MindFormal v1.0.0One Mind

MathFin.Foundations.IndepFreezing

Freezing an independent variable #

If X and Y are independent, the expectation of g(X, Y) can be computed by freezing X at a value x, averaging g(x, Y) over Y alone, and then averaging the result over the law of X:

𝔼[g(X, Y)] = ∫ x, 𝔼[g(x, Y)] d(law X).

This is the freezing lemma. When X = N is a count it is the law of total expectation over the number of jumps, the step every Poisson-mixture computation takes: the Merton jump-diffusion price (BlackScholes/MertonModel.lean) and the compound-Poisson moment generating function (Actuarial/CompoundPoissonMGF.lean) both go through it. With X a jump part of any law it is the mixing formula of BlackScholes/JumpDiffusionMixing.lean: a jump-diffusion call is the Black–Scholes price averaged over the jumps.

The proof composes two Mathlib facts: independence makes the joint law the product of the marginal laws (IndepFun.map_prod_eq_prod_map_map), and an integral against a product measure is an iterated integral (integral_prod).

Its conditional form is Shreve's independence lemma (Stochastic Calculus for Finance II, Lemma 2.3.4): if X is measurable for a σ-algebra 𝓜 and Y is independent of 𝓜, then

𝔼[g(X, Y) | 𝓜] = G(X), with G(x) = 𝔼[g(x, Y)].

Given 𝓜, X is known and Y keeps its law. On an event s ∈ 𝓜 the joint law of (X, Y) is the law of X on s times the law of Y (map_restrict_prodMk_of_indep), so the unconditional computation runs on every such event, which characterizes the conditional expectation. This is the step that prices an option at an intermediate date: the state at t is known, and the increment to maturity is independent of the past (the American put's Brownian transitions, BlackScholes/AmericanPut/Stopping/BrownianTransition.lean, and the jump-diffusion prices of BlackScholes/JumpDiffusionOptionPrices.lean).

Main results #

theorem MathFin.integrable_comp_prodMk_iff_of_indepFun {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {E : Type u_4} {mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} [NormedAddCommGroup E] {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} (hXY : ProbabilityTheory.IndepFun X Y P) (hX : AEMeasurable X P) (hY : AEMeasurable Y P) {g : α × β → E} (hg : MeasureTheory.AEStronglyMeasurable g ((MeasureTheory.Measure.map X P).prod (MeasureTheory.Measure.map Y P))) :

For independent X and Y, g(X, Y) is integrable exactly when g is integrable against the product of the laws of X and Y.

theorem MathFin.integral_comp_prodMk_of_indepFun {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {E : Type u_4} {mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} [NormedAddCommGroup E] {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} [NormedSpace ℝ E] (hXY : ProbabilityTheory.IndepFun X Y P) (hX : AEMeasurable X P) (hY : AEMeasurable Y P) {g : α × β → E} (hg : MeasureTheory.Integrable g ((MeasureTheory.Measure.map X P).prod (MeasureTheory.Measure.map Y P))) :
∫ (ω : Ω), g (X ω, Y ω) ∂P = ∫ (x : α), ∫ (ω : Ω), g (x, Y ω) ∂P ∂MeasureTheory.Measure.map X P

The freezing lemma. For independent X and Y, and g integrable against the product of their laws, 𝔼[g(X, Y)] = ∫ x, 𝔼[g(x, Y)] d(law X).

theorem MathFin.integrable_prod_map_of_countable {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} [Countable α] [MeasurableSingletonClass α] (hY : AEMeasurable Y P) {g : α × β → ℝ} (hgm : ∀ (a : α), Measurable fun (b : β) => g (a, b)) (hint : ∀ (a : α), MeasureTheory.Integrable (fun (ω : Ω) => g (a, Y ω)) P) (hint' : MeasureTheory.Integrable (fun (a : α) => ∫ (ω : Ω), ‖g (a, Y ω)‖ ∂P) (MeasureTheory.Measure.map X P)) :

For a countable-valued X, integrability of g against the product of the laws is checked one value of X at a time: each g(a, Y) integrable, and a ↦ 𝔼‖g(a, Y)‖ integrable against the law of X. Measurability of the sections suffices, since X takes countably many values.

theorem MathFin.integral_comp_prodMk_of_indepFun_of_countable {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} [Countable α] [MeasurableSingletonClass α] (hXY : ProbabilityTheory.IndepFun X Y P) (hX : AEMeasurable X P) (hY : AEMeasurable Y P) {g : α × β → ℝ} (hgm : ∀ (a : α), Measurable fun (b : β) => g (a, b)) (hg0 : ∀ (p : α × β), 0 ≤ g p) (hint : ∀ (a : α), MeasureTheory.Integrable (fun (ω : Ω) => g (a, Y ω)) P) (hint' : MeasureTheory.Integrable (fun (a : α) => ∫ (ω : Ω), g (a, Y ω) ∂P) (MeasureTheory.Measure.map X P)) :
∫ (ω : Ω), g (X ω, Y ω) ∂P = ∫ (a : α), ∫ (ω : Ω), g (a, Y ω) ∂P ∂MeasureTheory.Measure.map X P

The freezing lemma for a countable variable. For a countable-valued X independent of Y and a nonnegative g, if each g(a, Y) is integrable and a ↦ 𝔼[g(a, Y)] is integrable against the law of X, then 𝔼[g(X, Y)] = ∫ a, 𝔼[g(a, Y)] d(law X).

theorem MathFin.integral_comp_of_hasLaw_of_countable {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} [Countable α] [MeasurableSingletonClass α] {ν : MeasureTheory.Measure α} (hX : ProbabilityTheory.HasLaw X ν P) (hY : AEMeasurable Y P) (hXY : ProbabilityTheory.IndepFun X Y P) {F : α → β → ℝ} (hFm : ∀ (a : α), Measurable fun (y : β) => F a y) (hF0 : ∀ (a : α) (y : β), 0 ≤ F a y) {c : α → ℝ} (hint : ∀ (a : α), MeasureTheory.Integrable (fun (ω : Ω) => F a (Y ω)) P) (hc : ∀ (a : α), ∫ (ω : Ω), F a (Y ω) ∂P = c a) (hcint : MeasureTheory.Integrable c ν) :
∫ (ω : Ω), F (X ω) (Y ω) ∂P = ∫ (a : α), c a ∂ν

Integrating out a countable variable. For X with a countable law ν, independent of Y, and a nonnegative F, if each F(a, Y) is integrable with expectation c a and c is integrable against ν, then 𝔼[F(X, Y)] = ∫ a, c a ∂ν. For a Poisson count this is the Poisson-mixture step of a compound-Poisson computation.

The conditional freezing lemma #

theorem MathFin.map_restrict_prodMk_of_indep {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {m mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} (hm : m ≤ mΩ) (hX : Measurable X) (hY : AEMeasurable Y P) (hi : ProbabilityTheory.Indep (MeasurableSpace.comap Y mβ) m P) {s : Set Ω} (hs : MeasurableSet s) :

On an event s of a σ-algebra m for which X is measurable and of which Y is independent, the joint law of (X, Y) under P restricted to s is the law of X on s times the law of Y under P. Normalized by P(s), it says that given s, Y keeps its law and stays independent of X.

theorem MathFin.condExp_comp_prodMk_of_indep {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {E : Type u_4} {m mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} [NormedAddCommGroup E] {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} [NormedSpace ℝ E] [CompleteSpace E] (hm : m ≤ mΩ) (hX : Measurable X) (hY : AEMeasurable Y P) (hi : ProbabilityTheory.Indep (MeasurableSpace.comap Y mβ) m P) {g : α × β → E} (hg : MeasureTheory.StronglyMeasurable g) (hgi : MeasureTheory.Integrable (fun (ω : Ω) => g (X ω, Y ω)) P) :
P[fun (ω : Ω) => g (X ω, Y ω) | m] =ᵐ[P] fun (ω : Ω) => ∫ (y : β), g (X ω, y) ∂MeasureTheory.Measure.map Y P

The conditional freezing lemma (Shreve's independence lemma). If X is measurable for a σ-algebra m and Y is independent of m, then 𝔼[g(X, Y) | m] = G(X) almost surely, with G(x) = ∫ g(x, y) d(law Y)(y), for g strongly measurable and g(X, Y) integrable: given m, X is known and Y keeps its law. On each event of m the joint law of (X, Y) is a product (map_restrict_prodMk_of_indep), so both sides have the same integral over it.

Re-associating independence #

theorem MathFin.map_prod_prod_rotate {α : Type u_2} {β : Type u_3} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {γ : Type u_5} {mγ : MeasurableSpace γ} (μ : MeasureTheory.Measure α) (ν : MeasureTheory.Measure β) (ρ : MeasureTheory.Measure γ) [MeasureTheory.SFinite μ] [MeasureTheory.SFinite ν] [MeasureTheory.SFinite ρ] :
MeasureTheory.Measure.map (fun (p : α × β × γ) => (p.2.1, p.1, p.2.2)) (μ.prod (ν.prod ρ)) = ν.prod (μ.prod ρ)

Moving the middle factor of a triple product measure to the front: (μ ⊗ (ν ⊗ ρ)).map ((a, b, c) ↦ (b, a, c)) = ν ⊗ (μ ⊗ ρ).

theorem MathFin.indepFun_prodMk_of_indepFun_prodMk {Ω : Type u_1} {α : Type u_2} {β : Type u_3} {mΩ : MeasurableSpace Ω} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {P : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure P] {X : Ω → α} {Y : Ω → β} {γ : Type u_5} {mγ : MeasurableSpace γ} {W : Ω → γ} (hX : AEMeasurable X P) (hY : AEMeasurable Y P) (hW : AEMeasurable W P) (hXYW : ProbabilityTheory.IndepFun X (fun (ω : Ω) => (Y ω, W ω)) P) (hYW : ProbabilityTheory.IndepFun Y W P) :
ProbabilityTheory.IndepFun Y (fun (ω : Ω) => (X ω, W ω)) P

Re-associating independence. If X is independent of (Y, W) and Y of W, then Y is independent of (X, W). Either pair of hypotheses says that X, Y and W are mutually independent: the joint law is the product of the three marginal laws.