/-- Precomposition of functions into a normed ring by a continuous map is an algebra homomorphism.
-/
@[simps]
def ContinuousMap.compRightAlgHom {α β : Type*} [TopologicalSpace α] [TopologicalSpace β]
    (f : C(α, β)) : C(β, A) →ₐ[R] C(α, A) where
  toFun g := g.comp f
  map_zero' := by
    ext
    rfl
  map_add' g₁ g₂ := by
    ext
    rfl
  map_one' := by
    ext
    rfl
  map_mul' g₁ g₂ := by
    ext
    rfl
  commutes' r := by
    

Proof state:
α✝ : Type u_1
inst✝¹¹ : TopologicalSpace α✝
R : Type u_2
inst✝¹⁰ : CommSemiring R
A : Type u_3
inst✝⁹ : TopologicalSpace A
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁵ : TopologicalSpace A₂
inst✝⁴ : Semiring A₂
inst✝³ : Algebra R A₂
inst✝² : TopologicalSemiring A₂
α : Type u_5
β : Type u_6
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : C(α, β)
r : R
⊢ OneHom.toFun
      (↑↑{
            toMonoidHom :=
              { toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
                map_mul' :=
                  (_ :
                    ∀ (g₁ g₂ : C(β, A)),
                      OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                          (g₁ * g₂) =
                        OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                          OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                            g₂) },
            map_zero' :=
              (_ :
                OneHom.toFun
                    (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
                        map_mul' :=
                          (_ :
                            ∀ (g₁ g₂ : C(β, A)),
                              OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                  (g₁ * g₂) =
                                OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                    g₁ *
                                  OneHom.toFun
                                    { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₂) })
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (g₁ g₂ : C(β, A)),
                  OneHom.toFun
                      (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (g₁ g₂ : C(β, A)),
                                OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                    (g₁ * g₂) =
                                  OneHom.toFun
                                      { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                                    OneHom.toFun
                                      { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₂) })
                      (g₁ + g₂) =
                    OneHom.toFun
                        (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (g₁ g₂ : C(β, A)),
                                  OneHom.toFun
                                      { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                      (g₁ * g₂) =
                                    OneHom.toFun
                                        { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                                      OneHom.toFun
                                        { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                        g₂) })
                        g₁ +
                      OneHom.toFun
                        (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (g₁ g₂ : C(β, A)),
                                  OneHom.toFun
                                      { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                      (g₁ * g₂) =
                                    OneHom.toFun
                                        { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                                      OneHom.toFun
                                        { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) }
                                        g₂) })
                        g₂) })
      ((algebraMap R C(β, A)) r) =
    (algebraMap R C(α, A)) r

Next tactic:
ext