reserve x,y,z,X,Y for set;
reserve X,Y for non empty set,
  f for Function of X,Y;
reserve X, Y for non empty set,
  F for (BinOp of Y),
  B for (Element of Fin X),
  f for Function of X,Y;

theorem Th17:
  F is idempotent & F is commutative & F is associative & B <> {}
implies for x being Element of X holds F $$(B \/ {.x.}, f) = F.(F $$(B,f),f.x)
proof
  assume
A1: F is idempotent & F is commutative & F is associative;
  assume
A2: B <> {};
  then consider G9 being Function of Fin X, Y such that
A3: F $$ (B,f) = G9.B and
  for e being Element of Y st e is_a_unity_wrt F holds G9.{} = e and
A4: for x being Element of X holds G9.{x} = f.x and
A5: for B9 being Element of Fin X st B9 c= B & B9 <> {} for x being
  Element of X st x in B holds G9.(B9 \/ {x}) = F.(G9.B9,f.x) by A1,Th13;
  let x be Element of X;
  consider G being Function of Fin X, Y such that
A6: F $$ (B \/ {.x.},f) = G.(B \/ {.x.}) and
  for e being Element of Y st e is_a_unity_wrt F holds G.{} = e and
A7: for x being Element of X holds G.{x} = f.x and
A8: for B9 being Element of Fin X st B9 c= B \/ {x} & B9 <> {} for x9
being Element of X st x9 in B \/ {x} holds G.(B9 \/ {x9}) = F.(G.B9,f.x9) by A1
,Th13;
  defpred X[set] means $1 <> {} & $1 c= B implies G.$1 = G9.$1;
A9: for B9 being Element of Fin X, b being Element of X holds X[B9] implies
  X[B9 \/ {b}]
  proof
A10: B c= B \/ {x} by XBOOLE_1:7;
    let C be (Element of Fin X), y be Element of X such that
A11: C <> {} & C c= B implies G.C = G9.C;
    assume that
    C \/ {y} <> {} and
A12: C \/ {y} c= B;
A13: C c= B & y in B by A12,ZFMISC_1:137;
    per cases;
    suppose
A14:  C = {};
      hence G.(C \/ {y}) = f.y by A7
        .= G9.(C \/ {y}) by A4,A14;
    end;
    suppose
A15:  C <> {};
      hence G.(C \/ {y}) = F.(G9.C, f.y) by A8,A11,A13,A10,XBOOLE_1:1
        .= G9.(C \/ {y}) by A5,A13,A15;
    end;
  end;
A16: X[{}.X];
A17: for C being Element of Fin X holds X[C] from FinSubInd3(A16,A9);
  x in B \/ {x} by ZFMISC_1:136;
  hence F $$(B \/ {.x.}, f) = F.(G.B, f.x) by A2,A6,A8,XBOOLE_1:7
    .= F.(F $$(B,f),f.x) by A2,A3,A17;
end;
