Lean4
/-- Monoid homomorphism between the function spaces `I → α` and `I → β`, induced by a monoid
homomorphism `f` between `α` and `β`. -/
@[to_additive (attr := simps) /--
Additive monoid homomorphism between the function spaces `I → α` and `I → β`, induced by an
additive monoid homomorphism `f` between `α` and `β` -/
]
protected def compLeft {α β : Type*} [MulOneClass α] [MulOneClass β] (f : α →* β) (I : Type*) : (I → α) →* I → β
where
toFun h := f ∘ h
map_one' := by ext; simp
map_mul' _ _ := by ext; simp