Metamath Proof Explorer


Theorem gcdid

Description: The gcd of a number and itself is its absolute value. (Contributed by Paul Chapman, 31-Mar-2011)

Ref Expression
Assertion gcdid N N gcd N = N

Proof

Step Hyp Ref Expression
1 1z 1
2 0z 0
3 gcdaddm 1 N 0 N gcd 0 = N gcd 0 + 1 N
4 1 2 3 mp3an13 N N gcd 0 = N gcd 0 + 1 N
5 gcdid0 N N gcd 0 = N
6 zcn N N
7 mulid2 N 1 N = N
8 7 oveq2d N 0 + 1 N = 0 + N
9 addid2 N 0 + N = N
10 8 9 eqtrd N 0 + 1 N = N
11 6 10 syl N 0 + 1 N = N
12 11 oveq2d N N gcd 0 + 1 N = N gcd N
13 4 5 12 3eqtr3rd N N gcd N = N