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

tactic: intros
state_before: R : Type u
inst✝ : CommRing R
X Y Z : Type u
⊢ ((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).hom ≫ map (free R).toPrefunctor.obj (α_ X Y Z).hom =
    (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
      (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom

tactic: apply TensorProduct.ext
state_before: R : Type u
inst✝ : CommRing R
X Y Z : Type u
⊢ ((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).hom ≫ map (free R).toPrefunctor.obj (α_ X Y Z).hom =
    (α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
      (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom

tactic: apply TensorProduct.ext
state_before: case H
R : Type u
inst✝ : CommRing R
X Y Z : Type u
⊢ LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X ⊗ (free R).obj Y) ↑((free R).obj Z))
      (((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫ (μ R (X ⊗ Y) Z).hom ≫ map (free R).toPrefunctor.obj (α_ X Y Z).hom) =
    LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X ⊗ (free R).obj Y) ↑((free R).obj Z))
      ((α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
        (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom)

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

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

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

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

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

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

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

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

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

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

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

tactic: change Finsupp.mapDomain (α_ X Y Z).hom (finsuppTensorFinsupp' R (X ⊗ Y) Z
  (finsuppTensorFinsupp' R X Y
  (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single y 1) ⊗ₜ[R] Finsupp.single z 1)) a =
  finsuppTensorFinsupp' R X (Y ⊗ Z)
  (Finsupp.single x 1 ⊗ₜ[R]
    finsuppTensorFinsupp' R Y Z (Finsupp.single y 1 ⊗ₜ[R] Finsupp.single z 1)) a
state_before: case H.H.h.h.h.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y Z : Type u
x : X
y : Y
z : Z
a : X ⊗ Y ⊗ Z
⊢ ↑(↑(LinearMap.comp
              (↑(LinearMap.comp
                    (↑(LinearMap.comp
                          (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj Y))
                            (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X ⊗ (free R).obj Y) ↑((free R).obj Z))
                              (((μ R X Y).hom ⊗ 𝟙 ((free R).obj Z)) ≫
                                (μ R (X ⊗ Y) Z).hom ≫ map (free R).toPrefunctor.obj (α_ X Y Z).hom)))
                          (Finsupp.lsingle x))
                      1)
                    (Finsupp.lsingle y))
                1)
              (Finsupp.lsingle z))
          1)
      a =
    ↑(↑(LinearMap.comp
              (↑(LinearMap.comp
                    (↑(LinearMap.comp
                          (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X) ↑((free R).obj Y))
                            (LinearMap.compr₂ (TensorProduct.mk R ↑((free R).obj X ⊗ (free R).obj Y) ↑((free R).obj Z))
                              ((α_ ((free R).obj X) ((free R).obj Y) ((free R).obj Z)).hom ≫
                                (𝟙 ((free R).obj X) ⊗ (μ R Y Z).hom) ≫ (μ R X (Y ⊗ Z)).hom)))
                          (Finsupp.lsingle x))
                      1)
                    (Finsupp.lsingle y))
                1)
              (Finsupp.lsingle z))
          1)
      a

tactic: simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
  CategoryTheory.associator_hom_apply]
state_before: case H.H.h.h.h.h.h.h.h
R : Type u
inst✝ : CommRing R
X Y Z : Type u
x : X
y : Y
z : Z
a : X ⊗ Y ⊗ Z
⊢ ↑(Finsupp.mapDomain (α_ X Y Z).hom
          (↑(finsuppTensorFinsupp' R (X ⊗ Y) Z)
            (↑(finsuppTensorFinsupp' R X Y) (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single y 1) ⊗ₜ[R] Finsupp.single z 1)))
      a =
    ↑(↑(finsuppTensorFinsupp' R X (Y ⊗ Z))
          (Finsupp.single x 1 ⊗ₜ[R] ↑(finsuppTensorFinsupp' R Y Z) (Finsupp.single y 1 ⊗ₜ[R] Finsupp.single z 1)))
      a