Theorem: CategoryTheory.Presheaf.isSheaf_iff_isSheaf'
File: Mathlib/CategoryTheory/Sites/Sheaf.lean

tactic: constructor
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✝¹ : HasProducts A
inst✝ : HasPullbacks C
⊢ IsSheaf J P ↔ IsSheaf' J P

tactic: intro h U R hR
state_before: case mp
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
⊢ IsSheaf J P → IsSheaf' J P

tactic: refine' ⟨_⟩
state_before: case mp
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
⊢ Nonempty (IsLimit (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: apply coyonedaJointlyReflectsLimits
state_before: case mp
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
⊢ IsLimit (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P))

tactic: intro X
state_before: case mp.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
⊢ (X : Aᵒᵖ) →
    IsLimit
      ((coyoneda.obj X).mapCone (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: have q : Presieve.IsSheafFor (P ⋙ coyoneda.obj X) _ := h X.unop _ hR
state_before: case mp.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
X : Aᵒᵖ
⊢ IsLimit
    ((coyoneda.obj X).mapCone (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: rw [← Presieve.isSheafFor_iff_generate] at q
state_before: case mp.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
X : Aᵒᵖ
q : Presieve.IsSheafFor (P ⋙ coyoneda.obj X) (generate R).arrows
⊢ IsLimit
    ((coyoneda.obj X).mapCone (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: rw [Equalizer.Presieve.sheaf_condition] at q
state_before: case mp.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
X : Aᵒᵖ
q : Presieve.IsSheafFor (P ⋙ coyoneda.obj X) R
⊢ IsLimit
    ((coyoneda.obj X).mapCone (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: replace q := Classical.choice q
state_before: case mp.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
X : Aᵒᵖ
q :
  Nonempty
    (IsLimit
      (Fork.ofι (Equalizer.forkMap (P ⋙ coyoneda.obj X) R)
        (_ :
          Equalizer.forkMap (P ⋙ coyoneda.obj X) R ≫ Equalizer.Presieve.firstMap (P ⋙ coyoneda.obj X) R =
            Equalizer.forkMap (P ⋙ coyoneda.obj X) R ≫ Equalizer.Presieve.secondMap (P ⋙ coyoneda.obj X) R)))
⊢ IsLimit
    ((coyoneda.obj X).mapCone (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: apply (isSheafForIsSheafFor' _ _ _ _).symm q
state_before: case mp.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R✝ : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf J P
U : C
R : Presieve U
hR : generate R ∈ GrothendieckTopology.sieves J U
X : Aᵒᵖ
q :
  IsLimit
    (Fork.ofι (Equalizer.forkMap (P ⋙ coyoneda.obj X) R)
      (_ :
        Equalizer.forkMap (P ⋙ coyoneda.obj X) R ≫ Equalizer.Presieve.firstMap (P ⋙ coyoneda.obj X) R =
          Equalizer.forkMap (P ⋙ coyoneda.obj X) R ≫ Equalizer.Presieve.secondMap (P ⋙ coyoneda.obj X) R))
⊢ IsLimit
    ((coyoneda.obj X).mapCone (Fork.ofι (forkMap R P) (_ : forkMap R P ≫ firstMap R P = forkMap R P ≫ secondMap R P)))

tactic: intro h U X S hS
state_before: case mpr
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U : C
R : Presieve U
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
⊢ IsSheaf' J P → IsSheaf J P

tactic: rw [Equalizer.Presieve.sheaf_condition]
state_before: case mpr
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
⊢ Presieve.IsSheafFor (P ⋙ coyoneda.obj U.op) S.arrows

tactic: refine' ⟨_⟩
state_before: case mpr
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
⊢ Nonempty
    (IsLimit
      (Fork.ofι (Equalizer.forkMap (P ⋙ coyoneda.obj U.op) S.arrows)
        (_ :
          Equalizer.forkMap (P ⋙ coyoneda.obj U.op) S.arrows ≫
              Equalizer.Presieve.firstMap (P ⋙ coyoneda.obj U.op) S.arrows =
            Equalizer.forkMap (P ⋙ coyoneda.obj U.op) S.arrows ≫
              Equalizer.Presieve.secondMap (P ⋙ coyoneda.obj U.op) S.arrows)))

tactic: refine' isSheafForIsSheafFor' _ _ _ _ _
state_before: case mpr
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
⊢ IsLimit
    (Fork.ofι (Equalizer.forkMap (P ⋙ coyoneda.obj U.op) S.arrows)
      (_ :
        Equalizer.forkMap (P ⋙ coyoneda.obj U.op) S.arrows ≫
            Equalizer.Presieve.firstMap (P ⋙ coyoneda.obj U.op) S.arrows =
          Equalizer.forkMap (P ⋙ coyoneda.obj U.op) S.arrows ≫
            Equalizer.Presieve.secondMap (P ⋙ coyoneda.obj U.op) S.arrows))

tactic: letI := preservesSmallestLimitsOfPreservesLimits (coyoneda.obj (op U))
state_before: case mpr
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
⊢ IsLimit
    ((coyoneda.obj U.op).mapCone
      (Fork.ofι (forkMap S.arrows P)
        (_ : forkMap S.arrows P ≫ firstMap S.arrows P = forkMap S.arrows P ≫ secondMap S.arrows P)))

tactic: apply isLimitOfPreserves
state_before: case mpr
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
this : PreservesLimitsOfSize (coyoneda.obj U.op) := preservesSmallestLimitsOfPreservesLimits (coyoneda.obj U.op)
⊢ IsLimit
    ((coyoneda.obj U.op).mapCone
      (Fork.ofι (forkMap S.arrows P)
        (_ : forkMap S.arrows P ≫ firstMap S.arrows P = forkMap S.arrows P ≫ secondMap S.arrows P)))

tactic: apply Classical.choice (h _ S.arrows _)
state_before: case mpr.t
C : Type u₁
inst✝³ : Category C
A : Type u₂
inst✝² : Category A
J : GrothendieckTopology C
U✝ : C
R : Presieve U✝
P : Cᵒᵖ ⥤ A
inst✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
this : PreservesLimitsOfSize (coyoneda.obj U.op) := preservesSmallestLimitsOfPreservesLimits (coyoneda.obj U.op)
⊢ IsLimit
    (Fork.ofι (forkMap S.arrows P)
      (_ : forkMap S.arrows P ≫ firstMap S.arrows P = forkMap S.arrows P ≫ secondMap S.arrows P))

tactic: simpa
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✝¹ : HasProducts A
inst✝ : HasPullbacks C
h : IsSheaf' J P
U : A
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J X
this : PreservesLimitsOfSize (coyoneda.obj U.op) := preservesSmallestLimitsOfPreservesLimits (coyoneda.obj U.op)
⊢ generate S.arrows ∈ GrothendieckTopology.sieves J X