l3lab/ntp-mathlib huggingface dataset:
instance Algebra_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Algebra R A.X :=
  { A.one with
    map_zero' := A.one.map_zero
    map_one' := rfl
    map_mul' := fun x y => by
      have h := LinearMap.congr_fun A.one_mul.symm (x ⊗ₜ A.one y)
      rwa [MonoidalCategory.leftUnitor_hom_apply, ← A.one.map_smul] at h
    commutes' := fun r a => by
      dsimp
      have h₁ := LinearMap.congr_fun A.one_mul (r ⊗ₜ a)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : 𝟙_ (ModuleCat R) ⟶ A.X := A.one
r : R
a : ↑A.X
h₁ :
  (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (r ⊗ₜ[R] a) =
    (CategoryTheory.MonoidalCategory.leftUnitor A.X).hom (r ⊗ₜ[R] a)
⊢ AddHom.toFun A.one.toAddHom r * a = a * AddHom.toFun A.one.toAddHom r

Next tactic:
have h₂ := LinearMap.congr_fun A.mul_one (a ⊗ₜ r)
instance Algebra_of_Mon_ (A : Mon_ (ModuleCat.{u} R)) : Algebra R A.X :=
  { A.one with
    map_zero' := A.one.map_zero
    map_one' := rfl
    map_mul' := fun x y => by
      have h := LinearMap.congr_fun A.one_mul.symm (x ⊗ₜ A.one y)
      rwa [MonoidalCategory.leftUnitor_hom_apply, ← A.one.map_smul] at h
    commutes' := fun r a => by
      dsimp
      have h₁ := LinearMap.congr_fun A.one_mul (r ⊗ₜ a)
      have h₂ := LinearMap.congr_fun A.mul_one (a ⊗ₜ r)
      

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
src✝ : 𝟙_ (ModuleCat R) ⟶ A.X := A.one
r : R
a : ↑A.X
h₁ :
  (CategoryTheory.MonoidalCategory.tensorHom A.one (𝟙 A.X) ≫ A.mul) (r ⊗ₜ[R] a) =
    (CategoryTheory.MonoidalCategory.leftUnitor A.X).hom (r ⊗ₜ[R] a)
h₂ :
  (CategoryTheory.MonoidalCategory.tensorHom (𝟙 A.X) A.one ≫ A.mul) (a ⊗ₜ[R] r) =
    (CategoryTheory.MonoidalCategory.rightUnitor A.X).hom (a ⊗ₜ[R] r)
⊢ AddHom.toFun A.one.toAddHom r * a = a * AddHom.toFun A.one.toAddHom r

Next tactic:
exact h₁.trans h₂.symm
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
⊢ CategoryTheory.MonoidalCategory.tensorHom (Algebra.linearMap R ↑A) (𝟙 (of R ↑A)) ≫ mul' R ↑A =
    (CategoryTheory.MonoidalCategory.leftUnitor (of R ↑A)).hom

Next tactic:
refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ ((compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑(of R ↑A))
          (CategoryTheory.MonoidalCategory.tensorHom (Algebra.linearMap R ↑A) (𝟙 (of R ↑A)) ≫ mul' R ↑A))
        1)
      x =
    ((compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑(of R ↑A))
          (CategoryTheory.MonoidalCategory.leftUnitor (of R ↑A)).hom)
        1)
      x

Next tactic:
erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ (mul' R ↑A)
      ((CategoryTheory.MonoidalCategory.tensorHom (Algebra.linearMap R ↑A) (𝟙 (of R ↑A)))
        (((TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑(of R ↑A)) 1) x)) =
    (CategoryTheory.MonoidalCategory.leftUnitor (of R ↑A)).hom
      (((TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑(of R ↑A)) 1) x)

Next tactic:
erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ (1, x).1 • (𝟙 (of R ↑A)) (1, x).2 = 1 • x

Next tactic:
rw [id_apply]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
⊢ CategoryTheory.MonoidalCategory.tensorHom (𝟙 (of R ↑A)) (Algebra.linearMap R ↑A) ≫ mul' R ↑A =
    (CategoryTheory.MonoidalCategory.rightUnitor (of R ↑A)).hom

Next tactic:
refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply,
    --   AlgebraCat.coe_comp]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ ((compr₂ (TensorProduct.mk R ↑(of R ↑A) ↑(𝟙_ (ModuleCat R)))
          (CategoryTheory.MonoidalCategory.tensorHom (𝟙 (of R ↑A)) (Algebra.linearMap R ↑A) ≫ mul' R ↑A))
        x)
      1 =
    ((compr₂ (TensorProduct.mk R ↑(of R ↑A) ↑(𝟙_ (ModuleCat R)))
          (CategoryTheory.MonoidalCategory.rightUnitor (of R ↑A)).hom)
        x)
      1

Next tactic:
erw [compr₂_apply, compr₂_apply]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply,
    --   AlgebraCat.coe_comp]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [compr₂_apply, compr₂_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ (CategoryTheory.MonoidalCategory.tensorHom (𝟙 (of R ↑A)) (Algebra.linearMap R ↑A) ≫ mul' R ↑A)
      (((TensorProduct.mk R ↑(of R ↑A) ↑(𝟙_ (ModuleCat R))) x) 1) =
    (CategoryTheory.MonoidalCategory.rightUnitor (of R ↑A)).hom
      (((TensorProduct.mk R ↑(of R ↑A) ↑(𝟙_ (ModuleCat R))) x) 1)

Next tactic:
erw [CategoryTheory.comp_apply]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply,
    --   AlgebraCat.coe_comp]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [compr₂_apply, compr₂_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [CategoryTheory.comp_apply]
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ (mul' R ↑A)
      ((CategoryTheory.MonoidalCategory.tensorHom (𝟙 (of R ↑A)) (Algebra.linearMap R ↑A))
        (((TensorProduct.mk R ↑(of R ↑A) ↑(𝟙_ (ModuleCat R))) x) 1)) =
    (CategoryTheory.MonoidalCategory.rightUnitor (of R ↑A)).hom
      (((TensorProduct.mk R ↑(of R ↑A) ↑(𝟙_ (ModuleCat R))) x) 1)

Next tactic:
erw [LinearMap.mul'_apply, ModuleCat.MonoidalCategory.rightUnitor_hom_apply, ← Algebra.commutes,
      ← Algebra.smul_def]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply,
    --   AlgebraCat.coe_comp]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [compr₂_apply, compr₂_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [CategoryTheory.comp_apply]
    erw [LinearMap.mul'_apply, ModuleCat.MonoidalCategory.rightUnitor_hom_apply, ← Algebra.commutes,
      ← Algebra.smul_def]
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x : ↑(of R ↑A)
⊢ (x, 1).2 • (𝟙 (of R ↑A)) (x, 1).1 = 1 • x

Next tactic:
rw [id_apply]
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply,
    --   AlgebraCat.coe_comp]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [compr₂_apply, compr₂_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [CategoryTheory.comp_apply]
    erw [LinearMap.mul'_apply, ModuleCat.MonoidalCategory.rightUnitor_hom_apply, ← Algebra.commutes,
      ← Algebra.smul_def]
    rw [id_apply]
  mul_assoc := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
⊢ CategoryTheory.MonoidalCategory.tensorHom (mul' R ↑A) (𝟙 (of R ↑A)) ≫ mul' R ↑A =
    (CategoryTheory.MonoidalCategory.associator (of R ↑A) (of R ↑A) (of R ↑A)).hom ≫
      CategoryTheory.MonoidalCategory.tensorHom (𝟙 (of R ↑A)) (mul' R ↑A) ≫ mul' R ↑A

Next tactic:
refine TensorProduct.ext <| TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext fun y =>
      LinearMap.ext fun z => ?_
/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R) where
  X := ModuleCat.of R A
  one := Algebra.linearMap R A
  mul := LinearMap.mul' R A
  one_mul := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext_ring <| LinearMap.ext fun x => ?_
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [compr₂_apply, compr₂_apply, CategoryTheory.comp_apply]
    -- Porting note : this `dsimp` does nothing
    -- dsimp [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, RingHom.map_one,
    --   ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   ModuleCat.MonoidalCategory.leftUnitor_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [LinearMap.mul'_apply, MonoidalCategory.leftUnitor_hom_apply, ← Algebra.smul_def]
    rw [id_apply]
  mul_one := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext_ring ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, Algebra.linearMap_apply,
    --   LinearMap.compr₂_apply, Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply,
    --   AlgebraCat.coe_comp]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    erw [compr₂_apply, compr₂_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [CategoryTheory.comp_apply]
    erw [LinearMap.mul'_apply, ModuleCat.MonoidalCategory.rightUnitor_hom_apply, ← Algebra.commutes,
      ← Algebra.smul_def]
    rw [id_apply]
  mul_assoc := by
    -- Porting note : `ext` did not pick up `TensorProduct.ext`
    refine TensorProduct.ext <| TensorProduct.ext <| LinearMap.ext fun x => LinearMap.ext fun y =>
      LinearMap.ext fun z => ?_
    -- Porting note : this `dsimp` does nothing
    -- dsimp only [AlgebraCat.id_apply, TensorProduct.mk_apply, LinearMap.compr₂_apply,
    --   Function.comp_apply, ModuleCat.MonoidalCategory.hom_apply, AlgebraCat.coe_comp,
    --   MonoidalCategory.associator_hom_apply]
    -- Porting note : because `dsimp` is not effective, `rw` needs to be changed to `erw`
    rw [compr₂_apply, compr₂_apply, compr₂_apply, compr₂_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, CategoryTheory.comp_apply]
    erw [LinearMap.mul'_apply, LinearMap.mul'_apply]
    rw [id_apply, TensorProduct.mk_apply]
    erw [TensorProduct.mk_apply, TensorProduct.mk_apply, id_apply, LinearMap.mul'_apply,
      LinearMap.mul'_apply]
    

Proof state:
R : Type u
inst✝ : CommRing R
A : AlgebraCat R
x y z : ↑(of R ↑A)
⊢ x * y * (x ⊗ₜ[R] y, z).2 = ((x, y).1, (x, y).2 ⊗ₜ[R] (x ⊗ₜ[R] y, z).2).1 * ((x, y).2 * (x ⊗ₜ[R] y, z).2)

Next tactic:
simp only [LinearMap.mul'_apply, mul_assoc]
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 

Proof state:
R : Type u
inst✝ : CommRing R
A : Mon_ (ModuleCat R)
⊢ ((𝟭 (Mon_ (ModuleCat R))).obj A).one ≫
      {
        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)) } =
    ((functor ⋙ MonModuleEquivalenceAlgebra.inverse).obj A).one

Next tactic:
ext