[GOAL]
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)
[PROOFSTEP]
intros
[GOAL]
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✝)
[PROOFSTEP]
exact Finsupp.lmapDomain_id _ _
[GOAL]
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
[PROOFSTEP]
intros
[GOAL]
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✝
[PROOFSTEP]
exact Finsupp.lmapDomain_comp _ _ _ _
[GOAL]
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)
[PROOFSTEP]
intros
  -- Porting note: broken ext
[GOAL]
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)
[PROOFSTEP]
apply TensorProduct.ext
[GOAL]
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))
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
case H.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
⊢ ∀ (a : X),
    LinearMap.comp
        (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.comp
        (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)
[PROOFSTEP]
intro x
[GOAL]
case H.h
R : Type u
inst✝ : CommRing R
X Y X' Y' : Type u
f : X ⟶ Y
g : X' ⟶ Y'
x : X
⊢ LinearMap.comp
      (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.comp
      (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)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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.comp
          (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.comp
          (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
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
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.comp
        (↑(LinearMap.comp
              (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.comp
        (↑(LinearMap.comp
              (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)
[PROOFSTEP]
intro x'
[GOAL]
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.comp
      (↑(LinearMap.comp
            (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.comp
      (↑(LinearMap.comp
            (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')
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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.comp
          (↑(LinearMap.comp
                (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.comp
          (↑(LinearMap.comp
                (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
[PROOFSTEP]
apply Finsupp.ext
[GOAL]
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.comp
                (↑(LinearMap.comp
                      (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.comp
                (↑(LinearMap.comp
                      (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
[PROOFSTEP]
intro
  ⟨y, y'⟩
    -- Porting note: used to be dsimp [μ]
[GOAL]
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.comp
              (↑(LinearMap.comp
                    (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.comp
              (↑(LinearMap.comp
                    (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')
[PROOFSTEP]
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))) _
[GOAL]
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 (Finsupp.single x 1) ⊗ₜ[R] Finsupp.mapDomain g (Finsupp.single x' 1)))
      (y, y') =
    ↑(Finsupp.mapDomain (f ⊗ g) (↑(finsuppTensorFinsupp' R X X') (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single x' 1)))
      (y, y')
[PROOFSTEP]
simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one, Finsupp.mapDomain_single,
  CategoryTheory.tensor_apply]
[GOAL]
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
[PROOFSTEP]
intros
  -- Porting note: broken ext
[GOAL]
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
[PROOFSTEP]
apply TensorProduct.ext
[GOAL]
case H
R : Type u
inst✝ : CommRing R
X : Type u
⊢ LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom =
    LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
      ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
case H.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ ↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1 =
    ↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
          ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
      1
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
case H.h.h
R : Type u
inst✝ : CommRing R
X : Type u
⊢ ∀ (a : X),
    LinearMap.comp (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1)
        (Finsupp.lsingle a) =
      LinearMap.comp
        (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((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)
[PROOFSTEP]
intro x
[GOAL]
case H.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ LinearMap.comp (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1)
      (Finsupp.lsingle x) =
    LinearMap.comp
      (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
            ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
        1)
      (Finsupp.lsingle x)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
case H.h.h.h
R : Type u
inst✝ : CommRing R
X : Type u
x : X
⊢ ↑(LinearMap.comp (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1)
          (Finsupp.lsingle x))
      1 =
    ↑(LinearMap.comp
          (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
                ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
            1)
          (Finsupp.lsingle x))
      1
[PROOFSTEP]
apply Finsupp.ext
[GOAL]
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 ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1)
                (Finsupp.lsingle x))
            1)
        a =
      ↑(↑(LinearMap.comp
                (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
                      ((ε R ⊗ 𝟙 ((free R).obj X)) ≫
                        (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
                  1)
                (Finsupp.lsingle x))
            1)
        a
[PROOFSTEP]
intro x'
[GOAL]
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 ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1)
              (Finsupp.lsingle x))
          1)
      x' =
    ↑(↑(LinearMap.comp
              (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
                    ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
                1)
              (Finsupp.lsingle x))
          1)
      x'
[PROOFSTEP]
let q : X →₀ R := ((λ_ (of R (X →₀ R))).hom) (1 ⊗ₜ[R] Finsupp.single x 1)
[GOAL]
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 (1 ⊗ₜ[R] Finsupp.single x 1)
⊢ ↑(↑(LinearMap.comp
              (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X)) (λ_ ((free R).obj X)).hom) 1)
              (Finsupp.lsingle x))
          1)
      x' =
    ↑(↑(LinearMap.comp
              (↑(LinearMap.compr₂ (TensorProduct.mk R ↑tensorUnit' ↑((free R).obj X))
                    ((ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).toPrefunctor.obj (λ_ X).hom))
                1)
              (Finsupp.lsingle x))
          1)
      x'
[PROOFSTEP]
change
  q x' =
    Finsupp.mapDomain (λ_ X).hom
      (finsuppTensorFinsupp' R (𝟙_ (Type u)) X (Finsupp.single PUnit.unit 1 ⊗ₜ[R] Finsupp.single x 1)) x'
[GOAL]
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 (1 ⊗ₜ[R] Finsupp.single x 1)
⊢ ↑q x' =
    ↑(Finsupp.mapDomain (λ_ X).hom
          (↑(finsuppTensorFinsupp' R (𝟙_ (Type u)) X) (Finsupp.single PUnit.unit 1 ⊗ₜ[R] Finsupp.single x 1)))
      x'
[PROOFSTEP]
simp_rw [finsuppTensorFinsupp'_single_tmul_single, ModuleCat.MonoidalCategory.leftUnitor_hom_apply, mul_one,
  Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply, one_smul]
[GOAL]
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
[PROOFSTEP]
intros
  -- Porting note: broken ext
[GOAL]
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
[PROOFSTEP]
apply TensorProduct.ext
[GOAL]
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)
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
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)
[PROOFSTEP]
intro x
[GOAL]
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)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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
[PROOFSTEP]
apply Finsupp.ext
[GOAL]
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
[PROOFSTEP]
intro x'
[GOAL]
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'
[PROOFSTEP]
let q : X →₀ R := ((ρ_ (of R (X →₀ R))).hom) (Finsupp.single x 1 ⊗ₜ[R] 1)
[GOAL]
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'
[PROOFSTEP]
change
  q x' =
    Finsupp.mapDomain (ρ_ X).hom
      (finsuppTensorFinsupp' R X (𝟙_ (Type u)) (Finsupp.single x 1 ⊗ₜ[R] Finsupp.single PUnit.unit 1)) x'
[GOAL]
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'
[PROOFSTEP]
simp_rw [finsuppTensorFinsupp'_single_tmul_single, ModuleCat.MonoidalCategory.rightUnitor_hom_apply, mul_one,
  Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply, one_smul]
[GOAL]
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
[PROOFSTEP]
intros
  -- Porting note: broken ext
[GOAL]
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
[PROOFSTEP]
apply TensorProduct.ext
[GOAL]
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)
[PROOFSTEP]
apply TensorProduct.ext
[GOAL]
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))
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
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)
[PROOFSTEP]
intro x
[GOAL]
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)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
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)
[PROOFSTEP]
intro y
[GOAL]
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)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
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)
[PROOFSTEP]
intro z
[GOAL]
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)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
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
[PROOFSTEP]
apply Finsupp.ext
[GOAL]
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
[PROOFSTEP]
intro a
[GOAL]
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
[PROOFSTEP]
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
[GOAL]
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
[PROOFSTEP]
simp_rw [finsuppTensorFinsupp'_single_tmul_single, Finsupp.mapDomain_single, mul_one,
  CategoryTheory.associator_hom_apply]
[GOAL]
R : Type u
inst✝ : CommRing R
⊢ IsIso LaxMonoidal.ε
[PROOFSTEP]
refine' ⟨⟨Finsupp.lapply PUnit.unit, ⟨_, _⟩⟩⟩
[GOAL]
case refine'_1
R : Type u
inst✝ : CommRing R
⊢ LaxMonoidal.ε ≫ Finsupp.lapply PUnit.unit = 𝟙 (𝟙_ (ModuleCat R))
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
case refine'_1.h
R : Type u
inst✝ : CommRing R
⊢ ↑(LaxMonoidal.ε ≫ Finsupp.lapply PUnit.unit) 1 = ↑(𝟙 (𝟙_ (ModuleCat R))) 1
[PROOFSTEP]
dsimp
[GOAL]
case refine'_1.h
R : Type u
inst✝ : CommRing R
⊢ ↑(ε R ≫ Finsupp.lapply PUnit.unit) 1 = ↑(𝟙 (𝟙_ (ModuleCat R))) 1
[PROOFSTEP]
erw [ModuleCat.comp_def, LinearMap.comp_apply, ε_apply, Finsupp.lapply_apply, Finsupp.single_eq_same, id_apply]
[GOAL]
case refine'_2
R : Type u
inst✝ : CommRing R
⊢ Finsupp.lapply PUnit.unit ≫ LaxMonoidal.ε = 𝟙 ((free R).obj (𝟙_ (Type u)))
[PROOFSTEP]
apply Finsupp.lhom_ext'
[GOAL]
case refine'_2.h
R : Type u
inst✝ : CommRing R
⊢ ∀ (a : 𝟙_ (Type u)),
    LinearMap.comp (Finsupp.lapply PUnit.unit ≫ LaxMonoidal.ε) (Finsupp.lsingle a) =
      LinearMap.comp (𝟙 ((free R).obj (𝟙_ (Type u)))) (Finsupp.lsingle a)
[PROOFSTEP]
intro ⟨⟩
[GOAL]
case refine'_2.h
R : Type u
inst✝ : CommRing R
⊢ LinearMap.comp (Finsupp.lapply PUnit.unit ≫ LaxMonoidal.ε) (Finsupp.lsingle PUnit.unit) =
    LinearMap.comp (𝟙 ((free R).obj (𝟙_ (Type u)))) (Finsupp.lsingle PUnit.unit)
[PROOFSTEP]
apply LinearMap.ext_ring
[GOAL]
case refine'_2.h.h
R : Type u
inst✝ : CommRing R
⊢ ↑(LinearMap.comp (Finsupp.lapply PUnit.unit ≫ LaxMonoidal.ε) (Finsupp.lsingle PUnit.unit)) 1 =
    ↑(LinearMap.comp (𝟙 ((free R).obj (𝟙_ (Type u)))) (Finsupp.lsingle PUnit.unit)) 1
[PROOFSTEP]
apply Finsupp.ext
[GOAL]
case refine'_2.h.h.h
R : Type u
inst✝ : CommRing R
⊢ ∀ (a : 𝟙_ (Type u)),
    ↑(↑(LinearMap.comp (Finsupp.lapply PUnit.unit ≫ LaxMonoidal.ε) (Finsupp.lsingle PUnit.unit)) 1) a =
      ↑(↑(LinearMap.comp (𝟙 ((free R).obj (𝟙_ (Type u)))) (Finsupp.lsingle PUnit.unit)) 1) a
[PROOFSTEP]
intro
  ⟨⟩
    -- Porting note: simp used to be able to close this goal
[GOAL]
case refine'_2.h.h.h
R : Type u
inst✝ : CommRing R
⊢ ↑(↑(LinearMap.comp (Finsupp.lapply PUnit.unit ≫ LaxMonoidal.ε) (Finsupp.lsingle PUnit.unit)) 1) PUnit.unit =
    ↑(↑(LinearMap.comp (𝟙 ((free R).obj (𝟙_ (Type u)))) (Finsupp.lsingle PUnit.unit)) 1) PUnit.unit
[PROOFSTEP]
dsimp
[GOAL]
case refine'_2.h.h.h
R : Type u
inst✝ : CommRing R
⊢ ↑(↑(Finsupp.lapply PUnit.unit ≫ ε R) (Finsupp.single PUnit.unit 1)) PUnit.unit =
    ↑(↑(𝟙 (of R (𝟙_ (Type u) →₀ R))) (Finsupp.single PUnit.unit 1)) PUnit.unit
[PROOFSTEP]
erw [ModuleCat.comp_def, LinearMap.comp_apply, ε_apply, Finsupp.lapply_apply, Finsupp.single_eq_same]
[GOAL]
R : Type u
inst✝ : CommRing R
src✝ : LaxMonoidalFunctor (Type u) (ModuleCat R) := LaxMonoidalFunctor.of (free R).toPrefunctor.obj
⊢ IsIso LaxMonoidal.ε
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u
inst✝ : CommRing R
src✝ : LaxMonoidalFunctor (Type u) (ModuleCat R) := LaxMonoidalFunctor.of (free R).toPrefunctor.obj
X Y : Type u
⊢ IsIso (LaxMonoidalFunctor.μ (LaxMonoidalFunctor.mk src✝.toFunctor src✝.ε src✝.μ) X Y)
[PROOFSTEP]
dsimp
[GOAL]
R : Type u
inst✝ : CommRing R
src✝ : LaxMonoidalFunctor (Type u) (ModuleCat R) := LaxMonoidalFunctor.of (free R).toPrefunctor.obj
X Y : Type u
⊢ IsIso (Free.μ R X Y).hom
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
W X Y Z : Free R C
f : W ⟶ X
g : X ⟶ Y
h : Y ⟶ Z
⊢ (f ≫ g) ≫ h = f ≫ g ≫ h
[PROOFSTEP]
dsimp
  -- This imitates the proof of associativity for `MonoidAlgebra`.
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
W X Y Z : Free R C
f : W ⟶ X
g : X ⟶ Y
h : Y ⟶ Z
⊢ (sum (sum f fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)) fun f' s =>
      sum h fun g' t => single (f' ≫ g') (s * t)) =
    sum f fun f' s =>
      sum (sum g fun f' s => sum h fun g' t => single (f' ≫ g') (s * t)) fun g' t => single (f' ≫ g') (s * t)
[PROOFSTEP]
simp only [sum_sum_index, sum_single_index, single_zero, single_add, eq_self_iff_true, forall_true_iff,
  forall₃_true_iff, add_mul, mul_add, Category.assoc, mul_assoc, zero_mul, mul_zero, sum_zero, sum_add]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f f' : X ⟶ Y
g : Y ⟶ Z
⊢ (f + f') ≫ g = f ≫ g + f' ≫ g
[PROOFSTEP]
dsimp [CategoryTheory.categoryFree]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f f' : X ⟶ Y
g : Y ⟶ Z
⊢ (sum (f + f') fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)) =
    (sum f fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)) +
      sum f' fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)
[PROOFSTEP]
rw [Finsupp.sum_add_index']
[GOAL]
case h_zero
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f f' : X ⟶ Y
g : Y ⟶ Z
⊢ ∀ (a : X ⟶ Y), (sum g fun g' t => single (a ≫ g') (0 * t)) = 0
[PROOFSTEP]
simp [add_mul]
[GOAL]
case h_add
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f f' : X ⟶ Y
g : Y ⟶ Z
⊢ ∀ (a : X ⟶ Y) (b₁ b₂ : R),
    (sum g fun g' t => single (a ≫ g') ((b₁ + b₂) * t)) =
      (sum g fun g' t => single (a ≫ g') (b₁ * t)) + sum g fun g' t => single (a ≫ g') (b₂ * t)
[PROOFSTEP]
simp [add_mul]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
⊢ f ≫ (g + g') = f ≫ g + f ≫ g'
[PROOFSTEP]
dsimp [CategoryTheory.categoryFree]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
⊢ (sum f fun f' s => sum (g + g') fun g' t => single (f' ≫ g') (s * t)) =
    (sum f fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)) +
      sum f fun f' s => sum g' fun g' t => single (f' ≫ g') (s * t)
[PROOFSTEP]
rw [← Finsupp.sum_add]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
⊢ (sum f fun f' s => sum (g + g') fun g' t => single (f' ≫ g') (s * t)) =
    sum f fun a b => (sum g fun g' t => single (a ≫ g') (b * t)) + sum g' fun g' t => single (a ≫ g') (b * t)
[PROOFSTEP]
congr
[GOAL]
case e_g
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
⊢ (fun f' s => sum (g + g') fun g' t => single (f' ≫ g') (s * t)) = fun a b =>
    (sum g fun g' t => single (a ≫ g') (b * t)) + sum g' fun g' t => single (a ≫ g') (b * t)
[PROOFSTEP]
ext r h
[GOAL]
case e_g.h.h.h
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
r : X ⟶ Y
h : R
a✝ : X ⟶ Z
⊢ ↑(sum (g + g') fun g' t => single (r ≫ g') (h * t)) a✝ =
    ↑((sum g fun g' t => single (r ≫ g') (h * t)) + sum g' fun g' t => single (r ≫ g') (h * t)) a✝
[PROOFSTEP]
rw [Finsupp.sum_add_index']
[GOAL]
case e_g.h.h.h.h_zero
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
r : X ⟶ Y
h : R
a✝ : X ⟶ Z
⊢ ∀ (a : Y ⟶ Z), single (r ≫ a) (h * 0) = 0
[PROOFSTEP]
simp [mul_add]
[GOAL]
case e_g.h.h.h.h_add
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
g g' : Y ⟶ Z
r : X ⟶ Y
h : R
a✝ : X ⟶ Z
⊢ ∀ (a : Y ⟶ Z) (b₁ b₂ : R), single (r ≫ a) (h * (b₁ + b₂)) = single (r ≫ a) (h * b₁) + single (r ≫ a) (h * b₂)
[PROOFSTEP]
simp [mul_add]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
r : R
f : X ⟶ Y
g : Y ⟶ Z
⊢ (r • f) ≫ g = r • f ≫ g
[PROOFSTEP]
dsimp [CategoryTheory.categoryFree]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
r : R
f : X ⟶ Y
g : Y ⟶ Z
⊢ (sum (r • f) fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)) =
    r • sum f fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)
[PROOFSTEP]
rw [Finsupp.sum_smul_index]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
r : R
f : X ⟶ Y
g : Y ⟶ Z
⊢ (sum f fun i a => sum g fun g' t => single (i ≫ g') (r * a * t)) =
    r • sum f fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)
[PROOFSTEP]
simp [Finsupp.smul_sum, mul_assoc]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
r : R
f : X ⟶ Y
g : Y ⟶ Z
⊢ ∀ (i : X ⟶ Y), (sum g fun g' t => single (i ≫ g') (0 * t)) = 0
[PROOFSTEP]
simp [Finsupp.smul_sum, mul_assoc]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
⊢ f ≫ (r • g) = r • f ≫ g
[PROOFSTEP]
dsimp [CategoryTheory.categoryFree]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
⊢ (sum f fun f' s => sum (r • g) fun g' t => single (f' ≫ g') (s * t)) =
    r • sum f fun f' s => sum g fun g' t => single (f' ≫ g') (s * t)
[PROOFSTEP]
simp_rw [Finsupp.smul_sum]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
⊢ (sum f fun f' s => sum (r • g) fun g' t => single (f' ≫ g') (s * t)) =
    sum f fun a b => sum g fun a_1 b_1 => r • single (a ≫ a_1) (b * b_1)
[PROOFSTEP]
congr
[GOAL]
case e_g
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
⊢ (fun f' s => sum (r • g) fun g' t => single (f' ≫ g') (s * t)) = fun a b =>
    sum g fun a_1 b_1 => r • single (a ≫ a_1) (b * b_1)
[PROOFSTEP]
ext h s
[GOAL]
case e_g.h.h.h
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
h : X ⟶ Y
s : R
a✝ : X ⟶ Z
⊢ ↑(sum (r • g) fun g' t => single (h ≫ g') (s * t)) a✝ = ↑(sum g fun a b => r • single (h ≫ a) (s * b)) a✝
[PROOFSTEP]
rw [Finsupp.sum_smul_index]
[GOAL]
case e_g.h.h.h
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
h : X ⟶ Y
s : R
a✝ : X ⟶ Z
⊢ ↑(sum g fun i a => single (h ≫ i) (s * (r * a))) a✝ = ↑(sum g fun a b => r • single (h ≫ a) (s * b)) a✝
[PROOFSTEP]
simp [Finsupp.smul_sum, mul_left_comm]
[GOAL]
case e_g.h.h.h
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Free R C
f : X ⟶ Y
r : R
g : Y ⟶ Z
h : X ⟶ Y
s : R
a✝ : X ⟶ Z
⊢ ∀ (i : Y ⟶ Z), single (h ≫ i) (s * 0) = 0
[PROOFSTEP]
simp [Finsupp.smul_sum, mul_left_comm]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : C
f : X ⟶ Y
g : Y ⟶ Z
r s : R
⊢ single f r ≫ single g s = single (f ≫ g) (r * s)
[PROOFSTEP]
dsimp [CategoryTheory.categoryFree]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : C
f : X ⟶ Y
g : Y ⟶ Z
r s : R
⊢ (sum (single f r) fun f' s_1 => sum (single g s) fun g' t => single (f' ≫ g') (s_1 * t)) = single (f ≫ g) (r * s)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : C
f : X ⟶ Y
g : Y ⟶ Z
⊢ { obj := fun X => X, map := fun {X Y} f => single f 1 }.map (f ≫ g) =
    { obj := fun X => X, map := fun {X Y} f => single f 1 }.map f ≫
      { obj := fun X => X, map := fun {X Y} f => single f 1 }.map g
[PROOFSTEP]
dsimp only []
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
C : Type u
inst✝ : Category.{v, u} C
X Y Z : C
f : X ⟶ Y
g : Y ⟶ Z
⊢ single (f ≫ g) 1 = single f 1 ≫ single g 1
[PROOFSTEP]
rw [single_comp_single, one_mul]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
⊢ ∀ (X : Free R C),
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (𝟙 X) =
      𝟙 ({ obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.obj X)
[PROOFSTEP]
dsimp [CategoryTheory.categoryFree]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
⊢ ∀ (X : Free R C), (sum (single (𝟙 X) 1) fun f' r => r • F.map f') = 𝟙 (F.obj X)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
apply Finsupp.induction_linear f
[GOAL]
case h0
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (0 ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map 0 ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
dsimp
[GOAL]
case h0
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
⊢ (sum (0 ≫ g) fun f' r => r • F.map f') = 0 ≫ sum g fun f' r => r • F.map f'
[PROOFSTEP]
rw [Limits.zero_comp, sum_zero_index, Limits.zero_comp]
[GOAL]
case hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
⊢ ∀ (f g_1 : (X ⟶ Y) →₀ R),
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f ≫ g) =
        { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f ≫
          { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g →
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (g_1 ≫ g) =
          { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g_1 ≫
            { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g →
        { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map ((f + g_1) ≫ g) =
          { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f + g_1) ≫
            { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
intro f₁ f₂ w₁ w₂
[GOAL]
case hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₁ ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
w₂ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₂ ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₂ ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map ((f₁ + f₂) ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ + f₂) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
rw [add_comp]
[GOAL]
case hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₁ ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
w₂ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₂ ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₂ ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ ≫ g + f₂ ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ + f₂) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
dsimp at *
[GOAL]
case hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
⊢ (sum (f₁ ≫ g + f₂ ≫ g) fun f' r => r • F.map f') =
    (sum (f₁ + f₂) fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
[PROOFSTEP]
rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
[GOAL]
case hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
⊢ ((sum (f₁ ≫ g) fun f' r => r • F.map f') + sum (f₂ ≫ g) fun f' r => r • F.map f') =
    ((sum f₁ fun f' r => r • F.map f') + sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
[PROOFSTEP]
simp only [w₁, w₂, add_comp]
[GOAL]
case hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
⊢ ∀ (a : X ⟶ Y), 0 • F.map a = 0
[PROOFSTEP]
intros
[GOAL]
case hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
a✝ : X ⟶ Y
⊢ 0 • F.map a✝ = 0
[PROOFSTEP]
rw [zero_smul]
[GOAL]
case hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
⊢ ∀ (a : X ⟶ Y) (b₁ b₂ : R), (b₁ + b₂) • F.map a = b₁ • F.map a + b₂ • F.map a
[PROOFSTEP]
intros
[GOAL]
case hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
a✝ : X ⟶ Y
b₁✝ b₂✝ : R
⊢ (b₁✝ + b₂✝) • F.map a✝ = b₁✝ • F.map a✝ + b₂✝ • F.map a✝
[PROOFSTEP]
simp only [add_smul]
[GOAL]
case hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
⊢ ∀ (a : X ⟶ Z), 0 • F.map a = 0
[PROOFSTEP]
intros
[GOAL]
case hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
a✝ : X ⟶ Z
⊢ 0 • F.map a✝ = 0
[PROOFSTEP]
rw [zero_smul]
[GOAL]
case hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
⊢ ∀ (a : X ⟶ Z) (b₁ b₂ : R), (b₁ + b₂) • F.map a = b₁ • F.map a + b₂ • F.map a
[PROOFSTEP]
intros
[GOAL]
case hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : (sum (f₁ ≫ g) fun f' r => r • F.map f') = (sum f₁ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
w₂ : (sum (f₂ ≫ g) fun f' r => r • F.map f') = (sum f₂ fun f' r => r • F.map f') ≫ sum g fun f' r => r • F.map f'
a✝ : X ⟶ Z
b₁✝ b₂✝ : R
⊢ (b₁✝ + b₂✝) • F.map a✝ = b₁✝ • F.map a✝ + b₂✝ • F.map a✝
[PROOFSTEP]
simp only [add_smul]
[GOAL]
case hsingle
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
⊢ ∀ (a : X ⟶ Y) (b : R),
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single a b ≫ g) =
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single a b) ≫
        { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
intro f' r
[GOAL]
case hsingle
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ g) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g
[PROOFSTEP]
apply Finsupp.induction_linear g
[GOAL]
case hsingle.h0
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ 0) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map 0
[PROOFSTEP]
dsimp
[GOAL]
case hsingle.h0
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
⊢ (sum (single f' r ≫ 0) fun f' r => r • F.map f') = (sum (single f' r) fun f' r => r • F.map f') ≫ 0
[PROOFSTEP]
rw [Limits.comp_zero, sum_zero_index, Limits.comp_zero]
[GOAL]
case hsingle.hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
⊢ ∀ (f g : (Y ⟶ Z) →₀ R),
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ f) =
        { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
          { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f →
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ g) =
          { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
            { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map g →
        { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ (f + g)) =
          { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
            { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f + g)
[PROOFSTEP]
intro f₁ f₂ w₁ w₂
[GOAL]
case hsingle.hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ f₁) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₁
w₂ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ f₂) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₂
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ (f₁ + f₂)) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ + f₂)
[PROOFSTEP]
rw [comp_add]
[GOAL]
case hsingle.hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ f₁) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₁
w₂ :
  { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ f₂) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map f₂
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map
      (single f' r ≫ f₁ + single f' r ≫ f₂) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (f₁ + f₂)
[PROOFSTEP]
dsimp at *
[GOAL]
case hsingle.hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
⊢ (sum (single f' r ≫ f₁ + single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum (f₁ + f₂) fun f' r => r • F.map f'
[PROOFSTEP]
rw [Finsupp.sum_add_index', Finsupp.sum_add_index']
[GOAL]
case hsingle.hadd
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
⊢ ((sum (single f' r ≫ f₁) fun f' r => r • F.map f') + sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ ((sum f₁ fun f' r => r • F.map f') + sum f₂ fun f' r => r • F.map f')
[PROOFSTEP]
simp only [w₁, w₂, comp_add]
[GOAL]
case hsingle.hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
⊢ ∀ (a : Y ⟶ Z), 0 • F.map a = 0
[PROOFSTEP]
intros
[GOAL]
case hsingle.hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
a✝ : Y ⟶ Z
⊢ 0 • F.map a✝ = 0
[PROOFSTEP]
rw [zero_smul]
[GOAL]
case hsingle.hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
⊢ ∀ (a : Y ⟶ Z) (b₁ b₂ : R), (b₁ + b₂) • F.map a = b₁ • F.map a + b₂ • F.map a
[PROOFSTEP]
intros
[GOAL]
case hsingle.hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
a✝ : Y ⟶ Z
b₁✝ b₂✝ : R
⊢ (b₁✝ + b₂✝) • F.map a✝ = b₁✝ • F.map a✝ + b₂✝ • F.map a✝
[PROOFSTEP]
simp only [add_smul]
[GOAL]
case hsingle.hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
⊢ ∀ (a : X ⟶ Z), 0 • F.map a = 0
[PROOFSTEP]
intros
[GOAL]
case hsingle.hadd.h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
a✝ : X ⟶ Z
⊢ 0 • F.map a✝ = 0
[PROOFSTEP]
rw [zero_smul]
[GOAL]
case hsingle.hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
⊢ ∀ (a : X ⟶ Z) (b₁ b₂ : R), (b₁ + b₂) • F.map a = b₁ • F.map a + b₂ • F.map a
[PROOFSTEP]
intros
[GOAL]
case hsingle.hadd.h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
f₁ f₂ : (Y ⟶ Z) →₀ R
w₁ :
  (sum (single f' r ≫ f₁) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₁ fun f' r => r • F.map f'
w₂ :
  (sum (single f' r ≫ f₂) fun f' r => r • F.map f') =
    (sum (single f' r) fun f' r => r • F.map f') ≫ sum f₂ fun f' r => r • F.map f'
a✝ : X ⟶ Z
b₁✝ b₂✝ : R
⊢ (b₁✝ + b₂✝) • F.map a✝ = b₁✝ • F.map a✝ + b₂✝ • F.map a✝
[PROOFSTEP]
simp only [add_smul]
[GOAL]
case hsingle.hsingle
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
⊢ ∀ (a : Y ⟶ Z) (b : R),
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ single a b) =
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
        { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single a b)
[PROOFSTEP]
intro g' s
[GOAL]
case hsingle.hsingle
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
g' : Y ⟶ Z
s : R
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r ≫ single g' s) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single g' s)
[PROOFSTEP]
rw [single_comp_single _ _ f' g' r s]
[GOAL]
case hsingle.hsingle
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y Z : Free R C
f : X ⟶ Y
g : Y ⟶ Z
f' : X ⟶ Y
r : R
g' : Y ⟶ Z
s : R
⊢ { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single (f' ≫ g') (r * s)) =
    { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single f' r) ≫
      { obj := fun X => F.obj X, map := fun {X Y} f => sum f fun f' r => r • F.map f' }.map (single g' s)
[PROOFSTEP]
simp [mul_comm r s, mul_smul]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : C
f : X ⟶ Y
r : R
⊢ (lift R F).map (single f r) = r • F.map f
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f g : X ⟶ Y
⊢ (lift R F).map (f + g) = (lift R F).map f + (lift R F).map g
[PROOFSTEP]
dsimp
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f g : X ⟶ Y
⊢ (sum (f + g) fun f' r => r • F.map f') = (sum f fun f' r => r • F.map f') + sum g fun f' r => r • F.map f'
[PROOFSTEP]
rw [Finsupp.sum_add_index']
[GOAL]
case h_zero
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f g : X ⟶ Y
⊢ ∀ (a : X ⟶ Y), 0 • F.map a = 0
[PROOFSTEP]
simp [add_smul]
[GOAL]
case h_add
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f g : X ⟶ Y
⊢ ∀ (a : X ⟶ Y) (b₁ b₂ : R), (b₁ + b₂) • F.map a = b₁ • F.map a + b₂ • F.map a
[PROOFSTEP]
simp [add_smul]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f : X ⟶ Y
r : R
⊢ (lift R F).map (r • f) = r • (lift R F).map f
[PROOFSTEP]
dsimp
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f : X ⟶ Y
r : R
⊢ (sum (r • f) fun f' r => r • F.map f') = r • sum f fun f' r => r • F.map f'
[PROOFSTEP]
rw [Finsupp.sum_smul_index]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f : X ⟶ Y
r : R
⊢ (sum f fun i a => (r * a) • F.map i) = r • sum f fun f' r => r • F.map f'
[PROOFSTEP]
simp [Finsupp.smul_sum, mul_smul]
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
C : Type u
inst✝³ : Category.{v, u} C
D : Type u
inst✝² : Category.{v, u} D
inst✝¹ : Preadditive D
inst✝ : Linear R D
F : C ⥤ D
X Y : Free R C
f : X ⟶ Y
r : R
⊢ ∀ (i : X ⟶ Y), 0 • F.map i = 0
[PROOFSTEP]
simp [Finsupp.smul_sum, mul_smul]
[GOAL]
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
⊢ ∀ {X Y : Free R C} (f : X ⟶ Y), F.map f ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map f
[PROOFSTEP]
intro X Y f
[GOAL]
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
⊢ F.map f ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map f
[PROOFSTEP]
apply Finsupp.induction_linear f
[GOAL]
case h0
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
⊢ F.map 0 ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map 0
[PROOFSTEP]
rw [Functor.map_zero, Limits.zero_comp, Functor.map_zero, Limits.comp_zero]
[GOAL]
case hadd
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
⊢ ∀ (f g : (X ⟶ Y) →₀ R),
    F.map f ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map f →
      F.map g ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map g →
        F.map (f + g) ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map (f + g)
[PROOFSTEP]
intro f₁ f₂ w₁ w₂
[GOAL]
case hadd
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
f₁ f₂ : (X ⟶ Y) →₀ R
w₁ : F.map f₁ ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map f₁
w₂ : F.map f₂ ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map f₂
⊢ F.map (f₁ + f₂) ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map (f₁ + f₂)
[PROOFSTEP]
rw [Functor.map_add, add_comp, w₁, w₂, Functor.map_add, comp_add]
[GOAL]
case hsingle
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
⊢ ∀ (a : X ⟶ Y) (b : R),
    F.map (single a b) ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map (single a b)
[PROOFSTEP]
intro f' r
[GOAL]
case hsingle
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
f' : X ⟶ Y
r : R
⊢ F.map (single f' r) ≫ ((fun X => α.app X) Y).hom = ((fun X => α.app X) X).hom ≫ G.map (single f' r)
[PROOFSTEP]
rw [Iso.app_hom, Iso.app_hom, ← smul_single_one, F.map_smul, G.map_smul, smul_comp, comp_smul]
[GOAL]
case hsingle
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
f' : X ⟶ Y
r : R
⊢ r • F.map (single f' 1) ≫ NatTrans.app α.hom Y = r • NatTrans.app α.hom X ≫ G.map (single f' 1)
[PROOFSTEP]
change r • (embedding R C ⋙ F).map f' ≫ _ = r • _ ≫ (embedding R C ⋙ G).map f'
[GOAL]
case hsingle
R : Type u_1
inst✝⁸ : CommRing R
C : Type u
inst✝⁷ : Category.{v, u} C
D : Type u
inst✝⁶ : Category.{v, u} D
inst✝⁵ : Preadditive D
inst✝⁴ : Linear R D
F G : Free R C ⥤ D
inst✝³ : Functor.Additive F
inst✝² : Functor.Linear R F
inst✝¹ : Functor.Additive G
inst✝ : Functor.Linear R G
α : embedding R C ⋙ F ≅ embedding R C ⋙ G
X Y : Free R C
f : X ⟶ Y
f' : X ⟶ Y
r : R
⊢ r • (embedding R C ⋙ F).map f' ≫ NatTrans.app α.hom Y = r • NatTrans.app α.hom X ≫ (embedding R C ⋙ G).map f'
[PROOFSTEP]
rw [α.hom.naturality f']


[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryProducts C
X✝ Y✝ : Coalgebra (prodComonad X)
f : X✝ ⟶ Y✝
⊢ f.f ≫ ((fun A => Over.mk (A.a ≫ prod.fst)) Y✝).hom = ((fun A => Over.mk (A.a ≫ prod.fst)) X✝).hom
[PROOFSTEP]
rw [Over.mk_hom, ← f.h_assoc]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryProducts C
X✝ Y✝ : Coalgebra (prodComonad X)
f : X✝ ⟶ Y✝
⊢ X✝.a ≫ (prodComonad X).toFunctor.map f.f ≫ prod.fst = ((fun A => Over.mk (A.a ≫ prod.fst)) X✝).hom
[PROOFSTEP]
dsimp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryProducts C
X✝ Y✝ : Coalgebra (prodComonad X)
f : X✝ ⟶ Y✝
⊢ X✝.a ≫ prod.map (𝟙 X) f.f ≫ prod.fst = X✝.a ≫ prod.fst
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryProducts C
A : Coalgebra (prodComonad X)
⊢ (((𝟭 (Coalgebra (prodComonad X))).obj A).a ≫
        (prodComonad X).toFunctor.map (Iso.refl ((𝟭 (Coalgebra (prodComonad X))).obj A).A).hom) ≫
      prod.fst =
    ((Iso.refl ((𝟭 (Coalgebra (prodComonad X))).obj A).A).hom ≫ ((coalgebraToOver X ⋙ overToCoalgebra X).obj A).a) ≫
      prod.fst
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryProducts C
A : Coalgebra (prodComonad X)
⊢ (((𝟭 (Coalgebra (prodComonad X))).obj A).a ≫
        (prodComonad X).toFunctor.map (Iso.refl ((𝟭 (Coalgebra (prodComonad X))).obj A).A).hom) ≫
      prod.snd =
    ((Iso.refl ((𝟭 (Coalgebra (prodComonad X))).obj A).A).hom ≫ ((coalgebraToOver X ⋙ overToCoalgebra X).obj A).a) ≫
      prod.snd
[PROOFSTEP]
simpa using A.counit
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryCoproducts C
X✝ Y✝ : Algebra (coprodMonad X)
f : X✝ ⟶ Y✝
⊢ ((fun A => Under.mk (coprod.inl ≫ A.a)) X✝).hom ≫ f.f = ((fun A => Under.mk (coprod.inl ≫ A.a)) Y✝).hom
[PROOFSTEP]
rw [Under.mk_hom, Category.assoc, ← f.h]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryCoproducts C
X✝ Y✝ : Algebra (coprodMonad X)
f : X✝ ⟶ Y✝
⊢ coprod.inl ≫ (coprodMonad X).toFunctor.map f.f ≫ Y✝.a = ((fun A => Under.mk (coprod.inl ≫ A.a)) Y✝).hom
[PROOFSTEP]
dsimp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryCoproducts C
X✝ Y✝ : Algebra (coprodMonad X)
f : X✝ ⟶ Y✝
⊢ coprod.inl ≫ coprod.map (𝟙 X) f.f ≫ Y✝.a = coprod.inl ≫ Y✝.a
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryCoproducts C
A : Algebra (coprodMonad X)
⊢ coprod.inl ≫
      (coprodMonad X).toFunctor.map (Iso.refl ((𝟭 (Algebra (coprodMonad X))).obj A).A).hom ≫
        ((algebraToUnder X ⋙ underToAlgebra X).obj A).a =
    coprod.inl ≫ ((𝟭 (Algebra (coprodMonad X))).obj A).a ≫ (Iso.refl ((𝟭 (Algebra (coprodMonad X))).obj A).A).hom
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : HasBinaryCoproducts C
A : Algebra (coprodMonad X)
⊢ coprod.inr ≫
      (coprodMonad X).toFunctor.map (Iso.refl ((𝟭 (Algebra (coprodMonad X))).obj A).A).hom ≫
        ((algebraToUnder X ⋙ underToAlgebra X).obj A).a =
    coprod.inr ≫ ((𝟭 (Algebra (coprodMonad X))).obj A).a ≫ (Iso.refl ((𝟭 (Algebra (coprodMonad X))).obj A).A).hom
[PROOFSTEP]
simpa using A.unit.symm


[GOAL]
n✝ n : ℕ
⊢ boddDiv2 n = (bodd n, div2 n)
[PROOFSTEP]
unfold bodd div2
[GOAL]
n✝ n : ℕ
⊢ boddDiv2 n = ((boddDiv2 n).fst, (boddDiv2 n).snd)
[PROOFSTEP]
cases boddDiv2 n
[GOAL]
case mk
n✝ n : ℕ
fst✝ : Bool
snd✝ : ℕ
⊢ (fst✝, snd✝) = ((fst✝, snd✝).fst, (fst✝, snd✝).snd)
[PROOFSTEP]
rfl
[GOAL]
n✝ m n : ℕ
h : m = n
⊢ bit0 m = bit0 n
[PROOFSTEP]
subst h
[GOAL]
n m : ℕ
⊢ bit0 m = bit0 m
[PROOFSTEP]
rfl
[GOAL]
n✝ m n : ℕ
h : m = n
⊢ bit1 m = bit1 n
[PROOFSTEP]
subst h
[GOAL]
n m : ℕ
⊢ bit1 m = bit1 m
[PROOFSTEP]
rfl
[GOAL]
n✝ n : ℕ
h : n = 0
⊢ bit1 n = 1
[PROOFSTEP]
subst h
[GOAL]
n : ℕ
⊢ bit1 0 = 1
[PROOFSTEP]
rfl
[GOAL]
n✝ n : ℕ
h : n = 0
⊢ 1 = bit1 n
[PROOFSTEP]
subst h
[GOAL]
n : ℕ
⊢ 1 = bit1 0
[PROOFSTEP]
rfl
[GOAL]
n✝ : ℕ
b : Bool
n : ℕ
h : n ≠ 0
⊢ bit b n ≠ 0
[PROOFSTEP]
cases b <;> [exact Nat.bit0_ne_zero h; exact Nat.bit1_ne_zero _]
[GOAL]
n✝ : ℕ
b : Bool
n : ℕ
h : n ≠ 0
⊢ bit b n ≠ 0
[PROOFSTEP]
cases b
[GOAL]
case false
n✝ n : ℕ
h : n ≠ 0
⊢ bit false n ≠ 0
[PROOFSTEP]
exact Nat.bit0_ne_zero h
[GOAL]
case true
n✝ n : ℕ
h : n ≠ 0
⊢ bit true n ≠ 0
[PROOFSTEP]
exact Nat.bit1_ne_zero _
[GOAL]
n : ℕ
⊢ bit0 n % 2 = 0
[PROOFSTEP]
rw [Nat.mod_two_of_bodd]
[GOAL]
n : ℕ
⊢ (bif bodd (bit0 n) then 1 else 0) = 0
[PROOFSTEP]
simp
[GOAL]
n : ℕ
⊢ bit1 n % 2 = 1
[PROOFSTEP]
rw [Nat.mod_two_of_bodd]
[GOAL]
n : ℕ
⊢ (bif bodd (bit1 n) then 1 else 0) = 1
[PROOFSTEP]
simp
[GOAL]
n✝ n : ℕ
h : 0 < bit0 n
⊢ 0 < n
[PROOFSTEP]
cases n
[GOAL]
case zero
n : ℕ
h : 0 < bit0 zero
⊢ 0 < zero
[PROOFSTEP]
cases h
[GOAL]
case succ
n n✝ : ℕ
h : 0 < bit0 (succ n✝)
⊢ 0 < succ n✝
[PROOFSTEP]
apply succ_pos
[GOAL]
n✝ : ℕ
C : ℕ → Sort u
H : (b : Bool) → (n : ℕ) → C (bit b n)
b : Bool
n : ℕ
⊢ HEq (H (bodd (bit b n)) (div2 (bit b n))) (H b n)
[PROOFSTEP]
rw [bodd_bit, div2_bit]
[GOAL]
n : ℕ
C : ℕ → Sort u
⊢ Function.Injective fun H n => bitCasesOn n H
[PROOFSTEP]
intro H₁ H₂ h
[GOAL]
n : ℕ
C : ℕ → Sort u
H₁ H₂ : (b : Bool) → (n : ℕ) → C (bit b n)
h : (fun H n => bitCasesOn n H) H₁ = (fun H n => bitCasesOn n H) H₂
⊢ H₁ = H₂
[PROOFSTEP]
ext b n
[GOAL]
case h.h
n✝ : ℕ
C : ℕ → Sort u
H₁ H₂ : (b : Bool) → (n : ℕ) → C (bit b n)
h : (fun H n => bitCasesOn n H) H₁ = (fun H n => bitCasesOn n H) H₂
b : Bool
n : ℕ
⊢ H₁ b n = H₂ b n
[PROOFSTEP]
simpa only [bitCasesOn_bit] using congr_fun h (bit b n)
[GOAL]
n✝ n : ℕ
h : n = 0
⊢ bit0 n = 0
[PROOFSTEP]
simp [h]
[GOAL]
n✝ n : ℕ
b : Bool
⊢ bit b n = 0 ↔ n = 0 ∧ b = false
[PROOFSTEP]
constructor
[GOAL]
case mp
n✝ n : ℕ
b : Bool
⊢ bit b n = 0 → n = 0 ∧ b = false
[PROOFSTEP]
cases b
[GOAL]
case mp.false
n✝ n : ℕ
⊢ bit false n = 0 → n = 0 ∧ false = false
[PROOFSTEP]
simp [Nat.bit, Nat.bit0_eq_zero, Nat.bit1_ne_zero]
[GOAL]
case mp.true
n✝ n : ℕ
⊢ bit true n = 0 → n = 0 ∧ true = false
[PROOFSTEP]
simp [Nat.bit, Nat.bit0_eq_zero, Nat.bit1_ne_zero]
[GOAL]
case mpr
n✝ n : ℕ
b : Bool
⊢ n = 0 ∧ b = false → bit b n = 0
[PROOFSTEP]
rintro ⟨rfl, rfl⟩
[GOAL]
case mpr.intro
n : ℕ
⊢ bit false 0 = 0
[PROOFSTEP]
rfl
[GOAL]
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
⊢ binaryRec z f (bit b n) = f b n (binaryRec z f n)
[PROOFSTEP]
rw [binaryRec]
[GOAL]
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
    else
      let n' := div2 (bit b n);
      let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
      Eq.mpr (_ : C (bit b n) = C (bit (bodd (bit b n)) n')) (f (bodd (bit b n)) n' (binaryRec z f n'))) =
    f b n (binaryRec z f n)
[PROOFSTEP]
split_ifs with h'
[GOAL]
case pos
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : bit b n = 0
⊢ Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n)
[PROOFSTEP]
rcases bit_eq_zero_iff.mp h' with ⟨rfl, rfl⟩
[GOAL]
case pos.intro
n : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h : f false 0 z = z ∨ (0 = 0 → false = true)
h' : bit false 0 = 0
⊢ Eq.mpr (_ : C (bit false 0) = C 0) z = f false 0 (binaryRec z f 0)
[PROOFSTEP]
rw [binaryRec_zero]
[GOAL]
case pos.intro
n : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h : f false 0 z = z ∨ (0 = 0 → false = true)
h' : bit false 0 = 0
⊢ Eq.mpr (_ : C (bit false 0) = C 0) z = f false 0 z
[PROOFSTEP]
simp only [imp_false, or_false_iff, eq_self_iff_true, not_true] at h
[GOAL]
case pos.intro
n : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : bit false 0 = 0
h : f false 0 z = z
⊢ Eq.mpr (_ : C (bit false 0) = C 0) z = f false 0 z
[PROOFSTEP]
exact h.symm
[GOAL]
case neg
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : ¬bit b n = 0
⊢ (let n' := div2 (bit b n);
    let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
    Eq.mpr (_ : C (bit b n) = C (bit (bodd (bit b n)) n')) (f (bodd (bit b n)) n' (binaryRec z f n'))) =
    f b n (binaryRec z f n)
[PROOFSTEP]
dsimp only []
  -- Porting note: this line was `generalize_proofs e`:
[GOAL]
case neg
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : ¬bit b n = 0
⊢ Eq.mpr (_ : C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
      (f (bodd (bit b n)) (div2 (bit b n)) (binaryRec z f (div2 (bit b n)))) =
    f b n (binaryRec z f n)
[PROOFSTEP]
generalize
  @id (C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
    (Eq.symm (bit_decomp (bit b n)) ▸ Eq.refl (C (bit b n))) =
  e
[GOAL]
case neg
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : ¬bit b n = 0
e : C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n)))
⊢ Eq.mpr e (f (bodd (bit b n)) (div2 (bit b n)) (binaryRec z f (div2 (bit b n)))) = f b n (binaryRec z f n)
[PROOFSTEP]
revert e
[GOAL]
case neg
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : ¬bit b n = 0
⊢ ∀ (e : C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n)))),
    Eq.mpr e (f (bodd (bit b n)) (div2 (bit b n)) (binaryRec z f (div2 (bit b n)))) = f b n (binaryRec z f n)
[PROOFSTEP]
rw [bodd_bit, div2_bit]
[GOAL]
case neg
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : ¬bit b n = 0
⊢ ∀ (e : C (bit b n) = C (bit b n)), Eq.mpr e (f b n (binaryRec z f n)) = f b n (binaryRec z f n)
[PROOFSTEP]
intros
[GOAL]
case neg
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
b : Bool
n : ℕ
h : f false 0 z = z ∨ (n = 0 → b = true)
h' : ¬bit b n = 0
e✝ : C (bit b n) = C (bit b n)
⊢ Eq.mpr e✝ (f b n (binaryRec z f n)) = f b n (binaryRec z f n)
[PROOFSTEP]
rfl
[GOAL]
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → (n = 0 → b = true) → C n → C (bit b n)
b : Bool
n : ℕ
ih : C n
h : ¬(n = 0 → b = true)
⊢ C (bit b n)
[PROOFSTEP]
convert z
[GOAL]
case h.e'_1
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → (n = 0 → b = true) → C n → C (bit b n)
b : Bool
n : ℕ
ih : C n
h : ¬(n = 0 → b = true)
⊢ bit b n = 0
[PROOFSTEP]
rw [bit_eq_zero_iff]
[GOAL]
case h.e'_1
n✝ : ℕ
C : ℕ → Sort u_1
z : C 0
f : (b : Bool) → (n : ℕ) → (n = 0 → b = true) → C n → C (bit b n)
b : Bool
n : ℕ
ih : C n
h : ¬(n = 0 → b = true)
⊢ n = 0 ∧ b = false
[PROOFSTEP]
simpa using h
[GOAL]
n✝ : ℕ
C : ℕ → Sort u_1
z₀ : C 0
z₁ : C 1
f : (b : Bool) → (n : ℕ) → n ≠ 0 → C n → C (bit b n)
b : Bool
n : ℕ
h : n = 0 → b = true
ih : C n
h' : n = 0
⊢ C (bit b n)
[PROOFSTEP]
rw [h', h h']
[GOAL]
n✝ : ℕ
C : ℕ → Sort u_1
z₀ : C 0
z₁ : C 1
f : (b : Bool) → (n : ℕ) → n ≠ 0 → C n → C (bit b n)
b : Bool
n : ℕ
h : n = 0 → b = true
ih : C n
h' : n = 0
⊢ C (bit true 0)
[PROOFSTEP]
exact z₁
[GOAL]
n : ℕ
⊢ bits 0 = []
[PROOFSTEP]
simp [Nat.bits]
[GOAL]
n✝ n : ℕ
b : Bool
hn : n = 0 → b = true
⊢ bits (bit b n) = b :: bits n
[PROOFSTEP]
rw [Nat.bits, binaryRec_eq']
[GOAL]
case h
n✝ n : ℕ
b : Bool
hn : n = 0 → b = true
⊢ [false] = [] ∨ (n = 0 → b = true)
[PROOFSTEP]
simpa
[GOAL]
n : ℕ
⊢ bits 1 = [true]
[PROOFSTEP]
convert bit1_bits 0
[GOAL]
n✝ n : ℕ
⊢ bodd n = List.headI (bits n)
[PROOFSTEP]
induction' n using Nat.binaryRec' with b n h _
[GOAL]
case z
n : ℕ
⊢ bodd 0 = List.headI (bits 0)
[PROOFSTEP]
simp
[GOAL]
case f
n✝ : ℕ
b : Bool
n : ℕ
h : n = 0 → b = true
a✝ : bodd n = List.headI (bits n)
⊢ bodd (bit b n) = List.headI (bits (bit b n))
[PROOFSTEP]
simp [bodd_bit, bits_append_bit _ _ h]
[GOAL]
n✝ n : ℕ
⊢ bits (div2 n) = List.tail (bits n)
[PROOFSTEP]
induction' n using Nat.binaryRec' with b n h _
[GOAL]
case z
n : ℕ
⊢ bits (div2 0) = List.tail (bits 0)
[PROOFSTEP]
simp
[GOAL]
case f
n✝ : ℕ
b : Bool
n : ℕ
h : n = 0 → b = true
a✝ : bits (div2 n) = List.tail (bits n)
⊢ bits (div2 (bit b n)) = List.tail (bits (bit b n))
[PROOFSTEP]
simp [div2_bit, bits_append_bit _ _ h]