Mathlib.Probability.FiniteMarkedPoissonPartition
Finite marked Poisson experiment infrastructure: finite samples, exact partition splitting, canonical mark-ordered superposition, retained independent prefixes, depoissonization bridges, and the finite-measure KL identity.
Basic 6 core · 9 supporting 6 to review This file turns an independent Poisson count and infinite i.i.d. ★ finiteMarkedPoissonSampleLaw_restrict_count_eq
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.
A finite sequence is a length together with coordinates indexed by that length.
Definition (Lean source)
Embed a fixed-length tuple into the space of all finite sequences.
Definition (Lean source)
Truncate a count-and-stream outcome to the prefix selected by its count.
Definition (Lean source)
The finite Poisson sample law is obtained by drawing an independent scalar Poisson count and i.i.d. stream and retaining exactly the selected prefix.
Definition (Lean source)
A finite marked Poisson sample has i.i.d. observation-mark pairs, with observation law P, independent mark law R, and Poisson mean lam.
Definition (Lean source)
Fix a nonnegative Poisson rate lam. For an observation law P and an independent mark law R, restricting the finite marked Poisson sample law to the event that the observed count equals n yields exactly poissonMeasure lam {n} times the pushforward, under the fixed-size embedding, of n independent draws from the product measure P.prod R.
Formal statement
Proof (Lean source)
9 supporting declarations (lemmas, instances)
-
poissonMeasure_singleton_eq_poissonPMFlemma — The Poisson law with mean r gives the single count n exactly the Poisson probability mass at n.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 — Embedding a fixed-size tuple into the finite-sequence space is measurable.Proof (Lean source)
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 sequence is measurable.conclusionMeasurable (FiniteSample.count : FiniteSample X → ℕ)Proof (Lean source)
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.conclusionMeasurable (streamToFiniteSample : (ℕ × (ℕ → X)) → FiniteSample X)Proof (Lean source)
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.instance finitePoissonSampleLaw_isProbabilityMeasure (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) : IsProbabilityMeasure (finitePoissonSampleLaw P lam) := by unfold finitePoissonSampleLaw exact Measure.isProbabilityMeasure_map measurable_streamToFiniteSample.aemeasurable -
finitePoissonSampleLaw_map_countlemma — The count of a finite Poisson sample has scalar Poisson law with the requested mean.hypothesesP :lam :ℝ≥0conclusionMeasure.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 — On the fibre where the count equals n, the finite Poisson law is the Poisson mass at n times the embedded n-fold 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.instance finiteMarkedPoissonSampleLaw_isProbabilityMeasure (P : Measure X) [IsProbabilityMeasure P] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : IsProbabilityMeasure (finiteMarkedPoissonSampleLaw P R lam) := by unfold finiteMarkedPoissonSampleLaw infer_instance -
finiteMarkedPoissonSampleLaw_map_countlemma — The count of a finite marked Poisson sample has scalar Poisson law with mean lam.hypothesesconclusionMeasure.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
KL 4 core · 4 supporting 4 to review 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.
The total mass of a finite measure as a nonnegative real.
Definition (Lean source)
Normalise a nonzero finite measure to a probability measure, using the supplied probability law only on the zero-measure branch.
Definition (Lean source)
The marked Poisson experiment generated by finite intensity measure ν has count mean lam * ν(univ) and conditionally i.i.d. points from the normalisation of ν, with independent marks from R.
Definition (Lean source)
Fix a nonnegative Poisson rate lam and suppose the finite intensity measures ν₀ and ν₁ have equal total mass. Then, for a common baseline probability measure P₀ and mark law R, the KL divergence between the finite-measure marked Poisson experiments generated by ν₀ and by ν₁ equals lam times the KL divergence between ν₀ and ν₁.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
normalizedFiniteMeasure_isProbabilityMeasureinstance — The normalisation of a finite measure is a probability measure, including the explicit fallback on the zero branch.instance normalizedFiniteMeasure_isProbabilityMeasure (ν : Measure X) [IsFiniteMeasure ν] (P₀ : Measure X) [IsProbabilityMeasure P₀] : IsProbabilityMeasure (normalizedFiniteMeasure ν P₀) := by 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 — A finite-measure marked Poisson experiment is a probability measure.instance finiteMeasureMarkedPoissonLaw_isProbabilityMeasure (ν : Measure X) [IsFiniteMeasure ν] (P₀ : Measure X) [IsProbabilityMeasure P₀] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : IsProbabilityMeasure (finiteMeasureMarkedPoissonLaw ν P₀ R lam) := by unfold finiteMeasureMarkedPoissonLaw infer_instance -
finiteMeasureMarkedPoissonLaw_map_countlemma — The count in the finite-measure marked Poisson experiment is Poisson with mean lam times the total mass of the intensity measure.hypothesesν :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 — A one-point finite-measure KL bound transfers directly to the corresponding marked Poisson experiments after multiplication by the scalar intensity.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 4 to review 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.
Mapping every point of a finite sample preserves its random count.
Definition (Lean source)
Consider a sample size n that is at least 1 and a nonnegative KL budget B, and suppose the KL divergence between n independent identically distributed draws from P and from Q is at most B. Then the KL divergence between the marked Poisson experiments with mean count 2n, mark law R, and intensity measures P and Q respectively (both built over the same baseline P) is at most 2B.
Formal statement
Proof (Lean source)
A marked finite sample supplies its first n observation coordinates when it is long enough, and otherwise supplies a fixed fallback tuple.
Definition (Lean source)
A finite sample embeds into a count-and-stream representation by padding all coordinates beyond its count with a fixed fallback observation.
Definition (Lean source)
12 supporting declarations (lemmas, instances)
-
measurable_finiteSampleMaplemma — Pointwise mapping of dependent finite samples is measurable.hypothesesconclusionProof (Lean source)
-- @node: measurable_finiteSampleMap 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 — Mapping commutes with fixed-size embedding.hypothesesconclusionProof (Lean source)
-- @node: finiteSampleMap_fixedSizeEmbed 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 — Equal restrictions and equal cell masses give equal normalized cell laws.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)
-- @node: cellObservationLaw_eq_of_restrict_eq 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 — Reading a fixed prefix from a canonical finite configuration is measurable.hypothesesconclusionProof (Lean source)
-- @node: measurable_canonicalPrefixObservations 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 (Fin.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 (Fin.castLE h k)).fst) · simp only [dif_neg h] exact measurable_const ht -
map_canonicalPrefixObservations_restrict_count_gelemma — On the successful-count event, the canonical marked-Poisson configuration's first n observations have the unnormalised 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)
-- @node: map_canonicalPrefixObservations_restrict_count_ge 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 — The lower tail used in de-Poissonization is exponentially small.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_measurablelemmaProof (Lean source)
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_paddedStreamlemmahypothesesconclusionstreamToFiniteSample (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_rangelemmahypothesesX :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 over a nonempty standard Borel space are standard Borel. The explicit padded-stream presentation supplies the compatible Polish topology missing from the generic dependent-sum instance.-- @node: finiteSample_standardBorelSpace noncomputable instance finiteSample_standardBorelSpace {X : Type*} [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] : StandardBorelSpace (FiniteSample X) := by 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_countlemmahypothesesX :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 — When the intensity measure is already a probability law, the finite-measure Poisson wrapper agrees with 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 3 to review 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.
The law of an infinite i.i.d. stream with one-coordinate law P.
Definition (Lean source)
Every finite prefix of length n of an infinite stream whose coordinates are i.i.d. with common law P has exactly the corresponding n-fold product law.
Formal statement
Proof (Lean source)
An independent scalar Poisson count and infinite i.i.d. stream.
Definition (Lean source)
4 supporting declarations (lemmas, instances)
-
iidStreamLaw_isProbabilityMeasureinstance — The infinite i.i.d. stream law is a probability measure.instance iidStreamLaw_isProbabilityMeasure (P : Measure X) [IsProbabilityMeasure P] : IsProbabilityMeasure (iidStreamLaw P) := by unfold iidStreamLaw infer_instance -
poissonIIDStreamLaw_isProbabilityMeasureinstance — The independent Poisson-count and i.i.d.-stream law is a probability measure.instance poissonIIDStreamLaw_isProbabilityMeasure (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) : IsProbabilityMeasure (poissonIIDStreamLaw P lam) := by unfold poissonIIDStreamLaw infer_instance -
poissonIIDStreamLaw_map_countlemma — The count coordinate has the requested scalar Poisson law.hypothesesP :lam :ℝ≥0conclusionProof (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 — Every finite stream prefix remains an exact product sample after pairing the stream with an independent Poisson count.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]