Buckets:
cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Linear /AnisotropicGoodKernelComparison.lean
| 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.