Theorem: TopCat.Presheaf.isSheaf_of_isTerminal_of_indiscrete
File: Mathlib/Topology/Sheaves/PUnit.lean

tactic: obtain rfl | hne := eq_or_ne U ⊥
state_before: C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
U : TopologicalSpace.Opens ↑X
s : Sieve U
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) U
⊢ Presieve.IsSheafFor (F ⋙ coyoneda.obj c.op) s.arrows

tactic: intro _ _
state_before: case inl
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊥
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊥
⊢ Presieve.IsSheafFor (F ⋙ coyoneda.obj c.op) s.arrows

tactic: rw [@exists_unique_iff_exists _ ⟨fun _ _ => _⟩]
state_before: case inl
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊥
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊥
x✝ : Presieve.FamilyOfElements (F ⋙ coyoneda.obj c.op) s.arrows
a✝ : Presieve.FamilyOfElements.Compatible x✝
⊢ ∃! t, Presieve.FamilyOfElements.IsAmalgamation x✝ t

tactic: refine' ⟨it.from _, fun U hU hs => IsTerminal.hom_ext _ _ _⟩
state_before: case inl
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊥
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊥
x✝ : Presieve.FamilyOfElements (F ⋙ coyoneda.obj c.op) s.arrows
a✝ : Presieve.FamilyOfElements.Compatible x✝
⊢ ∃ x, Presieve.FamilyOfElements.IsAmalgamation x✝ x

tactic: rwa [le_bot_iff.1 hU.le]
state_before: case inl
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊥
hs✝ : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊥
x✝ : Presieve.FamilyOfElements (F ⋙ coyoneda.obj c.op) s.arrows
a✝ : Presieve.FamilyOfElements.Compatible x✝
U : TopologicalSpace.Opens ↑X
hU : U ⟶ ⊥
hs : s.arrows hU
⊢ IsTerminal (F.obj U.op)

tactic: apply it.hom_ext
state_before: C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊥
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊥
x✝ : Presieve.FamilyOfElements (F ⋙ coyoneda.obj c.op) s.arrows
a✝ : Presieve.FamilyOfElements.Compatible x✝
⊢ ∀ (x x_1 : (F ⋙ coyoneda.obj c.op).obj ⊥.op), x = x_1

tactic: convert Presieve.isSheafFor_top_sieve (F ⋙ coyoneda.obj (@op C c))
state_before: case inr
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
U : TopologicalSpace.Opens ↑X
s : Sieve U
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) U
hne : U ≠ ⊥
⊢ Presieve.IsSheafFor (F ⋙ coyoneda.obj c.op) s.arrows

tactic: rw [← Sieve.id_mem_iff_eq_top]
state_before: case h.e'_5.h.h.e'_4
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
U : TopologicalSpace.Opens ↑X
s : Sieve U
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) U
hne : U ≠ ⊥
⊢ s = ⊤

tactic: have := (U.eq_bot_or_top hind).resolve_left hne
state_before: case h.e'_5.h.h.e'_4
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
U : TopologicalSpace.Opens ↑X
s : Sieve U
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) U
hne : U ≠ ⊥
⊢ s.arrows (𝟙 U)

tactic: subst this
state_before: case h.e'_5.h.h.e'_4
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
U : TopologicalSpace.Opens ↑X
s : Sieve U
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) U
hne : U ≠ ⊥
this : U = ⊤
⊢ s.arrows (𝟙 U)

tactic: obtain he | ⟨⟨x⟩⟩ := isEmpty_or_nonempty X
state_before: case h.e'_5.h.h.e'_4
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊤
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊤
hne : ⊤ ≠ ⊥
⊢ s.arrows (𝟙 ⊤)

tactic: obtain ⟨U, f, hf, hm⟩ := hs x _root_.trivial
state_before: case h.e'_5.h.h.e'_4.inr.intro
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊤
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊤
hne : ⊤ ≠ ⊥
x : ↑X
⊢ s.arrows (𝟙 ⊤)

tactic: obtain rfl | rfl := U.eq_bot_or_top hind
state_before: case h.e'_5.h.h.e'_4.inr.intro.intro.intro.intro
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊤
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊤
hne : ⊤ ≠ ⊥
x : ↑X
U : TopologicalSpace.Opens ↑X
f : U ⟶ ⊤
hf : s.arrows f
hm : x ∈ U
⊢ s.arrows (𝟙 ⊤)

tactic: exact (hne <| SetLike.ext'_iff.2 <| Set.univ_eq_empty_iff.2 he).elim
state_before: case h.e'_5.h.h.e'_4.inl
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊤
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊤
hne : ⊤ ≠ ⊥
he : IsEmpty ↑X
⊢ s.arrows (𝟙 ⊤)

tactic: cases hm
state_before: case h.e'_5.h.h.e'_4.inr.intro.intro.intro.intro.inl
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊤
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊤
hne : ⊤ ≠ ⊥
x : ↑X
f : ⊥ ⟶ ⊤
hf : s.arrows f
hm : x ∈ ⊥
⊢ s.arrows (𝟙 ⊤)

tactic: convert hf
state_before: case h.e'_5.h.h.e'_4.inr.intro.intro.intro.intro.inr
C : Type u
inst✝ : Category C
X : TopCat
hind : X.str = ⊤
F : Presheaf C X
it : IsTerminal (F.obj ⊥.op)
c : C
s : Sieve ⊤
hs : s ∈ GrothendieckTopology.sieves (Opens.grothendieckTopology ↑X) ⊤
hne : ⊤ ≠ ⊥
x : ↑X
f : ⊤ ⟶ ⊤
hf : s.arrows f
hm : x ∈ ⊤
⊢ s.arrows (𝟙 ⊤)