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

theorem Th6:
  card X <= card Y implies card {F where F is Function of X,Y:F is
  one-to-one} = card Y!/((card Y-'card X)!)
proof
  defpred P[Nat] means for X,Y st card Y=$1 & card X <= card Y
  holds card {F where F is Function of X,Y:F is one-to-one}= card Y!/((card Y-'
  card X)!);
A1: for n st P[n] holds P[n+1]
  proof
    let n such that
A2: P[n];
    let X,Y such that
A3: card Y=n+1 and
A4: card X <= card Y;
    per cases;
    suppose
A5:   X is empty;
      set F1={F where F is Function of X,Y:F is one-to-one};
A6:   F1 c= {{}}
      proof
        let x be object;
        assume x in F1;
        then ex F be Function of X,Y st x=F & F is one-to-one;
        then x={} by A5;
        hence thesis by TARSKI:def 1;
      end;
A7:   rng {} c=Y;
      card Y-card X=card Y by A5;
      then
A8:   (card Y-'card X)!=card Y! by XREAL_0:def 2;
A9:   card Y! /((card Y-'card X)!)=1 by A8,XCMPLX_1:60;
      dom {}=X by A5;
      then {} is Function of X,Y by A7,FUNCT_2:2;
      then {} in F1;
      then F1 = {{}} by A6,ZFMISC_1:33;
      hence thesis by A9,CARD_1:30;
    end;
    suppose
      X is non empty;
      then consider x being object such that
A10:  x in X;
      reconsider x as set by TARSKI:1;
A11:  x in X by A10;
      defpred F[Function] means $1 is one-to-one;
      card Y,Y are_equipotent by CARD_1:def 2;
      then consider f be Function such that
A12:  f is one-to-one and
A13:  dom f= card Y and
A14:  rng f= Y by WELLORD2:def 4;
      reconsider f as Function of card Y,Y by A13,A14,FUNCT_2:1;
A15:  Y is non empty by A3;
A16:  f is onto one-to-one by A12,A14,FUNCT_2:def 3;
      consider F be XFinSequence of NAT such that
A17:  dom F = card Y and
A18:  card{g where g is Function of X,Y:F[g]} = Sum(F) and
A19:  for k st k in dom F holds F.k = card{g where g is Function of X
      ,Y:F[g] & g.x=f.k} from STIRL2_1:sch 6(A16,A15,A11);
A20:  for k be Nat st k in dom F holds F.k= n!/((card Y-'card X)!)
      proof
        card X >0 by A11;
        then reconsider cX1=card X-1 as Element of NAT by NAT_1:20;
        set Xx=X\{x};
        x in {x} by TARSKI:def 1;
        then
A21:    not x in Xx by XBOOLE_0:def 5;
A22:    X=Xx\/{x} by A11,ZFMISC_1:116;
A23:    (cX1+1)-1<=(n+1)-1 by A3,A4,XREAL_1:9;
        then
A24:    n-cX1>=cX1-cX1 by XREAL_1:9;
        let k be Nat such that
A25:    k in dom F;
A26:    f.k in Y by A13,A14,A17,A25,FUNCT_1:def 3;
        set Yy=Y\{f.k};
A27:    Y=Yy\/{f.k} by A26,ZFMISC_1:116;
        f.k in {f.k} by TARSKI:def 1;
        then
A28:    not f.k in Yy by XBOOLE_0:def 5;
        cX1+1 <=n+1 by A3,A4;
        then
A29:    card Xx =cX1 by A11,STIRL2_1:55;
A30:    card Yy =n by A3,A26,STIRL2_1:55;
        then
A31:    Yy is empty implies Xx is empty by A23,A29;
A32:    card {g where g is Function of Xx,Yy:g is one-to-one}= n!/((card
        Yy-' card Xx)!) by A2,A23,A29,A30;
        card Y-card X >= card X -card X by A4,XREAL_1:9;
        then
card Y-'card X=((card Yy+1)-1)-((card Xx+1)-1) by A3,A29,A30,XREAL_0:def 2
          .=card Yy-'card Xx by A29,A30,A24,XREAL_0:def 2;
        then
        card{g where g is Function of X,Y:g is one-to-one & g.x=f.k} = n!
        /((card Y-'card X)!) by A32,A27,A22,A28,A21,A31,Th4;
        hence thesis by A19,A25;
      end;
      then for k be Nat st k in dom F holds F.k >= n!/((card Y-'card X)!);
      then
A33:  Sum F>=len F*(n!/((card Y-'card X)!)) by AFINSQ_2:60;
      for k be Nat st k in dom F holds F.k <= n!/((card Y-'card X)!) by A20;
      then Sum F<=len F*(n!/((card Y-'card X)!)) by AFINSQ_2:59;
      then Sum F = (n+1) *((n!/((card Y-'card X)!))) by A3,A17,A33,XXREAL_0:1
        .=((n+1)*(n!))/((card Y-'card X)!) by XCMPLX_1:74
        .=card Y!/((card Y-'card X)!) by A3,NEWTON:15;
      hence thesis by A18;
    end;
  end;
A34: P[0]
  proof
    let X,Y such that
A35: card Y=0 and
A36: card X <= card Y;
    card Y-card X=0 by A35,A36;
    then
A37: (card Y-'card X)!=1 by NEWTON:12,XREAL_0:def 2;
    set F1={F where F is Function of X,Y:F is one-to-one};
A38: F1 c= {{}}
    proof
      let x be object;
      assume x in F1;
      then
A39:  ex F be Function of X,Y st x=F & F is one-to-one;
      Y={} by A35;
      then x={} by A39;
      hence thesis by TARSKI:def 1;
    end;
    dom {}=X & rng {}=Y by A35,A36;
    then {} is Function of X,Y by FUNCT_2:1;
    then {} in F1;
    then F1 = {{}} by A38,ZFMISC_1:33;
    hence thesis by A35,A37,CARD_1:30,NEWTON:12;
  end;
  for n holds P[n] from NAT_1:sch 2(A34,A1);
  hence thesis;
end;
