English
If Y is a CommSemiring, LocallyConstant X Y inherits a CommSemiring structure by pointwise operations; equality of the induced structure with the canonical one holds by construction.
Русский
Если Y — коммутативная полусемирия, LocallyConstant X Y получает CommSemiring по точкам; равенство структур следует из конструирования.
LaTeX
$$$\forall f,g:\mathrm{LocallyConstant}(X,Y),\; f\cdot g = g\cdot f\quad\text{and}\quad 1_{\mathrm{LocConst}} = \text{const}_X(1_Y).$$$
Lean4
instance [CommSemiring Y] : CommSemiring (LocallyConstant X Y) :=
Function.Injective.commSemiring DFunLike.coe DFunLike.coe_injective' rfl rfl (fun _ _ => rfl) (fun _ _ => rfl)
(fun _ _ => rfl) (fun _ _ => rfl) fun _ => rfl