l3lab/ntp-mathlib huggingface dataset:
private theorem colimitModule.add_smul (r s : R) (x : (M F)) : (r + s) • x = r • x + s • x := by
  refine' Quot.inductionOn x _; clear x; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
r s : R
⊢ ∀
    (a :
      (j : J) ×
        ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat).obj
          j),
    (r + s) •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          a =
      r •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a +
        s •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a

Next tactic:
intro x
private theorem colimitModule.add_smul (r s : R) (x : (M F)) : (r + s) • x = r • x + s • x := by
  refine' Quot.inductionOn x _; clear x; intro x; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
r s : R
x :
  (j : J) ×
    ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
            forget₂ AddGroupCat AddMonCat) ⋙
          forget AddMonCat).obj
      j
⊢ (r + s) •
      Quot.mk
        (Types.Quot.Rel
          ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
              forget₂ AddGroupCat AddMonCat) ⋙
            forget AddMonCat))
        x =
    r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          x +
      s •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          x

Next tactic:
cases' x with j x
private theorem colimitModule.add_smul (r s : R) (x : (M F)) : (r + s) • x = r • x + s • x := by
  refine' Quot.inductionOn x _; clear x; intro x; cases' x with j x
  

Proof state:
case mk
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
r s : R
j : J
x :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    j
⊢ (r + s) •
      Quot.mk
        (Types.Quot.Rel
          ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
              forget₂ AddGroupCat AddMonCat) ⋙
            forget AddMonCat))
        { fst := j, snd := x } =
    r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := j, snd := x } +
      s •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := j, snd := x }

Next tactic:
erw [colimit_smul_mk_eq, _root_.add_smul, colimit_smul_mk_eq, colimit_smul_mk_eq,
      colimit_add_mk_eq _ ⟨j, _⟩ ⟨j, _⟩ j (𝟙 j) (𝟙 j), CategoryTheory.Functor.map_id, id_apply,
      id_apply]
private theorem colimitModule.add_smul (r s : R) (x : (M F)) : (r + s) • x = r • x + s • x := by
  refine' Quot.inductionOn x _; clear x; intro x; cases' x with j x
  erw [colimit_smul_mk_eq, _root_.add_smul, colimit_smul_mk_eq, colimit_smul_mk_eq,
      colimit_add_mk_eq _ ⟨j, _⟩ ⟨j, _⟩ j (𝟙 j) (𝟙 j), CategoryTheory.Functor.map_id, id_apply,
      id_apply]
  

Proof state:
case mk
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
r s : R
j : J
x :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    j
⊢ M.mk F { fst := { fst := j, snd := x }.fst, snd := r • { fst := j, snd := x }.snd + s • { fst := j, snd := x }.snd } =
    AddMonCat.FilteredColimits.M.mk
      (((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
        forget₂ AddGroupCat AddMonCat)
      { fst := j, snd := r • { fst := j, snd := x }.snd + s • { fst := j, snd := x }.snd }

Next tactic:
rfl
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
x y : ↑(M F)
⊢ r • (x + y) = r • x + r • y

Next tactic:
refine' Quot.induction_on₂ x y _
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    refine' Quot.induction_on₂ x y _; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
x y : ↑(M F)
⊢ ∀
    (a b :
      (j : J) ×
        ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat).obj
          j),
    r •
        (Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a +
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            b) =
      r •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a +
        r •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            b

Next tactic:
clear x y
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    refine' Quot.induction_on₂ x y _; clear x y; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
⊢ ∀
    (a b :
      (j : J) ×
        ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat).obj
          j),
    r •
        (Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a +
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            b) =
      r •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a +
        r •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            b

Next tactic:
intro x y
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    refine' Quot.induction_on₂ x y _; clear x y; intro x y; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
x y :
  (j : J) ×
    ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
            forget₂ AddGroupCat AddMonCat) ⋙
          forget AddMonCat).obj
      j
⊢ r •
      (Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          x +
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          y) =
    r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          x +
      r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          y

Next tactic:
cases' x with i x
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    refine' Quot.induction_on₂ x y _; clear x y; intro x y; cases' x with i x; 

Proof state:
case mk
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
y :
  (j : J) ×
    ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
            forget₂ AddGroupCat AddMonCat) ⋙
          forget AddMonCat).obj
      j
i : J
x :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    i
⊢ r •
      (Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := i, snd := x } +
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          y) =
    r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := i, snd := x } +
      r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          y

Next tactic:
cases' y with j y
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    refine' Quot.induction_on₂ x y _; clear x y; intro x y; cases' x with i x; cases' y with j y
    

Proof state:
case mk.mk
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
i : J
x :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    i
j : J
y :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    j
⊢ r •
      (Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := i, snd := x } +
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := j, snd := y }) =
    r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := i, snd := x } +
      r •
        Quot.mk
          (Types.Quot.Rel
            ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat))
          { fst := j, snd := y }

Next tactic:
erw [colimit_add_mk_eq _ ⟨i, _⟩ ⟨j, _⟩ (max' i j) (IsFiltered.leftToMax i j)
      (IsFiltered.rightToMax i j), colimit_smul_mk_eq, smul_add, colimit_smul_mk_eq,
      colimit_smul_mk_eq, colimit_add_mk_eq _ ⟨i, _⟩ ⟨j, _⟩ (max' i j) (IsFiltered.leftToMax i j)
      (IsFiltered.rightToMax i j), LinearMap.map_smul, LinearMap.map_smul]
instance colimitModule : Module R (M F) :=
{ colimitMulAction F,
  colimitSMulWithZero F with
  smul_add := fun r x y => by
    refine' Quot.induction_on₂ x y _; clear x y; intro x y; cases' x with i x; cases' y with j y
    erw [colimit_add_mk_eq _ ⟨i, _⟩ ⟨j, _⟩ (max' i j) (IsFiltered.leftToMax i j)
      (IsFiltered.rightToMax i j), colimit_smul_mk_eq, smul_add, colimit_smul_mk_eq,
      colimit_smul_mk_eq, colimit_add_mk_eq _ ⟨i, _⟩ ⟨j, _⟩ (max' i j) (IsFiltered.leftToMax i j)
      (IsFiltered.rightToMax i j), LinearMap.map_smul, LinearMap.map_smul]
    

Proof state:
case mk.mk
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
src✝¹ : MulAction R ↑(M F) := colimitMulAction F
src✝ : SMulWithZero R ↑(M F) := colimitSMulWithZero F
r : R
i : J
x :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    i
j : J
y :
  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
          forget₂ AddGroupCat AddMonCat) ⋙
        forget AddMonCat).obj
    j
⊢ M.mk F
      {
        fst :=
          { fst := IsFiltered.max i j,
              snd :=
                ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                          forget₂ AddGroupCat AddMonCat).map
                      (IsFiltered.leftToMax i j))
                    { fst := i, snd := x }.snd +
                  ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                          forget₂ AddGroupCat AddMonCat).map
                      (IsFiltered.rightToMax i j))
                    { fst := j, snd := y }.snd }.fst,
        snd :=
          r •
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                      forget₂ AddGroupCat AddMonCat).map
                  (IsFiltered.leftToMax i j))
                { fst := i, snd := x }.snd +
            r •
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                      forget₂ AddGroupCat AddMonCat).map
                  (IsFiltered.rightToMax i j))
                { fst := j, snd := y }.snd } =
    AddMonCat.FilteredColimits.M.mk
      (((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
        forget₂ AddGroupCat AddMonCat)
      { fst := IsFiltered.max i j,
        snd :=
          r • (F.map (IsFiltered.leftToMax i j)) { fst := i, snd := x }.snd +
            r • (F.map (IsFiltered.rightToMax i j)) { fst := j, snd := y }.snd }

Next tactic:
rfl
/-- The linear map from a given `R`-module in the diagram to the colimit module. -/
def coconeMorphism (j : J) : F.obj j ⟶ colimit F :=
  { (AddCommGroupCat.FilteredColimits.colimitCocone
      (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat.{max v u})).ι.app j with
    map_smul' := fun r x => by 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
j : J
src✝ : (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat).obj j ⟶
  ((Functor.const J).obj
        (AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat)).pt).obj
    j :=
  (AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat)).ι.app j
r : R
x : ↑(F.obj j)
⊢ AddHom.toFun
      { toFun := src✝.toFun,
        map_add' :=
          (_ :
            ∀ (x y : ↑((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat).obj j)),
              ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
      (r • x) =
    (RingHom.id R) r •
      AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ :
              ∀ (x y : ↑((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat).obj j)),
                ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        x

Next tactic:
erw [colimit_smul_mk_eq F r ⟨j, x⟩]
/-- The linear map from a given `R`-module in the diagram to the colimit module. -/
def coconeMorphism (j : J) : F.obj j ⟶ colimit F :=
  { (AddCommGroupCat.FilteredColimits.colimitCocone
      (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat.{max v u})).ι.app j with
    map_smul' := fun r x => by erw [colimit_smul_mk_eq F r ⟨j, x⟩]; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
j : J
src✝ : (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat).obj j ⟶
  ((Functor.const J).obj
        (AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat)).pt).obj
    j :=
  (AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCat R) AddCommGroupCat)).ι.app j
r : R
x : ↑(F.obj j)
⊢ AddHom.toFun
      { toFun := src✝.toFun,
        map_add' :=
          (_ :
            ∀ (x y : ↑((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat).obj j)),
              ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
      (r • x) =
    M.mk F { fst := { fst := j, snd := x }.fst, snd := r • { fst := j, snd := x }.snd }

Next tactic:
rfl
/-- Given a cocone `t` of `F`, the induced monoid linear map from the colimit to the cocone point.
We already know that this is a morphism between additive groups. The only thing left to see is that
it is a linear map, i.e. preserves scalar multiplication.
-/
def colimitDesc (t : Cocone F) : colimit F ⟶ t.pt :=
  { (AddCommGroupCat.FilteredColimits.colimitCoconeIsColimit
          (F ⋙ forget₂ (ModuleCatMax.{v, u} R) AddCommGroupCat.{max v u})).desc
      ((forget₂ (ModuleCat R) AddCommGroupCat.{max v u}).mapCocone t) with
    map_smul' := fun r x => by
      

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
t : Cocone F
src✝ : (AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat)).pt ⟶
  ((forget₂ (ModuleCat R) AddCommGroupCat).mapCocone t).pt :=
  IsColimit.desc
    (AddCommGroupCat.FilteredColimits.colimitCoconeIsColimit (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat))
    ((forget₂ (ModuleCat R) AddCommGroupCat).mapCocone t)
r : R
x : ↑(colimit F)
⊢ AddHom.toFun
      { toFun := src✝.toFun,
        map_add' :=
          (_ :
            ∀
              (x y :
                ↑(AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat)).pt),
              ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
      (r • x) =
    (RingHom.id R) r •
      AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ :
              ∀
                (x y :
                  ↑(AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat)).pt),
                ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        x

Next tactic:
refine' Quot.inductionOn x _
/-- Given a cocone `t` of `F`, the induced monoid linear map from the colimit to the cocone point.
We already know that this is a morphism between additive groups. The only thing left to see is that
it is a linear map, i.e. preserves scalar multiplication.
-/
def colimitDesc (t : Cocone F) : colimit F ⟶ t.pt :=
  { (AddCommGroupCat.FilteredColimits.colimitCoconeIsColimit
          (F ⋙ forget₂ (ModuleCatMax.{v, u} R) AddCommGroupCat.{max v u})).desc
      ((forget₂ (ModuleCat R) AddCommGroupCat.{max v u}).mapCocone t) with
    map_smul' := fun r x => by
      refine' Quot.inductionOn x _; 

Proof state:
R : Type u
inst✝² : Ring R
J : Type v
inst✝¹ : SmallCategory J
inst✝ : IsFiltered J
F : J ⥤ ModuleCatMax R
t : Cocone F
src✝ : (AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat)).pt ⟶
  ((forget₂ (ModuleCat R) AddCommGroupCat).mapCocone t).pt :=
  IsColimit.desc
    (AddCommGroupCat.FilteredColimits.colimitCoconeIsColimit (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat))
    ((forget₂ (ModuleCat R) AddCommGroupCat).mapCocone t)
r : R
x : ↑(colimit F)
⊢ ∀
    (a :
      (j : J) ×
        ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                forget₂ AddGroupCat AddMonCat) ⋙
              forget AddMonCat).obj
          j),
    AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ :
              ∀
                (x y :
                  ↑(AddCommGroupCat.FilteredColimits.colimitCocone (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat)).pt),
                ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        (r •
          Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a) =
      (RingHom.id R) r •
        AddHom.toFun
          { toFun := src✝.toFun,
            map_add' :=
              (_ :
                ∀
                  (x y :
                    ↑(AddCommGroupCat.FilteredColimits.colimitCocone
                          (F ⋙ forget₂ (ModuleCatMax R) AddCommGroupCat)).pt),
                  ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
          (Quot.mk
            (Types.Quot.Rel
              ((((F ⋙ forget₂ (ModuleCat R) AddCommGroupCat) ⋙ forget₂ AddCommGroupCat AddGroupCat) ⋙
                  forget₂ AddGroupCat AddMonCat) ⋙
                forget AddMonCat))
            a)

Next tactic:
clear x