Theorem: tendsto_of_no_upcrossings
File: Mathlib/Topology/Algebra/Order/LiminfLimsup.lean

tactic: by_cases hbot : f = ⊥
state_before: α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
⊢ ∃ c, Tendsto u f (𝓝 c)

tactic: haveI : NeBot f := ⟨hbot⟩
state_before: case neg
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
⊢ ∃ c, Tendsto u f (𝓝 c)

tactic: refine' ⟨limsup u f, _⟩
state_before: case neg
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
⊢ ∃ c, Tendsto u f (𝓝 c)

tactic: apply tendsto_of_le_liminf_of_limsup_le _ le_rfl h h'
state_before: case neg
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
⊢ Tendsto u f (𝓝 (limsup u f))

tactic: by_contra' hlt
state_before: α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
⊢ limsup u f ≤ liminf u f

tactic: obtain ⟨a, ⟨⟨la, au⟩, as⟩⟩ : ∃ a, (f.liminf u < a ∧ a < f.limsup u) ∧ a ∈ s :=
  dense_iff_inter_open.1 hs (Set.Ioo (f.liminf u) (f.limsup u)) isOpen_Ioo
    (Set.nonempty_Ioo.2 hlt)
state_before: α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
hlt : liminf u f < limsup u f
⊢ False

tactic: obtain ⟨b, ⟨⟨ab, bu⟩, bs⟩⟩ : ∃ b, (a < b ∧ b < f.limsup u) ∧ b ∈ s :=
  dense_iff_inter_open.1 hs (Set.Ioo a (f.limsup u)) isOpen_Ioo (Set.nonempty_Ioo.2 au)
state_before: case intro.intro.intro
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
hlt : liminf u f < limsup u f
a : α
as : a ∈ s
la : liminf u f < a
au : a < limsup u f
⊢ False

tactic: have A : ∃ᶠ n in f, u n < a := frequently_lt_of_liminf_lt (IsBounded.isCobounded_ge h) la
state_before: case intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
hlt : liminf u f < limsup u f
a : α
as : a ∈ s
la : liminf u f < a
au : a < limsup u f
b : α
bs : b ∈ s
ab : a < b
bu : b < limsup u f
⊢ False

tactic: have B : ∃ᶠ n in f, b < u n := frequently_lt_of_lt_limsup (IsBounded.isCobounded_le h') bu
state_before: case intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
hlt : liminf u f < limsup u f
a : α
as : a ∈ s
la : liminf u f < a
au : a < limsup u f
b : α
bs : b ∈ s
ab : a < b
bu : b < limsup u f
A : ∃ᶠ (n : β) in f, u n < a
⊢ False

tactic: exact H a as b bs ab ⟨A, B⟩
state_before: case intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : ¬f = ⊥
this : NeBot f
hlt : liminf u f < limsup u f
a : α
as : a ∈ s
la : liminf u f < a
au : a < limsup u f
b : α
bs : b ∈ s
ab : a < b
bu : b < limsup u f
A : ∃ᶠ (n : β) in f, u n < a
B : ∃ᶠ (n : β) in f, b < u n
⊢ False

tactic: rw [hbot]
state_before: case pos
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : f = ⊥
⊢ ∃ c, Tendsto u f (𝓝 c)

tactic: exact ⟨sInf ∅, tendsto_bot⟩
state_before: case pos
α : Type u
β : Type v
inst✝³ : ConditionallyCompleteLinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderTopology α
inst✝ : DenselyOrdered α
f : Filter β
u : β → α
s : Set α
hs : Dense s
H : ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a < b → ¬((∃ᶠ (n : β) in f, u n < a) ∧ ∃ᶠ (n : β) in f, b < u n)
h : autoParam (IsBoundedUnder (fun x x_1 => x ≤ x_1) f u) _auto✝
h' : autoParam (IsBoundedUnder (fun x x_1 => x ≥ x_1) f u) _auto✝
hbot : f = ⊥
⊢ ∃ c, Tendsto u ⊥ (𝓝 c)