The areas / V15. Real analysis in one variable
Mathlib.Analysis.Calculus.Deriv.MeanValue
36 declarations. Mathlib docs · Source
Mean value theorem
In this file we prove Cauchy's and Lagrange's mean value theorems, and deduce some corollaries.
Cauchy's mean value theorem says that for two functions f and g
that are continuous on [a, b] and are differentiable on (a, b),
there exists a point c ∈ (a, b) such that f' c / g' c = (f b - f a) / (g b - g a).
We formulate this theorem with both sides multiplied by the denominators,
see exists_ratio_hasDerivAt_eq_ratio_slope,
in order to avoid auxiliary conditions like g' c ≠ 0.
Lagrange's mean value theorem, see exists_hasDerivAt_eq_slope,
says that for a function f that is continuous on [a, b] and is differentiable on (a, b),
there exists a point c ∈ (a, b) such that f' c = (f b - f a) / (b - a).
Lagrange's MVT implies that (f b - f a) / (b - a) > C
provided that f' c > C for all c ∈ (a, b), see mul_sub_lt_image_sub_of_lt_deriv,
and other theorems for > / ≥ / < / ≤.
In case C = 0, we deduce that a function with a positive derivative is strictly monotone,
see strictMonoOn_of_deriv_pos and nearby theorems for other types of monotonicity.
We also prove that a real function whose derivative tends to infinity from the right at a point is not differentiable on the right at that point, and similarly differentiability on the left.
Main results
-
exists_ratio_hasDerivAt_eq_ratio_slopeandexists_ratio_deriv_eq_ratio_slope: Cauchy's Mean Value Theorem. -
exists_hasDerivAt_eq_slopeandexists_deriv_eq_slope: Lagrange's Mean Value Theorem. -
domain_mvt: Lagrange's Mean Value Theorem, applied to a segment in a convex domain. -
Convex.image_sub_lt_mul_sub_of_deriv_lt,Convex.mul_sub_lt_image_sub_of_lt_deriv,Convex.image_sub_le_mul_sub_of_deriv_le,Convex.mul_sub_le_image_sub_of_le_deriv, if∀ x, C (</≤/>/≥) (f' x), thenC * (y - x) (</≤/>/≥) (f y - f x)wheneverx < y. -
monotoneOn_of_deriv_nonneg,antitoneOn_of_deriv_nonpos,strictMono_of_deriv_pos,strictAnti_of_deriv_neg: if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. -
convexOn_of_deriv,convexOn_of_deriv2_nonneg: if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex.
Functions [a, b] → ℝ.
Functions f : E → ℝ
theorem exists_ratio_hasDerivAt_eq_ratio_slope E3 #
∀ (f f' : ℝ → ℝ) {a b : ℝ},
a < b →
ContinuousOn f (Set.Icc a b) →
(∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x) →
∀ (g g' : ℝ → ℝ),
ContinuousOn g (Set.Icc a b) →
(∀ x ∈ Set.Ioo a b, HasDerivAt g (g' x) x) → ∃ c ∈ Set.Ioo a b, (g b - g a) * f' c = (f b - f a) * g' c
Cauchy's Mean Value Theorem, HasDerivAt version.
theorem exists_ratio_hasDerivAt_eq_ratio_slope' E1 #
∀ (f f' : ℝ → ℝ) {a b : ℝ},
a < b →
∀ (g g' : ℝ → ℝ) {lfa lga lfb lgb : ℝ},
(∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x) →
(∀ x ∈ Set.Ioo a b, HasDerivAt g (g' x) x) →
Filter.Tendsto f (nhdsWithin a (Set.Ioi a)) (nhds lfa) →
Filter.Tendsto g (nhdsWithin a (Set.Ioi a)) (nhds lga) →
Filter.Tendsto f (nhdsWithin b (Set.Iio b)) (nhds lfb) →
Filter.Tendsto g (nhdsWithin b (Set.Iio b)) (nhds lgb) →
∃ c ∈ Set.Ioo a b, (lgb - lga) * f' c = (lfb - lfa) * g' c
Cauchy's Mean Value Theorem, extended HasDerivAt version.
theorem exists_hasDerivAt_eq_slope E3 #
∀ (f f' : ℝ → ℝ) {a b : ℝ},
a < b →
ContinuousOn f (Set.Icc a b) →
(∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x) → ∃ c ∈ Set.Ioo a b, f' c = (f b - f a) / (b - a)
Lagrange's Mean Value Theorem, HasDerivAt version
theorem exists_ratio_deriv_eq_ratio_slope E3 #
∀ (f : ℝ → ℝ) {a b : ℝ},
a < b →
ContinuousOn f (Set.Icc a b) →
DifferentiableOn ℝ f (Set.Ioo a b) →
∀ (g : ℝ → ℝ),
ContinuousOn g (Set.Icc a b) →
DifferentiableOn ℝ g (Set.Ioo a b) → ∃ c ∈ Set.Ioo a b, (g b - g a) * deriv f c = (f b - f a) * deriv g c
Cauchy's Mean Value Theorem, deriv version.
theorem exists_ratio_deriv_eq_ratio_slope' E1 #
∀ (f : ℝ → ℝ) {a b : ℝ},
a < b →
∀ (g : ℝ → ℝ) {lfa lga lfb lgb : ℝ},
DifferentiableOn ℝ f (Set.Ioo a b) →
DifferentiableOn ℝ g (Set.Ioo a b) →
Filter.Tendsto f (nhdsWithin a (Set.Ioi a)) (nhds lfa) →
Filter.Tendsto g (nhdsWithin a (Set.Ioi a)) (nhds lga) →
Filter.Tendsto f (nhdsWithin b (Set.Iio b)) (nhds lfb) →
Filter.Tendsto g (nhdsWithin b (Set.Iio b)) (nhds lgb) →
∃ c ∈ Set.Ioo a b, (lgb - lga) * deriv f c = (lfb - lfa) * deriv g c
Cauchy's Mean Value Theorem, extended deriv version.
theorem exists_deriv_eq_slope E3 #
∀ (f : ℝ → ℝ) {a b : ℝ},
a < b →
ContinuousOn f (Set.Icc a b) →
DifferentiableOn ℝ f (Set.Ioo a b) → ∃ c ∈ Set.Ioo a b, deriv f c = (f b - f a) / (b - a)
Lagrange's Mean Value Theorem, deriv version.
theorem exists_deriv_eq_slope' E1 #
∀ (f : ℝ → ℝ) {a b : ℝ},
a < b → ContinuousOn f (Set.Icc a b) → DifferentiableOn ℝ f (Set.Ioo a b) → ∃ c ∈ Set.Ioo a b, deriv f c = slope f a b
Lagrange's Mean Value Theorem, deriv version.
theorem not_differentiableWithinAt_of_deriv_tendsto_atTop_Ioi E1 #
∀ (f : ℝ → ℝ) {a : ℝ},
Filter.Tendsto (deriv f) (nhdsWithin a (Set.Ioi a)) Filter.atTop → ¬DifferentiableWithinAt ℝ f (Set.Ioi a) a
A real function whose derivative tends to infinity from the right at a point is not differentiable on the right at that point.
theorem not_differentiableWithinAt_of_deriv_tendsto_atBot_Ioi E1 #
∀ (f : ℝ → ℝ) {a : ℝ},
Filter.Tendsto (deriv f) (nhdsWithin a (Set.Ioi a)) Filter.atBot → ¬DifferentiableWithinAt ℝ f (Set.Ioi a) a
A real function whose derivative tends to minus infinity from the right at a point is not differentiable on the right at that point
theorem not_differentiableWithinAt_of_deriv_tendsto_atBot_Iio E1 #
∀ (f : ℝ → ℝ) {a : ℝ},
Filter.Tendsto (deriv f) (nhdsWithin a (Set.Iio a)) Filter.atBot → ¬DifferentiableWithinAt ℝ f (Set.Iio a) a
A real function whose derivative tends to minus infinity from the left at a point is not differentiable on the left at that point
theorem not_differentiableWithinAt_of_deriv_tendsto_atTop_Iio E1 #
∀ (f : ℝ → ℝ) {a : ℝ},
Filter.Tendsto (deriv f) (nhdsWithin a (Set.Iio a)) Filter.atTop → ¬DifferentiableWithinAt ℝ f (Set.Iio a) a
A real function whose derivative tends to infinity from the left at a point is not differentiable on the left at that point
theorem Convex.mul_sub_lt_image_sub_of_lt_deriv E3 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f : ℝ → ℝ},
ContinuousOn f D →
DifferentiableOn ℝ f (interior D) →
∀ {C : ℝ}, (∀ x ∈ interior D, C < deriv f x) → ∀ x ∈ D, ∀ y ∈ D, x < y → C * (y - x) < f y - f x
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and C < f', then
f grows faster than C * x on D, i.e., C * (y - x) < f y - f x whenever x, y ∈ D,
x < y.
theorem mul_sub_lt_image_sub_of_lt_deriv E1 #
∀ {f : ℝ → ℝ}, Differentiable ℝ f → ∀ {C : ℝ}, (∀ (x : ℝ), C < deriv f x) → ∀ ⦃x y : ℝ⦄, x < y → C * (y - x) < f y - f x
Let f : ℝ → ℝ be a differentiable function. If C < f', then f grows faster than
C * x, i.e., C * (y - x) < f y - f x whenever x < y.
theorem Convex.mul_sub_le_image_sub_of_le_deriv E3 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f : ℝ → ℝ},
ContinuousOn f D →
DifferentiableOn ℝ f (interior D) →
∀ {C : ℝ}, (∀ x ∈ interior D, C ≤ deriv f x) → ∀ x ∈ D, ∀ y ∈ D, x ≤ y → C * (y - x) ≤ f y - f x
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and C ≤ f', then
f grows at least as fast as C * x on D, i.e., C * (y - x) ≤ f y - f x whenever x, y ∈ D,
x ≤ y.
theorem mul_sub_le_image_sub_of_le_deriv E1 #
∀ {f : ℝ → ℝ}, Differentiable ℝ f → ∀ {C : ℝ}, (∀ (x : ℝ), C ≤ deriv f x) → ∀ ⦃x y : ℝ⦄, x ≤ y → C * (y - x) ≤ f y - f x
Let f : ℝ → ℝ be a differentiable function. If C ≤ f', then f grows at least as fast
as C * x, i.e., C * (y - x) ≤ f y - f x whenever x ≤ y.
theorem Convex.image_sub_lt_mul_sub_of_deriv_lt E3 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f : ℝ → ℝ},
ContinuousOn f D →
DifferentiableOn ℝ f (interior D) →
∀ {C : ℝ}, (∀ x ∈ interior D, deriv f x < C) → ∀ x ∈ D, ∀ y ∈ D, x < y → f y - f x < C * (y - x)
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' < C, then
f grows slower than C * x on D, i.e., f y - f x < C * (y - x) whenever x, y ∈ D,
x < y.
theorem image_sub_lt_mul_sub_of_deriv_lt E1 #
∀ {f : ℝ → ℝ}, Differentiable ℝ f → ∀ {C : ℝ}, (∀ (x : ℝ), deriv f x < C) → ∀ ⦃x y : ℝ⦄, x < y → f y - f x < C * (y - x)
Let f : ℝ → ℝ be a differentiable function. If f' < C, then f grows slower than
C * x on D, i.e., f y - f x < C * (y - x) whenever x < y.
theorem Convex.image_sub_le_mul_sub_of_deriv_le E3 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f : ℝ → ℝ},
ContinuousOn f D →
DifferentiableOn ℝ f (interior D) →
∀ {C : ℝ}, (∀ x ∈ interior D, deriv f x ≤ C) → ∀ x ∈ D, ∀ y ∈ D, x ≤ y → f y - f x ≤ C * (y - x)
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' ≤ C, then
f grows at most as fast as C * x on D, i.e., f y - f x ≤ C * (y - x) whenever x, y ∈ D,
x ≤ y.
theorem image_sub_le_mul_sub_of_deriv_le E1 #
∀ {f : ℝ → ℝ}, Differentiable ℝ f → ∀ {C : ℝ}, (∀ (x : ℝ), deriv f x ≤ C) → ∀ ⦃x y : ℝ⦄, x ≤ y → f y - f x ≤ C * (y - x)
Let f : ℝ → ℝ be a differentiable function. If f' ≤ C, then f grows at most as fast
as C * x, i.e., f y - f x ≤ C * (y - x) whenever x ≤ y.
theorem strictMonoOn_of_deriv_pos E1 #
∀ {D : Set ℝ}, Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → (∀ x ∈ interior D, 0 < deriv f x) → StrictMonoOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is positive, then
f is a strictly monotone function on D.
Note that we don't require differentiability explicitly as it already implied by the derivative
being strictly positive.
theorem strictMono_of_deriv_pos E3 #
∀ {f : ℝ → ℝ}, (∀ (x : ℝ), 0 < deriv f x) → StrictMono f
Let f : ℝ → ℝ be a differentiable function. If f' is positive, then
f is a strictly monotone function.
Note that we don't require differentiability explicitly as it already implied by the derivative
being strictly positive.
theorem strictMonoOn_of_hasDerivWithinAt_pos E1 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f f' : ℝ → ℝ},
ContinuousOn f D →
(∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x) → (∀ x ∈ interior D, 0 < f' x) → StrictMonoOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is strictly positive,
then f is a strictly monotone function on D.
theorem strictMono_of_hasDerivAt_pos E1 #
∀ {f f' : ℝ → ℝ}, (∀ (x : ℝ), HasDerivAt f (f' x) x) → (∀ (x : ℝ), 0 < f' x) → StrictMono f
Let f : ℝ → ℝ be a differentiable function. If f' is strictly positive, then
f is a strictly monotone function.
theorem monotoneOn_of_deriv_nonneg E3 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f : ℝ → ℝ},
ContinuousOn f D → DifferentiableOn ℝ f (interior D) → (∀ x ∈ interior D, 0 ≤ deriv f x) → MonotoneOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is nonnegative, then
f is a monotone function on D.
theorem monotone_of_deriv_nonneg E1 #
∀ {f : ℝ → ℝ}, Differentiable ℝ f → (∀ (x : ℝ), 0 ≤ deriv f x) → Monotone f
Let f : ℝ → ℝ be a differentiable function. If f' is nonnegative, then
f is a monotone function.
theorem monotoneOn_of_hasDerivWithinAt_nonneg E1 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f f' : ℝ → ℝ},
ContinuousOn f D →
(∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x) → (∀ x ∈ interior D, 0 ≤ f' x) → MonotoneOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is nonnegative, then
f is a monotone function on D.
theorem monotone_of_hasDerivAt_nonneg E1 #
∀ {f f' : ℝ → ℝ}, (∀ (x : ℝ), HasDerivAt f (f' x) x) → 0 ≤ f' → Monotone f
Let f : ℝ → ℝ be a differentiable function. If f' is nonnegative, then
f is a monotone function.
theorem strictAntiOn_of_deriv_neg E1 #
∀ {D : Set ℝ}, Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → (∀ x ∈ interior D, deriv f x < 0) → StrictAntiOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is negative, then
f is a strictly antitone function on D.
theorem strictAnti_of_deriv_neg E3 #
∀ {f : ℝ → ℝ}, (∀ (x : ℝ), deriv f x < 0) → StrictAnti f
Let f : ℝ → ℝ be a differentiable function. If f' is negative, then
f is a strictly antitone function.
Note that we don't require differentiability explicitly as it already implied by the derivative
being strictly negative.
theorem strictAntiOn_of_hasDerivWithinAt_neg E1 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f f' : ℝ → ℝ},
ContinuousOn f D →
(∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x) → (∀ x ∈ interior D, f' x < 0) → StrictAntiOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is strictly positive,
then f is a strictly monotone function on D.
theorem strictAnti_of_hasDerivAt_neg E1 #
∀ {f f' : ℝ → ℝ}, (∀ (x : ℝ), HasDerivAt f (f' x) x) → (∀ (x : ℝ), f' x < 0) → StrictAnti f
Let f : ℝ → ℝ be a differentiable function. If f' is strictly positive, then
f is a strictly monotone function.
theorem antitoneOn_of_deriv_nonpos E3 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f : ℝ → ℝ},
ContinuousOn f D → DifferentiableOn ℝ f (interior D) → (∀ x ∈ interior D, deriv f x ≤ 0) → AntitoneOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is nonpositive, then
f is an antitone function on D.
theorem antitone_of_deriv_nonpos E1 #
∀ {f : ℝ → ℝ}, Differentiable ℝ f → (∀ (x : ℝ), deriv f x ≤ 0) → Antitone f
Let f : ℝ → ℝ be a differentiable function. If f' is nonpositive, then
f is an antitone function.
theorem antitoneOn_of_hasDerivWithinAt_nonpos E1 #
∀ {D : Set ℝ},
Convex ℝ D →
∀ {f f' : ℝ → ℝ},
ContinuousOn f D →
(∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x) → (∀ x ∈ interior D, f' x ≤ 0) → AntitoneOn f D
Let f be a function continuous on a convex (or, equivalently, connected) subset D
of the real line. If f is differentiable on the interior of D and f' is nonpositive, then
f is an antitone function on D.
theorem antitone_of_hasDerivAt_nonpos E1 #
∀ {f f' : ℝ → ℝ}, (∀ (x : ℝ), HasDerivAt f (f' x) x) → f' ≤ 0 → Antitone f
Let f : ℝ → ℝ be a differentiable function. If f' is nonpositive, then f is an antitone
function.
theorem domain_mvt E3 #
∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {x y : E}
{f' : E → StrongDual ℝ E},
(∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) →
Convex ℝ s → x ∈ s → y ∈ s → ∃ z ∈ segment ℝ x y, f y - f x = (f' z) (y - x)
Lagrange's Mean Value Theorem, applied to convex domains.