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 Th115:
  M is commutative associative &
  A is having_a_unity commutative associative
implies
  for E be Enumeration of F, p be Permutation of dom E st
    M is having_a_unity or len E >= 1
  for CE,CEp be non-empty non empty FinSequence of D* st
    CE = SignGenOp(f,A,F) * E & CEp=SignGenOp(f,A,F) * (E*p)
  for S be Element of Fin dom App CE,
      Sp be Element of Fin dom App CEp st
    Sp = {s*p where s is FinSequence of NAT: s in S}
  holds
   A$$(S, M "**" App CE) = A$$(Sp,M "**" App CEp)
proof
  assume that
A1: M is commutative associative and
A2: A is having_a_unity commutative associative;
  let E be Enumeration of F,p be Permutation of dom E such that
A3: M is having_a_unity or len E>=1;
 let CE,CEp be non-empty non empty FinSequence of D* such that
A4: CE = SignGenOp(f,A,F) * E & CEp=SignGenOp(f,A,F) * (E*p);
 defpred P[set] means for S be Element of Fin dom App CE,
   Sp be Element of Fin dom App CEp st S=$1 &
   Sp = {s*p where s is FinSequence of NAT: s in S}
   holds A $$ (S,M "**" App CE) = A $$ (Sp,M "**" App CEp);
A5: dom p = dom E = rng p by FUNCT_2:52,def 3;
A6: P[{}.dom App CE]
  proof
    let S be Element of Fin dom App CE, Sp be Element of Fin dom App CEp
      such that
A7:   S={}.dom App CE & Sp = {s*p where s is FinSequence of NAT: s in S};
    Sp={}
    proof
      assume Sp<>{};
      then consider x such that
A8:     x in Sp by XBOOLE_0:def 1;
      ex s be FinSequence of NAT st x= s*p & s in S by A8,A7;
      hence thesis by A7;
    end;
    then Sp = {}.dom App CEp;
    then A $$ (Sp,M "**" App CEp) = the_unity_wrt A by A2,SETWISEO:31
    .= A $$ (S,M "**" App CE) by A7,A2,SETWISEO:31;
    hence thesis;
  end;
A9: for B9 being (Element of Fin dom App CE), b being Element of dom App CE
    holds P[B9] & not b in B9 implies P[B9 \/ {b}]
  proof
    let B9 be Element of Fin dom App CE, b be Element of dom App CE such that
A10:  P[B9] & not b in B9;
    let S1 be Element of Fin dom App CE,
        S2 be Element of Fin dom App CEp such that
A11:  S1=B9 \/ {b} & S2 = {s*p where s is FinSequence of NAT: s in S1};
    set B2 = {s*p where s is FinSequence of NAT: s in B9};
    reconsider B2 as Element of Fin dom App CEp by A4,Th113;
A12:  len b = len CE = len E by Th47,A4,CARD_1:def 7;
    then
A13:  dom E = dom b by FINSEQ_3:30;
    b in doms CE;
    then reconsider c =b as FinSequence of NAT by FINSEQ_1:def 11;
A14:  B2 c= S2
    proof
      let y such that
A15:    y in B2;
      consider s be FinSequence of NAT such that
A16:    y=s*p & s in B9 by A15;
      s in S1 by A16,A11,XBOOLE_0:def 3;
      hence thesis by A16,A11;
    end;
    c in S1 by A11,ZFMISC_1:136;
    then
A17:  c*p in S2 by A11;
    then
A18:  {c*p} c= S2 by ZFMISC_1:31;
    S2 c= dom App CEp by FINSUB_1:def 5;
    then reconsider cp = c*p as Element of dom App CEp by A17;
A19:  not cp in B2
    proof
      assume cp in B2;
      then consider s be FinSequence of NAT such that
A20:    cp =s*p & s in B9;
      B9 c= dom App CE by FINSUB_1:def 5;
      then s in dom App CE by A20;
      then len s = len CE by Th47;
      then
A21:    dom E = dom s by A12,FINSEQ_3:30;
A22:    p*p" = id (rng p) by FUNCT_1:39;
      (c*p)*p" = s*(p*p") by A20,RELAT_1:36;
      then c*(p*p") = s*(p*p") by RELAT_1:36;
      then c*(p*p") = s by A22,A5,A21,RELAT_1:52;
      hence thesis by A20,A10,A22,A5,A13,RELAT_1:52;
    end;
    S2 c= B2 \/{b*p}
    proof
      let y such that
A23:    y in S2;
      consider s be FinSequence of NAT such that
A24:    y = s*p & s in S1 by A23,A11;
      s in B9 or s=c by A11,A24,ZFMISC_1:136;
      then y in B2 or y in {b*p} by A24,ZFMISC_1:31;
      hence thesis by XBOOLE_0:def 3;
    end;
    then
A25:  B2 \/{cp} = S2 by A18,A14,XBOOLE_1:8;
    (M "**" App CE).c = (M "**" App CEp).cp by Th112,A1,A4,A12,A3;
    hence A $$ ( S1, M "**" App CE)
     = A.(A $$ ( B9, M "**" App CE), (M "**" App CEp).cp)
       by A2,A10,A11,SETWOP_2:2
    .= A.(A $$ ( B2, M "**" App CEp), (M "**" App CEp).cp) by A10
    .= A $$ ( S2, M "**" App CEp) by A25,A2,A19,SETWOP_2:2;
  end;
  for B being Element of Fin dom App CE  holds
  P[B] from SETWISEO:sch 2(A6,A9);
  hence thesis;
end;
