File tree Expand file tree Collapse file tree
Mathlib/CategoryTheory/Monoidal/Internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ variable {R : Type u} [CommRing R]
4040
4141namespace MonModuleEquivalenceAlgebra
4242
43- instance MonObj.toRing (A : ModuleCat.{u} R) [MonObj A] : Ring A :=
43+ /-- The ring structure on a monoid object.
44+ This instance is dangerous as it doesn't round trip from a ring to a monoid object and then back
45+ to a ring, since the `npow` field is lost in the middle. Therefore, it is scoped. -/
46+ @[implicit_reducible]
47+ def MonObj.toRing (A : ModuleCat.{u} R) [MonObj A] : Ring A :=
4448 { (inferInstance : AddCommGroup A) with
4549 one := η[A] (1 : R)
4650 mul := fun x y => μ[A] (x ⊗ₜ y)
@@ -65,7 +69,12 @@ instance MonObj.toRing (A : ModuleCat.{u} R) [MonObj A] : Ring A :=
6569 mul_zero := fun x => show μ[A] _ = 0 by
6670 rw [TensorProduct.tmul_zero, map_zero] }
6771
68- instance Algebra_of_Mon_ (A : ModuleCat.{u} R) [MonObj A] : Algebra R A where
72+ scoped [ModuleCat.MonModuleEquivalenceAlgebra] attribute [instance] MonObj.toRing
73+
74+ /-- The algebra structure on a monoid object.
75+ This instance is dangerous as it doesn't round trip from a ring to a monoid object and then back
76+ to a ring, since the `npow` field is lost in the middle. Therefore, it is scoped. -/
77+ scoped instance Algebra_of_Mon_ (A : ModuleCat.{u} R) [MonObj A] : Algebra R A where
6978 algebraMap :=
7079 { η[A].hom with
7180 map_zero' := η[A].hom.map_zero
You can’t perform that action at this time.
0 commit comments