Buckets:
cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Sampling /SharedWidthPreparedShortForecastSourceModelAttachment.lean
import OAI.Combinatorics.Progressions.Estimates.SharedWidthPreparedPerturbativeCertifiedSource
import OAI.Combinatorics.Progressions.Sampling.PreparedShortForecastRawSourceBounds
namespace OAI
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 [BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [μ.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 SharedWidthPreparedCenteredForecastModelInterface
(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)
∀ {ξn : ℝ} (hξn : 0 < ξn)
(hξle : ξ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),
ξn⁻¹ ≤ Real.exp Plate →
let hW := allocatedPhysicalRootBudget_nonneg B U basis S (fun _ => 0)
let hξone : ξn ≤ 1 := hξle.trans (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 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 [BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[μ.IsAddLeftInvariant] in
theorem sharedWidthPreparedCenteredForecastModelInterface_of_radius
(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 : SharedWidthPreparedCenteredModelMarginalRadiusInterface
(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) :
SharedWidthPreparedCenteredForecastModelInterface
(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 hξn hξle hξLate hW hξone Pmarginal required cells poly hpoly hmem Rrank
hsize hrank hRank V hCells bases 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
hξn hξle hξLate 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
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 [BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [μ.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 SharedWidthPreparedCenteredForecastEarlyWidthModelInterface
(g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ) : Prop :=
SharedWidthPreparedCenteredForecastModelInterface
(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 [BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
[μ.IsAddLeftInvariant] in
theorem sharedWidthPreparedCenteredForecastEarlyWidthModelInterface_of_model
(g₀ Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(hModel : SharedWidthPreparedCenteredForecastModelInterface
(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) :
SharedWidthPreparedCenteredForecastEarlyWidthModelInterface
(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
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 (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [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 (Good : ∀ (poly : ∀ j, VectorPolynomial (Fin nX) ℝ (J j → ℝ)),
(∀ j ex, coefficients (poly j) ex ∈ U j) →
∀ (width : Option (LayerSamplerVariables G I n B) × Fin nX → ℝ)
(bases : Finset (Fin nX → ℤ)),
(CoefficientTorus (K := LayerSamplerVariables G I n B) U →
FiniteProbabilityWeights (bases × rectangularWeightIndices 0 width 1)) → Prop)
def SharedWidthPreparedCenteredForecastModelExtensionInterface
(Pchart Qstride Pmaster Plate _pGain Pphysical coarseTarget extraRequired : ℝ) : 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)
∀ {ξn : ℝ} (hξn : 0 < ξn)
(hξle : ξ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),
ξn⁻¹ ≤ Real.exp Plate →
let hW := allocatedPhysicalRootBudget_nonneg B U basis S (fun _ => 0)
let hξone : ξn ≤ 1 := hξle.trans (min_le_left _ _)
let Pmarginal := r.Pproj
let modelRequired := max r.required ((max Pmarginal E + preparedCenteredMarginalExponent m) ^
preparedCenteredMarginalExponent m)
let required := max modelRequired extraRequired
∀ (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 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),
Good poly hmem V bases centeredLaw ∧
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)
def SharedWidthPreparedCenteredForecastModelExtraDataInterface
(Pchart Qstride Pmaster Plate _pGain Pphysical coarseTarget extraRequired : ℝ) : 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)
∀ {ξn : ℝ} (hξn : 0 < ξn)
(hξle : ξ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),
ξn⁻¹ ≤ Real.exp Plate →
let hW := allocatedPhysicalRootBudget_nonneg B U basis S (fun _ => 0)
let _hξone : ξn ≤ 1 := hξle.trans (min_le_left _ _)
let Pmarginal := r.Pproj
let modelRequired := max r.required ((max Pmarginal E + preparedCenteredMarginalExponent m) ^
preparedCenteredMarginalExponent m)
let required := max modelRequired extraRequired
∀ (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 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
Good poly hmem V bases centeredLaw
theorem sharedWidthPreparedCenteredForecastModelExtension_of_model
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget extraRequired : ℝ)
(hModel : SharedWidthPreparedCenteredForecastModelInterface
(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)
(hExtra : SharedWidthPreparedCenteredForecastModelExtraDataInterface
(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) (Good := Good)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget extraRequired) :
SharedWidthPreparedCenteredForecastModelExtensionInterface
(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) (μ := μ) (Good := Good)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget extraRequired := 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 hξn hξle hξLate hW hξone Pmarginal modelRequired required cells poly hpoly hmem Rrank
hsize hrank hRank V hCells bases Z
have hsizeModel (i) : Real.exp modelRequired ≤ (N i : ℝ) :=
(Real.exp_le_exp.mpr (le_max_left _ _)).trans (hsize i)
have hRankModel : Real.exp modelRequired ≤ Rrank :=
(Real.exp_le_exp.mpr (le_max_left _ _)).trans hRank
obtain ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, hnormalizerCenter, hweight, hrest⟩ :=
hModel hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E) hτSpatial hτInv hτHalf hτDim
hξn hξle hξLate cells poly hpoly hmem hsizeModel hrank hRankModel hCells
have hgood := hExtra hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E) hτSpatial hτInv hτHalf hτDim
hξn hξle hξLate cells poly hpoly hmem hsize hrank hRank hCells
hN hbases hbox hmass hnormalizer hmargin hnormalizerCenter
refine ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, ?_⟩
intro Path Zcenter
refine ⟨hnormalizerCenter, ?_⟩
intro centeredLaw
exact ⟨hweight, hgood, hrest⟩
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 (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [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 (Good Extra : ∀ (poly : ∀ j, VectorPolynomial (Fin nX) ℝ (J j → ℝ)),
(∀ j ex, coefficients (poly j) ex ∈ U j) →
∀ (width : Option (LayerSamplerVariables G I n B) × Fin nX → ℝ)
(bases : Finset (Fin nX → ℤ)),
(CoefficientTorus (K := LayerSamplerVariables G I n B) U →
FiniteProbabilityWeights (bases × rectangularWeightIndices 0 width 1)) → Prop)
theorem sharedWidthPreparedCenteredForecastModelExtension_and
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget extra₁ extra₂ : ℝ)
(hModel : SharedWidthPreparedCenteredForecastModelExtensionInterface
(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) (μ := μ) (Good := Good)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget extra₁)
(hExtra : SharedWidthPreparedCenteredForecastModelExtraDataInterface
(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) (Good := Extra)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget (max extra₁ extra₂)) :
SharedWidthPreparedCenteredForecastModelExtensionInterface
(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) (μ := μ) (Good := fun poly hm width bases law =>
Good poly hm width bases law ∧ Extra poly hm width bases law)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget (max extra₁ extra₂) := 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 hξn hξle hξLate hW hξone Pmarginal modelRequired required cells poly hpoly hmem Rrank
hsize hrank hRank V hCells bases Z
have hcutoffPrevious : max modelRequired extra₁ ≤ required :=
max_le (le_max_left _ _) ((le_max_left extra₁ extra₂).trans (le_max_right _ _))
have hsizeModel (i) : Real.exp (max modelRequired extra₁) ≤ (N i : ℝ) :=
(Real.exp_le_exp.mpr hcutoffPrevious).trans (hsize i)
have hRankModel : Real.exp (max modelRequired extra₁) ≤ Rrank :=
(Real.exp_le_exp.mpr hcutoffPrevious).trans hRank
obtain ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, hnormalizerCenter, hweight, hgood, hrest⟩ :=
hModel hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E) hτSpatial hτInv hτHalf hτDim
hξn hξle hξLate cells poly hpoly hmem hsizeModel hrank hRankModel hCells
have hextra := hExtra hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff (E := E) hτSpatial hτInv hτHalf hτDim
hξn hξle hξLate cells poly hpoly hmem hsize hrank hRank hCells
hN hbases hbox hmass hnormalizer hmargin hnormalizerCenter
refine ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, ?_⟩
intro Path Zcenter
refine ⟨hnormalizerCenter, ?_⟩
intro centeredLaw
exact ⟨hweight, ⟨hgood, hextra⟩, hrest⟩
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule BooleanCubeKernel
open scoped Classical BigOperators NNReal TensorProduct
variable {m nX M : ℕ} {X₀ J₀ : Type}
variable (prep : RankPreparationFamily X₀ J₀ m)
local notation "kernel" => EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M))
local notation "blocks" => EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))
local notation "axes" => PreparedSamplerContinuous prep
local notation "transverse" => preparedSamplerTransverse prep
local notation "coords" => (fun j : Fin m => RankPreparationLayer.Coord (prep j))
variable (U : ∀ j, Submodule ℝ (coords j → ℝ))
variable (b : ∀ j, Module.Basis (Fin (transverse j)) ℝ (euclideanSubspace (U j))ᗮ)
variable {R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
variable (S : LayerSamplerScale (G := kernel) (I := axes) (n := transverse) (J := coords) blocks U b R σ)
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) ↪ kernel) (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 (axes j)) (transverse j) (R j) (Vtail j))
local notation "Kslice" => Real.exp (pSlice * Fintype.card (LayerSamplerVariables kernel axes transverse blocks))
variable (τ u p forecastCap : ℝ)
local notation "α" => forecastAugmentedUnitThreshold u p Kslice (max 1 Ctail) forecastCap
variable {P : ℝ}
local notation "grid" => allocatedGridAxis (I := axes) U b S.value
local notation "degree" => layerSamplerDegree axes transverse
local notation "Tuple" => PrincipalTupleIndex (fun a : {a // ¬grid a} => blocks (Subtype.val a)) (fun a => degree (Subtype.val a))
local notation "jetRows" => selectedRows
local notation "activeB" => (fun a : {a // ¬grid a} => blocks (Subtype.val a))
local notation "activeDegree" => (fun a : {a // ¬grid a} => degree (Subtype.val a))
local notation "L" => principalAxisLength (fun a => ¬grid a) (allocatedPrincipalSides blocks U b S)
local notation "positiveLengths" => (fun j : Tuple => allocatedPrincipalSides_pos blocks U b 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 (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
variable (o : ∀ j, OrthonormalBasis (axes j) ℝ (euclideanSubspace (U j)))
variable (bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (coords j)) (euclideanSubspace (U j))))
local notation "source" => allocatedCoefficientSource blocks U b hR hσ S
local notation "frozenSource" => allocatedFrozenCoefficientSource blocks U b hR hσ S
local notation "reference" => allocatedLongJetReference blocks U b S jetRows
variable [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (coords j)) (euclideanSubspace (U j)))]
variable (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (coords j)) (euclideanSubspace (U j))).toAddSubgroup))
variable [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
variable [MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U)]
variable [BorelSpace (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U)]
variable [CompactSpace (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U))
variable [μ.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 blocks U b hb o hR hσ S
def SharedWidthPreparedCenteredShortForecastGoodModelInterface
(prep : RankPreparationFamily X₀ J₀ m)
(U : ∀ j : Fin m, Submodule ℝ (RankPreparationLayer.Coord (prep j) → ℝ))
(b : ∀ j, Basis (Fin (preparedSamplerTransverse prep j)) ℝ (euclideanSubspace (U j))ᗮ)
{R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
(S : LayerSamplerScale
(G := EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(I := PreparedSamplerContinuous prep) (n := preparedSamplerTransverse prep)
(J := fun j => RankPreparationLayer.Coord (prep j))
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))) U b R σ)
(selection : Fin (0 + 1) ↪ EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(stride N : Fin nX → ℕ) (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ)
(Vtail : Fin m → ℝ≥0) (τ u p forecastCap : ℝ)
{Q : Fin m → Type} [∀ j, Fintype (Q j)]
(hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
(o : ∀ j, OrthonormalBasis (PreparedSamplerContinuous prep j) ℝ (euclideanSubspace (U j)))
(bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j))))
[∀ j, IsZLattice ℝ (latticeSection
(standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j)))]
[MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
(μ : Measure (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U))
[IsProbabilityMeasure μ]
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(B0 gainLog gain Pgood : ℝ) (Qgood : ℕ)
(spatialEmbedding : Fin 2 × Fin nX ↪ (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) : Prop := by
exact SharedWidthPreparedCenteredForecastModelExtensionInterface
(G := (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) (I := (PreparedSamplerContinuous prep)) (n := (preparedSamplerTransverse prep)) (J := (fun j : Fin m => RankPreparationLayer.Coord (prep j)))
(B := (EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) (U := U) (basis := b) (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) (μ := μ)
(Good := PreparedCenteredShortForecastGoodProperty (m := m) (nX := nX) (M := M) prep U b S bW hb o hR hσ μ
stride gainLog gain Qgood spatialEmbedding)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
(preparedCenteredShortForecastGoodRequired m B0 Pgood)
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule BooleanCubeKernel
open scoped Classical BigOperators NNReal TensorProduct
variable {m nX M : ℕ} {X₀ J₀ : Type}
variable (prep : RankPreparationFamily X₀ J₀ m)
local notation "kernel" => EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M))
local notation "blocks" => EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))
local notation "axes" => PreparedSamplerContinuous prep
local notation "transverse" => preparedSamplerTransverse prep
local notation "coords" => (fun j : Fin m => RankPreparationLayer.Coord (prep j))
variable (U : ∀ j, Submodule ℝ (coords j → ℝ))
variable (b : ∀ j, Module.Basis (Fin (transverse j)) ℝ (euclideanSubspace (U j))ᗮ)
variable {R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
variable (S : LayerSamplerScale (G := kernel) (I := axes) (n := transverse) (J := coords) blocks U b R σ)
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) ↪ kernel) (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 (axes j)) (transverse j) (R j) (Vtail j))
local notation "Kslice" => Real.exp (pSlice * Fintype.card (LayerSamplerVariables kernel axes transverse blocks))
variable (τ u p forecastCap : ℝ)
local notation "α" => forecastAugmentedUnitThreshold u p Kslice (max 1 Ctail) forecastCap
variable {P : ℝ}
local notation "grid" => allocatedGridAxis (I := axes) U b S.value
local notation "degree" => layerSamplerDegree axes transverse
local notation "Tuple" => PrincipalTupleIndex (fun a : {a // ¬grid a} => blocks (Subtype.val a)) (fun a => degree (Subtype.val a))
local notation "jetRows" => selectedRows
local notation "activeB" => (fun a : {a // ¬grid a} => blocks (Subtype.val a))
local notation "activeDegree" => (fun a : {a // ¬grid a} => degree (Subtype.val a))
local notation "L" => principalAxisLength (fun a => ¬grid a) (allocatedPrincipalSides blocks U b S)
local notation "positiveLengths" => (fun j : Tuple => allocatedPrincipalSides_pos blocks U b 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 (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
variable (o : ∀ j, OrthonormalBasis (axes j) ℝ (euclideanSubspace (U j)))
variable (bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (coords j)) (euclideanSubspace (U j))))
local notation "source" => allocatedCoefficientSource blocks U b hR hσ S
local notation "frozenSource" => allocatedFrozenCoefficientSource blocks U b hR hσ S
local notation "reference" => allocatedLongJetReference blocks U b S jetRows
variable [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (coords j)) (euclideanSubspace (U j)))]
variable (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (coords j)) (euclideanSubspace (U j))).toAddSubgroup))
variable [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
variable [MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U)]
variable [BorelSpace (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U)]
variable [CompactSpace (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables kernel axes transverse blocks) U))
variable [μ.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 blocks U b hb o hR hσ S
structure SharedWidthPreparedCenteredShortForecastGoodBounds
{m nX M : ℕ} {X₀ J₀ : Type}
(prep : RankPreparationFamily X₀ J₀ m)
(U : ∀ j : Fin m, Submodule ℝ (RankPreparationLayer.Coord (prep j) → ℝ))
(b : ∀ j, Basis (Fin (preparedSamplerTransverse prep j)) ℝ (euclideanSubspace (U j))ᗮ)
{R σ : Fin m → ℝ}
(S : LayerSamplerScale
(G := EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(I := PreparedSamplerContinuous prep) (n := preparedSamplerTransverse prep)
(J := fun j => RankPreparationLayer.Coord (prep j))
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))) U b R σ)
(selection : Fin (0 + 1) ↪ EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ)
(Vtail : Fin m → ℝ≥0) (u p forecastCap : ℝ)
(Pchart Qstride Pmaster Plate Pphysical coarseTarget : ℝ)
(B0 Vlog gainLog gain Pwidth P₀ Pgood : ℝ) (Qgood : ℕ) (D : ℝ) : Prop where
hcert : PreparedShortCertifiedSameScaleBadProductInterface (nX := nX) (M := M) prep U b S B0 (gainLog + 8) Vlog Qgood
hnX : 0 < nX
hσ1 : ∀ j, σ j ≤ 1
hsmall : ∀ C : Fin m → ℝ, (∀ j, 0 ≤ C j) →
(∀ j, C j ≤ Real.exp Pchart) →
∀ j, C j * ((Fintype.card ((PreparedSamplerContinuous prep) j) : ℝ) + 1) * R j ≤ 1/4
hMaster : 0 ≤ Pmaster
hLate : Pmaster ≤ Plate
hd : AllocatedComparisonDimensions (G := (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) (EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))) (Fin (0 + 1)) (fun j : Fin m => (boundedBooleanJetRows (Fin (0 + 1)) (j.val + 1) : Type)) D
hD : D ≤ Pmaster
hnMaster : (nX : ℝ) ≤ Pmaster
hRi : ∀ j, (R j)⁻¹ ≤ Real.exp Pmaster
hσi : ∀ j, (σ j)⁻¹ ≤ Real.exp Plate
hS : (S.value : ℝ) ≤ Real.exp Plate
hchartB : Pchart ≤ B0
hprojection : (preparedModularGeneralDetectorResources
(preparedModularGeneralDetectorConstants m 0) (0 + 1) Pmaster Plate).Pproj ≤ Pwidth
hphysical : jointPhysicalBaseLog Pwidth (gainLog + 8) Vlog ≤ B0
hVlog : 0 ≤ Vlog
hQexp : (Qgood : ℝ) ≤ Real.exp Vlog
hP₀ : 0 ≤ P₀
hnP₀ : (nX : ℝ) ≤ P₀
hgP₀ : gainLog ≤ P₀
hcutoffP : (P₀ + preparedCenteredShortForecastSpatialExponent m) ^
preparedCenteredShortForecastSpatialExponent m ≤ Pgood
hBP : B0 ≤ Pgood
hwidthP : Pwidth ≤ Pgood
hg : 0 ≤ gainLog
hgP : gainLog + 8 ≤ Pgood
hgain : Real.exp (-gainLog) ≤ gain
hstrideWidth : Qstride ≤ Pwidth
hτWidth : Pphysical ≤ Pwidth
hξWidth : Plate ≤ Pwidth
theorem sharedWidthPreparedCenteredShortForecastGoodExtraData
{m nX M : ℕ} {X₀ J₀ : Type}
(prep : RankPreparationFamily X₀ J₀ m)
(U : ∀ j : Fin m, Submodule ℝ (RankPreparationLayer.Coord (prep j) → ℝ))
(b : ∀ j, Basis (Fin (preparedSamplerTransverse prep j)) ℝ (euclideanSubspace (U j))ᗮ)
{R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
(S : LayerSamplerScale
(G := EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(I := PreparedSamplerContinuous prep) (n := preparedSamplerTransverse prep)
(J := fun j => RankPreparationLayer.Coord (prep j))
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))) U b R σ)
(selection : Fin (0 + 1) ↪ EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(stride N : Fin nX → ℕ) (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ)
(Vtail : Fin m → ℝ≥0) (τ u p forecastCap : ℝ)
{Q : Fin m → Type} [∀ j, Fintype (Q j)]
(hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
(o : ∀ j, OrthonormalBasis (PreparedSamplerContinuous prep j) ℝ (euclideanSubspace (U j)))
(bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j))))
[∀ j, IsZLattice ℝ (latticeSection
(standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j)))]
[MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
(μ : Measure (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U))
[IsProbabilityMeasure μ]
[μ.IsAddLeftInvariant]
(ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j)))
(euclideanSubspace (U j))).toAddSubgroup))
[∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(B0 Vlog gainLog gain Pwidth P₀ Pgood : ℝ) (Qgood : ℕ)
(spatialEmbedding : Fin 2 × Fin nX ↪ (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M))))
{D : ℝ}
(H : SharedWidthPreparedCenteredShortForecastGoodBounds (m := m) (nX := nX) (M := M)
(prep := prep) (U := U) (b := b) (S := S)
(selection := selection) (Pdetect := Pdetect) (uSource := uSource)
(pModel := pModel) (pSlice := pSlice) (Vtail := Vtail)
(u := u) (p := p) (forecastCap := forecastCap)
Pchart Qstride Pmaster Plate Pphysical coarseTarget
B0 Vlog gainLog gain Pwidth P₀ Pgood Qgood D) :
SharedWidthPreparedCenteredForecastModelExtraDataInterface
(G := (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) (I := (PreparedSamplerContinuous prep)) (n := (preparedSamplerTransverse prep)) (J := (fun j : Fin m => RankPreparationLayer.Coord (prep j)))
(B := (EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) (U := U) (basis := b) (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)
(Good := PreparedCenteredShortForecastGoodProperty (m := m) (nX := nX) (M := M) prep U b S bW hb o hR hσ μ
stride gainLog gain Qgood spatialEmbedding)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
(preparedCenteredShortForecastGoodRequired m B0 Pgood) := by
intro hstride hstrideBound C hC hCbound hchart Cforward hforward hForward
hVtail hVactual hprofile hcutoff Eforecast hτSpatial hτInv hτHalf hτDim
r W ξn hξn hξle hξLate hW hξone Pmarginal modelRequired required cells poly hpoly hmem Rrank
hsize hrank hRank V hCells bases Z hN hbases hbox hmass hnormalizer hmargin
Path Zcenter hnormalizerCenter centeredLaw
have hsizeGood (i) : Real.exp (preparedCenteredShortForecastGoodRequired m B0 Pgood) ≤ (N i : ℝ) :=
(Real.exp_le_exp.mpr (le_max_right _ _)).trans (hsize i)
have hRankGood : Real.exp (preparedCenteredShortForecastGoodRequired m B0 Pgood) ≤ Rrank :=
(Real.exp_le_exp.mpr (le_max_right _ _)).trans hRank
exact (exists_preparedCentered_short_forecastGoodData m).choose_spec.choose_spec.2.2.2 (nX := nX) (M := M) (X₀ := X₀) (J₀ := J₀) prep U b S B0 Vlog gainLog gain Qgood H.hcert
bW hb o Cforward Vtail hforward hVactual hR hσ H.hσ1 C hC hchart
(H.hsmall C hC hCbound)
(Pchart := Pchart) (Pmaster := Pmaster) (Plate := Plate) (D := D)
(Pwidth := Pwidth) (P₀ := P₀) (P := Pgood)
hprofile hForward hVtail H.hchartB H.hMaster H.hLate H.hd H.hD H.hnMaster H.hRi H.hσi H.hS
H.hprojection H.hphysical H.hVlog H.hQexp H.hP₀ H.hnP₀ H.hgP₀ H.hcutoffP H.hBP H.hwidthP H.hg H.hgP H.hgain
μ ν poly hpoly hmem stride hstride
(fun i => (hstrideBound i).trans (Real.exp_le_exp.mpr H.hstrideWidth))
hτSpatial (hτInv.trans (Real.exp_le_exp.mpr H.hτWidth)) hξn hξone (hξLate.trans (Real.exp_le_exp.mpr H.hξWidth))
N hN hsizeGood hrank hRankGood cells hCells bases hbases hmass
hnormalizerCenter H.hnX spatialEmbedding
theorem sharedWidthPreparedCenteredShortForecastGoodModelInterface_of_model
{m nX M : ℕ} {X₀ J₀ : Type}
(prep : RankPreparationFamily X₀ J₀ m)
(U : ∀ j : Fin m, Submodule ℝ (RankPreparationLayer.Coord (prep j) → ℝ))
(b : ∀ j, Basis (Fin (preparedSamplerTransverse prep j)) ℝ (euclideanSubspace (U j))ᗮ)
{R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
(S : LayerSamplerScale
(G := EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(I := PreparedSamplerContinuous prep) (n := preparedSamplerTransverse prep)
(J := fun j => RankPreparationLayer.Coord (prep j))
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))) U b R σ)
(selection : Fin (0 + 1) ↪ EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(stride N : Fin nX → ℕ) (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ)
(Vtail : Fin m → ℝ≥0) (τ u p forecastCap : ℝ)
{Q : Fin m → Type} [∀ j, Fintype (Q j)]
(hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
(o : ∀ j, OrthonormalBasis (PreparedSamplerContinuous prep j) ℝ (euclideanSubspace (U j)))
(bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j))))
[∀ j, IsZLattice ℝ (latticeSection
(standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j)))]
[MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
(μ : Measure (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U))
[IsProbabilityMeasure μ]
[μ.IsAddLeftInvariant]
(ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j)))
(euclideanSubspace (U j))).toAddSubgroup))
[∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(B0 Vlog gainLog gain Pwidth P₀ Pgood : ℝ) (Qgood : ℕ)
(spatialEmbedding : Fin 2 × Fin nX ↪ (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M))))
{D : ℝ}
(H : SharedWidthPreparedCenteredShortForecastGoodBounds (m := m) (nX := nX) (M := M)
(prep := prep) (U := U) (b := b) (S := S)
(selection := selection) (Pdetect := Pdetect) (uSource := uSource)
(pModel := pModel) (pSlice := pSlice) (Vtail := Vtail)
(u := u) (p := p) (forecastCap := forecastCap)
Pchart Qstride Pmaster Plate Pphysical coarseTarget
B0 Vlog gainLog gain Pwidth P₀ Pgood Qgood D)
(hModel : SharedWidthPreparedCenteredForecastModelInterface
(G := (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) (I := (PreparedSamplerContinuous prep)) (n := (preparedSamplerTransverse prep)) (J := (fun j : Fin m => RankPreparationLayer.Coord (prep j)))
(B := (EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) (U := U) (basis := b) (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) :
SharedWidthPreparedCenteredShortForecastGoodModelInterface (m := m) (nX := nX) (M := M)
(prep := prep) (U := U) (b := b) (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) (bW := bW) (μ := μ)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
B0 gainLog gain Pgood Qgood spatialEmbedding := by
apply sharedWidthPreparedCenteredForecastModelExtension_of_model
(G := (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) (I := (PreparedSamplerContinuous prep)) (n := (preparedSamplerTransverse prep)) (J := (fun j : Fin m => RankPreparationLayer.Coord (prep j)))
(B := (EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) (U := U) (basis := b) (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) (μ := μ)
(Good := PreparedCenteredShortForecastGoodProperty (m := m) (nX := nX) (M := M) prep U b S bW hb o hR hσ μ
stride gainLog gain Qgood spatialEmbedding)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
(preparedCenteredShortForecastGoodRequired m B0 Pgood) hModel
exact sharedWidthPreparedCenteredShortForecastGoodExtraData (m := m) (nX := nX) (M := M)
(prep := prep) (U := U) (b := b) (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) (bW := bW) (μ := μ) (ν := ν)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
B0 Vlog gainLog gain Pwidth P₀ Pgood Qgood spatialEmbedding
H
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open MeasureTheory Module Submodule BooleanCubeKernel
open scoped Classical BigOperators NNReal TensorProduct
theorem sharedWidthPreparedShortForecastSourceModelAttachment
{m nX M : ℕ} {X₀ J₀ : Type}
(prep : RankPreparationFamily X₀ J₀ m)
(U : ∀ j : Fin m, Submodule ℝ (RankPreparationLayer.Coord (prep j) → ℝ))
(b : ∀ j, Basis (Fin (preparedSamplerTransverse prep j)) ℝ (euclideanSubspace (U j))ᗮ)
{R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j)
(S : LayerSamplerScale
(G := EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(I := PreparedSamplerContinuous prep) (n := preparedSamplerTransverse prep)
(J := fun j => RankPreparationLayer.Coord (prep j))
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M))) U b R σ)
(selection : Fin (0 + 1) ↪ EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(stride N : Fin nX → ℕ) (Pdetect : Polynomial ℕ) (uSource pModel pSlice : ℝ)
(Vtail : Fin m → ℝ≥0) (τ u p forecastCap : ℝ)
{Q : Fin m → Type} [∀ j, Fintype (Q j)]
(hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))
(o : ∀ j, OrthonormalBasis (PreparedSamplerContinuous prep j) ℝ (euclideanSubspace (U j)))
(bW : ∀ j, Basis (Q j) ℤ
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j))))
[∀ j, IsZLattice ℝ (latticeSection
(standardEuclideanLattice (RankPreparationLayer.Coord (prep j))) (euclideanSubspace (U j)))]
[MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
[BorelSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
[CompactSpace (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U)]
(μ : Measure (CoefficientTorus (K := LayerSamplerVariables
(EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))
(PreparedSamplerContinuous prep) (preparedSamplerTransverse prep)
(EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) U))
[IsProbabilityMeasure μ]
[μ.IsAddLeftInvariant]
(ν : ∀ j, Measure (euclideanSubspace (U j) ⧸
(latticeSection (standardEuclideanLattice (RankPreparationLayer.Coord (prep j)))
(euclideanSubspace (U j))).toAddSubgroup))
[∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)]
(Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget : ℝ)
(baseB0 Vlog gainLog gain Pwidth : ℝ) (Qgood : ℕ)
(spatialEmbedding : Fin 2 × Fin nX ↪ (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M))))
{D : ℝ}
(H : PreparedShortForecastSourceRawBounds (m := m) (nX := nX) (M := M)
(prep := prep) (U := U) (b := b) (S := S)
(selection := selection) (Pdetect := Pdetect) (uSource := uSource)
(pModel := pModel) (pSlice := pSlice) (Vtail := Vtail)
(u := u) (p := p) (forecastCap := forecastCap)
Pchart Qstride Pmaster Plate Pphysical coarseTarget
baseB0 Vlog gainLog gain Pwidth Qgood D)
(hLateWidth : Plate ≤ Pwidth)
(hModel : SharedWidthPreparedCenteredForecastModelInterface
(G := (EnlargedPreparedCommonKernel m (modularInitialBlockCount m (nX + m * M)))) (I := (PreparedSamplerContinuous prep)) (n := (preparedSamplerTransverse prep)) (J := (fun j : Fin m => RankPreparationLayer.Coord (prep j)))
(B := (EnlargedPreparedCommonSamplerBlock prep (modularInitialBlockCount m (nX + m * M)))) (U := U) (basis := b) (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) :
let Bcert := preparedForecastGoodCertificateBudget baseB0 Pchart Pwidth gainLog Vlog
let Pgood := preparedForecastGoodAnalyticBudget
(preparedCenteredShortForecastSpatialExponent m) baseB0 Pchart Pwidth gainLog Vlog
SharedWidthPreparedCenteredShortForecastGoodModelInterface (m := m) (nX := nX) (M := M)
(prep := prep) (U := U) (b := b) (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) (bW := bW) (μ := μ)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
Bcert gainLog gain Pgood Qgood spatialEmbedding := by
intro Bcert Pgood
have Hgood := preparedShortForecastSourceRawBounds_to_good
(m := m) (nX := nX) (M := M) prep U b S selection
Pdetect uSource pModel pSlice Vtail u p forecastCap
Pchart Qstride Pmaster Plate Pphysical coarseTarget
baseB0 Vlog gainLog gain Pwidth Qgood D H
have Hshared : SharedWidthPreparedCenteredShortForecastGoodBounds prep U b S selection
Pdetect uSource pModel pSlice Vtail u p forecastCap
Pchart Qstride Pmaster Plate Pphysical coarseTarget
Bcert Vlog gainLog gain Pwidth Pchart Pgood Qgood D := {
hcert := Hgood.hcert
hnX := Hgood.hnX
hσ1 := Hgood.hσ1
hsmall := Hgood.hsmall
hMaster := Hgood.hMaster
hLate := Hgood.hLate
hd := Hgood.hd
hD := Hgood.hD
hnMaster := Hgood.hnMaster
hRi := Hgood.hRi
hσi := Hgood.hσi
hS := Hgood.hS
hchartB := Hgood.hchartB
hprojection := Hgood.hprojection
hphysical := Hgood.hphysical
hVlog := Hgood.hVlog
hQexp := Hgood.hQexp
hP₀ := Hgood.hP₀
hnP₀ := Hgood.hnP₀
hgP₀ := Hgood.hgP₀
hcutoffP := Hgood.hcutoffP
hBP := Hgood.hBP
hwidthP := Hgood.hwidthP
hg := Hgood.hg
hgP := Hgood.hgP
hgain := Hgood.hgain
hstrideWidth := Hgood.hstrideWidth
hτWidth := Hgood.hτWidth
hξWidth := hLateWidth }
exact sharedWidthPreparedCenteredShortForecastGoodModelInterface_of_model
(m := m) (nX := nX) (M := M) (X₀ := X₀) (J₀ := J₀)
(prep := prep) (U := U) (b := b) (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) (bW := bW) (μ := μ) (ν := ν)
Pchart Qstride Pmaster Plate pGain Pphysical coarseTarget
Bcert Vlog gainLog gain Pwidth Pchart Pgood Qgood spatialEmbedding
(D := D) Hshared hModel
end Erdos3.VectorPolynomial
end
end OAI
import OAI.Combinatorics.Progressions.Estimates.SharedWidthPreparedPerturbativeCertifiedSource
import OAI.Combinatorics.Progressions.Sampling.PreparedShortForecastRawSourceBounds
namespace OAI
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 [BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable [CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)]
variable (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U))
variable [μ.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 SharedWidthPreparedCenteredForecastModelInterface
(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)
∀ {ξn : ℝ} (hξn : 0 < ξn)
(hξle : ξ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),
ξn⁻¹ ≤ Real.exp Plate →
let hW := allocatedPhysicalRootBudget_nonneg B U basis S (fun _ => 0)
let hξone : ξn ≤ 1 := hξle.trans (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 → ℝ))
Xet Storage Details
- Size:
- 88.6 kB
- Xet hash:
- 37a58e4e1d76e7285672779f176bc3373d6e6b1b999c40c9dac54c293b459dcf
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.