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 N
prmlem2.lt N < 841
prmlem2.gt 1 < N
prmlem2.2 ¬ 2 N
prmlem2.3 ¬ 3 N
prmlem2.5 ¬ 5 N
prmlem2.7 ¬ 7 N
prmlem2.11 ¬ 11 N
prmlem2.13 ¬ 13 N
prmlem2.17 ¬ 17 N
prmlem2.19 ¬ 19 N
prmlem2.23 ¬ 23 N
Assertion prmlem2 N

Proof

Step Hyp Ref Expression
1 prmlem2.n N
2 prmlem2.lt N < 841
3 prmlem2.gt 1 < N
4 prmlem2.2 ¬ 2 N
5 prmlem2.3 ¬ 3 N
6 prmlem2.5 ¬ 5 N
7 prmlem2.7 ¬ 7 N
8 prmlem2.11 ¬ 11 N
9 prmlem2.13 ¬ 13 N
10 prmlem2.17 ¬ 17 N
11 prmlem2.19 ¬ 19 N
12 prmlem2.23 ¬ 23 N
13 eluzelre x 29 x
14 13 resqcld x 29 x 2
15 eluzle x 29 29 x
16 2nn0 2 0
17 9nn0 9 0
18 16 17 deccl 29 0
19 18 nn0rei 29
20 18 nn0ge0i 0 29
21 le2sq2 29 0 29 x 29 x 29 2 x 2
22 19 20 21 mpanl12 x 29 x 29 2 x 2
23 13 15 22 syl2anc x 29 29 2 x 2
24 1 nnrei N
25 19 resqcli 29 2
26 18 nn0cni 29
27 26 sqvali 29 2 = 29 29
28 eqid 29 = 29
29 1nn0 1 0
30 6nn0 6 0
31 16 30 deccl 26 0
32 5nn0 5 0
33 8nn0 8 0
34 26 2timesi 2 29 = 29 + 29
35 2p2e4 2 + 2 = 4
36 35 oveq1i 2 + 2 + 1 = 4 + 1
37 4p1e5 4 + 1 = 5
38 36 37 eqtri 2 + 2 + 1 = 5
39 9p9e18 9 + 9 = 18
40 16 17 16 17 28 28 38 33 39 decaddc 29 + 29 = 58
41 34 40 eqtri 2 29 = 58
42 eqid 26 = 26
43 5p2e7 5 + 2 = 7
44 43 oveq1i 5 + 2 + 1 = 7 + 1
45 7p1e8 7 + 1 = 8
46 44 45 eqtri 5 + 2 + 1 = 8
47 4nn0 4 0
48 8p6e14 8 + 6 = 14
49 32 33 16 30 41 42 46 47 48 decaddc 2 29 + 26 = 84
50 9t2e18 9 2 = 18
51 1p1e2 1 + 1 = 2
52 8p8e16 8 + 8 = 16
53 29 33 33 50 51 30 52 decaddci 9 2 + 8 = 26
54 9t9e81 9 9 = 81
55 17 16 17 28 29 33 53 54 decmul2c 9 29 = 261
56 18 16 17 28 29 31 49 55 decmul1c 29 29 = 841
57 27 56 eqtri 29 2 = 841
58 2 57 breqtrri N < 29 2
59 ltletr N 29 2 x 2 N < 29 2 29 2 x 2 N < x 2
60 58 59 mpani N 29 2 x 2 29 2 x 2 N < x 2
61 24 25 60 mp3an12 x 2 29 2 x 2 N < x 2
62 14 23 61 sylc x 29 N < x 2
63 ltnle N x 2 N < x 2 ¬ x 2 N
64 24 14 63 sylancr x 29 N < x 2 ¬ x 2 N
65 62 64 mpbid x 29 ¬ x 2 N
66 65 pm2.21d x 29 x 2 N ¬ x N
67 66 adantld x 29 x 2 x 2 N ¬ x N
68 67 adantl ¬ 2 29 x 29 x 2 x 2 N ¬ x N
69 9nn 9
70 3nn 3
71 1lt9 1 < 9
72 1lt3 1 < 3
73 9t3e27 9 3 = 27
74 69 70 71 72 73 nprmi ¬ 27
75 74 pm2.21i 27 ¬ 27 N
76 7nn0 7 0
77 eqid 27 = 27
78 7p2e9 7 + 2 = 9
79 16 76 16 77 78 decaddi 27 + 2 = 29
80 68 75 79 prmlem0 ¬ 2 27 x 27 x 2 x 2 N ¬ x N
81 5nn 5
82 1lt5 1 < 5
83 5t5e25 5 5 = 25
84 81 81 82 82 83 nprmi ¬ 25
85 84 pm2.21i 25 ¬ 25 N
86 eqid 25 = 25
87 16 32 16 86 43 decaddi 25 + 2 = 27
88 80 85 87 prmlem0 ¬ 2 25 x 25 x 2 x 2 N ¬ x N
89 12 a1i 23 ¬ 23 N
90 3nn0 3 0
91 eqid 23 = 23
92 3p2e5 3 + 2 = 5
93 16 90 16 91 92 decaddi 23 + 2 = 25
94 88 89 93 prmlem0 ¬ 2 23 x 23 x 2 x 2 N ¬ x N
95 7nn 7
96 1lt7 1 < 7
97 7t3e21 7 3 = 21
98 95 70 96 72 97 nprmi ¬ 21
99 98 pm2.21i 21 ¬ 21 N
100 eqid 21 = 21
101 1p2e3 1 + 2 = 3
102 16 29 16 100 101 decaddi 21 + 2 = 23
103 94 99 102 prmlem0 ¬ 2 21 x 21 x 2 x 2 N ¬ x N
104 11 a1i 19 ¬ 19 N
105 eqid 19 = 19
106 9p2e11 9 + 2 = 11
107 29 17 16 105 51 29 106 decaddci 19 + 2 = 21
108 103 104 107 prmlem0 ¬ 2 19 x 19 x 2 x 2 N ¬ x N
109 10 a1i 17 ¬ 17 N
110 eqid 17 = 17
111 29 76 16 110 78 decaddi 17 + 2 = 19
112 108 109 111 prmlem0 ¬ 2 17 x 17 x 2 x 2 N ¬ x N
113 5t3e15 5 3 = 15
114 81 70 82 72 113 nprmi ¬ 15
115 114 pm2.21i 15 ¬ 15 N
116 eqid 15 = 15
117 29 32 16 116 43 decaddi 15 + 2 = 17
118 112 115 117 prmlem0 ¬ 2 15 x 15 x 2 x 2 N ¬ x N
119 9 a1i 13 ¬ 13 N
120 eqid 13 = 13
121 29 90 16 120 92 decaddi 13 + 2 = 15
122 118 119 121 prmlem0 ¬ 2 13 x 13 x 2 x 2 N ¬ x N
123 8 a1i 11 ¬ 11 N
124 eqid 11 = 11
125 29 29 16 124 101 decaddi 11 + 2 = 13
126 122 123 125 prmlem0 ¬ 2 11 x 11 x 2 x 2 N ¬ x N
127 9nprm ¬ 9
128 127 pm2.21i 9 ¬ 9 N
129 126 128 106 prmlem0 ¬ 2 9 x 9 x 2 x 2 N ¬ x N
130 7 a1i 7 ¬ 7 N
131 129 130 78 prmlem0 ¬ 2 7 x 7 x 2 x 2 N ¬ x N
132 6 a1i 5 ¬ 5 N
133 131 132 43 prmlem0 ¬ 2 5 x 5 x 2 x 2 N ¬ x N
134 1 3 4 5 133 prmlem1a N