Theorem: continuousWithinAt_iff_lower_upperSemicontinuousWithinAt
File: Mathlib/Topology/Semicontinuous.lean

tactic: refine' ⟨fun h => ⟨h.lowerSemicontinuousWithinAt, h.upperSemicontinuousWithinAt⟩, _⟩
state_before: α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
⊢ ContinuousWithinAt f s x ↔ LowerSemicontinuousWithinAt f s x ∧ UpperSemicontinuousWithinAt f s x

tactic: rintro ⟨h₁, h₂⟩
state_before: α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
⊢ LowerSemicontinuousWithinAt f s x ∧ UpperSemicontinuousWithinAt f s x → ContinuousWithinAt f s x

tactic: intro v hv
state_before: case intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
⊢ ContinuousWithinAt f s x

tactic: simp only [Filter.mem_map]
state_before: case intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
⊢ v ∈ map f (𝓝[s] x)

tactic: by_cases Hl : ∃ l, l < f x
state_before: case intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: rcases exists_Ioc_subset_of_mem_nhds hv Hl with ⟨l, lfx, hl⟩
state_before: case pos
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: by_cases Hu : ∃ u, f x < u
state_before: case pos.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: rcases exists_Ico_subset_of_mem_nhds hv Hu with ⟨u, fxu, hu⟩
state_before: case pos
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ∃ u, f x < u
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: filter_upwards [h₁ l lfx, h₂ u fxu]with a lfa fau
state_before: case pos.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: cases' le_or_gt (f a) (f x) with h h
state_before: case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
a : α
lfa : l < f a
fau : f a < u
⊢ a ∈ f ⁻¹' v

tactic: exact hl ⟨lfa, h⟩
state_before: case h.inl
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
a : α
lfa : l < f a
fau : f a < u
h : f a ≤ f x
⊢ a ∈ f ⁻¹' v

tactic: exact hu ⟨le_of_lt h, fau⟩
state_before: case h.inr
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
a : α
lfa : l < f a
fau : f a < u
h : f a > f x
⊢ a ∈ f ⁻¹' v

tactic: simp only [not_exists, not_lt] at Hu
state_before: case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ¬∃ u, f x < u
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: filter_upwards [h₁ l lfx]with a lfa using hl ⟨lfa, Hu (f a)⟩
state_before: case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∃ l, l < f x
l : γ
lfx : l < f x
hl : Ioc l (f x) ⊆ v
Hu : ∀ (x_1 : γ), x_1 ≤ f x
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: simp only [not_exists, not_lt] at Hl
state_before: case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ¬∃ l, l < f x
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: by_cases Hu : ∃ u, f x < u
state_before: case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: rcases exists_Ico_subset_of_mem_nhds hv Hu with ⟨u, fxu, hu⟩
state_before: case pos
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∃ u, f x < u
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: filter_upwards [h₂ u fxu]with a lfa
state_before: case pos.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: apply hu
state_before: case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
a : α
lfa : f a < u
⊢ a ∈ f ⁻¹' v

tactic: exact ⟨Hl (f a), lfa⟩
state_before: case h.a
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∃ u, f x < u
u : γ
fxu : f x < u
hu : Ico (f x) u ⊆ v
a : α
lfa : f a < u
⊢ f a ∈ Ico (f x) u

tactic: simp only [not_exists, not_lt] at Hu
state_before: case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ¬∃ u, f x < u
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: apply Filter.eventually_of_forall
state_before: case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∀ (x_1 : γ), x_1 ≤ f x
⊢ f ⁻¹' v ∈ 𝓝[s] x

tactic: intro a
state_before: case neg.hp
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∀ (x_1 : γ), x_1 ≤ f x
⊢ ∀ (x : α), f x ∈ v

tactic: have : f a = f x := le_antisymm (Hu _) (Hl _)
state_before: case neg.hp
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∀ (x_1 : γ), x_1 ≤ f x
a : α
⊢ f a ∈ v

tactic: rw [this]
state_before: case neg.hp
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∀ (x_1 : γ), x_1 ≤ f x
a : α
this : f a = f x
⊢ f a ∈ v

tactic: exact mem_of_mem_nhds hv
state_before: case neg.hp
α : Type u_1
inst✝⁴ : TopologicalSpace α
β : Type ?u.220201
inst✝³ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_2
inst✝² : LinearOrder γ
inst✝¹ : TopologicalSpace γ
inst✝ : OrderTopology γ
f : α → γ
h₁ : LowerSemicontinuousWithinAt f s x
h₂ : UpperSemicontinuousWithinAt f s x
v : Set γ
hv : v ∈ 𝓝 (f x)
Hl : ∀ (x_1 : γ), f x ≤ x_1
Hu : ∀ (x_1 : γ), x_1 ≤ f x
a : α
this : f a = f x
⊢ f x ∈ v