Metamath Proof Explorer


Theorem 2sqlem6

Description: Lemma for 2sq . If a number that is a sum of two squares is divisible by a number whose prime divisors are all sums of two squares, then the quotient is a sum of two squares. (Contributed by Mario Carneiro, 20-Jun-2015)

Ref Expression
Hypotheses 2sq.1 S=ranwiw2
2sqlem6.1 φA
2sqlem6.2 φB
2sqlem6.3 φppBpS
2sqlem6.4 φABS
Assertion 2sqlem6 φAS

Proof

Step Hyp Ref Expression
1 2sq.1 S=ranwiw2
2 2sqlem6.1 φA
3 2sqlem6.2 φB
4 2sqlem6.3 φppBpS
5 2sqlem6.4 φABS
6 breq2 x=1pxp1
7 6 imbi1d x=1pxpSp1pS
8 7 ralbidv x=1ppxpSpp1pS
9 oveq2 x=1mx=m1
10 9 eleq1d x=1mxSm1S
11 10 imbi1d x=1mxSmSm1SmS
12 11 ralbidv x=1mmxSmSmm1SmS
13 8 12 imbi12d x=1ppxpSmmxSmSpp1pSmm1SmS
14 breq2 x=ypxpy
15 14 imbi1d x=ypxpSpypS
16 15 ralbidv x=yppxpSppypS
17 oveq2 x=ymx=my
18 17 eleq1d x=ymxSmyS
19 18 imbi1d x=ymxSmSmySmS
20 19 ralbidv x=ymmxSmSmmySmS
21 16 20 imbi12d x=yppxpSmmxSmSppypSmmySmS
22 breq2 x=zpxpz
23 22 imbi1d x=zpxpSpzpS
24 23 ralbidv x=zppxpSppzpS
25 oveq2 x=zmx=mz
26 25 eleq1d x=zmxSmzS
27 26 imbi1d x=zmxSmSmzSmS
28 27 ralbidv x=zmmxSmSmmzSmS
29 24 28 imbi12d x=zppxpSmmxSmSppzpSmmzSmS
30 breq2 x=yzpxpyz
31 30 imbi1d x=yzpxpSpyzpS
32 31 ralbidv x=yzppxpSppyzpS
33 oveq2 x=yzmx=myz
34 33 eleq1d x=yzmxSmyzS
35 34 imbi1d x=yzmxSmSmyzSmS
36 35 ralbidv x=yzmmxSmSmmyzSmS
37 32 36 imbi12d x=yzppxpSmmxSmSppyzpSmmyzSmS
38 breq2 x=BpxpB
39 38 imbi1d x=BpxpSpBpS
40 39 ralbidv x=BppxpSppBpS
41 oveq2 x=Bmx=mB
42 41 eleq1d x=BmxSmBS
43 42 imbi1d x=BmxSmSmBSmS
44 43 ralbidv x=BmmxSmSmmBSmS
45 40 44 imbi12d x=BppxpSmmxSmSppBpSmmBSmS
46 nncn mm
47 46 mulridd mm1=m
48 47 eleq1d mm1SmS
49 48 biimpd mm1SmS
50 49 rgen mm1SmS
51 50 a1i pp1pSmm1SmS
52 breq1 p=xpxxx
53 eleq1 p=xpSxS
54 52 53 imbi12d p=xpxpSxxxS
55 54 rspcv xppxpSxxxS
56 prmz xx
57 iddvds xxx
58 56 57 syl xxx
59 simprl xxSmmxSm
60 simpll xxSmmxSx
61 simprr xxSmmxSmxS
62 simplr xxSmmxSxS
63 1 59 60 61 62 2sqlem5 xxSmmxSmS
64 63 expr xxSmmxSmS
65 64 ralrimiva xxSmmxSmS
66 65 ex xxSmmxSmS
67 58 66 embantd xxxxSmmxSmS
68 55 67 syld xppxpSmmxSmS
69 anim12 ppypSmmySmSppzpSmmzSmSppypSppzpSmmySmSmmzSmS
70 simpr y2z2pp
71 eluzelz y2y
72 71 ad2antrr y2z2py
73 eluzelz z2z
74 73 ad2antlr y2z2pz
75 euclemma pyzpyzpypz
76 70 72 74 75 syl3anc y2z2ppyzpypz
77 76 imbi1d y2z2ppyzpSpypzpS
78 jaob pypzpSpypSpzpS
79 77 78 bitrdi y2z2ppyzpSpypSpzpS
80 79 ralbidva y2z2ppyzpSppypSpzpS
81 r19.26 ppypSpzpSppypSppzpS
82 80 81 bitrdi y2z2ppyzpSppypSppzpS
83 82 biimpa y2z2ppyzpSppypSppzpS
84 oveq1 m=nmy=ny
85 84 eleq1d m=nmySnyS
86 eleq1 m=nmSnS
87 85 86 imbi12d m=nmySmSnySnS
88 87 cbvralvw mmySmSnnySnS
89 46 adantl y2z2ppyzpSnnySnSmm
90 uzssz 2
91 zsscn
92 90 91 sstri 2
93 simpll y2z2ppyzpSy2
94 93 ad2antrr y2z2ppyzpSnnySnSmy2
95 92 94 sselid y2z2ppyzpSnnySnSmy
96 simplr y2z2ppyzpSz2
97 96 ad2antrr y2z2ppyzpSnnySnSmz2
98 92 97 sselid y2z2ppyzpSnnySnSmz
99 mul32 myzmyz=mzy
100 mulass myzmyz=myz
101 99 100 eqtr3d myzmzy=myz
102 89 95 98 101 syl3anc y2z2ppyzpSnnySnSmmzy=myz
103 102 eleq1d y2z2ppyzpSnnySnSmmzySmyzS
104 simpr y2z2ppyzpSnnySnSmm
105 eluz2nn z2z
106 97 105 syl y2z2ppyzpSnnySnSmz
107 104 106 nnmulcld y2z2ppyzpSnnySnSmmz
108 simplr y2z2ppyzpSnnySnSmnnySnS
109 oveq1 n=mzny=mzy
110 109 eleq1d n=mznySmzyS
111 eleq1 n=mznSmzS
112 110 111 imbi12d n=mznySnSmzySmzS
113 112 rspcv mznnySnSmzySmzS
114 107 108 113 sylc y2z2ppyzpSnnySnSmmzySmzS
115 103 114 sylbird y2z2ppyzpSnnySnSmmyzSmzS
116 115 imim1d y2z2ppyzpSnnySnSmmzSmSmyzSmS
117 116 ralimdva y2z2ppyzpSnnySnSmmzSmSmmyzSmS
118 88 117 sylan2b y2z2ppyzpSmmySmSmmzSmSmmyzSmS
119 118 expimpd y2z2ppyzpSmmySmSmmzSmSmmyzSmS
120 83 119 embantd y2z2ppyzpSppypSppzpSmmySmSmmzSmSmmyzSmS
121 120 ex y2z2ppyzpSppypSppzpSmmySmSmmzSmSmmyzSmS
122 121 com23 y2z2ppypSppzpSmmySmSmmzSmSppyzpSmmyzSmS
123 69 122 syl5 y2z2ppypSmmySmSppzpSmmzSmSppyzpSmmyzSmS
124 13 21 29 37 45 51 68 123 prmind BppBpSmmBSmS
125 3 4 124 sylc φmmBSmS
126 oveq1 m=AmB=AB
127 126 eleq1d m=AmBSABS
128 eleq1 m=AmSAS
129 127 128 imbi12d m=AmBSmSABSAS
130 129 rspcv AmmBSmSABSAS
131 2 125 5 130 syl3c φAS