reserve i,j,k,n,m for Nat,
        X for set,
        b,s for bag of X,
        x for object;
reserve O for Ordinal,
        R for right_zeroed add-associative right_complementable
          right_unital distributive non trivial doubleLoopStr,
        p for Polynomial of O, R;
reserve O for Ordinal,
        R for right_zeroed add-associative right_complementable
             right_unital distributive non trivial doubleLoopStr,
        p for Polynomial of O, R;

theorem Th59:
   for L be add-associative right_zeroed right_complementable
            well-unital distributive associative Abelian commutative
            non empty non trivial doubleLoopStr
   for n be Nat
     for f be FinSequence of L
       for xf be Function of n,L st xf = FS2XFS f
         for F be finite set
           for E be Enumeration of F
   for d be FinSequence st d in doms (SignGenOp(f,the addF of L,F) * E)
     holds
  (the multF of L) "**" ((App (SignGenOp(f,the addF of L,F) * E)).d) =
    eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)
proof
  let L be add-associative right_zeroed right_complementable
  well-unital distributive associative Abelian  commutative
  non empty non trivial doubleLoopStr;
  let n be Nat;
  let f be FinSequence of L;
  let xf be Function of n,L such that
A1:xf = FS2XFS f;
  set M=the multF of L, A=the addF of L;
  defpred P[Nat] means for F be finite set st card F=$1
  for E be Enumeration of F
  for d be FinSequence st d in doms (SignGenOp(f,A,F) * E) holds
  M "**" ((App (SignGenOp(f,A,F) * E)).d) =
  eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf);
A2: P[0]
  proof
    let F be finite set such that
A3: card F=0;
    let E be Enumeration of F;
    let d be FinSequence such that
A4: d in doms (SignGenOp(f,the addF of L,F) * E);
    len d = len (SignGenOp(f,A,F) * E) =len E = card F
    by A4,HILB10_7:47,CARD_1:def 7;
    then
A5:d = {} & SignGenOp(f,A,F) * E={} by A3;
    then
A6: M "**" ((App (SignGenOp(f,A,F) * E)).d)
    = the_unity_wrt the multF of L by FINSOP_1:def 1,HILB10_7:59
    .= 1_L by GROUP_1:22;
A7:SgnMembershipNumber(d,L,E) = 1.L by A5,Th56;
    count_reps(d,n) = EmptyBag n by A5,Th54;
    then eval(count_reps(d,n),xf) = 1.L by POLYNOM2:14;
    then eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)= 1.L * 1.L
    by A7,POLYNOM7:13
    .= 1.L;
    hence thesis by A6;
  end;
A8:P[i] implies P[i+1]
  proof
    assume
A9: P[i];
    let F be finite set such that
A10:  card F=i+1;
    let E be Enumeration of F;
    let d be FinSequence such that
A11:d in doms (SignGenOp(f,the addF of L,F) * E);
A12:len d = len (SignGenOp(f,A,F) * E) =len E = card F
    by A11,HILB10_7:47,CARD_1:def 7;
    set EE={E.len E}, Fi=F\EE;
    reconsider Ei = E|i as Enumeration of Fi by A12,A10,HILB10_7:96;
    reconsider Ee = <*E.len E*> as Enumeration of EE by A12,A10,HILB10_7:96;
    set di= d|i, D=<*d.(i+1)*>;
A13:len di = i & len Ei=i by A12,A10,NAT_1:11,FINSEQ_1:59;
A14: d = di ^ D by A10,A12,FINSEQ_3:55;
A15: len (SignGenOp(f,A,Fi) * Ei) = len Ei by CARD_1:def 7;
A16: F = Fi \/ EE by A12,A10,HILB10_7:96;
A17: E= Ei ^ Ee by A10,A12,FINSEQ_3:55;
    then
A18: SignGenOp(f,the addF of L,F) * E =
    (SignGenOp(f,A,Fi) * Ei)^(SignGenOp(f,A,EE) * Ee) by A16,HILB10_7:81;
    then
A19: di in doms (SignGenOp(f,A,Fi) * Ei) &
    D in doms (SignGenOp(f,A,EE) * Ee) by A11,A15,A13,A14,HILB10_7:50;
    then (App (SignGenOp(f,A,F) * E)).d =
    ((App (SignGenOp(f,A,Fi) * Ei)).di)^((App (SignGenOp(f,A,EE) * Ee)).D)
    by HILB10_7:61,A14,A18;
    then
A20: M "**" ((App (SignGenOp(f,A,F) * E)).d) =
    M.(M"**"((App (SignGenOp(f,A,Fi)*Ei)).di),
    M"**"((App (SignGenOp(f,A,EE)*Ee)).D)) by FINSOP_1:5;
A21: SignGenOp(f,A,EE) * Ee = <* SignGen(f,A,E.len E) *> by HILB10_7:78;
    then
A22: D.1 in dom SignGen(f,A,E.len E) by A19,HILB10_7:51;
    then
A23: SignGen(f,A,E.len E).(d.(i+1)) in rng SignGen(f,A,E.len E)
    by FUNCT_1:def 3;
A24: rng SignGen(f,A,E.len E) c= the carrier of L by FINSEQ_1:def 4;
    (App (SignGenOp(f,A,EE) * Ee)).D = <* SignGen(f,A,E.len E) . (d.(i+1))*>
    by A21,A22,HILB10_7:60;
    then
A25: M"**"((App (SignGenOp(f,A,EE) * Ee)).D)
    = SignGen(f,A,E.len E) . (d.(i+1)) by A24,A23,FINSOP_1:11;
A26: card Fi = i by A13,CARD_1:def 7;
    1<=1+i by NAT_1:11;
    then
A27: i+1 in dom d & i+1 in dom E by A10,A12,FINSEQ_3:25;
    then
A28: d.(i+1) in dom ((SignGenOp(f,A,F) * E).(i+1)) by HILB10_7:47,A11;
    then d.(i+1) in dom SignGen(f,A,E.(i+1)) by HILB10_7:80,A27;
    then
A29: d.(i+1) in dom f by HILB10_7:def 11;
    reconsider dd=d.(i+1) as Nat by A11;
    1<=dd by A28,FINSEQ_3:25;
    then reconsider dd1=dd-1 as Nat;
    len (FS2XFS f) = n by A1,FUNCT_2:def 1;
    then
A30: n = len f by AFINSQ_1:def 8;
    then
A31: dd1+1 <= n by A29,FINSEQ_3:25;
    then dd1 <n by NAT_1:13;
    then
A32: dd1 in Segm n by NAT_1:44;
A33: f.dd in rng f c= the carrier of L by FINSEQ_1:def 4,A29,FUNCT_1:def 3;
    then reconsider fdd=f.dd as Element of L;
A34: f.(dd1+1) = xf.dd1 by A1,A31,NAT_1:13,A30,AFINSQ_1:def 8;
A35: dd1+1 = dd;
A36: count_reps(d,n) = count_reps(di,n) + (EmptyBag n)+*(dd1,1)
    by A14,A35,Th55;
A37: eval((EmptyBag n)+*(dd1,1),xf) = power(L).(xf.dd1,1) by A32,Th14
    .= xf.dd1 by A33,A34,GROUP_1:50;
A38:  M "**" ((App (SignGenOp(f,A,F) * E)).d)
    = M.(eval(Monom(SgnMembershipNumber(di,L,Ei),count_reps(di,n)),xf),
    SignGen(f,A,E.len E) . dd) by A26,A25,A20,A9,A19
    .= M.(SgnMembershipNumber(di,L,Ei) *
    eval(count_reps(di,n),xf),SignGen(f,A,E.len E) . dd) by POLYNOM7:13;
    per cases;
    suppose
A39:  dd in E.len E;
      dd in dom SignGen(f,A,E.len E) by A29,HILB10_7:def 11;
      then SignGen(f,A,E.len E) . dd = (the_inverseOp_wrt A).fdd
      by A39,HILB10_7:def 11
      .= (comp L) .fdd by FVSUM_1:15
      .= -fdd by VECTSP_1:def 13;
      hence M "**" ((App (SignGenOp(f,A,F) * E)).d)
      = SgnMembershipNumber(di,L,Ei) * eval(count_reps(di,n),xf) *(-fdd)
      by A38
      .= SgnMembershipNumber(di,L,Ei) * (eval(count_reps(di,n),xf) * (-fdd))
      by GROUP_1:def 3
      .= SgnMembershipNumber(di,L,Ei) * (-(eval(count_reps(di,n),xf) * fdd))
      by VECTSP_1:8
      .= SgnMembershipNumber(di,L,Ei) * (-eval(count_reps(d,n),xf))
      by A36,POLYNOM2:16,A37,A34
      .= -(SgnMembershipNumber(di,L,Ei) * eval(count_reps(d,n),xf))
      by VECTSP_1:8
      .= (-SgnMembershipNumber(di,L,Ei)) * eval(count_reps(d,n),xf)
      by VECTSP_1:8
      .= SgnMembershipNumber(d,L,E) * eval(count_reps(d,n),xf)
      by A13,A39,Th58,A14,A17
      .= eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)
      by POLYNOM7:13;
    end;
    suppose
A40:  not dd in E.len E;
      dd in dom SignGen(f,A,E.len E) by A29,HILB10_7:def 11;
      hence M "**" ((App (SignGenOp(f,A,F) * E)).d) =
      SgnMembershipNumber(di,L,Ei) * eval(count_reps(di,n),xf) *fdd
      by A38,A40,HILB10_7:def 11
      .= SgnMembershipNumber(di,L,Ei) * (eval(count_reps(di,n),xf) * fdd)
      by GROUP_1:def 3
      .= SgnMembershipNumber(di,L,Ei) * eval(count_reps(d,n),xf)
      by A36,POLYNOM2:16,A37,A34
      .= SgnMembershipNumber(d,L,E) * eval(count_reps(d,n),xf)
      by A13,A40,Th57,A14,A17
      .= eval(Monom(SgnMembershipNumber(d,L,E),count_reps(d,n)),xf)
      by POLYNOM7:13;
    end;
  end;
  P[i] from NAT_1:sch 2(A2,A8);
  hence thesis;
end;
