Metamath Proof Explorer


Theorem 2sqlem8a

Description: Lemma for 2sqlem8 . (Contributed by Mario Carneiro, 4-Jun-2016)

Ref Expression
Hypotheses 2sq.1 S = ran w i w 2
2sqlem7.2 Y = z | x y x gcd y = 1 z = x 2 + y 2
2sqlem9.5 φ b 1 M 1 a Y b a b S
2sqlem9.7 φ M N
2sqlem8.n φ N
2sqlem8.m φ M 2
2sqlem8.1 φ A
2sqlem8.2 φ B
2sqlem8.3 φ A gcd B = 1
2sqlem8.4 φ N = A 2 + B 2
2sqlem8.c C = A + M 2 mod M M 2
2sqlem8.d D = B + M 2 mod M M 2
Assertion 2sqlem8a φ C gcd D

Proof

Step Hyp Ref Expression
1 2sq.1 S = ran w i w 2
2 2sqlem7.2 Y = z | x y x gcd y = 1 z = x 2 + y 2
3 2sqlem9.5 φ b 1 M 1 a Y b a b S
4 2sqlem9.7 φ M N
5 2sqlem8.n φ N
6 2sqlem8.m φ M 2
7 2sqlem8.1 φ A
8 2sqlem8.2 φ B
9 2sqlem8.3 φ A gcd B = 1
10 2sqlem8.4 φ N = A 2 + B 2
11 2sqlem8.c C = A + M 2 mod M M 2
12 2sqlem8.d D = B + M 2 mod M M 2
13 eluz2b3 M 2 M M 1
14 6 13 sylib φ M M 1
15 14 simpld φ M
16 7 15 11 4sqlem5 φ C A C M
17 16 simpld φ C
18 8 15 12 4sqlem5 φ D B D M
19 18 simpld φ D
20 14 simprd φ M 1
21 simpr φ C 2 = 0 C 2 = 0
22 7 15 11 21 4sqlem9 φ C 2 = 0 M 2 A 2
23 22 ex φ C 2 = 0 M 2 A 2
24 eluzelz M 2 M
25 6 24 syl φ M
26 dvdssq M A M A M 2 A 2
27 25 7 26 syl2anc φ M A M 2 A 2
28 23 27 sylibrd φ C 2 = 0 M A
29 simpr φ D 2 = 0 D 2 = 0
30 8 15 12 29 4sqlem9 φ D 2 = 0 M 2 B 2
31 30 ex φ D 2 = 0 M 2 B 2
32 dvdssq M B M B M 2 B 2
33 25 8 32 syl2anc φ M B M 2 B 2
34 31 33 sylibrd φ D 2 = 0 M B
35 ax-1ne0 1 0
36 35 a1i φ 1 0
37 9 36 eqnetrd φ A gcd B 0
38 37 neneqd φ ¬ A gcd B = 0
39 gcdeq0 A B A gcd B = 0 A = 0 B = 0
40 7 8 39 syl2anc φ A gcd B = 0 A = 0 B = 0
41 38 40 mtbid φ ¬ A = 0 B = 0
42 dvdslegcd M A B ¬ A = 0 B = 0 M A M B M A gcd B
43 25 7 8 41 42 syl31anc φ M A M B M A gcd B
44 28 34 43 syl2and φ C 2 = 0 D 2 = 0 M A gcd B
45 9 breq2d φ M A gcd B M 1
46 nnle1eq1 M M 1 M = 1
47 15 46 syl φ M 1 M = 1
48 45 47 bitrd φ M A gcd B M = 1
49 44 48 sylibd φ C 2 = 0 D 2 = 0 M = 1
50 49 necon3ad φ M 1 ¬ C 2 = 0 D 2 = 0
51 20 50 mpd φ ¬ C 2 = 0 D 2 = 0
52 17 zcnd φ C
53 sqeq0 C C 2 = 0 C = 0
54 52 53 syl φ C 2 = 0 C = 0
55 19 zcnd φ D
56 sqeq0 D D 2 = 0 D = 0
57 55 56 syl φ D 2 = 0 D = 0
58 54 57 anbi12d φ C 2 = 0 D 2 = 0 C = 0 D = 0
59 51 58 mtbid φ ¬ C = 0 D = 0
60 gcdn0cl C D ¬ C = 0 D = 0 C gcd D
61 17 19 59 60 syl21anc φ C gcd D