Download data/lean/OAI/Geometry/LatticeCovering/Transport.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 29.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/LatticeCovering/Transport.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/LatticeCovering/Transport.lean
-
curl -L -o Transport.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/LatticeCovering/Transport.lean
29.4 kB
| import OAI.Geometry.LatticeCovering.GridCounts | |
| namespace OAI | |
| section | |
| noncomputable section | |
| noncomputable section | |
| noncomputable section | |
| open MeasureTheory Filter Set | |
| open scoped Topology | |
| noncomputable section | |
| namespace SingleLatticeCovering.SharpYoung | |
| structure PositiveDensity where | |
| toFun : β β β | |
| continuous : Continuous toFun | |
| positive : β x, 0 < toFun x | |
| integrable : Integrable toFun volume | |
| integral_one : β« x, toFun x = 1 | |
| instance : CoeFun PositiveDensity (fun _ => β β β) := β¨PositiveDensity.toFunβ© | |
| def densityCDF (f : PositiveDensity) (x : β) : β := β« t in Iic x, f t | |
| lemma densityCDF_hasDerivAt (f : PositiveDensity) (x : β) : | |
| HasDerivAt (densityCDF f) (f x) x := by | |
| have h := (intervalIntegral.integral_hasDerivAt_right | |
| (f.integrable.intervalIntegrable (a := 0) (b := x)) | |
| (f.continuous.stronglyMeasurableAtFilter volume (π x)) f.continuous.continuousAt).const_add | |
| (densityCDF f 0) | |
| convert! h using 1 | |
| funext u | |
| have hdiff := intervalIntegral.integral_Iic_sub_Iic | |
| (f.integrable.integrableOn (s := Iic 0)) (f.integrable.integrableOn (s := Iic u)) | |
| dsimp [densityCDF] at * | |
| linarith | |
| lemma densityCDF_continuous (f : PositiveDensity) : Continuous (densityCDF f) := | |
| continuous_iff_continuousAt.mpr (fun x => (densityCDF_hasDerivAt f x).continuousAt) | |
| lemma densityCDF_strictMono (f : PositiveDensity) : StrictMono (densityCDF f) := by | |
| apply strictMono_of_deriv_pos | |
| intro x | |
| rw [(densityCDF_hasDerivAt f x).deriv] | |
| exact f.positive x | |
| lemma densityCDF_add_tail (f : PositiveDensity) (x : β) : | |
| densityCDF f x + (β« t in Ioi x, f t) = 1 := by | |
| simpa [densityCDF, f.integral_one] using integral_add_compl measurableSet_Iic f.integrable | |
| lemma densityCDF_mem_Ioo (f : PositiveDensity) (x : β) : densityCDF f x β Ioo 0 1 := by | |
| have hnonneg (y : β) : 0 β€ densityCDF f y := integral_nonneg (fun t => (f.positive t).le) | |
| have hle (y : β) : densityCDF f y β€ 1 := by | |
| have ht : 0 β€ β« t in Ioi y, f t := integral_nonneg (fun t => (f.positive t).le) | |
| linarith [densityCDF_add_tail f y] | |
| constructor | |
| Β· exact lt_of_le_of_lt (hnonneg (x-1)) (densityCDF_strictMono f (by linarith)) | |
| Β· exact lt_of_lt_of_le (densityCDF_strictMono f (show x < x+1 by linarith)) (hle (x+1)) | |
| lemma densityCDF_tendsto_bot (f : PositiveDensity) : | |
| Tendsto (densityCDF f) atBot (π 0) := tendsto_integral_Iic_zero tendsto_id | |
| lemma densityCDF_tendsto_top (f : PositiveDensity) : | |
| Tendsto (densityCDF f) atTop (π 1) := by | |
| have h : Tendsto (fun x : β => 1 - β« t in Ioi x, f t) atTop (π (1-0)) := | |
| tendsto_const_nhds.sub (tendsto_integral_Ioi_zero tendsto_id) | |
| convert h using 1 | |
| Β· funext x | |
| linarith [densityCDF_add_tail f x] | |
| Β· norm_num | |
| lemma densityCDF_surjOn (f : PositiveDensity) : | |
| SurjOn (densityCDF f) univ (Ioo 0 1) := by | |
| exact isPreconnected_univ.intermediate_value_Ioo (by simp) (by simp) | |
| (densityCDF_continuous f).continuousOn (densityCDF_tendsto_bot f) (densityCDF_tendsto_top f) | |
| def densityCDFIso (f : PositiveDensity) : β βo Ioo (0 : β) 1 := | |
| StrictMono.orderIsoOfSurjective (fun x => β¨densityCDF f x, densityCDF_mem_Ioo f xβ©) | |
| (fun _ _ h => densityCDF_strictMono f h) | |
| (fun y => by | |
| obtain β¨x, _, hxβ© := densityCDF_surjOn f y.property | |
| exact β¨x, Subtype.ext hxβ©) | |
| @[simp] lemma densityCDFIso_apply (f : PositiveDensity) (x : β) : | |
| (densityCDFIso f x : β) = densityCDF f x := rfl | |
| def densityTransport (f g : PositiveDensity) : β βo β := | |
| (densityCDFIso f).trans (densityCDFIso g).symm | |
| lemma densityCDF_transport (f g : PositiveDensity) (x : β) : | |
| densityCDF g (densityTransport f g x) = densityCDF f x := by | |
| change ((densityCDFIso g) ((densityCDFIso g).symm (densityCDFIso f x)) : β) = _ | |
| simp | |
| lemma densityTransport_hasDerivAt (f g : PositiveDensity) (x : β) : | |
| HasDerivAt (densityTransport f g) (f x / g (densityTransport f g x)) x := by | |
| apply HasDerivAt.of_comp_left (densityTransport f g).continuous.continuousAt | |
| (densityCDF_hasDerivAt g _) (densityCDF_hasDerivAt f x) (ne_of_gt (g.positive _)) | |
| exact Filter.Eventually.of_forall (densityCDF_transport f g) | |
| def normalizedGaussianDensity : PositiveDensity where | |
| toFun := fun x => Real.exp (-x^2) / Real.sqrt Real.pi | |
| continuous := by fun_prop | |
| positive := fun x => div_pos (Real.exp_pos _) (Real.sqrt_pos.mpr Real.pi_pos) | |
| integrable := by | |
| have h := integrable_exp_neg_mul_sq (show (0:β) < 1 by norm_num) | |
| simpa using h.div_const (Real.sqrt Real.pi) | |
| integral_one := by | |
| simp_rw [div_eq_mul_inv] | |
| rw [integral_mul_const] | |
| have h := integral_gaussian (1 : β) | |
| simp only [neg_mul, one_mul, div_one] at h | |
| rw [h, mul_inv_cancelβ (ne_of_gt (Real.sqrt_pos.mpr Real.pi_pos))] | |
| lemma gaussian_transport_density (f : PositiveDensity) (x : β) : | |
| Real.exp (-(densityTransport f normalizedGaussianDensity x)^2) * | |
| (f x / normalizedGaussianDensity (densityTransport f normalizedGaussianDensity x)) = | |
| Real.sqrt Real.pi * f x := by | |
| change Real.exp _ * (f x / (Real.exp _ / Real.sqrt Real.pi)) = _ | |
| field_simp | |
| end SingleLatticeCovering.SharpYoung | |
| namespace SingleLatticeCovering.SimplexYoung | |
| open SingleLatticeCovering.SharpYoung | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal | |
| def simplexConstant (r : β) : β := | |
| (Real.sqrt ((r:β)/(r+1:β)))β»ΒΉ^r / Real.sqrt (r+1:β) | |
| lemma simplexConstant_nonneg (r : β) : 0 β€ simplexConstant r := by | |
| unfold simplexConstant; positivity | |
| lemma simplex_positiveDensity_integral {r : β} (hr : 0 < r) | |
| (f : Fin (r+1) β PositiveDensity) : | |
| (β«β» x : V r, ENNReal.ofReal (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal (simplexConstant r) := by | |
| let T (i : Fin (r+1)) := densityTransport (f i) normalizedGaussianDensity | |
| let T' (i : Fin (r+1)) (t : β) := f i t / normalizedGaussianDensity (T i t) | |
| have ht := simplex_transport_integral hr (T := fun i => T i) (T' := T') | |
| (fun i => (T i).strictMono) (fun i => densityTransport_hasDerivAt (f i) _) | |
| (fun i t => div_pos ((f i).positive t) (normalizedGaussianDensity.positive _)) | |
| have hpoint (x : V r) : | |
| (β i, (Real.exp (-(T i (simplexForm i x))^2) * T' i (simplexForm i x)) ^ ((r:β)/(r+1:β))) = | |
| (Real.sqrt Real.pi)^r * β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)) := by | |
| change (β i, (Real.exp (-(densityTransport (f i) normalizedGaussianDensity | |
| (simplexForm i x))^2) * (f i (simplexForm i x) / | |
| normalizedGaussianDensity (densityTransport (f i) normalizedGaussianDensity | |
| (simplexForm i x)))) ^ ((r:β)/(r+1:β))) = _ | |
| simp_rw [gaussian_transport_density, | |
| Real.mul_rpow (Real.sqrt_nonneg _) ((f _).positive _).le] | |
| rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ, Fintype.card_fin] | |
| congr 1 | |
| rw [βReal.rpow_natCast, βReal.rpow_mul (Real.sqrt_nonneg _), div_mul_cancelβ _ (by positivity : (r+1:β) β (0:β)), Real.rpow_natCast] | |
| simp_rw [hpoint, ENNReal.ofReal_mul (pow_nonneg (Real.sqrt_nonneg _) r)] at ht | |
| rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] at ht | |
| have hp : 0 < (Real.sqrt Real.pi)^r := pow_pos (Real.sqrt_pos.mpr Real.pi_pos) r | |
| have hh : (β«β» x : V r, ENNReal.ofReal (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal ((Real.sqrt (Real.pi/((r:β)/(r+1:β))))^r / Real.sqrt (r+1:β)) / | |
| ENNReal.ofReal ((Real.sqrt Real.pi)^r) := | |
| (ENNReal.le_div_iff_mul_le (Or.inl (ne_of_gt (ENNReal.ofReal_pos.mpr hp))) | |
| (Or.inl ENNReal.ofReal_ne_top)).mpr (by rw [mul_comm]; exact ht) | |
| rw [βENNReal.ofReal_div_of_pos hp] at hh | |
| have he : ((Real.sqrt (Real.pi/((r:β)/(r+1:β))))^r / Real.sqrt (r+1:β)) / | |
| (Real.sqrt Real.pi)^r = simplexConstant r := by | |
| unfold simplexConstant | |
| rw [Real.sqrt_div Real.pi_pos.le, div_pow] | |
| have hc : 0 < Real.sqrt ((r:β)/(r+1:β)) := by positivity | |
| field_simp [hc.ne'] | |
| simp only [βmul_pow, one_div, mul_inv_cancelβ hc.ne', one_pow] | |
| simpa only [he] using hh | |
| lemma integral_pos_of_continuous_density {f : β β β} | |
| (hp : β x, 0 < f x) (hi : Integrable f volume) : 0 < β« x, f x := by | |
| apply (integral_pos_iff_support_of_nonneg (fun x => (hp x).le) hi).mpr | |
| have he : Function.support f = univ := by | |
| ext x | |
| simp [Function.mem_support, ne_of_gt (hp x)] | |
| rw [he] | |
| simp | |
| def normalizePositiveDensity (f : β β β) (hc : Continuous f) (hp : β x, 0 < f x) | |
| (hi : Integrable f volume) : PositiveDensity where | |
| toFun := fun x => f x / β« t, f t | |
| continuous := hc.div_const _ | |
| positive := fun x => div_pos (hp x) (integral_pos_of_continuous_density hp hi) | |
| integrable := hi.div_const _ | |
| integral_one := by | |
| rw [integral_div, div_self (ne_of_gt (integral_pos_of_continuous_density hp hi))] | |
| lemma simplex_positive_integral {r : β} (hr : 0 < r) (f : Fin (r+1) β β β β) | |
| (hc : β i, Continuous (f i)) (hp : β i x, 0 < f i x) | |
| (hi : β i, Integrable (f i) volume) : | |
| (β«β» x : V r, ENNReal.ofReal (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal (simplexConstant r * β i, (β« t, f i t) ^ ((r:β)/(r+1:β))) := by | |
| let g (i : Fin (r+1)) := normalizePositiveDensity (f i) (hc i) (hp i) (hi i) | |
| have hmass (i : Fin (r+1)) := integral_pos_of_continuous_density (hp i) (hi i) | |
| have he (i : Fin (r+1)) (x : β) : f i x = (β« t, f i t) * g i x := by | |
| dsimp [g, normalizePositiveDensity] | |
| field_simp [ne_of_gt (hmass i)] | |
| have hpoint (x : V r) : (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β))) = | |
| (β i, (β« t, f i t) ^ ((r:β)/(r+1:β))) * β i, (g i (simplexForm i x)) ^ ((r:β)/(r+1:β)) := by | |
| conv_lhs => arg 2; ext i; rw [he i (simplexForm i x)] | |
| simp_rw [Real.mul_rpow (hmass _).le ((g _).positive _).le] | |
| rw [Finset.prod_mul_distrib] | |
| have hn : 0 β€ β i, (β« t, f i t) ^ ((r:β)/(r+1:β)) := | |
| Finset.prod_nonneg (fun i _ => Real.rpow_nonneg (hmass i).le _) | |
| simp_rw [hpoint, ENNReal.ofReal_mul hn] | |
| rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top, | |
| ENNReal.ofReal_mul (simplexConstant_nonneg r)] | |
| rw [mul_comm (ENNReal.ofReal (simplexConstant r))] | |
| exact mul_le_mul' le_rfl (simplex_positiveDensity_integral hr g) | |
| lemma simplex_nonneg_integral {r : β} (hr : 0 < r) (f : Fin (r+1) β β β β) | |
| (hc : β i, Continuous (f i)) (hp : β i x, 0 β€ f i x) | |
| (hi : β i, Integrable (f i) volume) : | |
| (β«β» x : V r, ENNReal.ofReal (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal (simplexConstant r * β i, (β« t, f i t) ^ ((r:β)/(r+1:β))) := by | |
| have he (Ξ΅ : β) (hΞ΅ : 0 < Ξ΅) : | |
| (β«β» x : V r, ENNReal.ofReal (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal (simplexConstant r * β i, ((β« t, f i t)+Ξ΅) ^ ((r:β)/(r+1:β))) := by | |
| let F (i : Fin (r+1)) (x : β) := f i x + Ξ΅ * normalizedGaussianDensity x | |
| have hcF (i : Fin (r+1)) : Continuous (F i) := | |
| (hc i).add (continuous_const.mul normalizedGaussianDensity.continuous) | |
| have hpF (i : Fin (r+1)) (x : β) : 0 < F i x := | |
| add_pos_of_nonneg_of_pos (hp i x) (mul_pos hΞ΅ (normalizedGaussianDensity.positive x)) | |
| have hiF (i : Fin (r+1)) : Integrable (F i) volume := | |
| (hi i).add (normalizedGaussianDensity.integrable.const_mul Ξ΅) | |
| have hmF (i : Fin (r+1)) : β« t, F i t = (β« t, f i t)+Ξ΅ := by | |
| dsimp [F] | |
| rw [integral_add (hi i) (normalizedGaussianDensity.integrable.const_mul Ξ΅), | |
| integral_const_mul, normalizedGaussianDensity.integral_one, mul_one] | |
| have hmono : (β«β» x : V r, ENNReal.ofReal (β i, (f i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| (β«β» x : V r, ENNReal.ofReal (β i, (F i (simplexForm i x)) ^ ((r:β)/(r+1:β)))) := by | |
| apply lintegral_mono | |
| intro x | |
| apply ENNReal.ofReal_le_ofReal | |
| apply Finset.prod_le_prodβ | |
| Β· intro i _ | |
| exact Real.rpow_nonneg (hp i _) _ | |
| Β· intro i _ | |
| apply Real.rpow_le_rpow (hp i _) | |
| Β· exact le_add_of_nonneg_right (mul_nonneg hΞ΅.le (normalizedGaussianDensity.positive _).le) | |
| Β· positivity | |
| simpa only [hmF] using hmono.trans (simplex_positive_integral hr F hcF hpF hiF) | |
| have hct : ContinuousAt | |
| (fun Ξ΅ : β => ENNReal.ofReal (simplexConstant r * | |
| β i, ((β« t, f i t)+Ξ΅) ^ ((r:β)/(r+1:β)))) 0 := by | |
| apply ENNReal.continuous_ofReal.continuousAt.comp | |
| fun_prop (disch := positivity) | |
| have ht := hct.tendsto.comp (tendsto_one_div_add_atTop_nhds_zero_nat (π := β)) | |
| simp only [add_zero] at ht | |
| apply ge_of_tendsto ht | |
| exact Filter.Eventually.of_forall (fun n => he (1 / ((n:β)+1)) (by positivity)) | |
| end SingleLatticeCovering.SimplexYoung | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal | |
| noncomputable section | |
| namespace SingleLatticeCovering.SharpYoung | |
| lemma continuous_finTail {d : β} {E : Type*} [TopologicalSpace E] : | |
| Continuous (Fin.tail : (Fin (d+1) β E) β (Fin d β E)) := by | |
| exact continuous_pi (fun j => continuous_apply j.succ) | |
| lemma hasCompactSupport_finCons {d : β} {f : (Fin (d+1) β β) β β} | |
| (hf : HasCompactSupport f) : | |
| HasCompactSupport (fun p : β Γ (Fin d β β) => f (Fin.cons p.1 p.2)) := by | |
| apply HasCompactSupport.intro | |
| (hf.isCompact.image ((continuous_apply 0).prodMk continuous_finTail)) | |
| intro p hp | |
| by_contra hn | |
| apply hp | |
| refine β¨Fin.cons p.1 p.2, subset_tsupport f hn, ?_β© | |
| simp | |
| lemma hasCompactSupport_finSlice {d : β} {f : (Fin (d+1) β β) β β} | |
| (hf : HasCompactSupport f) (y : Fin d β β) : | |
| HasCompactSupport (fun t : β => f (Fin.cons t y)) := by | |
| apply HasCompactSupport.intro (hf.isCompact.image (continuous_apply 0)) | |
| intro t ht | |
| by_contra hn | |
| exact ht β¨Fin.cons t y, subset_tsupport f hn, by simpβ© | |
| def finMarginal {d : β} (f : (Fin (d+1) β β) β β) (y : Fin d β β) : β := | |
| β« t : β, f (Fin.cons t y) | |
| lemma hasCompactSupport_finMarginal {d : β} {f : (Fin (d+1) β β) β β} | |
| (hf : HasCompactSupport f) : HasCompactSupport (finMarginal f) := by | |
| apply HasCompactSupport.intro (hf.isCompact.image continuous_finTail) | |
| intro y hy | |
| have hz (t : β) : f (Fin.cons t y) = 0 := by | |
| by_contra hn | |
| exact hy β¨Fin.cons t y, subset_tsupport f hn, by simpβ© | |
| simp [finMarginal, hz] | |
| lemma continuous_finMarginal {d : β} {f : (Fin (d+1) β β) β β} | |
| (hc : Continuous f) (hk : HasCompactSupport f) : Continuous (finMarginal f) := by | |
| apply continuousOn_univ.mp | |
| apply continuousOn_integral_of_compact_support (hk.isCompact.image (continuous_apply 0)) | |
| Β· exact (hc.comp (continuous_snd.finCons continuous_fst)).continuousOn | |
| Β· intro y t _ ht | |
| by_contra hn | |
| exact ht β¨Fin.cons t y, subset_tsupport f hn, by simpβ© | |
| lemma finMarginal_nonneg {d : β} {f : (Fin (d+1) β β) β β} | |
| (hf : 0 β€ f) : 0 β€ finMarginal f := fun y => integral_nonneg (fun t => hf (Fin.cons t y)) | |
| lemma integral_finMarginal {d : β} {f : (Fin (d+1) β β) β β} | |
| (hc : Continuous f) (hk : HasCompactSupport f) : | |
| β« y, finMarginal f y = β« x, f x := by | |
| have hm := (volume_preserving_piFinSuccAbove (fun _ : Fin (d+1) => β) 0).symm | |
| have he := hm.integral_comp' f | |
| simp only [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv_zero] at he | |
| rw [β he] | |
| symm | |
| exact integral_prod_symm (fun p : β Γ (Fin d β β) => f (Fin.cons p.1 p.2)) | |
| ((hc.comp (continuous_fst.finCons continuous_snd)).integrable_of_hasCompactSupport | |
| (hasCompactSupport_finCons hk)) | |
| lemma lintegral_finCons {d : β} {E : Type*} [MeasureSpace E] | |
| [SigmaFinite (volume : Measure E)] | |
| (f : (Fin (d+1) β E) β ββ₯0β) (hf : Measurable f) : | |
| β«β» x, f x = β«β» y : Fin d β E, β«β» t : E, f (Fin.cons t y) := by | |
| have hm := (volume_preserving_piFinSuccAbove (fun _ : Fin (d+1) => E) 0).symm | |
| have he := hm.lintegral_comp_emb (MeasurableEquiv.measurableEmbedding _) f | |
| simp only [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv_zero] at he | |
| rw [β he] | |
| apply lintegral_prod_symm _ | |
| simpa only [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv_zero, Function.comp_def, Fin.consEquiv_apply] using | |
| (hf.comp (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (d+1) => E) 0).symm.measurable).aemeasurable | |
| end SingleLatticeCovering.SharpYoung | |
| namespace SingleLatticeCovering.SimplexYoung | |
| open SingleLatticeCovering.SharpYoung | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal | |
| def simplexSpatial {r d : β} (i : Fin (r+1)) (x : Fin d β V r) : Fin d β β := | |
| fun j => simplexForm i (x j) | |
| lemma continuous_simplexSpatial {r d : β} (i : Fin (r+1)) : | |
| Continuous (simplexSpatial (d := d) i) := by | |
| exact continuous_pi (fun j => (simplexForm i).continuous_of_finiteDimensional.comp | |
| (continuous_apply j)) | |
| lemma simplexSpatial_cons {r d : β} (i : Fin (r+1)) (t : V r) (x : Fin d β V r) : | |
| simplexSpatial i (Fin.cons t x) = Fin.cons (simplexForm i t) (simplexSpatial i x) := by | |
| ext j | |
| refine Fin.cases ?_ (fun k => ?_) j <;> simp [simplexSpatial] | |
| lemma simplex_cc_integral {r : β} (hr : 0 < r) (d : β) (f : Fin (r+1) β (Fin d β β) β β) | |
| (hc : β i, Continuous (f i)) (hn : β i x, 0 β€ f i x) | |
| (hk : β i, HasCompactSupport (f i)) : | |
| (β«β» x : Fin d β V r, ENNReal.ofReal | |
| (β i, (f i (simplexSpatial i x)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal ((simplexConstant r)^d * | |
| β i, (β« t, f i t) ^ ((r:β)/(r+1:β))) := by | |
| induction d with | |
| | zero => | |
| rw [Measure.volume_pi_eq_dirac (0 : Fin 0 β V r), lintegral_dirac] | |
| simp_rw [Measure.volume_pi_eq_dirac (0 : Fin 0 β β), integral_dirac] | |
| simp only [pow_zero, one_mul] | |
| apply le_of_eq | |
| congr 1 | |
| apply Finset.prod_congr rfl | |
| intro i _ | |
| congr 2 | |
| exact Subsingleton.elim _ _ | |
| | succ d ih => | |
| have hmeas : Measurable (fun x : Fin (d+1) β V r => ENNReal.ofReal | |
| (β i, (f i (simplexSpatial i x)) ^ ((r:β)/(r+1:β)))) := by | |
| apply Continuous.measurable | |
| apply ENNReal.continuous_ofReal.comp | |
| exact continuous_finsetProd _ (fun i _ => | |
| (hc i |>.comp (continuous_simplexSpatial i)).rpow_const (fun _ => Or.inr (by positivity))) | |
| rw [lintegral_finCons _ hmeas] | |
| let g (i : Fin (r+1)) := finMarginal (f i) | |
| have hcons (z : Fin d β β) : Continuous (fun t : β => (Fin.cons t z : Fin (d+1) β β)) := by | |
| apply continuous_pi | |
| intro j | |
| exact Fin.cases continuous_id (fun _ => continuous_const) j | |
| have hinner (y : Fin d β V r) : | |
| (β«β» t : V r, ENNReal.ofReal | |
| (β i, f i (simplexSpatial i (Fin.cons t y)) ^ ((r:β)/(r+1:β)))) β€ | |
| ENNReal.ofReal (simplexConstant r * | |
| β i, g i (simplexSpatial i y) ^ ((r:β)/(r+1:β))) := by | |
| simp_rw [simplexSpatial_cons] | |
| apply simplex_nonneg_integral hr (fun i t => f i (Fin.cons t (simplexSpatial i y))) | |
| Β· intro i | |
| exact (hc i).comp (hcons (simplexSpatial i y)) | |
| Β· intro i t | |
| exact hn i _ | |
| Β· intro i | |
| exact ((hc i).comp (hcons (simplexSpatial i y))).integrable_of_hasCompactSupport | |
| (hasCompactSupport_finSlice (hk i) _) | |
| apply (lintegral_mono hinner).trans | |
| have hcst : 0 β€ simplexConstant r := simplexConstant_nonneg r | |
| simp_rw [ENNReal.ofReal_mul hcst] | |
| rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] | |
| have hbound := ih g (fun i => continuous_finMarginal (hc i) (hk i)) | |
| (fun i x => finMarginal_nonneg (hn i) x) | |
| (fun i => hasCompactSupport_finMarginal (hk i)) | |
| have hmass (i : Fin (r+1)) : β« t, g i t = β« t, f i t := integral_finMarginal (hc i) (hk i) | |
| simp_rw [hmass] at hbound | |
| have hh := mul_le_mul' (le_refl (ENNReal.ofReal (simplexConstant r))) hbound | |
| convert hh using 1 | |
| rw [β ENNReal.ofReal_mul hcst, pow_succ] | |
| congr 1 | |
| ring | |
| end SingleLatticeCovering.SimplexYoung | |
| namespace SingleLatticeCovering.SimplexYoung | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal | |
| def simplexConfiguration {r d : β} (J : Fin (r+1) β Set (Fin d β β)) : | |
| Set (Fin d β V r) := {x | β i, simplexSpatial i x β J i} | |
| lemma simplexConfiguration_measurable {r d : β} {J : Fin (r+1) β Set (Fin d β β)} | |
| (hJ : β i, MeasurableSet (J i)) : MeasurableSet (simplexConfiguration J) := by | |
| unfold simplexConfiguration | |
| rw [Set.ofPred_forall] | |
| apply MeasurableSet.iInter | |
| intro i | |
| exact (hJ i).preimage (continuous_simplexSpatial i).measurable | |
| lemma simplex_measure_le_cc {r d : β} (hr : 0 < r) | |
| {J : Fin (r+1) β Set (Fin d β β)} (hJ : β i, MeasurableSet (J i)) | |
| (f : Fin (r+1) β (Fin d β β) β β) (hc : β i, Continuous (f i)) | |
| (hn : β i z, 0 β€ f i z) (hk : β i, HasCompactSupport (f i)) | |
| (hf : β i, EqOn (f i) 1 (J i)) : | |
| volume (simplexConfiguration J) β€ | |
| ENNReal.ofReal ((simplexConstant r)^d * β i, (β« z, f i z) ^ ((r:β)/(r+1:β))) := by | |
| apply le_trans _ (simplex_cc_integral hr d f hc hn hk) | |
| rw [βlintegral_indicator_one (simplexConfiguration_measurable hJ)] | |
| apply lintegral_mono | |
| intro x | |
| by_cases hx : x β simplexConfiguration J | |
| Β· have hh (i : Fin (r+1)) : f i (simplexSpatial i x) = 1 := hf i (hx i) | |
| simp [Set.indicator_of_mem hx, hh] | |
| Β· simp [Set.indicator_of_notMem hx] | |
| lemma volume_simplexConfiguration_le {r d : β} (hr : 0 < r) | |
| {J : Fin (r+1) β Set (Fin d β β)} (hJ : β i, IsCompact (J i)) : | |
| volume (simplexConfiguration J) β€ | |
| ENNReal.ofReal ((simplexConstant r)^d * | |
| β i, ((volume (J i)).toReal)^((r:β)/(r+1:β))) := by | |
| let M (i : Fin (r+1)) := (volume (J i)).toReal | |
| have hM (i) : 0 β€ M i := ENNReal.toReal_nonneg | |
| have hh (Ξ΅ : β) (hΞ΅ : 0 < Ξ΅) : volume (simplexConfiguration J) β€ | |
| ENNReal.ofReal ((simplexConstant r)^d * β i, (M i+Ξ΅)^((r:β)/(r+1:β))) := by | |
| have hex (i : Fin (r+1)) : β f : (Fin d β β) β β, Continuous f β§ | |
| HasCompactSupport f β§ EqOn f 1 (J i) β§ (β z, 0 β€ f z) β§ | |
| ENNReal.ofReal (β« z, f z) < ENNReal.ofReal (M i+Ξ΅) := by | |
| have hlt : volume (J i) < ENNReal.ofReal (M i+Ξ΅) := by | |
| rw [βENNReal.ofReal_toReal (hJ i).measure_ne_top] | |
| apply ENNReal.ofReal_lt_ofReal_iff (add_pos_of_nonneg_of_pos (hM i) hΞ΅) |>.mpr | |
| dsimp [M]; linarith | |
| rw [(hJ i).measure_eq_biInf_integral_hasCompactSupport volume] at hlt | |
| simp only [iInf_lt_iff] at hlt | |
| obtain β¨f, hc, hk, heq, hn, hfiβ© := hlt | |
| exact β¨f, hc, hk, heq, hn, hfiβ© | |
| choose f hc hk heq hn hfi using hex | |
| apply (simplex_measure_le_cc hr (fun i => (hJ i).measurableSet) f hc hn hk heq).trans | |
| apply ENNReal.ofReal_le_ofReal | |
| apply mul_le_mul_of_nonneg_left _ (pow_nonneg (simplexConstant_nonneg r) _) | |
| apply Finset.prod_le_prodβ | |
| Β· intro i _; exact Real.rpow_nonneg (integral_nonneg (hn i)) _ | |
| Β· intro i _ | |
| apply Real.rpow_le_rpow (integral_nonneg (hn i)) _ (by positivity) | |
| exact (ENNReal.ofReal_lt_ofReal_iff (add_pos_of_nonneg_of_pos (hM i) hΞ΅)).mp (hfi i) |>.le | |
| have hct : ContinuousAt (fun Ξ΅ : β => ENNReal.ofReal | |
| ((simplexConstant r)^d * β i, (M i+Ξ΅)^((r:β)/(r+1:β)))) 0 := by | |
| apply ENNReal.continuous_ofReal.continuousAt.comp | |
| fun_prop (disch := positivity) | |
| have ht := hct.tendsto.comp (tendsto_one_div_add_atTop_nhds_zero_nat (π := β)) | |
| have hle := ge_of_tendsto ht (Filter.Eventually.of_forall | |
| (fun n => hh (1/((n:β)+1)) (by positivity))) | |
| simpa only [add_zero, M] using hle | |
| end SingleLatticeCovering.SimplexYoung | |
| namespace SingleLatticeCovering.SimplexYoung | |
| open MeasureTheory Measure Set Matrix | |
| open scoped ENNReal Pointwise | |
| def weightedSimplexConfiguration {r d : β} (J : Set (Fin d β β)) | |
| (c : Fin r β β) : Set (Fin d β V r) := | |
| {x | (β j, (fun a => x a j) β J) β§ (fun a => β j, c j * x a j) β J} | |
| def simplexDiagonal {r d : β} (c : Fin r β β) : | |
| (Fin d β V r) ββ[β] (Fin d β V r) := | |
| LinearMap.pi (fun a : Fin d => (Matrix.diagonal c).mulVecLin.comp (LinearMap.proj a)) | |
| lemma simplexDiagonal_apply {r d : β} (c : Fin r β β) (x : Fin d β V r) | |
| (a : Fin d) (j : Fin r) : simplexDiagonal c x a j = c j * x a j := by | |
| simp [simplexDiagonal, Matrix.mulVec_diagonal] | |
| lemma simplexDiagonal_det {r d : β} (c : Fin r β β) : | |
| LinearMap.det (simplexDiagonal (d := d) c) = (β j, c j)^d := by | |
| unfold simplexDiagonal | |
| rw [LinearMap.det_pi] | |
| have h : LinearMap.det (Matrix.diagonal c).mulVecLin = β j, c j := by | |
| rw [βMatrix.toLin'_apply', LinearMap.det_toLin', Matrix.det_diagonal] | |
| simp [h] | |
| def scaledCircuitFamily {r d : β} (J : Set (Fin d β β)) (c : Fin r β β) : | |
| Fin (r+1) β Set (Fin d β β) := Fin.cons ((-1:β) β’ J) (fun j => c j β’ J) | |
| lemma scaledCircuitFamily_compact {r d : β} {J : Set (Fin d β β)} | |
| (hJ : IsCompact J) (c : Fin r β β) (i : Fin (r+1)) : | |
| IsCompact (scaledCircuitFamily J c i) := by | |
| refine Fin.cases ?_ (fun j => ?_) i <;> | |
| exact hJ.image (by fun_prop) | |
| lemma weightedSimplexConfiguration_preimage {r d : β} (J : Set (Fin d β β)) | |
| (c : Fin r β β) (hc : β j, c j β 0) : | |
| weightedSimplexConfiguration J c = | |
| simplexDiagonal c β»ΒΉ' simplexConfiguration (scaledCircuitFamily J c) := by | |
| ext x | |
| change (_ β§ _) β β i, simplexSpatial i (simplexDiagonal c x) β scaledCircuitFamily J c i | |
| rw [Fin.forall_fin_succ] | |
| have h0 : simplexSpatial 0 (simplexDiagonal c x) = | |
| (-1:β) β’ (fun a => β j, c j * x a j) := by | |
| ext a | |
| simp [simplexSpatial, simplexForm_zero, simplexDiagonal_apply] | |
| have hs (j : Fin r) : simplexSpatial j.succ (simplexDiagonal c x) = | |
| c j β’ (fun a => x a j) := by | |
| ext a | |
| simp [simplexSpatial, simplexForm_succ, simplexDiagonal_apply] | |
| simp only [scaledCircuitFamily, Fin.cons_zero, Fin.cons_succ, h0, hs, | |
| smul_mem_smul_set_iffβ (by norm_num : (-1:β) β 0), smul_mem_smul_set_iffβ (hc _)] | |
| exact and_comm | |
| lemma volume_scaledCircuitFamily {r d : β} (J : Set (Fin d β β)) (c : Fin r β β) : | |
| (volume (scaledCircuitFamily J c 0)).toReal = (volume J).toReal β§ | |
| β j, (volume (scaledCircuitFamily J c j.succ)).toReal = | |
| |c j|^d * (volume J).toReal := by | |
| constructor | |
| Β· simp [scaledCircuitFamily] | |
| Β· intro j | |
| simp [scaledCircuitFamily, Measure.addHaar_smul, abs_pow, | |
| ENNReal.toReal_mul] | |
| theorem volume_weightedSimplexConfiguration_le {r d : β} (hr : 0 < r) | |
| {J : Set (Fin d β β)} (hJ : IsCompact J) (c : Fin r β β) (hc : β j, c j β 0) : | |
| volume (weightedSimplexConfiguration J c) β€ | |
| ENNReal.ofReal ((β j, |c j|)β»ΒΉ^d * (simplexConstant r)^d * | |
| ((volume J).toReal^((r:β)/(r+1:β)) * | |
| β j, (|c j|^d * (volume J).toReal)^((r:β)/(r+1:β)))) := by | |
| rw [weightedSimplexConfiguration_preimage J c hc, | |
| addHaar_preimage_linearMap volume (by | |
| rw [simplexDiagonal_det]; exact pow_ne_zero _ (Finset.prod_ne_zero_iff.mpr (fun j _ => hc j))), | |
| simplexDiagonal_det] | |
| have hb := volume_simplexConfiguration_le hr (scaledCircuitFamily_compact hJ c) | |
| apply (mul_le_mul_right hb _).trans_eq | |
| rw [βENNReal.ofReal_mul (by positivity)] | |
| congr 1 | |
| rw [Fin.prod_univ_succ, (volume_scaledCircuitFamily J c).1] | |
| simp_rw [(volume_scaledCircuitFamily J c).2] | |
| rw [βinv_pow, abs_pow, abs_inv, Finset.abs_prod] | |
| ring | |
| end SingleLatticeCovering.SimplexYoung | |
| noncomputable section | |
| namespace SingleLatticeCovering.SimplexYoung | |
| open scoped BigOperators | |
| lemma weightedCircuitFactor {r d : β} (hr : 0 < r) (a : Fin r β β) | |
| (ha : β j, 0 < a j) (u C : β) (hu : 0 β€ u) : | |
| (β j, a j)β»ΒΉ^d * C^d * | |
| (u^((r:β)/(r+1:β)) * β j, (a j^d*u)^((r:β)/(r+1:β))) = | |
| C^d * (β j, a j^(-((d:β)/(r+1:β)))) * u^r := by | |
| have hn : (r+1:β) β 0 := by positivity | |
| have hp : 0 < (r:β)/(r+1:β) := div_pos (by exact_mod_cast hr) (by positivity) | |
| by_cases hz : u = 0 | |
| Β· rw [hz, Real.zero_rpow hp.ne', zero_mul, mul_zero, zero_pow hr.ne', mul_zero] | |
| have hu' : 0 < u := lt_of_le_of_ne hu (Ne.symm hz) | |
| let p : β := (r:β)/(r+1:β) | |
| change _ * _ * (u^p * β j, (a j^d*u)^p) = _ | |
| have hdist (j : Fin r) : (a j^d*u)^p = (a j)^(d*p) * u^p := by | |
| rw [Real.mul_rpow (pow_nonneg (ha j).le _) hu, βReal.rpow_natCast, βReal.rpow_mul (ha j).le] | |
| simp_rw [hdist] | |
| rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ, Fintype.card_fin] | |
| have he : p*(r+1:β) = (r:β) := by | |
| dsimp [p]; exact div_mul_cancelβ _ (by positivity) | |
| have huPow : u^p*(u^p)^r = u^r := by | |
| rw [βpow_succ', βReal.rpow_natCast, βReal.rpow_mul hu, he, Real.rpow_natCast] | |
| have hprod : (β j, a j)β»ΒΉ^d * (β j, (a j)^((d:β)*p)) = | |
| β j, a j^(-((d:β)/(r+1:β))) := by | |
| rw [βFinset.prod_inv_distrib, βFinset.prod_pow, βFinset.prod_mul_distrib] | |
| apply Finset.prod_congr rfl | |
| intro j _ | |
| rw [βReal.rpow_natCast, βReal.rpow_neg_one, βReal.rpow_mul (ha j).le, | |
| βReal.rpow_add (ha j)] | |
| congr 1 | |
| dsimp [p] | |
| push_cast | |
| field_simp | |
| ring | |
| calc | |
| _ = C^d * ((β j, a j)β»ΒΉ^d * (β j, (a j)^((d:β)*p))) * (u^p*(u^p)^r) := by ring | |
| _ = _ := by rw [hprod, huPow] | |
| end SingleLatticeCovering.SimplexYoung | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |