Metamath Proof Explorer


Theorem mul4sq

Description: Euler's four-square identity: The product of two sums of four squares is also a sum of four squares. This is usually quoted as an explicit formula involving eight real variables; we save some time by working with complex numbers (gaussian integers) instead, so that we only have to work with four variables, and also hiding the actual formula for the product in the proof of mul4sqlem . (For the curious, the explicit formula that is used is ( | a | ^ 2 + | b | ^ 2 ) ( | c | ^ 2 + | d | ^ 2 ) = | a * x. c + b x. d * | ^ 2 + | a * x. d - b x. c * | ^ 2 .) (Contributed by Mario Carneiro, 14-Jul-2014)

Ref Expression
Hypothesis 4sq.1 S=n|xyzwn=x2+y2+z2+w2
Assertion mul4sq ASBSABS

Proof

Step Hyp Ref Expression
1 4sq.1 S=n|xyzwn=x2+y2+z2+w2
2 1 4sqlem4 ASaibiA=a2+b2
3 1 4sqlem4 BScidiB=c2+d2
4 reeanv aicibiA=a2+b2diB=c2+d2aibiA=a2+b2cidiB=c2+d2
5 reeanv bidiA=a2+b2B=c2+d2biA=a2+b2diB=c2+d2
6 simpll aicibidiai
7 gzabssqcl aia20
8 6 7 syl aicibidia20
9 simprl aicibidibi
10 gzabssqcl bib20
11 9 10 syl aicibidib20
12 8 11 nn0addcld aicibidia2+b20
13 12 nn0cnd aicibidia2+b2
14 13 div1d aicibidia2+b21=a2+b2
15 simplr aicibidici
16 gzabssqcl cic20
17 15 16 syl aicibidic20
18 simprr aicibididi
19 gzabssqcl did20
20 18 19 syl aicibidid20
21 17 20 nn0addcld aicibidic2+d20
22 21 nn0cnd aicibidic2+d2
23 22 div1d aicibidic2+d21=c2+d2
24 14 23 oveq12d aicibidia2+b21c2+d21=a2+b2c2+d2
25 eqid a2+b2=a2+b2
26 eqid c2+d2=c2+d2
27 1nn 1
28 27 a1i aicibidi1
29 gzsubcl aiciaci
30 29 adantr aicibidiaci
31 gzcn aciac
32 30 31 syl aicibidiac
33 32 div1d aicibidiac1=ac
34 33 30 eqeltrd aicibidiac1i
35 gzsubcl bidibdi
36 35 adantl aicibidibdi
37 gzcn bdibd
38 36 37 syl aicibidibd
39 38 div1d aicibidibd1=bd
40 39 36 eqeltrd aicibidibd1i
41 14 12 eqeltrd aicibidia2+b210
42 1 6 9 15 18 25 26 28 34 40 41 mul4sqlem aicibidia2+b21c2+d21S
43 24 42 eqeltrrd aicibidia2+b2c2+d2S
44 oveq12 A=a2+b2B=c2+d2AB=a2+b2c2+d2
45 44 eleq1d A=a2+b2B=c2+d2ABSa2+b2c2+d2S
46 43 45 syl5ibrcom aicibidiA=a2+b2B=c2+d2ABS
47 46 rexlimdvva aicibidiA=a2+b2B=c2+d2ABS
48 5 47 biimtrrid aicibiA=a2+b2diB=c2+d2ABS
49 48 rexlimivv aicibiA=a2+b2diB=c2+d2ABS
50 4 49 sylbir aibiA=a2+b2cidiB=c2+d2ABS
51 2 3 50 syl2anb ASBSABS