
theorem
for m be non zero Nat, X be non-empty m-element FinSequence holds
 ex F be Function of CarProduct X,product X st F is one-to-one & F is onto
proof
    defpred P[non zero Nat] means
     for X be non-empty $1-element FinSequence holds
      ex F be Function of CarProduct X,product X
       st F is one-to-one & F is onto;

A1: P[1]
    proof
     let X be non-empty 1-element FinSequence;
     set P = ProdFinSeq X;
A2:   P.1 = X.1
    & ( for i be Nat st 1 <= i & i < 1 holds P.(i+1) = [:P.i,X.(i+1):] )
    & CarProduct X = P.1 by Def3;

     dom X = Seg len X by FINSEQ_1:def 3; then
A3:  dom X = Seg 1 by CARD_1:def 7; then
     1 in dom X; then
     consider I be Function of X.1,product X such that
A4:   I is one-to-one & I is onto
    & for x be object st x in X.1 holds I.x = <*x*>
       by A3,FINSEQ_1:2,PRVECT_3:2;
     reconsider I as Function of CarProduct X,product X by A2;
     take I;
     thus thesis by A4;
    end;

A5: for n be non zero Nat st P[n] holds P[n+1]
    proof
     let n be non zero Nat;
     assume A6: P[n];
     let X be non-empty (n+1)-element FinSequence;
A7:  len X = n+1 by CARD_1:def 7;

A8:  CarProduct X =[: CarProduct SubFin(X,n),ElmFin(X,n+1) :] by Th6;

     set X1 = SubFin(X,n);
     consider F1 be Function of CarProduct X1,product X1 such that
A9:  F1 is one-to-one & F1 is onto by A6;

     n+1 in Seg (n+1) by FINSEQ_1:4; then
A10: n+1 in dom X by A7,FINSEQ_1:def 3;

     reconsider Y = <*X.(n+1)*> as non empty FinSequence;
A11: len Y = 1 & rng Y = {X.(n+1)} by FINSEQ_1:39; then
     not {} in rng Y by A10; then
     reconsider Y as non-empty non empty FinSequence by RELAT_1:def 9;
A12: dom Y = Seg len Y by FINSEQ_1:def 3;

     Y.1 = X.(n+1); then
     consider J be Function of X.(n+1),product Y such that
A13:  J is one-to-one & J is onto
    & for x be object st x in X.(n+1) holds J.x = <*x*>
       by A10,A11,A12,FINSEQ_1:2,PRVECT_3:2;

     n < n+1 by NAT_1:13; then
A14:  X1 = X|n by Def5; then
A15: X1^Y = X by FINSEQ_3:55,A7;

A16:  ElmFin(X,n+1) = X.(n+1) by Def1;
     consider I be Function of [: product X1,product Y :],product(X1^Y)
       such that
A17:  I is one-to-one & I is onto
    & for x,y be FinSequence st x in product X1 & y in product Y holds
       I.(x,y) = x^y by PRVECT_3:6;
     reconsider I as Function of [: product X1,product Y :],product X
       by FINSEQ_3:55,A7,A14;

     deffunc B(object,object) = [F1.$1,J.$2];

A18: for x,y be object st x in CarProduct X1 & y in X.(n+1) holds
      B(x,y) in [: product X1,product Y :]
     proof
      let x,y be object;
      assume x in CarProduct X1 & y in X.(n+1); then
      F1.x in product X1 & J.y in product Y by FUNCT_2:5;
      hence B(x,y) in [: product X1,product Y :] by ZFMISC_1:87;
     end;

     consider K being Function of [: CarProduct X1,X.(n+1):],
               [: product X1,product Y :] such that
A19:  for x,y be object st x in CarProduct X1 & y in X.(n+1)
       holds K.(x,y) = B(x,y) from BINOP_1:sch 2(A18);
A20: dom K = [: CarProduct X1,X.(n+1):] by FUNCT_2:def 1;

     now let z1,z2 be object;
      assume
A21:   z1 in dom K & z2 in dom K & K.z1 = K.z2; then
      consider x1,y1 being object such that
A22:   x1 in CarProduct X1 & y1 in X.(n+1) & z1 = [x1,y1] by ZFMISC_1:def 2;
      consider x2,y2 being object such that
A23:   x2 in CarProduct X1 & y2 in X.(n+1) & z2 = [x2,y2]
         by A21,ZFMISC_1:def 2;

      [F1.x1,J.y1] = K.(x1,y1) by A19,A22; then
      [F1.x1,J.y1] = K.(x2,y2) by A21,A22,A23; then
      [F1.x1,J.y1] = [F1.x2,J.y2] by A19,A23; then
A24:  F1.x1 = F1.x2 & J.y1 = J.y2 by XTUPLE_0:1;
A25:  x1 in dom F1 & x2 in dom F1 by A22,A23,FUNCT_2:def 1;
      y1 in dom J & y2 in dom J by A22,A23,FUNCT_2:def 1; then
      y1 = y2 by A13,A24;
      hence z1=z2 by A9,A25,A24,A22,A23;
     end; then
A26: K is one-to-one;

     now let z be object;
      assume z in [: product X1,product Y :]; then
      consider x,y being object such that
A27:   x in product X1 & y in product Y & z = [x,y] by ZFMISC_1:def 2;

A28:  x in rng F1 & y in rng J by A13,A9,A27,FUNCT_2:def 3; then
      consider s be object such that
A29:   s in dom F1 & x=F1.s by FUNCT_1:def 3;
      consider t be object such that
A30:   t in dom J & y=J.t by A28,FUNCT_1:def 3;

A31:  [s,t] in dom K by A20,A29,A30,ZFMISC_1:87;

      K.(s,t) = B(s,t) by A19,A29,A30;
      hence z in rng K by A27,A29,A30,A31,FUNCT_1:3;
     end; then
     rng K = [: product X1,product Y :]; then
A32: K is onto by FUNCT_2:def 3;

     reconsider F=I*K as Function of [:CarProduct X1,X.(n+1):],product X;
     reconsider F as Function of CarProduct X,product X by A8,A16;
     take F;
     thus F is one-to-one & F is onto by A15,A17,A26,A32,FUNCT_2:27;
    end;

A33:for n be non zero Nat holds P[n] from NAT_1:sch 10(A1,A5);

    let m be non zero Nat;
    let X be non-empty m-element FinSequence;
    thus ex F be Function of CarProduct X,product X st
     F is one-to-one & F is onto by A33;
end;
