MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  2sq Structured version   Visualization version   GIF version

Theorem 2sq 27381
Description: All primes of the form 4𝑘 + 1 are sums of two squares. This is Metamath 100 proof #20. (Contributed by Mario Carneiro, 20-Jun-2015.)
Assertion
Ref Expression
2sq ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
Distinct variable group:   𝑥,𝑦,𝑃

Proof of Theorem 2sq
Dummy variables 𝑎 𝑏 𝑤 𝑧 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 eqid 2725 . . 3 ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
2 oveq1 7423 . . . . . . 7 (𝑎 = 𝑥 → (𝑎 gcd 𝑏) = (𝑥 gcd 𝑏))
32eqeq1d 2727 . . . . . 6 (𝑎 = 𝑥 → ((𝑎 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑏) = 1))
4 oveq1 7423 . . . . . . . 8 (𝑎 = 𝑥 → (𝑎↑2) = (𝑥↑2))
54oveq1d 7431 . . . . . . 7 (𝑎 = 𝑥 → ((𝑎↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑏↑2)))
65eqeq2d 2736 . . . . . 6 (𝑎 = 𝑥 → (𝑧 = ((𝑎↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑏↑2))))
73, 6anbi12d 630 . . . . 5 (𝑎 = 𝑥 → (((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2)))))
8 oveq2 7424 . . . . . . 7 (𝑏 = 𝑦 → (𝑥 gcd 𝑏) = (𝑥 gcd 𝑦))
98eqeq1d 2727 . . . . . 6 (𝑏 = 𝑦 → ((𝑥 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑦) = 1))
10 oveq1 7423 . . . . . . . 8 (𝑏 = 𝑦 → (𝑏↑2) = (𝑦↑2))
1110oveq2d 7432 . . . . . . 7 (𝑏 = 𝑦 → ((𝑥↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑦↑2)))
1211eqeq2d 2736 . . . . . 6 (𝑏 = 𝑦 → (𝑧 = ((𝑥↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
139, 12anbi12d 630 . . . . 5 (𝑏 = 𝑦 → (((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))))
147, 13cbvrex2vw 3230 . . . 4 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
1514abbii 2795 . . 3 {𝑧 ∣ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2)))} = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
161, 152sqlem11 27380 . 2 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → 𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)))
1712sqlem2 27369 . 2 (𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
1816, 17sylib 217 1 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 394   = wceq 1533  wcel 2098  {cab 2702  wrex 3060  cmpt 5226  ran crn 5673  cfv 6543  (class class class)co 7416  1c1 11139   + caddc 11141  2c2 12297  4c4 12299  cz 12588   mod cmo 13866  cexp 14058  abscabs 15213   gcd cgcd 16468  cprime 16641  ℤ[i]cgz 16897
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1789  ax-4 1803  ax-5 1905  ax-6 1963  ax-7 2003  ax-8 2100  ax-9 2108  ax-10 2129  ax-11 2146  ax-12 2166  ax-ext 2696  ax-rep 5280  ax-sep 5294  ax-nul 5301  ax-pow 5359  ax-pr 5423  ax-un 7738  ax-cnex 11194  ax-resscn 11195  ax-1cn 11196  ax-icn 11197  ax-addcl 11198  ax-addrcl 11199  ax-mulcl 11200  ax-mulrcl 11201  ax-mulcom 11202  ax-addass 11203  ax-mulass 11204  ax-distr 11205  ax-i2m1 11206  ax-1ne0 11207  ax-1rid 11208  ax-rnegex 11209  ax-rrecex 11210  ax-cnre 11211  ax-pre-lttri 11212  ax-pre-lttrn 11213  ax-pre-ltadd 11214  ax-pre-mulgt0 11215  ax-pre-sup 11216  ax-addf 11217  ax-mulf 11218
This theorem depends on definitions:  df-bi 206  df-an 395  df-or 846  df-3or 1085  df-3an 1086  df-tru 1536  df-fal 1546  df-ex 1774  df-nf 1778  df-sb 2060  df-mo 2528  df-eu 2557  df-clab 2703  df-cleq 2717  df-clel 2802  df-nfc 2877  df-ne 2931  df-nel 3037  df-ral 3052  df-rex 3061  df-rmo 3364  df-reu 3365  df-rab 3420  df-v 3465  df-sbc 3769  df-csb 3885  df-dif 3942  df-un 3944  df-in 3946  df-ss 3956  df-pss 3959  df-nul 4319  df-if 4525  df-pw 4600  df-sn 4625  df-pr 4627  df-tp 4629  df-op 4631  df-uni 4904  df-int 4945  df-iun 4993  df-iin 4994  df-br 5144  df-opab 5206  df-mpt 5227  df-tr 5261  df-id 5570  df-eprel 5576  df-po 5584  df-so 5585  df-fr 5627  df-se 5628  df-we 5629  df-xp 5678  df-rel 5679  df-cnv 5680  df-co 5681  df-dm 5682  df-rn 5683  df-res 5684  df-ima 5685  df-pred 6300  df-ord 6367  df-on 6368  df-lim 6369  df-suc 6370  df-iota 6495  df-fun 6545  df-fn 6546  df-f 6547  df-f1 6548  df-fo 6549  df-f1o 6550  df-fv 6551  df-isom 6552  df-riota 7372  df-ov 7419  df-oprab 7420  df-mpo 7421  df-of 7682  df-ofr 7683  df-om 7869  df-1st 7991  df-2nd 7992  df-supp 8164  df-tpos 8230  df-frecs 8285  df-wrecs 8316  df-recs 8390  df-rdg 8429  df-1o 8485  df-2o 8486  df-oadd 8489  df-er 8723  df-ec 8725  df-qs 8729  df-map 8845  df-pm 8846  df-ixp 8915  df-en 8963  df-dom 8964  df-sdom 8965  df-fin 8966  df-fsupp 9386  df-sup 9465  df-inf 9466  df-oi 9533  df-dju 9924  df-card 9962  df-pnf 11280  df-mnf 11281  df-xr 11282  df-ltxr 11283  df-le 11284  df-sub 11476  df-neg 11477  df-div 11902  df-nn 12243  df-2 12305  df-3 12306  df-4 12307  df-5 12308  df-6 12309  df-7 12310  df-8 12311  df-9 12312  df-n0 12503  df-xnn0 12575  df-z 12589  df-dec 12708  df-uz 12853  df-q 12963  df-rp 13007  df-fz 13517  df-fzo 13660  df-fl 13789  df-mod 13867  df-seq 13999  df-exp 14059  df-hash 14322  df-cj 15078  df-re 15079  df-im 15080  df-sqrt 15214  df-abs 15215  df-dvds 16231  df-gcd 16469  df-prm 16642  df-phi 16734  df-pc 16805  df-gz 16898  df-struct 17115  df-sets 17132  df-slot 17150  df-ndx 17162  df-base 17180  df-ress 17209  df-plusg 17245  df-mulr 17246  df-starv 17247  df-sca 17248  df-vsca 17249  df-ip 17250  df-tset 17251  df-ple 17252  df-ds 17254  df-unif 17255  df-hom 17256  df-cco 17257  df-0g 17422  df-gsum 17423  df-prds 17428  df-pws 17430  df-imas 17489  df-qus 17490  df-mre 17565  df-mrc 17566  df-acs 17568  df-mgm 18599  df-sgrp 18678  df-mnd 18694  df-mhm 18739  df-submnd 18740  df-grp 18897  df-minusg 18898  df-sbg 18899  df-mulg 19028  df-subg 19082  df-nsg 19083  df-eqg 19084  df-ghm 19172  df-cntz 19272  df-cmn 19741  df-abl 19742  df-mgp 20079  df-rng 20097  df-ur 20126  df-srg 20131  df-ring 20179  df-cring 20180  df-oppr 20277  df-dvdsr 20300  df-unit 20301  df-invr 20331  df-dvr 20344  df-rhm 20415  df-nzr 20456  df-subrng 20487  df-subrg 20512  df-drng 20630  df-field 20631  df-lmod 20749  df-lss 20820  df-lsp 20860  df-sra 21062  df-rgmod 21063  df-lidl 21108  df-rsp 21109  df-2idl 21148  df-rlreg 21234  df-domn 21235  df-idom 21236  df-cnfld 21284  df-zring 21377  df-zrh 21433  df-zn 21436  df-assa 21791  df-asp 21792  df-ascl 21793  df-psr 21846  df-mvr 21847  df-mpl 21848  df-opsr 21850  df-evls 22025  df-evl 22026  df-psr1 22107  df-vr1 22108  df-ply1 22109  df-coe1 22110  df-evl1 22244  df-mdeg 26006  df-deg1 26007  df-mon1 26084  df-uc1p 26085  df-q1p 26086  df-r1p 26087  df-lgs 27246
This theorem is referenced by:  2sqb  27383  2sqnn0  27389
  Copyright terms: Public domain W3C validator
OSZAR »