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

Theorem 2sq 27603
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 7417 . . . . . . 7 (𝑎 = 𝑥 → (𝑎 gcd 𝑏) = (𝑥 gcd 𝑏))
32eqeq1d 2765 . . . . . 6 (𝑎 = 𝑥 → ((𝑎 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑏) = 1))
4 oveq1 7417 . . . . . . . 8 (𝑎 = 𝑥 → (𝑎↑2) = (𝑥↑2))
54oveq1d 7425 . . . . . . 7 (𝑎 = 𝑥 → ((𝑎↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑏↑2)))
65eqeq2d 2774 . . . . . 6 (𝑎 = 𝑥 → (𝑧 = ((𝑎↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑏↑2))))
73, 6anbi12d 643 . . . . 5 (𝑎 = 𝑥 → (((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2)))))
8 oveq2 7418 . . . . . . 7 (𝑏 = 𝑦 → (𝑥 gcd 𝑏) = (𝑥 gcd 𝑦))
98eqeq1d 2765 . . . . . 6 (𝑏 = 𝑦 → ((𝑥 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑦) = 1))
10 oveq1 7417 . . . . . . . 8 (𝑏 = 𝑦 → (𝑏↑2) = (𝑦↑2))
1110oveq2d 7426 . . . . . . 7 (𝑏 = 𝑦 → ((𝑥↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑦↑2)))
1211eqeq2d 2774 . . . . . 6 (𝑏 = 𝑦 → (𝑧 = ((𝑥↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
139, 12anbi12d 643 . . . . 5 (𝑏 = 𝑦 → (((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))))
147, 13cbvrex2vw 3248 . . . 4 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
1514abbii 2830 . . 3 {𝑧 ∣ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2)))} = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
161, 152sqlem11 27602 . 2 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → 𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)))
1712sqlem2 27591 . 2 (𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
1816, 17sylib 221 1 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ 𝑃 = ((𝑥↑2) + (𝑦↑2)))
Colors of variables:    wff setvar class
This proof depends on syntax axioms:  wi 4  wa 400   = wceq 1570  wcel 2143  {cab 2741  wrex 3089  cmpt 5192  ran crn 5662  cfv 6536  (class class class)co 7410  1c1 11105   + caddc 11107  2c2 12299  4c4 12301  cz 12595   mod cmo 13907  cexp 14102  abscabs 15290   gcd cgcd 16556  cprime 16733  ℤ[i]cgz 16993
This proof depends on axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1825  ax-4 1839  ax-5 1940  ax-6 1997  ax-7 2038  ax-8 2145  ax-9 2153  ax-10 2176  ax-11 2192  ax-12 2213  ax-ext 2735  ax-rep 5238  ax-sep 5257  ax-nul 5269  ax-pow 5336  ax-pr 5404  ax-un 7732  ax-cnex 11160  ax-resscn 11161  ax-1cn 11162  ax-icn 11163  ax-addcl 11164  ax-addrcl 11165  ax-mulcl 11166  ax-mulrcl 11167  ax-mulcom 11168  ax-addass 11169  ax-mulass 11170  ax-distr 11171  ax-i2m1 11172  ax-1ne0 11173  ax-1rid 11174  ax-rnegex 11175  ax-rrecex 11176  ax-cnre 11177  ax-pre-lttri 11178  ax-pre-lttrn 11179  ax-pre-ltadd 11180  ax-pre-mulgt0 11181  ax-pre-sup 11182  ax-addf 11183  ax-mulf 11184
This proof depends on definitions:  df-bi 210  df-an 401  df-or 861  df-3or 1104  df-3an 1105  df-tru 1573  df-fal 1583  df-ex 1810  df-nf 1814  df-sb 2097  df-mo 2567  df-eu 2597  df-clab 2742  df-cleq 2755  df-clel 2838  df-nfc 2912  df-ne 2959  df-nel 3065  df-ral 3080  df-rex 3090  df-rmo 3369  df-reu 3370  df-rab 3417  df-v 3457  df-sbc 3745  df-csb 3854  df-dif 3908  df-un 3910  df-in 3912  df-ss 3922  df-pss 3925  df-nul 4287  df-if 4488  df-pw 4564  df-sn 4590  df-pr 4592  df-tp 4594  df-op 4596  df-uni 4873  df-int 4913  df-iun 4958  df-iin 4959  df-br 5110  df-opab 5174  df-mpt 5193  df-tr 5219  df-id 5556  df-eprel 5561  df-po 5569  df-so 5570  df-fr 5614  df-se 5615  df-we 5616  df-xp 5667  df-rel 5668  df-cnv 5669  df-co 5670  df-dm 5671  df-rn 5672  df-res 5673  df-ima 5674  df-pred 6302  df-ord 6363  df-on 6364  df-lim 6365  df-suc 6366  df-iota 6492  df-fun 6538  df-fn 6539  df-f 6540  df-f1 6541  df-fo 6542  df-f1o 6543  df-fv 6544  df-isom 6545  df-riota 7367  df-ov 7413  df-oprab 7414  df-mpo 7415  df-of 7674  df-ofr 7675  df-om 7859  df-1st 7982  df-2nd 7983  df-supp 8153  df-tpos 8218  df-frecs 8274  df-wrecs 8305  df-recs 8354  df-rdg 8393  df-1o 8449  df-2o 8450  df-oadd 8453  df-er 8690  df-ec 8692  df-qs 8696  df-map 8822  df-pm 8823  df-ixp 8892  df-en 8940  df-dom 8941  df-sdom 8942  df-fin 8943  df-fsupp 9318  df-sup 9398  df-inf 9399  df-oi 9468  df-dju 9892  df-card 9930  df-pnf 11249  df-mnf 11250  df-xr 11251  df-ltxr 11252  df-le 11253  df-sub 11447  df-neg 11448  df-div 11876  df-nn 12238  df-2 12307  df-3 12308  df-4 12309  df-5 12310  df-6 12311  df-7 12312  df-8 12313  df-9 12314  df-n0 12509  df-xnn0 12582  df-z 12596  df-dec 12716  df-uz 12867  df-q 12977  df-rp 13021  df-fz 13540  df-fzo 13688  df-fl 13830  df-mod 13908  df-seq 14043  df-exp 14103  df-hash 14372  df-cj 15155  df-re 15156  df-im 15157  df-sqrt 15291  df-abs 15292  df-dvds 16315  df-gcd 16557  df-prm 16734  df-phi 16829  df-pc 16901  df-gz 16994  df-struct 17211  df-sets 17228  df-slot 17246  df-ndx 17258  df-base 17274  df-ress 17295  df-plusg 17327  df-mulr 17328  df-starv 17329  df-sca 17330  df-vsca 17331  df-ip 17332  df-tset 17333  df-ple 17334  df-ds 17336  df-unif 17337  df-hom 17338  df-cco 17339  df-0g 17498  df-gsum 17499  df-prds 17504  df-pws 17506  df-imas 17566  df-qus 17567  df-mre 17642  df-mrc 17643  df-acs 17645  df-mgm 18702  df-sgrp 18781  df-mnd 18797  df-mhm 18845  df-submnd 18846  df-grp 19007  df-minusg 19008  df-sbg 19009  df-mulg 19138  df-subg 19193  df-nsg 19194  df-eqg 19195  df-ghm 19288  df-cntz 19391  df-cmn 19856  df-abl 19857  df-mgp 20221  df-rng 20235  df-ur 20268  df-srg 20273  df-ring 20321  df-cring 20322  df-oppr 20424  df-dvdsr 20444  df-unit 20445  df-invr 20475  df-dvr 20488  df-rhm 20559  df-nzr 20619  df-subrng 20654  df-subrg 20678  df-rlreg 20802  df-domn 20803  df-idom 20804  df-drng 20838  df-field 20839  df-lmod 20992  df-lss 21062  df-lsp 21102  df-sra 21303  df-rgmod 21304  df-lidl 21341  df-rsp 21342  df-2idl 21398  df-cnfld 21532  df-zring 21606  df-zrh 21662  df-zn 21665  df-assa 22012  df-asp 22013  df-ascl 22014  df-psr 22068  df-mvr 22069  df-mpl 22070  df-opsr 22072  df-evls 22234  df-evl 22235  df-psr1 22349  df-vr1 22350  df-ply1 22351  df-coe1 22352  df-evl1 22485  df-mdeg 26221  df-deg1 26222  df-mon1 26297  df-uc1p 26298  df-q1p 26299  df-r1p 26300  df-lgs 27468
This theorem is used by:  2sqb  27605  2sqnn0  27611
  Copyright terms: Public domain W3C validator