l3lab/ntp-mathlib huggingface dataset:
/-- `⨁ i, 𝓜 i` and `M` are isomorphic as `A`-modules.
"The internal version" and "the external version" are isomorphism as `A`-modules.
-/
def linearEquiv [DecidableEq ιA] [DecidableEq ιM] [GradedRing 𝓐] [DirectSum.Decomposition 𝓜] :
    @LinearEquiv A A _ _ (RingHom.id A) (RingHom.id A) _ _ M (⨁ i, 𝓜 i) _
    _ _ (by letI := isModule 𝓐 𝓜; infer_instance) := by
  letI h := isModule 𝓐 𝓜
  refine ⟨⟨(DirectSum.decomposeAddEquiv 𝓜).toAddHom, ?_⟩,
    (DirectSum.decomposeAddEquiv 𝓜).symm.toFun, (DirectSum.decomposeAddEquiv 𝓜).left_inv,
    (DirectSum.decomposeAddEquiv 𝓜).right_inv⟩
  intro x y
  classical
  rw [AddHom.toFun_eq_coe, ← DirectSum.sum_support_decompose 𝓐 x, map_sum, Finset.sum_smul,
    AddEquiv.coe_toAddHom, map_sum, Finset.sum_smul]
  refine Finset.sum_congr rfl (fun i _hi => ?_)
  rw [RingHom.id_apply, ← DirectSum.sum_support_decompose 𝓜 y, map_sum, Finset.smul_sum, map_sum,
    Finset.smul_sum]
  

Proof state:
ιA : Type u_1
ιM : Type u_2
R : Type u_3
A : Type u_4
M : Type u_5
σ : Type u_6
σ' : Type u_7
inst✝¹⁶ : AddMonoid ιA
inst✝¹⁵ : AddAction ιA ιM
inst✝¹⁴ : CommSemiring R
inst✝¹³ : Semiring A
inst✝¹² : Algebra R A
𝓐 : ιA → σ'
inst✝¹¹ : SetLike σ' A
𝓜 : ιM → σ
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module A M
inst✝⁸ : SetLike σ M
inst✝⁷ : AddSubmonoidClass σ' A
inst✝⁶ : AddSubmonoidClass σ M
inst✝⁵ : SetLike.GradedMonoid 𝓐
inst✝⁴ : SetLike.GradedSMul 𝓐 𝓜
inst✝³ : DecidableEq ιA
inst✝² : DecidableEq ιM
inst✝¹ : GradedRing 𝓐
inst✝ : Decomposition 𝓜
h : Module A (⨁ (i : ιM), ↥(𝓜 i)) := isModule 𝓐 𝓜
x : A
y : M
i : ιA
_hi : i ∈ DFinsupp.support ((decompose 𝓐) x)
⊢ ∑ x_1 in DFinsupp.support ((decompose 𝓜) y),
      (decomposeAddEquiv 𝓜) (↑(((decompose 𝓐) x) i) • ↑(((decompose 𝓜) y) x_1)) =
    ∑ x_1 in DFinsupp.support ((decompose 𝓜) y), ↑(((decompose 𝓐) x) i) • (decomposeAddEquiv 𝓜) ↑(((decompose 𝓜) y) x_1)

Next tactic:
refine Finset.sum_congr rfl (fun j _hj => ?_)
/-- `⨁ i, 𝓜 i` and `M` are isomorphic as `A`-modules.
"The internal version" and "the external version" are isomorphism as `A`-modules.
-/
def linearEquiv [DecidableEq ιA] [DecidableEq ιM] [GradedRing 𝓐] [DirectSum.Decomposition 𝓜] :
    @LinearEquiv A A _ _ (RingHom.id A) (RingHom.id A) _ _ M (⨁ i, 𝓜 i) _
    _ _ (by letI := isModule 𝓐 𝓜; infer_instance) := by
  letI h := isModule 𝓐 𝓜
  refine ⟨⟨(DirectSum.decomposeAddEquiv 𝓜).toAddHom, ?_⟩,
    (DirectSum.decomposeAddEquiv 𝓜).symm.toFun, (DirectSum.decomposeAddEquiv 𝓜).left_inv,
    (DirectSum.decomposeAddEquiv 𝓜).right_inv⟩
  intro x y
  classical
  rw [AddHom.toFun_eq_coe, ← DirectSum.sum_support_decompose 𝓐 x, map_sum, Finset.sum_smul,
    AddEquiv.coe_toAddHom, map_sum, Finset.sum_smul]
  refine Finset.sum_congr rfl (fun i _hi => ?_)
  rw [RingHom.id_apply, ← DirectSum.sum_support_decompose 𝓜 y, map_sum, Finset.smul_sum, map_sum,
    Finset.smul_sum]
  refine Finset.sum_congr rfl (fun j _hj => ?_)
  

Proof state:
ιA : Type u_1
ιM : Type u_2
R : Type u_3
A : Type u_4
M : Type u_5
σ : Type u_6
σ' : Type u_7
inst✝¹⁶ : AddMonoid ιA
inst✝¹⁵ : AddAction ιA ιM
inst✝¹⁴ : CommSemiring R
inst✝¹³ : Semiring A
inst✝¹² : Algebra R A
𝓐 : ιA → σ'
inst✝¹¹ : SetLike σ' A
𝓜 : ιM → σ
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module A M
inst✝⁸ : SetLike σ M
inst✝⁷ : AddSubmonoidClass σ' A
inst✝⁶ : AddSubmonoidClass σ M
inst✝⁵ : SetLike.GradedMonoid 𝓐
inst✝⁴ : SetLike.GradedSMul 𝓐 𝓜
inst✝³ : DecidableEq ιA
inst✝² : DecidableEq ιM
inst✝¹ : GradedRing 𝓐
inst✝ : Decomposition 𝓜
h : Module A (⨁ (i : ιM), ↥(𝓜 i)) := isModule 𝓐 𝓜
x : A
y : M
i : ιA
_hi : i ∈ DFinsupp.support ((decompose 𝓐) x)
j : ιM
_hj : j ∈ DFinsupp.support ((decompose 𝓜) y)
⊢ (decomposeAddEquiv 𝓜) (↑(((decompose 𝓐) x) i) • ↑(((decompose 𝓜) y) j)) =
    ↑(((decompose 𝓐) x) i) • (decomposeAddEquiv 𝓜) ↑(((decompose 𝓜) y) j)

Next tactic:
rw [show (decompose 𝓐 x i : A) • (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j) : (⨁ i, 𝓜 i)) =
    DirectSum.Gmodule.smulAddMonoidHom _ _ (decompose 𝓐 ↑(decompose 𝓐 x i))
    (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j)) from DirectSum.Gmodule.smul_def _ _ _ _]
/-- `⨁ i, 𝓜 i` and `M` are isomorphic as `A`-modules.
"The internal version" and "the external version" are isomorphism as `A`-modules.
-/
def linearEquiv [DecidableEq ιA] [DecidableEq ιM] [GradedRing 𝓐] [DirectSum.Decomposition 𝓜] :
    @LinearEquiv A A _ _ (RingHom.id A) (RingHom.id A) _ _ M (⨁ i, 𝓜 i) _
    _ _ (by letI := isModule 𝓐 𝓜; infer_instance) := by
  letI h := isModule 𝓐 𝓜
  refine ⟨⟨(DirectSum.decomposeAddEquiv 𝓜).toAddHom, ?_⟩,
    (DirectSum.decomposeAddEquiv 𝓜).symm.toFun, (DirectSum.decomposeAddEquiv 𝓜).left_inv,
    (DirectSum.decomposeAddEquiv 𝓜).right_inv⟩
  intro x y
  classical
  rw [AddHom.toFun_eq_coe, ← DirectSum.sum_support_decompose 𝓐 x, map_sum, Finset.sum_smul,
    AddEquiv.coe_toAddHom, map_sum, Finset.sum_smul]
  refine Finset.sum_congr rfl (fun i _hi => ?_)
  rw [RingHom.id_apply, ← DirectSum.sum_support_decompose 𝓜 y, map_sum, Finset.smul_sum, map_sum,
    Finset.smul_sum]
  refine Finset.sum_congr rfl (fun j _hj => ?_)
  rw [show (decompose 𝓐 x i : A) • (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j) : (⨁ i, 𝓜 i)) =
    DirectSum.Gmodule.smulAddMonoidHom _ _ (decompose 𝓐 ↑(decompose 𝓐 x i))
    (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j)) from DirectSum.Gmodule.smul_def _ _ _ _]
  

Proof state:
ιA : Type u_1
ιM : Type u_2
R : Type u_3
A : Type u_4
M : Type u_5
σ : Type u_6
σ' : Type u_7
inst✝¹⁶ : AddMonoid ιA
inst✝¹⁵ : AddAction ιA ιM
inst✝¹⁴ : CommSemiring R
inst✝¹³ : Semiring A
inst✝¹² : Algebra R A
𝓐 : ιA → σ'
inst✝¹¹ : SetLike σ' A
𝓜 : ιM → σ
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module A M
inst✝⁸ : SetLike σ M
inst✝⁷ : AddSubmonoidClass σ' A
inst✝⁶ : AddSubmonoidClass σ M
inst✝⁵ : SetLike.GradedMonoid 𝓐
inst✝⁴ : SetLike.GradedSMul 𝓐 𝓜
inst✝³ : DecidableEq ιA
inst✝² : DecidableEq ιM
inst✝¹ : GradedRing 𝓐
inst✝ : Decomposition 𝓜
h : Module A (⨁ (i : ιM), ↥(𝓜 i)) := isModule 𝓐 𝓜
x : A
y : M
i : ιA
_hi : i ∈ DFinsupp.support ((decompose 𝓐) x)
j : ιM
_hj : j ∈ DFinsupp.support ((decompose 𝓜) y)
⊢ (decomposeAddEquiv 𝓜) (↑(((decompose 𝓐) x) i) • ↑(((decompose 𝓜) y) j)) =
    ((Gmodule.smulAddMonoidHom (fun i => ↥(𝓐 i)) fun i => ↥(𝓜 i)) ((decompose 𝓐) ↑(((decompose 𝓐) x) i)))
      ((decomposeAddEquiv 𝓜) ↑(((decompose 𝓜) y) j))

Next tactic:
simp only [decomposeAddEquiv_apply, Equiv.invFun_as_coe, Equiv.symm_symm, decompose_coe,
    Gmodule.smulAddMonoidHom_apply_of_of]
/-- `⨁ i, 𝓜 i` and `M` are isomorphic as `A`-modules.
"The internal version" and "the external version" are isomorphism as `A`-modules.
-/
def linearEquiv [DecidableEq ιA] [DecidableEq ιM] [GradedRing 𝓐] [DirectSum.Decomposition 𝓜] :
    @LinearEquiv A A _ _ (RingHom.id A) (RingHom.id A) _ _ M (⨁ i, 𝓜 i) _
    _ _ (by letI := isModule 𝓐 𝓜; infer_instance) := by
  letI h := isModule 𝓐 𝓜
  refine ⟨⟨(DirectSum.decomposeAddEquiv 𝓜).toAddHom, ?_⟩,
    (DirectSum.decomposeAddEquiv 𝓜).symm.toFun, (DirectSum.decomposeAddEquiv 𝓜).left_inv,
    (DirectSum.decomposeAddEquiv 𝓜).right_inv⟩
  intro x y
  classical
  rw [AddHom.toFun_eq_coe, ← DirectSum.sum_support_decompose 𝓐 x, map_sum, Finset.sum_smul,
    AddEquiv.coe_toAddHom, map_sum, Finset.sum_smul]
  refine Finset.sum_congr rfl (fun i _hi => ?_)
  rw [RingHom.id_apply, ← DirectSum.sum_support_decompose 𝓜 y, map_sum, Finset.smul_sum, map_sum,
    Finset.smul_sum]
  refine Finset.sum_congr rfl (fun j _hj => ?_)
  rw [show (decompose 𝓐 x i : A) • (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j) : (⨁ i, 𝓜 i)) =
    DirectSum.Gmodule.smulAddMonoidHom _ _ (decompose 𝓐 ↑(decompose 𝓐 x i))
    (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j)) from DirectSum.Gmodule.smul_def _ _ _ _]
  simp only [decomposeAddEquiv_apply, Equiv.invFun_as_coe, Equiv.symm_symm, decompose_coe,
    Gmodule.smulAddMonoidHom_apply_of_of]
  

Proof state:
ιA : Type u_1
ιM : Type u_2
R : Type u_3
A : Type u_4
M : Type u_5
σ : Type u_6
σ' : Type u_7
inst✝¹⁶ : AddMonoid ιA
inst✝¹⁵ : AddAction ιA ιM
inst✝¹⁴ : CommSemiring R
inst✝¹³ : Semiring A
inst✝¹² : Algebra R A
𝓐 : ιA → σ'
inst✝¹¹ : SetLike σ' A
𝓜 : ιM → σ
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module A M
inst✝⁸ : SetLike σ M
inst✝⁷ : AddSubmonoidClass σ' A
inst✝⁶ : AddSubmonoidClass σ M
inst✝⁵ : SetLike.GradedMonoid 𝓐
inst✝⁴ : SetLike.GradedSMul 𝓐 𝓜
inst✝³ : DecidableEq ιA
inst✝² : DecidableEq ιM
inst✝¹ : GradedRing 𝓐
inst✝ : Decomposition 𝓜
h : Module A (⨁ (i : ιM), ↥(𝓜 i)) := isModule 𝓐 𝓜
x : A
y : M
i : ιA
_hi : i ∈ DFinsupp.support ((decompose 𝓐) x)
j : ιM
_hj : j ∈ DFinsupp.support ((decompose 𝓜) y)
⊢ (decompose 𝓜) (↑(((decompose 𝓐) x) i) • ↑(((decompose 𝓜) y) j)) =
    (of (fun i => ↥(𝓜 i)) (i +ᵥ j)) (GradedMonoid.GSMul.smul (((decompose 𝓐) x) i) (((decompose 𝓜) y) j))

Next tactic:
convert DirectSum.decompose_coe 𝓜 _
/-- `⨁ i, 𝓜 i` and `M` are isomorphic as `A`-modules.
"The internal version" and "the external version" are isomorphism as `A`-modules.
-/
def linearEquiv [DecidableEq ιA] [DecidableEq ιM] [GradedRing 𝓐] [DirectSum.Decomposition 𝓜] :
    @LinearEquiv A A _ _ (RingHom.id A) (RingHom.id A) _ _ M (⨁ i, 𝓜 i) _
    _ _ (by letI := isModule 𝓐 𝓜; infer_instance) := by
  letI h := isModule 𝓐 𝓜
  refine ⟨⟨(DirectSum.decomposeAddEquiv 𝓜).toAddHom, ?_⟩,
    (DirectSum.decomposeAddEquiv 𝓜).symm.toFun, (DirectSum.decomposeAddEquiv 𝓜).left_inv,
    (DirectSum.decomposeAddEquiv 𝓜).right_inv⟩
  intro x y
  classical
  rw [AddHom.toFun_eq_coe, ← DirectSum.sum_support_decompose 𝓐 x, map_sum, Finset.sum_smul,
    AddEquiv.coe_toAddHom, map_sum, Finset.sum_smul]
  refine Finset.sum_congr rfl (fun i _hi => ?_)
  rw [RingHom.id_apply, ← DirectSum.sum_support_decompose 𝓜 y, map_sum, Finset.smul_sum, map_sum,
    Finset.smul_sum]
  refine Finset.sum_congr rfl (fun j _hj => ?_)
  rw [show (decompose 𝓐 x i : A) • (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j) : (⨁ i, 𝓜 i)) =
    DirectSum.Gmodule.smulAddMonoidHom _ _ (decompose 𝓐 ↑(decompose 𝓐 x i))
    (decomposeAddEquiv 𝓜 ↑(decompose 𝓜 y j)) from DirectSum.Gmodule.smul_def _ _ _ _]
  simp only [decomposeAddEquiv_apply, Equiv.invFun_as_coe, Equiv.symm_symm, decompose_coe,
    Gmodule.smulAddMonoidHom_apply_of_of]
  convert DirectSum.decompose_coe 𝓜 _
  

Proof state:
case h.e'_2.h.e'_6
ιA : Type u_1
ιM : Type u_2
R : Type u_3
A : Type u_4
M : Type u_5
σ : Type u_6
σ' : Type u_7
inst✝¹⁶ : AddMonoid ιA
inst✝¹⁵ : AddAction ιA ιM
inst✝¹⁴ : CommSemiring R
inst✝¹³ : Semiring A
inst✝¹² : Algebra R A
𝓐 : ιA → σ'
inst✝¹¹ : SetLike σ' A
𝓜 : ιM → σ
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module A M
inst✝⁸ : SetLike σ M
inst✝⁷ : AddSubmonoidClass σ' A
inst✝⁶ : AddSubmonoidClass σ M
inst✝⁵ : SetLike.GradedMonoid 𝓐
inst✝⁴ : SetLike.GradedSMul 𝓐 𝓜
inst✝³ : DecidableEq ιA
inst✝² : DecidableEq ιM
inst✝¹ : GradedRing 𝓐
inst✝ : Decomposition 𝓜
h : Module A (⨁ (i : ιM), ↥(𝓜 i)) := isModule 𝓐 𝓜
x : A
y : M
i : ιA
_hi : i ∈ DFinsupp.support ((decompose 𝓐) x)
j : ιM
_hj : j ∈ DFinsupp.support ((decompose 𝓜) y)
⊢ ↑(((decompose 𝓐) x) i) • ↑(((decompose 𝓜) y) j) =
    ↑(GradedMonoid.GSMul.smul (((decompose 𝓐) x) i) (((decompose 𝓜) y) j))

Next tactic:
rfl
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
@[simps]
def coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation {X : C} {K : Type max v u}
    [SmallCategory K] {F : K ⥤ Cᵒᵖ ⥤ D} {W : J.Cover X} (i : W.Arrow)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj (op W))) :
    Cone (F ⋙ (evaluation _ _).obj (op i.Y)) where
  pt := E.pt
  π :=
    { app := fun k => E.π.app k ≫ Multiequalizer.ι (W.index (F.obj k)) i
      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)
X : C
K : Type (max v u)
inst✝ : SmallCategory K
F : K ⥤ Cᵒᵖ ⥤ D
W : Cover J X
i : Cover.Arrow W
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj (op W))
⊢ ∀ ⦃X_1 Y : K⦄ (f : X_1 ⟶ Y),
    ((Functor.const K).obj E.pt).map f ≫ (fun k => E.π.app k ≫ Multiequalizer.ι (Cover.index W (F.obj k)) i) Y =
      (fun k => E.π.app k ≫ Multiequalizer.ι (Cover.index W (F.obj k)) i) X_1 ≫
        (F ⋙ (evaluation Cᵒᵖ D).obj (op i.Y)).map f

Next tactic:
intro a b f
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
@[simps]
def coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation {X : C} {K : Type max v u}
    [SmallCategory K] {F : K ⥤ Cᵒᵖ ⥤ D} {W : J.Cover X} (i : W.Arrow)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj (op W))) :
    Cone (F ⋙ (evaluation _ _).obj (op i.Y)) where
  pt := E.pt
  π :=
    { app := fun k => E.π.app k ≫ Multiequalizer.ι (W.index (F.obj k)) i
      naturality := by
        intro a b 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)
X : C
K : Type (max v u)
inst✝ : SmallCategory K
F : K ⥤ Cᵒᵖ ⥤ D
W : Cover J X
i : Cover.Arrow W
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj (op W))
a b : K
f : a ⟶ b
⊢ ((Functor.const K).obj E.pt).map f ≫ (fun k => E.π.app k ≫ Multiequalizer.ι (Cover.index W (F.obj k)) i) b =
    (fun k => E.π.app k ≫ Multiequalizer.ι (Cover.index W (F.obj k)) i) a ≫ (F ⋙ (evaluation Cᵒᵖ D).obj (op i.Y)).map f

Next tactic:
dsimp
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
@[simps]
def coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation {X : C} {K : Type max v u}
    [SmallCategory K] {F : K ⥤ Cᵒᵖ ⥤ D} {W : J.Cover X} (i : W.Arrow)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj (op W))) :
    Cone (F ⋙ (evaluation _ _).obj (op i.Y)) where
  pt := E.pt
  π :=
    { app := fun k => E.π.app k ≫ Multiequalizer.ι (W.index (F.obj k)) i
      naturality := by
        intro a b f
        dsimp
        

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
F : K ⥤ Cᵒᵖ ⥤ D
W : Cover J X
i : Cover.Arrow W
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj (op W))
a b : K
f : a ⟶ b
⊢ 𝟙 E.pt ≫ E.π.app b ≫ Multiequalizer.ι (Cover.index W (F.obj b)) i =
    (E.π.app a ≫ Multiequalizer.ι (Cover.index W (F.obj a)) i) ≫ (F.map f).app (op i.Y)

Next tactic:
rw [Category.id_comp, Category.assoc, ← E.w f]
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
@[simps]
def coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation {X : C} {K : Type max v u}
    [SmallCategory K] {F : K ⥤ Cᵒᵖ ⥤ D} {W : J.Cover X} (i : W.Arrow)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj (op W))) :
    Cone (F ⋙ (evaluation _ _).obj (op i.Y)) where
  pt := E.pt
  π :=
    { app := fun k => E.π.app k ≫ Multiequalizer.ι (W.index (F.obj k)) i
      naturality := by
        intro a b f
        dsimp
        rw [Category.id_comp, Category.assoc, ← E.w 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)
X : C
K : Type (max v u)
inst✝ : SmallCategory K
F : K ⥤ Cᵒᵖ ⥤ D
W : Cover J X
i : Cover.Arrow W
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj (op W))
a b : K
f : a ⟶ b
⊢ (E.π.app a ≫ (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj (op W)).map f) ≫
      Multiequalizer.ι (Cover.index W (F.obj b)) i =
    E.π.app a ≫ Multiequalizer.ι (Cover.index W (F.obj a)) i ≫ (F.map f).app (op i.Y)

Next tactic:
dsimp [diagramNatTrans]
/-- An auxiliary definition to be used in the proof of the fact that
`J.diagramFunctor D X` preserves limits. -/
@[simps]
def coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation {X : C} {K : Type max v u}
    [SmallCategory K] {F : K ⥤ Cᵒᵖ ⥤ D} {W : J.Cover X} (i : W.Arrow)
    (E : Cone (F ⋙ J.diagramFunctor D X ⋙ (evaluation (J.Cover X)ᵒᵖ D).obj (op W))) :
    Cone (F ⋙ (evaluation _ _).obj (op i.Y)) where
  pt := E.pt
  π :=
    { app := fun k => E.π.app k ≫ Multiequalizer.ι (W.index (F.obj k)) i
      naturality := by
        intro a b f
        dsimp
        rw [Category.id_comp, Category.assoc, ← E.w f]
        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
F : K ⥤ Cᵒᵖ ⥤ D
W : Cover J X
i : Cover.Arrow W
E : Cone (F ⋙ diagramFunctor J D X ⋙ (evaluation (Cover J X)ᵒᵖ D).obj (op W))
a b : K
f : a ⟶ b
⊢ (E.π.app a ≫
        Multiequalizer.lift (Cover.index W (F.obj b)) (multiequalizer (Cover.index W (F.obj a)))
          (fun i => Multiequalizer.ι (Cover.index W (F.obj a)) i ≫ (F.map f).app (op i.Y))
          (_ :
            ∀ (i : (Cover.index (op W).unop (F.obj b)).R),
              (fun i => Multiequalizer.ι (Cover.index (op W).unop (F.obj a)) i ≫ (F.map f).app (op i.Y))
                    (MulticospanIndex.fstTo (Cover.index (op W).unop (F.obj b)) i) ≫
                  MulticospanIndex.fst (Cover.index (op W).unop (F.obj b)) i =
                (fun i => Multiequalizer.ι (Cover.index (op W).unop (F.obj a)) i ≫ (F.map f).app (op i.Y))
                    (MulticospanIndex.sndTo (Cover.index (op W).unop (F.obj b)) i) ≫
                  MulticospanIndex.snd (Cover.index (op W).unop (F.obj b)) i)) ≫
      Multiequalizer.ι (Cover.index W (F.obj b)) i =
    E.π.app a ≫ Multiequalizer.ι (Cover.index W (F.obj a)) i ≫ (F.map f).app (op i.Y)

Next tactic:
simp only [Multiequalizer.lift_ι, 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
      

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)
⊢ ∀ (b : (Cover.index W.unop (limit F)).R),
    (fun i =>
            IsLimit.lift (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F))
              (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation i E))
          (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) b) ≫
        MulticospanIndex.fst (Cover.index W.unop (limit F)) b =
      (fun i =>
            IsLimit.lift (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F))
              (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation i E))
          (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) b) ≫
        MulticospanIndex.snd (Cover.index W.unop (limit F)) b

Next tactic:
intro i
/-- 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
      

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
⊢ (fun i =>
          IsLimit.lift (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F))
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation i E))
        (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i) ≫
      MulticospanIndex.fst (Cover.index W.unop (limit F)) i =
    (fun i =>
          IsLimit.lift (isLimitOfPreserves ((evaluation Cᵒᵖ D).obj (op i.Y)) (limit.isLimit F))
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation i E))
        (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) ≫
      MulticospanIndex.snd (Cover.index W.unop (limit F)) i

Next tactic:
change (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
/-- 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 (_ ≫ _) ≫ _ = (_ ≫ _) ≫ _
      

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
⊢ ((IsLimit.liftConeMorphism
            (IsLimit.ofIsoLimit
              (limit.isLimit
                (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y)))
              (evaluateCombinedCones F (fun k => getLimitCone ((Functor.flip F).obj k))
                  (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y)).symm)
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
              (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i) E)).hom ≫
        ((Cones.functoriality F
                  ((evaluation Cᵒᵖ D).obj (op (MulticospanIndex.fstTo (Cover.index W.unop (limit F)) i).Y))).mapIso
              (IsLimit.uniqueUpToIso (combinedIsLimit F fun k => getLimitCone ((Functor.flip F).obj k))
                (limit.isLimit F))).hom.hom) ≫
      MulticospanIndex.fst (Cover.index W.unop (limit F)) i =
    ((IsLimit.liftConeMorphism
            (IsLimit.ofIsoLimit
              (limit.isLimit
                (F ⋙ (evaluation Cᵒᵖ D).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y)))
              (evaluateCombinedCones F (fun k => getLimitCone ((Functor.flip F).obj k))
                  (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y)).symm)
            (coneCompEvaluationOfConeCompDiagramFunctorCompEvaluation
              (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i) E)).hom ≫
        ((Cones.functoriality F
                  ((evaluation Cᵒᵖ D).obj (op (MulticospanIndex.sndTo (Cover.index W.unop (limit F)) i).Y))).mapIso
              (IsLimit.uniqueUpToIso (combinedIsLimit F fun k => getLimitCone ((Functor.flip F).obj k))
                (limit.isLimit F))).hom.hom) ≫
      MulticospanIndex.snd (Cover.index W.unop (limit F)) i

Next tactic:
dsimp [evaluateCombinedCones]