reserve P,Q,X,Y,Z for set, p,x,x9,x1,x2,y,z for object;

theorem
  for f being Function st dom f = X & for x st x in X holds f.x in Y
  holds f is Function of X,Y
proof
  let f be Function such that
A1: dom f = X and
A2: for x st x in X holds f.x in Y;
  rng f c= Y
  proof
    let y be object;
    assume y in rng f;
    then ex x being object st x in X & y = f.x by A1,FUNCT_1:def 3;
    hence thesis by A2;
  end;
  then reconsider R = f as Relation of dom f,Y by RELSET_1:4;
  Y = {} or Y <> {};
  then R is quasi_total by Def1;
  hence thesis by A1;
end;
