[GOAL]
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
⊢ ∃! s, IsGluing (presheafToTypes X T) U sf s
[PROOFSTEP]
choose index index_spec using fun x : ↑(iSup U) =>
  Opens.mem_iSup.mp
    x.2
      -- Using this data, we can glue our functions together to a single section
[GOAL]
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
⊢ ∃! s, IsGluing (presheafToTypes X T) U sf s
[PROOFSTEP]
let s : ∀ x : ↑(iSup U), T x := fun x => sf (index x) ⟨x.1, index_spec x⟩
[GOAL]
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
⊢ ∃! s, IsGluing (presheafToTypes X T) U sf s
[PROOFSTEP]
refine' ⟨s, _, _⟩
[GOAL]
case refine'_1
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
⊢ (fun s => IsGluing (presheafToTypes X T) U sf s) s
[PROOFSTEP]
intro i
[GOAL]
case refine'_1
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
i : ι
⊢ ↑((presheafToTypes X T).map (leSupr U i).op) s = sf i
[PROOFSTEP]
funext x
[GOAL]
case refine'_1.h
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
i : ι
x : { x // x ∈ (Opposite.op (U i)).unop }
⊢ ↑((presheafToTypes X T).map (leSupr U i).op) s x = sf i x
[PROOFSTEP]
exact congr_fun (hsf (index ⟨x, _⟩) i) ⟨x, ⟨index_spec ⟨x.1, _⟩, x.2⟩⟩
[GOAL]
case refine'_2
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
⊢ ∀ (y : (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (iSup U)))),
    (fun s => IsGluing (presheafToTypes X T) U sf s) y → y = s
[PROOFSTEP]
intro t ht
[GOAL]
case refine'_2
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
t : (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (iSup U)))
ht : IsGluing (presheafToTypes X T) U sf t
⊢ t = s
[PROOFSTEP]
funext x
[GOAL]
case refine'_2.h
X : TopCat
T : ↑X → Type u
ι : Type u
U : ι → Opens ↑X
sf : (i : ι) → (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (U i)))
hsf : IsCompatible (presheafToTypes X T) U sf
index : { x // x ∈ iSup U } → ι
index_spec : ∀ (x : { x // x ∈ iSup U }), ↑x ∈ U (index x)
s : (x : { x // x ∈ iSup U }) → T ↑x := fun x => sf (index x) { val := ↑x, property := (_ : ↑x ∈ U (index x)) }
t : (forget (Type u)).obj ((presheafToTypes X T).obj (Opposite.op (iSup U)))
ht : IsGluing (presheafToTypes X T) U sf t
x : { x // x ∈ (Opposite.op (iSup U)).unop }
⊢ t x = s x
[PROOFSTEP]
exact congr_fun (ht (index x)) ⟨x.1, index_spec x⟩
