L'Hôpital's rule
ProvedFamousTheorems.lhopital_zero_nhdsL'Hôpital's rule for the indeterminate form .
Suppose and are differentiable near , that near , and that and as . If has a limit at , then
The rule turns an indeterminate quotient into a quotient of derivatives, which is often tractable. The direction matters: a limit for gives one for , but not conversely — can converge while oscillates. The limit is taken in an arbitrary filter, so the statement covers as well as finite limits. The conclusion is stated on the punctured neighbourhood because nothing is assumed about or themselves; indeed is expected.
The rule appeared in de l'Hôpital's Analyse des Infiniment Petits (1696), the first textbook of differential calculus, but is due to Johann Bernoulli, who had contracted to send his discoveries to l'Hôpital in exchange for a salary.
Formalization note. ∀ᶠ x in 𝓝 a means "for all in some neighbourhood of ", and deriv
is the total derivative, which is junk-valued (zero) where is not differentiable — hence the
explicit DifferentiableAt hypothesis, without which the statement is false. The result is Mathlib's
deriv.lhopital_zero_nhds.
import Mathlib
namespace FamousTheorems
open MeasureTheory ProbabilityTheory Filter
open scoped Real Topology
theorem lhopital_zero_nhds {f g : ℝ → ℝ} {a : ℝ} {l : Filter ℝ}
(hdf : ∀ᶠ x in 𝓝 a, DifferentiableAt ℝ f x)
(hg' : ∀ᶠ x in 𝓝 a, deriv g x ≠ 0)
(hfa : Tendsto f (𝓝 a) (𝓝 0)) (hga : Tendsto g (𝓝 a) (𝓝 0))
(hdiv : Tendsto (fun x => deriv f x / deriv g x) (𝓝 a) l) :
Tendsto (fun x => f x / g x) (𝓝[≠] a) l := by sorry
end FamousTheorems