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