Metamath Proof Explorer


Theorem gcdmultiplez

Description: The GCD of a multiple of an integer is the integer itself. (Contributed by Scott Fenton, 18-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014) (Proof shortened by AV, 12-Jan-2023)

Ref Expression
Assertion gcdmultiplez ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → ( 𝑀 gcd ( 𝑀 · 𝑁 ) ) = 𝑀 )

Proof

Step Hyp Ref Expression
1 nncn ( 𝑀 ∈ ℕ → 𝑀 ∈ ℂ )
2 1 adantr ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → 𝑀 ∈ ℂ )
3 zcn ( 𝑁 ∈ ℤ → 𝑁 ∈ ℂ )
4 3 adantl ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → 𝑁 ∈ ℂ )
5 2 4 mulcomd ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → ( 𝑀 · 𝑁 ) = ( 𝑁 · 𝑀 ) )
6 5 oveq2d ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → ( 𝑀 gcd ( 𝑀 · 𝑁 ) ) = ( 𝑀 gcd ( 𝑁 · 𝑀 ) ) )
7 nnnn0 ( 𝑀 ∈ ℕ → 𝑀 ∈ ℕ0 )
8 7 adantr ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → 𝑀 ∈ ℕ0 )
9 simpr ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → 𝑁 ∈ ℤ )
10 8 9 gcdmultipled ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → ( 𝑀 gcd ( 𝑁 · 𝑀 ) ) = 𝑀 )
11 6 10 eqtrd ( ( 𝑀 ∈ ℕ ∧ 𝑁 ∈ ℤ ) → ( 𝑀 gcd ( 𝑀 · 𝑁 ) ) = 𝑀 )