
theorem
  for n being Nat st n >= 1 ex p being Prime st n < p & p <= 2*n
proof
  let n be Nat;
  assume
A1: n>=1;
AA: n in NAT by ORDINAL1:def 12;
  per cases;
  suppose
    n<4000;
    then n<4001 by XXREAL_0:2;
    hence thesis by A1,AA,Lm7;
  end;
  suppose
A2: n>=4000;
    set m = 2*n choose n;
    set X1={p|^(p |-count m) where p is prime Element of NAT: p<=sqrt(2*n) & p
    |-count m>0};
    set X2={p|^(p |-count m) where p is prime Element of NAT: sqrt(2*n)<p & p
    <=2*n/3 & p |-count m>0};
    set X3={p|^(p |-count m) where p is prime Element of NAT: n<p & p<=2*n & p
    |-count m>0};
    assume
A3: not ex p being Prime st n<p & p<=2*n;
    now
      assume X3<>{};
      then consider x be object such that
A4:   x in X3 by XBOOLE_0:def 1;
      ex p be prime Element of NAT st p|^(p |-count m)=x & n<p & p<=2*n &
      p |-count m>0 by A4;
      hence contradiction by A3;
    end;
    then
A5: m = (Product Sgm X1)*(Product Sgm X2)*1
    by AA,A2,Lm10,FINSEQ_3:43,RVSUM_1:94,XXREAL_0:2;
A6: 4|^n / (2*n) <= m by Th6;
    set X = {p where p is prime Element of NAT: p<=2*n/3};
A7: n>=3 by A2,XXREAL_0:2;
    then n/3>=3/3 by XREAL_1:72;
    then (n/3)*2>=1*2 by XREAL_1:64;
    then
A8: Product Sgm X <= (4 to_power ((2*n/3)-1)) by Th45;
    set mm=[/ 2*n/3 \];
    reconsider mm as Element of NAT by INT_1:53;
    set XX=Seg mm;
A9: now
      assume {} in X;
      then ex p being prime Element of NAT st p = {} & p<=2*n/3;
      hence contradiction;
    end;
    -1+(2*n/3)<0+(2*n/3) by XREAL_1:6;
    then
A10: 4 to_power ((2*n/3)-1) < 4 to_power (2*n/3) by POWER:39;
    now
      let x be object;
      assume x in X2;
      then consider p be prime Element of NAT such that
A11:  p|^(p |-count m)=x and
A12:  sqrt(2*n)<p and
A13:  p<=2*n/3 and
A14:  p |-count m>0;
      p |-count m <= 1 by AA,A7,A12,A13,Lm9;
      then p |-count m < 1+1 by NAT_1:13;
      then p |-count m = 1 by A14,NAT_1:23;
      then p=x by A11;
      hence x in X by A13;
    end;
    then
A15: X2 c= X;
    now
      let x be object;
      assume x in X;
      then consider p being prime Element of NAT such that
A16:  p = x and
A17:  p<=2*n/3;
A18:  1<=p by INT_2:def 4;
      2*n/3<=[/ 2*n/3 \] by INT_1:def 7;
      then p<=[/ 2*n/3 \] by A17,XXREAL_0:2;
      hence x in XX by A16,A18,FINSEQ_1:1;
    end;
    then
A19: X c= Seg mm;
    then X c= NAT by XBOOLE_1:1;
    then Product Sgm X2 <= Product Sgm X by A19,A9,A15,Th42;
    then
A20: Product Sgm X2 <= (4 to_power ((2*n/3)-1)) by A8,XXREAL_0:2;
    n>=3 by A2,XXREAL_0:2;
    then Product Sgm X1 <= (2*n) to_power sqrt(2*n) by AA,Lm11;
    then m <= ((2*n) to_power sqrt(2*n))*(4 to_power ((2*n/3)-1)) by A20,A5,
XREAL_1:66;
    then
A21: 4|^n / (2*n) <= ((2*n) to_power sqrt(2*n))*(4 to_power ((2*n/3)-1 ))
    by A6,XXREAL_0:2;
A22: 4 to_power (2*n/3)>0 by POWER:34;
    (2*n) to_power sqrt(2*n)>0 by A2,POWER:34;
    then
    (4 to_power ((2*n/3)-1))*((2*n) to_power sqrt(2*n)) < (4 to_power (2*
    n/3))*((2*n) to_power sqrt(2*n)) by A10,XREAL_1:68;
    then 4|^n / (2*n) <= ((2*n) to_power sqrt(2*n))*(4 to_power (2*n/3)) by A21
,XXREAL_0:2;
    then
    4|^n/(2*n)*(2*n)<=((2*n) to_power sqrt(2*n))*(4 to_power (2*n/3))*(2*
    n) by XREAL_1:64;
    then
    4|^n = 4 to_power (3*n/3) & 4|^n<=((2*n) to_power sqrt(2*n))*(2*n)*(4
    to_power (2*n/3)) by A2,POWER:41,XCMPLX_1:87;
    then
    (4 to_power (3*n/3))/(4 to_power (2*n/3)) <= (((2*n) to_power sqrt(2*
    n))*(2*n))* (4 to_power (2*n/3))/(4 to_power (2*n/3)) by A22,XREAL_1:72;
    then
    (4 to_power (3*n/3))/(4 to_power (2*n/3)) <= ((2*n) to_power sqrt(2*n
    ))*(2*n) by A22,XCMPLX_1:89;
    then 4 to_power ((3*n/3)-(2*n/3)) <= ((2*n) to_power sqrt(2*n))*(2*n) by
POWER:29;
    then 4 to_power (n/3) <= ((2*n) to_power sqrt(2*n))*((2*n) to_power 1) by
POWER:25;
    then 4 to_power (n/3) <= (2*n) to_power (sqrt(2*n)+1) by A2,POWER:27;
    then
A23: 4 to_power (n/3) < (2*n) to_power (sqrt(2*n)+1) or 4 to_power (n/3) =
    (2*n) to_power (sqrt(2*n)+1) by XXREAL_0:1;
    4 to_power (n/3)>0 by POWER:34;
    then (4 to_power (n/3)) to_power 3 <= ((2*n) to_power (sqrt(2*n)+1))
    to_power 3 by A23,POWER:37;
    then 4 to_power ((n/3)*3) <= ((2*n) to_power (sqrt(2*n)+1)) to_power 3 by
POWER:33;
    then
A24: 4 to_power n <= (2*n) to_power ((sqrt(2*n)+1)*3) by A2,POWER:33;
    reconsider 2n=2*n as Real;
A25: 6-root(2*n) to_power 6 = 6-root(2n) |^ 6 by POWER:41
      .= 2n by COMPTRIG:4;
    2 to_power 2 = 2|^2 by POWER:41
      .= Product <* 2, 2 *> by FINSEQ_2:61
      .= 2*2 by RVSUM_1:99;
    then
A26: 2 to_power (2*n)>0 & 4 to_power n = 2 to_power (2*n) by POWER:33,34;
    set n1=[\ 6-root(2*n) /];
    6-root(2*n) -1 < n1 by INT_1:def 6;
    then
A27: 6-root(2*n) -1 +1 < n1 +1 by XREAL_1:6;
    6-root(2*n) > 6-root 0 by A2,POWER:17;
    then
A28: 6-root(2*n) > 0 by POWER:5;
    then reconsider n1 as Element of NAT by INT_1:53;
    n1 <= 6-root(2*n) by INT_1:def 6;
    then n1 < 6-root(2*n) or n1 = 6-root(2*n) by XXREAL_0:1;
    then
A29: 2 to_power n1 <= 2 to_power (6-root(2*n)) by POWER:39;
    n1+1 <= 2|^n1 by NEWTON:85;
    then n1+1 <= 2 to_power n1 by POWER:41;
    then n1+1 <= 2 to_power (6-root(2*n)) by A29,XXREAL_0:2;
    then
    n1+1 < 2 to_power (6-root(2*n)) or n1+1 = 2 to_power (6-root(2*n)) by
XXREAL_0:1;
    then
A30: (n1+1) to_power 6 <= (2 to_power (6-root(2*n))) to_power 6 by POWER:37;
    6-root(2*n) to_power 6 < (n1+1) to_power 6 by A27,A28,POWER:37;
    then 2*n < (2 to_power (6-root(2*n))) to_power 6 by A30,A25,XXREAL_0:2;
    then
A31: 2*n < 2 to_power ((6-root(2*n))*6) by POWER:33;
    sqrt(2*n)>0 by A2,SQUARE_1:25;
    then (2*n) to_power ((sqrt(2*n)+1)*3) < (2 to_power ((6-root(2*n))*6))
    to_power ((sqrt(2*n)+1)*3) by A2,A31,POWER:37;
    then
    4 to_power n < (2 to_power ((6-root(2*n))*6)) to_power ((sqrt(2*n)+1)
    *3) by A24,XXREAL_0:2;
    then 4 to_power n < 2 to_power (((6-root(2*n))*6)*((sqrt(2*n)+1)*3)) by
POWER:33;
    then
    log(2,2 to_power (2*n)) < log(2,2 to_power (((6-root(2*n))*6)*((sqrt(
    2*n)+1)*3))) by A26,POWER:57;
    then
    (2*n)*log(2,2) < log(2,2 to_power (((6-root(2*n))*6)*((sqrt(2*n)+1)*3
    ))) by POWER:55;
    then (2*n)*log(2,2) < (((6-root(2*n))*6)*((sqrt(2*n)+1)*3))*log(2,2) by
POWER:55;
    then (2*n)*1 < (((6-root(2*n))*6)*((sqrt(2*n)+1)*3))*log(2,2) by POWER:52;
    then
A32: 2*n < (((6-root(2*n))*6)*((sqrt(2*n)+1)*3))*1 by POWER:52;
    42 < n by A2,XXREAL_0:2;
    then 42*2 < n*2 by XREAL_1:68;
    then 81 < 2*n by XXREAL_0:2;
    then
A33: sqrt(81) < sqrt(2*n) by SQUARE_1:27;
    81=9^2;
    then sqrt 81 = 9 by SQUARE_1:22;
    then 9*2 < sqrt(2*n)*2 by A33,XREAL_1:68;
    then 18 + 18*sqrt(2*n) < 2*sqrt(2*n)+18*sqrt(2*n) by XREAL_1:6;
    then
    (18 + 18*sqrt(2*n))*(6-root(2*n)) < 20*sqrt(2*n)*(6-root(2*n)) by A28,
XREAL_1:68;
    then 2*n < 20*(sqrt(2*n)*(6-root(2*n))) by A32,XXREAL_0:2;
    then 2*n < 20*((2-Root(2*n))*(6-root(2*n))) by PREPOWER:32;
    then 2*n < 20*((2-root(2*n))*(6-root(2*n))) by POWER:def 1;
    then 2*n < 20*(((2*n) to_power (1/2))*(6-root(2*n))) by POWER:45;
    then 2*n < 20*(((2*n) to_power (1/2))*((2*n) to_power (1/6))) by POWER:45;
    then
A34: 2*n < 20*((2*n) to_power (1/2+1/6)) by A2,POWER:27;
A35: (2*n) to_power (2/3)<>0 by A2,POWER:34;
    (2*n) to_power (2/3)>0 by A2,POWER:34;
    then (2*n)/((2*n) to_power (2/3)) < 20*((2*n) to_power (2/3))/((2*n)
    to_power (2/3)) by A34,XREAL_1:74;
    then (2*n)/((2*n) to_power (2/3)) < 20 by A35,XCMPLX_1:89;
    then ((2*n) to_power 1)/((2*n) to_power (2/3)) < 20 by POWER:25;
    then
A36: ((2*n) to_power (1-(2/3))) < 20 by A2,POWER:29;
    (2*n) to_power (1/3)>0 by A2,POWER:34;
    then ((2*n) to_power (1/3)) to_power 3 < 20 to_power 3 by A36,POWER:37;
    then ((2*n) to_power ((1/3)*3)) < 20 to_power 3 by A2,POWER:33;
    then 2*n < 20 to_power (2+1) by POWER:25;
    then 2*n < (20 to_power 2)*(20 to_power 1) by POWER:27;
    then 2*n < (20 to_power (1+1))*20 by POWER:25;
    then 2*n < (20 to_power 1)*(20 to_power 1)*20 by POWER:27;
    then 2*n < (20 to_power 1)*20*20 by POWER:25;
    then 2*n < 20*20*20 by POWER:25;
    then 2*n/2 < 8000/2 by XREAL_1:74;
    hence contradiction by A2;
  end;
end;
