Metamath Proof Explorer


Theorem prmgaplem3

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

Ref Expression
Hypothesis prmgaplem3.a A = p | p < N
Assertion prmgaplem3 N 3 x A y A y x

Proof

Step Hyp Ref Expression
1 prmgaplem3.a A = p | p < N
2 ssrab2 p | p < N
3 2 a1i N 3 p | p < N
4 prmssnn
5 nnssre
6 4 5 sstri
7 3 6 sstrdi N 3 p | p < N
8 fzofi 0 ..^ N Fin
9 breq1 p = i p < N i < N
10 9 elrab i p | p < N i i < N
11 prmnn i i
12 11 nnnn0d i i 0
13 12 ad2antrl N 3 i i < N i 0
14 eluzge3nn N 3 N
15 14 adantr N 3 i i < N N
16 simprr N 3 i i < N i < N
17 elfzo0 i 0 ..^ N i 0 N i < N
18 13 15 16 17 syl3anbrc N 3 i i < N i 0 ..^ N
19 18 ex N 3 i i < N i 0 ..^ N
20 10 19 syl5bi N 3 i p | p < N i 0 ..^ N
21 20 ssrdv N 3 p | p < N 0 ..^ N
22 ssfi 0 ..^ N Fin p | p < N 0 ..^ N p | p < N Fin
23 8 21 22 sylancr N 3 p | p < N Fin
24 breq1 p = 2 p < N 2 < N
25 2prm 2
26 25 a1i N 3 2
27 eluz2 N 3 3 N 3 N
28 df-3 3 = 2 + 1
29 28 breq1i 3 N 2 + 1 N
30 2z 2
31 zltp1le 2 N 2 < N 2 + 1 N
32 30 31 mpan N 2 < N 2 + 1 N
33 32 biimprd N 2 + 1 N 2 < N
34 29 33 syl5bi N 3 N 2 < N
35 34 imp N 3 N 2 < N
36 35 3adant1 3 N 3 N 2 < N
37 27 36 sylbi N 3 2 < N
38 24 26 37 elrabd N 3 2 p | p < N
39 38 ne0d N 3 p | p < N
40 sseq1 A = p | p < N A p | p < N
41 eleq1 A = p | p < N A Fin p | p < N Fin
42 neeq1 A = p | p < N A p | p < N
43 40 41 42 3anbi123d A = p | p < N A A Fin A p | p < N p | p < N Fin p | p < N
44 1 43 ax-mp A A Fin A p | p < N p | p < N Fin p | p < N
45 7 23 39 44 syl3anbrc N 3 A A Fin A
46 fimaxre A A Fin A x A y A y x
47 45 46 syl N 3 x A y A y x