Buckets:
cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Dynamics /AllocatedNarrowPathMarginal.lean
| import OAI.Combinatorics.Progressions.Estimates.AllocatedFixedScaleJointMarginal | |
| import OAI.Combinatorics.Progressions.Estimates.SelectedJointSiteDomination | |
| namespace OAI | |
| section | |
| namespace Erdos3.VectorPolynomial | |
| open Module Submodule MeasureTheory BooleanCubeKernel | |
| open scoped BigOperators Classical NNReal | |
| theorem exists_allocated_narrow_path_marginal (m : ℕ) : | |
| ∃ A : ℕ, 2 ≤ A ∧ ∀ {X G : Type*} [Fintype X] [DecidableEq X] [Fintype G] | |
| {I : Fin m → Type*} [∀ j, Fintype (I j)] {n : Fin m → ℕ} | |
| (B : LayerSamplerAxis I n → Type*) [∀ a, Fintype (B a)] | |
| {J : Fin m → Type*} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ)) | |
| (basis : ∀ j, Basis (Fin (n j)) ℝ (euclideanSubspace (U j))ᗮ) | |
| {R σ : Fin m → ℝ} (S : LayerSamplerScale (G := G) B U basis R σ) | |
| (hb : ∀ j, span ℤ (Set.range (basis j)) = projectedIntegerLattice (euclideanSubspace (U j))) | |
| (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j))) | |
| [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))] | |
| [CompactSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)] | |
| [MeasurableSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)] | |
| [BorelSpace (CoefficientTorus (K := LayerSamplerVariables G I n B) U)] | |
| (μ : Measure (CoefficientTorus (K := LayerSamplerVariables G I n B) U)) | |
| [μ.IsAddLeftInvariant] [IsProbabilityMeasure μ] | |
| (ν : ∀ j, Measure (euclideanSubspace (U j) ⧸ | |
| (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j))).toAddSubgroup)) | |
| [∀ j, (ν j).IsAddLeftInvariant] [∀ j, IsProbabilityMeasure (ν j)] | |
| (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j) (_hσ1 : ∀ j, σ j ≤ 1) | |
| (C V : Fin m → ℝ≥0) | |
| (_hC : ∀ j z, ‖normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j) z‖ ≤ C j * ‖z‖) | |
| (_hV : ∀ j, 0 ≤ mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ∧ | |
| mixedDensityCovolumeRatio (euclideanSubspace (U j)) (basis j) ≤ V j) | |
| (Cinv : Fin m → ℝ) (_hCinv : ∀ j, 0 ≤ Cinv j) | |
| (_hchart : ∀ j z, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (basis j)).symm z‖ ≤ Cinv j * ‖z‖) | |
| (_hsmall : ∀ j, Cinv j * ((Fintype.card (I j) : ℝ) + 1) * R j ≤ 1 / 4) | |
| {P : ℝ} (_hP : 0 ≤ P) (_hmSize : (m : ℝ) ≤ P) | |
| (_hK : (Fintype.card (LayerSamplerVariables G I n B) : ℝ) ≤ P) | |
| (_hX : (Fintype.card X : ℝ) ≤ P) | |
| (_hdim : (Fintype.card (Option (LayerSamplerVariables G I n B) × X) : ℝ) ≤ P) | |
| (_hRP : ∀ j, (R j)⁻¹ ≤ Real.exp P) (_hσP : ∀ j, (σ j)⁻¹ ≤ Real.exp P) | |
| (_hcount : ∀ j : Fin m, | |
| (Fintype.card (BoundedCoefficientExponent (LayerSamplerVariables G I n B) (j.val + 1)) : ℝ) ≤ P) | |
| (_hI : ∀ j, (Fintype.card (I j) : ℝ) ≤ P) (_hn : ∀ j, (n j : ℝ) ≤ P) | |
| (_hJ : ∀ j, (Fintype.card (J j) : ℝ) ≤ P) | |
| (_hAP : (probabilityProfileLipschitz : ℝ) ≤ Real.exp P) (_hLP : (S.value : ℝ) ≤ Real.exp P) | |
| (_hCP : ∀ j, (C j : ℝ) ≤ Real.exp P) (_hVP : ∀ j, (V j : ℝ) ≤ Real.exp P) | |
| (p : ∀ j, VectorPolynomial X ℝ (J j → ℝ)) | |
| (_hp : ∀ j, DegreeLE (1 : X → ℕ) (j.val + 1) (p j)) | |
| (hm : ∀ j d, coefficients (p j) d ∈ U j) | |
| (stride : X → ℕ) (_hs : ∀ d, 0 < stride d) (_hsP : ∀ d, (stride d : ℝ) ≤ Real.exp P) | |
| {W τ ξ : ℝ} (_hW : 0 ≤ W) (_hWP : W ≤ Real.exp P) | |
| (_hτ : 0 < τ) (_hτP : τ⁻¹ ≤ Real.exp P) | |
| (_hτhalf : τ ≤ 1 / 2) (_hτdim : (Fintype.card X : ℝ) * τ ≤ 1 / 2) | |
| (_hξ : 0 < ξ) (_hξ1 : ξ ≤ 1) (_hξP : ξ⁻¹ ≤ Real.exp P) | |
| (N : X → ℕ) (_hsize : ∀ d, Real.exp ((P + A) ^ A) ≤ (N d : ℝ)) | |
| {rank : ℝ} (_hrank : ∀ j, HasLayerSamplingRank (j.val + 1) (fun d => (N d : ℝ)) rank (U j) (p j)) | |
| (_hRank : Real.exp ((P + A) ^ A) ≤ rank) | |
| (T : Finset (ColumnResiduePattern (Option (LayerSamplerVariables G I n B)) X stride)) (_hT : T.Nonempty), | |
| let widths := narrowTrimmedSpatialWidths (G := G) | |
| (J := PrincipalTupleIndex B (layerSamplerDegree I n)) W τ ξ N | |
| let bases := trimmedIntegerBox N (spatialTrimMargin τ N) | |
| let density := allocatedJointBaseDensity B U basis hb o hR hσ S X p hm | |
| let Z := selectedJointDensityMass bases stride T widths density | |
| ∃ (hN : ∀ x, 0 < N x) (hbases : bases.Nonempty) (hbox : (integerBox N).Nonempty) | |
| (hmass : 0 < ∑' z, selectedResidueSmoothWeight stride T widths z), | |
| ∃ hnormalizer : |Z - 1| ≤ Real.exp (-P) ∧ | |
| Z ∈ Set.Icc (1 / 2 : ℝ) (3 / 2) ∧ 0 < Z ∧ Z⁻¹ ≤ 2, | |
| ∃ hmargin : ∀ x, 2 * spatialTrimMargin τ N x ≤ N x, | |
| ∀ {Sites : Type*} [Fintype Sites] [Nonempty Sites] | |
| (root : Sites → LayerSamplerVariables G I n B → ℤ) | |
| (_hroot : ∀ t k, |(root t k : ℝ)| ≤ Real.exp P) | |
| (hrootSum : ∀ t, (∑ k, |(root t k : ℝ)|) ≤ W), | |
| (FiniteProbabilityWeights.uniformFinset (integerBox N) hbox).excessMass | |
| ((allocatedOriginalPathLaw B U basis hb o hR hσ S X p hm N hN _hW _hτ _hξ | |
| stride T hmass bases hbases hnormalizer.2.2.1).siteLaw | |
| (narrowPhysicalSiteMap (G := G) (J := PrincipalTupleIndex B (layerSamplerDegree I n)) _hW _hτ _hξ1 N hN hmargin root hrootSum)) | |
| (4 * ∏ j, earlyConstantDensityCap (Fintype.card (I j)) (n j) (R j) (V j)) ≤ | |
| 6 * positiveProjectionAccuracy P := by | |
| obtain ⟨A₁, hA₁, hone⟩ := exists_allocated_narrow_oneSite_domination m | |
| obtain ⟨A₂, hA₂, hnorm⟩ := exists_allocated_narrow_normalization m | |
| let A := max (max A₁ A₂) 256 | |
| have hA : 256 ≤ A := le_max_right _ _ | |
| have hA₁A : A₁ ≤ A := (le_max_left _ _).trans (le_max_left _ _) | |
| have hA₂A : A₂ ≤ A := (le_max_right _ _).trans (le_max_left _ _) | |
| refine ⟨A, by omega, ?_⟩ | |
| intro X G _ _ _ I _ n B _ J _ U basis R σ S hb o _ _ _ _ μ _ _ ν _ _ | |
| hR hσ hσ1 C V hC hV Cinv hCinv hchart hsmall P hP hmSize hK hX hdim | |
| hRP hσP hcount hI hn hJ hAP hLP hCP hVP p hp hm stride hs hsP W τ ξ | |
| hW hWP hτ hτP hτhalf hτdim hξ hξ1 hξP N hsize rank hrank hRank T hT widths bases density Z | |
| have hthreshold (a : ℕ) (ha : a ≤ A) : | |
| Real.exp ((P + a) ^ a) ≤ Real.exp ((P + A) ^ A) := by | |
| have hAr : (256 : ℝ) ≤ A := by exact_mod_cast hA | |
| have har : (a : ℝ) ≤ A := by exact_mod_cast ha | |
| apply Real.exp_le_exp.mpr | |
| exact (pow_le_pow_left₀ (by positivity) (by linarith : P + (a : ℝ) ≤ P + A) a).trans | |
| (pow_le_pow_right₀ (by linarith : (1 : ℝ) ≤ P + A) ha) | |
| obtain ⟨hwidths, hmass, hone⟩ := hone B U basis S hb o μ ν | |
| hR hσ hσ1 C V hC hV Cinv hCinv hchart hsmall hP hmSize hK hX hdim | |
| hRP hσP hcount hI hn hJ hAP hLP hCP hVP p hp hm stride hs hsP | |
| hW hWP hτ hτP hξ hξ1 hξP N | |
| (fun x => (hthreshold A₁ hA₁A).trans (hsize x)) hrank | |
| ((hthreshold A₁ hA₁A).trans hRank) T hT | |
| obtain ⟨_, _, _, hnorm⟩ := hnorm B U basis S hb o μ ν | |
| hR hσ hσ1 C V hC hV Cinv hCinv hchart hsmall hP hmSize hK hX hdim | |
| hRP hσP hcount hI hn hJ hAP hLP hCP hVP p hp hm stride hs hsP | |
| hW hWP hτ hτP hξ hξ1 hξP N | |
| (fun x => (hthreshold A₂ hA₂A).trans (hsize x)) hrank | |
| ((hthreshold A₂ hA₂A).trans hRank) T hT | |
| have hN (x) : 0 < N x := by exact_mod_cast (Real.exp_pos _).trans_le (hsize x) | |
| have hmarginSize (x) : 4 ≤ τ * (N x : ℝ) := | |
| spatialTrimMargin_size_of_exp_size hP hτ hτP | |
| ((spatial_threshold_large hP hA).trans (hsize x)) | |
| have hproper := spatialTrimMargin_proper hτhalf N hN hmarginSize | |
| have hbases : bases.Nonempty := trimmedIntegerBox_nonempty N _ hproper | |
| have hbox : (integerBox N).Nonempty := by | |
| let : ∀ x, NeZero (N x) := fun x => ⟨(hN x).ne'⟩ | |
| exact integerBox_nonempty N | |
| have hnormalizer : |Z - 1| ≤ Real.exp (-P) ∧ | |
| Z ∈ Set.Icc (1 / 2 : ℝ) (3 / 2) ∧ 0 < Z ∧ Z⁻¹ ≤ 2 := hnorm bases hbases | |
| have hmargin (x) := (hproper x).le | |
| refine ⟨hN, hbases, hbox, hmass, hnormalizer, hmargin, ?_⟩ | |
| intro Sites _ _ root hroot hrootSum | |
| let : Nonempty (integerBox N) := hbox.to_subtype | |
| let e : integerBox N → X → ℝ := fun x i => (x.val i : ℝ) | |
| have he : Function.Injective e := by | |
| intro x y hxy | |
| apply Subtype.ext | |
| funext i | |
| have hc : (x.val i : ℝ) = (y.val i : ℝ) := congrFun hxy i | |
| exact_mod_cast hc | |
| have hloss : (∑ x, 2 * (spatialTrimMargin τ N x : ℝ) / N x) ≤ 1 / 2 := by | |
| have h := spatialTrimMargin_error_bound N hN hmarginSize | |
| linarith | |
| have hcard : (Fintype.card (integerBox N) : ℝ) / bases.card ≤ 2 := by | |
| simpa only [Fintype.card_coe] using trimmedIntegerBox_card_ratio_le_two N _ hproper hloss | |
| have hcap : 0 ≤ ∏ j, earlyConstantDensityCap (Fintype.card (I j)) (n j) (R j) (V j) := | |
| Finset.prod_nonneg (fun j _ => earlyConstantDensityCap_nonneg _ _ (hR j) (V j).coe_nonneg) | |
| have h := selectedJointFiniteLaw_site_excess bases hbases stride T widths hwidths hmass density | |
| (allocatedJointBaseDensity_nonneg B U basis hb o hR hσ S X p hm) | |
| hnormalizer.2.2.1 hnormalizer.2.1.1 e he root | |
| (narrowPhysicalSiteMap (G := G) (J := PrincipalTupleIndex B (layerSamplerDegree I n)) hW hτ hξ1 N hN hmargin root hrootSum) | |
| (fun z t => narrowPhysicalSiteMap_cast (G := G) (J := PrincipalTupleIndex B (layerSamplerDegree I n)) hW hτ hξ1 N hN hmargin root hrootSum z t) | |
| hcard hcap (fun a t φ hφ => hone a (root t) (hroot t) φ hφ) | |
| exact h.trans_eq (by ring) | |
| end Erdos3.VectorPolynomial | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 9.55 kB
- Xet hash:
- c9db24373adb76c042edb823c3cdc031da0c83614731edbf393d22e3ef69cb15
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.