Metamath Proof Explorer


Theorem mul2sq

Description: Fibonacci's identity (actually due to Diophantus). The product of two sums of two squares is also a sum of two squares. We can take advantage of Gaussian integers here to trivialize the proof. (Contributed by Mario Carneiro, 19-Jun-2015)

Ref Expression
Hypothesis 2sq.1 S = ran w i w 2
Assertion mul2sq A S B S A B S

Proof

Step Hyp Ref Expression
1 2sq.1 S = ran w i w 2
2 1 2sqlem1 A S x i A = x 2
3 1 2sqlem1 B S y i B = y 2
4 reeanv x i y i A = x 2 B = y 2 x i A = x 2 y i B = y 2
5 gzmulcl x i y i x y i
6 gzcn x i x
7 gzcn y i y
8 absmul x y x y = x y
9 6 7 8 syl2an x i y i x y = x y
10 9 oveq1d x i y i x y 2 = x y 2
11 6 abscld x i x
12 11 recnd x i x
13 7 abscld y i y
14 13 recnd y i y
15 sqmul x y x y 2 = x 2 y 2
16 12 14 15 syl2an x i y i x y 2 = x 2 y 2
17 10 16 eqtr2d x i y i x 2 y 2 = x y 2
18 fveq2 z = x y z = x y
19 18 oveq1d z = x y z 2 = x y 2
20 19 rspceeqv x y i x 2 y 2 = x y 2 z i x 2 y 2 = z 2
21 5 17 20 syl2anc x i y i z i x 2 y 2 = z 2
22 1 2sqlem1 x 2 y 2 S z i x 2 y 2 = z 2
23 21 22 sylibr x i y i x 2 y 2 S
24 oveq12 A = x 2 B = y 2 A B = x 2 y 2
25 24 eleq1d A = x 2 B = y 2 A B S x 2 y 2 S
26 23 25 syl5ibrcom x i y i A = x 2 B = y 2 A B S
27 26 rexlimivv x i y i A = x 2 B = y 2 A B S
28 4 27 sylbir x i A = x 2 y i B = y 2 A B S
29 2 3 28 syl2anb A S B S A B S