Documentation

Mathlib.Analysis.Calculus.Deriv.Slope

Derivative as the limit of the slope #

In this file we relate the derivative of a function with its definition from a standard undergraduate course as the limit of the slope (f y - f x) / (y - x) as y tends to 𝓝[β‰ ] x. Since we are talking about functions taking values in a normed space instead of the base field, we use slope f x y = (y - x)⁻¹ β€’ (f y - f x) instead of division.

We also prove some estimates on the upper/lower limits of the slope in terms of the derivative.

For a more detailed overview of one-dimensional derivatives in mathlib, see the module docstring of analysis/calculus/deriv/basic.

Keywords #

derivative, slope

theorem hasDerivAtFilter_iff_tendsto_slope {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} {L : Filter π•œ} :

If the domain has dimension one, then Fréchet derivative is equivalent to the classical definition with a limit. In this version we have to take the limit along the subset -{x}, because for y=x the slope equals zero due to the convention 0⁻¹=0.

theorem hasDerivWithinAt_iff_tendsto_slope {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} {s : Set π•œ} :
HasDerivWithinAt f f' s x ↔ Filter.Tendsto (slope f x) (nhdsWithin x (s \ {x})) (nhds f')
theorem hasDerivWithinAt_iff_tendsto_slope' {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} {s : Set π•œ} (hs : x βˆ‰ s) :
theorem hasDerivAt_iff_tendsto_slope {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} :
theorem hasDerivAt_iff_tendsto_slope_zero {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} :
HasDerivAt f f' x ↔ Filter.Tendsto (fun (t : π•œ) => t⁻¹ β€’ (f (x + t) - f x)) (nhdsWithin 0 {0}ᢜ) (nhds f')
theorem HasDerivAt.tendsto_slope_zero {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} :
HasDerivAt f f' x β†’ Filter.Tendsto (fun (t : π•œ) => t⁻¹ β€’ (f (x + t) - f x)) (nhdsWithin 0 {0}ᢜ) (nhds f')

Alias of the forward direction of hasDerivAt_iff_tendsto_slope_zero.

theorem HasDerivAt.tendsto_slope_zero_right {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} [PartialOrder π•œ] (h : HasDerivAt f f' x) :
Filter.Tendsto (fun (t : π•œ) => t⁻¹ β€’ (f (x + t) - f x)) (nhdsWithin 0 (Set.Ioi 0)) (nhds f')
theorem HasDerivAt.tendsto_slope_zero_left {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] {f : π•œ β†’ F} {f' : F} {x : π•œ} [PartialOrder π•œ] (h : HasDerivAt f f' x) :
Filter.Tendsto (fun (t : π•œ) => t⁻¹ β€’ (f (x + t) - f x)) (nhdsWithin 0 (Set.Iio 0)) (nhds f')
theorem range_derivWithin_subset_closure_span_image {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] (f : π•œ β†’ F) {s : Set π•œ} {t : Set π•œ} (h : s βŠ† closure (s ∩ t)) :
Set.range (derivWithin f s) βŠ† closure ↑(Submodule.span π•œ (f '' t))

Given a set t such that s ∩ t is dense in s, then the range of derivWithin f s is contained in the closure of the submodule spanned by the image of t.

theorem range_deriv_subset_closure_span_image {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] (f : π•œ β†’ F) {t : Set π•œ} (h : Dense t) :
Set.range (deriv f) βŠ† closure ↑(Submodule.span π•œ (f '' t))

Given a dense set t, then the range of deriv f is contained in the closure of the submodule spanned by the image of t.

theorem isSeparable_range_derivWithin {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] [TopologicalSpace.SeparableSpace π•œ] (f : π•œ β†’ F) (s : Set π•œ) :
theorem isSeparable_range_deriv {π•œ : Type u} [NontriviallyNormedField π•œ] {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] [TopologicalSpace.SeparableSpace π•œ] (f : π•œ β†’ F) :

Upper estimates on liminf and limsup #

theorem HasDerivWithinAt.limsup_slope_le {f : ℝ β†’ ℝ} {f' : ℝ} {s : Set ℝ} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' s x) (hr : f' < r) :
βˆ€αΆ  (z : ℝ) in nhdsWithin x (s \ {x}), slope f x z < r
theorem HasDerivWithinAt.limsup_slope_le' {f : ℝ β†’ ℝ} {f' : ℝ} {s : Set ℝ} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' s x) (hs : x βˆ‰ s) (hr : f' < r) :
βˆ€αΆ  (z : ℝ) in nhdsWithin x s, slope f x z < r
theorem HasDerivWithinAt.liminf_right_slope_le {f : ℝ β†’ ℝ} {f' : ℝ} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' (Set.Ici x) x) (hr : f' < r) :
βˆƒαΆ  (z : ℝ) in nhdsWithin x (Set.Ioi x), slope f x z < r
theorem HasDerivWithinAt.limsup_norm_slope_le {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : ℝ β†’ E} {f' : E} {s : Set ℝ} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' s x) (hr : β€–f'β€– < r) :
βˆ€αΆ  (z : ℝ) in nhdsWithin x s, β€–z - x‖⁻¹ * β€–f z - f xβ€– < r

If f has derivative f' within s at x, then for any r > β€–f'β€– the ratio β€–f z - f xβ€– / β€–z - xβ€– is less than r in some neighborhood of x within s. In other words, the limit superior of this ratio as z tends to x along s is less than or equal to β€–f'β€–.

theorem HasDerivWithinAt.limsup_slope_norm_le {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : ℝ β†’ E} {f' : E} {s : Set ℝ} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' s x) (hr : β€–f'β€– < r) :
βˆ€αΆ  (z : ℝ) in nhdsWithin x s, β€–z - x‖⁻¹ * (β€–f zβ€– - β€–f xβ€–) < r

If f has derivative f' within s at x, then for any r > β€–f'β€– the ratio (β€–f zβ€– - β€–f xβ€–) / β€–z - xβ€– is less than r in some neighborhood of x within s. In other words, the limit superior of this ratio as z tends to x along s is less than or equal to β€–f'β€–.

This lemma is a weaker version of HasDerivWithinAt.limsup_norm_slope_le where β€–f zβ€– - β€–f xβ€– is replaced by β€–f z - f xβ€–.

theorem HasDerivWithinAt.liminf_right_norm_slope_le {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : ℝ β†’ E} {f' : E} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' (Set.Ici x) x) (hr : β€–f'β€– < r) :
βˆƒαΆ  (z : ℝ) in nhdsWithin x (Set.Ioi x), β€–z - x‖⁻¹ * β€–f z - f xβ€– < r

If f has derivative f' within (x, +∞) at x, then for any r > β€–f'β€– the ratio β€–f z - f xβ€– / β€–z - xβ€– is frequently less than r as z β†’ x+0. In other words, the limit inferior of this ratio as z tends to x+0 is less than or equal to β€–f'β€–. See also HasDerivWithinAt.limsup_norm_slope_le for a stronger version using limit superior and any set s.

theorem HasDerivWithinAt.liminf_right_slope_norm_le {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : ℝ β†’ E} {f' : E} {x : ℝ} {r : ℝ} (hf : HasDerivWithinAt f f' (Set.Ici x) x) (hr : β€–f'β€– < r) :
βˆƒαΆ  (z : ℝ) in nhdsWithin x (Set.Ioi x), (z - x)⁻¹ * (β€–f zβ€– - β€–f xβ€–) < r

If f has derivative f' within (x, +∞) at x, then for any r > β€–f'β€– the ratio (β€–f zβ€– - β€–f xβ€–) / (z - x) is frequently less than r as z β†’ x+0. In other words, the limit inferior of this ratio as z tends to x+0 is less than or equal to β€–f'β€–.

See also