Offline · exact source
Exact Lean source

CountMultinomialMeasurability

formalization/Cloning/CountMultinomialMeasurability.lean

Source hash: 437d15cb3f5d2df5749f78a043df7f3444a9e29280e54cc996d03e45f4afd9c9

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Cloning.CountMultinomialDensity
2import Cloning.YoungUniformLocalQuantization
3 
4/-! Continuous parameter dependence and joint measurability of actual count smoothing. -/
5noncomputable section
6open scoped BigOperators Topology Classical
7open Filter MeasureTheory TopologicalSpace
8namespace Cloning.CountMultinomial
9open Cloning.YoungGeneral Cloning.YoungHyperplane Cloning.GeneralSymmetricOccupation
10set_option backward.isDefEq.respectTransparency false
11set_option maxHeartbeats 1000000
12 
13theorem density_eq_lattice (d N : ℕ) (hN : 0<N) (p : Fin (d+1) → ℝ)
14    (hp : ∀ i, 0≤p i) (hs : ∑ i, p i=1) (x : rootSpace d) :
15    density d N p hp hs x=(Real.sqrt (N : ℝ)^d/Real.sqrt ((d : ℝ)+1))*
16      (latticePMF d N p hp hs (sampleLabel d N (flatSpectrum (d+1)) x)).toReal := by
17  rw [density, sampleInterpolate_eq_on_cell d N (by exact_mod_cast hN) _ _ _ x
18    (mem_sampleCell_sampleLabel d N (flatSpectrum (d+1)) x)]
19  norm_cast
20 
21theorem density_eq_word_sum (d N : ℕ) (hN : 0<N) (p : Fin (d+1) → ℝ)
22    (hp : ∀ i, 0≤p i) (hs : ∑ i, p i=1) (x : rootSpace d) :
23    density d N p hp hs x=(Real.sqrt (N : ℝ)^d/Real.sqrt ((d : ℝ)+1))*
24      (∑ w : Word N (d+1), if sampleLabel d N (flatSpectrum (d+1)) x=shapeLattice d N (countShape w)
25        then wordWeight p w else 0) := by
26  rw [density_eq_lattice d N hN, latticePMF, countPMF, PMF.map_comp, PMF.map_apply,
27    tsum_fintype, ENNReal.toReal_sum]
28  · congr 1
29    apply Finset.sum_congr rfl
30    intro w _
31    dsimp only [Function.comp_def]
32    split_ifs
33    · exact wordPMF_toReal _ _ _ _ _ _
34    · rfl
35  · intro w _
36    split_ifs
37    · exact PMF.apply_ne_top _ _
38    · exact ENNReal.zero_ne_top
39 
40theorem measurable_density (d N : ℕ) (hN : 0<N) (p : Fin (d+1) → ℝ)
41    (hp : ∀ i, 0≤p i) (hs : ∑ i, p i=1) : Measurable (density d N p hp hs) := by
42  change Measurable (fun x ↦ density d N p hp hs x)
43  simp_rw [density_eq_lattice d N hN]
44  exact ((measurable_of_countable (fun μ : Lattice d (N : ℤ) ↦
45    (latticePMF d N p hp hs μ).toReal)).comp (measurable_sampleLabel d N _)).const_mul _
46 
47theorem continuous_density_parameter {Z : Type*} [TopologicalSpace Z]
48    (d N : ℕ) (hN : 0<N) (p : Z → Fin (d+1) → ℝ)
49    (hp : ∀ z i, 0≤p z i) (hs : ∀ z, ∑ i, p z i=1)
50    (hc : ∀ i, Continuous (fun z ↦ p z i)) (x : rootSpace d) :
51    Continuous (fun z ↦ density d N (p z) (hp z) (hs z) x) := by
52  simp_rw [density_eq_word_sum d N hN]
53  apply Continuous.const_mul
54  apply continuous_finset_sum
55  intro w _
56  by_cases hw : sampleLabel d N (flatSpectrum (d+1)) x=shapeLattice d N (countShape w)
57  · simp only [hw, if_true, wordWeight]
58    exact continuous_finset_prod _ (fun i _ ↦ hc (w i))
59  · simp only [hw, if_false]
60    exact continuous_const
61 
62theorem measurable_density_uncurry {Z : Type*} [TopologicalSpace Z] [MetrizableSpace Z]
63    [MeasurableSpace Z] [SecondCountableTopology Z] [OpensMeasurableSpace Z]
64    (d N : ℕ) (hN : 0<N) (p : Z → Fin (d+1) → ℝ)
65    (hp : ∀ z i, 0≤p z i) (hs : ∀ z, ∑ i, p z i=1)
66    (hc : ∀ i, Continuous (fun z ↦ p z i)) :
67    Measurable (fun zx : Z×rootSpace d ↦ density d N (p zx.1) (hp zx.1) (hs zx.1) zx.2) :=
68  measurable_uncurry_of_continuous_of_measurable
69    (continuous_density_parameter d N hN p hp hs hc) (fun z ↦ measurable_density d N hN (p z) (hp z) (hs z))
70 
71end Cloning.CountMultinomial