Metamath Proof Explorer


Theorem zgcdsq

Description: nn0gcdsq extended to integers by symmetry. (Contributed by Stefan O'Rear, 15-Sep-2014)

Ref Expression
Assertion zgcdsq A B A gcd B 2 = A 2 gcd B 2

Proof

Step Hyp Ref Expression
1 gcdabs A B A gcd B = A gcd B
2 1 eqcomd A B A gcd B = A gcd B
3 2 oveq1d A B A gcd B 2 = A gcd B 2
4 nn0abscl A A 0
5 nn0abscl B B 0
6 nn0gcdsq A 0 B 0 A gcd B 2 = A 2 gcd B 2
7 4 5 6 syl2an A B A gcd B 2 = A 2 gcd B 2
8 zre A A
9 8 adantr A B A
10 absresq A A 2 = A 2
11 9 10 syl A B A 2 = A 2
12 zre B B
13 12 adantl A B B
14 absresq B B 2 = B 2
15 13 14 syl A B B 2 = B 2
16 11 15 oveq12d A B A 2 gcd B 2 = A 2 gcd B 2
17 3 7 16 3eqtrd A B A gcd B 2 = A 2 gcd B 2