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

Theorem mul4sq 16284
 Description: Euler's four-square identity: The product of two sums of four squares is also a sum of four squares. This is usually quoted as an explicit formula involving eight real variables; we save some time by working with complex numbers (gaussian integers) instead, so that we only have to work with four variables, and also hiding the actual formula for the product in the proof of mul4sqlem 16283. (For the curious, the explicit formula that is used is ( ∣ 𝑎 ∣ ↑2 + ∣ 𝑏 ∣ ↑2)( ∣ 𝑐 ∣ ↑2 + ∣ 𝑑 ∣ ↑2) = ∣ 𝑎∗ · 𝑐 + 𝑏 · 𝑑∗ ∣ ↑2 + ∣ 𝑎∗ · 𝑑 − 𝑏 · 𝑐∗ ∣ ↑2.) (Contributed by Mario Carneiro, 14-Jul-2014.)
Hypothesis
Ref Expression
4sq.1 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
Assertion
Ref Expression
mul4sq ((𝐴𝑆𝐵𝑆) → (𝐴 · 𝐵) ∈ 𝑆)
Distinct variable groups:   𝑤,𝑛,𝑥,𝑦,𝑧   𝐵,𝑛   𝐴,𝑛   𝑆,𝑛
Allowed substitution hints:   𝐴(𝑥,𝑦,𝑧,𝑤)   𝐵(𝑥,𝑦,𝑧,𝑤)   𝑆(𝑥,𝑦,𝑧,𝑤)

Proof of Theorem mul4sq
Dummy variables 𝑎 𝑏 𝑐 𝑑 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 4sq.1 . . 3 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
214sqlem4 16282 . 2 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ[i] ∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)))
314sqlem4 16282 . 2 (𝐵𝑆 ↔ ∃𝑐 ∈ ℤ[i] ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)))
4 reeanv 3367 . . 3 (∃𝑎 ∈ ℤ[i] ∃𝑐 ∈ ℤ[i] (∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) ↔ (∃𝑎 ∈ ℤ[i] ∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ ∃𝑐 ∈ ℤ[i] ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))))
5 reeanv 3367 . . . . 5 (∃𝑏 ∈ ℤ[i] ∃𝑑 ∈ ℤ[i] (𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) ↔ (∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))))
6 simpll 765 . . . . . . . . . . . . 13 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → 𝑎 ∈ ℤ[i])
7 gzabssqcl 16271 . . . . . . . . . . . . 13 (𝑎 ∈ ℤ[i] → ((abs‘𝑎)↑2) ∈ ℕ0)
86, 7syl 17 . . . . . . . . . . . 12 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((abs‘𝑎)↑2) ∈ ℕ0)
9 simprl 769 . . . . . . . . . . . . 13 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → 𝑏 ∈ ℤ[i])
10 gzabssqcl 16271 . . . . . . . . . . . . 13 (𝑏 ∈ ℤ[i] → ((abs‘𝑏)↑2) ∈ ℕ0)
119, 10syl 17 . . . . . . . . . . . 12 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((abs‘𝑏)↑2) ∈ ℕ0)
128, 11nn0addcld 11953 . . . . . . . . . . 11 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∈ ℕ0)
1312nn0cnd 11951 . . . . . . . . . 10 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∈ ℂ)
1413div1d 11402 . . . . . . . . 9 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) / 1) = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)))
15 simplr 767 . . . . . . . . . . . . 13 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → 𝑐 ∈ ℤ[i])
16 gzabssqcl 16271 . . . . . . . . . . . . 13 (𝑐 ∈ ℤ[i] → ((abs‘𝑐)↑2) ∈ ℕ0)
1715, 16syl 17 . . . . . . . . . . . 12 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((abs‘𝑐)↑2) ∈ ℕ0)
18 simprr 771 . . . . . . . . . . . . 13 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → 𝑑 ∈ ℤ[i])
19 gzabssqcl 16271 . . . . . . . . . . . . 13 (𝑑 ∈ ℤ[i] → ((abs‘𝑑)↑2) ∈ ℕ0)
2018, 19syl 17 . . . . . . . . . . . 12 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((abs‘𝑑)↑2) ∈ ℕ0)
2117, 20nn0addcld 11953 . . . . . . . . . . 11 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)) ∈ ℕ0)
2221nn0cnd 11951 . . . . . . . . . 10 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)) ∈ ℂ)
2322div1d 11402 . . . . . . . . 9 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)) / 1) = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)))
2414, 23oveq12d 7168 . . . . . . . 8 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) / 1) · ((((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)) / 1)) = ((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) · (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))))
25 eqid 2821 . . . . . . . . 9 (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2))
26 eqid 2821 . . . . . . . . 9 (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)) = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))
27 1nn 11643 . . . . . . . . . 10 1 ∈ ℕ
2827a1i 11 . . . . . . . . 9 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → 1 ∈ ℕ)
29 gzsubcl 16270 . . . . . . . . . . . . 13 ((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) → (𝑎𝑐) ∈ ℤ[i])
3029adantr 483 . . . . . . . . . . . 12 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (𝑎𝑐) ∈ ℤ[i])
31 gzcn 16262 . . . . . . . . . . . 12 ((𝑎𝑐) ∈ ℤ[i] → (𝑎𝑐) ∈ ℂ)
3230, 31syl 17 . . . . . . . . . . 11 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (𝑎𝑐) ∈ ℂ)
3332div1d 11402 . . . . . . . . . 10 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((𝑎𝑐) / 1) = (𝑎𝑐))
3433, 30eqeltrd 2913 . . . . . . . . 9 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((𝑎𝑐) / 1) ∈ ℤ[i])
35 gzsubcl 16270 . . . . . . . . . . . . 13 ((𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i]) → (𝑏𝑑) ∈ ℤ[i])
3635adantl 484 . . . . . . . . . . . 12 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (𝑏𝑑) ∈ ℤ[i])
37 gzcn 16262 . . . . . . . . . . . 12 ((𝑏𝑑) ∈ ℤ[i] → (𝑏𝑑) ∈ ℂ)
3836, 37syl 17 . . . . . . . . . . 11 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (𝑏𝑑) ∈ ℂ)
3938div1d 11402 . . . . . . . . . 10 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((𝑏𝑑) / 1) = (𝑏𝑑))
4039, 36eqeltrd 2913 . . . . . . . . 9 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((𝑏𝑑) / 1) ∈ ℤ[i])
4114, 12eqeltrd 2913 . . . . . . . . 9 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) / 1) ∈ ℕ0)
421, 6, 9, 15, 18, 25, 26, 28, 34, 40, 41mul4sqlem 16283 . . . . . . . 8 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → (((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) / 1) · ((((abs‘𝑐)↑2) + ((abs‘𝑑)↑2)) / 1)) ∈ 𝑆)
4324, 42eqeltrrd 2914 . . . . . . 7 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) · (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) ∈ 𝑆)
44 oveq12 7159 . . . . . . . 8 ((𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → (𝐴 · 𝐵) = ((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) · (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))))
4544eleq1d 2897 . . . . . . 7 ((𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → ((𝐴 · 𝐵) ∈ 𝑆 ↔ ((((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) · (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) ∈ 𝑆))
4643, 45syl5ibrcom 249 . . . . . 6 (((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) ∧ (𝑏 ∈ ℤ[i] ∧ 𝑑 ∈ ℤ[i])) → ((𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → (𝐴 · 𝐵) ∈ 𝑆))
4746rexlimdvva 3294 . . . . 5 ((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) → (∃𝑏 ∈ ℤ[i] ∃𝑑 ∈ ℤ[i] (𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → (𝐴 · 𝐵) ∈ 𝑆))
485, 47syl5bir 245 . . . 4 ((𝑎 ∈ ℤ[i] ∧ 𝑐 ∈ ℤ[i]) → ((∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → (𝐴 · 𝐵) ∈ 𝑆))
4948rexlimivv 3292 . . 3 (∃𝑎 ∈ ℤ[i] ∃𝑐 ∈ ℤ[i] (∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → (𝐴 · 𝐵) ∈ 𝑆)
504, 49sylbir 237 . 2 ((∃𝑎 ∈ ℤ[i] ∃𝑏 ∈ ℤ[i] 𝐴 = (((abs‘𝑎)↑2) + ((abs‘𝑏)↑2)) ∧ ∃𝑐 ∈ ℤ[i] ∃𝑑 ∈ ℤ[i] 𝐵 = (((abs‘𝑐)↑2) + ((abs‘𝑑)↑2))) → (𝐴 · 𝐵) ∈ 𝑆)
512, 3, 50syl2anb 599 1 ((𝐴𝑆𝐵𝑆) → (𝐴 · 𝐵) ∈ 𝑆)
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 398   = wceq 1533   ∈ wcel 2110  {cab 2799  ∃wrex 3139  ‘cfv 6349  (class class class)co 7150  ℂcc 10529  1c1 10532   + caddc 10534   · cmul 10536   − cmin 10864   / cdiv 11291  ℕcn 11632  2c2 11686  ℕ0cn0 11891  ℤcz 11975  ↑cexp 13423  abscabs 14587  ℤ[i]cgz 16259 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1792  ax-4 1806  ax-5 1907  ax-6 1966  ax-7 2011  ax-8 2112  ax-9 2120  ax-10 2141  ax-11 2157  ax-12 2173  ax-ext 2793  ax-sep 5195  ax-nul 5202  ax-pow 5258  ax-pr 5321  ax-un 7455  ax-cnex 10587  ax-resscn 10588  ax-1cn 10589  ax-icn 10590  ax-addcl 10591  ax-addrcl 10592  ax-mulcl 10593  ax-mulrcl 10594  ax-mulcom 10595  ax-addass 10596  ax-mulass 10597  ax-distr 10598  ax-i2m1 10599  ax-1ne0 10600  ax-1rid 10601  ax-rnegex 10602  ax-rrecex 10603  ax-cnre 10604  ax-pre-lttri 10605  ax-pre-lttrn 10606  ax-pre-ltadd 10607  ax-pre-mulgt0 10608  ax-pre-sup 10609 This theorem depends on definitions:  df-bi 209  df-an 399  df-or 844  df-3or 1084  df-3an 1085  df-tru 1536  df-ex 1777  df-nf 1781  df-sb 2066  df-mo 2618  df-eu 2650  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 3772  df-csb 3883  df-dif 3938  df-un 3940  df-in 3942  df-ss 3951  df-pss 3953  df-nul 4291  df-if 4467  df-pw 4540  df-sn 4561  df-pr 4563  df-tp 4565  df-op 4567  df-uni 4832  df-iun 4913  df-br 5059  df-opab 5121  df-mpt 5139  df-tr 5165  df-id 5454  df-eprel 5459  df-po 5468  df-so 5469  df-fr 5508  df-we 5510  df-xp 5555  df-rel 5556  df-cnv 5557  df-co 5558  df-dm 5559  df-rn 5560  df-res 5561  df-ima 5562  df-pred 6142  df-ord 6188  df-on 6189  df-lim 6190  df-suc 6191  df-iota 6308  df-fun 6351  df-fn 6352  df-f 6353  df-f1 6354  df-fo 6355  df-f1o 6356  df-fv 6357  df-riota 7108  df-ov 7153  df-oprab 7154  df-mpo 7155  df-om 7575  df-2nd 7684  df-wrecs 7941  df-recs 8002  df-rdg 8040  df-er 8283  df-en 8504  df-dom 8505  df-sdom 8506  df-sup 8900  df-pnf 10671  df-mnf 10672  df-xr 10673  df-ltxr 10674  df-le 10675  df-sub 10866  df-neg 10867  df-div 11292  df-nn 11633  df-2 11694  df-3 11695  df-n0 11892  df-z 11976  df-uz 12238  df-rp 12384  df-seq 13364  df-exp 13424  df-cj 14452  df-re 14453  df-im 14454  df-sqrt 14588  df-abs 14589  df-gz 16260 This theorem is referenced by:  4sqlem19  16293
 Copyright terms: Public domain W3C validator