@@ -46,8 +46,8 @@ lemma isLocalMax_of_deriv_Ioo {f : ℝ → ℝ} {a b c : ℝ} (g₀ : a < b) (g
46
46
(h : ContinuousAt f b)
47
47
(hd₀ : DifferentiableOn ℝ f (Ioo a b))
48
48
(hd₁ : DifferentiableOn ℝ f (Ioo b c))
49
- (h₀ : ∀ x ∈ Ioo a b, 0 ≤ deriv f x)
50
- (h₁ : ∀ x ∈ Ioo b c, deriv f x ≤ 0 ) : IsLocalMax f b :=
49
+ (h₀ : ∀ x ∈ Ioo a b, 0 ≤ deriv f x)
50
+ (h₁ : ∀ x ∈ Ioo b c, deriv f x ≤ 0 ) : IsLocalMax f b :=
51
51
have hIoc : ContinuousOn f (Ioc a b) :=
52
52
Ioo_union_right g₀ ▸ hd₀.continuousOn.union_continuousAt (isOpen_Ioo (a := a) (b := b))
53
53
(by simp_all)
@@ -65,20 +65,20 @@ lemma isLocalMin_of_deriv_Ioo {f : ℝ → ℝ} {a b c : ℝ}
65
65
(hd₀ : DifferentiableOn ℝ f (Ioo a b)) (hd₁ : DifferentiableOn ℝ f (Ioo b c))
66
66
(h₀ : ∀ x ∈ Ioo a b, deriv f x ≤ 0 )
67
67
(h₁ : ∀ x ∈ Ioo b c, 0 ≤ deriv f x) : IsLocalMin f b := by
68
- have := isLocalMax_of_deriv_Ioo (f := -f) g₀ g₁
69
- (by simp_all) hd₀.neg hd₁.neg
70
- (fun x hx => deriv.neg (f := f) ▸ Left.nonneg_neg_iff.mpr <|h₀ x hx)
71
- (fun x hx => deriv.neg (f := f) ▸ Left.neg_nonpos_iff.mpr <|h₁ x hx)
72
- exact (neg_neg f) ▸ IsLocalMax.neg this
68
+ have := isLocalMax_of_deriv_Ioo (f := -f) g₀ g₁
69
+ (by simp_all) hd₀.neg hd₁.neg
70
+ (fun x hx => deriv.neg (f := f) ▸ Left.nonneg_neg_iff.mpr <|h₀ x hx)
71
+ (fun x hx => deriv.neg (f := f) ▸ Left.neg_nonpos_iff.mpr <|h₁ x hx)
72
+ exact (neg_neg f) ▸ IsLocalMax.neg this
73
73
74
74
/-- The First-Derivative Test from calculus, maxima version,
75
75
expressed in terms of left and right filters. -/
76
76
lemma isLocalMax_of_deriv' {f : ℝ → ℝ} {b : ℝ} (h : ContinuousAt f b)
77
77
(hd₀ : ∀ᶠ x in 𝓝[<] b, DifferentiableAt ℝ f x) (hd₁ : ∀ᶠ x in 𝓝[>] b, DifferentiableAt ℝ f x)
78
- (h₀ : ∀ᶠ x in 𝓝[<] b, 0 ≤ deriv f x) (h₁ : ∀ᶠ x in 𝓝[>] b, deriv f x ≤ 0 ) :
78
+ (h₀ : ∀ᶠ x in 𝓝[<] b, 0 ≤ deriv f x) (h₁ : ∀ᶠ x in 𝓝[>] b, deriv f x ≤ 0 ) :
79
79
IsLocalMax f b := by
80
- obtain ⟨a,ha⟩ := (nhdsWithin_Iio_basis' ⟨b - 1 , sub_one_lt b⟩).eventually_iff.mp <| hd₀.and h₀
81
- obtain ⟨c,hc⟩ := (nhdsWithin_Ioi_basis' ⟨b + 1 , lt_add_one b⟩).eventually_iff.mp <| hd₁.and h₁
80
+ obtain ⟨a, ha⟩ := (nhdsWithin_Iio_basis' ⟨b - 1 , sub_one_lt b⟩).eventually_iff.mp <| hd₀.and h₀
81
+ obtain ⟨c, hc⟩ := (nhdsWithin_Ioi_basis' ⟨b + 1 , lt_add_one b⟩).eventually_iff.mp <| hd₁.and h₁
82
82
exact isLocalMax_of_deriv_Ioo ha.1 hc.1 h
83
83
(fun _ hx => (ha.2 hx).1 .differentiableWithinAt)
84
84
(fun _ hx => (hc.2 hx).1 .differentiableWithinAt)
@@ -88,10 +88,10 @@ lemma isLocalMax_of_deriv' {f : ℝ → ℝ} {b : ℝ} (h : ContinuousAt f b)
88
88
expressed in terms of left and right filters. -/
89
89
lemma isLocalMin_of_deriv' {f : ℝ → ℝ} {b : ℝ} (h : ContinuousAt f b)
90
90
(hd₀ : ∀ᶠ x in 𝓝[<] b, DifferentiableAt ℝ f x) (hd₁ : ∀ᶠ x in 𝓝[>] b, DifferentiableAt ℝ f x)
91
- (h₀ : ∀ᶠ x in 𝓝[<] b, deriv f x ≤ 0 ) (h₁ : ∀ᶠ x in 𝓝[>] b, deriv f x ≥ 0 ) :
91
+ (h₀ : ∀ᶠ x in 𝓝[<] b, deriv f x ≤ 0 ) (h₁ : ∀ᶠ x in 𝓝[>] b, deriv f x ≥ 0 ) :
92
92
IsLocalMin f b := by
93
- obtain ⟨a,ha⟩ := (nhdsWithin_Iio_basis' ⟨b - 1 , sub_one_lt b⟩).eventually_iff.mp <| hd₀.and h₀
94
- obtain ⟨c,hc⟩ := (nhdsWithin_Ioi_basis' ⟨b + 1 , lt_add_one b⟩).eventually_iff.mp <| hd₁.and h₁
93
+ obtain ⟨a, ha⟩ := (nhdsWithin_Iio_basis' ⟨b - 1 , sub_one_lt b⟩).eventually_iff.mp <| hd₀.and h₀
94
+ obtain ⟨c, hc⟩ := (nhdsWithin_Ioi_basis' ⟨b + 1 , lt_add_one b⟩).eventually_iff.mp <| hd₁.and h₁
95
95
exact isLocalMin_of_deriv_Ioo ha.1 hc.1 h
96
96
(fun _ hx => (ha.2 hx).1 .differentiableWithinAt)
97
97
(fun _ hx => (hc.2 hx).1 .differentiableWithinAt)
@@ -100,15 +100,15 @@ lemma isLocalMin_of_deriv' {f : ℝ → ℝ} {b : ℝ} (h : ContinuousAt f b)
100
100
/-- The First Derivative test, maximum version. -/
101
101
theorem isLocalMax_of_deriv {f : ℝ → ℝ} {b : ℝ} (h : ContinuousAt f b)
102
102
(hd : ∀ᶠ x in 𝓝[≠] b, DifferentiableAt ℝ f x)
103
- (h₀ : ∀ᶠ x in 𝓝[<] b, 0 ≤ deriv f x) (h₁ : ∀ᶠ x in 𝓝[>] b, deriv f x ≤ 0 ) :
103
+ (h₀ : ∀ᶠ x in 𝓝[<] b, 0 ≤ deriv f x) (h₁ : ∀ᶠ x in 𝓝[>] b, deriv f x ≤ 0 ) :
104
104
IsLocalMax f b :=
105
105
isLocalMax_of_deriv' h
106
106
(nhds_left'_le_nhds_ne _ (by tauto)) (nhds_right'_le_nhds_ne _ (by tauto)) h₀ h₁
107
107
108
108
/-- The First Derivative test, minimum version. -/
109
109
theorem isLocalMin_of_deriv {f : ℝ → ℝ} {b : ℝ} (h : ContinuousAt f b)
110
110
(hd : ∀ᶠ x in 𝓝[≠] b, DifferentiableAt ℝ f x)
111
- (h₀ : ∀ᶠ x in 𝓝[<] b, deriv f x ≤ 0 ) (h₁ : ∀ᶠ x in 𝓝[>] b, 0 ≤ deriv f x) :
111
+ (h₀ : ∀ᶠ x in 𝓝[<] b, deriv f x ≤ 0 ) (h₁ : ∀ᶠ x in 𝓝[>] b, 0 ≤ deriv f x) :
112
112
IsLocalMin f b :=
113
113
isLocalMin_of_deriv' h
114
114
(nhds_left'_le_nhds_ne _ (by tauto)) (nhds_right'_le_nhds_ne _ (by tauto)) h₀ h₁
0 commit comments