Download data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/DivisionBlocksControl.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.04 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/DivisionBlocksControl.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/DivisionBlocksControl.lean
-
curl -L -o DivisionBlocksControl.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/DivisionBlocksControl.lean
8.04 kB
| import Mathlib | |
| import OAI.MeasureTheory.FalconerCompletion.Shells.RegularizationLeaves | |
| namespace OAI | |
| /-! Recursive policies and quantitative depth estimates. -/ | |
| section | |
| section | |
| open Set MeasureTheory | |
| open scoped ComplexConjugate RealInnerProductSpace | |
| namespace GraphLiteralSupport | |
| namespace CurrentFalconer.TreeND | |
| open MeasureTheory | |
| open scoped ENNReal | |
| variable {d : β} | |
| theorem division_blocks_control {H N : β} (hH : 0 < H) (hN : H β€ N) : | |
| 0 < N/H β§ N/(N/H)+1 β€ 2*H := by | |
| have hB : 0 < N/H := Nat.div_pos hN hH | |
| have hrem : N < (N/H+1)*H := by simpa [Nat.mul_comm] using Nat.lt_mul_div_succ N hH | |
| have hmul : (N/H+1)*H β€ (2*(N/H))*H := Nat.mul_le_mul_right H (by omega) | |
| have hlt : N < (2*H)*(N/H) := by nlinarith | |
| have hdiv : N/(N/H) < 2*H := (Nat.div_lt_iff_lt_mul hB).mpr hlt | |
| exact β¨hB,by omegaβ© | |
| theorem division_block_width {H N : β} {lam : β} (hlam : 0 β€ lam) | |
| (hH : 1 β€ lam*(H:β)) : ((N/H:β):β) β€ lam*(N:β) := by | |
| have hn : (((N/H)*H:β):β) β€ (N:β) := by exact_mod_cast Nat.div_mul_le_self N H | |
| have h0 : 0 β€ ((N/H:β):β) := Nat.cast_nonneg _ | |
| have hh := mul_le_mul_of_nonneg_left hH h0 | |
| have hl := mul_le_mul_of_nonneg_left hn hlam | |
| simp only [Nat.cast_mul, mul_one] at hh hl | |
| nlinarith | |
| theorem exists_regularization_block_control {lam : β} (hlam : 0 < lam) : | |
| β H Nβ : β, 0 < H β§ β N β₯ Nβ, | |
| 0 < N β§ 0 < N/H β§ N/(N/H)+1 β€ 2*H β§ | |
| ((N/H:β):β) β€ lam*(N:β) β§ | |
| (2:β)^(N/(N/H)+2) β€ ((2:β)^N)^lam := by | |
| obtain β¨H,hHβ© := exists_nat_gt (1/lam) | |
| have hHp : 0 < H := by | |
| have hp : 0 < (H:β) := (one_div_pos.mpr hlam).trans hH | |
| exact_mod_cast hp | |
| have hHl : 1 β€ lam*(H:β) := by | |
| have := (div_lt_iffβ hlam).mp hH | |
| nlinarith | |
| obtain β¨M,hMβ© := exists_nat_gt (((2*H+1:β):β)/lam) | |
| refine β¨H,max H M,hHp,?_β© | |
| intro N hN | |
| have hHN : H β€ N := (le_max_left _ _).trans hN | |
| have hMN : M β€ N := (le_max_right _ _).trans hN | |
| have hc := division_blocks_control hHp hHN | |
| refine β¨lt_of_lt_of_le hHp hHN,hc.1,hc.2,division_block_width hlam.le hHl,?_β© | |
| have hreal : ((2*H+1:β):β) β€ (N:β)*lam := by | |
| have hm := (div_lt_iffβ hlam).mp hM | |
| have hn : (M:β) β€ N := by exact_mod_cast hMN | |
| nlinarith | |
| have hcount : ((N/(N/H)+2:β):β) β€ (N:β)*lam := by | |
| have hh : N/(N/H)+2 β€ 2*H+1 := by omega | |
| have hhR : ((N/(N/H)+2:β):β) β€ ((2*H+1:β):β) := by exact_mod_cast hh | |
| exact hhR.trans hreal | |
| rw [β Real.rpow_natCast (2:β) (N/(N/H)+2), β Real.rpow_natCast (2:β) N, | |
| β Real.rpow_mul (by norm_num : (0:β) β€ 2)] | |
| exact Real.rpow_le_rpow_of_exponent_le (by norm_num) hcount | |
| theorem blockDepth_brackets {N n B : β} (hn : n β€ N) (hB : 0 < B) : | |
| let i := (N-n)/B | |
| i < N/B+1 β§ blockDepth N B (i+1) β€ n β§ n β€ blockDepth N B i β§ | |
| blockDepth N B i-n β€ B β§ n-blockDepth N B (i+1) β€ B := by | |
| dsimp only | |
| have hlo := Nat.div_mul_le_self (N-n) B | |
| have hhi := Nat.lt_mul_div_succ (N-n) hB | |
| have hi : (N-n)/B β€ N/B := Nat.div_le_div_right (Nat.sub_le _ _) | |
| simp only [blockDepth] | |
| rw [Nat.mul_comm B] at hhi | |
| have hgap := blockDepth_gap N B ((N-n)/B) | |
| dsimp only [blockDepth] at hgap | |
| omega | |
| theorem profile_bracket_mass_bound {R C lam mβ mβ mβ xβ xβ xβ : β} | |
| (hR : 1 β€ R) (hC : 0 < C) (hCL : C β€ R^lam) | |
| (hml : mβ-mβ β€ (d:β)*lam) (hmu : mβ-mβ β€ (d:β)*lam) | |
| (hlo : R^(-mβ)/C β€ xβ) (hhi : xβ β€ C*R^(-mβ)) | |
| (hxl : xβ β€ xβ) (hxu : xβ β€ xβ) : | |
| R^(-((d:β)+1)*lam)*R^(-mβ) β€ xβ β§ xβ β€ R^(((d:β)+1)*lam)*R^(-mβ) := by | |
| have hRp : 0 < R := lt_of_lt_of_le zero_lt_one hR | |
| constructor | |
| Β· apply le_trans ?_ (hlo.trans hxl) | |
| apply (le_div_iffβ hC).mpr | |
| calc | |
| R^(-((d:β)+1)*lam)*R^(-mβ)*C β€ R^(-((d:β)+1)*lam)*R^(-mβ)*R^lam := | |
| mul_le_mul_of_nonneg_left hCL (by positivity) | |
| _ = R^(-(d:β)*lam-mβ) := by rw [β Real.rpow_add hRp,β Real.rpow_add hRp]; congr 1; ring | |
| _ β€ R^(-mβ) := Real.rpow_le_rpow_of_exponent_le hR (by nlinarith) | |
| Β· apply le_trans (hxu.trans hhi) | |
| calc | |
| C*R^(-mβ) β€ R^lam*R^(-mβ) := mul_le_mul_of_nonneg_right hCL (by positivity) | |
| _ = R^(lam-mβ) := by rw [β Real.rpow_add hRp]; rfl | |
| _ β€ R^(((d:β)+1)*lam-mβ) := Real.rpow_le_rpow_of_exponent_le hR (by nlinarith) | |
| _ = R^(((d:β)+1)*lam)*R^(-mβ) := Real.rpow_add hRp _ _ | |
| theorem sourceProfile_short_increment (ΞΌ : Measure (EuclideanSpace β (Fin d))) | |
| {N B : β} (hN : 0 < N) (hB : 0 < B) (p : (CellPath d)) {lam u v : β} | |
| (hwidth : (B:β) β€ lam*(N:β)) (hu : 0 β€ u) (huv : u β€ v) (hv : v β€ N) | |
| (hshort : v-u β€ B) : | |
| sourceProfile ΞΌ N B p v-sourceProfile ΞΌ N B p u β€ (d:β)*lam := by | |
| classical | |
| have hh := regularizedProfile_increment hN (show regularizationLeaves ΞΌ N β dyadicPaths N from Finset.filter_subset _ _) | |
| (regularizationLabel ΞΌ N B) hB p hu huv hv | |
| apply hh.2.trans | |
| apply (div_le_iffβ (by exact_mod_cast hN : 0 < (N:β))).mpr | |
| have hd : 0 β€ (d:β) := Nat.cast_nonneg _ | |
| have hs := mul_le_mul_of_nonneg_left hshort hd | |
| have hw := mul_le_mul_of_nonneg_left hwidth hd | |
| nlinarith | |
| theorem sourceClass_all_depth_comparison (ΞΌ : Measure (EuclideanSpace β (Fin d))) [IsProbabilityMeasure ΞΌ] {N B : β} (hN : 0 < N) (hB : 0 < B) | |
| {lam : β} (hwidth : (B:β) β€ lam*(N:β)) | |
| (hlarge : (2:β)^(N/B+2) β€ ((2:β)^N)^lam) | |
| {p : (CellPath d)} (hp : p β regularizationLeaves ΞΌ N) | |
| {n : β} (hn : n β€ N) {P : (CellPath d)} | |
| (hP : P β (classLeaves (regularizationLeaves ΞΌ N) (regularizationLabel ΞΌ N B) | |
| (regularizationLabel ΞΌ N B p)).image (List.take n)) : | |
| ((2:β)^N)^(-((d:β)+1)*lam)*((2:β)^N)^(-sourceProfile ΞΌ N B p n) β€ | |
| (sourceClass ΞΌ N B p (treeCell P)).toReal β§ | |
| (sourceClass ΞΌ N B p (treeCell P)).toReal β€ | |
| ((2:β)^N)^(((d:β)+1)*lam)*((2:β)^N)^(-sourceProfile ΞΌ N B p n) := by | |
| classical | |
| let i := (N-n)/B | |
| have hb := blockDepth_brackets hn hB | |
| change i < N/B+1 β§ blockDepth N B (i+1) β€ n β§ n β€ blockDepth N B i β§ | |
| blockDepth N B i-n β€ B β§ n-blockDepth N B (i+1) β€ B at hb | |
| obtain β¨q,hq,rflβ© := Finset.mem_image.mp hP | |
| let Ο := sourceClass ΞΌ N B p | |
| have : IsProbabilityMeasure Ο := sourceClass_probability ΞΌ N B hp | |
| have hgp := sourceClass_grid_comparison ΞΌ hN hB hp (Nat.le_of_lt hb.1) | |
| (Finset.mem_image.mpr β¨q,hq,rflβ©) | |
| have hgm := sourceClass_grid_comparison ΞΌ hN hB hp (by omega : i+1 β€ N/B+1) | |
| (Finset.mem_image.mpr β¨q,hq,rflβ©) | |
| have hmonoβ : Ο (treeCell (q.take (blockDepth N B i))) β€ | |
| Ο (treeCell (q.take n)) := by | |
| apply measure_mono | |
| have hh := treeCell_subset_take (q.take (blockDepth N B i)) n | |
| simpa only [List.take_take,Nat.min_eq_left hb.2.2.1] using hh | |
| have hmonoβ : Ο (treeCell (q.take n)) β€ | |
| Ο (treeCell (q.take (blockDepth N B (i+1)))) := by | |
| apply measure_mono | |
| have hh := treeCell_subset_take (q.take n) (blockDepth N B (i+1)) | |
| simpa only [List.take_take,Nat.min_eq_left hb.2.1] using hh | |
| have hml := sourceProfile_short_increment ΞΌ hN hB p hwidth | |
| (Nat.cast_nonneg n) (Nat.cast_le.mpr hb.2.2.1) | |
| (Nat.cast_le.mpr (Nat.sub_le N (i*B))) (by | |
| simpa only [Nat.cast_sub hb.2.2.1] using | |
| (show (((blockDepth N B i-n):β):β) β€ (B:β) by exact_mod_cast hb.2.2.2.1)) | |
| have hmu := sourceProfile_short_increment ΞΌ hN hB p hwidth | |
| (Nat.cast_nonneg (blockDepth N B (i+1))) (Nat.cast_le.mpr hb.2.1) (Nat.cast_le.mpr hn) (by | |
| simpa only [Nat.cast_sub hb.2.1] using | |
| (show (((n-blockDepth N B (i+1)):β):β) β€ (B:β) by exact_mod_cast hb.2.2.2.2)) | |
| exact profile_bracket_mass_bound (one_le_powβ (by norm_num : (1:β) β€ 2)) | |
| (by positivity) hlarge hml hmu hgp.1 hgm.2 | |
| (ENNReal.toReal_mono (measure_ne_top Ο _) hmonoβ) | |
| (ENNReal.toReal_mono (measure_ne_top Ο _) hmonoβ) | |
| end CurrentFalconer.TreeND | |
| end GraphLiteralSupport | |
| end | |
| end | |
| end OAI | |