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

Theorem 2sq 27282
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 2724 . . 3 ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)) = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
2 oveq1 7409 . . . . . . 7 (𝑎 = 𝑥 → (𝑎 gcd 𝑏) = (𝑥 gcd 𝑏))
32eqeq1d 2726 . . . . . 6 (𝑎 = 𝑥 → ((𝑎 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑏) = 1))
4 oveq1 7409 . . . . . . . 8 (𝑎 = 𝑥 → (𝑎↑2) = (𝑥↑2))
54oveq1d 7417 . . . . . . 7 (𝑎 = 𝑥 → ((𝑎↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑏↑2)))
65eqeq2d 2735 . . . . . 6 (𝑎 = 𝑥 → (𝑧 = ((𝑎↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑏↑2))))
73, 6anbi12d 630 . . . . 5 (𝑎 = 𝑥 → (((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2)))))
8 oveq2 7410 . . . . . . 7 (𝑏 = 𝑦 → (𝑥 gcd 𝑏) = (𝑥 gcd 𝑦))
98eqeq1d 2726 . . . . . 6 (𝑏 = 𝑦 → ((𝑥 gcd 𝑏) = 1 ↔ (𝑥 gcd 𝑦) = 1))
10 oveq1 7409 . . . . . . . 8 (𝑏 = 𝑦 → (𝑏↑2) = (𝑦↑2))
1110oveq2d 7418 . . . . . . 7 (𝑏 = 𝑦 → ((𝑥↑2) + (𝑏↑2)) = ((𝑥↑2) + (𝑦↑2)))
1211eqeq2d 2735 . . . . . 6 (𝑏 = 𝑦 → (𝑧 = ((𝑥↑2) + (𝑏↑2)) ↔ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
139, 12anbi12d 630 . . . . 5 (𝑏 = 𝑦 → (((𝑥 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑏↑2))) ↔ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))))
147, 13cbvrex2vw 3231 . . . 4 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))))
1514abbii 2794 . . 3 {𝑧 ∣ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ((𝑎 gcd 𝑏) = 1 ∧ 𝑧 = ((𝑎↑2) + (𝑏↑2)))} = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
161, 152sqlem11 27281 . 2 ((𝑃 ∈ ℙ ∧ (𝑃 mod 4) = 1) → 𝑃 ∈ ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2)))
1712sqlem2 27270 . 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 1533  wcel 2098  {cab 2701  wrex 3062  cmpt 5222  ran crn 5668  cfv 6534  (class class class)co 7402  1c1 11108   + caddc 11110  2c2 12265  4c4 12267  cz 12556   mod cmo 13832  cexp 14025  abscabs 15179   gcd cgcd 16434  cprime 16607  ℤ[i]cgz 16863
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 2163  ax-ext 2695  ax-rep 5276  ax-sep 5290  ax-nul 5297  ax-pow 5354  ax-pr 5418  ax-un 7719  ax-cnex 11163  ax-resscn 11164  ax-1cn 11165  ax-icn 11166  ax-addcl 11167  ax-addrcl 11168  ax-mulcl 11169  ax-mulrcl 11170  ax-mulcom 11171  ax-addass 11172  ax-mulass 11173  ax-distr 11174  ax-i2m1 11175  ax-1ne0 11176  ax-1rid 11177  ax-rnegex 11178  ax-rrecex 11179  ax-cnre 11180  ax-pre-lttri 11181  ax-pre-lttrn 11182  ax-pre-ltadd 11183  ax-pre-mulgt0 11184  ax-pre-sup 11185  ax-addf 11186  ax-mulf 11187
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 845  df-3or 1085  df-3an 1086  df-tru 1536  df-fal 1546  df-ex 1774  df-nf 1778  df-sb 2060  df-mo 2526  df-eu 2555  df-clab 2702  df-cleq 2716  df-clel 2802  df-nfc 2877  df-ne 2933  df-nel 3039  df-ral 3054  df-rex 3063  df-rmo 3368  df-reu 3369  df-rab 3425  df-v 3468  df-sbc 3771  df-csb 3887  df-dif 3944  df-un 3946  df-in 3948  df-ss 3958  df-pss 3960  df-nul 4316  df-if 4522  df-pw 4597  df-sn 4622  df-pr 4624  df-tp 4626  df-op 4628  df-uni 4901  df-int 4942  df-iun 4990  df-iin 4991  df-br 5140  df-opab 5202  df-mpt 5223  df-tr 5257  df-id 5565  df-eprel 5571  df-po 5579  df-so 5580  df-fr 5622  df-se 5623  df-we 5624  df-xp 5673  df-rel 5674  df-cnv 5675  df-co 5676  df-dm 5677  df-rn 5678  df-res 5679  df-ima 5680  df-pred 6291  df-ord 6358  df-on 6359  df-lim 6360  df-suc 6361  df-iota 6486  df-fun 6536  df-fn 6537  df-f 6538  df-f1 6539  df-fo 6540  df-f1o 6541  df-fv 6542  df-isom 6543  df-riota 7358  df-ov 7405  df-oprab 7406  df-mpo 7407  df-of 7664  df-ofr 7665  df-om 7850  df-1st 7969  df-2nd 7970  df-supp 8142  df-tpos 8207  df-frecs 8262  df-wrecs 8293  df-recs 8367  df-rdg 8406  df-1o 8462  df-2o 8463  df-oadd 8466  df-er 8700  df-ec 8702  df-qs 8706  df-map 8819  df-pm 8820  df-ixp 8889  df-en 8937  df-dom 8938  df-sdom 8939  df-fin 8940  df-fsupp 9359  df-sup 9434  df-inf 9435  df-oi 9502  df-dju 9893  df-card 9931  df-pnf 11248  df-mnf 11249  df-xr 11250  df-ltxr 11251  df-le 11252  df-sub 11444  df-neg 11445  df-div 11870  df-nn 12211  df-2 12273  df-3 12274  df-4 12275  df-5 12276  df-6 12277  df-7 12278  df-8 12279  df-9 12280  df-n0 12471  df-xnn0 12543  df-z 12557  df-dec 12676  df-uz 12821  df-q 12931  df-rp 12973  df-fz 13483  df-fzo 13626  df-fl 13755  df-mod 13833  df-seq 13965  df-exp 14026  df-hash 14289  df-cj 15044  df-re 15045  df-im 15046  df-sqrt 15180  df-abs 15181  df-dvds 16197  df-gcd 16435  df-prm 16608  df-phi 16700  df-pc 16771  df-gz 16864  df-struct 17081  df-sets 17098  df-slot 17116  df-ndx 17128  df-base 17146  df-ress 17175  df-plusg 17211  df-mulr 17212  df-starv 17213  df-sca 17214  df-vsca 17215  df-ip 17216  df-tset 17217  df-ple 17218  df-ds 17220  df-unif 17221  df-hom 17222  df-cco 17223  df-0g 17388  df-gsum 17389  df-prds 17394  df-pws 17396  df-imas 17455  df-qus 17456  df-mre 17531  df-mrc 17532  df-acs 17534  df-mgm 18565  df-sgrp 18644  df-mnd 18660  df-mhm 18705  df-submnd 18706  df-grp 18858  df-minusg 18859  df-sbg 18860  df-mulg 18988  df-subg 19042  df-nsg 19043  df-eqg 19044  df-ghm 19131  df-cntz 19225  df-cmn 19694  df-abl 19695  df-mgp 20032  df-rng 20050  df-ur 20079  df-srg 20084  df-ring 20132  df-cring 20133  df-oppr 20228  df-dvdsr 20251  df-unit 20252  df-invr 20282  df-dvr 20295  df-rhm 20366  df-nzr 20407  df-subrng 20438  df-subrg 20463  df-drng 20581  df-field 20582  df-lmod 20700  df-lss 20771  df-lsp 20811  df-sra 21013  df-rgmod 21014  df-lidl 21059  df-rsp 21060  df-2idl 21099  df-rlreg 21185  df-domn 21186  df-idom 21187  df-cnfld 21231  df-zring 21304  df-zrh 21360  df-zn 21363  df-assa 21718  df-asp 21719  df-ascl 21720  df-psr 21773  df-mvr 21774  df-mpl 21775  df-opsr 21777  df-evls 21947  df-evl 21948  df-psr1 22024  df-vr1 22025  df-ply1 22026  df-coe1 22027  df-evl1 22159  df-mdeg 25912  df-deg1 25913  df-mon1 25990  df-uc1p 25991  df-q1p 25992  df-r1p 25993  df-lgs 27147
This theorem is referenced by:  2sqb  27284  2sqnn0  27290
  Copyright terms: Public domain W3C validator