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 Th141:
  M is commutative associative &
  A is commutative associative having_a_unity having_an_inverseOp &
  M is_distributive_wrt A
implies
  for E be Enumeration of bool {2}
    for CE be non-empty non empty FinSequence of D* st
      CE = SignGenOp(f,A,bool {2}) * E & len f = 2
      ex S be Element of Fin dom App CE st S = { <*1,1*>, <*2,2*>} &
        SignGenOp(f,M,A,{2}) = A $$ (S,M "**" App CE)
proof
  assume that
A1: M is commutative associative and
A2: A is commutative associative having_a_unity having_an_inverseOp and
A3: M is_distributive_wrt A;
  let E be Enumeration of bool {2};
  let CE be non-empty non empty FinSequence of D* such that
A4: CE = SignGenOp(f,A,bool {2}) * E & len f = 2;
  set C = SignGenOp(f,A,bool {2});
  set I=the_inverseOp_wrt A;
  1 in dom f & 2 in dom f by A4,FINSEQ_3:25;
  then f.1 in rng f & f.2 in rng f & rng f c= D by FUNCT_1:def 3;
  then reconsider f1=f.1,f2=f.2 as Element of D;
  M.(f1,A.(f1,I.f2)) = A.(M.(f1,f1),M.(f1,I.f2)) &
  M.(f2,A.(f1,I.f2)) = A.(M.(f2,f1),M.(f2,I.f2)) by A3,BINOP_1:11;
  then
A5: M.(A.(f1,f2),A.(f1,I.f2)) =
  A.(A.(M.(f1,f1),M.(f1,I.f2)),A.(M.(f2,f1),M.(f2,I.f2)))
      by A3,BINOP_1:def 10,def 11
    .= A.(M.(f1,f1),A.(M.(f1,I.f2),A.(M.(f2,f1),M.(f2,I.f2))))
      by A2,BINOP_1:def 3
    .= A.(M.(f1,f1),A.(A.(M.(f1,I.f2),M.(f2,f1)),M.(f2,I.f2)))
      by A2,BINOP_1:def 3
    .= A.(M.(f1,f1),A.(A.(I.(M.(f1,f2)),M.(f2,f1)),M.(f2,I.f2)))
      by A3,A2,FINSEQOP:67
    .= A.(M.(f1,f1),A.( A. (I.(M.(f1,f2)),M.(f1,f2)),M.(f2,I.f2)))
      by A1,BINOP_1:def 2
    .= A.(M.(f1,f1),A.(the_unity_wrt A, M.(f2,I.f2))) by A2,FINSEQOP:59
    .= A.(M.(f1,f1),M.(f2,I.f2)) by A2,SETWISEO:15;
A6:bool {2} = { {}, {2}} by ZFMISC_1:24;
  then card bool {2}= 2 by CARD_2:57;
  then
A7: len (CE)= len E = len f by A4,CARD_1:def 7;
A8: 1 in dom CE & 1 in dom E & 2 in dom CE & 2 in dom E by A7,A4,FINSEQ_3:25;
  then
A9: CE.1 = C.(E.1) & E.1 in rng E & CE.2 = C.(E.2) & E.2 in rng E
    by A4,FUNCT_1:12,def 3;
  then
A10: CE.1 = SignGen(f,A,E.1) & CE.2 = SignGen(f,A,E.2) by Def12;
  then
A11: len (CE.1) = len f & len (CE.2) = len f by CARD_1:def 7;
A12: { <*1,1*>, <*2,2*>} c= doms CE
  proof
    let x be object;
    assume
A13: x in { <*1,1*>, <*2,2*>};
    then
A14: x = <*1,1*> or x= <*2,2*> by TARSKI:def 2;
    reconsider x as FinSequence by A13;
A15: len x = 2 by A14,FINSEQ_1:44;
    for i st i in dom x holds x.i in dom (CE.i)
    proof
      let i such that
A16:    i in dom x;
A17:    1<=i <=2  by A16,A15,FINSEQ_3:25;
      then i<2 or i=2 by XXREAL_0:1;
      then
A18:    i=1 or i=2 by A17,NAT_1:23;
      then x.i = 1 or x.i=2 by A14;
      hence thesis by A18,A11,A4,FINSEQ_3:25;
    end;
    hence thesis by A15,A4,A7,Th47;
  end;
  then { <*1,1*>, <*2,2*>} c= dom App CE by Def9;
  then reconsider S = { <*1,1*>, <*2,2*>} as Element of Fin dom App CE
    by FINSUB_1:def 5;
  take S;
  thus S = { <*1,1*>, <*2,2*>};
A19: SignGenOp(f,M,A,{2}) = A.(M.(f1,f1), M.(f2,I.f2)) by A5,A4,A1,Th140;
  <*1,1*> in { <*1,1*>, <*2,2*>} & <*2,2*> in { <*1,1*>, <*2,2*>}
     by TARSKI:def 2;
  then reconsider s1=<*1,1*>,s2= <*2,2*> as Element of dom App CE by A12,Def9;
  s1.1=1 & s2.1=2;
  then
A20: s1 <>s2;
A21: A $$ (S,M "**" App CE)
    = A.((M "**" App CE).s1,(M "**" App CE).s2) by A20,A2,SETWOP_2:1
    .= A.(M "**" ((App CE).s1),(M "**" App CE).s2) by Def10
    .= A.(M "**" ((App CE).s1),M "**" ((App CE).s2)) by Def10;
A22: len ((App CE).s1) = len s1 =2 by Def9,CARD_1:def 7;
A23: len ((App CE).s2) = len s2 =2 by Def9,CARD_1:def 7;
A26: E.1 <> E.2 by A8, FUNCT_1:def 4;
  per cases by A6,A9,TARSKI:def 2;
  suppose
A27:  E.1={};
    then
A28:  E.2 ={2} by A26,A6,A9,TARSKI:def 2;
    for k st 1 <= k <= 2 holds ((App CE).s1).k = <* f1,f1*>.k
    proof
      let k such that
A29:    1 <= k <= 2;
A30:    k in dom s1 by A29,A22,FINSEQ_3:25;
      then
A31:    ((App CE).s1).k = CE.k.(s1.k) by Def9;
      k<2 or k=2 by A29,XXREAL_0:1;
      then per cases by A29,NAT_1:23;
      suppose
A32:      k=1;
        then CE.k.(s1.k) = f1 by A27,A10,Th71;
        hence thesis by A30,Def9,A32;
      end;
      suppose
A33:      k=2;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 1 in dom SignGen(f,A,{2}) & not 1 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        then SignGen(f,A,{2}).1 = f.1 by Def11;
        hence thesis by A31,A28,A10,A33;
      end;
    end;
    then (App CE).s1 = <* f1,f1*> by CARD_1:def 7,A22;
    then A34: M "**" ((App CE).s1) = M.(f1,f1) by FINSOP_1:12;
    for k st 1 <= k <= 2 holds ((App CE).s2).k = <* f2,I.f2*>.k
    proof
      let k such that
A35:    1 <= k <= 2;
      k in dom s2 by A35,A23,FINSEQ_3:25;
      then
A36:    ((App CE).s2).k = CE.k.(s2.k) by Def9;
      k<2 or k=2 by A35,XXREAL_0:1;
      then per cases by A35,NAT_1:23;
      suppose k=1;
        hence thesis by A36,Th71,A27,A10;
      end;
      suppose
A37:      k=2;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 2 in dom SignGen(f,A,{2}) & 2 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        then SignGen(f,A,{2}).2 = I.f2 by Def11;
        hence thesis by A36,A28,A10,A37;
      end;
    end;
    then (App CE).s2 = <* f2,I.f2*> by CARD_1:def 7,A23;
     hence thesis by A19,A21,A34,FINSOP_1:12;
  end;
  suppose
A38:  E.1={2};
    then
A39:  E.2 ={} by A26,A6,A9,TARSKI:def 2;
    for k st 1 <= k <= 2 holds ((App CE).s1).k = <* f1,f1*>.k
    proof
      let k such that
A40:    1 <= k <= 2;
      k in dom s1 by A40,A22,FINSEQ_3:25;
      then
A41:    ((App CE).s1).k = CE.k.(s1.k) by Def9;
      k<2 or k=2 by A40,XXREAL_0:1;
      then per cases by A40,NAT_1:23;
      suppose
A42:      k=2;
        then CE.k.(s1.k) = f1 by A39,A10,Th71;
        hence thesis by A41,A42;
      end;
      suppose
A43:      k=1;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 1 in dom SignGen(f,A,{2}) & not 1 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        hence thesis by A41,A38,A10,A43,Def11;
      end;
    end;
    then (App CE).s1 = <* f1,f1*> by CARD_1:def 7,A22;
    then
A44: M "**" ((App CE).s1) = M.(f1,f1) by FINSOP_1:12;
    for k st 1 <= k <= 2 holds ((App CE).s2).k = <* I.f2,f2*>.k
    proof
      let k such that
A45:    1 <= k <= 2;
      k in dom s2 by A45,A23,FINSEQ_3:25;
      then
A46:    ((App CE).s2).k = CE.k.(s2.k) by Def9;
      k<2 or k=2 by A45,XXREAL_0:1;
      then per cases by A45,NAT_1:23;
      suppose
A47:      k=2;
        then CE.k = SignGen(f,A,{}) by A38,A26,A6,A9,TARSKI:def 2,A10;
        then CE.k.(s2.k) = f2 by Th71,A47;
        hence thesis by A46,A47;
      end;
      suppose
A48:      k=1;
        len SignGen(f,A,{2}) = len f by CARD_1:def 7;
        then 2 in dom SignGen(f,A,{2}) & 2 in {2}
          by A4,FINSEQ_3:25,TARSKI:def 1;
        hence thesis by A46,A38,A10,A48,Def11;
      end;
    end;
    then
A49: (App CE).s2 = <* I.f2,f2*> by CARD_1:def 7,A23;
    A $$ (S,M "**" App CE)
      = A.(M.(f1,f1),M.(I.f2,f2)) by A21,A44,A49,FINSOP_1:12
      .= A.(M.(f1,f1),M.(f2,I.f2)) by A1,BINOP_1:def 2;
    hence thesis by A5,A4,A1,Th140;
  end;
end;
