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 Th18:
  F is idempotent & F is commutative & F is associative implies
for B1,B2 being Element of Fin X st B1 <> {} & B2 <> {} holds F $$ (B1 \/ B2,f)
  = F.(F $$ (B1,f),F $$ (B2,f))
proof
  assume that
A1: F is idempotent and
A2: F is commutative and
A3: F is associative;
  let B1,B2 be Element of Fin X;
  defpred X[Element of Fin X] means $1 <> {} implies F $$ (B1 \/ $1,f) = F.(F
  $$ (B1,f),F $$ ($1,f));
  assume
A4: B1 <> {};
A5: for B9 being Element of Fin X, b being Element of X holds X[B9] implies
  X[B9 \/ {.b.}]
  proof
    let B be (Element of Fin X), x be Element of X such that
A6: B <> {} implies F $$ (B1 \/ B,f) = F.(F $$ (B1,f),F $$ (B,f)) and
    B \/ {x} <> {};
    per cases;
    suppose
A7:   B = {};
      hence
      F $$ (B1 \/ (B \/ {.x.}),f) = F.(F $$ (B1,f), f.x) by A1,A2,A3,A4,Th17
        .= F.(F $$ (B1,f),F $$ (B \/ {.x.},f)) by A2,A3,A7,Th14;
    end;
    suppose
A8:   B <> {};
      thus F $$ (B1 \/ (B \/ {.x.}),f) = F $$ (B1 \/ B \/ {.x.},f) by
XBOOLE_1:4
        .= F.(F.(F $$ (B1,f),F $$ (B,f)), f.x) by A1,A2,A3,A6,A8,Th17
        .= F.(F $$ (B1,f),F.(F $$ (B,f), f.x)) by A3
        .= F.(F $$ (B1,f),F $$ (B \/ {.x.},f)) by A1,A2,A3,A8,Th17;
    end;
  end;
A9: X[{}.X];
  for B2 being Element of Fin X holds X[B2] from FinSubInd3(A9,A5);
  hence thesis;
end;
