MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  2sqlem9 Structured version   Unicode version

Theorem 2sqlem9 21159
Description: Lemma for 2sq 21162. (Contributed by Mario Carneiro, 19-Jun-2015.)
Hypotheses
Ref Expression
2sq.1  |-  S  =  ran  ( w  e.  ZZ [ _i ]  |->  ( ( abs `  w
) ^ 2 ) )
2sqlem7.2  |-  Y  =  { z  |  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) }
2sqlem9.5  |-  ( ph  ->  A. b  e.  ( 1 ... ( M  -  1 ) ) A. a  e.  Y  ( b  ||  a  ->  b  e.  S ) )
2sqlem9.7  |-  ( ph  ->  M  ||  N )
2sqlem9.6  |-  ( ph  ->  M  e.  NN )
2sqlem9.4  |-  ( ph  ->  N  e.  Y )
Assertion
Ref Expression
2sqlem9  |-  ( ph  ->  M  e.  S )
Distinct variable groups:    a, b, w, x, y, z    ph, x, y    M, a, b, x, y, z    S, a, b, x, y, z   
x, N, y, z    Y, a, b, x, y
Allowed substitution hints:    ph( z, w, a, b)    S( w)    M( w)    N( w, a, b)    Y( z, w)

Proof of Theorem 2sqlem9
Dummy variables  u  v are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 2sqlem9.4 . . 3  |-  ( ph  ->  N  e.  Y )
2 eqeq1 2444 . . . . . . . 8  |-  ( z  =  N  ->  (
z  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  N  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
32anbi2d 686 . . . . . . 7  |-  ( z  =  N  ->  (
( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( x  gcd  y )  =  1  /\  N  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) ) )
432rexbidv 2750 . . . . . 6  |-  ( z  =  N  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) )  <->  E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  N  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) ) ) )
5 oveq1 6090 . . . . . . . . 9  |-  ( x  =  u  ->  (
x  gcd  y )  =  ( u  gcd  y ) )
65eqeq1d 2446 . . . . . . . 8  |-  ( x  =  u  ->  (
( x  gcd  y
)  =  1  <->  (
u  gcd  y )  =  1 ) )
7 oveq1 6090 . . . . . . . . . 10  |-  ( x  =  u  ->  (
x ^ 2 )  =  ( u ^
2 ) )
87oveq1d 6098 . . . . . . . . 9  |-  ( x  =  u  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( u ^ 2 )  +  ( y ^ 2 ) ) )
98eqeq2d 2449 . . . . . . . 8  |-  ( x  =  u  ->  ( N  =  ( (
x ^ 2 )  +  ( y ^
2 ) )  <->  N  =  ( ( u ^
2 )  +  ( y ^ 2 ) ) ) )
106, 9anbi12d 693 . . . . . . 7  |-  ( x  =  u  ->  (
( ( x  gcd  y )  =  1  /\  N  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( u  gcd  y )  =  1  /\  N  =  ( ( u ^
2 )  +  ( y ^ 2 ) ) ) ) )
11 oveq2 6091 . . . . . . . . 9  |-  ( y  =  v  ->  (
u  gcd  y )  =  ( u  gcd  v ) )
1211eqeq1d 2446 . . . . . . . 8  |-  ( y  =  v  ->  (
( u  gcd  y
)  =  1  <->  (
u  gcd  v )  =  1 ) )
13 oveq1 6090 . . . . . . . . . 10  |-  ( y  =  v  ->  (
y ^ 2 )  =  ( v ^
2 ) )
1413oveq2d 6099 . . . . . . . . 9  |-  ( y  =  v  ->  (
( u ^ 2 )  +  ( y ^ 2 ) )  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) )
1514eqeq2d 2449 . . . . . . . 8  |-  ( y  =  v  ->  ( N  =  ( (
u ^ 2 )  +  ( y ^
2 ) )  <->  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) )
1612, 15anbi12d 693 . . . . . . 7  |-  ( y  =  v  ->  (
( ( u  gcd  y )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) ) )
1710, 16cbvrex2v 2943 . . . . . 6  |-  ( E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  N  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) )  <->  E. u  e.  ZZ  E. v  e.  ZZ  (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) ) )
184, 17syl6bb 254 . . . . 5  |-  ( z  =  N  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) )  <->  E. u  e.  ZZ  E. v  e.  ZZ  (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) ) ) )
19 2sqlem7.2 . . . . 5  |-  Y  =  { z  |  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) }
2018, 19elab2g 3086 . . . 4  |-  ( N  e.  Y  ->  ( N  e.  Y  <->  E. u  e.  ZZ  E. v  e.  ZZ  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) ) )
2120ibi 234 . . 3  |-  ( N  e.  Y  ->  E. u  e.  ZZ  E. v  e.  ZZ  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) )
221, 21syl 16 . 2  |-  ( ph  ->  E. u  e.  ZZ  E. v  e.  ZZ  (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) ) )
23 simpr 449 . . . . . 6  |-  ( ( ( ( ph  /\  ( u  e.  ZZ  /\  v  e.  ZZ ) )  /\  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) ) )  /\  M  =  1 )  ->  M  = 
1 )
24 1z 10313 . . . . . . . . 9  |-  1  e.  ZZ
25 zgz 13303 . . . . . . . . 9  |-  ( 1  e.  ZZ  ->  1  e.  ZZ [ _i ]
)
2624, 25ax-mp 8 . . . . . . . 8  |-  1  e.  ZZ [ _i ]
27 sq1 11478 . . . . . . . . 9  |-  ( 1 ^ 2 )  =  1
2827eqcomi 2442 . . . . . . . 8  |-  1  =  ( 1 ^ 2 )
29 fveq2 5730 . . . . . . . . . . . 12  |-  ( x  =  1  ->  ( abs `  x )  =  ( abs `  1
) )
30 abs1 12104 . . . . . . . . . . . 12  |-  ( abs `  1 )  =  1
3129, 30syl6eq 2486 . . . . . . . . . . 11  |-  ( x  =  1  ->  ( abs `  x )  =  1 )
3231oveq1d 6098 . . . . . . . . . 10  |-  ( x  =  1  ->  (
( abs `  x
) ^ 2 )  =  ( 1 ^ 2 ) )
3332eqeq2d 2449 . . . . . . . . 9  |-  ( x  =  1  ->  (
1  =  ( ( abs `  x ) ^ 2 )  <->  1  =  ( 1 ^ 2 ) ) )
3433rspcev 3054 . . . . . . . 8  |-  ( ( 1  e.  ZZ [
_i ]  /\  1  =  ( 1 ^ 2 ) )  ->  E. x  e.  ZZ [ _i ]  1  =  ( ( abs `  x
) ^ 2 ) )
3526, 28, 34mp2an 655 . . . . . . 7  |-  E. x  e.  ZZ [ _i ] 
1  =  ( ( abs `  x ) ^ 2 )
36 2sq.1 . . . . . . . 8  |-  S  =  ran  ( w  e.  ZZ [ _i ]  |->  ( ( abs `  w
) ^ 2 ) )
37362sqlem1 21149 . . . . . . 7  |-  ( 1  e.  S  <->  E. x  e.  ZZ [ _i ] 
1  =  ( ( abs `  x ) ^ 2 ) )
3835, 37mpbir 202 . . . . . 6  |-  1  e.  S
3923, 38syl6eqel 2526 . . . . 5  |-  ( ( ( ( ph  /\  ( u  e.  ZZ  /\  v  e.  ZZ ) )  /\  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) ) )  /\  M  =  1 )  ->  M  e.  S )
40 2sqlem9.5 . . . . . . . 8  |-  ( ph  ->  A. b  e.  ( 1 ... ( M  -  1 ) ) A. a  e.  Y  ( b  ||  a  ->  b  e.  S ) )
4140ad2antrr 708 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  A. b  e.  ( 1 ... ( M  -  1 ) ) A. a  e.  Y  ( b  ||  a  ->  b  e.  S
) )
42 2sqlem9.7 . . . . . . . 8  |-  ( ph  ->  M  ||  N )
4342ad2antrr 708 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  ||  N )
4436, 192sqlem7 21156 . . . . . . . . . 10  |-  Y  C_  ( S  i^i  NN )
45 inss2 3564 . . . . . . . . . 10  |-  ( S  i^i  NN )  C_  NN
4644, 45sstri 3359 . . . . . . . . 9  |-  Y  C_  NN
4746, 1sseldi 3348 . . . . . . . 8  |-  ( ph  ->  N  e.  NN )
4847ad2antrr 708 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  N  e.  NN )
49 2sqlem9.6 . . . . . . . . 9  |-  ( ph  ->  M  e.  NN )
5049ad2antrr 708 . . . . . . . 8  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  e.  NN )
51 simprr 735 . . . . . . . 8  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  =/=  1 )
52 eluz2b3 10551 . . . . . . . 8  |-  ( M  e.  ( ZZ>= `  2
)  <->  ( M  e.  NN  /\  M  =/=  1 ) )
5350, 51, 52sylanbrc 647 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  e.  ( ZZ>= `  2 )
)
54 simplrl 738 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  u  e.  ZZ )
55 simplrr 739 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  v  e.  ZZ )
56 simprll 740 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  (
u  gcd  v )  =  1 )
57 simprlr 741 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) )
58 eqid 2438 . . . . . . 7  |-  ( ( ( u  +  ( M  /  2 ) )  mod  M )  -  ( M  / 
2 ) )  =  ( ( ( u  +  ( M  / 
2 ) )  mod 
M )  -  ( M  /  2 ) )
59 eqid 2438 . . . . . . 7  |-  ( ( ( v  +  ( M  /  2 ) )  mod  M )  -  ( M  / 
2 ) )  =  ( ( ( v  +  ( M  / 
2 ) )  mod 
M )  -  ( M  /  2 ) )
60 eqid 2438 . . . . . . 7  |-  ( ( ( ( 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 ) ) ) )
61 eqid 2438 . . . . . . 7  |-  ( ( ( ( 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 ) ) ) )
6236, 19, 41, 43, 48, 53, 54, 55, 56, 57, 58, 59, 60, 612sqlem8 21158 . . . . . 6  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  e.  S )
6362anassrs 631 . . . . 5  |-  ( ( ( ( ph  /\  ( u  e.  ZZ  /\  v  e.  ZZ ) )  /\  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) ) )  /\  M  =/=  1
)  ->  M  e.  S )
6439, 63pm2.61dane 2684 . . . 4  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
u  gcd  v )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) ) )  ->  M  e.  S
)
6564ex 425 . . 3  |-  ( (
ph  /\  ( u  e.  ZZ  /\  v  e.  ZZ ) )  -> 
( ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) )  ->  M  e.  S ) )
6665rexlimdvva 2839 . 2  |-  ( ph  ->  ( E. u  e.  ZZ  E. v  e.  ZZ  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) )  ->  M  e.  S ) )
6722, 66mpd 15 1  |-  ( ph  ->  M  e.  S )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 360    = wceq 1653    e. wcel 1726   {cab 2424    =/= wne 2601   A.wral 2707   E.wrex 2708    i^i cin 3321   class class class wbr 4214    e. cmpt 4268   ran crn 4881   ` cfv 5456  (class class class)co 6083   1c1 8993    + caddc 8995    - cmin 9293    / cdiv 9679   NNcn 10002   2c2 10051   ZZcz 10284   ZZ>=cuz 10490   ...cfz 11045    mod cmo 11252   ^cexp 11384   abscabs 12041    || cdivides 12854    gcd cgcd 13008   ZZ [ _i ]cgz 13299
This theorem is referenced by:  2sqlem10  21160
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-sep 4332  ax-nul 4340  ax-pow 4379  ax-pr 4405  ax-un 4703  ax-cnex 9048  ax-resscn 9049  ax-1cn 9050  ax-icn 9051  ax-addcl 9052  ax-addrcl 9053  ax-mulcl 9054  ax-mulrcl 9055  ax-mulcom 9056  ax-addass 9057  ax-mulass 9058  ax-distr 9059  ax-i2m1 9060  ax-1ne0 9061  ax-1rid 9062  ax-rnegex 9063  ax-rrecex 9064  ax-cnre 9065  ax-pre-lttri 9066  ax-pre-lttrn 9067  ax-pre-ltadd 9068  ax-pre-mulgt0 9069  ax-pre-sup 9070
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rmo 2715  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-int 4053  df-iun 4097  df-br 4215  df-opab 4269  df-mpt 4270  df-tr 4305  df-eprel 4496  df-id 4500  df-po 4505  df-so 4506  df-fr 4543  df-we 4545  df-ord 4586  df-on 4587  df-lim 4588  df-suc 4589  df-om 4848  df-xp 4886  df-rel 4887  df-cnv 4888  df-co 4889  df-dm 4890  df-rn 4891  df-res 4892  df-ima 4893  df-iota 5420  df-fun 5458  df-fn 5459  df-f 5460  df-f1 5461  df-fo 5462  df-f1o 5463  df-fv 5464  df-ov 6086  df-oprab 6087  df-mpt2 6088  df-1st 6351  df-2nd 6352  df-riota 6551  df-recs 6635  df-rdg 6670  df-1o 6726  df-2o 6727  df-oadd 6730  df-er 6907  df-en 7112  df-dom 7113  df-sdom 7114  df-fin 7115  df-sup 7448  df-pnf 9124  df-mnf 9125  df-xr 9126  df-ltxr 9127  df-le 9128  df-sub 9295  df-neg 9296  df-div 9680  df-nn 10003  df-2 10060  df-3 10061  df-n0 10224  df-z 10285  df-uz 10491  df-rp 10615  df-fz 11046  df-fl 11204  df-mod 11253  df-seq 11326  df-exp 11385  df-cj 11906  df-re 11907  df-im 11908  df-sqr 12042  df-abs 12043  df-dvds 12855  df-gcd 13009  df-prm 13082  df-gz 13300
  Copyright terms: Public domain W3C validator