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

Theorem 2sq 27495
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 2763 . . 3 ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
2 oveq1 7404 . . . . . . 7 (𝑎 = 𝑥 → (𝑎 gcd 𝑏) = (𝑥 gcd 𝑏))
32eqeq1d 2765 . . . . . 6 (𝑎 = 𝑥 → ((𝑎 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑏) = 1))
4 oveq1 7404 . . . . . . . 8 (𝑎 = 𝑥 → (𝑎↑2) = (𝑥↑2))
54oveq1d 7412 . . . . . . 7 (𝑎 = 𝑥 → ((𝑎↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑏↑2)))
65eqeq2d 2774 . . . . . 6 (𝑎 = 𝑥 → (𝑧 = ((𝑎↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑏↑2))))
73, 6anbi12d 641 . . . . 5 (𝑎 = 𝑥 → (((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2)))))
8 oveq2 7405 . . . . . . 7 (𝑏 = 𝑦 → (𝑥 gcd 𝑏) = (𝑥 gcd 𝑦))
98eqeq1d 2765 . . . . . 6 (𝑏 = 𝑦 → ((𝑥 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑦) = 1))
10 oveq1 7404 . . . . . . . 8 (𝑏 = 𝑦 → (𝑏↑2) = (𝑦↑2))
1110oveq2d 7413 . . . . . . 7 (𝑏 = 𝑦 → ((𝑥↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑦↑2)))
1211eqeq2d 2774 . . . . . 6 (𝑏 = 𝑦 → (𝑧 = ((𝑥↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
139, 12anbi12d 641 . . . . 5 (𝑏 = 𝑦 → (((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))))
147, 13cbvrex2vw 3246 . . . 4 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
1514abbii 2830 . . 3 {𝑧 ∣ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2)))} = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
161, 152sqlem11 27494 . 2 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → 𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)))
1712sqlem2 27483 . 2 (𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
1816, 17sylib 220 1 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 399   = wceq 1561  wcel 2143  {cab 2741  wrex 3087  cmpt 5182  ran crn 5649  cfv 6522  (class class class)co 7397  1c1 11075   + caddc 11077  2c2 12273  4c4 12275  cz 12569   mod cmo 13880  cexp 14075  abscabs 15262   gcd cgcd 16529  cprime 16706  ℤ[i]cgz 16966
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1816  ax-4 1830  ax-5 1931  ax-6 1988  ax-7 2029  ax-8 2145  ax-9 2153  ax-10 2176  ax-11 2192  ax-12 2213  ax-ext 2735  ax-rep 5228  ax-sep 5247  ax-nul 5257  ax-pow 5323  ax-pr 5391  ax-un 7719  ax-cnex 11130  ax-resscn 11131  ax-1cn 11132  ax-icn 11133  ax-addcl 11134  ax-addrcl 11135  ax-mulcl 11136  ax-mulrcl 11137  ax-mulcom 11138  ax-addass 11139  ax-mulass 11140  ax-distr 11141  ax-i2m1 11142  ax-1ne0 11143  ax-1rid 11144  ax-rnegex 11145  ax-rrecex 11146  ax-cnre 11147  ax-pre-lttri 11148  ax-pre-lttrn 11149  ax-pre-ltadd 11150  ax-pre-mulgt0 11151  ax-pre-sup 11152  ax-addf 11153  ax-mulf 11154
This theorem depends on definitions:  df-bi 209  df-an 400  df-or 859  df-3or 1100  df-3an 1101  df-tru 1564  df-fal 1574  df-ex 1801  df-nf 1805  df-sb 2092  df-mo 2567  df-eu 2597  df-clab 2742  df-cleq 2755  df-clel 2838  df-nfc 2912  df-ne 2959  df-nel 3063  df-ral 3078  df-rex 3088  df-rmo 3368  df-reu 3369  df-rab 3416  df-v 3457  df-sbc 3746  df-csb 3854  df-dif 3908  df-un 3910  df-in 3912  df-ss 3922  df-pss 3925  df-nul 4287  df-if 4482  df-pw 4558  df-sn 4584  df-pr 4586  df-tp 4588  df-op 4590  df-uni 4867  df-int 4907  df-iun 4952  df-iin 4953  df-br 5102  df-opab 5164  df-mpt 5183  df-tr 5209  df-id 5543  df-eprel 5548  df-po 5556  df-so 5557  df-fr 5601  df-se 5602  df-we 5603  df-xp 5654  df-rel 5655  df-cnv 5656  df-co 5657  df-dm 5658  df-rn 5659  df-res 5660  df-ima 5661  df-pred 6289  df-ord 6350  df-on 6351  df-lim 6352  df-suc 6353  df-iota 6478  df-fun 6524  df-fn 6525  df-f 6526  df-f1 6527  df-fo 6528  df-f1o 6529  df-fv 6530  df-isom 6531  df-riota 7354  df-ov 7400  df-oprab 7401  df-mpo 7402  df-of 7661  df-ofr 7662  df-om 7848  df-1st 7971  df-2nd 7972  df-supp 8142  df-tpos 8207  df-frecs 8263  df-wrecs 8294  df-recs 8343  df-rdg 8382  df-1o 8438  df-2o 8439  df-oadd 8442  df-er 8679  df-ec 8681  df-qs 8685  df-map 8811  df-pm 8812  df-ixp 8881  df-en 8929  df-dom 8930  df-sdom 8931  df-fin 8932  df-fsupp 9309  df-sup 9389  df-inf 9390  df-oi 9459  df-dju 9860  df-card 9898  df-pnf 11219  df-mnf 11220  df-xr 11221  df-ltxr 11222  df-le 11223  df-sub 11417  df-neg 11418  df-div 11846  df-nn 12212  df-2 12281  df-3 12282  df-4 12283  df-5 12284  df-6 12285  df-7 12286  df-8 12287  df-9 12288  df-n0 12483  df-xnn0 12556  df-z 12570  df-dec 12690  df-uz 12841  df-q 12951  df-rp 12995  df-fz 13514  df-fzo 13661  df-fl 13803  df-mod 13881  df-seq 14016  df-exp 14076  df-hash 14345  df-cj 15127  df-re 15128  df-im 15129  df-sqrt 15263  df-abs 15264  df-dvds 16288  df-gcd 16530  df-prm 16707  df-phi 16802  df-pc 16874  df-gz 16967  df-struct 17184  df-sets 17201  df-slot 17219  df-ndx 17231  df-base 17247  df-ress 17268  df-plusg 17300  df-mulr 17301  df-starv 17302  df-sca 17303  df-vsca 17304  df-ip 17305  df-tset 17306  df-ple 17307  df-ds 17309  df-unif 17310  df-hom 17311  df-cco 17312  df-0g 17471  df-gsum 17472  df-prds 17477  df-pws 17479  df-imas 17539  df-qus 17540  df-mre 17615  df-mrc 17616  df-acs 17618  df-mgm 18675  df-sgrp 18754  df-mnd 18770  df-mhm 18818  df-submnd 18819  df-grp 18979  df-minusg 18980  df-sbg 18981  df-mulg 19111  df-subg 19166  df-nsg 19167  df-eqg 19168  df-ghm 19255  df-cntz 19358  df-cmn 19823  df-abl 19824  df-mgp 20188  df-rng 20200  df-ur 20233  df-srg 20238  df-ring 20286  df-cring 20287  df-oppr 20387  df-dvdsr 20407  df-unit 20408  df-invr 20438  df-dvr 20451  df-rhm 20522  df-nzr 20564  df-subrng 20597  df-subrg 20621  df-rlreg 20745  df-domn 20746  df-idom 20747  df-drng 20782  df-field 20783  df-lmod 20930  df-lss 21000  df-lsp 21040  df-sra 21241  df-rgmod 21242  df-lidl 21279  df-rsp 21280  df-2idl 21321  df-cnfld 21426  df-zring 21500  df-zrh 21556  df-zn 21559  df-assa 21906  df-asp 21907  df-ascl 21908  df-psr 21962  df-mvr 21963  df-mpl 21964  df-opsr 21966  df-evls 22128  df-evl 22129  df-psr1 22243  df-vr1 22244  df-ply1 22245  df-coe1 22246  df-evl1 22380  df-mdeg 26116  df-deg1 26117  df-mon1 26192  df-uc1p 26193  df-q1p 26194  df-r1p 26195  df-lgs 27360
This theorem is referenced by:  2sqb  27497  2sqnn0  27503
  Copyright terms: Public domain W3C validator