reserve x, x1, x2, y, z, X9 for set,
  X, Y for finite set,
  n, k, m for Nat,
  f for Function;

theorem Th4:
  for X,Y,x,y st (Y is empty implies X is empty) & not x in X & not
y in Y holds card{F where F is Function of X,Y:F is one-to-one}= card{F where F
  is Function of X\/{x},Y\/{y}:F is one-to-one & F.x=y}
proof
  let X,Y,x,y such that
A1: Y is empty implies X is empty and
A2: not x in X and
A3: not y in Y;
  defpred P[Function,set,set] means $1 is one-to-one & rng ($1|X) c=Y;
A4: for f be Function of X\/{x},Y\/{y} st f.x=y holds P[f,X\/{x},Y\/{y}] iff
  P[f|X,X,Y]
  proof
    let f be Function of X\/{x},Y\/{y} such that
A5: f.x=y;
    thus P[f,X\/{x},Y\/{y}] implies P[f|X,X,Y] by FUNCT_1:52;
    thus P[f|X,X,Y] implies P[f,X\/{x},Y\/{y}]
    proof
      (X\/{x})/\X=X & dom f = X\/{x} by FUNCT_2:def 1,XBOOLE_1:21;
      then
A6:   dom (f|X)=X by RELAT_1:61;
      assume that
A7:   f|X is one-to-one and
A8:   rng (f|X|X) c=Y;
      rng (f|X) c= Y by A8;
      then f|X is Function of X,Y by A6,FUNCT_2:2;
      hence thesis by A1,A3,A5,A7,A8,STIRL2_1:58;
    end;
  end;
  set F3={F where F is Function of X\/{x},Y\/{y}: F is one-to-one & F.x=y};
A9: F3 c= {f where f is Function of (X\/{x}),(Y\/{y}): P[f,X\/{x},Y\/{y}] &
  rng (f|X) c=Y & f.x=y}
  proof
    let z be object;
    assume z in F3;
    then consider F be Function of X\/{x},Y\/{y} such that
A10: z=F and
A11: F is one-to-one & F.x=y;
    rng (F|X) c=Y
    proof
A12:  dom F=X\/{x} by FUNCT_2:def 1;
      x in {x} by TARSKI:def 1;
      then
A13:  x in dom F by A12,XBOOLE_0:def 3;
      assume not rng (F|X) c=Y;
      then consider fz be object such that
A14:  fz in rng (F|X) and
A15:  not fz in Y;
      consider z be object such that
A16:  z in dom (F|X) and
A17:  fz=(F|X).z by A14,FUNCT_1:def 3;
A18:  z in dom F by A16,RELAT_1:57;
A19:  fz in Y or fz in {y} by A14,XBOOLE_0:def 3;
A20:  z in X by A16;
      F.z=(F|X).z by A16,FUNCT_1:47;
      then y=F.z by A15,A17,A19,TARSKI:def 1;
      hence thesis by A2,A11,A13,A20,A18;
    end;
    hence thesis by A10,A11;
  end;
A21: {f where f is Function of (X\/{x}),(Y\/{y}): P[f,X\/{x},Y\/{y}]&rng (f|
  X) c=Y &f.x=y} c= F3
  proof
    let z be object;
    assume z in {f where f is Function of (X\/{x}),(Y\/{y}): P[f,X\/{x},Y\/{
    y}] & rng (f|X) c=Y & f.x=y};
    then ex f be Function of (X\/{x}),(Y\/{y}) st z=f & P[f,X\/{x},Y\/{y}] &
    rng (f|X) c=Y & f.x=y;
    hence thesis;
  end;
  set F2={f where f is Function of X,Y:f is one-to-one & rng (f|X) c= Y};
  set F1={F where F is Function of X,Y:F is one-to-one};
A22: F1 c=F2
  proof
    let z be object;
    assume z in F1;
    then consider F be Function of X,Y such that
A23: z=F & F is one-to-one;
    rng (F|X) c= rng F;
    hence thesis by A23;
  end;
A24: not x in X by A2;
A25: card{f where f is Function of X,Y:P[f,X,Y]}= card{f where f is Function
of (X\/{x}),(Y\/{y}): P[f,X\/{x},Y\/{y}]&rng (f|X) c=Y & f.x=y} from
STIRL2_1:
  sch 4(A1,A24,A4);
  F2 c=F1
  proof
    let z be object;
    assume z in F2;
    then ex f be Function of X,Y st z=f & f is one-to-one & rng (f|X)c= Y;
    hence thesis;
  end;
  then F2=F1 by A22;
  hence thesis by A9,A21,A25,XBOOLE_0:def 10;
end;
