/-- The inclusion of locally-constant functions into continuous functions as an algebra map. -/
@[simps]
def toContinuousMapAlgHom (R : Type*) [CommSemiring R] [Semiring Y] [Algebra R Y]
    [TopologicalSemiring Y] : LocallyConstant X Y →ₐ[R] C(X, Y) where
  toFun := (↑)
  map_one' := by
    ext
    simp
  map_mul' x y := by
    ext
    simp
  map_zero' := by
    ext
    simp
  map_add' x y := by
    ext
    simp
  commutes' r := by
    ext x
    

Proof state:
case h
X : Type u_1
Y : Type u_2
inst✝⁵ : TopologicalSpace X
inst✝⁴ : TopologicalSpace Y
f : LocallyConstant X Y
R : Type u_3
inst✝³ : CommSemiring R
inst✝² : Semiring Y
inst✝¹ : Algebra R Y
inst✝ : TopologicalSemiring Y
r : R
x : X
⊢ (OneHom.toFun
        (↑↑{
              toMonoidHom :=
                { toOneHom := { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (x y : LocallyConstant X Y),
                        OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } (x * y) =
                          OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } x *
                            OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } y) },
              map_zero' :=
                (_ :
                  OneHom.toFun
                      (↑{ toOneHom := { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : LocallyConstant X Y),
                                OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } (x * y) =
                                  OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } x *
                                    OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } y) })
                      0 =
                    0),
              map_add' :=
                (_ :
                  ∀ (x y : LocallyConstant X Y),
                    OneHom.toFun
                        (↑{ toOneHom := { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : LocallyConstant X Y),
                                  OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } (x * y) =
                                    OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } x *
                                      OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } y) })
                        (x + y) =
                      OneHom.toFun
                          (↑{ toOneHom := { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : LocallyConstant X Y),
                                    OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } (x * y) =
                                      OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } x *
                                        OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } y) })
                          x +
                        OneHom.toFun
                          (↑{ toOneHom := { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : LocallyConstant X Y),
                                    OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } (x * y) =
                                      OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } x *
                                        OneHom.toFun { toFun := toContinuousMap, map_one' := (_ : ↑1 = 1) } y) })
                          y) })
        ((algebraMap R (LocallyConstant X Y)) r))
      x =
    ((algebraMap R C(X, Y)) r) x

Next tactic:
simp [Algebra.smul_def]