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

Theorem 4sqlem2 15491
 Description: Lemma for 4sq 15506. 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 2680 . 2 (𝐴𝑆𝐴 ∈ {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))})
3 id 22 . . . . . . 7 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
4 ovex 6577 . . . . . . 7 (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ∈ V
53, 4syl6eqel 2696 . . . . . 6 (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V)
65a1i 11 . . . . 5 (((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) ∧ (𝑐 ∈ ℤ ∧ 𝑑 ∈ ℤ)) → (𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V))
76rexlimdvva 3020 . . . 4 ((𝑎 ∈ ℤ ∧ 𝑏 ∈ ℤ) → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V))
87rexlimivv 3018 . . 3 (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) → 𝐴 ∈ V)
9 oveq1 6556 . . . . . . . . 9 (𝑥 = 𝑎 → (𝑥↑2) = (𝑎↑2))
109oveq1d 6564 . . . . . . . 8 (𝑥 = 𝑎 → ((𝑥↑2) + (𝑦↑2)) = ((𝑎↑2) + (𝑦↑2)))
1110oveq1d 6564 . . . . . . 7 (𝑥 = 𝑎 → (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))))
1211eqeq2d 2620 . . . . . 6 (𝑥 = 𝑎 → (𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
13122rexbidv 3039 . . . . 5 (𝑥 = 𝑎 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
14 oveq1 6556 . . . . . . . . 9 (𝑦 = 𝑏 → (𝑦↑2) = (𝑏↑2))
1514oveq2d 6565 . . . . . . . 8 (𝑦 = 𝑏 → ((𝑎↑2) + (𝑦↑2)) = ((𝑎↑2) + (𝑏↑2)))
1615oveq1d 6564 . . . . . . 7 (𝑦 = 𝑏 → (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))))
1716eqeq2d 2620 . . . . . 6 (𝑦 = 𝑏 → (𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2)))))
18172rexbidv 3039 . . . . 5 (𝑦 = 𝑏 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2)))))
1913, 18cbvrex2v 3156 . . . 4 (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))))
20 oveq1 6556 . . . . . . . . . 10 (𝑧 = 𝑐 → (𝑧↑2) = (𝑐↑2))
2120oveq1d 6564 . . . . . . . . 9 (𝑧 = 𝑐 → ((𝑧↑2) + (𝑤↑2)) = ((𝑐↑2) + (𝑤↑2)))
2221oveq2d 6565 . . . . . . . 8 (𝑧 = 𝑐 → (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))))
2322eqeq2d 2620 . . . . . . 7 (𝑧 = 𝑐 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2)))))
24 oveq1 6556 . . . . . . . . . 10 (𝑤 = 𝑑 → (𝑤↑2) = (𝑑↑2))
2524oveq2d 6565 . . . . . . . . 9 (𝑤 = 𝑑 → ((𝑐↑2) + (𝑤↑2)) = ((𝑐↑2) + (𝑑↑2)))
2625oveq2d 6565 . . . . . . . 8 (𝑤 = 𝑑 → (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))) = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
2726eqeq2d 2620 . . . . . . 7 (𝑤 = 𝑑 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
2823, 27cbvrex2v 3156 . . . . . 6 (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
29 eqeq1 2614 . . . . . . 7 (𝑛 = 𝐴 → (𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ↔ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
30292rexbidv 3039 . . . . . 6 (𝑛 = 𝐴 → (∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
3128, 30syl5bb 271 . . . . 5 (𝑛 = 𝐴 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
32312rexbidv 3039 . . . 4 (𝑛 = 𝐴 → (∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑎↑2) + (𝑏↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
3319, 32syl5bb 271 . . 3 (𝑛 = 𝐴 → (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2)))))
348, 33elab3 3327 . 2 (𝐴 ∈ {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))} ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
352, 34bitri 263 1 (𝐴𝑆 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ↔ wb 195   ∧ wa 383   = wceq 1475   ∈ wcel 1977  {cab 2596  ∃wrex 2897  Vcvv 3173  (class class class)co 6549   + caddc 9818  2c2 10947  ℤcz 11254  ↑cexp 12722 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1713  ax-4 1728  ax-5 1827  ax-6 1875  ax-7 1922  ax-10 2006  ax-11 2021  ax-12 2034  ax-13 2234  ax-ext 2590  ax-nul 4717 This theorem depends on definitions:  df-bi 196  df-or 384  df-an 385  df-3an 1033  df-tru 1478  df-ex 1696  df-nf 1701  df-sb 1868  df-eu 2462  df-clab 2597  df-cleq 2603  df-clel 2606  df-nfc 2740  df-ral 2901  df-rex 2902  df-rab 2905  df-v 3175  df-sbc 3403  df-dif 3543  df-un 3545  df-in 3547  df-ss 3554  df-nul 3875  df-if 4037  df-sn 4126  df-pr 4128  df-op 4132  df-uni 4373  df-br 4584  df-iota 5768  df-fv 5812  df-ov 6552 This theorem is referenced by:  4sqlem3  15492  4sqlem4  15494  4sqlem18  15504  4sq  15506
 Copyright terms: Public domain W3C validator