Stat.Coupling.ProductLossMonotoneCoupling
This module collects the coupling construction and optimality theorem showing that, among all couplings of two real probability measures with finite second moments, the product expectation is largest at the comonotone qu
TailIntegral 3 core · 10 supporting The elementary identity behind Hoeffding's covariance formula is that every real number is the Lebesgue integral of a *signed tail indicator*: a = ∫ s, (𝟙{s < a} - 𝟙{s < 0}) ds. ★ integral_signedTail_prod
The signed tail representation of a real number
The elementary identity behind Hoeffding's covariance formula is that every real number is the Lebesgue integral of a signed tail indicator:
a = ∫ s, (𝟙{s < a} - 𝟙{s < 0}) ds.
Indeed the integrand vanishes outside the interval between 0 and a, where it
equals +1 (if a ≥ 0) or -1 (if a < 0), so the integral is the signed
length a.
This file packages that identity, its integrability, and the corresponding
statements for the product signedTail x s * signedTail y t on ℝ × ℝ, which
represents the product x * y as a two-dimensional Lebesgue integral:
x * y = ∫∫ (𝟙{s < x} - 𝟙{s < 0})(𝟙{t < y} - 𝟙{t < 0}) ds dt.
Together with the L¹ bound ∫∫ |·| = |x| * |y| (which is what makes the
downstream Fubini swap legitimate for L² marginals, via Cauchy–Schwarz), this
is the entire analytic input to hoeffding_cov_identity.
tailInd a s is the indicator 𝟙{s < a}, i.e. 1 when s < a and 0 otherwise, written as the indicator function of the ray Iio a.
signedTail a s = 𝟙{s < a} - 𝟙{s < 0}, the signed tail indicator of a. As a function of s it is +1 on [0, a) when a ≥ 0, -1 on [a, 0) when a < 0, and 0 elsewhere; its Lebesgue integral is exactly a.
Definition (Lean source)
Product tail representation. For any two reals x and y, their product x * y equals the two-dimensional Lebesgue integral of the product of their signed tail indicators, ∫∫ (𝟙{s<x} - 𝟙{s<0})(𝟙{t<y} - 𝟙{t<0}) ds dt.
Formal statement
Proof (Lean source)
10 supporting declarations (lemmas, instances)
-
tailInd_applylemma — The tail indicator equals one below the threshold and zero at or above it.Proof (Lean source)
@[simp] lemma tailInd_apply (a s : ℝ) : tailInd a s = if s < a then 1 else 0 := by simp [tailInd, Set.indicator_apply, Set.mem_Iio] -
signedTail_eq_indicator_sublemma — signedTail a is, as a function of s, the difference of the indicators of the two intervals Ico 0 a and Ico a 0 (at most one of which is nonempty). This is the normal form used to compute its integral and to see it is integrable.hypothesesa :ℝconclusionProof (Lean source)
lemma signedTail_eq_indicator_sub (a : ℝ) : signedTail a = (Ico 0 a).indicator (fun _ => (1 : ℝ)) - (Ico a 0).indicator (fun _ => (1 : ℝ)) := by funext s by_cases hsa : s < a <;> by_cases hs0 : s < 0 <;> simp [signedTail, tailInd_apply, Set.indicator_apply, Set.mem_Ico, hsa, hs0] -
measurable_signedTaillemma — signedTail a is measurable in the tail variable s.Proof (Lean source)
lemma measurable_signedTail (a : ℝ) : Measurable (signedTail a) := by rw [signedTail_eq_indicator_sub] exact (measurable_const.indicator measurableSet_Ico).sub (measurable_const.indicator measurableSet_Ico) -
measurable_signedTail_uncurrylemma — signedTail is jointly measurable in (a, s), since {z | z.2 < z.1} is an open (hence measurable) subset of ℝ × ℝ.conclusionMeasurable (fun z : ℝ × ℝ => signedTail z.1 z.2)Proof (Lean source)
lemma measurable_signedTail_uncurry : Measurable (fun z : ℝ × ℝ => signedTail z.1 z.2) := by have hxa : MeasurableSet {z : ℝ × ℝ | z.2 < z.1} := measurableSet_lt measurable_snd measurable_fst have hx0 : MeasurableSet {z : ℝ × ℝ | z.2 < (0 : ℝ)} := measurableSet_lt measurable_snd measurable_const have h1 : Measurable (fun z : ℝ × ℝ => ({z : ℝ × ℝ | z.2 < z.1}.indicator (fun _ => (1 : ℝ)) z)) := measurable_const.indicator hxa have h0 : Measurable (fun z : ℝ × ℝ => ({z : ℝ × ℝ | z.2 < (0 : ℝ)}.indicator (fun _ => (1 : ℝ)) z)) := measurable_const.indicator hx0 simpa [signedTail, tailInd, Set.indicator_apply, Set.mem_Iio] using h1.fun_sub h0 -
abs_signedTail_le_onelemma — The signed tail indicator is bounded by 1 in absolute value.Proof (Lean source)
lemma abs_signedTail_le_one (a s : ℝ) : |signedTail a s| ≤ 1 := by simp [signedTail, tailInd_apply] split_ifs <;> norm_num -
integrable_signedTaillemma — signedTail a is Lebesgue integrable: it is a bounded function supported on a bounded interval.Proof (Lean source)
lemma integrable_signedTail (a : ℝ) : Integrable (signedTail a) volume := by rw [signedTail_eq_indicator_sub] refine Integrable.sub ?_ ?_ · refine (integrableOn_const (μ := volume) (s := Ico (0 : ℝ) a) (hs := ?_)).integrable_indicator measurableSet_Ico rw [Real.volume_Ico] exact ENNReal.ofReal_ne_top · refine (integrableOn_const (μ := volume) (s := Ico a (0 : ℝ)) (hs := ?_)).integrable_indicator measurableSet_Ico rw [Real.volume_Ico] exact ENNReal.ofReal_ne_top -
integral_signedTaillemma — Signed tail representation. ∫ s, (𝟙{s < a} - 𝟙{s < 0}) ds = a.Proof (Lean source)
lemma integral_signedTail (a : ℝ) : (∫ s : ℝ, signedTail a s ∂volume) = a := by have hrw : (fun s : ℝ => signedTail a s) = fun s : ℝ => (({s : ℝ | s < a}.indicator (fun _ : ℝ => (1 : ℝ)) s) - ({s : ℝ | s < 0}.indicator (fun _ : ℝ => (1 : ℝ)) s)) := rfl rw [hrw] by_cases ha : 0 ≤ a · have hdiff : (fun s : ℝ => ({s : ℝ | s < a}.indicator (fun _ : ℝ => (1 : ℝ)) s) - ({s : ℝ | s < 0}.indicator (fun _ : ℝ => (1 : ℝ)) s)) = (Ico (0 : ℝ) a).indicator (fun _ : ℝ => (1 : ℝ)) := by funext s by_cases hsa : s < a · by_cases hs0 : s < 0 · have hsI : s ∉ Ico (0 : ℝ) a := by simp [Set.mem_Ico, not_le_of_gt hs0] simp [hsa, hs0, hsI] · have hsI : s ∈ Ico (0 : ℝ) a := ⟨le_of_not_gt hs0, hsa⟩ simp [hsa, hs0, hsI] · have hs0 : ¬ s < 0 := fun hs0 => hsa (lt_of_lt_of_le hs0 ha) have hsI : s ∉ Ico (0 : ℝ) a := fun hsI => hsa hsI.2 simp [hsa, hs0, hsI] rw [hdiff] have hint : (∫ s : ℝ, (Ico (0 : ℝ) a).indicator (fun _ : ℝ => (1 : ℝ)) s ∂volume) = volume.real (Ico (0 : ℝ) a) := by exact integral_indicator_one (μ := volume) (s := Ico (0 : ℝ) a) measurableSet_Ico rw [hint, measureReal_def, Real.volume_Ico, ENNReal.toReal_ofReal] · ring · exact sub_nonneg.mpr ha · have hle : a ≤ 0 := le_of_not_ge ha have hdiff : (fun s : ℝ => ({s : ℝ | s < a}.indicator (fun _ : ℝ => (1 : ℝ)) s) - ({s : ℝ | s < 0}.indicator (fun _ : ℝ => (1 : ℝ)) s)) = (Ico a (0 : ℝ)).indicator (fun _ : ℝ => (-1 : ℝ)) := by funext s by_cases hsa : s < a · have hs0 : s < 0 := lt_of_lt_of_le hsa hle have hsI : s ∉ Ico a (0 : ℝ) := fun hsI => (not_lt_of_ge hsI.1) hsa simp [hsa, hs0, hsI] · by_cases hs0 : s < 0 · have hsI : s ∈ Ico a (0 : ℝ) := ⟨le_of_not_gt hsa, hs0⟩ simp [hsa, hs0, hsI] · have hsI : s ∉ Ico a (0 : ℝ) := fun hsI => hs0 hsI.2 simp [hsa, hs0, hsI] rw [hdiff] calc (∫ s : ℝ, (Ico a (0 : ℝ)).indicator (fun _ : ℝ => (-1 : ℝ)) s ∂volume) = volume.real (Ico a (0 : ℝ)) * (-1 : ℝ) := by rw [integral_indicator_const (-1 : ℝ) measurableSet_Ico] simp [smul_eq_mul] _ = a := by rw [measureReal_def, Real.volume_Ico, ENNReal.toReal_ofReal] · ring · exact sub_nonneg.mpr hle -
integral_abs_signedTaillemma — The L¹ norm of the signed tail indicator is |a|: the integrand is ±1 on an interval of length |a|.Proof (Lean source)
lemma integral_abs_signedTail (a : ℝ) : (∫ s : ℝ, |signedTail a s| ∂volume) = |a| := by by_cases ha : 0 ≤ a · have hnonneg : ∀ s : ℝ, 0 ≤ signedTail a s := by intro s simp [signedTail, tailInd_apply] split_ifs <;> linarith have habs : (fun s : ℝ => |signedTail a s|) = signedTail a := by funext s exact abs_of_nonneg (hnonneg s) rw [habs, integral_signedTail, abs_of_nonneg ha] · have hlt : a < 0 := lt_of_not_ge ha have hnonpos : ∀ s : ℝ, signedTail a s ≤ 0 := by intro s simp [signedTail, tailInd_apply] split_ifs <;> linarith have habs : (fun s : ℝ => |signedTail a s|) = fun s : ℝ => -signedTail a s := by funext s exact abs_of_nonpos (hnonpos s) rw [habs, integral_neg, integral_signedTail, abs_of_neg hlt] -
integrable_signedTail_prodlemma — The tensor product (s, t) ↦ signedTail x s * signedTail y t is integrable on ℝ × ℝ for Lebesgue×Lebesgue.hypothesesx y :ℝconclusionProof (Lean source)
lemma integrable_signedTail_prod (x y : ℝ) : Integrable (fun q : ℝ × ℝ => signedTail x q.1 * signedTail y q.2) (volume.prod volume) := (integrable_signedTail x).mul_prod (integrable_signedTail y) -
integral_norm_signedTail_prodlemma — The L¹ norm of the product tail representation is |x| * |y|. This is the domination bound that makes the Fubini swap against an L² coupling valid: its π-integral is E|XY| < ∞ by Cauchy–Schwarz.hypothesesx y :ℝconclusion(∫ q : ℝ × ℝ, ‖signedTail x q.1 * signedTail y q.2‖ ∂(volume.prod volume)) = |x| * |y|Proof (Lean source)
lemma integral_norm_signedTail_prod (x y : ℝ) : (∫ q : ℝ × ℝ, ‖signedTail x q.1 * signedTail y q.2‖ ∂(volume.prod volume)) = |x| * |y| := by simp only [norm_mul, Real.norm_eq_abs] rw [integral_prod_mul (fun s : ℝ => |signedTail x s|) (fun t : ℝ => |signedTail y t|), integral_abs_signedTail, integral_abs_signedTail]
PIT 2 core · 3 supporting This file proves the probability-integral-transform: if μ is a Borel probability measure on ℝ, then pushing the uniform measure on (0,1) through the (lower) quantile function Causalean.Stat.quantile μ recovers μ: (volume ★ quantile_map_uniform
Probability integral transform (PIT) for the quantile function
This file proves the probability-integral-transform: if μ is a Borel
probability measure on ℝ, then pushing the uniform measure on (0,1) through
the (lower) quantile function Causalean.Stat.quantile μ recovers μ:
(volume.restrict (Ioo 0 1)).map (quantile μ) = μ.
The proof rests on the Galois characterisation quantile_le_iff from
Causalean.Stat.Quantile:
quantile μ τ ≤ x ↔ τ ≤ cdf μ x (for interior 0 < τ < 1),
so that, writing U for a Unif(0,1) variable,
P(quantile μ U ≤ x) = P(U ≤ cdf μ x) = cdf μ x, i.e. the pushforward and μ
have the same values on every left-ray Iic x, hence are equal by
Measure.ext_of_Iic.
These are the reusable primitives feeding the comonotone / countermonotone
optimal couplings in Coupling.lean.
The uniform probability measure on the open unit interval (0,1), realised as Lebesgue measure restricted to Ioo 0 1.
Probability integral transform. For a Borel probability measure μ on ℝ, the pushforward of the uniform distribution on (0,1) under μ's quantile function equals μ itself.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
instIsProbabilityMeasure_unifOIinstance — unifOI is a probability measure: volume (Ioo 0 1) = 1.instance instIsProbabilityMeasure_unifOI : IsProbabilityMeasure unifOI := by constructor rw [unifOI, Measure.restrict_apply_univ, Real.volume_Ioo] norm_num -
monotoneOn_quantilelemma — The quantile function is monotone on the open unit interval (0,1) (immediate from quantile_mono, whose hypotheses 0 < τ, τ' < 1 hold throughout the interior).Proof (Lean source)
lemma monotoneOn_quantile (μ : Measure ℝ) : MonotoneOn (quantile μ) (Ioo (0 : ℝ) 1) := by intro a ha b hb hab exact quantile_mono ha.1 hb.2 hab -
aemeasurable_quantile_unifOIlemma — The quantile function is a.e.-measurable with respect to the uniform measure on (0,1); it is monotone there, and a monotone function is measurable.Proof (Lean source)
lemma aemeasurable_quantile_unifOI (μ : Measure ℝ) : AEMeasurable (quantile μ) unifOI := by exact aemeasurable_restrict_of_monotoneOn measurableSet_Ioo (monotoneOn_quantile μ)
Coupling 5 core · 1 supporting A coupling of two real probability measures μ, ν is a probability measure π on ℝ × ℝ whose two marginals are μ and ν. ★ isCoupling_comonotoneCoupling★ isCoupling_countermonotoneCoupling
Couplings and the explicit monotone couplings
A coupling of two real probability measures μ, ν is a probability measure
π on ℝ × ℝ whose two marginals are μ and ν. This file:
* defines IsCoupling π μ ν (probability measure with π.map Prod.fst = μ,
π.map Prod.snd = ν), the Fréchet class Π(μ,ν);
* defines the two extremal couplings built from the quantile transform:
* comonotoneCoupling μ ν — pushforward of Unif(0,1) under
u ↦ (quantile μ u, quantile ν u) (the comonotone / quantile coupling);
* countermonotoneCoupling μ ν — pushforward under
u ↦ (quantile μ u, quantile ν (1 - u)) (the countermonotone coupling);
* proves each is genuinely a coupling of (μ, ν) (marginals via the PIT
quantile_map_uniform, plus that u ↦ 1 - u preserves Unif(0,1)).
These are the optimizers whose optimality is established downstream.
π is a coupling of μ and ν, i.e. a member of the Fréchet class Π(μ, ν), when it is a probability measure on ℝ × ℝ whose first marginal is μ and whose second marginal is ν.
The comonotone (quantile) coupling of μ and ν: the pushforward of the uniform measure on (0,1) under u ↦ (quantile μ u, quantile ν u). Both coordinates are driven by the same uniform draw, giving the maximal positive dependence within Π(μ, ν).
Definition (Lean source)
The countermonotone coupling of μ and ν: the pushforward of the uniform measure on (0,1) under u ↦ (quantile μ u, quantile ν (1 - u)). The reflection u ↦ 1 - u on the second coordinate produces the maximal negative dependence within Π(μ, ν).
Definition (Lean source)
For probability measures μ and ν on the reals, the comonotone coupling of μ and ν is indeed a coupling of the pair, i.e. its two marginals recover μ and ν.
Formal statement
Proof (Lean source)
For probability measures μ and ν on the reals, the countermonotone coupling of μ and ν is indeed a coupling of the pair, i.e. its two marginals recover μ and ν.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
map_one_sub_unifOIlemma — The reflection u ↦ 1 - u preserves the uniform measure on (0,1): unifOI.map (fun u => 1 - u) = unifOI.conclusionunifOI.map (fun u : ℝ => 1 - u) = unifOIProof (Lean source)
lemma map_one_sub_unifOI : unifOI.map (fun u : ℝ => 1 - u) = unifOI := by let f : ℝ → ℝ := fun u => 1 - u have hf : Measurable f := measurable_const.sub measurable_id have hvol : Measure.map f (volume : Measure ℝ) = volume := by have hneg : Measure.map (fun u : ℝ => (-1 : ℝ) * u) (volume : Measure ℝ) = volume := by simpa using (Real.map_volume_mul_left (a := (-1 : ℝ)) (by norm_num)) have hadd : Measure.map (fun u : ℝ => (1 : ℝ) + u) (volume : Measure ℝ) = volume := (measurePreserving_add_left (volume : Measure ℝ) (1 : ℝ)).map_eq calc Measure.map f (volume : Measure ℝ) = Measure.map (fun u : ℝ => (1 : ℝ) + u) (Measure.map (fun u : ℝ => (-1 : ℝ) * u) volume) := by rw [Measure.map_map] · congr 1 funext u dsimp [f] ring · exact (measurable_const.add measurable_id) · exact (measurable_const.mul measurable_id) _ = volume := by rw [hneg, hadd] have hpre : f ⁻¹' Ioo (0 : ℝ) 1 = Ioo (0 : ℝ) 1 := by ext u simp [f] have hrestrict := Measure.restrict_map (μ := (volume : Measure ℝ)) (f := f) hf (s := Ioo (0 : ℝ) 1) measurableSet_Ioo simpa [unifOI, hvol, hpre] using hrestrict.symm
FrechetHoeffding 3 core · 0 supporting For a coupling π ∈ Π(μ, ν) with marginal cdfs F = cdf μ, G = cdf ν, the joint cdf H_π x y = π (Iic x ×ˢ Iic y) obeys the pointwise Fréchet–Hoeffding bounds max (F x + G y - 1) 0 ≤ H_π x y ≤ min (F x) (G y). ★ frechet_hoeffding_upper★ frechet_hoeffding_lower
Fréchet–Hoeffding bounds on the joint cdf
For a coupling π ∈ Π(μ, ν) with marginal cdfs F = cdf μ, G = cdf ν, the
joint cdf H_π x y = π (Iic x ×ˢ Iic y) obeys the pointwise
Fréchet–Hoeffding bounds
max (F x + G y - 1) 0 ≤ H_π x y ≤ min (F x) (G y).
The upper bound is H ≤ F and H ≤ G (monotonicity of measure under the two
projections onto the marginals); the lower bound is inclusion–exclusion on the
complement. Both bounds are attained:
- the comonotone coupling attains the upper bound
H = min (F, G); - the countermonotone coupling attains the lower bound
H = max (F+G-1, 0).
This is the pointwise ordering that, integrated against the Hoeffding covariance identity, yields the optimality of the monotone couplings.
The joint cdf of a measure π on ℝ × ℝ: the mass of the lower-left quadrant Iic x ×ˢ Iic y, as a real number.
Fréchet–Hoeffding upper bound. For a coupling π of the probability measures μ and ν and reals x and y, the joint cdf of π at (x, y) is bounded above by the smaller of the marginal cdfs of μ at x and ν at y.
Formal statement
Proof (Lean source)
Fréchet–Hoeffding lower bound. For a coupling π of the probability measures μ and ν and reals x and y, the joint cdf of π at (x, y) is bounded below by the maximum of 0 and the sum of the marginal cdfs of μ at x and ν at y, minus 1.
Formal statement
Proof (Lean source)
Survival 4 core · 3 supporting For a coupling π ∈ Π(μ, ν) we record the two marginal *survival* functions and the joint survival function SX s = π{p | s < p.1}, SY t = π{p | t < p.2}, S s t = π{p | s < p.1 ∧ t < p.2}. ★ surv_gap_eq
Survival functions of a coupling, and the survival-to-cdf bridge
For a coupling π ∈ Π(μ, ν) we record the two marginal survival functions and
the joint survival function
SX s = π{p | s < p.1}, SY t = π{p | t < p.2}, S s t = π{p | s < p.1 ∧ t < p.2}.
Since π is a probability measure, complementation gives SX = 1 - F and
SY = 1 - G, and inclusion–exclusion on the two half-planes gives
S = 1 - F - G + H_π. The point of this file is the resulting survival gap =
cdf gap identity
S s t - SX s * SY t = H_π s t - F s * G t,
which is what converts the Fubini computation of Cov_π (which naturally
produces survival functions, because the tail indicator 𝟙{s < x} is a
survival indicator) into the Fréchet-gap form used by the optimality theorem.
The first marginal survival function of π: SX s = π{p | s < p.1}.
The second marginal survival function of π: SY t = π{p | t < p.2}.
The joint survival function of π: S s t = π (Ioi s ×ˢ Ioi t), the mass of the open upper-right quadrant.
Survival gap = cdf gap. For a coupling π of two probability measures μ and ν, the gap between the joint and product-of-marginals survival functions of π at (s, t) equals the corresponding gap between the joint and product-of-marginals cumulative distribution functions.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
survFst_eqlemma — The first marginal survival function of a coupling is 1 - F, where F = cdf μ. Proof: Prod.fst ⁻¹' Ioi s is the complement of Prod.fst ⁻¹' Iic s, whose π-mass is μ (Iic s) = F s by h.map_fst.Proof (Lean source)
lemma survFst_eq (h : IsCoupling π μ ν) (s : ℝ) : survFst π s = 1 - cdf μ s := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure haveI : IsProbabilityMeasure μ := by rw [← h.map_fst] exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable haveI : IsProbabilityMeasure ν := by rw [← h.map_snd] exact Measure.isProbabilityMeasure_map measurable_snd.aemeasurable let A : Set (ℝ × ℝ) := Prod.fst ⁻¹' Iic s have hA_meas : MeasurableSet A := measurableSet_Iic.preimage measurable_fst have hsurv : Prod.fst ⁻¹' Ioi s = Aᶜ := by ext p simp [A] have hA : π.real A = cdf μ s := by rw [cdf_eq_real] rw [measureReal_def] congr 1 calc π A = (π.map Prod.fst) (Iic s) := by rw [Measure.map_apply] · exact measurable_fst · exact measurableSet_Iic _ = μ (Iic s) := by rw [h.map_fst] have hcompl := measureReal_add_measureReal_compl (μ := π) hA_meas have huniv : π.real (univ : Set (ℝ × ℝ)) = 1 := by simp [Measure.real] unfold survFst change π.real (Prod.fst ⁻¹' Ioi s) = 1 - cdf μ s rw [hsurv] linarith -
survSnd_eqlemma — The second marginal survival function of a coupling is 1 - G, where G = cdf ν.Proof (Lean source)
lemma survSnd_eq (h : IsCoupling π μ ν) (t : ℝ) : survSnd π t = 1 - cdf ν t := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure haveI : IsProbabilityMeasure μ := by rw [← h.map_fst] exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable haveI : IsProbabilityMeasure ν := by rw [← h.map_snd] exact Measure.isProbabilityMeasure_map measurable_snd.aemeasurable let B : Set (ℝ × ℝ) := Prod.snd ⁻¹' Iic t have hB_meas : MeasurableSet B := measurableSet_Iic.preimage measurable_snd have hsurv : Prod.snd ⁻¹' Ioi t = Bᶜ := by ext p simp [B] have hB : π.real B = cdf ν t := by rw [cdf_eq_real] rw [measureReal_def] congr 1 calc π B = (π.map Prod.snd) (Iic t) := by rw [Measure.map_apply] · exact measurable_snd · exact measurableSet_Iic _ = ν (Iic t) := by rw [h.map_snd] have hcompl := measureReal_add_measureReal_compl (μ := π) hB_meas have huniv : π.real (univ : Set (ℝ × ℝ)) = 1 := by simp [Measure.real] unfold survSnd change π.real (Prod.snd ⁻¹' Ioi t) = 1 - cdf ν t rw [hsurv] linarith -
jointSurv_eqlemma — Inclusion–exclusion. The joint survival function of a coupling is S s t = 1 - F s - G t + H_π s t. Proof: Ioi s ×ˢ Ioi t is the complement of (Prod.fst ⁻¹' Iic s) ∪ (Prod.snd ⁻¹' Iic t), and the mass of that union is F s + G t - H_π s t by measureReal_union_add_inter, the intersection being the lower-left quadrant Iic s ×ˢ Iic t.hypothesesh :IsCoupling π μ νs t :ℝProof (Lean source)
lemma jointSurv_eq (h : IsCoupling π μ ν) (s t : ℝ) : jointSurv π s t = 1 - cdf μ s - cdf ν t + jointCdf π s t := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure haveI : IsProbabilityMeasure μ := by rw [← h.map_fst] exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable haveI : IsProbabilityMeasure ν := by rw [← h.map_snd] exact Measure.isProbabilityMeasure_map measurable_snd.aemeasurable let A : Set (ℝ × ℝ) := Prod.fst ⁻¹' Iic s let B : Set (ℝ × ℝ) := Prod.snd ⁻¹' Iic t have hA_meas : MeasurableSet A := measurableSet_Iic.preimage measurable_fst have hB_meas : MeasurableSet B := measurableSet_Iic.preimage measurable_snd have hsurv : Ioi s ×ˢ Ioi t = (A ∪ B)ᶜ := by ext p simp [A, B, Set.mem_prod] have hquad : Iic s ×ˢ Iic t = A ∩ B := by ext p constructor · intro hp exact ⟨hp.1, hp.2⟩ · intro hp exact ⟨hp.1, hp.2⟩ have hA : π.real A = cdf μ s := by rw [cdf_eq_real] rw [measureReal_def] congr 1 calc π A = (π.map Prod.fst) (Iic s) := by rw [Measure.map_apply] · exact measurable_fst · exact measurableSet_Iic _ = μ (Iic s) := by rw [h.map_fst] have hB : π.real B = cdf ν t := by rw [cdf_eq_real] rw [measureReal_def] congr 1 calc π B = (π.map Prod.snd) (Iic t) := by rw [Measure.map_apply] · exact measurable_snd · exact measurableSet_Iic _ = ν (Iic t) := by rw [h.map_snd] have hAB : π.real (A ∩ B) = jointCdf π s t := by unfold jointCdf change π.real (A ∩ B) = π.real (Iic s ×ˢ Iic t) rw [hquad] have hinc := measureReal_union_add_inter (μ := π) (s := A) (t := B) hB_meas have hcompl := measureReal_add_measureReal_compl (μ := π) (hA_meas.union hB_meas) have huniv : π.real (univ : Set (ℝ × ℝ)) = 1 := by simp [Measure.real] unfold jointSurv change π.real (Ioi s ×ˢ Ioi t) = 1 - cdf μ s - cdf ν t + jointCdf π s t rw [hsurv] linarith
FrechetHoeffdingAttainment 2 core · 2 supporting This file proves that the quantile couplings attain the Fréchet-Hoeffding bounds on the joint distribution function. ★ jointCdf_comonotoneCoupling★ jointCdf_countermonotoneCoupling
Sharp Fréchet-Hoeffding attainability for monotone quantile couplings
This file proves that the quantile couplings attain the Fréchet-Hoeffding bounds on the joint distribution function. The comonotone coupling realizes the upper envelope, and the countermonotone coupling realizes the lower envelope.
The resulting pointwise comparisons are the cdf-order inputs used by the product-expectation optimality theorem.
Comonotone attainment. The joint cdf of the comonotone coupling of two probability measures μ and ν, evaluated at a point (x, y), equals the Fréchet–Hoeffding upper bound min (cdf μ x) (cdf ν y).
Formal statement
Proof (Lean source)
Countermonotone attainment. The joint cdf of the countermonotone coupling of two probability measures μ and ν, evaluated at a point (x, y), equals the Fréchet–Hoeffding lower bound max (cdf μ x + cdf ν y - 1) 0.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
jointCdf_le_comonotonetheorem — Corollary: for any coupling π of (μ, ν), its joint cdf is dominated pointwise by the comonotone joint cdf. This is the pointwise inequality that the covariance identity turns into optimality of E[XY].hypothesesconclusionProof (Lean source)
theorem jointCdf_le_comonotone (h : IsCoupling π μ ν) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (x y : ℝ) : jointCdf π x y ≤ jointCdf (comonotoneCoupling μ ν) x y := by rw [jointCdf_comonotoneCoupling]; exact frechet_hoeffding_upper h x y -
countermonotone_le_jointCdftheorem — Corollary: the countermonotone joint cdf is dominated pointwise by any other coupling's joint cdf.hypothesesconclusionProof (Lean source)
theorem countermonotone_le_jointCdf (h : IsCoupling π μ ν) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (x y : ℝ) : jointCdf (countermonotoneCoupling μ ν) x y ≤ jointCdf π x y := by rw [jointCdf_countermonotoneCoupling]; exact frechet_hoeffding_lower h x y
Hoeffding 1 core · 3 supporting For a coupling π ∈ Π(μ, ν) of two L² real measures, with marginal cdfs F = cdf μ, G = cdf ν and joint cdf H_π, Hoeffding's identity expresses the covariance as a double integral of the gap between the joint cdf and the p ★ hoeffding_cov_identity
Hoeffding's covariance identity
For a coupling π ∈ Π(μ, ν) of two L² real measures, with marginal cdfs
F = cdf μ, G = cdf ν and joint cdf H_π, Hoeffding's identity expresses the
covariance as a double integral of the gap between the joint cdf and the product
of the marginals:
Cov_π(X, Y) = ∫∫ (H_π x y - F x · G y) dx dy,
where Cov_π(X,Y) = E_π[XY] - E[X] E[Y].
Proof structure
Everything is assembled from HoeffdingFubini.lean and Survival.lean:
1. integral_prod_eq_integral_fiber : E_π[XY] = ∫ q, (∫ Φ q p ∂π) dq, where
Φ q p = signedTail p.1 q.1 * signedTail p.2 q.2 is the product tail
representation of p.1 * p.2.
2. fiber_integral_pi : the inner integral is
S - 𝟙{t<0}·SX - 𝟙{s<0}·SY + 𝟙{s<0}·𝟙{t<0} in terms of survival functions.
3. mean_fst_tail, mean_snd_tail and integral_prod_mul : the product of the
means is ∫ q, (SX q.1 - 𝟙{q.1<0})·(SY q.2 - 𝟙{q.2<0}) dq.
4. Subtracting (2) and (3) pointwise, the three inhomogeneous terms cancel and
what remains is the survival gap S - SX·SY.
5. surv_gap_eq : the survival gap equals the Fréchet gap H_π - F·G.
The MemLp 2 hypotheses on the marginals enter exactly once, through
Cauchy–Schwarz, to give E|XY| < ∞ and hence the Fubini domination.
Hoeffding's covariance identity. For a coupling π of μ and ν, where both μ and ν have finite second moment (are L²), the covariance of the coordinates under π equals the double integral, over the plane, of the Fréchet gap between the joint and product cumulative distribution functions, H_π - F·G:
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
fiber_sub_mean_prodlemma — Pointwise cancellation: the fibre integral minus the product of the centred marginal survival functions is exactly the Fréchet gap H_π - F·G.hypothesesh :IsCoupling π μ νq :ℝ × ℝconclusion(∫ p : ℝ × ℝ, signedTail p.1 q.1 * signedTail p.2 q.2 ∂π)Proof (Lean source)
lemma fiber_sub_mean_prod (h : IsCoupling π μ ν) (q : ℝ × ℝ) : (∫ p : ℝ × ℝ, signedTail p.1 q.1 * signedTail p.2 q.2 ∂π) - (survFst π q.1 - tailInd 0 q.1) * (survSnd π q.2 - tailInd 0 q.2) = jointCdf π q.1 q.2 - cdf μ q.1 * cdf ν q.2 := by rw [fiber_integral_pi h q.1 q.2, ← surv_gap_eq h q.1 q.2] ring -
integrable_frechet_gaptheorem — The Fréchet gap H_π - F·G is integrable on ℝ × ℝ for an L² coupling; this is the integrability side-condition consumed by hoeffding_cov_identity and by the monotone comparison of double integrals in Optimality.lean.hypothesesconclusionProof (Lean source)
theorem integrable_frechet_gap (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) (hν : MemLp (fun y : ℝ => y) 2 ν) : Integrable (fun p : ℝ × ℝ => jointCdf π p.1 p.2 - cdf μ p.1 * cdf ν p.2) (volume.prod volume) := by have hfib := integrable_fiber h hμ hν have hmean := (integrable_survFst_sub h hμ).mul_prod (integrable_survSnd_sub h hν) have hsub := hfib.sub hmean refine hsub.congr ?_ filter_upwards with q using fiber_sub_mean_prod h q -
hoeffding_cov_identity_prodtheorem — Hoeffding's covariance identity, product form. For a coupling π of two L² probability measures μ, ν,hypothesesProof (Lean source)
theorem hoeffding_cov_identity_prod (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) (hν : MemLp (fun y : ℝ => y) 2 ν) : (∫ p, p.1 * p.2 ∂π) - (∫ x, x ∂μ) * (∫ y, y ∂ν) = ∫ q : ℝ × ℝ, (jointCdf π q.1 q.2 - cdf μ q.1 * cdf ν q.2) ∂(volume.prod volume) := by rw [integral_prod_eq_integral_fiber h hμ hν, mean_fst_tail h hμ, mean_snd_tail h hν] rw [← integral_prod_mul (fun s : ℝ => survFst π s - tailInd 0 s) (fun t : ℝ => survSnd π t - tailInd 0 t)] rw [← integral_sub (integrable_fiber h hμ hν) ((integrable_survFst_sub h hμ).mul_prod (integrable_survSnd_sub h hν))] exact integral_congr_ae (Filter.Eventually.of_forall (fiber_sub_mean_prod h))
HoeffdingFubini 1 core · 7 supporting Fix a coupling π ∈ Π(μ, ν) with L² marginals. ★ fiber_integral_pi
The Fubini step in Hoeffding's covariance identity
Fix a coupling π ∈ Π(μ, ν) with L² marginals. Writing
Φ q p = signedTail p.1 q.1 * signedTail p.2 q.2 for the product tail
representation of p.1 * p.2 (see TailIntegral.lean), this file performs the
two Fubini swaps that turn the moments of π into Lebesgue integrals of
survival functions:
* integral_prod_eq_integral_fiber : E_π[XY] = ∫∫ (∫ Φ q p ∂π) dq;
* mean_fst_tail / mean_snd_tail : E[X] = ∫ (SX s - 𝟙{s<0}) ds, likewise E[Y];
* fiber_integral_pi : the inner π-integral evaluates, by linearity of the
expectation of a product of tail indicators, to
S s t - 𝟙{t<0}·SX s - 𝟙{s<0}·SY t + 𝟙{s<0}·𝟙{t<0}.
The domination that legitimises both swaps is ∫∫ |Φ q p| dq = |p.1| * |p.2|
(integral_norm_signedTail_prod), whose π-integral is finite by Cauchy–Schwarz
on the L² marginals. Subtracting E[X]·E[Y] (rewritten as a double integral
via integral_prod_mul) cancels the three inhomogeneous terms and leaves the
survival gap S - SX·SY, which is the Fréchet gap by surv_gap_eq.
Orientation convention: all product measures are taken as
(volume.prod volume).prod π, i.e. tail variables first, so that
MeasureTheory.Integrable.integral_prod_left directly yields integrability of
the fibre q ↦ ∫ Φ q p ∂π against Lebesgue×Lebesgue.
Fibre integral. For a coupling π of two probability measures, the π-integral of the product of the two signed tail indicators at thresholds s and t equals the joint survival function of π at (s, t), adjusted by cross terms built from the two marginal survival functions and the sign indicators of s and t.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
coupling_fst_memLplemma — The first coordinate is in L²(π) when μ = π.map Prod.fst has a second moment.hypothesesh :IsCoupling π μ νhμ :MemLp (fun x : ℝ => x) 2 μconclusionMemLp (fun p : ℝ × ℝ => p.1) 2 πProof (Lean source)
lemma coupling_fst_memLp (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) : MemLp (fun p : ℝ × ℝ => p.1) 2 π := by rw [← h.map_fst] at hμ simpa [Function.comp_def] using (hμ.comp_of_map (μ := π) (f := fst) measurable_fst.aemeasurable) -
coupling_snd_memLplemma — The second coordinate is in L²(π) when ν = π.map Prod.snd has a second moment.hypothesesh :IsCoupling π μ νhν :MemLp (fun y : ℝ => y) 2 νconclusionMemLp (fun p : ℝ × ℝ => p.2) 2 πProof (Lean source)
lemma coupling_snd_memLp (h : IsCoupling π μ ν) (hν : MemLp (fun y : ℝ => y) 2 ν) : MemLp (fun p : ℝ × ℝ => p.2) 2 π := by rw [← h.map_snd] at hν simpa [Function.comp_def] using (hν.comp_of_map (μ := π) (f := snd) measurable_snd.aemeasurable) -
coupling_integral_fstlemma — E_π[X] = E_μ[id]: the first moment of a coupling is that of its first marginal.hypothesesh :IsCoupling π μ νhμ :MemLp (fun x : ℝ => x) 2 μconclusion(∫ p : ℝ × ℝ, p.1 ∂π) = ∫ x : ℝ, x ∂μProof (Lean source)
lemma coupling_integral_fst (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) : (∫ p : ℝ × ℝ, p.1 ∂π) = ∫ x : ℝ, x ∂μ := by have hμ' : AEStronglyMeasurable (fun x : ℝ => x) (π.map fst) := by simpa [h.map_fst] using hμ.aestronglyMeasurable rw [← h.map_fst] exact (integral_map measurable_fst.aemeasurable hμ').symm -
coupling_integral_sndlemma — E_π[Y] = E_ν[id]: the first moment of a coupling is that of its second marginal.hypothesesh :IsCoupling π μ νhν :MemLp (fun y : ℝ => y) 2 νconclusion(∫ p : ℝ × ℝ, p.2 ∂π) = ∫ y : ℝ, y ∂νProof (Lean source)
lemma coupling_integral_snd (h : IsCoupling π μ ν) (hν : MemLp (fun y : ℝ => y) 2 ν) : (∫ p : ℝ × ℝ, p.2 ∂π) = ∫ y : ℝ, y ∂ν := by have hν' : AEStronglyMeasurable (fun y : ℝ => y) (π.map snd) := by simpa [h.map_snd] using hν.aestronglyMeasurable rw [← h.map_snd] exact (integral_map measurable_snd.aemeasurable hν').symm -
coupling_integrable_mullemma — XY ∈ L¹(π) by Cauchy–Schwarz from the two L² marginals.hypothesesconclusionIntegrable (fun p : ℝ × ℝ => p.1 * p.2) πProof (Lean source)
lemma coupling_integrable_mul (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) (hν : MemLp (fun y : ℝ => y) 2 ν) : Integrable (fun p : ℝ × ℝ => p.1 * p.2) π := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure exact (coupling_fst_memLp h hμ).integrable_mul (coupling_snd_memLp h hν) -
integral_signedTail_fstlemma — The π-integral of the signed tail indicator of the first coordinate is the marginal survival function minus the constant 𝟙{s<0}: ∫ p, (𝟙{s < p.1} - 𝟙{s < 0}) ∂π = SX s - 𝟙{s < 0}. Uses ∫ p, 𝟙{s < p.1} ∂π = π.real (Prod.fst ⁻¹' Ioi s) and π univ = 1.Proof (Lean source)
lemma integral_signedTail_fst (h : IsCoupling π μ ν) (s : ℝ) : (∫ p : ℝ × ℝ, signedTail p.1 s ∂π) = survFst π s - tailInd 0 s := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure let A : Set (ℝ × ℝ) := Prod.fst ⁻¹' Ioi s have hA : MeasurableSet A := measurableSet_Ioi.preimage measurable_fst have hfun : (fun p : ℝ × ℝ => signedTail p.1 s) = fun p : ℝ × ℝ => A.indicator (fun _ => (1 : ℝ)) p - tailInd 0 s := by funext p by_cases hsp : s < p.1 <;> simp [A, signedTail, tailInd_apply, hsp] have hInd : Integrable (fun p : ℝ × ℝ => A.indicator (fun _ => (1 : ℝ)) p) π := (integrable_const (1 : ℝ)).indicator hA have hConst : Integrable (fun _ : ℝ × ℝ => tailInd 0 s) π := integrable_const _ have hIntA : (∫ p : ℝ × ℝ, A.indicator (fun _ => (1 : ℝ)) p ∂π) = π.real A := by exact (integral_indicator_one (μ := π) (s := A) hA) rw [hfun, integral_sub hInd hConst, hIntA, integral_const] simp [survFst, A, Measure.real, smul_eq_mul] -
integral_signedTail_sndlemma — The π-integral of the signed tail indicator of the second coordinate.Proof (Lean source)
lemma integral_signedTail_snd (h : IsCoupling π μ ν) (t : ℝ) : (∫ p : ℝ × ℝ, signedTail p.2 t ∂π) = survSnd π t - tailInd 0 t := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure let B : Set (ℝ × ℝ) := Prod.snd ⁻¹' Ioi t have hB : MeasurableSet B := measurableSet_Ioi.preimage measurable_snd have hfun : (fun p : ℝ × ℝ => signedTail p.2 t) = fun p : ℝ × ℝ => B.indicator (fun _ => (1 : ℝ)) p - tailInd 0 t := by funext p by_cases htp : t < p.2 <;> simp [B, signedTail, tailInd_apply, htp] have hInd : Integrable (fun p : ℝ × ℝ => B.indicator (fun _ => (1 : ℝ)) p) π := (integrable_const (1 : ℝ)).indicator hB have hConst : Integrable (fun _ : ℝ × ℝ => tailInd 0 t) π := integrable_const _ have hIntB : (∫ p : ℝ × ℝ, B.indicator (fun _ => (1 : ℝ)) p ∂π) = π.real B := by exact (integral_indicator_one (μ := π) (s := B) hB) rw [hfun, integral_sub hInd hConst, hIntB, integral_const] simp [survSnd, B, Measure.real, smul_eq_mul]
HoeffdingFubiniIntegrability 2 core · 7 supporting This file proves the integrability bounds and Fubini swaps that turn the signed tail representation of the product into Lebesgue integrals of fibre expectations and marginal tail means. ★ integrable_bigPhi★ integral_prod_eq_integral_fiber
Integrability and Fubini swaps for Hoeffding's identity
This file proves the integrability bounds and Fubini swaps that turn the signed tail representation of the product into Lebesgue integrals of fibre expectations and marginal tail means.
The output supplies the integrable fibre and mean-tail formulas consumed by the final Hoeffding covariance identity.
The key integrability. Let π be a coupling of μ and ν, where both marginals have finite second moment. Then the product tail kernel Φ q p = signedTail p.1 q.1 * signedTail p.2 q.2 is integrable for the product of Lebesgue measure on the plane with π, i.e. on (volume ⊗ volume) ⊗ π.
Formal statement
Proof (Lean source)
First swap. For a coupling π of μ and ν, where both marginals have finite second moment, the expectation E_π[XY] equals the Lebesgue double integral, over the plane, of the fibre integrals ∫ p, Φ q p ∂π, i.e. ∫ p, p.1 * p.2 ∂π = ∫ q, (∫ p, Φ q p ∂π) dq.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
integrable_tail_fst_prodlemma — The single-coordinate tail kernel is integrable on volume ⊗ π. Domination: ∫ s, |signedTail p.1 s| ds = |p.1|, which is π-integrable since X ∈ L²(π) and π is finite.hypothesesh :IsCoupling π μ νhμ :MemLp (fun x : ℝ => x) 2 μconclusionIntegrable (fun z : ℝ × (ℝ × ℝ) => signedTail z.2.1 z.1) (volume.prod π)Proof (Lean source)
lemma integrable_tail_fst_prod (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) : Integrable (fun z : ℝ × (ℝ × ℝ) => signedTail z.2.1 z.1) (volume.prod π) := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure have hmeas : Measurable (fun z : ℝ × (ℝ × ℝ) => signedTail z.2.1 z.1) := by exact measurable_signedTail_uncurry.comp ((measurable_fst.comp measurable_snd).prodMk measurable_fst) refine (integrable_prod_iff' hmeas.aestronglyMeasurable).2 ?_ constructor · exact Filter.Eventually.of_forall fun p => integrable_signedTail p.1 · have h12 : (1 : ENNReal) ≤ (2 : ENNReal) := by norm_num have hInt : Integrable (fun p : ℝ × ℝ => p.1) π := (coupling_fst_memLp h hμ).integrable h12 simpa [Real.norm_eq_abs, integral_abs_signedTail] using hInt.norm -
integrable_tail_snd_prodlemma — The single-coordinate tail kernel is integrable on volume ⊗ π (second coordinate).hypothesesh :IsCoupling π μ νhν :MemLp (fun y : ℝ => y) 2 νconclusionIntegrable (fun z : ℝ × (ℝ × ℝ) => signedTail z.2.2 z.1) (volume.prod π)Proof (Lean source)
lemma integrable_tail_snd_prod (h : IsCoupling π μ ν) (hν : MemLp (fun y : ℝ => y) 2 ν) : Integrable (fun z : ℝ × (ℝ × ℝ) => signedTail z.2.2 z.1) (volume.prod π) := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure have hmeas : Measurable (fun z : ℝ × (ℝ × ℝ) => signedTail z.2.2 z.1) := by exact measurable_signedTail_uncurry.comp ((measurable_snd.comp measurable_snd).prodMk measurable_fst) refine (integrable_prod_iff' hmeas.aestronglyMeasurable).2 ?_ constructor · exact Filter.Eventually.of_forall fun p => integrable_signedTail p.2 · have h12 : (1 : ENNReal) ≤ (2 : ENNReal) := by norm_num have hInt : Integrable (fun p : ℝ × ℝ => p.2) π := (coupling_snd_memLp h hν).integrable h12 simpa [Real.norm_eq_abs, integral_abs_signedTail] using hInt.norm -
mean_fst_taillemma — Tail formula for the mean. E[X] = ∫ s, (SX s - 𝟙{s<0}) ds, by the same swap on volume ⊗ π using integral_signedTail pointwise.hypothesesh :IsCoupling π μ νhμ :MemLp (fun x : ℝ => x) 2 μProof (Lean source)
lemma mean_fst_tail (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) : (∫ x : ℝ, x ∂μ) = ∫ s : ℝ, (survFst π s - tailInd 0 s) ∂volume := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure calc (∫ x : ℝ, x ∂μ) = ∫ p : ℝ × ℝ, p.1 ∂π := (coupling_integral_fst h hμ).symm _ = ∫ p : ℝ × ℝ, (∫ s : ℝ, signedTail p.1 s ∂volume) ∂π := by apply integral_congr_ae exact Filter.Eventually.of_forall fun p => (integral_signedTail p.1).symm _ = ∫ s : ℝ, (∫ p : ℝ × ℝ, signedTail p.1 s ∂π) ∂volume := by exact (integral_integral_swap (μ := volume) (ν := π) (f := fun s : ℝ => fun p : ℝ × ℝ => signedTail p.1 s) (integrable_tail_fst_prod h hμ)).symm _ = ∫ s : ℝ, (survFst π s - tailInd 0 s) ∂volume := by apply integral_congr_ae exact Filter.Eventually.of_forall fun s => integral_signedTail_fst h s -
mean_snd_taillemma — Tail formula for the mean (second coordinate).hypothesesh :IsCoupling π μ νhν :MemLp (fun y : ℝ => y) 2 νProof (Lean source)
lemma mean_snd_tail (h : IsCoupling π μ ν) (hν : MemLp (fun y : ℝ => y) 2 ν) : (∫ y : ℝ, y ∂ν) = ∫ t : ℝ, (survSnd π t - tailInd 0 t) ∂volume := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure calc (∫ y : ℝ, y ∂ν) = ∫ p : ℝ × ℝ, p.2 ∂π := (coupling_integral_snd h hν).symm _ = ∫ p : ℝ × ℝ, (∫ t : ℝ, signedTail p.2 t ∂volume) ∂π := by apply integral_congr_ae exact Filter.Eventually.of_forall fun p => (integral_signedTail p.2).symm _ = ∫ t : ℝ, (∫ p : ℝ × ℝ, signedTail p.2 t ∂π) ∂volume := by exact (integral_integral_swap (μ := volume) (ν := π) (f := fun t : ℝ => fun p : ℝ × ℝ => signedTail p.2 t) (integrable_tail_snd_prod h hν)).symm _ = ∫ t : ℝ, (survSnd π t - tailInd 0 t) ∂volume := by apply integral_congr_ae exact Filter.Eventually.of_forall fun t => integral_signedTail_snd h t -
integrable_survFst_sublemma — The centred marginal survival function s ↦ SX s - 𝟙{s<0} is Lebesgue integrable (it is E[signedTail X ·], integrable by Integrable.integral_prod_left on integrable_tail_fst_prod).Proof (Lean source)
lemma integrable_survFst_sub (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) : Integrable (fun s : ℝ => survFst π s - tailInd 0 s) volume := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure exact (integrable_tail_fst_prod h hμ).integral_prod_left.congr (Filter.Eventually.of_forall fun s => integral_signedTail_fst h s) -
integrable_survSnd_sublemma — The centred marginal survival function t ↦ SY t - 𝟙{t<0} is Lebesgue integrable.Proof (Lean source)
lemma integrable_survSnd_sub (h : IsCoupling π μ ν) (hν : MemLp (fun y : ℝ => y) 2 ν) : Integrable (fun t : ℝ => survSnd π t - tailInd 0 t) volume := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure exact (integrable_tail_snd_prod h hν).integral_prod_left.congr (Filter.Eventually.of_forall fun t => integral_signedTail_snd h t) -
integrable_fiberlemma — The fibre q ↦ ∫ p, Φ q p ∂π is integrable on ℝ × ℝ, by Integrable.integral_prod_left applied to integrable_bigPhi.hypothesesconclusionIntegrable (fun q : ℝ × ℝ => ∫ p : ℝ × ℝ, signedTail p.1 q.1 * signedTail p.2 q.2 ∂π) (volume.prod volume)Proof (Lean source)
lemma integrable_fiber (h : IsCoupling π μ ν) (hμ : MemLp (fun x : ℝ => x) 2 μ) (hν : MemLp (fun y : ℝ => y) 2 ν) : Integrable (fun q : ℝ × ℝ => ∫ p : ℝ × ℝ, signedTail p.1 q.1 * signedTail p.2 q.2 ∂π) (volume.prod volume) := by letI : IsProbabilityMeasure π := h.isProbabilityMeasure exact (integrable_bigPhi h hμ hν).integral_prod_left
Optimality 3 core · 0 supporting Over the Fréchet class Π(μ, ν) of couplings of two L² real probability measures, the product expectation E_π[XY] = ∫ p, p.1 * p.2 ∂π is: * maximised by the comonotone (quantile) coupling, and * minimised by the countermo ★ product_expectation_le_comonotone★ countermonotone_le_product_expectation★ product_expectation_comonotoneCoupling
Optimality of the monotone couplings (capstone)
Over the Fréchet class Π(μ, ν) of couplings of two L² real probability
measures, the product expectation E_π[XY] = ∫ p, p.1 * p.2 ∂π is:
- maximised by the comonotone (quantile) coupling, and
- minimised by the countermonotone coupling.
The argument: by Hoeffding's identity E_π[XY] = E[X]E[Y] + ∫∫ (H_π - F·G).
The term E[X]E[Y] depends only on the marginals μ, ν, hence is constant
across Π(μ, ν); so extremising E_π[XY] is the same as extremising
∫∫ H_π. The Fréchet–Hoeffding bounds give this pointwise: H_π ≤ H_comonotone
and H_countermonotone ≤ H_π, and monotonicity of the double integral lifts the
pointwise ordering to the integrals.
A closed form for the optimum is also recorded:
E[XY] under the comonotone coupling equals ∫_(0,1) quantile μ · quantile ν.
Upper optimality. For any coupling π of μ and ν, where both marginals have finite second moment, the expectation of the coordinate product under π is at most its expectation under the comonotone (quantile) coupling of μ and ν:
Formal statement
Proof (Lean source)
Lower optimality. For any coupling π of μ and ν, where both marginals have finite second moment, the expectation of the coordinate product under π is at least its expectation under the countermonotone coupling of μ and ν:
Formal statement
Proof (Lean source)
Closed form of the optimum. For two probability measures μ and ν, each with finite second moment, the expectation of the coordinate product under the comonotone (quantile) coupling of μ and ν equals the integral, over (0,1), of the product of their quantile functions: