Mathlib.Probability.Poisson.FinitePartition
Finite-partition Poisson-process tools: cell counts, splitting and superposition, iid-Poisson representations, relative entropy, and depoissonization.
Basic 12 core · 12 supporting This file turns an independent Poisson count and infinite i.i.d. ★ finiteMarkedPoissonSampleLaw_restrict_count_eq★ map_totalizedPrefix_restrict_nonoverflow
Finite Poisson samples
This file turns an independent Poisson count and infinite i.i.d. stream into a genuine finite sequence. It records the count law and the exact, unnormalised fixed-count fibre law. The latter is the convenient measure-theoretic form of the statement that, conditional on the count, the observations are i.i.d.
For an observation space, a finite sample consists of a nonnegative sample size and one observation for each position below that size.
Definition (Lean source)
For a finite sample, its count is the number of observations it contains.
Definition (Lean source)
For a finite sample, its points are its observations indexed by positions below its count.
Definition (Lean source)
Given a sample size and a tuple indexed by its positions, the fixed-size embedding is the finite sample having that size and those observations.
Definition (Lean source)
Given a sample size paired with an infinite observation stream, the associated finite sample has that size and retains the corresponding stream prefix.
Definition (Lean source)
Given an observation probability law and a nonnegative Poisson mean, the finite Poisson sample law draws an independent Poisson count and i.i.d. observation stream, then retains the stream prefix selected by the count.
Definition (Lean source)
Given an observation probability law, a real-valued mark law, and a nonnegative Poisson mean, the finite marked Poisson sample law uses independent observation--mark pairs with the product of those laws as their common distribution.
Definition (Lean source)
For an observation probability law, a real-valued mark law, a nonnegative Poisson rate, and a count, the count-restricted marked law is its Poisson mass times the embedded product law.
Formal statement
Proof (Lean source)
Given a fixed array, a requested prefix length, and a proof that the request fits, the finite prefix sample retains the first m coordinates.
Definition (Lean source)
For a fixed array and a requested length, the capped prefix is the genuine prefix in the right summand when the request fits and the distinguished left summand on overflow, so overflow is never confused with an empty observation.
Definition (Lean source)
For an overflow finite sample, a fixed array, and a requested length, the totalized capped prefix agrees with the genuine prefix off overflow and uses the specified value on overflow.
Definition (Lean source)
For an observation probability law, a Poisson mean, a fixed sample size, and an overflow totalization, the nonoverflow totalized-prefix law equals the count-capped finite Poisson law.
Formal statement
Proof (Lean source)
12 supporting declarations (lemmas, instances)
-
poissonMeasure_singleton_eq_poissonPMFlemma — For a Poisson rate and a count, its probability equals the probability-mass-function value.Proof (Lean source)
lemma poissonMeasure_singleton_eq_poissonPMF (r : ℝ≥0) (n : ℕ) : poissonMeasure r {n} = poissonPMF r n := by rw [poissonMeasure_singleton, ← poissonPMFReal_ofReal_eq_poissonPMF] rfl -
measurable_fixedSizeEmbedlemma — For a fixed sample size, fixed-size embedding is measurable.Proof (Lean source)
@[fun_prop] lemma measurable_fixedSizeEmbed (n : ℕ) : Measurable (fixedSizeEmbed (X := X) n) := by change Measurable (Sigma.mk n) apply Measurable.of_le_map exact iInf_le _ n -
measurable_finiteSample_countlemma — Reading the count of a finite sample is measurable.Proof (Lean source)
@[fun_prop] lemma measurable_finiteSample_count : Measurable (FiniteSample.count : FiniteSample X → ℕ) := by apply measurable_to_countable' intro n change MeasurableSet ({s : FiniteSample X | s.1 = n}) rw [MeasurableSpace.measurableSet_iInf] intro m change MeasurableSet ((Sigma.mk m) ⁻¹' {s : FiniteSample X | s.1 = n}) by_cases hmn : m = n · subst m simp · convert MeasurableSet.empty using 1 ext x simp [hmn] -
measurable_streamToFiniteSamplelemma — Truncating a count-and-stream outcome to its selected prefix is measurable.hypothesesX :sharedType u_1conclusionMeasurable (streamToFiniteSample : (ℕ × (ℕ → X)) → FiniteSample X)Proof (Lean source)
@[fun_prop] lemma measurable_streamToFiniteSample : Measurable (streamToFiniteSample : (ℕ × (ℕ → X)) → FiniteSample X) := by intro s hs rw [MeasurableSpace.measurableSet_iInf] at hs rw [show streamToFiniteSample ⁻¹' s = ⋃ n : ℕ, {z : ℕ × (ℕ → X) | z.1 = n} ∩ (fun z : ℕ × (ℕ → X) => fun i : Fin n => z.2 i) ⁻¹' (fixedSizeEmbed n ⁻¹' s) by ext z simp only [mem_preimage, mem_iUnion, mem_inter_iff, mem_setOf_eq] constructor · intro hz exact ⟨z.1, rfl, hz⟩ · rintro ⟨n, hn, hz⟩ subst n exact hz] apply MeasurableSet.iUnion intro n apply MeasurableSet.inter · exact measurable_fst (measurableSet_singleton n) · have hsn : MeasurableSet (fixedSizeEmbed n ⁻¹' s) := hs n exact hsn.preimage (by fun_prop) -
finitePoissonSampleLaw_isProbabilityMeasureinstance — The finite Poisson sample law is a probability measure for any observation probability law and any nonnegative Poisson mean.parametersinstancefinitePoissonSampleLaw_isProbabilityMeasure P lam :given byby unfold finitePoissonSampleLaw exact Measure.isProbabilityMeasure_map measurable_streamToFiniteSample.aemeasurable -
finitePoissonSampleLaw_map_countlemma — For an observation probability law and a nonnegative Poisson mean, the count of the resulting finite sample has the scalar Poisson law with that mean.hypothesesconclusionMeasure.map FiniteSample.count (finitePoissonSampleLaw P lam) = poissonMeasure lamProof (Lean source)
lemma finitePoissonSampleLaw_map_count (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) : Measure.map FiniteSample.count (finitePoissonSampleLaw P lam) = poissonMeasure lam := by unfold finitePoissonSampleLaw rw [Measure.map_map measurable_finiteSample_count measurable_streamToFiniteSample] change Measure.map fst (poissonIIDStreamLaw P lam) = poissonMeasure lam exact poissonIIDStreamLaw_map_count P lam -
finitePoissonSampleLaw_restrict_count_eqlemma — For an observation probability law, a nonnegative Poisson mean, and a count, the restricted law is its Poisson mass times the embedded product law.hypothesesconclusion= (poissonMeasure lam) ({n} : Set ℕ) • Measure.map (fixedSizeEmbed n) (Measure.pi (fun _ : Fin n => P))Proof (Lean source)
lemma finitePoissonSampleLaw_restrict_count_eq (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) (n : ℕ) : (finitePoissonSampleLaw P lam).restrict (FiniteSample.count ⁻¹' ({n} : Set ℕ)) = (poissonMeasure lam) ({n} : Set ℕ) • Measure.map (fixedSizeEmbed n) (Measure.pi (fun _ : Fin n => P)) := by unfold finitePoissonSampleLaw poissonIIDStreamLaw rw [Measure.restrict_map measurable_streamToFiniteSample (measurable_finiteSample_count (X := X) (measurableSet_singleton n))] have hpre : streamToFiniteSample ⁻¹' (FiniteSample.count ⁻¹' ({n} : Set ℕ)) = ({n} : Set ℕ) ×ˢ (Set.univ : Set (ℕ → X)) := by ext z simp [streamToFiniteSample, FiniteSample.count] rw [hpre, ← Measure.restrict_prod_eq_prod_univ, Measure.restrict_singleton, Measure.prod_smul_left, Measure.map_smul, Measure.dirac_prod, Measure.map_map measurable_streamToFiniteSample (by fun_prop)] change (poissonMeasure lam) {n} • Measure.map (fixedSizeEmbed n ∘ fun z : ℕ → X => fun i : Fin n => z i) (iidStreamLaw P) = _ rw [← Measure.map_map (measurable_fixedSizeEmbed n) (by fun_prop), iidStreamLaw_map_finPrefix] -
finiteMarkedPoissonSampleLaw_isProbabilityMeasureinstance — The finite marked Poisson sample law is a probability measure for any observation probability law, any real-valued mark law, and any nonnegative Poisson mean.parametersX :sharedType u_1P :R :lam :ℝ≥0instancefiniteMarkedPoissonSampleLaw_isProbabilityMeasure P R lam :given byby unfold finiteMarkedPoissonSampleLaw infer_instance -
finiteMarkedPoissonSampleLaw_map_countlemma — For an observation probability law, a real-valued mark law, and a nonnegative Poisson mean, the resulting marked sample has a Poisson count with that mean.hypothesesX :sharedType u_1P :R :lam :ℝ≥0conclusionMeasure.map FiniteSample.count (finiteMarkedPoissonSampleLaw P R lam) = poissonMeasure lamProof (Lean source)
lemma finiteMarkedPoissonSampleLaw_map_count (P : Measure X) [IsProbabilityMeasure P] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : Measure.map FiniteSample.count (finiteMarkedPoissonSampleLaw P R lam) = poissonMeasure lam := by exact finitePoissonSampleLaw_map_count (P.prod R) lam -
measurable_prefixOfLEtheorem — For a fixed admissible length, taking that prefix is a measurable map of the fixed array.hypothesesX :sharedType u_1n m :ℕh :m ≤ nconclusionProof (Lean source)
@[fun_prop] theorem measurable_prefixOfLE {n m : ℕ} (h : m ≤ n) : Measurable (fun x : Fin n → X ↦ prefixOfLE x m h) := by -- Compose `measurable_fixedSizeEmbed` with the coordinate restriction map. apply (measurable_fixedSizeEmbed m).comp fun_prop -
measurable_cappedPrefixtheorem — For fixed array length, the option-valued capped prefix is jointly measurable in the array and count, with the left summand recording every overflow outcome.hypothesesX :sharedType u_1n :ℕconclusionProof (Lean source)
@[fun_prop] theorem measurable_cappedPrefix (n : ℕ) : Measurable (fun z : (Fin n → X) × ℕ ↦ cappedPrefix z.1 z.2) := by -- Partition the countable count coordinate into the measurable fibres `{m}`. apply measurable_from_prod_countable_left intro m unfold cappedPrefix change Measurable (fun x : Fin n → X ↦ if h : m ≤ n then inr (prefixOfLE x m h) else inl ()) split · exact measurable_inr.comp (measurable_prefixOfLE (X := X) ‹m ≤ n›) · fun_prop -
measurable_totalizedPrefixtheorem — For a specified overflow sample, the totalized capped-prefix map is measurable.hypothesesconclusionProof (Lean source)
@[fun_prop] theorem measurable_totalizedPrefix {n : ℕ} (overflow : FiniteSample X) : Measurable (fun z : (Fin n → X) × ℕ ↦ totalizedPrefix overflow z.1 z.2) := by -- Compose `measurable_cappedPrefix` with measurable sum elimination. exact (measurable_const.sumElim measurable_id).comp (measurable_cappedPrefix n)
KL 4 core · 4 supporting This file packages a finite measure as a Poisson count with mean equal to its mass times a scalar intensity and conditionally i.i.d. ★ klDiv_finiteMeasureMarkedPoissonLaw
Relative entropy of finite Poisson experiments
This file packages a finite measure as a Poisson count with mean equal to its mass times a scalar intensity and conditionally i.i.d. points from its normalisation. It states the extended-real KL identity for two equal-mass finite intensity measures and the monotone upper-bound form used in testing arguments. A shared independent real mark law is carried throughout.
Given a finite measure, its finite-measure mass is its total mass on the observation space, represented as a nonnegative real number.
Definition (Lean source)
Given a finite measure and a fallback probability law, the normalized finite measure is the fallback when the measure is zero and otherwise is the measure divided by its total mass.
Definition (Lean source)
Given a finite intensity measure, a fallback probability law, a real-valued mark law, and a nonnegative scalar intensity, the finite-measure marked Poisson law normalizes the intensity measure and uses a Poisson mean equal to the scalar intensity times its total mass.
Definition (Lean source)
For two finite intensity measures, a fallback probability law, a real-valued mark law, and a nonnegative scalar intensity, if the intensity measures have equal total mass, their marked Poisson divergence is the scalar intensity times their divergence.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
normalizedFiniteMeasure_isProbabilityMeasureinstance — Normalizing a finite measure produces a probability measure on a measurable observation space, using the finite measure and a fallback probability law.parametersinstancenormalizedFiniteMeasure_isProbabilityMeasure ν P₀ :given byby classical rw [normalizedFiniteMeasure] split_ifs with hν · infer_instance · rw [isProbabilityMeasure_iff, Measure.smul_apply _ _ univ] have hmass : ν univ≠ 0 := by exact fun h ↦ hν (Measure.measure_univ_eq_zero.mp h) exact ENNReal.inv_mul_cancel hmass (ne_of_lt (measure_lt_top ν univ)) -
finiteMeasureMarkedPoissonLaw_isProbabilityMeasureinstance — The finite-measure marked Poisson law is a probability measure on a measurable observation space, for a finite intensity measure, a fallback probability law, a real-valued mark law, and a nonnegative scalar intensity.parametersX :sharedType u_1ν :P₀ :R :lam :ℝ≥0instancefiniteMeasureMarkedPoissonLaw_isProbabilityMeasure ν P₀ R lam :IsProbabilityMeasure (finiteMeasureMarkedPoissonLaw ν P₀ R lam)given byby unfold finiteMeasureMarkedPoissonLaw infer_instance -
finiteMeasureMarkedPoissonLaw_map_countlemma — For a finite intensity measure, a fallback probability law, a real-valued mark law, and a nonnegative scalar intensity, the count is Poisson with mean equal to the scaled total intensity mass.hypothesesX :sharedType u_1ν :P₀ :R :lam :ℝ≥0conclusionMeasure.map FiniteSample.count (finiteMeasureMarkedPoissonLaw ν P₀ R lam)= poissonMeasure (lam * finiteMeasureMass ν)Proof (Lean source)
lemma finiteMeasureMarkedPoissonLaw_map_count (ν : Measure X) [IsFiniteMeasure ν] (P₀ : Measure X) [IsProbabilityMeasure P₀] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : Measure.map FiniteSample.count (finiteMeasureMarkedPoissonLaw ν P₀ R lam) = poissonMeasure (lam * finiteMeasureMass ν) := by exact finiteMarkedPoissonSampleLaw_map_count (normalizedFiniteMeasure ν P₀) R (lam * finiteMeasureMass ν) -
klDiv_finiteMeasureMarkedPoissonLaw_lelemma — For two finite intensity measures, a fallback probability law, a real-valued mark law, a nonnegative scalar intensity, and a divergence budget, if the measures have equal total mass and their divergence is within the budget, the marked-experiment divergence is at most the scaled budget.Proof (Lean source)
lemma klDiv_finiteMeasureMarkedPoissonLaw_le [StandardBorelSpace X] (ν₀ ν₁ : Measure X) [IsFiniteMeasure ν₀] [IsFiniteMeasure ν₁] (P₀ : Measure X) [IsProbabilityMeasure P₀] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) (B : ℝ≥0∞) (hmass : ν₀ univ = ν₁ univ) (hKL : klDiv ν₀ ν₁ ≤ B) : klDiv (finiteMeasureMarkedPoissonLaw ν₀ P₀ R lam) (finiteMeasureMarkedPoissonLaw ν₁ P₀ R lam) ≤ (lam : ℝ≥0∞) * B := by rw [klDiv_finiteMeasureMarkedPoissonLaw ν₀ ν₁ P₀ R lam hmass] exact mul_le_mul_right hKL (lam : ℝ≥0∞)
Depoissonization 4 core · 12 supporting This file provides measurable maps between dependent finite samples, padded streams, and canonical marked configurations. ★ markedPoissonKL_le_two_mul_of_piKL
Finite-sample maps and de-Poissonization
This file provides measurable maps between dependent finite samples, padded streams, and canonical marked configurations. It also records the Poisson count identity and a reusable exponential lower-tail bound used to transfer random-size experiments to fixed sample sizes.
Given a map between observation spaces and a finite sample, the mapped finite sample has the same size and applies the map to every observation.
Definition (Lean source)
For two observation probability laws, a real-valued mark law, and a sample size, suppose the size is positive and the product-law divergence is within a budget. The corresponding doubled-mean marked Poisson divergence is at most twice the budget.
Formal statement
Proof (Lean source)
Given a fallback observation, a prefix length, and a finite sample of observation--mark pairs, the canonical prefix consists of the first n observations when available and otherwise repeats the fallback n times.
Definition (Lean source)
Given a fallback observation and a finite sample, its padded stream representation records the sample size, then agrees with its observations below that size and equals the fallback thereafter.
Definition (Lean source)
12 supporting declarations (lemmas, instances)
-
measurable_finiteSampleMaplemma — If a map between observation spaces is measurable, pointwise finite-sample mapping is measurable.hypothesesconclusionProof (Lean source)
@[fun_prop] lemma measurable_finiteSampleMap {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] (f : X → Y) (hf : Measurable f) : Measurable (finiteSampleMap f : FiniteSample X → FiniteSample Y) := by intro s hs rw [MeasurableSpace.measurableSet_iInf] at hs ⊢ intro n let g : (Fin n → X) → (Fin n → Y) := fun x i => f (x i) have hg : Measurable g := measurable_pi_lambda _ fun i => hf.comp (measurable_pi_apply i) have hsn := hs n change MeasurableSet (fixedSizeEmbed n ⁻¹' s) at hsn change MeasurableSet ((fun x : Fin n → X => ⟨n, fun i => f (x i)⟩) ⁻¹' s) exact hsn.preimage hg -
finiteSampleMap_fixedSizeEmbedlemma — For a map between observation spaces, a sample size, and a tuple of that size, mapping commutes with fixed-size embedding.hypothesesconclusionProof (Lean source)
lemma finiteSampleMap_fixedSizeEmbed {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] (f : X → Y) (n : ℕ) (x : Fin n → X) : finiteSampleMap f (fixedSizeEmbed n x) = fixedSizeEmbed n (fun i => f (x i)) := rfl -
cellObservationLaw_eq_of_restrict_eqlemma — For a measurable partition, two probability laws, and a selected cell, if the first law gives the cell positive mass, the laws give it equal mass, and their restrictions to it agree, their normalized within-cell laws agree.hypothesesX ι :p :μ ν :j :ιhpos :μ (p.cellSet j) ≠ 0hmass :μ (p.cellSet j) = ν (p.cellSet j)hrest :μ.restrict (p.cellSet j) = ν.restrict (p.cellSet j)conclusionp.cellObservationLaw μ j = p.cellObservationLaw ν jProof (Lean source)
lemma cellObservationLaw_eq_of_restrict_eq {X ι : Type*} [MeasurableSpace X] [Fintype ι] [MeasurableSpace ι] [MeasurableSingletonClass ι] (p : FiniteMeasurablePartition X ι) (μ ν : Measure X) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (j : ι) (hpos : μ (p.cellSet j) ≠ 0) (hmass : μ (p.cellSet j) = ν (p.cellSet j)) (hrest : μ.restrict (p.cellSet j) = ν.restrict (p.cellSet j)) : p.cellObservationLaw μ j = p.cellObservationLaw ν j := by unfold FiniteMeasurablePartition.cellObservationLaw have hν : ν (p.cellSet j) ≠ 0 := by simpa [← hmass] rw [dif_neg hpos, dif_neg hν, ← hmass, hrest] -
measurable_canonicalPrefixObservationslemma — For a fallback observation and a prefix length, reading the canonical prefix is measurable.hypothesesconclusionProof (Lean source)
@[fun_prop] lemma measurable_canonicalPrefixObservations {X : Type*} [MeasurableSpace X] (x₀ : X) (n : ℕ) : Measurable (canonicalPrefixObservations x₀ n : FiniteSample (X × ℝ) → Fin n → X) := by unfold canonicalPrefixObservations apply measurable_pi_lambda intro k t ht rw [MeasurableSpace.measurableSet_iInf] intro m change MeasurableSet ((fun x : Fin m → X × ℝ => (if h : n ≤ m then fun k => (x (castLE h k)).1 else fun _ => x₀) k) ⁻¹' t) by_cases h : n ≤ m · simp only [dif_pos h] exact ht.preimage ((measurable_pi_apply (castLE h k)).fst) · simp only [dif_neg h] exact measurable_const ht -
map_canonicalPrefixObservations_restrict_count_gelemma — For an observation probability law, an atomless mark law, a nonnegative intensity, a fallback observation, and a prefix length, the successful canonical prefix has the event mass times the product law.hypothesesX :Type*P :lam :ℝ≥0x₀ :Xn :ℕconclusionMeasure.map (canonicalPrefixObservations x₀ n) ((canonicalMarkedPoissonSampleLaw P R lam).restrict (FiniteSample.count ⁻¹' Ici n))Proof (Lean source)
lemma map_canonicalPrefixObservations_restrict_count_ge {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (R : Measure ℝ) [IsProbabilityMeasure R] [NullSingletonClass R] (lam : ℝ≥0) (x₀ : X) (n : ℕ) : Measure.map (canonicalPrefixObservations x₀ n) ((canonicalMarkedPoissonSampleLaw P R lam).restrict (FiniteSample.count ⁻¹' Ici n)) = (poissonMeasure lam) (Ici n) • Measure.pi (fun _ : Fin n => P) := by let μ := finiteMarkedPoissonSampleLaw P R lam have hcount : orderByMarks ⁻¹' (FiniteSample.count ⁻¹' Ici n : Set (FiniteSample (X × ℝ))) = FiniteSample.count ⁻¹' Ici n := by ext s change (n ≤ (orderByMarks s).count) ↔ n ≤ s.count rw [orderByMarks_count] rw [canonicalMarkedPoissonSampleLaw, Measure.restrict_map measurable_orderByMarks (measurable_finiteSample_count (measurableSet_Ici)), hcount, Measure.map_map (measurable_canonicalPrefixObservations x₀ n) measurable_orderByMarks] have hfun : canonicalPrefixObservations x₀ n ∘ orderByMarks = retainedObservations x₀ n := by funext s unfold canonicalPrefixObservations retainedObservations by_cases h : n ≤ s.count · simp only [orderByMarks_count, dif_pos h, Function.comp_apply] funext k congr 2 · simp only [orderByMarks_count, dif_neg h, Function.comp_apply] rw [hfun] exact map_retainedObservations_restrict_count_ge P R lam x₀ n -
poisson_two_n_lower_taillemma — For a target sample size, the corresponding doubled-mean Poisson lower tail has the stated exponential bound.Proof (Lean source)
lemma poisson_two_n_lower_tail (n : ℕ) : (poissonMeasure (2 * n)) {k | k < n} ≤ ofReal (exp (-(n : ℝ) * (1 - log 2))) := by rw [show {k : ℕ | k < n} = (↑(range n) : Set ℕ) by ext k; simp] rw [← MeasureTheory.sum_measure_singleton] simp_rw [poissonMeasure_singleton_eq_poissonPMF] have hterm : ∀ k ∈ range n, poissonPMF (2 * n) k ≤ ofReal (exp (-(n : ℝ) * (1 - log 2))) * poissonPMF n k := by intro k hk have hreal : poissonPMFReal (2 * (n : ℝ≥0)) k ≤ exp (-(n : ℝ) * (1 - log 2)) * poissonPMFReal (n : ℝ≥0) k := by unfold poissonPMFReal rw [← mul_div_assoc] apply (div_le_div_iff_of_pos_right (by positivity : (0 : ℝ) < k.factorial)).2 have hn0 : (0 : ℝ) ≤ n := by positivity have hpow : (2 : ℝ) ^ k ≤ 2 ^ n := pow_le_pow_right₀ (by norm_num) (Finset.mem_range.1 hk).le have htarget : exp (-(n : ℝ) * (1 - log 2)) = exp (-(n : ℝ)) * (2 : ℝ) ^ n := by rw [show -(n : ℝ) * (1 - log 2) = -(n : ℝ) + log 2 * n by ring, Real.exp_add, show log 2 * (n : ℝ) = (n : ℝ) * log 2 by ring, Real.exp_nat_mul, Real.exp_log (by norm_num : (0 : ℝ) < 2)] have hexp2 : exp (-((2 : ℝ) * (n : ℝ))) = exp (-(n : ℝ)) * exp (-(n : ℝ)) := by rw [← Real.exp_add] congr 1 ring norm_num only [NNReal.smul_def, NNReal.coe_natCast, NNReal.coe_mul, Nat.cast_ofNat] rw [mul_pow, htarget] change exp (-(2 * (n : ℝ))) * ((2 : ℝ) ^ k * (n : ℝ) ^ k) ≤ _ rw [hexp2] calc exp (-(n : ℝ)) * exp (-(n : ℝ)) * ((2 : ℝ) ^ k * (n : ℝ) ^ k) = (exp (-(n : ℝ)) * exp (-(n : ℝ)) * (n : ℝ) ^ k) * 2 ^ k := by ring _ ≤ (exp (-(n : ℝ)) * exp (-(n : ℝ)) * (n : ℝ) ^ k) * 2 ^ n := mul_le_mul_of_nonneg_left hpow (by positivity) _ = exp (-(n : ℝ)) * 2 ^ n * (exp (-(n : ℝ)) * (n : ℝ) ^ k) := by ring unfold poissonPMF change ofReal (poissonPMFReal (2 * n) k) ≤ ofReal (exp (-(n : ℝ) * (1 - log 2))) * ofReal (poissonPMFReal n k) rw [← ENNReal.ofReal_mul (Real.exp_pos _).le] exact ENNReal.ofReal_le_ofReal hreal calc ∑ k ∈ range n, poissonPMF (2 * n) k ≤ ∑ k ∈ range n, ofReal (exp (-(n : ℝ) * (1 - log 2))) * poissonPMF n k := Finset.sum_le_sum hterm _ = ofReal (exp (-(n : ℝ) * (1 - log 2))) * ∑ k ∈ range n, poissonPMF n k := by rw [Finset.mul_sum] _ ≤ ofReal (exp (-(n : ℝ) * (1 - log 2))) * 1 := by gcongr exact ((poissonPMF n).property.summable.sum_le_tsum _ (fun _ _ => bot_le)).trans_eq (poissonPMF n).property.tsum_eq _ = _ := mul_one _ -
finiteSamplePaddedStream_measurablelemma — Given a fallback observation, mapping a finite sample to its padded stream is measurable.Proof (Lean source)
@[fun_prop] lemma finiteSamplePaddedStream_measurable {X : Type*} [MeasurableSpace X] (x0 : X) : Measurable (finiteSamplePaddedStream x0) := by intro t ht rw [MeasurableSpace.measurableSet_iInf] intro n change MeasurableSet ((fun s : Fin n → X => finiteSamplePaddedStream x0 ⟨n, s⟩) ⁻¹' t) apply ht.preimage apply measurable_const.prodMk apply measurable_pi_lambda intro k by_cases hk : k < n · let i : Fin n := ⟨k, hk⟩ simpa [finiteSamplePaddedStream, FiniteSample.count, FiniteSample.points, hk, i] using (measurable_pi_apply i : Measurable (fun s : Fin n → X => s i)) · simp [finiteSamplePaddedStream, FiniteSample.count, hk] -
streamToFiniteSample_paddedStreamlemma — Given a fallback observation and a finite sample, converting its padded stream back recovers the sample.hypothesesconclusionstreamToFiniteSample (finiteSamplePaddedStream x0 s) = sProof (Lean source)
lemma streamToFiniteSample_paddedStream {X : Type*} [MeasurableSpace X] (x0 : X) (s : FiniteSample X) : streamToFiniteSample (finiteSamplePaddedStream x0 s) = s := by cases s with | mk n s => change (⟨n, fun k => if h : k < n then s ⟨k, h⟩ else x0⟩ : Σ n : ℕ, Fin n → X) = ⟨n, s⟩ congr funext k simp -
finiteSamplePaddedStream_rangelemma — Given a fallback observation, the padded-stream range consists exactly of streams equal to it beyond their size.hypothesesX :Type*x0 :Xconclusionrange (finiteSamplePaddedStream x0) = {z : ℕ × (ℕ → X) | ∀ k, z.1 ≤ k → z.2 k = x0}Proof (Lean source)
lemma finiteSamplePaddedStream_range {X : Type*} [MeasurableSpace X] (x0 : X) : range (finiteSamplePaddedStream x0) = {z : ℕ × (ℕ → X) | ∀ k, z.1 ≤ k → z.2 k = x0} := by ext z constructor · rintro ⟨s, rfl⟩ k hk have hnot : ¬k < s.count := Nat.not_lt_of_ge hk simp [finiteSamplePaddedStream, hnot] · intro hz refine ⟨streamToFiniteSample z, ?_⟩ apply Prod.ext · rfl · funext k by_cases hk : k < z.1 · simp [finiteSamplePaddedStream, FiniteSample.count, FiniteSample.points, streamToFiniteSample, hk] · simp [finiteSamplePaddedStream, FiniteSample.count, FiniteSample.points, streamToFiniteSample, hk, hz k (Nat.le_of_not_gt hk)] -
finiteSample_standardBorelSpaceinstance — Finite samples form a standard Borel space whenever the observation space is nonempty and standard Borel.parametersX :instancegiven byby let x0 : X := Classical.choice ‹Nonempty X› let rangeSet : Set (ℕ × (ℕ → X)) := range (finiteSamplePaddedStream x0) have hrange : MeasurableSet rangeSet := by dsimp [rangeSet] rw [finiteSamplePaddedStream_range x0] rw [show {z : ℕ × (ℕ → X) | ∀ k, z.1 ≤ k → z.2 k = x0} = ⋂ k : ℕ, {z | k < z.1} ∪ {z | z.2 k = x0} by ext z simp only [Set.mem_setOf_eq, Set.mem_iInter, Set.mem_union] constructor · intro h k by_cases hk : k < z.1 · exact inl hk · exact inr (h k (Nat.le_of_not_gt hk)) · intro h k hk exact (h k).resolve_left (Nat.not_lt_of_ge hk)] apply MeasurableSet.iInter intro k exact (measurableSet_lt measurable_const measurable_fst).union ((measurableSet_singleton x0).preimage ((measurable_pi_apply k).comp measurable_snd)) let e : FiniteSample X ≃ᵐ rangeSet := { toEquiv := { toFun := fun s => ⟨finiteSamplePaddedStream x0 s, ⟨s, rfl⟩⟩ invFun := fun z => streamToFiniteSample z.1 left_inv := streamToFiniteSample_paddedStream x0 right_inv := by intro z apply Subtype.ext obtain ⟨s, hs⟩ := z.2 change finiteSamplePaddedStream x0 (streamToFiniteSample z.1) = z.1 rw [← hs, streamToFiniteSample_paddedStream] } measurable_toFun := by exact (finiteSamplePaddedStream_measurable x0).subtype_mk (h := fun s => ⟨s, rfl⟩) measurable_invFun := by exact measurable_streamToFiniteSample.comp measurable_subtype_coe } letI hsb : StandardBorelSpace rangeSet := hrange.standardBorel letI upgraded : UpgradedStandardBorel rangeSet := upgradeStandardBorel rangeSet letI : TopologicalSpace rangeSet := upgraded.toTopologicalSpace letI : BorelSpace rangeSet := upgraded.toBorelSpace letI : PolishSpace rangeSet := upgraded.toPolishSpace let tau : TopologicalSpace (FiniteSample X) := (inferInstance : TopologicalSpace rangeSet).induced e refine ⟨⟨tau, ?_, ?_⟩⟩ · exact e.measurableEmbedding.borelSpace ⟨rfl⟩ · exact e.toEquiv.polishSpace_induced -
canonicalMarkedPoissonSampleLaw_map_countlemma — Given a base probability law, a mark probability law, and a nonnegative intensity, the canonical marked-Poisson sample has a Poisson count with that intensity.hypothesesX :Type*P :R :lam :ℝ≥0conclusionMeasure.map FiniteSample.count (canonicalMarkedPoissonSampleLaw P R lam)= poissonMeasure lamProof (Lean source)
lemma canonicalMarkedPoissonSampleLaw_map_count {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : Measure.map FiniteSample.count (canonicalMarkedPoissonSampleLaw P R lam) = poissonMeasure lam := by unfold canonicalMarkedPoissonSampleLaw rw [Measure.map_map measurable_finiteSample_count measurable_orderByMarks] simpa only [Function.comp_def, orderByMarks_count] using finiteMarkedPoissonSampleLaw_map_count P R lam -
finiteMeasureMarkedPoissonLaw_probability_eqtheorem — For an intensity measure that is already a probability law, a fallback probability law, a real-valued mark law, and a nonnegative intensity, the finite-measure wrapper equals the ordinary marked Poisson sample law.hypothesesX :Type*P :P0 :R :lam :ℝ≥0conclusionfiniteMeasureMarkedPoissonLaw P P0 R lam = finiteMarkedPoissonSampleLaw P R lamProof (Lean source)
theorem finiteMeasureMarkedPoissonLaw_probability_eq {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (P0 : Measure X) [IsProbabilityMeasure P0] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : finiteMeasureMarkedPoissonLaw P P0 R lam = finiteMarkedPoissonSampleLaw P R lam := by have hP : P ≠ 0 := by intro h have : P univ = 1 := by simp simp [h] at this have hnorm : normalizedFiniteMeasure P P0 = P := by unfold normalizedFiniteMeasure rw [dif_neg hP] simp have hmass : finiteMeasureMass P = 1 := by unfold finiteMeasureMass simp unfold finiteMeasureMarkedPoissonLaw rw [hmass, mul_one] congr 2
IIDPoisson 3 core · 4 supporting This file provides the paper-neutral count-and-stream probability space used as the elementary input to finite marked Poisson constructions. ★ iidStreamLaw_map_finPrefix
I.i.d. streams paired with an independent Poisson count
This file provides the paper-neutral count-and-stream probability space used as the elementary input to finite marked Poisson constructions. An infinite i.i.d. stream has exact finite product marginals, and pairing it with an independent scalar Poisson count preserves both the count and prefix laws.
Given a probability measure on a measurable sample space, the infinite i.i.d. stream law is the product probability measure on infinite sequences whose every coordinate has that measure as its marginal.
Definition (Lean source)
Every finite prefix length under an i.i.d. stream law has the corresponding finite product law.
Formal statement
Proof (Lean source)
Given an observation probability law and a nonnegative Poisson rate, the joint count-and-stream law is the product law of a Poisson count with that rate and an independent infinite stream whose coordinates are independent with the given common distribution.
Definition (Lean source)
4 supporting declarations (lemmas, instances)
-
iidStreamLaw_isProbabilityMeasureinstance — The infinite i.i.d. stream law is a probability measure on a measurable sample space with a probability law. -
poissonIIDStreamLaw_isProbabilityMeasureinstance — The independent Poisson count-and-stream law is a probability measure on a measurable sample space with an observation probability law and a nonnegative Poisson rate. -
poissonIIDStreamLaw_map_countlemma — For an observation probability law and a nonnegative Poisson rate, the count coordinate has the scalar Poisson law with that rate.hypothesesconclusionProof (Lean source)
lemma poissonIIDStreamLaw_map_count (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) : Measure.map fst (poissonIIDStreamLaw P lam) = poissonMeasure lam := by unfold poissonIIDStreamLaw iidStreamLaw rw [Measure.map_fst_prod, measure_univ, one_smul] -
poissonIIDStreamLaw_map_finPrefixlemma — For an observation probability law, a nonnegative Poisson rate, and a prefix length, the stream prefix has the exact product observation law.hypothesesconclusionMeasure.map (fun z : ℕ × (ℕ → X) => fun i : Fin n => z.2 i) (poissonIIDStreamLaw P lam)= Measure.pi (fun _ : Fin n => P)Proof (Lean source)
lemma poissonIIDStreamLaw_map_finPrefix (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) (n : ℕ) : Measure.map (fun z : ℕ × (ℕ → X) => fun i : Fin n => z.2 i) (poissonIIDStreamLaw P lam) = Measure.pi (fun _ : Fin n => P) := by rw [show (fun z : ℕ × (ℕ → X) => fun i : Fin n => z.2 i) = (fun z : ℕ → X => fun i : Fin n => z i) ∘ snd by rfl, ← Measure.map_map (by fun_prop) (by fun_prop)] unfold poissonIIDStreamLaw rw [Measure.map_snd_prod, measure_univ, one_smul, iidStreamLaw_map_finPrefix]