Theorem: TopCat.Presheaf.toTypes_isSheaf
File: Mathlib/Topology/Sheaves/SheafOfFunctions.lean

tactic: choose index index_spec using fun x : ↑(iSup U) => Opens.mem_iSup.mp x.2
state_before: X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
⊢ ∃! s, (X.presheafToTypes T).IsGluing U sf s
state_after: X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
⊢ ∃! s, (X.presheafToTypes T).IsGluing U sf s

tactic: let s : ∀ x : ↑(iSup U), T x := fun x => sf (index x) ⟨x.1, index_spec x⟩
state_before: X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
⊢ ∃! s, (X.presheafToTypes T).IsGluing U sf s
state_after: X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
⊢ ∃! s, (X.presheafToTypes T).IsGluing U sf s

tactic: refine ⟨s, ?_, ?_⟩
state_before: X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
⊢ ∃! s, (X.presheafToTypes T).IsGluing U sf s
state_after: case refine_1
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
⊢ (fun s => (X.presheafToTypes T).IsGluing U sf s) s

case refine_2
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
⊢ ∀ (y : (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := iSup U })),
    (fun s => (X.presheafToTypes T).IsGluing U sf s) y → y = s

tactic: intro i
state_before: case refine_1
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
⊢ (fun s => (X.presheafToTypes T).IsGluing U sf s) s
state_after: case refine_1
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
i : ι
⊢ ((X.presheafToTypes T).map (leSupr U i).op) s = sf i

tactic: funext x
state_before: case refine_1
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
i : ι
⊢ ((X.presheafToTypes T).map (leSupr U i).op) s = sf i
state_after: case refine_1.h
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
i : ι
x : ↥{ unop := U i }.unop
⊢ ((X.presheafToTypes T).map (leSupr U i).op) s x = sf i x

tactic: exact congr_fun (hsf (index ⟨x, _⟩) i) ⟨x, ⟨index_spec ⟨x.1, _⟩, x.2⟩⟩
state_before: case refine_1.h
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
i : ι
x : ↥{ unop := U i }.unop
⊢ ((X.presheafToTypes T).map (leSupr U i).op) s x = sf i x
state_after: no goals

tactic: intro t ht
state_before: case refine_2
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
⊢ ∀ (y : (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := iSup U })),
    (fun s => (X.presheafToTypes T).IsGluing U sf s) y → y = s
state_after: case refine_2
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
t : (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := iSup U })
ht : (X.presheafToTypes T).IsGluing U sf t
⊢ t = s

tactic: funext x
state_before: case refine_2
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
t : (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := iSup U })
ht : (X.presheafToTypes T).IsGluing U sf t
⊢ t = s
state_after: case refine_2.h
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
t : (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := iSup U })
ht : (X.presheafToTypes T).IsGluing U sf t
x : ↥{ unop := iSup U }.unop
⊢ t x = s x

tactic: exact congr_fun (ht (index x)) ⟨x.1, index_spec x⟩
state_before: case refine_2.h
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := U i })
hsf : (X.presheafToTypes T).IsCompatible U sf
index : ↥(iSup U) → ι
index_spec : ∀ (x : ↥(iSup U)), ↑x ∈ U (index x)
s : (x : ↥(iSup U)) → T ↑x := fun x => sf (index x) ⟨↑x, ⋯⟩
t : (forget (Type u)).obj ((X.presheafToTypes T).obj { unop := iSup U })
ht : (X.presheafToTypes T).IsGluing U sf t
x : ↥{ unop := iSup U }.unop
⊢ t x = s x
state_after: no goals