
theorem Th1:
  for D being non empty set, S being non empty Subset of D, f being
BinOp of D, g being BinOp of S st g = f||S holds (f is commutative implies g is
  commutative) & (f is idempotent implies g is idempotent) & (f is associative
  implies g is associative)
proof
  let D be non empty set, S be non empty Subset of D;
  let f be BinOp of D, g be BinOp of S;
A1: dom g = [:S,S:] by FUNCT_2:def 1;
  assume
A2: g = f||S;
  thus f is commutative implies g is commutative
  proof
    assume
A3: for a,b being Element of D holds f.(a,b) = f.(b,a);
    let a,b be Element of S qua non empty set;
    reconsider a9 = a, b9 = b as Element of S;
    reconsider a9, b9 as Element of D;
    thus g.(a,b) = f.[a,b] by A2,A1,FUNCT_1:47
      .= f.(a9,b9)
      .= f.(b9,a9) by A3
      .= g.[b,a] by A2,A1,FUNCT_1:47
      .= g.(b,a);
  end;
  thus f is idempotent implies g is idempotent
  proof
    assume
A4: for a being Element of D holds f.(a,a) = a;
    let a be Element of S;
    thus g.(a,a) = f.[a,a] by A2,A1,FUNCT_1:47
      .= f.(a,a)
      .= a by A4;
  end;
  assume
A5: for a,b,c being Element of D holds f.(f.(a,b),c) = f.(a,f.(b,c));
  let a,b,c be Element of S qua non empty set;
  reconsider a9 = a, b9 = b, c9 = c as Element of S;
  reconsider a9, b9, c9 as Element of D;
  thus g.(g.(a,b),c) = f.[g.(a,b),c] by A2,A1,FUNCT_1:47
    .= f.[f.[a,b],c] by A2,A1,FUNCT_1:47
    .= f.(f.(a,b),c)
    .= f.(a9,f.(b9,c9)) by A5
    .= f.(a,g.[b,c]) by A2,A1,FUNCT_1:47
    .= f.[a,g.(b,c)]
    .= g.(a,g.(b,c)) by A2,A1,FUNCT_1:47;
end;
