/-- Embedding of a subalgebra into the algebra. -/
def subtype : S →⋆ₐ[R] A := by refine' { toFun := ((↑) : S → A), .. } <;> intros <;> 

Proof state:
case refine'_6
F : Type u_1
R : Type u_2
A : Type u_3
B : Type u_4
C : Type u_5
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : Semiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Algebra R A
inst✝⁸ : StarModule R A
inst✝⁷ : Semiring B
inst✝⁶ : StarRing B
inst✝⁵ : Algebra R B
inst✝⁴ : StarModule R B
inst✝³ : Semiring C
inst✝² : StarRing C
inst✝¹ : Algebra R C
inst✝ : StarModule R C
S : StarSubalgebra R A
x✝ : ↥S
⊢ OneHom.toFun
      (↑↑↑{
              toRingHom :=
                {
                  toMonoidHom :=
                    { toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                      map_mul' :=
                        (_ :
                          ∀ (x y : ↥S),
                            OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                              OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) },
                  map_zero' :=
                    (_ :
                      OneHom.toFun
                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : ↥S),
                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                          0 =
                        OneHom.toFun
                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : ↥S),
                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                          0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↥S),
                        OneHom.toFun
                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                            (x + y) =
                          OneHom.toFun
                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                            (x + y)) },
              commutes' :=
                (_ :
                  ∀ (r : R),
                    OneHom.toFun
                        (↑↑{
                              toMonoidHom :=
                                { toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : ↥S),
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                          OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) },
                              map_zero' :=
                                (_ :
                                  OneHom.toFun
                                      (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : ↥S),
                                                OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y) =
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y)) })
                                      0 =
                                    OneHom.toFun
                                      (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : ↥S),
                                                OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y) =
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y)) })
                                      0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↥S),
                                    OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        (x + y) =
                                      OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        (x + y)) })
                        ((algebraMap R ↥S) r) =
                      OneHom.toFun
                        (↑↑{
                              toMonoidHom :=
                                { toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : ↥S),
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                          OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) },
                              map_zero' :=
                                (_ :
                                  OneHom.toFun
                                      (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : ↥S),
                                                OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y) =
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y)) })
                                      0 =
                                    OneHom.toFun
                                      (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : ↥S),
                                                OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y) =
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                    (x * y)) })
                                      0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↥S),
                                    OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        (x + y) =
                                      OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        (x + y)) })
                        ((algebraMap R ↥S) r)) })
      (star x✝) =
    star
      (OneHom.toFun
        (↑↑↑{
                toRingHom :=
                  {
                    toMonoidHom :=
                      { toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                        map_mul' :=
                          (_ :
                            ∀ (x y : ↥S),
                              OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) },
                    map_zero' :=
                      (_ :
                        OneHom.toFun
                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                            0 =
                          OneHom.toFun
                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                            0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↥S),
                          OneHom.toFun
                              (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : ↥S),
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                          OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                              (x + y) =
                            OneHom.toFun
                              (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : ↥S),
                                        OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                          OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) })
                              (x + y)) },
                commutes' :=
                  (_ :
                    ∀ (r : R),
                      OneHom.toFun
                          (↑↑{
                                toMonoidHom :=
                                  { toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : ↥S),
                                          OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                            OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) },
                                map_zero' :=
                                  (_ :
                                    OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        0 =
                                      OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun
                                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (x y : ↥S),
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y) =
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y)) })
                                          (x + y) =
                                        OneHom.toFun
                                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (x y : ↥S),
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y) =
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y)) })
                                          (x + y)) })
                          ((algebraMap R ↥S) r) =
                        OneHom.toFun
                          (↑↑{
                                toMonoidHom :=
                                  { toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : ↥S),
                                          OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y) =
                                            OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) } (x * y)) },
                                map_zero' :=
                                  (_ :
                                    OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        0 =
                                      OneHom.toFun
                                        (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : ↥S),
                                                  OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y) =
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                      (x * y)) })
                                        0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun
                                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (x y : ↥S),
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y) =
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y)) })
                                          (x + y) =
                                        OneHom.toFun
                                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (x y : ↥S),
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y) =
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := (_ : ↑1 = ↑1) }
                                                        (x * y)) })
                                          (x + y)) })
                          ((algebraMap R ↥S) r)) })
        x✝)

Next tactic:
rfl