Metamath Proof Explorer


Theorem isprm7

Description: One need only check prime divisors of P up to sqrt P in order to ensure primality. This version of isprm5 combines the primality and bound on z into a finite interval of prime numbers. (Contributed by Steve Rodriguez, 20-Jan-2020)

Ref Expression
Assertion isprm7 P P 2 z 2 P ¬ z P

Proof

Step Hyp Ref Expression
1 isprm5 P P 2 z z 2 P ¬ z P
2 prmz z z
3 2 zred z z
4 0red z 0
5 1red z 1
6 0lt1 0 < 1
7 6 a1i z 0 < 1
8 prmgt1 z 1 < z
9 4 5 3 7 8 lttrd z 0 < z
10 4 3 9 ltled z 0 z
11 3 10 jca z z 0 z
12 eluzelre P 2 P
13 0red P 2 0
14 2re 2
15 14 a1i P 2 2
16 0le2 0 2
17 16 a1i P 2 0 2
18 eluzle P 2 2 P
19 13 15 12 17 18 letrd P 2 0 P
20 12 19 jca P 2 P 0 P
21 resqcl z z 2
22 sqge0 z 0 z 2
23 21 22 jca z z 2 0 z 2
24 23 adantr z 0 z z 2 0 z 2
25 sqrtle z 2 0 z 2 P 0 P z 2 P z 2 P
26 24 25 sylan z 0 z P 0 P z 2 P z 2 P
27 sqrtsq z 0 z z 2 = z
28 27 breq1d z 0 z z 2 P z P
29 28 adantr z 0 z P 0 P z 2 P z P
30 26 29 bitrd z 0 z P 0 P z 2 P z P
31 11 20 30 syl2anr P 2 z z 2 P z P
32 31 imbi1d P 2 z z 2 P ¬ z P z P ¬ z P
33 32 ralbidva P 2 z z 2 P ¬ z P z z P ¬ z P
34 33 pm5.32i P 2 z z 2 P ¬ z P P 2 z z P ¬ z P
35 impexp z z P ¬ z P z z P ¬ z P
36 12 19 resqrtcld P 2 P
37 36 flcld P 2 P
38 37 2 anim12i P 2 z P z
39 38 adantr P 2 z z P P z
40 prmuz2 z z 2
41 eluzle z 2 2 z
42 40 41 syl z 2 z
43 42 ad2antlr P 2 z z P 2 z
44 flge P z z P z P
45 36 2 44 syl2an P 2 z z P z P
46 45 biimpa P 2 z z P z P
47 2z 2
48 elfz4 2 P z 2 z z P z 2 P
49 47 48 mp3anl1 P z 2 z z P z 2 P
50 39 43 46 49 syl12anc P 2 z z P z 2 P
51 50 anasss P 2 z z P z 2 P
52 simprl P 2 z z P z
53 51 52 elind P 2 z z P z 2 P
54 53 ex P 2 z z P z 2 P
55 elin z 2 P z 2 P z
56 elfzelz z 2 P z
57 56 zred z 2 P z
58 57 adantl P 2 z 2 P z
59 reflcl P P
60 36 59 syl P 2 P
61 60 adantr P 2 z 2 P P
62 36 adantr P 2 z 2 P P
63 elfzle2 z 2 P z P
64 63 adantl P 2 z 2 P z P
65 flle P P P
66 36 65 syl P 2 P P
67 66 adantr P 2 z 2 P P P
68 58 61 62 64 67 letrd P 2 z 2 P z P
69 68 ex P 2 z 2 P z P
70 69 anim1d P 2 z 2 P z z P z
71 55 70 syl5bi P 2 z 2 P z P z
72 ancom z P z z z P
73 71 72 syl6ib P 2 z 2 P z z P
74 54 73 impbid P 2 z z P z 2 P
75 74 imbi1d P 2 z z P ¬ z P z 2 P ¬ z P
76 35 75 bitr3id P 2 z z P ¬ z P z 2 P ¬ z P
77 76 ralbidv2 P 2 z z P ¬ z P z 2 P ¬ z P
78 77 pm5.32i P 2 z z P ¬ z P P 2 z 2 P ¬ z P
79 1 34 78 3bitri P P 2 z 2 P ¬ z P