Metamath Proof Explorer


Theorem 4sqlem1

Description: Lemma for 4sq . The set S is the set of all numbers that are expressible as a sum of four squares. Our goal is to show that S = NN0 ; here we show one subset direction. (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 4sqlem1 S 0

Proof

Step Hyp Ref Expression
1 4sq.1 S = n | x y z w n = x 2 + y 2 + z 2 + w 2
2 zsqcl2 x x 2 0
3 zsqcl2 y y 2 0
4 nn0addcl x 2 0 y 2 0 x 2 + y 2 0
5 2 3 4 syl2an x y x 2 + y 2 0
6 zsqcl2 z z 2 0
7 zsqcl2 w w 2 0
8 nn0addcl z 2 0 w 2 0 z 2 + w 2 0
9 6 7 8 syl2an z w z 2 + w 2 0
10 nn0addcl x 2 + y 2 0 z 2 + w 2 0 x 2 + y 2 + z 2 + w 2 0
11 5 9 10 syl2an x y z w x 2 + y 2 + z 2 + w 2 0
12 eleq1a x 2 + y 2 + z 2 + w 2 0 n = x 2 + y 2 + z 2 + w 2 n 0
13 11 12 syl x y z w n = x 2 + y 2 + z 2 + w 2 n 0
14 13 rexlimdvva x y z w n = x 2 + y 2 + z 2 + w 2 n 0
15 14 rexlimivv x y z w n = x 2 + y 2 + z 2 + w 2 n 0
16 15 abssi n | x y z w n = x 2 + y 2 + z 2 + w 2 0
17 1 16 eqsstri S 0