Exact Lean source
YoungFlatCouplingDensity
formalization/Cloning/YoungFlatCouplingDensity.lean
Source hash: d3c0495be47bf426dd102368da437ab1891fecdc75612f98a7b9ad84acaf1003
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
definition
Cloning.YoungFlatCoupling.densityBindefinition Cloning.YoungFlatCoupling.densityCommontheorem Cloning.YoungFlatCoupling.integrable_bintheorem Cloning.YoungFlatCoupling.densityBin_nonnegtheorem Cloning.YoungFlatCoupling.densityBin_sumtheorem Cloning.YoungFlatCoupling.densityCommon_rowtheorem Cloning.YoungFlatCoupling.densityCommon_coltheorem Cloning.YoungFlatCoupling.densityCommon_nonnegtheorem Cloning.YoungFlatCoupling.densityCommon_row_letheorem Cloning.YoungFlatCoupling.densityCommon_col_letheorem Cloning.YoungFlatCoupling.densityCommon_masstheorem Cloning.YoungFlatCoupling.density_overlap_defect1import Cloning.YoungFlatCouplingFinite
2import Cloning.YoungUniformLocalScheffe
3
4/-! The common part of two normalized densities gives a finite subcoupling;
5its missing mass is exactly half their L¹ distance. -/
6noncomputable section
7open scoped BigOperators Topology Classical
8open MeasureTheory Filter
9namespace Cloning.YoungFlatCoupling
10set_option backward.isDefEq.respectTransparency false
11set_option maxHeartbeats 800000
12variable {X I J : Type*} [MeasurableSpace X] [Fintype I] [Fintype J]
13variable (μ : Measure X)
14
15def densityBin (Q : X → I) (f : X → ℝ) (i : I) : ℝ :=
16 ∫ x, if Q x = i then f x else 0 ∂μ
17
18def densityCommon (Q : X → I) (S : X → J) (f g : X → ℝ) (i : I) (j : J) : ℝ :=
19 ∫ x, if Q x = i ∧ S x = j then min (f x) (g x) else 0 ∂μ
20
21theorem integrable_bin (Q : X → I) (f : X → ℝ)
22 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hf : Integrable f μ) (i : I) :
23 Integrable (fun x => if Q x = i then f x else 0) μ := by
24 exact hf.indicator (hQ i)
25
26theorem densityBin_nonneg (Q : X → I) (f : X → ℝ) (hf : ∀ x, 0 ≤ f x) (i : I) :
27 0 ≤ densityBin μ Q f i := by
28 apply integral_nonneg
29 intro x
30 dsimp only
31 split_ifs
32 · exact hf x
33 · exact le_rfl
34
35theorem densityBin_sum (Q : X → I) (f : X → ℝ)
36 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hf : Integrable f μ) :
37 (∑ i, densityBin μ Q f i) = ∫ x, f x ∂μ := by
38 simp only [densityBin]
39 rw [← integral_finset_sum _ (fun i _ => integrable_bin μ Q f hQ hf i)]
40 apply integral_congr_ae
41 exact ae_of_all _ (fun x => by simp)
42
43theorem densityCommon_row (Q : X → I) (S : X → J) (f g : X → ℝ)
44 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hS : ∀ j, MeasurableSet {x | S x = j})
45 (hf : Integrable f μ) (hg : Integrable g μ) (i : I) :
46 (∑ j, densityCommon μ Q S f g i j) = densityBin μ Q (fun x => min (f x) (g x)) i := by
47 have hmin : Integrable (fun x => min (f x) (g x)) μ := hf.inf hg
48 have hi j : Integrable (fun x => if Q x = i ∧ S x = j then min (f x) (g x) else 0) μ :=
49 by
50 convert hmin.indicator ((hQ i).inter (hS j)) using 1
51 funext x
52 simp only [Set.indicator_apply, Set.mem_inter_iff, Set.mem_setOf_eq]
53 simp only [densityCommon]
54 rw [← integral_finset_sum _ (fun j _ => hi j)]
55 apply integral_congr_ae
56 apply ae_of_all
57 intro x
58 by_cases h : Q x = i <;> simp [h]
59
60theorem densityCommon_col (Q : X → I) (S : X → J) (f g : X → ℝ)
61 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hS : ∀ j, MeasurableSet {x | S x = j})
62 (hf : Integrable f μ) (hg : Integrable g μ) (j : J) :
63 (∑ i, densityCommon μ Q S f g i j) = densityBin μ S (fun x => min (f x) (g x)) j := by
64 have he : densityCommon μ Q S f g = fun i j => densityCommon μ S Q g f j i := by
65 funext i j
66 simp only [densityCommon, and_comm, min_comm]
67 rw [he, densityCommon_row μ S Q g f hS hQ hg hf]
68 simp only [min_comm]
69
70theorem densityCommon_nonneg (Q : X → I) (S : X → J) (f g : X → ℝ)
71 (hf : ∀ x, 0 ≤ f x) (hg : ∀ x, 0 ≤ g x) (i : I) (j : J) :
72 0 ≤ densityCommon μ Q S f g i j := by
73 apply integral_nonneg
74 intro x
75 dsimp only
76 split_ifs
77 · exact le_min (hf x) (hg x)
78 · exact le_rfl
79
80theorem densityCommon_row_le (Q : X → I) (S : X → J) (f g : X → ℝ)
81 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hS : ∀ j, MeasurableSet {x | S x = j})
82 (hf : Integrable f μ) (hg : Integrable g μ) (i : I) :
83 ∑ j, densityCommon μ Q S f g i j ≤ densityBin μ Q f i := by
84 rw [densityCommon_row μ Q S f g hQ hS hf hg]
85 apply integral_mono (integrable_bin μ Q _ hQ (hf.inf hg) i) (integrable_bin μ Q f hQ hf i)
86 intro x
87 dsimp only
88 split_ifs
89 · exact min_le_left _ _
90 · exact le_rfl
91
92theorem densityCommon_col_le (Q : X → I) (S : X → J) (f g : X → ℝ)
93 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hS : ∀ j, MeasurableSet {x | S x = j})
94 (hf : Integrable f μ) (hg : Integrable g μ) (j : J) :
95 ∑ i, densityCommon μ Q S f g i j ≤ densityBin μ S g j := by
96 rw [densityCommon_col μ Q S f g hQ hS hf hg]
97 apply integral_mono (integrable_bin μ S _ hS (hf.inf hg) j) (integrable_bin μ S g hS hg j)
98 intro x
99 dsimp only
100 split_ifs
101 · exact min_le_right _ _
102 · exact le_rfl
103
104theorem densityCommon_mass (Q : X → I) (S : X → J) (f g : X → ℝ)
105 (hQ : ∀ i, MeasurableSet {x | Q x = i}) (hS : ∀ j, MeasurableSet {x | S x = j})
106 (hf : Integrable f μ) (hg : Integrable g μ) :
107 commonMass (densityCommon μ Q S f g) = ∫ x, min (f x) (g x) ∂μ := by
108 simp only [commonMass, densityCommon_row μ Q S f g hQ hS hf hg]
109 exact densityBin_sum μ Q _ hQ (hf.inf hg)
110
111theorem density_overlap_defect (f g : X → ℝ) (hf : Integrable f μ) (hg : Integrable g μ)
112 (hfm : ∫ x, f x ∂μ = 1) (hgm : ∫ x, g x ∂μ = 1) :
113 1 - (∫ x, min (f x) (g x) ∂μ) = (1/2 : ℝ) * ∫ x, |f x-g x| ∂μ := by
114 have he : (fun x => |f x-g x|) = fun x => f x+g x-2*min (f x) (g x) := by
115 funext x
116 by_cases h : f x ≤ g x
117 · rw [min_eq_left h, abs_of_nonpos (sub_nonpos.mpr h)]; ring
118 · rw [min_eq_right (le_of_not_ge h), abs_of_nonneg (sub_nonneg.mpr (le_of_not_ge h))]; ring
119 have hmin : Integrable (fun x => min (f x) (g x)) μ := hf.inf hg
120 rw [he]
121 erw [integral_sub (hf.add hg) (hmin.const_mul 2), integral_add hf hg,
122 integral_const_mul, hfm, hgm]
123 ring
124
125end Cloning.YoungFlatCoupling