Metamath Proof Explorer


Theorem gcdcomnni

Description: Commutative law for gcd. (Contributed by metakunt, 25-Apr-2024)

Ref Expression
Hypotheses gcdcomnni.1 𝑀 ∈ ℕ
gcdcomnni.2 𝑁 ∈ ℕ
Assertion gcdcomnni ( 𝑀 gcd 𝑁 ) = ( 𝑁 gcd 𝑀 )

Proof

Step Hyp Ref Expression
1 gcdcomnni.1 𝑀 ∈ ℕ
2 gcdcomnni.2 𝑁 ∈ ℕ
3 1 nnzi 𝑀 ∈ ℤ
4 2 nnzi 𝑁 ∈ ℤ
5 3 4 pm3.2i ( 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ )
6 gcdcom ( ( 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ ) → ( 𝑀 gcd 𝑁 ) = ( 𝑁 gcd 𝑀 ) )
7 5 6 ax-mp ( 𝑀 gcd 𝑁 ) = ( 𝑁 gcd 𝑀 )