instance : StarAlgHomClass (A →⋆ₐ[R] B) R A B
    where
  coe f := f.toFun
  coe_injective' := by rintro ⟨⟨⟨⟨⟨f, _⟩, _⟩, _⟩, _⟩, _⟩ ⟨⟨⟨⟨⟨g, _⟩, _⟩, _⟩, _⟩, _⟩ h; 

Proof state:
case mk.mk.mk.mk.mk.mk.mk.mk.mk.mk
F : Type u_1
R : Type u_2
A : Type u_3
B : Type u_4
C : Type u_5
D : Type u_6
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring A
inst✝¹⁰ : Algebra R A
inst✝⁹ : Star A
inst✝⁸ : Semiring B
inst✝⁷ : Algebra R B
inst✝⁶ : Star B
inst✝⁵ : Semiring C
inst✝⁴ : Algebra R C
inst✝³ : Star C
inst✝² : Semiring D
inst✝¹ : Algebra R D
inst✝ : Star D
f : A → B
map_one'✝¹ : f 1 = 1
map_mul'✝¹ :
  ∀ (x y : A),
    OneHom.toFun { toFun := f, map_one' := map_one'✝¹ } (x * y) =
      OneHom.toFun { toFun := f, map_one' := map_one'✝¹ } x * OneHom.toFun { toFun := f, map_one' := map_one'✝¹ } y
map_zero'✝¹ : OneHom.toFun (↑{ toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ }) 0 = 0
map_add'✝¹ :
  ∀ (x y : A),
    OneHom.toFun (↑{ toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ }) (x + y) =
      OneHom.toFun (↑{ toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ }) x +
        OneHom.toFun (↑{ toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ }) y
commutes'✝¹ :
  ∀ (r : R),
    OneHom.toFun
        (↑↑{ toMonoidHom := { toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ },
              map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ })
        ((algebraMap R A) r) =
      (algebraMap R B) r
map_star'✝¹ :
  ∀ (x : A),
    OneHom.toFun
        (↑↑↑{
                toRingHom :=
                  { toMonoidHom := { toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ },
                    map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ },
                commutes' := commutes'✝¹ })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{
                  toRingHom :=
                    { toMonoidHom := { toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ },
                      map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ },
                  commutes' := commutes'✝¹ })
          x)
g : A → B
map_one'✝ : g 1 = 1
map_mul'✝ :
  ∀ (x y : A),
    OneHom.toFun { toFun := g, map_one' := map_one'✝ } (x * y) =
      OneHom.toFun { toFun := g, map_one' := map_one'✝ } x * OneHom.toFun { toFun := g, map_one' := map_one'✝ } y
map_zero'✝ : OneHom.toFun (↑{ toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ }) 0 = 0
map_add'✝ :
  ∀ (x y : A),
    OneHom.toFun (↑{ toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ }) (x + y) =
      OneHom.toFun (↑{ toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ }) x +
        OneHom.toFun (↑{ toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ }) y
commutes'✝ :
  ∀ (r : R),
    OneHom.toFun
        (↑↑{ toMonoidHom := { toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ },
              map_zero' := map_zero'✝, map_add' := map_add'✝ })
        ((algebraMap R A) r) =
      (algebraMap R B) r
map_star'✝ :
  ∀ (x : A),
    OneHom.toFun
        (↑↑↑{
                toRingHom :=
                  { toMonoidHom := { toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ },
                    map_zero' := map_zero'✝, map_add' := map_add'✝ },
                commutes' := commutes'✝ })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{
                  toRingHom :=
                    { toMonoidHom := { toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ },
                      map_zero' := map_zero'✝, map_add' := map_add'✝ },
                  commutes' := commutes'✝ })
          x)
h :
  (fun f => f.toFun)
      {
        toAlgHom :=
          {
            toRingHom :=
              { toMonoidHom := { toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ },
                map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ },
            commutes' := commutes'✝¹ },
        map_star' := map_star'✝¹ } =
    (fun f => f.toFun)
      {
        toAlgHom :=
          {
            toRingHom :=
              { toMonoidHom := { toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ },
                map_zero' := map_zero'✝, map_add' := map_add'✝ },
            commutes' := commutes'✝ },
        map_star' := map_star'✝ }
⊢ {
      toAlgHom :=
        {
          toRingHom :=
            { toMonoidHom := { toOneHom := { toFun := f, map_one' := map_one'✝¹ }, map_mul' := map_mul'✝¹ },
              map_zero' := map_zero'✝¹, map_add' := map_add'✝¹ },
          commutes' := commutes'✝¹ },
      map_star' := map_star'✝¹ } =
    {
      toAlgHom :=
        {
          toRingHom :=
            { toMonoidHom := { toOneHom := { toFun := g, map_one' := map_one'✝ }, map_mul' := map_mul'✝ },
              map_zero' := map_zero'✝, map_add' := map_add'✝ },
          commutes' := commutes'✝ },
      map_star' := map_star'✝ }

Next tactic:
congr