Buckets:
cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Sampling /AllocatedPrimitiveSiteSampling.lean
| import OAI.Combinatorics.Progressions.Fourier.AllocatedSiteSpectrumBudget | |
| import OAI.Combinatorics.Progressions.Lattices.AllocatedResidueSitePrimitiveAverage | |
| namespace OAI | |
| section | |
| namespace Erdos3.VectorPolynomial | |
| open MeasureTheory Module Submodule _root_.Set _root_.OAI.Set BooleanCubeKernel | |
| open scoped BigOperators Classical NNReal | |
| universe uG uI uB uJ uQ uX | |
| attribute [local instance 2000] fullBooleanRowSetFintype | |
| variable {m dim : ℕ} {G : Type uG} [Fintype G] | |
| variable {I : Fin m → Type uI} [∀ j, Fintype (I j)] [∀ j, DecidableEq (I j)] | |
| variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type uB) | |
| variable [∀ a, Fintype (B a)] [∀ a, DecidableEq (B a)] | |
| variable {J : Fin m → Type uJ} [∀ j, Fintype (J j)] | |
| variable (U : ∀ j, Submodule ℝ (J j → ℝ)) | |
| variable (b : ∀ j, Basis (Fin (n j)) ℝ (euclideanSubspace (U j))ᗮ) | |
| variable {R σ : Fin m → ℝ} (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j) | |
| variable (S : LayerSamplerScale (G := G) B U b R σ) | |
| local notation "rowSets" => (fun j : Fin m => boundedBooleanJetRows (Fin dim) (Fin.val j + 1)) | |
| local notation "rowTypes" => (fun j : Fin m => (rowSets j : Type)) | |
| local notation "rows" => (fun j => (Subtype.val : rowSets j → Finset (Fin dim))) | |
| variable (q : ℕ) [NeZero q] | |
| variable {p₁ w v E : ℝ} | |
| local notation "siteDelta" => allocatedSitePrimitiveTolerance m p₁ w v E | |
| local notation "siteLambda" => allocatedSiteSpectrumLog m p₁ w v E | |
| section Constructed | |
| local notation "grid" => allocatedGridAxis (I := I) U b S.value | |
| local notation "active" => allocatedActiveGrid B U b S | |
| local notation "activeAxes" => {a : {a // grid a} // active a} | |
| local notation "ig" => allocatedGridIntegerAxis B U b S | |
| local notation "axisN" => allocatedGridNaturalScale B U b S | |
| local notation "volumeN" => allocatedActiveNaturalVolume B U b S rowSets | |
| local notation "rowFamily" => (fun a : (Σ j : Fin m, Fin (n j)) => rowSets (Sigma.fst a)) | |
| variable (hq : 0 < q) (hsize : (Fintype.card (Fin dim) + 1) * q ≤ S.value) | |
| variable (P : ℝ) | |
| variable (M : {a : {a // allocatedGridAxis (I := I) U b S.value a} // allocatedActiveGrid B U b S a} → ℕ) | |
| variable [∀ a, NeZero (M a)] | |
| local notation "pointTolerance" => allocatedSitePointTolerance (G := G) B rowSets siteDelta | |
| local notation "trueCap" => allocatedGridFamilyCap B (rowFamily) P + 1 | |
| local notation "halfAccuracy" => uniformProductAccuracy (Fintype.card (Σ j : Fin m, Fin (n j))) trueCap pointTolerance / 2 | |
| local notation "torus" => (fun a : activeAxes => allocatedGridTorusFactor B (Fin dim) (ig (Subtype.val a))) | |
| local notation "cap" => (fun a : activeAxes => allocatedGridPointCap B P (ig (Subtype.val a)) (rowSets (Sigma.fst (ig (Subtype.val a))))) | |
| local notation "siteH" => (fun a : activeAxes => | |
| allocatedNaturalSiteRadius (G := G) B (Sigma.fst (ig (Subtype.val a))) (Sigma.snd (ig (Subtype.val a))) (rowSets (Sigma.fst (ig (Subtype.val a)))) + 1 / 4) | |
| local notation "bias" => (fun a : activeAxes => positiveModerateRetainedBias (Fin.val (Sigma.fst (ig (Subtype.val a)))) | |
| (Finset.card (rowSets (Sigma.fst (ig (Subtype.val a))))) ((layerTailDegree m + 2) * Finset.card (rowSets (Sigma.fst (ig (Subtype.val a))))) | |
| P ((torus) a : ℝ) ((2 * ((torus) a : ℝ)) ^ Finset.card (rowSets (Sigma.fst (ig (Subtype.val a))))) halfAccuracy) | |
| local notation "freq" => (fun a : activeAxes => Real.toNNReal (positiveRetainedFrequencyBound | |
| (Fin.val (Sigma.fst (ig (Subtype.val a)))) (Finset.card (rowSets (Sigma.fst (ig (Subtype.val a))))) P ((torus) a : ℝ) ((bias) a))) | |
| include hq hsize in | |
| theorem exists_allocated_primitive_site_sampled_error | |
| (hp₁ : 0 ≤ p₁) (hw : 0 ≤ w) (hv : 0 ≤ v) (hE : 0 ≤ E) | |
| (hdimSmall : dim ≤ m + 1) | |
| (hvars : (Fintype.card (LayerSamplerVariables G I n B) : ℝ) ≤ p₁) | |
| (hI : ∀ j, (Fintype.card (I j) : ℝ) ≤ p₁) (hn₁ : ∀ j, (n j : ℝ) ≤ p₁) | |
| (hJ : ∀ j, (Fintype.card (J j) : ℝ) ≤ p₁) | |
| (M₀ : ℕ) (hqM : q ≤ M₀ ^ (m + 1)) (hM₀ : (M₀ : ℝ) ≤ Real.exp p₁) | |
| (hS₁ : (S.value : ℝ) ≤ Real.exp p₁) | |
| (hEbudget : E + 4 ≤ p₁) | |
| (hP : 1 ≤ P) (hPp : P ≤ Real.exp p₁) | |
| (hgamma : ∀ a : activeAxes, principalProfileSize (R (ig a.val).1) | |
| (Finset.card (layerIntegerPrincipalSlots (G := G) B (ig a.val).1 (ig a.val).2)) ≤ S.value) | |
| (L : ℝ≥0) (hL : LipschitzWith L Real.smoothTransition) | |
| (hcP : scalarCubePrimitiveEnvelope Empty L 16 (128 * probabilityProfileLipschitz) 1 ≤ P) | |
| (hsP : scalarCubePrimitiveEnvelope (Fin dim) L 1 0 q ≤ P) | |
| (hM : ∀ a, M a = (torus) a * axisN a.val) | |
| (hB : ∀ a : activeAxes, positiveModerateSpectrumBlockCount (ig a.val).1.val | |
| (rowSets (ig a.val).1).card ((layerTailDegree m + 2) * (rowSets (ig a.val).1).card) ≤ | |
| Fintype.card (B ⟨(ig a.val).1, Sum.inr (ig a.val).2⟩)) : | |
| ∃ K : ℕ, 2 ≤ K ∧ | |
| ∃ witnesses : (r : AllocatedPositiveResidue (dim := dim) B U b S q) → | |
| AllocatedResidueSiteWitness (dim := dim) B U b S q r.val, | |
| (∀ r, allocatedActiveSiteBounds B U b S rowSets P pointTolerance siteLambda M (witnesses r).expansion) ∧ | |
| ∀ | |
| (x : G → IntegerScalarCubeBox (Fin dim) S.value) | |
| (hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j))) | |
| (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j))) | |
| {Q : Fin m → Type uQ} [∀ j, Fintype (Q j)] | |
| (bW : ∀ j, Basis (Q j) ℤ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))) | |
| (d : ℕ) [NeZero d] | |
| [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))] | |
| (f : ((Σ a : {a // ¬allocatedGridAxis (I := I) U b S.value a}, | |
| {t : Finset (Fin dim) // t ∈ rowSets (Sigma.fst (Subtype.val a))}) → ℝ) → ℝ) | |
| (CM Cf : ℝ≥0) (_hCM : 1 ≤ (CM : ℝ)) (_hfb : ∀ v, |f v| ≤ Cf) | |
| (_hCMexp : (CM : ℝ) ≤ Real.exp w) (_hCfexp : (Cf : ℝ) ≤ Real.exp v) | |
| (_hmask : ∀ y₀ : PrincipalIntegerTuples B (layerSamplerDegree I n) (Fin dim) | |
| (allocatedPrincipalSides B U b S), ∀ j z, 0 ≤ allocatedIntegerKernelMask (O := rowTypes) B U b S x | |
| (fun j => (Subtype.val : rowSets j → Finset (Fin dim))) j q | |
| (integerResidueMatrix (allocatedNonkernelJetMatrix (O := rowTypes) B U b S x | |
| (principalAxisRestrict (allocatedGridAxis (I := I) U b S.value) y₀) | |
| (fun j => (Subtype.val : rowSets j → Finset (Fin dim))) j | |
| (principalAxisRestrict (fun a => ¬allocatedGridAxis (I := I) U b S.value a) y₀)) q) z ∧ | |
| allocatedIntegerKernelMask (O := rowTypes) B U b S x | |
| (fun j => (Subtype.val : rowSets j → Finset (Fin dim))) j q | |
| (integerResidueMatrix (allocatedNonkernelJetMatrix (O := rowTypes) B U b S x | |
| (principalAxisRestrict (allocatedGridAxis (I := I) U b S.value) y₀) | |
| (fun j => (Subtype.val : rowSets j → Finset (Fin dim))) j | |
| (principalAxisRestrict (fun a => ¬allocatedGridAxis (I := I) U b S.value a) y₀)) q) z ≤ CM) | |
| (_hperiod : ∀ j, integerScalarLattice (rowTypes j) (q : ℤ) ≤ | |
| (scalarKernelIntegerJet x (j.val + 1) (rows j)).mulVecLin.range) | |
| (C V : Fin m → ℝ≥0) | |
| (_hC : ∀ j w, ‖normalizedOrthogonalChart (euclideanSubspace (U j)) (b j) w‖ ≤ C j * ‖w‖) | |
| (_hV : ∀ j, 0 ≤ mixedDensityCovolumeRatio (euclideanSubspace (U j)) (b j) ∧ | |
| mixedDensityCovolumeRatio (euclideanSubspace (U j)) (b j) ≤ V j) | |
| (_hCexp : ∀ j, (C j : ℝ) ≤ Real.exp p₁) (_hVexp : ∀ j, (V j : ℝ) ≤ Real.exp p₁) | |
| {X : Type uX} [Fintype X] [DecidableEq X] | |
| {P₀ : ℝ} (_hP : 0 ≤ P₀) (_hn : (Fintype.card X : ℝ) ≤ P₀) | |
| (_hdim : (Fintype.card (Option (Fin dim) × X) : ℝ) ≤ P₀) | |
| (_hbudget : allocatedSiteErrorFourierOutput m p₁ w v ≤ P₀) | |
| [CompactSpace (CoefficientTorus (K := Fin dim) U)] | |
| [MeasurableSpace (CoefficientTorus (K := Fin dim) U)] [BorelSpace (CoefficientTorus (K := Fin dim) U)] | |
| (μ : Measure (CoefficientTorus (K := Fin dim) U)) [μ.IsAddLeftInvariant] [IsProbabilityMeasure μ] | |
| (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸ | |
| (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))).toAddSubgroup)) | |
| [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)] | |
| (p : ∀ j, VectorPolynomial X ℝ (J j → ℝ)) | |
| (_hp : ∀ j, DegreeLE (1 : X → ℕ) (j.val + 1) (p j)) | |
| (hmp : ∀ j e, coefficients (p j) e ∈ U j) | |
| (stride : X → ℕ) (_hs : ∀ x, 0 < stride x) | |
| {R₁ S₀ ρ : ℝ} (_hS : 0 ≤ S₀) (_hSP : S₀ ≤ Real.exp P₀) (_hρ : 0 < ρ) | |
| (_hρP : 1 / ρ ≤ Real.exp P₀) | |
| (_hstride : ∀ x, (stride x : ℝ) ≤ S₀) | |
| (H : X → ℝ) (_hsize : ∀ x, Real.exp ((P₀ + K) ^ K) ≤ H x) | |
| (_hrank : ∀ j, HasLayerSamplingRank (j.val + 1) H R₁ (U j) (p j)) | |
| (_hR : Real.exp ((P₀ + K) ^ K) ≤ R₁) | |
| (cells : Finset (ColumnResiduePattern (Option (Fin dim)) X stride)) (_hcells : cells.Nonempty) | |
| (W : Option (Fin dim) × X → ℝ) (hW : ∀ z, 0 < W z) (_hwidth : ∀ z, ρ * H z.2 ≤ W z), | |
| let law := principalTupleWeights (α := Fin dim) B (layerSamplerDegree I n) | |
| (allocatedPrincipalSides B U b S) (allocatedPrincipalSides_pos B U b S) | |
| let target := allocatedSupportedResidueSiteProfile B U b hR hσ S q x hb o bW d f witnesses | |
| let error := fun y : EuclideanJetLayers U (rowTypes) => | |
| law.complexMean (fun y₀ => | |
| (allocatedWholeMaskedCoveredProfile (O := rowTypes) B U b hR hσ S x (rows) hb o bW d y₀ q f y : ℂ)) - | |
| (law.fiberLaw (principalResidueLabel q)).complexMean (fun r => target r y) | |
| ∃ hZ : 0 < ∑' z, selectedResidueSmoothWeight stride cells W z, | |
| selectedResidueDensityMass stride cells W | |
| (fun z => ‖error (physicalCubeRowSample (O := rowTypes) U d (rows) p hmp (standardPhysicalCubeOutput z))‖) | |
| ≤ Real.exp (-E) ∧ | |
| ∀ φ : (Option (Fin dim) × X → ℤ) → ℂ, (∀ z, ‖φ z‖ ≤ 1) → | |
| ‖∑' z, ((selectedResidueSmoothPMF stride cells W hW hZ z).toReal : ℂ) * | |
| (error (physicalCubeRowSample (O := rowTypes) U d (rows) p hmp (standardPhysicalCubeOutput z)) * φ z)‖ | |
| ≤ Real.exp (-E) := by | |
| have hrowdim : Fintype.card (Fin dim) ≤ m + 1 := by | |
| simpa only [Fintype.card_fin] using hdimSmall | |
| have hspec := allocatedSiteSpectrum_primitive_budget B rowSets hrowdim | |
| hp₁ hw hv hE hP hPp hvars hI hn₁ | |
| have hδ := allocatedSitePrimitiveTolerance_pos m p₁ w v E | |
| have hΛ := (allocatedSiteSpectrumLog_bounds m hp₁ hw hv hE).2.2.2.1 | |
| exact exists_allocated_residue_site_primitive_error | |
| (B := B) (U := U) (b := b) (hR := hR) (hσ := hσ) (S := S) (q := q) | |
| (δ := siteDelta) (hq := hq) (hsize := hsize) (P := P) (Λ := siteLambda) (M := M) | |
| hp₁ hw hv hE hdimSmall hvars hI hn₁ hJ M₀ hqM hM₀ hS₁ le_rfl hEbudget | |
| hP hδ hΛ hgamma L hL hcP hsP hM hB | |
| (fun a => (hspec (ig a.val)).1) | |
| (fun a => (hspec (ig a.val)).2.1) | |
| (fun a => (hspec (ig a.val)).2.2) | |
| end Constructed | |
| end Erdos3.VectorPolynomial | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 11.1 kB
- Xet hash:
- 32480fe194363250ef7576b89b1f142e0474332b33b2549214650377a2f0fcf3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.