Metamath Proof Explorer


Theorem smndex1iidm

Description: The modulo function I is idempotent. (Contributed by AV, 12-Feb-2024)

Ref Expression
Hypotheses smndex1ibas.m ⊢ M = EndoFMnd ⁡ ℕ 0
smndex1ibas.n ⊢ N ∈ ℕ
smndex1ibas.i ⊢ I = x ∈ ℕ 0 ⟼ x mod N
Assertion smndex1iidm ⊢ I ∘ I = I

Proof

Step Hyp Ref Expression
1 smndex1ibas.m ⊢ M = EndoFMnd ⁡ ℕ 0
2 smndex1ibas.n ⊢ N ∈ ℕ
3 smndex1ibas.i ⊢ I = x ∈ ℕ 0 ⟼ x mod N
4 nn0re ⊢ y ∈ ℕ 0 → y ∈ ℝ
5 nnrp ⊢ N ∈ ℕ → N ∈ ℝ +
6 2 5 ax-mp ⊢ N ∈ ℝ +
7 modabs2 ⊢ y ∈ ℝ ∧ N ∈ ℝ + → y mod N mod N = y mod N
8 4 6 7 sylancl ⊢ y ∈ ℕ 0 → y mod N mod N = y mod N
9 8 eqcomd ⊢ y ∈ ℕ 0 → y mod N = y mod N mod N
10 9 mpteq2ia ⊢ y ∈ ℕ 0 ⟼ y mod N = y ∈ ℕ 0 ⟼ y mod N mod N
11 oveq1 ⊢ x = y → x mod N = y mod N
12 11 cbvmptv ⊢ x ∈ ℕ 0 ⟼ x mod N = y ∈ ℕ 0 ⟼ y mod N
13 3 12 eqtri ⊢ I = y ∈ ℕ 0 ⟼ y mod N
14 nn0z ⊢ y ∈ ℕ 0 → y ∈ ℤ
15 14 anim2i ⊢ N ∈ ℕ ∧ y ∈ ℕ 0 → N ∈ ℕ ∧ y ∈ ℤ
16 15 ancomd ⊢ N ∈ ℕ ∧ y ∈ ℕ 0 → y ∈ ℤ ∧ N ∈ ℕ
17 zmodcl ⊢ y ∈ ℤ ∧ N ∈ ℕ → y mod N ∈ ℕ 0
18 16 17 syl ⊢ N ∈ ℕ ∧ y ∈ ℕ 0 → y mod N ∈ ℕ 0
19 13 a1i ⊢ N ∈ ℕ → I = y ∈ ℕ 0 ⟼ y mod N
20 3 a1i ⊢ N ∈ ℕ → I = x ∈ ℕ 0 ⟼ x mod N
21 oveq1 ⊢ x = y mod N → x mod N = y mod N mod N
22 18 19 20 21 fmptco ⊢ N ∈ ℕ → I ∘ I = y ∈ ℕ 0 ⟼ y mod N mod N
23 2 22 ax-mp ⊢ I ∘ I = y ∈ ℕ 0 ⟼ y mod N mod N
24 10 13 23 3eqtr4ri ⊢ I ∘ I = I