l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem cliqueSet_map_of_equiv (G : SimpleGraph α) (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueSet n = map e.toEmbedding '' G.cliqueSet n := by
  obtain rfl | hn := eq_or_ne n 1
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
G✝ H : SimpleGraph α
n : ℕ
a b c : α
s : Finset α
G : SimpleGraph α
e : α ≃ β
⊢ cliqueSet (SimpleGraph.map (Equiv.toEmbedding e) G) 1 = map (Equiv.toEmbedding e) '' cliqueSet G 1

Next tactic:
ext
@[simp]
theorem cliqueSet_map_of_equiv (G : SimpleGraph α) (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueSet n = map e.toEmbedding '' G.cliqueSet n := by
  obtain rfl | hn := eq_or_ne n 1
  · ext
    

Proof state:
case inl.h
α : Type u_1
β : Type u_2
G✝ H : SimpleGraph α
n : ℕ
a b c : α
s : Finset α
G : SimpleGraph α
e : α ≃ β
x✝ : Finset β
⊢ x✝ ∈ cliqueSet (SimpleGraph.map (Equiv.toEmbedding e) G) 1 ↔ x✝ ∈ map (Equiv.toEmbedding e) '' cliqueSet G 1

Next tactic:
simp [e.exists_congr_left]
@[simp]
theorem cliqueSet_map_of_equiv (G : SimpleGraph α) (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueSet n = map e.toEmbedding '' G.cliqueSet n := by
  obtain rfl | hn := eq_or_ne n 1
  · ext
    simp [e.exists_congr_left]
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
G✝ H : SimpleGraph α
n✝ : ℕ
a b c : α
s : Finset α
G : SimpleGraph α
e : α ≃ β
n : ℕ
hn : n ≠ 1
⊢ cliqueSet (SimpleGraph.map (Equiv.toEmbedding e) G) n = map (Equiv.toEmbedding e) '' cliqueSet G n

Next tactic:
exact cliqueSet_map hn _ _
@[simp]
theorem cliqueFinset_eq_empty_iff : G.cliqueFinset n = ∅ ↔ G.CliqueFree n := by
  

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
n : ℕ
a b c : α
s : Finset α
⊢ cliqueFinset G n = ∅ ↔ CliqueFree G n

Next tactic:
simp_rw [CliqueFree, eq_empty_iff_forall_not_mem, mem_cliqueFinset_iff]
theorem card_cliqueFinset_le : (G.cliqueFinset n).card ≤ (card α).choose n := by
  

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
n : ℕ
a b c : α
s : Finset α
⊢ Finset.card (cliqueFinset G n) ≤ Nat.choose (Fintype.card α) n

Next tactic:
rw [← card_univ, ← card_powersetCard]
theorem card_cliqueFinset_le : (G.cliqueFinset n).card ≤ (card α).choose n := by
  rw [← card_univ, ← card_powersetCard]
  

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
n : ℕ
a b c : α
s : Finset α
⊢ Finset.card (cliqueFinset G n) ≤ Finset.card (powersetCard n univ)

Next tactic:
refine' card_mono fun s => _
theorem card_cliqueFinset_le : (G.cliqueFinset n).card ≤ (card α).choose n := by
  rw [← card_univ, ← card_powersetCard]
  refine' card_mono fun s => _
  

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝² : Fintype α
inst✝¹ : DecidableEq α
inst✝ : DecidableRel G.Adj
n : ℕ
a b c : α
s✝ s : Finset α
⊢ s ∈ cliqueFinset G n → s ∈ powersetCard n univ

Next tactic:
simpa [mem_powersetCard_univ] using IsNClique.card_eq
@[simp]
theorem cliqueFinset_map (f : α ↪ β) (hn : n ≠ 1) :
    (G.map f).cliqueFinset n = (G.cliqueFinset n).map ⟨map f, Finset.map_injective _⟩ :=
  coe_injective <| by
    

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝⁵ : Fintype α
inst✝⁴ : DecidableEq α
inst✝³ : DecidableRel G.Adj
n : ℕ
a b c : α
s : Finset α
inst✝² : DecidableRel H.Adj
inst✝¹ : Fintype β
inst✝ : DecidableEq β
f : α ↪ β
hn : n ≠ 1
⊢ ↑(cliqueFinset (SimpleGraph.map f G) n) =
    ↑(map { toFun := map f, inj' := (_ : Injective (map f)) } (cliqueFinset G n))

Next tactic:
simp_rw [coe_cliqueFinset, cliqueSet_map hn, coe_map, coe_cliqueFinset, Embedding.coeFn_mk]
@[simp]
theorem cliqueFinset_map_of_equiv (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueFinset n =
      (G.cliqueFinset n).map ⟨map e.toEmbedding, Finset.map_injective _⟩ :=
  coe_injective <| by 

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝⁵ : Fintype α
inst✝⁴ : DecidableEq α
inst✝³ : DecidableRel G.Adj
n✝ : ℕ
a b c : α
s : Finset α
inst✝² : DecidableRel H.Adj
inst✝¹ : Fintype β
inst✝ : DecidableEq β
e : α ≃ β
n : ℕ
⊢ ↑(cliqueFinset (SimpleGraph.map (Equiv.toEmbedding e) G) n) =
    ↑(map { toFun := map (Equiv.toEmbedding e), inj' := (_ : Injective (map (Equiv.toEmbedding e))) }
        (cliqueFinset G n))

Next tactic:
push_cast
@[simp]
theorem cliqueFinset_map_of_equiv (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueFinset n =
      (G.cliqueFinset n).map ⟨map e.toEmbedding, Finset.map_injective _⟩ :=
  coe_injective <| by push_cast; 

Proof state:
α : Type u_1
β : Type u_2
G H : SimpleGraph α
inst✝⁵ : Fintype α
inst✝⁴ : DecidableEq α
inst✝³ : DecidableRel G.Adj
n✝ : ℕ
a b c : α
s : Finset α
inst✝² : DecidableRel H.Adj
inst✝¹ : Fintype β
inst✝ : DecidableEq β
e : α ≃ β
n : ℕ
⊢ cliqueSet (SimpleGraph.map (Equiv.toEmbedding e) G) n =
    ⇑{ toFun := map (Equiv.toEmbedding e), inj' := (_ : Injective (map (Equiv.toEmbedding e))) } '' cliqueSet G n

Next tactic:
exact cliqueSet_map_of_equiv _ _ _
@[simp 1100]
theorem op_map_id_obj (U : (Opens X)ᵒᵖ) : (map (𝟙 X)).op.obj U = U := by 

Proof state:
X Y Z : TopCat
U : (Opens ↑X)ᵒᵖ
⊢ (map (𝟙 X)).op.obj U = U

Next tactic:
simp
theorem map_iSup (f : X ⟶ Y) {ι : Type*} (U : ι → Opens Y) :
    (map f).obj (iSup U) = iSup ((map f).obj ∘ U) := by
  

Proof state:
X Y Z : TopCat
f : X ⟶ Y
ι : Type u_1
U : ι → Opens ↑Y
⊢ (map f).obj (iSup U) = iSup ((map f).toPrefunctor.obj ∘ U)

Next tactic:
ext1
theorem map_iSup (f : X ⟶ Y) {ι : Type*} (U : ι → Opens Y) :
    (map f).obj (iSup U) = iSup ((map f).obj ∘ U) := by
  ext1; 

Proof state:
case h
X Y Z : TopCat
f : X ⟶ Y
ι : Type u_1
U : ι → Opens ↑Y
⊢ ↑((map f).obj (iSup U)) = ↑(iSup ((map f).toPrefunctor.obj ∘ U))

Next tactic:
rw [iSup_def, iSup_def, map_obj]
theorem map_iSup (f : X ⟶ Y) {ι : Type*} (U : ι → Opens Y) :
    (map f).obj (iSup U) = iSup ((map f).obj ∘ U) := by
  ext1; rw [iSup_def, iSup_def, map_obj]
  

Proof state:
case h
X Y Z : TopCat
f : X ⟶ Y
ι : Type u_1
U : ι → Opens ↑Y
⊢ ↑{ carrier := ⇑f ⁻¹' ⋃ i, ↑(U i), is_open' := (_ : IsOpen (⇑f ⁻¹' ⋃ i, ↑(U i))) } =
    ↑{ carrier := ⋃ i, ↑(((map f).toPrefunctor.obj ∘ U) i),
        is_open' := (_ : IsOpen (⋃ i, ↑(((map f).toPrefunctor.obj ∘ U) i))) }

Next tactic:
dsimp
theorem map_iSup (f : X ⟶ Y) {ι : Type*} (U : ι → Opens Y) :
    (map f).obj (iSup U) = iSup ((map f).obj ∘ U) := by
  ext1; rw [iSup_def, iSup_def, map_obj]
  dsimp; 

Proof state:
case h
X Y Z : TopCat
f : X ⟶ Y
ι : Type u_1
U : ι → Opens ↑Y
⊢ ⇑f ⁻¹' ⋃ i, ↑(U i) = ⋃ i, ⇑f ⁻¹' ↑(U i)

Next tactic:
rw [Set.preimage_iUnion]
theorem map_id_eq : map (𝟙 X) = 𝟭 (Opens X) := by
  

Proof state:
X Y Z : TopCat
⊢ map (𝟙 X) = 𝟭 (Opens ↑X)

Next tactic:
rfl
/-- If two continuous maps `f g : X ⟶ Y` are equal,
then the functors `Opens Y ⥤ Opens X` they induce are isomorphic.
-/
def mapIso (f g : X ⟶ Y) (h : f = g) : map f ≅ map g :=
  NatIso.ofComponents fun U => eqToIso (by 

Proof state:
X Y Z : TopCat
f g : X ⟶ Y
h : f = g
U : Opens ↑Y
⊢ (map f).obj U = (map g).obj U

Next tactic:
rw [congr_arg map h]
theorem map_eq (f g : X ⟶ Y) (h : f = g) : map f = map g := by
  

Proof state:
X Y Z : TopCat
f g : X ⟶ Y
h : f = g
⊢ map f = map g

Next tactic:
subst h
theorem map_eq (f g : X ⟶ Y) (h : f = g) : map f = map g := by
  subst h
  

Proof state:
X Y Z : TopCat
f : X ⟶ Y
⊢ map f = map f

Next tactic:
rfl
@[simp]
theorem mapIso_hom_app (f g : X ⟶ Y) (h : f = g) (U : Opens Y) :
    (mapIso f g h).hom.app U = eqToHom (by 

Proof state:
X Y Z : TopCat
f g : X ⟶ Y
h : f = g
U : Opens ↑Y
⊢ (map f).obj U = (map g).obj U

Next tactic:
rw [h]
@[simp]
theorem mapIso_inv_app (f g : X ⟶ Y) (h : f = g) (U : Opens Y) :
    (mapIso f g h).inv.app U = eqToHom (by 

Proof state:
X Y Z : TopCat
f g : X ⟶ Y
h : f = g
U : Opens ↑Y
⊢ (map g).obj U = (map f).obj U

Next tactic:
rw [h]
/-- A homeomorphism of spaces gives an equivalence of categories of open sets.

TODO: define `OrderIso.equivalence`, use it.
-/
@[simps]
def mapMapIso {X Y : TopCat.{u}} (H : X ≅ Y) : Opens Y ≌ Opens X where
  functor := map H.hom
  inverse := map H.inv
  unitIso := NatIso.ofComponents fun U => eqToIso (by 

Proof state:
X✝ Y✝ Z X Y : TopCat
H : X ≅ Y
U : Opens ↑Y
⊢ (𝟭 (Opens ↑Y)).obj U = (map H.hom ⋙ map H.inv).obj U

Next tactic:
simp [map, Set.preimage_preimage]
/-- A homeomorphism of spaces gives an equivalence of categories of open sets.

TODO: define `OrderIso.equivalence`, use it.
-/
@[simps]
def mapMapIso {X Y : TopCat.{u}} (H : X ≅ Y) : Opens Y ≌ Opens X where
  functor := map H.hom
  inverse := map H.inv
  unitIso := NatIso.ofComponents fun U => eqToIso (by simp [map, Set.preimage_preimage])
  counitIso := NatIso.ofComponents fun U => eqToIso (by 

Proof state:
X✝ Y✝ Z X Y : TopCat
H : X ≅ Y
U : Opens ↑X
⊢ (map H.inv ⋙ map H.hom).obj U = (𝟭 (Opens ↑X)).obj U

Next tactic:
simp [map, Set.preimage_preimage]
instance IsOpenMap.functorFullOfMono {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) [H : Mono f] :
    Full hf.functor where
  preimage i :=
    homOfLE fun x hx => by
      

Proof state:
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
H : Mono f
X✝ Y✝ : Opens ↑X
i : (functor hf).obj X✝ ⟶ (functor hf).obj Y✝
x : ↑X
hx : x ∈ ↑X✝
⊢ x ∈ ↑Y✝

Next tactic:
obtain ⟨y, hy, eq⟩ := i.le ⟨x, hx, rfl⟩
instance IsOpenMap.functorFullOfMono {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) [H : Mono f] :
    Full hf.functor where
  preimage i :=
    homOfLE fun x hx => by
      obtain ⟨y, hy, eq⟩ := i.le ⟨x, hx, rfl⟩
      

Proof state:
case intro.intro
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
H : Mono f
X✝ Y✝ : Opens ↑X
i : (functor hf).obj X✝ ⟶ (functor hf).obj Y✝
x : ↑X
hx : x ∈ ↑X✝
y : (forget TopCat).obj X
hy : y ∈ ↑Y✝
eq : f y = f x
⊢ x ∈ ↑Y✝

Next tactic:
exact (TopCat.mono_iff_injective f).mp H eq ▸ hy
@[simp]
theorem openEmbedding_obj_top {X : TopCat} (U : Opens X) :
    U.openEmbedding.isOpenMap.functor.obj ⊤ = U := by
  

Proof state:
X : TopCat
U : Opens ↑X
⊢ (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj ⊤ = U

Next tactic:
ext1
@[simp]
theorem openEmbedding_obj_top {X : TopCat} (U : Opens X) :
    U.openEmbedding.isOpenMap.functor.obj ⊤ = U := by
  ext1
  

Proof state:
case h
X : TopCat
U : Opens ↑X
⊢ ↑((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj ⊤) = ↑U

Next tactic:
exact Set.image_univ.trans Subtype.range_coe
@[simp]
theorem inclusion_map_eq_top {X : TopCat} (U : Opens X) : (Opens.map U.inclusion).obj U = ⊤ := by
  

Proof state:
X : TopCat
U : Opens ↑X
⊢ (map (inclusion U)).obj U = ⊤

Next tactic:
ext1
@[simp]
theorem inclusion_map_eq_top {X : TopCat} (U : Opens X) : (Opens.map U.inclusion).obj U = ⊤ := by
  ext1
  

Proof state:
case h
X : TopCat
U : Opens ↑X
⊢ ↑((map (inclusion U)).obj U) = ↑⊤

Next tactic:
exact Subtype.coe_preimage_self _
@[simp]
theorem adjunction_counit_app_self {X : TopCat} (U : Opens X) :
    U.openEmbedding.isOpenMap.adjunction.counit.app U = eqToHom (by 

Proof state:
X : TopCat
U : Opens ↑X
⊢ (map (inclusion U) ⋙ IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj U = (𝟭 (Opens ↑X)).obj U

Next tactic:
simp
theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv := by
  

Proof state:
X : TopCat
⊢ IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤)) = map (inclusionTopIso X).inv

Next tactic:
refine' CategoryTheory.Functor.ext _ _
theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv := by
  refine' CategoryTheory.Functor.ext _ _
  · 

Proof state:
case refine'_1
X : TopCat
⊢ ∀ (X_1 : Opens ↑((toTopCat X).obj ⊤)),
    (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj X_1 = (map (inclusionTopIso X).inv).obj X_1

Next tactic:
intro U
theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv := by
  refine' CategoryTheory.Functor.ext _ _
  · intro U
    

Proof state:
case refine'_1
X : TopCat
U : Opens ↑((toTopCat X).obj ⊤)
⊢ (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj U = (map (inclusionTopIso X).inv).obj U

Next tactic:
ext x
theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv := by
  refine' CategoryTheory.Functor.ext _ _
  · intro U
    ext x
    

Proof state:
case refine'_1.h.h
X : TopCat
U : Opens ↑((toTopCat X).obj ⊤)
x : ↑X
⊢ x ∈ ↑((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj U) ↔ x ∈ ↑((map (inclusionTopIso X).inv).obj U)

Next tactic:
exact ⟨fun ⟨⟨_, _⟩, h, rfl⟩ => h, fun h => ⟨⟨x, trivial⟩, h, rfl⟩⟩
theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv := by
  refine' CategoryTheory.Functor.ext _ _
  · intro U
    ext x
    exact ⟨fun ⟨⟨_, _⟩, h, rfl⟩ => h, fun h => ⟨⟨x, trivial⟩, h, rfl⟩⟩
  · 

Proof state:
case refine'_2
X : TopCat
⊢ ∀ (X_1 Y : Opens ↑((toTopCat X).obj ⊤)) (f : X_1 ⟶ Y),
    (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).map f =
      eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj X_1 = (map (inclusionTopIso X).inv).obj X_1) ≫
        (map (inclusionTopIso X).inv).map f ≫
          eqToHom (_ : (map (inclusionTopIso X).inv).obj Y = (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj Y)

Next tactic:
intros U V f
theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv := by
  refine' CategoryTheory.Functor.ext _ _
  · intro U
    ext x
    exact ⟨fun ⟨⟨_, _⟩, h, rfl⟩ => h, fun h => ⟨⟨x, trivial⟩, h, rfl⟩⟩
  · intros U V f
    

Proof state:
case refine'_2
X : TopCat
U V : Opens ↑((toTopCat X).obj ⊤)
f : U ⟶ V
⊢ (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).map f =
    eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj U = (map (inclusionTopIso X).inv).obj U) ≫
      (map (inclusionTopIso X).inv).map f ≫
        eqToHom (_ : (map (inclusionTopIso X).inv).obj V = (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion ⊤))).obj V)

Next tactic:
apply Subsingleton.elim
theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U := by
  

Proof state:
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
U : Opens ↑Y
⊢ (IsOpenMap.functor hf).obj ((map f).obj U) = (IsOpenMap.functor hf).obj ⊤ ⊓ U

Next tactic:
ext
theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U := by
  ext
  

Proof state:
case h.h
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
U : Opens ↑Y
x✝ : ↑Y
⊢ x✝ ∈ ↑((IsOpenMap.functor hf).obj ((map f).obj U)) ↔ x✝ ∈ ↑((IsOpenMap.functor hf).obj ⊤ ⊓ U)

Next tactic:
constructor
theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U := by
  ext
  constructor
  · 

Proof state:
case h.h.mp
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
U : Opens ↑Y
x✝ : ↑Y
⊢ x✝ ∈ ↑((IsOpenMap.functor hf).obj ((map f).obj U)) → x✝ ∈ ↑((IsOpenMap.functor hf).obj ⊤ ⊓ U)

Next tactic:
rintro ⟨x, hx, rfl⟩
theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U := by
  ext
  constructor
  · rintro ⟨x, hx, rfl⟩
    

Proof state:
case h.h.mp.intro.intro
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
U : Opens ↑Y
x : (forget TopCat).obj X
hx : x ∈ ↑((map f).obj U)
⊢ f x ∈ ↑((IsOpenMap.functor hf).obj ⊤ ⊓ U)

Next tactic:
exact ⟨⟨x, trivial, rfl⟩, hx⟩
theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U := by
  ext
  constructor
  · rintro ⟨x, hx, rfl⟩
    exact ⟨⟨x, trivial, rfl⟩, hx⟩
  · 

Proof state:
case h.h.mpr
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
U : Opens ↑Y
x✝ : ↑Y
⊢ x✝ ∈ ↑((IsOpenMap.functor hf).obj ⊤ ⊓ U) → x✝ ∈ ↑((IsOpenMap.functor hf).obj ((map f).obj U))

Next tactic:
rintro ⟨⟨x, -, rfl⟩, hx⟩
theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U := by
  ext
  constructor
  · rintro ⟨x, hx, rfl⟩
    exact ⟨⟨x, trivial, rfl⟩, hx⟩
  · rintro ⟨⟨x, -, rfl⟩, hx⟩
    

Proof state:
case h.h.mpr.intro.intro.intro
X Y : TopCat
f : X ⟶ Y
hf : IsOpenMap ⇑f
U : Opens ↑Y
x : (forget TopCat).obj X
hx : f x ∈ ↑U
⊢ f x ∈ ↑((IsOpenMap.functor hf).obj ((map f).obj U))

Next tactic:
exact ⟨x, hx, rfl⟩
lemma set_range_forget_map_inclusion {X : TopCat} (U : Opens X) :
    Set.range ((forget TopCat).map (inclusion U)) = (U : Set X) := by
  

Proof state:
X : TopCat
U : Opens ↑X
⊢ Set.range ((forget TopCat).map (inclusion U)) = ↑U

Next tactic:
ext x
lemma set_range_forget_map_inclusion {X : TopCat} (U : Opens X) :
    Set.range ((forget TopCat).map (inclusion U)) = (U : Set X) := by
  ext x
  

Proof state:
case h
X : TopCat
U : Opens ↑X
x : (forget TopCat).obj X
⊢ x ∈ Set.range ((forget TopCat).map (inclusion U)) ↔ x ∈ ↑U

Next tactic:
constructor
lemma set_range_forget_map_inclusion {X : TopCat} (U : Opens X) :
    Set.range ((forget TopCat).map (inclusion U)) = (U : Set X) := by
  ext x
  constructor
  · 

Proof state:
case h.mp
X : TopCat
U : Opens ↑X
x : (forget TopCat).obj X
⊢ x ∈ Set.range ((forget TopCat).map (inclusion U)) → x ∈ ↑U

Next tactic:
rintro ⟨x, rfl⟩
lemma set_range_forget_map_inclusion {X : TopCat} (U : Opens X) :
    Set.range ((forget TopCat).map (inclusion U)) = (U : Set X) := by
  ext x
  constructor
  · rintro ⟨x, rfl⟩
    

Proof state:
case h.mp.intro
X : TopCat
U : Opens ↑X
x : (forget TopCat).obj ((toTopCat X).obj U)
⊢ (forget TopCat).map (inclusion U) x ∈ ↑U

Next tactic:
exact x.2
lemma set_range_forget_map_inclusion {X : TopCat} (U : Opens X) :
    Set.range ((forget TopCat).map (inclusion U)) = (U : Set X) := by
  ext x
  constructor
  · rintro ⟨x, rfl⟩
    exact x.2
  · 

Proof state:
case h.mpr
X : TopCat
U : Opens ↑X
x : (forget TopCat).obj X
⊢ x ∈ ↑U → x ∈ Set.range ((forget TopCat).map (inclusion U))

Next tactic:
intro h
lemma set_range_forget_map_inclusion {X : TopCat} (U : Opens X) :
    Set.range ((forget TopCat).map (inclusion U)) = (U : Set X) := by
  ext x
  constructor
  · rintro ⟨x, rfl⟩
    exact x.2
  · intro h
    

Proof state:
case h.mpr
X : TopCat
U : Opens ↑X
x : (forget TopCat).obj X
h : x ∈ ↑U
⊢ x ∈ Set.range ((forget TopCat).map (inclusion U))

Next tactic:
exact ⟨⟨x, h⟩, rfl⟩
@[simp]
theorem functor_map_eq_inf {X : TopCat} (U V : Opens X) :
    U.openEmbedding.isOpenMap.functor.obj ((Opens.map U.inclusion).obj V) = V ⊓ U := by
  

Proof state:
X : TopCat
U V : Opens ↑X
⊢ (IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj ((map (inclusion U)).obj V) = V ⊓ U

Next tactic:
ext1
@[simp]
theorem functor_map_eq_inf {X : TopCat} (U V : Opens X) :
    U.openEmbedding.isOpenMap.functor.obj ((Opens.map U.inclusion).obj V) = V ⊓ U := by
  ext1
  

Proof state:
case h
X : TopCat
U V : Opens ↑X
⊢ ↑((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj ((map (inclusion U)).obj V)) = ↑(V ⊓ U)

Next tactic:
refine' Set.image_preimage_eq_inter_range.trans _
@[simp]
theorem functor_map_eq_inf {X : TopCat} (U V : Opens X) :
    U.openEmbedding.isOpenMap.functor.obj ((Opens.map U.inclusion).obj V) = V ⊓ U := by
  ext1
  refine' Set.image_preimage_eq_inter_range.trans _
  

Proof state:
case h
X : TopCat
U V : Opens ↑X
⊢ (V.1 ∩ Set.range fun x => (inclusion U) x) = ↑(V ⊓ U)

Next tactic:
erw [set_range_forget_map_inclusion U]
@[simp]
theorem functor_map_eq_inf {X : TopCat} (U V : Opens X) :
    U.openEmbedding.isOpenMap.functor.obj ((Opens.map U.inclusion).obj V) = V ⊓ U := by
  ext1
  refine' Set.image_preimage_eq_inter_range.trans _
  erw [set_range_forget_map_inclusion U]
  

Proof state:
case h
X : TopCat
U V : Opens ↑X
⊢ V.1 ∩ ↑U = ↑(V ⊓ U)

Next tactic:
rfl
@[simp]
theorem adjunction_counit_map_functor {X : TopCat} {U : Opens X} (V : Opens U) :
    U.openEmbedding.isOpenMap.adjunction.counit.app (U.openEmbedding.isOpenMap.functor.obj V) =
      eqToHom (by 

Proof state:
X : TopCat
U : Opens ↑X
V : Opens ↥U
⊢ (map (inclusion U) ⋙ IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj
      ((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj V) =
    (𝟭 (Opens ↑X)).obj ((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj V)

Next tactic:
dsimp
@[simp]
theorem adjunction_counit_map_functor {X : TopCat} {U : Opens X} (V : Opens U) :
    U.openEmbedding.isOpenMap.adjunction.counit.app (U.openEmbedding.isOpenMap.functor.obj V) =
      eqToHom (by dsimp; 

Proof state:
X : TopCat
U : Opens ↑X
V : Opens ↥U
⊢ (IsOpenMap.functor (_ : IsOpenMap Subtype.val)).obj
      ((map (inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap Subtype.val)).obj V)) =
    (IsOpenMap.functor (_ : IsOpenMap Subtype.val)).obj V

Next tactic:
rw [map_functor_eq V]
@[simp]
theorem adjunction_counit_map_functor {X : TopCat} {U : Opens X} (V : Opens U) :
    U.openEmbedding.isOpenMap.adjunction.counit.app (U.openEmbedding.isOpenMap.functor.obj V) =
      eqToHom (by dsimp; rw [map_functor_eq V]) :=
  by 

Proof state:
X : TopCat
U : Opens ↑X
V : Opens ↥U
⊢ (IsOpenMap.adjunction (_ : IsOpenMap ⇑(inclusion U))).counit.app
      ((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj V) =
    eqToHom
      (_ :
        (map (inclusion U) ⋙ IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj
            ((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj V) =
          (𝟭 (Opens ↑X)).obj ((IsOpenMap.functor (_ : IsOpenMap ⇑(inclusion U))).obj V))

Next tactic:
apply Subsingleton.elim
/-- The canonical transition map `(Uᵢ ×[Z] Y) ×[X] Uⱼ ⟶ (Uⱼ ×[Z] Y) ×[X] Uᵢ` given by the fact
that pullbacks are associative and symmetric. -/
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
i j : 𝒰.J
⊢ v 𝒰 f g i j ⟶ v 𝒰 f g j i

Next tactic:
haveI : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
    hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
/-- The canonical transition map `(Uᵢ ×[Z] Y) ×[X] Uⱼ ⟶ (Uⱼ ×[Z] Y) ×[X] Uᵢ` given by the fact
that pullbacks are associative and symmetric. -/
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
  haveI : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
    hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
i j : 𝒰.J
this : HasPullback (pullback.snd ≫ OpenCover.map 𝒰 i ≫ f) g
⊢ v 𝒰 f g i j ⟶ v 𝒰 f g j i

Next tactic:
haveI : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
    hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
/-- The canonical transition map `(Uᵢ ×[Z] Y) ×[X] Uⱼ ⟶ (Uⱼ ×[Z] Y) ×[X] Uᵢ` given by the fact
that pullbacks are associative and symmetric. -/
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
  haveI : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
    hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
  haveI : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
    hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (i : 𝒰.J), HasPullback (OpenCover.map 𝒰 i ≫ f) g
i j : 𝒰.J
this✝ : HasPullback (pullback.snd ≫ OpenCover.map 𝒰 i ≫ f) g
this : HasPullback (pullback.snd ≫ OpenCover.map 𝒰 j ≫ f) g
⊢ v 𝒰 f g i j ⟶ v 𝒰 f g j i

Next tactic:
refine' (pullbackSymmetry _ _).hom ≫ _