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 Th7:
  for i,j st i in Seg (n+1) & j in Seg (n+1) holds card {p1: p1.i = j} = n!
proof
  let i,j such that
A1: i in Seg (n+1) and
A2: j in Seg (n+1);
  reconsider N = n as Element of NAT by ORDINAL1:def 12;
  set n1=N+1;
  set X=finSeg n1;
  set Y=X\{j};
A3: Y\/{j}=X by A2,ZFMISC_1:116;
  set X9=X\{i};
  set P1=Permutations n1;
  set F={p where p is Element of P1:p.i=j};
  set F9={f where f is Function of X9\/{i},Y\/{j}:f is one-to-one & f.i=j};
A4: X9\/{i}=X by A1,ZFMISC_1:116;
A5: F9 c= F
  proof
    let x be object;
    assume x in F9;
    then consider f be Function of X,X such that
A6: f=x and
A7: f is one-to-one and
A8: f.i=j by A4,A3;
    card X=card X;
    then f is onto by A7,FINSEQ_4:63;
    then f in P1 by A7,MATRIX_1:def 12;
    hence thesis by A6,A8;
  end;
  F c= F9
  proof
    let x be object;
    assume x in F;
    then consider p be Element of P1 such that
A9: x=p and
A10: p.i=j;
    reconsider p as Permutation of X by MATRIX_1:def 12;
    p.i=j by A10;
    hence thesis by A4,A3,A9;
  end;
  then
A11: F=F9 by A5,XBOOLE_0:def 10;
A12: card X=n1 by FINSEQ_1:57;
A13: not j in Y by ZFMISC_1:56;
  then
A14: card X=card Y+1 by A3,CARD_2:41;
A15: not i in X9 by ZFMISC_1:56;
  then
A16: card X=card X9+1 by A4,CARD_2:41;
  then Y is empty implies X9 is empty by A14;
  hence card {p1: p1.i = j} = card {f where f is Function of X9,Y:f is
  one-to-one} by A15,A13,A11,CARD_FIN:5
    .= card Y!/((card Y-'card X9)!) by A16,A14,CARD_FIN:7
    .= card Y!/1 by A16,A14,NEWTON:12,XREAL_1:232
    .= n! by A14,A12;
end;
