reserve a,b,d,n,k,i,j,x,s for Nat;

theorem Th38:
  for p be Prime st 2 < n & n div 2 < p <= 2*(n div 2) holds
    p |-count (n!) = 1
proof
  let p be Prime such that
A1: 2 < n & n div 2 < p <= 2*(n div 2);
  per cases;
  suppose n is even;
    then consider k be Nat such that
A2:   n=2*k by ABIAN:def 2;
A3:   n div 2 = k by A2,NAT_D:18;
A4:   p < 2*k
    proof
      assume p >= 2*k;
      then p = 2*k by A1,A3,XXREAL_0:1;
      hence thesis by A2,A1,NUMBER06:2;
    end;
A5:   n < 2*p by A2, A3,A1,XREAL_1:68;
A6:   p|^1 divides n! by A3,A1,A2,NEWTON:41;
A7:   p<> 1 by INT_2:def 4;
    not p|^(1+1) divides n! by A4,A2,Th36,A5;
    hence thesis by A6,A7,NAT_3:def 7;
  end;
  suppose n is odd;
    then consider k be Nat such that
A8:   n=2*k+1 by ABIAN:9;
    1 div 2 = 0 by NAT_D:27;
    then
A9:   n div 2 = k + 0 by A8,NAT_D:61;
    k+1<=p by A9,A1,NAT_1:13;
    then k+1+k < p+p by A9,A1,XREAL_1:8;
    then
A10:  n < 2*p by A8;
A11:  p <= 2*k+1 by A9,A1,NAT_1:13;
    then
A12:  p|^1 divides n! by A8,NEWTON:41;
A13:  p<> 1 by INT_2:def 4;
    not p|^(1+1) divides n! by A8,A11,Th36,A10;
    hence thesis by A12,A13,NAT_3:def 7;
  end;
end;
