l3lab/ntp-mathlib huggingface dataset:
theorem rightUnitor_naturality {M N : ModuleCat R} (f : M ⟶ N) :
    tensorHom f (𝟙 (ModuleCat.of R R)) ≫ (rightUnitor N).hom = (rightUnitor M).hom ≫ f := by
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply LinearMap.ext; intro x
  apply LinearMap.ext_ring
  -- Porting note: used to be dsimp
  change ((rightUnitor N).hom) ((tensorHom f (𝟙 (of R R))) (x ⊗ₜ[R] (1 : R))) =
    f (((rightUnitor M).hom) (x ⊗ₜ[R] 1))
  

Proof state:
case H.h.h
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
f : M ⟶ N
x : ↑M
⊢ (rightUnitor N).hom ((tensorHom f (𝟙 (of R R))) (x ⊗ₜ[R] 1)) = f ((rightUnitor M).hom (x ⊗ₜ[R] 1))

Next tactic:
erw [TensorProduct.rid_tmul, TensorProduct.rid_tmul]
theorem rightUnitor_naturality {M N : ModuleCat R} (f : M ⟶ N) :
    tensorHom f (𝟙 (ModuleCat.of R R)) ≫ (rightUnitor N).hom = (rightUnitor M).hom ≫ f := by
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply LinearMap.ext; intro x
  apply LinearMap.ext_ring
  -- Porting note: used to be dsimp
  change ((rightUnitor N).hom) ((tensorHom f (𝟙 (of R R))) (x ⊗ₜ[R] (1 : R))) =
    f (((rightUnitor M).hom) (x ⊗ₜ[R] 1))
  erw [TensorProduct.rid_tmul, TensorProduct.rid_tmul]
  

Proof state:
case H.h.h
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
f : M ⟶ N
x : ↑M
⊢ (𝟙 (of R R)) (x, 1).2 • f (x, 1).1 = f (1 • x)

Next tactic:
rw [LinearMap.map_smul]
theorem rightUnitor_naturality {M N : ModuleCat R} (f : M ⟶ N) :
    tensorHom f (𝟙 (ModuleCat.of R R)) ≫ (rightUnitor N).hom = (rightUnitor M).hom ≫ f := by
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply LinearMap.ext; intro x
  apply LinearMap.ext_ring
  -- Porting note: used to be dsimp
  change ((rightUnitor N).hom) ((tensorHom f (𝟙 (of R R))) (x ⊗ₜ[R] (1 : R))) =
    f (((rightUnitor M).hom) (x ⊗ₜ[R] 1))
  erw [TensorProduct.rid_tmul, TensorProduct.rid_tmul]
  rw [LinearMap.map_smul]
  

Proof state:
case H.h.h
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
f : M ⟶ N
x : ↑M
⊢ (𝟙 (of R R)) (x, 1).2 • f (x, 1).1 = 1 • f x

Next tactic:
rfl
theorem triangle (M N : ModuleCat.{u} R) :
    (associator M (ModuleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =
      tensorHom (rightUnitor M).hom (𝟙 N) := by
  

Proof state:
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
⊢ (associator M (of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom = tensorHom (rightUnitor M).hom (𝟙 N)

Next tactic:
apply TensorProduct.ext_threefold
theorem triangle (M N : ModuleCat.{u} R) :
    (associator M (ModuleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =
      tensorHom (rightUnitor M).hom (𝟙 N) := by
  apply TensorProduct.ext_threefold
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
⊢ ∀ (x : ↑M) (y : ↑(of R R)) (z : ↑N),
    ((associator M (of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom) ((x ⊗ₜ[R] y) ⊗ₜ[R] z) =
      (tensorHom (rightUnitor M).hom (𝟙 N)) ((x ⊗ₜ[R] y) ⊗ₜ[R] z)

Next tactic:
intro x y z
theorem triangle (M N : ModuleCat.{u} R) :
    (associator M (ModuleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =
      tensorHom (rightUnitor M).hom (𝟙 N) := by
  apply TensorProduct.ext_threefold
  intro x y z
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
x : ↑M
y : ↑(of R R)
z : ↑N
⊢ ((associator M (of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom) ((x ⊗ₜ[R] y) ⊗ₜ[R] z) =
    (tensorHom (rightUnitor M).hom (𝟙 N)) ((x ⊗ₜ[R] y) ⊗ₜ[R] z)

Next tactic:
change R at y
theorem triangle (M N : ModuleCat.{u} R) :
    (associator M (ModuleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =
      tensorHom (rightUnitor M).hom (𝟙 N) := by
  apply TensorProduct.ext_threefold
  intro x y z
  change R at y
  -- Porting note: used to be dsimp [tensorHom, associator]
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
x : ↑M
z : ↑N
y : R
⊢ ((associator M (of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom) ((x ⊗ₜ[R] y) ⊗ₜ[R] z) =
    (tensorHom (rightUnitor M).hom (𝟙 N)) ((x ⊗ₜ[R] y) ⊗ₜ[R] z)

Next tactic:
change x ⊗ₜ[R] ((leftUnitor N).hom) (y ⊗ₜ[R] z) = ((rightUnitor M).hom) (x ⊗ₜ[R] y) ⊗ₜ[R] z
theorem triangle (M N : ModuleCat.{u} R) :
    (associator M (ModuleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =
      tensorHom (rightUnitor M).hom (𝟙 N) := by
  apply TensorProduct.ext_threefold
  intro x y z
  change R at y
  -- Porting note: used to be dsimp [tensorHom, associator]
  change x ⊗ₜ[R] ((leftUnitor N).hom) (y ⊗ₜ[R] z) = ((rightUnitor M).hom) (x ⊗ₜ[R] y) ⊗ₜ[R] z
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
x : ↑M
z : ↑N
y : R
⊢ x ⊗ₜ[R] (leftUnitor N).hom (y ⊗ₜ[R] z) = (rightUnitor M).hom (x ⊗ₜ[R] y) ⊗ₜ[R] z

Next tactic:
erw [TensorProduct.lid_tmul, TensorProduct.rid_tmul]
theorem triangle (M N : ModuleCat.{u} R) :
    (associator M (ModuleCat.of R R) N).hom ≫ tensorHom (𝟙 M) (leftUnitor N).hom =
      tensorHom (rightUnitor M).hom (𝟙 N) := by
  apply TensorProduct.ext_threefold
  intro x y z
  change R at y
  -- Porting note: used to be dsimp [tensorHom, associator]
  change x ⊗ₜ[R] ((leftUnitor N).hom) (y ⊗ₜ[R] z) = ((rightUnitor M).hom) (x ⊗ₜ[R] y) ⊗ₜ[R] z
  erw [TensorProduct.lid_tmul, TensorProduct.rid_tmul]
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
M N : ModuleCat R
x : ↑M
z : ↑N
y : R
⊢ x ⊗ₜ[R] (y • z) = (y • x) ⊗ₜ[R] z

Next tactic:
exact (TensorProduct.smul_tmul _ _ _).symm
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  

Proof state:
R : Type u
inst✝ : CommRing R
⊢ MonoidalPreadditive (ModuleCat R)

Next tactic:
refine' ⟨_, _, _, _⟩
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · 

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
⊢ ∀ {W X Y Z : ModuleCat R} (f : W ⟶ X), f ⊗ 0 = 0

Next tactic:
dsimp only [autoParam]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; 

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
⊢ ∀ {W X Y Z : ModuleCat R} (f : W ⟶ X), f ⊗ 0 = 0

Next tactic:
intros
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
⊢ f✝ ⊗ 0 = 0

Next tactic:
refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
x : ↑W✝
y : ↑Y✝
⊢ ((LinearMap.compr₂ (TensorProduct.mk R ↑W✝ ↑Y✝) (f✝ ⊗ 0)) x) y =
    ((LinearMap.compr₂ (TensorProduct.mk R ↑W✝ ↑Y✝) 0) x) y

Next tactic:
simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
x : ↑W✝
y : ↑Y✝
⊢ (f✝ ⊗ 0) (x ⊗ₜ[R] y) = 0 (x ⊗ₜ[R] y)

Next tactic:
rw [LinearMap.zero_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
x : ↑W✝
y : ↑Y✝
⊢ (f✝ ⊗ 0) (x ⊗ₜ[R] y) = 0

Next tactic:
erw [MonoidalCategory.hom_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    

Proof state:
case refine'_1
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
x : ↑W✝
y : ↑Y✝
⊢ f✝ x ⊗ₜ[R] 0 y = 0

Next tactic:
rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · 

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
⊢ ∀ {W X Y Z : ModuleCat R} (f : Y ⟶ Z), 0 ⊗ f = 0

Next tactic:
dsimp only [autoParam]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; 

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
⊢ ∀ {W X Y Z : ModuleCat R} (f : Y ⟶ Z), 0 ⊗ f = 0

Next tactic:
intros
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : Y✝ ⟶ Z✝
⊢ 0 ⊗ f✝ = 0

Next tactic:
refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ ((LinearMap.compr₂ (TensorProduct.mk R ↑W✝ ↑Y✝) (0 ⊗ f✝)) x) y =
    ((LinearMap.compr₂ (TensorProduct.mk R ↑W✝ ↑Y✝) 0) x) y

Next tactic:
simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ (0 ⊗ f✝) (x ⊗ₜ[R] y) = 0 (x ⊗ₜ[R] y)

Next tactic:
rw [LinearMap.zero_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ (0 ⊗ f✝) (x ⊗ₜ[R] y) = 0

Next tactic:
erw [MonoidalCategory.hom_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    

Proof state:
case refine'_2
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ 0 x ⊗ₜ[R] f✝ y = 0

Next tactic:
rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · 

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
⊢ ∀ {W X Y Z : ModuleCat R} (f : W ⟶ X) (g h : Y ⟶ Z), f ⊗ (g + h) = f ⊗ g + f ⊗ h

Next tactic:
dsimp only [autoParam]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; 

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
⊢ ∀ {W X Y Z : ModuleCat R} (f : W ⟶ X) (g h : Y ⟶ Z), f ⊗ (g + h) = f ⊗ g + f ⊗ h

Next tactic:
intros
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; intros
    

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
g✝ h✝ : Y✝ ⟶ Z✝
⊢ f✝ ⊗ (g✝ + h✝) = f✝ ⊗ g✝ + f✝ ⊗ h✝

Next tactic:
refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
g✝ h✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ ((LinearMap.compr₂ (TensorProduct.mk R ↑W✝ ↑Y✝) (f✝ ⊗ (g✝ + h✝))) x) y =
    ((LinearMap.compr₂ (TensorProduct.mk R ↑W✝ ↑Y✝) (f✝ ⊗ g✝ + f✝ ⊗ h✝)) x) y

Next tactic:
simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
g✝ h✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ (f✝ ⊗ (g✝ + h✝)) (x ⊗ₜ[R] y) = (f✝ ⊗ g✝ + f✝ ⊗ h✝) (x ⊗ₜ[R] y)

Next tactic:
rw [LinearMap.add_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.add_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
g✝ h✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ (f✝ ⊗ (g✝ + h✝)) (x ⊗ₜ[R] y) = (f✝ ⊗ g✝) (x ⊗ₜ[R] y) + (f✝ ⊗ h✝) (x ⊗ₜ[R] y)

Next tactic:
erw [MonoidalCategory.hom_apply, MonoidalCategory.hom_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.add_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply, MonoidalCategory.hom_apply]
    

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
g✝ h✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ f✝ x ⊗ₜ[R] (g✝ + h✝) y = f✝ x ⊗ₜ[R] g✝ y + (f✝ ⊗ h✝) (x ⊗ₜ[R] y)

Next tactic:
erw [MonoidalCategory.hom_apply]
instance : MonoidalPreadditive (ModuleCat.{u} R) := by
  refine' ⟨_, _, _, _⟩
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.tmul_zero]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.zero_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply]
    rw [LinearMap.zero_apply, TensorProduct.zero_tmul]
  · dsimp only [autoParam]; intros
    refine' TensorProduct.ext (LinearMap.ext fun x => LinearMap.ext fun y => _)
    simp only [LinearMap.compr₂_apply, TensorProduct.mk_apply]
    rw [LinearMap.add_apply]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [MonoidalCategory.hom_apply, MonoidalCategory.hom_apply]
    erw [MonoidalCategory.hom_apply]
    

Proof state:
case refine'_3
R : Type u
inst✝ : CommRing R
W✝ X✝ Y✝ Z✝ : ModuleCat R
f✝ : W✝ ⟶ X✝
g✝ h✝ : Y✝ ⟶ Z✝
x : ↑W✝
y : ↑Y✝
⊢ f✝ x ⊗ₜ[R] (g✝ + h✝) y = f✝ x ⊗ₜ[R] g✝ y + f✝ x ⊗ₜ[R] h✝ y

Next tactic:
rw [LinearMap.add_apply, TensorProduct.tmul_add]