Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 49c6841

Browse files
committed
chore(topology): generalize real.image_Icc etc (#9784)
* add lemmas about `Ici`/`Iic`/`Icc` in `α × β`; * introduce a typeclass for `is_compact_Icc` so that the same lemma works for `ℝ` and `ℝⁿ`; * generalize `real.image_Icc` etc to a conditionally complete linear order (e.g., now it works for `nnreal`, `ennreal`, `ereal`), move these lemmas to the `continuous_on` namespace.
1 parent 55a1160 commit 49c6841

File tree

10 files changed

+156
-78
lines changed

10 files changed

+156
-78
lines changed

docs/undergrad.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Single Variable Real Analysis:
307307
continuity: 'continuous'
308308
limits: 'filter.tendsto'
309309
intermediate value theorem: 'intermediate_value_Icc'
310-
image of a segment: 'real.image_Icc'
310+
image of a segment: 'continuous_on.image_Icc'
311311
continuity of monotone functions: 'order_iso.continuous'
312312
continuity of inverse functions: 'order_iso.to_homeomorph'
313313
Differentiability:

src/analysis/box_integral/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ lemma integrable_of_continuous_on [complete_space E] {I : box ι} {f : ℝⁿ
643643
(hc : continuous_on f I.Icc) (μ : measure ℝⁿ) [is_locally_finite_measure μ] :
644644
integrable.{u v v} I l f μ.to_box_additive.to_smul :=
645645
begin
646-
have huc := (is_compact_pi_Icc I.lower I.upper).uniform_continuous_on_of_continuous hc,
646+
have huc := I.is_compact_Icc.uniform_continuous_on_of_continuous hc,
647647
rw metric.uniform_continuous_on_iff_le at huc,
648648
refine integrable_iff_cauchy_basis.2 (λ ε ε0, _),
649649
rcases exists_pos_mul_lt ε0 (μ.to_box_additive I) with ⟨ε', ε0', hε⟩,

src/analysis/box_integral/box/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ lemma Icc_def : I.Icc = Icc I.lower I.upper := rfl
149149
@[simp] lemma upper_mem_Icc (I : box ι) : I.upper ∈ I.Icc := right_mem_Icc.2 I.lower_le_upper
150150
@[simp] lemma lower_mem_Icc (I : box ι) : I.lower ∈ I.Icc := left_mem_Icc.2 I.lower_le_upper
151151

152-
protected lemma is_compact_Icc : is_compact I.Icc := is_compact_pi_Icc I.lower I.upper
152+
protected lemma is_compact_Icc (I : box ι) : is_compact I.Icc := is_compact_Icc
153153

154154
lemma Icc_eq_pi : I.Icc = pi univ (λ i, Icc (I.lower i) (I.upper i)) := (pi_univ_Icc _ _).symm
155155

src/analysis/box_integral/divergence_theorem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ begin
9797
{ intros y hy,
9898
refine (hε y hy).trans (mul_le_mul_of_nonneg_left _ h0.le),
9999
rw ← dist_eq_norm,
100-
exact dist_le_diam_of_mem (is_compact_pi_Icc I.lower I.upper).bounded hy hxI },
100+
exact dist_le_diam_of_mem I.is_compact_Icc.bounded hy hxI },
101101
rw [two_mul, add_mul],
102102
exact norm_sub_le_of_le (hε _ (this _ Hl)) (hε _ (this _ Hu)) } },
103103
calc ∥(∏ j, (I.upper j - I.lower j)) • f' (pi.single i 1) -

src/analysis/box_integral/partition/measure.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ end
4747
lemma measurable_set_Icc [fintype ι] (I : box ι) : measurable_set I.Icc := measurable_set_Icc
4848

4949
lemma measure_Icc_lt_top (μ : measure (ι → ℝ)) [is_locally_finite_measure μ] : μ I.Icc < ∞ :=
50-
show μ (Icc I.lower I.upper) < ∞, from (is_compact_pi_Icc I.lower I.upper).measure_lt_top
50+
show μ (Icc I.lower I.upper) < ∞, from I.is_compact_Icc.measure_lt_top
5151

5252
lemma measure_coe_lt_top (μ : measure (ι → ℝ)) [is_locally_finite_measure μ] : μ I < ∞ :=
5353
(measure_mono $ coe_subset_Icc).trans_lt (I.measure_Icc_lt_top μ)

src/data/set/intervals/basic.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,32 @@ end
12121212

12131213
end linear_order
12141214

1215+
/-!
1216+
### Closed intervals in `α × β`
1217+
-/
1218+
1219+
section prod
1220+
1221+
variables {α β : Type*} [preorder α] [preorder β]
1222+
1223+
@[simp] lemma Iic_prod_Iic (a : α) (b : β) : (Iic a).prod (Iic b) = Iic (a, b) := rfl
1224+
1225+
@[simp] lemma Ici_prod_Ici (a : α) (b : β) : (Ici a).prod (Ici b) = Ici (a, b) := rfl
1226+
1227+
lemma Ici_prod_eq (a : α × β) : Ici a = (Ici a.1).prod (Ici a.2) := rfl
1228+
1229+
lemma Iic_prod_eq (a : α × β) : Iic a = (Iic a.1).prod (Iic a.2) := rfl
1230+
1231+
@[simp] lemma Icc_prod_Icc (a₁ a₂ : α) (b₁ b₂ : β) :
1232+
(Icc a₁ a₂).prod (Icc b₁ b₂) = Icc (a₁, b₁) (a₂, b₂) :=
1233+
by { ext ⟨x, y⟩, simp [and.assoc, and_comm, and.left_comm] }
1234+
1235+
lemma Icc_prod_eq (a b : α × β) :
1236+
Icc a b = (Icc a.1 b.1).prod (Icc a.2 b.2) :=
1237+
by simp
1238+
1239+
end prod
1240+
12151241
/-! ### Lemmas about membership of arithmetic operations -/
12161242

12171243
section ordered_comm_group

src/measure_theory/integral/interval_integral.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,27 +2276,27 @@ theorem integral_comp_smul_deriv'' {f f' : ℝ → ℝ} {g : ℝ → E}
22762276
∫ x in a..b, f' x • (g ∘ f) x= ∫ u in f a..f b, g u :=
22772277
begin
22782278
have h_cont : continuous_on (λ u, ∫ t in f a..f u, g t) [a, b],
2279-
{ rw [real.image_interval hf] at hg,
2279+
{ rw [hf.image_interval] at hg,
22802280
refine (continuous_on_primitive_interval' hg.interval_integrable _).comp hf _,
2281-
{ rw [← real.image_interval hf], exact mem_image_of_mem f left_mem_interval },
2282-
{ rw [← image_subset_iff], exact (real.image_interval hf).subset } },
2281+
{ rw [← hf.image_interval], exact mem_image_of_mem f left_mem_interval },
2282+
{ rw [← image_subset_iff], exact hf.image_interval.subset } },
22832283
have h_der : ∀ x ∈ Ioo (min a b) (max a b), has_deriv_within_at
22842284
(λ u, ∫ t in f a..f u, g t) (f' x • ((g ∘ f) x)) (Ioi x) x,
22852285
{ intros x hx,
22862286
let I := [Inf (f '' [a, b]), Sup (f '' [a, b])],
2287-
have hI : f '' [a, b] = I := real.image_interval hf,
2287+
have hI : f '' [a, b] = I := hf.image_interval,
22882288
have h2x : f x ∈ I, { rw [← hI], exact mem_image_of_mem f (Ioo_subset_Icc_self hx) },
22892289
have h2g : interval_integrable g volume (f a) (f x),
22902290
{ refine (hg.mono $ _).interval_integrable,
2291-
exact real.interval_subset_image_interval hf left_mem_interval (Ioo_subset_Icc_self hx) },
2291+
exact hf.surj_on_interval left_mem_interval (Ioo_subset_Icc_self hx) },
22922292
rw [hI] at hg,
22932293
have h3g : measurable_at_filter g (𝓝[I] f x) volume :=
22942294
hg.measurable_at_filter_nhds_within measurable_set_Icc (f x),
22952295
haveI : fact (f x ∈ I) := ⟨h2x⟩,
22962296
have : has_deriv_within_at (λ u, ∫ x in f a..u, g x) (g (f x)) I (f x) :=
22972297
integral_has_deriv_within_at_right h2g h3g (hg (f x) h2x),
22982298
refine (this.scomp x ((hff' x hx).Ioo_of_Ioi hx.2) _).Ioi_of_Ioo hx.2,
2299-
dsimp only [I], rw [← image_subset_iff, ← real.image_interval hf],
2299+
dsimp only [I], rw [← image_subset_iff, ← hf.image_interval],
23002300
refine image_subset f (Ioo_subset_Icc_self.trans $ Icc_subset_Icc_left hx.1.le) },
23012301
have h_int : interval_integrable (λ (x : ℝ), f' x • (g ∘ f) x) volume a b :=
23022302
(hf'.smul (hg.comp hf $ subset_preimage_image f _)).interval_integrable,
@@ -2339,7 +2339,7 @@ theorem integral_deriv_comp_smul_deriv' {f f' : ℝ → ℝ} {g g' : ℝ → E}
23392339
begin
23402340
rw [integral_comp_smul_deriv'' hf hff' hf' hg',
23412341
integral_eq_sub_of_has_deriv_right hg hgg' (hg'.mono _).interval_integrable],
2342-
exact real.interval_subset_image_interval hf left_mem_interval right_mem_interval,
2342+
exact intermediate_value_interval hf
23432343
end
23442344

23452345
theorem integral_deriv_comp_smul_deriv {f f' : ℝ → ℝ} {g g' : ℝ → E}

src/topology/algebra/ordered/compact.lean

Lines changed: 104 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,42 @@ order topology (or a product of such types) is compact. We also prove the extrem
1313
(`is_compact.exists_forall_le`, `is_compact.exists_forall_ge`): a continuous function on a compact
1414
set takes its minimum and maximum values.
1515
16+
We also prove that the image of a closed interval under a continuous map is a closed interval, see
17+
`continuous_on.image_Icc`.
18+
1619
## Tags
1720
1821
compact, extreme value theorem
1922
-/
2023

2124
open classical filter order_dual topological_space function set
2225

23-
variables {α β : Type*}
24-
[conditionally_complete_linear_order α] [topological_space α] [order_topology α]
25-
[conditionally_complete_linear_order β] [topological_space β] [order_topology β]
26-
2726
/-!
2827
### Compactness of a closed interval
28+
29+
In this section we define a typeclass `compact_Icc_space α` saying that all closed intervals in `α`
30+
are compact. Then we provide an instance for a `conditionally_complete_linear_order` and prove that
31+
the product (both `α × β` and an indexed product) of spaces with this property inherits the
32+
property.
33+
34+
We also prove some simple lemmas about spaces with this property.
2935
-/
3036

37+
/-- This typeclass says that all closed intervals in `α` are compact. This is true for all
38+
conditionally complete linear orders with order topology and products (finite or infinite)
39+
of such spaces. -/
40+
class compact_Icc_space (α : Type*) [topological_space α] [preorder α] : Prop :=
41+
(is_compact_Icc : ∀ {a b : α}, is_compact (Icc a b))
42+
43+
export compact_Icc_space (is_compact_Icc)
44+
3145
/-- A closed interval in a conditionally complete linear order is compact. -/
32-
lemma is_compact_Icc {a b : α} : is_compact (Icc a b) :=
46+
@[priority 100]
47+
instance conditionally_complete_linear_order.to_compact_Icc_space
48+
(α : Type*) [conditionally_complete_linear_order α] [topological_space α] [order_topology α] :
49+
compact_Icc_space α :=
3350
begin
51+
refine ⟨λ a b, _⟩,
3452
cases le_or_lt a b with hab hab, swap, { simp [hab] },
3553
refine is_compact_iff_ultrafilter_le_nhds.2 (λ f hf, _),
3654
contrapose! hf,
@@ -72,32 +90,51 @@ begin
7290
{ exact ((hsc.1 ⟨hy, hay⟩).not_lt hxy.1).elim },
7391
end
7492

75-
/-- An unordered closed interval in a conditionally complete linear order is compact. -/
76-
lemma is_compact_interval {a b : α} : is_compact (interval a b) := is_compact_Icc
93+
instance {ι : Type*} {α : ι → Type*} [Π i, preorder (α i)] [Π i, topological_space (α i)]
94+
[Π i, compact_Icc_space (α i)] : compact_Icc_space (Π i, α i) :=
95+
⟨λ a b, pi_univ_Icc a b ▸ is_compact_univ_pi $ λ i, is_compact_Icc⟩
7796

78-
lemma is_compact_pi_Icc {ι : Type*} {α : ι → Type*} [Π i, conditionally_complete_linear_order (α i)]
79-
[Π i, topological_space (α i)] [Π i, order_topology (α i)] (a b : Π i, α i) :
80-
is_compact (Icc a b) :=
81-
pi_univ_Icc a b ▸ is_compact_univ_pi $ λ i, is_compact_Icc
97+
instance pi.compact_Icc_space' {α β : Type*} [preorder β] [topological_space β]
98+
[compact_Icc_space β] : compact_Icc_space (α → β) :=
99+
pi.compact_Icc_space
82100

83-
instance compact_space_Icc (a b : α) : compact_space (Icc a b) :=
84-
is_compact_iff_compact_space.mp is_compact_Icc
101+
instance {α β : Type*} [preorder α] [topological_space α] [compact_Icc_space α]
102+
[preorder β] [topological_space β] [compact_Icc_space β] :
103+
compact_Icc_space (α × β) :=
104+
⟨λ a b, (Icc_prod_eq a b).symm ▸ is_compact_Icc.prod is_compact_Icc⟩
105+
106+
/-- An unordered closed interval in a conditionally complete linear order is compact. -/
107+
lemma is_compact_interval {α : Type*} [conditionally_complete_linear_order α]
108+
[topological_space α] [order_topology α]{a b : α} : is_compact (interval a b) :=
109+
is_compact_Icc
85110

86-
instance compact_space_pi_Icc {ι : Type*} {α : ι → Type*}
87-
[Π i, conditionally_complete_linear_order (α i)] [Π i, topological_space (α i)]
88-
[Π i, order_topology (α i)] (a b : Π i, α i) : compact_space (Icc a b) :=
89-
is_compact_iff_compact_space.mp (is_compact_pi_Icc a b)
111+
/-- A complete linear order is a compact space.
90112
113+
We do not register an instance for a `[compact_Icc_space α]` because this would only add instances
114+
for products (indexed or not) of complete linear orders, and we have instances with higher priority
115+
that cover these cases. -/
91116
@[priority 100] -- See note [lower instance priority]
92117
instance compact_space_of_complete_linear_order {α : Type*} [complete_linear_order α]
93118
[topological_space α] [order_topology α] :
94119
compact_space α :=
95120
by simp only [← Icc_bot_top, is_compact_Icc]⟩
96121

122+
section
123+
124+
variables {α : Type*} [preorder α] [topological_space α] [compact_Icc_space α]
125+
126+
instance compact_space_Icc (a b : α) : compact_space (Icc a b) :=
127+
is_compact_iff_compact_space.mp is_compact_Icc
128+
129+
end
130+
97131
/-!
98132
### Min and max elements of a compact set
99133
-/
100134

135+
variables {α β : Type*} [conditionally_complete_linear_order α] [topological_space α]
136+
[order_topology α] [topological_space β]
137+
101138
lemma is_compact.Inf_mem {s : set α} (hs : is_compact s) (ne_s : s.nonempty) :
102139
Inf s ∈ s :=
103140
hs.is_closed.cInf_mem ne_s hs.bdd_below
@@ -138,16 +175,16 @@ lemma is_compact.exists_is_lub {s : set α} (hs : is_compact s) (ne_s : s.nonemp
138175
∃ x ∈ s, is_lub s x :=
139176
⟨_, hs.Sup_mem ne_s, hs.is_lub_Sup ne_s⟩
140177

141-
lemma is_compact.exists_Inf_image_eq {α : Type*} [topological_space α]
142-
{s : set α} (hs : is_compact s) (ne_s : s.nonempty) {f : αβ} (hf : continuous_on f s) :
178+
lemma is_compact.exists_Inf_image_eq {s : set β} (hs : is_compact s) (ne_s : s.nonempty)
179+
{f : βα} (hf : continuous_on f s) :
143180
∃ x ∈ s, Inf (f '' s) = f x :=
144181
let ⟨x, hxs, hx⟩ := (hs.image_of_continuous_on hf).Inf_mem (ne_s.image f)
145182
in ⟨x, hxs, hx.symm⟩
146183

147-
lemma is_compact.exists_Sup_image_eq {α : Type*} [topological_space α]:
148-
∀ {s : set α}, is_compact s → s.nonempty → ∀ {f : αβ}, continuous_on f s →
184+
lemma is_compact.exists_Sup_image_eq :
185+
∀ {s : set β}, is_compact s → s.nonempty → ∀ {f : βα}, continuous_on f s →
149186
∃ x ∈ s, Sup (f '' s) = f x :=
150-
@is_compact.exists_Inf_image_eq (order_dual β) _ _ _ _ _
187+
@is_compact.exists_Inf_image_eq (order_dual α) _ _ _ _ _
151188

152189
lemma eq_Icc_of_connected_compact {s : set α} (h₁ : is_connected s) (h₂ : is_compact s) :
153190
s = Icc (Inf s) (Sup s) :=
@@ -158,8 +195,8 @@ eq_Icc_cInf_cSup_of_connected_bdd_closed h₁ h₂.bdd_below h₂.bdd_above h₂
158195
-/
159196

160197
/-- The **extreme value theorem**: a continuous function realizes its minimum on a compact set. -/
161-
lemma is_compact.exists_forall_le {α : Type*} [topological_space α]
162-
{s : set α} (hs : is_compact s) (ne_s : s.nonempty) {f : αβ} (hf : continuous_on f s) :
198+
lemma is_compact.exists_forall_le {s : set β} (hs : is_compact s) (ne_s : s.nonempty)
199+
{f : βα} (hf : continuous_on f s) :
163200
∃x∈s, ∀y∈s, f x ≤ f y :=
164201
begin
165202
rcases (hs.image_of_continuous_on hf).exists_is_least (ne_s.image f)
@@ -168,30 +205,60 @@ begin
168205
end
169206

170207
/-- The **extreme value theorem**: a continuous function realizes its maximum on a compact set. -/
171-
lemma is_compact.exists_forall_ge {α : Type*} [topological_space α]:
172-
∀ {s : set α}, is_compact s → s.nonempty → ∀ {f : αβ}, continuous_on f s →
208+
lemma is_compact.exists_forall_ge :
209+
∀ {s : set β}, is_compact s → s.nonempty → ∀ {f : βα}, continuous_on f s →
173210
∃x∈s, ∀y∈s, f y ≤ f x :=
174-
@is_compact.exists_forall_le (order_dual β) _ _ _ _ _
211+
@is_compact.exists_forall_le (order_dual α) _ _ _ _ _
175212

176213
/-- The **extreme value theorem**: if a continuous function `f` tends to infinity away from compact
177214
sets, then it has a global minimum. -/
178-
lemma continuous.exists_forall_le {α : Type*} [topological_space α] [nonempty α] {f : αβ}
179-
(hf : continuous f) (hlim : tendsto f (cocompact α) at_top) :
215+
lemma continuous.exists_forall_le [nonempty β] {f : βα}
216+
(hf : continuous f) (hlim : tendsto f (cocompact β) at_top) :
180217
∃ x, ∀ y, f x ≤ f y :=
181218
begin
182-
inhabit α,
183-
obtain ⟨s : set α, hsc : is_compact s, hsf : ∀ x ∉ s, f (default α) ≤ f x⟩ :=
184-
(has_basis_cocompact.tendsto_iff at_top_basis).1 hlim (f $ default α) trivial,
185-
obtain ⟨x, -, hx⟩ :=
186-
(hsc.insert (default α)).exists_forall_le (nonempty_insert _ _) hf.continuous_on,
219+
inhabit β,
220+
obtain ⟨s : set β, hsc : is_compact s, hsf : ∀ x ∉ s, f (default β) ≤ f x⟩ :=
221+
(has_basis_cocompact.tendsto_iff at_top_basis).1 hlim (f $ default β) trivial,
222+
obtain ⟨x, -, hx⟩ : ∃ x ∈ insert (default β) s, ∀ y ∈ insert (default β) s, f x ≤ f y :=
223+
(hsc.insert (default β)).exists_forall_le (nonempty_insert _ _) hf.continuous_on,
187224
refine ⟨x, λ y, _⟩,
188225
by_cases hy : y ∈ s,
189226
exacts [hx y (or.inr hy), (hx _ (or.inl rfl)).trans (hsf y hy)]
190227
end
191228

192229
/-- The **extreme value theorem**: if a continuous function `f` tends to negative infinity away from
193230
compact sets, then it has a global maximum. -/
194-
lemma continuous.exists_forall_ge {α : Type*} [topological_space α] [nonempty α] {f : αβ}
195-
(hf : continuous f) (hlim : tendsto f (cocompact α) at_bot) :
231+
lemma continuous.exists_forall_ge [nonempty β] {f : βα}
232+
(hf : continuous f) (hlim : tendsto f (cocompact β) at_bot) :
196233
∃ x, ∀ y, f y ≤ f x :=
197-
@continuous.exists_forall_le (order_dual β) _ _ _ _ _ _ _ hf hlim
234+
@continuous.exists_forall_le (order_dual α) _ _ _ _ _ _ _ hf hlim
235+
236+
/-!
237+
### Image of a closed interval
238+
-/
239+
240+
variables [densely_ordered α] [conditionally_complete_linear_order β] [order_topology β]
241+
{f : α → β} {a b x y : α}
242+
243+
open_locale interval
244+
245+
lemma continuous_on.image_Icc (hab : a ≤ b) (h : continuous_on f $ Icc a b) :
246+
f '' Icc a b = Icc (Inf $ f '' Icc a b) (Sup $ f '' Icc a b) :=
247+
eq_Icc_of_connected_compact ⟨(nonempty_Icc.2 hab).image f, is_preconnected_Icc.image f h⟩
248+
(is_compact_Icc.image_of_continuous_on h)
249+
250+
lemma continuous_on.image_interval_eq_Icc (h : continuous_on f $ [a, b]) :
251+
f '' [a, b] = Icc (Inf (f '' [a, b])) (Sup (f '' [a, b])) :=
252+
begin
253+
cases le_total a b with h2 h2,
254+
{ simp_rw [interval_of_le h2] at h ⊢, exact h.image_Icc h2 },
255+
{ simp_rw [interval_of_ge h2] at h ⊢, exact h.image_Icc h2 },
256+
end
257+
258+
lemma continuous_on.image_interval (h : continuous_on f $ [a, b]) :
259+
f '' [a, b] = [Inf (f '' [a, b]), Sup (f '' [a, b])] :=
260+
begin
261+
refine h.image_interval_eq_Icc.trans (interval_of_le _).symm,
262+
refine cInf_le_cSup _ _ (nonempty_interval.image _); rw h.image_interval_eq_Icc,
263+
exacts [bdd_below_Icc, bdd_above_Icc]
264+
end

src/topology/algebra/ordered/intermediate_value.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,20 @@ or.elim (eq_or_lt_of_le hab) (λ he y h, absurd h.1 (not_lt_of_lt (he ▸ h.2)))
520520
_ _ ((hf.continuous_within_at ⟨hab, refl b⟩).mono Ioo_subset_Icc_self)
521521
((hf.continuous_within_at ⟨refl a, hab⟩).mono Ioo_subset_Icc_self))
522522

523+
/-- **Intermediate value theorem**: if `f` is continuous on an order-connected set `s` and `a`,
524+
`b` are two points of this set, then `f` sends `s` to a superset of `Icc (f x) (f y)`. -/
525+
lemma continuous_on.surj_on_Icc {s : set α} [hs : ord_connected s] {f : α → δ}
526+
(hf : continuous_on f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) :
527+
surj_on f s (Icc (f a) (f b)) :=
528+
hs.is_preconnected.intermediate_value ha hb hf
529+
530+
/-- **Intermediate value theorem**: if `f` is continuous on an order-connected set `s` and `a`,
531+
`b` are two points of this set, then `f` sends `s` to a superset of `[f x, f y]`. -/
532+
lemma continuous_on.surj_on_interval {s : set α} [hs : ord_connected s] {f : α → δ}
533+
(hf : continuous_on f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) :
534+
surj_on f s (interval (f a) (f b)) :=
535+
by cases le_total (f a) (f b) with hab hab; simp [hf.surj_on_Icc, *]
536+
523537
/-- A continuous function which tendsto `at_top` `at_top` and to `at_bot` `at_bot` is surjective. -/
524538
lemma continuous.surjective {f : α → δ} (hf : continuous f) (h_top : tendsto f at_top at_top)
525539
(h_bot : tendsto f at_bot at_bot) :

src/topology/instances/real.lean

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -308,35 +308,6 @@ lemma real.subset_Icc_Inf_Sup_of_bounded {s : set ℝ} (h : bounded s) :
308308
subset_Icc_cInf_cSup (real.bounded_iff_bdd_below_bdd_above.1 h).1
309309
(real.bounded_iff_bdd_below_bdd_above.1 h).2
310310

311-
lemma real.image_Icc {f : ℝ → ℝ} {a b : ℝ} (hab : a ≤ b) (h : continuous_on f $ Icc a b) :
312-
f '' Icc a b = Icc (Inf $ f '' Icc a b) (Sup $ f '' Icc a b) :=
313-
eq_Icc_of_connected_compact ⟨(nonempty_Icc.2 hab).image f, is_preconnected_Icc.image f h⟩
314-
(is_compact_Icc.image_of_continuous_on h)
315-
316-
lemma real.image_interval_eq_Icc {f : ℝ → ℝ} {a b : ℝ} (h : continuous_on f $ [a, b]) :
317-
f '' [a, b] = Icc (Inf (f '' [a, b])) (Sup (f '' [a, b])) :=
318-
begin
319-
cases le_total a b with h2 h2,
320-
{ simp_rw [interval_of_le h2] at h ⊢, exact real.image_Icc h2 h },
321-
{ simp_rw [interval_of_ge h2] at h ⊢, exact real.image_Icc h2 h },
322-
end
323-
324-
lemma real.image_interval {f : ℝ → ℝ} {a b : ℝ} (h : continuous_on f $ [a, b]) :
325-
f '' [a, b] = [Inf (f '' [a, b]), Sup (f '' [a, b])] :=
326-
begin
327-
refine (real.image_interval_eq_Icc h).trans (interval_of_le _).symm,
328-
rw [real.image_interval_eq_Icc h],
329-
exact real.Inf_le_Sup _ bdd_below_Icc bdd_above_Icc
330-
end
331-
332-
lemma real.interval_subset_image_interval {f : ℝ → ℝ} {a b x y : ℝ}
333-
(h : continuous_on f [a, b]) (hx : x ∈ [a, b]) (hy : y ∈ [a, b]) :
334-
[f x, f y] ⊆ f '' [a, b] :=
335-
begin
336-
rw [real.image_interval h, interval_subset_interval_iff_mem, ← real.image_interval h],
337-
exact ⟨mem_image_of_mem f hx, mem_image_of_mem f hy⟩
338-
end
339-
340311
end
341312

342313
section periodic

0 commit comments

Comments
 (0)