Theorem: CategoryTheory.Presheaf.isSheaf_iff_multiequalizer
File: Mathlib/CategoryTheory/Sites/Sheaf.lean

tactic: rw [isSheaf_iff_multifork]
state_before: C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
⊢ IsSheaf J P ↔ ∀ (X : C) (S : GrothendieckTopology.Cover J X), IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)

tactic: refine' forall₂_congr fun X S => ⟨_, _⟩
state_before: C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
⊢ (∀ (X : C) (S : GrothendieckTopology.Cover J X), Nonempty (IsLimit (GrothendieckTopology.Cover.multifork S P))) ↔
    ∀ (X : C) (S : GrothendieckTopology.Cover J X), IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)

tactic: rintro ⟨h⟩
state_before: case refine'_1
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
⊢ Nonempty (IsLimit (GrothendieckTopology.Cover.multifork S P)) →
    IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)

tactic: let e : P.obj (op X) ≅ multiequalizer (S.index P) :=
  h.conePointUniqueUpToIso (limit.isLimit _)
state_before: case refine'_1.intro
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsLimit (GrothendieckTopology.Cover.multifork S P)
⊢ IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)

tactic: exact (inferInstance : IsIso e.hom)
state_before: case refine'_1.intro
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsLimit (GrothendieckTopology.Cover.multifork S P)
e : P.obj X.op ≅ multiequalizer (GrothendieckTopology.Cover.index S P) :=
  IsLimit.conePointUniqueUpToIso h (limit.isLimit (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P)))
⊢ IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)

tactic: intro h
state_before: case refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
⊢ IsIso (GrothendieckTopology.Cover.toMultiequalizer S P) →
    Nonempty (IsLimit (GrothendieckTopology.Cover.multifork S P))

tactic: refine' ⟨IsLimit.ofIsoLimit (limit.isLimit _) (Cones.ext _ _)⟩
state_before: case refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
⊢ Nonempty (IsLimit (GrothendieckTopology.Cover.multifork S P))

tactic: apply (@asIso _ _ _ _ _ h).symm
state_before: case refine'_2.refine'_1
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
⊢ (limit.cone (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P))).pt ≅
    (GrothendieckTopology.Cover.multifork S P).pt

tactic: intro a
state_before: case refine'_2.refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
⊢ ∀ (j : WalkingMulticospan (GrothendieckTopology.Cover.index S P).fstTo (GrothendieckTopology.Cover.index S P).sndTo),
    (limit.cone (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P))).π.app j =
      (asIso (GrothendieckTopology.Cover.toMultiequalizer S P)).symm.hom ≫
        (GrothendieckTopology.Cover.multifork S P).π.app j

tactic: symm
state_before: case refine'_2.refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
a : WalkingMulticospan (GrothendieckTopology.Cover.index S P).fstTo (GrothendieckTopology.Cover.index S P).sndTo
⊢ (limit.cone (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P))).π.app a =
    (asIso (GrothendieckTopology.Cover.toMultiequalizer S P)).symm.hom ≫
      (GrothendieckTopology.Cover.multifork S P).π.app a

tactic: erw [IsIso.inv_comp_eq]
state_before: case refine'_2.refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
a : WalkingMulticospan (GrothendieckTopology.Cover.index S P).fstTo (GrothendieckTopology.Cover.index S P).sndTo
⊢ (asIso (GrothendieckTopology.Cover.toMultiequalizer S P)).symm.hom ≫
      (GrothendieckTopology.Cover.multifork S P).π.app a =
    (limit.cone (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P))).π.app a

tactic: dsimp
state_before: case refine'_2.refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
a : WalkingMulticospan (GrothendieckTopology.Cover.index S P).fstTo (GrothendieckTopology.Cover.index S P).sndTo
⊢ (GrothendieckTopology.Cover.multifork S P).π.app a =
    GrothendieckTopology.Cover.toMultiequalizer S P ≫
      (limit.cone (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P))).π.app a

tactic: simp
state_before: case refine'_2.refine'_2
C : Type u₁
inst✝² : Category C
A : Type u₂
inst✝¹ : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝ : ∀ (X : C) (S : GrothendieckTopology.Cover J X), HasMultiequalizer (GrothendieckTopology.Cover.index S P)
X : C
S : GrothendieckTopology.Cover J X
h : IsIso (GrothendieckTopology.Cover.toMultiequalizer S P)
a : WalkingMulticospan (GrothendieckTopology.Cover.index S P).fstTo (GrothendieckTopology.Cover.index S P).sndTo
⊢ (match a with
    | WalkingMulticospan.left a => P.map a.f.op
    | WalkingMulticospan.right b =>
      P.map (MulticospanIndex.fstTo (GrothendieckTopology.Cover.index S P) b).f.op ≫
        MulticospanIndex.fst (GrothendieckTopology.Cover.index S P) b) =
    GrothendieckTopology.Cover.toMultiequalizer S P ≫
      limit.π (MulticospanIndex.multicospan (GrothendieckTopology.Cover.index S P)) a