The areas / V15. Real analysis in one variable
Mathlib.Analysis.Calculus.LocalExtr.Basic
27 declarations. Mathlib docs · Source
Local extrema of differentiable functions
Main definitions
In a real normed space E we define posTangentConeAt (s : Set E) (x : E).
This would be the same as tangentConeAt ℝ≥0 s x if we had a theory of normed semifields.
This set is used in the proof of Fermat's Theorem (see below), and can be used to formalize
Lagrange multipliers and/or
Karush–Kuhn–Tucker conditions.
Main statements
For each theorem name listed below,
we also prove similar theorems for min, extr (if applicable),
and fderiv/deriv instead of HasFDerivAt/HasDerivAt.
-
IsLocalMaxOn.hasFDerivWithinAt_nonpos:f' y ≤ 0wheneverais a local maximum offons,fhas derivativef'atawithins, andybelongs to the positive tangent cone ofsata. -
IsLocalMaxOn.hasFDerivWithinAt_eq_zero: In the settings of the previous theorem, if bothyand-ybelong to the positive tangent cone, thenf' y = 0. -
IsLocalMax.hasFDerivAt_eq_zero: Fermat's Theorem, the derivative of a differentiable function at a local extremum point equals zero.
Implementation notes
For each mathematical fact we prove several versions of its formalization:
- for maxima and minima;
- using
HasFDeriv*/HasDeriv*orfderiv*/deriv*.
For the fderiv*/deriv* versions we omit the differentiability condition whenever it is possible
due to the fact that fderiv and deriv are defined to be zero for non-differentiable functions.
References
Tags
local extremum, tangent cone, Fermat's Theorem
Positive tangent cone
Fermat's Theorem (vector space)
Fermat's Theorem
theorem posTangentConeAt_mono E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {a : E}, Monotone fun s ↦ posTangentConeAt s a
theorem mem_posTangentConeAt_of_frequently_mem E0 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {s : Set E} {x y : E},
(∃ᶠ (t : ℝ) in nhdsWithin 0 (Set.Ioi 0), x + t • y ∈ s) → y ∈ posTangentConeAt s x
theorem sub_mem_posTangentConeAt_of_segment_subset E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {s : Set E} {x y : E},
segment ℝ x y ⊆ s → y - x ∈ posTangentConeAt s x
theorem mem_posTangentConeAt_of_segment_subset E0 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {s : Set E} {x y : E},
segment ℝ x (x + y) ⊆ s → y ∈ posTangentConeAt s x
If [x -[ℝ] x + y] ⊆ s, then y belongs to the positive tangent cone of s.
theorem posTangentConeAt_univ E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {a : E}, posTangentConeAt Set.univ a = Set.univ
theorem IsLocalMaxOn.hasFDerivWithinAt_nonpos E3 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {s : Set E}
{a y : E}, IsLocalMaxOn f s a → HasFDerivWithinAt f f' s a → y ∈ posTangentConeAt s a → f' y ≤ 0
If f has a local max on s at a, f' is the derivative of f at a within s, and
y belongs to the positive tangent cone of s at a, then f' y ≤ 0.
theorem IsLocalMaxOn.fderivWithin_nonpos E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {a y : E},
IsLocalMaxOn f s a → y ∈ posTangentConeAt s a → (fderivWithin ℝ f s a) y ≤ 0
If f has a local max on s at a and y belongs to the positive tangent cone
of s at a, then f' y ≤ 0.
theorem IsLocalMaxOn.hasFDerivWithinAt_eq_zero E3 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {s : Set E}
{a y : E},
IsLocalMaxOn f s a → HasFDerivWithinAt f f' s a → y ∈ posTangentConeAt s a → -y ∈ posTangentConeAt s a → f' y = 0
If f has a local max on s at a, f' is a derivative of f at a within s, and
both y and -y belong to the positive tangent cone of s at a, then f' y ≤ 0.
theorem IsLocalMaxOn.fderivWithin_eq_zero E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {a y : E},
IsLocalMaxOn f s a → y ∈ posTangentConeAt s a → -y ∈ posTangentConeAt s a → (fderivWithin ℝ f s a) y = 0
If f has a local max on s at a and both y and -y belong to the positive tangent cone
of s at a, then f' y = 0.
theorem IsLocalMinOn.hasFDerivWithinAt_nonneg E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {s : Set E}
{a y : E}, IsLocalMinOn f s a → HasFDerivWithinAt f f' s a → y ∈ posTangentConeAt s a → 0 ≤ f' y
If f has a local min on s at a, f' is the derivative of f at a within s, and
y belongs to the positive tangent cone of s at a, then 0 ≤ f' y.
theorem IsLocalMinOn.fderivWithin_nonneg E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {a y : E},
IsLocalMinOn f s a → y ∈ posTangentConeAt s a → 0 ≤ (fderivWithin ℝ f s a) y
If f has a local min on s at a and y belongs to the positive tangent cone
of s at a, then 0 ≤ f' y.
theorem IsLocalMinOn.hasFDerivWithinAt_eq_zero E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {s : Set E}
{a y : E},
IsLocalMinOn f s a → HasFDerivWithinAt f f' s a → y ∈ posTangentConeAt s a → -y ∈ posTangentConeAt s a → f' y = 0
If f has a local max on s at a, f' is a derivative of f at a within s, and
both y and -y belong to the positive tangent cone of s at a, then f' y ≤ 0.
theorem IsLocalMinOn.fderivWithin_eq_zero E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {a y : E},
IsLocalMinOn f s a → y ∈ posTangentConeAt s a → -y ∈ posTangentConeAt s a → (fderivWithin ℝ f s a) y = 0
If f has a local min on s at a and both y and -y belong to the positive tangent cone
of s at a, then f' y = 0.
theorem IsLocalMin.hasFDerivAt_eq_zero E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {a : E},
IsLocalMin f a → HasFDerivAt f f' a → f' = 0
Fermat's Theorem: the derivative of a function at a local minimum equals zero.
theorem IsLocalMin.fderiv_eq_zero E3 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {a : E},
IsLocalMin f a → fderiv ℝ f a = 0
Fermat's Theorem: the derivative of a function at a local minimum equals zero.
theorem IsLocalMax.hasFDerivAt_eq_zero E3 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {a : E},
IsLocalMax f a → HasFDerivAt f f' a → f' = 0
Fermat's Theorem: the derivative of a function at a local maximum equals zero.
theorem IsLocalMax.fderiv_eq_zero E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {a : E},
IsLocalMax f a → fderiv ℝ f a = 0
Fermat's Theorem: the derivative of a function at a local maximum equals zero.
theorem IsLocalExtr.hasFDerivAt_eq_zero E1 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {f' : StrongDual ℝ E} {a : E},
IsLocalExtr f a → HasFDerivAt f f' a → f' = 0
Fermat's Theorem: the derivative of a function at a local extremum equals zero.
theorem IsLocalExtr.fderiv_eq_zero E3 #
∀ {E : Type u} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {a : E},
IsLocalExtr f a → fderiv ℝ f a = 0
Fermat's Theorem: the derivative of a function at a local extremum equals zero.
theorem one_mem_posTangentConeAt_iff_mem_closure E1 #
∀ {s : Set ℝ} {a : ℝ}, 1 ∈ posTangentConeAt s a ↔ a ∈ closure (Set.Ioi a ∩ s)
theorem one_mem_posTangentConeAt_iff_frequently E1 #
∀ {s : Set ℝ} {a : ℝ}, 1 ∈ posTangentConeAt s a ↔ ∃ᶠ (x : ℝ) in nhdsWithin a (Set.Ioi a), x ∈ s
theorem IsLocalMin.hasDerivAt_eq_zero E1 #
∀ {f : ℝ → ℝ} {f' a : ℝ}, IsLocalMin f a → HasDerivAt f f' a → f' = 0
Fermat's Theorem: the derivative of a function at a local minimum equals zero.
theorem IsLocalMin.deriv_eq_zero E1 #
∀ {f : ℝ → ℝ} {a : ℝ}, IsLocalMin f a → deriv f a = 0
Fermat's Theorem: the derivative of a function at a local minimum equals zero.
theorem IsLocalMax.hasDerivAt_eq_zero E1 #
∀ {f : ℝ → ℝ} {f' a : ℝ}, IsLocalMax f a → HasDerivAt f f' a → f' = 0
Fermat's Theorem: the derivative of a function at a local maximum equals zero.
theorem IsLocalMax.deriv_eq_zero E1 #
∀ {f : ℝ → ℝ} {a : ℝ}, IsLocalMax f a → deriv f a = 0
Fermat's Theorem: the derivative of a function at a local maximum equals zero.
theorem IsLocalExtr.hasDerivAt_eq_zero E1 #
∀ {f : ℝ → ℝ} {f' a : ℝ}, IsLocalExtr f a → HasDerivAt f f' a → f' = 0
Fermat's Theorem: the derivative of a function at a local extremum equals zero.
theorem IsLocalExtr.deriv_eq_zero E3 #
∀ {f : ℝ → ℝ} {a : ℝ}, IsLocalExtr f a → deriv f a = 0
Fermat's Theorem: the derivative of a function at a local extremum equals zero.