This repository was archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 289
Expand file tree
/
Copy pathlocal_extr.lean
More file actions
522 lines (376 loc) · 19.5 KB
/
Copy pathlocal_extr.lean
File metadata and controls
522 lines (376 loc) · 19.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
/-
Copyright (c) 2019 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import order.filter.extr
import topology.continuous_on
/-!
# Local extrema of functions on topological spaces
> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.
## Main definitions
This file defines special versions of `is_*_filter f a l`, `*=min/max/extr`,
from `order/filter/extr` for two kinds of filters: `nhds_within` and `nhds`.
These versions are called `is_local_*_on` and `is_local_*`, respectively.
## Main statements
Many lemmas in this file restate those from `order/filter/extr`, and you can find
a detailed documentation there. These convenience lemmas are provided only to make the dot notation
return propositions of expected types, not just `is_*_filter`.
Here is the list of statements specific to these two types of filters:
* `is_local_*.on`, `is_local_*_on.on_subset`: restrict to a subset;
* `is_local_*_on.inter` : intersect the set with another one;
* `is_*_on.localize` : a global extremum is a local extremum too.
* `is_[local_]*_on.is_local_*` : if we have `is_local_*_on f s a` and `s ∈ 𝓝 a`,
then we have `is_local_* f a`.
-/
universes u v w x
variables {α : Type u} {β : Type v} {γ : Type w} {δ : Type x} [topological_space α]
open set filter
open_locale topology filter
section preorder
variables [preorder β] [preorder γ] (f : α → β) (s : set α) (a : α)
/-- `is_local_min_on f s a` means that `f a ≤ f x` for all `x ∈ s` in some neighborhood of `a`. -/
def is_local_min_on := is_min_filter f (𝓝[s] a) a
/-- `is_local_max_on f s a` means that `f x ≤ f a` for all `x ∈ s` in some neighborhood of `a`. -/
def is_local_max_on := is_max_filter f (𝓝[s] a) a
/-- `is_local_extr_on f s a` means `is_local_min_on f s a ∨ is_local_max_on f s a`. -/
def is_local_extr_on := is_extr_filter f (𝓝[s] a) a
/-- `is_local_min f a` means that `f a ≤ f x` for all `x` in some neighborhood of `a`. -/
def is_local_min := is_min_filter f (𝓝 a) a
/-- `is_local_max f a` means that `f x ≤ f a` for all `x ∈ s` in some neighborhood of `a`. -/
def is_local_max := is_max_filter f (𝓝 a) a
/-- `is_local_extr_on f s a` means `is_local_min_on f s a ∨ is_local_max_on f s a`. -/
def is_local_extr := is_extr_filter f (𝓝 a) a
variables {f s a}
lemma is_local_extr_on.elim {p : Prop} :
is_local_extr_on f s a → (is_local_min_on f s a → p) → (is_local_max_on f s a → p) → p :=
or.elim
lemma is_local_extr.elim {p : Prop} :
is_local_extr f a → (is_local_min f a → p) → (is_local_max f a → p) → p :=
or.elim
/-! ### Restriction to (sub)sets -/
lemma is_local_min.on (h : is_local_min f a) (s) : is_local_min_on f s a :=
h.filter_inf _
lemma is_local_max.on (h : is_local_max f a) (s) : is_local_max_on f s a :=
h.filter_inf _
lemma is_local_extr.on (h : is_local_extr f a) (s) : is_local_extr_on f s a :=
h.filter_inf _
lemma is_local_min_on.on_subset {t : set α} (hf : is_local_min_on f t a) (h : s ⊆ t) :
is_local_min_on f s a :=
hf.filter_mono $ nhds_within_mono a h
lemma is_local_max_on.on_subset {t : set α} (hf : is_local_max_on f t a) (h : s ⊆ t) :
is_local_max_on f s a :=
hf.filter_mono $ nhds_within_mono a h
lemma is_local_extr_on.on_subset {t : set α} (hf : is_local_extr_on f t a) (h : s ⊆ t) :
is_local_extr_on f s a :=
hf.filter_mono $ nhds_within_mono a h
lemma is_local_min_on.inter (hf : is_local_min_on f s a) (t) : is_local_min_on f (s ∩ t) a :=
hf.on_subset (inter_subset_left s t)
lemma is_local_max_on.inter (hf : is_local_max_on f s a) (t) : is_local_max_on f (s ∩ t) a :=
hf.on_subset (inter_subset_left s t)
lemma is_local_extr_on.inter (hf : is_local_extr_on f s a) (t) : is_local_extr_on f (s ∩ t) a :=
hf.on_subset (inter_subset_left s t)
lemma is_min_on.localize (hf : is_min_on f s a) : is_local_min_on f s a :=
hf.filter_mono $ inf_le_right
lemma is_max_on.localize (hf : is_max_on f s a) : is_local_max_on f s a :=
hf.filter_mono $ inf_le_right
lemma is_extr_on.localize (hf : is_extr_on f s a) : is_local_extr_on f s a :=
hf.filter_mono $ inf_le_right
lemma is_local_min_on.is_local_min (hf : is_local_min_on f s a) (hs : s ∈ 𝓝 a) : is_local_min f a :=
have 𝓝 a ≤ 𝓟 s, from le_principal_iff.2 hs,
hf.filter_mono $ le_inf le_rfl this
lemma is_local_max_on.is_local_max (hf : is_local_max_on f s a) (hs : s ∈ 𝓝 a) : is_local_max f a :=
have 𝓝 a ≤ 𝓟 s, from le_principal_iff.2 hs,
hf.filter_mono $ le_inf le_rfl this
lemma is_local_extr_on.is_local_extr (hf : is_local_extr_on f s a) (hs : s ∈ 𝓝 a) :
is_local_extr f a :=
hf.elim (λ hf, (hf.is_local_min hs).is_extr) (λ hf, (hf.is_local_max hs).is_extr)
lemma is_min_on.is_local_min (hf : is_min_on f s a) (hs : s ∈ 𝓝 a) : is_local_min f a :=
hf.localize.is_local_min hs
lemma is_max_on.is_local_max (hf : is_max_on f s a) (hs : s ∈ 𝓝 a) : is_local_max f a :=
hf.localize.is_local_max hs
lemma is_extr_on.is_local_extr (hf : is_extr_on f s a) (hs : s ∈ 𝓝 a) : is_local_extr f a :=
hf.localize.is_local_extr hs
lemma is_local_min_on.not_nhds_le_map [topological_space β]
(hf : is_local_min_on f s a) [ne_bot (𝓝[<] (f a))] :
¬𝓝 (f a) ≤ map f (𝓝[s] a) :=
λ hle,
have ∀ᶠ y in 𝓝[<] (f a), f a ≤ y,
from (eventually_map.2 hf).filter_mono (inf_le_left.trans hle),
let ⟨y, hy⟩ := (this.and self_mem_nhds_within).exists in hy.1.not_lt hy.2
lemma is_local_max_on.not_nhds_le_map [topological_space β]
(hf : is_local_max_on f s a) [ne_bot (𝓝[>] (f a))] :
¬𝓝 (f a) ≤ map f (𝓝[s] a) :=
@is_local_min_on.not_nhds_le_map α βᵒᵈ _ _ _ _ _ ‹_› hf ‹_›
lemma is_local_extr_on.not_nhds_le_map [topological_space β]
(hf : is_local_extr_on f s a) [ne_bot (𝓝[<] (f a))] [ne_bot (𝓝[>] (f a))] :
¬𝓝 (f a) ≤ map f (𝓝[s] a) :=
hf.elim (λ h, h.not_nhds_le_map) (λ h, h.not_nhds_le_map)
/-! ### Constant -/
lemma is_local_min_on_const {b : β} : is_local_min_on (λ _, b) s a := is_min_filter_const
lemma is_local_max_on_const {b : β} : is_local_max_on (λ _, b) s a := is_max_filter_const
lemma is_local_extr_on_const {b : β} : is_local_extr_on (λ _, b) s a := is_extr_filter_const
lemma is_local_min_const {b : β} : is_local_min (λ _, b) a := is_min_filter_const
lemma is_local_max_const {b : β} : is_local_max (λ _, b) a := is_max_filter_const
lemma is_local_extr_const {b : β} : is_local_extr (λ _, b) a := is_extr_filter_const
/-! ### Composition with (anti)monotone functions -/
lemma is_local_min.comp_mono (hf : is_local_min f a) {g : β → γ} (hg : monotone g) :
is_local_min (g ∘ f) a :=
hf.comp_mono hg
lemma is_local_max.comp_mono (hf : is_local_max f a) {g : β → γ} (hg : monotone g) :
is_local_max (g ∘ f) a :=
hf.comp_mono hg
lemma is_local_extr.comp_mono (hf : is_local_extr f a) {g : β → γ} (hg : monotone g) :
is_local_extr (g ∘ f) a :=
hf.comp_mono hg
lemma is_local_min.comp_antitone (hf : is_local_min f a) {g : β → γ}
(hg : antitone g) :
is_local_max (g ∘ f) a :=
hf.comp_antitone hg
lemma is_local_max.comp_antitone (hf : is_local_max f a) {g : β → γ}
(hg : antitone g) :
is_local_min (g ∘ f) a :=
hf.comp_antitone hg
lemma is_local_extr.comp_antitone (hf : is_local_extr f a) {g : β → γ}
(hg : antitone g) :
is_local_extr (g ∘ f) a :=
hf.comp_antitone hg
lemma is_local_min_on.comp_mono (hf : is_local_min_on f s a) {g : β → γ} (hg : monotone g) :
is_local_min_on (g ∘ f) s a :=
hf.comp_mono hg
lemma is_local_max_on.comp_mono (hf : is_local_max_on f s a) {g : β → γ} (hg : monotone g) :
is_local_max_on (g ∘ f) s a :=
hf.comp_mono hg
lemma is_local_extr_on.comp_mono (hf : is_local_extr_on f s a) {g : β → γ} (hg : monotone g) :
is_local_extr_on (g ∘ f) s a :=
hf.comp_mono hg
lemma is_local_min_on.comp_antitone (hf : is_local_min_on f s a) {g : β → γ}
(hg : antitone g) :
is_local_max_on (g ∘ f) s a :=
hf.comp_antitone hg
lemma is_local_max_on.comp_antitone (hf : is_local_max_on f s a) {g : β → γ}
(hg : antitone g) :
is_local_min_on (g ∘ f) s a :=
hf.comp_antitone hg
lemma is_local_extr_on.comp_antitone (hf : is_local_extr_on f s a) {g : β → γ}
(hg : antitone g) :
is_local_extr_on (g ∘ f) s a :=
hf.comp_antitone hg
lemma is_local_min.bicomp_mono [preorder δ] {op : β → γ → δ} (hop : ((≤) ⇒ (≤) ⇒ (≤)) op op)
(hf : is_local_min f a) {g : α → γ} (hg : is_local_min g a) :
is_local_min (λ x, op (f x) (g x)) a :=
hf.bicomp_mono hop hg
lemma is_local_max.bicomp_mono [preorder δ] {op : β → γ → δ} (hop : ((≤) ⇒ (≤) ⇒ (≤)) op op)
(hf : is_local_max f a) {g : α → γ} (hg : is_local_max g a) :
is_local_max (λ x, op (f x) (g x)) a :=
hf.bicomp_mono hop hg
-- No `extr` version because we need `hf` and `hg` to be of the same kind
lemma is_local_min_on.bicomp_mono [preorder δ] {op : β → γ → δ} (hop : ((≤) ⇒ (≤) ⇒ (≤)) op op)
(hf : is_local_min_on f s a) {g : α → γ} (hg : is_local_min_on g s a) :
is_local_min_on (λ x, op (f x) (g x)) s a :=
hf.bicomp_mono hop hg
lemma is_local_max_on.bicomp_mono [preorder δ] {op : β → γ → δ} (hop : ((≤) ⇒ (≤) ⇒ (≤)) op op)
(hf : is_local_max_on f s a) {g : α → γ} (hg : is_local_max_on g s a) :
is_local_max_on (λ x, op (f x) (g x)) s a :=
hf.bicomp_mono hop hg
/-! ### Composition with `continuous_at` -/
lemma is_local_min.comp_continuous [topological_space δ] {g : δ → α} {b : δ}
(hf : is_local_min f (g b)) (hg : continuous_at g b) :
is_local_min (f ∘ g) b :=
hg hf
lemma is_local_max.comp_continuous [topological_space δ] {g : δ → α} {b : δ}
(hf : is_local_max f (g b)) (hg : continuous_at g b) :
is_local_max (f ∘ g) b :=
hg hf
lemma is_local_extr.comp_continuous [topological_space δ] {g : δ → α} {b : δ}
(hf : is_local_extr f (g b)) (hg : continuous_at g b) :
is_local_extr (f ∘ g) b :=
hf.comp_tendsto hg
lemma is_local_min.comp_continuous_on [topological_space δ] {s : set δ} {g : δ → α} {b : δ}
(hf : is_local_min f (g b)) (hg : continuous_on g s) (hb : b ∈ s) :
is_local_min_on (f ∘ g) s b :=
hf.comp_tendsto (hg b hb)
lemma is_local_max.comp_continuous_on [topological_space δ] {s : set δ} {g : δ → α} {b : δ}
(hf : is_local_max f (g b)) (hg : continuous_on g s) (hb : b ∈ s) :
is_local_max_on (f ∘ g) s b :=
hf.comp_tendsto (hg b hb)
lemma is_local_extr.comp_continuous_on [topological_space δ] {s : set δ} (g : δ → α) {b : δ}
(hf : is_local_extr f (g b)) (hg : continuous_on g s) (hb : b ∈ s) :
is_local_extr_on (f ∘ g) s b :=
hf.elim (λ hf, (hf.comp_continuous_on hg hb).is_extr)
(λ hf, (is_local_max.comp_continuous_on hf hg hb).is_extr)
lemma is_local_min_on.comp_continuous_on [topological_space δ] {t : set α} {s : set δ} {g : δ → α}
{b : δ} (hf : is_local_min_on f t (g b)) (hst : s ⊆ g ⁻¹' t) (hg : continuous_on g s)
(hb : b ∈ s) :
is_local_min_on (f ∘ g) s b :=
hf.comp_tendsto (tendsto_nhds_within_mono_right (image_subset_iff.mpr hst)
(continuous_within_at.tendsto_nhds_within_image (hg b hb)))
lemma is_local_max_on.comp_continuous_on [topological_space δ] {t : set α} {s : set δ} {g : δ → α}
{b : δ} (hf : is_local_max_on f t (g b)) (hst : s ⊆ g ⁻¹' t) (hg : continuous_on g s)
(hb : b ∈ s) :
is_local_max_on (f ∘ g) s b :=
hf.comp_tendsto (tendsto_nhds_within_mono_right (image_subset_iff.mpr hst)
(continuous_within_at.tendsto_nhds_within_image (hg b hb)))
lemma is_local_extr_on.comp_continuous_on [topological_space δ] {t : set α} {s : set δ} (g : δ → α)
{b : δ} (hf : is_local_extr_on f t (g b)) (hst : s ⊆ g ⁻¹' t) (hg : continuous_on g s)
(hb : b ∈ s) :
is_local_extr_on (f ∘ g) s b :=
hf.elim (λ hf, (hf.comp_continuous_on hst hg hb).is_extr)
(λ hf, (is_local_max_on.comp_continuous_on hf hst hg hb).is_extr)
end preorder
/-! ### Pointwise addition -/
section ordered_add_comm_monoid
variables [ordered_add_comm_monoid β] {f g : α → β} {a : α} {s : set α} {l : filter α}
lemma is_local_min.add (hf : is_local_min f a) (hg : is_local_min g a) :
is_local_min (λ x, f x + g x) a :=
hf.add hg
lemma is_local_max.add (hf : is_local_max f a) (hg : is_local_max g a) :
is_local_max (λ x, f x + g x) a :=
hf.add hg
lemma is_local_min_on.add (hf : is_local_min_on f s a) (hg : is_local_min_on g s a) :
is_local_min_on (λ x, f x + g x) s a :=
hf.add hg
lemma is_local_max_on.add (hf : is_local_max_on f s a) (hg : is_local_max_on g s a) :
is_local_max_on (λ x, f x + g x) s a :=
hf.add hg
end ordered_add_comm_monoid
/-! ### Pointwise negation and subtraction -/
section ordered_add_comm_group
variables [ordered_add_comm_group β] {f g : α → β} {a : α} {s : set α} {l : filter α}
lemma is_local_min.neg (hf : is_local_min f a) : is_local_max (λ x, -f x) a :=
hf.neg
lemma is_local_max.neg (hf : is_local_max f a) : is_local_min (λ x, -f x) a :=
hf.neg
lemma is_local_extr.neg (hf : is_local_extr f a) : is_local_extr (λ x, -f x) a :=
hf.neg
lemma is_local_min_on.neg (hf : is_local_min_on f s a) : is_local_max_on (λ x, -f x) s a :=
hf.neg
lemma is_local_max_on.neg (hf : is_local_max_on f s a) : is_local_min_on (λ x, -f x) s a :=
hf.neg
lemma is_local_extr_on.neg (hf : is_local_extr_on f s a) : is_local_extr_on (λ x, -f x) s a :=
hf.neg
lemma is_local_min.sub (hf : is_local_min f a) (hg : is_local_max g a) :
is_local_min (λ x, f x - g x) a :=
hf.sub hg
lemma is_local_max.sub (hf : is_local_max f a) (hg : is_local_min g a) :
is_local_max (λ x, f x - g x) a :=
hf.sub hg
lemma is_local_min_on.sub (hf : is_local_min_on f s a) (hg : is_local_max_on g s a) :
is_local_min_on (λ x, f x - g x) s a :=
hf.sub hg
lemma is_local_max_on.sub (hf : is_local_max_on f s a) (hg : is_local_min_on g s a) :
is_local_max_on (λ x, f x - g x) s a :=
hf.sub hg
end ordered_add_comm_group
/-! ### Pointwise `sup`/`inf` -/
section semilattice_sup
variables [semilattice_sup β] {f g : α → β} {a : α} {s : set α} {l : filter α}
lemma is_local_min.sup (hf : is_local_min f a) (hg : is_local_min g a) :
is_local_min (λ x, f x ⊔ g x) a :=
hf.sup hg
lemma is_local_max.sup (hf : is_local_max f a) (hg : is_local_max g a) :
is_local_max (λ x, f x ⊔ g x) a :=
hf.sup hg
lemma is_local_min_on.sup (hf : is_local_min_on f s a) (hg : is_local_min_on g s a) :
is_local_min_on (λ x, f x ⊔ g x) s a :=
hf.sup hg
lemma is_local_max_on.sup (hf : is_local_max_on f s a) (hg : is_local_max_on g s a) :
is_local_max_on (λ x, f x ⊔ g x) s a :=
hf.sup hg
end semilattice_sup
section semilattice_inf
variables [semilattice_inf β] {f g : α → β} {a : α} {s : set α} {l : filter α}
lemma is_local_min.inf (hf : is_local_min f a) (hg : is_local_min g a) :
is_local_min (λ x, f x ⊓ g x) a :=
hf.inf hg
lemma is_local_max.inf (hf : is_local_max f a) (hg : is_local_max g a) :
is_local_max (λ x, f x ⊓ g x) a :=
hf.inf hg
lemma is_local_min_on.inf (hf : is_local_min_on f s a) (hg : is_local_min_on g s a) :
is_local_min_on (λ x, f x ⊓ g x) s a :=
hf.inf hg
lemma is_local_max_on.inf (hf : is_local_max_on f s a) (hg : is_local_max_on g s a) :
is_local_max_on (λ x, f x ⊓ g x) s a :=
hf.inf hg
end semilattice_inf
/-! ### Pointwise `min`/`max` -/
section linear_order
variables [linear_order β] {f g : α → β} {a : α} {s : set α} {l : filter α}
lemma is_local_min.min (hf : is_local_min f a) (hg : is_local_min g a) :
is_local_min (λ x, min (f x) (g x)) a :=
hf.min hg
lemma is_local_max.min (hf : is_local_max f a) (hg : is_local_max g a) :
is_local_max (λ x, min (f x) (g x)) a :=
hf.min hg
lemma is_local_min_on.min (hf : is_local_min_on f s a) (hg : is_local_min_on g s a) :
is_local_min_on (λ x, min (f x) (g x)) s a :=
hf.min hg
lemma is_local_max_on.min (hf : is_local_max_on f s a) (hg : is_local_max_on g s a) :
is_local_max_on (λ x, min (f x) (g x)) s a :=
hf.min hg
lemma is_local_min.max (hf : is_local_min f a) (hg : is_local_min g a) :
is_local_min (λ x, max (f x) (g x)) a :=
hf.max hg
lemma is_local_max.max (hf : is_local_max f a) (hg : is_local_max g a) :
is_local_max (λ x, max (f x) (g x)) a :=
hf.max hg
lemma is_local_min_on.max (hf : is_local_min_on f s a) (hg : is_local_min_on g s a) :
is_local_min_on (λ x, max (f x) (g x)) s a :=
hf.max hg
lemma is_local_max_on.max (hf : is_local_max_on f s a) (hg : is_local_max_on g s a) :
is_local_max_on (λ x, max (f x) (g x)) s a :=
hf.max hg
end linear_order
section eventually
/-! ### Relation with `eventually` comparisons of two functions -/
variables [preorder β] {s : set α}
lemma filter.eventually_le.is_local_max_on {f g : α → β} {a : α} (hle : g ≤ᶠ[𝓝[s] a] f)
(hfga : f a = g a) (h : is_local_max_on f s a) : is_local_max_on g s a :=
hle.is_max_filter hfga h
lemma is_local_max_on.congr {f g : α → β} {a : α} (h : is_local_max_on f s a)
(heq : f =ᶠ[𝓝[s] a] g) (hmem : a ∈ s) : is_local_max_on g s a :=
h.congr heq $ heq.eq_of_nhds_within hmem
lemma filter.eventually_eq.is_local_max_on_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝[s] a] g)
(hmem : a ∈ s) : is_local_max_on f s a ↔ is_local_max_on g s a :=
heq.is_max_filter_iff $ heq.eq_of_nhds_within hmem
lemma filter.eventually_le.is_local_min_on {f g : α → β} {a : α} (hle : f ≤ᶠ[𝓝[s] a] g)
(hfga : f a = g a) (h : is_local_min_on f s a) : is_local_min_on g s a :=
hle.is_min_filter hfga h
lemma is_local_min_on.congr {f g : α → β} {a : α} (h : is_local_min_on f s a)
(heq : f =ᶠ[𝓝[s] a] g) (hmem : a ∈ s) : is_local_min_on g s a :=
h.congr heq $ heq.eq_of_nhds_within hmem
lemma filter.eventually_eq.is_local_min_on_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝[s] a] g)
(hmem : a ∈ s) : is_local_min_on f s a ↔ is_local_min_on g s a :=
heq.is_min_filter_iff $ heq.eq_of_nhds_within hmem
lemma is_local_extr_on.congr {f g : α → β} {a : α} (h : is_local_extr_on f s a)
(heq : f =ᶠ[𝓝[s] a] g) (hmem : a ∈ s) : is_local_extr_on g s a :=
h.congr heq $ heq.eq_of_nhds_within hmem
lemma filter.eventually_eq.is_local_extr_on_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝[s] a] g)
(hmem : a ∈ s) : is_local_extr_on f s a ↔ is_local_extr_on g s a :=
heq.is_extr_filter_iff $ heq.eq_of_nhds_within hmem
lemma filter.eventually_le.is_local_max {f g : α → β} {a : α} (hle : g ≤ᶠ[𝓝 a] f) (hfga : f a = g a)
(h : is_local_max f a) : is_local_max g a :=
hle.is_max_filter hfga h
lemma is_local_max.congr {f g : α → β} {a : α} (h : is_local_max f a) (heq : f =ᶠ[𝓝 a] g) :
is_local_max g a :=
h.congr heq heq.eq_of_nhds
lemma filter.eventually_eq.is_local_max_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝 a] g) :
is_local_max f a ↔ is_local_max g a :=
heq.is_max_filter_iff heq.eq_of_nhds
lemma filter.eventually_le.is_local_min {f g : α → β} {a : α} (hle : f ≤ᶠ[𝓝 a] g) (hfga : f a = g a)
(h : is_local_min f a) : is_local_min g a :=
hle.is_min_filter hfga h
lemma is_local_min.congr {f g : α → β} {a : α} (h : is_local_min f a) (heq : f =ᶠ[𝓝 a] g) :
is_local_min g a :=
h.congr heq heq.eq_of_nhds
lemma filter.eventually_eq.is_local_min_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝 a] g) :
is_local_min f a ↔ is_local_min g a :=
heq.is_min_filter_iff heq.eq_of_nhds
lemma is_local_extr.congr {f g : α → β} {a : α} (h : is_local_extr f a) (heq : f =ᶠ[𝓝 a] g) :
is_local_extr g a :=
h.congr heq heq.eq_of_nhds
lemma filter.eventually_eq.is_local_extr_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝 a] g) :
is_local_extr f a ↔ is_local_extr g a :=
heq.is_extr_filter_iff heq.eq_of_nhds
end eventually