Metamath Proof Explorer


Theorem neggcd

Description: Negating one operand of the gcd operator does not alter the result. (Contributed by Paul Chapman, 22-Jun-2011)

Ref Expression
Assertion neggcd ⊢ M ∈ ℤ ∧ N ∈ ℤ → -M gcd N = M gcd N

Proof

Step Hyp Ref Expression
1 gcdneg ⊢ N ∈ ℤ ∧ M ∈ ℤ → N gcd -M = N gcd M
2 1 ancoms ⊢ M ∈ ℤ ∧ N ∈ ℤ → N gcd -M = N gcd M
3 znegcl ⊢ M ∈ ℤ → − M ∈ ℤ
4 gcdcom ⊢ − M ∈ ℤ ∧ N ∈ ℤ → -M gcd N = N gcd -M
5 3 4 sylan ⊢ M ∈ ℤ ∧ N ∈ ℤ → -M gcd N = N gcd -M
6 gcdcom ⊢ M ∈ ℤ ∧ N ∈ ℤ → M gcd N = N gcd M
7 2 5 6 3eqtr4d ⊢ M ∈ ℤ ∧ N ∈ ℤ → -M gcd N = M gcd N