Skip to content

Commit 20cab64

Browse files
committed
feat: ZMod.castHom_self (#7013)
drive-by: typo Co-authored-by: Moritz Firsching <firsching@google.com>
1 parent 8cad453 commit 20cab64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Mathlib/Data/ZMod/Basic.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ variable [AddGroupWithOne R]
144144

145145
/-- Cast an integer modulo `n` to another semiring.
146146
This function is a morphism if the characteristic of `R` divides `n`.
147-
See `ZMod.cast_hom` for a bundled version. -/
147+
See `ZMod.castHom` for a bundled version. -/
148148
@[coe] def cast : ∀ {n : ℕ}, ZMod n → R
149149
| 0 => Int.cast
150150
| _ + 1 => fun i => i.val
@@ -1161,6 +1161,10 @@ theorem ringHom_eq_of_ker_eq [CommRing R] (f g : R →+* ZMod n)
11611161
rw [← this, RingHom.ext_zmod (f.liftOfRightInverse _ _ ⟨g, _⟩) _, RingHom.id_comp]
11621162
#align zmod.ring_hom_eq_of_ker_eq ZMod.ringHom_eq_of_ker_eq
11631163

1164+
@[simp]
1165+
lemma castHom_self {n : ℕ} : ZMod.castHom dvd_rfl (ZMod n) = RingHom.id (ZMod n) :=
1166+
RingHom.ext_zmod (ZMod.castHom dvd_rfl (ZMod n)) (RingHom.id (ZMod n))
1167+
11641168
section lift
11651169

11661170
variable (n) {A : Type*} [AddGroup A]

0 commit comments

Comments
 (0)