Metamath Proof Explorer


Theorem addmodidr

Description: The sum of a positive integer and a nonnegative integer less than the positive integer is equal to the nonnegative integer modulo the positive integer. (Contributed by AV, 19-Mar-2021)

Ref Expression
Assertion addmodidr ⊢ A ∈ ℕ 0 ∧ M ∈ ℕ ∧ A < M → A + M mod M = A

Proof

Step Hyp Ref Expression
1 nn0cn ⊢ A ∈ ℕ 0 → A ∈ ℂ
2 nncn ⊢ M ∈ ℕ → M ∈ ℂ
3 addcom ⊢ A ∈ ℂ ∧ M ∈ ℂ → A + M = M + A
4 1 2 3 syl2an ⊢ A ∈ ℕ 0 ∧ M ∈ ℕ → A + M = M + A
5 4 3adant3 ⊢ A ∈ ℕ 0 ∧ M ∈ ℕ ∧ A < M → A + M = M + A
6 5 oveq1d ⊢ A ∈ ℕ 0 ∧ M ∈ ℕ ∧ A < M → A + M mod M = M + A mod M
7 addmodid ⊢ A ∈ ℕ 0 ∧ M ∈ ℕ ∧ A < M → M + A mod M = A
8 6 7 eqtrd ⊢ A ∈ ℕ 0 ∧ M ∈ ℕ ∧ A < M → A + M mod M = A