cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Sampling /PreparedCenteredForecastEarlyWidth.lean
cfahlgren1's picture
download
raw
48 kB
import OAI.Combinatorics.Progressions.Estimates.PreparedCenteredModelMarginalData
import OAI.Combinatorics.Progressions.Sampling.ActualFixedSpatialCenteredForecastModel
namespace OAI
section
namespace Erdos3.VectorPolynomial
open BooleanCubeKernel
open scoped BigOperators Classical TensorProduct
variable {m : ℕ} {G : Type*} [Fintype G] [DecidableEq G]
variable {I : Fin m → Type*} [∀ j, Fintype (I j)] [∀ j, DecidableEq (I j)]
variable {n : Fin m → ℕ}
variable (B : LayerSamplerAxis I n → Type*) [∀ a, Fintype (B a)] [∀ a, DecidableEq (B a)]
variable {J : Fin m → Type*} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ))
variable (b : ∀ j, Module.Basis (Fin (n j)) ℝ (euclideanSubspace (U j))ᗮ)
variable {R σ : Fin m → ℝ} (S : LayerSamplerScale (G := G) B U b R σ)
local notation "sides" => Sum.elim (fun _ : G => S.value) (allocatedPrincipalSides B U b S)
theorem preparedCenteredForecast_slice_bounds {p : ℝ} {A : Finset (integerBox sides)}
(hA : IsDenseCommonStrideBox sides p (A.image Subtype.val)) :
A.Nonempty ∧ (Fintype.card (integerBox sides) : ℝ) / A.card ≤
Real.exp (p * Fintype.card (LayerSamplerVariables G I n B)) := by
exact ⟨Finset.image_nonempty.mp hA.nonempty, allocatedParameterBox_slice_cost B U b S hA⟩
theorem preparedCenteredForecast_slice_family_bounds
{Path : Type*} {Tests : Path → Type*}
(slices : ∀ z, Tests z → Finset (integerBox sides)) {p : ℝ}
(hDense : ∀ z j, IsDenseCommonStrideBox sides p ((slices z j).image Subtype.val)) :
(∀ z j, (slices z j).Nonempty) ∧
(∀ z j, (Fintype.card (integerBox sides) : ℝ) / (slices z j).card ≤
Real.exp (p * Fintype.card (LayerSamplerVariables G I n B))) := by
exact ⟨fun z j => (preparedCenteredForecast_slice_bounds B U b S (hDense z j)).1,
fun z j => (preparedCenteredForecast_slice_bounds B U b S (hDense z j)).2⟩
theorem preparedCenteredForecast_niltest_star_eval_bound
{ι L : Type*} [LieRing L] [LieAlgebra ℚ L] {s d : ℕ}
[TopologicalSpace (ℝ ⊗[ℚ] L)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] L)]
[ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [T2Space (ℝ ⊗[ℚ] L)]
{D : RationalFilteredNilmanifold L s d} {w : ι → ℕ}
(V : D.Niltest w) (hcap : (V.normBound : ℝ) ≤ 1) (x : ι → ℤ) :
‖star (V.eval x)‖ ≤ 1 := by
simpa only [norm_star] using (V.norm_eval_le x).trans hcap
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule BooleanCubeKernel
open scoped Classical BigOperators NNReal TensorProduct
variable {m : ℕ} {G : Type} [Fintype G] [DecidableEq G]
variable {I : Fin m → Type} [∀ j, Fintype (I j)]
variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type)
variable [∀ a, Fintype (B a)]
variable {J : Fin m → Type} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ))
variable (basis : ∀ j, Module.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 basis R σ)
variable {nX : ℕ}
local notation "rowSets" => (fun j : Fin m => boundedBooleanJetRows (Fin (0 + 1)) (Fin.val j + 1))
attribute [local instance 2000] fullBooleanRowSetFintype
attribute [local instance] ScalarSiteExpansion.termFinite
local notation "selectedRows" => (fun j : Fin m => (rowSets j : Type))
local notation "rows" => (fun j => (Subtype.val : rowSets j → Finset (Fin (0 + 1))))
variable (selection : Fin (0 + 1) ↪ G) (stride N : Fin nX → ℕ)
variable (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ) (Vtail : Fin m → ℝ≥0)
local notation "pDetect" => allocatedModelTestLog uSource pModel
local notation "qDetect" => allocatedModelTestLog uSource pModel
local notation "Ctail" => (4 * ∏ j, earlyConstantDensityCap (Fintype.card (I j)) (n j) (R j) (Vtail j))
local notation "Kslice" => Real.exp (pSlice * Fintype.card (LayerSamplerVariables G I n B))
variable (τ u p forecastCap : ℝ)
local notation "α" => forecastAugmentedUnitThreshold u p Kslice (max 1 Ctail) forecastCap
variable {P : ℝ}
local notation "grid" => allocatedGridAxis (I := I) U basis S.value
local notation "degree" => layerSamplerDegree I n
local notation "Tuple" => PrincipalTupleIndex (fun a : {a // ¬grid a} => B (Subtype.val a)) (fun a => degree (Subtype.val a))
local notation "jetRows" => selectedRows
local notation "activeB" => (fun a : {a // ¬grid a} => B (Subtype.val a))
local notation "activeDegree" => (fun a : {a // ¬grid a} => degree (Subtype.val a))
local notation "L" => principalAxisLength (fun a => ¬grid a) (allocatedPrincipalSides B U basis S)
local notation "positiveLengths" => (fun j : Tuple => allocatedPrincipalSides_pos B U basis S
(Sigma.mk (Subtype.val (Sigma.fst j)) (Sigma.snd j)))
variable (Q : Fin m → Type) [∀ j, Fintype (Q j)]
variable (hb : ∀ j, span ℤ (Set.range (basis j)) = projectedIntegerLattice (euclideanSubspace (U j)))
variable (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j)))
variable (bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))))
local notation "source" => allocatedCoefficientSource B U basis hR hσ S
local notation "frozenSource" => allocatedFrozenCoefficientSource B U basis hR hσ S
local notation "reference" => allocatedLongJetReference B U basis S jetRows
variable [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))]
variable (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))).toAddSubgroup))
variable [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
variable [MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [coefficientBorel : BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [coefficientCompact : CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [measureInvariant : μ.IsAddLeftInvariant] [IsProbabilityMeasure μ]
local notation "jetHaar" => Measure.pi (fun j =>
@Measure.pi (selectedRows j) _ (fullBooleanRowSetFintype (0 + 1) (Fin.val j + 1)) _
(fun _ : selectedRows j => ν j))
local notation "density" => allocatedCoefficientDensity B U basis hb o hR hσ S
def PreparedCenteredForecastModelInterface
(Pchart Qstride Pmaster Plate _pGain Pphysical coarseTarget : ℝ) : Prop :=
∀ (_hstride : ∀ i, 0 < stride i) (_hstrideBound : ∀ i, (stride i : ℝ) ≤ Real.exp Qstride)
(C : Fin m → ℝ) (_hC : ∀ j, 0 ≤ C j) (_hCbound : ∀ j, C j ≤ Real.exp Pchart)
(_hchart : ∀ j v, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j)).symm v‖ ≤ C j * ‖v‖)
(Cforward : Fin m → ℝ≥0)
(_hforward : ∀ j v, ‖normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j) v‖ ≤ Cforward j * ‖v‖)
(_hForward : ∀ j, (Cforward j : ℝ) ≤ Real.exp Pchart)
(_hVtail : ∀ j, (Vtail j : ℝ) ≤ Real.exp Pchart)
(_hVactual : ∀ j, 0 ≤ mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ∧
mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ≤ Vtail j)
(_hprofile : (probabilityProfileLipschitz : ℝ) ≤ Real.exp Pchart)
(_hcutoff : (normalizedSiteCutoffBound : ℝ) ≤ Real.exp Pchart),
∀ {E : ℝ},
∀ (hτSpatial : 0 < τ), τ⁻¹ ≤ Real.exp Pphysical →
τ ≤ 1 / 2 → (nX : ℝ) * τ ≤ 1 / 2 →
let r := preparedModularGeneralDetectorResources (preparedModularGeneralDetectorConstants m 0) (0 + 1) Pmaster Plate
let W := allocatedPhysicalRootBudget B U basis S (fun _ => 0)
let ξn := normalizedTupleNarrowWidth (Fin nX)
(PrincipalTupleIndex B (layerSamplerDegree I n)) selection
(allocatedDetectedKernelCutoff 0 G (Fintype.card (LayerSamplerVariables G I n B)) Pdetect pDetect qDetect (α / 2))
Pphysical coarseTarget
let hW := allocatedPhysicalRootBudget_nonneg B U basis S (fun _ => 0)
let hξone : ξn ≤ 1 := min_le_left _ _
let Pmarginal := r.Pproj
let required := max r.required ((max Pmarginal E + preparedCenteredMarginalExponent m) ^
preparedCenteredMarginalExponent m)
∀ (cells : Finset (ColumnResiduePattern (Option (LayerSamplerVariables G I n B)) (Fin nX) stride))
(poly : ∀ j, VectorPolynomial (Fin nX) ℝ (J j → ℝ))
(_hp : ∀ j, DegreeLE (1 : (Fin nX) → ℕ) (j.val + 1) (poly j))
(hmem : ∀ j ex, coefficients (poly j) ex ∈ U j)
{Rrank : ℝ},
(∀ i, Real.exp required ≤ (N i : ℝ)) →
(∀ j, HasLayerSamplingRank (j.val + 1) (fun i => (N i : ℝ)) Rrank (U j) (poly j)) →
Real.exp required ≤ Rrank →
let V := narrowTrimmedSpatialWidths (G := G) (J := PrincipalTupleIndex B (layerSamplerDegree I n)) W τ ξn N
cells.Nonempty →
let bases := trimmedIntegerBox N (spatialTrimMargin τ N)
let hξn := normalizedTupleNarrowWidth_pos (Fin nX)
(PrincipalTupleIndex B (layerSamplerDegree I n)) selection (allocatedDetectedKernelCutoff 0 G (Fintype.card (LayerSamplerVariables G I n B)) Pdetect pDetect qDetect (α / 2)) Pphysical coarseTarget
let Z := selectedJointDensityMass bases stride cells V
(allocatedJointBaseDensity B U basis hb o hR hσ S (Fin nX) poly hmem)
∃ (hN : ∀ i, 0 < N i) (hbases : bases.Nonempty) (hbox : (integerBox N).Nonempty)
(hmass : 0 < ∑' z, selectedResidueSmoothWeight stride cells V z)
(_hnormalizer : |Z - 1| ≤ Real.exp (-r.E) ∧ Z ∈ Set.Icc (1 / 2 : ℝ) (3 / 2) ∧ 0 < Z ∧ Z⁻¹ ≤ 2)
(_hmargin : ∀ i, 2 * spatialTrimMargin τ N i ≤ N i),
let Path := bases × rectangularWeightIndices 0 V 1
let Zcenter := fun center => selectedJointDensityMass bases stride cells V
(allocatedCenteredJointDensity B U basis hb o hR hσ S poly hmem center)
∃ hnormalizerCenter : ∀ center,
|Zcenter center - 1| ≤ Real.exp (-E) ∧
Zcenter center ∈ Set.Icc (1 / 2 : ℝ) (3 / 2) ∧
0 < Zcenter center ∧ (Zcenter center)⁻¹ ≤ 2,
let centeredLaw := fun center => selectedJointFiniteLaw bases hbases stride cells V
(narrowTrimmedSpatialWidths_pos hW hτSpatial hξn N hN) hmass
(allocatedCenteredJointDensity B U basis hb o hR hσ S poly hmem center)
(allocatedCenteredJointDensity_nonneg B U basis hb o hR hσ S poly hmem center) (hnormalizerCenter center).2.2.1
∃ hweight : ∀ z, Measurable (fun center => (centeredLaw center).weight z),
let pathLaw := centeredFiniteMarginal μ centeredLaw hweight
let sides := Sum.elim (fun _ : G => S.value) (allocatedPrincipalSides B U basis S)
let Sites := integerBox sides
let e : Sites → LayerSamplerVariables G I n B → ℤ := Subtype.val
letI : Nonempty Sites := by
have hpos (k : LayerSamplerVariables G I n B) : 0 < sides k := by
cases k with
| inl g => exact S.positive
| inr j => exact allocatedPrincipalSides_pos B U basis S j
let : ∀ k, NeZero (sides k) := fun k => ⟨(hpos k).ne'⟩
exact (integerBox_nonempty sides).to_subtype
let hrootSum := fun t : Sites => allocatedParameterBox_root_bound B U basis S t
let physical := narrowPhysicalSiteMap (G := G)
(J := PrincipalTupleIndex B (layerSamplerDegree I n)) hW hτSpatial hξone N hN
_hmargin e hrootSum
(FiniteProbabilityWeights.uniformFinset (integerBox N) hbox).excessMass
(pathLaw.siteLaw physical) Ctail ≤ 6 * positiveProjectionAccuracy E ∧
∀ {Tests : Path → Type} [∀ z, Nonempty (Tests z)]
{Ldetect : ∀ z, Tests z → Type} [∀ z j, LieRing (Ldetect z j)] [∀ z j, LieAlgebra ℚ (Ldetect z j)]
{dims : ∀ z, Tests z → ℕ}
[∀ z j, TopologicalSpace (ℝ ⊗[ℚ] Ldetect z j)]
[∀ z j, IsTopologicalAddGroup (ℝ ⊗[ℚ] Ldetect z j)]
[∀ z j, ContinuousSMul ℝ (ℝ ⊗[ℚ] Ldetect z j)] [∀ z j, T2Space (ℝ ⊗[ℚ] Ldetect z j)]
(Ddetect : ∀ z j, RationalFilteredNilmanifold (Ldetect z j) 0 (dims z j))
(Vdetect : ∀ z j, (Ddetect z j).Niltest (fun _ : LayerSamplerVariables G I n B => 1))
(slices : ∀ z, Tests z → Finset Sites)
(cdetect : ∀ z, Tests z → LayerSamplerVariables G I n B → ℤ)
(stepdetect : ∀ z, Tests z → ℕ)
(Hdetect : ∀ z, Tests z → LayerSamplerVariables G I n B → ℕ),
(∀ z j, 0 < stepdetect z j) →
(∀ z j, (slices z j).image e = commonStrideBox (cdetect z j) (stepdetect z j) (Hdetect z j)) →
(∀ z j, IsDenseCommonStrideBox
(Sum.elim (fun _ : G => S.value) (allocatedPrincipalSides B U basis S)) pSlice ((slices z j).image e)) →
(Fintype.card (LayerSamplerVariables G I n B) : ℝ) ≤ Pdetect.eval₂ (Nat.castRingHom ℝ) qDetect →
(∀ z j, (Vdetect z j).ComplexityLE (Pdetect.eval₂ (Nat.castRingHom ℝ) qDetect)) →
(∀ z j, ((Vdetect z j).normBound : ℝ) ≤ 1) →
let budget := r.nativeBudget
let tests := fun z j t => star ((Vdetect z j).eval
(commonStrideIndex (cdetect z j) (stepdetect z j) (e t)))
∀ {Forecast : Type} [Nonempty Forecast]
(forecast : Forecast → integerBox N → ℂ)
{PforecastNative massLog : ℝ},
0 ≤ PforecastNative → 0 ≤ massLog →
u + 2 * p + max (max budget (3 * PforecastNative + 3))
(2 * u + 4 * p + massLog + 20) + 32 ≤ E →
∀ (Term : Forecast → Type) [∀ f, Fintype (Term f)]
(coefficient : ∀ f, Term f → ℂ)
(centerConstant : Forecast → ∀ j, J j → ℝ)
(twists : ∀ f, Term f → NormalizedPolynomialTwist (Fin nX) (Σ j, J j)
(Real.exp (3 * PforecastNative + 3)) (Real.exp (3 * PforecastNative + 3))
⟨Real.exp (3 * PforecastNative + 3), Real.exp_nonneg _⟩),
(∀ f, (∑ i, ‖coefficient f i‖) ≤ Real.exp massLog) →
(∀ f v, ‖forecast f v - ∑ i, coefficient f i *
(twists f i).eval N (fun j => subtractConstant (centerConstant f j) (poly j)) v.val‖ ≤
Real.exp (-(2 * u + 4 * p + 12))) →
(∀ f v, ‖forecast f v‖ ≤ forecastCap) →
∀ (input : integerBox N → ℂ), (∀ v, ‖input v‖ ≤ Real.exp p) →
let commonBudget := max budget (3 * PforecastNative + 3)
let Qmodel := max commonBudget (2 * u + 4 * p + massLog + 20)
∃ (nterms : ℕ) (_ : 0 < nterms)
(models : Fin nterms → (integerBox N → ℂ))
(coeff : Fin nterms → ℝ) (err : integerBox N → ℂ),
(∀ i, models i ∈ twistedNativeSampleFunctions (1 : Fin nX → ℕ) 0 commonBudget
(fun v : integerBox N => v.val)
(fun (W : NormalizedPolynomialTwist (Fin nX) (Σ j, J j)
(Real.exp commonBudget) (Real.exp commonBudget)
⟨Real.exp commonBudget, Real.exp_nonneg _⟩)
(v : integerBox N) => W.eval N poly v.val)) ∧
input = (∑ i, coeff i • models i) + err ∧
(∑ i, |coeff i|) ≤ Real.exp (Qmodel + 2) ∧
sampledSliceSeminorm pathLaw physical slices tests err ≤ Real.exp (-u) ∧
(∀ f, ‖(FiniteProbabilityWeights.uniformFinset (integerBox N) hbox).correlation
err (forecast f)‖ ≤ Real.exp (-u)) ∧
(nterms : ℝ) ≤ Real.exp (2 * Qmodel + 2 * u + 4 * p + 34) ∧
∀ errLocal : CoefficientTorus (K := LayerSamplerVariables G I n B) U × Path → ℂ,
Measurable errLocal →
(∀ center z, ∃ j, errLocal (center, z) =
𝔼 t ∈ slices z j, err (physical z t) * tests z j t) →
Integrable errLocal (centeredFiniteProbabilityMeasure μ centeredLaw) ∧
(∫ y, ‖errLocal y‖ ∂centeredFiniteProbabilityMeasure μ centeredLaw) ≤ Real.exp (-u)
omit coefficientBorel coefficientCompact measureInvariant in
theorem preparedCenteredForecastModelInterface_of_radius
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[μ.IsAddLeftInvariant]
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(hMaster : 0 ≤ Pmaster) (hLate : Pmaster ≤ Plate)
(hu : 0 ≤ u) (hp : 0 ≤ p)
(hSliceLog : pSlice * Fintype.card (LayerSamplerVariables G I n B) ≤ p)
(hCtail : Ctail ≤ Real.exp p)
(hForecastCap : 0 ≤ forecastCap) (hForecastCapP : forecastCap ≤ Real.exp p)
(hSource : PreparedCenteredModelMarginalRadiusInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (u := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) («α» := α) (τ := τ) (hb := hb) (o := o) (μ := μ)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget) :
PreparedCenteredForecastModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (τ := τ) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget := by
intro hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff E hτSpatial hτInv hτHalf hτDim
r W ξn hW hξone Pmarginal required cells poly hpoly hmem Rrank
hsize hrank hRank V hCells bases hξn Z
obtain ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, hnormalizerCenter, hweight,
hexcess, hdetect⟩ :=
hSource hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E) hτSpatial hτInv hτHalf hτDim
cells poly hpoly hmem hsize hrank hRank hCells
refine ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, ?_⟩
intro Path Zcenter
refine ⟨hnormalizerCenter, ?_⟩
intro centeredLaw
refine ⟨hweight, ?_⟩
intro pathLaw sides Sites e hrootSum physical
let : Nonempty Sites := by
have hpos (k : LayerSamplerVariables G I n B) : 0 < sides k := by
cases k with
| inl g => exact S.positive
| inr j => exact allocatedPrincipalSides_pos B U basis S j
let : ∀ k, NeZero (sides k) := fun k => ⟨(hpos k).ne'⟩
exact (integerBox_nonempty sides).to_subtype
refine ⟨hexcess, ?_⟩
intro Tests instTests Ldetect instLie instAlg dims instTopo instAdd instSmul instT2
Ddetect Vdetect slices cdetect stepdetect Hdetect hstep hSlices hDense
hnum hcomplex hcap budget tests Forecast instForecast forecast PforecastNative massLog
hForecastNative hMassLog hModelPrecision Term instTerm coefficient centerConstant twists
hCoeffMass hApprox hForecast input hinput
let : ∀ i, NeZero (N i) := fun i => ⟨(hN i).ne'⟩
have hKp : Kslice ≤ Real.exp p := Real.exp_le_exp.mpr hSliceLog
have hCap := marginalCap_max_one_exp_bound hp hCtail
have hα : 0 < α := (forecastAugmentedUnitThreshold_bounds hu hp
(Real.exp_nonneg _) (zero_le_one.trans hCap.1) hKp hCap.2 hForecastCapP).1
have hbudget : 0 ≤ budget :=
(((Classical.choose_spec (exists_preparedModularGeneralDetector_resource_budget
(preparedModularGeneralDetectorConstants m 0) (0 + 1))).2 hMaster hLate).1).nativeBudget.1
have hslices := preparedCenteredForecast_slice_family_bounds B U basis S slices hDense
have htests (z) (j) (t : Sites) : ‖tests z j t‖ ≤ 1 :=
preparedCenteredForecast_niltest_star_eval_bound (Vdetect z j) (hcap z j)
(commonStrideIndex (cdetect z j) (stepdetect z j) (e t))
have hmodelDetect (signal : (Fin nX → ℤ) → ℂ)
(hsignal : ∀ t, ‖signal t‖ ≤ 1)
(hzero : ∀ t, t ∉ integerBox N → signal t = 0)
(hlarge : α ≤ sampledSliceSeminorm pathLaw
(fun z t => jointIntegerPhysicalSite (e t) (z.1.val, z.2.val)) slices tests signal) :=
hdetect Ddetect Vdetect slices cdetect stepdetect Hdetect hstep hSlices hDense
hnum hcomplex hcap signal hα hsignal hzero hlarge
have hExcessCap := (FiniteProbabilityWeights.excessMass_max_one_le
(FiniteProbabilityWeights.uniformFinset (integerBox N) hbox)
(pathLaw.siteLaw physical) Ctail).trans hexcess
exact exists_centered_forecast_twist_model N poly budget PforecastNative hbudget hForecastNative
μ centeredLaw hweight physical
(fun z t => jointIntegerPhysicalSite (e t) (z.1.val, z.2.val))
(fun _ _ => rfl) slices tests forecast hu hp hMassLog (Real.exp_nonneg _)
hCap.1 hForecastCap hKp hCap.2 hForecastCapP hModelPrecision
hslices.1 hslices.2 htests hForecast hmodelDetect Term coefficient centerConstant twists
hCoeffMass hApprox hExcessCap le_rfl input hinput
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule BooleanCubeKernel
open scoped Classical BigOperators NNReal TensorProduct Matrix
variable {m : ℕ} {G : Type} [Fintype G] [DecidableEq G]
variable {I : Fin m → Type} [∀ j, Fintype (I j)]
variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type)
variable [∀ a, Fintype (B a)]
variable {J : Fin m → Type} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ))
variable (basis : ∀ j, Module.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 basis R σ)
variable {nX : ℕ}
local notation "rowSets" => (fun j : Fin m => boundedBooleanJetRows (Fin (0 + 1)) (Fin.val j + 1))
attribute [local instance 2000] fullBooleanRowSetFintype
attribute [local instance] ScalarSiteExpansion.termFinite
local notation "selectedRows" => (fun j : Fin m => (rowSets j : Type))
local notation "rows" => (fun j => (Subtype.val : rowSets j → Finset (Fin (0 + 1))))
variable (selection : Fin (0 + 1) ↪ G) (stride N : Fin nX → ℕ)
variable (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ) (Vtail : Fin m → ℝ≥0)
local notation "pDetect" => allocatedModelTestLog uSource pModel
local notation "qDetect" => allocatedModelTestLog uSource pModel
local notation "Ctail" => (4 * ∏ j, earlyConstantDensityCap (Fintype.card (I j)) (n j) (R j) (Vtail j))
local notation "Kslice" => Real.exp (pSlice * Fintype.card (LayerSamplerVariables G I n B))
variable (τ u p forecastCap : ℝ)
local notation "α" => forecastAugmentedUnitThreshold u p Kslice (max 1 Ctail) forecastCap
variable {P : ℝ}
local notation "grid" => allocatedGridAxis (I := I) U basis S.value
local notation "degree" => layerSamplerDegree I n
local notation "Tuple" => PrincipalTupleIndex (fun a : {a // ¬grid a} => B (Subtype.val a)) (fun a => degree (Subtype.val a))
local notation "jetRows" => selectedRows
local notation "activeB" => (fun a : {a // ¬grid a} => B (Subtype.val a))
local notation "activeDegree" => (fun a : {a // ¬grid a} => degree (Subtype.val a))
local notation "L" => principalAxisLength (fun a => ¬grid a) (allocatedPrincipalSides B U basis S)
local notation "positiveLengths" => (fun j : Tuple => allocatedPrincipalSides_pos B U basis S
(Sigma.mk (Subtype.val (Sigma.fst j)) (Sigma.snd j)))
variable (Q : Fin m → Type) [∀ j, Fintype (Q j)]
variable (hb : ∀ j, span ℤ (Set.range (basis j)) = projectedIntegerLattice (euclideanSubspace (U j)))
variable (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j)))
variable (bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))))
local notation "source" => allocatedCoefficientSource B U basis hR hσ S
local notation "frozenSource" => allocatedFrozenCoefficientSource B U basis hR hσ S
local notation "reference" => allocatedLongJetReference B U basis S jetRows
variable [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))]
variable (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))).toAddSubgroup))
variable [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
variable [MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [coefficientBorel : BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [coefficientCompact : CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [measureInvariant : μ.IsAddLeftInvariant] [IsProbabilityMeasure μ]
local notation "jetHaar" => Measure.pi (fun j =>
@Measure.pi (selectedRows j) _ (fullBooleanRowSetFintype (0 + 1) (Fin.val j + 1)) _
(fun _ : selectedRows j => ν j))
local notation "density" => allocatedCoefficientDensity B U basis hb o hR hσ S
variable {Eout : Fin m → Type} [∀ j, Fintype (Eout j)]
variable {Dmod Lrank : ℕ}
variable {spatial : Fin Lrank ↪ G}
variable {kernel : ∀ j : Fin m, Fin Lrank × Fin (j.val + 1) ↪ G}
variable {block : ∀ j, ∀ a : AllocatedDegreeActiveAxis
(allocatedShortAxis (I := I) U basis S.value) j, Fin Lrank ↪ B ⟨j, a.val⟩}
variable {Tsp : Type} [Fintype Tsp]
variable {spatialEquiv : G ≃ Fin nX ⊕ (Fin nX ⊕ Tsp)} {Wsp Lsp δslice : ℝ}
variable {A : Type} [Fintype A] (selected : A → Σ j : Fin m, Fin (n j))
variable (setup : ActualFixedSpatialForecastSetup (X := Fin nX) (Eout := Eout)
B U basis S Dmod selected τ δslice)
variable (bWforecast : ∀ j, Basis (Eout j) ℤ
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))))
variable (Eforecast : ℝ)
local notation "qforecast" => setup.logs Eforecast
def PreparedActualForecastModelInterface
(Pchart Qstride Pmaster Plate _pGain Pphysical coarseTarget : ℝ) : Prop :=
∀ (_hstride : ∀ i, 0 < stride i) (_hstrideBound : ∀ i, (stride i : ℝ) ≤ Real.exp Qstride)
(C : Fin m → ℝ) (_hC : ∀ j, 0 ≤ C j) (_hCbound : ∀ j, C j ≤ Real.exp Pchart)
(_hchart : ∀ j v, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j)).symm v‖ ≤ C j * ‖v‖)
(Cforward : Fin m → ℝ≥0)
(_hforward : ∀ j v, ‖normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j) v‖ ≤ Cforward j * ‖v‖)
(_hForward : ∀ j, (Cforward j : ℝ) ≤ Real.exp Pchart)
(_hVtail : ∀ j, (Vtail j : ℝ) ≤ Real.exp Pchart)
(_hVactual : ∀ j, 0 ≤ mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ∧
mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ≤ Vtail j)
(_hprofile : (probabilityProfileLipschitz : ℝ) ≤ Real.exp Pchart)
(_hcutoff : (normalizedSiteCutoffBound : ℝ) ≤ Real.exp Pchart),
∀ {E : ℝ},
∀ (hτSpatial : 0 < τ), τ⁻¹ ≤ Real.exp Pphysical →
τ ≤ 1 / 2 → (nX : ℝ) * τ ≤ 1 / 2 →
let r := preparedModularGeneralDetectorResources (preparedModularGeneralDetectorConstants m 0) (0 + 1) Pmaster Plate
let W := allocatedPhysicalRootBudget B U basis S (fun _ => 0)
let ξn := normalizedTupleNarrowWidth (Fin nX)
(PrincipalTupleIndex B (layerSamplerDegree I n)) selection
(allocatedDetectedKernelCutoff 0 G (Fintype.card (LayerSamplerVariables G I n B)) Pdetect pDetect qDetect (α / 2))
Pphysical coarseTarget
let hW := allocatedPhysicalRootBudget_nonneg B U basis S (fun _ => 0)
let hξone : ξn ≤ 1 := min_le_left _ _
let Pmarginal := r.Pproj
let required := max r.required ((max Pmarginal E + preparedCenteredMarginalExponent m) ^
preparedCenteredMarginalExponent m)
∀ (cells : Finset (ColumnResiduePattern (Option (LayerSamplerVariables G I n B)) (Fin nX) stride))
(poly : ∀ j, VectorPolynomial (Fin nX) ℝ (J j → ℝ))
(_hp : ∀ j, DegreeLE (1 : (Fin nX) → ℕ) (j.val + 1) (poly j))
(hmem : ∀ j ex, coefficients (poly j) ex ∈ U j)
{Rrank : ℝ},
(∀ i, Real.exp required ≤ (N i : ℝ)) →
(∀ j, HasLayerSamplingRank (j.val + 1) (fun i => (N i : ℝ)) Rrank (U j) (poly j)) →
Real.exp required ≤ Rrank →
let V := narrowTrimmedSpatialWidths (G := G) (J := PrincipalTupleIndex B (layerSamplerDegree I n)) W τ ξn N
cells.Nonempty →
let bases := trimmedIntegerBox N (spatialTrimMargin τ N)
let hξn := normalizedTupleNarrowWidth_pos (Fin nX)
(PrincipalTupleIndex B (layerSamplerDegree I n)) selection (allocatedDetectedKernelCutoff 0 G (Fintype.card (LayerSamplerVariables G I n B)) Pdetect pDetect qDetect (α / 2)) Pphysical coarseTarget
let Z := selectedJointDensityMass bases stride cells V
(allocatedJointBaseDensity B U basis hb o hR hσ S (Fin nX) poly hmem)
∃ (hN : ∀ i, 0 < N i) (hbases : bases.Nonempty) (hbox : (integerBox N).Nonempty)
(hmass : 0 < ∑' z, selectedResidueSmoothWeight stride cells V z)
(_hnormalizer : |Z - 1| ≤ Real.exp (-r.E) ∧ Z ∈ Set.Icc (1 / 2 : ℝ) (3 / 2) ∧ 0 < Z ∧ Z⁻¹ ≤ 2)
(_hmargin : ∀ i, 2 * spatialTrimMargin τ N i ≤ N i),
let Path := bases × rectangularWeightIndices 0 V 1
let Zcenter := fun center => selectedJointDensityMass bases stride cells V
(allocatedCenteredJointDensity B U basis hb o hR hσ S poly hmem center)
∃ hnormalizerCenter : ∀ center,
|Zcenter center - 1| ≤ Real.exp (-E) ∧
Zcenter center ∈ Set.Icc (1 / 2 : ℝ) (3 / 2) ∧
0 < Zcenter center ∧ (Zcenter center)⁻¹ ≤ 2,
let centeredLaw := fun center => selectedJointFiniteLaw bases hbases stride cells V
(narrowTrimmedSpatialWidths_pos hW hτSpatial hξn N hN) hmass
(allocatedCenteredJointDensity B U basis hb o hR hσ S poly hmem center)
(allocatedCenteredJointDensity_nonneg B U basis hb o hR hσ S poly hmem center) (hnormalizerCenter center).2.2.1
∃ hweight : ∀ z, Measurable (fun center => (centeredLaw center).weight z),
let pathLaw := centeredFiniteMarginal μ centeredLaw hweight
let sides := Sum.elim (fun _ : G => S.value) (allocatedPrincipalSides B U basis S)
let Sites := integerBox sides
let e : Sites → LayerSamplerVariables G I n B → ℤ := Subtype.val
letI : Nonempty Sites := by
have hpos (k : LayerSamplerVariables G I n B) : 0 < sides k := by
cases k with
| inl g => exact S.positive
| inr j => exact allocatedPrincipalSides_pos B U basis S j
let : ∀ k, NeZero (sides k) := fun k => ⟨(hpos k).ne'⟩
exact (integerBox_nonempty sides).to_subtype
let hrootSum := fun t : Sites => allocatedParameterBox_root_bound B U basis S t
let physical := narrowPhysicalSiteMap (G := G)
(J := PrincipalTupleIndex B (layerSamplerDegree I n)) hW hτSpatial hξone N hN
_hmargin e hrootSum
(FiniteProbabilityWeights.uniformFinset (integerBox N) hbox).excessMass
(pathLaw.siteLaw physical) Ctail ≤ 6 * positiveProjectionAccuracy E ∧
∀ {Tests : Path → Type} [∀ z, Nonempty (Tests z)]
{Ldetect : ∀ z, Tests z → Type} [∀ z j, LieRing (Ldetect z j)] [∀ z j, LieAlgebra ℚ (Ldetect z j)]
{dims : ∀ z, Tests z → ℕ}
[∀ z j, TopologicalSpace (ℝ ⊗[ℚ] Ldetect z j)]
[∀ z j, IsTopologicalAddGroup (ℝ ⊗[ℚ] Ldetect z j)]
[∀ z j, ContinuousSMul ℝ (ℝ ⊗[ℚ] Ldetect z j)] [∀ z j, T2Space (ℝ ⊗[ℚ] Ldetect z j)]
(Ddetect : ∀ z j, RationalFilteredNilmanifold (Ldetect z j) 0 (dims z j))
(Vdetect : ∀ z j, (Ddetect z j).Niltest (fun _ : LayerSamplerVariables G I n B => 1))
(slices : ∀ z, Tests z → Finset Sites)
(cdetect : ∀ z, Tests z → LayerSamplerVariables G I n B → ℤ)
(stepdetect : ∀ z, Tests z → ℕ)
(Hdetect : ∀ z, Tests z → LayerSamplerVariables G I n B → ℕ),
(∀ z j, 0 < stepdetect z j) →
(∀ z j, (slices z j).image e = commonStrideBox (cdetect z j) (stepdetect z j) (Hdetect z j)) →
(∀ z j, IsDenseCommonStrideBox
(Sum.elim (fun _ : G => S.value) (allocatedPrincipalSides B U basis S)) pSlice ((slices z j).image e)) →
(Fintype.card (LayerSamplerVariables G I n B) : ℝ) ≤ Pdetect.eval₂ (Nat.castRingHom ℝ) qDetect →
(∀ z j, (Vdetect z j).ComplexityLE (Pdetect.eval₂ (Nat.castRingHom ℝ) qDetect)) →
(∀ z j, ((Vdetect z j).normBound : ℝ) ≤ 1) →
let budget := r.nativeBudget
let tests := fun z j t => star ((Vdetect z j).eval
(commonStrideIndex (cdetect z j) (stepdetect z j) (e t)))
u + 2 * p + max (max budget (3 * (qforecast).native + 3))
(2 * u + 4 * p + (setup.Pκ + (qforecast).mass) + 20) + 32 ≤ E →
let ForecastPath := ActualFixedSpatialForecastPath (Eout := Eout) B U basis S hR hσ
Dmod spatial kernel block spatialEquiv Wsp Lsp N τ δslice setup.P setup.Pbad setup.Ppres
∃ data : Option ForecastPath → ActualForecastData N poly
(qforecast).native (setup.Pκ + (qforecast).mass) (setup.Pκ + (qforecast).cap) Eforecast,
(∀ path, (data (some path)).target =
path.target selected setup.hBactive o bWforecast hb poly hmem setup.κ ∧
(data (some path)).centerConstant = fun j => (path.center j).val) ∧
(data none).target = (fun _ => 0) ∧
(data none).centerConstant = (fun _ _ => 0) ∧
let forecast := fun f => (data f).target
∀ (input : integerBox N → ℂ), (∀ v, ‖input v‖ ≤ Real.exp p) →
let commonBudget := max budget (3 * (qforecast).native + 3)
let Qmodel := max commonBudget (2 * u + 4 * p + (setup.Pκ + (qforecast).mass) + 20)
∃ (nterms : ℕ) (_ : 0 < nterms)
(models : Fin nterms → (integerBox N → ℂ))
(coeff : Fin nterms → ℝ) (err : integerBox N → ℂ),
(∀ i, models i ∈ twistedNativeSampleFunctions (1 : Fin nX → ℕ) 0 commonBudget
(fun v : integerBox N => v.val)
(fun (W : NormalizedPolynomialTwist (Fin nX) (Σ j, J j)
(Real.exp commonBudget) (Real.exp commonBudget)
⟨Real.exp commonBudget, Real.exp_nonneg _⟩)
(v : integerBox N) => W.eval N poly v.val)) ∧
input = (∑ i, coeff i • models i) + err ∧
(∑ i, |coeff i|) ≤ Real.exp (Qmodel + 2) ∧
sampledSliceSeminorm pathLaw physical slices tests err ≤ Real.exp (-u) ∧
(∀ f, ‖(FiniteProbabilityWeights.uniformFinset (integerBox N) hbox).correlation
err (forecast f)‖ ≤ Real.exp (-u)) ∧
(nterms : ℝ) ≤ Real.exp (2 * Qmodel + 2 * u + 4 * p + 34) ∧
∀ errLocal : CoefficientTorus (K := LayerSamplerVariables G I n B) U × Path → ℂ,
Measurable errLocal →
(∀ center z, ∃ j, errLocal (center, z) =
𝔼 t ∈ slices z j, err (physical z t) * tests z j t) →
Integrable errLocal (centeredFiniteProbabilityMeasure μ centeredLaw) ∧
(∫ y, ‖errLocal y‖ ∂centeredFiniteProbabilityMeasure μ centeredLaw) ≤ Real.exp (-u)
omit coefficientBorel coefficientCompact measureInvariant in
theorem preparedActualForecastModelInterface_of_prepared
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[μ.IsAddLeftInvariant]
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(hEforecast : 0 ≤ Eforecast)
(hApproxPrecision : 2 * u + 4 * p + 12 ≤ Eforecast)
(hCap : Real.exp (setup.Pκ + (qforecast).cap) ≤ forecastCap)
{Tcert : ℕ} {δcert : ℝ}
(hcert : ActualFixedSpatialPreparedCertificate (X := Fin nX) (J := J)
B setup.hδslice setup.forward setup.K setup.radius τ setup.hτ Dmod (Dmod + 1)
setup.P setup.D setup.Pbad setup.Ppres (Eforecast + setup.Pκ) qforecast Tcert δcert)
(hsize : Tcert ≤ S.value)
(hModel : PreparedCenteredForecastModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (τ := τ) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget) :
PreparedActualForecastModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (τ := τ) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ) (spatial := spatial) (kernel := kernel) (block := block)
(spatialEquiv := spatialEquiv) (Wsp := Wsp) (Lsp := Lsp)
(selected := selected) (setup := setup) (bWforecast := bWforecast) (Eforecast := Eforecast)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget := by
intro hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff E hτSpatial hτInv hτHalf hτDim
r W ξn hW hξone Pmarginal required cells poly hpoly hmem Rrank
hsizeModel hrank hRank V hCells bases hξn Z
obtain ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, hnormalizerCenter,
hweight, hexcess, hmodel⟩ :=
hModel hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E) hτSpatial hτInv hτHalf hτDim
cells poly hpoly hmem hsizeModel hrank hRank hCells
refine ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, ?_⟩
intro Path Zcenter
refine ⟨hnormalizerCenter, ?_⟩
intro centeredLaw
refine ⟨hweight, ?_⟩
intro pathLaw sides Sites e hrootSum physical
let : Nonempty Sites := by
have hpos (k : LayerSamplerVariables G I n B) : 0 < sides k := by
cases k with
| inl g => exact S.positive
| inr j => exact allocatedPrincipalSides_pos B U basis S j
let : ∀ k, NeZero (sides k) := fun k => ⟨(hpos k).ne'⟩
exact (integerBox_nonempty sides).to_subtype
refine ⟨hexcess, ?_⟩
intro Tests instTests Ldetect instLie instAlg dims instTopo instAdd instSmul instT2
Ddetect Vdetect slices cdetect stepdetect Hdetect hstep hSlices hDense
hnum hcomplex hcap budget tests hModelPrecision ForecastPath
obtain ⟨data, hdata, hnone, hnoneCenter, hdataCap, hdataMass, hdataApprox⟩ :=
exists_actualFixedSpatialForecastFamily_option_of_certificate
(hR := hR) (hσ := hσ) (spatial := spatial) (kernel := kernel) (block := block)
(spatialEquiv := spatialEquiv) (Wsp := Wsp) (Lsp := Lsp) (physicalN := N)
selected setup o bWforecast hb poly hmem hEforecast hcert hsize
refine ⟨data, hdata, hnone, hnoneCenter, ?_⟩
intro forecast input hinput
have hq := setup.logs_nonneg hEforecast
exact hmodel Ddetect Vdetect slices cdetect stepdetect Hdetect hstep hSlices hDense
hnum hcomplex hcap forecast hq.native (add_nonneg setup.hPκ hq.mass) hModelPrecision
(fun f => (data f).Term) (fun f => (data f).coefficient)
(fun f => (data f).centerConstant) (fun f => (data f).twists)
hdataMass (fun f v => (hdataApprox f v).trans
(Real.exp_le_exp.mpr (neg_le_neg hApproxPrecision)))
(fun f v => (hdataCap f v).trans hCap) input hinput
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule BooleanCubeKernel
open scoped Classical BigOperators NNReal TensorProduct
variable {m : ℕ} {G : Type} [Fintype G] [DecidableEq G]
variable {I : Fin m → Type} [∀ j, Fintype (I j)]
variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type)
variable [∀ a, Fintype (B a)]
variable {J : Fin m → Type} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ))
variable (basis : ∀ j, Module.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 basis R σ)
variable {nX : ℕ}
local notation "rowSets" => (fun j : Fin m => boundedBooleanJetRows (Fin (0 + 1)) (Fin.val j + 1))
attribute [local instance 2000] fullBooleanRowSetFintype
attribute [local instance] ScalarSiteExpansion.termFinite
local notation "selectedRows" => (fun j : Fin m => (rowSets j : Type))
local notation "rows" => (fun j => (Subtype.val : rowSets j → Finset (Fin (0 + 1))))
variable (selection : Fin (0 + 1) ↪ G) (stride N : Fin nX → ℕ)
variable (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ) (Vtail : Fin m → ℝ≥0)
local notation "pDetect" => allocatedModelTestLog uSource pModel
local notation "qDetect" => allocatedModelTestLog uSource pModel
local notation "Ctail" => (4 * ∏ j, earlyConstantDensityCap (Fintype.card (I j)) (n j) (R j) (Vtail j))
local notation "Kslice" => Real.exp (pSlice * Fintype.card (LayerSamplerVariables G I n B))
variable (u p forecastCap : ℝ)
local notation "α" => forecastAugmentedUnitThreshold u p Kslice (max 1 Ctail) forecastCap
variable {P : ℝ}
local notation "grid" => allocatedGridAxis (I := I) U basis S.value
local notation "degree" => layerSamplerDegree I n
local notation "Tuple" => PrincipalTupleIndex (fun a : {a // ¬grid a} => B (Subtype.val a)) (fun a => degree (Subtype.val a))
local notation "jetRows" => selectedRows
local notation "activeB" => (fun a : {a // ¬grid a} => B (Subtype.val a))
local notation "activeDegree" => (fun a : {a // ¬grid a} => degree (Subtype.val a))
local notation "L" => principalAxisLength (fun a => ¬grid a) (allocatedPrincipalSides B U basis S)
local notation "positiveLengths" => (fun j : Tuple => allocatedPrincipalSides_pos B U basis S
(Sigma.mk (Subtype.val (Sigma.fst j)) (Sigma.snd j)))
variable (Q : Fin m → Type) [∀ j, Fintype (Q j)]
variable (hb : ∀ j, span ℤ (Set.range (basis j)) = projectedIntegerLattice (euclideanSubspace (U j)))
variable (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j)))
variable (bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))))
local notation "source" => allocatedCoefficientSource B U basis hR hσ S
local notation "frozenSource" => allocatedFrozenCoefficientSource B U basis hR hσ S
local notation "reference" => allocatedLongJetReference B U basis S jetRows
variable [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))]
variable (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))).toAddSubgroup))
variable [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
variable [MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [coefficientBorel : BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [coefficientCompact : CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [measureInvariant : μ.IsAddLeftInvariant] [IsProbabilityMeasure μ]
local notation "jetHaar" => Measure.pi (fun j =>
@Measure.pi (selectedRows j) _ (fullBooleanRowSetFintype (0 + 1) (Fin.val j + 1)) _
(fun _ : selectedRows j => ν j))
local notation "density" => allocatedCoefficientDensity B U basis hb o hR hσ S
def PreparedCenteredForecastEarlyWidthModelInterface
(g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ) : Prop :=
PreparedCenteredForecastModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ)
(τ := Real.exp (-(g₀ + (nX : ℝ) + 8)))
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
omit coefficientBorel coefficientCompact measureInvariant in
theorem preparedCenteredForecastEarlyWidthModelInterface_of_model
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[μ.IsAddLeftInvariant]
(g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(hModel : PreparedCenteredForecastModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ)
(τ := Real.exp (-(g₀ + (nX : ℝ) + 8)))
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget) :
PreparedCenteredForecastEarlyWidthModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ)
g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget := hModel
omit coefficientBorel coefficientCompact measureInvariant in
theorem preparedCenteredForecastEarlyWidthModelInterface_apply
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[μ.IsAddLeftInvariant]
(g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(hg₀ : 0 ≤ g₀) (hphysical : g₀ + (nX : ℝ) + 8 ≤ Pphysical)
(hModel : PreparedCenteredForecastEarlyWidthModelInterface
(B := B) (U := U) (basis := basis) (S := S) (hR := hR) (hσ := hσ)
(selection := selection) (stride := stride) (N := N)
(Pdetect := Pdetect) (uSource := uSource) (pModel := pModel) (pSlice := pSlice)
(Vtail := Vtail) (u := u) (p := p) (forecastCap := forecastCap)
(hb := hb) (o := o) (μ := μ)
g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget)
(hstride : ∀ i, 0 < stride i) (hstrideBound : ∀ i, (stride i : ℝ) ≤ Real.exp Qstride)
(C : Fin m → ℝ) (hC : ∀ j, 0 ≤ C j) (hCbound : ∀ j, C j ≤ Real.exp Pchart)
(hchart : ∀ j v, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j)).symm v‖ ≤ C j * ‖v‖)
(Cforward : Fin m → ℝ≥0)
(hforward : ∀ j v, ‖normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j) v‖ ≤ Cforward j * ‖v‖)
(hForward : ∀ j, (Cforward j : ℝ) ≤ Real.exp Pchart)
(hVtail : ∀ j, (Vtail j : ℝ) ≤ Real.exp Pchart)
(hVactual : ∀ j, 0 ≤ mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ∧
mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ≤ Vtail j)
(hprofile : (probabilityProfileLipschitz : ℝ) ≤ Real.exp Pchart)
(hcutoff : (normalizedSiteCutoffBound : ℝ) ≤ Real.exp Pchart)
{E : ℝ} : type_of% (
let hwidth := preparedEarlySpatialWidth nX hg₀
hModel hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E)
(Real.exp_pos _) (hwidth.2.2.2.2.2.1 Pphysical hphysical)
hwidth.2.2.1 hwidth.2.2.2.1) :=
let hwidth := preparedEarlySpatialWidth nX hg₀
hModel hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E)
(Real.exp_pos _) (hwidth.2.2.2.2.2.1 Pphysical hphysical)
hwidth.2.2.1 hwidth.2.2.2.1
end Erdos3.VectorPolynomial
end
end OAI

Xet Storage Details

Size:
48 kB
·
Xet hash:
2569577f27220422fed885889382540c923aa66d27418ce21ac122c6197e45ed

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