@@ -13,24 +13,42 @@ order topology (or a product of such types) is compact. We also prove the extrem
13
13
(`is_compact.exists_forall_le`, `is_compact.exists_forall_ge`): a continuous function on a compact
14
14
set takes its minimum and maximum values.
15
15
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
+
16
19
## Tags
17
20
18
21
compact, extreme value theorem
19
22
-/
20
23
21
24
open classical filter order_dual topological_space function set
22
25
23
- variables {α β : Type *}
24
- [conditionally_complete_linear_order α] [topological_space α] [order_topology α]
25
- [conditionally_complete_linear_order β] [topological_space β] [order_topology β]
26
-
27
26
/-!
28
27
### 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.
29
35
-/
30
36
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
+
31
45
/-- 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 α :=
33
50
begin
51
+ refine ⟨λ a b, _⟩,
34
52
cases le_or_lt a b with hab hab, swap, { simp [hab] },
35
53
refine is_compact_iff_ultrafilter_le_nhds.2 (λ f hf, _),
36
54
contrapose! hf,
@@ -72,32 +90,51 @@ begin
72
90
{ exact ((hsc.1 ⟨hy, hay⟩).not_lt hxy.1 ).elim },
73
91
end
74
92
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⟩
77
96
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
82
100
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
85
110
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.
90
112
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. -/
91
116
@[priority 100 ] -- See note [lower instance priority]
92
117
instance compact_space_of_complete_linear_order {α : Type *} [complete_linear_order α]
93
118
[topological_space α] [order_topology α] :
94
119
compact_space α :=
95
120
⟨by simp only [← Icc_bot_top, is_compact_Icc]⟩
96
121
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
+
97
131
/-!
98
132
### Min and max elements of a compact set
99
133
-/
100
134
135
+ variables {α β : Type *} [conditionally_complete_linear_order α] [topological_space α]
136
+ [order_topology α] [topological_space β]
137
+
101
138
lemma is_compact.Inf_mem {s : set α} (hs : is_compact s) (ne_s : s.nonempty) :
102
139
Inf s ∈ s :=
103
140
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
138
175
∃ x ∈ s, is_lub s x :=
139
176
⟨_, hs.Sup_mem ne_s, hs.is_lub_Sup ne_s⟩
140
177
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) :
143
180
∃ x ∈ s, Inf (f '' s) = f x :=
144
181
let ⟨x, hxs, hx⟩ := (hs.image_of_continuous_on hf).Inf_mem (ne_s.image f)
145
182
in ⟨x, hxs, hx.symm⟩
146
183
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 →
149
186
∃ 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 α ) _ _ _ _ _
151
188
152
189
lemma eq_Icc_of_connected_compact {s : set α} (h₁ : is_connected s) (h₂ : is_compact s) :
153
190
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₂
158
195
-/
159
196
160
197
/-- 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) :
163
200
∃x∈s, ∀y∈s, f x ≤ f y :=
164
201
begin
165
202
rcases (hs.image_of_continuous_on hf).exists_is_least (ne_s.image f)
@@ -168,30 +205,60 @@ begin
168
205
end
169
206
170
207
/-- 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 →
173
210
∃x∈s, ∀y∈s, f y ≤ f x :=
174
- @is_compact.exists_forall_le (order_dual β ) _ _ _ _ _
211
+ @is_compact.exists_forall_le (order_dual α ) _ _ _ _ _
175
212
176
213
/-- The **extreme value theorem** : if a continuous function `f` tends to infinity away from compact
177
214
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) :
180
217
∃ x, ∀ y, f x ≤ f y :=
181
218
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,
187
224
refine ⟨x, λ y, _⟩,
188
225
by_cases hy : y ∈ s,
189
226
exacts [hx y (or.inr hy), (hx _ (or.inl rfl)).trans (hsf y hy)]
190
227
end
191
228
192
229
/-- The **extreme value theorem** : if a continuous function `f` tends to negative infinity away from
193
230
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) :
196
233
∃ 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
0 commit comments