Metamath Proof Explorer


Theorem prmgaplem8

Description: Lemma for prmgap . (Contributed by AV, 13-Aug-2020)

Ref Expression
Hypotheses prmgaplem7.n φ N
prmgaplem7.f φ F
prmgaplem7.i φ i 2 N 1 < F N + i gcd i
Assertion prmgaplem8 φ p q N q p z p + 1 ..^ q z

Proof

Step Hyp Ref Expression
1 prmgaplem7.n φ N
2 prmgaplem7.f φ F
3 prmgaplem7.i φ i 2 N 1 < F N + i gcd i
4 prmnn q q
5 4 nnred q q
6 5 ad2antll p < F N + 2 F N + N < q φ p q q
7 prmnn p p
8 7 nnred p p
9 8 ad2antlr φ p q p
10 9 adantl p < F N + 2 F N + N < q φ p q p
11 1 nnred φ N
12 11 ad2antrr φ p q N
13 12 adantl p < F N + 2 F N + N < q φ p q N
14 elmapi F F :
15 ffvelrn F : N F N
16 15 ex F : N F N
17 2 14 16 3syl φ N F N
18 1 17 mpd φ F N
19 18 nnred φ F N
20 19 ad2antrr φ p q F N
21 20 adantl p < F N + 2 F N + N < q φ p q F N
22 1red p < F N + 2 F N + N < q φ p q 1
23 21 22 readdcld p < F N + 2 F N + N < q φ p q F N + 1
24 18 nncnd φ F N
25 1cnd φ 1
26 1 nncnd φ N
27 24 25 26 add32d φ F N + 1 + N = F N + N + 1
28 27 adantr φ p F N + 1 + N = F N + N + 1
29 28 ad2antrr φ p q F N + N < q F N + 1 + N = F N + N + 1
30 18 nnzd φ F N
31 30 adantr φ p F N
32 1 nnzd φ N
33 32 adantr φ p N
34 31 33 zaddcld φ p F N + N
35 prmz q q
36 zltp1le F N + N q F N + N < q F N + N + 1 q
37 34 35 36 syl2an φ p q F N + N < q F N + N + 1 q
38 37 biimpa φ p q F N + N < q F N + N + 1 q
39 29 38 eqbrtrd φ p q F N + N < q F N + 1 + N q
40 39 expcom F N + N < q φ p q F N + 1 + N q
41 40 adantl p < F N + 2 F N + N < q φ p q F N + 1 + N q
42 41 imp p < F N + 2 F N + N < q φ p q F N + 1 + N q
43 df-2 2 = 1 + 1
44 43 a1i φ 2 = 1 + 1
45 44 oveq2d φ F N + 2 = F N + 1 + 1
46 24 25 25 addassd φ F N + 1 + 1 = F N + 1 + 1
47 45 46 eqtr4d φ F N + 2 = F N + 1 + 1
48 47 adantr φ p F N + 2 = F N + 1 + 1
49 48 breq2d φ p p < F N + 2 p < F N + 1 + 1
50 prmz p p
51 30 peano2zd φ F N + 1
52 zleltp1 p F N + 1 p F N + 1 p < F N + 1 + 1
53 50 51 52 syl2anr φ p p F N + 1 p < F N + 1 + 1
54 53 biimprd φ p p < F N + 1 + 1 p F N + 1
55 49 54 sylbid φ p p < F N + 2 p F N + 1
56 55 adantr φ p q p < F N + 2 p F N + 1
57 56 com12 p < F N + 2 φ p q p F N + 1
58 57 adantr p < F N + 2 F N + N < q φ p q p F N + 1
59 58 imp p < F N + 2 F N + N < q φ p q p F N + 1
60 6 10 13 23 42 59 lesub3d p < F N + 2 F N + N < q φ p q N q p
61 60 ex p < F N + 2 F N + N < q φ p q N q p
62 61 3adant3 p < F N + 2 F N + N < q z p + 1 ..^ q z φ p q N q p
63 62 impcom φ p q p < F N + 2 F N + N < q z p + 1 ..^ q z N q p
64 simpr3 φ p q p < F N + 2 F N + N < q z p + 1 ..^ q z z p + 1 ..^ q z
65 63 64 jca φ p q p < F N + 2 F N + N < q z p + 1 ..^ q z N q p z p + 1 ..^ q z
66 1 2 3 prmgaplem7 φ p q p < F N + 2 F N + N < q z p + 1 ..^ q z
67 65 66 reximddv2 φ p q N q p z p + 1 ..^ q z