Skip to content

Commit 17ef218

Browse files
committed
feat: coercing to an AlgHom then RingHom (#27205)
From Toric
1 parent 0bab082 commit 17ef218

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Mathlib/Algebra/Algebra/Hom.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,15 @@ lemma cancel_left {g₁ g₂ : A →ₐ[R] B} {f : B →ₐ[R] C} (hf : Function
362362
end Semiring
363363
end AlgHom
364364

365+
namespace AlgHomClass
366+
367+
@[simp]
368+
lemma toRingHom_toAlgHom {R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A]
369+
[Algebra R B] {F : Type*} [FunLike F A B] [AlgHomClass F R A B] (f : F) :
370+
RingHomClass.toRingHom (AlgHomClass.toAlgHom f) = RingHomClass.toRingHom f := rfl
371+
372+
end AlgHomClass
373+
365374
namespace RingHom
366375

367376
variable {R S : Type*}

Mathlib/Topology/Algebra/Algebra.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ def _root_.Subalgebra.valA (p : Subalgebra R A) : p →A[R] A where
482482
toAlgHom := p.val
483483

484484
@[simp, norm_cast]
485-
theorem _root_.Subalgebra.coe_valA (p : Subalgebra R A) :
486-
(p.valA : p →ₐ[R] A) = p.subtype :=
485+
theorem _root_.Subalgebra.coe_valA (p : Subalgebra R A) : p.valA = p.subtype :=
487486
rfl
488487

489488
@[simp]

0 commit comments

Comments
 (0)