cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Linear /AnisotropicGoodKernelComparison.lean
cfahlgren1's picture
download
raw
10.1 kB
import OAI.Combinatorics.Progressions.Geometry.AnisotropicSpatialCapBudget
namespace OAI
section
namespace Erdos3
open MeasureTheory BooleanCubeKernel
open scoped BigOperators NNReal
noncomputable def anisotropicSpatialDetAllowance (I : Type*) [Fintype I] (C : ℝ) : ℝ :=
(Fintype.card (Unit βŠ• I)).factorial * C ^ Fintype.card (Unit βŠ• I)
noncomputable def anisotropicSpatialMeshThreshold {I J : Type*} [Fintype I] [Fintype J]
(s : I β†ͺ J) (N : Type*) [Fintype N] (C : ℝ) : ℝ :=
2 * (1 + 4 ^ (Fintype.card (Unit βŠ• I) + Fintype.card (UnselectedColumn s βŠ• N)) *
((Fintype.card (UnselectedColumn s βŠ• N) + Fintype.card (Unit βŠ• I) : ℝ) * probabilityProfileLipschitz)) *
anisotropicSpatialDetAllowance I C
noncomputable def anisotropicSpatialError {I J : Type*} [Fintype I] [Fintype J]
(s : I β†ͺ J) (N : Type*) [Fintype N] (B : β„•) (ΞΊ C ρ ΞΎ : ℝ) : ℝ :=
normalizedFiberErrorConstant (Fintype.card (Unit βŠ• I)) (Fintype.card (UnselectedColumn s βŠ• N))
((B : ℝ) ^ (Fintype.card I + 1)) (physicalSpatialInverseBound I ΞΊ)
(Fintype.card (UnselectedColumn s βŠ• N)) 1 1
((Fintype.card (UnselectedColumn s βŠ• N) + Fintype.card (Unit βŠ• I)) * probabilityProfileLipschitz) *
anisotropicSpatialDetAllowance I C / ρ +
(B : ℝ) ^ (Fintype.card I + 1) *
(spatialKernelErrorConstant (Fintype.card (Unit βŠ• I)) (Fintype.card (UnselectedColumn s))
(physicalSpatialInverseBound I ΞΊ) 1
((Fintype.card (UnselectedColumn s) + Fintype.card (Unit βŠ• I)) * probabilityProfileLipschitz) *
(Fintype.card N * ΞΎ))
theorem anisotropicSpatial_original_error {I J N : Type*}
[Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] [Fintype N] [DecidableEq N]
(root : J β†’ β„€) (D : Matrix I J β„€) (s : I β†ͺ J)
(C : Matrix (Unit βŠ• I) N β„€) (Q : N β†’ ℝ)
{A R L ΞΊ Cβ‚€ ρ ΞΎ : ℝ} {B : β„•}
(hA : 0 < A) (hR : 0 < R) (hL : 0 < L) (hκ : 0 < κ) (hρ : 0 < ρ)
(hCβ‚€ : 1 ≀ Cβ‚€) (hr : βˆ€ j, |(root j : ℝ)| * R ≀ A)
(hD : βˆ€ i j, |(D i j : ℝ)| ≀ L)
(hrC : βˆ€ j, |(root j : ℝ)| ≀ Cβ‚€) (hDC : βˆ€ i j, |(D i j : ℝ)| ≀ Cβ‚€)
(hminor : ΞΊ ≀ |(Matrix.of (fun i j => (D i (s j) : ℝ) / L)).det|)
(hperiod : HasBoundedScalarPeriod D.mulVecLin.range B)
(hQ : βˆ€ j, 0 < Q j) (hΞΎ0 : 0 ≀ ΞΎ) (hΞΎ1 : ΞΎ ≀ 1)
(hC : βˆ€ i j, |(C i j : ℝ)| * Q j ≀ ΞΎ * physicalSpatialOutputScale I A R L i)
(hscaleA : ρ ≀ A) (hscaleR : ρ ≀ R) (hscaleQ : βˆ€ j, ρ ≀ Q j)
(hmesh : anisotropicSpatialMeshThreshold s N Cβ‚€ ≀ ρ) :
let hp := (anisotropicSpatialPivot_control root D s hA hR hL hΞΊ hr hD hminor).1
βˆ€ v, |(∏ i, physicalSpatialOutputScale I A R L i) *
(anisotropicSpatialOutputLaw root D C A R Q hA hR hQ v).toReal -
maskedIntegerImageDensity (selectedSpatialPivot root D s)
(Matrix.fromCols (selectedSpatialFreeColumns root D s) C) (physicalSpatialOutputScale I A R L)
(anisotropicSpatialKernelDensity s root D hp A R L hA hR hL) v| ≀
anisotropicSpatialError s N B ΞΊ Cβ‚€ ρ ΞΎ := by
intro hp
let M := selectedSpatialPivot root D s
let M' := selectedSpatialFreeColumns root D s
let S := anisotropicSpatialScale I A R
let P := physicalSpatialOutputScale I A R L
let lip : ℝβ‰₯0 := (Fintype.card (UnselectedColumn s βŠ• N) + Fintype.card (Unit βŠ• I)) * probabilityProfileLipschitz
have hS := anisotropicSpatialScale_pos I hA hR
have hP := physicalSpatialOutputScale_pos I hA hR hL
have hFree : βˆ€ j, 0 < Sum.elim (fun _ : UnselectedColumn s => R) Q j := by
rintro (j | j)
Β· exact hR
Β· exact hQ j
have hscaleS : βˆ€ i, ρ ≀ S i := by
rintro (i | i)
Β· exact hscaleA
Β· exact hscaleR
have hscaleFree : βˆ€ j, ρ ≀ Sum.elim (fun _ : UnselectedColumn s => R) Q j := by
rintro (j | j)
Β· exact hscaleR
Β· exact hscaleQ j
have hcoeff : βˆ€ i j, |(M i j : ℝ)| ≀ Cβ‚€ * (1 : ℝ) ^ 0 := by
intro i j
have heq : M = (physicalCubeCoefficient root D).submatrix id (physicalCubePivotIndex s) :=
(physicalCubeCoefficient_pivot root D s).symm
rw [heq]
simpa only [Matrix.submatrix_apply, id_eq, pow_zero, mul_one] using
physicalCube_coefficient_bound root D hCβ‚€ hrC hDC i (physicalCubePivotIndex s j)
have hdet : (M.det.natAbs : ℝ) ≀ anisotropicSpatialDetAllowance I Cβ‚€ := by
simpa only [anisotropicSpatialDetAllowance, one_pow, mul_one] using
integerPivot_polynomial_period_bound M 0 hcoeff
have hm := enormousCoefficient_mesh_conditions (j := Fintype.card (Unit βŠ• I)) (h := 0)
(D := anisotropicSpatialDetAllowance I Cβ‚€)
(Z := 4 ^ (Fintype.card (Unit βŠ• I) + Fintype.card (UnselectedColumn s βŠ• N)) * (lip : ℝ))
(L := 1) (H := ρ) (by unfold anisotropicSpatialDetAllowance; positivity) (by positivity)
(by norm_num) hρ (by
simpa only [anisotropicSpatialMeshThreshold, lip, NNReal.coe_mul, NNReal.coe_add,
NNReal.coe_natCast, one_pow, mul_one] using hmesh)
simp only [one_pow, mul_one, div_one] at hm
have hsmallMass : 4 ^ (Fintype.card (Unit βŠ• I) + Fintype.card (UnselectedColumn s βŠ• N)) *
(lip : ℝ) * ((M.det.natAbs : ℝ) / ρ) ≀ 1 / 2 :=
(mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right hdet hρ.le) (by positivity)).trans hm.2
have hindex : ((pivotFullImage M (Matrix.fromCols M' C)).toAddSubgroup.index : ℝ) ≀
(B : ℝ) ^ (Fintype.card I + 1) := by
exact_mod_cast selectedSpatial_extended_index root D s C hperiod
have hinv : β€–(normalizedPivotEquiv M hp S P hS hP).symm.toContinuousLinearMapβ€– ≀
physicalSpatialInverseBound I ΞΊ := by
rw [normalizedPivotEquiv_inverse_eq]
exact (anisotropicSpatialPivot_control root D s hA hR hL hΞΊ hr hD hminor).2
have hcol := anisotropicSpatial_free_norm_bound root D s C Q hA hR hL hΞΎ1
(fun j => (hQ j).le) hr hD hC
have hmove : βˆ€ n, smoothProductProfile N n β‰  0 β†’
β€–matrixSupCLM (normalizedIntegerColumns C Q P) nβ€– ≀ Fintype.card N * ΞΎ := by
apply supported_column_displacement _ _ (smoothProductProfile_zero_outside N)
simpa only [mul_one] using normalizedIntegerColumns_variable_norm_bound C Q P hP hΞΎ0
(fun j => (hQ j).le) hC
have hfull : LipschitzWith lip
(splitFreeProfile (smoothSplitProfile (UnselectedColumn s) (Unit βŠ• I)) (smoothProductProfile N)) := by
rw [splitFreeProfile_smooth]
exact smoothSplitProfile_lipschitz _ _
have hbound : βˆ€ p, β€–splitFreeProfile
(smoothSplitProfile (UnselectedColumn s) (Unit βŠ• I)) (smoothProductProfile N) pβ€– ≀ 1 := by
rw [splitFreeProfile_smooth]
exact smoothSplitProfile_norm_le _ _
obtain ⟨hM, hpoint, _⟩ := normalizedSpatial_probability_comparison M hp M' C S P
(fun _ : UnselectedColumn s => R) Q hS hP hFree
(smoothSplitProfile (UnselectedColumn s) (Unit βŠ• I)) (smoothProductProfile N)
(fun p => (smoothSplitProfile_range _ _ p).1) (fun n => (smoothProductProfile_range _ n).1)
(smoothSplitProfile_lipschitz _ _) (smoothProductProfile_contDiff N).continuous hfull
0 zero_le_one (mul_nonneg (Nat.cast_nonneg _) hξ0) hρ zero_le_one hscaleS hscaleFree
(hdet.trans hm.1) hcoeff (smoothSplitProfile_zero_outside _ _) (smoothProductProfile_zero_outside N)
(smoothSplitProfile_integral _ _) (smoothProductProfile_integral N)
(by simpa only [max_self, show (2 : ℝ) * 1 + 2 = 4 by norm_num] using hsmallMass)
hbound hindex hinv hcol hmove
rw [← smoothSelectedSpatial_anisotropic_law root D s C hA hR Q hQ]
simpa only [splitFreeProfile_smooth, max_self, one_pow, mul_one, lip, M, M', S, P,
smoothIntegerImagePMF, anisotropicSpatialError, anisotropicSpatialDetAllowance,
anisotropicSpatialKernelDensity] using hpoint
end Erdos3
end
section
namespace Erdos3
open BooleanCubeKernel
open scoped BigOperators
theorem goodScalarKernelTuple_anisotropic_error {I J N : Type*}
[Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] [Fintype N] [DecidableEq N]
{L B : β„•} (hL : 0 < L) (s : I β†ͺ J) (x : J β†’ IntegerScalarCubeBox I L)
(root : J β†’ β„€) (C : Matrix (Unit βŠ• I) N β„€) (Q : N β†’ ℝ)
{A R ΞΊ Cβ‚€ ρ ΞΎ : ℝ} (hA : 0 < A) (hR : 0 < R) (hΞΊ : 0 < ΞΊ) (hρ : 0 < ρ)
(hx : GoodScalarKernelTuple s ΞΊ B x) (hCβ‚€ : 1 ≀ Cβ‚€) (hLC : (L : ℝ) ≀ Cβ‚€)
(hr : βˆ€ j, |(root j : ℝ)| * R ≀ A) (hrC : βˆ€ j, |(root j : ℝ)| ≀ Cβ‚€)
(hQ : βˆ€ j, 0 < Q j) (hΞΎ0 : 0 ≀ ΞΎ) (hΞΎ1 : ΞΎ ≀ 1)
(hC : βˆ€ i j, |(C i j : ℝ)| * Q j ≀ ΞΎ * physicalSpatialOutputScale I A R L i)
(hscaleA : ρ ≀ A) (hscaleR : ρ ≀ R) (hscaleQ : βˆ€ j, ρ ≀ Q j)
(hmesh : anisotropicSpatialMeshThreshold s N Cβ‚€ ≀ ρ) :
let hp := goodScalarKernelTuple_spatial_det_ne_zero s x root hΞΊ hx
βˆ€ v, |(∏ i, physicalSpatialOutputScale I A R L i) *
(anisotropicSpatialOutputLaw root (scalarCubeDifferenceMatrix x) C A R Q hA hR hQ v).toReal -
maskedIntegerImageDensity (selectedSpatialPivot root (scalarCubeDifferenceMatrix x) s)
(Matrix.fromCols (selectedSpatialFreeColumns root (scalarCubeDifferenceMatrix x) s) C)
(physicalSpatialOutputScale I A R L)
(anisotropicSpatialKernelDensity s root (scalarCubeDifferenceMatrix x) hp A R L
hA hR (Nat.cast_pos.mpr hL)) v| ≀ anisotropicSpatialError s N B ΞΊ Cβ‚€ ρ ΞΎ := by
intro hp
have hD : βˆ€ i j, |(scalarCubeDifferenceMatrix x i j : ℝ)| ≀ L := by
intro i j
have hi := Finset.mem_Ico.mp (x j (some i)).property
exact_mod_cast (abs_le.mpr ⟨hi.1, hi.2.le⟩)
have hminor : ΞΊ ≀ |(Matrix.of (fun i j => (scalarCubeDifferenceMatrix x i (s j) : ℝ) / (L : ℝ))).det| := by
change ΞΊ ≀ |(normalizedScalarCubePivot s x).det|
rw [normalizedScalarCubePivot_det]
exact hx.1.le
exact anisotropicSpatial_original_error root (scalarCubeDifferenceMatrix x) s C Q
hA hR (Nat.cast_pos.mpr hL) hΞΊ hρ hCβ‚€ hr hD hrC (fun i j => (hD i j).trans hLC)
hminor hx.2 hQ hΞΎ0 hΞΎ1 hC hscaleA hscaleR hscaleQ hmesh
end Erdos3
end
end OAI

Xet Storage Details

Size:
10.1 kB
Β·
Xet hash:
60b6ce011c55ffd9c23537544e1a9eececcd3fc80955d65b485db6ae904cc55c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.