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

tactic: intros
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).toPrefunctor.obj (ρ_ X).hom

tactic: apply TensorProduct.ext
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).toPrefunctor.obj (ρ_ X).hom

tactic: apply Finsupp.lhom_ext'
state_before: case H
R : Type u
inst✝ : CommRing R
X : Type u
⊢ LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom =
    LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
      ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom)

tactic: intro x
state_before: case H.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ ∀ (a : X),
    LinearMap.comp (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
        (Finsupp.lsingle a) =
      LinearMap.comp
        (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
          ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
        (Finsupp.lsingle a)

tactic: apply LinearMap.ext_ring
state_before: case H.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ LinearMap.comp (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
      (Finsupp.lsingle x) =
    LinearMap.comp
      (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
        ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
      (Finsupp.lsingle x)

tactic: apply LinearMap.ext_ring
state_before: case H.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ↑(LinearMap.comp (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
          (Finsupp.lsingle x))
      1 =
    ↑(LinearMap.comp
          (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
            ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
          (Finsupp.lsingle x))
      1

tactic: apply Finsupp.ext
state_before: case H.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ↑(↑(LinearMap.comp (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
              (Finsupp.lsingle x))
          1)
      1 =
    ↑(↑(LinearMap.comp
              (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
                ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
              (Finsupp.lsingle x))
          1)
      1

tactic: intro x'
state_before: case H.h.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ∀ (a : X),
    ↑(↑(↑(LinearMap.comp
                    (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
                    (Finsupp.lsingle x))
                1)
            1)
        a =
      ↑(↑(↑(LinearMap.comp
                    (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
                      ((𝟙 ((free R).obj X) ⊗ ε R) ≫
                        (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
                    (Finsupp.lsingle x))
                1)
            1)
        a

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
⊢ ↑(↑(↑(LinearMap.comp (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
                  (Finsupp.lsingle x))
              1)
          1)
      x' =
    ↑(↑(↑(LinearMap.comp
                  (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
                    ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
                  (Finsupp.lsingle x))
              1)
          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)
⊢ ↑(↑(↑(LinearMap.comp (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit') (ρ_ ((free R).obj X)).hom)
                  (Finsupp.lsingle x))
              1)
          1)
      x' =
    ↑(↑(↑(LinearMap.comp
                  (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑tensorUnit')
                    ((𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).toPrefunctor.obj (ρ_ X).hom))
                  (Finsupp.lsingle x))
              1)
          1)
      x'

tactic: simp_rw [finsuppTensorFinsupp'_single_tmul_single,
  ModuleCat.MonoidalCategory.rightUnitor_hom_apply, Finsupp.smul_single', mul_one,
  Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply, one_smul]
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'