Offline · exact source
Exact Lean source

HybridFlatBody

formalization/Cloning/HybridFlatBody.lean

Source hash: 155d551acbb0567b3590180294816640c014f8421a0a3568d0d8bfe45519af17

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.HybridFlatBox
2import Mathlib.Analysis.Convex.Basic
3 
4/-! Normalized flat priors on arbitrary compact convex phase-space bodies.
5Their exact dilation Jacobian and nesting apply in particular to the image
6of the manuscript's score-hyperplane boxes under whitening. -/
7noncomputable section
8open scoped Topology
9open Filter MeasureTheory
10namespace Cloning.Hybrid
11set_option backward.isDefEq.respectTransparency false
12set_option maxHeartbeats 1000000
13variable {k s : ℕ}
14 
15structure PhaseBody (k s : ℕ) where
16  carrier : Set (PhaseSpace k s)
17  compact : IsCompact carrier
18  convex : Convex ℝ carrier
19  zero_interior : (0 : PhaseSpace k s) ∈ interior carrier
20 
21namespace PhaseBody
22variable (B : PhaseBody k s)
23 
24theorem volume_real_pos : 0 < volume.real B.carrier :=
25  ENNReal.toReal_pos
26    (Measure.measure_pos_of_nonempty_interior volume ⟨0,B.zero_interior⟩).ne'
27    B.compact.measure_ne_top
28 
29def dilate (L : ℝ) : Set (PhaseSpace k s) := (fun ξ => L • ξ) '' B.carrier
30 
31theorem dilate_compact (L : ℝ) : IsCompact (B.dilate L) :=
32  B.compact.image (by fun_prop)
33 
34theorem smul_mem_dilate_iff {L : ℝ} (hL : L ≠ 0) (ξ : PhaseSpace k s) :
35    L • ξ ∈ B.dilate L ↔ ξ ∈ B.carrier := by
36  constructor
37  · rintro ⟨x,hx,he⟩
38    have hxξ : x=ξ := (smul_right_injective _ hL) he
39    simpa only [hxξ] using hx
40  · intro h
41    exact ⟨ξ,h,rfl⟩
42 
43theorem dilate_mono {L M : ℝ} (hL : 0 ≤ L) (hM : 0 < M) (hLM : L ≤ M) :
44    B.dilate L ⊆ B.dilate M := by
45  rintro ξ ⟨x,hx,rfl⟩
46  refine ⟨(L/M) • x,B.convex.smul_mem_of_zero_mem
47    (interior_subset B.zero_interior) hx ⟨div_nonneg hL hM.le,(div_le_one hM).mpr hLM⟩,?_⟩
48  change M • ((L/M) • x)=L • x
49  rw [smul_smul,mul_div_cancel₀ _ hM.ne']
50 
51def density : PhaseDensity k s where
52  value := B.carrier.indicator (fun _ => (volume.real B.carrier)⁻¹)
53  measurable := measurable_const.indicator B.compact.isClosed.measurableSet
54  nonneg := fun ξ => Set.indicator_nonneg (fun _ _ => inv_nonneg.mpr measureReal_nonneg) ξ
55  integral_one := by
56    rw [integral_indicator B.compact.isClosed.measurableSet,integral_const]
57    simp only [measureReal_restrict_apply_univ,smul_eq_mul]
58    exact mul_inv_cancel₀ B.volume_real_pos.ne'
59 
60theorem integral_expandingPrior {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
61    (n : ℕ) (f : PhaseSpace k s → E) (hf : Continuous f) :
62    (∫ ξ,f ξ ∂B.density.expandingPrior n)=
63      (volume.real B.carrier)⁻¹ • ∫ z in B.carrier,f (((n : ℝ)+1) • z) := by
64  rw [B.density.integral_expandingPrior n f hf]
65  change (∫ z,(B.carrier.indicator (fun _ => (volume.real B.carrier)⁻¹) z) •
66    f (((n : ℝ)+1) • z))=_
67  rw [← integral_smul,← integral_indicator B.compact.isClosed.measurableSet]
68  congr 1
69  funext z
70  by_cases hz : z∈B.carrier <;> simp [hz]
71 
72theorem integral_dilate {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
73    {L : ℝ} (hL : 0<L) (f : PhaseSpace k s → E) :
74    (∫ z in B.carrier,f (L • z))=
75      (L^Module.finrank ℝ (PhaseSpace k s))⁻¹ • ∫ z in B.dilate L,f z := by
76  classical
77  have he : (fun z => (B.dilate L).indicator f (L • z))=
78      B.carrier.indicator (fun z => f (L • z)) := by
79    funext z
80    by_cases hz : z∈B.carrier
81    · simp only [Set.indicator_of_mem hz,
82        Set.indicator_of_mem ((B.smul_mem_dilate_iff hL.ne' z).mpr hz)]
83    · simp only [Set.indicator_of_notMem hz,
84        Set.indicator_of_notMem (mt (B.smul_mem_dilate_iff hL.ne' z).mp hz)]
85  calc
86    _ = ∫ z,B.carrier.indicator (fun z => f (L • z)) z :=
87      (integral_indicator B.compact.isClosed.measurableSet).symm
88    _ = ∫ z,(B.dilate L).indicator f (L • z) :=
89      (congrArg (fun g : PhaseSpace k s → E => ∫ z,g z) he).symm
90    _ = _ := Measure.integral_comp_smul_of_nonneg volume ((B.dilate L).indicator f) L
91      (hR:=hL.le)
92    _ = _ := congrArg (fun v : E => (L^Module.finrank ℝ (PhaseSpace k s))⁻¹ • v)
93      (integral_indicator (B.dilate_compact L).isClosed.measurableSet)
94 
95theorem dilate_volume_real {L : ℝ} (hL : 0<L) :
96    volume.real (B.dilate L)=L^Module.finrank ℝ (PhaseSpace k s)*volume.real B.carrier := by
97  have hv := B.integral_dilate hL (fun _ : PhaseSpace k s => (1:ℝ))
98  simp only [integral_const,Measure.restrict_apply_univ,measureReal_def,smul_eq_mul,mul_one] at hv
99  change volume.real B.carrier=(L^Module.finrank ℝ (PhaseSpace k s))⁻¹*volume.real (B.dilate L) at hv
100  rw [hv,← mul_assoc,mul_inv_cancel₀ (pow_ne_zero _ hL.ne'),one_mul]
101 
102theorem normalized_dilate {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
103    {L : ℝ} (hL : 0<L) (f : PhaseSpace k s → E) :
104    (volume.real B.carrier)⁻¹ • (∫ z in B.carrier,f (L • z))=
105      (volume.real (B.dilate L))⁻¹ • ∫ z in B.dilate L,f z := by
106  rw [B.integral_dilate hL f,smul_smul,B.dilate_volume_real hL,mul_inv_rev]
107 
108end PhaseBody
109end Cloning.Hybrid