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

Theorem mul4sq 14117
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 14116. (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 14115 . 2  |-  ( A  e.  S  <->  E. a  e.  ZZ[_i]  E. b  e.  ZZ[_i]  A  =  ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b
) ^ 2 ) ) )
314sqlem4 14115 . 2  |-  ( B  e.  S  <->  E. c  e.  ZZ[_i]  E. d  e.  ZZ[_i]  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )
4 reeanv 2984 . . 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 2984 . . . . 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 14104 . . . . . . . . . . . . 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 14104 . . . . . . . . . . . . 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 10741 . . . . . . . . . . 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 10739 . . . . . . . . . 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 10200 . . . . . . . . 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 14104 . . . . . . . . . . . . 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 14104 . . . . . . . . . . . . 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 10741 . . . . . . . . . . 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 10739 . . . . . . . . . 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 10200 . . . . . . . . 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 6208 . . . . . . . 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 2451 . . . . . . . . 9  |-  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )
26 eqid 2451 . . . . . . . . 9  |-  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  =  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )
27 1nn 10434 . . . . . . . . . 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 14103 . . . . . . . . . . . . 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 14095 . . . . . . . . . . . 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 10200 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( a  -  c
)  /  1 )  =  ( a  -  c ) )
3433, 30eqeltrd 2539 . . . . . . . . 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 14103 . . . . . . . . . . . . 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 14095 . . . . . . . . . . . 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 10200 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( b  -  d
)  /  1 )  =  ( b  -  d ) )
4039, 36eqeltrd 2539 . . . . . . . . 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 2539 . . . . . . . . 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 14116 . . . . . . . 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 2540 . . . . . . 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 6199 . . . . . . . 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 2520 . . . . . . 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 2944 . . . . 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 2942 . . 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 1370    e. wcel 1758   {cab 2436   E.wrex 2796   ` cfv 5516  (class class class)co 6190   CCcc 9381   1c1 9384    + caddc 9386    x. cmul 9388    - cmin 9696    / cdiv 10094   NNcn 10423   2c2 10472   NN0cn0 10680   ZZcz 10747   ^cexp 11966   abscabs 12825   ZZ[_i]cgz 14092
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1710  ax-7 1730  ax-8 1760  ax-9 1762  ax-10 1777  ax-11 1782  ax-12 1794  ax-13 1952  ax-ext 2430  ax-sep 4511  ax-nul 4519  ax-pow 4568  ax-pr 4629  ax-un 6472  ax-cnex 9439  ax-resscn 9440  ax-1cn 9441  ax-icn 9442  ax-addcl 9443  ax-addrcl 9444  ax-mulcl 9445  ax-mulrcl 9446  ax-mulcom 9447  ax-addass 9448  ax-mulass 9449  ax-distr 9450  ax-i2m1 9451  ax-1ne0 9452  ax-1rid 9453  ax-rnegex 9454  ax-rrecex 9455  ax-cnre 9456  ax-pre-lttri 9457  ax-pre-lttrn 9458  ax-pre-ltadd 9459  ax-pre-mulgt0 9460  ax-pre-sup 9461
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1703  df-eu 2264  df-mo 2265  df-clab 2437  df-cleq 2443  df-clel 2446  df-nfc 2601  df-ne 2646  df-nel 2647  df-ral 2800  df-rex 2801  df-reu 2802  df-rmo 2803  df-rab 2804  df-v 3070  df-sbc 3285  df-csb 3387  df-dif 3429  df-un 3431  df-in 3433  df-ss 3440  df-pss 3442  df-nul 3736  df-if 3890  df-pw 3960  df-sn 3976  df-pr 3978  df-tp 3980  df-op 3982  df-uni 4190  df-iun 4271  df-br 4391  df-opab 4449  df-mpt 4450  df-tr 4484  df-eprel 4730  df-id 4734  df-po 4739  df-so 4740  df-fr 4777  df-we 4779  df-ord 4820  df-on 4821  df-lim 4822  df-suc 4823  df-xp 4944  df-rel 4945  df-cnv 4946  df-co 4947  df-dm 4948  df-rn 4949  df-res 4950  df-ima 4951  df-iota 5479  df-fun 5518  df-fn 5519  df-f 5520  df-f1 5521  df-fo 5522  df-f1o 5523  df-fv 5524  df-riota 6151  df-ov 6193  df-oprab 6194  df-mpt2 6195  df-om 6577  df-2nd 6678  df-recs 6932  df-rdg 6966  df-er 7201  df-en 7411  df-dom 7412  df-sdom 7413  df-sup 7792  df-pnf 9521  df-mnf 9522  df-xr 9523  df-ltxr 9524  df-le 9525  df-sub 9698  df-neg 9699  df-div 10095  df-nn 10424  df-2 10481  df-3 10482  df-n0 10681  df-z 10748  df-uz 10963  df-rp 11093  df-seq 11908  df-exp 11967  df-cj 12690  df-re 12691  df-im 12692  df-sqr 12826  df-abs 12827  df-gz 14093
This theorem is referenced by:  4sqlem19  14126
  Copyright terms: Public domain W3C validator