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

Theorem 4sqlem4 16288
Description: Lemma for 4sq 16300. 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 16285 . . 3 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
3 gzreim 16275 . . . . . . . 8 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (𝑎 + (i · 𝑏)) ∈ ℤ[i])
43adantr 483 . . . . . . 7 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝑎 + (i · 𝑏)) ∈ ℤ[i])
5 gzreim 16275 . . . . . . . 8 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (𝑐 + (i · 𝑑)) ∈ ℤ[i])
65adantl 484 . . . . . . 7 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝑐 + (i · 𝑑)) ∈ ℤ[i])
7 gzcn 16268 . . . . . . . . . . . 12 ((𝑎 + (i · 𝑏)) ∈ ℤ[i] → (𝑎 + (i · 𝑏)) ∈ ℂ)
83, 7syl 17 . . . . . . . . . . 11 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (𝑎 + (i · 𝑏)) ∈ ℂ)
98absvalsq2d 14803 . . . . . . . . . 10 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((abs‘(𝑎 + (i · 𝑏)))↑2) = (((ℜ‘(𝑎 + (i · 𝑏)))↑2) + ((ℑ‘(𝑎 + (i · 𝑏)))↑2)))
10 zre 11986 . . . . . . . . . . . . 13 (𝑎 ∈ ℤ → 𝑎 ∈ ℝ)
11 zre 11986 . . . . . . . . . . . . 13 (𝑏 ∈ ℤ → 𝑏 ∈ ℝ)
12 crre 14473 . . . . . . . . . . . . 13 ((𝑎 ∈ ℝ ∧ 𝑏 ∈ ℝ) → (ℜ‘(𝑎 + (i · 𝑏))) = 𝑎)
1310, 11, 12syl2an 597 . . . . . . . . . . . 12 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (ℜ‘(𝑎 + (i · 𝑏))) = 𝑎)
1413oveq1d 7171 . . . . . . . . . . 11 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((ℜ‘(𝑎 + (i · 𝑏)))↑2) = (𝑎↑2))
15 crim 14474 . . . . . . . . . . . . 13 ((𝑎 ∈ ℝ ∧ 𝑏 ∈ ℝ) → (ℑ‘(𝑎 + (i · 𝑏))) = 𝑏)
1610, 11, 15syl2an 597 . . . . . . . . . . . 12 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (ℑ‘(𝑎 + (i · 𝑏))) = 𝑏)
1716oveq1d 7171 . . . . . . . . . . 11 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((ℑ‘(𝑎 + (i · 𝑏)))↑2) = (𝑏↑2))
1814, 17oveq12d 7174 . . . . . . . . . 10 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (((ℜ‘(𝑎 + (i · 𝑏)))↑2) + ((ℑ‘(𝑎 + (i · 𝑏)))↑2)) = ((𝑎↑2) + (𝑏↑2)))
199, 18eqtrd 2856 . . . . . . . . 9 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → ((abs‘(𝑎 + (i · 𝑏)))↑2) = ((𝑎↑2) + (𝑏↑2)))
20 gzcn 16268 . . . . . . . . . . . 12 ((𝑐 + (i · 𝑑)) ∈ ℤ[i] → (𝑐 + (i · 𝑑)) ∈ ℂ)
215, 20syl 17 . . . . . . . . . . 11 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (𝑐 + (i · 𝑑)) ∈ ℂ)
2221absvalsq2d 14803 . . . . . . . . . 10 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((abs‘(𝑐 + (i · 𝑑)))↑2) = (((ℜ‘(𝑐 + (i · 𝑑)))↑2) + ((ℑ‘(𝑐 + (i · 𝑑)))↑2)))
23 zre 11986 . . . . . . . . . . . . 13 (𝑐 ∈ ℤ → 𝑐 ∈ ℝ)
24 zre 11986 . . . . . . . . . . . . 13 (𝑑 ∈ ℤ → 𝑑 ∈ ℝ)
25 crre 14473 . . . . . . . . . . . . 13 ((𝑐 ∈ ℝ ∧ 𝑑 ∈ ℝ) → (ℜ‘(𝑐 + (i · 𝑑))) = 𝑐)
2623, 24, 25syl2an 597 . . . . . . . . . . . 12 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (ℜ‘(𝑐 + (i · 𝑑))) = 𝑐)
2726oveq1d 7171 . . . . . . . . . . 11 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((ℜ‘(𝑐 + (i · 𝑑)))↑2) = (𝑐↑2))
28 crim 14474 . . . . . . . . . . . . 13 ((𝑐 ∈ ℝ ∧ 𝑑 ∈ ℝ) → (ℑ‘(𝑐 + (i · 𝑑))) = 𝑑)
2923, 24, 28syl2an 597 . . . . . . . . . . . 12 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (ℑ‘(𝑐 + (i · 𝑑))) = 𝑑)
3029oveq1d 7171 . . . . . . . . . . 11 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((ℑ‘(𝑐 + (i · 𝑑)))↑2) = (𝑑↑2))
3127, 30oveq12d 7174 . . . . . . . . . 10 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → (((ℜ‘(𝑐 + (i · 𝑑)))↑2) + ((ℑ‘(𝑐 + (i · 𝑑)))↑2)) = ((𝑐↑2) + (𝑑↑2)))
3222, 31eqtrd 2856 . . . . . . . . 9 ((𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ) → ((abs‘(𝑐 + (i · 𝑑)))↑2) = ((𝑐↑2) + (𝑑↑2)))
3319, 32oveqan12d 7175 . . . . . . . 8 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2)) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
3433eqcomd 2827 . . . . . . 7 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2)))
35 fveq2 6670 . . . . . . . . . . 11 (𝑢 = (𝑎 + (i · 𝑏)) → (abs‘𝑢) = (abs‘(𝑎 + (i · 𝑏))))
3635oveq1d 7171 . . . . . . . . . 10 (𝑢 = (𝑎 + (i · 𝑏)) → ((abs‘𝑢)↑2) = ((abs‘(𝑎 + (i · 𝑏)))↑2))
3736oveq1d 7171 . . . . . . . . 9 (𝑢 = (𝑎 + (i · 𝑏)) → (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2)))
3837eqeq2d 2832 . . . . . . . 8 (𝑢 = (𝑎 + (i · 𝑏)) → ((((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ↔ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2))))
39 fveq2 6670 . . . . . . . . . . 11 (𝑣 = (𝑐 + (i · 𝑑)) → (abs‘𝑣) = (abs‘(𝑐 + (i · 𝑑))))
4039oveq1d 7171 . . . . . . . . . 10 (𝑣 = (𝑐 + (i · 𝑑)) → ((abs‘𝑣)↑2) = ((abs‘(𝑐 + (i · 𝑑)))↑2))
4140oveq2d 7172 . . . . . . . . 9 (𝑣 = (𝑐 + (i · 𝑑)) → (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2)) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2)))
4241eqeq2d 2832 . . . . . . . 8 (𝑣 = (𝑐 + (i · 𝑑)) → ((((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘𝑣)↑2)) ↔ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘(𝑎 + (i · 𝑏)))↑2) + ((abs‘(𝑐 + (i · 𝑑)))↑2))))
4338, 42rspc2ev 3635 . . . . . . 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 1367 . . . . . 6 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
45 eqeq1 2825 . . . . . . 7 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → (𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ↔ (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
46452rexbidv 3300 . . . . . 6 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → (∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ↔ ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
4744, 46syl5ibrcom 249 . . . . 5 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
4847rexlimdvva 3294 . . . 4 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2))))
4948rexlimivv 3292 . . 3 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
502, 49sylbi 219 . 2 (𝐴𝑆 → ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
5114sqlem4a 16287 . . . 4 ((𝑢 ∈ ℤ[i] ∧ 𝑣 ∈ ℤ[i]) → (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ∈ 𝑆)
52 eleq1a 2908 . . . 4 ((((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) ∈ 𝑆 → (𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) → 𝐴𝑆))
5351, 52syl 17 . . 3 ((𝑢 ∈ ℤ[i] ∧ 𝑣 ∈ ℤ[i]) → (𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) → 𝐴𝑆))
5453rexlimivv 3292 . 2 (∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)) → 𝐴𝑆)
5550, 54impbii 211 1 (𝐴𝑆 ↔ ∃𝑢 ∈ ℤ[i] ∃𝑣 ∈ ℤ[i] 𝐴 = (((abs‘𝑢)↑2) + ((abs‘𝑣)↑2)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 208  wa 398   = wceq 1537  wcel 2114  {cab 2799  wrex 3139  cfv 6355  (class class class)co 7156  cc 10535  cr 10536  ici 10539   + caddc 10540   · cmul 10542  2c2 11693  cz 11982  cexp 13430  cre 14456  cim 14457  abscabs 14593  ℤ[i]cgz 16265
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1796  ax-4 1810  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2116  ax-9 2124  ax-10 2145  ax-11 2161  ax-12 2177  ax-ext 2793  ax-sep 5203  ax-nul 5210  ax-pow 5266  ax-pr 5330  ax-un 7461  ax-cnex 10593  ax-resscn 10594  ax-1cn 10595  ax-icn 10596  ax-addcl 10597  ax-addrcl 10598  ax-mulcl 10599  ax-mulrcl 10600  ax-mulcom 10601  ax-addass 10602  ax-mulass 10603  ax-distr 10604  ax-i2m1 10605  ax-1ne0 10606  ax-1rid 10607  ax-rnegex 10608  ax-rrecex 10609  ax-cnre 10610  ax-pre-lttri 10611  ax-pre-lttrn 10612  ax-pre-ltadd 10613  ax-pre-mulgt0 10614  ax-pre-sup 10615
This theorem depends on definitions:  df-bi 209  df-an 399  df-or 844  df-3or 1084  df-3an 1085  df-tru 1540  df-ex 1781  df-nf 1785  df-sb 2070  df-mo 2622  df-eu 2654  df-clab 2800  df-cleq 2814  df-clel 2893  df-nfc 2963  df-ne 3017  df-nel 3124  df-ral 3143  df-rex 3144  df-reu 3145  df-rmo 3146  df-rab 3147  df-v 3496  df-sbc 3773  df-csb 3884  df-dif 3939  df-un 3941  df-in 3943  df-ss 3952  df-pss 3954  df-nul 4292  df-if 4468  df-pw 4541  df-sn 4568  df-pr 4570  df-tp 4572  df-op 4574  df-uni 4839  df-iun 4921  df-br 5067  df-opab 5129  df-mpt 5147  df-tr 5173  df-id 5460  df-eprel 5465  df-po 5474  df-so 5475  df-fr 5514  df-we 5516  df-xp 5561  df-rel 5562  df-cnv 5563  df-co 5564  df-dm 5565  df-rn 5566  df-res 5567  df-ima 5568  df-pred 6148  df-ord 6194  df-on 6195  df-lim 6196  df-suc 6197  df-iota 6314  df-fun 6357  df-fn 6358  df-f 6359  df-f1 6360  df-fo 6361  df-f1o 6362  df-fv 6363  df-riota 7114  df-ov 7159  df-oprab 7160  df-mpo 7161  df-om 7581  df-2nd 7690  df-wrecs 7947  df-recs 8008  df-rdg 8046  df-er 8289  df-en 8510  df-dom 8511  df-sdom 8512  df-sup 8906  df-pnf 10677  df-mnf 10678  df-xr 10679  df-ltxr 10680  df-le 10681  df-sub 10872  df-neg 10873  df-div 11298  df-nn 11639  df-2 11701  df-3 11702  df-n0 11899  df-z 11983  df-uz 12245  df-rp 12391  df-seq 13371  df-exp 13431  df-cj 14458  df-re 14459  df-im 14460  df-sqrt 14594  df-abs 14595  df-gz 16266
This theorem is referenced by:  mul4sq  16290
  Copyright terms: Public domain W3C validator