Metamath Proof Explorer


Theorem 4sqlem2

Description: Lemma for 4sq . Change bound variables in S . (Contributed by Mario Carneiro, 14-Jul-2014)

Ref Expression
Hypothesis 4sq.1 S = n | x y z w n = x 2 + y 2 + z 2 + w 2
Assertion 4sqlem2 A S a b c d A = a 2 + b 2 + c 2 + d 2

Proof

Step Hyp Ref Expression
1 4sq.1 S = n | x y z w n = x 2 + y 2 + z 2 + w 2
2 1 eleq2i A S A n | x y z w n = x 2 + y 2 + z 2 + w 2
3 id A = a 2 + b 2 + c 2 + d 2 A = a 2 + b 2 + c 2 + d 2
4 ovex a 2 + b 2 + c 2 + d 2 V
5 3 4 eqeltrdi A = a 2 + b 2 + c 2 + d 2 A V
6 5 a1i a b c d A = a 2 + b 2 + c 2 + d 2 A V
7 6 rexlimdvva a b c d A = a 2 + b 2 + c 2 + d 2 A V
8 7 rexlimivv a b c d A = a 2 + b 2 + c 2 + d 2 A V
9 oveq1 x = a x 2 = a 2
10 9 oveq1d x = a x 2 + y 2 = a 2 + y 2
11 10 oveq1d x = a x 2 + y 2 + z 2 + w 2 = a 2 + y 2 + z 2 + w 2
12 11 eqeq2d x = a n = x 2 + y 2 + z 2 + w 2 n = a 2 + y 2 + z 2 + w 2
13 12 2rexbidv x = a z w n = x 2 + y 2 + z 2 + w 2 z w n = a 2 + y 2 + z 2 + w 2
14 oveq1 y = b y 2 = b 2
15 14 oveq2d y = b a 2 + y 2 = a 2 + b 2
16 15 oveq1d y = b a 2 + y 2 + z 2 + w 2 = a 2 + b 2 + z 2 + w 2
17 16 eqeq2d y = b n = a 2 + y 2 + z 2 + w 2 n = a 2 + b 2 + z 2 + w 2
18 17 2rexbidv y = b z w n = a 2 + y 2 + z 2 + w 2 z w n = a 2 + b 2 + z 2 + w 2
19 13 18 cbvrex2vw x y z w n = x 2 + y 2 + z 2 + w 2 a b z w n = a 2 + b 2 + z 2 + w 2
20 oveq1 z = c z 2 = c 2
21 20 oveq1d z = c z 2 + w 2 = c 2 + w 2
22 21 oveq2d z = c a 2 + b 2 + z 2 + w 2 = a 2 + b 2 + c 2 + w 2
23 22 eqeq2d z = c n = a 2 + b 2 + z 2 + w 2 n = a 2 + b 2 + c 2 + w 2
24 oveq1 w = d w 2 = d 2
25 24 oveq2d w = d c 2 + w 2 = c 2 + d 2
26 25 oveq2d w = d a 2 + b 2 + c 2 + w 2 = a 2 + b 2 + c 2 + d 2
27 26 eqeq2d w = d n = a 2 + b 2 + c 2 + w 2 n = a 2 + b 2 + c 2 + d 2
28 23 27 cbvrex2vw z w n = a 2 + b 2 + z 2 + w 2 c d n = a 2 + b 2 + c 2 + d 2
29 eqeq1 n = A n = a 2 + b 2 + c 2 + d 2 A = a 2 + b 2 + c 2 + d 2
30 29 2rexbidv n = A c d n = a 2 + b 2 + c 2 + d 2 c d A = a 2 + b 2 + c 2 + d 2
31 28 30 syl5bb n = A z w n = a 2 + b 2 + z 2 + w 2 c d A = a 2 + b 2 + c 2 + d 2
32 31 2rexbidv n = A a b z w n = a 2 + b 2 + z 2 + w 2 a b c d A = a 2 + b 2 + c 2 + d 2
33 19 32 syl5bb n = A x y z w n = x 2 + y 2 + z 2 + w 2 a b c d A = a 2 + b 2 + c 2 + d 2
34 8 33 elab3 A n | x y z w n = x 2 + y 2 + z 2 + w 2 a b c d A = a 2 + b 2 + c 2 + d 2
35 2 34 bitri A S a b c d A = a 2 + b 2 + c 2 + d 2