Theorem: TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types
File: Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean

tactic: rw [isSheaf_iff_isSheafEqualizerProducts]
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι : Type v
U : ι → Opens ↑X
Fsh : IsSheafUniqueGluing F
⊢ IsSheaf F

tactic: intro ι U
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι : Type v
U : ι → Opens ↑X
Fsh : IsSheafUniqueGluing F
⊢ IsSheafEqualizerProducts F

tactic: refine' ⟨Fork.IsLimit.mk' _ _⟩
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
⊢ Nonempty (IsLimit (fork F U))

tactic: intro s
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
⊢ (s : Fork (leftRes F U) (rightRes F U)) →
    { l //
      l ≫ Fork.ι (fork F U) = Fork.ι s ∧
        ∀
          {m :
            ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
              ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero},
          m ≫ Fork.ι (fork F U) = Fork.ι s → m = l }

tactic: have h_compatible :
  ∀ x : s.pt, F.IsCompatible U ((F.piOpensIsoSectionsFamily U).hom (s.ι x)) := by
  intro x
  rw [compatible_iff_leftRes_eq_rightRes]
  convert congr_fun s.condition x
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
⊢ { l //
    l ≫ Fork.ι (fork F U) = Fork.ι s ∧
      ∀
        {m :
          ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
            ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero},
        m ≫ Fork.ι (fork F U) = Fork.ι s → m = l }

tactic: choose m m_spec m_uniq using fun x : s.pt =>
  Fsh U ((piOpensIsoSectionsFamily F U).hom (s.ι x)) (h_compatible x)
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
⊢ { l //
    l ≫ Fork.ι (fork F U) = Fork.ι s ∧
      ∀
        {m :
          ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
            ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero},
        m ≫ Fork.ι (fork F U) = Fork.ι s → m = l }

tactic: refine' ⟨m, _, _⟩
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
⊢ { l //
    l ≫ Fork.ι (fork F U) = Fork.ι s ∧
      ∀
        {m :
          ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
            ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero},
        m ≫ Fork.ι (fork F U) = Fork.ι s → m = l }

tactic: intro x
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
⊢ ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))

tactic: rw [compatible_iff_leftRes_eq_rightRes]
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
x : s.pt
⊢ IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))

tactic: convert congr_fun s.condition x
state_before: C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
x : s.pt
⊢ leftRes F U (Fork.ι s x) = rightRes F U (Fork.ι s x)

tactic: refine limit.hom_ext fun ⟨i⟩ => funext fun x => ?_
state_before: case refine'_1
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
⊢ m ≫ Fork.ι (fork F U) = Fork.ι s

tactic: simp [res]
state_before: case refine'_1
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
x✝ : Discrete ι
i : ι
x : ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero
⊢ ((m ≫ Fork.ι (fork F U)) ≫ limit.π (Discrete.functor fun i => F.obj (U i).op) { as := i }) x =
    (Fork.ι s ≫ limit.π (Discrete.functor fun i => F.obj (U i).op) { as := i }) x

tactic: exact m_spec x i
state_before: case refine'_1
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
x✝ : Discrete ι
i : ι
x : ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero
⊢ F.map (leSupr U i).op (m x) = limit.π (Discrete.functor fun i => F.obj (U i).op) { as := i } (Fork.ι s x)

tactic: intro l hl
state_before: case refine'_2
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
⊢ ∀
    {m_1 :
      ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
        ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero},
    m_1 ≫ Fork.ι (fork F U) = Fork.ι s → m_1 = m

tactic: ext x
state_before: case refine'_2
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
l :
  ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero
hl : l ≫ Fork.ι (fork F U) = Fork.ι s
⊢ l = m

tactic: apply m_uniq
state_before: case refine'_2.h
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
l :
  ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero
hl : l ≫ Fork.ι (fork F U) = Fork.ι s
x : ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero
⊢ l x = m x

tactic: rw [isGluing_iff_eq_res]
state_before: case refine'_2.h.a
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
l :
  ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero
hl : l ≫ Fork.ι (fork F U) = Fork.ι s
x : ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero
⊢ IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) (l x)

tactic: exact congr_fun hl x
state_before: case refine'_2.h.a
C : Type u
inst✝¹ : Category C
inst✝ : ConcreteCategory C
X : TopCat
F : Presheaf (Type v) X
ι✝ : Type v
U✝ : ι✝ → Opens ↑X
Fsh : IsSheafUniqueGluing F
ι : Type v
U : ι → Opens ↑X
s : Fork (leftRes F U) (rightRes F U)
h_compatible : ∀ (x : s.pt), IsCompatible F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x))
m : s.pt → (forget (Type v)).obj (F.obj (iSup U).op)
m_spec : ∀ (x : s.pt), (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) (m x)
m_uniq :
  ∀ (x : s.pt) (y : (forget (Type v)).obj (F.obj (iSup U).op)),
    (fun s_1 => IsGluing F U ((piOpensIsoSectionsFamily F U).hom (Fork.ι s x)) s_1) y → y = m x
l :
  ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((Functor.const WalkingParallelPair).obj (fork F U).pt).obj WalkingParallelPair.zero
hl : l ≫ Fork.ι (fork F U) = Fork.ι s
x : ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero
⊢ res F U (l x) = Fork.ι s x