Martingale Definition
Statement
A stochastic process adapted to a filtration is a martingale with respect to measure if:
- is integrable for all , and
- For all : a.s.
Equivalently (in the Mathlib formulation): is strongly adapted to and the conditional expectation property holds for all .
Visualization
Symmetric random walk. Let be i.i.d. with , and set , .
| Possible values of | ||
|---|---|---|
| (same computation) | ||
| for any |
The next step always goes with equal probability, so the expected value of given is exactly . The walk is "fair": no drift.
+2 *
|
+1 * *
| |
0 * | * | *
| |
-1 * *
|
-2 *
n: 0 1 2 3
Each level is equally likely to go up or down, keeping the expected future value equal to the present.
Proof Sketch
Verification for the random walk:
- Adaptedness. is -measurable by definition.
- Integrability. .
- Martingale property. .
- By Linearity of Conditional ExpectationLinearity of Conditional ExpectationConditional expectation is linear: E[aX+bY|G] = aE[X|G] + bE[Y|G] almost surelyRead more →: .
- Since is -measurable: a.s.
- Since is independent of : .
- Conclusion: a.s.
Connections
The martingale definition builds on Linearity of Conditional ExpectationLinearity of Conditional ExpectationConditional expectation is linear: E[aX+bY|G] = aE[X|G] + bE[Y|G] almost surelyRead more → (step 3 above) and Law of Total ExpectationLaw of Total ExpectationThe expectation of X equals the expectation of its conditional expectation: E[X] = E[E[X|Y]]Read more → (taking unconditional expectations of both sides gives for all — martingales have constant mean). The Borel-Cantelli LemmaBorel-Cantelli LemmaIf the sum of event probabilities is finite, almost surely only finitely many events occurRead more → is proved using a martingale-based argument in the second BC lemma (Mathlib's ProbabilityTheory.measure_limsup_eq_one).
Lean4 Proof
Mathlib defines MeasureTheory.Martingale in Mathlib.Probability.Martingale.Basic. The symmetric random walk is a martingale via martingale_condExp.
martingale_condExp is proved in Mathlib using condExp_condExp_of_le (tower property) to verify for .
Lean4 Proof
import Mathlib.Probability.Martingale.Basic
namespace MoonMath
open MeasureTheory
/-- The process `fun i => μ[f | ℱ i]` (the tower of conditional expectations of `f`) is
always a martingale. This establishes the pattern: martingales arise whenever you take
conditional expectations of an integrable target. -/
theorem condExp_martingale {Ω E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[CompleteSpace E] {m0 : MeasurableSpace Ω} (μ : Measure Ω) {ι : Type*} [Preorder ι]
(ℱ : Filtration ι m0) (f : Ω → E) :
Martingale (fun i => μ[f | ℱ i]) ℱ μ :=
martingale_condExp f ℱ μ
/-- Martingales have constant mean: for i ≤ j, E[M_j] = E[M_i]. -/
theorem martingale_const_mean {Ω E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[CompleteSpace E] {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ι : Type*} [Preorder ι]
{ℱ : Filtration ι m0} {f : ι → Ω → E} (hf : Martingale f ℱ μ)
{i j : ι} (hij : i ≤ j) [SigmaFiniteFiltration μ ℱ] :
∫ ω, f j ω ∂μ = ∫ ω, f i ω ∂μ :=
hf.setIntegral_eq hij MeasurableSet.univ
end MoonMathReferenced by
- Law of Total ExpectationProbability
- Linearity of Conditional ExpectationProbability