reserve A,B,C for Ordinal,
  X,X1,Y,Y1,Z for set,a,b,b1,b2,x,y,z for object,
  R for Relation,
  f,g,h for Function,
  k,m,n for Nat;
reserve M,N for Cardinal;

theorem Th11:
  card X c= card Y iff ex f st dom f = Y & X c= rng f
proof
  thus card X c= card Y implies ex f st dom f = Y & X c= rng f
  proof
    assume card X c= card Y;
    then consider f such that
A1: f is one-to-one and
A2: dom f = X and
A3: rng f c= Y by Th9;
    defpred P[object,object] means
$1 in rng f & $2 = f".$1 or not $1 in rng f & $2
    = 0;
A4: for x being object st x in Y ex y being object st P[x,y]
    proof
      let x being object such that
      x in Y;
      not x in rng f implies thesis;
      hence thesis;
    end;
A5: for x,y,z being object st x in Y & P[x,y] & P[x,z] holds y = z;
    consider g such that
A6: dom g = Y & for y being object st y in Y holds P[y,g.y]
from FUNCT_1:sch 2(A5,
    A4);
    take g;
    thus dom g = Y by A6;
    let x be object;
    assume
A7: x in X;
    then
A8: f.x in rng f by A2,FUNCT_1:def 3;
    f".(f.x) = x by A1,A2,A7,FUNCT_1:34;
    then x = g.(f.x) by A3,A6,A8;
    hence thesis by A3,A6,A8,FUNCT_1:def 3;
  end;
  given f such that
A9: dom f = Y and
A10: X c= rng f;
  deffunc f(object) = f"{$1};
  consider g such that
A11: dom g = X &
for x being object st x in X holds g.x = f(x) from FUNCT_1:sch 3;
  per cases;
  suppose X <> {};
    then reconsider M = rng g as non empty set by A11,RELAT_1:42;
    for Z st Z in M holds Z <> {}
    proof
      let Z;
      assume Z in M;
      then consider x being object such that
A12:  x in dom g & Z = g.x by FUNCT_1:def 3;
A13:  x in {x} by TARSKI:def 1;
      Z = f"{x} & ex y being object st y in dom f & x = f.y
by A10,A11,A12,FUNCT_1:def 3;
      hence thesis by A13,FUNCT_1:def 7;
    end;
    then consider F being Function such that
A14: dom F = M and
A15: for Z st Z in M holds F.Z in Z by FUNCT_1:111;
A16: dom(F*g) = X by A11,A14,RELAT_1:27;
A17: F*g is one-to-one
    proof
      let x,y be object;
      assume that
A18:  x in dom(F*g) and
A19:  y in dom(F*g) and
A20:  (F*g).x = (F*g).y;
A21:  g.y = f"{y} by A11,A16,A19;
      then f"{y} in M by A11,A16,A19,FUNCT_1:def 3;
      then F.(f"{y}) in f"{y} by A15;
      then
A22:  f.(F.(f"{y})) in {y} by FUNCT_1:def 7;
A23:  g.x = f"{x} by A11,A16,A18;
      then f"{x} in M by A11,A16,A18,FUNCT_1:def 3;
      then F.(f"{x}) in f"{x} by A15;
      then f.(F.(f"{x})) in {x} by FUNCT_1:def 7;
      then
A24:  f.(F.(f"{x})) = x by TARSKI:def 1;
      (F*g).x = F.(g.x) & (F*g).y = F. ( g.y) by A11,A16,A18,A19,FUNCT_1:13;
      hence thesis by A20,A23,A21,A22,A24,TARSKI:def 1;
    end;
    rng(F*g) c= Y
    proof
      let x be object;
      assume x in rng(F*g);
      then consider y being object such that
A25:  y in dom(F*g) and
A26:  x = (F*g).y by FUNCT_1:def 3;
A27:  x = F.(g.y) by A11,A16,A25,A26,FUNCT_1:13;
A28:  g.y = f"{y} by A11,A16,A25;
      then f"{y} in M by A11,A16,A25,FUNCT_1:def 3;
      then x in f"{y} by A15,A28,A27;
      hence thesis by A9,FUNCT_1:def 7;
    end;
    hence thesis by A16,A17,Th9;
  end;
 suppose X = {};
  hence thesis;
 end;
end;
