
theorem Th1:
  for X,Y,Z,D being set st D c= Funcs(X, Funcs(Y,Z)) ex F being
  ManySortedSet of D st F is uncurrying & rng F c= Funcs([:X,Y:], Z)
proof
  let X,Y,Z,D be set such that
A1: D c= Funcs(X, Funcs(Y,Z));
  per cases;
  suppose
    D is empty;
    then reconsider F={} as ManySortedSet of D by PARTFUN1:def 2,RELAT_1:38
,def 18;
    take F;
    thus F is uncurrying;
    thus thesis;
  end;
  suppose
    D is non empty;
    then reconsider E=D as non empty functional set by A1;
    deffunc F(Function) = uncurry $1;
    consider F being ManySortedSet of E such that
A2: for d being Element of E holds F.d = F(d) from PBOOLE:sch 5;
    reconsider F1=F as ManySortedSet of D;
    take F1;
    thus F1 is uncurrying
    proof
      hereby
        let x be set;
        assume x in dom F1;
        then x in D;
        then consider x1 being Function such that
A3:     x1=x and
        dom x1=X and
A4:     rng x1 c= Funcs(Y,Z) by A1,FUNCT_2:def 2;
        x1 is Function-yielding
        proof
          let a be object;
          assume a in dom x1;
          then x1.a in rng x1 by FUNCT_1:def 3;
          hence thesis by A4;
        end;
        hence x is Function-yielding Function by A3;
      end;
      let f be Function;
      assume f in dom F1;
      then reconsider d=f as Element of E;
      thus F1.f = F.d .= uncurry f by A2;
    end;
    thus rng F1 c= Funcs([:X,Y:], Z)
    proof
      let y be object;
      assume y in rng F1;
      then consider x being object such that
A5:   x in dom F1 and
A6:   y = F1.x by FUNCT_1:def 3;
      reconsider d=x as Element of E by A5;
A7:   d in Funcs(X, Funcs(Y,Z)) by A1;
      y = uncurry d by A2,A6;
      hence thesis by A7,FUNCT_6:11;
    end;
  end;
end;
