Markov's Inequality

lean4-proofprobabilityvisualization
P(Xa)E[X]aP(X \geq a) \leq \frac{E[X]}{a}

Statement

For any non-negative random variable XX and any a>0a > 0:

P(Xa)E[X]aP(X \geq a) \leq \frac{E[X]}{a}

Equivalently in measure-theoretic form: for a non-negative μ\mu-almost-everywhere measurable ff and ε>0\varepsilon > 0,

εμ{xεf(x)}fdμ\varepsilon \cdot \mu\{x \mid \varepsilon \leq f(x)\} \leq \int f \, d\mu

Visualization

Consider rolling a fair six-sided die, so X{1,2,3,4,5,6}X \in \{1,2,3,4,5,6\} each with probability 1/61/6.

E[X]=1+2+3+4+5+66=216=3.5E[X] = \frac{1+2+3+4+5+6}{6} = \frac{21}{6} = 3.5

Markov's inequality with a=5a = 5:

Bound typeValue
Exact P(X5)P(X \geq 5)2/60.3332/6 \approx 0.333
Markov upper bound E[X]/5E[X]/53.5/5=0.73.5/5 = 0.7

The bound is loose here because the die is not concentrated near zero — Markov is tight only for distributions that put all mass at 00 and aa.

aaExact P(Xa)P(X \geq a)Markov bound
25/60.8335/6 \approx 0.8333.5/2=1.753.5/2 = 1.75 (trivial)
43/6=0.53/6 = 0.53.5/4=0.8753.5/4 = 0.875
52/60.3332/6 \approx 0.3333.5/5=0.73.5/5 = 0.7
61/60.1671/6 \approx 0.1673.5/60.5833.5/6 \approx 0.583

Proof Sketch

Observe that f(x)ε1{fε}(x)f(x) \geq \varepsilon \cdot \mathbf{1}_{\{f \geq \varepsilon\}}(x) pointwise for f0f \geq 0. Integrating both sides:

fdμεμ{fε}\int f \, d\mu \geq \varepsilon \cdot \mu\{f \geq \varepsilon\}

That is the entire proof.

Connections

Markov's inequality is the building block for Chebyshev's InequalityChebyshev's InequalityP(Xμkσ)1k2P(|X - \mu| \geq k\sigma) \leq \frac{1}{k^2}A random variable rarely deviates from its mean by more than a few standard deviationsRead more →, which applies Markov to the squared deviation XE[X]2|X - E[X]|^2. It underlies concentration inequalities throughout probability theory. The measure-theoretic statement connects naturally to the Lebesgue integral machinery used in Hausdorff DimensionHausdorff Dimensiond=logNlog(1/r)d = \frac{\log N}{\log (1/r)}Measuring the fractional dimension of self-similar setsRead more → and Iterated Function SystemsIterated Function SystemsA=i=1Nfi(A)A = \bigcup_{i=1}^{N} f_i(A)Constructing fractals via contractive affine transformationsRead more → via their underlying measure spaces.

Lean4 Proof

The proof below is verified against Mathlib v4.28.0. The key lemma is MeasureTheory.mul_meas_ge_le_lintegral₀ from Mathlib.MeasureTheory.Integral.Lebesgue.Markov.

mul_meas_ge_le_lintegral₀ is proved in Mathlib by the pointwise inequality fε1{fε}f \geq \varepsilon \cdot \mathbf{1}_{\{f \geq \varepsilon\}} and monotone integration.

Lean4 Proof

import Mathlib.MeasureTheory.Integral.Lebesgue.Markov

namespace MoonMath

open MeasureTheory

/-- **Markov's inequality** (ENNReal form).
    For a non-negative AE-measurable function `f` and threshold `ε`,
    `ε * μ {x | ε ≤ f x} ≤ ∫⁻ x, f x ∂μ`. -/
theorem markov_inequality
    {α : Type*} {m : MeasurableSpace α} (μ : Measure α)
    {f : α  0∞} (hf : AEMeasurable f μ) (ε : 0∞) :
    ε * μ {x | ε  f x}  ∫⁻ x, f x ∂μ :=
  mul_meas_ge_le_lintegral₀ hf ε

end MoonMath