Jensen's Inequality
Statement
Let be a convex function and an integrable real-valued random variable. Then:
Equivalently, in finite-weight form: if with and , then:
Visualization
Take (convex) and a fair die: , each with weight .
Mean first, then square:
Square first, then average:
| weight | |||
|---|---|---|---|
| 1 | 1 | 1/6 | 1/6 |
| 2 | 4 | 1/6 | 4/6 |
| 3 | 9 | 1/6 | 9/6 |
| 4 | 16 | 1/6 | 16/6 |
| 5 | 25 | 1/6 | 25/6 |
| 6 | 36 | 1/6 | 36/6 |
Jensen: . The gap is exactly the variance.
Proof Sketch
- Tangent line at the mean. Because is convex, there exists a supporting hyperplane (tangent) at : a constant such that for all .
- Substitute . Pointwise: .
- Take expectations. .
The discrete version follows the same idea with weighted sums replacing integrals.
Connections
Jensen's inequality extends Cauchy–Schwarz InequalityCauchy–Schwarz InequalityThe inner product of two vectors is bounded by the product of their normsRead more → to general convex functions: Cauchy–Schwarz is Jensen applied to with a specific pairing. It also underpins the AM–GM InequalityAM–GM InequalityThe arithmetic mean is always at least as large as the geometric meanRead more →: apply Jensen to (convex) with uniform weights to obtain , i.e., AM GM.
Lean4 Proof
The discrete finite-weight form lives in Mathlib.Analysis.Convex.Jensen as ConvexOn.map_sum_le.
ConvexOn.map_sum_le is proved in Mathlib by induction on the finite set, applying the two-point convexity condition at each step.
Lean4 Proof
import Mathlib.Analysis.Convex.Jensen
namespace MoonMath
open Finset
/-- **Jensen's inequality** (finite discrete form).
For a convex function `φ` on a convex set `s`, non-negative weights summing to 1,
and points in `s`, `φ(Σ w_i x_i) ≤ Σ w_i φ(x_i)`. -/
theorem jensen_discrete {ι : Type*} (t : Finset ι)
{φ : ℝ → ℝ} {s : Set ℝ} (hφ : ConvexOn ℝ s φ)
{w : ι → ℝ} {x : ι → ℝ}
(hw : ∀ i ∈ t, 0 ≤ w i) (hw1 : ∑ i ∈ t, w i = 1)
(hx : ∀ i ∈ t, x i ∈ s) :
φ (∑ i ∈ t, w i • x i) ≤ ∑ i ∈ t, w i • φ (x i) :=
hφ.map_sum_le hw hw1 hx
end MoonMathReferenced by
- Law of Total VarianceProbability
- Linearity of Conditional ExpectationProbability