Metamath Proof Explorer


Theorem 2sqlem9

Description: Lemma for 2sq . (Contributed by Mario Carneiro, 19-Jun-2015)

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
2sqlem9.6 φ M
2sqlem9.4 φ N Y
Assertion 2sqlem9 φ M S

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 2sqlem9.6 φ M
6 2sqlem9.4 φ N Y
7 eqeq1 z = N z = x 2 + y 2 N = x 2 + y 2
8 7 anbi2d z = N x gcd y = 1 z = x 2 + y 2 x gcd y = 1 N = x 2 + y 2
9 8 2rexbidv z = N x y x gcd y = 1 z = x 2 + y 2 x y x gcd y = 1 N = x 2 + y 2
10 oveq1 x = u x gcd y = u gcd y
11 10 eqeq1d x = u x gcd y = 1 u gcd y = 1
12 oveq1 x = u x 2 = u 2
13 12 oveq1d x = u x 2 + y 2 = u 2 + y 2
14 13 eqeq2d x = u N = x 2 + y 2 N = u 2 + y 2
15 11 14 anbi12d x = u x gcd y = 1 N = x 2 + y 2 u gcd y = 1 N = u 2 + y 2
16 oveq2 y = v u gcd y = u gcd v
17 16 eqeq1d y = v u gcd y = 1 u gcd v = 1
18 oveq1 y = v y 2 = v 2
19 18 oveq2d y = v u 2 + y 2 = u 2 + v 2
20 19 eqeq2d y = v N = u 2 + y 2 N = u 2 + v 2
21 17 20 anbi12d y = v u gcd y = 1 N = u 2 + y 2 u gcd v = 1 N = u 2 + v 2
22 15 21 cbvrex2vw x y x gcd y = 1 N = x 2 + y 2 u v u gcd v = 1 N = u 2 + v 2
23 9 22 bitrdi z = N x y x gcd y = 1 z = x 2 + y 2 u v u gcd v = 1 N = u 2 + v 2
24 23 2 elab2g N Y N Y u v u gcd v = 1 N = u 2 + v 2
25 24 ibi N Y u v u gcd v = 1 N = u 2 + v 2
26 6 25 syl φ u v u gcd v = 1 N = u 2 + v 2
27 simpr φ u v u gcd v = 1 N = u 2 + v 2 M = 1 M = 1
28 1z 1
29 zgz 1 1 i
30 28 29 ax-mp 1 i
31 sq1 1 2 = 1
32 31 eqcomi 1 = 1 2
33 fveq2 x = 1 x = 1
34 abs1 1 = 1
35 33 34 eqtrdi x = 1 x = 1
36 35 oveq1d x = 1 x 2 = 1 2
37 36 rspceeqv 1 i 1 = 1 2 x i 1 = x 2
38 30 32 37 mp2an x i 1 = x 2
39 1 2sqlem1 1 S x i 1 = x 2
40 38 39 mpbir 1 S
41 27 40 eqeltrdi φ u v u gcd v = 1 N = u 2 + v 2 M = 1 M S
42 3 ad2antrr φ u v u gcd v = 1 N = u 2 + v 2 M 1 b 1 M 1 a Y b a b S
43 4 ad2antrr φ u v u gcd v = 1 N = u 2 + v 2 M 1 M N
44 1 2 2sqlem7 Y S
45 inss2 S
46 44 45 sstri Y
47 46 6 sselid φ N
48 47 ad2antrr φ u v u gcd v = 1 N = u 2 + v 2 M 1 N
49 5 ad2antrr φ u v u gcd v = 1 N = u 2 + v 2 M 1 M
50 simprr φ u v u gcd v = 1 N = u 2 + v 2 M 1 M 1
51 eluz2b3 M 2 M M 1
52 49 50 51 sylanbrc φ u v u gcd v = 1 N = u 2 + v 2 M 1 M 2
53 simplrl φ u v u gcd v = 1 N = u 2 + v 2 M 1 u
54 simplrr φ u v u gcd v = 1 N = u 2 + v 2 M 1 v
55 simprll φ u v u gcd v = 1 N = u 2 + v 2 M 1 u gcd v = 1
56 simprlr φ u v u gcd v = 1 N = u 2 + v 2 M 1 N = u 2 + v 2
57 eqid u + M 2 mod M M 2 = u + M 2 mod M M 2
58 eqid v + M 2 mod M M 2 = v + M 2 mod M M 2
59 eqid u + M 2 mod M M 2 u + M 2 mod M M 2 gcd v + M 2 mod M M 2 = u + M 2 mod M M 2 u + M 2 mod M M 2 gcd v + M 2 mod M M 2
60 eqid v + M 2 mod M M 2 u + M 2 mod M M 2 gcd v + M 2 mod M M 2 = v + M 2 mod M M 2 u + M 2 mod M M 2 gcd v + M 2 mod M M 2
61 1 2 42 43 48 52 53 54 55 56 57 58 59 60 2sqlem8 φ u v u gcd v = 1 N = u 2 + v 2 M 1 M S
62 61 anassrs φ u v u gcd v = 1 N = u 2 + v 2 M 1 M S
63 41 62 pm2.61dane φ u v u gcd v = 1 N = u 2 + v 2 M S
64 63 ex φ u v u gcd v = 1 N = u 2 + v 2 M S
65 64 rexlimdvva φ u v u gcd v = 1 N = u 2 + v 2 M S
66 26 65 mpd φ M S