l3lab/ntp-mathlib huggingface dataset:
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
    · apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
  homEquiv_counit {𝓕} c α := by
    -- Porting note : added a `dsimp`
    dsimp; ext U; simp only [Equiv.coe_fn_symm_mk, counit_app]
    

Proof state:
case ih
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : 𝓕 ⟶ (skyscraperPresheafFunctor p₀).obj c
U : Opens ↑X
hxU✝ : p₀ ∈ U
⊢ Presheaf.germ 𝓕 { val := p₀, property := hxU✝ } ≫ fromStalk p₀ α =
    Presheaf.germ 𝓕 { val := p₀, property := hxU✝ } ≫
      (Presheaf.stalkFunctor C p₀).map α ≫ (skyscraperPresheafStalkOfSpecializes p₀ c (_ : p₀ ⤳ p₀)).hom

Next tactic:
erw [colimit.ι_desc, ← Category.assoc, colimit.ι_map, whiskerLeft_app, Category.assoc,
      colimit.ι_desc]
/-- `skyscraperPresheafFunctor` is the right adjoint of `Presheaf.stalkFunctor`
-/
def skyscraperPresheafStalkAdjunction [HasColimits C] :
    (Presheaf.stalkFunctor C p₀ : Presheaf C X ⥤ C) ⊣ skyscraperPresheafFunctor p₀ where
  homEquiv c 𝓕 :=
    { toFun := toSkyscraperPresheaf _
      invFun := fromStalk _
      left_inv := fromStalk_to_skyscraper _
      right_inv := to_skyscraper_fromStalk _ }
  unit := StalkSkyscraperPresheafAdjunctionAuxs.unit _
  counit := StalkSkyscraperPresheafAdjunctionAuxs.counit _
  homEquiv_unit {𝓕} c α := by
    ext U;
    -- Porting note : `NatTrans.comp_app` is not picked up by `simp`
    rw [NatTrans.comp_app]
    simp only [Equiv.coe_fn_mk, toSkyscraperPresheaf_app, SkyscraperPresheafFunctor.map'_app,
      skyscraperPresheafFunctor_map, unit_app]
    split_ifs with h
    · erw [Category.id_comp, ← Category.assoc, comp_eqToHom_iff, Category.assoc, Category.assoc,
        Category.assoc, Category.assoc, eqToHom_trans, eqToHom_refl, Category.comp_id, ←
        Category.assoc _ _ α, eqToHom_trans, eqToHom_refl, Category.id_comp]
    · apply ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext
  homEquiv_counit {𝓕} c α := by
    -- Porting note : added a `dsimp`
    dsimp; ext U; simp only [Equiv.coe_fn_symm_mk, counit_app]
    erw [colimit.ι_desc, ← Category.assoc, colimit.ι_map, whiskerLeft_app, Category.assoc,
      colimit.ι_desc]
    

Proof state:
case ih
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓕 : Presheaf C X
c : C
α : 𝓕 ⟶ (skyscraperPresheafFunctor p₀).obj c
U : Opens ↑X
hxU✝ : p₀ ∈ U
⊢ { pt := c,
            ι :=
              NatTrans.mk fun U =>
                α.app (op U.unop.obj) ≫ eqToHom (_ : (if p₀ ∈ U.unop.obj then c else ⊤_ C) = c) }.ι.app
      (op { obj := U, property := (_ : ↑{ val := p₀, property := hxU✝ } ∈ U) }) =
    α.app ((OpenNhds.inclusion p₀).op.obj (op { obj := U, property := (_ : ↑{ val := p₀, property := hxU✝ } ∈ U) })) ≫
      { cocone := skyscraperPresheafCoconeOfSpecializes p₀ c (_ : p₀ ⤳ p₀),
                isColimit := skyscraperPresheafCoconeIsColimitOfSpecializes p₀ c (_ : p₀ ⤳ p₀) }.cocone.ι.app
        (op { obj := U, property := (_ : ↑{ val := p₀, property := hxU✝ } ∈ U) })

Next tactic:
rfl
/-- Taking stalks of a sheaf is the left adjoint functor to `skyscraperSheafFunctor`
-/
def stalkSkyscraperSheafAdjunction [HasColimits C] :
    Sheaf.forget C X ⋙ Presheaf.stalkFunctor _ p₀ ⊣ skyscraperSheafFunctor p₀ where
  -- Porting note : `ext1` is changed to `Sheaf.Hom.ext`,
  -- see https://github.com/leanprover-community/mathlib4/issues/5229
  homEquiv 𝓕 c :=
    ⟨fun f => ⟨toSkyscraperPresheaf p₀ f⟩, fun g => fromStalk p₀ g.1, fromStalk_to_skyscraper p₀,
      fun g => Sheaf.Hom.ext _ _ <| to_skyscraper_fromStalk _ _⟩
  unit :=
    { app := fun 𝓕 => ⟨(StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕.1⟩
      naturality := fun 𝓐 𝓑 f => Sheaf.Hom.ext _ _ <| by
        

Proof state:
X : TopCat
p₀ : ↑X
inst✝³ : (U : Opens ↑X) → Decidable (p₀ ∈ U)
C : Type v
inst✝² : Category.{u, v} C
A : C
inst✝¹ : HasTerminal C
inst✝ : HasColimits C
𝓐 𝓑 : TopCat.Sheaf C X
f : 𝓐 ⟶ 𝓑
⊢ ((𝟭 (TopCat.Sheaf C X)).map f ≫
        (fun 𝓕 => { val := (StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕.val }) 𝓑).val =
    ((fun 𝓕 => { val := (StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕.val }) 𝓐 ≫
        ((Sheaf.forget C X ⋙ Presheaf.stalkFunctor C p₀) ⋙ skyscraperSheafFunctor p₀).map f).val

Next tactic:
apply (StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).naturality
theorem projIcc_of_le_left (hx : x ≤ a) : projIcc a b h x = ⟨a, left_mem_Icc.2 h⟩ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
hx : x ≤ a
⊢ projIcc a b h x = { val := a, property := (_ : a ∈ Icc a b) }

Next tactic:
simp [projIcc, hx, hx.trans h]
theorem projIcc_of_right_le (hx : b ≤ x) : projIcc a b h x = ⟨b, right_mem_Icc.2 h⟩ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
hx : b ≤ x
⊢ projIcc a b h x = { val := b, property := (_ : b ∈ Icc a b) }

Next tactic:
simp [projIcc, hx, h]
theorem projIci_eq_self : projIci a x = ⟨a, le_rfl⟩ ↔ x ≤ a := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
⊢ projIci a x = { val := a, property := (_ : a ≤ a) } ↔ x ≤ a

Next tactic:
simp [projIci, Subtype.ext_iff]
theorem projIic_eq_self : projIic b x = ⟨b, le_rfl⟩ ↔ b ≤ x := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
⊢ projIic b x = { val := b, property := (_ : b ≤ b) } ↔ b ≤ x

Next tactic:
simp [projIic, Subtype.ext_iff]
theorem projIcc_eq_left (h : a < b) : projIcc a b h.le x = ⟨a, left_mem_Icc.mpr h.le⟩ ↔ x ≤ a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h✝ : a ≤ b
x : α
h : a < b
⊢ projIcc a b (_ : a ≤ b) x = { val := a, property := (_ : a ∈ Icc a b) } ↔ x ≤ a

Next tactic:
simp [projIcc, Subtype.ext_iff, h.not_le]
theorem projIcc_eq_right (h : a < b) : projIcc a b h.le x = ⟨b, right_mem_Icc.2 h.le⟩ ↔ b ≤ x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h✝ : a ≤ b
x : α
h : a < b
⊢ projIcc a b (_ : a ≤ b) x = { val := b, property := (_ : b ∈ Icc a b) } ↔ b ≤ x

Next tactic:
simp [projIcc, Subtype.ext_iff, max_min_distrib_left, h.le, h.not_le]
theorem projIci_of_mem (hx : x ∈ Ici a) : projIci a x = ⟨x, hx⟩ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
hx : x ∈ Ici a
⊢ projIci a x = { val := x, property := hx }

Next tactic:
simpa [projIci]
theorem projIic_of_mem (hx : x ∈ Iic b) : projIic b x = ⟨x, hx⟩ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
hx : x ∈ Iic b
⊢ projIic b x = { val := x, property := hx }

Next tactic:
simpa [projIic]
theorem projIcc_of_mem (hx : x ∈ Icc a b) : projIcc a b h x = ⟨x, hx⟩ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
hx : x ∈ Icc a b
⊢ projIcc a b h x = { val := x, property := hx }

Next tactic:
simp [projIcc, hx.1, hx.2]
@[simp]
theorem projIci_coe (x : Ici a) : projIci a x = x := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
x : ↑(Ici a)
⊢ projIci a ↑x = x

Next tactic:
cases x
@[simp]
theorem projIci_coe (x : Ici a) : projIci a x = x := by cases x; 

Proof state:
case mk
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x val✝ : α
property✝ : val✝ ∈ Ici a
⊢ projIci a ↑{ val := val✝, property := property✝ } = { val := val✝, property := property✝ }

Next tactic:
apply projIci_of_mem
@[simp]
theorem projIic_coe (x : Iic b) : projIic b x = x := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
x : ↑(Iic b)
⊢ projIic b ↑x = x

Next tactic:
cases x
@[simp]
theorem projIic_coe (x : Iic b) : projIic b x = x := by cases x; 

Proof state:
case mk
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x val✝ : α
property✝ : val✝ ∈ Iic b
⊢ projIic b ↑{ val := val✝, property := property✝ } = { val := val✝, property := property✝ }

Next tactic:
apply projIic_of_mem
@[simp]
theorem projIcc_val (x : Icc a b) : projIcc a b h x = x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
x : ↑(Icc a b)
⊢ projIcc a b h ↑x = x

Next tactic:
cases x
@[simp]
theorem projIcc_val (x : Icc a b) : projIcc a b h x = x := by
  cases x
  

Proof state:
case mk
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x val✝ : α
property✝ : val✝ ∈ Icc a b
⊢ projIcc a b h ↑{ val := val✝, property := property✝ } = { val := val✝, property := property✝ }

Next tactic:
apply projIcc_of_mem
theorem strictMonoOn_projIci : StrictMonoOn (projIci a) (Ici a) := fun x hx y hy hxy => by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ x : α
hx : x ∈ Ici a
y : α
hy : y ∈ Ici a
hxy : x < y
⊢ projIci a x < projIci a y

Next tactic:
simpa only [projIci_of_mem, hx, hy]
theorem strictMonoOn_projIic : StrictMonoOn (projIic b) (Iic b) := fun x hx y hy hxy => by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ x : α
hx : x ∈ Iic b
y : α
hy : y ∈ Iic b
hxy : x < y
⊢ projIic b x < projIic b y

Next tactic:
simpa only [projIic_of_mem, hx, hy]
theorem strictMonoOn_projIcc : StrictMonoOn (projIcc a b h) (Icc a b) := fun x hx y hy hxy => by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ x : α
hx : x ∈ Icc a b
y : α
hy : y ∈ Icc a b
hxy : x < y
⊢ projIcc a b h x < projIcc a b h y

Next tactic:
simpa only [projIcc_of_mem, hx, hy]
@[simp]
theorem range_IciExtend (f : Ici a → β) : range (IciExtend f) = range f := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
f : ↑(Ici a) → β
⊢ range (IciExtend f) = range f

Next tactic:
simp only [IciExtend, range_comp f, range_projIci, range_id', image_univ]
@[simp]
theorem range_IicExtend (f : Iic b → β) : range (IicExtend f) = range f := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
f : ↑(Iic b) → β
⊢ range (IicExtend f) = range f

Next tactic:
simp only [IicExtend, range_comp f, range_projIic, range_id', image_univ]
@[simp]
theorem IccExtend_range (f : Icc a b → β) : range (IccExtend h f) = range f := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
f : ↑(Icc a b) → β
⊢ range (IccExtend h f) = range f

Next tactic:
simp only [IccExtend, range_comp f, range_projIcc, image_univ]
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
⊢ IccExtend h (f ∘ Subtype.val) = f

Next tactic:
ext x
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  ext x
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
x : α
⊢ IccExtend h (f ∘ Subtype.val) x = f x

Next tactic:
cases' lt_or_le x a with hxa hax
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  ext x
  cases' lt_or_le x a with hxa hax
  · 

Proof state:
case h.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
x : α
hxa : x < a
⊢ IccExtend h (f ∘ Subtype.val) x = f x

Next tactic:
simp [IccExtend_of_le_left _ _ hxa.le, ha x hxa]
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  ext x
  cases' lt_or_le x a with hxa hax
  · simp [IccExtend_of_le_left _ _ hxa.le, ha x hxa]
  · 

Proof state:
case h.inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
x : α
hax : a ≤ x
⊢ IccExtend h (f ∘ Subtype.val) x = f x

Next tactic:
rcases le_or_lt x b with hxb | hbx
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  ext x
  cases' lt_or_le x a with hxa hax
  · simp [IccExtend_of_le_left _ _ hxa.le, ha x hxa]
  · rcases le_or_lt x b with hxb | hbx
    · 

Proof state:
case h.inr.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
x : α
hax : a ≤ x
hxb : x ≤ b
⊢ IccExtend h (f ∘ Subtype.val) x = f x

Next tactic:
lift x to Icc a b using ⟨hax, hxb⟩
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  ext x
  cases' lt_or_le x a with hxa hax
  · simp [IccExtend_of_le_left _ _ hxa.le, ha x hxa]
  · rcases le_or_lt x b with hxb | hbx
    · lift x to Icc a b using ⟨hax, hxb⟩
      

Proof state:
case h.inr.inl.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
x : { x // x ∈ Icc a b }
hax : a ≤ ↑x
hxb : ↑x ≤ b
⊢ IccExtend h (f ∘ Subtype.val) ↑x = f ↑x

Next tactic:
rw [IccExtend_val, comp_apply]
/-- If `f : α → β` is a constant both on $(-∞, a]$ and on $[b, +∞)$, then the extension of this
function from $[a, b]$ to the whole line is equal to the original function. -/
theorem IccExtend_eq_self (f : α → β) (ha : ∀ x < a, f x = f a) (hb : ∀ x, b < x → f x = f b) :
    IccExtend h (f ∘ (↑)) = f := by
  ext x
  cases' lt_or_le x a with hxa hax
  · simp [IccExtend_of_le_left _ _ hxa.le, ha x hxa]
  · rcases le_or_lt x b with hxb | hbx
    · lift x to Icc a b using ⟨hax, hxb⟩
      rw [IccExtend_val, comp_apply]
    · 

Proof state:
case h.inr.inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a b : α
h : a ≤ b
x✝ : α
f : α → β
ha : ∀ x < a, f x = f a
hb : ∀ (x : α), b < x → f x = f b
x : α
hax : a ≤ x
hbx : b < x
⊢ IccExtend h (f ∘ Subtype.val) x = f x

Next tactic:
simp [IccExtend_of_right_le _ _ hbx.le, hb x hbx]
theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : PartialOrder α
inst✝ : Nontrivial α
⊢ Disjoint atBot atTop

Next tactic:
rcases exists_pair_ne α with ⟨x, y, hne⟩
theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop := by
  rcases exists_pair_ne α with ⟨x, y, hne⟩
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : PartialOrder α
inst✝ : Nontrivial α
x y : α
hne : x ≠ y
⊢ Disjoint atBot atTop

Next tactic:
by_cases hle : x ≤ y
theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop := by
  rcases exists_pair_ne α with ⟨x, y, hne⟩
  by_cases hle : x ≤ y
  · 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : PartialOrder α
inst✝ : Nontrivial α
x y : α
hne : x ≠ y
hle : x ≤ y
⊢ Disjoint atBot atTop

Next tactic:
refine' disjoint_of_disjoint_of_mem _ (Iic_mem_atBot x) (Ici_mem_atTop y)
theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop := by
  rcases exists_pair_ne α with ⟨x, y, hne⟩
  by_cases hle : x ≤ y
  · refine' disjoint_of_disjoint_of_mem _ (Iic_mem_atBot x) (Ici_mem_atTop y)
    

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : PartialOrder α
inst✝ : Nontrivial α
x y : α
hne : x ≠ y
hle : x ≤ y
⊢ Disjoint (Iic x) (Ici y)

Next tactic:
exact Iic_disjoint_Ici.2 (hle.lt_of_ne hne).not_le
theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop := by
  rcases exists_pair_ne α with ⟨x, y, hne⟩
  by_cases hle : x ≤ y
  · refine' disjoint_of_disjoint_of_mem _ (Iic_mem_atBot x) (Ici_mem_atTop y)
    exact Iic_disjoint_Ici.2 (hle.lt_of_ne hne).not_le
  · 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : PartialOrder α
inst✝ : Nontrivial α
x y : α
hne : x ≠ y
hle : ¬x ≤ y
⊢ Disjoint atBot atTop

Next tactic:
refine' disjoint_of_disjoint_of_mem _ (Iic_mem_atBot y) (Ici_mem_atTop x)
theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop := by
  rcases exists_pair_ne α with ⟨x, y, hne⟩
  by_cases hle : x ≤ y
  · refine' disjoint_of_disjoint_of_mem _ (Iic_mem_atBot x) (Ici_mem_atTop y)
    exact Iic_disjoint_Ici.2 (hle.lt_of_ne hne).not_le
  · refine' disjoint_of_disjoint_of_mem _ (Iic_mem_atBot y) (Ici_mem_atTop x)
    

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : PartialOrder α
inst✝ : Nontrivial α
x y : α
hne : x ≠ y
hle : ¬x ≤ y
⊢ Disjoint (Iic y) (Ici x)

Next tactic:
exact Iic_disjoint_Ici.2 hle
theorem atTop_eq_generate_Ici [SemilatticeSup α] : atTop = generate (range (Ici (α := α))) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
⊢ atTop = generate (range Ici)

Next tactic:
rcases isEmpty_or_nonempty α with hα|hα
theorem atTop_eq_generate_Ici [SemilatticeSup α] : atTop = generate (range (Ici (α := α))) := by
  rcases isEmpty_or_nonempty α with hα|hα
  · 

Proof state:
case inl
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
hα : IsEmpty α
⊢ atTop = generate (range Ici)

Next tactic:
simp only [eq_iff_true_of_subsingleton]
theorem atTop_eq_generate_Ici [SemilatticeSup α] : atTop = generate (range (Ici (α := α))) := by
  rcases isEmpty_or_nonempty α with hα|hα
  · simp only [eq_iff_true_of_subsingleton]
  · 

Proof state:
case inr
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
hα : Nonempty α
⊢ atTop = generate (range Ici)

Next tactic:
simp [(atTop_basis (α := α)).eq_generate, range]
theorem eventually_forall_ge_atTop [Preorder α] {p : α → Prop} :
    (∀ᶠ x in atTop, ∀ y, x ≤ y → p y) ↔ ∀ᶠ x in atTop, p x := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : Preorder α
p : α → Prop
⊢ (∀ᶠ (x : α) in atTop, ∀ (y : α), x ≤ y → p y) ↔ ∀ᶠ (x : α) in atTop, p x

Next tactic:
refine ⟨fun h ↦ h.mono fun x hx ↦ hx x le_rfl, fun h ↦ ?_⟩
theorem eventually_forall_ge_atTop [Preorder α] {p : α → Prop} :
    (∀ᶠ x in atTop, ∀ y, x ≤ y → p y) ↔ ∀ᶠ x in atTop, p x := by
  refine ⟨fun h ↦ h.mono fun x hx ↦ hx x le_rfl, fun h ↦ ?_⟩
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : Preorder α
p : α → Prop
h : ∀ᶠ (x : α) in atTop, p x
⊢ ∀ᶠ (x : α) in atTop, ∀ (y : α), x ≤ y → p y

Next tactic:
rcases (hasBasis_iInf_principal_finite _).eventually_iff.1 h with ⟨S, hSf, hS⟩
theorem eventually_forall_ge_atTop [Preorder α] {p : α → Prop} :
    (∀ᶠ x in atTop, ∀ y, x ≤ y → p y) ↔ ∀ᶠ x in atTop, p x := by
  refine ⟨fun h ↦ h.mono fun x hx ↦ hx x le_rfl, fun h ↦ ?_⟩
  rcases (hasBasis_iInf_principal_finite _).eventually_iff.1 h with ⟨S, hSf, hS⟩
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : Preorder α
p : α → Prop
h : ∀ᶠ (x : α) in atTop, p x
S : Set α
hSf : Set.Finite S
hS : ∀ ⦃x : α⦄, x ∈ ⋂ i ∈ S, Ici i → p x
⊢ ∀ᶠ (x : α) in atTop, ∀ (y : α), x ≤ y → p y

Next tactic:
refine mem_iInf_of_iInter hSf (V := fun x ↦ Ici x.1) (fun _ ↦ Subset.rfl) fun x hx y hy ↦ ?_
theorem eventually_forall_ge_atTop [Preorder α] {p : α → Prop} :
    (∀ᶠ x in atTop, ∀ y, x ≤ y → p y) ↔ ∀ᶠ x in atTop, p x := by
  refine ⟨fun h ↦ h.mono fun x hx ↦ hx x le_rfl, fun h ↦ ?_⟩
  rcases (hasBasis_iInf_principal_finite _).eventually_iff.1 h with ⟨S, hSf, hS⟩
  refine mem_iInf_of_iInter hSf (V := fun x ↦ Ici x.1) (fun _ ↦ Subset.rfl) fun x hx y hy ↦ ?_
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : Preorder α
p : α → Prop
h : ∀ᶠ (x : α) in atTop, p x
S : Set α
hSf : Set.Finite S
hS : ∀ ⦃x : α⦄, x ∈ ⋂ i ∈ S, Ici i → p x
x : α
hx : x ∈ ⋂ i, (fun x => Ici ↑x) i
y : α
hy : x ≤ y
⊢ p y

Next tactic:
simp only [mem_iInter] at hS hx
theorem eventually_forall_ge_atTop [Preorder α] {p : α → Prop} :
    (∀ᶠ x in atTop, ∀ y, x ≤ y → p y) ↔ ∀ᶠ x in atTop, p x := by
  refine ⟨fun h ↦ h.mono fun x hx ↦ hx x le_rfl, fun h ↦ ?_⟩
  rcases (hasBasis_iInf_principal_finite _).eventually_iff.1 h with ⟨S, hSf, hS⟩
  refine mem_iInf_of_iInter hSf (V := fun x ↦ Ici x.1) (fun _ ↦ Subset.rfl) fun x hx y hy ↦ ?_
  simp only [mem_iInter] at hS hx
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : Preorder α
p : α → Prop
h : ∀ᶠ (x : α) in atTop, p x
S : Set α
hSf : Set.Finite S
x y : α
hy : x ≤ y
hS : ∀ ⦃x : α⦄, (∀ i ∈ S, x ∈ Ici i) → p x
hx : ∀ (i : ↑S), x ∈ Ici ↑i
⊢ p y

Next tactic:
exact hS fun z hz ↦ le_trans (hx ⟨z, hz⟩) hy
theorem Tendsto.eventually_forall_ge_atTop {α β : Type*} [Preorder β] {l : Filter α}
    {p : β → Prop} {f : α → β} (hf : Tendsto f l atTop) (h_evtl : ∀ᶠ x in atTop, p x) :
    ∀ᶠ x in l, ∀ y, f x ≤ y → p y := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α✝ : Type u_3
β✝ : Type u_4
γ : Type u_5
α : Type u_6
β : Type u_7
inst✝ : Preorder β
l : Filter α
p : β → Prop
f : α → β
hf : Tendsto f l atTop
h_evtl : ∀ᶠ (x : β) in atTop, p x
⊢ ∀ᶠ (x : α) in l, ∀ (y : β), f x ≤ y → p y

Next tactic:
rw [← Filter.eventually_forall_ge_atTop] at h_evtl
theorem Tendsto.eventually_forall_ge_atTop {α β : Type*} [Preorder β] {l : Filter α}
    {p : β → Prop} {f : α → β} (hf : Tendsto f l atTop) (h_evtl : ∀ᶠ x in atTop, p x) :
    ∀ᶠ x in l, ∀ y, f x ≤ y → p y := by
  rw [← Filter.eventually_forall_ge_atTop] at h_evtl; 

Proof state:
ι : Type u_1
ι' : Type u_2
α✝ : Type u_3
β✝ : Type u_4
γ : Type u_5
α : Type u_6
β : Type u_7
inst✝ : Preorder β
l : Filter α
p : β → Prop
f : α → β
hf : Tendsto f l atTop
h_evtl : ∀ᶠ (x : β) in atTop, ∀ (y : β), x ≤ y → p y
⊢ ∀ᶠ (x : α) in l, ∀ (y : β), f x ≤ y → p y

Next tactic:
exact (h_evtl.comap f).filter_mono hf.le_comap