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

Theorem 2sq 27357
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 2728 . . 3 ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
2 oveq1 7422 . . . . . . 7 (𝑎 = 𝑥 → (𝑎 gcd 𝑏) = (𝑥 gcd 𝑏))
32eqeq1d 2730 . . . . . 6 (𝑎 = 𝑥 → ((𝑎 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑏) = 1))
4 oveq1 7422 . . . . . . . 8 (𝑎 = 𝑥 → (𝑎↑2) = (𝑥↑2))
54oveq1d 7430 . . . . . . 7 (𝑎 = 𝑥 → ((𝑎↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑏↑2)))
65eqeq2d 2739 . . . . . 6 (𝑎 = 𝑥 → (𝑧 = ((𝑎↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑏↑2))))
73, 6anbi12d 631 . . . . 5 (𝑎 = 𝑥 → (((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2)))))
8 oveq2 7423 . . . . . . 7 (𝑏 = 𝑦 → (𝑥 gcd 𝑏) = (𝑥 gcd 𝑦))
98eqeq1d 2730 . . . . . 6 (𝑏 = 𝑦 → ((𝑥 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑦) = 1))
10 oveq1 7422 . . . . . . . 8 (𝑏 = 𝑦 → (𝑏↑2) = (𝑦↑2))
1110oveq2d 7431 . . . . . . 7 (𝑏 = 𝑦 → ((𝑥↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑦↑2)))
1211eqeq2d 2739 . . . . . 6 (𝑏 = 𝑦 → (𝑧 = ((𝑥↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
139, 12anbi12d 631 . . . . 5 (𝑏 = 𝑦 → (((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))))
147, 13cbvrex2vw 3235 . . . 4 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
1514abbii 2798 . . 3 {𝑧 ∣ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2)))} = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
161, 152sqlem11 27356 . 2 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → 𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)))
1712sqlem2 27345 . 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 395   = wceq 1534  wcel 2099  {cab 2705  wrex 3066  cmpt 5226  ran crn 5674  cfv 6543  (class class class)co 7415  1c1 11134   + caddc 11136  2c2 12292  4c4 12294  cz 12583   mod cmo 13861  cexp 14053  abscabs 15208   gcd cgcd 16463  cprime 16636  ℤ[i]cgz 16892
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1790  ax-4 1804  ax-5 1906  ax-6 1964  ax-7 2004  ax-8 2101  ax-9 2109  ax-10 2130  ax-11 2147  ax-12 2167  ax-ext 2699  ax-rep 5280  ax-sep 5294  ax-nul 5301  ax-pow 5360  ax-pr 5424  ax-un 7735  ax-cnex 11189  ax-resscn 11190  ax-1cn 11191  ax-icn 11192  ax-addcl 11193  ax-addrcl 11194  ax-mulcl 11195  ax-mulrcl 11196  ax-mulcom 11197  ax-addass 11198  ax-mulass 11199  ax-distr 11200  ax-i2m1 11201  ax-1ne0 11202  ax-1rid 11203  ax-rnegex 11204  ax-rrecex 11205  ax-cnre 11206  ax-pre-lttri 11207  ax-pre-lttrn 11208  ax-pre-ltadd 11209  ax-pre-mulgt0 11210  ax-pre-sup 11211  ax-addf 11212  ax-mulf 11213
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 847  df-3or 1086  df-3an 1087  df-tru 1537  df-fal 1547  df-ex 1775  df-nf 1779  df-sb 2061  df-mo 2530  df-eu 2559  df-clab 2706  df-cleq 2720  df-clel 2806  df-nfc 2881  df-ne 2937  df-nel 3043  df-ral 3058  df-rex 3067  df-rmo 3372  df-reu 3373  df-rab 3429  df-v 3472  df-sbc 3776  df-csb 3891  df-dif 3948  df-un 3950  df-in 3952  df-ss 3962  df-pss 3964  df-nul 4320  df-if 4526  df-pw 4601  df-sn 4626  df-pr 4628  df-tp 4630  df-op 4632  df-uni 4905  df-int 4946  df-iun 4994  df-iin 4995  df-br 5144  df-opab 5206  df-mpt 5227  df-tr 5261  df-id 5571  df-eprel 5577  df-po 5585  df-so 5586  df-fr 5628  df-se 5629  df-we 5630  df-xp 5679  df-rel 5680  df-cnv 5681  df-co 5682  df-dm 5683  df-rn 5684  df-res 5685  df-ima 5686  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 7371  df-ov 7418  df-oprab 7419  df-mpo 7420  df-of 7680  df-ofr 7681  df-om 7866  df-1st 7988  df-2nd 7989  df-supp 8161  df-tpos 8226  df-frecs 8281  df-wrecs 8312  df-recs 8386  df-rdg 8425  df-1o 8481  df-2o 8482  df-oadd 8485  df-er 8719  df-ec 8721  df-qs 8725  df-map 8841  df-pm 8842  df-ixp 8911  df-en 8959  df-dom 8960  df-sdom 8961  df-fin 8962  df-fsupp 9381  df-sup 9460  df-inf 9461  df-oi 9528  df-dju 9919  df-card 9957  df-pnf 11275  df-mnf 11276  df-xr 11277  df-ltxr 11278  df-le 11279  df-sub 11471  df-neg 11472  df-div 11897  df-nn 12238  df-2 12300  df-3 12301  df-4 12302  df-5 12303  df-6 12304  df-7 12305  df-8 12306  df-9 12307  df-n0 12498  df-xnn0 12570  df-z 12584  df-dec 12703  df-uz 12848  df-q 12958  df-rp 13002  df-fz 13512  df-fzo 13655  df-fl 13784  df-mod 13862  df-seq 13994  df-exp 14054  df-hash 14317  df-cj 15073  df-re 15074  df-im 15075  df-sqrt 15209  df-abs 15210  df-dvds 16226  df-gcd 16464  df-prm 16637  df-phi 16729  df-pc 16800  df-gz 16893  df-struct 17110  df-sets 17127  df-slot 17145  df-ndx 17157  df-base 17175  df-ress 17204  df-plusg 17240  df-mulr 17241  df-starv 17242  df-sca 17243  df-vsca 17244  df-ip 17245  df-tset 17246  df-ple 17247  df-ds 17249  df-unif 17250  df-hom 17251  df-cco 17252  df-0g 17417  df-gsum 17418  df-prds 17423  df-pws 17425  df-imas 17484  df-qus 17485  df-mre 17560  df-mrc 17561  df-acs 17563  df-mgm 18594  df-sgrp 18673  df-mnd 18689  df-mhm 18734  df-submnd 18735  df-grp 18887  df-minusg 18888  df-sbg 18889  df-mulg 19018  df-subg 19072  df-nsg 19073  df-eqg 19074  df-ghm 19162  df-cntz 19262  df-cmn 19731  df-abl 19732  df-mgp 20069  df-rng 20087  df-ur 20116  df-srg 20121  df-ring 20169  df-cring 20170  df-oppr 20267  df-dvdsr 20290  df-unit 20291  df-invr 20321  df-dvr 20334  df-rhm 20405  df-nzr 20446  df-subrng 20477  df-subrg 20502  df-drng 20620  df-field 20621  df-lmod 20739  df-lss 20810  df-lsp 20850  df-sra 21052  df-rgmod 21053  df-lidl 21098  df-rsp 21099  df-2idl 21138  df-rlreg 21224  df-domn 21225  df-idom 21226  df-cnfld 21274  df-zring 21367  df-zrh 21423  df-zn 21426  df-assa 21781  df-asp 21782  df-ascl 21783  df-psr 21836  df-mvr 21837  df-mpl 21838  df-opsr 21840  df-evls 22012  df-evl 22013  df-psr1 22093  df-vr1 22094  df-ply1 22095  df-coe1 22096  df-evl1 22229  df-mdeg 25982  df-deg1 25983  df-mon1 26060  df-uc1p 26061  df-q1p 26062  df-r1p 26063  df-lgs 27222
This theorem is referenced by:  2sqb  27359  2sqnn0  27365
  Copyright terms: Public domain W3C validator