mathlib documentation

analysis.calculus.lhopital

L'Hôpital's rule for 0/0 indeterminate forms

In this file, we prove several forms of "L'Hopital's rule" for computing 0/0 indeterminate forms. The proof of has_deriv_at.lhopital_zero_right_on_Ioo is based on the one given in the corresponding Wikibooks chapter, and all other statements are derived from this one by composing by carefully chosen functions.

Note that the filter f'/g' tends to isn't required to be one of 𝓝 a, at_top or at_bot. In fact, we give a slightly stronger statement by allowing it to be any filter on .

Each statement is available in a has_deriv_at form and a deriv form, which is denoted by each statement being in either the has_deriv_at or the deriv namespace.

Interval-based versions

We start by proving statements where all conditions (derivability, g' ≠ 0) have to be satisfied on an explicitely-provided interval.

theorem has_deriv_at.lhopital_zero_right_on_Ioo {a b : } (hab : a < b) {l : filter } {f f' g g' : } :
(∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x)(∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x)(∀ (x : ), x set.Ioo a bg' x 0)filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Ioi a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Ioi a] a) l

theorem has_deriv_at.lhopital_zero_right_on_Ico {a b : } (hab : a < b) {l : filter } {f f' g g' : } :
(∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x)(∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x)continuous_on f (set.Ico a b)continuous_on g (set.Ico a b)(∀ (x : ), x set.Ioo a bg' x 0)f a = 0g a = 0filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Ioi a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Ioi a] a) l

theorem has_deriv_at.lhopital_zero_left_on_Ioo {a b : } (hab : a < b) {l : filter } {f f' g g' : } :
(∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x)(∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x)(∀ (x : ), x set.Ioo a bg' x 0)filter.tendsto f (𝓝[set.Iio b] b) (𝓝 0)filter.tendsto g (𝓝[set.Iio b] b) (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Iio b] b) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Iio b] b) l

theorem has_deriv_at.lhopital_zero_left_on_Ioc {a b : } (hab : a < b) {l : filter } {f f' g g' : } :
(∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x)(∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x)continuous_on f (set.Ioc a b)continuous_on g (set.Ioc a b)(∀ (x : ), x set.Ioo a bg' x 0)f b = 0g b = 0filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Iio b] b) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Iio b] b) l

theorem has_deriv_at.lhopital_zero_at_top_on_Ioi {a : } {l : filter } {f f' g g' : } :
(∀ (x : ), x set.Ioi ahas_deriv_at f (f' x) x)(∀ (x : ), x set.Ioi ahas_deriv_at g (g' x) x)(∀ (x : ), x set.Ioi ag' x 0)filter.tendsto f filter.at_top (𝓝 0)filter.tendsto g filter.at_top (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) filter.at_top lfilter.tendsto (λ (x : ), f x / g x) filter.at_top l

theorem has_deriv_at.lhopital_zero_at_bot_on_Iio {a : } {l : filter } {f f' g g' : } :
(∀ (x : ), x set.Iio ahas_deriv_at f (f' x) x)(∀ (x : ), x set.Iio ahas_deriv_at g (g' x) x)(∀ (x : ), x set.Iio ag' x 0)filter.tendsto f filter.at_bot (𝓝 0)filter.tendsto g filter.at_bot (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) filter.at_bot lfilter.tendsto (λ (x : ), f x / g x) filter.at_bot l

theorem deriv.lhopital_zero_right_on_Ioo {a b : } (hab : a < b) {l : filter } {f g : } :
differentiable_on f (set.Ioo a b)(∀ (x : ), x set.Ioo a bderiv g x 0)filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Ioi a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Ioi a] a) l

theorem deriv.lhopital_zero_right_on_Ico {a b : } (hab : a < b) {l : filter } {f g : } :
differentiable_on f (set.Ioo a b)continuous_on f (set.Ico a b)continuous_on g (set.Ico a b)(∀ (x : ), x set.Ioo a bderiv g x 0)f a = 0g a = 0filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Ioi a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Ioi a] a) l

theorem deriv.lhopital_zero_left_on_Ioo {a b : } (hab : a < b) {l : filter } {f g : } :
differentiable_on f (set.Ioo a b)(∀ (x : ), x set.Ioo a bderiv g x 0)filter.tendsto f (𝓝[set.Iio b] b) (𝓝 0)filter.tendsto g (𝓝[set.Iio b] b) (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Iio b] b) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Iio b] b) l

theorem deriv.lhopital_zero_at_top_on_Ioi {a : } {l : filter } {f g : } :
differentiable_on f (set.Ioi a)(∀ (x : ), x set.Ioi aderiv g x 0)filter.tendsto f filter.at_top (𝓝 0)filter.tendsto g filter.at_top (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_top lfilter.tendsto (λ (x : ), f x / g x) filter.at_top l

theorem deriv.lhopital_zero_at_bot_on_Iio {a : } {l : filter } {f g : } :
differentiable_on f (set.Iio a)(∀ (x : ), x set.Iio aderiv g x 0)filter.tendsto f filter.at_bot (𝓝 0)filter.tendsto g filter.at_bot (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_bot lfilter.tendsto (λ (x : ), f x / g x) filter.at_bot l

Generic versions

The following statements no longer any explicit interval, as they only require conditions holding eventually.

theorem has_deriv_at.lhopital_zero_nhds_right {a : } {l : filter } {f f' g g' : } :
(∀ᶠ (x : ) in 𝓝[set.Ioi a] a, has_deriv_at f (f' x) x)(∀ᶠ (x : ) in 𝓝[set.Ioi a] a, has_deriv_at g (g' x) x)(∀ᶠ (x : ) in 𝓝[set.Ioi a] a, g' x 0)filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Ioi a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Ioi a] a) l

L'Hôpital's rule for approaching a real from the right, has_deriv_at version

theorem has_deriv_at.lhopital_zero_nhds_left {a : } {l : filter } {f f' g g' : } :
(∀ᶠ (x : ) in 𝓝[set.Iio a] a, has_deriv_at f (f' x) x)(∀ᶠ (x : ) in 𝓝[set.Iio a] a, has_deriv_at g (g' x) x)(∀ᶠ (x : ) in 𝓝[set.Iio a] a, g' x 0)filter.tendsto f (𝓝[set.Iio a] a) (𝓝 0)filter.tendsto g (𝓝[set.Iio a] a) (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Iio a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Iio a] a) l

L'Hôpital's rule for approaching a real from the left, has_deriv_at version

theorem has_deriv_at.lhopital_zero_nhds' {a : } {l : filter } {f f' g g' : } :
(∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, has_deriv_at f (f' x) x)(∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, has_deriv_at g (g' x) x)(∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, g' x 0)filter.tendsto f (𝓝[set.univ \ {a}] a) (𝓝 0)filter.tendsto g (𝓝[set.univ \ {a}] a) (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.univ \ {a}] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.univ \ {a}] a) l

L'Hôpital's rule for approaching a real, has_deriv_at version. This does not require anything about the situation at a

theorem has_deriv_at.lhopital_zero_nhds {a : } {l : filter } {f f' g g' : } :
(∀ᶠ (x : ) in 𝓝 a, has_deriv_at f (f' x) x)(∀ᶠ (x : ) in 𝓝 a, has_deriv_at g (g' x) x)(∀ᶠ (x : ) in 𝓝 a, g' x 0)filter.tendsto f (𝓝 a) (𝓝 0)filter.tendsto g (𝓝 a) (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) (𝓝 a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.univ \ {a}] a) l

L'Hôpital's rule for approaching a real, has_deriv_at version

theorem has_deriv_at.lhopital_zero_at_top {l : filter } {f f' g g' : } :
(∀ᶠ (x : ) in filter.at_top, has_deriv_at f (f' x) x)(∀ᶠ (x : ) in filter.at_top, has_deriv_at g (g' x) x)(∀ᶠ (x : ) in filter.at_top, g' x 0)filter.tendsto f filter.at_top (𝓝 0)filter.tendsto g filter.at_top (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) filter.at_top lfilter.tendsto (λ (x : ), f x / g x) filter.at_top l

L'Hôpital's rule for approaching +∞, has_deriv_at version

theorem has_deriv_at.lhopital_zero_at_bot {l : filter } {f f' g g' : } :
(∀ᶠ (x : ) in filter.at_bot, has_deriv_at f (f' x) x)(∀ᶠ (x : ) in filter.at_bot, has_deriv_at g (g' x) x)(∀ᶠ (x : ) in filter.at_bot, g' x 0)filter.tendsto f filter.at_bot (𝓝 0)filter.tendsto g filter.at_bot (𝓝 0)filter.tendsto (λ (x : ), f' x / g' x) filter.at_bot lfilter.tendsto (λ (x : ), f x / g x) filter.at_bot l

L'Hôpital's rule for approaching -∞, has_deriv_at version

theorem deriv.lhopital_zero_nhds_right {a : } {l : filter } {f g : } :
(∀ᶠ (x : ) in 𝓝[set.Ioi a] a, differentiable_at f x)(∀ᶠ (x : ) in 𝓝[set.Ioi a] a, deriv g x 0)filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Ioi a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Ioi a] a) l

L'Hôpital's rule for approaching a real from the right, deriv version

theorem deriv.lhopital_zero_nhds_left {a : } {l : filter } {f g : } :
(∀ᶠ (x : ) in 𝓝[set.Iio a] a, differentiable_at f x)(∀ᶠ (x : ) in 𝓝[set.Iio a] a, deriv g x 0)filter.tendsto f (𝓝[set.Iio a] a) (𝓝 0)filter.tendsto g (𝓝[set.Iio a] a) (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Iio a] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.Iio a] a) l

L'Hôpital's rule for approaching a real from the left, deriv version

theorem deriv.lhopital_zero_nhds' {a : } {l : filter } {f g : } :
(∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, differentiable_at f x)(∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, deriv g x 0)filter.tendsto f (𝓝[set.univ \ {a}] a) (𝓝 0)filter.tendsto g (𝓝[set.univ \ {a}] a) (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.univ \ {a}] a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.univ \ {a}] a) l

L'Hôpital's rule for approaching a real, deriv version. This does not require anything about the situation at a

theorem deriv.lhopital_zero_nhds {a : } {l : filter } {f g : } :
(∀ᶠ (x : ) in 𝓝 a, differentiable_at f x)(∀ᶠ (x : ) in 𝓝 a, deriv g x 0)filter.tendsto f (𝓝 a) (𝓝 0)filter.tendsto g (𝓝 a) (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝 a) lfilter.tendsto (λ (x : ), f x / g x) (𝓝[set.univ \ {a}] a) l

L'Hôpital's rule for approaching a real, deriv version

theorem deriv.lhopital_zero_at_top {l : filter } {f g : } :
(∀ᶠ (x : ) in filter.at_top, differentiable_at f x)(∀ᶠ (x : ) in filter.at_top, deriv g x 0)filter.tendsto f filter.at_top (𝓝 0)filter.tendsto g filter.at_top (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_top lfilter.tendsto (λ (x : ), f x / g x) filter.at_top l

L'Hôpital's rule for approaching +∞, deriv version

theorem deriv.lhopital_zero_at_bot {l : filter } {f g : } :
(∀ᶠ (x : ) in filter.at_bot, differentiable_at f x)(∀ᶠ (x : ) in filter.at_bot, deriv g x 0)filter.tendsto f filter.at_bot (𝓝 0)filter.tendsto g filter.at_bot (𝓝 0)filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_bot lfilter.tendsto (λ (x : ), f x / g x) filter.at_bot l

L'Hôpital's rule for approaching -∞, deriv version