instance : NonUnitalStarAlgHomClass (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
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
D : Type u_5
inst✝¹² : Monoid R
inst✝¹¹ : NonUnitalNonAssocSemiring A
inst✝¹⁰ : DistribMulAction R A
inst✝⁹ : Star A
inst✝⁸ : NonUnitalNonAssocSemiring B
inst✝⁷ : DistribMulAction R B
inst✝⁶ : Star B
inst✝⁵ : NonUnitalNonAssocSemiring C
inst✝⁴ : DistribMulAction R C
inst✝³ : Star C
inst✝² : NonUnitalNonAssocSemiring D
inst✝¹ : DistribMulAction R D
inst✝ : Star D
f : A → B
map_smul'✝¹ : ∀ (m : R) (x : A), f (m • x) = m • f x
map_zero'✝¹ : MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } 0 = 0
map_add'✝¹ :
  ∀ (x y : A),
    MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } (x + y) =
      MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } x +
        MulActionHom.toFun { toFun := f, map_smul' := map_smul'✝¹ } y
map_mul'✝¹ :
  ∀ (x y : A),
    MulActionHom.toFun
        { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
            map_add' := map_add'✝¹ }.toMulActionHom
        (x * y) =
      MulActionHom.toFun
          { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
              map_add' := map_add'✝¹ }.toMulActionHom
          x *
        MulActionHom.toFun
          { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
              map_add' := map_add'✝¹ }.toMulActionHom
          y
map_star'✝¹ :
  ∀ (a : A),
    MulActionHom.toFun
        {
              toDistribMulActionHom :=
                { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
                  map_add' := map_add'✝¹ },
              map_mul' := map_mul'✝¹ }.toDistribMulActionHom.toMulActionHom
        (star a) =
      star
        (MulActionHom.toFun
          {
                toDistribMulActionHom :=
                  { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
                    map_add' := map_add'✝¹ },
                map_mul' := map_mul'✝¹ }.toDistribMulActionHom.toMulActionHom
          a)
g : A → B
map_smul'✝ : ∀ (m : R) (x : A), g (m • x) = m • g x
map_zero'✝ : MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } 0 = 0
map_add'✝ :
  ∀ (x y : A),
    MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } (x + y) =
      MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } x +
        MulActionHom.toFun { toFun := g, map_smul' := map_smul'✝ } y
map_mul'✝ :
  ∀ (x y : A),
    MulActionHom.toFun
        { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
            map_add' := map_add'✝ }.toMulActionHom
        (x * y) =
      MulActionHom.toFun
          { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
              map_add' := map_add'✝ }.toMulActionHom
          x *
        MulActionHom.toFun
          { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
              map_add' := map_add'✝ }.toMulActionHom
          y
map_star'✝ :
  ∀ (a : A),
    MulActionHom.toFun
        {
              toDistribMulActionHom :=
                { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
                  map_add' := map_add'✝ },
              map_mul' := map_mul'✝ }.toDistribMulActionHom.toMulActionHom
        (star a) =
      star
        (MulActionHom.toFun
          {
                toDistribMulActionHom :=
                  { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
                    map_add' := map_add'✝ },
                map_mul' := map_mul'✝ }.toDistribMulActionHom.toMulActionHom
          a)
h :
  (fun f => f.toFun)
      {
        toNonUnitalAlgHom :=
          {
            toDistribMulActionHom :=
              { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
                map_add' := map_add'✝¹ },
            map_mul' := map_mul'✝¹ },
        map_star' := map_star'✝¹ } =
    (fun f => f.toFun)
      {
        toNonUnitalAlgHom :=
          {
            toDistribMulActionHom :=
              { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
                map_add' := map_add'✝ },
            map_mul' := map_mul'✝ },
        map_star' := map_star'✝ }
⊢ {
      toNonUnitalAlgHom :=
        {
          toDistribMulActionHom :=
            { toMulActionHom := { toFun := f, map_smul' := map_smul'✝¹ }, map_zero' := map_zero'✝¹,
              map_add' := map_add'✝¹ },
          map_mul' := map_mul'✝¹ },
      map_star' := map_star'✝¹ } =
    {
      toNonUnitalAlgHom :=
        {
          toDistribMulActionHom :=
            { toMulActionHom := { toFun := g, map_smul' := map_smul'✝ }, map_zero' := map_zero'✝,
              map_add' := map_add'✝ },
          map_mul' := map_mul'✝ },
      map_star' := map_star'✝ }

Next tactic:
congr