Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d7a8709

Browse files
committed
chore(algebra/group/hom): Add mk_coe lemmas (#5812)
These are the counterparts to the `coe_mk` lemmas.
1 parent b121429 commit d7a8709

4 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/algebra/algebra/basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ coe_fn_inj $ funext H
436436
theorem ext_iff {φ₁ φ₂ : A →ₐ[R] B} : φ₁ = φ₂ ↔ ∀ x, φ₁ x = φ₂ x :=
437437
⟨alg_hom.congr_fun, ext⟩
438438

439+
@[simp] theorem mk_coe {f : A →ₐ[R] B} (h₁ h₂ h₃ h₄ h₅) :
440+
(⟨f, h₁, h₂, h₃, h₄, h₅⟩ : A →ₐ[R] B) = f := ext $ λ _, rfl
441+
439442
@[simp]
440443
theorem commutes (r : R) : φ (algebra_map R A r) = algebra_map R B r := φ.commutes' r
441444

src/algebra/group/hom.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,23 @@ lemma monoid_with_zero_hom.ext_iff [monoid_with_zero M] [monoid_with_zero N]
276276
{f g : monoid_with_zero_hom M N} : f = g ↔ ∀ x, f x = g x :=
277277
⟨λ h x, h ▸ rfl, λ h, monoid_with_zero_hom.ext h⟩
278278

279+
@[simp, to_additive]
280+
lemma one_hom.mk_coe [has_one M] [has_one N]
281+
(f : one_hom M N) (h1) : one_hom.mk f h1 = f :=
282+
one_hom.ext $ λ _, rfl
283+
@[simp, to_additive]
284+
lemma mul_hom.mk_coe [has_mul M] [has_mul N]
285+
(f : mul_hom M N) (hmul) : mul_hom.mk f hmul = f :=
286+
mul_hom.ext $ λ _, rfl
287+
@[simp, to_additive]
288+
lemma monoid_hom.mk_coe [monoid M] [monoid N]
289+
(f : M →* N) (h1 hmul) : monoid_hom.mk f h1 hmul = f :=
290+
monoid_hom.ext $ λ _, rfl
291+
@[simp]
292+
lemma monoid_with_zero_hom.mk_coe [monoid_with_zero M] [monoid_with_zero N]
293+
(f : monoid_with_zero_hom M N) (h0 h1 hmul) : monoid_with_zero_hom.mk f h0 h1 hmul = f :=
294+
monoid_with_zero_hom.ext $ λ _, rfl
295+
279296
end coes
280297

281298
@[simp, to_additive]

src/algebra/module/linear_map.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ protected lemma congr_fun (h : f = g) (x : M) : f x = g x := h ▸ rfl
117117
theorem ext_iff : f = g ↔ ∀ x, f x = g x :=
118118
by { rintro rfl x, refl }, ext⟩
119119

120+
@[simp] lemma mk_coe (f : M →ₗ[R] M₂) (h₁ h₂) :
121+
(linear_map.mk f h₁ h₂ : M →ₗ[R] M₂) = f := ext $ λ _, rfl
122+
120123
variables (f g)
121124

122125
@[simp] lemma map_add (x y : M) : f (x + y) = f x + f y := f.map_add' x y

src/algebra/ring/basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ coe_inj (funext h)
285285
theorem ext_iff {f g : α →+* β} : f = g ↔ ∀ x, f x = g x :=
286286
⟨λ h x, h ▸ rfl, λ h, ext h⟩
287287

288+
@[simp] lemma mk_coe (f : α →+* β) (h₁ h₂ h₃ h₄) : ring_hom.mk f h₁ h₂ h₃ h₄ = f :=
289+
ext $ λ _, rfl
290+
288291
theorem coe_add_monoid_hom_injective : function.injective (coe : (α →+* β) → (α →+ β)) :=
289292
λ f g h, ext (λ x, add_monoid_hom.congr_fun h x)
290293

0 commit comments

Comments
 (0)