-- Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean
theorem isSheaf_iff_isSheafOpensLeCover : F.IsSheaf ↔ F.IsSheafOpensLeCover

Proof state:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
⊢ Sieve.generate S.arrows ∈ (Opens.grothendieckTopology ↑X) Y →
    Nonempty (IsLimit (Functor.mapCone F (Sieve.generate S.arrows).arrows.cocone.op))

Tactic:
intro hS

Result:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
hS : Sieve.generate S.arrows ∈ (Opens.grothendieckTopology ↑X) Y
⊢ Nonempty (IsLimit (Functor.mapCone F (Sieve.generate S.arrows).arrows.cocone.op))

Proof state:
case mp
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h :
  ∀ ⦃X_1 : Opens ↑X⦄,
    ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))
ι : Type w
U : ι → Opens ↑X
⊢ Nonempty (IsLimit (Functor.mapCone F (opensLeCoverCocone U).op))

Tactic:
rw [(isLimitOpensLeEquivGenerate₁ F U rfl).nonempty_congr]

Result:
case mp
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h :
  ∀ ⦃X_1 : Opens ↑X⦄,
    ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))
ι : Type w
U : ι → Opens ↑X
⊢ Nonempty (IsLimit (Functor.mapCone F (Sieve.generate (presieveOfCoveringAux U (iSup U))).arrows.cocone.op))

Proof state:
case mp
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h :
  ∀ ⦃X_1 : Opens ↑X⦄,
    ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))
ι : Type w
U : ι → Opens ↑X
⊢ Nonempty (IsLimit (Functor.mapCone F (Sieve.generate (presieveOfCoveringAux U (iSup U))).arrows.cocone.op))

Tactic:
apply h

Result:
case mp.a
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h :
  ∀ ⦃X_1 : Opens ↑X⦄,
    ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))
ι : Type w
U : ι → Opens ↑X
⊢ Sieve.generate (presieveOfCoveringAux U (iSup U)) ∈ (Opens.grothendieckTopology ↑X) (iSup U)

Proof state:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
hS : Sieve.generate S.arrows ∈ (Opens.grothendieckTopology ↑X) Y
⊢ Nonempty (IsLimit (Functor.mapCone F (Sieve.generate S.arrows).arrows.cocone.op))

Tactic:
rw [← (isLimitOpensLeEquivGenerate₂ F S.1 hS).nonempty_congr]

Result:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
hS : Sieve.generate S.arrows ∈ (Opens.grothendieckTopology ↑X) Y
⊢ Nonempty (IsLimit (Functor.mapCone F (opensLeCoverCocone (coveringOfPresieve Y S.arrows)).op))

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ (∀ ⦃X_1 : Opens ↑X⦄,
      ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))) ↔
    F.IsSheafOpensLeCover

Tactic:
constructor

Result:
case mp
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ (∀ ⦃X_1 : Opens ↑X⦄,
      ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))) →
    F.IsSheafOpensLeCover

case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ F.IsSheafOpensLeCover →
    ∀ ⦃X_1 : Opens ↑X⦄,
      ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ F.IsSheaf ↔ F.IsSheafOpensLeCover

Tactic:
refine (Presheaf.isSheaf_iff_isLimit _ _).trans ?_

Result:
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ (∀ ⦃X_1 : Opens ↑X⦄,
      ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))) ↔
    F.IsSheafOpensLeCover

Proof state:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ F.IsSheafOpensLeCover →
    ∀ ⦃X_1 : Opens ↑X⦄,
      ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))

Tactic:
intro h Y S

Result:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
⊢ S ∈ (Opens.grothendieckTopology ↑X) Y → Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))

Proof state:
case mp
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
⊢ (∀ ⦃X_1 : Opens ↑X⦄,
      ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))) →
    F.IsSheafOpensLeCover

Tactic:
intro h ι U

Result:
case mp
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h :
  ∀ ⦃X_1 : Opens ↑X⦄,
    ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))
ι : Type w
U : ι → Opens ↑X
⊢ Nonempty (IsLimit (Functor.mapCone F (opensLeCoverCocone U).op))

Proof state:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
hS : Sieve.generate S.arrows ∈ (Opens.grothendieckTopology ↑X) Y
⊢ Nonempty (IsLimit (Functor.mapCone F (opensLeCoverCocone (coveringOfPresieve Y S.arrows)).op))

Tactic:
apply h

Result:
no goals

Proof state:
case mp.a
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h :
  ∀ ⦃X_1 : Opens ↑X⦄,
    ∀ S ∈ (Opens.grothendieckTopology ↑X) X_1, Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))
ι : Type w
U : ι → Opens ↑X
⊢ Sieve.generate (presieveOfCoveringAux U (iSup U)) ∈ (Opens.grothendieckTopology ↑X) (iSup U)

Tactic:
apply presieveOfCovering.mem_grothendieckTopology

Result:
no goals

Proof state:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
⊢ S ∈ (Opens.grothendieckTopology ↑X) Y → Nonempty (IsLimit (Functor.mapCone F S.arrows.cocone.op))

Tactic:
rw [← Sieve.generate_sieve S]

Result:
case mpr
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Presheaf C X
h : F.IsSheafOpensLeCover
Y : Opens ↑X
S : Sieve Y
⊢ Sieve.generate S.arrows ∈ (Opens.grothendieckTopology ↑X) Y →
    Nonempty (IsLimit (Functor.mapCone F (Sieve.generate S.arrows).arrows.cocone.op))