reserve X,X1,X2,Y,Y1,Y2 for set, p,x,x1,x2,y,y1,y2,z,z1,z2 for object;
reserve f,g,g1,g2,h for Function,
  R,S for Relation;

theorem
  Y <> {} or X = {} implies ex f st X = dom f & rng f c= Y
proof
  assume
A1: Y <> {} or X = {};
A2: now
    set y = the Element of Y;
    deffunc F(object) = y;
    consider f such that
A3: dom f = X and
A4: for x st x in X holds f.x = F(x) from Lambda;
    assume X <> {};
    then
A5: y in Y by A1;
    take f;
    thus dom f = X by A3;
    for z being object holds z in rng f implies z in Y
    proof let z be object;
      assume z in rng f;
      then ex x being object st x in dom f & z = f.x by Def3;
      hence thesis by A5,A3,A4;
    end;
    hence rng f c= Y;
  end;
  now
    assume
A6: X = {};
    take f = {};
    thus dom f = X by A6;
    thus rng f c= Y;
  end;
  hence thesis by A2;
end;
