reserve x,y,y1,y2,z,a,b for object, X,Y,Z,V1,V2 for set,
  f,g,h,h9,f1,f2 for Function,
  i for Nat,
  P for Permutation of X,
  D,D1,D2,D3 for non empty set,
  d1 for Element of D1,
  d2 for Element of D2,
  d3 for Element of D3;

theorem
  for A,B,C be set, f be Function st A <> {} & B <> {} & f in Funcs(A,
  Funcs(B,C)) holds commute commute f = f
proof
  let A,B,C be set, f be Function;
  assume that
A1: A <> {} & B <> {} and
A2: f in Funcs(A,Funcs(B,C));
A3: ex g be Function st g = f & dom g = A & rng g c= Funcs(B,C) by A2,
FUNCT_2:def 2;
  set cf = commute f;
A4: commute f in Funcs(B,Funcs(A,C)) by A1,A2,Th50;
  then commute cf in Funcs(A,Funcs(B,C)) by A1,Th50;
  then
A5: ex h be Function st h = commute cf & dom h = A & rng h c= Funcs(B,C) by
FUNCT_2:def 2;
A6: ex g be Function st g = cf & dom g = B & rng g c= Funcs(A,C) by A4,
FUNCT_2:def 2;
  for x being object st x in A holds f.x = (commute cf).x
  proof
    set ccf = commute cf, uf = uncurry f, ucf = uncurry cf;
    let x be object;
    assume
A7: x in A;
    then f.x in rng f by A3,FUNCT_1:def 3;
    then consider g be Function such that
A8: g = f.x & dom g = B and
    rng g c= C by A3,FUNCT_2:def 2;
    ccf.x in rng ccf by A5,A7,FUNCT_1:def 3;
    then consider h be Function such that
A9: h = ccf.x and
A10: dom h = B and
    rng h c= C by A5,FUNCT_2:def 2;
A11: for y st y in B for h be Function st h = cf.y holds x in dom h & h.x = g.y
    proof
      let y;
      assume y in B;
      then
A12:  [x,y] in dom uf & uf.(x,y) = g.y by A3,A7,A8,FUNCT_5:38;
      let h be Function;
      assume h = cf.y;
      hence thesis by A12,FUNCT_5:22;
    end;
A13: for y st y in B holds [y,x] in dom ucf & ucf.(y,x) = g.y
    proof
      let y;
      reconsider h = cf.y as Function;
      assume
A14:  y in B;
      then x in dom h & h.x = g.y by A11;
      hence thesis by A6,A14,FUNCT_5:38;
    end;
    for y being object st y in B holds h.y = g.y
    proof
      let y be object;
      assume y in B;
      then [y,x] in dom ucf & ucf.(y,x) = g.y by A13;
      hence thesis by A9,FUNCT_5:22;
    end;
    hence thesis by A8,A9,A10,FUNCT_1:2;
  end;
  hence thesis by A3,A5;
end;
