l3lab/ntp-mathlib huggingface dataset:
/-- The plus construction, associating a presheaf to any presheaf.
See `plusFunctor` below for a functorial version. -/
def plusObj : Cᵒᵖ ⥤ D where
  obj X := colimit (J.diagram P X.unop)
  map f := colimMap (J.diagramPullback P f.unop) ≫ colimit.pre _ _
  map_id := by
    intro X
    refine' colimit.hom_ext (fun S => _)
    dsimp
    simp only [diagramPullback_app, colimit.ι_pre, ι_colimMap_assoc, Category.comp_id]
    let e := S.unop.pullbackId
    dsimp only [Functor.op, pullback_obj]
    erw [← colimit.w _ e.inv.op, ← Category.assoc]
    convert Category.id_comp (colimit.ι (diagram J P (unop X)) S)
    refine' Multiequalizer.hom_ext _ _ _ (fun I => _)
    dsimp
    simp only [Multiequalizer.lift_ι, Category.id_comp, Category.assoc]
    dsimp [Cover.Arrow.map, Cover.Arrow.base]
    cases I
    congr
    simp
  map_comp := by
    intro X Y Z f g
    refine' colimit.hom_ext (fun S => _)
    dsimp
    simp only [diagramPullback_app, colimit.ι_pre_assoc, colimit.ι_pre, ι_colimMap_assoc,
      Category.assoc]
    let e := S.unop.pullbackComp g.unop f.unop
    dsimp only [Functor.op, pullback_obj]
    erw [← colimit.w _ e.inv.op, ← Category.assoc, ← Category.assoc]
    congr 1
    refine' Multiequalizer.hom_ext _ _ _ (fun I => _)
    dsimp
    simp only [Multiequalizer.lift_ι, Category.assoc]
    cases I
    dsimp only [Cover.Arrow.base, Cover.Arrow.map]
    congr 2
    

Proof state:
case e_a.mk.h.e_5.h.e_f
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
X Y Z : Cᵒᵖ
f : X ⟶ Y
g : Y ⟶ Z
S : (Cover J X.unop)ᵒᵖ
e : Cover.pullback S.unop (g.unop ≫ f.unop) ≅ Cover.pullback (Cover.pullback S.unop f.unop) g.unop :=
  Cover.pullbackComp S.unop g.unop f.unop
Y✝ : C
f✝ : Y✝ ⟶ Z.unop
hf✝ : (Cover.sieve (op (Cover.pullback (Cover.pullback S.unop f.unop) g.unop)).unop).arrows f✝
⊢ f✝ ≫ g.unop ≫ f.unop = (f✝ ≫ g.unop) ≫ f.unop

Next tactic:
simp
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
⊢ ∀ ⦃X Y : Cᵒᵖ⦄ (f : X ⟶ Y),
    (plusObj J P).map f ≫ (fun X => colimMap (diagramNatTrans J η X.unop)) Y =
      (fun X => colimMap (diagramNatTrans J η X.unop)) X ≫ (plusObj J Q).map f

Next tactic:
intro X Y f
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
⊢ (plusObj J P).map f ≫ (fun X => colimMap (diagramNatTrans J η X.unop)) Y =
    (fun X => colimMap (diagramNatTrans J η X.unop)) X ≫ (plusObj J Q).map f

Next tactic:
dsimp [plusObj]
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    dsimp [plusObj]
    

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
⊢ (colimMap (diagramPullback J P f.unop) ≫ colimit.pre (diagram J P Y.unop) (pullback J f.unop).op) ≫
      colimMap (diagramNatTrans J η Y.unop) =
    colimMap (diagramNatTrans J η X.unop) ≫
      colimMap (diagramPullback J Q f.unop) ≫ colimit.pre (diagram J Q Y.unop) (pullback J f.unop).op

Next tactic:
ext
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    dsimp [plusObj]
    ext
    

Proof state:
case w
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
j✝ : (Cover J X.unop)ᵒᵖ
⊢ colimit.ι (diagram J P X.unop) j✝ ≫
      (colimMap (diagramPullback J P f.unop) ≫ colimit.pre (diagram J P Y.unop) (pullback J f.unop).op) ≫
        colimMap (diagramNatTrans J η Y.unop) =
    colimit.ι (diagram J P X.unop) j✝ ≫
      colimMap (diagramNatTrans J η X.unop) ≫
        colimMap (diagramPullback J Q f.unop) ≫ colimit.pre (diagram J Q Y.unop) (pullback J f.unop).op

Next tactic:
simp only [diagramPullback_app, ι_colimMap, colimit.ι_pre_assoc, colimit.ι_pre,
      ι_colimMap_assoc, Category.assoc]
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    dsimp [plusObj]
    ext
    simp only [diagramPullback_app, ι_colimMap, colimit.ι_pre_assoc, colimit.ι_pre,
      ι_colimMap_assoc, Category.assoc]
    

Proof state:
case w
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
j✝ : (Cover J X.unop)ᵒᵖ
⊢ Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop P) ((diagram J P X.unop).obj j✝)
        (fun I => Multiequalizer.ι (Cover.index j✝.unop P) (Cover.Arrow.base I))
        (_ :
          ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop P).R),
            Multiequalizer.ι (Cover.index j✝.unop P)
                  (MulticospanIndex.fstTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                MulticospanIndex.fst (Cover.index j✝.unop P) (Cover.Relation.base I) =
              Multiequalizer.ι (Cover.index j✝.unop P)
                  (MulticospanIndex.sndTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                MulticospanIndex.snd (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
      (diagramNatTrans J η Y.unop).app ((pullback J f.unop).op.obj j✝) ≫
        colimit.ι (diagram J Q Y.unop) ((pullback J f.unop).op.obj j✝) =
    (diagramNatTrans J η X.unop).app j✝ ≫
      Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop Q) ((diagram J Q X.unop).obj j✝)
          (fun I => Multiequalizer.ι (Cover.index j✝.unop Q) (Cover.Arrow.base I))
          (_ :
            ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop Q).R),
              Multiequalizer.ι (Cover.index j✝.unop Q)
                    (MulticospanIndex.fstTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                  MulticospanIndex.fst (Cover.index j✝.unop Q) (Cover.Relation.base I) =
                Multiequalizer.ι (Cover.index j✝.unop Q)
                    (MulticospanIndex.sndTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                  MulticospanIndex.snd (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
        colimit.ι (diagram J Q Y.unop) ((pullback J f.unop).op.obj j✝)

Next tactic:
simp_rw [← Category.assoc]
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    dsimp [plusObj]
    ext
    simp only [diagramPullback_app, ι_colimMap, colimit.ι_pre_assoc, colimit.ι_pre,
      ι_colimMap_assoc, Category.assoc]
    simp_rw [← Category.assoc]
    

Proof state:
case w
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
j✝ : (Cover J X.unop)ᵒᵖ
⊢ (Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop P) ((diagram J P X.unop).obj j✝)
          (fun I => Multiequalizer.ι (Cover.index j✝.unop P) (Cover.Arrow.base I))
          (_ :
            ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop P).R),
              Multiequalizer.ι (Cover.index j✝.unop P)
                    (MulticospanIndex.fstTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                  MulticospanIndex.fst (Cover.index j✝.unop P) (Cover.Relation.base I) =
                Multiequalizer.ι (Cover.index j✝.unop P)
                    (MulticospanIndex.sndTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                  MulticospanIndex.snd (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
        (diagramNatTrans J η Y.unop).app ((pullback J f.unop).op.obj j✝)) ≫
      colimit.ι (diagram J Q Y.unop) ((pullback J f.unop).op.obj j✝) =
    ((diagramNatTrans J η X.unop).app j✝ ≫
        Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop Q) ((diagram J Q X.unop).obj j✝)
          (fun I => Multiequalizer.ι (Cover.index j✝.unop Q) (Cover.Arrow.base I))
          (_ :
            ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop Q).R),
              Multiequalizer.ι (Cover.index j✝.unop Q)
                    (MulticospanIndex.fstTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                  MulticospanIndex.fst (Cover.index j✝.unop Q) (Cover.Relation.base I) =
                Multiequalizer.ι (Cover.index j✝.unop Q)
                    (MulticospanIndex.sndTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                  MulticospanIndex.snd (Cover.index j✝.unop Q) (Cover.Relation.base I))) ≫
      colimit.ι (diagram J Q Y.unop) ((pullback J f.unop).op.obj j✝)

Next tactic:
congr 1
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    dsimp [plusObj]
    ext
    simp only [diagramPullback_app, ι_colimMap, colimit.ι_pre_assoc, colimit.ι_pre,
      ι_colimMap_assoc, Category.assoc]
    simp_rw [← Category.assoc]
    congr 1
    

Proof state:
case w.e_a
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
j✝ : (Cover J X.unop)ᵒᵖ
⊢ Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop P) ((diagram J P X.unop).obj j✝)
        (fun I => Multiequalizer.ι (Cover.index j✝.unop P) (Cover.Arrow.base I))
        (_ :
          ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop P).R),
            Multiequalizer.ι (Cover.index j✝.unop P)
                  (MulticospanIndex.fstTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                MulticospanIndex.fst (Cover.index j✝.unop P) (Cover.Relation.base I) =
              Multiequalizer.ι (Cover.index j✝.unop P)
                  (MulticospanIndex.sndTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                MulticospanIndex.snd (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
      (diagramNatTrans J η Y.unop).app ((pullback J f.unop).op.obj j✝) =
    (diagramNatTrans J η X.unop).app j✝ ≫
      Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop Q) ((diagram J Q X.unop).obj j✝)
        (fun I => Multiequalizer.ι (Cover.index j✝.unop Q) (Cover.Arrow.base I))
        (_ :
          ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop Q).R),
            Multiequalizer.ι (Cover.index j✝.unop Q)
                  (MulticospanIndex.fstTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                MulticospanIndex.fst (Cover.index j✝.unop Q) (Cover.Relation.base I) =
              Multiequalizer.ι (Cover.index j✝.unop Q)
                  (MulticospanIndex.sndTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                MulticospanIndex.snd (Cover.index j✝.unop Q) (Cover.Relation.base I))

Next tactic:
exact Multiequalizer.hom_ext _ _ _ (fun I => by dsimp; simp)
/-- An auxiliary definition used in `plus` below. -/
def plusMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.plusObj P ⟶ J.plusObj Q where
  app X := colimMap (J.diagramNatTrans η X.unop)
  naturality := by
    intro X Y f
    dsimp [plusObj]
    ext
    simp only [diagramPullback_app, ι_colimMap, colimit.ι_pre_assoc, colimit.ι_pre,
      ι_colimMap_assoc, Category.assoc]
    simp_rw [← Category.assoc]
    congr 1
    exact Multiequalizer.hom_ext _ _ _ (fun I => by 

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q : Cᵒᵖ ⥤ D
η : P ⟶ Q
X Y : Cᵒᵖ
f : X ⟶ Y
j✝ : (Cover J X.unop)ᵒᵖ
I : (Cover.index ((pullback J f.unop).op.obj j✝).unop Q).L
⊢ (Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop P) ((diagram J P X.unop).obj j✝)
          (fun I => Multiequalizer.ι (Cover.index j✝.unop P) (Cover.Arrow.base I))
          (_ :
            ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop P).R),
              Multiequalizer.ι (Cover.index j✝.unop P)
                    (MulticospanIndex.fstTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                  MulticospanIndex.fst (Cover.index j✝.unop P) (Cover.Relation.base I) =
                Multiequalizer.ι (Cover.index j✝.unop P)
                    (MulticospanIndex.sndTo (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
                  MulticospanIndex.snd (Cover.index j✝.unop P) (Cover.Relation.base I)) ≫
        (diagramNatTrans J η Y.unop).app ((pullback J f.unop).op.obj j✝)) ≫
      Multiequalizer.ι (Cover.index ((pullback J f.unop).op.obj j✝).unop Q) I =
    ((diagramNatTrans J η X.unop).app j✝ ≫
        Multiequalizer.lift (Cover.index ((pullback J f.unop).op.obj j✝).unop Q) ((diagram J Q X.unop).obj j✝)
          (fun I => Multiequalizer.ι (Cover.index j✝.unop Q) (Cover.Arrow.base I))
          (_ :
            ∀ (I : (Cover.index ((pullback J f.unop).op.obj j✝).unop Q).R),
              Multiequalizer.ι (Cover.index j✝.unop Q)
                    (MulticospanIndex.fstTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                  MulticospanIndex.fst (Cover.index j✝.unop Q) (Cover.Relation.base I) =
                Multiequalizer.ι (Cover.index j✝.unop Q)
                    (MulticospanIndex.sndTo (Cover.index j✝.unop Q) (Cover.Relation.base I)) ≫
                  MulticospanIndex.snd (Cover.index j✝.unop Q) (Cover.Relation.base I))) ≫
      Multiequalizer.ι (Cover.index ((pullback J f.unop).op.obj j✝).unop Q) I

Next tactic:
dsimp
@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _ := by
  

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P : Cᵒᵖ ⥤ D
⊢ plusMap J (𝟙 P) = 𝟙 (plusObj J P)

Next tactic:
ext : 2
@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _ := by
  ext : 2
  

Proof state:
case w.h
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
⊢ (plusMap J (𝟙 P)).app x✝ = (𝟙 (plusObj J P)).app x✝

Next tactic:
dsimp only [plusMap, plusObj]
@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _ := by
  ext : 2
  dsimp only [plusMap, plusObj]
  

Proof state:
case w.h
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
⊢ colimMap (diagramNatTrans J (𝟙 P) x✝.unop) =
    (𝟙
          (Functor.mk
            { obj := fun X => colimit (diagram J P X.unop),
              map := fun {X Y} f =>
                colimMap (diagramPullback J P f.unop) ≫ colimit.pre (diagram J P Y.unop) (pullback J f.unop).op })).app
      x✝

Next tactic:
rw [J.diagramNatTrans_id, NatTrans.id_app]
@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _ := by
  ext : 2
  dsimp only [plusMap, plusObj]
  rw [J.diagramNatTrans_id, NatTrans.id_app]
  

Proof state:
case w.h
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
⊢ colimMap (𝟙 (diagram J P x✝.unop)) =
    𝟙
      ((Functor.mk
            { obj := fun X => colimit (diagram J P X.unop),
              map := fun {X Y} f =>
                colimMap (diagramPullback J P f.unop) ≫ colimit.pre (diagram J P Y.unop) (pullback J f.unop).op }).obj
        x✝)

Next tactic:
ext
@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _ := by
  ext : 2
  dsimp only [plusMap, plusObj]
  rw [J.diagramNatTrans_id, NatTrans.id_app]
  ext
  

Proof state:
case w.h.w
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
j✝ : (Cover J x✝.unop)ᵒᵖ
⊢ colimit.ι (diagram J P x✝.unop) j✝ ≫ colimMap (𝟙 (diagram J P x✝.unop)) =
    colimit.ι (diagram J P x✝.unop) j✝ ≫
      𝟙
        ((Functor.mk
              { obj := fun X => colimit (diagram J P X.unop),
                map := fun {X Y} f =>
                  colimMap (diagramPullback J P f.unop) ≫ colimit.pre (diagram J P Y.unop) (pullback J f.unop).op }).obj
          x✝)

Next tactic:
dsimp
@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _ := by
  ext : 2
  dsimp only [plusMap, plusObj]
  rw [J.diagramNatTrans_id, NatTrans.id_app]
  ext
  dsimp
  

Proof state:
case w.h.w
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
j✝ : (Cover J x✝.unop)ᵒᵖ
⊢ colimit.ι (diagram J P x✝.unop) j✝ ≫ colimMap (𝟙 (diagram J P x✝.unop)) =
    colimit.ι (diagram J P x✝.unop) j✝ ≫ 𝟙 (colimit (diagram J P x✝.unop))

Next tactic:
simp
@[simp]
theorem plusMap_zero [Preadditive D] (P Q : Cᵒᵖ ⥤ D) : J.plusMap (0 : P ⟶ Q) = 0 := by
  

Proof state:
C : Type u
inst✝⁴ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝³ : Category.{max v u, w} D
inst✝² : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝¹ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
inst✝ : Preadditive D
P Q : Cᵒᵖ ⥤ D
⊢ plusMap J 0 = 0

Next tactic:
ext : 2
@[simp]
theorem plusMap_zero [Preadditive D] (P Q : Cᵒᵖ ⥤ D) : J.plusMap (0 : P ⟶ Q) = 0 := by
  ext : 2
  

Proof state:
case w.h
C : Type u
inst✝⁴ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝³ : Category.{max v u, w} D
inst✝² : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝¹ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
inst✝ : Preadditive D
P Q : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
⊢ (plusMap J 0).app x✝ = 0.app x✝

Next tactic:
refine' colimit.hom_ext (fun S => _)
@[simp]
theorem plusMap_zero [Preadditive D] (P Q : Cᵒᵖ ⥤ D) : J.plusMap (0 : P ⟶ Q) = 0 := by
  ext : 2
  refine' colimit.hom_ext (fun S => _)
  

Proof state:
case w.h
C : Type u
inst✝⁴ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝³ : Category.{max v u, w} D
inst✝² : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝¹ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
inst✝ : Preadditive D
P Q : Cᵒᵖ ⥤ D
x✝ : Cᵒᵖ
S : (Cover J x✝.unop)ᵒᵖ
⊢ colimit.ι (diagram J P x✝.unop) S ≫ (plusMap J 0).app x✝ = colimit.ι (diagram J P x✝.unop) S ≫ 0.app x✝

Next tactic:
erw [comp_zero, colimit.ι_map, J.diagramNatTrans_zero, zero_comp]
@[simp]
theorem plusMap_comp {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) :
    J.plusMap (η ≫ γ) = J.plusMap η ≫ J.plusMap γ := by
  

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q R : Cᵒᵖ ⥤ D
η : P ⟶ Q
γ : Q ⟶ R
⊢ plusMap J (η ≫ γ) = plusMap J η ≫ plusMap J γ

Next tactic:
ext : 2
@[simp]
theorem plusMap_comp {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) :
    J.plusMap (η ≫ γ) = J.plusMap η ≫ J.plusMap γ := by
  ext : 2
  

Proof state:
case w.h
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q R : Cᵒᵖ ⥤ D
η : P ⟶ Q
γ : Q ⟶ R
x✝ : Cᵒᵖ
⊢ (plusMap J (η ≫ γ)).app x✝ = (plusMap J η ≫ plusMap J γ).app x✝

Next tactic:
refine' colimit.hom_ext (fun S => _)
@[simp]
theorem plusMap_comp {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) :
    J.plusMap (η ≫ γ) = J.plusMap η ≫ J.plusMap γ := by
  ext : 2
  refine' colimit.hom_ext (fun S => _)
  

Proof state:
case w.h
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P✝ : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
P Q R : Cᵒᵖ ⥤ D
η : P ⟶ Q
γ : Q ⟶ R
x✝ : Cᵒᵖ
S : (Cover J x✝.unop)ᵒᵖ
⊢ colimit.ι (diagram J P x✝.unop) S ≫ (plusMap J (η ≫ γ)).app x✝ =
    colimit.ι (diagram J P x✝.unop) S ≫ (plusMap J η ≫ plusMap J γ).app x✝

Next tactic:
simp [plusMap, J.diagramNatTrans_comp]
/-- The canonical map from `P` to `J.plusObj P`.
See `toPlusNatTrans` for a functorial version. -/
def toPlus : P ⟶ J.plusObj P where
  app X := Cover.toMultiequalizer (⊤ : J.Cover X.unop) P ≫ colimit.ι (J.diagram P X.unop) (op ⊤)
  naturality := by
    

Proof state:
C : Type u
inst✝³ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w
inst✝² : Category.{max v u, w} D
inst✝¹ : ∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : Cover J X), HasMultiequalizer (Cover.index S P)
P : Cᵒᵖ ⥤ D
inst✝ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
⊢ ∀ ⦃X Y : Cᵒᵖ⦄ (f : X ⟶ Y),
    P.map f ≫ (fun X => Cover.toMultiequalizer ⊤ P ≫ colimit.ι (diagram J P X.unop) (op ⊤)) Y =
      (fun X => Cover.toMultiequalizer ⊤ P ≫ colimit.ι (diagram J P X.unop) (op ⊤)) X ≫ (plusObj J P).map f

Next tactic:
intro X Y f