Metamath Proof Explorer


Theorem prmlem2

Description: Our last proving session got as far as 25 because we started with the two "bootstrap" primes 2 and 3, and the next prime is 5, so knowing that 2 and 3 are prime and 4 is not allows us to cover the numbers less than 5 ^ 2 = 2 5 . Additionally, nonprimes are "easy", so we can extend this range of known prime/nonprimes all the way until 29, which is the first prime larger than 25. Thus, in this lemma we extend another blanket out to 2 9 ^ 2 = 8 4 1 , from which we can prove even more primes. If we wanted, we could keep doing this, but the goal is Bertrand's postulate, and for that we only need a few large primes - we don't need to find them all, as we have been doing thus far. So after this blanket runs out, we'll have to switch to another method (see 1259prm ).

As a side note, you can see the pattern of the primes in the indentation pattern of this lemma! (Contributed by Mario Carneiro, 18-Feb-2014) (Proof shortened by Mario Carneiro, 20-Apr-2015)

Ref Expression
Hypotheses prmlem2.n 𝑁 ∈ ℕ
prmlem2.lt 𝑁 < 8 4 1
prmlem2.gt 1 < 𝑁
prmlem2.2 ¬ 2 ∥ 𝑁
prmlem2.3 ¬ 3 ∥ 𝑁
prmlem2.5 ¬ 5 ∥ 𝑁
prmlem2.7 ¬ 7 ∥ 𝑁
prmlem2.11 ¬ 1 1 ∥ 𝑁
prmlem2.13 ¬ 1 3 ∥ 𝑁
prmlem2.17 ¬ 1 7 ∥ 𝑁
prmlem2.19 ¬ 1 9 ∥ 𝑁
prmlem2.23 ¬ 2 3 ∥ 𝑁
Assertion prmlem2 𝑁 ∈ ℙ

Proof

Step Hyp Ref Expression
1 prmlem2.n 𝑁 ∈ ℕ
2 prmlem2.lt 𝑁 < 8 4 1
3 prmlem2.gt 1 < 𝑁
4 prmlem2.2 ¬ 2 ∥ 𝑁
5 prmlem2.3 ¬ 3 ∥ 𝑁
6 prmlem2.5 ¬ 5 ∥ 𝑁
7 prmlem2.7 ¬ 7 ∥ 𝑁
8 prmlem2.11 ¬ 1 1 ∥ 𝑁
9 prmlem2.13 ¬ 1 3 ∥ 𝑁
10 prmlem2.17 ¬ 1 7 ∥ 𝑁
11 prmlem2.19 ¬ 1 9 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 𝑁 < ( 𝑥 ↑ 2 ) ) )
62 14 23 61 sylc ( 𝑥 ∈ ( ℤ 2 9 ) → 𝑁 < ( 𝑥 ↑ 2 ) )
63 ltnle ( ( 𝑁 ∈ ℝ ∧ ( 𝑥 ↑ 2 ) ∈ ℝ ) → ( 𝑁 < ( 𝑥 ↑ 2 ) ↔ ¬ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) )
64 24 14 63 sylancr ( 𝑥 ∈ ( ℤ 2 9 ) → ( 𝑁 < ( 𝑥 ↑ 2 ) ↔ ¬ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) )
65 62 64 mpbid ( 𝑥 ∈ ( ℤ 2 9 ) → ¬ ( 𝑥 ↑ 2 ) ≤ 𝑁 )
66 65 pm2.21d ( 𝑥 ∈ ( ℤ 2 9 ) → ( ( 𝑥 ↑ 2 ) ≤ 𝑁 → ¬ 𝑥𝑁 ) )
67 66 adantld ( 𝑥 ∈ ( ℤ 2 9 ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
68 67 adantl ( ( ¬ 2 ∥ 2 9 ∧ 𝑥 ∈ ( ℤ 2 9 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
69 9nn 9 ∈ ℕ
70 3nn 3 ∈ ℕ
71 1lt9 1 < 9
72 1lt3 1 < 3
73 9t3e27 ( 9 · 3 ) = 2 7
74 69 70 71 72 73 nprmi ¬ 2 7 ∈ ℙ
75 74 pm2.21i ( 2 7 ∈ ℙ → ¬ 2 7 ∥ 𝑁 )
76 7nn0 7 ∈ ℕ0
77 eqid 2 7 = 2 7
78 7p2e9 ( 7 + 2 ) = 9
79 16 76 16 77 78 decaddi ( 2 7 + 2 ) = 2 9
80 68 75 79 prmlem0 ( ( ¬ 2 ∥ 2 7 ∧ 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2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
104 11 a1i ( 1 9 ∈ ℙ → ¬ 1 9 ∥ 𝑁 )
105 eqid 1 9 = 1 9
106 9p2e11 ( 9 + 2 ) = 1 1
107 29 17 16 105 51 29 106 decaddci ( 1 9 + 2 ) = 2 1
108 103 104 107 prmlem0 ( ( ¬ 2 ∥ 1 9 ∧ 𝑥 ∈ ( ℤ 1 9 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
109 10 a1i ( 1 7 ∈ ℙ → ¬ 1 7 ∥ 𝑁 )
110 eqid 1 7 = 1 7
111 29 76 16 110 78 decaddi ( 1 7 + 2 ) = 1 9
112 108 109 111 prmlem0 ( ( ¬ 2 ∥ 1 7 ∧ 𝑥 ∈ ( ℤ 1 7 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
113 5t3e15 ( 5 · 3 ) = 1 5
114 81 70 82 72 113 nprmi ¬ 1 5 ∈ ℙ
115 114 pm2.21i ( 1 5 ∈ ℙ → ¬ 1 5 ∥ 𝑁 )
116 eqid 1 5 = 1 5
117 29 32 16 116 43 decaddi ( 1 5 + 2 ) = 1 7
118 112 115 117 prmlem0 ( ( ¬ 2 ∥ 1 5 ∧ 𝑥 ∈ ( ℤ 1 5 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
119 9 a1i ( 1 3 ∈ ℙ → ¬ 1 3 ∥ 𝑁 )
120 eqid 1 3 = 1 3
121 29 90 16 120 92 decaddi ( 1 3 + 2 ) = 1 5
122 118 119 121 prmlem0 ( ( ¬ 2 ∥ 1 3 ∧ 𝑥 ∈ ( ℤ 1 3 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
123 8 a1i ( 1 1 ∈ ℙ → ¬ 1 1 ∥ 𝑁 )
124 eqid 1 1 = 1 1
125 29 29 16 124 101 decaddi ( 1 1 + 2 ) = 1 3
126 122 123 125 prmlem0 ( ( ¬ 2 ∥ 1 1 ∧ 𝑥 ∈ ( ℤ 1 1 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
127 9nprm ¬ 9 ∈ ℙ
128 127 pm2.21i ( 9 ∈ ℙ → ¬ 9 ∥ 𝑁 )
129 126 128 106 prmlem0 ( ( ¬ 2 ∥ 9 ∧ 𝑥 ∈ ( ℤ ‘ 9 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
130 7 a1i ( 7 ∈ ℙ → ¬ 7 ∥ 𝑁 )
131 129 130 78 prmlem0 ( ( ¬ 2 ∥ 7 ∧ 𝑥 ∈ ( ℤ ‘ 7 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
132 6 a1i ( 5 ∈ ℙ → ¬ 5 ∥ 𝑁 )
133 131 132 43 prmlem0 ( ( ¬ 2 ∥ 5 ∧ 𝑥 ∈ ( ℤ ‘ 5 ) ) → ( ( 𝑥 ∈ ( ℙ ∖ { 2 } ) ∧ ( 𝑥 ↑ 2 ) ≤ 𝑁 ) → ¬ 𝑥𝑁 ) )
134 1 3 4 5 133 prmlem1a 𝑁 ∈ ℙ