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
  (uncurry f in PFuncs([:X,Y:],Z) or uncurry' f in PFuncs([:Y,X:],Z)) &
  rng f c= PFuncs(V1,V2) & dom f c= X implies f in PFuncs(X,PFuncs(Y,Z))
proof
  assume that
A1: uncurry f in PFuncs([:X,Y:],Z) or uncurry' f in PFuncs([:Y,X:],Z) and
A2: rng f c= PFuncs(V1,V2) and
A3: dom f c= X;
A4: (ex g st uncurry f = g & dom g c= [:X,Y:] & rng g c= Z) or ex g st
  uncurry' f = g & dom g c= [:Y,X:] & rng g c= Z by A1,PARTFUN1:def 3;
  uncurry' f = ~uncurry f by FUNCT_5:def 4;
  then
A5: dom uncurry' f c= [:Y,X:] by A4,FUNCT_4:45;
  rng f c= PFuncs(Y,Z)
  proof
    let y be object;
    assume
A6: y in rng f;
    then consider x being object such that
A7: x in dom f & y = f.x by FUNCT_1:def 3;
    ex g st y = g & dom g c= V1 & rng g c= V2 by A2,A6,PARTFUN1:def 3;
    then reconsider h = y as Function;
A8: rng h c= Z
    proof
      let z be object;
      assume z in rng h;
      then ex y1 being object st y1 in dom h & z = h.y1 by FUNCT_1:def 3;
      then z in rng uncurry f & z in rng uncurry' f by A7,FUNCT_5:38,39;
      hence thesis by A4;
    end;
    dom h c= Y
    proof
      let z be object;
      assume z in dom h;
      then [z,x] in dom uncurry' f by A7,FUNCT_5:39;
      hence thesis by A5,ZFMISC_1:87;
    end;
    hence thesis by A8,PARTFUN1:def 3;
  end;
  hence thesis by A3,PARTFUN1:def 3;
end;
