cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Sampling /AllocatedFixedSamplingCover.lean
cfahlgren1's picture
download
raw
13.8 kB
import OAI.Combinatorics.Progressions.Estimates.AllocatedScaledIdealCover
namespace OAI
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule _root_.Set _root_.OAI.Set BooleanCubeKernel
open scoped BigOperators Classical NNReal
universe uG uI uB uJ uQ uX
attribute [local instance 2000] fullBooleanRowSetFintype activeAmbientAxisDecidableEq
attribute [local instance] ScalarSiteExpansion.termFinite
variable {m dim : ℕ} {G : Type uG} [Fintype G]
variable {I : Fin m → Type uI} [∀ j, Fintype (I j)] [∀ j, DecidableEq (I j)]
variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type uB)
variable [∀ a, Fintype (B a)] [∀ a, DecidableEq (B a)]
variable {J : Fin m → Type uJ} [∀ j, Fintype (J j)]
variable (U : ∀ j, Submodule ℝ (J j → ℝ))
variable (b : ∀ j, Basis (Fin (n j)) ℝ (euclideanSubspace (U j))ᗮ)
variable {R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
variable (S : LayerSamplerScale (G := G) B U b R σ)
local notation "rowSets" => (fun j : Fin m => boundedBooleanJetRows (Fin dim) (Fin.val j + 1))
local notation "rowTypes" => (fun j : Fin m => (rowSets j : Type))
local notation "rows" => (fun j => (Subtype.val : rowSets j → Finset (Fin dim)))
variable (M₀ : ℕ)
local notation "period" => kernelPeriodCandidate (m + 1)
local notation "P" => canonicalScalarSourceEnvelope m M₀
local notation "L" => scalarSourceTransitionBound
variable {p₀ p₁ w e E : ℝ}
local notation "δ" => allocatedSitePrimitiveTolerance m p₁ w (allocatedIdealProfileLog m p₁ e) E
local notation "Λ" => allocatedSiteSpectrumLog m p₁ w (allocatedIdealProfileLog m p₁ e) E
local notation "grid" => allocatedGridAxis (I := I) U b S.value
local notation "active" => allocatedActiveGrid B U b S
local notation "activeAxes" => {a : {a // grid a} // active a}
local notation "ig" => allocatedGridIntegerAxis B U b S
local notation "axisN" => allocatedGridNaturalScale B U b S
variable (hsize : (Fintype.card (Fin dim) + 1) * M₀ ^ (m + 1) ≤ S.value)
variable (M : {a : {a // allocatedGridAxis (I := I) U b S.value a} // allocatedActiveGrid B U b S a} → ℕ)
variable [∀ a, NeZero (M a)]
local notation "pointTolerance" => allocatedSitePointTolerance (G := G) B rowSets δ
local notation "torus" => (fun a : activeAxes => allocatedGridTorusFactor B (Fin dim) (ig (Subtype.val a)))
local notation "siteLip" => (NNReal.mk (Real.exp (1 + 6 * Λ + 12)) (Real.exp_nonneg _) + 4 : ℝ≥0)
local notation "coefficientCap" => (fun a : activeAxes =>
allocatedGridPointCap B P (ig (Subtype.val a)) (rowSets (Sigma.fst (ig (Subtype.val a)))) *
Real.exp (Fintype.card (Finset (Fin dim)) * (4 * Λ + 8) + Λ))
variable {K : ℕ}
variable (hSampling : ∀ inst : ∀ j : Fin m,
Fintype {s : Finset (Fin dim) // s ∈ boundedBooleanJetRows (Fin dim) (j.val + 1)},
@AllocatedBooleanRowsSampling.{uX,uJ,uG,uI,uB,uQ} m dim K
(fun j => {s : Finset (Fin dim) // s ∈ boundedBooleanJetRows (Fin dim) (j.val + 1)})
inst (fun _ => Subtype.val))
include hsize hSampling in
theorem cutoff_mask_good_kernel_ideal_cover_at_sampling
(hw : 0 ≤ w) (he : 0 ≤ e) (hE : 0 ≤ E)
(hdimSmall : dim ≤ m + 1)
(hvars : (Fintype.card (LayerSamplerVariables G I n B) : ℝ) ≤ p₁)
(hI : ∀ j, (Fintype.card (I j) : ℝ) ≤ p₁) (hn₁ : ∀ j, (n j : ℝ) ≤ p₁)
(hJ : ∀ j, (Fintype.card (J j) : ℝ) ≤ p₁)
(hp₀ : 0 ≤ p₀) (hcutoff : (M₀ : ℝ) ≤ Real.exp p₀)
(hSourceLog : canonicalScalarSourceLog m p₀ ≤ p₁)
(hmaskBudget : (m * 2 ^ (m + 1) : ℕ) * p₀ ≤ w)
(hS₁ : (S.value : ℝ) ≤ Real.exp p₁)
(hEbudget : E + 4 ≤ p₁)
(hgamma : ∀ a : activeAxes, principalProfileSize (R (ig a.val).1)
(Finset.card (layerIntegerPrincipalSlots (G := G) B (ig a.val).1 (ig a.val).2)) ≤ S.value)
(hM : ∀ a, M a = (torus) a * axisN a.val)
(hB : ∀ a : activeAxes, positiveModerateSpectrumBlockCount (ig a.val).1.val
(rowSets (ig a.val).1).card ((layerTailDegree m + 2) * (rowSets (ig a.val).1).card) ≤
Fintype.card (B ⟨(ig a.val).1, Sum.inr (ig a.val).2⟩)) :
∃ witnesses : (t : Fin M₀) → (r : AllocatedPositiveResidue (dim := dim) B U b S (period t)) →
AllocatedResidueSiteWitness (dim := dim) B U b S (period t) r.val,
(∀ t r, allocatedActiveSiteBounds B U b S rowSets P pointTolerance Λ M (witnesses t r).expansion) ∧ ∀
(hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
(o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j)))
{Q : Fin m → Type uQ} [∀ j, Fintype (Q j)]
(bW : ∀ j, Basis (Q j) ℤ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))))
(d : ℕ) [NeZero d]
[∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))]
(C V : Fin m → ℝ≥0)
(_hC : ∀ j z, ‖normalizedOrthogonalChart (euclideanSubspace (U j)) (b j) z‖ ≤ C j * ‖z‖)
(_hV : ∀ j, 0 ≤ mixedDensityCovolumeRatio (euclideanSubspace (U j)) (b j) ∧
mixedDensityCovolumeRatio (euclideanSubspace (U j)) (b j) ≤ V j)
(_hCexp : ∀ j, (C j : ℝ) ≤ Real.exp p₁) (_hVexp : ∀ j, (V j : ℝ) ≤ Real.exp p₁)
(_hRi : ∀ j, (R j)⁻¹ ≤ Real.exp p₁) (_hσ1 : ∀ j, σ j ≤ 1)
(Qsite : ℝ≥0) (_hQsite : ∀ a : activeAxes, 8 * ((Finset.card (layerIntegerPrincipalSlots (G := G) B
(ig a.val).1 (ig a.val).2) : ℝ) + 1) ≤ Qsite)
(Cinv : Fin m → ℝ) (_hCinv : ∀ j, 0 ≤ Cinv j)
(_hchart : ∀ j z, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (b j)).symm z‖ ≤ Cinv j * ‖z‖)
(_hsmall : ∀ j, R j ≤ allocatedIdealCoverRadius (G := G) B rowSets Cinv j),
∃ g : (t : Fin M₀) → (r : AllocatedPositiveResidue (dim := dim) B U b S (period t)) →
(∀ a, ((witnesses t r).expansion a).Term) → Finset (Fin dim) → (((Σ j, J j) → UnitAddCircle) → ℂ),
(∀ t r k s, LipschitzWith (max (((Fintype.card activeAxes * siteLip) * Qsite) *
(Real.toNNReal (Real.exp p₁) * ∑ j, C j * Fintype.card (J j)) * commonSitePeriod (witnesses t r).expansion k)
(4 * commonSitePeriod (witnesses t r).expansion k)) (g t r k s) ∧ ∀ z, ‖g t r k s z‖ ≤ 1) ∧
(∀ t r, (∑ k, ‖coverSiteCoefficient (witnesses t r).expansion k‖) ≤
(2 : ℝ) ^ Fintype.card (Finset (Fin dim)) * ∏ a, (coefficientCap) a) ∧
(∀ t, allocatedResidueCoverCoefficientMass B U b S (period t) (witnesses t) ≤
(2 : ℝ) ^ Fintype.card (Finset (Fin dim)) * ∏ a, (coefficientCap) a) ∧
∀ (x : G → IntegerScalarCubeBox (Fin dim) S.value)
(selection : Fin dim ↪ G) {κ : ℝ}
(_hx : GoodScalarKernelTuple selection κ M₀ x),
∃ t : Fin M₀,
(∀ root : G → ℤ, integerScalarLattice (Unit ⊕ Fin dim) (period t : ℤ) ≤
pivotFullImage (selectedSpatialPivot root (scalarCubeDifferenceMatrix x) selection)
(selectedSpatialFreeColumns root (scalarCubeDifferenceMatrix x) selection)) ∧
(∀ j, integerScalarLattice (rowTypes j) (period t : ℤ) ≤
(scalarKernelIntegerJet x (j.val + 1) (rows j)).mulVecLin.range) ∧
∀ (τ : ℝ≥0), 0 < τ → τ ≤ 1 → (τ : ℝ)⁻¹ ≤ Real.exp e → ∀
{X : Type uX} [Fintype X] [DecidableEq X]
{P₀ : ℝ} (_hP : 0 ≤ P₀) (_hn : (Fintype.card X : ℝ) ≤ P₀)
(_hdim : (Fintype.card (Option (Fin dim) × X) : ℝ) ≤ P₀)
(_hbudget : allocatedSiteErrorFourierOutput m p₁ w (allocatedIdealProfileLog m p₁ e) ≤ P₀)
[CompactSpace (CoefficientTorus (K := Fin dim) U)]
[MeasurableSpace (CoefficientTorus (K := Fin dim) U)] [BorelSpace (CoefficientTorus (K := Fin dim) U)]
(μ : Measure (CoefficientTorus (K := Fin dim) U)) [μ.IsAddLeftInvariant] [IsProbabilityMeasure μ]
(ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))).toAddSubgroup))
[∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
(p : ∀ j, VectorPolynomial X ℝ (J j → ℝ))
(_hp : ∀ j, DegreeLE (1 : X → ℕ) (j.val + 1) (p j))
(hmp : ∀ j e, coefficients (p j) e ∈ U j)
(stride : X → ℕ) (_hs : ∀ x, 0 < stride x)
{R₁ S₀ ρ : ℝ} (_hS : 0 ≤ S₀) (_hSP : S₀ ≤ Real.exp P₀) (_hρ : 0 < ρ)
(_hρP : 1 / ρ ≤ Real.exp P₀)
(_hstride : ∀ x, (stride x : ℝ) ≤ S₀)
(H : X → ℝ) (_hsize : ∀ x, Real.exp ((P₀ + K) ^ K) ≤ H x)
(_hrank : ∀ j, HasLayerSamplingRank (j.val + 1) H R₁ (U j) (p j))
(_hR : Real.exp ((P₀ + K) ^ K) ≤ R₁)
(cells : Finset (ColumnResiduePattern (Option (Fin dim)) X stride)) (_hcells : cells.Nonempty)
(W : Option (Fin dim) × X → ℝ) (hW : ∀ z, 0 < W z) (_hwidth : ∀ z, ρ * H z.2 ≤ W z),
let f := allocatedPhysicalLongIdeal B U b hR S rowSets τ
let law := principalTupleWeights (α := Fin dim) B (layerSamplerDegree I n)
(allocatedPrincipalSides B U b S) (allocatedPrincipalSides_pos B U b S)
let error := fun z : Option (Fin dim) × X → ℤ =>
law.complexMean (fun y₀ =>
(allocatedWholeMaskedCoveredProfile (O := rowTypes) B U b hR hσ S x (rows) hb o bW d y₀ (period t) f
(physicalCubeRowSample U d (rows) p hmp (standardPhysicalCubeOutput z)) : ℂ)) -
(law.fiberLaw (principalResidueLabel (period t))).complexMean
(allocatedSupportedIdealCoverValue B U b hR hσ S (period t) (witnesses t) hb o bW d (g t) τ x p hmp
(standardPhysicalCubeOutput z))
∃ hZ : 0 < ∑' z, selectedResidueSmoothWeight stride cells W z,
selectedResidueDensityMass stride cells W (fun z => ‖error z‖) ≤ Real.exp (-E) ∧
∀ φ : (Option (Fin dim) × X → ℤ) → ℂ, (∀ z, ‖φ z‖ ≤ 1) →
‖∑' z, ((selectedResidueSmoothPMF stride cells W hW hZ z).toReal : ℂ) *
(error z * φ z)‖ ≤ Real.exp (-E) := by
have hp₁ := (canonicalScalarSourceLog_bounds m hp₀).1.trans hSourceLog
have hM₀ := hcutoff.trans (Real.exp_le_exp.mpr
((canonicalScalarSourceLog_bounds m hp₀).2.trans hSourceLog))
have hPp := (canonicalScalarSourceEnvelope_le_exp m hp₀ hcutoff).trans
(Real.exp_le_exp.mpr hSourceLog)
obtain ⟨hP, hcP, hsources⟩ := canonicalScalarSourceEnvelope_bounds m M₀
have hsP := hsources dim hdimSmall
have hL := scalarSourceTransitionBound_spec.2
have hv := allocatedIdealProfileLog_nonneg m hp₁ he
have hδ := allocatedSitePrimitiveTolerance_pos m p₁ w (allocatedIdealProfileLog m p₁ e) E
have hΛ := (allocatedSiteSpectrumLog_bounds m hp₁ hw hv hE).2.2.2.1
have hspec := allocatedSiteSpectrum_primitive_budget B rowSets
(by simpa only [Fintype.card_fin] using hdimSmall) hp₁ hw hv hE hP hPp hvars hI hn₁
have hsizeFamily (t : Fin M₀) : (Fintype.card (Fin dim) + 1) * period t ≤ S.value :=
(Nat.mul_le_mul_left _ (kernelPeriodCandidate_le (m + 1) t)).trans hsize
have hsourceFamily (t : Fin M₀) :
scalarCubePrimitiveEnvelope (Fin dim) L 1 0 (period t) ≤ P := by
have hperiodSize : (period t : ℝ) ≤ (M₀ ^ (m + 1) : ℕ) := by
exact_mod_cast kernelPeriodCandidate_le (m + 1) t
have hcap := paddedResidueDensityCap_mono (Fin dim) (kernelPeriodCandidate_le (m + 1) t)
dsimp only [scalarCubePrimitiveEnvelope] at hsP ⊢
linarith only [hsP, hperiodSize, hcap]
have hex (t : Fin M₀) := exists_allocated_residue_site_sampling.{uG,uI,uB,uJ,uQ,uX}
B U b hR hσ S (period t) (kernelPeriodCandidate_pos (m + 1) t) (hsizeFamily t)
P δ Λ M hP hδ hΛ hgamma L hL hcP (hsourceFamily t) hM hB
(fun a => (hspec (ig a.val)).1)
(fun a => (hspec (ig a.val)).2.1)
(fun a => (hspec (ig a.val)).2.2)
choose witnesses hBounds hWitnesses using hex
refine ⟨witnesses, hBounds, ?_⟩
intro hb o Q _ bW d _ _ C V hC hV hCexp hVexp hRi hσ1 Qsite hQsite Cinv hCinv hchart hsmall
have hBounds' := hBounds
dsimp only [allocatedActiveSiteBounds] at hBounds'
have hcover (t : Fin M₀) := exists_allocated_ideal_cover_error B U b hR hσ S (period t)
δ (witnesses t) (hWitnesses t) hp₁ hw he hE hdimSmall hvars hI hn₁ hJ
M₀ (kernelPeriodCandidate_le (m + 1) t) hM₀ hS₁ (le_refl _) hEbudget (hBounds' t)
(K := K) (@hSampling (fun j => Finset.Subtype.fintype (rowSets j)))
hb o bW d C V hC hV hCexp hVexp hRi hσ1 Qsite hQsite Cinv hCinv hchart hsmall
choose g hg hc hmass hcomparison using hcover
refine ⟨g, hg, hc, hmass, ?_⟩
intro x selection κ hx
have hrows : ∀ j (z : rowTypes j), z.val.card ≤ j.val + 1 :=
fun j z => (mem_boundedBooleanJetRows (j.val + 1) z.val).mp z.property
obtain ⟨t, hspatial, hperiod⟩ := goodKernel_periodFamily selection x hx (m + 1) (by omega)
(fun j : Fin m => j.val + 1) (fun j => by omega) rows
(fun _ => Subtype.val_injective) hrows
refine ⟨t, hspatial, hperiod, ?_⟩
have hMpos : 0 < M₀ := by
obtain ⟨a, ha, haM, _⟩ := hx.2
exact ha.trans_le haM
intro τ hτ hτ1 hτe
refine @hcomparison t τ hτ hτ1 hτe x ?_ hperiod
intro y₀ j z
have hbound := allocatedIntegerKernelMask_bound B U b S x rows hMpos selection hx
(by simpa only [Fintype.card_fin] using hdimSmall)
(fun _ => Subtype.val_injective) hrows j (period t)
(integerResidueMatrix (allocatedNonkernelJetMatrix B U b S x
(principalAxisRestrict grid y₀) rows j
(principalAxisRestrict (fun a => ¬grid a) y₀)) (period t)) z
exact ⟨hbound.1, hbound.2.trans
((layerKernelIndexBound_le_exp m hcutoff).trans (Real.exp_le_exp.mpr hmaskBudget))⟩
end Erdos3.VectorPolynomial
end
end OAI

Xet Storage Details

Size:
13.8 kB
·
Xet hash:
43c79f3dd18f7f2f8d941390f5e8ca5d53145f7d518c492170fdb0ddd9d1b421

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