Lean4
/-- Semigroup structure on additive submonoids of a (possibly, non-unital) semiring. -/
protected def semigroup : Semigroup (AddSubmonoid R) where
mul_assoc _M _N
_P :=
le_antisymm
(mul_le.2 fun _mn hmn p hp =>
AddSubmonoid.mul_induction_on hmn (fun m hm n hn ↦ mul_assoc m n p ▸ mul_mem_mul hm <| mul_mem_mul hn hp)
fun x y ↦ (add_mul x y p).symm ▸ add_mem)
(mul_le.2 fun m hm _np hnp =>
AddSubmonoid.mul_induction_on hnp (fun n hn p hp ↦ mul_assoc m n p ▸ mul_mem_mul (mul_mem_mul hm hn) hp)
fun x y ↦ (mul_add m x y) ▸ add_mem)