reserve x,y for object,
  N for Element of NAT,
  c,i,j,k,m,n for Nat,
  D for non empty set,
  s for Element of 2Set Seg (n+2),
  p for Element of Permutations(n) ,
  p1, q1 for Element of Permutations(n+1),
  p2 for Element of Permutations(n +2),
  K for Field,
  a for Element of K,
  f for FinSequence of K,
  A for (Matrix of K),
  AD for Matrix of n,m,D,
  pD for FinSequence of D,
  M for Matrix of n,K;

theorem Th20:
  for i,j st i in Seg (n+1) & j in Seg(n+1) for P be set st P = { p1: p1
.i = j} ex Proj be Function of P,Permutations n st Proj is bijective & for
  q1 st q1.i = j holds Proj.q1 = Rem(q1,i)
proof
  let i,j such that
A1: i in Seg (n+1) and
A2: j in Seg(n+1);
  set n1 = n+1;
  reconsider N=n as Element of NAT by ORDINAL1:def 12;
  set P1 = Permutations(N+1);
  defpred F[object,object] means
   for p be Element of P1 st $1=p & p.i=j holds $2=Rem(p,i);
  let X be set such that
A3: X={p1:p1.i=j};
A4: for x being object st x in X
ex y being object st y in Permutations n & F[x,y]
  proof
    let x be object;
    assume x in X;
    then consider p be Element of P1 such that
A5: p=x and
    p.i=j by A3;
    take Rem(p,i);
    thus thesis by A5;
  end;
  consider f be Function of X,Permutations n such that
A6: for x being object st x in X holds F[x,f.x] from FUNCT_2:sch 1(A4);
  for x1,x2 be object st x1 in X & x2 in X & f.x1 = f.x2 holds x1 = x2
  proof
    let x1,x2 be object such that
A7: x1 in X and
A8: x2 in X and
A9: f.x1 = f.x2;
    consider p1 be Element of P1 such that
A10: p1=x1 and
A11: p1.i=j by A3,A7;
    set R1=Rem(p1,i);
A12: f.x1 =R1 by A6,A7,A10,A11;
    consider p2 be Element of P1 such that
A13: p2=x2 and
A14: p2.i=j by A3,A8;
    set R2=Rem(p2,i);
A15: f.x2 =R2 by A6,A8,A13,A14;
    reconsider p19=p1,p29=p2 as Permutation of Seg n1 by MATRIX_1:def 12;
A16: dom p29=Seg n1 by FUNCT_2:52;
A17: dom p19=Seg n1 by FUNCT_2:52;
    now
      let x be object such that
A18:  x in Seg n1;
      consider k being Nat such that
A19:  x=k and
A20:  1<=k and
A21:  k<=n1 by A18;
      per cases by XXREAL_0:1;
      suppose
A22:    k<i;
        i<=n1 by A1,FINSEQ_1:1;
        then k<n1 by A22,XXREAL_0:2;
        then k<=n by NAT_1:13;
        then
A23:    k in Seg n by A20;
        per cases;
        suppose
          p1.k<j & p2.k<j or p1.k>=j & p2.k>=j;
          then R1.k=p1.k & R2.k=p2.k or R1.k=p1.k-1 & R2.k=p2.k-1 by A1,A11,A14
,A22,A23,Def3;
          hence p1.x=p2.x by A9,A12,A15,A19;
        end;
        suppose
          p1.k<j & p2.k>=j or p1.k>=j & p2.k<j;
          then
          R1.k=p1.k & R2.k=p2.k-1 & p1.k<j & p2.k>=j or R1.k=p1.k-1 & R2.
          k=p2.k & p1.k>=j & p2.k<j by A1,A11,A14,A22,A23,Def3;
          then
          p1.k+1=p2.k & p1.k<j & p2.k>=j or p1.k=p2.k+1 & p1.k>=j & p2.k<
          j by A9,A12,A15;
          then p2.k<=j & p2.k>=j or p1.k>=j & p1.k<=j by NAT_1:13;
          then p29.k=p29.i or p19.k=p19.i by A11,A14,XXREAL_0:1;
          hence p1.x=p2.x by A1,A17,A16,A18,A19,A22,FUNCT_1:def 4;
        end;
      end;
      suppose
        k=i;
        hence p1.x=p2.x by A11,A14,A19;
      end;
      suppose
A24:    k>i;
        then reconsider k1=k-1 as Element of NAT by NAT_1:20;
        k1+1>i by A24;
        then
A25:    k1>=i by NAT_1:13;
        k1+1 <= n1 by A21;
        then k1 < n1 by NAT_1:13;
        then
A26:    k1<=n by NAT_1:13;
        1<=i by A1,FINSEQ_1:1;
        then 1<k1+1 by A24,XXREAL_0:2;
        then 1<=k1 by NAT_1:13;
        then
A27:    k1 in Seg n by A26;
        per cases;
        suppose
          p1.(k1+1)<j&p2.(k1+1)<j or p1.(k1+1)>=j&p2.(k1+1)>=j;
          then R1.k1=p1.k & R2.k1=p2.k or R1.k1=p1.k-1 & R2.k1=p2.k-1 by A1,A11
,A14,A27,A25,Def3;
          hence p1.x=p2.x by A9,A12,A15,A19;
        end;
        suppose
          p1.(k1+1)<j&p2.(k1+1)>=j or p1.(k1+1)>=j&p2.(k1+1)<j;
          then R1.k1=p1.k & R2.k1=p2.k-1 & p1.k<j & p2.k>=j or R1.k1=p1.k-1 &
          R2.k1=p2.k & p1.k>=j & p2.k<j by A1,A11,A14,A27,A25,Def3;
          then
          p1.k+1=p2.k & p1.k<j & p2.k>=j or p1.k=p2.k+1 & p1.k>=j & p2.k<
          j by A9,A12,A15;
          then p2.k<=j & p2.k>=j or p1.k>=j & p1.k<=j by NAT_1:13;
          then p29.k=p29.i or p19.k=p19.i by A11,A14,XXREAL_0:1;
          hence p1.x=p2.x by A1,A17,A16,A18,A19,A24,FUNCT_1:def 4;
        end;
      end;
    end;
    hence thesis by A10,A13,A17,A16,FUNCT_1:2;
  end;
  then
A28: f is one-to-one by FUNCT_2:19;
  set P = Permutations(N);
  card X= N! by A1,A2,A3,Th7;
  then reconsider P9=P,X9=X as finite set;
  take f;
A30: card P9=n! by Th6;
  card X9=n! by A1,A2,A3,Th7;
  then f is onto one-to-one by A28,A30,FINSEQ_4:63;
  hence f is bijective;
  let p be Element of Permutations(n+1) such that
A31: p.i=j;
  p in X by A3,A31;
  hence thesis by A6,A31;
end;
