11/-
22Copyright (c) 2024 Bjørn Kjos-Hanssen. All rights reserved.
33Released under Apache 2.0 license as described in the file LICENSE.
4- Authors: Bjørn Kjos-Hanssen, Patrick Massot, Yongxi Lin
4+ Authors: Bjørn Kjos-Hanssen, Patrick Massot
55-/
66module
77
88public import Mathlib.Topology.Order.OrderClosed
99public import Mathlib.Topology.Order.LocalExtr
1010
1111/-!
12- # Extrema from monotonicity and antitonicity
12+ # Local maxima from monotonicity and antitonicity
1313
1414In this file we prove a lemma that is useful for the First Derivative Test in calculus,
1515and its dual.
@@ -25,13 +25,13 @@ and its dual.
2525
2626public section
2727
28- open Set Topology Filter
28+ open Set
2929
3030variable {α β : Type *} [LinearOrder α] [Preorder β] {s : Set α} {a b c : α} {f : α → β}
3131
3232/-- If `f` is monotone on `(a, b]` and antitone on `[b,c)`, then the maximum of `f` on `(a, c)` is
3333attained at `b`. -/
34- lemma isMaxOn_of_mono_anti_Ioo (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneOn f (Ico b c)) :
34+ lemma isMaxOn_Ioo_of_mono_anti (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneOn f (Ico b c)) :
3535 IsMaxOn f (Ioo a c) b := by
3636 intro x hx
3737 by_cases! g₀ : x ≤ b
@@ -40,13 +40,13 @@ lemma isMaxOn_of_mono_anti_Ioo (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneO
4040
4141/-- If `f` is antitone on `(a, b]` and monotone on `[b,c)`, then the minimum of `f` on `(a, c)` is
4242attained at `b`. -/
43- lemma isMinOn_of_anti_mono_Ioo (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Ico b c)) :
43+ lemma isMinOn_Ioo_of_anti_mono (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Ico b c)) :
4444 IsMinOn f (Ioo a c) b :=
45- isMaxOn_of_mono_anti_Ioo (β := βᵒᵈ) h₀ h₁
45+ isMaxOn_Ioo_of_mono_anti (β := βᵒᵈ) h₀ h₁
4646
4747/-- If `f` is monotone on `[a, b]` and antitone on `[b,c)`, then the maximum of `f` on `[a, c)` is
4848attained at `b`. -/
49- lemma isMaxOn_of_mono_anti_Ico
49+ lemma isMaxOn_Ico_of_mono_anti
5050 (h₀ : MonotoneOn f (Icc a b))
5151 (h₁ : AntitoneOn f (Ico b c)) : IsMaxOn f (Ico a c) b := by
5252 intro x hx
@@ -56,13 +56,13 @@ lemma isMaxOn_of_mono_anti_Ico
5656
5757/-- If `f` is antitone on `[a, b]` and monotone on `[b,c)`, then the minimum of `f` on `[a, c)` is
5858attained at `b`. -/
59- lemma isMinOn_of_anti_mono_Ico (h₀ : AntitoneOn f (Icc a b)) (h₁ : MonotoneOn f (Ico b c)) :
59+ lemma isMinOn_Ico_of_anti_mono (h₀ : AntitoneOn f (Icc a b)) (h₁ : MonotoneOn f (Ico b c)) :
6060 IsMinOn f (Ico a c) b :=
61- isMaxOn_of_mono_anti_Ico (β := βᵒᵈ) h₀ h₁
61+ isMaxOn_Ico_of_mono_anti (β := βᵒᵈ) h₀ h₁
6262
6363/-- If `f` is monotone on `(a, b]` and antitone on `[b,c]`, then the maximum of `f` on `(a, c]` is
6464attained at `b`. -/
65- lemma isMaxOn_of_mono_anti_Ioc (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneOn f (Icc b c)) :
65+ lemma isMaxOn_Ioc_of_mono_anti (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneOn f (Icc b c)) :
6666 IsMaxOn f (Ioc a c) b := by
6767 intro x hx
6868 by_cases! g₀ : x ≤ b
@@ -71,13 +71,13 @@ lemma isMaxOn_of_mono_anti_Ioc (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneO
7171
7272/-- If `f` is monotone on `(a, b]` and antitone on `[b,c]`, then the maximum of `f` on `(a, c]` is
7373attained at `b`. -/
74- lemma isMinOn_of_anti_mono_Ioc (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Icc b c)) :
74+ lemma isMinOn_Ioc_of_anti_mono (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Icc b c)) :
7575 IsMinOn f (Ioc a c) b :=
76- isMaxOn_of_mono_anti_Ioc (β := βᵒᵈ) h₀ h₁
76+ isMaxOn_Ioc_of_mono_anti (β := βᵒᵈ) h₀ h₁
7777
7878/-- If `f` is monotone on `[a, b]` and antitone on `[b,c]`, then the maximum of `f` on `[a, c]` is
7979attained at `b`. -/
80- lemma isMaxOn_of_mono_anti_Icc (h₀ : MonotoneOn f (Icc a b)) (h₁ : AntitoneOn f (Icc b c)) :
80+ lemma isMaxOn_Icc_of_mono_anti (h₀ : MonotoneOn f (Icc a b)) (h₁ : AntitoneOn f (Icc b c)) :
8181 IsMaxOn f (Icc a c) b := by
8282 intro x hx
8383 by_cases! g₀ : x ≤ b
@@ -86,13 +86,13 @@ lemma isMaxOn_of_mono_anti_Icc (h₀ : MonotoneOn f (Icc a b)) (h₁ : AntitoneO
8686
8787/-- If `f` is antitone on `[a, b]` and monotone on `[b,c]`, then the minimum of `f` on `(a, c]` is
8888attained at `b`. -/
89- lemma isMinOn_of_anti_mono_Icc (h₀ : AntitoneOn f (Icc a b)) (h₁ : MonotoneOn f (Icc b c)) :
89+ lemma isMinOn_Icc_of_anti_mono (h₀ : AntitoneOn f (Icc a b)) (h₁ : MonotoneOn f (Icc b c)) :
9090 IsMinOn f (Icc a c) b :=
91- isMaxOn_of_mono_anti_Icc (β := βᵒᵈ) h₀ h₁
91+ isMaxOn_Icc_of_mono_anti (β := βᵒᵈ) h₀ h₁
9292
9393/-- If `f` is monotone on `(a, b]` and antitone on `[b,∞)`, then the maximum of `f` on `(a, ∞)` is
9494attained at `b`. -/
95- lemma isMaxOn_of_mono_anti_Ioi (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneOn f (Ici b)) :
95+ lemma isMaxOn_Ioi_of_mono_anti (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneOn f (Ici b)) :
9696 IsMaxOn f (Ioi a) b := by
9797 intro x hx
9898 by_cases! g₀ : x ≤ b
@@ -101,13 +101,13 @@ lemma isMaxOn_of_mono_anti_Ioi (h₀ : MonotoneOn f (Ioc a b)) (h₁ : AntitoneO
101101
102102/-- If `f` is antitone on `(a, b]` and monotone on `[b,∞)`, then the minimum of `f` on `(a, ∞)` is
103103attained at `b`. -/
104- lemma isMinOn_of_anti_mono_Ioi (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Ici b)) :
104+ lemma isMinOn_Ioi_of_anti_mono (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Ici b)) :
105105 IsMinOn f (Ioi a) b :=
106- isMaxOn_of_mono_anti_Ioi (β := βᵒᵈ) h₀ h₁
106+ isMaxOn_Ioi_of_mono_anti (β := βᵒᵈ) h₀ h₁
107107
108108/-- If `f` is monotone on `[a, b]` and antitone on `[b,∞)`, then the maximum of `f` on `[a, ∞)` is
109109attained at `b`. -/
110- lemma isMaxOn_of_mono_anti_Ici (h₀ : MonotoneOn f (Icc a b)) (h₁ : AntitoneOn f (Ici b)) :
110+ lemma isMaxOn_Ici_of_mono_anti (h₀ : MonotoneOn f (Icc a b)) (h₁ : AntitoneOn f (Ici b)) :
111111 IsMaxOn f (Ici a) b := by
112112 intro x hx
113113 by_cases! g₀ : x ≤ b
@@ -116,13 +116,13 @@ lemma isMaxOn_of_mono_anti_Ici (h₀ : MonotoneOn f (Icc a b)) (h₁ : AntitoneO
116116
117117/-- If `f` is antitone on `(a, b]` and monotone on `[b,∞)`, then the minimum of `f` on `[a, ∞)` is
118118attained at `b`. -/
119- lemma isMinOn_of_anti_mono_Ici (h₀ : AntitoneOn f (Icc a b)) (h₁ : MonotoneOn f (Ici b)) :
119+ lemma isMinOn_Ici_of_anti_mono (h₀ : AntitoneOn f (Icc a b)) (h₁ : MonotoneOn f (Ici b)) :
120120 IsMinOn f (Ici a) b :=
121- isMaxOn_of_mono_anti_Ici (β := βᵒᵈ) h₀ h₁
121+ isMaxOn_Ici_of_mono_anti (β := βᵒᵈ) h₀ h₁
122122
123123/-- If `f` is monotone on `(-∞, b]` and antitone on `[b,a)`, then the maximum of `f` on `(-∞, a)` is
124124attained at `b`. -/
125- lemma isMaxOn_of_mono_anti_Iio (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn f (Ico b a)) :
125+ lemma isMaxOn_Iio_of_mono_anti (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn f (Ico b a)) :
126126 IsMaxOn f (Iio a) b := by
127127 intro x hx
128128 by_cases! g₀ : x ≤ b
@@ -131,13 +131,13 @@ lemma isMaxOn_of_mono_anti_Iio (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn
131131
132132/-- If `f` is antitone on `(-∞, b]` and monotone on `[b,a)`, then the minimum of `f` on `(-∞, a)` is
133133attained at `b`. -/
134- lemma isMinOn_of_anti_mono_Iio (h₀ : AntitoneOn f (Iic b)) (h₁ : MonotoneOn f (Ico b a)) :
134+ lemma isMinOn_Iio_of_anti_mono (h₀ : AntitoneOn f (Iic b)) (h₁ : MonotoneOn f (Ico b a)) :
135135 IsMinOn f (Iio a) b :=
136- isMaxOn_of_mono_anti_Iio (β := βᵒᵈ) h₀ h₁
136+ isMaxOn_Iio_of_mono_anti (β := βᵒᵈ) h₀ h₁
137137
138138/-- If `f` is monotone on `(-∞, b]` and antitone on `[b,a]`, then the maximum of
139139`f` on `(-∞, a]` is attained at `b`. -/
140- lemma isMaxOn_of_mono_anti_Iic (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn f (Icc b a)) :
140+ lemma isMaxOn_Iic_of_mono_anti (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn f (Icc b a)) :
141141 IsMaxOn f (Iic a) b := by
142142 intro x hx
143143 by_cases! g₀ : x ≤ b
@@ -146,21 +146,21 @@ lemma isMaxOn_of_mono_anti_Iic (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn
146146
147147/-- If `f` is antitone on `(-∞, b]` and monotone on `[b,a]`, then the minimum of `f` on `(-∞, a]` is
148148attained at `b`. -/
149- lemma isMinOn_of_anti_mono_Iic (h₀ : AntitoneOn f (Iic b)) (h₁ : MonotoneOn f (Icc b a)) :
149+ lemma isMinOn_Iic_of_anti_mono (h₀ : AntitoneOn f (Iic b)) (h₁ : MonotoneOn f (Icc b a)) :
150150 IsMinOn f (Iic a) b :=
151- isMaxOn_of_mono_anti_Iic (β := βᵒᵈ) h₀ h₁
151+ isMaxOn_Iic_of_mono_anti (β := βᵒᵈ) h₀ h₁
152152
153153/-- If `f` is monotone on `(-∞, b]` and antitone on `[b,∞)`, then the maximum of `f` is attained
154154at `b`. -/
155- lemma isMaxOn_of_mono_anti_univ (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn f (Ici b)) :
155+ lemma isMaxOn_univ_of_mono_anti (h₀ : MonotoneOn f (Iic b)) (h₁ : AntitoneOn f (Ici b)) :
156156 IsMaxOn f univ b :=
157157 fun x _ => by rcases le_total x b <;> aesop
158158
159159/-- If `f` is antitone on `(-∞, b]` and monotone on `[b,∞)`, then the minimum of `f` is attained
160160at `b`. -/
161- lemma isMinOn_of_anti_mono_univ (h₀ : AntitoneOn f (Iic b)) (h₁ : MonotoneOn f (Ici b)) :
161+ lemma isMinOn_univ_of_anti_mono (h₀ : AntitoneOn f (Iic b)) (h₁ : MonotoneOn f (Ici b)) :
162162 IsMinOn f univ b :=
163- isMaxOn_of_mono_anti_univ (β := βᵒᵈ) h₀ h₁
163+ isMaxOn_univ_of_mono_anti (β := βᵒᵈ) h₀ h₁
164164
165165/-- If `f` is monotone on `(a,b]` and antitone on `[b,c)` then `f` has
166166a local maximum at `b`. -/
@@ -170,12 +170,12 @@ lemma isLocalMax_of_mono_anti
170170 {a b c : α} (g₀ : a < b) (g₁ : b < c) {f : α → β}
171171 (h₀ : MonotoneOn f (Ioc a b))
172172 (h₁ : AntitoneOn f (Ico b c)) : IsLocalMax f b :=
173- isLocalMax_of_mono_anti' (Ioc_mem_nhdsLE g₀) (Ico_mem_nhdsGE g₁) h₀ h₁
173+ (isMaxOn_Ioo_of_mono_anti h₀ h₁).isLocalMax (Ioo_mem_nhds g₀ g₁)
174174
175175/-- If `f` is antitone on `(a,b]` and monotone on `[b,c)` then `f` has
176176a local minimum at `b`. -/
177177lemma isLocalMin_of_anti_mono
178178 {α : Type *} [TopologicalSpace α] [LinearOrder α] [OrderClosedTopology α]
179179 {β : Type *} [Preorder β] {a b c : α} (g₀ : a < b) (g₁ : b < c) {f : α → β}
180180 (h₀ : AntitoneOn f (Ioc a b)) (h₁ : MonotoneOn f (Ico b c)) : IsLocalMin f b :=
181- mem_of_superset (Ioo_mem_nhds g₀ g₁) (fun x hx => by rcases le_total x b <;> aesop)
181+ isLocalMax_of_mono_anti (β := βᵒᵈ) g₀ g₁ h₀ h₁
0 commit comments