reserve x,y for set;
reserve C,C9,D,E for non empty set;
reserve c,c9,c1,c2,c3 for Element of C;
reserve B,B9,B1,B2 for Element of Fin C;
reserve A for Element of Fin C9;
reserve d,d1,d2,d3,d4,e for Element of D;
reserve F,G for BinOp of D;
reserve u for UnOp of D;
reserve f,f9 for Function of C,D;
reserve g for Function of C9,D;
reserve H for BinOp of E;
reserve h for Function of D,E;
reserve i,j for Nat;
reserve s for Function;
reserve p,q for FinSequence of D;
reserve T1,T2 for Element of i-tuples_on D;

theorem Th2:
  F is commutative associative & (B <> {} or F is having_a_unity) &
  not c in B implies F $$(B \/ {.c.}, f) = F.(F $$(B,f),f.c)
proof
  assume that
A1: F is commutative associative and
A2: B <> {} or F is having_a_unity and
A3: not c in B;
  per cases;
  suppose
A4: B = {};
    then B = {}.C;
    then F $$(B,f) = the_unity_wrt F by A1,A2,SETWISEO:31;
    hence F.(F $$(B,f),f.c) = f.c by A2,A4,SETWISEO:15
      .= F $$(B \/ {.c.}, f) by A1,A4,SETWISEO:17;
  end;
  suppose
A5: B <> {};
    consider g9 being Function of Fin C, D such that
A6: F $$ (B,f) = g9.B and
    for e st e is_a_unity_wrt F holds g9.{} = e and
A7: for c9 holds g9.{c9} = f.c9 and
A8: for B9 st B9 c= B & B9 <> {} for c9 st c9 in B \ B9 holds g9.(B9
    \/ {c9}) = F.(g9.B9,f.c9) by A1,A2,SETWISEO:def 3;
    consider g being Function of Fin C, D such that
A9: F $$ (B \/ {.c.},f) = g.(B \/ {c}) and
    for e st e is_a_unity_wrt F holds g.{} = e and
A10: for c9 holds g.{c9} = f.c9 and
A11: for B9 st B9 c= B \/ {c} & B9 <> {} for c9 st c9 in (B \/ {c}) \
    B9 holds g.(B9 \/ {c9}) = F.(g.B9,f.c9) by A1,SETWISEO:def 3;
    defpred X[set] means $1 <> {} & $1 c= B implies g.($1) = g9.($1);
A12: for B9 being Element of Fin C, b being Element of C holds X[B9] & not
    b in B9 implies X[B9 \/ {b}]
    proof
A13:  B c= B \/ {c} by XBOOLE_1:7;
      let B9, c9 such that
A14:  B9 <> {} & B9 c= B implies g.B9 = g9.B9 and
A15:  not c9 in B9 and
      B9 \/ {c9} <> {} and
A16:  B9 \/ {c9} c= B;
A17:  c9 in B by A16,ZFMISC_1:137;
      then
A18:  c9 in B \ B9 by A15,XBOOLE_0:def 5;
      c9 in (B \/ {c}) by A17,XBOOLE_0:def 3;
      then
A19:  c9 in (B \/ {c}) \ B9 by A15,XBOOLE_0:def 5;
      B9 c= B by A16,XBOOLE_1:11;
      then
A20:  B9 c= B \/ {c} by A13,XBOOLE_1:1;
      per cases;
      suppose
A21:    B9 = {};
        then g.(B9 \/ {c9}) = f.c9 by A10;
        hence thesis by A7,A21;
      end;
      suppose
A22:    B9 <> {};
        hence g.(B9 \/ {c9}) = F.(g9.B9, f.c9) by A11,A14,A16,A20,A19,
XBOOLE_1:11
          .= g9.(B9 \/ {c9}) by A8,A16,A18,A22,XBOOLE_1:11;
      end;
    end;
A23: X[{}.C];
A24: for B9 holds X[B9] from SETWISEO:sch 2(A23,A12);
    c in B \/ {c} by ZFMISC_1:136;
    then c in (B \/ {c}) \ B by A3,XBOOLE_0:def 5;
    hence F $$(B \/ {.c.}, f) = F.(g.B, f.c) by A5,A9,A11,XBOOLE_1:7
      .= F.(F $$(B,f),f.c) by A5,A6,A24;
  end;
end;
