Lean4
/-- Evaluation of functions into an indexed collection of monoids at a point is a monoid
homomorphism.
This is `Function.eval i` as a `MonoidHom`. -/
@[to_additive (attr := simps) /-- Evaluation of functions into an indexed collection of additive
monoids at a point is an additive monoid homomorphism. This is `Function.eval i` as an
`AddMonoidHom`. -/
]
def evalMonoidHom (i : I) : (∀ i, f i) →* f i where
toFun g := g i
map_one' := Pi.one_apply i
map_mul' _ _ := Pi.mul_apply _ _ i