l3lab/ntp-mathlib huggingface dataset:
/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f := by
  let A : MulAction G H := MulAction.compHom _ f
  

Proof state:
G : Type u_1
X : Type u_2
inst✝¹⁴ : TopologicalSpace G
inst✝¹³ : TopologicalSpace X
inst✝¹² : Group G
inst✝¹¹ : TopologicalGroup G
inst✝¹⁰ : MulAction G X
inst✝⁹ : SigmaCompactSpace G
inst✝⁸ : BaireSpace X
inst✝⁷ : T2Space X
inst✝⁶ : ContinuousSMul G X
inst✝⁵ : IsPretransitive G X
H : Type u_3
inst✝⁴ : Group H
inst✝³ : TopologicalSpace H
inst✝² : BaireSpace H
inst✝¹ : T2Space H
inst✝ : ContinuousMul H
f : G →* H
hf : Surjective ⇑f
h'f : Continuous ⇑f
A : MulAction G H := MulAction.compHom H f
⊢ IsOpenMap ⇑f

Next tactic:
have : ContinuousSMul G H := continuousSMul_compHom h'f
/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f := by
  let A : MulAction G H := MulAction.compHom _ f
  have : ContinuousSMul G H := continuousSMul_compHom h'f
  

Proof state:
G : Type u_1
X : Type u_2
inst✝¹⁴ : TopologicalSpace G
inst✝¹³ : TopologicalSpace X
inst✝¹² : Group G
inst✝¹¹ : TopologicalGroup G
inst✝¹⁰ : MulAction G X
inst✝⁹ : SigmaCompactSpace G
inst✝⁸ : BaireSpace X
inst✝⁷ : T2Space X
inst✝⁶ : ContinuousSMul G X
inst✝⁵ : IsPretransitive G X
H : Type u_3
inst✝⁴ : Group H
inst✝³ : TopologicalSpace H
inst✝² : BaireSpace H
inst✝¹ : T2Space H
inst✝ : ContinuousMul H
f : G →* H
hf : Surjective ⇑f
h'f : Continuous ⇑f
A : MulAction G H := MulAction.compHom H f
this : ContinuousSMul G H
⊢ IsOpenMap ⇑f

Next tactic:
have : IsPretransitive G H := isPretransitive_compHom hf
/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f := by
  let A : MulAction G H := MulAction.compHom _ f
  have : ContinuousSMul G H := continuousSMul_compHom h'f
  have : IsPretransitive G H := isPretransitive_compHom hf
  

Proof state:
G : Type u_1
X : Type u_2
inst✝¹⁴ : TopologicalSpace G
inst✝¹³ : TopologicalSpace X
inst✝¹² : Group G
inst✝¹¹ : TopologicalGroup G
inst✝¹⁰ : MulAction G X
inst✝⁹ : SigmaCompactSpace G
inst✝⁸ : BaireSpace X
inst✝⁷ : T2Space X
inst✝⁶ : ContinuousSMul G X
inst✝⁵ : IsPretransitive G X
H : Type u_3
inst✝⁴ : Group H
inst✝³ : TopologicalSpace H
inst✝² : BaireSpace H
inst✝¹ : T2Space H
inst✝ : ContinuousMul H
f : G →* H
hf : Surjective ⇑f
h'f : Continuous ⇑f
A : MulAction G H := MulAction.compHom H f
this✝ : ContinuousSMul G H
this : IsPretransitive G H
⊢ IsOpenMap ⇑f

Next tactic:
have : f = (fun (g : G) ↦ g • (1 : H)) := by simp [MulAction.compHom_smul_def]
/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f := by
  let A : MulAction G H := MulAction.compHom _ f
  have : ContinuousSMul G H := continuousSMul_compHom h'f
  have : IsPretransitive G H := isPretransitive_compHom hf
  have : f = (fun (g : G) ↦ g • (1 : H)) := by 

Proof state:
G : Type u_1
X : Type u_2
inst✝¹⁴ : TopologicalSpace G
inst✝¹³ : TopologicalSpace X
inst✝¹² : Group G
inst✝¹¹ : TopologicalGroup G
inst✝¹⁰ : MulAction G X
inst✝⁹ : SigmaCompactSpace G
inst✝⁸ : BaireSpace X
inst✝⁷ : T2Space X
inst✝⁶ : ContinuousSMul G X
inst✝⁵ : IsPretransitive G X
H : Type u_3
inst✝⁴ : Group H
inst✝³ : TopologicalSpace H
inst✝² : BaireSpace H
inst✝¹ : T2Space H
inst✝ : ContinuousMul H
f : G →* H
hf : Surjective ⇑f
h'f : Continuous ⇑f
A : MulAction G H := MulAction.compHom H f
this✝ : ContinuousSMul G H
this : IsPretransitive G H
⊢ ⇑f = fun g => g • 1

Next tactic:
simp [MulAction.compHom_smul_def]
/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f := by
  let A : MulAction G H := MulAction.compHom _ f
  have : ContinuousSMul G H := continuousSMul_compHom h'f
  have : IsPretransitive G H := isPretransitive_compHom hf
  have : f = (fun (g : G) ↦ g • (1 : H)) := by simp [MulAction.compHom_smul_def]
  

Proof state:
G : Type u_1
X : Type u_2
inst✝¹⁴ : TopologicalSpace G
inst✝¹³ : TopologicalSpace X
inst✝¹² : Group G
inst✝¹¹ : TopologicalGroup G
inst✝¹⁰ : MulAction G X
inst✝⁹ : SigmaCompactSpace G
inst✝⁸ : BaireSpace X
inst✝⁷ : T2Space X
inst✝⁶ : ContinuousSMul G X
inst✝⁵ : IsPretransitive G X
H : Type u_3
inst✝⁴ : Group H
inst✝³ : TopologicalSpace H
inst✝² : BaireSpace H
inst✝¹ : T2Space H
inst✝ : ContinuousMul H
f : G →* H
hf : Surjective ⇑f
h'f : Continuous ⇑f
A : MulAction G H := MulAction.compHom H f
this✝¹ : ContinuousSMul G H
this✝ : IsPretransitive G H
this : ⇑f = fun g => g • 1
⊢ IsOpenMap ⇑f

Next tactic:
rw [this]
/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f := by
  let A : MulAction G H := MulAction.compHom _ f
  have : ContinuousSMul G H := continuousSMul_compHom h'f
  have : IsPretransitive G H := isPretransitive_compHom hf
  have : f = (fun (g : G) ↦ g • (1 : H)) := by simp [MulAction.compHom_smul_def]
  rw [this]
  

Proof state:
G : Type u_1
X : Type u_2
inst✝¹⁴ : TopologicalSpace G
inst✝¹³ : TopologicalSpace X
inst✝¹² : Group G
inst✝¹¹ : TopologicalGroup G
inst✝¹⁰ : MulAction G X
inst✝⁹ : SigmaCompactSpace G
inst✝⁸ : BaireSpace X
inst✝⁷ : T2Space X
inst✝⁶ : ContinuousSMul G X
inst✝⁵ : IsPretransitive G X
H : Type u_3
inst✝⁴ : Group H
inst✝³ : TopologicalSpace H
inst✝² : BaireSpace H
inst✝¹ : T2Space H
inst✝ : ContinuousMul H
f : G →* H
hf : Surjective ⇑f
h'f : Continuous ⇑f
A : MulAction G H := MulAction.compHom H f
this✝¹ : ContinuousSMul G H
this✝ : IsPretransitive G H
this : ⇑f = fun g => g • 1
⊢ IsOpenMap fun g => g • 1

Next tactic:
exact isOpenMap_smul_of_sigmaCompact _
/-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R where
  obj X := ModuleCat.of R (X →₀ R)
  map {X Y} f := Finsupp.lmapDomain _ _ f
  map_id := by 

Proof state:
R : Type u
inst✝ : Ring R
⊢ ∀ (X : Type u),
    { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (𝟙 X) =
      𝟙 ({ obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.obj X)

Next tactic:
intros
/-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R where
  obj X := ModuleCat.of R (X →₀ R)
  map {X Y} f := Finsupp.lmapDomain _ _ f
  map_id := by intros; 

Proof state:
R : Type u
inst✝ : Ring R
X✝ : Type u
⊢ { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (𝟙 X✝) =
    𝟙 ({ obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.obj X✝)

Next tactic:
exact Finsupp.lmapDomain_id _ _
/-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R where
  obj X := ModuleCat.of R (X →₀ R)
  map {X Y} f := Finsupp.lmapDomain _ _ f
  map_id := by intros; exact Finsupp.lmapDomain_id _ _
  map_comp := by 

Proof state:
R : Type u
inst✝ : Ring R
⊢ ∀ {X Y Z : Type u} (f : X ⟶ Y) (g : Y ⟶ Z),
    { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (f ≫ g) =
      { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map f ≫
        { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map g

Next tactic:
intros
/-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R where
  obj X := ModuleCat.of R (X →₀ R)
  map {X Y} f := Finsupp.lmapDomain _ _ f
  map_id := by intros; exact Finsupp.lmapDomain_id _ _
  map_comp := by intros; 

Proof state:
R : Type u
inst✝ : Ring R
X✝ Y✝ Z✝ : Type u
f✝ : X✝ ⟶ Y✝
g✝ : Y✝ ⟶ Z✝
⊢ { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (f✝ ≫ g✝) =
    { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map f✝ ≫
      { obj := fun X => of R (X →₀ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map g✝

Next tactic:
exact Finsupp.lmapDomain_comp _ _ _ _
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  

Proof state:
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
⊢ ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g)

Next tactic:
intros
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  

Proof state:
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
⊢ ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g)

Next tactic:
apply TensorProduct.ext
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
⊢ LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
      (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) =
    LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X')) ((μ R X X').hom ≫ (free R).map (f ⊗ g))

Next tactic:
apply Finsupp.lhom_ext'
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  

Proof state:
case H.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
⊢ ∀ (a : X),
    LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
          (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
        Finsupp.lsingle a =
      LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
          ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
        Finsupp.lsingle a

Next tactic:
intro x
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  

Proof state:
case H.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
⊢ LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
        (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
      Finsupp.lsingle x =
    LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
        ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
      Finsupp.lsingle x

Next tactic:
apply LinearMap.ext_ring
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  

Proof state:
case H.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
⊢ (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
          (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
        Finsupp.lsingle x)
      1 =
    (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
          ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
        Finsupp.lsingle x)
      1

Next tactic:
apply Finsupp.lhom_ext'
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  

Proof state:
case H.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
⊢ ∀ (a : X'),
    (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
              (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
            Finsupp.lsingle x)
          1 ∘ₗ
        Finsupp.lsingle a =
      (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
              ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
            Finsupp.lsingle x)
          1 ∘ₗ
        Finsupp.lsingle a

Next tactic:
intro x'
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  intro x'
  

Proof state:
case H.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
x' : X'
⊢ (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
            (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
          Finsupp.lsingle x)
        1 ∘ₗ
      Finsupp.lsingle x' =
    (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
            ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
          Finsupp.lsingle x)
        1 ∘ₗ
      Finsupp.lsingle x'

Next tactic:
apply LinearMap.ext_ring
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  intro x'
  apply LinearMap.ext_ring
  

Proof state:
case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
x' : X'
⊢ ((LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
              (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
            Finsupp.lsingle x)
          1 ∘ₗ
        Finsupp.lsingle x')
      1 =
    ((LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
              ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
            Finsupp.lsingle x)
          1 ∘ₗ
        Finsupp.lsingle x')
      1

Next tactic:
apply Finsupp.ext
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  intro x'
  apply LinearMap.ext_ring
  apply Finsupp.ext
  

Proof state:
case H.h.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
x' : X'
⊢ ∀ (a : Y ⊗ Y'),
    (((LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
                  (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
                Finsupp.lsingle x)
              1 ∘ₗ
            Finsupp.lsingle x')
          1)
        a =
      (((LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
                  ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
                Finsupp.lsingle x)
              1 ∘ₗ
            Finsupp.lsingle x')
          1)
        a

Next tactic:
intro ⟨y, y'⟩
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  intro x'
  apply LinearMap.ext_ring
  apply Finsupp.ext
  intro ⟨y, y'⟩
  -- Porting note: used to be dsimp [μ]
  

Proof state:
case H.h.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
x' : X'
y : Y
y' : Y'
⊢ (((LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
                (((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom) ∘ₗ
              Finsupp.lsingle x)
            1 ∘ₗ
          Finsupp.lsingle x')
        1)
      (y, y') =
    (((LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj X'))
                ((μ R X X').hom ≫ (free R).map (f ⊗ g)) ∘ₗ
              Finsupp.lsingle x)
            1 ∘ₗ
          Finsupp.lsingle x')
        1)
      (y, y')

Next tactic:
change (finsuppTensorFinsupp' R Y Y')
    (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
    = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
    (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1))) _
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  intro x'
  apply LinearMap.ext_ring
  apply Finsupp.ext
  intro ⟨y, y'⟩
  -- Porting note: used to be dsimp [μ]
  change (finsuppTensorFinsupp' R Y Y')
    (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
    = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
    (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1))) _

  -- extra `rfl` after leanprover/lean4#2466
  

Proof state:
case H.h.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
x' : X'
y : Y
y' : Y'
⊢ ((finsuppTensorFinsupp' R Y Y') ((Finsupp.mapDomain f fun₀ | x => 1) ⊗ₜ[R] Finsupp.mapDomain g fun₀ | x' => 1))
      (y, y') =
    (Finsupp.mapDomain (f ⊗ g) ((finsuppTensorFinsupp' R X X') ((fun₀ | x => 1) ⊗ₜ[R] fun₀ | x' => 1))) (y, y')

Next tactic:
simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]
theorem μ_natural {X Y X' Y' : Type u} (f : X ⟶ Y) (g : X' ⟶ Y') :
    ((free R).map f ⊗ (free R).map g) ≫ (μ R Y Y').hom = (μ R X X').hom ≫ (free R).map (f ⊗ g) := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply Finsupp.lhom_ext'
  intro x
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  intro x'
  apply LinearMap.ext_ring
  apply Finsupp.ext
  intro ⟨y, y'⟩
  -- Porting note: used to be dsimp [μ]
  change (finsuppTensorFinsupp' R Y Y')
    (Finsupp.mapDomain f (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _
    = (Finsupp.mapDomain (f ⊗ g) (finsuppTensorFinsupp' R X X'
    (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1))) _

  -- extra `rfl` after leanprover/lean4#2466
  simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one,
    Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; 

Proof state:
case H.h.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
x' : X'
y : Y
y' : Y'
⊢ (fun₀ | (f x, g x') => 1) (y, y') = (fun₀ | (f x, g x') => 1) (y, y')

Next tactic:
rfl
theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
  

Proof state:
R : Type u
inst✝ : CommRing R
X : Type u
⊢ (λ_ ((free R).obj X)).hom =
    (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom

Next tactic:
intros
theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
  intros
  -- Porting note: broken ext
  

Proof state:
R : Type u
inst✝ : CommRing R
X : Type u
⊢ (λ_ ((free R).obj X)).hom =
    (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom

Next tactic:
apply TensorProduct.ext
theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  

Proof state:
case H
R : Type u
inst✝ : CommRing R
X : Type u
⊢ LinearMap.compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑((free R).obj X)) (λ_ ((free R).obj X)).hom =
    LinearMap.compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑((free R).obj X))
      ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom)

Next tactic:
apply LinearMap.ext_ring
theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply LinearMap.ext_ring
  

Proof state:
case H.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ (LinearMap.compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1 =
    (LinearMap.compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑((free R).obj X))
        ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
      1

Next tactic:
apply Finsupp.lhom_ext'
theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom := by
  intros
  -- Porting note: broken ext
  apply TensorProduct.ext
  apply LinearMap.ext_ring
  apply Finsupp.lhom_ext'
  

Proof state:
case H.h.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ ∀ (a : X),
    (LinearMap.compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1 ∘ₗ
        Finsupp.lsingle a =
      (LinearMap.compr₂ (TensorProduct.mk R ↑(𝟙_ (ModuleCat R)) ↑((free R).obj X))
            ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
          1 ∘ₗ
        Finsupp.lsingle a

Next tactic:
intro x