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

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' := ?refine'_1 },
                        map_mul' :=
                          (_ :
                            ∀ (x y : ↥S),
                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                  OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) },
                    map_zero' := ?refine'_3,
                    map_add' :=
                      (_ :
                        ∀ (x y : ↥S),
                          OneHom.toFun
                              (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : ↥S),
                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                              (x + y) =
                            OneHom.toFun
                                (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : ↥S),
                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                x +
                              OneHom.toFun
                                (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : ↥S),
                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                y) },
                commutes' :=
                  (_ :
                    ∀ (r : R),
                      OneHom.toFun
                          (↑↑{
                                toMonoidHom :=
                                  { toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : ↥S),
                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) },
                                map_zero' := ?refine'_3,
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↥S),
                                      OneHom.toFun
                                          (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (x y : ↥S),
                                                    OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                        (x * y) =
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                          y) })
                                          (x + y) =
                                        OneHom.toFun
                                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (x y : ↥S),
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                          (x * y) =
                                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            x *
                                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            y) })
                                            x +
                                          OneHom.toFun
                                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (x y : ↥S),
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                          (x * y) =
                                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            x *
                                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            y) })
                                            y) })
                          ((algebraMap R ↥S) r) =
                        (algebraMap R A) r) })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{
                  toRingHom :=
                    {
                      toMonoidHom :=
                        { toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                          map_mul' :=
                            (_ :
                              ∀ (x y : ↥S),
                                OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                  OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                    OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) },
                      map_zero' := ?refine'_3,
                      map_add' :=
                        (_ :
                          ∀ (x y : ↥S),
                            OneHom.toFun
                                (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : ↥S),
                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                (x + y) =
                              OneHom.toFun
                                  (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : ↥S),
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                                OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                  x +
                                OneHom.toFun
                                  (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : ↥S),
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                                OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                  y) },
                  commutes' :=
                    (_ :
                      ∀ (r : R),
                        OneHom.toFun
                            (↑↑{
                                  toMonoidHom :=
                                    { toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : ↥S),
                                            OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } (x * y) =
                                              OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } x *
                                                OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 } y) },
                                  map_zero' := ?refine'_3,
                                  map_add' :=
                                    (_ :
                                      ∀ (x y : ↥S),
                                        OneHom.toFun
                                            (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (x y : ↥S),
                                                      OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                          (x * y) =
                                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            x *
                                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            y) })
                                            (x + y) =
                                          OneHom.toFun
                                              (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (x y : ↥S),
                                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            (x * y) =
                                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                              x *
                                                            OneHom.toFun
                                                              { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                              x +
                                            OneHom.toFun
                                              (↑{ toOneHom := { toFun := Subtype.val, map_one' := ?refine'_1 },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (x y : ↥S),
                                                        OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                            (x * y) =
                                                          OneHom.toFun { toFun := Subtype.val, map_one' := ?refine'_1 }
                                                              x *
                                                            OneHom.toFun
                                                              { toFun := Subtype.val, map_one' := ?refine'_1 } y) })
                                              y) })
                            ((algebraMap R ↥S) r) =
                          (algebraMap R A) r) })
          x)

Next tactic:
intros