Theorem: ModuleCat.Free.right_unitality
File: Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean

Proof steps:
state_before: R : Type u
inst✝ : CommRing R
X : Type u
⊢ (ρ_ ((free R).obj X)).hom = (𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom
state_after: case H
R : Type u
inst✝ : CommRing R
X : Type u
⊢ (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom =
    (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
      ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom)
tactic: apply TensorProduct.ext
state_before: case H
R : Type u
inst✝ : CommRing R
X : Type u
⊢ (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom =
    (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
      ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom)
state_after: case H.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ ∀ (a : X),
    (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle a =
      (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
          ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
        Finsupp.lsingle a
tactic: apply Finsupp.lhom_ext'
state_before: case H.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ ∀ (a : X),
    (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle a =
      (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
          ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
        Finsupp.lsingle a
state_after: case H.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x =
    (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
        ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
      Finsupp.lsingle x
tactic: intro x
state_before: case H.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x =
    (TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
        ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
      Finsupp.lsingle x
state_after: case H.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x) 1 =
    ((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
          ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
        Finsupp.lsingle x)
      1
tactic: apply LinearMap.ext_ring
state_before: case H.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x) 1 =
    ((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
          ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
        Finsupp.lsingle x)
      1
state_after: case H.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ (((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x) 1)
      1 =
    (((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
            ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
          Finsupp.lsingle x)
        1)
      1
tactic: apply LinearMap.ext_ring
state_before: case H.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ (((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x) 1)
      1 =
    (((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
            ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
          Finsupp.lsingle x)
        1)
      1
state_after: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ∀ (a : X),
    ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x)
            1)
          1)
        a =
      ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
                ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
              Finsupp.lsingle x)
            1)
          1)
        a
tactic: apply Finsupp.ext
state_before: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ∀ (a : X),
    ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x)
            1)
          1)
        a =
      ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
                ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
              Finsupp.lsingle x)
            1)
          1)
        a
state_after: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x x' : X
⊢ ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x)
          1)
        1)
      x' =
    ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
              ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
            Finsupp.lsingle x)
          1)
        1)
      x'
tactic: intro x'
state_before: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x x' : X
⊢ ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x)
          1)
        1)
      x' =
    ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
              ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
            Finsupp.lsingle x)
          1)
        1)
      x'
state_after: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x x' : X
q : X →₀ R := (ρ_ (of R (X →₀ R))).hom (Finsupp.single x 1 ⊗ₜ[R] 1)
⊢ ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x)
          1)
        1)
      x' =
    ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
              ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
            Finsupp.lsingle x)
          1)
        1)
      x'
tactic: let q : X →₀ R := ((ρ_ (of R (X →₀ R))).hom) (Finsupp.single x 1 ⊗ₜ[R] 1)
state_before: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x x' : X
q : X →₀ R := (ρ_ (of R (X →₀ R))).hom (Finsupp.single x 1 ⊗ₜ[R] 1)
⊢ ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂ (ρ_ ((free R).obj X)).hom ∘ₗ Finsupp.lsingle x)
          1)
        1)
      x' =
    ((((TensorProduct.mk R ↑((free R).obj X) ↑(𝟙_ (ModuleCat R))).compr₂
              ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom) ∘ₗ
            Finsupp.lsingle x)
          1)
        1)
      x'
state_after: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x x' : X
q : X →₀ R := (ρ_ (of R (X →₀ R))).hom (Finsupp.single x 1 ⊗ₜ[R] 1)
⊢ q x' =
    (Finsupp.mapDomain (ρ_ X).hom
        ((finsuppTensorFinsupp' R X (𝟙_ (Type u))) (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)))
      x'
tactic: change q x' = Finsupp.mapDomain (ρ_ X).hom (finsuppTensorFinsupp' R X (𝟙_ (Type u))
    (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)) x'
state_before: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x x' : X
q : X →₀ R := (ρ_ (of R (X →₀ R))).hom (Finsupp.single x 1 ⊗ₜ[R] 1)
⊢ q x' =
    (Finsupp.mapDomain (ρ_ X).hom
        ((finsuppTensorFinsupp' R X (𝟙_ (Type u))) (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)))
      x'
state_after: no goals
tactic: simp_rw [q, finsuppTensorFinsupp'_single_tmul_single,
    ModuleCat.MonoidalCategory.rightUnitor_hom_apply, mul_one,
    Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply, one_smul]