Metamath Proof Explorer


Theorem pc2dvds

Description: A characterization of divisibility in terms of prime count. (Contributed by Mario Carneiro, 23-Feb-2014) (Revised by Mario Carneiro, 3-Oct-2014)

Ref Expression
Assertion pc2dvds ABABpppCntAppCntB

Proof

Step Hyp Ref Expression
1 pcdvdstr pABABppCntAppCntB
2 1 ancoms ABABpppCntAppCntB
3 2 ralrimiva ABABpppCntAppCntB
4 3 3expia ABABpppCntAppCntB
5 oveq2 A=0ppCntA=ppCnt0
6 5 breq1d A=0ppCntAppCntBppCnt0ppCntB
7 6 ralbidv A=0pppCntAppCntBpppCnt0ppCntB
8 breq1 A=0AB0B
9 7 8 imbi12d A=0pppCntAppCntBABpppCnt0ppCntB0B
10 gcddvds ABAgcdBAAgcdBB
11 10 simpld ABAgcdBA
12 gcdcl ABAgcdB0
13 12 nn0zd ABAgcdB
14 simpl ABA
15 dvdsabsb AgcdBAAgcdBAAgcdBA
16 13 14 15 syl2anc ABAgcdBAAgcdBA
17 11 16 mpbid ABAgcdBA
18 17 adantr ABA0AgcdBA
19 simpl A=0B=0A=0
20 19 necon3ai A0¬A=0B=0
21 gcdn0cl AB¬A=0B=0AgcdB
22 20 21 sylan2 ABA0AgcdB
23 22 nnzd ABA0AgcdB
24 22 nnne0d ABA0AgcdB0
25 nnabscl AA0A
26 25 adantlr ABA0A
27 26 nnzd ABA0A
28 dvdsval2 AgcdBAgcdB0AAgcdBAAAgcdB
29 23 24 27 28 syl3anc ABA0AgcdBAAAgcdB
30 18 29 mpbid ABA0AAgcdB
31 nnre AA
32 nngt0 A0<A
33 31 32 jca AA0<A
34 nnre AgcdBAgcdB
35 nngt0 AgcdB0<AgcdB
36 34 35 jca AgcdBAgcdB0<AgcdB
37 divgt0 A0<AAgcdB0<AgcdB0<AAgcdB
38 33 36 37 syl2an AAgcdB0<AAgcdB
39 26 22 38 syl2anc ABA00<AAgcdB
40 elnnz AAgcdBAAgcdB0<AAgcdB
41 30 39 40 sylanbrc ABA0AAgcdB
42 elnn1uz2 AAgcdBAAgcdB=1AAgcdB2
43 41 42 sylib ABA0AAgcdB=1AAgcdB2
44 10 simprd ABAgcdBB
45 44 adantr ABA0AgcdBB
46 breq1 AgcdB=AAgcdBBAB
47 45 46 syl5ibcom ABA0AgcdB=AAB
48 26 nncnd ABA0A
49 22 nncnd ABA0AgcdB
50 1cnd ABA01
51 48 49 50 24 divmuld ABA0AAgcdB=1AgcdB1=A
52 49 mulridd ABA0AgcdB1=AgcdB
53 52 eqeq1d ABA0AgcdB1=AAgcdB=A
54 51 53 bitrd ABA0AAgcdB=1AgcdB=A
55 absdvdsb ABABAB
56 55 adantr ABA0ABAB
57 47 54 56 3imtr4d ABA0AAgcdB=1AB
58 exprmfct AAgcdB2ppAAgcdB
59 simprl ABA0ppAAgcdBp
60 26 adantr ABA0ppAAgcdBA
61 60 nnzd ABA0ppAAgcdBA
62 60 nnne0d ABA0ppAAgcdBA0
63 22 adantr ABA0ppAAgcdBAgcdB
64 pcdiv pAA0AgcdBppCntAAgcdB=ppCntAppCntAgcdB
65 59 61 62 63 64 syl121anc ABA0ppAAgcdBppCntAAgcdB=ppCntAppCntAgcdB
66 simplll ABA0ppAAgcdBA
67 zq AA
68 66 67 syl ABA0ppAAgcdBA
69 pcabs pAppCntA=ppCntA
70 59 68 69 syl2anc ABA0ppAAgcdBppCntA=ppCntA
71 70 oveq1d ABA0ppAAgcdBppCntAppCntAgcdB=ppCntAppCntAgcdB
72 65 71 eqtrd ABA0ppAAgcdBppCntAAgcdB=ppCntAppCntAgcdB
73 simprr ABA0ppAAgcdBpAAgcdB
74 41 adantr ABA0ppAAgcdBAAgcdB
75 pcelnn pAAgcdBppCntAAgcdBpAAgcdB
76 59 74 75 syl2anc ABA0ppAAgcdBppCntAAgcdBpAAgcdB
77 73 76 mpbird ABA0ppAAgcdBppCntAAgcdB
78 72 77 eqeltrrd ABA0ppAAgcdBppCntAppCntAgcdB
79 59 63 pccld ABA0ppAAgcdBppCntAgcdB0
80 79 nn0zd ABA0ppAAgcdBppCntAgcdB
81 simplr ABA0ppAAgcdBA0
82 pczcl pAA0ppCntA0
83 59 66 81 82 syl12anc ABA0ppAAgcdBppCntA0
84 83 nn0zd ABA0ppAAgcdBppCntA
85 znnsub ppCntAgcdBppCntAppCntAgcdB<ppCntAppCntAppCntAgcdB
86 80 84 85 syl2anc ABA0ppAAgcdBppCntAgcdB<ppCntAppCntAppCntAgcdB
87 78 86 mpbird ABA0ppAAgcdBppCntAgcdB<ppCntA
88 79 nn0red ABA0ppAAgcdBppCntAgcdB
89 83 nn0red ABA0ppAAgcdBppCntA
90 88 89 ltnled ABA0ppAAgcdBppCntAgcdB<ppCntA¬ppCntAppCntAgcdB
91 87 90 mpbid ABA0ppAAgcdB¬ppCntAppCntAgcdB
92 simpllr ABA0ppAAgcdBB
93 nprmdvds1 p¬p1
94 93 ad2antrl ABA0ppAAgcdB¬p1
95 gcdid0 AAgcd0=A
96 66 95 syl ABA0ppAAgcdBAgcd0=A
97 96 oveq2d ABA0ppAAgcdBAAgcd0=AA
98 48 adantr ABA0ppAAgcdBA
99 98 62 dividd ABA0ppAAgcdBAA=1
100 97 99 eqtrd ABA0ppAAgcdBAAgcd0=1
101 100 breq2d ABA0ppAAgcdBpAAgcd0p1
102 94 101 mtbird ABA0ppAAgcdB¬pAAgcd0
103 oveq2 B=0AgcdB=Agcd0
104 103 oveq2d B=0AAgcdB=AAgcd0
105 104 breq2d B=0pAAgcdBpAAgcd0
106 73 105 syl5ibcom ABA0ppAAgcdBB=0pAAgcd0
107 106 necon3bd ABA0ppAAgcdB¬pAAgcd0B0
108 102 107 mpd ABA0ppAAgcdBB0
109 pczcl pBB0ppCntB0
110 59 92 108 109 syl12anc ABA0ppAAgcdBppCntB0
111 110 nn0red ABA0ppAAgcdBppCntB
112 lemin ppCntAppCntAppCntBppCntAifppCntAppCntBppCntAppCntBppCntAppCntAppCntAppCntB
113 89 89 111 112 syl3anc ABA0ppAAgcdBppCntAifppCntAppCntBppCntAppCntBppCntAppCntAppCntAppCntB
114 pcgcd pABppCntAgcdB=ifppCntAppCntBppCntAppCntB
115 59 66 92 114 syl3anc ABA0ppAAgcdBppCntAgcdB=ifppCntAppCntBppCntAppCntB
116 115 breq2d ABA0ppAAgcdBppCntAppCntAgcdBppCntAifppCntAppCntBppCntAppCntB
117 89 leidd ABA0ppAAgcdBppCntAppCntA
118 117 biantrurd ABA0ppAAgcdBppCntAppCntBppCntAppCntAppCntAppCntB
119 113 116 118 3bitr4rd ABA0ppAAgcdBppCntAppCntBppCntAppCntAgcdB
120 91 119 mtbird ABA0ppAAgcdB¬ppCntAppCntB
121 120 expr ABA0ppAAgcdB¬ppCntAppCntB
122 121 reximdva ABA0ppAAgcdBp¬ppCntAppCntB
123 rexnal p¬ppCntAppCntB¬pppCntAppCntB
124 122 123 imbitrdi ABA0ppAAgcdB¬pppCntAppCntB
125 58 124 syl5 ABA0AAgcdB2¬pppCntAppCntB
126 57 125 orim12d ABA0AAgcdB=1AAgcdB2AB¬pppCntAppCntB
127 43 126 mpd ABA0AB¬pppCntAppCntB
128 127 ord ABA0¬AB¬pppCntAppCntB
129 128 con4d ABA0pppCntAppCntBAB
130 2prm 2
131 130 ne0ii
132 r19.2z pppCnt0ppCntBpppCnt0ppCntB
133 131 132 mpan pppCnt0ppCntBpppCnt0ppCntB
134 id pp
135 zq BB
136 135 adantl ABB
137 pcxcl pBppCntB*
138 134 136 137 syl2anr ABpppCntB*
139 pnfge ppCntB*ppCntB+∞
140 138 139 syl ABpppCntB+∞
141 140 biantrurd ABp+∞ppCntBppCntB+∞+∞ppCntB
142 pc0 pppCnt0=+∞
143 142 adantl ABpppCnt0=+∞
144 143 breq1d ABpppCnt0ppCntB+∞ppCntB
145 pnfxr +∞*
146 xrletri3 ppCntB*+∞*ppCntB=+∞ppCntB+∞+∞ppCntB
147 138 145 146 sylancl ABpppCntB=+∞ppCntB+∞+∞ppCntB
148 141 144 147 3bitr4d ABpppCnt0ppCntBppCntB=+∞
149 pnfnre +∞
150 149 neli ¬+∞
151 eleq1 ppCntB=+∞ppCntB+∞
152 150 151 mtbiri ppCntB=+∞¬ppCntB
153 109 nn0red pBB0ppCntB
154 153 adantll ApBB0ppCntB
155 154 an4s ABpB0ppCntB
156 155 expr ABpB0ppCntB
157 156 necon1bd ABp¬ppCntBB=0
158 152 157 syl5 ABpppCntB=+∞B=0
159 148 158 sylbid ABpppCnt0ppCntBB=0
160 159 rexlimdva ABpppCnt0ppCntBB=0
161 0dvds B0BB=0
162 161 adantl AB0BB=0
163 160 162 sylibrd ABpppCnt0ppCntB0B
164 133 163 syl5 ABpppCnt0ppCntB0B
165 9 129 164 pm2.61ne ABpppCntAppCntBAB
166 4 165 impbid ABABpppCntAppCntB