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 Th99:
  for E1 be Enumeration of F1
    for g be Function st
       union F1 c= dom g & g is one-to-one
       for gE1 be Enumeration of .:g.:F1 st gE1 = (.:g)*E1
    for fg be FinSequence of D st fg = (f*g") | dom fg & g.:dom f c= dom fg
    for s be FinSequence st s in doms (SignGenOp(f,A,F1) * E1) & rng s c= dom g
       holds
(App (SignGenOp(f,A,F1) * E1)).s
        = (App (SignGenOp(fg,A,.:g.:F1) * gE1)).(g*s)
proof
  let E1 be Enumeration of F1;
  let g be Function such that
A1:       union F1 c= dom g & g is one-to-one;
  let gE1 be Enumeration of .:g.:F1 such that
A2: gE1 = (.:g)*E1;
A3: g|union F1 is one-to-one by A1,FUNCT_1:52;
  then
A4:len (SignGenOp(f,A,F1) * E1)= len E1=len gE1 =
    len (SignGenOp(f,A,.:g.:F1) * gE1) by A1,A2,Th97,CARD_1:def 7;
  let gf be FinSequence of D such that
A5:  gf = (f*g") | dom gf and
A6: g.:dom f c= dom gf;
  let s be FinSequence such that
A7: s in doms (SignGenOp(f,A,F1) * E1)
  and
A8: rng s c= dom g;
  dom (g*s) = dom s = Seg len s by A8,RELAT_1:27,FINSEQ_1:def 3;
  then reconsider gs=g*s as FinSequence by FINSEQ_1:def 2;
A9: dom (g*s) = dom s = Seg len s by A8,RELAT_1:27,FINSEQ_1:def 3;
  then reconsider gs=g*s as FinSequence by FINSEQ_1:def 2;
A10: len gs = len s = len (SignGenOp(f,A,.:g.:F1) * gE1)
  by A9,FINSEQ_3:29,Th47,A4,A7;
A11: gs in doms (SignGenOp(gf,A,.:g.:F1) * gE1) by A2,A1,A3,A6,Th98,A8,A7;
  len s = len  (SignGenOp(f,A,F1) * E1) by A7,Th47;
  then
A12: dom s = dom (SignGenOp(f,A,F1) * E1) by FINSEQ_3:30;
A13: gs =g*s & gs in doms (SignGenOp(gf,A,.:g.:F1) * gE1)
  by A2,A1,A3,A6,Th98,A8,A7;
A14: len ((App (SignGenOp(f,A,F1) * E1)).s) = len s by Def9,A7;
  for i st 1<=i & i <= len s holds
  ((App (SignGenOp(f,A,F1) * E1)).s).i =
  ((App (SignGenOp(gf,A,.:g.:F1) * gE1)).gs).i
  proof
    let i such that
A15: 1<=i & i <= len s;
A16:i in dom s by A15,FINSEQ_3:25;
A17: s.i in rng s by A16,FUNCT_1:def 3;
A18: gs.i = g.(s.i) & i in dom gs by A17,A8,A16,FUNCT_1:11,13;
    len gs = len (SignGenOp(gf,A,.:g.:F1) * gE1) by A13,Th47;
    then
A19: dom gs = dom (SignGenOp(gf,A,.:g.:F1) * gE1) by FINSEQ_3:30;
    then
A20: (SignGenOp(gf,A,.:g.:F1) * gE1).i = SignGen(gf,A,gE1.i)
    by A17,A8,A16,FUNCT_1:11,Th80;
A21:(SignGenOp(f,A,F1) * E1).i = SignGen(f,A,E1.i)
      by A15,FINSEQ_3:25,A12,Th80;
A22: i in dom gs by A17,A8,A16,FUNCT_1:11;
A23: ((App (SignGenOp(f,A,F1) * E1)).s).i
    = (SignGenOp(f,A,F1) * E1).i.(s.i) by A7,A16,Def9
    .= SignGen(f,A,E1.i) .(s.i) by A15,FINSEQ_3:25,A12,Th80;
A24: ((App (SignGenOp(gf,A,.:g.:F1) * gE1)).gs).i
    = (SignGenOp(gf,A,.:g.:F1) * gE1).i.(gs.i)
    by A17,A8,A16,FUNCT_1:11,Def9,A13
    .= SignGen(gf,A,gE1.i).(gs.i) by A19,A17,A8,A16,FUNCT_1:11,Th80;
A25: s.i in dom SignGen(f,A,E1.i) by A21,A7,A16,Th47;
A26: gs.i in dom SignGen(gf,A,gE1.i) by A20,A22,A13,Th47;
A27:dom SignGen(gf,A,gE1.i) = dom gf by Def11;
A28: i in dom E1 by A12,A16,FUNCT_1:11;
    then E1.i in rng E1 =F1 by RLAFFIN3:def 1,FUNCT_1:def 3;
    then E1.i c= union F1 by ZFMISC_1:74;
    then
A29: E1.i c= dom g by A1;
    then E1.i in bool dom g;
    then
A30:E1.i in dom (.:g) by FUNCT_3:def 1;
    gE1.i = (.:g).(E1.i) by A28,A2,A30,FUNCT_1:11,12;
    then
A31: gE1.i = g.:(E1.i) by A29,FUNCT_3:def 1;
    gs.i in dom (f*g") & gf.(gs.i) = (f*g").(gs.i)
    by A26,A27,FUNCT_1:47,RELAT_1:57,A5;
    then
A32: gf.(gs.i) = f.((g").(gs.i)) by FUNCT_1:12
    .= f.(s.i) by A1,A17,A8,A18,FUNCT_1:34;
    per cases;
    suppose
A33: s.i in E1.i;
      then
A34: SignGen(f,A,E1.i) .(s.i) = (the_inverseOp_wrt A).(f.(s.i)) by A25,Def11;
      gs.i in gE1.i by A31,A17,A8,A33,A18,FUNCT_1:def 6;
      hence thesis by A23,A24,A34,A32,A26,Def11;
    end;
    suppose
A35:  not s.i in E1.i;
      then
A36:  SignGen(f,A,E1.i) .(s.i) = f.(s.i) by A25, Def11;
      not gs.i in gE1.i
      proof
        assume gs.i in gE1.i;
        then ex x st x in dom g & x in E1.i & gs.i = g.x by A31,FUNCT_1:def 6;
        hence thesis by A35,A17,A8,A18,A1;
      end;
      hence thesis by A23,A24,A36,A32,A26,Def11;
    end;
  end;
  hence thesis by A10,Def9,A11,A14;
end;
