l3lab/ntp-mathlib huggingface dataset:
theorem orderTopology_of_nhds_abs {α : Type*} [TopologicalSpace α] [LinearOrderedAddCommGroup α]
    (h_nhds : ∀ a : α, 𝓝 a = ⨅ r > 0, 𝓟 { b | |a - b| < r }) : OrderTopology α := by
  refine' ⟨eq_of_nhds_eq_nhds fun a => _⟩
  rw [h_nhds]
  letI := Preorder.topology α; 

Proof state:
α✝ : Type u
β : Type v
γ : Type w
inst✝⁴ : TopologicalSpace α✝
inst✝³ : LinearOrderedAddCommGroup α✝
inst✝² : OrderTopology α✝
l : Filter β
f g : β → α✝
α : Type u_1
inst✝¹ : TopologicalSpace α
inst✝ : LinearOrderedAddCommGroup α
h_nhds : ∀ (a : α), 𝓝 a = ⨅ r, ⨅ (_ : r > 0), 𝓟 {b | |a - b| < r}
a : α
this : TopologicalSpace α := Preorder.topology α
⊢ ⨅ r, ⨅ (_ : r > 0), 𝓟 {b | |a - b| < r} = 𝓝 a

Next tactic:
letI : OrderTopology α := ⟨rfl⟩
theorem orderTopology_of_nhds_abs {α : Type*} [TopologicalSpace α] [LinearOrderedAddCommGroup α]
    (h_nhds : ∀ a : α, 𝓝 a = ⨅ r > 0, 𝓟 { b | |a - b| < r }) : OrderTopology α := by
  refine' ⟨eq_of_nhds_eq_nhds fun a => _⟩
  rw [h_nhds]
  letI := Preorder.topology α; letI : OrderTopology α := ⟨rfl⟩
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
inst✝⁴ : TopologicalSpace α✝
inst✝³ : LinearOrderedAddCommGroup α✝
inst✝² : OrderTopology α✝
l : Filter β
f g : β → α✝
α : Type u_1
inst✝¹ : TopologicalSpace α
inst✝ : LinearOrderedAddCommGroup α
h_nhds : ∀ (a : α), 𝓝 a = ⨅ r, ⨅ (_ : r > 0), 𝓟 {b | |a - b| < r}
a : α
this✝ : TopologicalSpace α := Preorder.topology α
this : OrderTopology α := { topology_eq_generate_intervals := rfl }
⊢ ⨅ r, ⨅ (_ : r > 0), 𝓟 {b | |a - b| < r} = 𝓝 a

Next tactic:
exact (nhds_eq_iInf_abs_sub a).symm
theorem LinearOrderedAddCommGroup.tendsto_nhds {x : Filter β} {a : α} :
    Tendsto f x (𝓝 a) ↔ ∀ ε > (0 : α), ∀ᶠ b in x, |f b - a| < ε := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
x : Filter β
a : α
⊢ Tendsto f x (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ (b : β) in x, |f b - a| < ε

Next tactic:
simp [nhds_eq_iInf_abs_sub, abs_sub_comm a]
theorem eventually_abs_sub_lt (a : α) {ε : α} (hε : 0 < ε) : ∀ᶠ x in 𝓝 a, |x - a| < ε :=
  (nhds_eq_iInf_abs_sub a).symm ▸
    mem_iInf_of_mem ε (mem_iInf_of_mem hε <| by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
a ε : α
hε : 0 < ε
⊢ {x | (fun x => |x - a| < ε) x} ∈ 𝓟 {b | |a - b| < ε}

Next tactic:
simp only [abs_sub_comm, mem_principal_self]
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to `C`
and `g` tends to `atTop` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.add_atTop {C : α} (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l (𝓝 C)
hg : Tendsto g l atTop
⊢ Tendsto (fun x => f x + g x) l atTop

Next tactic:
nontriviality α
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to `C`
and `g` tends to `atTop` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.add_atTop {C : α} (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop := by
  nontriviality α
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l (𝓝 C)
hg : Tendsto g l atTop
✝ : Nontrivial α
⊢ Tendsto (fun x => f x + g x) l atTop

Next tactic:
obtain ⟨C', hC'⟩ : ∃ C', C' < C := exists_lt C
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to `C`
and `g` tends to `atTop` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.add_atTop {C : α} (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop := by
  nontriviality α
  obtain ⟨C', hC'⟩ : ∃ C', C' < C := exists_lt C
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l (𝓝 C)
hg : Tendsto g l atTop
✝ : Nontrivial α
C' : α
hC' : C' < C
⊢ Tendsto (fun x => f x + g x) l atTop

Next tactic:
refine' tendsto_atTop_add_left_of_le' _ C' _ hg
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to `C`
and `g` tends to `atTop` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.add_atTop {C : α} (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop := by
  nontriviality α
  obtain ⟨C', hC'⟩ : ∃ C', C' < C := exists_lt C
  refine' tendsto_atTop_add_left_of_le' _ C' _ hg
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l (𝓝 C)
hg : Tendsto g l atTop
✝ : Nontrivial α
C' : α
hC' : C' < C
⊢ ∀ᶠ (x : β) in l, C' ≤ f x

Next tactic:
exact (hf.eventually (lt_mem_nhds hC')).mono fun x => le_of_lt
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atTop` and `g` tends to `C` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.atTop_add {C : α} (hf : Tendsto f l atTop) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atTop := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l atTop
hg : Tendsto g l (𝓝 C)
⊢ Tendsto (fun x => f x + g x) l atTop

Next tactic:
conv in _ + _ => rw [add_comm]
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atTop` and `g` tends to `C` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.atTop_add {C : α} (hf : Tendsto f l atTop) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atTop := by
  conv in _ + _ => 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l atTop
hg : Tendsto g l (𝓝 C)
x : β
| f x + g x

Next tactic:
rw [add_comm]
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atTop` and `g` tends to `C` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.atTop_add {C : α} (hf : Tendsto f l atTop) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atTop := by
  conv in _ + _ => rw [add_comm]
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l atTop
hg : Tendsto g l (𝓝 C)
⊢ Tendsto (fun x => g x + f x) l atTop

Next tactic:
exact hg.add_atTop hf
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atBot` and `g` tends to `C` then `f + g` tends to `atBot`. -/
theorem Filter.Tendsto.atBot_add {C : α} (hf : Tendsto f l atBot) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atBot := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l atBot
hg : Tendsto g l (𝓝 C)
⊢ Tendsto (fun x => f x + g x) l atBot

Next tactic:
conv in _ + _ => rw [add_comm]
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atBot` and `g` tends to `C` then `f + g` tends to `atBot`. -/
theorem Filter.Tendsto.atBot_add {C : α} (hf : Tendsto f l atBot) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atBot := by
  conv in _ + _ => 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l atBot
hg : Tendsto g l (𝓝 C)
x : β
| f x + g x

Next tactic:
rw [add_comm]
/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atBot` and `g` tends to `C` then `f + g` tends to `atBot`. -/
theorem Filter.Tendsto.atBot_add {C : α} (hf : Tendsto f l atBot) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atBot := by
  conv in _ + _ => rw [add_comm]
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrderedAddCommGroup α
inst✝ : OrderTopology α
l : Filter β
f g : β → α
C : α
hf : Tendsto f l atBot
hg : Tendsto g l (𝓝 C)
⊢ Tendsto (fun x => g x + f x) l atBot

Next tactic:
exact hg.add_atBot hf
theorem nhds_basis_abs_sub_lt [NoMaxOrder α] (a : α) :
    (𝓝 a).HasBasis (fun ε : α => (0 : α) < ε) fun ε => { b | |b - a| < ε } := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : LinearOrderedAddCommGroup α
inst✝¹ : OrderTopology α
l : Filter β
f g : β → α
inst✝ : NoMaxOrder α
a : α
⊢ HasBasis (𝓝 a) (fun ε => 0 < ε) fun ε => {b | |b - a| < ε}

Next tactic:
simp only [nhds_eq_iInf_abs_sub, abs_sub_comm (a := a)]
theorem nhds_basis_abs_sub_lt [NoMaxOrder α] (a : α) :
    (𝓝 a).HasBasis (fun ε : α => (0 : α) < ε) fun ε => { b | |b - a| < ε } := by
  simp only [nhds_eq_iInf_abs_sub, abs_sub_comm (a := a)]
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : LinearOrderedAddCommGroup α
inst✝¹ : OrderTopology α
l : Filter β
f g : β → α
inst✝ : NoMaxOrder α
a : α
⊢ HasBasis (⨅ r, ⨅ (_ : r > 0), 𝓟 {b | |b - a| < r}) (fun ε => 0 < ε) fun ε => {b | |b - a| < ε}

Next tactic:
refine hasBasis_biInf_principal' (fun x hx y hy => ?_) (exists_gt _)
theorem nhds_basis_abs_sub_lt [NoMaxOrder α] (a : α) :
    (𝓝 a).HasBasis (fun ε : α => (0 : α) < ε) fun ε => { b | |b - a| < ε } := by
  simp only [nhds_eq_iInf_abs_sub, abs_sub_comm (a := a)]
  refine hasBasis_biInf_principal' (fun x hx y hy => ?_) (exists_gt _)
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : LinearOrderedAddCommGroup α
inst✝¹ : OrderTopology α
l : Filter β
f g : β → α
inst✝ : NoMaxOrder α
a x : α
hx : x > 0
y : α
hy : y > 0
⊢ ∃ k > 0, {b | |b - a| < k} ⊆ {b | |b - a| < x} ∧ {b | |b - a| < k} ⊆ {b | |b - a| < y}

Next tactic:
exact ⟨min x y, lt_min hx hy, fun _ hz => hz.trans_le (min_le_left _ _),
    fun _ hz => hz.trans_le (min_le_right _ _)⟩
theorem nhds_basis_Ioo_pos [NoMaxOrder α] (a : α) :
    (𝓝 a).HasBasis (fun ε : α => (0 : α) < ε) fun ε => Ioo (a - ε) (a + ε) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : LinearOrderedAddCommGroup α
inst✝¹ : OrderTopology α
l : Filter β
f g : β → α
inst✝ : NoMaxOrder α
a : α
⊢ HasBasis (𝓝 a) (fun ε => 0 < ε) fun ε => Ioo (a - ε) (a + ε)

Next tactic:
convert nhds_basis_abs_sub_lt a
theorem nhds_basis_Ioo_pos [NoMaxOrder α] (a : α) :
    (𝓝 a).HasBasis (fun ε : α => (0 : α) < ε) fun ε => Ioo (a - ε) (a + ε) := by
  convert nhds_basis_abs_sub_lt a
  

Proof state:
case h.e'_5.h
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : LinearOrderedAddCommGroup α
inst✝¹ : OrderTopology α
l : Filter β
f g : β → α
inst✝ : NoMaxOrder α
a x✝ : α
⊢ Ioo (a - x✝) (a + x✝) = {b | |b - a| < x✝}

Next tactic:
simp only [Ioo, abs_lt, ← sub_lt_iff_lt_add, neg_lt_sub_iff_lt_add, sub_lt_comm]
theorem nhds_basis_zero_abs_sub_lt [NoMaxOrder α] :
    (𝓝 (0 : α)).HasBasis (fun ε : α => (0 : α) < ε) fun ε => { b | |b| < ε } := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : LinearOrderedAddCommGroup α
inst✝¹ : OrderTopology α
l : Filter β
f g : β → α
inst✝ : NoMaxOrder α
⊢ HasBasis (𝓝 0) (fun ε => 0 < ε) fun ε => {b | |b| < ε}

Next tactic:
simpa using nhds_basis_abs_sub_lt (0 : α)
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
a : α
s : Set α
ha : IsLUB s a
hs : Set.Nonempty s
⊢ ∃ᶠ (x : α) in 𝓝[≤] a, x ∈ s

Next tactic:
rcases hs with ⟨a', ha'⟩
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  rcases hs with ⟨a', ha'⟩
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
a : α
s : Set α
ha : IsLUB s a
a' : α
ha' : a' ∈ s
⊢ ∃ᶠ (x : α) in 𝓝[≤] a, x ∈ s

Next tactic:
intro h
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  rcases hs with ⟨a', ha'⟩
  intro h
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
a : α
s : Set α
ha : IsLUB s a
a' : α
ha' : a' ∈ s
h : ∀ᶠ (x : α) in 𝓝[≤] a, ¬(fun x => x ∈ s) x
⊢ False

Next tactic:
rcases (ha.1 ha').eq_or_lt with (rfl | ha'a)
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  rcases hs with ⟨a', ha'⟩
  intro h
  rcases (ha.1 ha').eq_or_lt with (rfl | ha'a)
  · 

Proof state:
case intro.inl
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
s : Set α
a' : α
ha' : a' ∈ s
ha : IsLUB s a'
h : ∀ᶠ (x : α) in 𝓝[≤] a', ¬(fun x => x ∈ s) x
⊢ False

Next tactic:
exact h.self_of_nhdsWithin le_rfl ha'
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  rcases hs with ⟨a', ha'⟩
  intro h
  rcases (ha.1 ha').eq_or_lt with (rfl | ha'a)
  · exact h.self_of_nhdsWithin le_rfl ha'
  · 

Proof state:
case intro.inr
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
a : α
s : Set α
ha : IsLUB s a
a' : α
ha' : a' ∈ s
h : ∀ᶠ (x : α) in 𝓝[≤] a, ¬(fun x => x ∈ s) x
ha'a : a' < a
⊢ False

Next tactic:
rcases (mem_nhdsWithin_Iic_iff_exists_Ioc_subset' ha'a).1 h with ⟨b, hba, hb⟩
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  rcases hs with ⟨a', ha'⟩
  intro h
  rcases (ha.1 ha').eq_or_lt with (rfl | ha'a)
  · exact h.self_of_nhdsWithin le_rfl ha'
  · rcases (mem_nhdsWithin_Iic_iff_exists_Ioc_subset' ha'a).1 h with ⟨b, hba, hb⟩
    

Proof state:
case intro.inr.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
a : α
s : Set α
ha : IsLUB s a
a' : α
ha' : a' ∈ s
h : ∀ᶠ (x : α) in 𝓝[≤] a, ¬(fun x => x ∈ s) x
ha'a : a' < a
b : α
hba : b ∈ Iio a
hb : Ioc b a ⊆ {x | (fun x => ¬(fun x => x ∈ s) x) x}
⊢ False

Next tactic:
rcases ha.exists_between hba with ⟨b', hb's, hb'⟩
theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s := by
  rcases hs with ⟨a', ha'⟩
  intro h
  rcases (ha.1 ha').eq_or_lt with (rfl | ha'a)
  · exact h.self_of_nhdsWithin le_rfl ha'
  · rcases (mem_nhdsWithin_Iic_iff_exists_Ioc_subset' ha'a).1 h with ⟨b, hba, hb⟩
    rcases ha.exists_between hba with ⟨b', hb's, hb'⟩
    

Proof state:
case intro.inr.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
a : α
s : Set α
ha : IsLUB s a
a' : α
ha' : a' ∈ s
h : ∀ᶠ (x : α) in 𝓝[≤] a, ¬(fun x => x ∈ s) x
ha'a : a' < a
b : α
hba : b ∈ Iio a
hb : Ioc b a ⊆ {x | (fun x => ¬(fun x => x ∈ s) x) x}
b' : α
hb's : b' ∈ s
hb' : b < b' ∧ b' ≤ a
⊢ False

Next tactic:
exact hb hb' hb's
theorem isLUB_of_mem_closure {s : Set α} {a : α} (hsa : a ∈ upperBounds s) (hsf : a ∈ closure s) :
    IsLUB s a := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
s : Set α
a : α
hsa : a ∈ upperBounds s
hsf : a ∈ closure s
⊢ IsLUB s a

Next tactic:
rw [mem_closure_iff_clusterPt, ClusterPt, inf_comm] at hsf
theorem isLUB_of_mem_closure {s : Set α} {a : α} (hsa : a ∈ upperBounds s) (hsf : a ∈ closure s) :
    IsLUB s a := by
  rw [mem_closure_iff_clusterPt, ClusterPt, inf_comm] at hsf
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁵ : TopologicalSpace α
inst✝⁴ : TopologicalSpace β
inst✝³ : LinearOrder α
inst✝² : LinearOrder β
inst✝¹ : OrderTopology α
inst✝ : OrderTopology β
s : Set α
a : α
hsa : a ∈ upperBounds s
hsf : NeBot (𝓟 s ⊓ 𝓝 a)
⊢ IsLUB s a

Next tactic:
exact isLUB_of_mem_nhds hsa (mem_principal_self s)
theorem IsLUB.mem_upperBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
    {f : α → γ} {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsLUB s a)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ upperBounds (f '' s) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁸ : TopologicalSpace α
inst✝⁷ : TopologicalSpace β
inst✝⁶ : LinearOrder α
inst✝⁵ : LinearOrder β
inst✝⁴ : OrderTopology α
inst✝³ : OrderTopology β
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderClosedTopology γ
f : α → γ
s : Set α
a : α
b : γ
hf : MonotoneOn f s
ha : IsLUB s a
hb : Tendsto f (𝓝[s] a) (𝓝 b)
⊢ b ∈ upperBounds (f '' s)

Next tactic:
rintro _ ⟨x, hx, rfl⟩
theorem IsLUB.mem_upperBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
    {f : α → γ} {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsLUB s a)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ upperBounds (f '' s) := by
  rintro _ ⟨x, hx, rfl⟩
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁸ : TopologicalSpace α
inst✝⁷ : TopologicalSpace β
inst✝⁶ : LinearOrder α
inst✝⁵ : LinearOrder β
inst✝⁴ : OrderTopology α
inst✝³ : OrderTopology β
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderClosedTopology γ
f : α → γ
s : Set α
a : α
b : γ
hf : MonotoneOn f s
ha : IsLUB s a
hb : Tendsto f (𝓝[s] a) (𝓝 b)
x : α
hx : x ∈ s
⊢ f x ≤ b

Next tactic:
replace ha := ha.inter_Ici_of_mem hx
theorem IsLUB.mem_upperBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
    {f : α → γ} {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsLUB s a)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ upperBounds (f '' s) := by
  rintro _ ⟨x, hx, rfl⟩
  replace ha := ha.inter_Ici_of_mem hx
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁸ : TopologicalSpace α
inst✝⁷ : TopologicalSpace β
inst✝⁶ : LinearOrder α
inst✝⁵ : LinearOrder β
inst✝⁴ : OrderTopology α
inst✝³ : OrderTopology β
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderClosedTopology γ
f : α → γ
s : Set α
a : α
b : γ
hf : MonotoneOn f s
hb : Tendsto f (𝓝[s] a) (𝓝 b)
x : α
hx : x ∈ s
ha : IsLUB (s ∩ Ici x) a
⊢ f x ≤ b

Next tactic:
haveI := ha.nhdsWithin_neBot ⟨x, hx, le_rfl⟩
theorem IsLUB.mem_upperBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
    {f : α → γ} {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsLUB s a)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ upperBounds (f '' s) := by
  rintro _ ⟨x, hx, rfl⟩
  replace ha := ha.inter_Ici_of_mem hx
  haveI := ha.nhdsWithin_neBot ⟨x, hx, le_rfl⟩
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁸ : TopologicalSpace α
inst✝⁷ : TopologicalSpace β
inst✝⁶ : LinearOrder α
inst✝⁵ : LinearOrder β
inst✝⁴ : OrderTopology α
inst✝³ : OrderTopology β
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderClosedTopology γ
f : α → γ
s : Set α
a : α
b : γ
hf : MonotoneOn f s
hb : Tendsto f (𝓝[s] a) (𝓝 b)
x : α
hx : x ∈ s
ha : IsLUB (s ∩ Ici x) a
this : NeBot (𝓝[s ∩ Ici x] a)
⊢ f x ≤ b

Next tactic:
refine' ge_of_tendsto (hb.mono_left (nhdsWithin_mono _ (inter_subset_left s (Ici x)))) _
theorem IsLUB.mem_upperBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
    {f : α → γ} {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsLUB s a)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ upperBounds (f '' s) := by
  rintro _ ⟨x, hx, rfl⟩
  replace ha := ha.inter_Ici_of_mem hx
  haveI := ha.nhdsWithin_neBot ⟨x, hx, le_rfl⟩
  refine' ge_of_tendsto (hb.mono_left (nhdsWithin_mono _ (inter_subset_left s (Ici x)))) _
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁸ : TopologicalSpace α
inst✝⁷ : TopologicalSpace β
inst✝⁶ : LinearOrder α
inst✝⁵ : LinearOrder β
inst✝⁴ : OrderTopology α
inst✝³ : OrderTopology β
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderClosedTopology γ
f : α → γ
s : Set α
a : α
b : γ
hf : MonotoneOn f s
hb : Tendsto f (𝓝[s] a) (𝓝 b)
x : α
hx : x ∈ s
ha : IsLUB (s ∩ Ici x) a
this : NeBot (𝓝[s ∩ Ici x] a)
⊢ ∀ᶠ (c : α) in 𝓝[s ∩ Ici x] a, f x ≤ f c

Next tactic:
exact mem_of_superset self_mem_nhdsWithin fun y hy => hf hx hy.1 hy.2
theorem IsLUB.exists_seq_strictMono_tendsto_of_not_mem {t : Set α} {x : α}
    [IsCountablyGenerated (𝓝 x)] (htx : IsLUB t x) (not_mem : x ∉ t) (ht : t.Nonempty) :
    ∃ u : ℕ → α, StrictMono u ∧ (∀ n, u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁶ : TopologicalSpace α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : LinearOrder α
inst✝³ : LinearOrder β
inst✝² : OrderTopology α
inst✝¹ : OrderTopology β
t : Set α
x : α
inst✝ : IsCountablyGenerated (𝓝 x)
htx : IsLUB t x
not_mem : x ∉ t
ht : Set.Nonempty t
⊢ ∃ u, StrictMono u ∧ (∀ (n : ℕ), u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t

Next tactic:
obtain ⟨v, hvx, hvt⟩ := exists_seq_forall_of_frequently (htx.frequently_mem ht)
theorem IsLUB.exists_seq_strictMono_tendsto_of_not_mem {t : Set α} {x : α}
    [IsCountablyGenerated (𝓝 x)] (htx : IsLUB t x) (not_mem : x ∉ t) (ht : t.Nonempty) :
    ∃ u : ℕ → α, StrictMono u ∧ (∀ n, u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t := by
  obtain ⟨v, hvx, hvt⟩ := exists_seq_forall_of_frequently (htx.frequently_mem ht)
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁶ : TopologicalSpace α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : LinearOrder α
inst✝³ : LinearOrder β
inst✝² : OrderTopology α
inst✝¹ : OrderTopology β
t : Set α
x : α
inst✝ : IsCountablyGenerated (𝓝 x)
htx : IsLUB t x
not_mem : x ∉ t
ht : Set.Nonempty t
v : ℕ → α
hvx : Tendsto v atTop (𝓝[≤] x)
hvt : ∀ (n : ℕ), v n ∈ t
⊢ ∃ u, StrictMono u ∧ (∀ (n : ℕ), u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t

Next tactic:
replace hvx := hvx.mono_right nhdsWithin_le_nhds
theorem IsLUB.exists_seq_strictMono_tendsto_of_not_mem {t : Set α} {x : α}
    [IsCountablyGenerated (𝓝 x)] (htx : IsLUB t x) (not_mem : x ∉ t) (ht : t.Nonempty) :
    ∃ u : ℕ → α, StrictMono u ∧ (∀ n, u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t := by
  obtain ⟨v, hvx, hvt⟩ := exists_seq_forall_of_frequently (htx.frequently_mem ht)
  replace hvx := hvx.mono_right nhdsWithin_le_nhds
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
inst✝⁶ : TopologicalSpace α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : LinearOrder α
inst✝³ : LinearOrder β
inst✝² : OrderTopology α
inst✝¹ : OrderTopology β
t : Set α
x : α
inst✝ : IsCountablyGenerated (𝓝 x)
htx : IsLUB t x
not_mem : x ∉ t
ht : Set.Nonempty t
v : ℕ → α
hvt : ∀ (n : ℕ), v n ∈ t
hvx : Tendsto v atTop (𝓝 x)
⊢ ∃ u, StrictMono u ∧ (∀ (n : ℕ), u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t

Next tactic:
have hvx' : ∀ {n}, v n < x := (htx.1 (hvt _)).lt_of_ne (ne_of_mem_of_not_mem (hvt _) not_mem)