Lean4
/-- A type endowed with `*` is a commutative semigroup, if it admits an injective map that
preserves `*` to a commutative semigroup. See note [reducible non-instances]. -/
@[to_additive /-- A type endowed with `+` is an additive commutative semigroup,if it admits
an injective map that preserves `+` to an additive commutative semigroup. -/
]
protected abbrev commSemigroup [CommSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
(mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₁
where
toSemigroup := hf.semigroup f mul
__ := hf.commMagma f mul