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

Theorem 4sqlem2 16277
 Description: Lemma for 4sq 16292. 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 2881 . 2 (𝐴𝑆𝐴 ∈ {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))})
3 id 22 . . . . . . 7 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
4 ovex 7168 . . . . . . 7 (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ∈ V
53, 4eqeltrdi 2898 . . . . . 6 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V)
65a1i 11 . . . . 5 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V))
76rexlimdvva 3253 . . . 4 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V))
87rexlimivv 3251 . . 3 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V)
9 oveq1 7142 . . . . . . . . 9 (𝑥 = 𝑎 → (𝑥↑2) = (𝑎↑2))
109oveq1d 7150 . . . . . . . 8 (𝑥 = 𝑎 → ((𝑥↑2) + (𝑦↑2)) = ((𝑎↑2) + (𝑦↑2)))
1110oveq1d 7150 . . . . . . 7 (𝑥 = 𝑎 → (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))))
1211eqeq2d 2809 . . . . . 6 (𝑥 = 𝑎 → (𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
13122rexbidv 3259 . . . . 5 (𝑥 = 𝑎 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
14 oveq1 7142 . . . . . . . . 9 (𝑦 = 𝑏 → (𝑦↑2) = (𝑏↑2))
1514oveq2d 7151 . . . . . . . 8 (𝑦 = 𝑏 → ((𝑎↑2) + (𝑦↑2)) = ((𝑎↑2) + (𝑏↑2)))
1615oveq1d 7150 . . . . . . 7 (𝑦 = 𝑏 → (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))))
1716eqeq2d 2809 . . . . . 6 (𝑦 = 𝑏 → (𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2)))))
18172rexbidv 3259 . . . . 5 (𝑦 = 𝑏 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2)))))
1913, 18cbvrex2vw 3409 . . . 4 (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))))
20 oveq1 7142 . . . . . . . . . 10 (𝑧 = 𝑐 → (𝑧↑2) = (𝑐↑2))
2120oveq1d 7150 . . . . . . . . 9 (𝑧 = 𝑐 → ((𝑧↑2) + (𝑤↑2)) = ((𝑐↑2) + (𝑤↑2)))
2221oveq2d 7151 . . . . . . . 8 (𝑧 = 𝑐 → (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))))
2322eqeq2d 2809 . . . . . . 7 (𝑧 = 𝑐 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2)))))
24 oveq1 7142 . . . . . . . . . 10 (𝑤 = 𝑑 → (𝑤↑2) = (𝑑↑2))
2524oveq2d 7151 . . . . . . . . 9 (𝑤 = 𝑑 → ((𝑐↑2) + (𝑤↑2)) = ((𝑐↑2) + (𝑑↑2)))
2625oveq2d 7151 . . . . . . . 8 (𝑤 = 𝑑 → (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
2726eqeq2d 2809 . . . . . . 7 (𝑤 = 𝑑 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
2823, 27cbvrex2vw 3409 . . . . . 6 (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
29 eqeq1 2802 . . . . . . 7 (𝑛 = 𝐴 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ↔ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
30292rexbidv 3259 . . . . . 6 (𝑛 = 𝐴 → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
3128, 30syl5bb 286 . . . . 5 (𝑛 = 𝐴 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
32312rexbidv 3259 . . . 4 (𝑛 = 𝐴 → (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
3319, 32syl5bb 286 . . 3 (𝑛 = 𝐴 → (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
348, 33elab3 3622 . 2 (𝐴 ∈ {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))} ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
352, 34bitri 278 1 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ↔ wb 209   ∧ wa 399   = wceq 1538   ∈ wcel 2111  {cab 2776  ∃wrex 3107  Vcvv 3441  (class class class)co 7135   + caddc 10531  2c2 11682  ℤcz 11971  ↑cexp 13427 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-nul 5174 This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  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-ral 3111  df-rex 3112  df-v 3443  df-sbc 3721  df-dif 3884  df-un 3886  df-in 3888  df-ss 3898  df-nul 4244  df-sn 4526  df-pr 4528  df-op 4532  df-uni 4801  df-br 5031  df-iota 6283  df-fv 6332  df-ov 7138 This theorem is referenced by:  4sqlem3  16278  4sqlem4  16280  4sqlem18  16290  4sq  16292
 Copyright terms: Public domain W3C validator