Stat.FiniteRaoBlackwell.Poisson.FinitePartition.NestedEventMoment
The fixed-count identity is mixed over the Poisson sample size to give a total, division-free joint factorial moment.
NestedEventMoment 1 core · 2 supporting The fixed-count identity is mixed over the Poisson sample size to give a total, division-free joint factorial moment. ★ finitePoisson_nestedEvent_factorialMoment
Nested-event factorial moment of a finite Poisson sample
The fixed-count identity is mixed over the Poisson sample size to give a total, division-free joint factorial moment. A positive-mass corollary expresses the same identity as a conditional-mean proportion of the larger-event moment.
Under an observation probability law, a Poisson intensity, two events with measurable membership and the first contained in the second, and an order with positive order, the expectation, under the finite Poisson sample law, of the smaller-event count times the falling factorial of order one less than the given order of the larger-event count minus one equals the intensity raised to the order, times the smaller-event probability, times the larger-event probability raised to the order minus one.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
integrable_weightedFactorialtheorem — Under an observation probability law, a Poisson intensity, two events with measurable membership and the first contained in the second, and an order with positive order, the weighted nested-event factorial is integrable under the finite Poisson sample law.hypothesesconclusionProof (Lean source)
theorem integrable_weightedFactorial (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) (A B : Set X) (hA : MeasurableSet A) (hB : MeasurableSet B) (hAB : A ⊆ B) (v : ℕ) (hv : 1 ≤ v) : Integrable (weightedFactorial A B v) (finitePoissonSampleLaw P lam) := by /- Bound the nonnegative statistic by count.descFactorial v after the ordered-tuple expansion (weightedFactorial_nonneg_le_countFactorial), then use poisson_descFactorial_integrable and finitePoissonSampleLaw_map_count. The measurable_weightedFactorial lemma supplies strong measurability. -/ have hcount : Integrable (fun s : FiniteSample X => (s.count.descFactorial v : ℝ)) (finitePoissonSampleLaw P lam) := by have h := poisson_descFactorial_integrable lam v rw [← finitePoissonSampleLaw_map_count P lam] at h simpa only [Function.comp_def] using h.comp_aemeasurable measurable_finiteSample_count.aemeasurable exact integrable_of_le_of_le (measurable_weightedFactorial A B hA hB v).aestronglyMeasurable (Filter.Eventually.of_forall fun s => (weightedFactorial_nonneg_le_countFactorial A B hAB v hv s).1) (Filter.Eventually.of_forall fun s => (weightedFactorial_nonneg_le_countFactorial A B hAB v hv s).2) (integrable_zero _ _ _) hcount -
finitePoisson_nestedEvent_conditionalMeantheorem — Under an observation probability law, a Poisson intensity, two events with measurable membership and the first contained in the second, positive larger-event probability, and an order with positive order, the nested weighted factorial moment equals the event-probability ratio times the containing-event factorial moment.hypothesesX :sharedType u_1P :lam :ℝ≥0A B :Set XhA :hB :hAB :A ⊆ BhBpos :0 < (P B).toRealv :ℕhv :1 ≤ vconclusion(∫ s, weightedFactorial A B v s ∂finitePoissonSampleLaw P lam)Proof (Lean source)
theorem finitePoisson_nestedEvent_conditionalMean (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) (A B : Set X) (hA : MeasurableSet A) (hB : MeasurableSet B) (hAB : A ⊆ B) (hBpos : 0 < (P B).toReal) (v : ℕ) (hv : 1 ≤ v) : (∫ s, weightedFactorial A B v s ∂finitePoissonSampleLaw P lam) = ((P A).toReal / (P B).toReal) * (∫ s, weightedFactorial B B v s ∂finitePoissonSampleLaw P lam) := by rw [finitePoisson_nestedEvent_factorialMoment P lam A B hA hB hAB v hv, finitePoisson_nestedEvent_factorialMoment P lam B B hB hB (Set.Subset.refl B) v hv] field_simp [ne_of_gt hBpos]
Basic 4 core · 0 supporting This module defines event counts in a finite sample and a weighted falling factorial. ★ weightedFactorial_eq_injectiveTupleSum
Counts of nested events and their ordered-tuple expansion
This module defines event counts in a finite sample and a weighted falling factorial. The key combinatorial statement expands that statistic as a sum over injective ordered tuples, with the first point in the smaller event and every remaining point in the larger event.
A finite sample and an event determine the event count, given by the number of sample positions whose observation lies in the event.
Definition (Lean source)
Two events, an order, and a finite sample determine the weighted nested-event factorial count, given by the count of the first event times the falling factorial, of order one less than the given order, of the count of the second event minus one. Both subtractions are natural-number subtractions truncated at zero, so order zero is treated like order one and an empty second-event count is treated like a count of one.
Definition (Lean source)
Two events, an order with positive order, and an ordered observation tuple determine the nested-event kernel, given by one when its first observation is in the first event and all remaining observations are in the second event, and zero otherwise.
Given two events with the first contained in the second, an order with positive order, a sample size, and fixed observations, the weighted nested-event factorial equals the sum of the nested-event kernel over injective ordered position tuples.
Formal statement
Proof (Lean source)
Envelope 1 core · 2 supporting These lemmas provide the pointwise and measurable envelope needed to integrate weighted factorial counts under a finite Poisson sample law. ★ weightedFactorial_nonneg_le_countFactorial
Measurability and scalar bound for nested-event counts
These lemmas provide the pointwise and measurable envelope needed to integrate weighted factorial counts under a finite Poisson sample law.
Two events with the first contained in the second, an order with positive order, and a finite sample have a nonnegative weighted factorial count bounded by the sample-size falling factorial.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
measurable_eventCounttheorem — An event with measurable membership has a measurable finite-sample event count.hypothesesconclusionMeasurable (fun s : FiniteSample X => eventCount s A)Proof (Lean source)
theorem measurable_eventCount (A : Set X) (hA : MeasurableSet A) : Measurable (fun s : FiniteSample X => eventCount s A) := by classical apply measurable_to_countable' intro k rw [MeasurableSpace.measurableSet_iInf] intro n change MeasurableSet {x : Fin n → X | eventCount (fixedSizeEmbed n x) A = k} have hcount : Measurable (fun x : Fin n → X => ∑ i : Fin n, if x i ∈ A then (1 : ℕ) else 0) := by apply Finset.measurable_sum intro i hi exact Measurable.ite ((measurable_pi_apply i) hA) measurable_const measurable_const have heq : (fun x : Fin n → X => eventCount (fixedSizeEmbed n x) A) = (fun x => ∑ i : Fin n, if x i ∈ A then (1 : ℕ) else 0) := by funext x simp [eventCount, FiniteSample.points, fixedSizeEmbed] rfl change MeasurableSet ((fun x : Fin n → X => eventCount (fixedSizeEmbed n x) A) ⁻¹' {k}) rw [heq] exact hcount (measurableSet_singleton k) -
measurable_weightedFactorialtheorem — Two events with measurable membership and an order give a measurable weighted nested-event factorial count.hypothesesconclusionMeasurable (weightedFactorial A B v)Proof (Lean source)
theorem measurable_weightedFactorial (A B : Set X) (hA : MeasurableSet A) (hB : MeasurableSet B) (v : ℕ) : Measurable (weightedFactorial A B v) := by unfold weightedFactorial have hA' : Measurable (fun s : FiniteSample X => (eventCount s A : ℝ)) := (measurable_of_countable (fun n : ℕ => (n : ℝ))).comp (measurable_eventCount A hA) have hB' : Measurable (fun s : FiniteSample X => (eventCount s B - 1).descFactorial (v - 1)) := (measurable_of_countable (fun n : ℕ => n.descFactorial (v - 1))).comp ((measurable_eventCount B hB).sub (measurable_const : Measurable (fun _ : FiniteSample X => (1 : ℕ)))) exact hA'.mul ((measurable_of_countable (fun n : ℕ => (n : ℝ))).comp hB')
Fibre 1 core · 0 supporting The fixed-count iid identity is transported to each count fibre of the finite Poisson sample law. ★ integral_weightedFactorial_countFibre
Exact-count fibres for nested-event factorial moments
The fixed-count iid identity is transported to each count fibre of the finite Poisson sample law. The result is total at zero Poisson mass and zero event mass.
Under an observation probability law, a Poisson intensity, two events with measurable membership and the first contained in the second, an order with positive order, and a sample-size fibre, the integral of the weighted nested-event factorial over the samples of exactly that size, under the finite Poisson sample law, equals the Poisson probability of that size times the falling factorial of the size of the given order, times the smaller-event probability, times the larger-event probability raised to the order minus one.
Formal statement
Proof (Lean source)
FixedCount 1 core · 3 supporting This module evaluates the ordered event kernel under a product probability law and then evaluates the weighted nested-event statistic on each fixed-size iid sample fibre. ★ integral_weightedFactorial_fixedCount
Fixed-count iid nested-event factorial moment
This module evaluates the ordered event kernel under a product probability law and then evaluates the weighted nested-event statistic on each fixed-size iid sample fibre.
Under an observation probability law, two events with measurable membership and the first contained in the second, an order with positive order, and a fixed sample size, the iid mean of the weighted nested-event factorial equals the falling factorial of the sample size of the given order, times the smaller-event probability, times the larger-event probability raised to the order minus one.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
measurable_nestedEventKerneltheorem — Two events with measurable membership, an order, and positive order give a measurable ordered nested-event kernel.hypothesesconclusionMeasurable (nestedEventKernel A B v hv)Proof (Lean source)
theorem measurable_nestedEventKernel (A B : Set X) (hA : MeasurableSet A) (hB : MeasurableSet B) (v : ℕ) (hv : 1 ≤ v) : Measurable (nestedEventKernel A B v hv) := by classical unfold nestedEventKernel have hfirst : MeasurableSet {x : Fin v → X | x ⟨0, hv⟩ ∈ A} := hA.preimage (measurable_pi_apply _) have htail : MeasurableSet {x : Fin v → X | ∀ j : Fin v, j.val ≠ 0 → x j ∈ B} := by have hm : MeasurableSet (⋂ j : Fin v, {x : Fin v → X | j.val ≠ 0 → x j ∈ B}) := by apply MeasurableSet.iInter intro j by_cases hj : j.val = 0 · simp [hj] · have hpre : MeasurableSet {x : Fin v → X | x j ∈ B} := hB.preimage (measurable_pi_apply j) convert hpre using 1 ext x simp [hj] convert hm using 1 ext x simp exact measurable_const.ite (hfirst.inter htail) measurable_const -
integrable_nestedEventKerneltheorem — Under an observation probability law, two events with measurable membership, an order, and positive order, the ordered nested-event kernel is integrable under the iid product law.Proof (Lean source)
theorem integrable_nestedEventKernel (P : Measure X) [IsProbabilityMeasure P] (A B : Set X) (hA : MeasurableSet A) (hB : MeasurableSet B) (v : ℕ) (hv : 1 ≤ v) : Integrable (nestedEventKernel A B v hv) (Measure.pi (fun _ : Fin v => P)) := by classical let C : Set (Fin v → X) := Set.univ.pi (fun j : Fin v => if j.val = 0 then A else B) have hC : MeasurableSet C := by apply MeasurableSet.pi Set.countable_univ intro j _ split_ifs <;> assumption have hfin : IsFiniteMeasure (Measure.pi (fun _ : Fin v => P)) := inferInstance have hint : Integrable (C.indicator (fun _ => (1 : ℝ))) (Measure.pi (fun _ : Fin v => P)) := (integrable_const (1 : ℝ)).indicator hC convert hint using 1 funext x exact nestedEventKernel_eq_indicator A B v hv x -
integral_nestedEventKerneltheorem — Under an observation probability law, two events with measurable membership, an order, and positive order, the iid mean of the ordered nested-event kernel equals the smaller-event probability times the required power of the larger-event probability.Proof (Lean source)
theorem integral_nestedEventKernel (P : Measure X) [IsProbabilityMeasure P] (A B : Set X) (hA : MeasurableSet A) (hB : MeasurableSet B) (v : ℕ) (hv : 1 ≤ v) : (∫ x : Fin v → X, nestedEventKernel A B v hv x ∂Measure.pi (fun _ : Fin v => P)) = (P A).toReal * (P B).toReal ^ (v - 1) := by classical let C : Set (Fin v → X) := Set.univ.pi (fun j : Fin v => if j.val = 0 then A else B) have hC : MeasurableSet C := by apply MeasurableSet.pi Set.countable_univ intro j _ split_ifs <;> assumption have hprob : (Measure.pi (fun _ : Fin v => P)) C = P A * (P B) ^ (v - 1) := by change (Measure.pi (fun _ : Fin v => P)) (Set.univ.pi (fun j : Fin v => if j.val = 0 then A else B)) = _ rw [Measure.pi_pi] rw [Fintype.prod_eq_mul_prod_compl ⟨0, hv⟩] simp only [↓reduceIte] have htail : (∏ j ∈ ({⟨0, hv⟩}ᶜ : Finset (Fin v)), P (if j.val = 0 then A else B)) = (P B) ^ (v - 1) := by have heq : ∀ j ∈ ({⟨0, hv⟩}ᶜ : Finset (Fin v)), P (if j.val = 0 then A else B) = P B := by intro j hj have hj0 : j ≠ ⟨0, hv⟩ := by simpa using hj have hjv : j.val ≠ 0 := by intro h exact hj0 (Fin.ext h) simp [hjv] rw [Finset.prod_congr rfl heq, Finset.prod_const] simp [Finset.card_compl, Fintype.card_fin] rw [htail] have hkernel : nestedEventKernel A B v hv = C.indicator (fun _ => (1 : ℝ)) := by funext x exact nestedEventKernel_eq_indicator A B v hv x rw [hkernel, integral_indicator hC, setIntegral_const] simp only [smul_eq_mul, mul_one, Measure.real] rw [hprob, ENNReal.toReal_mul, ENNReal.toReal_pow]