/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R) where
  toFun p := p.toContinuousMapOn X
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    simp
  map_mul' _ _ := by
    ext
    simp
  commutes' _ := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
X : Set R
x✝ : R
⊢ OneHom.toFun
      (↑↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) },
                map_mul' :=
                  (_ :
                    ∀ (x x_1 : R[X]),
                      OneHom.toFun
                          { toFun := fun p => toContinuousMapOn p X,
                            map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                          (x * x_1) =
                        OneHom.toFun
                            { toFun := fun p => toContinuousMapOn p X,
                              map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                            x *
                          OneHom.toFun
                            { toFun := fun p => toContinuousMapOn p X,
                              map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                            x_1) },
            map_zero' :=
              (_ :
                OneHom.toFun
                    (↑{
                        toOneHom :=
                          { toFun := fun p => toContinuousMapOn p X,
                            map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) },
                        map_mul' :=
                          (_ :
                            ∀ (x x_1 : R[X]),
                              OneHom.toFun
                                  { toFun := fun p => toContinuousMapOn p X,
                                    map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                  (x * x_1) =
                                OneHom.toFun
                                    { toFun := fun p => toContinuousMapOn p X,
                                      map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                    x *
                                  OneHom.toFun
                                    { toFun := fun p => toContinuousMapOn p X,
                                      map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                    x_1) })
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (x x_1 : R[X]),
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            { toFun := fun p => toContinuousMapOn p X,
                              map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x x_2 : R[X]),
                                OneHom.toFun
                                    { toFun := fun p => toContinuousMapOn p X,
                                      map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                    (x * x_2) =
                                  OneHom.toFun
                                      { toFun := fun p => toContinuousMapOn p X,
                                        map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                      x *
                                    OneHom.toFun
                                      { toFun := fun p => toContinuousMapOn p X,
                                        map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                      x_2) })
                      (x + x_1) =
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun p => toContinuousMapOn p X,
                                map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x x_2 : R[X]),
                                  OneHom.toFun
                                      { toFun := fun p => toContinuousMapOn p X,
                                        map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                      (x * x_2) =
                                    OneHom.toFun
                                        { toFun := fun p => toContinuousMapOn p X,
                                          map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                        x *
                                      OneHom.toFun
                                        { toFun := fun p => toContinuousMapOn p X,
                                          map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                        x_2) })
                        x +
                      OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun p => toContinuousMapOn p X,
                                map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x x_2 : R[X]),
                                  OneHom.toFun
                                      { toFun := fun p => toContinuousMapOn p X,
                                        map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                      (x * x_2) =
                                    OneHom.toFun
                                        { toFun := fun p => toContinuousMapOn p X,
                                          map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                        x *
                                      OneHom.toFun
                                        { toFun := fun p => toContinuousMapOn p X,
                                          map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                                        x_2) })
                        x_1) })
      ((algebraMap R R[X]) x✝) =
    (algebraMap R C(↑X, R)) x✝

Next tactic:
ext