ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  mul4sq Unicode version

Theorem mul4sq 12409
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 12408. (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 12407 . 2  |-  ( A  e.  S  <->  E. a  e.  ZZ[_i]  E. b  e.  ZZ[_i]  A  =  ( ( ( abs `  a ) ^ 2 )  +  ( ( abs `  b
) ^ 2 ) ) )
314sqlem4 12407 . 2  |-  ( B  e.  S  <->  E. c  e.  ZZ[_i]  E. d  e.  ZZ[_i]  B  =  ( ( ( abs `  c ) ^ 2 )  +  ( ( abs `  d
) ^ 2 ) ) )
4 reeanv 2659 . . 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 2659 . . . . 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 527 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  a  e.  ZZ[_i]
)
7 gzabssqcl 12396 . . . . . . . . . . . . 13  |-  ( a  e.  ZZ[_i]  ->  ( ( abs `  a ) ^
2 )  e.  NN0 )
86, 7syl 14 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  a
) ^ 2 )  e.  NN0 )
9 simprl 529 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  b  e.  ZZ[_i]
)
10 gzabssqcl 12396 . . . . . . . . . . . . 13  |-  ( b  e.  ZZ[_i]  ->  ( ( abs `  b ) ^
2 )  e.  NN0 )
119, 10syl 14 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  b
) ^ 2 )  e.  NN0 )
128, 11nn0addcld 9250 . . . . . . . . . . 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 9248 . . . . . . . . . 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 8754 . . . . . . . . 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 528 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  c  e.  ZZ[_i]
)
16 gzabssqcl 12396 . . . . . . . . . . . . 13  |-  ( c  e.  ZZ[_i]  ->  ( ( abs `  c ) ^
2 )  e.  NN0 )
1715, 16syl 14 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  c
) ^ 2 )  e.  NN0 )
18 simprr 531 . . . . . . . . . . . . 13  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  d  e.  ZZ[_i]
)
19 gzabssqcl 12396 . . . . . . . . . . . . 13  |-  ( d  e.  ZZ[_i]  ->  ( ( abs `  d ) ^
2 )  e.  NN0 )
2018, 19syl 14 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( abs `  d
) ^ 2 )  e.  NN0 )
2117, 20nn0addcld 9250 . . . . . . . . . . 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 9248 . . . . . . . . . 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 8754 . . . . . . . . 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 5908 . . . . . . . 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 2188 . . . . . . . . 9  |-  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )  =  ( ( ( abs `  a
) ^ 2 )  +  ( ( abs `  b ) ^ 2 ) )
26 eqid 2188 . . . . . . . . 9  |-  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )  =  ( ( ( abs `  c
) ^ 2 )  +  ( ( abs `  d ) ^ 2 ) )
27 1nn 8947 . . . . . . . . . 10  |-  1  e.  NN
2827a1i 9 . . . . . . . . 9  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  1  e.  NN )
29 gzsubcl 12395 . . . . . . . . . . . . 13  |-  ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i]
)  ->  ( a  -  c )  e.  ZZ[_i]
)
3029adantr 276 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
a  -  c )  e.  ZZ[_i] )
31 gzcn 12387 . . . . . . . . . . . 12  |-  ( ( a  -  c )  e.  ZZ[_i]  ->  ( a  -  c )  e.  CC )
3230, 31syl 14 . . . . . . . . . . 11  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
a  -  c )  e.  CC )
3332div1d 8754 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( a  -  c
)  /  1 )  =  ( a  -  c ) )
3433, 30eqeltrd 2265 . . . . . . . . 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 12395 . . . . . . . . . . . . 13  |-  ( ( b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
)  ->  ( b  -  d )  e.  ZZ[_i]
)
3635adantl 277 . . . . . . . . . . . 12  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
b  -  d )  e.  ZZ[_i] )
37 gzcn 12387 . . . . . . . . . . . 12  |-  ( ( b  -  d )  e.  ZZ[_i]  ->  ( b  -  d )  e.  CC )
3836, 37syl 14 . . . . . . . . . . 11  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
b  -  d )  e.  CC )
3938div1d 8754 . . . . . . . . . 10  |-  ( ( ( a  e.  ZZ[_i]  /\  c  e.  ZZ[_i] )  /\  (
b  e.  ZZ[_i]  /\  d  e.  ZZ[_i]
) )  ->  (
( b  -  d
)  /  1 )  =  ( b  -  d ) )
4039, 36eqeltrd 2265 . . . . . . . . 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 2265 . . . . . . . . 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 12408 . . . . . . . 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 2266 . . . . . . 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 5899 . . . . . . . 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 2257 . . . . . . 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 157 . . . . . 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 2614 . . . . 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, 47biimtrrid 153 . . . 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 2612 . . 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 135 . 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 291 1  |-  ( ( A  e.  S  /\  B  e.  S )  ->  ( A  x.  B
)  e.  S )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 104    = wceq 1363    e. wcel 2159   {cab 2174   E.wrex 2468   ` cfv 5230  (class class class)co 5890   CCcc 7826   1c1 7829    + caddc 7831    x. cmul 7833    - cmin 8145    / cdiv 8646   NNcn 8936   2c2 8987   NN0cn0 9193   ZZcz 9270   ^cexp 10536   abscabs 11023   ZZ[_i]cgz 12384
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 615  ax-in2 616  ax-io 710  ax-5 1457  ax-7 1458  ax-gen 1459  ax-ie1 1503  ax-ie2 1504  ax-8 1514  ax-10 1515  ax-11 1516  ax-i12 1517  ax-bndl 1519  ax-4 1520  ax-17 1536  ax-i9 1540  ax-ial 1544  ax-i5r 1545  ax-13 2161  ax-14 2162  ax-ext 2170  ax-coll 4132  ax-sep 4135  ax-nul 4143  ax-pow 4188  ax-pr 4223  ax-un 4447  ax-setind 4550  ax-iinf 4601  ax-cnex 7919  ax-resscn 7920  ax-1cn 7921  ax-1re 7922  ax-icn 7923  ax-addcl 7924  ax-addrcl 7925  ax-mulcl 7926  ax-mulrcl 7927  ax-addcom 7928  ax-mulcom 7929  ax-addass 7930  ax-mulass 7931  ax-distr 7932  ax-i2m1 7933  ax-0lt1 7934  ax-1rid 7935  ax-0id 7936  ax-rnegex 7937  ax-precex 7938  ax-cnre 7939  ax-pre-ltirr 7940  ax-pre-ltwlin 7941  ax-pre-lttrn 7942  ax-pre-apti 7943  ax-pre-ltadd 7944  ax-pre-mulgt0 7945  ax-pre-mulext 7946  ax-arch 7947  ax-caucvg 7948
This theorem depends on definitions:  df-bi 117  df-dc 836  df-3or 980  df-3an 981  df-tru 1366  df-fal 1369  df-nf 1471  df-sb 1773  df-eu 2040  df-mo 2041  df-clab 2175  df-cleq 2181  df-clel 2184  df-nfc 2320  df-ne 2360  df-nel 2455  df-ral 2472  df-rex 2473  df-reu 2474  df-rmo 2475  df-rab 2476  df-v 2753  df-sbc 2977  df-csb 3072  df-dif 3145  df-un 3147  df-in 3149  df-ss 3156  df-nul 3437  df-if 3549  df-pw 3591  df-sn 3612  df-pr 3613  df-op 3615  df-uni 3824  df-int 3859  df-iun 3902  df-br 4018  df-opab 4079  df-mpt 4080  df-tr 4116  df-id 4307  df-po 4310  df-iso 4311  df-iord 4380  df-on 4382  df-ilim 4383  df-suc 4385  df-iom 4604  df-xp 4646  df-rel 4647  df-cnv 4648  df-co 4649  df-dm 4650  df-rn 4651  df-res 4652  df-ima 4653  df-iota 5192  df-fun 5232  df-fn 5233  df-f 5234  df-f1 5235  df-fo 5236  df-f1o 5237  df-fv 5238  df-riota 5846  df-ov 5893  df-oprab 5894  df-mpo 5895  df-1st 6158  df-2nd 6159  df-recs 6323  df-frec 6409  df-pnf 8011  df-mnf 8012  df-xr 8013  df-ltxr 8014  df-le 8015  df-sub 8147  df-neg 8148  df-reap 8549  df-ap 8556  df-div 8647  df-inn 8937  df-2 8995  df-3 8996  df-4 8997  df-n0 9194  df-z 9271  df-uz 9546  df-rp 9671  df-seqfrec 10463  df-exp 10537  df-cj 10868  df-re 10869  df-im 10870  df-rsqrt 11024  df-abs 11025  df-gz 12385
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator