l3lab/ntp-mathlib huggingface dataset:
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  

Proof state:
case refine'_2.mk.mk
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
i j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
f : { unop := i } ⟶ { unop := j }
g : j ⟶ i := f.unop
this : f = g.op
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map f ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := i } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map f

Next tactic:
clear_value g
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  

Proof state:
case refine'_2.mk.mk
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
i j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
f : { unop := i } ⟶ { unop := j }
g : j ⟶ i
this : f = g.op
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map f ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := i } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map f

Next tactic:
subst this
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  

Proof state:
case refine'_2.mk.mk
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
i j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
g : j ⟶ i
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := i } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩)
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  

Proof state:
case refine'_2.mk.mk.single.up.left
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
g : j ⟶ Pairwise.single { down := WalkingPair.left }
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := Pairwise.single { down := WalkingPair.left } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases j with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩)
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  

Proof state:
case refine'_2.mk.mk.single.up.right
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
g : j ⟶ Pairwise.single { down := WalkingPair.right }
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := Pairwise.single { down := WalkingPair.right } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases j with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩)
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  

Proof state:
case refine'_2.mk.mk.pair.up.left.up
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
down✝ : WalkingPair
g : j ⟶ Pairwise.pair { down := WalkingPair.left } { down := down✝ }
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := Pairwise.pair { down := WalkingPair.left } { down := down✝ } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases j with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩)
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  

Proof state:
case refine'_2.mk.mk.pair.up.right.up
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
j : CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair)
down✝ : WalkingPair
g : j ⟶ Pairwise.pair { down := WalkingPair.right } { down := down✝ }
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := j } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := Pairwise.pair { down := WalkingPair.right } { down := down✝ } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases j with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩)
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  rcases j with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  

Proof state:
case refine'_2.mk.mk.single.up.left.single.up.left
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
g : Pairwise.single { down := WalkingPair.left } ⟶ Pairwise.single { down := WalkingPair.left }
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := Pairwise.single { down := WalkingPair.left } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := Pairwise.single { down := WalkingPair.left } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases g with ⟨⟩
/-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) := by
  let ι : ULift.{w} WalkingPair → Opens X := fun j => WalkingPair.casesOn j.down U V
  have hι : U ⊔ V = iSup ι := by
    ext
    rw [Opens.coe_iSup, Set.mem_iUnion]
    constructor
    · rintro (h | h)
      exacts [⟨⟨WalkingPair.left⟩, h⟩, ⟨⟨WalkingPair.right⟩, h⟩]
    · rintro ⟨⟨_ | _⟩, h⟩
      exacts [Or.inl h, Or.inr h]
  refine'
    (F.presheaf.isSheaf_iff_isSheafPairwiseIntersections.mp F.2 ι).some.lift
        ⟨s.pt,
          { app := _
            naturality := _ }⟩ ≫
      F.1.map (eqToHom hι).op
  · rintro ((_ | _) | (_ | _))
    exacts [s.fst, s.snd, s.fst ≫ F.1.map (homOfLE inf_le_left).op,
      s.snd ≫ F.1.map (homOfLE inf_le_left).op]
  rintro ⟨i⟩ ⟨j⟩ f
  let g : j ⟶ i := f.unop
  have : f = g.op := rfl
  clear_value g
  subst this
  rcases i with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  rcases j with (⟨⟨_ | _⟩⟩ | ⟨⟨_ | _⟩, ⟨_⟩⟩) <;>
  

Proof state:
case refine'_2.mk.mk.single.up.left.single.up.right
C : Type u
inst✝ : Category.{v, u} C
X : TopCat
F : Sheaf C X
U V : Opens ↑X
s : PullbackCone (F.val.map (homOfLE (_ : U ⊓ V ≤ U)).op) (F.val.map (homOfLE (_ : U ⊓ V ≤ V)).op)
ι : ULift.{w, 0} WalkingPair → Opens ↑X := fun j => WalkingPair.casesOn j.down U V
hι : U ⊔ V = iSup ι
g : Pairwise.single { down := WalkingPair.right } ⟶ Pairwise.single { down := WalkingPair.left }
⊢ (((Functor.const (CategoryTheory.Pairwise (ULift.{w, 0} WalkingPair))ᵒᵖ).obj s.pt).map g.op ≫
      Opposite.casesOn { unop := Pairwise.single { down := WalkingPair.right } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) =
    (Opposite.casesOn { unop := Pairwise.single { down := WalkingPair.left } } fun unop =>
        Pairwise.casesOn unop
          (fun a => ULift.casesOn a fun down => WalkingPair.casesOn down (PullbackCone.fst s) (PullbackCone.snd s))
          fun a a_1 =>
          ULift.casesOn a fun down =>
            WalkingPair.casesOn down (PullbackCone.fst s ≫ F.val.map (homOfLE (_ : U ⊓ ι a_1 ≤ U)).op)
              (PullbackCone.snd s ≫ F.val.map (homOfLE (_ : V ⊓ ι a_1 ≤ V)).op)) ≫
      ((Pairwise.diagram ι).op ⋙ presheaf F).map g.op

Next tactic:
rcases g with ⟨⟩