l3lab/ntp-mathlib huggingface dataset:
/-- Witness that the limit cone in `ModuleCat R` is a limit cone.
(Internal use only; use the limits API.)
-/
def limitConeIsLimit (F : J ⥤ ModuleCatMax.{v, w, u} R) : IsLimit (limitCone.{v, w} F) := by
  refine' IsLimit.ofFaithful (forget (ModuleCat R)) (Types.limitConeIsLimit.{v, w} _)
    (fun s => ⟨⟨(Types.limitConeIsLimit.{v, w} _).lift ((forget (ModuleCat R)).mapCone s), _⟩, _⟩)
    (fun s => rfl)
  all_goals
    intros
    dsimp [Types.limitConeIsLimit]
    

Proof state:
case refine'_1
R : Type u
inst✝¹ : Ring R
J : Type v
inst✝ : SmallCategory J
F : J ⥤ ModuleCatMax R
s : Cone F
x✝ y✝ : ↑s.pt
⊢ { val := fun j => (s.π.app j) (x✝ + y✝),
      property :=
        (_ :
          ∀ {j j' : J} (f : j ⟶ j'),
            (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) (x✝ + y✝) =
              ((forget (ModuleCat R)).mapCone s).π.app j' (x✝ + y✝)) } =
    { val := fun j => (s.π.app j) x✝,
        property :=
          (_ :
            ∀ {j j' : J} (f : j ⟶ j'),
              (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) x✝ =
                ((forget (ModuleCat R)).mapCone s).π.app j' x✝) } +
      { val := fun j => (s.π.app j) y✝,
        property :=
          (_ :
            ∀ {j j' : J} (f : j ⟶ j'),
              (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) y✝ =
                ((forget (ModuleCat R)).mapCone s).π.app j' y✝) }

Next tactic:
simp
/-- Witness that the limit cone in `ModuleCat R` is a limit cone.
(Internal use only; use the limits API.)
-/
def limitConeIsLimit (F : J ⥤ ModuleCatMax.{v, w, u} R) : IsLimit (limitCone.{v, w} F) := by
  refine' IsLimit.ofFaithful (forget (ModuleCat R)) (Types.limitConeIsLimit.{v, w} _)
    (fun s => ⟨⟨(Types.limitConeIsLimit.{v, w} _).lift ((forget (ModuleCat R)).mapCone s), _⟩, _⟩)
    (fun s => rfl)
  all_goals
    intros
    dsimp [Types.limitConeIsLimit]
    simp
    

Proof state:
case refine'_1
R : Type u
inst✝¹ : Ring R
J : Type v
inst✝ : SmallCategory J
F : J ⥤ ModuleCatMax R
s : Cone F
x✝ y✝ : ↑s.pt
⊢ { val := fun j => (s.π.app j) x✝ + (s.π.app j) y✝,
      property :=
        (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (ModuleCat R))) fun j => (s.π.app j) x✝ + (s.π.app j) y✝) } =
    { val := fun j => (s.π.app j) x✝,
        property :=
          (_ :
            ∀ {j j' : J} (f : j ⟶ j'),
              (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) x✝ =
                ((forget (ModuleCat R)).mapCone s).π.app j' x✝) } +
      { val := fun j => (s.π.app j) y✝,
        property :=
          (_ :
            ∀ {j j' : J} (f : j ⟶ j'),
              (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) y✝ =
                ((forget (ModuleCat R)).mapCone s).π.app j' y✝) }

Next tactic:
rfl
/-- Witness that the limit cone in `ModuleCat R` is a limit cone.
(Internal use only; use the limits API.)
-/
def limitConeIsLimit (F : J ⥤ ModuleCatMax.{v, w, u} R) : IsLimit (limitCone.{v, w} F) := by
  refine' IsLimit.ofFaithful (forget (ModuleCat R)) (Types.limitConeIsLimit.{v, w} _)
    (fun s => ⟨⟨(Types.limitConeIsLimit.{v, w} _).lift ((forget (ModuleCat R)).mapCone s), _⟩, _⟩)
    (fun s => rfl)
  all_goals
    

Proof state:
case refine'_2
R : Type u
inst✝¹ : Ring R
J : Type v
inst✝ : SmallCategory J
F : J ⥤ ModuleCatMax R
s : Cone F
⊢ ∀ (r : R) (x : ↑s.pt),
    AddHom.toFun
        { toFun := IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s),
          map_add' :=
            (_ :
              ∀ (x y : ↑s.pt),
                IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                    (x + y) =
                  IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                      x +
                    IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                      y) }
        (r • x) =
      (RingHom.id R) r •
        AddHom.toFun
          {
            toFun :=
              IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s),
            map_add' :=
              (_ :
                ∀ (x y : ↑s.pt),
                  IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                      (x + y) =
                    IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                        x +
                      IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R)))
                        ((forget (ModuleCat R)).mapCone s) y) }
          x

Next tactic:
intros
/-- Witness that the limit cone in `ModuleCat R` is a limit cone.
(Internal use only; use the limits API.)
-/
def limitConeIsLimit (F : J ⥤ ModuleCatMax.{v, w, u} R) : IsLimit (limitCone.{v, w} F) := by
  refine' IsLimit.ofFaithful (forget (ModuleCat R)) (Types.limitConeIsLimit.{v, w} _)
    (fun s => ⟨⟨(Types.limitConeIsLimit.{v, w} _).lift ((forget (ModuleCat R)).mapCone s), _⟩, _⟩)
    (fun s => rfl)
  all_goals
    intros
    

Proof state:
case refine'_2
R : Type u
inst✝¹ : Ring R
J : Type v
inst✝ : SmallCategory J
F : J ⥤ ModuleCatMax R
s : Cone F
r✝ : R
x✝ : ↑s.pt
⊢ AddHom.toFun
      { toFun := IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s),
        map_add' :=
          (_ :
            ∀ (x y : ↑s.pt),
              IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                  (x + y) =
                IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s) x +
                  IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                    y) }
      (r✝ • x✝) =
    (RingHom.id R) r✝ •
      AddHom.toFun
        { toFun := IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s),
          map_add' :=
            (_ :
              ∀ (x y : ↑s.pt),
                IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                    (x + y) =
                  IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                      x +
                    IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (ModuleCat R))) ((forget (ModuleCat R)).mapCone s)
                      y) }
        x✝

Next tactic:
dsimp [Types.limitConeIsLimit]
/-- Witness that the limit cone in `ModuleCat R` is a limit cone.
(Internal use only; use the limits API.)
-/
def limitConeIsLimit (F : J ⥤ ModuleCatMax.{v, w, u} R) : IsLimit (limitCone.{v, w} F) := by
  refine' IsLimit.ofFaithful (forget (ModuleCat R)) (Types.limitConeIsLimit.{v, w} _)
    (fun s => ⟨⟨(Types.limitConeIsLimit.{v, w} _).lift ((forget (ModuleCat R)).mapCone s), _⟩, _⟩)
    (fun s => rfl)
  all_goals
    intros
    dsimp [Types.limitConeIsLimit]
    

Proof state:
case refine'_2
R : Type u
inst✝¹ : Ring R
J : Type v
inst✝ : SmallCategory J
F : J ⥤ ModuleCatMax R
s : Cone F
r✝ : R
x✝ : ↑s.pt
⊢ { val := fun j => (s.π.app j) (r✝ • x✝),
      property :=
        (_ :
          ∀ {j j' : J} (f : j ⟶ j'),
            (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) (r✝ • x✝) =
              ((forget (ModuleCat R)).mapCone s).π.app j' (r✝ • x✝)) } =
    r✝ •
      { val := fun j => (s.π.app j) x✝,
        property :=
          (_ :
            ∀ {j j' : J} (f : j ⟶ j'),
              (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) x✝ =
                ((forget (ModuleCat R)).mapCone s).π.app j' x✝) }

Next tactic:
simp
/-- Witness that the limit cone in `ModuleCat R` is a limit cone.
(Internal use only; use the limits API.)
-/
def limitConeIsLimit (F : J ⥤ ModuleCatMax.{v, w, u} R) : IsLimit (limitCone.{v, w} F) := by
  refine' IsLimit.ofFaithful (forget (ModuleCat R)) (Types.limitConeIsLimit.{v, w} _)
    (fun s => ⟨⟨(Types.limitConeIsLimit.{v, w} _).lift ((forget (ModuleCat R)).mapCone s), _⟩, _⟩)
    (fun s => rfl)
  all_goals
    intros
    dsimp [Types.limitConeIsLimit]
    simp
    

Proof state:
case refine'_2
R : Type u
inst✝¹ : Ring R
J : Type v
inst✝ : SmallCategory J
F : J ⥤ ModuleCatMax R
s : Cone F
r✝ : R
x✝ : ↑s.pt
⊢ { val := fun j => r✝ • (s.π.app j) x✝,
      property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (ModuleCat R))) fun j => r✝ • (s.π.app j) x✝) } =
    r✝ •
      { val := fun j => (s.π.app j) x✝,
        property :=
          (_ :
            ∀ {j j' : J} (f : j ⟶ j'),
              (((forget (ModuleCat R)).mapCone s).π.app j ≫ (F ⋙ forget (ModuleCat R)).map f) x✝ =
                ((forget (ModuleCat R)).mapCone s).π.app j' x✝) }

Next tactic:
rfl
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    

Proof state:
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
i : ι
⊢ { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (𝟙 i) =
    𝟙 ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj i)

Next tactic:
apply LinearMap.ext
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    apply LinearMap.ext
    

Proof state:
case h
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
i : ι
⊢ ∀ (x : ↑({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj i)),
    ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (𝟙 i)) x =
      (𝟙 ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj i)) x

Next tactic:
intro x
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    apply LinearMap.ext
    intro x
    

Proof state:
case h
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
i : ι
x : ↑({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj i)
⊢ ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (𝟙 i)) x =
    (𝟙 ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj i)) x

Next tactic:
apply Module.DirectedSystem.map_self
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    apply LinearMap.ext
    intro x
    apply Module.DirectedSystem.map_self
  map_comp hij hjk := by
    

Proof state:
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
X✝ Y✝ Z✝ : ι
hij : X✝ ⟶ Y✝
hjk : Y✝ ⟶ Z✝
⊢ { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (hij ≫ hjk) =
    { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hij ≫
      { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hjk

Next tactic:
apply LinearMap.ext
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    apply LinearMap.ext
    intro x
    apply Module.DirectedSystem.map_self
  map_comp hij hjk := by
    apply LinearMap.ext
    

Proof state:
case h
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
X✝ Y✝ Z✝ : ι
hij : X✝ ⟶ Y✝
hjk : Y✝ ⟶ Z✝
⊢ ∀ (x : ↑({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj X✝)),
    ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (hij ≫ hjk)) x =
      ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hij ≫
          { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hjk)
        x

Next tactic:
intro x
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    apply LinearMap.ext
    intro x
    apply Module.DirectedSystem.map_self
  map_comp hij hjk := by
    apply LinearMap.ext
    intro x
    

Proof state:
case h
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
X✝ Y✝ Z✝ : ι
hij : X✝ ⟶ Y✝
hjk : Y✝ ⟶ Z✝
x : ↑({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj X✝)
⊢ ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (hij ≫ hjk)) x =
    ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hij ≫
        { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hjk)
      x

Next tactic:
symm
/-- The diagram (in the sense of `CategoryTheory`)
 of an unbundled `directLimit` of modules. -/
@[simps]
def directLimitDiagram : ι ⥤ ModuleCat R where
  obj i := ModuleCat.of R (G i)
  map hij := f _ _ hij.le
  map_id i := by
    apply LinearMap.ext
    intro x
    apply Module.DirectedSystem.map_self
  map_comp hij hjk := by
    apply LinearMap.ext
    intro x
    symm
    

Proof state:
case h
R : Type u
inst✝⁵ : Ring R
J : Type v
inst✝⁴ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type v
inst✝² : (i : ι) → AddCommGroup (G i)
inst✝¹ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝ : DirectedSystem G fun i j h => ⇑(f i j h)
X✝ Y✝ Z✝ : ι
hij : X✝ ⟶ Y✝
hjk : Y✝ ⟶ Z✝
x : ↑({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.obj X✝)
⊢ ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hij ≫
        { obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map hjk)
      x =
    ({ obj := fun i => of R (G i), map := fun {X Y} hij => f X Y (_ : X ≤ Y) }.map (hij ≫ hjk)) x

Next tactic:
apply Module.DirectedSystem.map_map
/-- The `Cocone` on `directLimitDiagram` corresponding to
the unbundled `directLimit` of modules.

In `directLimitIsColimit` we show that it is a colimit cocone. -/
@[simps]
def directLimitCocone : Cocone (directLimitDiagram G f) where
  pt := ModuleCat.of R <| DirectLimit G f
  ι :=
    { app := Module.DirectLimit.of R ι G f
      naturality := fun _ _ hij => by
        

Proof state:
R : Type u
inst✝⁶ : Ring R
J : Type v
inst✝⁵ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁴ : Preorder ι
G : ι → Type v
inst✝³ : (i : ι) → AddCommGroup (G i)
inst✝² : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : DecidableEq ι
x✝¹ x✝ : ι
hij : x✝¹ ⟶ x✝
⊢ (directLimitDiagram G f).map hij ≫ DirectLimit.of R ι G f x✝ =
    DirectLimit.of R ι G f x✝¹ ≫ ((Functor.const ι).obj (of R (DirectLimit G f))).map hij

Next tactic:
apply LinearMap.ext
/-- The `Cocone` on `directLimitDiagram` corresponding to
the unbundled `directLimit` of modules.

In `directLimitIsColimit` we show that it is a colimit cocone. -/
@[simps]
def directLimitCocone : Cocone (directLimitDiagram G f) where
  pt := ModuleCat.of R <| DirectLimit G f
  ι :=
    { app := Module.DirectLimit.of R ι G f
      naturality := fun _ _ hij => by
        apply LinearMap.ext
        

Proof state:
case h
R : Type u
inst✝⁶ : Ring R
J : Type v
inst✝⁵ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁴ : Preorder ι
G : ι → Type v
inst✝³ : (i : ι) → AddCommGroup (G i)
inst✝² : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : DecidableEq ι
x✝¹ x✝ : ι
hij : x✝¹ ⟶ x✝
⊢ ∀ (x : ↑((directLimitDiagram G f).obj x✝¹)),
    ((directLimitDiagram G f).map hij ≫ DirectLimit.of R ι G f x✝) x =
      (DirectLimit.of R ι G f x✝¹ ≫ ((Functor.const ι).obj (of R (DirectLimit G f))).map hij) x

Next tactic:
intro x
/-- The `Cocone` on `directLimitDiagram` corresponding to
the unbundled `directLimit` of modules.

In `directLimitIsColimit` we show that it is a colimit cocone. -/
@[simps]
def directLimitCocone : Cocone (directLimitDiagram G f) where
  pt := ModuleCat.of R <| DirectLimit G f
  ι :=
    { app := Module.DirectLimit.of R ι G f
      naturality := fun _ _ hij => by
        apply LinearMap.ext
        intro x
        

Proof state:
case h
R : Type u
inst✝⁶ : Ring R
J : Type v
inst✝⁵ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁴ : Preorder ι
G : ι → Type v
inst✝³ : (i : ι) → AddCommGroup (G i)
inst✝² : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝¹ : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝ : DecidableEq ι
x✝¹ x✝ : ι
hij : x✝¹ ⟶ x✝
x : ↑((directLimitDiagram G f).obj x✝¹)
⊢ ((directLimitDiagram G f).map hij ≫ DirectLimit.of R ι G f x✝) x =
    (DirectLimit.of R ι G f x✝¹ ≫ ((Functor.const ι).obj (of R (DirectLimit G f))).map hij) x

Next tactic:
exact DirectLimit.of_f
/-- The unbundled `directLimit` of modules is a colimit
in the sense of `CategoryTheory`. -/
@[simps]
def directLimitIsColimit [IsDirected ι (· ≤ ·)] : IsColimit (directLimitCocone G f)
    where
  desc s :=
    DirectLimit.lift R ι G f s.ι.app fun i j h x => by
      

Proof state:
R : Type u
inst✝⁷ : Ring R
J : Type v
inst✝⁶ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type v
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝² : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝¹ : DecidableEq ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
s : Cocone (directLimitDiagram G f)
i j : ι
h : i ≤ j
x : G i
⊢ (s.ι.app j) ((f i j h) x) = (s.ι.app i) x

Next tactic:
rw [← s.w (homOfLE h)]
/-- The unbundled `directLimit` of modules is a colimit
in the sense of `CategoryTheory`. -/
@[simps]
def directLimitIsColimit [IsDirected ι (· ≤ ·)] : IsColimit (directLimitCocone G f)
    where
  desc s :=
    DirectLimit.lift R ι G f s.ι.app fun i j h x => by
      rw [← s.w (homOfLE h)]
      

Proof state:
R : Type u
inst✝⁷ : Ring R
J : Type v
inst✝⁶ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type v
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝² : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝¹ : DecidableEq ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
s : Cocone (directLimitDiagram G f)
i j : ι
h : i ≤ j
x : G i
⊢ (s.ι.app j) ((f i j h) x) = ((directLimitDiagram G f).map (homOfLE h) ≫ s.ι.app j) x

Next tactic:
rfl
/-- The unbundled `directLimit` of modules is a colimit
in the sense of `CategoryTheory`. -/
@[simps]
def directLimitIsColimit [IsDirected ι (· ≤ ·)] : IsColimit (directLimitCocone G f)
    where
  desc s :=
    DirectLimit.lift R ι G f s.ι.app fun i j h x => by
      rw [← s.w (homOfLE h)]
      rfl
  fac s i := by
    

Proof state:
R : Type u
inst✝⁷ : Ring R
J : Type v
inst✝⁶ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type v
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝² : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝¹ : DecidableEq ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
s : Cocone (directLimitDiagram G f)
i : ι
⊢ (directLimitCocone G f).ι.app i ≫
      (fun s =>
          DirectLimit.lift R ι G f s.ι.app
            (_ : ∀ (i j : ι) (h : i ≤ j) (x : G i), (s.ι.app j) ((f i j h) x) = (s.ι.app i) x))
        s =
    s.ι.app i

Next tactic:
apply LinearMap.ext
/-- The unbundled `directLimit` of modules is a colimit
in the sense of `CategoryTheory`. -/
@[simps]
def directLimitIsColimit [IsDirected ι (· ≤ ·)] : IsColimit (directLimitCocone G f)
    where
  desc s :=
    DirectLimit.lift R ι G f s.ι.app fun i j h x => by
      rw [← s.w (homOfLE h)]
      rfl
  fac s i := by
    apply LinearMap.ext
    

Proof state:
case h
R : Type u
inst✝⁷ : Ring R
J : Type v
inst✝⁶ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type v
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝² : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝¹ : DecidableEq ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
s : Cocone (directLimitDiagram G f)
i : ι
⊢ ∀ (x : ↑((directLimitDiagram G f).obj i)),
    ((directLimitCocone G f).ι.app i ≫
          (fun s =>
              DirectLimit.lift R ι G f s.ι.app
                (_ : ∀ (i j : ι) (h : i ≤ j) (x : G i), (s.ι.app j) ((f i j h) x) = (s.ι.app i) x))
            s)
        x =
      (s.ι.app i) x

Next tactic:
intro x
/-- The unbundled `directLimit` of modules is a colimit
in the sense of `CategoryTheory`. -/
@[simps]
def directLimitIsColimit [IsDirected ι (· ≤ ·)] : IsColimit (directLimitCocone G f)
    where
  desc s :=
    DirectLimit.lift R ι G f s.ι.app fun i j h x => by
      rw [← s.w (homOfLE h)]
      rfl
  fac s i := by
    apply LinearMap.ext
    intro x
    

Proof state:
case h
R : Type u
inst✝⁷ : Ring R
J : Type v
inst✝⁶ : SmallCategory J
ι : Type v
dec_ι : DecidableEq ι
inst✝⁵ : Preorder ι
G : ι → Type v
inst✝⁴ : (i : ι) → AddCommGroup (G i)
inst✝³ : (i : ι) → Module R (G i)
f : (i j : ι) → i ≤ j → G i →ₗ[R] G j
inst✝² : DirectedSystem G fun i j h => ⇑(f i j h)
inst✝¹ : DecidableEq ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
s : Cocone (directLimitDiagram G f)
i : ι
x : ↑((directLimitDiagram G f).obj i)
⊢ ((directLimitCocone G f).ι.app i ≫
        (fun s =>
            DirectLimit.lift R ι G f s.ι.app
              (_ : ∀ (i j : ι) (h : i ≤ j) (x : G i), (s.ι.app j) ((f i j h) x) = (s.ι.app i) x))
          s)
      x =
    (s.ι.app i) x

Next tactic:
dsimp only [directLimitCocone, CategoryStruct.comp]