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

Theorem 2sqlem11 21160
Description: Lemma for 2sq 21161. (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 ) ) ) }
Assertion
Ref Expression
2sqlem11  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  S )
Distinct variable groups:    x, w, y, z    x, S, y, z    x, Y, y   
x, P, y
Allowed substitution hints:    P( z, w)    S( w)    Y( z, w)

Proof of Theorem 2sqlem11
Dummy variable  n is distinct from all other variables.
StepHypRef Expression
1 simpr 449 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( P  mod  4 )  =  1 )
2 simpl 445 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  Prime )
3 1ne2 10188 . . . . . . . . . . 11  |-  1  =/=  2
43necomi 2687 . . . . . . . . . 10  |-  2  =/=  1
5 oveq1 6089 . . . . . . . . . . . 12  |-  ( P  =  2  ->  ( P  mod  4 )  =  ( 2  mod  4
) )
6 2re 10070 . . . . . . . . . . . . 13  |-  2  e.  RR
7 4re 10074 . . . . . . . . . . . . . 14  |-  4  e.  RR
8 4pos 10087 . . . . . . . . . . . . . 14  |-  0  <  4
97, 8elrpii 10616 . . . . . . . . . . . . 13  |-  4  e.  RR+
10 0re 9092 . . . . . . . . . . . . . 14  |-  0  e.  RR
11 2pos 10083 . . . . . . . . . . . . . 14  |-  0  <  2
1210, 6, 11ltleii 9197 . . . . . . . . . . . . 13  |-  0  <_  2
13 2lt4 10147 . . . . . . . . . . . . 13  |-  2  <  4
14 modid 11271 . . . . . . . . . . . . 13  |-  ( ( ( 2  e.  RR  /\  4  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  4
) )  ->  (
2  mod  4 )  =  2 )
156, 9, 12, 13, 14mp4an 656 . . . . . . . . . . . 12  |-  ( 2  mod  4 )  =  2
165, 15syl6eq 2485 . . . . . . . . . . 11  |-  ( P  =  2  ->  ( P  mod  4 )  =  2 )
1716neeq1d 2615 . . . . . . . . . 10  |-  ( P  =  2  ->  (
( P  mod  4
)  =/=  1  <->  2  =/=  1 ) )
184, 17mpbiri 226 . . . . . . . . 9  |-  ( P  =  2  ->  ( P  mod  4 )  =/=  1 )
1918necon2i 2652 . . . . . . . 8  |-  ( ( P  mod  4 )  =  1  ->  P  =/=  2 )
201, 19syl 16 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  =/=  2 )
21 eldifsn 3928 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  <->  ( P  e.  Prime  /\  P  =/=  2 ) )
222, 20, 21sylanbrc 647 . . . . . 6  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  ( Prime  \  { 2 } ) )
23 m1lgs 21147 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  / L P )  =  1  <->  ( P  mod  4 )  =  1 ) )
2422, 23syl 16 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  (
( -u 1  / L P )  =  1  <-> 
( P  mod  4
)  =  1 ) )
251, 24mpbird 225 . . . 4  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -u 1  / L P
)  =  1 )
26 1z 10312 . . . . . 6  |-  1  e.  ZZ
27 znegcl 10314 . . . . . 6  |-  ( 1  e.  ZZ  ->  -u 1  e.  ZZ )
2826, 27ax-mp 8 . . . . 5  |-  -u 1  e.  ZZ
29 lgsqr 21131 . . . . 5  |-  ( (
-u 1  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( -u 1  / L P
)  =  1  <->  ( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 ) ) ) )
3028, 22, 29sylancr 646 . . . 4  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  (
( -u 1  / L P )  =  1  <-> 
( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  (
( n ^ 2 )  -  -u 1
) ) ) )
3125, 30mpbid 203 . . 3  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 ) ) )
3231simprd 451 . 2  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  E. n  e.  ZZ  P  ||  (
( n ^ 2 )  -  -u 1
) )
33 simprl 734 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  ZZ )
3426a1i 11 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
1  e.  ZZ )
35 gcd1 13033 . . . . . 6  |-  ( n  e.  ZZ  ->  (
n  gcd  1 )  =  1 )
3635ad2antrl 710 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n  gcd  1
)  =  1 )
37 eqidd 2438 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) )
38 oveq1 6089 . . . . . . . 8  |-  ( x  =  n  ->  (
x  gcd  y )  =  ( n  gcd  y ) )
3938eqeq1d 2445 . . . . . . 7  |-  ( x  =  n  ->  (
( x  gcd  y
)  =  1  <->  (
n  gcd  y )  =  1 ) )
40 oveq1 6089 . . . . . . . . 9  |-  ( x  =  n  ->  (
x ^ 2 )  =  ( n ^
2 ) )
4140oveq1d 6097 . . . . . . . 8  |-  ( x  =  n  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )
4241eqeq2d 2448 . . . . . . 7  |-  ( x  =  n  ->  (
( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) )
4339, 42anbi12d 693 . . . . . 6  |-  ( x  =  n  ->  (
( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( n  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) ) )
44 oveq2 6090 . . . . . . . 8  |-  ( y  =  1  ->  (
n  gcd  y )  =  ( n  gcd  1 ) )
4544eqeq1d 2445 . . . . . . 7  |-  ( y  =  1  ->  (
( n  gcd  y
)  =  1  <->  (
n  gcd  1 )  =  1 ) )
46 oveq1 6089 . . . . . . . . . 10  |-  ( y  =  1  ->  (
y ^ 2 )  =  ( 1 ^ 2 ) )
47 sq1 11477 . . . . . . . . . 10  |-  ( 1 ^ 2 )  =  1
4846, 47syl6eq 2485 . . . . . . . . 9  |-  ( y  =  1  ->  (
y ^ 2 )  =  1 )
4948oveq2d 6098 . . . . . . . 8  |-  ( y  =  1  ->  (
( n ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  1 ) )
5049eqeq2d 2448 . . . . . . 7  |-  ( y  =  1  ->  (
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) )
5145, 50anbi12d 693 . . . . . 6  |-  ( y  =  1  ->  (
( ( n  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( n  gcd  1 )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) ) )
5243, 51rspc2ev 3061 . . . . 5  |-  ( ( n  e.  ZZ  /\  1  e.  ZZ  /\  (
( n  gcd  1
)  =  1  /\  ( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) ) )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5333, 34, 36, 37, 52syl112anc 1189 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  ( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) ) )
54 ovex 6107 . . . . 5  |-  ( ( n ^ 2 )  +  1 )  e. 
_V
55 eqeq1 2443 . . . . . . 7  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
z  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5655anbi2d 686 . . . . . 6  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) ) )
57562rexbidv 2749 . . . . 5  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  ( 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 ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) ) ) )
58 2sqlem7.2 . . . . 5  |-  Y  =  { z  |  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) }
5954, 57, 58elab2 3086 . . . 4  |-  ( ( ( n ^ 2 )  +  1 )  e.  Y  <->  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
6053, 59sylibr 205 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  e.  Y )
61 prmnn 13083 . . . 4  |-  ( P  e.  Prime  ->  P  e.  NN )
6261ad2antrr 708 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  NN )
63 simprr 735 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  -  -u 1 ) )
6433zcnd 10377 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  CC )
6564sqcld 11522 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n ^ 2 )  e.  CC )
66 ax-1cn 9049 . . . . 5  |-  1  e.  CC
67 subneg 9351 . . . . 5  |-  ( ( ( n ^ 2 )  e.  CC  /\  1  e.  CC )  ->  ( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6865, 66, 67sylancl 645 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6963, 68breqtrd 4237 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  +  1 ) )
70 2sq.1 . . . 4  |-  S  =  ran  ( w  e.  ZZ [ _i ]  |->  ( ( abs `  w
) ^ 2 ) )
7170, 582sqlem10 21159 . . 3  |-  ( ( ( ( n ^
2 )  +  1 )  e.  Y  /\  P  e.  NN  /\  P  ||  ( ( n ^
2 )  +  1 ) )  ->  P  e.  S )
7260, 62, 69, 71syl3anc 1185 . 2  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  S )
7332, 72rexlimddv 2835 1  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  S )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 178    /\ wa 360    = wceq 1653    e. wcel 1726   {cab 2423    =/= wne 2600   E.wrex 2707    \ cdif 3318   {csn 3815   class class class wbr 4213    e. cmpt 4267   ran crn 4880   ` cfv 5455  (class class class)co 6082   CCcc 8989   RRcr 8990   0cc0 8991   1c1 8992    + caddc 8994    < clt 9121    <_ cle 9122    - cmin 9292   -ucneg 9293   NNcn 10001   2c2 10050   4c4 10052   ZZcz 10283   RR+crp 10613    mod cmo 11251   ^cexp 11383   abscabs 12040    || cdivides 12853    gcd cgcd 13007   Primecprime 13080   ZZ [ _i ]cgz 13298    / Lclgs 21079
This theorem is referenced by:  2sq  21161
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 2418  ax-rep 4321  ax-sep 4331  ax-nul 4339  ax-pow 4378  ax-pr 4404  ax-un 4702  ax-inf2 7597  ax-cnex 9047  ax-resscn 9048  ax-1cn 9049  ax-icn 9050  ax-addcl 9051  ax-addrcl 9052  ax-mulcl 9053  ax-mulrcl 9054  ax-mulcom 9055  ax-addass 9056  ax-mulass 9057  ax-distr 9058  ax-i2m1 9059  ax-1ne0 9060  ax-1rid 9061  ax-rnegex 9062  ax-rrecex 9063  ax-cnre 9064  ax-pre-lttri 9065  ax-pre-lttrn 9066  ax-pre-ltadd 9067  ax-pre-mulgt0 9068  ax-pre-sup 9069  ax-addf 9070  ax-mulf 9071
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 2286  df-mo 2287  df-clab 2424  df-cleq 2430  df-clel 2433  df-nfc 2562  df-ne 2602  df-nel 2603  df-ral 2711  df-rex 2712  df-reu 2713  df-rmo 2714  df-rab 2715  df-v 2959  df-sbc 3163  df-csb 3253  df-dif 3324  df-un 3326  df-in 3328  df-ss 3335  df-pss 3337  df-nul 3630  df-if 3741  df-pw 3802  df-sn 3821  df-pr 3822  df-tp 3823  df-op 3824  df-uni 4017  df-int 4052  df-iun 4096  df-iin 4097  df-br 4214  df-opab 4268  df-mpt 4269  df-tr 4304  df-eprel 4495  df-id 4499  df-po 4504  df-so 4505  df-fr 4542  df-se 4543  df-we 4544  df-ord 4585  df-on 4586  df-lim 4587  df-suc 4588  df-om 4847  df-xp 4885  df-rel 4886  df-cnv 4887  df-co 4888  df-dm 4889  df-rn 4890  df-res 4891  df-ima 4892  df-iota 5419  df-fun 5457  df-fn 5458  df-f 5459  df-f1 5460  df-fo 5461  df-f1o 5462  df-fv 5463  df-isom 5464  df-ov 6085  df-oprab 6086  df-mpt2 6087  df-of 6306  df-ofr 6307  df-1st 6350  df-2nd 6351  df-tpos 6480  df-riota 6550  df-recs 6634  df-rdg 6669  df-1o 6725  df-2o 6726  df-oadd 6729  df-er 6906  df-ec 6908  df-qs 6912  df-map 7021  df-pm 7022  df-ixp 7065  df-en 7111  df-dom 7112  df-sdom 7113  df-fin 7114  df-sup 7447  df-oi 7480  df-card 7827  df-cda 8049  df-pnf 9123  df-mnf 9124  df-xr 9125  df-ltxr 9126  df-le 9127  df-sub 9294  df-neg 9295  df-div 9679  df-nn 10002  df-2 10059  df-3 10060  df-4 10061  df-5 10062  df-6 10063  df-7 10064  df-8 10065  df-9 10066  df-10 10067  df-n0 10223  df-z 10284  df-dec 10384  df-uz 10490  df-q 10576  df-rp 10614  df-fz 11045  df-fzo 11137  df-fl 11203  df-mod 11252  df-seq 11325  df-exp 11384  df-hash 11620  df-cj 11905  df-re 11906  df-im 11907  df-sqr 12041  df-abs 12042  df-dvds 12854  df-gcd 13008  df-prm 13081  df-phi 13156  df-pc 13212  df-gz 13299  df-struct 13472  df-ndx 13473  df-slot 13474  df-base 13475  df-sets 13476  df-ress 13477  df-plusg 13543  df-mulr 13544  df-starv 13545  df-sca 13546  df-vsca 13547  df-tset 13549  df-ple 13550  df-ds 13552  df-unif 13553  df-hom 13554  df-cco 13555  df-prds 13672  df-pws 13674  df-0g 13728  df-gsum 13729  df-imas 13735  df-divs 13736  df-mre 13812  df-mrc 13813  df-acs 13815  df-mnd 14691  df-mhm 14739  df-submnd 14740  df-grp 14813  df-minusg 14814  df-sbg 14815  df-mulg 14816  df-subg 14942  df-nsg 14943  df-eqg 14944  df-ghm 15005  df-cntz 15117  df-cmn 15415  df-abl 15416  df-mgp 15650  df-rng 15664  df-cring 15665  df-ur 15666  df-oppr 15729  df-dvdsr 15747  df-unit 15748  df-invr 15778  df-rnghom 15820  df-drng 15838  df-field 15839  df-subrg 15867  df-lmod 15953  df-lss 16010  df-lsp 16049  df-sra 16245  df-rgmod 16246  df-lidl 16247  df-rsp 16248  df-2idl 16304  df-nzr 16330  df-rlreg 16344  df-domn 16345  df-idom 16346  df-assa 16373  df-asp 16374  df-ascl 16375  df-psr 16418  df-mvr 16419  df-mpl 16420  df-evls 16421  df-evl 16422  df-opsr 16426  df-psr1 16577  df-vr1 16578  df-ply1 16579  df-evl1 16581  df-coe1 16582  df-cnfld 16705  df-zrh 16783  df-zn 16786  df-mdeg 19979  df-deg1 19980  df-mon1 20054  df-uc1p 20055  df-q1p 20056  df-r1p 20057  df-lgs 21080
  Copyright terms: Public domain W3C validator