MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  mul4sq Structured version   Unicode version

Theorem mul4sq 14007
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 14006. (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.)
Hypothesis
Ref Expression
4sq.1  |-  S  =  { n  |  E. x  e.  ZZ  E. y  e.  ZZ  E. z  e.  ZZ  E. w  e.  ZZ  n  =  ( ( ( x ^
2 )  +  ( y ^ 2 ) )  +  ( ( z ^ 2 )  +  ( w ^
2 ) ) ) }
Assertion
Ref Expression
mul4sq  |-  ( ( A  e.  S  /\  B  e.  S )  ->  ( A  x.  B
)  e.  S )
Distinct variable groups:    w, n, x, y, z    B, n    A, n    S, n
Allowed substitution hints:    A( x, y, z, w)    B( x, y, z, w)    S( x, y, z, w)

Proof of Theorem mul4sq
Dummy variables  a 
b  c  d are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 4sq.1 . . 3  |-  S  =  { n  |  E. x  e.  ZZ  E. y  e.  ZZ  E. z  e.  ZZ  E. w  e.  ZZ  n  =  ( ( ( x ^
2 )  +  ( y ^ 2 ) )  +  ( ( z ^ 2 )  +  ( w ^
2 ) ) ) }
214sqlem4 14005 . 2  |-  ( A  e.  S  <->  E. a  e.  ZZ[_i]  E. b  e.  ZZ[_i]  A  =  ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b
) ^ 2 ) ) )
314sqlem4 14005 . 2  |-  ( B  e.  S  <->  E. c  e.  ZZ[_i]  E. d  e.  ZZ[_i]  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )
4 reeanv 2883 . . 3  |-  ( E. a  e.  ZZ[_i]  E. c  e.  ZZ[_i] 
( E. b  e.  ZZ[_i]  A  =  ( (
( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  E. d  e.  ZZ[_i]  B  =  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) )  <->  ( E. a  e.  ZZ[_i]  E. b  e.  ZZ[_i]  A  =  ( (
( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  E. c  e.  ZZ[_i]  E. d  e.  ZZ[_i]  B  =  ( (
( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) ) )
5 reeanv 2883 . . . . 5  |-  ( E. b  e.  ZZ[_i]  E. d  e.  ZZ[_i] 
( A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )  <->  ( E. b  e.  ZZ[_i]  A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  E. d  e.  ZZ[_i]  B  =  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) ) )
6 simpll 753 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  a  e.  ZZ[_i]
)
7 gzabssqcl 13994 . . . . . . . . . . . . 13  |-  ( a  e.  ZZ[_i]  ->  ( ( abs `  a ) ^
2 )  e.  NN0 )
86, 7syl 16 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  a
) ^ 2 )  e.  NN0 )
9 simprl 755 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  b  e.  ZZ[_i]
)
10 gzabssqcl 13994 . . . . . . . . . . . . 13  |-  ( b  e.  ZZ[_i]  ->  ( ( abs `  b ) ^
2 )  e.  NN0 )
119, 10syl 16 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  b
) ^ 2 )  e.  NN0 )
128, 11nn0addcld 10632 . . . . . . . . . . 11  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  e.  NN0 )
1312nn0cnd 10630 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  e.  CC )
1413div1d 10091 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /  1 )  =  ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) ) )
15 simplr 754 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  c  e.  ZZ[_i]
)
16 gzabssqcl 13994 . . . . . . . . . . . . 13  |-  ( c  e.  ZZ[_i]  ->  ( ( abs `  c ) ^
2 )  e.  NN0 )
1715, 16syl 16 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  c
) ^ 2 )  e.  NN0 )
18 simprr 756 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  d  e.  ZZ[_i]
)
19 gzabssqcl 13994 . . . . . . . . . . . . 13  |-  ( d  e.  ZZ[_i]  ->  ( ( abs `  d ) ^
2 )  e.  NN0 )
2018, 19syl 16 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  d
) ^ 2 )  e.  NN0 )
2117, 20nn0addcld 10632 . . . . . . . . . . 11  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  e.  NN0 )
2221nn0cnd 10630 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  e.  CC )
2322div1d 10091 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  /  1 )  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) )
2414, 23oveq12d 6104 . . . . . . . 8  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b
) ^ 2 ) )  /  1 )  x.  ( ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  /  1
) )  =  ( ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  x.  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) ) )
25 eqid 2438 . . . . . . . . 9  |-  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )
26 eqid 2438 . . . . . . . . 9  |-  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  =  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )
27 1nn 10325 . . . . . . . . . 10  |-  1  e.  NN
2827a1i 11 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  1  e.  NN )
29 gzsubcl 13993 . . . . . . . . . . . . 13  |-  ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i]
)  ->  ( a  -  c )  e.  ZZ[_i]
)
3029adantr 465 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
a  -  c )  e.  ZZ[_i] )
31 gzcn 13985 . . . . . . . . . . . 12  |-  ( ( a  -  c )  e.  ZZ[_i]  ->  ( a  -  c )  e.  CC )
3230, 31syl 16 . . . . . . . . . . 11  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
a  -  c )  e.  CC )
3332div1d 10091 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( a  -  c
)  /  1 )  =  ( a  -  c ) )
3433, 30eqeltrd 2512 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( a  -  c
)  /  1 )  e.  ZZ[_i] )
35 gzsubcl 13993 . . . . . . . . . . . . 13  |-  ( ( b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
)  ->  ( b  -  d )  e.  ZZ[_i]
)
3635adantl 466 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
b  -  d )  e.  ZZ[_i] )
37 gzcn 13985 . . . . . . . . . . . 12  |-  ( ( b  -  d )  e.  ZZ[_i]  ->  ( b  -  d )  e.  CC )
3836, 37syl 16 . . . . . . . . . . 11  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
b  -  d )  e.  CC )
3938div1d 10091 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( b  -  d
)  /  1 )  =  ( b  -  d ) )
4039, 36eqeltrd 2512 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( b  -  d
)  /  1 )  e.  ZZ[_i] )
4114, 12eqeltrd 2512 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /  1 )  e. 
NN0 )
421, 6, 9, 15, 18, 25, 26, 28, 34, 40, 41mul4sqlem 14006 . . . . . . . 8  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b
) ^ 2 ) )  /  1 )  x.  ( ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  /  1
) )  e.  S
)
4324, 42eqeltrrd 2513 . . . . . . 7  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  x.  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )  e.  S
)
44 oveq12 6095 . . . . . . . 8  |-  ( ( A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )  ->  ( A  x.  B )  =  ( ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  x.  (
( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) ) )
4544eleq1d 2504 . . . . . . 7  |-  ( ( A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )  ->  (
( A  x.  B
)  e.  S  <->  ( (
( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  x.  (
( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) )  e.  S ) )
4643, 45syl5ibrcom 222 . . . . . 6  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )  ->  ( A  x.  B )  e.  S ) )
4746rexlimdvva 2843 . . . . 5  |-  ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i]
)  ->  ( E. b  e.  ZZ[_i]  E. d  e.  ZZ[_i] 
( A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )  ->  ( A  x.  B )  e.  S ) )
485, 47syl5bir 218 . . . 4  |-  ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i]
)  ->  ( ( E. b  e.  ZZ[_i]  A  =  ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b
) ^ 2 ) )  /\  E. d  e.  ZZ[_i]  B  =  ( (
( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) )  -> 
( A  x.  B
)  e.  S ) )
4948rexlimivv 2841 . . 3  |-  ( E. a  e.  ZZ[_i]  E. c  e.  ZZ[_i] 
( E. b  e.  ZZ[_i]  A  =  ( (
( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  E. d  e.  ZZ[_i]  B  =  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) )  -> 
( A  x.  B
)  e.  S )
504, 49sylbir 213 . 2  |-  ( ( E. a  e.  ZZ[_i]  E. b  e.  ZZ[_i]  A  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  /\  E. c  e.  ZZ[_i]  E. d  e.  ZZ[_i]  B  =  ( (
( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) ) )  -> 
( A  x.  B
)  e.  S )
512, 3, 50syl2anb 479 1  |-  ( ( A  e.  S  /\  B  e.  S )  ->  ( A  x.  B
)  e.  S )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1369    e. wcel 1756   {cab 2424   E.wrex 2711   ` cfv 5413  (class class class)co 6086   CCcc 9272   1c1 9275    + caddc 9277    x. cmul 9279    - cmin 9587    / cdiv 9985   NNcn 10314   2c2 10363   NN0cn0 10571   ZZcz 10638   ^cexp 11857   abscabs 12715   ZZ[_i]cgz 13982
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2419  ax-sep 4408  ax-nul 4416  ax-pow 4465  ax-pr 4526  ax-un 6367  ax-cnex 9330  ax-resscn 9331  ax-1cn 9332  ax-icn 9333  ax-addcl 9334  ax-addrcl 9335  ax-mulcl 9336  ax-mulrcl 9337  ax-mulcom 9338  ax-addass 9339  ax-mulass 9340  ax-distr 9341  ax-i2m1 9342  ax-1ne0 9343  ax-1rid 9344  ax-rnegex 9345  ax-rrecex 9346  ax-cnre 9347  ax-pre-lttri 9348  ax-pre-lttrn 9349  ax-pre-ltadd 9350  ax-pre-mulgt0 9351  ax-pre-sup 9352
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2256  df-mo 2257  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2715  df-rex 2716  df-reu 2717  df-rmo 2718  df-rab 2719  df-v 2969  df-sbc 3182  df-csb 3284  df-dif 3326  df-un 3328  df-in 3330  df-ss 3337  df-pss 3339  df-nul 3633  df-if 3787  df-pw 3857  df-sn 3873  df-pr 3875  df-tp 3877  df-op 3879  df-uni 4087  df-iun 4168  df-br 4288  df-opab 4346  df-mpt 4347  df-tr 4381  df-eprel 4627  df-id 4631  df-po 4636  df-so 4637  df-fr 4674  df-we 4676  df-ord 4717  df-on 4718  df-lim 4719  df-suc 4720  df-xp 4841  df-rel 4842  df-cnv 4843  df-co 4844  df-dm 4845  df-rn 4846  df-res 4847  df-ima 4848  df-iota 5376  df-fun 5415  df-fn 5416  df-f 5417  df-f1 5418  df-fo 5419  df-f1o 5420  df-fv 5421  df-riota 6047  df-ov 6089  df-oprab 6090  df-mpt2 6091  df-om 6472  df-2nd 6573  df-recs 6824  df-rdg 6858  df-er 7093  df-en 7303  df-dom 7304  df-sdom 7305  df-sup 7683  df-pnf 9412  df-mnf 9413  df-xr 9414  df-ltxr 9415  df-le 9416  df-sub 9589  df-neg 9590  df-div 9986  df-nn 10315  df-2 10372  df-3 10373  df-n0 10572  df-z 10639  df-uz 10854  df-rp 10984  df-seq 11799  df-exp 11858  df-cj 12580  df-re 12581  df-im 12582  df-sqr 12716  df-abs 12717  df-gz 13983
This theorem is referenced by:  4sqlem19  14016
  Copyright terms: Public domain W3C validator