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 Th27:
  F is commutative & F is associative & F is idempotent implies
  for Z being non empty set for G being BinOp of Z st G is commutative & G is
associative & G is idempotent for f being Function of X, Y for g being Function
  of Y,Z st for x,y being Element of Y holds g.(F.(x,y)) = G.(g.x,g.y) for B
  being Element of Fin X st B <> {} holds g.(F$$(B,f)) = G$$(B,g*f)
proof
  assume that
A1: F is commutative & F is associative and
A2: F is idempotent;
  let Z be non empty set, G be BinOp of Z such that
A3: G is commutative & G is associative and
A4: G is idempotent;
  let f be Function of X,Y;
  let g be Function of Y,Z such that
A5: for x,y being Element of Y holds g.(F.(x, y)) = G.(g.x, g.y);
  defpred X[Element of Fin X] means $1 <> {} implies g.(F$$($1,f)) = G$$($1,g*
  f);
A6: 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;
    assume that
A7: B <> {} implies g.(F$$(B,f)) = G$$(B,g*f) and
    B \/ {x} <> {};
    per cases;
    suppose
A8:   B = {};
      hence g.(F$$(B \/ {.x.},f)) = g.(f.x) by A1,Th14
        .= (g*f).x by FUNCT_2:15
        .= G$$(B \/ {.x.},g*f) by A3,A8,Th14;
    end;
    suppose
A9:   B <> {};
      hence g.(F$$(B \/ {.x.},f)) = g.(F.(F$$(B,f), f.x)) by A1,A2,Th17
        .= G.(g.(F$$(B,f)), g.(f.x)) by A5
        .= G.(G$$(B,g*f), (g*f).x) by A7,A9,FUNCT_2:15
        .= G$$(B \/ {.x.},g*f) by A3,A4,A9,Th17;
    end;
  end;
A10: X[{}.X];
  thus for B being Element of Fin X holds X[B] from FinSubInd3(A10,A6 );
end;
