import OAI.MeasureTheory.Falconer.Recursion.ProfileGrid import OAI.MeasureTheory.Falconer.Estimates.AllDimensionalOccupiedClasses import OAI.MeasureTheory.Falconer.Estimates.RegularizationScales namespace OAI /-! # Mass-profile comparison at every depth in arbitrary dimension The interpolation loss is (d+1)*lambda. The block depths satisfy the same numerical bracketing as in the planar case. -/ namespace Falconer.Regularization variable {d : ℕ} open MeasureTheory open scoped ENNReal noncomputable def sourceProfile (Q : DyadicCube d) (μ : Measure (Space d)) (N B : ℕ) (p : CellPath d) : ℝ → ℝ := regularizedProfile (regularizationLeaves Q μ N) (regularizationLabel Q μ N B) N B (N/B+1) p noncomputable def sourceClass (Q : DyadicCube d) (μ : Measure (Space d)) (N B : ℕ) (p : CellPath d) : Measure (Space d) := normalizedClass Q μ (regularizationLeaves Q μ N) (regularizationLabel Q μ N B) (regularizationLabel Q μ N B p) theorem sourceClass_grid_comparison (Q : DyadicCube d) (hQ : 0 < Q.side) (μ : Measure (Space d)) [IsProbabilityMeasure μ] {N B : ℕ} (hN : 0 < N) (hB : 0 < B) {p : CellPath d} (hp : p ∈ regularizationLeaves Q μ N) {i : ℕ} (hi : i ≤ N/B+1) {P : CellPath d} (hP : P ∈ (classLeaves (regularizationLeaves Q μ N) (regularizationLabel Q μ N B) (regularizationLabel Q μ N B p)).image (List.take (blockDepth N B i))) : (((2:ℝ)^N)^(-sourceProfile Q μ N B p (blockDepth N B i)))/(2:ℝ)^(N/B+2) ≤ (sourceClass Q μ N B p (Q.descendant P).carrier).toReal ∧ (sourceClass Q μ N B p (Q.descendant P).carrier).toReal ≤ (2:ℝ)^(N/B+2)*(((2:ℝ)^N)^(-sourceProfile Q μ N B p (blockDepth N B i))) := by classical rw [sourceProfile,regularizedProfile_reference_grid hN (show regularizationLeaves Q μ N ⊆ cubePaths d N from Finset.filter_subset _ _) (regularizationLabel Q μ N B) hB p hi] exact regularization_grid_mass_bounds Q hQ μ N hB hp hi hP 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 linarith) · 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 linarith) _ = R^(((d:ℝ)+1)*lam)*R^(-mₙ) := Real.rpow_add hRp _ _ theorem sourceProfile_short_increment (Q : DyadicCube d) (μ : Measure (Space 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 Q μ N B p v-sourceProfile Q μ N B p u ≤ (d:ℝ)*lam := by classical have hh := regularizedProfile_increment hN (show regularizationLeaves Q μ N ⊆ cubePaths d N from Finset.filter_subset _ _) (regularizationLabel Q μ N B) hB p hu huv hv apply hh.2.trans apply (div_le_iff₀ (by exact_mod_cast hN : 0 < (N:ℝ))).mpr have hmul₁ := mul_le_mul_of_nonneg_left hwidth (Nat.cast_nonneg d) have hmul₂ := mul_le_mul_of_nonneg_left hshort (Nat.cast_nonneg d) nlinarith theorem sourceClass_all_depth_comparison (Q : DyadicCube d) (hQ : 0 < Q.side) (μ : Measure (Space 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 Q μ N) {n : ℕ} (hn : n ≤ N) {P : CellPath d} (hP : P ∈ (classLeaves (regularizationLeaves Q μ N) (regularizationLabel Q μ N B) (regularizationLabel Q μ N B p)).image (List.take n)) : ((2:ℝ)^N)^(-((d:ℝ)+1)*lam)*((2:ℝ)^N)^(-sourceProfile Q μ N B p n) ≤ (sourceClass Q μ N B p (Q.descendant P).carrier).toReal ∧ (sourceClass Q μ N B p (Q.descendant P).carrier).toReal ≤ ((2:ℝ)^N)^(((d:ℝ)+1)*lam)*((2:ℝ)^N)^(-sourceProfile Q μ N B p n) := by classical let i := (N-n)/B have hb := PlanarFalconer.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 Q μ N B p have : IsProbabilityMeasure ρ := regularization_class_probability Q hQ μ N B hp have hgp := sourceClass_grid_comparison Q hQ μ hN hB hp (Nat.le_of_lt hb.1) (Finset.mem_image.mpr ⟨q,hq,rfl⟩) have hgm := sourceClass_grid_comparison Q hQ μ hN hB hp (by omega : i+1 ≤ N/B+1) (Finset.mem_image.mpr ⟨q,hq,rfl⟩) have hmono₁ : ρ (Q.descendant (q.take (blockDepth N B i))).carrier ≤ ρ (Q.descendant (q.take n)).carrier := by apply measure_mono have hh := descendant_subset_take Q hQ (q.take (blockDepth N B i)) n simpa only [List.take_take,Nat.min_eq_left hb.2.2.1] using hh have hmono₀ : ρ (Q.descendant (q.take n)).carrier ≤ ρ (Q.descendant (q.take (blockDepth N B (i+1)))).carrier := by apply measure_mono have hh := descendant_subset_take Q hQ (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 Q μ 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 Q μ 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 Falconer.Regularization end OAI