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

theorem Th12:
 for z,x,y being object holds
  not z in X implies card Choose(X,k,x,y)= card{f where f is
  Function of X\/{z},{x,y}:card (f"{x})=k+1 & f.z=x}
proof let z,x,y be object;
  set F1={f where f is Function of X\/{z},{x,y}:card (f"{x})=k+1 & f.z=x};
  defpred P[set,set,set] means for f be Function st f=$1 holds card ((f|X)"{x}
  )=k;
A1: for f be Function of X\/{z},{x,y}\/{x} st f.z=x holds P[f,X\/{z},{x,y}\/
  {x}] iff P[f|X,X,{x,y}]
  proof
    let f be Function of X\/{z},{x,y}\/{x} such that
    f.z=x;
    (f|X)=((f|X)|X);
    hence thesis;
  end;
  set F3={f where f is Function of X\/{z},{x,y}\/{x}: P[f,X\/{z},{x,y}\/{x}] &
  rng (f|X) c={x,y} & f.z=x};
  set F2={f where f is Function of X,{x,y}:P[f,X,{x,y}]};
  assume
A2: not z in X;
A3: F3 c= F1
  proof
    {x}\/{x,y}={x,x,y} by ENUMSET1:2;
    then
A4: {x,y}\/{x}={x,y} by ENUMSET1:30;
    z in {z} by TARSKI:def 1;
    then
A5: z in X\/{z} by XBOOLE_0:def 3;
    let x1 be object;
    assume x1 in F3;
    then consider f be Function of X\/{z},{x,y}\/{x} such that
A6: x1=f and
A7: P[f,X\/{z},{x,y}\/{x}] and
    rng (f|X) c={x,y} and
A8: f.z=x;
    dom f=X\/{z} & (X\/{z})\{z}=X by A2,FUNCT_2:def 1,ZFMISC_1:117;
    then
A9: {z}\/(f|X)"{x}=f"{x} by A8,A5,AFINSQ_2:66;
    not z in dom f/\X by A2,XBOOLE_0:def 4;
    then not z in dom (f|X) by RELAT_1:61;
    then
A10: not z in (f|X)"{x} by FUNCT_1:def 7;
    card ((f|X)"{x})=k by A7;
    then card (f"{x})=k+1 by A9,A10,CARD_2:41;
    hence thesis by A6,A8,A4;
  end;
A11: F2 c=Choose(X,k,x,y)
  proof
    let x1 be object;
    assume x1 in F2;
    then consider f be Function of X,{x,y} such that
A12: x1=f and
A13: P[f,X,{x,y}];
    f|X=f;
    then card (f"{x})=k by A13;
    hence thesis by A12,Def1;
  end;
A14: Choose(X,k,x,y)c= F2
  proof
    let x1 be object;
    assume x1 in Choose(X,k,x,y);
    then consider f be Function of X,{x,y} such that
A15: x1=f and
A16: card (f"{x})=k by Def1;
    P[f,X,{x,y}] by A16;
    hence thesis by A15;
  end;
A17: {x,y} is empty implies X is empty;
A18: card F2=card F3 from STIRL2_1:sch 4(A17,A2,A1);
  F1 c= F3
  proof
    z in {z} by TARSKI:def 1;
    then
A19: z in X\/{z} by XBOOLE_0:def 3;
    let x1 be object;
    assume x1 in F1;
    then consider f be Function of X\/{z},{x,y} such that
A20: x1=f and
A21: card (f"{x})=k+1 and
A22: f.z=x;
    not z in dom f/\X by A2,XBOOLE_0:def 4;
    then not z in dom (f|X) by RELAT_1:61;
    then
A23: not z in ((f|X)"{x}) by FUNCT_1:def 7;
    dom f=X\/{z} & (X\/{z})\{z}=X by A2,FUNCT_2:def 1,ZFMISC_1:117;
    then ((f|X)"{x})\/{z}=f"{x} by A22,A19,AFINSQ_2:66;
    then card ((f|X)"{x})+1=k+1 by A21,A23,CARD_2:41;
    then
A24: P[f,X\/{z},{x,y}\/{x}];
    {x}\/{x,y}={x,x,y} by ENUMSET1:2;
    then rng (f|X) c={x,y} & f is Function of X\/{z},{x,y}\/{x} by ENUMSET1:30;
    hence thesis by A20,A22,A24;
  end;
  then F1=F3 by A3;
  hence thesis by A11,A14,A18,XBOOLE_0:def 10;
end;
