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

theorem
  for f being Function of X,Y for g being Function of Y,X st g*f = id X
   holds f is one-to-one & g is onto
proof
  let f be Function of X,Y;
  let g be Function of Y,X;
  assume that
A1: g*f = id X;
  thus f is one-to-one
   proof
    per cases;
    suppose Y = {};
     hence thesis;
    end;
    suppose Y <> {};
     then dom f = X by Def1;
    hence thesis by A1,FUNCT_1:31;
    end;
   end;
  rng(g*f) = X by A1;
  then X c= rng g by RELAT_1:26;
  hence rng g = X;
end;
