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
  [:X,Y:] <> {} implies curry ([:X,Y:] --> z) = X --> (Y --> z) & curry'
  ([:X,Y:] --> z) = Y --> (X --> z)
proof
  assume
A1: [:X,Y:] <> {};
A2: dom ([:X,Y:] --> z) = [:X,Y:];
A4: now
    let x be object;
    assume
A5: x in Y;
    then consider f such that
A6: (curry' ([:X,Y:] --> z)).x = f & dom f = X and
    rng f c= rng ([:X,Y:] --> z) and
A7: for y st y in X holds f.y = ([:X,Y:] --> z).(y,x) by A1,A2,FUNCT_5:32;
A8: now
      let y be object;
      assume
A9:   y in X;
      then
A10:  f.y = ([:X,Y:] --> z).(y,x) by A7;
      (X --> z).y = z & [y,x] in [:X,Y:] by A5,A9,FUNCOP_1:7,ZFMISC_1:87;
      hence f.y = (X --> z).y by A10,FUNCOP_1:7;
    end;
    (Y --> (X --> z)).x = X --> z by A5,FUNCOP_1:7;
    hence (curry' ([:X,Y:] --> z)).x = (Y --> (X --> z)).x by A6,A8;
  end;
A12: now
    let x be object;
    assume
A13: x in X;
    then consider f such that
A14: (curry ([:X,Y:] --> z)).x = f & dom f = Y and
    rng f c= rng ([:X,Y:] --> z) and
A15: for y st y in Y holds f.y = ([:X,Y:] --> z).(x,y) by A1,A2,FUNCT_5:29;
A16: now
      let y be object;
      assume
A17:  y in Y;
      then
A18:  f.y = ([:X,Y:] --> z).(x,y) by A15;
      (Y --> z).y = z & [x,y] in [:X,Y:] by A13,A17,FUNCOP_1:7,ZFMISC_1:87;
      hence f.y = (Y --> z).y by A18,FUNCOP_1:7;
    end;
    (X --> (Y --> z)).x = Y --> z by A13,FUNCOP_1:7;
    hence (curry ([:X,Y:] --> z)).x = (X --> (Y --> z)).x by A14,A16;
  end;
  dom (X --> (Y --> z)) = X & dom curry ([:X,Y:] --> z) = X 
    by A1,A2,FUNCT_5:24;
  hence curry ([:X,Y:] --> z) = X --> (Y --> z) by A12;
  dom (Y --> (X --> z)) = Y & dom curry' ([:X,Y:] --> z) = Y 
    by A1,A2,FUNCT_5:24;
  hence thesis by A4;
end;
