@@ -63,6 +63,13 @@ private lemma continuousOn_Ico {f : β β β} {a b : β} (gβ : a < b) (h :
6363 (hdβ : DifferentiableOn β f (Ioo a b)) : ContinuousOn f (Ico a b) :=
6464 Ioo_union_left gβ βΈ hdβ.continuousOn.union_continuousAt isOpen_Ioo (by simp_all)
6565
66+ /-- If `f` is continuous at `a, b` and differentiable on `(a, b)`, then `f` is continuous on
67+ `[a, b]`. -/
68+ private lemma continuousOn_Icc {f : β β β} {a b : β} (gβ : a β€ b)
69+ (ha : ContinuousAt f a) (hb : ContinuousAt f b)
70+ (hdβ : DifferentiableOn β f (Ioo a b)) : ContinuousOn f (Icc a b) :=
71+ Ioo_union_both gβ βΈ hdβ.continuousOn.union_continuousAt isOpen_Ioo (by simp_all)
72+
6673/-- Suppose `a < b < c`, `f : β β β` is continuous at `b`, the derivative `f'` is nonnegative on
6774`(a, b)`, and the derivative `f'` is nonpositive on `(b, c)`. Then `f` attains its maximum on
6875`(a, c)` at `b`. -/
@@ -87,13 +94,11 @@ lemma isMaxOn_of_deriv_Ioc {f : β β β} {a b c : β} (gβ : a < b) (gβ
8794 (hdβ : DifferentiableOn β f (Ioo b c))
8895 (hβ : β x β Ioo a b, 0 β€ deriv f x)
8996 (hβ : β x β Ioo b c, deriv f x β€ 0 ) : IsMaxOn f (Ioc a c) b :=
90- have hIoc : ContinuousOn f (Ioc a b) := Ioo_union_right gβ βΈ
91- hdβ.continuousOn.union_continuousAt isOpen_Ioo (by simp_all)
92- have hIcc : ContinuousOn f (Icc b c) := Ioo_union_both gβ βΈ
93- hdβ.continuousOn.union_continuousAt isOpen_Ioo (by simp_all)
9497 isMaxOn_of_mono_anti_Ioc gβ gβ
95- (monotoneOn_of_deriv_nonneg (convex_Ioc a b) hIoc (by simp_all) (by simp_all))
96- (antitoneOn_of_deriv_nonpos (convex_Icc b c) hIcc (by simp_all) (by simp_all))
98+ (monotoneOn_of_deriv_nonneg (convex_Ioc a b) (continuousOn_Ioc gβ hb hdβ) (by simp_all)
99+ (by simp_all))
100+ (antitoneOn_of_deriv_nonpos (convex_Icc b c) (continuousOn_Icc gβ hb hc hdβ) (by simp_all)
101+ (by simp_all))
97102
98103/-- Suppose `a β€ b < c`, `f : β β β` is continuous at `b` and `c`, the derivative `f'` is
99104nonnegative on `(a,b)`, and the derivative `f'` is nonpositive on `(b,c)`. Then `f` attains its
@@ -104,13 +109,11 @@ lemma isMaxOn_of_deriv_Ico {f : β β β} {a b c : β} (gβ : a β€ b) (g
104109 (hdβ : DifferentiableOn β f (Ioo b c))
105110 (hβ : β x β Ioo a b, 0 β€ deriv f x)
106111 (hβ : β x β Ioo b c, deriv f x β€ 0 ) : IsMaxOn f (Ico a c) b :=
107- have hIcc : ContinuousOn f (Icc a b) := Ioo_union_both gβ βΈ
108- hdβ.continuousOn.union_continuousAt isOpen_Ioo (by simp_all)
109- have hIco : ContinuousOn f (Ico b c) := Ioo_union_left gβ βΈ
110- hdβ.continuousOn.union_continuousAt isOpen_Ioo (by simp_all)
111112 isMaxOn_of_mono_anti_Ico gβ gβ
112- (monotoneOn_of_deriv_nonneg (convex_Icc a b) hIcc (by simp_all) (by simp_all))
113- (antitoneOn_of_deriv_nonpos (convex_Ico b c) hIco (by simp_all) (by simp_all))
113+ (monotoneOn_of_deriv_nonneg (convex_Icc a b) (continuousOn_Icc gβ ha hb hdβ) (by simp_all)
114+ (by simp_all))
115+ (antitoneOn_of_deriv_nonpos (convex_Ico b c) (continuousOn_Ico gβ hb hdβ) (by simp_all)
116+ (by simp_all))
114117
115118/-- The First-Derivative Test from calculus, maxima version.
116119Suppose `a < b < c`, `f : β β β` is continuous at `b`,
0 commit comments