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.

Tags #

L'Hôpital's rule, L'Hopital's rule

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' : } (hff' : ∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x) (hgg' : ∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x) (hg' : ∀ (x : ), x set.Ioo a bg' x 0) (hfa : filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Ioi a] a) l) :
filter.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' : } (hff' : ∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x) (hgg' : ∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x) (hcf : continuous_on f (set.Ico a b)) (hcg : continuous_on g (set.Ico a b)) (hg' : ∀ (x : ), x set.Ioo a bg' x 0) (hfa : f a = 0) (hga : g a = 0) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Ioi a] a) l) :
filter.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' : } (hff' : ∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x) (hgg' : ∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x) (hg' : ∀ (x : ), x set.Ioo a bg' x 0) (hfb : filter.tendsto f (𝓝[set.Iio b] b) (𝓝 0)) (hgb : filter.tendsto g (𝓝[set.Iio b] b) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Iio b] b) l) :
filter.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' : } (hff' : ∀ (x : ), x set.Ioo a bhas_deriv_at f (f' x) x) (hgg' : ∀ (x : ), x set.Ioo a bhas_deriv_at g (g' x) x) (hcf : continuous_on f (set.Ioc a b)) (hcg : continuous_on g (set.Ioc a b)) (hg' : ∀ (x : ), x set.Ioo a bg' x 0) (hfb : f b = 0) (hgb : g b = 0) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Iio b] b) l) :
filter.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' : } (hff' : ∀ (x : ), x set.Ioi ahas_deriv_at f (f' x) x) (hgg' : ∀ (x : ), x set.Ioi ahas_deriv_at g (g' x) x) (hg' : ∀ (x : ), x set.Ioi ag' x 0) (hftop : filter.tendsto f filter.at_top (𝓝 0)) (hgtop : filter.tendsto g filter.at_top (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) filter.at_top l) :
filter.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' : } (hff' : ∀ (x : ), x set.Iio ahas_deriv_at f (f' x) x) (hgg' : ∀ (x : ), x set.Iio ahas_deriv_at g (g' x) x) (hg' : ∀ (x : ), x set.Iio ag' x 0) (hfbot : filter.tendsto f filter.at_bot (𝓝 0)) (hgbot : filter.tendsto g filter.at_bot (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) filter.at_bot l) :
filter.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 : } (hdf : differentiable_on f (set.Ioo a b)) (hg' : ∀ (x : ), x set.Ioo a bderiv g x 0) (hfa : filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Ioi a] a) l) :
filter.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 : } (hdf : differentiable_on f (set.Ioo a b)) (hcf : continuous_on f (set.Ico a b)) (hcg : continuous_on g (set.Ico a b)) (hg' : ∀ (x : ), x set.Ioo a bderiv g x 0) (hfa : f a = 0) (hga : g a = 0) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Ioi a] a) l) :
filter.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 : } (hdf : differentiable_on f (set.Ioo a b)) (hg' : ∀ (x : ), x set.Ioo a bderiv g x 0) (hfb : filter.tendsto f (𝓝[set.Iio b] b) (𝓝 0)) (hgb : filter.tendsto g (𝓝[set.Iio b] b) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Iio b] b) l) :
filter.tendsto (λ (x : ), f x / g x) (𝓝[set.Iio b] b) l
theorem deriv.lhopital_zero_at_top_on_Ioi {a : } {l : filter } {f g : } (hdf : differentiable_on f (set.Ioi a)) (hg' : ∀ (x : ), x set.Ioi aderiv g x 0) (hftop : filter.tendsto f filter.at_top (𝓝 0)) (hgtop : filter.tendsto g filter.at_top (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_top l) :
filter.tendsto (λ (x : ), f x / g x) filter.at_top l
theorem deriv.lhopital_zero_at_bot_on_Iio {a : } {l : filter } {f g : } (hdf : differentiable_on f (set.Iio a)) (hg' : ∀ (x : ), x set.Iio aderiv g x 0) (hfbot : filter.tendsto f filter.at_bot (𝓝 0)) (hgbot : filter.tendsto g filter.at_bot (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_bot l) :
filter.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' : } (hff' : ∀ᶠ (x : ) in 𝓝[set.Ioi a] a, has_deriv_at f (f' x) x) (hgg' : ∀ᶠ (x : ) in 𝓝[set.Ioi a] a, has_deriv_at g (g' x) x) (hg' : ∀ᶠ (x : ) in 𝓝[set.Ioi a] a, g' x 0) (hfa : filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Ioi a] a) l) :
filter.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' : } (hff' : ∀ᶠ (x : ) in 𝓝[set.Iio a] a, has_deriv_at f (f' x) x) (hgg' : ∀ᶠ (x : ) in 𝓝[set.Iio a] a, has_deriv_at g (g' x) x) (hg' : ∀ᶠ (x : ) in 𝓝[set.Iio a] a, g' x 0) (hfa : filter.tendsto f (𝓝[set.Iio a] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.Iio a] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.Iio a] a) l) :
filter.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' : } (hff' : ∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, has_deriv_at f (f' x) x) (hgg' : ∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, has_deriv_at g (g' x) x) (hg' : ∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, g' x 0) (hfa : filter.tendsto f (𝓝[set.univ \ {a}] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.univ \ {a}] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝[set.univ \ {a}] a) l) :
filter.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' : } (hff' : ∀ᶠ (x : ) in 𝓝 a, has_deriv_at f (f' x) x) (hgg' : ∀ᶠ (x : ) in 𝓝 a, has_deriv_at g (g' x) x) (hg' : ∀ᶠ (x : ) in 𝓝 a, g' x 0) (hfa : filter.tendsto f (𝓝 a) (𝓝 0)) (hga : filter.tendsto g (𝓝 a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (𝓝 a) l) :
filter.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' : } (hff' : ∀ᶠ (x : ) in filter.at_top, has_deriv_at f (f' x) x) (hgg' : ∀ᶠ (x : ) in filter.at_top, has_deriv_at g (g' x) x) (hg' : ∀ᶠ (x : ) in filter.at_top, g' x 0) (hftop : filter.tendsto f filter.at_top (𝓝 0)) (hgtop : filter.tendsto g filter.at_top (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) filter.at_top l) :
filter.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' : } (hff' : ∀ᶠ (x : ) in filter.at_bot, has_deriv_at f (f' x) x) (hgg' : ∀ᶠ (x : ) in filter.at_bot, has_deriv_at g (g' x) x) (hg' : ∀ᶠ (x : ) in filter.at_bot, g' x 0) (hfbot : filter.tendsto f filter.at_bot (𝓝 0)) (hgbot : filter.tendsto g filter.at_bot (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) filter.at_bot l) :
filter.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 : } (hdf : ∀ᶠ (x : ) in 𝓝[set.Ioi a] a, differentiable_at f x) (hg' : ∀ᶠ (x : ) in 𝓝[set.Ioi a] a, deriv g x 0) (hfa : filter.tendsto f (𝓝[set.Ioi a] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.Ioi a] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Ioi a] a) l) :
filter.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 : } (hdf : ∀ᶠ (x : ) in 𝓝[set.Iio a] a, differentiable_at f x) (hg' : ∀ᶠ (x : ) in 𝓝[set.Iio a] a, deriv g x 0) (hfa : filter.tendsto f (𝓝[set.Iio a] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.Iio a] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.Iio a] a) l) :
filter.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 : } (hdf : ∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, differentiable_at f x) (hg' : ∀ᶠ (x : ) in 𝓝[set.univ \ {a}] a, deriv g x 0) (hfa : filter.tendsto f (𝓝[set.univ \ {a}] a) (𝓝 0)) (hga : filter.tendsto g (𝓝[set.univ \ {a}] a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝[set.univ \ {a}] a) l) :
filter.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 : } (hdf : ∀ᶠ (x : ) in 𝓝 a, differentiable_at f x) (hg' : ∀ᶠ (x : ) in 𝓝 a, deriv g x 0) (hfa : filter.tendsto f (𝓝 a) (𝓝 0)) (hga : filter.tendsto g (𝓝 a) (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) (𝓝 a) l) :
filter.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 : } (hdf : ∀ᶠ (x : ) in filter.at_top, differentiable_at f x) (hg' : ∀ᶠ (x : ) in filter.at_top, deriv g x 0) (hftop : filter.tendsto f filter.at_top (𝓝 0)) (hgtop : filter.tendsto g filter.at_top (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_top l) :
filter.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 : } (hdf : ∀ᶠ (x : ) in filter.at_bot, differentiable_at f x) (hg' : ∀ᶠ (x : ) in filter.at_bot, deriv g x 0) (hfbot : filter.tendsto f filter.at_bot (𝓝 0)) (hgbot : filter.tendsto g filter.at_bot (𝓝 0)) (hdiv : filter.tendsto (λ (x : ), deriv f x / deriv g x) filter.at_bot l) :
filter.tendsto (λ (x : ), f x / g x) filter.at_bot l

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