# mathlibdocumentation

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 explicitly-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 b (f' x) x) (hgg' : ∀ (x : ), x b (g' x) x) (hg' : ∀ (x : ), x bg' x 0) (hfa : (set.Ioi a)) (nhds 0)) (hga : (set.Ioi a)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.Ioi a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Ioi 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 b (f' x) x) (hgg' : ∀ (x : ), x b (g' x) x) (hcf : (set.Ico a b)) (hcg : (set.Ico a b)) (hg' : ∀ (x : ), x bg' x 0) (hfa : f a = 0) (hga : g a = 0) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.Ioi a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Ioi 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 b (f' x) x) (hgg' : ∀ (x : ), x b (g' x) x) (hg' : ∀ (x : ), x bg' x 0) (hfb : (set.Iio b)) (nhds 0)) (hgb : (set.Iio b)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.Iio b)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Iio 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 b (f' x) x) (hgg' : ∀ (x : ), x b (g' x) x) (hcf : (set.Ioc a b)) (hcg : (set.Ioc a b)) (hg' : ∀ (x : ), x bg' x 0) (hfb : f b = 0) (hgb : g b = 0) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.Iio b)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Iio b)) l
theorem has_deriv_at.lhopital_zero_at_top_on_Ioi {a : } {l : filter } {f f' g g' : } (hff' : ∀ (x : ), x (f' x) x) (hgg' : ∀ (x : ), x (g' x) x) (hg' : ∀ (x : ), x g' x 0) (hftop : (nhds 0)) (hgtop : (nhds 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 (f' x) x) (hgg' : ∀ (x : ), x (g' x) x) (hg' : ∀ (x : ), x g' x 0) (hfbot : (nhds 0)) (hgbot : (nhds 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 : (set.Ioo a b)) (hg' : ∀ (x : ), x b x 0) (hfa : (set.Ioi a)) (nhds 0)) (hga : (set.Ioi a)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / x) (set.Ioi a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Ioi a)) l
theorem deriv.lhopital_zero_right_on_Ico {a b : } (hab : a < b) {l : filter } {f g : } (hdf : (set.Ioo a b)) (hcf : (set.Ico a b)) (hcg : (set.Ico a b)) (hg' : ∀ (x : ), x b x 0) (hfa : f a = 0) (hga : g a = 0) (hdiv : filter.tendsto (λ (x : ), x / x) (set.Ioi a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Ioi a)) l
theorem deriv.lhopital_zero_left_on_Ioo {a b : } (hab : a < b) {l : filter } {f g : } (hdf : (set.Ioo a b)) (hg' : ∀ (x : ), x b x 0) (hfb : (set.Iio b)) (nhds 0)) (hgb : (set.Iio b)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / x) (set.Iio b)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Iio b)) l
theorem deriv.lhopital_zero_at_top_on_Ioi {a : } {l : filter } {f g : } (hdf : (set.Ioi a)) (hg' : ∀ (x : ), x x 0) (hftop : (nhds 0)) (hgtop : (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / 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 : (set.Iio a)) (hg' : ∀ (x : ), x x 0) (hfbot : (nhds 0)) (hgbot : (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / 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), (f' x) x) (hgg' : ∀ᶠ (x : ) in (set.Ioi a), (g' x) x) (hg' : ∀ᶠ (x : ) in (set.Ioi a), g' x 0) (hfa : (set.Ioi a)) (nhds 0)) (hga : (set.Ioi a)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.Ioi a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Ioi 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), (f' x) x) (hgg' : ∀ᶠ (x : ) in (set.Iio a), (g' x) x) (hg' : ∀ᶠ (x : ) in (set.Iio a), g' x 0) (hfa : (set.Iio a)) (nhds 0)) (hga : (set.Iio a)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.Iio a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Iio 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}), (f' x) x) (hgg' : ∀ᶠ (x : ) in (set.univ \ {a}), (g' x) x) (hg' : ∀ᶠ (x : ) in (set.univ \ {a}), g' x 0) (hfa : (set.univ \ {a})) (nhds 0)) (hga : (set.univ \ {a})) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (set.univ \ {a})) l) :
filter.tendsto (λ (x : ), f x / g x) (set.univ \ {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 nhds a, (f' x) x) (hgg' : ∀ᶠ (x : ) in nhds a, (g' x) x) (hg' : ∀ᶠ (x : ) in nhds a, g' x 0) (hfa : (nhds a) (nhds 0)) (hga : (nhds a) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), f' x / g' x) (nhds a) l) :
filter.tendsto (λ (x : ), f x / g x) (set.univ \ {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, (f' x) x) (hgg' : ∀ᶠ (x : ) in filter.at_top, (g' x) x) (hg' : ∀ᶠ (x : ) in filter.at_top, g' x 0) (hftop : (nhds 0)) (hgtop : (nhds 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, (f' x) x) (hgg' : ∀ᶠ (x : ) in filter.at_bot, (g' x) x) (hg' : ∀ᶠ (x : ) in filter.at_bot, g' x 0) (hfbot : (nhds 0)) (hgbot : (nhds 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), ) (hg' : ∀ᶠ (x : ) in (set.Ioi a), x 0) (hfa : (set.Ioi a)) (nhds 0)) (hga : (set.Ioi a)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / x) (set.Ioi a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Ioi 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), ) (hg' : ∀ᶠ (x : ) in (set.Iio a), x 0) (hfa : (set.Iio a)) (nhds 0)) (hga : (set.Iio a)) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / x) (set.Iio a)) l) :
filter.tendsto (λ (x : ), f x / g x) (set.Iio 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}), ) (hg' : ∀ᶠ (x : ) in (set.univ \ {a}), x 0) (hfa : (set.univ \ {a})) (nhds 0)) (hga : (set.univ \ {a})) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / x) (set.univ \ {a})) l) :
filter.tendsto (λ (x : ), f x / g x) (set.univ \ {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 nhds a, ) (hg' : ∀ᶠ (x : ) in nhds a, x 0) (hfa : (nhds a) (nhds 0)) (hga : (nhds a) (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / x) (nhds a) l) :
filter.tendsto (λ (x : ), f x / g x) (set.univ \ {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, ) (hg' : ∀ᶠ (x : ) in filter.at_top, x 0) (hftop : (nhds 0)) (hgtop : (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / 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, ) (hg' : ∀ᶠ (x : ) in filter.at_bot, x 0) (hfbot : (nhds 0)) (hgbot : (nhds 0)) (hdiv : filter.tendsto (λ (x : ), x / 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