l3lab/ntp-mathlib huggingface dataset:
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
abbrev liftToDiagramLimitObj {X : C} {K : Type max v u} [SmallCategory K] [HasLimitsOfShape K D]
    {W : (J.Cover X)ᵒᵖ} (F : K ⥤ Cᵒᵖ ⥤ D)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj W)) :
    E.pt ⟶ (J.diagram (limit F) X).obj W :=
  Multiequalizer.lift ((unop W).index (limit F)) E.pt
    (fun i => (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F)).lift
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation.{w, v, u} i E))
    (by
      intro i
      change (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
      dsimp [evaluateCombinedCones]
      

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
W : (Cover J X)ᵒᵖ
F : K ⥤ Cᵒᵖ ⥤ D
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
i : (Cover.index W.unop (limit F)).R
⊢ ((limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y))
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
              (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i) E) ≫
          𝟙
            (getLimitCone
                  ((Functor.flip F).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y))).cone.pt) ≫
        (limit.lift F (combineCones F fun k => getLimitCone ((Functor.flip F).obj k))).app
          (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y)) ≫
      MulticospanIndex.fst (Cover.index W.unop (limit F)) i =
    ((limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y))
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
              (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) E) ≫
          𝟙
            (getLimitCone
                  ((Functor.flip F).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y))).cone.pt) ≫
        (limit.lift F (combineCones F fun k => getLimitCone ((Functor.flip F).obj k))).app
          (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y)) ≫
      MulticospanIndex.snd (Cover.index W.unop (limit F)) i

Next tactic:
erw [Category.comp_id, Category.comp_id, Category.assoc, Category.assoc, ←
        (limit.lift F _).naturality, ← (limit.lift F _).naturality, ← Category.assoc, ←
        Category.assoc]
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
abbrev liftToDiagramLimitObj {X : C} {K : Type max v u} [SmallCategory K] [HasLimitsOfShape K D]
    {W : (J.Cover X)ᵒᵖ} (F : K ⥤ Cᵒᵖ ⥤ D)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj W)) :
    E.pt ⟶ (J.diagram (limit F) X).obj W :=
  Multiequalizer.lift ((unop W).index (limit F)) E.pt
    (fun i => (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F)).lift
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation.{w, v, u} i E))
    (by
      intro i
      change (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
      dsimp [evaluateCombinedCones]
      erw [Category.comp_id, Category.comp_id, Category.assoc, Category.assoc, ←
        (limit.lift F _).naturality, ← (limit.lift F _).naturality, ← Category.assoc, ←
        Category.assoc]
      

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
W : (Cover J X)ᵒᵖ
F : K ⥤ Cᵒᵖ ⥤ D
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
i : (Cover.index W.unop (limit F)).R
⊢ (limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y))
          (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
            (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i) E) ≫
        (combineCones F fun k => getLimitCone ((Functor.flip F).obj k)).pt.map i.g₁.op) ≫
      (limit.lift F (combineCones F fun k => getLimitCone ((Functor.flip F).obj k))).app (op i.Z) =
    (limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y))
          (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
            (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) E) ≫
        (combineCones F fun k => getLimitCone ((Functor.flip F).obj k)).pt.map i.g₂.op) ≫
      (limit.lift F (combineCones F fun k => getLimitCone ((Functor.flip F).obj k))).app (op i.Z)

Next tactic:
congr 1
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
abbrev liftToDiagramLimitObj {X : C} {K : Type max v u} [SmallCategory K] [HasLimitsOfShape K D]
    {W : (J.Cover X)ᵒᵖ} (F : K ⥤ Cᵒᵖ ⥤ D)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj W)) :
    E.pt ⟶ (J.diagram (limit F) X).obj W :=
  Multiequalizer.lift ((unop W).index (limit F)) E.pt
    (fun i => (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F)).lift
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation.{w, v, u} i E))
    (by
      intro i
      change (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
      dsimp [evaluateCombinedCones]
      erw [Category.comp_id, Category.comp_id, Category.assoc, Category.assoc, ←
        (limit.lift F _).naturality, ← (limit.lift F _).naturality, ← Category.assoc, ←
        Category.assoc]
      congr 1
      

Proof state:
case 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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
W : (Cover J X)ᵒᵖ
F : K ⥤ Cᵒᵖ ⥤ D
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
i : (Cover.index W.unop (limit F)).R
⊢ limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y))
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
          (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i) E) ≫
      (combineCones F fun k => getLimitCone ((Functor.flip F).obj k)).pt.map i.g₁.op =
    limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y))
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
          (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) E) ≫
      (combineCones F fun k => getLimitCone ((Functor.flip F).obj k)).pt.map i.g₂.op

Next tactic:
refine' limit.hom_ext (fun j => _)
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
abbrev liftToDiagramLimitObj {X : C} {K : Type max v u} [SmallCategory K] [HasLimitsOfShape K D]
    {W : (J.Cover X)ᵒᵖ} (F : K ⥤ Cᵒᵖ ⥤ D)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj W)) :
    E.pt ⟶ (J.diagram (limit F) X).obj W :=
  Multiequalizer.lift ((unop W).index (limit F)) E.pt
    (fun i => (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F)).lift
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation.{w, v, u} i E))
    (by
      intro i
      change (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
      dsimp [evaluateCombinedCones]
      erw [Category.comp_id, Category.comp_id, Category.assoc, Category.assoc, ←
        (limit.lift F _).naturality, ← (limit.lift F _).naturality, ← Category.assoc, ←
        Category.assoc]
      congr 1
      refine' limit.hom_ext (fun j => _)
      

Proof state:
case 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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
W : (Cover J X)ᵒᵖ
F : K ⥤ Cᵒᵖ ⥤ D
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
i : (Cover.index W.unop (limit F)).R
j : K
⊢ (limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y))
          (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
            (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i) E) ≫
        (combineCones F fun k => getLimitCone ((Functor.flip F).obj k)).pt.map i.g₁.op) ≫
      limit.π ((Functor.flip F).obj (op i.Z)) j =
    (limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y))
          (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
            (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) E) ≫
        (combineCones F fun k => getLimitCone ((Functor.flip F).obj k)).pt.map i.g₂.op) ≫
      limit.π ((Functor.flip F).obj (op i.Z)) j

Next tactic:
erw [Category.assoc, Category.assoc, limit.lift_π, limit.lift_π, limit.lift_π_assoc,
        limit.lift_π_assoc, Category.assoc, Category.assoc, Multiequalizer.condition]
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
abbrev liftToDiagramLimitObj {X : C} {K : Type max v u} [SmallCategory K] [HasLimitsOfShape K D]
    {W : (J.Cover X)ᵒᵖ} (F : K ⥤ Cᵒᵖ ⥤ D)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj W)) :
    E.pt ⟶ (J.diagram (limit F) X).obj W :=
  Multiequalizer.lift ((unop W).index (limit F)) E.pt
    (fun i => (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F)).lift
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation.{w, v, u} i E))
    (by
      intro i
      change (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
      dsimp [evaluateCombinedCones]
      erw [Category.comp_id, Category.comp_id, Category.assoc, Category.assoc, ←
        (limit.lift F _).naturality, ← (limit.lift F _).naturality, ← Category.assoc, ←
        Category.assoc]
      congr 1
      refine' limit.hom_ext (fun j => _)
      erw [Category.assoc, Category.assoc, limit.lift_π, limit.lift_π, limit.lift_π_assoc,
        limit.lift_π_assoc, Category.assoc, Category.assoc, Multiequalizer.condition]
      

Proof state:
case 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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
W : (Cover J X)ᵒᵖ
F : K ⥤ Cᵒᵖ ⥤ D
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
i : (Cover.index W.unop (limit F)).R
j : K
⊢ E.π.app j ≫
      Multiequalizer.ι (Cover.index W.unop (F.obj j)) (MulticospanIndex.sndTo (Cover.index W.unop (F.obj j)) i) ≫
        MulticospanIndex.snd (Cover.index W.unop (F.obj j)) i =
    E.π.app j ≫
      Multiequalizer.ι (Cover.index W.unop (F.obj j)) (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) ≫
        ((Functor.flip F).map i.g₂.op).app j

Next tactic:
rfl
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := 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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
⊢ ∀ (s : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)) (j : K),
    (fun E => liftToDiagramLimitObj F E) s ≫
        ((diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W).mapCone (limit.cone F)).π.app j =
      s.π.app j

Next tactic:
intro E k
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
⊢ (fun E => liftToDiagramLimitObj F E) E ≫
      ((diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W).mapCone (limit.cone F)).π.app k =
    E.π.app k

Next tactic:
dsimp [diagramNatTrans]
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
⊢ liftToDiagramLimitObj F E ≫
      Multiequalizer.lift (Cover.index W.unop (F.obj k)) (multiequalizer (Cover.index W.unop (limit F)))
        (fun i => Multiequalizer.ι (Cover.index W.unop (limit F)) i ≫ (limit.π F k).app (op i.Y))
        (_ :
          ∀ (i : (Cover.index W.unop (F.obj k)).R),
            (fun i => Multiequalizer.ι (Cover.index W.unop (limit F)) i ≫ (limit.π F k).app (op i.Y))
                  (MulticospanIndex.fstTo (Cover.index W.unop (F.obj k)) i) ≫
                MulticospanIndex.fst (Cover.index W.unop (F.obj k)) i =
              (fun i => Multiequalizer.ι (Cover.index W.unop (limit F)) i ≫ (limit.π F k).app (op i.Y))
                  (MulticospanIndex.sndTo (Cover.index W.unop (F.obj k)) i) ≫
                MulticospanIndex.snd (Cover.index W.unop (F.obj k)) i) =
    E.π.app k

Next tactic:
refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
a : (Cover.index W.unop (F.obj k)).L
⊢ (liftToDiagramLimitObj F E ≫
        Multiequalizer.lift (Cover.index W.unop (F.obj k)) (multiequalizer (Cover.index W.unop (limit F)))
          (fun i => Multiequalizer.ι (Cover.index W.unop (limit F)) i ≫ (limit.π F k).app (op i.Y))
          (_ :
            ∀ (i : (Cover.index W.unop (F.obj k)).R),
              (fun i => Multiequalizer.ι (Cover.index W.unop (limit F)) i ≫ (limit.π F k).app (op i.Y))
                    (MulticospanIndex.fstTo (Cover.index W.unop (F.obj k)) i) ≫
                  MulticospanIndex.fst (Cover.index W.unop (F.obj k)) i =
                (fun i => Multiequalizer.ι (Cover.index W.unop (limit F)) i ≫ (limit.π F k).app (op i.Y))
                    (MulticospanIndex.sndTo (Cover.index W.unop (F.obj k)) i) ≫
                  MulticospanIndex.snd (Cover.index W.unop (F.obj k)) i)) ≫
      Multiequalizer.ι (Cover.index W.unop (F.obj k)) a =
    E.π.app k ≫ Multiequalizer.ι (Cover.index W.unop (F.obj k)) a

Next tactic:
simp only [Multiequalizer.lift_ι, Multiequalizer.lift_ι_assoc, Category.assoc]
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
          simp only [Multiequalizer.lift_ι, Multiequalizer.lift_ι_assoc, Category.assoc]
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
a : (Cover.index W.unop (F.obj k)).L
⊢ IsLimit.lift (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op a.Y)) (limit.isLimit F))
        (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation a E) ≫
      (limit.π F k).app (op a.Y) =
    E.π.app k ≫ Multiequalizer.ι (Cover.index W.unop (F.obj k)) a

Next tactic:
change (_ ≫ _) ≫ _ = _
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
          simp only [Multiequalizer.lift_ι, Multiequalizer.lift_ι_assoc, Category.assoc]
          change (_ ≫ _) ≫ _ = _
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
a : (Cover.index W.unop (F.obj k)).L
⊢ ((IsLimit.liftConeMorphism
            (IsLimit.ofIsoLimit (limit.isLimit (F ⋙ (evaluation Cᵒᵖ D).obj (op a.Y)))
              (evaluateCombinedCones F (fun k => getLimitCone ((Functor.flip F).obj k)) (op a.Y)).symm)
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation a E)).hom ≫
        ((Cones.functoriality F ((evaluation Cᵒᵖ D).obj (op a.Y))).mapIso
              (IsLimit.uniqueUpToIso (combinedIsLimit F fun k => getLimitCone ((Functor.flip F).obj k))
                (limit.isLimit F))).hom.hom) ≫
      (limit.π F k).app (op a.Y) =
    E.π.app k ≫ Multiequalizer.ι (Cover.index W.unop (F.obj k)) a

Next tactic:
dsimp [evaluateCombinedCones]
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
          simp only [Multiequalizer.lift_ι, Multiequalizer.lift_ι_assoc, Category.assoc]
          change (_ ≫ _) ≫ _ = _
          dsimp [evaluateCombinedCones]
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
a : (Cover.index W.unop (F.obj k)).L
⊢ ((limit.lift (F ⋙ (evaluation Cᵒᵖ D).obj (op a.Y)) (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation a E) ≫
          𝟙 (getLimitCone ((Functor.flip F).obj (op a.Y))).cone.pt) ≫
        (limit.lift F (combineCones F fun k => getLimitCone ((Functor.flip F).obj k))).app (op a.Y)) ≫
      (limit.π F k).app (op a.Y) =
    E.π.app k ≫ Multiequalizer.ι (Cover.index W.unop (F.obj k)) a

Next tactic:
erw [Category.comp_id, Category.assoc, ← NatTrans.comp_app, limit.lift_π, limit.lift_π]
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
          simp only [Multiequalizer.lift_ι, Multiequalizer.lift_ι_assoc, Category.assoc]
          change (_ ≫ _) ≫ _ = _
          dsimp [evaluateCombinedCones]
          erw [Category.comp_id, Category.assoc, ← NatTrans.comp_app, limit.lift_π, limit.lift_π]
          

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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W)
k : K
a : (Cover.index W.unop (F.obj k)).L
⊢ (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation a E).π.app k =
    E.π.app k ≫ Multiequalizer.ι (Cover.index W.unop (F.obj k)) a

Next tactic:
rfl
instance preservesLimit_diagramFunctor
    (X : C) (K : Type max v u) [SmallCategory K] [HasLimitsOfShape K D] (F : K ⥤ Cᵒᵖ ⥤ D) :
    PreservesLimit F (J.diagramFunctor D X) :=
  preservesLimitOfEvaluation _ _ fun W =>
    preservesLimitOfPreservesLimitCone (limit.isLimit _)
      { lift := fun E => liftToDiagramLimitObj.{w, v, u} F E
        fac := by
          intro E k
          dsimp [diagramNatTrans]
          refine' Multiequalizer.hom_ext _ _ _ (fun a => _)
          simp only [Multiequalizer.lift_ι, Multiequalizer.lift_ι_assoc, Category.assoc]
          change (_ ≫ _) ≫ _ = _
          dsimp [evaluateCombinedCones]
          erw [Category.comp_id, Category.assoc, ← NatTrans.comp_app, limit.lift_π, limit.lift_π]
          rfl
        uniq := 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)
X : C
K : Type (max v u)
inst✝¹ : SmallCategory K
inst✝ : HasLimitsOfShape K D
F : K ⥤ Cᵒᵖ ⥤ D
W : (Cover J X)ᵒᵖ
⊢ ∀ (s : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W))
    (m : s.pt ⟶ ((diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W).mapCone (limit.cone F)).pt),
    (∀ (j : K),
        m ≫ ((diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj W).mapCone (limit.cone F)).π.app j = s.π.app j) →
      m = (fun E => liftToDiagramLimitObj F E) s

Next tactic:
intro E m hm