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

Theorem 4sqlem4 16278
Description: Lemma for 4sq 16290. We can express the four-square property more compactly in terms of gaussian integers, because the norms of gaussian integers are exactly sums of two squares. (Contributed by Mario Carneiro, 14-Jul-2014.)
Hypothesis
Ref Expression
4sq.1 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
Assertion
Ref Expression
4sqlem4 (𝐴𝑆 ↔ ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
Distinct variable groups:   𝑤,𝑛,𝑥,𝑦,𝑧   𝑣,𝑛,𝐴,𝑢   𝑆,𝑛,𝑢,𝑣   𝑢,𝐴
Allowed substitution hints:   𝐴(𝑥,𝑦,𝑧,𝑤)   𝑆(𝑥,𝑦,𝑧,𝑤)

Proof of Theorem 4sqlem4
Dummy variables 𝑎 𝑏 𝑐 𝑑 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 4sq.1 . . . 4 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
214sqlem2 16275 . . 3 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
3 gzreim 16265 . . . . . . . 8 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (𝑎 + (i · 𝑏)) ∈ ℤ[i])
43adantr 484 . . . . . . 7 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝑎 + (i · 𝑏)) ∈ ℤ[i])
5 gzreim 16265 . . . . . . . 8 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (𝑐 + (i · 𝑑)) ∈ ℤ[i])
65adantl 485 . . . . . . 7 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝑐 + (i · 𝑑)) ∈ ℤ[i])
7 gzcn 16258 . . . . . . . . . . . 12 ((𝑎 + (i · 𝑏)) ∈ ℤ[i] → (𝑎 + (i · 𝑏)) ∈ ℂ)
83, 7syl 17 . . . . . . . . . . 11 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (𝑎 + (i · 𝑏)) ∈ ℂ)
98absvalsq2d 14795 . . . . . . . . . 10 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((abs‘(𝑎 + (i · 𝑏)))↑2) = (((ℜ‘(𝑎 + (i · 𝑏)))↑2) + ((ℑ‘(𝑎 + (i · 𝑏)))↑2)))
10 zre 11973 . . . . . . . . . . . . 13 (𝑎 ∈ ℤ → 𝑎 ∈ ℝ)
11 zre 11973 . . . . . . . . . . . . 13 (𝑏 ∈ ℤ → 𝑏 ∈ ℝ)
12 crre 14465 . . . . . . . . . . . . 13 ((𝑎 ∈ ℝ ∧ 𝑏 ∈ ℝ) → (ℜ‘(𝑎 + (i · 𝑏))) = 𝑎)
1310, 11, 12syl2an 598 . . . . . . . . . . . 12 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (ℜ‘(𝑎 + (i · 𝑏))) = 𝑎)
1413oveq1d 7150 . . . . . . . . . . 11 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((ℜ‘(𝑎 + (i · 𝑏)))↑2) = (𝑎↑2))
15 crim 14466 . . . . . . . . . . . . 13 ((𝑎 ∈ ℝ ∧ 𝑏 ∈ ℝ) → (ℑ‘(𝑎 + (i · 𝑏))) = 𝑏)
1610, 11, 15syl2an 598 . . . . . . . . . . . 12 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (ℑ‘(𝑎 + (i · 𝑏))) = 𝑏)
1716oveq1d 7150 . . . . . . . . . . 11 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((ℑ‘(𝑎 + (i · 𝑏)))↑2) = (𝑏↑2))
1814, 17oveq12d 7153 . . . . . . . . . 10 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (((ℜ‘(𝑎 + (i · 𝑏)))↑2) + ((ℑ‘(𝑎 + (i · 𝑏)))↑2)) = ((𝑎↑2) + (𝑏↑2)))
199, 18eqtrd 2833 . . . . . . . . 9 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((abs‘(𝑎 + (i · 𝑏)))↑2) = ((𝑎↑2) + (𝑏↑2)))
20 gzcn 16258 . . . . . . . . . . . 12 ((𝑐 + (i · 𝑑)) ∈ ℤ[i] → (𝑐 + (i · 𝑑)) ∈ ℂ)
215, 20syl 17 . . . . . . . . . . 11 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (𝑐 + (i · 𝑑)) ∈ ℂ)
2221absvalsq2d 14795 . . . . . . . . . 10 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((abs‘(𝑐 + (i · 𝑑)))↑2) = (((ℜ‘(𝑐 + (i · 𝑑)))↑2) + ((ℑ‘(𝑐 + (i · 𝑑)))↑2)))
23 zre 11973 . . . . . . . . . . . . 13 (𝑐 ∈ ℤ → 𝑐 ∈ ℝ)
24 zre 11973 . . . . . . . . . . . . 13 (𝑑 ∈ ℤ → 𝑑 ∈ ℝ)
25 crre 14465 . . . . . . . . . . . . 13 ((𝑐 ∈ ℝ ∧ 𝑑 ∈ ℝ) → (ℜ‘(𝑐 + (i · 𝑑))) = 𝑐)
2623, 24, 25syl2an 598 . . . . . . . . . . . 12 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (ℜ‘(𝑐 + (i · 𝑑))) = 𝑐)
2726oveq1d 7150 . . . . . . . . . . 11 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((ℜ‘(𝑐 + (i · 𝑑)))↑2) = (𝑐↑2))
28 crim 14466 . . . . . . . . . . . . 13 ((𝑐 ∈ ℝ ∧ 𝑑 ∈ ℝ) → (ℑ‘(𝑐 + (i · 𝑑))) = 𝑑)
2923, 24, 28syl2an 598 . . . . . . . . . . . 12 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (ℑ‘(𝑐 + (i · 𝑑))) = 𝑑)
3029oveq1d 7150 . . . . . . . . . . 11 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((ℑ‘(𝑐 + (i · 𝑑)))↑2) = (𝑑↑2))
3127, 30oveq12d 7153 . . . . . . . . . 10 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (((ℜ‘(𝑐 + (i · 𝑑)))↑2) + ((ℑ‘(𝑐 + (i · 𝑑)))↑2)) = ((𝑐↑2) + (𝑑↑2)))
3222, 31eqtrd 2833 . . . . . . . . 9 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((abs‘(𝑐 + (i · 𝑑)))↑2) = ((𝑐↑2) + (𝑑↑2)))
3319, 32oveqan12d 7154 . . . . . . . 8 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2)) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
3433eqcomd 2804 . . . . . . 7 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2)))
35 fveq2 6645 . . . . . . . . . . 11 (𝑢 = (𝑎 + (i · 𝑏)) → (abs‘𝑢) = (abs‘(𝑎 + (i · 𝑏))))
3635oveq1d 7150 . . . . . . . . . 10 (𝑢 = (𝑎 + (i · 𝑏)) → ((abs‘𝑢)↑2) = ((abs‘(𝑎 + (i · 𝑏)))↑2))
3736oveq1d 7150 . . . . . . . . 9 (𝑢 = (𝑎 + (i · 𝑏)) → (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2)))
3837eqeq2d 2809 . . . . . . . 8 (𝑢 = (𝑎 + (i · 𝑏)) → ((((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ↔ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2))))
39 fveq2 6645 . . . . . . . . . . 11 (𝑣 = (𝑐 + (i · 𝑑)) → (abs‘𝑣) = (abs‘(𝑐 + (i · 𝑑))))
4039oveq1d 7150 . . . . . . . . . 10 (𝑣 = (𝑐 + (i · 𝑑)) → ((abs‘𝑣)↑2) = ((abs‘(𝑐 + (i · 𝑑)))↑2))
4140oveq2d 7151 . . . . . . . . 9 (𝑣 = (𝑐 + (i · 𝑑)) → (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2)) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2)))
4241eqeq2d 2809 . . . . . . . 8 (𝑣 = (𝑐 + (i · 𝑑)) → ((((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2)) ↔ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2))))
4338, 42rspc2ev 3583 . . . . . . 7 (((𝑎 + (i · 𝑏)) ∈ ℤ[i] ∧ (𝑐 + (i · 𝑑)) ∈ ℤ[i] ∧ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
444, 6, 34, 43syl3anc 1368 . . . . . 6 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
45 eqeq1 2802 . . . . . . 7 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → (𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ↔ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
46452rexbidv 3259 . . . . . 6 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → (∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ↔ ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
4744, 46syl5ibrcom 250 . . . . 5 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
4847rexlimdvva 3253 . . . 4 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
4948rexlimivv 3251 . . 3 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
502, 49sylbi 220 . 2 (𝐴𝑆 → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
5114sqlem4a 16277 . . . 4 ((𝑢 ∈ ℤ[i] ∧ 𝑣 ∈ ℤ[i]) → (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ∈ 𝑆)
52 eleq1a 2885 . . . 4 ((((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ∈ 𝑆 → (𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) → 𝐴𝑆))
5351, 52syl 17 . . 3 ((𝑢 ∈ ℤ[i] ∧ 𝑣 ∈ ℤ[i]) → (𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) → 𝐴𝑆))
5453rexlimivv 3251 . 2 (∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) → 𝐴𝑆)
5550, 54impbii 212 1 (𝐴𝑆 ↔ ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 209  wa 399   = wceq 1538  wcel 2111  {cab 2776  wrex 3107  cfv 6324  (class class class)co 7135  cc 10524  cr 10525  ici 10528   + caddc 10529   · cmul 10531  2c2 11680  cz 11969  cexp 13425  cre 14448  cim 14449  abscabs 14585  ℤ[i]cgz 16255
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2113  ax-9 2121  ax-10 2142  ax-11 2158  ax-12 2175  ax-ext 2770  ax-sep 5167  ax-nul 5174  ax-pow 5231  ax-pr 5295  ax-un 7441  ax-cnex 10582  ax-resscn 10583  ax-1cn 10584  ax-icn 10585  ax-addcl 10586  ax-addrcl 10587  ax-mulcl 10588  ax-mulrcl 10589  ax-mulcom 10590  ax-addass 10591  ax-mulass 10592  ax-distr 10593  ax-i2m1 10594  ax-1ne0 10595  ax-1rid 10596  ax-rnegex 10597  ax-rrecex 10598  ax-cnre 10599  ax-pre-lttri 10600  ax-pre-lttrn 10601  ax-pre-ltadd 10602  ax-pre-mulgt0 10603  ax-pre-sup 10604
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1085  df-3an 1086  df-tru 1541  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2598  df-eu 2629  df-clab 2777  df-cleq 2791  df-clel 2870  df-nfc 2938  df-ne 2988  df-nel 3092  df-ral 3111  df-rex 3112  df-reu 3113  df-rmo 3114  df-rab 3115  df-v 3443  df-sbc 3721  df-csb 3829  df-dif 3884  df-un 3886  df-in 3888  df-ss 3898  df-pss 3900  df-nul 4244  df-if 4426  df-pw 4499  df-sn 4526  df-pr 4528  df-tp 4530  df-op 4532  df-uni 4801  df-iun 4883  df-br 5031  df-opab 5093  df-mpt 5111  df-tr 5137  df-id 5425  df-eprel 5430  df-po 5438  df-so 5439  df-fr 5478  df-we 5480  df-xp 5525  df-rel 5526  df-cnv 5527  df-co 5528  df-dm 5529  df-rn 5530  df-res 5531  df-ima 5532  df-pred 6116  df-ord 6162  df-on 6163  df-lim 6164  df-suc 6165  df-iota 6283  df-fun 6326  df-fn 6327  df-f 6328  df-f1 6329  df-fo 6330  df-f1o 6331  df-fv 6332  df-riota 7093  df-ov 7138  df-oprab 7139  df-mpo 7140  df-om 7561  df-2nd 7672  df-wrecs 7930  df-recs 7991  df-rdg 8029  df-er 8272  df-en 8493  df-dom 8494  df-sdom 8495  df-sup 8890  df-pnf 10666  df-mnf 10667  df-xr 10668  df-ltxr 10669  df-le 10670  df-sub 10861  df-neg 10862  df-div 11287  df-nn 11626  df-2 11688  df-3 11689  df-n0 11886  df-z 11970  df-uz 12232  df-rp 12378  df-seq 13365  df-exp 13426  df-cj 14450  df-re 14451  df-im 14452  df-sqrt 14586  df-abs 14587  df-gz 16256
This theorem is referenced by:  mul4sq  16280
  Copyright terms: Public domain W3C validator