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

Theorem 4sqlem2 16650
Description: Lemma for 4sq 16665. Change bound variables in 𝑆. (Contributed by Mario Carneiro, 14-Jul-2014.)
Hypothesis
Ref Expression
4sq.1 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
Assertion
Ref Expression
4sqlem2 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
Distinct variable groups:   𝑎,𝑏,𝑐,𝑑,𝑛,𝑤,𝑥,𝑦,𝑧   𝐴,𝑎,𝑏,𝑐,𝑑,𝑛   𝑆,𝑎,𝑏,𝑐,𝑑,𝑛
Allowed substitution hints:   𝐴(𝑥,𝑦,𝑧,𝑤)   𝑆(𝑥,𝑦,𝑧,𝑤)

Proof of Theorem 4sqlem2
StepHypRef Expression
1 4sq.1 . . 3 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
21eleq2i 2830 . 2 (𝐴𝑆𝐴 ∈ {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))})
3 id 22 . . . . . . 7 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
4 ovex 7308 . . . . . . 7 (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ∈ V
53, 4eqeltrdi 2847 . . . . . 6 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V)
65a1i 11 . . . . 5 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V))
76rexlimdvva 3223 . . . 4 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V))
87rexlimivv 3221 . . 3 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V)
9 oveq1 7282 . . . . . . . . 9 (𝑥 = 𝑎 → (𝑥↑2) = (𝑎↑2))
109oveq1d 7290 . . . . . . . 8 (𝑥 = 𝑎 → ((𝑥↑2) + (𝑦↑2)) = ((𝑎↑2) + (𝑦↑2)))
1110oveq1d 7290 . . . . . . 7 (𝑥 = 𝑎 → (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))))
1211eqeq2d 2749 . . . . . 6 (𝑥 = 𝑎 → (𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
13122rexbidv 3229 . . . . 5 (𝑥 = 𝑎 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
14 oveq1 7282 . . . . . . . . 9 (𝑦 = 𝑏 → (𝑦↑2) = (𝑏↑2))
1514oveq2d 7291 . . . . . . . 8 (𝑦 = 𝑏 → ((𝑎↑2) + (𝑦↑2)) = ((𝑎↑2) + (𝑏↑2)))
1615oveq1d 7290 . . . . . . 7 (𝑦 = 𝑏 → (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))))
1716eqeq2d 2749 . . . . . 6 (𝑦 = 𝑏 → (𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2)))))
18172rexbidv 3229 . . . . 5 (𝑦 = 𝑏 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2)))))
1913, 18cbvrex2vw 3397 . . . 4 (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))))
20 oveq1 7282 . . . . . . . . . 10 (𝑧 = 𝑐 → (𝑧↑2) = (𝑐↑2))
2120oveq1d 7290 . . . . . . . . 9 (𝑧 = 𝑐 → ((𝑧↑2) + (𝑤↑2)) = ((𝑐↑2) + (𝑤↑2)))
2221oveq2d 7291 . . . . . . . 8 (𝑧 = 𝑐 → (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))))
2322eqeq2d 2749 . . . . . . 7 (𝑧 = 𝑐 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2)))))
24 oveq1 7282 . . . . . . . . . 10 (𝑤 = 𝑑 → (𝑤↑2) = (𝑑↑2))
2524oveq2d 7291 . . . . . . . . 9 (𝑤 = 𝑑 → ((𝑐↑2) + (𝑤↑2)) = ((𝑐↑2) + (𝑑↑2)))
2625oveq2d 7291 . . . . . . . 8 (𝑤 = 𝑑 → (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
2726eqeq2d 2749 . . . . . . 7 (𝑤 = 𝑑 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
2823, 27cbvrex2vw 3397 . . . . . 6 (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
29 eqeq1 2742 . . . . . . 7 (𝑛 = 𝐴 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ↔ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
30292rexbidv 3229 . . . . . 6 (𝑛 = 𝐴 → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
3128, 30bitrid 282 . . . . 5 (𝑛 = 𝐴 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
32312rexbidv 3229 . . . 4 (𝑛 = 𝐴 → (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
3319, 32bitrid 282 . . 3 (𝑛 = 𝐴 → (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
348, 33elab3 3617 . 2 (𝐴 ∈ {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))} ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
352, 34bitri 274 1 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 205  wa 396   = wceq 1539  wcel 2106  {cab 2715  wrex 3065  Vcvv 3432  (class class class)co 7275   + caddc 10874  2c2 12028  cz 12319  cexp 13782
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2709  ax-nul 5230
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 845  df-3an 1088  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2068  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2816  df-ral 3069  df-rex 3070  df-rab 3073  df-v 3434  df-dif 3890  df-un 3892  df-in 3894  df-ss 3904  df-nul 4257  df-if 4460  df-sn 4562  df-pr 4564  df-op 4568  df-uni 4840  df-br 5075  df-iota 6391  df-fv 6441  df-ov 7278
This theorem is referenced by:  4sqlem3  16651  4sqlem4  16653  4sqlem18  16663  4sq  16665
  Copyright terms: Public domain W3C validator