Mathlib.Probability.Poisson­Add­One­Poincare

Poisson concentration infrastructure: scalar add-one Poincaré variance bounds, countable-series and L² closure tools, and tensorization over finite independent Poisson products.

L2­Closure 3 core · 6 supporting This module isolates the pairwise product-law variance identity and the graph-norm density of finite-support truncations for the forward add-one operator. ★ variance_eq_half_integral_prod_sq_sub

Finite-support and L² closure for Poisson sequences

This module isolates the pairwise product-law variance identity and the graph-norm density of finite-support truncations for the forward add-one operator.

def addOne reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A real sequence at an index has a forward add-one increment, given by the next value minus the current value.

Definition (Lean source)
f :
NatReal
n :
addOne f n :
f (n + 1) - f n
Causalean.Mathlib.Probability.PoissonAddOnePoincare.addOne · Causalean/Mathlib/Probability/PoissonAddOnePoincare/L2Closure.lean:26
theorem variance_eq_half_integral_prod_sq_sub reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

Under a probability law, a square-integrable real statistic has variance equal to one half of the expected squared difference between two independent draws.

Formal statement
alpha :
Type*
f :
alpha → Real
hf :
MemLp f 2 mu
variance f mu = (1 / 2 : Real) * ∫ z, (f z.1 - f z.2) ^ 2 ∂(mu.prod mu)
Proof (Lean source)
theorem variance_eq_half_integral_prod_sq_sub {alpha : Type*} [MeasurableSpace alpha] (mu : Measure alpha) [IsProbabilityMeasure mu] (f : alpha → Real) (hf : MemLp f 2 mu) : variance f mu = (1 / 2 : Real) * ∫ z, (f z.1 - f z.2) ^ 2 ∂(mu.prod mu) := by -- Expand both sides with `variance_eq_sub`, use product Fubini for `f`, `f²`, and -- the cross term, and finish the resulting scalar identity by `ring`. rw [variance_eq_sub hf] have hfi : Integrable f mu := hf.integrable one_le_two have hfsq : Integrable (fun x ↦ f x ^ 2) mu := hf.integrable_sq have hfst : Integrable (fun z : alpha × alpha ↦ f z.1 ^ 2) (mu.prod mu) := hfsq.comp_fst mu have hsnd : Integrable (fun z : alpha × alpha ↦ f z.2 ^ 2) (mu.prod mu) := hfsq.comp_snd mu have hcross : Integrable (fun z : alpha × alpha ↦ f z.1 * f z.2) (mu.prod mu) := hfi.mul_prod hfi rw [show (fun z : alpha × alpha ↦ (f z.1 - f z.2) ^ 2) = fun z ↦ f z.1 ^ 2 - 2 * (f z.1 * f z.2) + f z.2 ^ 2 by funext z ring] have hInt : (∫ z : alpha × alpha, f z.1 ^ 2 - 2 * (f z.1 * f z.2) + f z.2 ^ 2 ∂(mu.prod mu)) = (∫ z : alpha × alpha, f z.1 ^ 2 ∂(mu.prod mu)) - 2 * (∫ z : alpha × alpha, f z.1 * f z.2 ∂(mu.prod mu)) + ∫ z : alpha × alpha, f z.2 ^ 2 ∂(mu.prod mu) := by calc _ = (∫ z : alpha × alpha, f z.1 ^ 2 - 2 * (f z.1 * f z.2) ∂(mu.prod mu)) + ∫ z : alpha × alpha, f z.2 ^ 2 ∂(mu.prod mu) := integral_add (hfst.sub (hcross.const_mul 2)) hsnd _ = ((∫ z : alpha × alpha, f z.1 ^ 2 ∂(mu.prod mu)) - ∫ z : alpha × alpha, 2 * (f z.1 * f z.2) ∂(mu.prod mu)) + ∫ z : alpha × alpha, f z.2 ^ 2 ∂(mu.prod mu) := by rw [integral_sub hfst (hcross.const_mul 2)] _ = _ := by rw [integral_const_mul] have hfstInt : (∫ z : alpha × alpha, f z.1 ^ 2 ∂(mu.prod mu)) = ∫ x, f x ^ 2 ∂mu := by simpa using integral_fun_fst (μ := mu) (ν := mu) (fun x ↦ f x ^ 2) have hsndInt : (∫ z : alpha × alpha, f z.2 ^ 2 ∂(mu.prod mu)) = ∫ x, f x ^ 2 ∂mu := by simpa using integral_fun_snd (μ := mu) (ν := mu) (fun x ↦ f x ^ 2) have hcrossInt : (∫ z : alpha × alpha, f z.1 * f z.2 ∂(mu.prod mu)) = (∫ x, f x ∂mu) * ∫ x, f x ∂mu := integral_prod_mul f f rw [hInt, hfstInt, hsndInt, hcrossInt] simp ring
Causalean.Mathlib.Probability.PoissonAddOnePoincare.variance_eq_half_integral_prod_sq_sub · Causalean/Mathlib/Probability/PoissonAddOnePoincare/L2Closure.lean:30
def supportTruncation reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A cutoff index and real sequence determine its support truncation, given by retaining exactly the values below the cutoff and setting all later values to zero.

Definition (Lean source)
K :
f :
NatReal
supportTruncation K f :
NatReal
fun n ↦ if n < K then f n else 0
Causalean.Mathlib.Probability.PoissonAddOnePoincare.supportTruncation · Causalean/Mathlib/Probability/PoissonAddOnePoincare/L2Closure.lean:82
6 supporting declarations (lemmas, instances)
Series 2 core · 7 supporting This module isolates the explicit Poisson weights, their size-bias shift, two nonnegative upper-triangle reindexings, and the finite telescoping/Cauchy–Schwarz estimate. ★ sq_sub_le_nat_sub_mul_sum_sq_step

Series algebra for the Poisson add-one inequality

This module isolates the explicit Poisson weights, their size-bias shift, two nonnegative upper-triangle reindexings, and the finite telescoping/Cauchy–Schwarz estimate.

def poissonWeight reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A nonnegative Poisson rate and count value determine the real Poisson probability mass at that count, given by the standard exponential--factorial mass formula.

Definition (Lean source)
lambda :
n :
poissonWeight lambda n :
exp (-(lambda : Real)) * (lambda : Real) ^ n / factorial n
Causalean.Mathlib.Probability.PoissonAddOnePoincare.poissonWeight · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Series.lean:25
theorem sq_sub_le_nat_sub_mul_sum_sq_step reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

For a real sequence and ordered endpoints, the squared endpoint difference is bounded by path length times the sum of squared adjacent increments.

Formal statement
f :
NatReal
n m :
hnm :
n ≤ m
(f m - f n) ^ 2 ≤ (m - n : Nat) * ∑ k ∈ Ico n m, (f (k + 1) - f k) ^ 2
Proof (Lean source)
theorem sq_sub_le_nat_sub_mul_sum_sq_step (f : NatReal) {n m : Nat} (hnm : n ≤ m) : (f m - f n) ^ 2 ≤ (m - n : Nat) * ∑ k ∈ Ico n m, (f (k + 1) - f k) ^ 2 := by -- Rewrite the left difference by `Finset.sum_Ico_sub`; apply finite Cauchy–Schwarz to -- the increments paired with the constant-one vector, and simplify its squared norm. rw [← Finset.sum_Ico_sub f hnm] calc (∑ k ∈ Ico n m, (f (k + 1) - f k)) ^ 2 = (∑ k ∈ Ico n m, (f (k + 1) - f k) * 1) ^ 2 := by simp _ ≤ (∑ k ∈ Ico n m, (f (k + 1) - f k) ^ 2) * ∑ k ∈ Ico n m, (1 : Real) ^ 2 := Finset.sum_mul_sq_le_sq_mul_sq _ _ _ _ = (m - n : Nat) * ∑ k ∈ Ico n m, (f (k + 1) - f k) ^ 2 := by simp [Nat.card_Ico] ring
Causalean.Mathlib.Probability.PoissonAddOnePoincare.sq_sub_le_nat_sub_mul_sum_sq_step · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Series.lean:124
7 supporting declarations (lemmas, instances)
Scalar 1 core · 3 supporting This module proves the sharp scalar Poincaré inequality first for finitely supported sequences and then for arbitrary functions in the graph domain of the Poisson add-one operator. ★ poisson_addOne_poincare

Scalar Poisson add-one Poincaré inequality

This module proves the sharp scalar Poincaré inequality first for finitely supported sequences and then for arbitrary functions in the graph domain of the Poisson add-one operator. The theorem is stated for every nonnegative rate, so the degenerate zero-rate Poisson law is included.

theorem poisson_addOne_poincare reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

At a nonnegative Poisson rate, a real sequence whose values are square-integrable and whose add-one increments are square-integrable has variance no larger than the rate times the expected squared add-one increment.

Formal statement
lambda :
f :
NatReal
hf :
MemLp f 2 (poissonMeasure lambda)
hdf :
MemLp (addOne f) 2 (poissonMeasure lambda)
≤ (lambda : Real) * ∫ n, (addOne f n) ^ 2 ∂(poissonMeasure lambda)
Proof (Lean source)
theorem poisson_addOne_poincare (lambda : NNReal) (f : NatReal) (hf : MemLp f 2 (poissonMeasure lambda)) (hdf : MemLp (addOne f) 2 (poissonMeasure lambda)) : variance f (poissonMeasure lambda) ≤ (lambda : Real) * ∫ n, (addOne f n) ^ 2 ∂(poissonMeasure lambda) := by -- Apply the finite-support result to `supportTruncation K f`. Pass variance and energy -- to the limit with the two graph-norm closure lemmas and L² variance continuity. let fK : NatNatReal := fun K ↦ supportTruncation K f have hfK (K : Nat) : MemLp (fK K) 2 (poissonMeasure lambda) := memLp_poissonMeasure_of_finiteSupport lambda _ (supportTruncation_finiteSupport K f) have hdfK (K : Nat) : MemLp (addOne (fK K)) 2 (poissonMeasure lambda) := memLp_poissonMeasure_of_finiteSupport lambda _ (finiteSupport_addOne _ (supportTruncation_finiteSupport K f)) have hvar : Tendsto (fun K ↦ variance (fK K) (poissonMeasure lambda)) atTop (nhds (variance f (poissonMeasure lambda))) := variance_tendsto_of_integral_sq_sub_tendsto_zero (poissonMeasure lambda) fK f hfK hf (by simpa [fK] using supportTruncation_integral_sq_tendsto_zero lambda f hf) have henergy : Tendsto (fun K ↦ ∫ n, (addOne (fK K) n) ^ 2 ∂(poissonMeasure lambda)) atTop (nhds (∫ n, (addOne f n) ^ 2 ∂(poissonMeasure lambda))) := integral_sq_tendsto_of_integral_sq_sub_tendsto_zero (poissonMeasure lambda) (fun K ↦ addOne (fK K)) (addOne f) hdfK hdf (by simpa [fK] using supportTruncation_addOne_integral_sq_tendsto_zero lambda f hf hdf) exact le_of_tendsto_of_tendsto' hvar ((tendsto_const_nhds : Tendsto (fun _ : Nat ↦ (lambda : Real)) atTop (nhds (lambda : Real))).mul henergy) (fun K ↦ poisson_addOne_poincare_finiteSupport lambda (fK K) (supportTruncation_finiteSupport K f))
Causalean.Mathlib.Probability.PoissonAddOnePoincare.poisson_addOne_poincare · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Scalar.lean:782 · uses addOne
3 supporting declarations (lemmas, instances)
Tensorization 7 core · 2 supporting This module tensorizes variance over Measure.pi, using coordinate replacement to express conditional variances and add-one increments. ★ poissonPi_addOne_poincare

Finite-product tensorization of Poisson add-one Poincaré inequalities

This module tensorizes variance over Measure.pi, using coordinate replacement to express conditional variances and add-one increments. It also provides a nested paired-coordinate form whose sample space is directly of the shape i → j → Nat × Nat.

def coordinateReplace reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A coordinate, dependent-product observation, and replacement value determine the observation with that coordinate replaced, given by updating exactly the selected coordinate.

Definition (Lean source)
iota :
Type*
iota → Type*
i :
iota
x :
(j : iota) → X j
y :
X i
j :
iota
coordinateReplace i x y j :
X j
update x i y
Causalean.Mathlib.Probability.PoissonAddOnePoincare.coordinateReplace · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:27
def coordinateAddOne reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A coordinate, real-valued statistic, and count-vector observation determine the statistic's add-one increment in that coordinate, given by increasing the selected count by one and subtracting the original statistic.

Definition (Lean source)
iota :
Type*
i :
iota
F :
(iota → Nat) → Real
x :
iota → Nat
coordinateAddOne i F x :
F (update x i (x i + 1)) - F x
Causalean.Mathlib.Probability.PoissonAddOnePoincare.coordinateAddOne · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:33
def poissonPi reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A finite collection of nonnegative Poisson rates determines the product law of independent Poisson counts, given by the coordinatewise product of their Poisson laws.

Definition (Lean source)
iota :
Type*
Fintype iota
lambda :
iota → NNReal
poissonPi lambda :
Measure (iota → Nat)
Measure.pi fun i ↦ poissonMeasure (lambda i)
Causalean.Mathlib.Probability.PoissonAddOnePoincare.poissonPi · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:39
theorem poissonPi_addOne_poincare reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

For a finite collection of nonnegative Poisson rates, a real-valued statistic of the count vector that is square-integrable and whose coordinate add-one increments are square-integrable has variance bounded by the sum of rate-weighted expected squared coordinate increments.

Formal statement
iota :
Type*
Fintype iota
lambda :
iota → NNReal
F :
(iota → Nat) → Real
hF :
MemLp F 2 (poissonPi lambda)
hD :
∀ i, MemLp (coordinateAddOne i F) 2 (poissonPi lambda)
variance F (poissonPi lambda)
≤ ∑ i : iota, (lambda i : Real) * ∫ x, (coordinateAddOne i F x) ^ 2 ∂(poissonPi lambda)
Proof (Lean source)
theorem poissonPi_addOne_poincare {iota : Type*} [Fintype iota] [DecidableEq iota] (lambda : iota → NNReal) (F : (iota → Nat) → Real) (hF : MemLp F 2 (poissonPi lambda)) (hD : ∀ i, MemLp (coordinateAddOne i F) 2 (poissonPi lambda)) : variance F (poissonPi lambda) ≤ ∑ i : iota, (lambda i : Real) * ∫ x, (coordinateAddOne i F x) ^ 2 ∂(poissonPi lambda) := by classical let e : Fin (card iota) ≃ iota := (Fintype.equivFin iota).symm let phi := MeasurableEquiv.piCongrLeft (fun _ : iota ↦ Nat) e let lambda' : Fin (card iota) → NNReal := fun k ↦ lambda (e k) let G : (Fin (card iota) → Nat) → Real := F ∘ phi have hmp := measurePreserving_piCongrLeft (fun i ↦ poissonMeasure (lambda i)) e have hG : MemLp G 2 (poissonPi lambda') := hF.comp_measurePreserving hmp have hDG (k : Fin (card iota)) : MemLp (coordinateAddOne k G) 2 (poissonPi lambda') := by have heq : coordinateAddOne k G = coordinateAddOne (e k) F ∘ phi := by funext z simp only [coordinateAddOne, G, Function.comp_apply] rw [piCongrLeft_update_const e z k (z k + 1)] rw [MeasurableEquiv.piCongrLeft_apply_apply] rw [heq] exact (hD (e k)).comp_measurePreserving hmp have hfin := poissonPi_fin_addOne_poincare (card iota) lambda' G hG hDG have hvar := hmp.variance_fun_comp hF.aemeasurable rw [show variance F (poissonPi lambda) = variance G (poissonPi lambda') by exact hvar.symm] calc variance G (poissonPi lambda') ≤ ∑ k, (lambda' k : Real) * ∫ z, (coordinateAddOne k G z) ^ 2 ∂(poissonPi lambda') := hfin _ = ∑ k, (lambda (e k) : Real) * ∫ x, (coordinateAddOne (e k) F x) ^ 2 ∂(poissonPi lambda) := by apply Finset.sum_congr rfl intro k _ congr 1 change (∫ z, (coordinateAddOne k G z) ^ 2 ∂Measure.pi (fun j ↦ poissonMeasure (lambda (e j)))) = ∫ x, (coordinateAddOne (e k) F x) ^ 2 ∂Measure.pi (fun i ↦ poissonMeasure (lambda i)) rw [← hmp.integral_comp'] apply integral_congr_ae filter_upwards with z simp only [coordinateAddOne, G, Function.comp_apply] rw [piCongrLeft_update_const e z k (z k + 1)] rw [MeasurableEquiv.piCongrLeft_apply_apply] _ = _ := e.sum_comp (fun i ↦ (lambda i : Real) * ∫ x, (coordinateAddOne i F x) ^ 2 ∂(poissonPi lambda))
Causalean.Mathlib.Probability.PoissonAddOnePoincare.poissonPi_addOne_poincare · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:559 · uses coordinateAddOne , poissonPi
def nestedPairedPoissonMeasure reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

Two arrays of nonnegative Poisson rates determine the nested product law of independent Poisson-count pairs, given by independent two-count product laws in every array cell.

Definition (Lean source)
iota kappa :
Type*
Fintype iota
Fintype kappa
lambda₁ lambda₂ :
iota → kappa → NNReal
nestedPairedPoissonMeasure lambda₁ lambda₂ :
Measure (iota → kappa → Nat × Nat)
Measure.pi fun i ↦ Measure.pi fun j ↦ (poissonMeasure (lambda₁ i j)).prod (poissonMeasure (lambda₂ i j))
Causalean.Mathlib.Probability.PoissonAddOnePoincare.nestedPairedPoissonMeasure · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:611
def nestedPairAddOneFst reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A first array coordinate, second array coordinate, real-valued nested-array statistic, and nested count-pair observation determine the increment from adding one to that cell's first count, given by updating the selected first count and subtracting the original statistic.

Definition (Lean source)
iota kappa :
Type*
i :
iota
j :
kappa
F :
(iota → kappa → Nat × Nat) → Real
x :
iota → kappa → Nat × Nat
nestedPairAddOneFst i j F x :
F (update x i (update (x i) j ((x i j).1 + 1, (x i j).2))) - F x
Causalean.Mathlib.Probability.PoissonAddOnePoincare.nestedPairAddOneFst · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:619
def nestedPairAddOneSnd reviewed
Causalean.Mathlib.Probability.PoissonAddOnePoincare

A first array coordinate, second array coordinate, real-valued nested-array statistic, and nested count-pair observation determine the increment from adding one to that cell's second count, given by updating the selected second count and subtracting the original statistic.

Definition (Lean source)
iota kappa :
Type*
i :
iota
j :
kappa
F :
(iota → kappa → Nat × Nat) → Real
x :
iota → kappa → Nat × Nat
nestedPairAddOneSnd i j F x :
F (update x i (update (x i) j ((x i j).1, (x i j).2 + 1))) - F x
Causalean.Mathlib.Probability.PoissonAddOnePoincare.nestedPairAddOneSnd · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:628
2 supporting declarations (lemmas, instances)
  • variance_pi_le_sum_integral_coordinateVariance theorem — For a finite family of probability laws, a real-valued statistic of their product observation that is square-integrable has variance bounded by the sum of expected conditional variances from resampling one coordinate at a time.
    iota :
    Type*
    Fintype iota
    iota → Type*
    (i : iota) → MeasurableSpace (X i)
    mu :
    (i : iota) → Measure (X i)
    ∀ i, IsProbabilityMeasure (mu i)
    F :
    ((i : iota) → X i) → Real
    hF :
    MemLp F 2 (Measure.pi mu)
    variance F (Measure.pi mu)
    ≤ ∑ i : iota, ∫ x, variance (fun y ↦ F (coordinateReplace i x y)) (mu i) ∂(Measure.pi mu)
    Proof (Lean source)
    theorem variance_pi_le_sum_integral_coordinateVariance {iota : Type*} [Fintype iota] [DecidableEq iota] {X : iota → Type*} [(i : iota) → MeasurableSpace (X i)] (mu : (i : iota) → Measure (X i)) [∀ i, IsProbabilityMeasure (mu i)] (F : ((i : iota) → X i) → Real) (hF : MemLp F 2 (Measure.pi mu)) : variance F (Measure.pi mu) ≤ ∑ i : iota, ∫ x, variance (fun y ↦ F (coordinateReplace i x y)) (mu i) ∂(Measure.pi mu) := by classical let e : Fin (card iota) ≃ iota := (Fintype.equivFin iota).symm let phi := MeasurableEquiv.piCongrLeft X e let nu : (k : Fin (card iota)) → Measure (X (e k)) := fun k ↦ mu (e k) let G : ((k : Fin (card iota)) → X (e k)) → Real := F ∘ phi have hmp := measurePreserving_piCongrLeft mu e have hG : MemLp G 2 (Measure.pi nu) := by exact hF.comp_measurePreserving hmp have h := variance_pi_fin (card iota) nu G hG have hvar := hmp.variance_fun_comp hF.aemeasurable rw [show variance F (Measure.pi mu) = variance G (Measure.pi nu) by exact hvar.symm] calc variance G (Measure.pi nu) ≤ ∑ k, ∫ z, variance (fun y ↦ G (update z k y)) (nu k) ∂(Measure.pi nu) := h _ = ∑ k, ∫ x, variance (fun y ↦ F (coordinateReplace (e k) x y)) (mu (e k)) ∂(Measure.pi mu) := by apply Finset.sum_congr rfl intro k _ rw [← hmp.integral_comp'] apply integral_congr_ae filter_upwards with z congr 1 funext y apply congrArg F funext a obtain ⟨j, rfl⟩ := e.surjective a by_cases hj : j = k · subst j simp [phi, coordinateReplace, MeasurableEquiv.piCongrLeft_apply_apply] · simp [phi, coordinateReplace, MeasurableEquiv.piCongrLeft_apply_apply, hj] _ = _ := e.sum_comp (fun i ↦ ∫ x, variance (fun y ↦ F (coordinateReplace i x y)) (mu i) ∂(Measure.pi mu))
    Causalean.Mathlib.Probability.PoissonAddOnePoincare.variance_pi_le_sum_integral_coordinateVariance · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:373
  • nestedPairedPoisson_addOne_poincare theorem — For two arrays of nonnegative Poisson rates, a real-valued nested-array statistic that is square-integrable, with first-count add-one increments square-integrable and second-count add-one increments square-integrable, has variance bounded by the sum of the two rate-weighted expected squared increments in every cell.
    iota kappa :
    Type*
    Fintype iota
    Fintype kappa
    lambda₁ lambda₂ :
    iota → kappa → NNReal
    F :
    (iota → kappa → Nat × Nat) → Real
    hF :
    MemLp F 2 (nestedPairedPoissonMeasure lambda₁ lambda₂)
    hD₁ :
    ∀ i j,
    MemLp (nestedPairAddOneFst (iota := iota) (kappa := kappa) i j F) 2 (nestedPairedPoissonMeasure lambda₁ lambda₂)
    hD₂ :
    ∀ i j,
    MemLp (nestedPairAddOneSnd (iota := iota) (kappa := kappa) i j F) 2 (nestedPairedPoissonMeasure lambda₁ lambda₂)
    variance F (nestedPairedPoissonMeasure lambda₁ lambda₂)
    ≤ Finset.univ.sum (fun i : iota ↦ Finset.univ.sum (fun j : kappa ↦ ((lambda₁ i j : Real) * ∫ x : iota → kappa → Nat × Nat, (nestedPairAddOneFst (iota := iota) (kappa := kappa) (i : iota) (j : kappa) F x) ^ 2 ∂(nestedPairedPoissonMeasure lambda₁ lambda₂)) + ((lambda₂ i j : Real) * ∫ x : iota → kappa → Nat × Nat, (nestedPairAddOneSnd (iota := iota) (kappa := kappa) (i : iota) (j : kappa) F x) ^ 2 ∂(nestedPairedPoissonMeasure lambda₁ lambda₂))))
    Proof (Lean source)
    theorem nestedPairedPoisson_addOne_poincare {iota kappa : Type*} [Fintype iota] [DecidableEq iota] [Fintype kappa] [DecidableEq kappa] (lambda₁ lambda₂ : iota → kappa → NNReal) (F : (iota → kappa → Nat × Nat) → Real) (hF : MemLp F 2 (nestedPairedPoissonMeasure lambda₁ lambda₂)) (hD₁ : ∀ i j, MemLp (nestedPairAddOneFst (iota := iota) (kappa := kappa) i j F) 2 (nestedPairedPoissonMeasure lambda₁ lambda₂)) (hD₂ : ∀ i j, MemLp (nestedPairAddOneSnd (iota := iota) (kappa := kappa) i j F) 2 (nestedPairedPoissonMeasure lambda₁ lambda₂)) : variance F (nestedPairedPoissonMeasure lambda₁ lambda₂) ≤ Finset.univ.sum (fun i : iota ↦ Finset.univ.sum (fun j : kappa ↦ ((lambda₁ i j : Real) * ∫ x : iota → kappa → Nat × Nat, (nestedPairAddOneFst (iota := iota) (kappa := kappa) (i : iota) (j : kappa) F x) ^ 2 ∂(nestedPairedPoissonMeasure lambda₁ lambda₂)) + ((lambda₂ i j : Real) * ∫ x : iota → kappa → Nat × Nat, (nestedPairAddOneSnd (iota := iota) (kappa := kappa) (i : iota) (j : kappa) F x) ^ 2 ∂(nestedPairedPoissonMeasure lambda₁ lambda₂)))) := by classical let flatIndex := Sigma fun _ : iota ↦ Sigma fun _ : kappa ↦ Fin 2 let flatLambda : flatIndex → NNReal := fun p ↦ Fin.cases (lambda₁ p.1 p.2.1) (fun _ ↦ lambda₂ p.1 p.2.1) p.2.2 let e₁ := MeasurableEquiv.piCurry (fun (_ : iota) (_ : Sigma fun _ : kappa ↦ Fin 2) ↦ Nat) let e₂ := MeasurableEquiv.piCongrRight (fun _ : iota ↦ MeasurableEquiv.piCurry (fun (_ : kappa) (_ : Fin 2) ↦ Nat)) let e₃ := MeasurableEquiv.piCongrRight (fun _ : iota ↦ MeasurableEquiv.piCongrRight (fun _ : kappa ↦ MeasurableEquiv.piFinTwo (fun _ : Fin 2 ↦ Nat))) let e := e₁.trans (e₂.trans e₃) let mu₀ : Measure (flatIndex → Nat) := poissonPi flatLambda let mu₁ : Measure (iota → (Sigma fun _ : kappa ↦ Fin 2) → Nat) := Measure.pi fun i ↦ Measure.pi fun q ↦ poissonMeasure (flatLambda ⟨i, q⟩) let mu₂ : Measure (iota → kappa → Fin 2 → Nat) := Measure.pi fun i ↦ Measure.pi fun j ↦ Measure.pi fun b ↦ poissonMeasure (flatLambda ⟨i, ⟨j, b⟩⟩) let mu₃ : Measure (iota → kappa → Nat × Nat) := nestedPairedPoissonMeasure lambda₁ lambda₂ have hmp₁ : MeasurePreserving e₁ mu₀ mu₁ := by simpa [e₁, mu₀, mu₁, poissonPi, flatIndex] using (measurePreserving_piCurry_probability (fun (i : iota) (q : Sigma fun _ : kappa ↦ Fin 2) ↦ poissonMeasure (flatLambda ⟨i, q⟩))) have hmp₂ : MeasurePreserving e₂ mu₁ mu₂ := by apply measurePreserving_piCongrRight_probability intro i simpa [mu₁, mu₂, e₂] using (measurePreserving_piCurry_probability (fun (j : kappa) (b : Fin 2) ↦ poissonMeasure (flatLambda ⟨i, ⟨j, b⟩⟩))) have hmp₃ : MeasurePreserving e₃ mu₂ mu₃ := by apply measurePreserving_piCongrRight_probability intro i apply measurePreserving_piCongrRight_probability intro j convert (measurePreserving_piFinTwo (fun b : Fin 2 ↦ poissonMeasure (Fin.cases (lambda₁ i j) (fun _ ↦ lambda₂ i j) b))) using 1 · simp [mu₂, mu₃, e₃, nestedPairedPoissonMeasure, flatLambda] congr 2 have hmp : MeasurePreserving e mu₀ mu₃ := by exact hmp₃.comp (hmp₂.comp hmp₁) have he_apply (z : flatIndex → Nat) (i : iota) (j : kappa) : e z i j = (z ⟨i, ⟨j, 0⟩⟩, z ⟨i, ⟨j, 1⟩⟩) := by rfl have he_update_fst (z : flatIndex → Nat) (i : iota) (j : kappa) : e (update z ⟨i, ⟨j, 0⟩⟩ (z ⟨i, ⟨j, 0⟩⟩ + 1)) = update (e z) i (update (e z i) j ((e z i j).1 + 1, (e z i j).2)) := by funext i' j' rw [he_apply] by_cases hi : i' = i <;> by_cases hj : j' = j · subst i' subst j' simp [he_apply] · subst i' simp [he_apply, hj] · simp [he_apply, hi] · simp [he_apply, hi] have he_update_snd (z : flatIndex → Nat) (i : iota) (j : kappa) : e (update z ⟨i, ⟨j, 1⟩⟩ (z ⟨i, ⟨j, 1⟩⟩ + 1)) = update (e z) i (update (e z i) j ((e z i j).1, (e z i j).2 + 1)) := by funext i' j' rw [he_apply] by_cases hi : i' = i <;> by_cases hj : j' = j · subst i' subst j' simp [he_apply] · subst i' simp [he_apply, hj] · simp [he_apply, hi] · simp [he_apply, hi] let G : (flatIndex → Nat) → Real := F ∘ e have hG : MemLp G 2 mu₀ := hF.comp_measurePreserving hmp have hDpoint_fst (i : iota) (j : kappa) : coordinateAddOne ⟨i, ⟨j, 0⟩⟩ G = nestedPairAddOneFst i j F ∘ e := by funext z simp only [coordinateAddOne, G, Function.comp_apply, nestedPairAddOneFst] rw [he_update_fst] have hDpoint_snd (i : iota) (j : kappa) : coordinateAddOne ⟨i, ⟨j, 1⟩⟩ G = nestedPairAddOneSnd i j F ∘ e := by funext z simp only [coordinateAddOne, G, Function.comp_apply, nestedPairAddOneSnd] rw [he_update_snd] have hDG (p : flatIndex) : MemLp (coordinateAddOne p G) 2 mu₀ := by rcases p with ⟨i, j, b⟩ have hb : b = 0 ∨ b = 1 := by omega rcases hb with rfl | rfl · rw [hDpoint_fst] exact (hD₁ i j).comp_measurePreserving hmp · rw [hDpoint_snd] exact (hD₂ i j).comp_measurePreserving hmp have hflat := poissonPi_addOne_poincare flatLambda G hG hDG have henergy_fst (i : iota) (j : kappa) : (∫ z, (coordinateAddOne ⟨i, ⟨j, 0⟩⟩ G z) ^ 2 ∂mu₀) = ∫ x, (nestedPairAddOneFst i j F x) ^ 2 ∂mu₃ := by rw [← hmp.integral_comp'] apply integral_congr_ae filter_upwards with z rw [congrFun (hDpoint_fst i j) z] rfl have henergy_snd (i : iota) (j : kappa) : (∫ z, (coordinateAddOne ⟨i, ⟨j, 1⟩⟩ G z) ^ 2 ∂mu₀) = ∫ x, (nestedPairAddOneSnd i j F x) ^ 2 ∂mu₃ := by rw [← hmp.integral_comp'] apply integral_congr_ae filter_upwards with z rw [congrFun (hDpoint_snd i j) z] rfl have hvar := hmp.variance_fun_comp hF.aemeasurable rw [show variance F mu₃ = variance G mu₀ by exact hvar.symm] calc variance G mu₀ ≤ ∑ p : flatIndex, (flatLambda p : Real) * ∫ z, (coordinateAddOne p G z) ^ 2 ∂mu₀ := hflat _ = _ := by rw [Fintype.sum_sigma] apply Finset.sum_congr rfl intro i _ rw [Fintype.sum_sigma] apply Finset.sum_congr rfl intro j _ rw [Fin.sum_univ_two, henergy_fst, henergy_snd] congr 2
    Causalean.Mathlib.Probability.PoissonAddOnePoincare.nestedPairedPoisson_addOne_poincare · Causalean/Mathlib/Probability/PoissonAddOnePoincare/Tensorization.lean:663