Cramér's theorem in : exponential decay rate of
OpenLargeDeviations.cramer_theorem_realThis is Cramér's large deviation theorem for sums of i.i.d. real random variables, in its classical half-line form.
Let be independent, identically distributed real random variables on a probability space whose logarithmic moment generating function
is finite for every . Let
Theorem (Cramér). For every with and ,
The upper bound is the Chernoff bound; the content of the theorem is the matching lower bound, usually proved by an exponential change of measure (tilting). Cramér's theorem (1938) is the founding result of large deviations theory and the prototype for Sanov's theorem, the Gärtner–Ellis theorem and the large deviation estimates used in statistics, information theory and queueing. It is the half-line case of the large deviation principle of Dembo–Zeitouni, Theorem 2.2.3.
Formalization Note The variables are indexed from : X i is , so ∑ i ∈ Finset.range n, X i ω is . Each X i is measurable, the family is mutually independent (iIndepFun X P), and every X i has the same law as X 0 (IdentDistrib (X i) (X 0) P P). Finiteness of everywhere is the hypothesis that is integrable for every real ; this also makes integrable, so the Bochner integral in the hypothesis is the genuine expectation. is Mathlib's cgf (X 0) P t, which is by definition Real.log of the Bochner integral . The probability is the real number (P {ω | n * a ≤ ∑ i ∈ Finset.range n, X i ω}).toReal and the logarithm is Real.log. Under the hypotheses this probability is at least for , so Lean's junk value never occurs. The rate is the real supremum ⨆ t : ℝ, (t * a - cgf (X 0) P t); under the hypotheses for all (for because , and for by Jensen's inequality and ), so the family is bounded above and this is the genuine finite supremum, not Lean's junk value for unbounded families. At the factor is in Lean, so the term is , which does not affect the limit.
import Mathlib open MeasureTheory ProbabilityTheory Filter Topology
namespace LargeDeviations
/-- **Cramér's theorem in ℝ, half-line form** (Cramér 1938; Durrett, *Probability: Theory and
Examples*, 5th ed., Section 2.7; Dembo–Zeitouni, *Large Deviations Techniques and Applications*,
2nd ed., Theorem 2.2.3 applied to half-lines).
Let `X 0, X 1, …` be i.i.d. real random variables whose moment generating function
`E[exp (t * X 0)]` is finite for every real `t`, so that the log-moment generating function
`Λ t = cgf (X 0) P t = log E[exp (t * X 0)]` is a real number for every `t`. Let
`I a = ⨆ t : ℝ, (t * a - Λ t)`. For every `a` with `E[X 0] < a` and `P (X 0 > a) > 0`,
`(1 / n) * log P (X 0 + ⋯ + X (n - 1) ≥ n * a) → -I a` as `n → ∞`.
Under these hypotheses `P (X 0 + ⋯ + X (n - 1) ≥ n * a) ≥ P (X 0 > a) ^ n > 0` for `n ≥ 1`, so
`Real.log` is the genuine logarithm, and `t * a - Λ t ≤ -log P (X 0 > a)` for all `t`, so the
real `⨆` is the genuine (finite) supremum. At `n = 0` the term is `0`, which does not affect
the limit. -/
theorem cramer_theorem_real {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω}
[IsProbabilityMeasure P] {X : ℕ → Ω → ℝ} (hmeas : ∀ i, Measurable (X i))
(hindep : iIndepFun X P) (hident : ∀ i, IdentDistrib (X i) (X 0) P P)
(hfin : ∀ t : ℝ, Integrable (fun ω => Real.exp (t * X 0 ω)) P)
(a : ℝ) (hmean : ∫ ω, X 0 ω ∂P < a) (hpos : 0 < P {ω | a < X 0 ω}) :
Tendsto
(fun n : ℕ => (1 / (n : ℝ)) *
Real.log ((P {ω | (n : ℝ) * a ≤ ∑ i ∈ Finset.range n, X i ω}).toReal))
atTop (𝓝 (-⨆ t : ℝ, (t * a - cgf (X 0) P t))) := by sorry
end LargeDeviations