Offline · exact source
Exact Lean source

YoungFlatCouplingQuantizer

formalization/Cloning/YoungFlatCouplingQuantizer.lean

Source hash: 3fbc29118cc66803d4bf4ee59101e5f128f70fa4c88705bd63d255d6b800de11

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.YoungFlatCouplingDensity
2import Cloning.YoungFlatSmoothing
3 
4/-! Exact recovery of the finite physical Young law by the clamped shape
5quantizer. Invalid finite shapes carry zero physical probability. -/
6noncomputable section
7open scoped BigOperators Topology Classical ENNReal
8open MeasureTheory Filter
9namespace Cloning.YoungFlatCoupling
10open Cloning.YoungHyperplane Cloning.YoungGeneral Cloning.TensorLie
11set_option backward.isDefEq.respectTransparency false
12set_option maxHeartbeats 800000
13 
14def shapeOfLattice (d N : ℕ) (z : Lattice d (N : ℤ)) : Shape (d+1) N :=
15  fun i => ⟨min (z.1 i).toNat N, Nat.lt_succ_of_le (min_le_right _ _)⟩
16 
17theorem shapeOfLattice_shapeLattice (d N : ℕ) (s : Shape (d+1) N)
18    (hs : ∑ i, (s i).val = N) : shapeOfLattice d N (shapeLattice d N s) = s := by
19  funext i
20  apply Fin.ext
21  change min ((shapeLattice d N s).1 i).toNat N = (s i).val
22  rw [shapeLattice_apply d N s hs, Int.toNat_natCast, min_eq_left (Nat.le_of_lt_succ (s i).isLt)]
23 
24theorem map_shapeOfLattice_tensorYoungLatticePMF (d N : ℕ) (p : Fin (d+1) → ℝ)
25    (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) :
26    (tensorYoungLatticePMF d N p hp hs).map (shapeOfLattice d N) =
27      tensorYoungPMF N (d+1) p hp hs := by
28  rw [tensorYoungLatticePMF, PMF.map_comp]
29  conv_rhs => rw [← PMF.map_id (tensorYoungPMF N (d+1) p hp hs)]
30  ext s
31  simp only [PMF.map_apply]
32  apply tsum_congr
33  intro z
34  by_cases hz : ∑ i, (z i).val = N
35  · simp only [Function.comp_apply, shapeOfLattice_shapeLattice d N z hz, id_eq]
36    split_ifs <;> rfl
37  · have he : tensorYoungPMF N (d+1) p hp hs z = 0 :=
38      physicalYoungPMF_eq_zero_of_not_partition _ _ _ _ _ _ z (Or.inr hz)
39    simp only [he, ite_self]
40 
41theorem measurable_sampleShape (d N : ℕ) (p : Fin (d+1) → ℝ) :
42    Measurable (sampleShape d N p) :=
43  (measurable_of_countable (shapeOfLattice d N)).comp (measurable_sampleLabel d N p)
44 
45theorem map_sampleShape_physicalSmoothedMeasure (d N : ℕ) (hN : 0 < N)
46    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) :
47    Measure.map (sampleShape d N p) (physicalSmoothedMeasure d N p hp hs) =
48      (tensorYoungPMF N (d+1) p hp hs).toMeasure := by
49  change Measure.map (shapeOfLattice d N ∘ sampleLabel d N p) _ = _
50  rw [← Measure.map_map (measurable_of_countable _) (measurable_sampleLabel d N p),
51    map_sampleLabel_physicalSmoothedMeasure d N hN p hp hs]
52  exact (PMF.toMeasure_map (shapeOfLattice d N) (tensorYoungLatticePMF d N p hp hs)
53    (measurable_of_countable _)).trans (congrArg PMF.toMeasure
54      (map_shapeOfLattice_tensorYoungLatticePMF d N p hp hs))
55 
56theorem densityBin_sampleShape (d N : ℕ) (hN : 0 < N)
57    (p : Fin (d+1) → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1)
58    (s : Shape (d+1) N) :
59    densityBin volume (sampleShape d N p) (tensorYoungDensity d N p hp hs) s =
60      (tensorYoungPMF N (d+1) p hp hs s).toReal := by
61  have he := congrArg (fun μ : Measure (Shape (d+1) N) => μ {s})
62    (map_sampleShape_physicalSmoothedMeasure d N hN p hp hs)
63  dsimp only at he
64  rw [Measure.map_apply (measurable_sampleShape d N p) (measurableSet_singleton s),
65    physicalSmoothedMeasure_apply d N hN p hp hs _
66      ((measurable_sampleShape d N p) (measurableSet_singleton s)),
67    PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton s)] at he
68  have hn := densityBin_nonneg volume (sampleShape d N p) _
69    (tensorYoungDensity_nonneg d N p hp hs) s
70  have hi : densityBin volume (sampleShape d N p) (tensorYoungDensity d N p hp hs) s =
71      ∫ x in (sampleShape d N p) ⁻¹' {s}, tensorYoungDensity d N p hp hs x := by
72    rw [densityBin, ← integral_indicator ((measurable_sampleShape d N p) (measurableSet_singleton s))]
73    rfl
74  rw [← hi] at he
75  exact (ENNReal.toReal_ofReal hn).symm.trans (congrArg ENNReal.toReal he)
76 
77end Cloning.YoungFlatCoupling