set_option maxHeartbeats 500000 in
/-- The category of internal monoid objects in `ModuleCat R`
is equivalent to the category of "native" bundled `R`-algebras.
-/
def monModuleEquivalenceAlgebra : Mon_ (ModuleCat.{u} R) ≌ AlgebraCat R where
  functor := functor
  inverse := inverse
  unitIso :=
    NatIso.ofComponents
      (fun A =>
        { hom :=
            { hom :=
                { toFun := _root_.id
                  map_add' := fun x y => rfl
                  map_smul' := fun r a => rfl }
              mul_hom := by
                -- Porting note : `ext` did not pick up `TensorProduct.ext`
                refine TensorProduct.ext ?_
                dsimp at *
                rfl
              one_hom := by ext; rfl }
          inv :=
            { hom :=
                { toFun := _root_.id
                  map_add' := fun x y => rfl
                  map_smul' := fun r a => rfl }
              mul_hom := by
                -- Porting note : `ext` did not pick up `TensorProduct.ext`
                refine TensorProduct.ext ?_
                dsimp at *
                rfl
              one_hom := by ext; rfl }
          hom_inv_id := by ext; 

Proof state:
case w.h
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
x✝ : ↑((𝟭 (Mon_ (ModuleCat R))).obj A).X
⊢ (Mon_.Hom.mk
            {
              toAddHom :=
                { toFun := _root_.id,
                  map_add' :=
                    (_ : ∀ (x y : ↑((𝟭 (Mon_ (ModuleCat R))).obj A).X), _root_.id (x + y) = _root_.id (x + y)) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (a : ↑((𝟭 (Mon_ (ModuleCat R))).obj A).X),
                    AddHom.toFun
                        { toFun := _root_.id,
                          map_add' :=
                            (_ : ∀ (x y : ↑((𝟭 (Mon_ (ModuleCat R))).obj A).X), _root_.id (x + y) = _root_.id (x + y)) }
                        (r • a) =
                      AddHom.toFun
                        { toFun := _root_.id,
                          map_add' :=
                            (_ : ∀ (x y : ↑((𝟭 (Mon_ (ModuleCat R))).obj A).X), _root_.id (x + y) = _root_.id (x + y)) }
                        (r • a)) } ≫
          Mon_.Hom.mk
            {
              toAddHom :=
                { toFun := _root_.id,
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑((functor ⋙ MonModuleEquivalenceAlgebra.inverse).obj A).X),
                        _root_.id (x + y) = _root_.id (x + y)) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (a : ↑((functor ⋙ MonModuleEquivalenceAlgebra.inverse).obj A).X),
                    AddHom.toFun
                        { toFun := _root_.id,
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑((functor ⋙ MonModuleEquivalenceAlgebra.inverse).obj A).X),
                                _root_.id (x + y) = _root_.id (x + y)) }
                        (r • a) =
                      AddHom.toFun
                        { toFun := _root_.id,
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑((functor ⋙ MonModuleEquivalenceAlgebra.inverse).obj A).X),
                                _root_.id (x + y) = _root_.id (x + y)) }
                        (r • a)) }).hom
      x✝ =
    (𝟙 ((𝟭 (Mon_ (ModuleCat R))).obj A)).hom x✝

Next tactic:
rfl