Skip to content

Commit

Permalink
feat: add the coercion from types satisfying StarAlgEquivClass to `…
Browse files Browse the repository at this point in the history
…StarAlgEquiv` (#10368)
  • Loading branch information
j-loreaux committed Feb 14, 2024
1 parent 73913b6 commit ca4293b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Mathlib/Algebra/Star/StarAlgHom.lean
Expand Up @@ -775,6 +775,23 @@ instance (priority := 100) instStarAlgHomClass (F R A B : Type*) {_ : CommSemiri
StarAlgHomClass F R A B :=
{ }

/-- Turn an element of a type `F` satisfying `StarAlgEquivClass F R A B` into an actual
`StarAlgEquiv`. This is declared as the default coercion from `F` to `A ≃⋆ₐ[R] B`. -/
@[coe]
def toStarAlgEquiv {F R A B : Type*} [Add A] [Mul A] [SMul R A] [Star A] [Add B] [Mul B] [SMul R B]
[Star B] [EquivLike F A B] [NonUnitalAlgEquivClass F R A B] [StarAlgEquivClass F R A B]
(f : F) : A ≃⋆ₐ[R] B :=
{ (f : A ≃+* B) with
map_star' := map_star f
map_smul' := map_smul f}

/-- Any type satisfying `StarAlgEquivClass` can be cast into `StarAlgEquiv` via
`StarAlgEquivClass.toStarAlgEquiv`. -/
instance instCoeHead {F R A B : Type*} [Add A] [Mul A] [SMul R A] [Star A] [Add B] [Mul B]
[SMul R B] [Star B] [EquivLike F A B] [NonUnitalAlgEquivClass F R A B]
[StarAlgEquivClass F R A B] : CoeHead F (A ≃⋆ₐ[R] B) :=
⟨toStarAlgEquiv⟩

end StarAlgEquivClass

namespace StarAlgEquiv
Expand Down

0 comments on commit ca4293b

Please sign in to comment.