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

Theorem 2sqlem9 20628
Description: Lemma for 2sq 20631. (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 2302 . . . . . . . 8  |-  ( z  =  N  ->  (
z  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  N  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
32anbi2d 684 . . . . . . 7  |-  ( z  =  N  ->  (
( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( x  gcd  y )  =  1  /\  N  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) ) )
432rexbidv 2599 . . . . . 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 5881 . . . . . . . . 9  |-  ( x  =  u  ->  (
x  gcd  y )  =  ( u  gcd  y ) )
65eqeq1d 2304 . . . . . . . 8  |-  ( x  =  u  ->  (
( x  gcd  y
)  =  1  <->  (
u  gcd  y )  =  1 ) )
7 oveq1 5881 . . . . . . . . . 10  |-  ( x  =  u  ->  (
x ^ 2 )  =  ( u ^
2 ) )
87oveq1d 5889 . . . . . . . . 9  |-  ( x  =  u  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( u ^ 2 )  +  ( y ^ 2 ) ) )
98eqeq2d 2307 . . . . . . . 8  |-  ( x  =  u  ->  ( N  =  ( (
x ^ 2 )  +  ( y ^
2 ) )  <->  N  =  ( ( u ^
2 )  +  ( y ^ 2 ) ) ) )
106, 9anbi12d 691 . . . . . . 7  |-  ( x  =  u  ->  (
( ( x  gcd  y )  =  1  /\  N  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( u  gcd  y )  =  1  /\  N  =  ( ( u ^
2 )  +  ( y ^ 2 ) ) ) ) )
11 oveq2 5882 . . . . . . . . 9  |-  ( y  =  v  ->  (
u  gcd  y )  =  ( u  gcd  v ) )
1211eqeq1d 2304 . . . . . . . 8  |-  ( y  =  v  ->  (
( u  gcd  y
)  =  1  <->  (
u  gcd  v )  =  1 ) )
13 oveq1 5881 . . . . . . . . . 10  |-  ( y  =  v  ->  (
y ^ 2 )  =  ( v ^
2 ) )
1413oveq2d 5890 . . . . . . . . 9  |-  ( y  =  v  ->  (
( u ^ 2 )  +  ( y ^ 2 ) )  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) )
1514eqeq2d 2307 . . . . . . . 8  |-  ( y  =  v  ->  ( N  =  ( (
u ^ 2 )  +  ( y ^
2 ) )  <->  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) )
1612, 15anbi12d 691 . . . . . . 7  |-  ( y  =  v  ->  (
( ( u  gcd  y )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) ) )
1710, 16cbvrex2v 2786 . . . . . 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 252 . . . . 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 2929 . . . 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 232 . . 3  |-  ( N  e.  Y  ->  E. u  e.  ZZ  E. v  e.  ZZ  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) ) )
221, 21syl 15 . 2  |-  ( ph  ->  E. u  e.  ZZ  E. v  e.  ZZ  (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) ) )
23 simpr 447 . . . . . 6  |-  ( ( ( ( ph  /\  ( u  e.  ZZ  /\  v  e.  ZZ ) )  /\  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) ) )  /\  M  =  1 )  ->  M  = 
1 )
24 1z 10069 . . . . . . . . 9  |-  1  e.  ZZ
25 zgz 12996 . . . . . . . . 9  |-  ( 1  e.  ZZ  ->  1  e.  ZZ [ _i ]
)
2624, 25ax-mp 8 . . . . . . . 8  |-  1  e.  ZZ [ _i ]
27 sq1 11214 . . . . . . . . 9  |-  ( 1 ^ 2 )  =  1
2827eqcomi 2300 . . . . . . . 8  |-  1  =  ( 1 ^ 2 )
29 fveq2 5541 . . . . . . . . . . . 12  |-  ( x  =  1  ->  ( abs `  x )  =  ( abs `  1
) )
30 abs1 11798 . . . . . . . . . . . 12  |-  ( abs `  1 )  =  1
3129, 30syl6eq 2344 . . . . . . . . . . 11  |-  ( x  =  1  ->  ( abs `  x )  =  1 )
3231oveq1d 5889 . . . . . . . . . 10  |-  ( x  =  1  ->  (
( abs `  x
) ^ 2 )  =  ( 1 ^ 2 ) )
3332eqeq2d 2307 . . . . . . . . 9  |-  ( x  =  1  ->  (
1  =  ( ( abs `  x ) ^ 2 )  <->  1  =  ( 1 ^ 2 ) ) )
3433rspcev 2897 . . . . . . . 8  |-  ( ( 1  e.  ZZ [
_i ]  /\  1  =  ( 1 ^ 2 ) )  ->  E. x  e.  ZZ [ _i ]  1  =  ( ( abs `  x
) ^ 2 ) )
3526, 28, 34mp2an 653 . . . . . . 7  |-  E. x  e.  ZZ [ _i ] 
1  =  ( ( abs `  x ) ^ 2 )
36 2sq.1 . . . . . . . 8  |-  S  =  ran  ( w  e.  ZZ [ _i ]  |->  ( ( abs `  w
) ^ 2 ) )
37362sqlem1 20618 . . . . . . 7  |-  ( 1  e.  S  <->  E. x  e.  ZZ [ _i ] 
1  =  ( ( abs `  x ) ^ 2 ) )
3835, 37mpbir 200 . . . . . 6  |-  1  e.  S
3923, 38syl6eqel 2384 . . . . 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 706 . . . . . . 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 706 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  ||  N )
4436, 192sqlem7 20625 . . . . . . . . . 10  |-  Y  C_  ( S  i^i  NN )
45 inss2 3403 . . . . . . . . . 10  |-  ( S  i^i  NN )  C_  NN
4644, 45sstri 3201 . . . . . . . . 9  |-  Y  C_  NN
4746, 1sseldi 3191 . . . . . . . 8  |-  ( ph  ->  N  e.  NN )
4847ad2antrr 706 . . . . . . 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 706 . . . . . . . 8  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  e.  NN )
51 simprr 733 . . . . . . . 8  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  =/=  1 )
52 eluz2b3 10307 . . . . . . . 8  |-  ( M  e.  ( ZZ>= `  2
)  <->  ( M  e.  NN  /\  M  =/=  1 ) )
5350, 51, 52sylanbrc 645 . . . . . . 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 736 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  u  e.  ZZ )
55 simplrr 737 . . . . . . 7  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  v  e.  ZZ )
56 simprll 738 . . . . . . 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 739 . . . . . . 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 2296 . . . . . . 7  |-  ( ( ( u  +  ( M  /  2 ) )  mod  M )  -  ( M  / 
2 ) )  =  ( ( ( u  +  ( M  / 
2 ) )  mod 
M )  -  ( M  /  2 ) )
59 eqid 2296 . . . . . . 7  |-  ( ( ( v  +  ( M  /  2 ) )  mod  M )  -  ( M  / 
2 ) )  =  ( ( ( v  +  ( M  / 
2 ) )  mod 
M )  -  ( M  /  2 ) )
60 eqid 2296 . . . . . . 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 2296 . . . . . . 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 20627 . . . . . 6  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
( u  gcd  v
)  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^
2 ) ) )  /\  M  =/=  1
) )  ->  M  e.  S )
6362anassrs 629 . . . . 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 2537 . . . 4  |-  ( ( ( ph  /\  (
u  e.  ZZ  /\  v  e.  ZZ )
)  /\  ( (
u  gcd  v )  =  1  /\  N  =  ( ( u ^ 2 )  +  ( v ^ 2 ) ) ) )  ->  M  e.  S
)
6564ex 423 . . 3  |-  ( (
ph  /\  ( u  e.  ZZ  /\  v  e.  ZZ ) )  -> 
( ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) )  ->  M  e.  S ) )
6665rexlimdvva 2687 . 2  |-  ( ph  ->  ( E. u  e.  ZZ  E. v  e.  ZZ  ( ( u  gcd  v )  =  1  /\  N  =  ( ( u ^
2 )  +  ( v ^ 2 ) ) )  ->  M  e.  S ) )
6722, 66mpd 14 1  |-  ( ph  ->  M  e.  S )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 358    = wceq 1632    e. wcel 1696   {cab 2282    =/= wne 2459   A.wral 2556   E.wrex 2557    i^i cin 3164   class class class wbr 4039    e. cmpt 4093   ran crn 4706   ` cfv 5271  (class class class)co 5874   1c1 8754    + caddc 8756    - cmin 9053    / cdiv 9439   NNcn 9762   2c2 9811   ZZcz 10040   ZZ>=cuz 10246   ...cfz 10798    mod cmo 10989   ^cexp 11120   abscabs 11735    || cdivides 12547    gcd cgcd 12701   ZZ [ _i ]cgz 12992
This theorem is referenced by:  2sqlem10  20629
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830  ax-pre-sup 8831
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rmo 2564  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-int 3879  df-iun 3923  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-1st 6138  df-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-1o 6495  df-2o 6496  df-oadd 6499  df-er 6676  df-en 6880  df-dom 6881  df-sdom 6882  df-fin 6883  df-sup 7210  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-div 9440  df-nn 9763  df-2 9820  df-3 9821  df-n0 9982  df-z 10041  df-uz 10247  df-rp 10371  df-fz 10799  df-fl 10941  df-mod 10990  df-seq 11063  df-exp 11121  df-cj 11600  df-re 11601  df-im 11602  df-sqr 11736  df-abs 11737  df-dvds 12548  df-gcd 12702  df-prm 12775  df-gz 12993
  Copyright terms: Public domain W3C validator