reserve i,j,n,k,m for Nat,
     a,b,x,y,z for object,
     F,G for FinSequence-yielding FinSequence,
     f,g,p,q for FinSequence,
     X,Y for set,
     D for non empty set;
reserve
  B,A,M for BinOp of D,
  F,G for D* -valued FinSequence,
  f for FinSequence of D,
  d,d1,d2 for Element of D;
reserve
  F,G for non-empty non empty FinSequence of D*,
  f for non empty FinSequence of D;
reserve f,g for FinSequence of D,
        a,b,c for set,
        F,F1,F2 for finite set;

theorem
   for E be Enumeration of F st union F c= Seg (1+len f)
      for Ee be Enumeration of Ext(F,1+len f,2+len f) st
          Ee = Ext(E,1+len f,2+len f)
       for CE1,CEE be FinSequence of D* st
          CE1 = SignGenOp(f^<*d*>,A,F) * E &
          CEE = SignGenOp(f^<*d1*>^<*d2*>,A,Ext(F,1+len f,2+len f)) * Ee
       for s be FinSequence st s in doms CE1 & rng s c= dom f holds
           s in doms CEE & (App CE1).s = (App CEE).s
proof
  set I=the_inverseOp_wrt A;
  let E be Enumeration of F such that
A1:union F c= Seg (1+len f);
  set EF=Ext(F,1+len f,2+len f);
  let Ee be Enumeration of EF such that
A2: Ee = Ext(E,1+len f,2+len f);
  let CE1,CEE be FinSequence of D* such that
A3: CE1 = SignGenOp(f^<*d*>,A,F) * E &
  CEE = SignGenOp(f^<*d1*>^<*d2*>,A,EF) * Ee;
  let s be FinSequence such that
A4: s in doms CE1 & rng s c= dom f;
A5: 1+len f < 1+len f+1  by NAT_1:13;
  then
A6: not 2+len f in union F by A1,FINSEQ_1:1;
A7: len (f^<*d1*>^<*d2*>) = len (f^<*d1*>)+1 by FINSEQ_2:16
  .=len f+1+1 by FINSEQ_2:16;
  len (f^<*d*>) = len f+1  by FINSEQ_2:16;
  then
A8: doms CE1 c= doms CEE by A3,A5,A6,A7, Th10,Th107;
  hence  s in doms CEE by A4;
A9:len E= len CE1 = len s = len CEE  by A3,A8,Th47,A4,CARD_1:def 7;
A10:len ((App CEE).s) = len s = len ((App CE1).s) by A8,A4,Def9;
  for i st 1<= i <= len s holds ((App CE1).s).i = ((App CEE).s).i
  proof
    let i such that
A11: 1<= i <= len s;
    reconsider si=s.i as Nat by A4;
A12: i in dom CE1 & i in dom CEE & i in dom E & i in dom s
    by A11,A9,FINSEQ_3:25;
    then
A13: ((App CE1).s).i = CE1.i.si & CE1.i = SignGen(f^<*d*>,A,E.i) &
    ((App CEE).s).i = CEE.i.si & CEE.i = SignGen(f^<*d1*>^<*d2*>,A,Ee.i)
    by A3,A4,A8,Def9,Th80;
A14: si in rng s by A12,FUNCT_1:def 3;
    then
A15:  si <= len f < len f+2 by A4,FINSEQ_3:25,NAT_1:16;
    dom f c= dom (f^<*d*>) by FINSEQ_1:26;
    then si in dom (f^<*d*>) by A14,A4;
    then
A16:si in dom SignGen(f^<*d*>,A,E.i) by Def11;
A17: f^<*d1*>^<*d2*> = f^<*d1,d2*> by FINSEQ_1:32;
    dom f c= dom (f^<*d1,d2*>) by FINSEQ_1:26;
    then si in dom (f^<*d1*>^<*d2*>) by A14,A4,A17;
    then
A18:si in dom SignGen(f^<*d1*>^<*d2*>,A,Ee.i) by Def11;
    per cases;
    suppose
A19:  si in E.i;
      then
A20:  SignGen(f^<*d*>,A,E.i).si = I.((f^<*d*>).si) by A16,Def11
      .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
      per cases;
      suppose 1+len f in E.i;
        then Ee.i = (E.i)\/{2+len f} by A2,A12,Def5;
        then si in Ee.i by A19,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        I.((f^<*d1,d2*>).si) by A17,A18,Def11
        .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
        hence thesis by A20,A13;
      end;
      suppose not 1+len f in E.i;
        then si in Ee.i by A19,A2,A12,Def5;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        I.((f^<*d1,d2*>).si) by A17,A18,Def11
        .= I.(f.si) by A14,A4,FINSEQ_1:def 7;
        hence thesis by A20,A13;
      end;
    end;
    suppose
A21:  not si in E.i;
      then
A22:  SignGen(f^<*d*>,A,E.i).si = (f^<*d*>).si by A16,Def11
      .= f.si by A14,A4,FINSEQ_1:def 7;
      per cases;
      suppose 1+len f in E.i;
        then Ee.i = (E.i)\/{2+len f} by A2,A12,Def5;
        then not si in Ee.i by A15,A21,ZFMISC_1:136;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        (f^<*d1,d2*>).si by A17,A18,Def11
        .= f.si by A14,A4,FINSEQ_1:def 7;
        hence thesis by A22,A13;
      end;
      suppose not 1+len f in E.i;
        then not si in Ee.i by A21,A2,A12,Def5;
        then SignGen(f^<*d1*>^<*d2*>,A,Ee.i).si =
        (f^<*d1,d2*>).si by A17,A18,Def11
        .= f.si by A14,A4,FINSEQ_1:def 7;
        hence thesis by A22,A13;
      end;
    end;
  end;
  hence thesis by A10;
end;
