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 PP2z2P¬zP

Proof

Step Hyp Ref Expression
1 isprm5 PP2zz2P¬zP
2 prmz zz
3 2 zred zz
4 0red z0
5 1red z1
6 0lt1 0<1
7 6 a1i z0<1
8 prmgt1 z1<z
9 4 5 3 7 8 lttrd z0<z
10 4 3 9 ltled z0z
11 3 10 jca zz0z
12 eluzelre P2P
13 0red P20
14 2re 2
15 14 a1i P22
16 0le2 02
17 16 a1i P202
18 eluzle P22P
19 13 15 12 17 18 letrd P20P
20 12 19 jca P2P0P
21 resqcl zz2
22 sqge0 z0z2
23 21 22 jca zz20z2
24 23 adantr z0zz20z2
25 sqrtle z20z2P0Pz2Pz2P
26 24 25 sylan z0zP0Pz2Pz2P
27 sqrtsq z0zz2=z
28 27 breq1d z0zz2PzP
29 28 adantr z0zP0Pz2PzP
30 26 29 bitrd z0zP0Pz2PzP
31 11 20 30 syl2anr P2zz2PzP
32 31 imbi1d P2zz2P¬zPzP¬zP
33 32 ralbidva P2zz2P¬zPzzP¬zP
34 33 pm5.32i P2zz2P¬zPP2zzP¬zP
35 impexp zzP¬zPzzP¬zP
36 12 19 resqrtcld P2P
37 36 flcld P2P
38 37 2 anim12i P2zPz
39 38 adantr P2zzPPz
40 prmuz2 zz2
41 eluzle z22z
42 40 41 syl z2z
43 42 ad2antlr P2zzP2z
44 flge PzzPzP
45 36 2 44 syl2an P2zzPzP
46 45 biimpa P2zzPzP
47 2z 2
48 elfz4 2Pz2zzPz2P
49 47 48 mp3anl1 Pz2zzPz2P
50 39 43 46 49 syl12anc P2zzPz2P
51 50 anasss P2zzPz2P
52 simprl P2zzPz
53 51 52 elind P2zzPz2P
54 53 ex P2zzPz2P
55 elin z2Pz2Pz
56 elfzelz z2Pz
57 56 zred z2Pz
58 57 adantl P2z2Pz
59 reflcl PP
60 36 59 syl P2P
61 60 adantr P2z2PP
62 36 adantr P2z2PP
63 elfzle2 z2PzP
64 63 adantl P2z2PzP
65 flle PPP
66 36 65 syl P2PP
67 66 adantr P2z2PPP
68 58 61 62 64 67 letrd P2z2PzP
69 68 ex P2z2PzP
70 69 anim1d P2z2PzzPz
71 55 70 biimtrid P2z2PzPz
72 ancom zPzzzP
73 71 72 imbitrdi P2z2PzzP
74 54 73 impbid P2zzPz2P
75 74 imbi1d P2zzP¬zPz2P¬zP
76 35 75 bitr3id P2zzP¬zPz2P¬zP
77 76 ralbidv2 P2zzP¬zPz2P¬zP
78 77 pm5.32i P2zzP¬zPP2z2P¬zP
79 1 34 78 3bitri PP2z2P¬zP