Skip to content

Commit

Permalink
feat: add StarAlgHom.ofId (#8993)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-loreaux committed Dec 12, 2023
1 parent 15f6474 commit cc5a723
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mathlib/Algebra/Star/StarAlgHom.lean
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,14 @@ theorem coe_id : ⇑(StarAlgHom.id R A) = id :=
rfl
#align star_alg_hom.coe_id StarAlgHom.coe_id

/-- `algebraMap R A` as a `StarAlgHom` when `A` is a star algebra over `R`. -/
@[simps]
def ofId (R A : Type*) [CommSemiring R] [StarRing R] [Semiring A] [StarMul A]
[Algebra R A] [StarModule R A] : R →⋆ₐ[R] A :=
{ Algebra.ofId R A with
toFun := algebraMap R A
map_star' := by simp [Algebra.algebraMap_eq_smul_one] }

end

instance : Inhabited (A →⋆ₐ[R] A) :=
Expand Down

0 comments on commit cc5a723

Please sign in to comment.