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

Theorem 2sqlem8a 20626
Description: Lemma for 2sqlem8 20627. (Contributed by Mario Carneiro, 4-Jun-2016.)
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 )
2sqlem8.n  |-  ( ph  ->  N  e.  NN )
2sqlem8.m  |-  ( ph  ->  M  e.  ( ZZ>= ` 
2 ) )
2sqlem8.1  |-  ( ph  ->  A  e.  ZZ )
2sqlem8.2  |-  ( ph  ->  B  e.  ZZ )
2sqlem8.3  |-  ( ph  ->  ( A  gcd  B
)  =  1 )
2sqlem8.4  |-  ( ph  ->  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
Ref Expression
2sqlem8a  |-  ( ph  ->  ( C  gcd  D
)  e.  NN )
Distinct variable groups:    a, b, w, x, y, z    A, a, x, y, z    x, C    ph, x, y    B, a, b, x, y    M, a, b, x, y, z    S, a, b, x, y, z    x, D    x, N, y, z    Y, a, b, x, y
Allowed substitution hints:    ph( z, w, a, b)    A( w, b)    B( z, w)    C( y, z, w, a, b)    D( y, z, w, a, b)    S( w)    M( w)    N( w, a, b)    Y( z, w)

Proof of Theorem 2sqlem8a
StepHypRef Expression
1 2sqlem8.1 . . . 4  |-  ( ph  ->  A  e.  ZZ )
2 2sqlem8.m . . . . . 6  |-  ( ph  ->  M  e.  ( ZZ>= ` 
2 ) )
3 eluz2b3 10307 . . . . . 6  |-  ( M  e.  ( ZZ>= `  2
)  <->  ( M  e.  NN  /\  M  =/=  1 ) )
42, 3sylib 188 . . . . 5  |-  ( ph  ->  ( M  e.  NN  /\  M  =/=  1 ) )
54simpld 445 . . . 4  |-  ( ph  ->  M  e.  NN )
6 2sqlem8.c . . . 4  |-  C  =  ( ( ( A  +  ( M  / 
2 ) )  mod 
M )  -  ( M  /  2 ) )
71, 5, 64sqlem5 13005 . . 3  |-  ( ph  ->  ( C  e.  ZZ  /\  ( ( A  -  C )  /  M
)  e.  ZZ ) )
87simpld 445 . 2  |-  ( ph  ->  C  e.  ZZ )
9 2sqlem8.2 . . . 4  |-  ( ph  ->  B  e.  ZZ )
10 2sqlem8.d . . . 4  |-  D  =  ( ( ( B  +  ( M  / 
2 ) )  mod 
M )  -  ( M  /  2 ) )
119, 5, 104sqlem5 13005 . . 3  |-  ( ph  ->  ( D  e.  ZZ  /\  ( ( B  -  D )  /  M
)  e.  ZZ ) )
1211simpld 445 . 2  |-  ( ph  ->  D  e.  ZZ )
134simprd 449 . . . 4  |-  ( ph  ->  M  =/=  1 )
14 simpr 447 . . . . . . . . . 10  |-  ( (
ph  /\  ( C ^ 2 )  =  0 )  ->  ( C ^ 2 )  =  0 )
151, 5, 6, 144sqlem9 13009 . . . . . . . . 9  |-  ( (
ph  /\  ( C ^ 2 )  =  0 )  ->  ( M ^ 2 )  ||  ( A ^ 2 ) )
1615ex 423 . . . . . . . 8  |-  ( ph  ->  ( ( C ^
2 )  =  0  ->  ( M ^
2 )  ||  ( A ^ 2 ) ) )
17 eluzelz 10254 . . . . . . . . . 10  |-  ( M  e.  ( ZZ>= `  2
)  ->  M  e.  ZZ )
182, 17syl 15 . . . . . . . . 9  |-  ( ph  ->  M  e.  ZZ )
19 dvdssq 12755 . . . . . . . . 9  |-  ( ( M  e.  ZZ  /\  A  e.  ZZ )  ->  ( M  ||  A  <->  ( M ^ 2 ) 
||  ( A ^
2 ) ) )
2018, 1, 19syl2anc 642 . . . . . . . 8  |-  ( ph  ->  ( M  ||  A  <->  ( M ^ 2 ) 
||  ( A ^
2 ) ) )
2116, 20sylibrd 225 . . . . . . 7  |-  ( ph  ->  ( ( C ^
2 )  =  0  ->  M  ||  A
) )
22 simpr 447 . . . . . . . . . 10  |-  ( (
ph  /\  ( D ^ 2 )  =  0 )  ->  ( D ^ 2 )  =  0 )
239, 5, 10, 224sqlem9 13009 . . . . . . . . 9  |-  ( (
ph  /\  ( D ^ 2 )  =  0 )  ->  ( M ^ 2 )  ||  ( B ^ 2 ) )
2423ex 423 . . . . . . . 8  |-  ( ph  ->  ( ( D ^
2 )  =  0  ->  ( M ^
2 )  ||  ( B ^ 2 ) ) )
25 dvdssq 12755 . . . . . . . . 9  |-  ( ( M  e.  ZZ  /\  B  e.  ZZ )  ->  ( M  ||  B  <->  ( M ^ 2 ) 
||  ( B ^
2 ) ) )
2618, 9, 25syl2anc 642 . . . . . . . 8  |-  ( ph  ->  ( M  ||  B  <->  ( M ^ 2 ) 
||  ( B ^
2 ) ) )
2724, 26sylibrd 225 . . . . . . 7  |-  ( ph  ->  ( ( D ^
2 )  =  0  ->  M  ||  B
) )
28 2sqlem8.3 . . . . . . . . . . 11  |-  ( ph  ->  ( A  gcd  B
)  =  1 )
29 ax-1ne0 8822 . . . . . . . . . . . 12  |-  1  =/=  0
3029a1i 10 . . . . . . . . . . 11  |-  ( ph  ->  1  =/=  0 )
3128, 30eqnetrd 2477 . . . . . . . . . 10  |-  ( ph  ->  ( A  gcd  B
)  =/=  0 )
3231neneqd 2475 . . . . . . . . 9  |-  ( ph  ->  -.  ( A  gcd  B )  =  0 )
33 gcdeq0 12716 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  ( ( A  gcd  B )  =  0  <->  ( A  =  0  /\  B  =  0 ) ) )
341, 9, 33syl2anc 642 . . . . . . . . 9  |-  ( ph  ->  ( ( A  gcd  B )  =  0  <->  ( A  =  0  /\  B  =  0 ) ) )
3532, 34mtbid 291 . . . . . . . 8  |-  ( ph  ->  -.  ( A  =  0  /\  B  =  0 ) )
36 dvdslegcd 12711 . . . . . . . 8  |-  ( ( ( M  e.  ZZ  /\  A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  ( A  =  0  /\  B  =  0 ) )  -> 
( ( M  ||  A  /\  M  ||  B
)  ->  M  <_  ( A  gcd  B ) ) )
3718, 1, 9, 35, 36syl31anc 1185 . . . . . . 7  |-  ( ph  ->  ( ( M  ||  A  /\  M  ||  B
)  ->  M  <_  ( A  gcd  B ) ) )
3821, 27, 37syl2and 469 . . . . . 6  |-  ( ph  ->  ( ( ( C ^ 2 )  =  0  /\  ( D ^ 2 )  =  0 )  ->  M  <_  ( A  gcd  B
) ) )
3928breq2d 4051 . . . . . . 7  |-  ( ph  ->  ( M  <_  ( A  gcd  B )  <->  M  <_  1 ) )
40 nnle1eq1 9790 . . . . . . . 8  |-  ( M  e.  NN  ->  ( M  <_  1  <->  M  = 
1 ) )
415, 40syl 15 . . . . . . 7  |-  ( ph  ->  ( M  <_  1  <->  M  =  1 ) )
4239, 41bitrd 244 . . . . . 6  |-  ( ph  ->  ( M  <_  ( A  gcd  B )  <->  M  = 
1 ) )
4338, 42sylibd 205 . . . . 5  |-  ( ph  ->  ( ( ( C ^ 2 )  =  0  /\  ( D ^ 2 )  =  0 )  ->  M  =  1 ) )
4443necon3ad 2495 . . . 4  |-  ( ph  ->  ( M  =/=  1  ->  -.  ( ( C ^ 2 )  =  0  /\  ( D ^ 2 )  =  0 ) ) )
4513, 44mpd 14 . . 3  |-  ( ph  ->  -.  ( ( C ^ 2 )  =  0  /\  ( D ^ 2 )  =  0 ) )
468zcnd 10134 . . . . 5  |-  ( ph  ->  C  e.  CC )
47 sqeq0 11184 . . . . 5  |-  ( C  e.  CC  ->  (
( C ^ 2 )  =  0  <->  C  =  0 ) )
4846, 47syl 15 . . . 4  |-  ( ph  ->  ( ( C ^
2 )  =  0  <-> 
C  =  0 ) )
4912zcnd 10134 . . . . 5  |-  ( ph  ->  D  e.  CC )
50 sqeq0 11184 . . . . 5  |-  ( D  e.  CC  ->  (
( D ^ 2 )  =  0  <->  D  =  0 ) )
5149, 50syl 15 . . . 4  |-  ( ph  ->  ( ( D ^
2 )  =  0  <-> 
D  =  0 ) )
5248, 51anbi12d 691 . . 3  |-  ( ph  ->  ( ( ( C ^ 2 )  =  0  /\  ( D ^ 2 )  =  0 )  <->  ( C  =  0  /\  D  =  0 ) ) )
5345, 52mtbid 291 . 2  |-  ( ph  ->  -.  ( C  =  0  /\  D  =  0 ) )
54 gcdn0cl 12709 . 2  |-  ( ( ( C  e.  ZZ  /\  D  e.  ZZ )  /\  -.  ( C  =  0  /\  D  =  0 ) )  ->  ( C  gcd  D )  e.  NN )
558, 12, 53, 54syl21anc 1181 1  |-  ( ph  ->  ( C  gcd  D
)  e.  NN )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 176    /\ wa 358    = wceq 1632    e. wcel 1696   {cab 2282    =/= wne 2459   A.wral 2556   E.wrex 2557   class class class wbr 4039    e. cmpt 4093   ran crn 4706   ` cfv 5271  (class class class)co 5874   CCcc 8751   0cc0 8753   1c1 8754    + caddc 8756    <_ cle 8884    - 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:  2sqlem8  20627
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-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-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-er 6676  df-en 6880  df-dom 6881  df-sdom 6882  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-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
  Copyright terms: Public domain W3C validator