Add lean source and binary files (part 50)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- lean/OAI/Combinatorics/Progressions/Estimates/SampledNativeModel.leanAdded+585
- lean/OAI/Combinatorics/Progressions/Estimates/SampledSliceFixedModelPartners.leanAdded+120
- lean/OAI/Combinatorics/Progressions/Estimates/SaturatedFlag.leanAdded+599
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarBadSublevelRamp.leanAdded+44
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeBoundaryCost.leanAdded+77
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeBoundaryVolume.leanAdded+117
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeCokernelCutoff.leanAdded+132
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeDomain.leanAdded+233
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeFaceSlab.leanAdded+363
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeRootTranslation.leanAdded+82
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeWindowDomain.leanAdded+88
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarDominatedSlack.leanAdded+481
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarExtensionSubstitution.leanAdded+32
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarInitialThreshold.leanAdded+74
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarInputLogFactor.leanAdded+26
- lean/OAI/Combinatorics/Progressions/Estimates/ScalarWindowPartitions.leanAdded+58
- lean/OAI/Combinatorics/Progressions/Estimates/ScaledConditionedComparison.leanAdded+605
- lean/OAI/Combinatorics/Progressions/Estimates/ScaledFloorPerturbation.leanAdded+38
- lean/OAI/Combinatorics/Progressions/Estimates/ScaledJointFrozenSource.leanAdded+161
- lean/OAI/Combinatorics/Progressions/Estimates/ScaledLinearResidual.leanAdded+48
- lean/OAI/Combinatorics/Progressions/Estimates/ScaledSectionGram.leanAdded+73
- lean/OAI/Combinatorics/Progressions/Estimates/SecondDifferenceVectorEquivalence.leanAdded+143
- lean/OAI/Combinatorics/Progressions/Estimates/SecondaryMeshGeometry.leanAdded+112
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedChildBound.leanAdded+53
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedCoefficientEvaluation.leanAdded+435
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedImageCorrections.leanAdded+85
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedJointLifts.leanAdded+117
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedJointSiteDomination.leanAdded+91
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedJointWeightedReferenceComparison.leanAdded+91
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedOutputL1.leanAdded+107
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedPhysicalReferenceCap.leanAdded+75
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedProductEnvelope.leanAdded+34
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedProfileTranslationL1.leanAdded+59
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedSingletonSmoothTestQuadrature.leanAdded+235
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedSplitUnitSource.leanAdded+76
- lean/OAI/Combinatorics/Progressions/Estimates/SelectedWindowIndicator.leanAdded+224
- lean/OAI/Combinatorics/Progressions/Estimates/SeparatedCosetBalls.leanAdded+68
- lean/OAI/Combinatorics/Progressions/Estimates/SeparatedInterpolationBound.leanAdded+104
- lean/OAI/Combinatorics/Progressions/Estimates/SeparatedLabelExtension.leanAdded+86
- lean/OAI/Combinatorics/Progressions/Estimates/SeparatedPositiveSum.leanAdded+48
- lean/OAI/Combinatorics/Progressions/Estimates/SeparatedRealSamples.leanAdded+77
- lean/OAI/Combinatorics/Progressions/Estimates/Separation.leanAdded+48
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeComparisonDescent.leanAdded+87
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeComparisonLift.leanAdded+879
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeComparisonOrbit.leanAdded+109
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeCorrelatedFactorization.leanAdded+220
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeFrozenComparison.leanAdded+423
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeLowerFactorization.leanAdded+686
- lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeRoundingThreshold.leanAdded+845
- lean/OAI/Combinatorics/Progressions/Estimates/SharedWidthPreparedChoice.leanAdded+43
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585import Mathlib.Analysis.LocallyConvex.BalancedCoreHullimport Mathlib.Analysis.Normed.Module.Seminorm.Basicimport OAI.Combinatorics.Progressions.Fourier.WeightedTranslationTwistedCentralFrequencyimport OAI.Combinatorics.Progressions.Lattices.NativeIntegerAffinePullbackHomimport OAI.Combinatorics.Progressions.Lattices.ResidueStrideRebase
namespace OAI
section
namespace Erdos3
open scoped BigOperators
theorem detector_of_unit_detector {X : Type*} [Fintype X] (μ : FiniteProbabilityWeights X) (S : Seminorm ℂ (X → ℂ)) (atoms : Set (X → ℂ)) {R δ β : ℝ} (hR : 0 < R) (hdetect : ∀ g : X → ℂ, (∀ x, ‖g x‖ ≤ 1) → δ / R ≤ S g → ∃ Q ∈ atoms, β ≤ ‖μ.correlation g Q‖) (f : X → ℂ) (hf : ∀ x, ‖f x‖ ≤ R) (hS : δ ≤ S f) : ∃ Q ∈ atoms, R * β ≤ ‖μ.correlation f Q‖ := by let g : X → ℂ := (R : ℂ)⁻¹ • f have hg (x : X) : ‖g x‖ ≤ 1 := by change ‖(R : ℂ)⁻¹ * f x‖ ≤ 1 rw [norm_mul, norm_inv, Complex.norm_real, Real.norm_of_nonneg hR.le] calc R⁻¹ * ‖f x‖ ≤ R⁻¹ * R := mul_le_mul_of_nonneg_left (hf x) (inv_nonneg.mpr hR.le) _ = 1 := inv_mul_cancel₀ hR.ne' have hSg : δ / R ≤ S g := by dsimp only [g] rw [map_smul_eq_mul, norm_inv, Complex.norm_real, Real.norm_of_nonneg hR.le] simpa only [div_eq_mul_inv, mul_comm] using mul_le_mul_of_nonneg_left hS (inv_nonneg.mpr hR.le) obtain ⟨Q, hQ, hcorr⟩ := hdetect g hg hSg have heq : μ.correlation g Q = (R : ℂ)⁻¹ * μ.correlation f Q := by simp only [FiniteProbabilityWeights.correlation, g, Pi.smul_apply, smul_eq_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ ring rw [heq, norm_mul, norm_inv, Complex.norm_real, Real.norm_of_nonneg hR.le] at hcorr refine ⟨Q, hQ, ?_⟩ have h := mul_le_mul_of_nonneg_left hcorr hR.le simpa only [← mul_assoc, mul_inv_cancel₀ hR.ne', one_mul] using h
end Erdos3
end
section
namespace Erdos3
open scoped TensorProduct BigOperators
structure NativeSampleCorrelation {σ X : Type*} (w : σ → ℕ) (degree : ℕ) (p : ℝ) (S : Finset X) (sample : X → σ → ℤ) (f : X → ℂ) where L : Type [lie : LieRing L] [algebra : LieAlgebra ℚ L] dim : ℕ [topology : TopologicalSpace (ℝ ⊗[ℚ] L)] [topologicalAdd : IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [continuousSMul : ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [hausdorff : T2Space (ℝ ⊗[ℚ] L)] model : RationalFilteredNilmanifold L degree dim test : model.Niltest w complexity : test.ComplexityLE p correlation : Real.exp (-p) ≤ ‖𝔼 x ∈ S, f x * star (test.eval (sample x))‖
attribute [local instance] NativeSampleCorrelation.lie NativeSampleCorrelation.algebra NativeSampleCorrelation.topology NativeSampleCorrelation.topologicalAdd NativeSampleCorrelation.continuousSMul NativeSampleCorrelation.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
namespace NativeSampleCorrelation
variable {σ X : Type*} {w : σ → ℕ} {s : ℕ} {p q : ℝ} {S : Finset X} {sample : X → σ → ℤ} {f : X → ℂ}
noncomputable def mono (V : NativeSampleCorrelation w s p S sample f) (hpq : p ≤ q) : NativeSampleCorrelation w s q S sample f := { V with complexity := V.complexity.mono hpq correlation := (Real.exp_le_exp.mpr (neg_le_neg hpq)).trans V.correlation }
theorem exists_of_expansion {eta : (σ → ℤ) → ℂ} (E : NativeIntegerExpansion w s p eta) (hq : 0 ≤ q) (hcorr : Real.exp (-q) ≤ ‖𝔼 x ∈ S, f x * star (eta (sample x))‖) : Nonempty (NativeSampleCorrelation w s (q + p) S sample f) := by obtain ⟨i, hi⟩ := E.select_sample_correlation S sample f hcorr exact ⟨{ L := E.L i dim := E.dim i model := E.model i test := E.test i complexity := (E.complexity i).mono (le_add_of_nonneg_left hq) correlation := hi }⟩
end NativeSampleCorrelation
end Erdos3
end
section
namespace Erdos3
open scoped TensorProduct Pointwise BigOperators
structure NativeSampleModel {σ X : Type*} (w : σ → ℕ) (degree : ℕ) (p : ℝ) (sample : X → σ → ℤ) (f : X → ℂ) where L : Type [lie : LieRing L] [algebra : LieAlgebra ℚ L] dim : ℕ [topology : TopologicalSpace (ℝ ⊗[ℚ] L)] [topologicalAdd : IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [continuousSMul : ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [hausdorff : T2Space (ℝ ⊗[ℚ] L)] model : RationalFilteredNilmanifold L degree dim test : model.Niltest w norm : test.normBound ≤ 1 complexity : test.ComplexityLE p eval : ∀ x, f x = test.eval (sample x)
attribute [local instance] NativeSampleModel.lie NativeSampleModel.algebra NativeSampleModel.topology NativeSampleModel.topologicalAdd NativeSampleModel.continuousSMul NativeSampleModel.hausdorff NativeSampleCorrelation.lie NativeSampleCorrelation.algebra NativeSampleCorrelation.topology NativeSampleCorrelation.topologicalAdd NativeSampleCorrelation.continuousSMul NativeSampleCorrelation.hausdorff
variable {σ X : Type*} {w : σ → ℕ} {degree : ℕ} {p : ℝ} {sample : X → σ → ℤ} {f : X → ℂ}
noncomputable def NativeSampleModel.constOne (hp : 2 ≤ p) : NativeSampleModel w degree p sample (fun _ => 1) where L := RationalTorus.Algebra 0 dim := 0 model := RationalTorus.trivialNilmanifold degree test := RationalFilteredNilmanifold.Niltest.const (RationalTorus.trivialNilmanifold degree) w 1 norm := by simp [RationalFilteredNilmanifold.Niltest.const] complexity := RationalTorus.trivialNilmanifold_const_one_complexity degree w hp eval _ := rfl
noncomputable def NativeSampleCorrelation.ofMean {S : Finset X} (hp : 2 ≤ p) (hmean : Real.exp (-p) ≤ ‖𝔼 x ∈ S, f x‖) : NativeSampleCorrelation w degree p S sample f where L := RationalTorus.Algebra 0 dim := 0 model := RationalTorus.trivialNilmanifold degree test := RationalFilteredNilmanifold.Niltest.const (RationalTorus.trivialNilmanifold degree) w 1 complexity := RationalTorus.trivialNilmanifold_const_one_complexity degree w hp correlation := by simpa only [RationalFilteredNilmanifold.Niltest.eval_const, star_one, mul_one] using hmean
noncomputable def NativeSampleModel.smul (F : NativeSampleModel w degree p sample f) (c : ℂ) (hc : ‖c‖ ≤ 1) : NativeSampleModel w degree p sample (c • f) where L := F.L dim := F.dim model := F.model test := F.test.scaleComplex c norm := (F.test.scaleComplex_norm hc).trans F.norm complexity := F.test.scaleComplex_complexity hc F.complexity eval x := by change c * f x = c * F.test.eval (sample x); rw [F.eval]
theorem NativeSampleModel.norm_le (F : NativeSampleModel w degree p sample f) (x : X) : ‖f x‖ ≤ 1 := by rw [F.eval] exact (F.test.norm_eval_le _).trans F.norm
noncomputable def NativeSampleCorrelation.toSampleModel {S : Finset X} (V : NativeSampleCorrelation w degree p S sample f) (hV : V.test.normBound ≤ 1) : NativeSampleModel w degree p sample (fun x => V.test.eval (sample x)) where L := V.L dim := V.dim model := V.model test := V.test norm := hV complexity := V.complexity eval _ := rfl
def twistedNativeSampleFunctions {I : Type*} (w : σ → ℕ) (degree : ℕ) (p : ℝ) (sample : X → σ → ℤ) (twist : I → X → ℂ) : Set (X → ℂ) := {f | f = 0 ∨ ∃ i g, Nonempty (NativeSampleModel w degree p sample g) ∧ f = fun x => star (twist i x) * g x}
theorem twistedNativeSampleFunctions_zero {I : Type*} (twist : I → X → ℂ) : (0 : X → ℂ) ∈ twistedNativeSampleFunctions w degree p sample twist := Or.inl rfl
theorem twistedNativeSampleFunctions_balanced {I : Type*} (twist : I → X → ℂ) : Balanced ℂ (twistedNativeSampleFunctions w degree p sample twist) := by rintro c hc _ ⟨f, hf, rfl⟩ rcases hf with rfl | ⟨i, g, ⟨G⟩, rfl⟩ · exact Or.inl (smul_zero c) · refine Or.inr ⟨i, c • g, ⟨G.smul c hc⟩, ?_⟩ funext x simp only [Pi.smul_apply, smul_eq_mul] ring
theorem twistedNativeSampleFunctions_norm {I : Type*} (twist : I → X → ℂ) (htwist : ∀ i x, ‖twist i x‖ ≤ 1) (hf : f ∈ twistedNativeSampleFunctions w degree p sample twist) (x : X) : ‖f x‖ ≤ 1 := by rcases hf with rfl | ⟨i, g, ⟨G⟩, rfl⟩ · simp · rw [norm_mul, norm_star] exact (mul_le_of_le_one_left (norm_nonneg _) (htwist i x)).trans (G.norm_le x)
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators
attribute [local instance] NativeSampleCorrelation.lie NativeSampleCorrelation.algebra NativeSampleCorrelation.topology NativeSampleCorrelation.topologicalAdd NativeSampleCorrelation.continuousSMul NativeSampleCorrelation.hausdorff
theorem nativeCorrelation_restrict_model {A σ : Type*} (S : Finset A) (hS : S.Nonempty) (w : σ → ℕ) (degree : ℕ) (p : ℝ) (sample : A → σ → ℤ) (f twist : A → ℂ) (V : NativeSampleCorrelation w degree p S sample (fun x => f x * twist x)) (hV : V.test.normBound ≤ 1) : ∃ G : S → ℂ, Nonempty (NativeSampleModel w degree p (fun x => sample x.val) G) ∧ Real.exp (-p) ≤ ‖(FiniteProbabilityWeights.uniformFinset S hS).correlation (fun x => f x.val) (fun x => star (twist x.val) * G x)‖ := by let G : S → ℂ := fun x => V.test.eval (sample x.val) refine ⟨G, ⟨?_⟩, ?_⟩ · exact { L := V.L dim := V.dim model := V.model test := V.test norm := hV complexity := V.complexity eval := fun _ => rfl } have hc := V.correlation rw [← FiniteProbabilityWeights.uniformFinset_complexMean S hS (fun x => (f x * twist x) * star (V.test.eval (sample x)))] at hc simpa only [G, FiniteProbabilityWeights.correlation, FiniteProbabilityWeights.complexMean, star_mul, star_star, mul_assoc, mul_left_comm, mul_comm] using hc
theorem nativeCorrelation_finite_site_model {A σ : Type*} (S : Finset A) (hS : S.Nonempty) [Nonempty S] (w : σ → ℕ) (degree : ℕ) (p : ℝ) (sample : A → σ → ℤ) (g : S → ℂ) (twist : A → ℂ) (V : NativeSampleCorrelation w degree p S sample (fun x => finiteSiteExtension Subtype.val g x * twist x)) (hV : V.test.normBound ≤ 1) : ∃ G : S → ℂ, Nonempty (NativeSampleModel w degree p (fun x => sample x.val) G) ∧ Real.exp (-p) ≤ ‖(FiniteProbabilityWeights.uniformFinset S hS).correlation g (fun x => star (twist x.val) * G x)‖ := by obtain ⟨G, hG, hc⟩ := nativeCorrelation_restrict_model S hS w degree p sample (finiteSiteExtension Subtype.val g) twist V hV refine ⟨G, hG, ?_⟩ simpa only [finiteSiteExtension_apply Subtype.val Subtype.val_injective] using hc
end Erdos3
end
section
namespace Erdos3
open scoped TensorProduct
theorem commonStridePoint_index_of_mem {I : Type*} [Fintype I] [DecidableEq I] (c : I → ℤ) (m : ℕ) (len : I → ℕ) {y : I → ℤ} (hy : y ∈ commonStrideBox c m len) : commonStridePoint c m (commonStrideIndex c m y) = y := by rw [commonStrideBox_eq_image] at hy obtain ⟨x, _, rfl⟩ := Finset.mem_image.mp hy change commonStridePoint c m (commonStrideIndex c m (commonStridePoint c m x)) = commonStridePoint c m x by_cases hm : m = 0 · subst m funext i change c i + (0 : ℤ) * _ = c i + (0 : ℤ) * x i simp only [zero_mul, add_zero] · rw [commonStrideIndex_point c (Nat.pos_of_ne_zero hm)]
namespace RationalFilteredNilmanifold.Niltest
variable {I L : Type*} [Fintype I] [DecidableEq I] [LieRing L] [LieAlgebra ℚ L] [TopologicalSpace (ℝ ⊗[ℚ] L)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [T2Space (ℝ ⊗[ℚ] L)] {degree dim : ℕ} {D : RationalFilteredNilmanifold L degree dim}
noncomputable def commonStridePullback (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) : D.Niltest (fun _ : I => 1) := T.affinePullback (residueStepMatrix (fun _ : I => m)) c
@[simp] theorem commonStridePullback_observable (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) : (T.commonStridePullback c m).observable = T.observable := rfl
@[simp] theorem commonStridePullback_normBound (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) : (T.commonStridePullback c m).normBound = T.normBound := rfl
@[simp] theorem commonStridePullback_lipBound (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) : (T.commonStridePullback c m).lipBound = T.lipBound := rfl
@[simp] theorem commonStridePullback_complexityLE (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) (p : ℝ) : (T.commonStridePullback c m).ComplexityLE p ↔ T.ComplexityLE p := Iff.rfl
theorem commonStridePullback_eval (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) (x : I → ℤ) : (T.commonStridePullback c m).eval x = T.eval (commonStridePoint c m x) := by rw [commonStridePullback, eval_affinePullback, integerAffineMap_residueStepMatrix] rfl
theorem commonStridePullback_eval_index_of_modEq (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) (y : I → ℤ) (hy : ∀ i, y i ≡ c i [ZMOD (m : ℤ)]) : (T.commonStridePullback c m).eval (commonStrideIndex c m y) = T.eval y := by rw [commonStridePullback_eval, commonStridePoint_index_of_modEq c m y hy]
theorem commonStridePullback_eval_index_of_mem (T : D.Niltest (fun _ : I => 1)) (c : I → ℤ) (m : ℕ) (len : I → ℕ) (y : I → ℤ) (hy : y ∈ commonStrideBox c m len) : (T.commonStridePullback c m).eval (commonStrideIndex c m y) = T.eval y := by rw [commonStridePullback_eval, commonStridePoint_index_of_mem c m len hy]
end RationalFilteredNilmanifold.Niltest
namespace RationalFilteredNilmanifold.Niltest
variable {I Ω : Type*} {L : Type} [Fintype I] [DecidableEq I] [LieRing L] [LieAlgebra ℚ L] [TopologicalSpace (ℝ ⊗[ℚ] L)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [T2Space (ℝ ⊗[ℚ] L)] {degree dim : ℕ} {D : RationalFilteredNilmanifold L degree dim} {p : ℝ}
noncomputable def commonStrideSampleModelOfModEq (T : D.Niltest (fun _ : I => 1)) (hnorm : T.normBound ≤ 1) (hcomplexity : T.ComplexityLE p) (c : I → ℤ) (m : ℕ) (site : Ω → I → ℤ) (hsite : ∀ x i, site x i ≡ c i [ZMOD (m : ℤ)]) : NativeSampleModel (fun _ : I => 1) degree p (fun x => commonStrideIndex c m (site x)) (fun x => T.eval (site x)) where L := L dim := dim model := D test := T.commonStridePullback c m norm := hnorm complexity := hcomplexity eval x := (T.commonStridePullback_eval_index_of_modEq c m (site x) (hsite x)).symm
noncomputable def commonStrideSampleModel (T : D.Niltest (fun _ : I => 1)) (hnorm : T.normBound ≤ 1) (hcomplexity : T.ComplexityLE p) (c : I → ℤ) (m : ℕ) (len : I → ℕ) : NativeSampleModel (fun _ : I => 1) degree p (fun y : commonStrideBox c m len => commonStrideIndex c m y.val) (fun y => T.eval y.val) where L := L dim := dim model := D test := T.commonStridePullback c m norm := hnorm complexity := hcomplexity eval y := (T.commonStridePullback_eval_index_of_mem c m len y.val y.property).symm
noncomputable def residueSliceSampleModel (T : D.Niltest (fun _ : I => 1)) (hnorm : T.normBound ≤ 1) (hcomplexity : T.ComplexityLE p) {N : I → ℕ} {m : ℕ} (slice : ResidueBoxSlice N m) : NativeSampleModel (fun _ : I => 1) degree p (fun y : slice.integerPoints => commonStrideIndex (fun i => (slice.start i : ℤ)) m y.val) (fun y => T.eval y.val) where L := L dim := dim model := D test := T.commonStridePullback (fun i => (slice.start i : ℤ)) m norm := hnorm complexity := hcomplexity eval y := by apply (T.commonStridePullback_eval_index_of_mem (fun i => (slice.start i : ℤ)) m slice.length y.val _).symm rw [← slice.integerPoints_eq_commonStrideBox] exact y.property
end RationalFilteredNilmanifold.Niltest
end Erdos3
end
section
namespace Erdos3.NativeSampleModel
open CircleFourieropen scoped TensorProduct BigOperators
attribute [local instance] NativeSampleModel.lie NativeSampleModel.algebra NativeSampleModel.topology NativeSampleModel.topologicalAdd NativeSampleModel.continuousSMul NativeSampleModel.hausdorff
variable {σ X : Type*} {w : σ → ℕ} {degree : ℕ} {p : ℝ} {sample : X → σ → ℤ} {f : X → ℂ}
structure VerticalExpansion (native : NativeSampleModel w degree p sample f) (q rho : ℝ) where I : Type [finite : Fintype I] frequency : I → native.L →ₗ[ℚ] ℚ component : I → native.model.Niltest w card_le : (Fintype.card I : ℝ) ≤ Real.exp (verticalDecompositionBudget q) height_le : ∀ i j, rationalLogHeight (frequency i (native.model.basis j)) ≤ verticalDecompositionBudget q orbit_eq : ∀ i, (component i).orbit = native.test.orbit norm_eq : ∀ i, (component i).normBound = native.test.normBound lip_eq : ∀ i, (component i).lipBound = native.test.lipBound vertical : ∀ i (z : native.model.RealGroup), z ∈ native.model.filtration.realification.subgroup degree → ∀ x, (component i).observable (z • x) = character ((realifyFunctional (frequency i) z.coord : ℝ) : CircleFourier.Circle) * (component i).observable x integral : ∀ i, (∃ x, (component i).observable x ≠ 0) → ∀ z : native.model.RealGroup, z ∈ native.model.filtration.realification.subgroup degree → z ∈ native.model.realLattice → ∃ n : ℤ, realifyFunctional (frequency i) z.coord = n preserves_character : ∀ (z : native.model.RealGroup) (c : ℂ), (∀ x, native.test.observable (z • x) = c * native.test.observable x) → ∀ i x, (component i).observable (z • x) = c * (component i).observable x observable_error : ∀ x, ‖(∑ i, (component i).observable x) - native.test.observable x‖ ≤ rho
attribute [instance] VerticalExpansion.finite
theorem exists_verticalExpansion (native : NativeSampleModel w degree p sample f) {q rho : ℝ} (hq : 0 ≤ q) (hpq : p ≤ q) (hrho : 0 < rho) (hrhoq : rho⁻¹ ≤ Real.exp q) : Nonempty (native.VerticalExpansion q rho) := by obtain ⟨I, inst, frequency, component, hcard, hheight, hcert, hvert, hint, hpres, herr, _⟩ := native.test.exists_vertical_decomposition_preserving_bounds_and_characters hq (native.complexity.mono hpq) hrho hrhoq exact ⟨{ I := I finite := inst frequency := frequency component := component card_le := hcard height_le := hheight orbit_eq := fun i => (hcert i).2.1 norm_eq := fun i => (hcert i).2.2.1 lip_eq := fun i => (hcert i).2.2.2 vertical := hvert integral := hint preserves_character := hpres observable_error := herr }⟩
theorem exists_verticalExpansion_exp_error (native : NativeSampleModel w degree p sample f) {r : ℝ} (hp : 0 ≤ p) (hr : 0 ≤ r) : Nonempty (native.VerticalExpansion (p + r) (Real.exp (-r))) := by apply native.exists_verticalExpansion (add_nonneg hp hr) (le_add_of_nonneg_right hr) (Real.exp_pos _) rw [Real.exp_neg, inv_inv] exact Real.exp_le_exp.mpr (le_add_of_nonneg_left hp)
namespace VerticalExpansion
variable {native : NativeSampleModel w degree p sample f} {q rho : ℝ} (E : native.VerticalExpansion q rho)
theorem complexity (i : E.I) : (E.component i).ComplexityLE p := by refine ⟨native.complexity.1, ?_⟩ rw [E.norm_eq, E.lip_eq] exact native.complexity.2
theorem normBound_le (i : E.I) : (E.component i).normBound ≤ 1 := by rw [E.norm_eq] exact native.norm
theorem eval_error (x : σ → ℤ) : ‖(∑ i, (E.component i).eval x) - native.test.eval x‖ ≤ rho := by simpa only [RationalFilteredNilmanifold.Niltest.eval, E.orbit_eq] using E.observable_error (QuotientGroup.mk (native.model.filtration.realification.polynomialOrbitEval w x native.test.orbit))
theorem evalReal_error (x : σ → ℝ) : ‖(∑ i, (E.component i).evalReal x) - native.test.evalReal x‖ ≤ rho := by simpa only [RationalFilteredNilmanifold.Niltest.evalReal, E.orbit_eq] using E.observable_error (QuotientGroup.mk (native.model.filtration.realification.polynomialOrbitRealEval w x native.test.orbit))
theorem sample_error (x : X) : ‖(∑ i, (E.component i).eval (sample x)) - f x‖ ≤ rho := by rw [native.eval] exact E.eval_error (sample x)
theorem norm_eval_le (i : E.I) (x : σ → ℤ) : ‖(E.component i).eval x‖ ≤ 1 := ((E.component i).norm_eval_le x).trans (E.normBound_le i)
theorem norm_evalReal_le (i : E.I) (x : σ → ℝ) : ‖(E.component i).evalReal x‖ ≤ 1 := ((E.component i).norm_evalReal_le x).trans (E.normBound_le i)
noncomputable def sampleModel (i : E.I) : NativeSampleModel w degree p sample (fun x => (E.component i).eval (sample x)) where L := native.L dim := native.dim model := native.model test := E.component i norm := E.normBound_le i complexity := E.complexity i eval _ := rfl
theorem coefficient_mass : (∑ _i : E.I, ‖(1 : ℂ)‖) ≤ Real.exp (verticalDecompositionBudget q) := by simpa using E.card_le
end VerticalExpansionend Erdos3.NativeSampleModel
end
section
namespace Erdos3
open scoped BigOperators
theorem exists_sampled_native_model {Ω T X σ I : Type*} [Fintype Ω] [Fintype T] [Nonempty T] [Fintype X] {J : Ω → Type*} [∀ z, Nonempty (J z)] (μ : FiniteProbabilityWeights Ω) (F : Ω → T → X) (slices : ∀ z, J z → Finset T) (tests : ∀ z, J z → T → ℂ) (r : FiniteProbabilityWeights X) (hr : ∀ x, 0 < r.weight x) (w : σ → ℕ) (degree : ℕ) (complexity : ℝ) (sample : X → σ → ℤ) (twist : I → X → ℂ) (htwist : ∀ i x, ‖twist i x‖ ≤ 1) {K C B beta tau ε : ℝ} (hK : 0 ≤ K) (hC : 0 ≤ C) (hB : 0 < B) (hbeta : 0 < beta) (htau : 0 < tau) (hsize : ∀ z j, (Fintype.card T : ℝ) / (slices z j).card ≤ K) (htests : ∀ z j t, ‖tests z j t‖ ≤ 1) (hdetect : ∀ g : X → ℂ, (∀ x, ‖g x‖ ≤ 1) → (tau / B ^ 2) / max 1 (K * (2 * C) / tau) ≤ sampledSliceSeminorm μ F slices tests g → ∃ (i : I) (G : X → ℂ), Nonempty (NativeSampleModel w degree complexity sample G) ∧ beta ≤ ‖r.correlation g (fun x => star (twist i x) * G x)‖) (hexcess : r.excessMass (μ.siteLaw F) C ≤ ε) (b : X → ℂ) (hb : ∀ x, ‖b x‖ ≤ B) : ∃ (n : ℕ) (_ : 0 < n) (Q : Fin n → (X → ℂ)) (c : Fin n → ℝ) (e : X → ℂ), (∀ i, Q i ∈ twistedNativeSampleFunctions w degree complexity sample twist) ∧ b = (∑ i, c i • Q i) + e ∧ (∑ i, |c i|) ≤ 2 / beta ∧ sampledSliceSeminorm μ F slices tests e ≤ 2 * tau + 2 * K * (B + 2 / beta) * ε ∧ (n : ℝ) ≤ 1 + 4 * (K * (2 * C)) ^ 2 / (beta ^ 2 * tau ^ 2) := by let atoms := twistedNativeSampleFunctions w degree complexity sample twist let cap := max 1 (K * (2 * C) / tau) have hcap : 1 ≤ cap := le_max_left _ _ have hdetector (g : X → ℂ) (hg : ∀ x, ‖g x‖ ≤ K * (2 * C) / tau) (hlarge : tau / B ^ 2 ≤ sampledSliceSeminorm μ F slices tests g) : ∃ Q ∈ atoms, beta ≤ ‖r.correlation g Q‖ := by have hunit (v : X → ℂ) (hv : ∀ x, ‖v x‖ ≤ 1) (hX : (tau / B ^ 2) / cap ≤ sampledSliceSeminorm μ F slices tests v) : ∃ Q ∈ atoms, beta ≤ ‖r.correlation v Q‖ := by obtain ⟨i, G, hG, hcorr⟩ := hdetect v hv hX exact ⟨_, Or.inr ⟨i, G, hG, rfl⟩, hcorr⟩ obtain ⟨Q, hQ, hc⟩ := detector_of_unit_detector r (sampledSliceSeminorm μ F slices tests) atoms (lt_of_lt_of_le zero_lt_one hcap) hunit g (fun x => (hg x).trans (le_max_right _ _)) hlarge have hscale : beta ≤ cap * beta := by simpa only [one_mul] using mul_le_mul_of_nonneg_right hcap hbeta.le exact ⟨Q, hQ, hscale.trans hc⟩ exact exists_sampled_slice_model μ F slices tests r hr (twistedNativeSampleFunctions_balanced twist) ⟨0, twistedNativeSampleFunctions_zero twist⟩ (fun Q hQ x => twistedNativeSampleFunctions_norm twist htwist hQ x) hK hC hB hbeta htau hsize htests hdetector hexcess b hb
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120import OAI.Combinatorics.Progressions.Estimates.SampledNativeModel
namespace OAI
section
namespace Erdos3open scoped BigOperators Classical
theorem exists_fixed_sampled_slice_model_partners {Ω T X K : Type*} {J : Ω → Type*} {I : K → Type*} [Fintype Ω] [Fintype T] [Nonempty T] [Fintype K] [∀ k, Fintype (I k)] [∀ k, Nonempty (I k)] (outer : FiniteProbabilityWeights Ω) (productive : Finset Ω) (physical : Ω → T → X) (slices : ∀ z, J z → Finset T) (weight : ∀ z, J z → T → ℂ) (selected : ∀ z, K → J z) (hS : ∀ z j, (slices z j).Nonempty) {cap : ℝ} (hsize : ∀ z j, (Fintype.card T : ℝ) / (slices z j).card ≤ cap) (hweight : ∀ z j t, ‖weight z j t‖ ≤ 1) (v e : K → X → ℂ) (Q : ∀ k, I k → X → ℂ) (c : ∀ k, I k → ℂ) (hmodel : ∀ k, v k = (∑ i, c k i • Q k i) + e k) {delta M kappa : ℝ} (hdelta : 0 < delta) (hM : 0 < M) (hc : ∀ k, (∑ i, ‖c k i‖) ≤ M) (hproductive : kappa ≤ outer.mass productive) (herror : (∑ k, sampledSliceSeminorm outer physical slices weight (e k)) ≤ kappa * delta / 8) (hscore : ∀ z ∈ productive, ∀ k, delta ≤ ‖𝔼 t ∈ slices z (selected z k), v k (physical z t) * weight z (selected z k) t‖) : ∃ (partner : ∀ k, I k) (retained : Finset Ω), retained ⊆ productive ∧ (3 * kappa / 4) / (∏ k, (Fintype.card (I k) : ℝ)) ≤ outer.mass retained ∧ ∀ z ∈ retained, ∀ k, delta / (2 * M) ≤ ‖𝔼 t ∈ slices z (selected z k), Q k (partner k) (physical z t) * weight z (selected z k) t‖ := by let W := fun z j => normalizedSliceTest (slices z j) (weight z j) let test := fun z k => sampledTestLinearMap (physical z) (W z (selected z k)) let err := fun k z => (⨆ j, sampledSingleTestSeminorm (physical z) (W z j)) (e k) have hW (z) (j) (t) : ‖W z j t‖ ≤ cap := normalizedSliceTest_norm_le _ _ (hsize z j) (hweight z j) t have htest (z) (_hz : z ∈ productive) (k) : ‖test z k (e k)‖ ≤ err k z := by change sampledSingleTestSeminorm (physical z) (W z (selected z k)) (e k) ≤ _ dsimp only [err] have hb := sampledSingleTestSeminorm_bddAbove physical W hW z rw [Seminorm.iSup_apply hb] exact le_ciSup (Seminorm.bddAbove_range_iff.mp hb (e k)) (selected z k) have hmean : (∑ k, outer.mean (err k)) ≤ kappa * (delta / 2) / 4 := by change (∑ k, sampledSliceSeminorm outer physical slices weight (e k)) ≤ _ convert herror using 1; ring have heval (z) (k) (f : X → ℂ) : test z k f = 𝔼 t ∈ slices z (selected z k), f (physical z t) * weight z (selected z k) t := normalizedSliceTest_mean _ (hS z (selected z k)) _ _ obtain ⟨partner, retained, hsub, hmass, hlocal⟩ := exists_fixed_linear_model_partners outer productive v e Q c test err hmodel hdelta hM hc (fun _ _ => apply_nonneg _ _) htest hproductive hmean (by intro z hz k; rw [heval]; exact hscore z hz k) refine ⟨partner, retained, hsub, hmass, ?_⟩ intro z hz k simpa only [heval] using hlocal z hz k
theorem exists_fixed_sampled_slice_native_partners {Ω T X K σ Θ : Type*} {J : Ω → Type*} {I : K → Type*} [Fintype Ω] [Fintype T] [Nonempty T] [Fintype K] [∀ k, Fintype (I k)] [∀ k, Nonempty (I k)] (outer : FiniteProbabilityWeights Ω) (productive : Finset Ω) (physical : Ω → T → X) (slices : ∀ z, J z → Finset T) (weight : ∀ z, J z → T → ℂ) (selected : ∀ z, K → J z) (hS : ∀ z j, (slices z j).Nonempty) {cap : ℝ} (hsize : ∀ z j, (Fintype.card T : ℝ) / (slices z j).card ≤ cap) (hweight : ∀ z j t, ‖weight z j t‖ ≤ 1) (v e : K → X → ℂ) (Q : ∀ k, I k → X → ℂ) (c : ∀ k, I k → ℂ) (hmodel : ∀ k, v k = (∑ i, c k i • Q k i) + e k) {delta M kappa : ℝ} (hdelta : 0 < delta) (hM : 0 < M) (hc : ∀ k, (∑ i, ‖c k i‖) ≤ M) (hproductive : kappa ≤ outer.mass productive) (herror : (∑ k, sampledSliceSeminorm outer physical slices weight (e k)) ≤ kappa * delta / 8) (hkappa : 0 < kappa) (w : σ → ℕ) (degree : ℕ) (budget : ℝ) (sample : X → σ → ℤ) (twist : Θ → X → ℂ) (hQ : ∀ k i, Q k i ∈ twistedNativeSampleFunctions w degree budget sample twist) (hscore : ∀ z ∈ productive, ∀ k, delta ≤ ‖𝔼 t ∈ slices z (selected z k), v k (physical z t) * weight z (selected z k) t‖) : ∃ (fixedTwist : K → Θ) (nativeValue : K → X → ℂ) (_native : ∀ k, NativeSampleModel w degree budget sample (nativeValue k)) (retained : Finset Ω), retained ⊆ productive ∧ 0 < outer.mass retained ∧ (3 * kappa / 4) / (∏ k, (Fintype.card (I k) : ℝ)) ≤ outer.mass retained ∧ ∀ z ∈ retained, ∀ k, delta / (2 * M) ≤ ‖𝔼 t ∈ slices z (selected z k), (star (twist (fixedTwist k) (physical z t)) * nativeValue k (physical z t)) * weight z (selected z k) t‖ := by obtain ⟨partner, retained, hsub, hmass, hlocal⟩ := exists_fixed_sampled_slice_model_partners outer productive physical slices weight selected hS hsize hweight v e Q c hmodel hdelta hM hc hproductive herror hscore have hmasspos : 0 < outer.mass retained := (div_pos (by positivity : 0 < 3 * kappa / 4) (Finset.prod_pos (fun k _ => Nat.cast_pos.mpr Fintype.card_pos))).trans_le hmass have hne : retained.Nonempty := Finset.nonempty_iff_ne_empty.mpr (by intro he simp only [he, FiniteProbabilityWeights.mass, Finset.sum_empty] at hmasspos linarith) obtain ⟨z₀, hz₀⟩ := hne have hchosen (k) : ∃ (t : Θ) (g : X → ℂ), Nonempty (NativeSampleModel w degree budget sample g) ∧ Q k (partner k) = fun x => star (twist t x) * g x := by rcases hQ k (partner k) with hzero | hnative · have hn := hlocal z₀ hz₀ k rw [hzero] at hn simp only [Pi.zero_apply, zero_mul] at hn have hpos : 0 < delta / (2 * M) := div_pos hdelta (by positivity) simp at hn linarith · exact hnative choose fixedTwist nativeValue hnative heq using hchosen let native := fun k => Classical.choice (hnative k) refine ⟨fixedTwist, nativeValue, native, retained, hsub, hmasspos, hmass, ?_⟩ intro z hz k simpa only [heq k] using hlocal z hz k
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599import Mathlib.Algebra.EuclideanDomain.Intimport Mathlib.Basic.Real.Basicimport Mathlib.LinearAlgebra.Basis.Prodimport Mathlib.LinearAlgebra.FreeModule.PIDimport Mathlib.LinearAlgebra.LinearIndependent.Lemmasimport Mathlib.LinearAlgebra.Projection
namespace OAI
section
namespace Erdos3.IntegerBasisReduction.SaturatedFlag
open scoped BigOperatorsopen Function Set Submoduleopen Module
variable {M : Type*} [AddCommGroup M]
def IsSaturated (P : Submodule ℤ M) : Prop := ∀ (a : ℤ) (x : M), a ≠ 0 → a • x ∈ P → x ∈ P
def IsAdaptedTo {κ : Type*} (b : Basis κ ℤ M) (P : Submodule ℤ M) : Prop := ∃ s : Set κ, P = Submodule.span ℤ (b '' s)
@[simp] theorem isSaturated_bot [Module.IsTorsionFree ℤ M] : IsSaturated (⊥ : Submodule ℤ M) := by intro a x ha hx rw [Submodule.mem_bot] at hx ⊢ exact (smul_eq_zero.mp hx).resolve_left ha
@[simp] theorem isSaturated_top : IsSaturated (⊤ : Submodule ℤ M) := by intro _ _ _ _ exact Submodule.mem_top
theorem IsSaturated.comap_subtype {P O : Submodule ℤ M} (hP : IsSaturated P) (_hPO : P ≤ O) : IsSaturated (P.comap O.subtype) := by intro a x ha hx change (a • (x : M)) ∈ P at hx change (x : M) ∈ P exact hP a x ha hx
theorem IsSaturated.comap_subtype_of_le {P O : Submodule ℤ M} (hP : IsSaturated P) (hPO : P ≤ O) : IsSaturated (P.comap O.subtype) := hP.comap_subtype hPO
def rationalEmbed (d : ℕ) : (Fin d → ℤ) →ₗ[ℤ] (Fin d → ℚ) where toFun x i := (x i : ℚ) map_add' x y := by ext i simp map_smul' a x := by ext i simp
@[simp] theorem rationalEmbed_apply {d : ℕ} (x : Fin d → ℤ) (i : Fin d) : rationalEmbed d x i = (x i : ℚ) := rfl
theorem rationalEmbed_zsmul {d : ℕ} (a : ℤ) (x : Fin d → ℤ) : rationalEmbed d (a • x) = (a : ℚ) • rationalEmbed d x := by ext i simp [rationalEmbed]
def rationalSpanLattice {d : ℕ} (S : Set (Fin d → ℤ)) : Submodule ℤ (Fin d → ℤ) := ((Submodule.span ℚ (rationalEmbed d '' S)).restrictScalars ℤ).comap (rationalEmbed d)
@[simp] theorem mem_rationalSpanLattice {d : ℕ} {S : Set (Fin d → ℤ)} {x : Fin d → ℤ} : x ∈ rationalSpanLattice S ↔ rationalEmbed d x ∈ Submodule.span ℚ (rationalEmbed d '' S) := Iff.rfl
theorem isSaturated_rationalSpanLattice {d : ℕ} (S : Set (Fin d → ℤ)) : IsSaturated (rationalSpanLattice S) := by intro a x ha hx rw [mem_rationalSpanLattice] at hx ⊢ have hax : (a : ℚ) • rationalEmbed d x ∈ Submodule.span ℚ (rationalEmbed d '' S) := by rw [← rationalEmbed_zsmul] exact hx have hinv := (Submodule.span ℚ (rationalEmbed d '' S)).smul_mem (a : ℚ)⁻¹ hax simpa [smul_smul, ha] using hinv
theorem rationalSpanLattice_mono {d : ℕ} {S T : Set (Fin d → ℤ)} (hST : S ⊆ T) : rationalSpanLattice S ≤ rationalSpanLattice T := by intro x hx rw [mem_rationalSpanLattice] at hx ⊢ exact Submodule.span_mono (Set.image_mono hST) hx
def realEmbed (d : ℕ) : (Fin d → ℤ) →ₗ[ℤ] (Fin d → ℝ) where toFun x i := (x i : ℝ) map_add' x y := by ext i simp map_smul' a x := by ext i simp
@[simp] theorem realEmbed_apply {d : ℕ} (x : Fin d → ℤ) (i : Fin d) : realEmbed d x i = (x i : ℝ) := rfl
theorem realEmbed_zsmul {d : ℕ} (a : ℤ) (x : Fin d → ℤ) : realEmbed d (a • x) = (a : ℝ) • realEmbed d x := by ext i simp [realEmbed]
def realPrefixLattice {d n : ℕ} (x : Fin n → (Fin d → ℤ)) (i : Fin n) : Submodule ℤ (Fin d → ℤ) := ((Submodule.span ℝ (realEmbed d '' (x '' Set.Iic i))).restrictScalars ℤ).comap (realEmbed d)
@[simp] theorem mem_realPrefixLattice {d n : ℕ} {x : Fin n → (Fin d → ℤ)} {i : Fin n} {z : Fin d → ℤ} : z ∈ realPrefixLattice x i ↔ realEmbed d z ∈ Submodule.span ℝ (realEmbed d '' (x '' Set.Iic i)) := Iff.rfl
theorem isSaturated_realPrefixLattice {d n : ℕ} (x : Fin n → (Fin d → ℤ)) (i : Fin n) : IsSaturated (realPrefixLattice x i) := by intro a z ha hz rw [mem_realPrefixLattice] at hz ⊢ have haz : (a : ℝ) • realEmbed d z ∈ Submodule.span ℝ (realEmbed d '' (x '' Set.Iic i)) := by rw [← realEmbed_zsmul] exact hz have hinv := (Submodule.span ℝ (realEmbed d '' (x '' Set.Iic i))).smul_mem (a : ℝ)⁻¹ haz simpa [smul_smul, ha] using hinv
theorem monotone_realPrefixLattice {d n : ℕ} (x : Fin n → (Fin d → ℤ)) : Monotone (realPrefixLattice x) := by intro i j hij z hz rw [mem_realPrefixLattice] at hz ⊢ apply Submodule.span_mono (Set.image_mono (Set.image_mono ?_)) hz intro k hk exact hk.trans hij
theorem self_mem_realPrefixLattice {d n : ℕ} (x : Fin n → (Fin d → ℤ)) (i : Fin n) : x i ∈ realPrefixLattice x i := by rw [mem_realPrefixLattice] apply Submodule.subset_span exact ⟨x i, ⟨i, Set.mem_Iic.mpr le_rfl, rfl⟩, rfl⟩
section Smith
variable {ι : Type*} [Finite ι]
omit [Finite ι] in
theorem smithVector_mem_of_isSaturated (_b : Basis ι ℤ M) (P : Submodule ℤ M) (hP : IsSaturated P) {n : ℕ} (snf : Basis.SmithNormalForm P ι n) (i : Fin n) : snf.bM (snf.f i) ∈ P := by classical have hai : snf.a i ≠ 0 := by intro hai apply (snf.bN.ne_zero i) apply Subtype.ext simp [snf.snf i, hai] exact hP (snf.a i) (snf.bM (snf.f i)) hai <| by simpa [snf.snf i] using (snf.bN i).property
theorem exists_isCompl_of_isSaturated (b : Basis ι ℤ M) (P : Submodule ℤ M) (hP : IsSaturated P) : ∃ Q : Submodule ℤ M, IsCompl P Q := by classical let snf := P.smithNormalForm b let selected : Set ι := Set.range snf.2.f let Q : Submodule ℤ M := Submodule.span ℤ (snf.2.bM '' selectedᶜ) have hselected : P = Submodule.span ℤ (snf.2.bM '' selected) := by apply le_antisymm · intro x hx let xp : P := ⟨x, hx⟩ have hxp : xp ∈ Submodule.span ℤ (Set.range snf.2.bN) := by rw [snf.2.bN.span_eq] exact Submodule.mem_top exact Submodule.span_induction (R := ℤ) (s := Set.range snf.2.bN) (p := fun y _ ↦ (y : M) ∈ Submodule.span ℤ (snf.2.bM '' selected)) (fun y hy ↦ by obtain ⟨i, rfl⟩ := hy rw [snf.2.snf i] apply Submodule.smul_mem apply Submodule.subset_span exact ⟨snf.2.f i, ⟨i, rfl⟩, rfl⟩) (Submodule.zero_mem _) (fun _ _ _ _ hy hz ↦ Submodule.add_mem _ hy hz) (fun a _ _ hy ↦ Submodule.smul_mem _ a hy) hxp · refine Submodule.span_le.mpr ?_ rintro _ ⟨j, ⟨i, rfl⟩, rfl⟩ exact smithVector_mem_of_isSaturated b P hP snf.2 i refine ⟨Q, ?_⟩ rw [hselected] exact snf.2.bM.linearIndependent.isCompl_span_image snf.2.bM.span_eq (isCompl_compl)
theorem exists_basis_extending_of_isSaturated (b : Basis ι ℤ M) (P : Submodule ℤ M) (hP : IsSaturated P) {κ : Type*} (bP : Basis κ ℤ P) : ∃ (m : ℕ) (bM : Basis (κ ⊕ Fin m) ℤ M), ∀ i, bM (Sum.inl i) = (bP i : M) := by classical obtain ⟨Q, hPQ⟩ := exists_isCompl_of_isSaturated b P hP obtain ⟨m, bQ⟩ := Submodule.basisOfPid b Q let e : (P × Q) ≃ₗ[ℤ] M := P.prodEquivOfIsCompl Q hPQ let bM : Basis (κ ⊕ Fin m) ℤ M := (bP.prod bQ).map e refine ⟨m, bM, ?_⟩ intro i simp [bM, e]
theorem span_image_inl_eq_of_span_comap_eq {P R : Submodule ℤ M} (hRP : R ≤ P) {κ μ : Type*} (bP : Basis κ ℤ P) (bM : Basis (κ ⊕ μ) ℤ M) (hext : ∀ i, bM (Sum.inl i) = (bP i : M)) (s : Set κ) (hspan : R.comap P.subtype = Submodule.span ℤ (bP '' s)) : R = Submodule.span ℤ (bM '' (Sum.inl '' s)) := by have himage : P.subtype '' (bP '' s) = bM '' (Sum.inl '' s) := by ext x constructor · rintro ⟨_, ⟨i, hi, rfl⟩, rfl⟩ exact ⟨Sum.inl i, ⟨i, hi, rfl⟩, hext i⟩ · rintro ⟨_, ⟨i, hi, rfl⟩, rfl⟩ exact ⟨bP i, ⟨i, hi, rfl⟩, (hext i).symm⟩ calc R = (R.comap P.subtype).map P.subtype := (Submodule.map_comap_eq_self (by simpa [Submodule.range_subtype] using hRP)).symm _ = (Submodule.span ℤ (bP '' s)).map P.subtype := by rw [hspan] _ = Submodule.span ℤ (P.subtype '' (bP '' s)) := by rw [Submodule.map_span] _ = Submodule.span ℤ (bM '' (Sum.inl '' s)) := by rw [himage]
theorem span_range_inl_prod_eq {P Q : Submodule ℤ M} (hPQ : IsCompl P Q) {κ μ : Type*} (bP : Basis κ ℤ P) (bQ : Basis μ ℤ Q) : let bM := (bP.prod bQ).map (P.prodEquivOfIsCompl Q hPQ) P = Submodule.span ℤ (bM '' Set.range Sum.inl) := by classical let bM := (bP.prod bQ).map (P.prodEquivOfIsCompl Q hPQ) apply le_antisymm · intro x hx let xp : P := ⟨x, hx⟩ have hxp : xp ∈ Submodule.span ℤ (Set.range bP) := by rw [bP.span_eq] exact Submodule.mem_top exact Submodule.span_induction (R := ℤ) (s := Set.range bP) (p := fun y _ ↦ (y : M) ∈ Submodule.span ℤ (bM '' Set.range Sum.inl)) (fun y hy ↦ by obtain ⟨i, rfl⟩ := hy apply Submodule.subset_span refine ⟨Sum.inl i, ⟨i, rfl⟩, ?_⟩ simp [bM]) (Submodule.zero_mem _) (fun _ _ _ _ hy hz ↦ Submodule.add_mem _ hy hz) (fun a _ _ hy ↦ Submodule.smul_mem _ a hy) hxp · refine Submodule.span_le.mpr ?_ rintro _ ⟨_, ⟨i, rfl⟩, rfl⟩ simp
theorem exists_basis_with_repr_eq_zero_iff (b : Basis ι ℤ M) (P : Submodule ℤ M) (hP : IsSaturated P) : ∃ (κ : Type) (_ : Fintype κ) (bM : Basis κ ℤ M) (s : Set κ), ∀ x : M, x ∈ P ↔ ∀ j ∉ s, bM.repr x j = 0 := by classical obtain ⟨Q, hPQ⟩ := exists_isCompl_of_isSaturated b P hP obtain ⟨n, bP⟩ := Submodule.basisOfPid b P obtain ⟨m, bQ⟩ := Submodule.basisOfPid b Q let e : (P × Q) ≃ₗ[ℤ] M := P.prodEquivOfIsCompl Q hPQ let bM : Basis (Fin n ⊕ Fin m) ℤ M := (bP.prod bQ).map e let s : Set (Fin n ⊕ Fin m) := Set.range Sum.inl refine ⟨Fin n ⊕ Fin m, inferInstance, bM, s, ?_⟩ intro x constructor · intro hxP j hj have hx : ((P.prodEquivOfIsCompl Q hPQ).symm x).2 = 0 := (P.prodEquivOfIsCompl_symm_apply_snd_eq_zero Q hPQ).mpr hxP cases j with | inl i => exact False.elim (hj ⟨i, rfl⟩) | inr i => change bQ.repr ((e.symm x).2) i = 0 rw [hx] simp · intro hx apply (P.prodEquivOfIsCompl_symm_apply_snd_eq_zero Q hPQ).mp apply bQ.repr.injective ext i have hi := hx (Sum.inr i) (by simp [s]) change bQ.repr ((e.symm x).2) i = 0 at hi simpa [e] using hi
end Smith
universe u
theorem exists_basis_with_nested_supports_of_saturated_flag (n : ℕ) : ∀ {N : Type u} [AddCommGroup N] {ι : Type} [Finite ι], (b₀ : Basis ι ℤ N) → (P : Fin n → Submodule ℤ N) → (∀ i, IsSaturated (P i)) → Antitone P → ∃ (κ : Type) (_ : Fintype κ) (b : Basis κ ℤ N) (s : Fin n → Set κ), Antitone s ∧ ∀ i, P i = Submodule.span ℤ (b '' s i) := by induction n with | zero => intro N _ ι _ b₀ P _ _ classical let := Fintype.ofFinite ι let b : Basis (Fin (Fintype.card ι)) ℤ N := b₀.reindex (Fintype.equivFin ι) let s : Fin 0 → Set (Fin (Fintype.card ι)) := Fin.elim0 exact ⟨Fin (Fintype.card ι), inferInstance, b, s, fun i ↦ Fin.elim0 i, fun i ↦ Fin.elim0 i⟩ | succ n ih => intro N _ ι _ b₀ P hsat hanti classical let P₀ : Submodule ℤ N := P 0 obtain ⟨p, bP₀⟩ := Submodule.basisOfPid b₀ P₀ let tail : Fin n → Submodule ℤ P₀ := fun i ↦ (P i.succ).comap P₀.subtype have htail_sat : ∀ i, IsSaturated (tail i) := by intro i apply (hsat i.succ).comap_subtype exact hanti (Fin.zero_le i.succ) have htail_anti : Antitone tail := by intro i j hij apply Submodule.comap_mono exact hanti (by simpa using hij) obtain ⟨κ, instκ, bP, sP, hsPanti, hbP⟩ := ih (N := P₀) (ι := Fin p) bP₀ tail htail_sat htail_anti let : Fintype κ := instκ obtain ⟨Q, hP₀Q⟩ := exists_isCompl_of_isSaturated b₀ P₀ (hsat 0) obtain ⟨m, bQ⟩ := Submodule.basisOfPid b₀ Q let e : (P₀ × Q) ≃ₗ[ℤ] N := P₀.prodEquivOfIsCompl Q hP₀Q let b : Basis (κ ⊕ Fin m) ℤ N := (bP.prod bQ).map e let s : Fin (n + 1) → Set (κ ⊕ Fin m) := fun i ↦ Fin.cases (Set.range Sum.inl) (fun j ↦ Sum.inl '' sP j) i refine ⟨κ ⊕ Fin m, inferInstance, b, s, ?_, ?_⟩ · intro i j hij obtain rfl | ⟨i', rfl⟩ := i.eq_zero_or_eq_succ · obtain rfl | ⟨j', rfl⟩ := j.eq_zero_or_eq_succ · exact fun _ hx ↦ hx · rintro x ⟨k, hk, rfl⟩ exact Set.mem_range.mpr ⟨k, rfl⟩ · obtain rfl | ⟨j', rfl⟩ := j.eq_zero_or_eq_succ · exact False.elim ((not_le_of_gt (Fin.succ_pos i')) hij) · exact Set.image_mono (hsPanti (by simpa using hij)) · intro i refine Fin.cases ?_ (fun j ↦ ?_) i · exact span_range_inl_prod_eq hP₀Q bP bQ · apply span_image_inl_eq_of_span_comap_eq (P := P₀) (R := P j.succ) (hanti (Fin.zero_le j.succ)) bP b (fun k ↦ by simp [b, e]) (sP j) simpa [tail, P₀] using hbP j
theorem exists_basis_adapted_to_saturated_flag (n : ℕ) {N : Type u} [AddCommGroup N] {ι : Type} [Finite ι] (b₀ : Basis ι ℤ N) (P : Fin n → Submodule ℤ N) (hsat : ∀ i, IsSaturated (P i)) (hanti : Antitone P) : ∃ (κ : Type) (_ : Fintype κ) (b : Basis κ ℤ N), ∀ i, IsAdaptedTo b (P i) := by obtain ⟨κ, instκ, b, s, _hsanti, hs⟩ := exists_basis_with_nested_supports_of_saturated_flag n b₀ P hsat hanti exact ⟨κ, instκ, b, fun i ↦ ⟨s i, hs i⟩⟩
theorem exists_basis_with_nested_supports_of_monotone_saturated_flag (n : ℕ) {N : Type u} [AddCommGroup N] {ι : Type} [Finite ι] (b₀ : Basis ι ℤ N) (P : Fin n → Submodule ℤ N) (hsat : ∀ i, IsSaturated (P i)) (hmono : Monotone P) : ∃ (κ : Type) (_ : Fintype κ) (b : Basis κ ℤ N) (s : Fin n → Set κ), Monotone s ∧ ∀ i, P i = Submodule.span ℤ (b '' s i) := by let Prev : Fin n → Submodule ℤ N := fun i ↦ P i.rev have hPrev : Antitone Prev := by intro i j hij exact hmono (Fin.rev_anti hij) obtain ⟨κ, instκ, b, t, htanti, ht⟩ := exists_basis_with_nested_supports_of_saturated_flag n b₀ Prev (fun i ↦ hsat i.rev) hPrev let s : Fin n → Set κ := fun i ↦ t i.rev refine ⟨κ, instκ, b, s, ?_, ?_⟩ · intro i j hij exact htanti (Fin.rev_anti hij) · intro i simpa [s, Prev] using ht i.rev
theorem repr_eq_zero_of_mem_span_image {N : Type*} [AddCommGroup N] {κ : Type*} (b : Basis κ ℤ N) (s : Set κ) {x : N} (hx : x ∈ Submodule.span ℤ (b '' s)) {j : κ} (hj : j ∉ s) : b.repr x j = 0 := by have hsupp := b.repr_support_subset_of_mem_span s hx by_contra hne exact hj (hsupp (Finsupp.mem_support_iff.mpr hne))
theorem exists_basis_with_nested_supports_rationalSpanLattice {d n : ℕ} (S : Fin n → Set (Fin d → ℤ)) (hS : Antitone S) : ∃ (κ : Type) (_ : Fintype κ) (b : Basis κ ℤ (Fin d → ℤ)) (s : Fin n → Set κ), Antitone s ∧ ∀ i, rationalSpanLattice (S i) = Submodule.span ℤ (b '' s i) := by let P : Fin n → Submodule ℤ (Fin d → ℤ) := fun i ↦ rationalSpanLattice (S i) have hPanti : Antitone P := by intro i j hij exact rationalSpanLattice_mono (hS hij) simpa [P] using (exists_basis_with_nested_supports_of_saturated_flag n (Pi.basisFun ℤ (Fin d)) P (fun i ↦ isSaturated_rationalSpanLattice (S i)) hPanti)
theorem exists_basis_with_nested_supports_realPrefixLattice {d n : ℕ} (x : Fin n → (Fin d → ℤ)) : ∃ (κ : Type) (_ : Fintype κ) (b : Basis κ ℤ (Fin d → ℤ)) (s : Fin n → Set κ), Monotone s ∧ ∀ i, realPrefixLattice x i = Submodule.span ℤ (b '' s i) := by exact exists_basis_with_nested_supports_of_monotone_saturated_flag n (Pi.basisFun ℤ (Fin d)) (realPrefixLattice x) (isSaturated_realPrefixLattice x) (monotone_realPrefixLattice x)
theorem exists_fin_basis_with_nested_supports_realPrefixLattice {n : ℕ} (x : Fin n → (Fin n → ℤ)) : ∃ (b : Basis (Fin n) ℤ (Fin n → ℤ)) (s : Fin n → Set (Fin n)), Monotone s ∧ (∀ i, realPrefixLattice x i = Submodule.span ℤ (b '' s i)) ∧ ∀ i j, j ∉ s i → b.repr (x i) j = 0 := by classical obtain ⟨κ, instκ, bκ, sκ, hsmono, hs⟩ := exists_basis_with_nested_supports_realPrefixLattice x let : Fintype κ := instκ let e : κ ≃ Fin n := bκ.indexEquiv (Pi.basisFun ℤ (Fin n)) let b : Basis (Fin n) ℤ (Fin n → ℤ) := bκ.reindex e let s : Fin n → Set (Fin n) := fun i ↦ e '' sκ i have himage (i : Fin n) : b '' s i = bκ '' sκ i := by ext y constructor · rintro ⟨_, ⟨k, hk, rfl⟩, rfl⟩ exact ⟨k, hk, by simp [b, e]⟩ · rintro ⟨k, hk, rfl⟩ exact ⟨e k, ⟨k, hk, rfl⟩, by simp [b, e]⟩ have hspan (i : Fin n) : realPrefixLattice x i = Submodule.span ℤ (b '' s i) := by rw [himage] exact hs i refine ⟨b, s, ?_, hspan, ?_⟩ · intro i j hij exact Set.image_mono (hsmono hij) · intro i j hj apply repr_eq_zero_of_mem_span_image b (s i) · rw [← hspan i] exact self_mem_realPrefixLattice x i · exact hj
theorem exists_prefix_adapted_basis_realPrefixLattice {n : ℕ} (x : Fin n → (Fin n → ℤ)) (hli : LinearIndependent ℝ (fun i ↦ realEmbed n (x i))) : ∃ b : Basis (Fin n) ℤ (Fin n → ℤ), (∀ i, realPrefixLattice x i = Submodule.span ℤ (b '' Set.Iic i)) ∧ (∀ i j, i < j → b.repr (x i) j = 0) ∧ ∀ i, b.repr (x i) i ≠ 0 := by classical obtain ⟨b, s, hsmono, hspan, hzero⟩ := exists_fin_basis_with_nested_supports_realPrefixLattice x have hpivot : ∀ i : Fin n, ∃ j : Fin n, j ∈ s i ∧ b.repr (x i) j ≠ 0 ∧ ∀ hi : 0 < i.val, j ∉ s (⟨i.val - 1, by omega⟩ : Fin n) := by intro i by_cases hi : 0 < i.val · let ip : Fin n := ⟨i.val - 1, by omega⟩ have hset : Set.Iic ip = Set.Iio i := by ext k simp only [Set.mem_Iic, Set.mem_Iio, Fin.le_iff_val_le_val, Fin.lt_def, ip] omega have hnot : x i ∉ realPrefixLattice x ip := by intro hmem have him := (mem_realPrefixLattice.mp hmem) apply hli.notMem_span_image (s := Set.Iio i) (lt_irrefl i) simpa [Set.image_image, Function.comp_def, hset] using him have hnotspan : x i ∉ Submodule.span ℤ (b '' s ip) := by rw [← hspan ip] exact hnot have hnsub : ¬ ((b.repr (x i)).support : Set (Fin n)) ⊆ s ip := by simpa [b.mem_span_image] using hnotspan obtain ⟨j, hjmem, hjnot⟩ := Set.not_subset.mp hnsub have hjne : b.repr (x i) j ≠ 0 := Finsupp.mem_support_iff.mp hjmem have hjcur : j ∈ s i := by by_contra hj exact hjne (hzero i j hj) refine ⟨j, hjcur, hjne, ?_⟩ intro _hi simpa [ip] using hjnot · have hxne : x i ≠ 0 := by intro hx apply hli.ne_zero i simp [hx] have hrepr : b.repr (x i) ≠ 0 := by intro hr apply hxne apply b.repr.injective simpa using hr obtain ⟨j, hjmem⟩ := Finsupp.support_nonempty_iff.mpr hrepr have hjne : b.repr (x i) j ≠ 0 := Finsupp.mem_support_iff.mp hjmem have hjcur : j ∈ s i := by by_contra hj exact hjne (hzero i j hj) exact ⟨j, hjcur, hjne, fun h ↦ (hi h).elim⟩ choose p hp_mem hp_ne hp_prev using hpivot have hp_injective : Function.Injective p := by intro i j hpij by_contra hij rcases lt_or_gt_of_ne hij with hijlt | hjilt · have hjpos : 0 < j.val := lt_of_le_of_lt (Nat.zero_le _) hijlt let jp : Fin n := ⟨j.val - 1, by omega⟩ have hijp : i ≤ jp := by apply Fin.le_iff_val_le_val.mpr change i.val ≤ j.val - 1 omega have hpimem : p i ∈ s jp := hsmono hijp (hp_mem i) have hpjnot : p j ∉ s jp := by simpa [jp] using hp_prev j hjpos exact hpjnot (hpij ▸ hpimem) · have hipos : 0 < i.val := lt_of_le_of_lt (Nat.zero_le _) hjilt let ip : Fin n := ⟨i.val - 1, by omega⟩ have hjip : j ≤ ip := by apply Fin.le_iff_val_le_val.mpr change j.val ≤ i.val - 1 omega have hpjmem : p j ∈ s ip := hsmono hjip (hp_mem j) have hpinot : p i ∉ s ip := by simpa [ip] using hp_prev i hipos exact hpinot (hpij.symm ▸ hpjmem) have hp_bijective : Function.Bijective p := (Fintype.bijective_iff_injective_and_card p).mpr ⟨hp_injective, rfl⟩ let ep : Fin n ≃ Fin n := Equiv.ofBijective p hp_bijective have hs_eq (i : Fin n) : p '' Set.Iic i = s i := by apply Set.Subset.antisymm · rintro _ ⟨k, hk, rfl⟩ exact hsmono (Set.mem_Iic.mp hk) (hp_mem k) · intro q hq obtain ⟨k, rfl⟩ := hp_bijective.2 q refine ⟨k, ?_, rfl⟩ apply Set.mem_Iic.mpr by_contra hki have hik : i < k := lt_of_not_ge hki have hkpos : 0 < k.val := lt_of_le_of_lt (Nat.zero_le _) hik let kp : Fin n := ⟨k.val - 1, by omega⟩ have hikp : i ≤ kp := by apply Fin.le_iff_val_le_val.mpr change i.val ≤ k.val - 1 omega exact (hp_prev k hkpos) (hsmono hikp hq) let b' : Basis (Fin n) ℤ (Fin n → ℤ) := b.reindex ep.symm have hbimage (i : Fin n) : b' '' Set.Iic i = b '' s i := by rw [← hs_eq i] ext y constructor · rintro ⟨k, hk, rfl⟩ exact ⟨p k, ⟨k, hk, rfl⟩, by simp [b', ep]⟩ · rintro ⟨_, ⟨k, hk, rfl⟩, rfl⟩ exact ⟨k, hk, by simp [b', ep]⟩ have hspan' (i : Fin n) : realPrefixLattice x i = Submodule.span ℤ (b' '' Set.Iic i) := by rw [hbimage] exact hspan i refine ⟨b', hspan', ?_, ?_⟩ · intro i j hij apply repr_eq_zero_of_mem_span_image b' (Set.Iic i) · rw [← hspan' i] exact self_mem_realPrefixLattice x i · exact fun hj ↦ (not_le_of_gt hij) (Set.mem_Iic.mp hj) · intro i simpa [b', ep] using hp_ne i
end Erdos3.IntegerBasisReduction.SaturatedFlag
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344import Mathlib.Analysis.Normed.Group.Basicimport Mathlib.Tacticimport Mathlib.Topology.MetricSpace.Lipschitz
namespace OAI
section
namespace Erdos3open scoped NNReal
noncomputable def scalarBadSublevelRamp (κ t : ℝ) : ℝ := max 0 (min 1 (2 - 2 * |t| / κ))
theorem scalarBadSublevelRamp_range (κ t : ℝ) : scalarBadSublevelRamp κ t ∈ Set.Icc (0 : ℝ) 1 := by exact ⟨le_max_left _ _, max_le zero_le_one (min_le_left _ _)⟩
theorem scalarBadSublevelRamp_eq_one {κ t : ℝ} (hκ : 0 < κ) (ht : |t| ≤ κ / 2) : scalarBadSublevelRamp κ t = 1 := by have hr : 2 * |t| / κ ≤ 1 := (div_le_one hκ).mpr (by linarith) rw [scalarBadSublevelRamp, min_eq_left (by linarith), max_eq_right zero_le_one]
theorem scalarBadSublevelRamp_eq_zero {κ t : ℝ} (hκ : 0 < κ) (ht : κ ≤ |t|) : scalarBadSublevelRamp κ t = 0 := by have hr : 2 ≤ 2 * |t| / κ := (le_div_iff₀ hκ).mpr (by linarith) rw [scalarBadSublevelRamp, min_eq_right (by linarith), max_eq_left (by linarith)]
theorem scalarBadSublevelRamp_lipschitz {κ : ℝ} (hκ : 0 < κ) : LipschitzWith ⟨2 / κ, by positivity⟩ (scalarBadSublevelRamp κ) := by have hraw : LipschitzWith ⟨2 / κ, by positivity⟩ (fun t : ℝ => 2 - 2 * |t| / κ) := by apply LipschitzWith.of_dist_le_mul intro x y rw [Real.dist_eq, Real.dist_eq] have he : (2 - 2 * |x| / κ) - (2 - 2 * |y| / κ) = -(2 / κ) * (|x| - |y|) := by ring rw [he, abs_mul, abs_neg, abs_of_nonneg (by positivity : 0 ≤ 2 / κ)] exact mul_le_mul_of_nonneg_left (abs_abs_sub_abs_le_abs_sub x y) (by positivity) exact (hraw.const_min 1).const_max 0
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677import OAI.Combinatorics.Progressions.Estimates.BooleanMinorDimensionimport OAI.Combinatorics.Progressions.Probability.ScalarCubeDomainDensity
namespace OAI
section
namespace Erdos3
open scoped BigOperators NNReal
noncomputable def scalarCubeLinearMap {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) : (Option α → ℝ) →L[ℝ] ℝ := ∑ r : Option α, (booleanFeature r t : ℝ) • ContinuousLinearMap.proj r
theorem scalarCubeLinearMap_apply {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) (a : Option α → ℝ) : scalarCubeLinearMap t a = scalarCubeValue a t := by simp only [scalarCubeLinearMap, sum_apply, smul_apply, ContinuousLinearMap.proj_apply, smul_eq_mul, scalarCubeValue]
theorem scalarCubeLinearMap_single {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) (r : Option α) : scalarCubeLinearMap t (Pi.single r 1) = (booleanFeature r t : ℝ) := by rw [scalarCubeLinearMap_apply] simp [scalarCubeValue, Pi.single_apply, mul_ite]
theorem scalarCubeLinearMap_norm_le {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) : ‖scalarCubeLinearMap t‖ ≤ (Fintype.card α : ℝ) + 1 := by have h := clm_norm_le_card_mul_of_basis (scalarCubeLinearMap t) zero_le_one (fun r => by rw [scalarCubeLinearMap_single, Real.norm_eq_abs] exact booleanFeature_abs_le_one r t) simpa only [Fintype.card_option, Nat.cast_add, Nat.cast_one, mul_one] using h
theorem scalarCubeValue_fderiv_norm_le {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) (a : Option α → ℝ) : ‖fderiv ℝ (fun x => scalarCubeValue x t) a‖ ≤ (Fintype.card α : ℝ) + 1 := by have heq : (fun x => scalarCubeValue x t) = scalarCubeLinearMap t := funext (fun x => (scalarCubeLinearMap_apply t x).symm) rw [heq, ContinuousLinearMap.fderiv] exact scalarCubeLinearMap_norm_le t
theorem scalarCubeFace_fderiv_norm_le {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (a : Option α → ℝ) : ‖fderiv ℝ (scalarCubeFace i) a‖ ≤ (Fintype.card α : ℝ) + 1 := by rcases i with ⟨b, t⟩ cases b with | false => exact scalarCubeValue_fderiv_norm_le t a | true => change ‖fderiv ℝ (fun x => 1 - scalarCubeValue x t) a‖ ≤ _ rw [fderiv_const_sub, norm_neg] exact scalarCubeValue_fderiv_norm_le t a
theorem scalarCubeBoundaryCutoff_compact (α : Type*) [Fintype α] [DecidableEq α] {r : ℝ} (hr : 0 < r) : HasCompactSupport (inequalityBoundaryCutoff (fun _ : Bool × Finset α => r) scalarCubeFace) := by apply inequalityBoundaryCutoff_compact _ (fun _ => hr) _ (fun i => (scalarCubeFace_contDiff i).continuous) rw [positiveInequalityDomain_scalarCubeFace] exact scalarCubeDomain_isBounded α
theorem scalarCubeBoundaryCutoff_fderiv_norm_le {α : Type*} [Fintype α] [DecidableEq α] (A : ℝ≥0) (hLip : LipschitzWith A Real.smoothTransition) {r : ℝ} (hr : 0 < r) (a : Option α → ℝ) : ‖fderiv ℝ (inequalityBoundaryCutoff (fun _ : Bool × Finset α => r) scalarCubeFace) a‖ ≤ ((2 * 2 ^ Fintype.card α : ℕ) : ℝ) * ((A : ℝ) / r * ((Fintype.card α : ℝ) + 1)) := by apply (inequalityBoundaryCutoff_fderiv_norm_le A hLip _ (fun _ => hr) scalarCubeFace scalarCubeFace_contDiff a).trans calc _ ≤ ∑ _i : Bool × Finset α, (A : ℝ) / r * ((Fintype.card α : ℝ) + 1) := Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (scalarCubeFace_fderiv_norm_le i a) (div_nonneg A.coe_nonneg hr.le)) _ = _ := by rw [Finset.sum_const, Finset.card_univ, scalarCubeFace_card, nsmul_eq_mul]
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117import Mathlib.MeasureTheory.Measure.Lebesgue.Basicimport OAI.Combinatorics.Progressions.Estimates.FiniteFiberVolumeBoundimport OAI.Combinatorics.Progressions.Geometry.ScalarCubeCoordinates
namespace OAI
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators
def scalarCubeFaceStrip {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (u : ℝ) : Set (Option α → ℝ) := scalarCubeDomain α ∩ {a | scalarCubeFace i a < u}
theorem scalarCubeFaceStrip_measurable {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (u : ℝ) : MeasurableSet (scalarCubeFaceStrip i u) := (scalarCubeDomain_isOpen α).measurableSet.inter (measurableSet_lt (scalarCubeFace_contDiff i).continuous.measurable measurable_const)
theorem scalarCubeFaceStrip_volume_lt_top {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (u : ℝ) : volume (scalarCubeFaceStrip i u) < ⊤ := (measure_mono Set.inter_subset_left).trans_lt (scalarCubeDomain_volume_lt_top α)
theorem scalarCubeFaceStrip_fiber_interval {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (u : ℝ) (b : α → ℝ) : ∃ lo : ℝ, {y | scalarCubeJoin (b, y) ∈ scalarCubeFaceStrip i u} ⊆ Set.Ioo lo (lo + u) := by rcases i with ⟨side, t⟩ cases side with | false => refine ⟨-(∑ k ∈ t, b k), ?_⟩ intro y hy have hpos := (hy.1 t).1 have hupper := hy.2 change scalarCubeValue (scalarCubeJoin (b, y)) t < u at hupper rw [scalarCubeJoin_value] at hpos hupper exact ⟨by linarith, by linarith⟩ | true => refine ⟨1 - (∑ k ∈ t, b k) - u, ?_⟩ intro y hy have hpos := (hy.1 t).2 have hlower := hy.2 change 1 - scalarCubeValue (scalarCubeJoin (b, y)) t < u at hlower rw [scalarCubeJoin_value] at hpos hlower exact ⟨by linarith, by linarith⟩
theorem scalarCubeFaceStrip_fiber_volume_le {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) {u : ℝ} (hu : 0 ≤ u) (b : α → ℝ) : volume.real {y | scalarCubeJoin (b, y) ∈ scalarCubeFaceStrip i u} ≤ u := by obtain ⟨lo, hsub⟩ := scalarCubeFaceStrip_fiber_interval i u b have hlen : volume.real (Set.Ioo lo (lo + u)) = u := by rw [Real.volume_real_Ioo] simpa only [add_sub_cancel_left] using max_eq_left hu exact (measureReal_mono (μ := volume) hsub (by simp [Real.volume_Ioo])).trans_eq hlen
theorem scalarCubeFaceStrip_base_bound {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (u : ℝ) {z : (α → ℝ) × ℝ} (hz : scalarCubeJoin z ∈ scalarCubeFaceStrip i u) : z.1 ∈ Metric.closedBall (0 : α → ℝ) 1 := by rw [Metric.mem_closedBall, dist_zero_right] apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr intro k have h := (scalarCubeDomain_coordinate_abs_lt_one hz.1 (some k)).le simpa only [scalarCubeJoin_some, Real.norm_eq_abs] using h
end Erdos3
end
section
namespace Erdos3
open MeasureTheory
theorem scalarCubeFaceStrip_volume_le {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) {u : ℝ} (hu : 0 ≤ u) : volume.real (scalarCubeFaceStrip i u) ≤ (2 : ℝ) ^ Fintype.card α * u := by let s : Set ((α → ℝ) × ℝ) := scalarCubeJoin ⁻¹' scalarCubeFaceStrip i u have hs : MeasurableSet s := (scalarCubeFaceStrip_measurable i u).preimage (scalarCubeJoin_measurable α) have hpres := scalarCubeJoin_measurePreserving α have hmass : volume s = volume (scalarCubeFaceStrip i u) := hpres.measure_preimage (scalarCubeFaceStrip_measurable i u).nullMeasurableSet have hreal : volume.real s = volume.real (scalarCubeFaceStrip i u) := hpres.measureReal_preimage (scalarCubeFaceStrip_measurable i u).nullMeasurableSet have hsfin : (volume : Measure ((α → ℝ) × ℝ)) s ≠ ⊤ := by rw [hmass] exact (scalarCubeFaceStrip_volume_lt_top i u).ne have h := product_measureReal_le_of_fiber_bound (volume : Measure (α → ℝ)) (volume : Measure ℝ) s hs hsfin (Metric.closedBall (0 : α → ℝ) 1) measurableSet_closedBall (isCompact_closedBall _ _).measure_ne_top (fun z hz => scalarCubeFaceStrip_base_bound i u hz) (scalarCubeFaceStrip_fiber_volume_le i hu) change volume.real s ≤ _ at h rw [hreal] at h have hbase : volume.real (Metric.closedBall (0 : α → ℝ) 1) = (2 : ℝ) ^ Fintype.card α := by rw [measureReal_def, Real.volume_pi_closedBall _ (by norm_num)] simp rw [hbase] at h exact h
theorem scalarCubeFaceStrip_weighted_volume_le {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) {u : ℝ} (hu : 0 ≤ u) : (∫ _ in scalarCubeFaceStrip i u, scalarCubeDomainDensity α) ≤ scalarCubeDomainDensity α * (2 : ℝ) ^ Fintype.card α * u := by rw [setIntegral_const, smul_eq_mul] have h := mul_le_mul_of_nonneg_left (scalarCubeFaceStrip_volume_le i hu) (scalarCubeDomainDensity_pos α).le nlinarith
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132import OAI.Combinatorics.Progressions.Lattices.CubeResidueSupport
namespace OAI
namespace Erdos3
open scoped Matrix
theorem integerMatrix_scaled_period {I J : Type*} [Fintype I] [Fintype J] (A : Matrix I J ℤ) (m a : ℤ) (hperiod : integerScalarLattice I a ≤ A.mulVecLin.range) : integerScalarLattice I (m * a) ≤ (m • A).mulVecLin.range := by rintro y ⟨z, rfl⟩ change (m * a) • z ∈ (m • A).mulVecLin.range obtain ⟨u, hu⟩ := hperiod ((integerScalarLattice_mem a _).mpr ⟨z, rfl⟩) refine ⟨u, ?_⟩ change (m • A) *ᵥ u = (m * a) • z change A *ᵥ u = a • z at hu rw [Matrix.smul_mulVec, hu, smul_smul]
theorem integerCokernelExponent_scaled_le {I J : Type*} [Fintype I] [Fintype J] (A : Matrix I J ℤ) (m : ℕ) (hm : 0 < m) (hA : 0 < integerCokernelExponent A.mulVecLin.range) : integerCokernelExponent ((m : ℤ) • A).mulVecLin.range ≤ m * integerCokernelExponent A.mulVecLin.range := by have hp := integerMatrix_scaled_period A (m : ℤ) (integerCokernelExponent A.mulVecLin.range : ℤ) (integerCokernelExponent_period A.mulVecLin.range) have hp' : integerScalarLattice I ((m * integerCokernelExponent A.mulVecLin.range : ℕ) : ℤ) ≤ ((m : ℤ) • A).mulVecLin.range := by simpa only [Nat.cast_mul] using hp exact Nat.le_of_dvd (Nat.mul_pos hm hA) (integerCokernelExponent_dvd_period _ _ hp')
theorem scaled_nonzeroMinor {I J : Type*} [Fintype I] [DecidableEq I] (A : Matrix I J ℤ) (m : ℤ) (s : I → J) (h : (((m • A).submatrix id s).det) ≠ 0) : (A.submatrix id s).det ≠ 0 := by intro hz apply h change (m • A.submatrix id s).det = 0 rw [Matrix.det_smul, hz, mul_zero]
theorem scaled_largeCokernel_implies {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] (A : Matrix I J ℤ) (m B : ℕ) (hm : 0 < m) (hminor : ∃ s : I → J, (((m : ℤ) • A).submatrix id s).det ≠ 0) (hB : m * B < integerCokernelExponent ((m : ℤ) • A).mulVecLin.range) : (∃ s : I → J, (A.submatrix id s).det ≠ 0) ∧ B < integerCokernelExponent A.mulVecLin.range := by obtain ⟨s, hs⟩ := hminor have hs' := scaled_nonzeroMinor A (m : ℤ) s hs have hpos := (integerCokernelExponent_le_det A.mulVecLin.range (A.submatrix id s) hs' (integerColumnMinor_range_le A s)).1 have hle := integerCokernelExponent_scaled_le A m hm hpos exact ⟨⟨s, hs'⟩, (Nat.mul_lt_mul_left hm).mp (hB.trans_le hle)⟩
end Erdos3
namespace Erdos3
def HasBoundedScalarPeriod {I : Type*} [Fintype I] (L : Submodule ℤ (I → ℤ)) (B : ℕ) : Prop := ∃ a : ℕ, 0 < a ∧ a ≤ B ∧ integerScalarLattice I (a : ℤ) ≤ L
theorem hasBoundedScalarPeriod_iff {I : Type*} [Fintype I] (L : Submodule ℤ (I → ℤ)) (hL : 0 < integerCokernelExponent L) (B : ℕ) : HasBoundedScalarPeriod L B ↔ integerCokernelExponent L ≤ B := by constructor · rintro ⟨a, ha, haB, hperiod⟩ exact (Nat.le_of_dvd ha (integerCokernelExponent_dvd_period L a hperiod)).trans haB · intro hB exact ⟨integerCokernelExponent L, hL, hB, integerCokernelExponent_period L⟩
theorem scalarCube_no_bounded_period_iff {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] {L : ℕ} (B : ℕ) (x : J → IntegerScalarCubeBox I L) : ((∃ s : I → J, ((scalarCubeDifferenceMatrix x).submatrix id s).det ≠ 0) ∧ ¬ HasBoundedScalarPeriod (scalarCubeDifferenceMatrix x).mulVecLin.range B) ↔ scalarCubeLargeCokernelEvent B x := by have hpos (h : ∃ s : I → J, ((scalarCubeDifferenceMatrix x).submatrix id s).det ≠ 0) : 0 < integerCokernelExponent (scalarCubeDifferenceMatrix x).mulVecLin.range := by obtain ⟨s, hs⟩ := h exact (integerCokernelExponent_le_det _ _ hs (integerColumnMinor_range_le _ s)).1 constructor · rintro ⟨hminor, hperiod⟩ exact ⟨hminor, Nat.lt_of_not_ge (hperiod ∘ (hasBoundedScalarPeriod_iff _ (hpos hminor) B).mpr)⟩ · rintro ⟨hminor, hB⟩ exact ⟨hminor, fun hp => (Nat.not_le_of_lt hB) ((hasBoundedScalarPeriod_iff _ (hpos hminor) B).mp hp)⟩
def stridedScalarCubeLargeCokernelEvent {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] {L : ℕ} (m B : ℕ) (x : J → IntegerScalarCubeBox I L) : Prop := (∃ s : I → J, (((m : ℤ) • scalarCubeDifferenceMatrix x).submatrix id s).det ≠ 0) ∧ B < integerCokernelExponent ((m : ℤ) • scalarCubeDifferenceMatrix x).mulVecLin.range
theorem stridedScalarCube_largeCokernel_probability_le {I J : Type*} [Fintype I] [DecidableEq I] [Nonempty I] [Fintype J] [DecidableEq J] (L m B : ℕ) (hL : 0 < L) (hsize : Fintype.card I + 1 ≤ L) (hm : 0 < m) (hB : 0 < B) (hJ : Fintype.card J = Fintype.card I * (Fintype.card I + 2)) : (FiniteProbabilityWeights.pi (fun _ : J => integerScalarCubeWeights I L hL)).eventProbability (stridedScalarCubeLargeCokernelEvent m (m * B)) ≤ (integerScalarCubeDensityCap I * (1 + ((Fintype.card I).factorial : ℝ))) ^ Fintype.card J / (B : ℝ) := by apply (FiniteProbabilityWeights.eventProbability_mono _ _ (scalarCubeLargeCokernelEvent B) ?_).trans (scalarCube_largeCokernel_probability_le L B hL hsize hB hJ) intro x hx exact scaled_largeCokernel_implies (scalarCubeDifferenceMatrix x) m B hm hx.1 hx.2
theorem exists_scalarCube_cokernel_cutoff (I J : Type*) [Fintype I] [DecidableEq I] [Nonempty I] [Fintype J] [DecidableEq J] (hJ : Fintype.card J = Fintype.card I * (Fintype.card I + 2)) (ε : ℝ) (hε : 0 < ε) : ∃ B : ℕ, 0 < B ∧ ∀ (L m : ℕ) (hL : 0 < L), Fintype.card I + 1 ≤ L → 0 < m → (FiniteProbabilityWeights.pi (fun _ : J => integerScalarCubeWeights I L hL)).eventProbability (stridedScalarCubeLargeCokernelEvent m (m * B)) ≤ ε := by let C := (integerScalarCubeDensityCap I * (1 + ((Fintype.card I).factorial : ℝ))) ^ Fintype.card J obtain ⟨B, hB⟩ := exists_nat_gt (max 1 (C / ε)) have hBpos : 0 < B := by have h : (1 : ℝ) < B := (le_max_left _ _).trans_lt hB exact_mod_cast (zero_lt_one.trans h) have hbound : C / (B : ℝ) ≤ ε := by apply (div_le_iff₀ (by exact_mod_cast hBpos)).mpr have h := (div_lt_iff₀ hε).mp ((le_max_right _ _).trans_lt hB) linarith refine ⟨B, hBpos, fun L m hL hsize hm => ?_⟩ exact (stridedScalarCube_largeCokernel_probability_le L m B hL hsize hm hBpos hJ).trans hbound
end Erdos3
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233import Mathlib.Analysis.Normed.Module.FiniteDimensionimport Mathlib.Topology.MetricSpace.Boundedimport OAI.Combinatorics.Progressions.Dynamics.ProductCutoffBudgetimport OAI.Combinatorics.Progressions.Estimates.SmoothHalfspaceCutoffimport OAI.Combinatorics.Progressions.Polynomial.PolynomialDeterminantDerivativeBound
namespace OAI
section
namespace Erdos3
open scoped BigOperators ContDiff NNReal
def positiveInequalityDomain {I E : Type*} (d : I → E → ℝ) : Set E := {x | ∀ i, 0 < d i x}
theorem positiveInequalityDomain_isOpen {I E : Type*} [Fintype I] [TopologicalSpace E] (d : I → E → ℝ) (hd : ∀ i, Continuous (d i)) : IsOpen (positiveInequalityDomain d) := by have heq : positiveInequalityDomain d = ⋂ i, {x | 0 < d i x} := by ext x simp [positiveInequalityDomain] rw [heq] exact isOpen_iInter_of_finite (fun i => isOpen_lt continuous_const (hd i))
noncomputable def inequalityBoundaryCutoff {I E : Type*} [Fintype I] (r : I → ℝ) (d : I → E → ℝ) (x : E) : ℝ := ∏ i, halfspaceCutoff (r i) (d i) x
theorem inequalityBoundaryCutoff_range {I E : Type*} [Fintype I] (r : I → ℝ) (d : I → E → ℝ) (x : E) : inequalityBoundaryCutoff r d x ∈ Set.Icc (0 : ℝ) 1 := product_cutoff_range _ (fun i => halfspaceCutoff_range (r i) (d i) x)
theorem inequalityBoundaryCutoff_smooth {I E : Type*} [Fintype I] [NormedAddCommGroup E] [NormedSpace ℝ E] (r : I → ℝ) (d : I → E → ℝ) (hd : ∀ i, ContDiff ℝ ∞ (d i)) : ContDiff ℝ ∞ (inequalityBoundaryCutoff r d) := contDiff_prod (fun i _ => contDiff_halfspaceCutoff (r i) (d i) (hd i))
theorem inequalityBoundaryCutoff_tsupport_subset {I E : Type*} [Fintype I] [TopologicalSpace E] (r : I → ℝ) (hr : ∀ i, 0 < r i) (d : I → E → ℝ) (hd : ∀ i, Continuous (d i)) : tsupport (inequalityBoundaryCutoff r d) ⊆ {x | ∀ i, r i ≤ d i x} := by intro x hx i exact halfspaceCutoff_tsupport_subset (hr i) (d i) (hd i) (product_cutoff_tsupport_subset (fun j => halfspaceCutoff (r j) (d j)) i hx)
theorem inequalityBoundaryCutoff_tsupport_domain {I E : Type*} [Fintype I] [TopologicalSpace E] (r : I → ℝ) (hr : ∀ i, 0 < r i) (d : I → E → ℝ) (hd : ∀ i, Continuous (d i)) : tsupport (inequalityBoundaryCutoff r d) ⊆ positiveInequalityDomain d := by intro x hx i exact (hr i).trans_le (inequalityBoundaryCutoff_tsupport_subset r hr d hd hx i)
theorem inequalityBoundaryCutoff_compact {I E : Type*} [Fintype I] [MetricSpace E] [ProperSpace E] (r : I → ℝ) (hr : ∀ i, 0 < r i) (d : I → E → ℝ) (hd : ∀ i, Continuous (d i)) (hbounded : Bornology.IsBounded (positiveInequalityDomain d)) : HasCompactSupport (inequalityBoundaryCutoff r d) := by apply Metric.isCompact_of_isClosed_isBounded (isClosed_tsupport _) exact hbounded.subset (inequalityBoundaryCutoff_tsupport_domain r hr d hd)
theorem inequalityBoundaryCutoff_eq_one {I E : Type*} [Fintype I] (r : I → ℝ) (hr : ∀ i, 0 < r i) (d : I → E → ℝ) {x : E} (hx : ∀ i, 2 * r i ≤ d i x) : inequalityBoundaryCutoff r d x = 1 := Finset.prod_eq_one (fun i _ => halfspaceCutoff_eq_one (hr i) (d i) (hx i))
theorem inequalityBoundaryCutoff_fderiv_norm_le {I E : Type*} [Fintype I] [NormedAddCommGroup E] [NormedSpace ℝ E] (A : ℝ≥0) (hLip : LipschitzWith A Real.smoothTransition) (r : I → ℝ) (hr : ∀ i, 0 < r i) (d : I → E → ℝ) (hd : ∀ i, ContDiff ℝ ∞ (d i)) (x : E) : ‖fderiv ℝ (inequalityBoundaryCutoff r d) x‖ ≤ ∑ i, ((A : ℝ) / r i) * ‖fderiv ℝ (d i) x‖ := by apply (product_cutoff_fderiv_norm_le (fun i => halfspaceCutoff (r i) (d i)) x (fun i => ((contDiff_halfspaceCutoff (r i) (d i) (hd i)).differentiable (by norm_num)).differentiableAt) (fun i => halfspaceCutoff_range (r i) (d i) x)).trans exact Finset.sum_le_sum (fun i _ => halfspaceCutoff_fderiv_norm_le A hLip (hr i) (d i) (((hd i).differentiable (by norm_num)).differentiableAt))
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators
theorem halfspaceCutoff_measurable {E : Type*} [MeasurableSpace E] (r : ℝ) (d : E → ℝ) (hd : Measurable d) : Measurable (halfspaceCutoff r d) := Real.smoothTransition.continuous.measurable.comp ((hd.div_const r).sub_const 1)
theorem halfspaceCutoff_integral_loss_le {E : Type*} [MeasurableSpace E] (μ : Measure E) [IsFiniteMeasure μ] {r : ℝ} (hr : 0 < r) (d : E → ℝ) (hd : Measurable d) : (∫ x, 1 - halfspaceCutoff r d x ∂μ) ≤ μ.real {x | d x < 2 * r} := by let s := {x | d x < 2 * r} have hs : MeasurableSet s := measurableSet_lt hd measurable_const have hfi := cutoff_integrable μ _ (halfspaceCutoff_measurable r d hd) (halfspaceCutoff_range r d) calc _ ≤ ∫ x, s.indicator (fun _ => (1 : ℝ)) x ∂μ := by apply integral_mono ((integrable_const (1 : ℝ)).sub hfi) ((integrable_const (1 : ℝ)).indicator hs) intro x change 1 - halfspaceCutoff r d x ≤ s.indicator (fun _ => (1 : ℝ)) x by_cases hx : x ∈ s · rw [Set.indicator_of_mem hx] linarith [(halfspaceCutoff_range r d x).1] · rw [Set.indicator_of_notMem hx, halfspaceCutoff_eq_one hr d (le_of_not_gt hx)] norm_num _ = _ := integral_indicator_one hs
theorem inequalityBoundaryCutoff_integral_loss_le {I E : Type*} [Fintype I] [MeasurableSpace E] (μ : Measure E) [IsFiniteMeasure μ] (r : I → ℝ) (hr : ∀ i, 0 < r i) (d : I → E → ℝ) (hd : ∀ i, Measurable (d i)) : (∫ x, 1 - inequalityBoundaryCutoff r d x ∂μ) ≤ ∑ i, μ.real {x | d i x < 2 * r i} := by apply (product_cutoff_integral_loss_le μ (fun i => halfspaceCutoff (r i) (d i)) (fun i => halfspaceCutoff_measurable (r i) (d i) (hd i)) (fun i => halfspaceCutoff_range (r i) (d i))).trans exact Finset.sum_le_sum (fun i _ => halfspaceCutoff_integral_loss_le μ (hr i) (d i) (hd i))
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators ContDiff
noncomputable def scalarCubeValue {α : Type*} [Fintype α] [DecidableEq α] (a : Option α → ℝ) (t : Finset α) : ℝ := ∑ r : Option α, (booleanFeature r t : ℝ) * a r
theorem scalarCubeValue_empty {α : Type*} [Fintype α] [DecidableEq α] (a : Option α → ℝ) : scalarCubeValue a ∅ = a none := by simp [scalarCubeValue, Fintype.sum_option, booleanFeature]
theorem scalarCubeValue_singleton {α : Type*} [Fintype α] [DecidableEq α] (a : Option α → ℝ) (i : α) : scalarCubeValue a {i} = a none + a (some i) := by simp [scalarCubeValue, Fintype.sum_option, booleanFeature]
theorem scalarCubeValue_contDiff {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) : ContDiff ℝ ∞ (fun a : Option α → ℝ => scalarCubeValue a t) := by unfold scalarCubeValue apply ContDiff.sum intro r _ exact contDiff_const.mul (ContinuousLinearMap.proj r : (Option α → ℝ) →L[ℝ] ℝ).contDiff
def scalarCubeDomain (α : Type*) [Fintype α] [DecidableEq α] : Set (Option α → ℝ) := {a | ∀ t : Finset α, scalarCubeValue a t ∈ Set.Ioo (0 : ℝ) 1}
noncomputable def scalarCubeFace {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) (a : Option α → ℝ) : ℝ := if i.1 then 1 - scalarCubeValue a i.2 else scalarCubeValue a i.2
theorem scalarCubeFace_contDiff {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) : ContDiff ℝ ∞ (scalarCubeFace i) := by rcases i with ⟨b, t⟩ cases b with | false => exact scalarCubeValue_contDiff t | true => exact contDiff_const.sub (scalarCubeValue_contDiff t)
theorem positiveInequalityDomain_scalarCubeFace (α : Type*) [Fintype α] [DecidableEq α] : positiveInequalityDomain (@scalarCubeFace α _ _) = scalarCubeDomain α := by ext a constructor · intro ha t have hlo : 0 < scalarCubeValue a t := ha (false, t) have hhi : 0 < 1 - scalarCubeValue a t := ha (true, t) exact ⟨hlo, by linarith⟩ · intro ha i rcases i with ⟨b, t⟩ cases b with | false => exact (ha t).1 | true => exact sub_pos.mpr (ha t).2
theorem scalarCubeDomain_isOpen (α : Type*) [Fintype α] [DecidableEq α] : IsOpen (scalarCubeDomain α) := by rw [← positiveInequalityDomain_scalarCubeFace α] exact positiveInequalityDomain_isOpen _ (fun i => (scalarCubeFace_contDiff i).continuous)
theorem scalarCubeDomain_coordinate_abs_lt_one {α : Type*} [Fintype α] [DecidableEq α] {a : Option α → ℝ} (ha : a ∈ scalarCubeDomain α) (r : Option α) : |a r| < 1 := by have hzero := ha ∅ rw [scalarCubeValue_empty] at hzero cases r with | none => exact abs_lt.mpr ⟨by linarith [hzero.1], hzero.2⟩ | some i => have hi := ha {i} rw [scalarCubeValue_singleton] at hi exact abs_lt.mpr ⟨by linarith [hzero.1, hzero.2, hi.1], by linarith [hzero.1, hi.2]⟩
theorem scalarCubeDomain_isBounded (α : Type*) [Fintype α] [DecidableEq α] : Bornology.IsBounded (scalarCubeDomain α) := by apply (Metric.isBounded_closedBall (x := (0 : Option α → ℝ)) (r := 1)).subset intro a ha rw [Metric.mem_closedBall, dist_zero_right] apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr intro r simpa only [Real.norm_eq_abs] using (scalarCubeDomain_coordinate_abs_lt_one ha r).le
noncomputable def scalarCubeCenter (α : Type*) : Option α → ℝ | none => 1 / 2 | some _ => 0
theorem scalarCubeValue_center {α : Type*} [Fintype α] [DecidableEq α] (t : Finset α) : scalarCubeValue (scalarCubeCenter α) t = 1 / 2 := by simp [scalarCubeValue, Fintype.sum_option, scalarCubeCenter, booleanFeature]
theorem scalarCubeDomain_nonempty (α : Type*) [Fintype α] [DecidableEq α] : (scalarCubeDomain α).Nonempty := by refine ⟨scalarCubeCenter α, ?_⟩ intro t rw [scalarCubeValue_center] norm_num
theorem scalarCubeFace_card (α : Type*) [Fintype α] : Fintype.card (Bool × Finset α) = 2 * 2 ^ Fintype.card α := by simp
theorem booleanAffinePolynomial_eval_scalarCubeValue {B F α : Type*} [Fintype α] [DecidableEq α] (a : BlockParameter B F α → ℝ) (b : B) (v : F) (t : Finset α) : MvPolynomial.eval a (booleanAffinePolynomial b v t) = scalarCubeValue (fun r => a (b, v, r)) t := booleanAffinePolynomial_eval a b v t
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363import OAI.Combinatorics.Progressions.Geometry.NormalizedRestrictionTransportimport OAI.Combinatorics.Progressions.Probability.ScalarCubeBoundaryMass
namespace OAI
section
namespace Erdos3
open MeasureTheory
def closedScalarCubeDomain (α : Type*) [Fintype α] [DecidableEq α] : Set (Option α → ℝ) := {a | ∀ t : Finset α, scalarCubeValue a t ∈ Set.Icc (0 : ℝ) 1}
theorem scalarCubeDomain_subset_closed (α : Type*) [Fintype α] [DecidableEq α] : scalarCubeDomain α ⊆ closedScalarCubeDomain α := fun _ ha t => ⟨(ha t).1.le, (ha t).2.le⟩
theorem closedScalarCubeDomain_isClosed (α : Type*) [Fintype α] [DecidableEq α] : IsClosed (closedScalarCubeDomain α) := by have heq : closedScalarCubeDomain α = ⋂ t : Finset α, {a | scalarCubeValue a t ∈ Set.Icc (0 : ℝ) 1} := by ext a simp [closedScalarCubeDomain] rw [heq] exact isClosed_iInter (fun t => isClosed_Icc.preimage (scalarCubeValue_contDiff t).continuous)
theorem closedScalarCubeDomain_iff_faces {α : Type*} [Fintype α] [DecidableEq α] (a : Option α → ℝ) : a ∈ closedScalarCubeDomain α ↔ ∀ i, 0 ≤ scalarCubeFace i a := by constructor · intro ha i rcases i with ⟨side, t⟩ cases side with | false => exact (ha t).1 | true => exact sub_nonneg.mpr (ha t).2 · intro ha t have hlo : 0 ≤ scalarCubeValue a t := ha (false, t) have hhi : 0 ≤ 1 - scalarCubeValue a t := ha (true, t) exact ⟨hlo, by linarith⟩
theorem closedScalarCubeDomain_coordinate_abs_le_one {α : Type*} [Fintype α] [DecidableEq α] {a : Option α → ℝ} (ha : a ∈ closedScalarCubeDomain α) (r : Option α) : |a r| ≤ 1 := by have hzero := ha ∅ rw [scalarCubeValue_empty] at hzero cases r with | none => exact abs_le.mpr ⟨by linarith [hzero.1], hzero.2⟩ | some i => have hi := ha {i} rw [scalarCubeValue_singleton] at hi exact abs_le.mpr ⟨by linarith [hzero.2, hi.1], by linarith [hzero.1, hi.2]⟩
theorem closedScalarCubeDomain_compact (α : Type*) [Fintype α] [DecidableEq α] : IsCompact (closedScalarCubeDomain α) := by apply Metric.isCompact_of_isClosed_isBounded (closedScalarCubeDomain_isClosed α) apply (Metric.isBounded_closedBall (x := (0 : Option α → ℝ)) (r := 1)).subset intro a ha rw [Metric.mem_closedBall, dist_zero_right] apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr intro r simpa only [Real.norm_eq_abs] using closedScalarCubeDomain_coordinate_abs_le_one ha r
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators
theorem closedScalarCubeFace_zero_volume {α : Type*} [Fintype α] [DecidableEq α] (i : Bool × Finset α) : volume (closedScalarCubeDomain α ∩ {a | scalarCubeFace i a = 0}) = 0 := by let Z := closedScalarCubeDomain α ∩ {a | scalarCubeFace i a = 0} have hZm : MeasurableSet Z := (closedScalarCubeDomain_isClosed α).measurableSet.inter (measurableSet_eq_fun (scalarCubeFace_contDiff i).continuous.measurable measurable_const) have hZfin : volume Z ≠ ⊤ := ne_of_lt ((measure_mono Set.inter_subset_left).trans_lt (closedScalarCubeDomain_compact α).measure_lt_top) let s : Set ((α → ℝ) × ℝ) := scalarCubeJoin ⁻¹' Z have hs : MeasurableSet s := hZm.preimage (scalarCubeJoin_measurable α) have hm := (scalarCubeJoin_measurePreserving α).measure_preimage hZm.nullMeasurableSet have hmr := (scalarCubeJoin_measurePreserving α).measureReal_preimage hZm.nullMeasurableSet have hsfin : (volume : Measure ((α → ℝ) × ℝ)) s ≠ ⊤ := by change volume (scalarCubeJoin ⁻¹' Z) ≠ ⊤ rw [hm] exact hZfin have hbase : ∀ z ∈ s, z.1 ∈ Metric.closedBall (0 : α → ℝ) 1 := by intro z hz rw [Metric.mem_closedBall, dist_zero_right] apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr intro k have h := closedScalarCubeDomain_coordinate_abs_le_one hz.1 (some k) simpa only [Real.norm_eq_abs, scalarCubeJoin_some] using h have hbound : ∀ b : α → ℝ, volume.real {y | (b, y) ∈ s} ≤ 0 := by intro b let c : ℝ := if i.1 then 1 - ∑ k ∈ i.2, b k else -(∑ k ∈ i.2, b k) have hsub : {y | (b, y) ∈ s} ⊆ {c} := by intro y hy have heq : scalarCubeFace i (scalarCubeJoin (b, y)) = 0 := hy.2 rw [scalarCubeJoin_face] at heq apply Set.mem_singleton_iff.mpr dsimp [c] split_ifs at heq ⊢ <;> linarith have h := measureReal_mono (μ := volume) hsub (by simp) simpa [measureReal_def] using h have h := product_measureReal_le_of_fiber_bound (volume : Measure (α → ℝ)) (volume : Measure ℝ) s hs hsfin (Metric.closedBall (0 : α → ℝ) 1) measurableSet_closedBall (isCompact_closedBall _ _).measure_ne_top hbase hbound change volume.real s ≤ _ at h rw [hmr, mul_zero] at h exact (measureReal_eq_zero_iff hZfin).mp (le_antisymm h measureReal_nonneg)
theorem closedScalarCubeDomain_boundary_null (α : Type*) [Fintype α] [DecidableEq α] : volume (closedScalarCubeDomain α \ scalarCubeDomain α) = 0 := by have hsub : closedScalarCubeDomain α \ scalarCubeDomain α ⊆ ⋃ i : Bool × Finset α, closedScalarCubeDomain α ∩ {a | scalarCubeFace i a = 0} := by intro a ha have hn : ¬ ∀ i, 0 < scalarCubeFace i a := by intro hp apply ha.2 rw [← positiveInequalityDomain_scalarCubeFace α] exact hp obtain ⟨i, hi⟩ := not_forall.mp hn have hz : scalarCubeFace i a = 0 := le_antisymm (le_of_not_gt hi) ((closedScalarCubeDomain_iff_faces a).mp ha.1 i) exact Set.mem_iUnion.mpr ⟨i, ha.1, hz⟩ exact measure_mono_null hsub (measure_iUnion_null closedScalarCubeFace_zero_volume)
theorem scalarCubeDomain_ae_closed (α : Type*) [Fintype α] [DecidableEq α] : scalarCubeDomain α =ᵐ[volume] closedScalarCubeDomain α := by apply ae_eq_set.mpr constructor · have he : scalarCubeDomain α \ closedScalarCubeDomain α = ∅ := by apply Set.eq_empty_iff_forall_notMem.mpr intro a ha exact ha.2 (scalarCubeDomain_subset_closed α ha.1) rw [he, measure_empty] · exact closedScalarCubeDomain_boundary_null α
noncomputable def closedScalarCubeMeasure (α : Type*) [Fintype α] [DecidableEq α] : Measure (Option α → ℝ) := (volume (closedScalarCubeDomain α))⁻¹ • volume.restrict (closedScalarCubeDomain α)
theorem closedScalarCubeMeasure_eq (α : Type*) [Fintype α] [DecidableEq α] : closedScalarCubeMeasure α = scalarCubeMeasure α := by have hvol := measure_congr (scalarCubeDomain_ae_closed α) have hrestrict := Measure.restrict_congr_set (scalarCubeDomain_ae_closed α) simp only [closedScalarCubeMeasure, scalarCubeMeasure, ← hvol, ← hrestrict]
instance closedScalarCubeMeasure_probability (α : Type*) [Fintype α] [DecidableEq α] : IsProbabilityMeasure (closedScalarCubeMeasure α) := by rw [closedScalarCubeMeasure_eq] infer_instance
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped Classical
def halfOpenScalarCubeDomain (I : Type*) [Fintype I] [DecidableEq I] : Set (Option I → ℝ) := {x | ∀ t : Finset I, scalarCubeValue x t ∈ Set.Ico (0 : ℝ) 1}
theorem halfOpenScalarCubeDomain_measurable (I : Type*) [Fintype I] [DecidableEq I] : MeasurableSet (halfOpenScalarCubeDomain I) := by have he : halfOpenScalarCubeDomain I = ⋂ t : Finset I, (fun x => scalarCubeValue x t) ⁻¹' Set.Ico (0 : ℝ) 1 := by ext x simp only [halfOpenScalarCubeDomain, Set.mem_ofPred_eq, Set.mem_iInter, Set.mem_preimage] rw [he] exact MeasurableSet.iInter (fun (t : Finset I) => measurableSet_Ico.preimage (scalarCubeValue_contDiff t).continuous.measurable)
theorem scalarCubeDomain_subset_halfOpen (I : Type*) [Fintype I] [DecidableEq I] : scalarCubeDomain I ⊆ halfOpenScalarCubeDomain I := fun _ hx t => ⟨(hx t).1.le, (hx t).2⟩
theorem halfOpenScalarCubeDomain_subset_closed (I : Type*) [Fintype I] [DecidableEq I] : halfOpenScalarCubeDomain I ⊆ closedScalarCubeDomain I := fun _ hx t => ⟨(hx t).1, (hx t).2.le⟩
theorem halfOpenScalarCubeDomain_norm_le {I : Type*} [Fintype I] [DecidableEq I] {x : Option I → ℝ} (hx : x ∈ halfOpenScalarCubeDomain I) : ‖x‖ ≤ 1 := by apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr intro i exact closedScalarCubeDomain_coordinate_abs_le_one (halfOpenScalarCubeDomain_subset_closed I hx) i
theorem halfOpenScalarCubeDomain_ae (I : Type*) [Fintype I] [DecidableEq I] : halfOpenScalarCubeDomain I =ᵐ[volume] scalarCubeDomain I := by filter_upwards [scalarCubeDomain_ae_closed I] with x hx apply propext have hx' : x ∈ scalarCubeDomain I ↔ x ∈ closedScalarCubeDomain I := iff_of_eq hx constructor · intro h exact hx'.mpr (halfOpenScalarCubeDomain_subset_closed I h) · exact fun h => scalarCubeDomain_subset_halfOpen I h
noncomputable def scalarCubeIndicator (I : Type*) [Fintype I] [DecidableEq I] (x : Option I → ℝ) : ℝ := if x ∈ halfOpenScalarCubeDomain I then 1 else 0
theorem scalarCubeIndicator_range (I : Type*) [Fintype I] [DecidableEq I] (x : Option I → ℝ) : 0 ≤ scalarCubeIndicator I x ∧ scalarCubeIndicator I x ≤ 1 := by unfold scalarCubeIndicator split_ifs <;> norm_num
theorem scalarCubeIndicator_zero_outside (I : Type*) [Fintype I] [DecidableEq I] (x : Option I → ℝ) (hx : 1 < ‖x‖) : scalarCubeIndicator I x = 0 := by apply ite_eq_right exact fun h => (not_lt_of_ge (halfOpenScalarCubeDomain_norm_le h)) hx
theorem scalarCubeIndicator_integrable (I : Type*) [Fintype I] [DecidableEq I] : Integrable (scalarCubeIndicator I) := by change Integrable ((halfOpenScalarCubeDomain I).indicator (fun _ => (1 : ℝ))) exact (integrableOn_const ((measure_mono (halfOpenScalarCubeDomain_subset_closed I)).trans_lt (closedScalarCubeDomain_compact I).measure_lt_top).ne).integrable_indicator (halfOpenScalarCubeDomain_measurable I)
theorem scalarCubeIndicator_integral (I : Type*) [Fintype I] [DecidableEq I] : (∫ x, scalarCubeIndicator I x) = volume.real (scalarCubeDomain I) := by have he : scalarCubeIndicator I =ᵐ[volume] (scalarCubeDomain I).indicator (fun _ => (1 : ℝ)) := by filter_upwards [halfOpenScalarCubeDomain_ae I] with x hx have hx' : (x ∈ halfOpenScalarCubeDomain I) = (x ∈ scalarCubeDomain I) := hx change (if x ∈ halfOpenScalarCubeDomain I then 1 else 0) = if x ∈ scalarCubeDomain I then 1 else 0 rw [hx'] rw [integral_congr_ae he] exact integral_indicator_one (scalarCubeDomain_isOpen I).measurableSet
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators
theorem scalarCubeValue_smul {α : Type*} [Fintype α] [DecidableEq α] (T : ℝ) (a : Option α → ℝ) (vertex : Finset α) : scalarCubeValue (T • a) vertex = T * scalarCubeValue a vertex := by simp only [scalarCubeValue, Pi.smul_apply, smul_eq_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro r _ ring
def scaledScalarCubeDomain (α : Type*) [Fintype α] [DecidableEq α] (T : ℝ) : Set (Option α → ℝ) := {a | ∀ vertex : Finset α, scalarCubeValue a vertex ∈ Set.Ioo (0 : ℝ) T}
theorem scaledScalarCubeDomain_smul_iff {α : Type*} [Fintype α] [DecidableEq α] {T : ℝ} (hT : 0 < T) (a : Option α → ℝ) : T • a ∈ scaledScalarCubeDomain α T ↔ a ∈ scalarCubeDomain α := by change (∀ vertex, 0 < scalarCubeValue (T • a) vertex ∧ scalarCubeValue (T • a) vertex < T) ↔ _ simp only [scalarCubeValue_smul, mul_pos_iff_of_pos_left hT, mul_lt_iff_lt_one_right hT] rfl
theorem scaledScalarCubeDomain_eq_image {α : Type*} [Fintype α] [DecidableEq α] {T : ℝ} (hT : 0 < T) : scaledScalarCubeDomain α T = (T • ·) '' scalarCubeDomain α := by ext a constructor · intro ha refine ⟨T⁻¹ • a, ?_, smul_inv_smul₀ hT.ne' a⟩ apply (scaledScalarCubeDomain_smul_iff hT _).mp simpa only [smul_inv_smul₀ hT.ne'] using ha · rintro ⟨a, ha, rfl⟩ exact (scaledScalarCubeDomain_smul_iff hT a).mpr ha
theorem scaledScalarCubeDomain_isOpen (α : Type*) [Fintype α] [DecidableEq α] (T : ℝ) : IsOpen (scaledScalarCubeDomain α T) := by have he : scaledScalarCubeDomain α T = ⋂ vertex : Finset α, (scalarCubeValue · vertex) ⁻¹' Set.Ioo (0 : ℝ) T := by ext a simp [scaledScalarCubeDomain] rw [he] exact isOpen_iInter_of_finite (fun vertex => isOpen_Ioo.preimage (scalarCubeValue_contDiff vertex).continuous)
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators
def scalarCubeFaceSlab {I : Type*} [Fintype I] [DecidableEq I] (i : Bool × Finset I) (u : ℝ) : Set (Option I → ℝ) := Metric.closedBall 0 2 ∩ {x | |scalarCubeFace i x| ≤ u}
theorem scalarCubeFaceSlab_measurable {I : Type*} [Fintype I] [DecidableEq I] (i : Bool × Finset I) (u : ℝ) : MeasurableSet (scalarCubeFaceSlab i u) := measurableSet_closedBall.inter (measurableSet_le (scalarCubeFace_contDiff i).continuous.abs.measurable measurable_const)
theorem scalarCubeFaceSlab_finite {I : Type*} [Fintype I] [DecidableEq I] (i : Bool × Finset I) (u : ℝ) : volume (scalarCubeFaceSlab i u) ≠ ⊤ := ne_of_lt ((measure_mono Set.inter_subset_left).trans_lt (isCompact_closedBall _ _).measure_lt_top)
theorem scalarCubeFaceSlab_fiber_bound {I : Type*} [Fintype I] [DecidableEq I] (i : Bool × Finset I) {u : ℝ} (hu : 0 ≤ u) (b : I → ℝ) : volume.real {y | scalarCubeJoin (b, y) ∈ scalarCubeFaceSlab i u} ≤ 2*u := by let c : ℝ := if i.1 then 1 - ∑ k ∈ i.2, b k else -(∑ k ∈ i.2, b k) have hsub : {y | scalarCubeJoin (b, y) ∈ scalarCubeFaceSlab i u} ⊆ Set.Icc (c-u) (c+u) := by intro y hy have hraw : |scalarCubeFace i (scalarCubeJoin (b,y))| ≤ u := hy.2 have h := abs_le.mp hraw rw [scalarCubeJoin_face] at h dsimp only [c] split_ifs at h ⊢ <;> constructor <;> linarith have hv : volume.real (Set.Icc (c-u) (c+u)) = 2*u := by rw [Real.volume_real_Icc] simp only [show c+u-(c-u) = 2*u by ring, max_eq_left (by positivity : 0 ≤ 2*u)] exact (measureReal_mono (μ := volume) hsub (by simp [Real.volume_Icc])).trans_eq hv
theorem scalarCubeFaceSlab_volume_le {I : Type*} [Fintype I] [DecidableEq I] (i : Bool × Finset I) {u : ℝ} (hu : 0 ≤ u) : volume.real (scalarCubeFaceSlab i u) ≤ (4 : ℝ)^Fintype.card I * (2*u) := by let s := scalarCubeJoin ⁻¹' scalarCubeFaceSlab i u have hs : MeasurableSet s := (scalarCubeFaceSlab_measurable i u).preimage (scalarCubeJoin_measurable I) have hm := (scalarCubeJoin_measurePreserving I).measure_preimage (scalarCubeFaceSlab_measurable i u).nullMeasurableSet have hmr := (scalarCubeJoin_measurePreserving I).measureReal_preimage (scalarCubeFaceSlab_measurable i u).nullMeasurableSet have hfin : (volume : Measure ((I → ℝ) × ℝ)) s ≠ ⊤ := by change volume (scalarCubeJoin ⁻¹' scalarCubeFaceSlab i u) ≠ ⊤ rw [hm] exact scalarCubeFaceSlab_finite i u have hb : ∀ z ∈ s, z.1 ∈ Metric.closedBall (0 : I → ℝ) 2 := by intro z hz rw [Metric.mem_closedBall, dist_zero_right] apply (pi_norm_le_iff_of_nonneg (by norm_num)).mpr intro k have hh : ‖scalarCubeJoin z‖ ≤ 2 := by simpa only [Metric.mem_closedBall, dist_zero_right] using hz.1 exact (norm_le_pi_norm (scalarCubeJoin z) (some k)).trans hh have h := product_measureReal_le_of_fiber_bound (volume : Measure (I → ℝ)) (volume : Measure ℝ) s hs hfin (Metric.closedBall (0 : I → ℝ) 2) measurableSet_closedBall (isCompact_closedBall _ _).measure_ne_top hb (scalarCubeFaceSlab_fiber_bound i hu) change volume.real s ≤ _ at h rw [hmr] at h have hbase : volume.real (Metric.closedBall (0 : I → ℝ) 2) = (4 : ℝ)^Fintype.card I := by rw [measureReal_def, Real.volume_pi_closedBall _ (by norm_num)] norm_num rwa [hbase] at h
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182import OAI.Combinatorics.Progressions.Lattices.CubeResidueSupport
namespace OAI
section
namespace Erdos3
def shiftScalarCube {I : Type*} (c : ℤ) (x : Option I → ℤ) : Option I → ℤ | none => c + x none | some i => x (some i)
def shiftScalarCubeResidues {I : Type*} (c : ℤ) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) : ∀ i, ZMod (m i) | none => r none - (c : ZMod (m none)) | some i => r (some i)
theorem shiftScalarCube_value {I : Type*} [Fintype I] (c : ℤ) (x : Option I → ℤ) (t : Finset I) : integerScalarCubeValue (shiftScalarCube c x) t = c + integerScalarCubeValue x t := by simp only [integerScalarCubeValue, shiftScalarCube, add_assoc]
theorem shiftScalarCube_residues_iff {I : Type*} (c : ℤ) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) (x : Option I → ℤ) : (∀ i, ((shiftScalarCube c x i : ℤ) : ZMod (m i)) = r i) ↔ ∀ i, ((x i : ℤ) : ZMod (m i)) = shiftScalarCubeResidues c m r i := by constructor · intro h i cases i with | none => simpa [shiftScalarCube, shiftScalarCubeResidues, eq_sub_iff_add_eq, add_comm] using h none | some i => exact h (some i) · intro h i cases i with | none => simpa [shiftScalarCube, shiftScalarCubeResidues, eq_sub_iff_add_eq, add_comm] using h none | some i => exact h (some i)
def supportedCubeCoordinates {q : ℕ} (p : (Fin q → ℤ) × ℤ) : Option (Fin q) → ℤ | none => p.2 | some i => p.1 i
def supportedIntervalTranslateEquiv (q K : ℕ) (c : ℤ) : SupportedCube q (Set.Ico (0 : ℤ) (K : ℤ)) ≃ SupportedCube q (Set.Ico c (c + K)) where toFun p := ⟨(p.val.1, c + p.val.2), fun ω => by have h := p.property ω change 0 ≤ p.val.2 + cubeShift p.val.1 ω ∧ p.val.2 + cubeShift p.val.1 ω < K at h change c ≤ c + p.val.2 + cubeShift p.val.1 ω ∧ c + p.val.2 + cubeShift p.val.1 ω < c + K constructor <;> omega⟩ invFun p := ⟨(p.val.1, p.val.2 - c), fun ω => by have h := p.property ω change c ≤ p.val.2 + cubeShift p.val.1 ω ∧ p.val.2 + cubeShift p.val.1 ω < c + K at h change 0 ≤ p.val.2 - c + cubeShift p.val.1 ω ∧ p.val.2 - c + cubeShift p.val.1 ω < K constructor <;> omega⟩ left_inv p := by apply Subtype.ext apply Prod.ext · rfl · simp right_inv p := by apply Subtype.ext apply Prod.ext · rfl · simp
noncomputable def shiftedScalarCubeEquiv (q K : ℕ) (c : ℤ) : ↥(integerScalarCubeSet (Fin q) K) ≃ SupportedCube q (Set.Ico c (c + K)) := (integerScalarCubeEquiv q K).trans (supportedIntervalTranslateEquiv q K c)
theorem shiftedScalarCubeEquiv_coordinates (q K : ℕ) (c : ℤ) (x : ↥(integerScalarCubeSet (Fin q) K)) : supportedCubeCoordinates (shiftedScalarCubeEquiv q K c x).val = shiftScalarCube c (fun i => (x.val i : ℤ)) := by funext i cases i <;> rfl
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788import OAI.Combinatorics.Progressions.Lattices.CubeResidueSupport
namespace OAI
section
namespace Erdos3
theorem integerScalarCube_mono {I : Type*} [Fintype I] {K L : ℕ} (hKL : K ≤ L) {x : Option I → ℤ} (hx : IntegerScalarCube K x) : IntegerScalarCube L x := by intro t exact ⟨(hx t).1, (hx t).2.trans_le (by exact_mod_cast hKL)⟩
def integerScalarCubeBoxEmbed (I : Type*) (K L : ℕ) (hKL : K ≤ L) (x : IntegerScalarCubeBox I K) : IntegerScalarCubeBox I L := fun i => ⟨(x i : ℤ), Finset.mem_Ico.mpr (by have hi := Finset.mem_Ico.mp (x i).property constructor <;> omega)⟩
noncomputable def scalarCubeWindowResidueSet (I : Type*) [Fintype I] (L K : ℕ) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) : Finset (IntegerScalarCubeBox I L) := by classical exact Finset.univ.filter (fun x => IntegerScalarCube K (fun i => (x i : ℤ)) ∧ ∀ i, ((x i : ℤ) : ZMod (m i)) = r i)
theorem mem_scalarCubeWindowResidueSet {I : Type*} [Fintype I] (L K : ℕ) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) (x : IntegerScalarCubeBox I L) : x ∈ scalarCubeWindowResidueSet I L K m r ↔ IntegerScalarCube K (fun i => (x i : ℤ)) ∧ ∀ i, ((x i : ℤ) : ZMod (m i)) = r i := by classical simp only [scalarCubeWindowResidueSet, Finset.mem_filter, Finset.mem_univ, true_and]
theorem scalarCubeWindowResidueSet_subset {I : Type*} [Fintype I] (L K : ℕ) (hKL : K ≤ L) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) : scalarCubeWindowResidueSet I L K m r ⊆ integerScalarCubeSet I L := by intro x hx exact (mem_integerScalarCubeSet L x).mpr (integerScalarCube_mono hKL ((mem_scalarCubeWindowResidueSet L K m r x).mp hx).1)
noncomputable def scalarCubeWindowResidueEquiv (I : Type*) [Fintype I] [DecidableEq I] (L K : ℕ) (hKL : K ≤ L) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) : ↥((integerScalarCubeSet I K) ∩ scalarCubeResidueSet I K m r) ≃ ↥(scalarCubeWindowResidueSet I L K m r) where toFun x := by have hx := Finset.mem_inter.mp x.property exact ⟨integerScalarCubeBoxEmbed I K L hKL x.val, (mem_scalarCubeWindowResidueSet L K m r _).mpr ⟨(mem_integerScalarCubeSet K x.val).mp hx.1, (mem_scalarCubeResidueSet K m r x.val).mp hx.2⟩⟩ invFun y := by have hy := (mem_scalarCubeWindowResidueSet L K m r y.val).mp y.property let x : IntegerScalarCubeBox I K := fun i => ⟨(y.val i : ℤ), Finset.mem_Ico.mpr ⟨(integerScalarCube_coordinates hy.1 i).1.le, (integerScalarCube_coordinates hy.1 i).2⟩⟩ exact ⟨x, Finset.mem_inter.mpr ⟨(mem_integerScalarCubeSet K x).mpr hy.1, (mem_scalarCubeResidueSet K m r x).mpr hy.2⟩⟩ left_inv x := by apply Subtype.ext funext i apply Subtype.ext rfl right_inv y := by apply Subtype.ext funext i apply Subtype.ext rfl
theorem scalarCubeWindowResidueSet_card (I : Type*) [Fintype I] [DecidableEq I] (L K : ℕ) (hKL : K ≤ L) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) : (scalarCubeWindowResidueSet I L K m r).card = ((integerScalarCubeSet I K) ∩ scalarCubeResidueSet I K m r).card := by simpa only [Fintype.card_coe] using (Fintype.card_congr (scalarCubeWindowResidueEquiv I L K hKL m r)).symm
theorem scalarCubeWindowResidueSet_card_lower (I : Type*) [Fintype I] [DecidableEq I] (L K M H : ℕ) (hKL : K ≤ L) (m : Option I → ℕ) (r : ∀ i, ZMod (m i)) (hm : ∀ i, 0 < m i) (hmM : ∀ i, m i ≤ M) (hH : 0 < H) (hbudget : (Fintype.card I + 1) * (M * H) ≤ K) : H ^ (Fintype.card I + 1) ≤ (scalarCubeWindowResidueSet I L K m r).card := by rw [scalarCubeWindowResidueSet_card I L K hKL m r] exact scalarCubeResidueSet_card_lower I K M H m r hm hmM hH hbudget
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481import Mathlib.Analysis.SpecialFunctions.Expimport Mathlib.Data.Set.Cardimport OAI.Combinatorics.Progressions.Geometry.ProductSectionSupportimport OAI.Combinatorics.Progressions.Probability.FiniteExcessMassCapimport OAI.Combinatorics.Progressions.Probability.IntervalDivisorProbability
namespace OAI
section
namespace Erdos3
open scoped BigOperators
namespace FiniteProbabilityWeights
theorem mean_comm {X Y : Type*} [Fintype X] [Fintype Y] (p : FiniteProbabilityWeights X) (q : FiniteProbabilityWeights Y) (F : X → Y → ℝ) : p.mean (fun x => q.mean (F x)) = q.mean (fun y => p.mean (fun x => F x y)) := by unfold mean simp_rw [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro y _ apply Finset.sum_congr rfl intro x _ ring
theorem mean_sum {X J : Type*} [Fintype X] (p : FiniteProbabilityWeights X) (s : Finset J) (F : J → X → ℝ) : p.mean (fun x => ∑ j ∈ s, F j x) = ∑ j ∈ s, p.mean (F j) := by unfold mean simp_rw [Finset.mul_sum] exact Finset.sum_comm
theorem mean_sub {X : Type*} [Fintype X] (p : FiniteProbabilityWeights X) (f g : X → ℝ) : p.mean (fun x => f x - g x) = p.mean f - p.mean g := by simp only [mean, mul_sub, Finset.sum_sub_distrib]
theorem mean_mul_const {X : Type*} [Fintype X] (p : FiniteProbabilityWeights X) (f : X → ℝ) (c : ℝ) : p.mean (fun x => f x * c) = p.mean f * c := by simp only [mean, ← mul_assoc, Finset.sum_mul]
end FiniteProbabilityWeights
variable {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)]
theorem productMean_coordinateSwap (μ : ∀ i, FiniteProbabilityWeights (X i)) (S : Finset I) (F : (∀ i, X i) → (∀ i, X i) → ℝ) : (FiniteProbabilityWeights.pi μ).mean (fun x => (FiniteProbabilityWeights.pi μ).mean (fun y => F (productCoordinateMix S x y) (productCoordinateMix S y x))) = (FiniteProbabilityWeights.pi μ).mean (fun x => (FiniteProbabilityWeights.pi μ).mean (F x)) := by let p := FiniteProbabilityWeights.pi μ have h : (∑ z : (∀ i, X i) × (∀ i, X i), p.weight z.1 * p.weight z.2 * F (productCoordinateMix S z.1 z.2) (productCoordinateMix S z.2 z.1)) = ∑ z : (∀ i, X i) × (∀ i, X i), p.weight z.1 * p.weight z.2 * F z.1 z.2 := by apply Fintype.sum_equiv (productCoordinateSwap (X := X) S) intro z change _ = p.weight (productCoordinateMix S z.1 z.2) * p.weight (productCoordinateMix S z.2 z.1) * _ rw [productCoordinateMix_weight] rfl simpa only [FiniteProbabilityWeights.mean, Fintype.sum_prod_type, Finset.mul_sum, mul_assoc] using h
theorem productMean_coordinateMix (μ : ∀ i, FiniteProbabilityWeights (X i)) (S : Finset I) (f : (∀ i, X i) → ℝ) : (FiniteProbabilityWeights.pi μ).mean (fun x => (FiniteProbabilityWeights.pi μ).mean (fun y => f (productCoordinateMix S x y))) = (FiniteProbabilityWeights.pi μ).mean f := by have h := productMean_coordinateSwap μ S (fun x _ => f x) simpa only [FiniteProbabilityWeights.mean_const] using h
end Erdos3
end
section
namespace Erdos3.FiniteProbabilityWeights
open scoped BigOperators Classical
theorem exists_code_fiber_mass {Ω I : Type*} [Fintype Ω] [Fintype I] [Nonempty I] (p : FiniteProbabilityWeights Ω) (Q : Finset Ω) (code : Ω → I) : ∃ i, p.mass Q / Fintype.card I ≤ p.mass (Q.filter (fun x => code x = i)) := by have hsum : (∑ i, p.mass (Q.filter (fun x => code x = i))) = p.mass Q := by simp only [mass, Finset.sum_filter] rw [Finset.sum_comm] simp have hmean : (𝔼 i, p.mass (Q.filter (fun x => code x = i))) = p.mass Q / Fintype.card I := by rw [Fintype.expect_eq_sum_div_card, hsum] obtain ⟨i, _, hi⟩ := Finset.exists_le_of_le_expect Finset.univ_nonempty hmean.ge exact ⟨i, hi⟩
end Erdos3.FiniteProbabilityWeights
end
section
namespace Erdos3.FiniteProbabilityWeights
open scoped BigOperators Classical
theorem retain_simultaneous_mean_error {Ω J : Type*} [Fintype Ω] [Fintype J] (p : FiniteProbabilityWeights Ω) (productive : Finset Ω) (err : J → Ω → ℝ) (herr : ∀ j a, 0 ≤ err j a) {tau : ℝ} (htau : 0 < tau) : ∃ retained : Finset Ω, retained ⊆ productive ∧ p.mass productive - (∑ j, p.mean (err j)) / tau ≤ p.mass retained ∧ ∀ a ∈ retained, ∀ j, err j a ≤ tau := by let retained := productive.filter (fun a => ∀ j, err j a ≤ tau) have hpoint (a : Ω) : tau * ((if a ∈ productive then (1 : ℝ) else 0) - (if a ∈ retained then 1 else 0)) ≤ ∑ j, err j a := by by_cases ha : a ∈ productive · by_cases hg : ∀ j, err j a ≤ tau · have hret : a ∈ retained := Finset.mem_filter.mpr ⟨ha, hg⟩ simp only [ha, hret, ite_true, sub_self, mul_zero] exact Finset.sum_nonneg (fun j _ => herr j a) · have hret : a ∉ retained := by simpa only [retained, Finset.mem_filter, ha, true_and] using hg simp only [ha, hret, ite_true, ite_false, sub_zero, mul_one] push Not at hg obtain ⟨j, hj⟩ := hg exact hj.le.trans (Finset.single_le_sum (fun i _ => herr i a) (Finset.mem_univ j)) · have hret : a ∉ retained := fun h => ha (Finset.mem_filter.mp h).1 simp only [ha, hret, ite_false, sub_self, mul_zero] exact Finset.sum_nonneg (fun j _ => herr j a) have h := p.mean_mono hpoint rw [p.mean_const_mul, p.mean_sub, p.mean_indicator, p.mean_indicator, p.mean_sum] at h have hdiv : p.mass productive - p.mass retained ≤ (∑ j, p.mean (err j)) / tau := (le_div_iff₀ htau).mpr (by simpa only [mul_comm] using h) refine ⟨retained, Finset.filter_subset _ _, by linarith, ?_⟩ intro a ha exact (Finset.mem_filter.mp ha).2
theorem retain_simultaneous_small_mean_error {Ω J : Type*} [Fintype Ω] [Fintype J] (p : FiniteProbabilityWeights Ω) (productive : Finset Ω) (err : J → Ω → ℝ) (herr : ∀ j a, 0 ≤ err j a) {tau kappa : ℝ} (htau : 0 < tau) (hproductive : kappa ≤ p.mass productive) (hmean : (∑ j, p.mean (err j)) ≤ kappa * tau / 4) : ∃ retained : Finset Ω, retained ⊆ productive ∧ 3 * kappa / 4 ≤ p.mass retained ∧ ∀ a ∈ retained, ∀ j, err j a ≤ tau := by obtain ⟨retained, hsub, hmass, hgood⟩ := p.retain_simultaneous_mean_error productive err herr htau have hdiv : (∑ j, p.mean (err j)) / tau ≤ kappa / 4 := (div_le_iff₀ htau).mpr (by nlinarith) exact ⟨retained, hsub, by linarith, hgood⟩
end Erdos3.FiniteProbabilityWeights
end
section
namespace Erdos3
theorem exists_weighted_exponential_constant_fiber {Ω β : Type*} [Fintype Ω] (outer : FiniteProbabilityWeights Ω) (S : Finset Ω) (hS : 0 < outer.mass S) (f : Ω → β) (A : Set β) (hA : A.Finite) (hf : ∀ x ∈ S, f x ∈ A) {C : ℝ} (hcount : (A.ncard : ℝ) ≤ Real.exp C) : ∃ y ∈ A, ∃ T : Finset Ω, T ⊆ S ∧ T.Nonempty ∧ (∀ x ∈ T, f x = y) ∧ Real.exp (-C) * outer.mass S ≤ outer.mass T := by classical have hSne : S.Nonempty := by apply Finset.nonempty_iff_ne_empty.mpr intro he simp only [he, FiniteProbabilityWeights.mass, Finset.sum_empty, lt_self_iff_false] at hS obtain ⟨x₀, hx₀⟩ := hSne let : Fintype A := hA.fintype let default : A := ⟨f x₀, hf x₀ hx₀⟩ let : Nonempty A := ⟨default⟩ let code : Ω → A := fun x => if hx : x ∈ S then ⟨f x, hf x hx⟩ else default obtain ⟨y, hy⟩ := outer.exists_code_fiber_mass S code let T := S.filter (fun x => code x = y) have hcard : (Fintype.card A : ℝ) ≤ Real.exp C := by simpa only [Set.fintypeCard_eq_ncard] using hcount have hcardpos : (0 : ℝ) < Fintype.card A := by exact_mod_cast Fintype.card_pos have hmass : Real.exp (-C) * outer.mass S ≤ outer.mass T := by calc _ = outer.mass S / Real.exp C := by rw [Real.exp_neg, div_eq_mul_inv, mul_comm] _ ≤ outer.mass S / Fintype.card A := div_le_div_of_nonneg_left hS.le hcardpos hcard _ ≤ outer.mass T := by convert hy using 1 apply congrArg outer.mass ext x simp only [T, Finset.mem_filter] have hTpos : 0 < outer.mass T := (mul_pos (Real.exp_pos _) hS).trans_le hmass have hTne : T.Nonempty := by apply Finset.nonempty_iff_ne_empty.mpr intro he simp only [he, FiniteProbabilityWeights.mass, Finset.sum_empty, lt_self_iff_false] at hTpos refine ⟨y.val, y.property, T, Finset.filter_subset _ _, hTne, ?_, hmass⟩ intro x hx have hxS : x ∈ S := (Finset.mem_filter.mp hx).1 have he := congrArg Subtype.val (Finset.mem_filter.mp hx).2 simpa only [code, dite_eq_left hxS] using he
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
theorem exists_linear_model_partner {V I : Type*} [AddCommGroup V] [Module ℂ V] [Fintype I] (test : V →ₗ[ℂ] ℂ) (v e : V) (Q : I → V) (c : I → ℂ) (hmodel : v = (∑ i, c i • Q i) + e) {delta M : ℝ} (hdelta : 0 < delta) (hM : 0 < M) (hc : (∑ i, ‖c i‖) ≤ M) (herr : ‖test e‖ ≤ delta / 2) (hscore : delta ≤ ‖test v‖) : ∃ i, delta / (2 * M) ≤ ‖test (Q i)‖ := by have hid : test v = (∑ i, c i * test (Q i)) + test e := by rw [hmodel, map_add, map_sum] simp only [map_smul, smul_eq_mul] have hsum : delta / 2 ≤ ‖∑ i, c i * test (Q i)‖ := by have ht := norm_add_le (∑ i, c i * test (Q i)) (test e) rw [← hid] at ht linarith obtain ⟨i, hi⟩ := exists_large_weighted_term c (fun i => test (Q i)) (by positivity : 0 < delta / 2) hM hc hsum refine ⟨i, ?_⟩ convert hi using 1; ring
theorem exists_fixed_linear_model_partners {Ω K V : Type*} {I : K → Type*} [Fintype Ω] [Fintype K] [∀ k, Fintype (I k)] [∀ k, Nonempty (I k)] [AddCommGroup V] [Module ℂ V] (outer : FiniteProbabilityWeights Ω) (productive : Finset Ω) (v e : K → V) (Q : ∀ k, I k → V) (c : ∀ k, I k → ℂ) (test : Ω → K → V →ₗ[ℂ] ℂ) (err : K → Ω → ℝ) (hmodel : ∀ k, v k = (∑ i, c k i • Q k i) + e k) {delta M kappa : ℝ} (hdelta : 0 < delta) (hM : 0 < M) (hc : ∀ k, (∑ i, ‖c k i‖) ≤ M) (herr : ∀ k a, 0 ≤ err k a) (htest : ∀ a ∈ productive, ∀ k, ‖test a k (e k)‖ ≤ err k a) (hproductive : kappa ≤ outer.mass productive) (hmean : (∑ k, outer.mean (err k)) ≤ kappa * (delta / 2) / 4) (hscore : ∀ a ∈ productive, ∀ k, delta ≤ ‖test a k (v k)‖) : ∃ (partner : ∀ k, I k) (retained : Finset Ω), retained ⊆ productive ∧ (3 * kappa / 4) / (∏ k, (Fintype.card (I k) : ℝ)) ≤ outer.mass retained ∧ ∀ a ∈ retained, ∀ k, delta / (2 * M) ≤ ‖test a k (Q k (partner k))‖ := by obtain ⟨good, hgood, hmass, herrors⟩ := outer.retain_simultaneous_small_mean_error productive err herr (by positivity : 0 < delta / 2) hproductive hmean have hex (a : Ω) (ha : a ∈ good) (k : K) : ∃ i, delta / (2 * M) ≤ ‖test a k (Q k i)‖ := exists_linear_model_partner (test a k) (v k) (e k) (Q k) (c k) (hmodel k) hdelta hM (hc k) ((htest a (hgood ha) k).trans (herrors a ha k)) (hscore a (hgood ha) k) let choice : Ω → ∀ k, I k := fun a k => if ha : a ∈ good then Classical.choose (hex a ha k) else Classical.choice inferInstance have hchoice (a : Ω) (ha : a ∈ good) (k : K) : delta / (2 * M) ≤ ‖test a k (Q k (choice a k))‖ := by dsimp only [choice] rw [dite_eq_left ha] exact Classical.choose_spec (hex a ha k) obtain ⟨partner, hpartner⟩ := outer.exists_code_fiber_mass good choice let retained := good.filter (fun a => choice a = partner) have hretained : retained ⊆ good := Finset.filter_subset _ _ refine ⟨partner, retained, fun a ha => hgood (hretained ha), ?_, ?_⟩ · have hcard : (Fintype.card (∀ k, I k) : ℝ) = ∏ k, (Fintype.card (I k) : ℝ) := by simp rw [hcard] at hpartner have h := (div_le_div_of_nonneg_right hmass (by positivity : 0 ≤ ∏ k, (Fintype.card (I k) : ℝ))).trans hpartner convert h using 1; try rfl congr 1 ext a simp only [retained, Finset.mem_filter] · intro a ha k have he := (Finset.mem_filter.mp ha).2 rw [← he] exact hchoice a (hretained ha) k
end Erdos3
end
section
namespace Erdos3
open scoped Classical
theorem fixedParameter_observed_tail_of_tests {X T A : Type*} [Fintype X] [Fintype T] (source : FiniteProbabilityWeights X) (parameter : FiniteProbabilityWeights T) (observe : X → A) (value : T → A → ℝ) {gap bound : ℝ} (hgap : 0 < gap) (htest : ∀ w : A → ℝ, (∀ x, 0 ≤ w (observe x) ∧ w (observe x) ≤ 1) → (parameter.prod source).mean (fun tx => w (observe tx.2) * value tx.1 (observe tx.2)) ≤ gap * bound) : source.eventProbability (fun x => gap < parameter.mean (fun t => value t (observe x))) ≤ bound := by let w : A → ℝ := fun z => if gap < parameter.mean (fun t => value t z) then 1 else 0 have hw (x) : 0 ≤ w (observe x) ∧ w (observe x) ≤ 1 := by dsimp only [w] split_ifs <;> norm_num have hup := htest w hw rw [FiniteProbabilityWeights.mean_prod, FiniteProbabilityWeights.mean_comm] at hup simp only [FiniteProbabilityWeights.mean_const_mul] at hup have hlow : gap * source.eventProbability (fun x => gap < parameter.mean (fun t => value t (observe x))) ≤ source.mean (fun x => w (observe x) * parameter.mean (fun t => value t (observe x))) := by rw [FiniteProbabilityWeights.eventProbability, ← source.mean_const_mul] apply source.mean_mono intro x dsimp only [w] split_ifs with hx · simpa only [mul_one, one_mul] using hx.le · simp only [mul_zero, zero_mul, le_refl] exact (mul_le_mul_iff_right₀ hgap).mp (hlow.trans hup)
theorem fixedParameter_observed_tail_exp {X T A : Type*} [Fintype X] [Fintype T] (source : FiniteProbabilityWeights X) (parameter : FiniteProbabilityWeights T) (observe : X → A) (value : T → A → ℝ) (p dominationLog : ℝ) (htest : ∀ w : A → ℝ, (∀ x, 0 ≤ w (observe x) ∧ w (observe x) ≤ 1) → (parameter.prod source).mean (fun tx => w (observe tx.2) * value tx.1 (observe tx.2)) ≤ Real.exp (-(2 * p + dominationLog)) / 2) : source.eventProbability (fun x => Real.exp (-p) < parameter.mean (fun t => value t (observe x))) ≤ Real.exp (-(p + dominationLog)) := by apply fixedParameter_observed_tail_of_tests source parameter observe value (Real.exp_pos (-p)) intro w hw apply (htest w hw).trans rw [← Real.exp_add] have he : -p + -(p + dominationLog) = -(2 * p + dominationLog) := by ring rw [he] linarith [Real.exp_pos (-(2 * p + dominationLog))]
theorem fixedParameter_observed_tail_dominated {X T A : Type*} [Fintype X] [Fintype T] (source outer : FiniteProbabilityWeights X) (parameter : FiniteProbabilityWeights T) (observe : X → A) (value : T → A → ℝ) (p dominationLog : ℝ) (hdom : ∀ x, outer.weight x ≤ Real.exp dominationLog * source.weight x) (htest : ∀ w : A → ℝ, (∀ x, 0 ≤ w (observe x) ∧ w (observe x) ≤ 1) → (parameter.prod source).mean (fun tx => w (observe tx.2) * value tx.1 (observe tx.2)) ≤ Real.exp (-(2 * p + dominationLog)) / 2) : outer.eventProbability (fun x => Real.exp (-p) < parameter.mean (fun t => value t (observe x))) ≤ Real.exp (-p) := by have ht := fixedParameter_observed_tail_exp source parameter observe value p dominationLog htest calc _ ≤ Real.exp dominationLog * source.eventProbability (fun x => Real.exp (-p) < parameter.mean (fun t => value t (observe x))) := outer.eventProbability_le_of_weight_le source _ hdom _ _ ≤ Real.exp dominationLog * Real.exp (-(p + dominationLog)) := mul_le_mul_of_nonneg_left ht (Real.exp_nonneg _) _ = _ := by rw [← Real.exp_add]; congr 1; ring
end Erdos3
end
section
namespace Erdos3.FiniteProbabilityWeights
open scoped BigOperators Classical
theorem uniform_injective_mean_le {B X : Type*} [Fintype B] [Nonempty B] [Fintype X] [Nonempty X] (F : B → X) (hF : Function.Injective F) (φ : X → ℝ) (hφ : ∀ x, 0 ≤ φ x) : (uniform B).mean (fun b => φ (F b)) ≤ ((Fintype.card X : ℝ) / Fintype.card B) * (uniform X).mean φ := by have hsum : (∑ b, φ (F b)) ≤ ∑ x, φ x := Finset.sum_le_sum_of_injOn F hF.injOn (Finset.subset_univ _) (fun _ _ => le_rfl) (fun x _ _ => hφ x) rw [uniform_mean, uniform_mean, Fintype.expect_eq_sum_div_card, Fintype.expect_eq_sum_div_card] have hX : (Fintype.card X : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero calc _ ≤ (∑ x, φ x) / Fintype.card B := div_le_div_of_nonneg_right hsum (Nat.cast_nonneg _) _ = _ := by field_simp
theorem uniform_base_reweight_test_le {B Ω X : Type*} [Fintype B] [Nonempty B] [Fintype Ω] [Fintype X] [Nonempty X] (q : FiniteProbabilityWeights Ω) (D : B × Ω → ℝ) (hD : ∀ z, 0 ≤ D z) (hZ : 0 < ((uniform B).prod q).mean D) (F : B × Ω → X) (hF : ∀ z, Function.Injective (fun b => F (b, z))) (φ : X → ℝ) (hφ : ∀ x, 0 ≤ φ x) {M ε a : ℝ} (hM : 0 ≤ M) (ha : 0 < a) (hlower : a ≤ ((uniform B).prod q).mean D) (hlocal : ∀ b, q.mean (fun z => D (b, z) * φ (F (b, z))) ≤ M * q.mean (fun z => φ (F (b, z))) + ε) : (((uniform B).prod q).reweightPositive D hD hZ).mean (fun z => φ (F z)) ≤ ((M * ((Fintype.card X : ℝ) / Fintype.card B)) * (uniform X).mean φ + ε) / a := by have href : ((uniform B).prod q).mean (fun z => φ (F z)) ≤ ((Fintype.card X : ℝ) / Fintype.card B) * (uniform X).mean φ := by rw [mean_prod, mean_comm] exact (q.mean_mono (fun z => uniform_injective_mean_le _ (hF z) φ hφ)).trans_eq (q.mean_const _) have hraw : ((uniform B).prod q).mean (fun z => D z * φ (F z)) ≤ M * ((uniform B).prod q).mean (fun z => φ (F z)) + ε := by rw [mean_prod, mean_prod] exact ((uniform B).mean_mono hlocal).trans_eq (by rw [mean_add, mean_const_mul, mean_const]) have hnorm := ((uniform B).prod q).reweightPositive_test_le D hD hZ (fun z => φ (F z)) (fun z => hφ (F z)) ha hlower hraw apply hnorm.trans apply div_le_div_of_nonneg_right _ ha.le calc _ ≤ M * (((Fintype.card X : ℝ) / Fintype.card B) * (uniform X).mean φ) + ε := by gcongr _ = _ := by ring
theorem siteLaw_excessMass_le_of_test_bound {Ω T X : Type*} [Fintype Ω] [Fintype T] [Nonempty T] [Fintype X] (p : FiniteProbabilityWeights Ω) (r : FiniteProbabilityWeights X) (F : Ω → T → X) {C ε : ℝ} (htest : ∀ (φ : X → ℝ), (∀ x, φ x ∈ Set.Icc (0 : ℝ) 1) → ∀ t, p.mean (fun z => φ (F z t)) ≤ C * r.mean φ + ε) : r.excessMass (p.siteLaw F) C ≤ ε := by apply excessMass_le_of_mass_le intro A let φ : X → ℝ := fun x => if x ∈ A then 1 else 0 have hφ : ∀ x, φ x ∈ Set.Icc (0 : ℝ) 1 := by intro x; dsimp only [φ]; split_ifs <;> norm_num have hmean : (p.siteLaw F).mean φ ≤ C * r.mean φ + ε := by rw [siteLaw_mean] simp_rw [← uniform_mean] rw [mean_comm] exact ((uniform T).mean_mono (htest φ hφ)).trans_eq ((uniform T).mean_const _) have hfilter : Finset.univ.filter (fun x => x ∈ A) = A := by ext x; simp simpa only [mean, φ, mul_ite, mul_one, mul_zero, ← Finset.sum_filter, hfilter, mass] using hmean
end Erdos3.FiniteProbabilityWeights
end
section
namespace Erdos3
theorem fixedParameter_scalar_tail_mono_slack {X T : Type*} [Fintype X] [Fintype T] (outer : FiniteProbabilityWeights X) (parameter : FiniteProbabilityWeights T) (h g : X → T → ℝ) {level small large gap bound : ℝ} (hg : ∀ x t, 0 ≤ g x t) (hlevel : 0 ≤ level) (hslack : small ≤ large) (hbound : outer.eventProbability (fun x => gap < parameter.mean (fun t => h x t - (1 + small) * level * g x t)) ≤ bound) : outer.eventProbability (fun x => gap < parameter.mean (fun t => h x t - (1 + large) * level * g x t)) ≤ bound := by apply (outer.eventProbability_mono _ _ ?_).trans hbound intro x hx apply hx.trans_le apply parameter.mean_mono intro t have hs := mul_le_mul_of_nonneg_right hslack (mul_nonneg hlevel (hg x t)) nlinarith
end Erdos3
end
section
namespace Erdos3
theorem fixedParameter_scalar_tail_dominated_slack {X T : Type*} [Fintype X] [Fintype T] (reference outer : FiniteProbabilityWeights X) (parameter : FiniteProbabilityWeights T) (h g : X → T → ℝ) {p level small large : ℝ} (hp : 0 ≤ p) (hdom : ∀ x, outer.weight x ≤ Real.exp p * reference.weight x) (hg : ∀ x t, 0 ≤ g x t) (hlevel : 0 ≤ level) (hslack : small ≤ large) (hbound : reference.eventProbability (fun x => Real.exp (-(2 * p)) < parameter.mean (fun t => h x t - (1 + small) * level * g x t)) ≤ Real.exp (-(2 * p))) : outer.eventProbability (fun x => Real.exp (-p) < parameter.mean (fun t => h x t - (1 + large) * level * g x t)) ≤ Real.exp (-p) := by have hlarge := fixedParameter_scalar_tail_mono_slack reference parameter h g hg hlevel hslack hbound have hgap : Real.exp (-(2 * p)) ≤ Real.exp (-p) := Real.exp_le_exp.mpr (by linarith) have hreference : reference.eventProbability (fun x => Real.exp (-p) < parameter.mean (fun t => h x t - (1 + large) * level * g x t)) ≤ Real.exp (-(2 * p)) := (reference.eventProbability_mono _ _ (fun _ hx => hgap.trans_lt hx)).trans hlarge calc _ ≤ Real.exp p * reference.eventProbability (fun x => Real.exp (-p) < parameter.mean (fun t => h x t - (1 + large) * level * g x t)) := outer.eventProbability_le_of_weight_le reference (Real.exp p) hdom _ _ ≤ Real.exp p * Real.exp (-(2 * p)) := mul_le_mul_of_nonneg_left hreference (Real.exp_pos p).le _ = Real.exp (-p) := by rw [← Real.exp_add]; congr 1; ring
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132import OAI.Combinatorics.Progressions.Polynomial.RealPolynomialEvaluationMass
namespace OAI
section
namespace Erdos3
open MvPolynomialopen scoped BigOperators Classical
theorem aeval_polynomial_totalDegree_le {I J R S : Type*} [CommRing R] [CommRing S] [Algebra R S] (P : MvPolynomial I R) (f : I → MvPolynomial J S) {d e : ℕ} (hP : P.totalDegree ≤ d) (hf : ∀ i, (f i).totalDegree ≤ e) : (aeval f P).totalDegree ≤ d * e := by rw [aeval_def, eval₂_eq] apply totalDegree_finsetSum_le intro a ha apply (totalDegree_mul _ _).trans simp only [MvPolynomial.algebraMap_apply, totalDegree_C, zero_add] calc _ ≤ ∑ i ∈ a.support, (f i ^ a i).totalDegree := totalDegree_finsetProd _ _ _ ≤ ∑ i ∈ a.support, a i * e := Finset.sum_le_sum (fun i _ => (totalDegree_pow _ _).trans (Nat.mul_le_mul_left _ (hf i))) _ = (a.sum fun _ n => n) * e := by rw [← Finset.sum_mul]; rfl _ ≤ d * e := Nat.mul_le_mul_right _ ((le_totalDegree ha).trans hP)
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374import OAI.Combinatorics.Progressions.Dynamics.OriginalParameterReferenceBudgetimport OAI.Combinatorics.Progressions.Polynomial.ScalarInitialPolynomialBudgetimport OAI.Combinatorics.Progressions.Polynomial.ScalarThresholdPolynomial
namespace OAI
section
namespace Erdos3
noncomputable def scalarInitialThreshold (E m n d : ℕ) (epsilon p P0 : ℝ) : ℝ := let Z := replacementCommonInputLog m n d P0 let G := 2 * physicalPairCoefficientLog n d Z + 2 let U := scalarInitialReferenceInput m n d p P0 let pref := affineReferenceInput epsilon U let common := affineCommonReferenceBudget E epsilon U let b := adaptiveAffineCutoff ⌈(pref + 2) ^ E⌉₊ m n epsilon p (scalarTransferTail (3 * p)) Z (scalarTransferBaseAccuracy (3 * p)) Z scalarCombinedLogThreshold n d b p P0 Z G ((pref + 2) ^ E) (scalarTransferCellLog common b p Z U) (scalarMeshLog G (P0 + 1) (scalarTransferAccuracyLog b p Z))
theorem exists_scalarInitialThreshold_power (E d A : ℕ) (hE : 2 ≤ E) {epsilon : ℝ} (hepsilon : 0 < epsilon) (hepsilon1 : epsilon ≤ 1) : ∃ C : ℕ, 2 ≤ C ∧ ∀ (m n : ℕ) (p : ℝ), 2 ≤ p → (m : ℝ) ≤ (d + 1 : ℝ) * p → (n : ℝ) ≤ p → epsilon⁻¹ ≤ Real.exp ((A : ℝ) * (p + 1)) → scalarInitialThreshold E m n d epsilon p ((A : ℝ) * (p + 1)) ≤ (p + 2) ^ C := by obtain ⟨C0, _, hUbound⟩ := exists_scalarInitialReferenceInput_power_bound d A obtain ⟨C1, hC1, hthreshold⟩ := exists_scalarCombinedLogThreshold_common_power let q := ((C0 + 4) * (affineReferencePower epsilon + 1) + 1) * E + 1 refine ⟨(q + 2) * C1, by nlinarith [Nat.zero_le q], ?_⟩ intro m n p hp hm hn heps let P0 := (A : ℝ) * (p + 1) let Z := replacementCommonInputLog m n d P0 let G := 2 * physicalPairCoefficientLog n d Z + 2 let U := scalarInitialReferenceInput m n d p P0 let pref := affineReferenceInput epsilon U let common := affineCommonReferenceBudget E epsilon U let b := adaptiveAffineCutoff ⌈(pref + 2) ^ E⌉₊ m n epsilon p (scalarTransferTail (3 * p)) Z (scalarTransferBaseAccuracy (3 * p)) Z have hp0 : 0 ≤ p := by linarith have hP0 : 0 ≤ P0 := by dsimp only [P0]; positivity have hZ : 0 ≤ Z := (replacementCommonInputLog_bounds m n d hP0).1 obtain ⟨hU, hZU, hGU, hP0U, hmU, hnU, hdU, hTU, hpU⟩ := scalarInitialReferenceInput_bounds m n d hp0 hP0 have hGU' : G ≤ U := by linarith have hepsU : epsilon⁻¹ ≤ Real.exp U := heps.trans (Real.exp_le_exp.mpr hP0U) have hbase : 0 < scalarTransferBaseAccuracy (3 * p) := Real.exp_pos _ have hbaseInv : (scalarTransferBaseAccuracy (3 * p))⁻¹ ≤ Real.exp U := by simp only [scalarTransferBaseAccuracy, Real.exp_neg, inv_inv] apply Real.exp_le_exp.mpr unfold scalarTransferTail at hTU linarith have hT : 0 ≤ scalarTransferTail (3 * p) := by unfold scalarTransferTail; positivity have hb := (adaptiveAffineCutoff_reference_bounds hE hepsilon hepsilon1 hU hp0 hT hZ hZ hpU hTU hZU hZU hmU hnU hepsU hbase hbaseInv).2 have hc := affineCommonReferenceBudget_bounds hE epsilon hU have hcost : (pref + 2) ^ E ≤ common := by have hpref : 0 ≤ pref + 2 := by linarith [(affineReferenceInput_bounds epsilon hU).1] change (pref + 2) ^ E ≤ 2 * (pref + 2) ^ E nlinarith [pow_nonneg hpref E] have hthresholdCommon := hthreshold n d b p P0 Z G U common ((pref + 2) ^ E) hc.1 hZ (hpU.trans hc.2.1) (hP0U.trans hc.2.1) (hZU.trans hc.2.1) (hGU'.trans hc.2.1) hc.2.1 (hnU.trans hc.2.1) (hdU.trans hc.2.1) hcost hb have hUoriginal : U ≤ (p + 2) ^ C0 := hUbound m n p hp0 hm hn have hcommonOriginal : common ≤ (p + 2) ^ q := affineCommonReferenceBudget_le_original_power E epsilon hp hU hUoriginal exact polynomial_budget_comp hp0 hc.1 q C1 hcommonOriginal hthresholdCommon
end Erdos3
end
end OAI1234567891011121314151617181920212223242526import OAI.Combinatorics.Progressions.Dynamics.InitialBudgetJointReplacement
namespace OAI
section
namespace Erdos3
theorem exists_scalarInputLogFactor (ell : ℕ) (epsilon : ℝ) : ∃ A0 : ℕ, 10 ≤ A0 ∧ epsilon⁻¹ ≤ Real.exp (A0 : ℝ) ∧ (ell : ℝ) ≤ Real.exp (A0 : ℝ) ∧ (probabilityProfileLipschitz : ℝ) ≤ Real.exp (A0 : ℝ) := by let B : ℝ := max 10 (max epsilon⁻¹ (max (ell : ℝ) (probabilityProfileLipschitz : ℝ))) obtain ⟨A0, hA0⟩ := exists_nat_ge B have h10 : (10 : ℝ) ≤ A0 := (le_max_left _ _).trans hA0 have hexp : (A0 : ℝ) ≤ Real.exp (A0 : ℝ) := by linarith [Real.add_one_le_exp (A0 : ℝ)] refine ⟨A0, by exact_mod_cast h10, ?_, ?_, ?_⟩ · exact ((le_max_left _ _).trans ((le_max_right _ _).trans hA0)).trans hexp · exact ((le_max_left _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans hA0))).trans hexp · exact ((le_max_right _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans hA0))).trans hexp
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758import Mathlib.Algebra.Order.Floor.Ringimport OAI.Combinatorics.Progressions.Geometry.PhysicalBoxPartition
namespace OAI
section
namespace Erdos3
noncomputable def scalarWindowLength (N : ℕ) (S : ℝ) : ℕ := min N ⌊S / 4⌋₊
theorem scalarWindowLength_bounds {N : ℕ} {S K : ℝ} (hN : 0 < N) (hS : 4 ≤ S) (hK : 0 ≤ K) (hratio : S ≤ K * N) : 0 < scalarWindowLength N S ∧ scalarWindowLength N S ≤ N ∧ 2 * (scalarWindowLength N S : ℝ) ≤ S / 2 ∧ S ≤ (K + 8) * scalarWindowLength N S := by have hfloor : 1 ≤ ⌊S / 4⌋₊ := (Nat.le_floor_iff (by positivity : 0 ≤ S / 4)).mpr (by norm_num; linarith) have hfloorle : (⌊S / 4⌋₊ : ℝ) ≤ S / 4 := Nat.floor_le (by positivity) have hgap : S / 4 < (⌊S / 4⌋₊ : ℝ) + 1 := Nat.lt_floor_add_one (S / 4) have hpositive : 0 < scalarWindowLength N S := lt_min hN (by omega) have hsmall : scalarWindowLength N S ≤ ⌊S / 4⌋₊ := min_le_right _ _ have hsmallreal : (scalarWindowLength N S : ℝ) ≤ (⌊S / 4⌋₊ : ℝ) := by exact_mod_cast hsmall refine ⟨hpositive, min_le_left _ _, by linarith, ?_⟩ by_cases hNF : N ≤ ⌊S / 4⌋₊ · rw [scalarWindowLength, min_eq_left hNF] nlinarith [Nat.cast_nonneg (α := ℝ) N] · rw [scalarWindowLength, min_eq_right (le_of_not_ge hNF)] have hfloorreal : (1 : ℝ) ≤ ⌊S / 4⌋₊ := by exact_mod_cast hfloor nlinarith [mul_nonneg hK (Nat.cast_nonneg (α := ℝ) ⌊S / 4⌋₊)]
theorem exists_scalarWindowPartitions {I : Type*} (N : I → ℕ) (S : I → ℝ) (K : ℝ) (hN : ∀ i, 0 < N i) (hS : ∀ i, 4 ≤ S i) (hK : 0 ≤ K) (hratio : ∀ i, S i ≤ K * N i) : ∃ P : ∀ i, FiniteProgressionPartition (N i), (∀ i c, (P i).step c = 1) ∧ (∀ i c, 0 < (P i).length c) ∧ (∀ i c, ((P i).length c : ℝ) ≤ S i / 2) ∧ (∀ i c, S i ≤ (K + 8) * (P i).length c) := by let H := fun i => scalarWindowLength (N i) (S i) have hbounds i := scalarWindowLength_bounds (hN i) (hS i) hK (hratio i) let P := comparableBoxPartitions N H (fun i => (hbounds i).1) (fun i => (hbounds i).2.1) have hlength i c := comparableBoxPartitions_length N H (fun i => (hbounds i).1) (fun i => (hbounds i).2.1) i c refine ⟨P, comparableBoxPartitions_step _ _ _ _, ?_, ?_, ?_⟩ · intro i c exact (hbounds i).1.trans_le (hlength i c).1 · intro i c have hlen : ((P i).length c : ℝ) < 2 * H i := by exact_mod_cast (hlength i c).2 exact hlen.le.trans (hbounds i).2.2.1 · intro i c exact (hbounds i).2.2.2.trans (mul_le_mul_of_nonneg_left (by exact_mod_cast (hlength i c).1) (by linarith))
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605import OAI.Combinatorics.Progressions.Dynamics.DependentShellBudgetimport OAI.Combinatorics.Progressions.Estimates.ObservedUnitTruncationimport OAI.Combinatorics.Progressions.Linear.KernelCoreComparisonimport OAI.Combinatorics.Progressions.Linear.ProductEmbeddingANOVA
namespace OAI
section
namespace Erdos3
open scoped BigOperators
variable {ι : Type*} [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)]
theorem productANOVA_sum (μ : ∀ i, FiniteProbabilityWeights (X i)) {α : Type*} (s : Finset α) (f : α → (∀ i, X i) → ℝ) (S : Finset ι) (x : ∀ i, X i) : productANOVA μ S (fun y => ∑ a ∈ s, f a y) x = ∑ a ∈ s, productANOVA μ S (f a) x := by simp only [productANOVA, productConditionalMean, FiniteProbabilityWeights.mean_sum, Finset.mul_sum] rw [Finset.sum_comm]
theorem productANOVATruncation_sum (μ : ∀ i, FiniteProbabilityWeights (X i)) {α : Type*} (s : Finset α) (f : α → (∀ i, X i) → ℝ) (D : Finset (Finset ι)) (x : ∀ i, X i) : productANOVATruncation μ D (fun y => ∑ a ∈ s, f a y) x = ∑ a ∈ s, productANOVATruncation μ D (f a) x := by simp only [productANOVATruncation, productANOVA_sum] rw [Finset.sum_comm]
theorem productANOVATruncation_smul (μ : ∀ i, FiniteProbabilityWeights (X i)) (D : Finset (Finset ι)) (a : ℝ) (f : (∀ i, X i) → ℝ) (x : ∀ i, X i) : productANOVATruncation μ D (fun y => a * f y) x = a * productANOVATruncation μ D f x := by simp only [productANOVATruncation, productANOVA_smul, Finset.mul_sum]
variable {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem productCouplingPairing_smul (a b : ℝ) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : productCouplingPairing c (fun x => a * w x) (fun y => b * f y) = a * b * productCouplingPairing c w f := by unfold productCouplingPairing rw [← FiniteProbabilityWeights.mean_const_mul] congr 1 funext z ring
theorem productCouplingPairing_truncation_smul (D : Finset (Finset ι)) (a b : ℝ) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : productCouplingPairing c (productANOVATruncation μ D (fun x => a * w x)) (productANOVATruncation ν D (fun y => b * f y)) = a * b * productCouplingPairing c (productANOVATruncation μ D w) (productANOVATruncation ν D f) := by simp only [show productANOVATruncation μ D (fun x => a * w x) = (fun x => a * productANOVATruncation μ D w x) from funext (productANOVATruncation_smul μ D a w), show productANOVATruncation ν D (fun y => b * f y) = (fun y => b * productANOVATruncation ν D f y) from funext (productANOVATruncation_smul ν D b f), productCouplingPairing_smul]
end Erdos3
end
section
namespace Erdos3
theorem normalized_pairing_error_scale {P u v q m s E : ℝ} (hm : 0 < m) (hs : 0 < s) (h : |m⁻¹ * s⁻¹ * P - q * ((m⁻¹ * u) * (s⁻¹ * v))| ≤ E) : |P - q * (u * v)| ≤ m * s * E := by calc _ = |(m * s) * (m⁻¹ * s⁻¹ * P - q * ((m⁻¹ * u) * (s⁻¹ * v)))| := by congr 1 field_simp _ = m * s * |m⁻¹ * s⁻¹ * P - q * ((m⁻¹ * u) * (s⁻¹ * v))| := by rw [abs_mul, abs_of_nonneg (mul_nonneg hm.le hs.le)] _ ≤ _ := mul_le_mul_of_nonneg_left h (mul_nonneg hm.le hs.le)
variable {ι : Type*} [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
noncomputable def productAtomTruncatedPairing (D : Finset (Finset ι)) (I : Finset ι) (x : ∀ i, X i) (y : ∀ i, Y i) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : ℝ := productCouplingPairing c (productANOVATruncation μ D (fun z => productFiberIndicator I x z * w z)) (productANOVATruncation ν D (fun z => productFiberIndicator I y z * f z))
theorem productAtomTruncatedPairing_smul (D : Finset (Finset ι)) (I : Finset ι) (x : ∀ i, X i) (y : ∀ i, Y i) (a b : ℝ) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : productAtomTruncatedPairing c D I x y (fun z => a * w z) (fun z => b * f z) = a * b * productAtomTruncatedPairing c D I x y w f := by have hw : (fun z => productFiberIndicator I x z * (a * w z)) = (fun z => a * (productFiberIndicator I x z * w z)) := by funext z; ring have hf : (fun z => productFiberIndicator I y z * (b * f z)) = (fun z => b * (productFiberIndicator I y z * f z)) := by funext z; ring unfold productAtomTruncatedPairing rw [hw, hf, productCouplingPairing_truncation_smul]
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators
variable {ι : Type*} [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)]
theorem productANOVA_add (μ : ∀ i, FiniteProbabilityWeights (X i)) (S : Finset ι) (f g : (∀ i, X i) → ℝ) (x : ∀ i, X i) : productANOVA μ S (fun y => f y + g y) x = productANOVA μ S f x + productANOVA μ S g x := by simp only [productANOVA, productConditionalMean, FiniteProbabilityWeights.mean_add, mul_add, Finset.sum_add_distrib]
theorem productANOVATruncation_add (μ : ∀ i, FiniteProbabilityWeights (X i)) (D : Finset (Finset ι)) (f g : (∀ i, X i) → ℝ) (x : ∀ i, X i) : productANOVATruncation μ D (fun y => f y + g y) x = productANOVATruncation μ D f x + productANOVATruncation μ D g x := by simp only [productANOVATruncation, productANOVA_add, Finset.sum_add_distrib]
variable {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
noncomputable def productTruncatedPairing (D : Finset (Finset ι)) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : ℝ := productCouplingPairing c (productANOVATruncation μ D w) (productANOVATruncation ν D f)
theorem productTruncatedPairing_add_left (D : Finset (Finset ι)) (u w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : productTruncatedPairing c D (fun x => u x + w x) f = productTruncatedPairing c D u f + productTruncatedPairing c D w f := by simp only [productTruncatedPairing, productCouplingPairing, productANOVATruncation_add, add_mul, FiniteProbabilityWeights.mean_add]
theorem productTruncatedPairing_add_right (D : Finset (Finset ι)) (w : (∀ i, X i) → ℝ) (f g : (∀ i, Y i) → ℝ) : productTruncatedPairing c D w (fun x => f x + g x) = productTruncatedPairing c D w f + productTruncatedPairing c D w g := by simp only [productTruncatedPairing, productCouplingPairing, productANOVATruncation_add, mul_add, FiniteProbabilityWeights.mean_add]
theorem productTruncatedPairing_smul (D : Finset (Finset ι)) (a b : ℝ) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : productTruncatedPairing c D (fun x => a * w x) (fun y => b * f y) = a * b * productTruncatedPairing c D w f := productCouplingPairing_truncation_smul c D a b w f
theorem productTruncatedPairing_sub_smul_right (D : Finset (Finset ι)) (a : ℝ) (w : (∀ i, X i) → ℝ) (f g : (∀ i, Y i) → ℝ) : productTruncatedPairing c D w (fun y => f y - a * g y) = productTruncatedPairing c D w f - a * productTruncatedPairing c D w g := by have he : (fun y => f y - a * g y) = (fun y => f y + (-a) * g y) := by funext y; ring have hs := productTruncatedPairing_smul c D 1 (-a) w g simp only [one_mul] at hs rw [he, productTruncatedPairing_add_right, hs] ring
theorem productTruncatedPairing_sum_right {α : Type*} (s : Finset α) (D : Finset (Finset ι)) (w : (∀ i, X i) → ℝ) (f : α → (∀ i, Y i) → ℝ) : productTruncatedPairing c D w (fun y => ∑ a ∈ s, f a y) = ∑ a ∈ s, productTruncatedPairing c D w (f a) := by simp only [productTruncatedPairing, productCouplingPairing, productANOVATruncation_sum, Finset.mul_sum, FiniteProbabilityWeights.mean_sum]
theorem productAtomTruncatedPairing_sub_smul_right (D : Finset (Finset ι)) (I : Finset ι) (x : ∀ i, X i) (y : ∀ i, Y i) (a : ℝ) (w : (∀ i, X i) → ℝ) (f g : (∀ i, Y i) → ℝ) : productAtomTruncatedPairing c D I x y w (fun z => f z - a * g z) = productAtomTruncatedPairing c D I x y w f - a * productAtomTruncatedPairing c D I x y w g := by have he : (fun z => productFiberIndicator I y z * (f z - a * g z)) = (fun z => productFiberIndicator I y z * f z - a * (productFiberIndicator I y z * g z)) := by funext z ring change productTruncatedPairing c D (fun z => productFiberIndicator I x z * w z) _ = _ rw [he, productTruncatedPairing_sub_smul_right] rfl
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
variable {ι : Type*} [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem productTruncatedPairing_atom_sum_right (D : Finset (Finset ι)) (I : Finset ι) (x : ∀ i, X i) (baseY : ∀ i, Y i) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) : (∑ a : ∀ i : I, Y i, productAtomTruncatedPairing c D I x (productSubtypePoint I a baseY) w f) = productTruncatedPairing c D (fun z => productFiberIndicator I x z * w z) f := by change (∑ a : ∀ i : I, Y i, productTruncatedPairing c D (fun z => productFiberIndicator I x z * w z) (fun z => productFiberIndicator I (productSubtypePoint I a baseY) z * f z)) = _ rw [← productTruncatedPairing_sum_right] congr 1 funext z exact productFiberIndicator_partition I baseY f z
variable {Ω : Type*} [Fintype Ω] [∀ i, DecidableEq (X i)]
omit c intheorem ProductCylinder.indicator_density_cut (d : ProductCylinder X) (μ : ∀ i, FiniteProbabilityWeights (X i)) (base : ∀ i, X i) (p : FiniteProbabilityWeights Ω) (F : Ω → ∀ i, X i) (w : Ω → ℝ) : (fun z => productFiberIndicator d.1 (d.assignment base) z * observedProductDensity μ p F (d.cut F w) z) = observedProductDensity μ p F (d.cut F w) := by funext z by_cases hz : d.Contains z · have hi := (d.contains_iff base z).mp hz have he : productFiberIndicator d.1 (d.assignment base) z = 1 := by unfold productFiberIndicator exact ite_eq_left hi rw [he, one_mul] · simp only [d.density_cut, ite_eq_right hz, mul_zero]
theorem ProductCylinder.truncated_pairing_atoms (d : ProductCylinder X) (D : Finset (Finset ι)) (base : ∀ i, X i) (baseY : ∀ i, Y i) (p : FiniteProbabilityWeights Ω) (F : Ω → ∀ i, X i) (w : Ω → ℝ) (f : (∀ i, Y i) → ℝ) : productTruncatedPairing c D (observedProductDensity μ p F (d.cut F w)) f = ∑ a : ∀ i : d.1, Y i, productAtomTruncatedPairing c D d.1 (d.assignment base) (productSubtypePoint d.1 a baseY) (observedProductDensity μ p F (d.cut F w)) f := by rw [productTruncatedPairing_atom_sum_right, d.indicator_density_cut μ base p F w]
end Erdos3
end
section
namespace Erdos3
variable {Ω ι : Type*} [Fintype Ω] [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem observedProductDensity_residual_difference (p : FiniteProbabilityWeights Ω) (F : Ω → ∀ i, X i) (hμ : ∀ i x, 0 < (μ i).weight x) (base : ∀ i, X i) (v : Ω → ℝ) {η τ H G a : ℝ} (ha : 0 ≤ a) (hv : ∀ z, 0 ≤ v z ∧ v z ≤ 1) (hη : 0 ≤ η) (hmass : p.mean v ≤ τ) (D : Finset (Finset ι)) {b : ℕ} (hcard : ∀ S ∈ D, S.card ≤ b) (hclose : ProductMarginalsClose μ (observedProductDensity μ p F (fun _ => 1)) η (2 * b)) (herr : 2 * η * (D.card : ℝ) ^ 2 * (4 : ℝ) ^ b * (1 + η) ^ 2 ≤ τ) (h g : (∀ i, Y i) → ℝ) (hh : Real.sqrt (productANOVAEnergy ν D h) ≤ H) (hg : Real.sqrt (productANOVAEnergy ν D g) ≤ G) : |productTruncatedPairing c D (observedProductDensity μ p F v) (fun y => h y - a * g y)| ≤ Real.sqrt (3 * τ) * (H + a * G) := by have hH := observedProductDensity_small_mass_pairing c p F hμ base v hv hη hmass D hcard hclose herr h hh have hG := observedProductDensity_small_mass_pairing c p F hμ base v hv hη hmass D hcard hclose herr g hg rw [productTruncatedPairing_sub_smul_right, sub_eq_add_neg] calc _ ≤ |productTruncatedPairing c D (observedProductDensity μ p F v) h| + |-(a * productTruncatedPairing c D (observedProductDensity μ p F v) g)| := abs_add_le _ _ _ = |productTruncatedPairing c D (observedProductDensity μ p F v) h| + a * |productTruncatedPairing c D (observedProductDensity μ p F v) g| := by rw [abs_neg, abs_mul, abs_of_nonneg ha] _ ≤ Real.sqrt (3 * τ) * H + a * (Real.sqrt (3 * τ) * G) := add_le_add hH (mul_le_mul_of_nonneg_left hG ha) _ = _ := by ring
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
variable {Ω ι : Type*} [Fintype Ω] [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] [∀ i, DecidableEq (X i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem CylinderRemovalChain.retained_pairing_sum_le {base : ∀ i, X i} {p : FiniteProbabilityWeights Ω} {F : Ω → ∀ i, X i} {K τ : ℝ} {j r : ℕ} {w v : Ω → ℝ} {cs : List (ProductCylinder X)} (hchain : CylinderRemovalChain μ base p F K τ j r w v cs) (hμ : ∀ i x, 0 < (μ i).weight x) (D : Finset (Finset ι)) (baseY : ∀ i, Y i) (hw : ∀ z, w z ≤ 1) (hv : ∀ z, 0 ≤ v z) {C : ℝ} (hC : 0 ≤ C) (E : (d : ProductCylinder X) → (Ω → ℝ) → (∀ i : d.1, Y i) → ℝ) (f : (∀ i, Y i) → ℝ) (hret : ∀ cf ∈ cs.zip (removedCylinderWeights F w cs), ∀ a : ∀ i : cf.1.1, Y i, productAtomTruncatedPairing c D cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 a baseY) (observedProductDensity μ p F cf.2) f ≤ C * (productCouplingAtomMass c cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 a baseY) * cf.1.mass μ base (observedProductDensity μ p F cf.2)) + E cf.1 cf.2 a) : ((cs.zip (removedCylinderWeights F w cs)).map (fun cf => ∑ a : ∀ i : cf.1.1, Y i, productAtomTruncatedPairing c D cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 a baseY) (observedProductDensity μ p F cf.2) f)).sum ≤ C + ((cs.zip (removedCylinderWeights F w cs)).map (fun cf => ∑ a : ∀ i : cf.1.1, Y i, E cf.1 cf.2 a)).sum := by apply list_weighted_error_sum_le _ _ (fun cf => ∑ a : ∀ i : cf.1.1, Y i, productCouplingAtomMass c cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 a baseY) * cf.1.mass μ base (observedProductDensity μ p F cf.2)) _ hC · exact CylinderRemovalChain.joint_mass_sum_le_one c hchain hμ baseY hw hv · intro cf hcf have hs := Finset.sum_le_sum (fun a (_ : a ∈ (Finset.univ : Finset (∀ i : cf.1.1, Y i))) => hret cf hcf a) simpa only [Finset.sum_add_distrib, ← Finset.mul_sum] using hs
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators
variable {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] {X Y : I → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i)) (e : J ↪ I) (baseX : ∀ i, X i) (baseY : ∀ i, Y i)
include baseX baseY
theorem productCouplingPairing_embedding (f : (∀ j, X (e j)) → ℝ) (g : (∀ j, Y (e j)) → ℝ) : productCouplingPairing c (fun x => f (fun j => x (e j))) (fun y => g (fun j => y (e j))) = productCouplingPairing (fun j => c (e j)) f g := by exact productMean_pullback (fun i => (c i).law) e e.injective (fun i => (baseX i, baseY i)) (fun z => f (fun j => (z j).1) * g (fun j => (z j).2))
theorem productTruncatedPairing_embedding (D : Finset (Finset J)) (f : (∀ j, X (e j)) → ℝ) (g : (∀ j, Y (e j)) → ℝ) : productTruncatedPairing c (D.map (Finset.mapEmbedding e).toEmbedding) (fun x => f (fun j => x (e j))) (fun y => g (fun j => y (e j))) = productTruncatedPairing (fun j => c (e j)) D f g := by have hleft : productANOVATruncation μ (D.map (Finset.mapEmbedding e).toEmbedding) (fun x => f (fun j => x (e j))) = (fun x => productANOVATruncation (fun j => μ (e j)) D f (fun j => x (e j))) := funext (productANOVATruncation_embedding μ e baseX D f) have hright : productANOVATruncation ν (D.map (Finset.mapEmbedding e).toEmbedding) (fun y => g (fun j => y (e j))) = (fun y => productANOVATruncation (fun j => ν (e j)) D g (fun j => y (e j))) := funext (productANOVATruncation_embedding ν e baseY D g) unfold productTruncatedPairing rw [hleft, hright] exact productCouplingPairing_embedding c e baseX baseY _ _
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
variable {Ω ι : Type*} [Fintype Ω] [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] [∀ i, DecidableEq (X i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem CylinderRemovalChain.truncated_pairing_decomposition {base : ∀ i, X i} {p : FiniteProbabilityWeights Ω} {F : Ω → ∀ i, X i} {K τ : ℝ} {j r : ℕ} {w v : Ω → ℝ} {cs : List (ProductCylinder X)} (hchain : CylinderRemovalChain μ base p F K τ j r w v cs) (D : Finset (Finset ι)) (baseY : ∀ i, Y i) (f : (∀ i, Y i) → ℝ) : productTruncatedPairing c D (observedProductDensity μ p F w) f = ((cs.zip (removedCylinderWeights F w cs)).map (fun cf => ∑ a : ∀ i : cf.1.1, Y i, productAtomTruncatedPairing c D cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 a baseY) (observedProductDensity μ p F cf.2) f)).sum + productTruncatedPairing c D (observedProductDensity μ p F v) f := by induction hchain with | nil => simp only [removedCylinderWeights, List.zip_nil_left, List.map_nil, List.sum_nil, zero_add] | @cons w v cs d hsize hmass hbounded rest ih => have he : observedProductDensity μ p F w = (fun z => observedProductDensity μ p F (d.cut F w) z + observedProductDensity μ p F (d.erase F w) z) := by funext z have h := observedProductDensity_add μ p F (d.cut F w) (d.erase F w) z rw [show (fun z => d.cut F w z + d.erase F w z) = w from funext (d.cut_add_erase F w)] at h exact h rw [he, productTruncatedPairing_add_left, d.truncated_pairing_atoms c D base baseY p F w f, ih] simp only [removedCylinderWeights, List.zip_cons_cons, List.map_cons, List.sum_cons, add_assoc]
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
variable {Ω ι : Type*} [Fintype Ω] [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] [∀ i, DecidableEq (X i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem CylinderRemovalChain.total_pairing_le {base : ∀ i, X i} {p : FiniteProbabilityWeights Ω} {F : Ω → ∀ i, X i} {K τ : ℝ} {j r : ℕ} {w v : Ω → ℝ} {cs : List (ProductCylinder X)} (hchain : CylinderRemovalChain μ base p F K τ j r w v cs) (hμ : ∀ i x, 0 < (μ i).weight x) (D : Finset (Finset ι)) (baseY : ∀ i, Y i) (hw : ∀ z, w z ≤ 1) (hv : ∀ z, 0 ≤ v z ∧ v z ≤ 1) (hmass : p.mean v ≤ τ) {η C H G a : ℝ} (hη : 0 ≤ η) (hC : 0 ≤ C) (ha : 0 ≤ a) {b : ℕ} (hcard : ∀ S ∈ D, S.card ≤ b) (hclose : ProductMarginalsClose μ (observedProductDensity μ p F (fun _ => 1)) η (2 * b)) (herr : 2 * η * (D.card : ℝ) ^ 2 * (4 : ℝ) ^ b * (1 + η) ^ 2 ≤ τ) (h g : (∀ i, Y i) → ℝ) (hh : Real.sqrt (productANOVAEnergy ν D h) ≤ H) (hg : Real.sqrt (productANOVAEnergy ν D g) ≤ G) (E : (d : ProductCylinder X) → (Ω → ℝ) → (∀ i : d.1, Y i) → ℝ) (hret : ∀ cf ∈ cs.zip (removedCylinderWeights F w cs), ∀ z : ∀ i : cf.1.1, Y i, productAtomTruncatedPairing c D cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 z baseY) (observedProductDensity μ p F cf.2) (fun y => h y - a * g y) ≤ C * (productCouplingAtomMass c cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 z baseY) * cf.1.mass μ base (observedProductDensity μ p F cf.2)) + E cf.1 cf.2 z) : productTruncatedPairing c D (observedProductDensity μ p F w) (fun y => h y - a * g y) ≤ C + ((cs.zip (removedCylinderWeights F w cs)).map (fun cf => ∑ z : ∀ i : cf.1.1, Y i, E cf.1 cf.2 z)).sum + Real.sqrt (3 * τ) * (H + a * G) := by have hretained := CylinderRemovalChain.retained_pairing_sum_le c hchain hμ D baseY hw (fun z => (hv z).1) hC E (fun y => h y - a * g y) hret have hresidual := observedProductDensity_residual_difference c p F hμ base v ha hv hη hmass D hcard hclose herr h g hh hg rw [CylinderRemovalChain.truncated_pairing_decomposition c hchain D baseY] exact add_le_add hretained ((le_abs_self _).trans hresidual)
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
variable {Ω ι : Type*} [Fintype Ω] [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] [∀ i, DecidableEq (X i)] {μ : ∀ i, FiniteProbabilityWeights (X i)} {ν : ∀ i, FiniteProbabilityWeights (Y i)} (c : ∀ i, FiniteProbabilityCoupling (μ i) (ν i))
theorem CylinderRemovalChain.total_pairing_with_shell_budget {base : ∀ i, X i} {p : FiniteProbabilityWeights Ω} {F : Ω → ∀ i, X i} {K τ : ℝ} {j r : ℕ} {w v : Ω → ℝ} {cs : List (ProductCylinder X)} (hchain : CylinderRemovalChain μ base p F K τ j r w v cs) (hμ : ∀ i x, 0 < (μ i).weight x) (D : Finset (Finset ι)) (baseY : ∀ i, Y i) (hw : ∀ z, w z ≤ 1) (hv : ∀ z, 0 ≤ v z ∧ v z ≤ 1) (hmass : p.mean v ≤ τ) {η C H G a κ ε P : ℝ} (hη : 0 ≤ η) (hC : 0 ≤ C) (ha : 0 ≤ a) (hκ0 : 0 ≤ κ) (hκhalf : κ ≤ 1 / 2) (hε : 0 < ε) {b : ℕ} (hcard : ∀ S ∈ D, S.card ≤ b) (hclose : ProductMarginalsClose μ (observedProductDensity μ p F (fun _ => 1)) η (2 * b)) (herr : 2 * η * (D.card : ℝ) ^ 2 * (4 : ℝ) ^ b * (1 + η) ^ 2 ≤ τ) (h g : (∀ i, Y i) → ℝ) (hh : Real.sqrt (productANOVAEnergy ν D h) ≤ H) (hg : Real.sqrt (productANOVAEnergy ν D g) ≤ G) (B : (d : ProductCylinder X) → (Ω → ℝ) → (∀ i : d.1, Y i) → ℝ) (hB : ∀ cf ∈ cs.zip (removedCylinderWeights F w cs), ∀ z, 0 ≤ B cf.1 cf.2 z) (hbudget : ((cs.zip (removedCylinderWeights F w cs)).map (fun cf => ∑ z : ∀ i : cf.1.1, Y i, B cf.1 cf.2 z)).sum ≤ Real.exp P) (hb : j + CyclicCrootSisask.spectralIterations ε P ≤ b) (hret : ∀ cf ∈ cs.zip (removedCylinderWeights F w cs), ∀ z : ∀ i : cf.1.1, Y i, productAtomTruncatedPairing c D cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 z baseY) (observedProductDensity μ p F cf.2) (fun y => h y - a * g y) ≤ C * (productCouplingAtomMass c cf.1.1 (cf.1.assignment base) (productSubtypePoint cf.1.1 z baseY) * cf.1.mass μ base (observedProductDensity μ p F cf.2)) + κ ^ (b - cf.1.1.card) * B cf.1 cf.2 z) : productTruncatedPairing c D (observedProductDensity μ p F w) (fun y => h y - a * g y) ≤ C + ε / 16 + Real.sqrt (3 * τ) * (H + a * G) := by let E := fun (d : ProductCylinder X) (f : Ω → ℝ) (z : ∀ i : d.1, Y i) => κ ^ (b - d.1.card) * B d f z have ht := CylinderRemovalChain.total_pairing_le c hchain hμ D baseY hw hv hmass hη hC ha hcard hclose herr h g hh hg E hret have hs := list_dependent_shell_sum_after_cutoff (cs.zip (removedCylinderWeights F w cs)) (fun cf => ∀ i : cf.1.1, Y i) (fun cf => cf.1.1.card) (fun cf z => E cf.1 cf.2 z) (fun cf z => B cf.1 cf.2 z) hε hκ0 hκhalf (fun cf hcf => (hchain.removed_size_mass cf hcf).1) hB (fun _ _ _ => le_rfl) hbudget hb linarith
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators
theorem weighted_pairing_error_compose {P Q R m E F : ℝ} (hm : 0 ≤ m) (hP : |P - m * Q| ≤ E) (hQ : |Q - R| ≤ F) : |P - m * R| ≤ E + m * F := by calc _ = |(P - m * Q) + m * (Q - R)| := by congr 1; ring _ ≤ |P - m * Q| + |m * (Q - R)| := abs_add_le _ _ _ = |P - m * Q| + m * |Q - R| := by rw [abs_mul, abs_of_nonneg hm] _ ≤ _ := add_le_add hP (mul_le_mul_of_nonneg_left hQ hm)
theorem productKernel_conditioned_mean_comparison {ι : Type*} [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] (μ : ∀ i, FiniteProbabilityWeights (X i)) (ν : ∀ i, FiniteProbabilityWeights (Y i)) (K : ∀ i, X i → FiniteProbabilityWeights (Y i)) (C : ι → ℝ) (hC : ∀ i, 0 ≤ C i) (hbound : ∀ i (f : Y i → ℝ), (ν i).mean f = 0 → (μ i).mean (fun x => (K i x).mean f ^ 2) ≤ C i * (ν i).mean (fun y => f y ^ 2)) (hK : ∀ i (f : Y i → ℝ), (μ i).mean (fun x => (K i x).mean f) = (ν i).mean f) (I : Finset ι) {r b : ℕ} (hIb : I.card ≤ b) (hr : r ≤ b - I.card) {κ A B M N : ℝ} (hκ0 : 0 ≤ κ) (hκ1 : κ ≤ 1) (hcap : ∀ i ∉ I, C i ≤ κ ^ 2) (hsmall : κ * A ^ 2 * B ^ 2 ≤ 1 / 2) (x : ∀ i, X i) (y : ∀ i, Y i) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) (hw : ∀ k, 1 ≤ k → k ≤ r → Real.sqrt (productANOVAEnergy μ (Finset.univ.powersetCard k) (productSectionAverage μ I I x w)) ≤ A ^ (2 * k)) (hf : ∀ k, 1 ≤ k → k ≤ r → Real.sqrt (productANOVAEnergy ν (Finset.univ.powersetCard k) (productSectionAverage ν I I y f)) ≤ B ^ (2 * k)) (hM : Real.sqrt (productANOVAEnergy μ (lowDegreeCoordinateSets ι b) (productSectionAverage μ I I x w)) ≤ M) (hN : Real.sqrt (productANOVAEnergy ν (lowDegreeCoordinateSets ι b) (productSectionAverage ν I I y f)) ≤ N) : let c := fun i => FiniteProbabilityCoupling.ofKernel (μ i) (ν i) (K i) (hK i) |productCouplingPairing c (productANOVATruncation μ (lowDegreeCoordinateSets ι b) (fun z => productFiberIndicator I x z * w z)) (productANOVATruncation ν (lowDegreeCoordinateSets ι b) (fun z => productFiberIndicator I y z * f z)) - productCouplingAtomMass c I x y * ((FiniteProbabilityWeights.pi μ).mean (productSectionAverage μ I I x w) * (FiniteProbabilityWeights.pi ν).mean (productSectionAverage ν I I y f))| ≤ (2 : ℝ) ^ I.card * (κ ^ (b - I.card) * M * N) + productCouplingAtomMass c I x y * (2 * (κ * A ^ 2 * B ^ 2) + κ ^ r * M * N) := by dsimp only let c := fun i => FiniteProbabilityCoupling.ofKernel (μ i) (ν i) (K i) (hK i) have hsub : lowDegreeCoordinateSets ι (b - I.card) ⊆ lowDegreeCoordinateSets ι b := by intro S hS exact (mem_lowDegreeCoordinateSets ι b S).mpr (((mem_lowDegreeCoordinateSets ι (b - I.card) S).mp hS).trans (Nat.sub_le b I.card)) have hcore := productKernel_core_comparison μ ν K C hC hbound hK Iᶜ hr hκ0 hκ1 (fun i hi => hcap i (Finset.mem_compl.mp hi)) hsmall (productSectionAverage μ I I x w) (productSectionAverage ν I I y f) hw hf ((Real.sqrt_le_sqrt (productANOVAEnergy_mono μ hsub _)).trans hM) ((Real.sqrt_le_sqrt (productANOVAEnergy_mono ν hsub _)).trans hN) have hshell := productKernel_conditioning_shell_of_truncated μ ν K C hC hbound hK I b hIb hκ0 hκ1 hcap x y w f hM hN exact weighted_pairing_error_compose (productCouplingAtomMass_nonneg c I x y) hshell hcore
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators
theorem productKernel_scaled_conditioned_mean_comparison {ι : Type*} [Fintype ι] [DecidableEq ι] {X Y : ι → Type*} [∀ i, Fintype (X i)] [∀ i, Fintype (Y i)] (μ : ∀ i, FiniteProbabilityWeights (X i)) (ν : ∀ i, FiniteProbabilityWeights (Y i)) (K : ∀ i, X i → FiniteProbabilityWeights (Y i)) (C : ι → ℝ) (hC : ∀ i, 0 ≤ C i) (hbound : ∀ i (f : Y i → ℝ), (ν i).mean f = 0 → (μ i).mean (fun x => (K i x).mean f ^ 2) ≤ C i * (ν i).mean (fun y => f y ^ 2)) (hK : ∀ i (f : Y i → ℝ), (μ i).mean (fun x => (K i x).mean f) = (ν i).mean f) (I : Finset ι) {r b : ℕ} (hIb : I.card ≤ b) (hr : r ≤ b - I.card) {κ A B M N m s : ℝ} (hm : 0 < m) (hs : 0 < s) (hκ0 : 0 ≤ κ) (hκ1 : κ ≤ 1) (hcap : ∀ i ∉ I, C i ≤ κ ^ 2) (hsmall : κ * A ^ 2 * B ^ 2 ≤ 1 / 2) (x : ∀ i, X i) (y : ∀ i, Y i) (w : (∀ i, X i) → ℝ) (f : (∀ i, Y i) → ℝ) (hw : ∀ k, 1 ≤ k → k ≤ r → Real.sqrt (productANOVAEnergy μ (Finset.univ.powersetCard k) (fun z => m⁻¹ * productSectionAverage μ I I x w z)) ≤ A ^ (2 * k)) (hf : ∀ k, 1 ≤ k → k ≤ r → Real.sqrt (productANOVAEnergy ν (Finset.univ.powersetCard k) (fun z => s⁻¹ * productSectionAverage ν I I y f z)) ≤ B ^ (2 * k)) (hM : Real.sqrt (productANOVAEnergy μ (lowDegreeCoordinateSets ι b) (fun z => m⁻¹ * productSectionAverage μ I I x w z)) ≤ M) (hN : Real.sqrt (productANOVAEnergy ν (lowDegreeCoordinateSets ι b) (fun z => s⁻¹ * productSectionAverage ν I I y f z)) ≤ N) : let c := fun i => FiniteProbabilityCoupling.ofKernel (μ i) (ν i) (K i) (hK i) |productAtomTruncatedPairing c (lowDegreeCoordinateSets ι b) I x y w f - productCouplingAtomMass c I x y * (productConditionalMean μ I w x * productConditionalMean ν I f y)| ≤ m * s * ((2 : ℝ) ^ I.card * (κ ^ (b - I.card) * M * N) + productCouplingAtomMass c I x y * (2 * (κ * A ^ 2 * B ^ 2) + κ ^ r * M * N)) := by dsimp only let c := fun i => FiniteProbabilityCoupling.ofKernel (μ i) (ν i) (K i) (hK i) have hw_eq : productSectionAverage μ I I x (fun z => m⁻¹ * w z) = (fun z => m⁻¹ * productSectionAverage μ I I x w z) := funext (productSectionAverage_smul μ I I x m⁻¹ w) have hf_eq : productSectionAverage ν I I y (fun z => s⁻¹ * f z) = (fun z => s⁻¹ * productSectionAverage ν I I y f z) := funext (productSectionAverage_smul ν I I y s⁻¹ f) have h := productKernel_conditioned_mean_comparison μ ν K C hC hbound hK I hIb hr hκ0 hκ1 hcap hsmall x y (fun z => m⁻¹ * w z) (fun z => s⁻¹ * f z) (by simpa only [hw_eq] using hw) (by simpa only [hf_eq] using hf) (by simpa only [hw_eq] using hM) (by simpa only [hf_eq] using hN) change |productAtomTruncatedPairing c (lowDegreeCoordinateSets ι b) I x y (fun z => m⁻¹ * w z) (fun z => s⁻¹ * f z) - productCouplingAtomMass c I x y * ((FiniteProbabilityWeights.pi μ).mean (productSectionAverage μ I I x (fun z => m⁻¹ * w z)) * (FiniteProbabilityWeights.pi ν).mean (productSectionAverage ν I I y (fun z => s⁻¹ * f z)))| ≤ _ at h rw [productAtomTruncatedPairing_smul, productSectionAverage_self_mean, productSectionAverage_self_mean, productConditionalMean_smul, productConditionalMean_smul] at h exact normalized_pairing_error_scale hm hs h
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738import Mathlib.Algebra.Order.Floor.Ringimport Mathlib.Tactic
namespace OAI
section
namespace Erdos3
theorem scaled_floor_perturbation {s a ε : ℝ} (hs : 0 < s) (z : ℤ) (hz : |(z : ℝ)| ≤ ε * s) : |((⌊s * a⌋ + z : ℤ) : ℝ) / s - a| ≤ ε + 1 / s := by have hround : |(⌊s * a⌋ : ℝ) - s * a| ≤ 1 := by apply abs_le.mpr constructor <;> linarith [Int.floor_le (s * a), Int.lt_floor_add_one (s * a)] have hsum : |((⌊s * a⌋ + z : ℤ) : ℝ) - s * a| ≤ 1 + ε * s := by rw [Int.cast_add, show (⌊s * a⌋ : ℝ) + z - s * a = ((⌊s * a⌋ : ℝ) - s * a) + z by ring] exact (abs_add_le _ _).trans (add_le_add hround hz) have heq : ((⌊s * a⌋ + z : ℤ) : ℝ) / s - a = (((⌊s * a⌋ + z : ℤ) : ℝ) - s * a) / s := by field_simp rw [heq, abs_div, abs_of_pos hs] calc _ ≤ (1 + ε * s) / s := div_le_div_of_nonneg_right hsum hs.le _ = ε + 1 / s := by field_simp; ring
theorem scaled_floor_perturbation_le_twice {s a ε : ℝ} (hs : 0 < s) (hscale : 1 / s ≤ ε) (z : ℤ) (hz : |(z : ℝ)| ≤ ε * s) : |((⌊s * a⌋ + z : ℤ) : ℝ) / s - a| ≤ 2 * ε := by have h := scaled_floor_perturbation (a := a) hs z hz linarith
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161import Mathlib.MeasureTheory.Measure.Prodimport OAI.Combinatorics.Progressions.Probability.SlicedRemainderDensityFamilyimport OAI.Combinatorics.Progressions.Sampling.CanonicalRawSampler
namespace OAI
section
namespace Erdos3
open MeasureTheory
def jointCubeScale {D α : Type*} {B : D → Type*} (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (x : JointBlockParameter B h α → ℝ) (j : JointBlockParameter B h α) : ℝ := T ⟨j.1, j.2.1, j.2.2.1⟩ * x j
theorem jointCubeScale_measurable {D α : Type*} {B : D → Type*} (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) : Measurable (jointCubeScale (α := α) h T) := Measurable.of_eval (fun coordinate => measurable_const.mul (measurable_pi_apply coordinate))
noncomputable def jointCubeScaleHomeomorph {D α : Type*} {B : D → Type*} (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, T i ≠ 0) : (JointBlockParameter B h α → ℝ) ≃ₜ (JointBlockParameter B h α → ℝ) := Homeomorph.piCongrRight (fun j => Homeomorph.smulOfNeZero (α := ℝ) (T ⟨j.1, j.2.1, j.2.2.1⟩) (hT _))
theorem jointCubeScaleHomeomorph_apply {D α : Type*} {B : D → Type*} (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, T i ≠ 0) (x : JointBlockParameter B h α → ℝ) : jointCubeScaleHomeomorph h T hT x = jointCubeScale h T x := rfl
noncomputable def scaledJointCubeSource {D α : Type*} [Fintype D] [Fintype α] [DecidableEq α] {B : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) : Measure (JointBlockParameter B h α → ℝ) := sigmaAxisMeasure (fun d => scaledBlockCubeMeasure (fun i : B d × Fin (h d) => T ⟨d, i⟩))
theorem scaledJointCubeSource_eq_map {D α : Type*} [Fintype D] [Fintype α] [DecidableEq α] {B : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, 0 < T i) : scaledJointCubeSource (α := α) h T = (jointBooleanSource h).map (jointCubeScale h T) := by change _ = (jointBooleanSource h).map (sigmaAxisSampler (fun d => blockCubeScale (α := α) (fun i : B d × Fin (h d) => T ⟨d, i⟩))) rw [jointBooleanSource, sigmaAxisSampler_image_law _ _ (fun d => blockCubeScale_measurable (fun i : B d × Fin (h d) => T ⟨d, i⟩))] unfold scaledJointCubeSource congr 1 funext d exact scaledBlockCubeMeasure_eq_map _ (fun i => hT ⟨d, i⟩)
theorem scaledJointCubeSource_probability {D α : Type*} [Fintype D] [Fintype α] [DecidableEq α] {B : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, 0 < T i) : IsProbabilityMeasure (scaledJointCubeSource (α := α) h T) := by rw [scaledJointCubeSource_eq_map h T hT] infer_instance
theorem scaledJointCubeSource_integral {D α : Type*} [Fintype D] [Fintype α] [DecidableEq α] {B : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, 0 < T i) (f : (JointBlockParameter B h α → ℝ) → ℝ) : (∫ x, f x ∂scaledJointCubeSource h T) = ∫ x, f (jointCubeScale h T x) ∂jointBooleanSource h := by rw [scaledJointCubeSource_eq_map h T hT] exact (jointCubeScaleHomeomorph h T (fun i => (hT i).ne')).toMeasurableEquiv.measurableEmbedding.integral_map f
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators
noncomputable def rawCanonicalCubeTuple {D G Z α : Type*} [Fintype α] [DecidableEq α] {B : D → Type*} {h : D → ℕ} (extra : G → Option α → Z) (scale : SamplerTupleIndex G B h → ℝ) (z : Z → ℝ) (x : JointBlockParameter B h α → ℝ) (vertex : Finset α) : SamplerTupleIndex G B h → ℝ | .inl g => scale (.inl g) * ∑ r : Option α, (booleanFeature r vertex : ℝ) * z (extra g r) | .inr ⟨d, b, v⟩ => scalarCubeValue (fun r => x ⟨d, b, v, r⟩) vertex
theorem rawCanonicalCubeTuple_rescale {D G Z α : Type*} [Fintype α] [DecidableEq α] {B : D → Type*} {h : D → ℕ} (extra : G → Option α → Z) (scale : SamplerTupleIndex G B h → ℝ) (z : Z → ℝ) (x : JointBlockParameter B h α → ℝ) (vertex : Finset α) (k : SamplerTupleIndex G B h) : rawCanonicalCubeTuple extra scale z (jointCubeScale h (fun i => scale (.inr i)) x) vertex k = scale k * normalizedCubeTuple (canonicalTupleInput extra) z x vertex k := by cases k with | inl g => rfl | inr i => rcases i with ⟨d, b, v⟩ exact scalarCubeValue_smul (scale (.inr ⟨d, b, v⟩)) (fun r => x ⟨d, b, v, r⟩) vertex
noncomputable def rawCanonicalJet {D G Z α : Type*} [Fintype α] [DecidableEq α] {B O L : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (c : ∀ d, B d → ℝ) (sets : ∀ d, O d → Finset α) (terms : ∀ d, Finset (L d)) (weight : ∀ d, L d → ℝ) (exponent : ∀ d, L d → SamplerTupleIndex G B h →₀ ℕ) (coefficientIndex : ∀ d, L d → Z) (extra : G → Option α → Z) (Q : D → ℝ) (scale : SamplerTupleIndex G B h → ℝ) (constant : D → ℝ) (t : ℝ) (z : Z → ℝ) (x : JointBlockParameter B h α → ℝ) : (Σ d, O d) → ℝ := rawProductArrayJet h sets terms exponent (fun d b v => .inr ⟨d, b, v⟩) (scaledPrincipalCoefficient h Q scale (fun d b v => .inr ⟨d, b, v⟩) c) (scaledTailCoefficient Q scale weight exponent coefficientIndex t z) (fun d => Q d * constant d) Q (rawCanonicalCubeTuple extra scale z x)
theorem rawCanonicalJet_rescale {D G Z α : Type*} [Fintype α] [DecidableEq α] {B O L : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (c : ∀ d, B d → ℝ) (sets : ∀ d, O d → Finset α) (terms : ∀ d, Finset (L d)) (weight : ∀ d, L d → ℝ) (exponent : ∀ d, L d → SamplerTupleIndex G B h →₀ ℕ) (coefficientIndex : ∀ d, L d → Z) (extra : G → Option α → Z) (Q : D → ℝ) (scale : SamplerTupleIndex G B h → ℝ) (constant : D → ℝ) (t : ℝ) (z : Z → ℝ) (x : JointBlockParameter B h α → ℝ) : rawCanonicalJet h c sets terms weight exponent coefficientIndex extra Q scale constant t z (jointCubeScale h (fun i => scale (.inr i)) x) = canonicalScaledProductArrayJet h c sets terms weight exponent coefficientIndex extra Q scale constant t z x := by unfold rawCanonicalJet canonicalScaledProductArrayJet scaledProductArrayJet have he : rawCanonicalCubeTuple extra scale z (jointCubeScale h (fun i => scale (.inr i)) x) = fun vertex k => scale k * normalizedCubeTuple (canonicalTupleInput extra) z x vertex k := by funext vertex k exact rawCanonicalCubeTuple_rescale extra scale z x vertex k rw [he]
end Erdos3
end
section
namespace Erdos3
open MeasureTheory
theorem scaledJointCubeSource_prod {Ω D α : Type*} [MeasurableSpace Ω] [Fintype D] [Fintype α] [DecidableEq α] {B : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, 0 < T i) (μ : Measure Ω) [SFinite μ] : μ.prod (scaledJointCubeSource (α := α) h T) = (μ.prod (jointBooleanSource h)).map (Prod.map id (jointCubeScale h T)) := by rw [scaledJointCubeSource_eq_map h T hT] simpa only [Measure.map_id] using Measure.map_prod_map μ (jointBooleanSource h) measurable_id (jointCubeScale_measurable h T)
theorem scaledJointCubeSource_prod_integral {Ω D α : Type*} [MeasurableSpace Ω] [Fintype D] [Fintype α] [DecidableEq α] {B : D → Type*} [∀ d, Fintype (B d)] (h : D → ℕ) (T : PrincipalTupleIndex B h → ℝ) (hT : ∀ i, 0 < T i) (μ : Measure Ω) [SFinite μ] (f : Ω × (JointBlockParameter B h α → ℝ) → ℝ) : (∫ p, f p ∂μ.prod (scaledJointCubeSource h T)) = ∫ p, f (p.1, jointCubeScale h T p.2) ∂μ.prod (jointBooleanSource h) := by rw [scaledJointCubeSource_prod h T hT] exact ((MeasurableEquiv.refl Ω).prodCongr (jointCubeScaleHomeomorph h T (fun i => (hT i).ne')).toMeasurableEquiv).measurableEmbedding.integral_map f
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import Mathlib.Algebra.Module.LinearMap.Basicimport Mathlib.Tactic
namespace OAI
section
namespace Erdos3
variable {V W : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W]
noncomputable def scaledLinearResidual (E : V →ₗ[ℝ] W) (T : W →ₗ[ℝ] V) (q : ℝ) : V →ₗ[ℝ] V := q • LinearMap.id - T.comp E
theorem scaledLinearResidual_apply (E : V →ₗ[ℝ] W) (T : W →ₗ[ℝ] V) (q : ℝ) (x : V) : scaledLinearResidual E T q x = q • x - T (E x) := rfl
theorem scaledLinearResidual_evaluation (E : V →ₗ[ℝ] W) (T : W →ₗ[ℝ] V) (q : ℝ) (hT : ∀ x, E (T (E x)) = q • E x) (x : V) : E (scaledLinearResidual E T q x) = 0 := by rw [scaledLinearResidual_apply, map_sub, map_smul, hT, sub_self]
theorem scaledLinearResidual_on_kernel (E : V →ₗ[ℝ] W) (T : W →ₗ[ℝ] V) (q : ℝ) (x : V) (hx : E x = 0) : scaledLinearResidual E T q x = q • x := by rw [scaledLinearResidual_apply, hx, map_zero, sub_zero]
theorem scaledLinearResidual_factor_iff (E : V →ₗ[ℝ] W) (T : W →ₗ[ℝ] V) {q : ℝ} (hq : q ≠ 0) (hT : ∀ x, E (T (E x)) = q • E x) (L : V →ₗ[ℝ] ℝ) : L.comp (scaledLinearResidual E T q) = 0 ↔ ∃ M : W →ₗ[ℝ] ℝ, L = M.comp E := by constructor · intro h refine ⟨q⁻¹ • L.comp T, ?_⟩ ext x have hx := DFunLike.congr_fun h x simp only [LinearMap.comp_apply, scaledLinearResidual_apply, map_sub, map_smul, smul_eq_mul, LinearMap.zero_apply, sub_eq_zero] at hx simp only [LinearMap.comp_apply, LinearMap.smul_apply, smul_eq_mul] rw [← hx, ← mul_assoc, inv_mul_cancel₀ hq, one_mul] · rintro ⟨M, rfl⟩ ext x simp only [LinearMap.comp_apply, scaledLinearResidual_evaluation E T q hT, map_zero, LinearMap.zero_apply]
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273import OAI.Combinatorics.Progressions.Lattices.EuclideanDerivativeLatticeimport OAI.Combinatorics.Progressions.Linear.GramBasisChange
namespace OAI
section
namespace Erdos3
open Module
theorem gram_det_injective_map_basis {ι V E : Type*} [Fintype ι] [DecidableEq ι] [AddCommGroup V] [Module ℝ V] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] (f : V →ₗ[ℝ] E) (hf : Function.Injective f) (b₀ b₁ : Basis ι ℝ V) : (Matrix.gram ℝ (fun i => f (b₁ i))).det = (b₀.det b₁) ^ 2 * (Matrix.gram ℝ (fun i => f (b₀ i))).det := by let e := LinearEquiv.ofInjective f hf have h := gram_det_basis_change (b₀.map e) (fun i => e (b₁ i)) have hd : (b₀.map e).det (fun i => e (b₁ i)) = b₀.det b₁ := by rw [Basis.det_map] apply congrArg b₀.det funext i exact e.symm_apply_apply (b₁ i) have h₀ : Matrix.gram ℝ (b₀.map e) = Matrix.gram ℝ (fun i => f (b₀ i)) := by ext i j simp only [Matrix.gram_apply, Basis.map_apply] rfl have h₁ : Matrix.gram ℝ (fun i => e (b₁ i)) = Matrix.gram ℝ (fun i => f (b₁ i)) := by ext i j rfl rw [hd, h₀, h₁] at h exact h
end Erdos3
end
section
namespace Erdos3
open Module
theorem coordinateScaleEquiv_basis_det {ι : Type*} [Fintype ι] [DecidableEq ι] (T : ι → ℝ) (hT : ∀ i, T i ≠ 0) : (Pi.basisFun ℝ ι).det ((Pi.basisFun ℝ ι).map (coordinateScaleEquiv T hT)) = ∏ i, T i := by rw [Pi.basisFun_det_apply] have he : Matrix.of ((Pi.basisFun ℝ ι).map (coordinateScaleEquiv T hT)) = Matrix.diagonal T := by ext i j by_cases hij : i = j <;> simp [Basis.map_apply, coordinateScaleEquiv_apply, Pi.basisFun_apply, hij] rw [he, Matrix.det_diagonal]
theorem scaled_section_gram_sqrt {ι E : Type*} [Fintype ι] [DecidableEq ι] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] (L : (ι → ℝ) →ₗ[ℝ] E) (hL : Function.Injective L) (T : ι → ℝ) (hT : ∀ i, 0 < T i) : Real.sqrt (Matrix.gram ℝ (fun i => L (coordinateScaleEquiv T (fun j => (hT j).ne') (Pi.basisFun ℝ ι i)))).det = (∏ i, T i) * Real.sqrt (Matrix.gram ℝ (fun i => L (Pi.basisFun ℝ ι i))).det := by have h := gram_det_injective_map_basis L hL (Pi.basisFun ℝ ι) ((Pi.basisFun ℝ ι).map (coordinateScaleEquiv T (fun j => (hT j).ne'))) rw [coordinateScaleEquiv_basis_det] at h have he := congrArg Real.sqrt h rw [Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq (Finset.prod_nonneg (fun i _ => (hT i).le))] at he simpa only [Basis.map_apply] using he
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143import OAI.Combinatorics.Progressions.Lattices.MultidegreeIntegerTranslationimport OAI.Combinatorics.Progressions.Lattices.NativeIntegerHalving
namespace OAI
section
namespace Erdos3
open scoped BigOperators
def mixedSecondDifferenceInput (j : Fin 4) (x : Fin 4 → ℤ) : Fin 2 → ℤ := correlationInput (x 0) (x 1 + ![0, x 2, x 3, x 2 + x 3] j)
namespace NativeMultidegreeNilcharacter
noncomputable def mixedSecondDifferenceWithShift {s : ℕ} {p : ℝ} (M : NativeMultidegreeNilcharacter (mixedCorrelationDegree s) p) (c : Fin 4 → ℤ) (a : (Fin M.outputDim × Fin M.outputDim) × (Fin M.outputDim × Fin M.outputDim)) (x : Fin 4 → ℤ) : ℂ := (M.eval a.1.1 (mixedSecondDifferenceInput 0 x + ![0, c 0]) * star (M.eval a.1.2 (mixedSecondDifferenceInput 1 x + ![0, c 1]))) * star (M.eval a.2.1 (mixedSecondDifferenceInput 2 x + ![0, c 2]) * star (M.eval a.2.2 (mixedSecondDifferenceInput 3 x + ![0, c 3])))
theorem mixedSecondDifferenceWithShift_unit {s : ℕ} {p : ℝ} (M : NativeMultidegreeNilcharacter (mixedCorrelationDegree s) p) (c : Fin 4 → ℤ) (x : Fin 4 → ℤ) : ∑ a, ‖M.mixedSecondDifferenceWithShift c a x‖ ^ 2 = 1 := by simp only [mixedSecondDifferenceWithShift, Fintype.sum_prod_type, norm_mul, norm_star, mul_pow, ← Finset.mul_sum, M.unit_eval, mul_one]
theorem exists_mixed_second_difference_translation (s : ℕ) : ∃ C : ℕ, 2 ≤ C ∧ ∀ {p : ℝ} (M : NativeMultidegreeNilcharacter (mixedCorrelationDegree s) p) (c : Fin 4 → ℤ), NativeIntegerVectorEquivalence s ((p + C) ^ C) (M.mixedSecondDifferenceWithShift c) (M.mixedSecondDifferenceWithShift 0) := by obtain ⟨A, _, htranslate⟩ := exists_multidegree_integer_translation s obtain ⟨B, _, htensor⟩ := NativeIntegerVectorEquivalence.exists_tensor_budget let X : Polynomial ℕ := Polynomial.X let U := (X + Polynomial.C A) ^ A let V := (U + Polynomial.C B) ^ B obtain ⟨C, hC, hbudget⟩ := exists_natPolynomial_eval_budget ((V + Polynomial.C B) ^ B) refine ⟨C, hC, ?_⟩ intro p M c have hp : 0 ≤ p := (Nat.cast_nonneg M.dim).trans M.complexity.1.1 let u := (p + A) ^ A let v := (u + B) ^ B have hu : 0 ≤ u := by dsimp [u]; positivity have hv : 0 ≤ v := by dsimp [v]; positivity have hcost : (v + B) ^ B ≤ (p + C) ^ C := by simpa [X, U, V, u, v, Polynomial.eval₂_pow] using hbudget p hp have hdegree : (∑ i, mixedCorrelationDegree s i) = s + 1 := by rw [Fin.sum_univ_two] change 1 + s = s + 1 omega let F (j : Fin 4) : Fin 2 → ((Fin 4 → ℤ) →+ ℤ) := fun i => { toFun := fun x => mixedSecondDifferenceInput j x i map_zero' := by fin_cases j <;> fin_cases i <;> rfl map_add' := by intro x y fin_cases i · rfl · change (x + y) 1 + ![0, (x + y) 2, (x + y) 3, (x + y) 2 + (x + y) 3] j = (x 1 + ![0, x 2, x 3, x 2 + x 3] j) + (y 1 + ![0, y 2, y 3, y 2 + y 3] j) fin_cases j <;> dsimp <;> ring } have hzero : (![0, 0] : Fin 2 → ℤ) = 0 := by ext i; fin_cases i <;> rfl have E (j : Fin 4) : NativeIntegerVectorEquivalence s u (fun i x => M.eval i (mixedSecondDifferenceInput j x + ![0, c j])) (fun i x => M.eval i (mixedSecondDifferenceInput j x + ![0, 0])) := by have T := (htranslate (mixedCorrelationDegree s) hdegree M ![0, c j] 0).linearPullbackHom (F j) change NativeIntegerVectorEquivalence s u (fun i x => M.eval i (mixedSecondDifferenceInput j x + ![0, c j])) (fun i x => M.eval i (mixedSecondDifferenceInput j x + 0)) at T simpa only [hzero] using T have E₀ := htensor hu (E 0) (E 1).conjugate have E₁ := htensor hu (E 2) (E 3).conjugate exact (htensor hv E₀ E₁.conjugate).mono hcost
end NativeMultidegreeNilcharacter
end Erdos3
end
section
namespace Erdos3
def mixedSecondDifferenceHom (j : Fin 4) (i : Fin 2) : ((Fin 4 → ℤ) →+ ℤ) where toFun x := mixedSecondDifferenceInput j x i map_zero' := by fin_cases j <;> fin_cases i <;> rfl map_add' x y := by fin_cases i · rfl · change (x + y) 1 + ![0, (x + y) 2, (x + y) 3, (x + y) 2 + (x + y) 3] j = (x 1 + ![0, x 2, x 3, x 2 + x 3] j) + (y 1 + ![0, y 2, y 3, y 2 + y 3] j) fin_cases j <;> dsimp <;> ring
noncomputable def mixedSecondDifferenceVector {I : Type*} (f : I → (Fin 2 → ℤ) → ℂ) (a : (I × I) × (I × I)) (x : Fin 4 → ℤ) : ℂ := (f a.1.1 (mixedSecondDifferenceInput 0 x) * star (f a.1.2 (mixedSecondDifferenceInput 1 x))) * star (f a.2.1 (mixedSecondDifferenceInput 2 x) * star (f a.2.2 (mixedSecondDifferenceInput 3 x)))
theorem NativeMultidegreeNilcharacter.mixedSecondDifferenceWithShift_zero {s : ℕ} {p : ℝ} (M : NativeMultidegreeNilcharacter (mixedCorrelationDegree s) p) : M.mixedSecondDifferenceWithShift 0 = mixedSecondDifferenceVector M.eval := by have hzero : (![0, 0] : Fin 2 → ℤ) = 0 := by ext i; fin_cases i <;> rfl funext a x simp only [NativeMultidegreeNilcharacter.mixedSecondDifferenceWithShift, mixedSecondDifferenceVector, Pi.zero_apply, hzero, add_zero]
theorem NativeIntegerVectorEquivalence.exists_second_difference_budget : ∃ C : ℕ, 2 ≤ C ∧ ∀ {I J : Type*} [Fintype I] [Fintype J] {s : ℕ} {p : ℝ} {f : I → (Fin 2 → ℤ) → ℂ} {g : J → (Fin 2 → ℤ) → ℂ}, 0 ≤ p → NativeIntegerVectorEquivalence s p f g → NativeIntegerVectorEquivalence s ((p + C) ^ C) (mixedSecondDifferenceVector f) (mixedSecondDifferenceVector g) := by obtain ⟨A, _, htensor⟩ := NativeIntegerVectorEquivalence.exists_tensor_budget let X : Polynomial ℕ := Polynomial.X obtain ⟨C, hC, hbudget⟩ := exists_natPolynomial_eval_budget (((X + Polynomial.C A) ^ A + Polynomial.C A) ^ A) refine ⟨C, hC, ?_⟩ intro I J _ _ s p f g hp E let q := (p + A) ^ A have hq : 0 ≤ q := by dsimp [q]; positivity have H (j : Fin 4) : NativeIntegerVectorEquivalence s p (fun i x => f i (mixedSecondDifferenceInput j x)) (fun i x => g i (mixedSecondDifferenceInput j x)) := E.linearPullbackHom (mixedSecondDifferenceHom j) have H₀ := htensor hp (H 0) (H 1).conjugate have H₁ := htensor hp (H 2) (H 3).conjugate have hcost : (q + A) ^ A ≤ (p + C) ^ C := by simpa [X, q, Polynomial.eval₂_pow] using hbudget p hp exact (htensor hq H₀ H₁.conjugate).mono hcost
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112import OAI.Combinatorics.Progressions.Estimates.ResidualErrorAllocation
namespace OAI
section
namespace Erdos3
noncomputable def secondaryBoundaryMargin (boundary beta : ℝ) : ℝ := replacementAccuracy boundary beta
noncomputable def secondaryMeshDelta (boundary movement beta : ℝ) : ℝ := replacementAccuracy movement (secondaryBoundaryMargin boundary beta)
theorem secondaryMeshAllocation_spec {boundary movement beta : ℝ} (hboundary : 0 ≤ boundary) (hmovement : 0 ≤ movement) (hbeta : 0 < beta) : 0 < secondaryBoundaryMargin boundary beta ∧ secondaryBoundaryMargin boundary beta ≤ 1 ∧ boundary * secondaryBoundaryMargin boundary beta ≤ beta ∧ 0 < secondaryMeshDelta boundary movement beta ∧ secondaryMeshDelta boundary movement beta ≤ 1 ∧ secondaryMeshDelta boundary movement beta * movement ≤ secondaryBoundaryMargin boundary beta := by have hm := replacementAccuracy_spec hboundary hbeta have hd := replacementAccuracy_spec hmovement hm.1 exact ⟨hm.1, hm.2.1, hm.2.2, hd.1, hd.2.1, (mul_comm _ _).trans_le hd.2.2⟩
theorem secondaryMeshAllocation_inverse_bounds {boundary movement beta P : ℝ} (hboundary : 0 ≤ boundary) (hmovement : 0 ≤ movement) (hbeta : 0 < beta) (hP : 0 ≤ P) (hboundaryP : boundary ≤ Real.exp P) (hmovementP : movement ≤ Real.exp P) (hbetaP : beta⁻¹ ≤ Real.exp P) : (secondaryBoundaryMargin boundary beta)⁻¹ ≤ Real.exp (2 * P + 2) ∧ (secondaryMeshDelta boundary movement beta)⁻¹ ≤ Real.exp (4 * P + 6) := by have hm := replacementAccuracy_inverse_le_exp hboundary hbeta hP hboundaryP hbetaP refine ⟨hm, ?_⟩ have hmargin := (replacementAccuracy_spec hboundary hbeta).1 have hmovement' : movement ≤ Real.exp (2 * P + 2) := hmovementP.trans (Real.exp_le_exp.mpr (by linarith)) have hd := replacementAccuracy_inverse_le_exp hmovement hmargin (by linarith : 0 ≤ 2 * P + 2) hmovement' hm exact hd.trans_eq (by congr 1; ring)
theorem secondaryMeshAllocation_size_bounds {boundary movement beta P H scale : ℝ} (hboundary : 0 ≤ boundary) (hmovement : 0 ≤ movement) (hbeta : 0 < beta) (hP : 0 ≤ P) (hboundaryP : boundary ≤ Real.exp P) (hmovementP : movement ≤ Real.exp P) (hbetaP : beta⁻¹ ≤ Real.exp P) (hH : Real.exp (2 * P + 2) ≤ H) (hscale : 4 * Real.exp (4 * P + 6) ≤ scale) : 1 ≤ secondaryBoundaryMargin boundary beta * H ∧ 4 ≤ secondaryMeshDelta boundary movement beta * scale := by have hs := secondaryMeshAllocation_spec hboundary hmovement hbeta have hi := secondaryMeshAllocation_inverse_bounds hboundary hmovement hbeta hP hboundaryP hmovementP hbetaP constructor · have h := mul_le_mul_of_nonneg_left (hi.1.trans hH) hs.1.le simpa only [mul_inv_cancel₀ hs.1.ne'] using h · have hdiv : 4 / secondaryMeshDelta boundary movement beta ≤ scale := by calc _ = 4 * (secondaryMeshDelta boundary movement beta)⁻¹ := div_eq_mul_inv _ _ _ ≤ 4 * Real.exp (4 * P + 6) := mul_le_mul_of_nonneg_left hi.2 (by norm_num) _ ≤ scale := hscale simpa only [mul_comm] using (div_le_iff₀ hs.2.2.2.1).mp hdiv
end Erdos3
end
section
namespace Erdos3
noncomputable def secondaryMovementBudget (movement sourceRatio parameterRatio : ℝ) : ℝ := movement + sourceRatio + parameterRatio
theorem secondaryMesh_geometry {boundary movement sourceRatio parameterRatio beta : ℝ} (hb : 0 ≤ boundary) (hm : 0 ≤ movement) (hs : 0 ≤ sourceRatio) (hp : 0 ≤ parameterRatio) (hbeta : 0 < beta) : let M := secondaryMovementBudget movement sourceRatio parameterRatio let margin := secondaryBoundaryMargin boundary beta let delta := secondaryMeshDelta boundary M beta 0 < margin ∧ margin ≤ 1 ∧ boundary * margin ≤ beta ∧ 0 < delta ∧ delta ≤ 1 ∧ delta * movement ≤ margin ∧ delta * sourceRatio ≤ 1 ∧ delta * parameterRatio ≤ 1 := by intro M margin delta have hM : 0 ≤ M := by dsimp only [M, secondaryMovementBudget]; positivity have h := secondaryMeshAllocation_spec hb hM hbeta change 0 < margin ∧ margin ≤ 1 ∧ boundary * margin ≤ beta ∧ 0 < delta ∧ delta ≤ 1 ∧ delta * M ≤ margin at h have hmM : movement ≤ M := by dsimp only [M, secondaryMovementBudget]; linarith have hsM : sourceRatio ≤ M := by dsimp only [M, secondaryMovementBudget]; linarith have hpM : parameterRatio ≤ M := by dsimp only [M, secondaryMovementBudget]; linarith exact ⟨h.1, h.2.1, h.2.2.1, h.2.2.2.1, h.2.2.2.2.1, (mul_le_mul_of_nonneg_left hmM h.2.2.2.1.le).trans h.2.2.2.2.2, ((mul_le_mul_of_nonneg_left hsM h.2.2.2.1.le).trans h.2.2.2.2.2).trans h.2.1, ((mul_le_mul_of_nonneg_left hpM h.2.2.2.1.le).trans h.2.2.2.2.2).trans h.2.1⟩
theorem secondaryMovementBudget_le_exp {movement sourceRatio parameterRatio P : ℝ} (hm : movement ≤ Real.exp P) (hs : sourceRatio ≤ Real.exp P) (hp : parameterRatio ≤ Real.exp P) : secondaryMovementBudget movement sourceRatio parameterRatio ≤ Real.exp (P + 3) := by have hthree : (3 : ℝ) ≤ Real.exp 3 := by linarith [Real.add_one_le_exp (3 : ℝ)] rw [Real.exp_add] have h := mul_le_mul_of_nonneg_left hthree (Real.exp_nonneg P) unfold secondaryMovementBudget linarith
theorem normalizedMesh_upper_of_ratio {delta scale ratio : ℝ} (N : ℕ) (hdelta : 0 ≤ delta) (hbudget : delta * ratio ≤ 1) (hscale : scale ≤ ratio * (N : ℝ)) : delta * scale ≤ 2 * (N : ℝ) := by have h := mul_le_mul_of_nonneg_left hscale hdelta have h' := mul_le_mul_of_nonneg_right hbudget (Nat.cast_nonneg N) nlinarith
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import OAI.Combinatorics.Progressions.Estimates.FiniteCellRefinement
namespace OAI
section
namespace Erdos3.CellRefinement
open scoped BigOperators
variable {G : Type*} [AddCommGroup G] [DecidableEq G]
theorem active_center_integral_le (Z : Finset (G × G)) (L S : Finset G) (a f g : G → ℝ) (origin : G) (shape : G × G → Finset G) (active : G × G → Bool) {T : ℝ} (hf : ∀ r, 0 ≤ f r ∧ f r ≤ 1) (hg : ∀ r, 0 ≤ g r ∧ g r ≤ 1) (hchild : ∀ z ∈ Z, active z = true → CellBilinearBound (shape z) a T) : (𝔼 z ∈ Z, if active z = true then centerChildIntegral L S (fun r => a (origin + r)) f g z (shape z) else 0) ≤ T * (𝔼 z ∈ Z, if active z = true then centerChildPotential L S f g z (shape z) else 0) := by calc _ ≤ 𝔼 z ∈ Z, T * (if active z = true then centerChildPotential L S f g z (shape z) else 0) := by apply Finset.expect_le_expect intro z hz by_cases ha : active z = true · simpa only [ite_eq_left ha] using centerChildIntegral_le_of_cellBilinearBound L S (shape z) a f g origin z (hchild z hz ha) hf hg · simp only [ite_eq_right ha, mul_zero, le_refl] _ = _ := (Finset.mul_expect _ _ T).symm
theorem parent_bound_of_selected_children (Z : Finset (G × G)) (L S : Finset G) (a f g : G → ℝ) (origin : G) (shape : G × G → Finset G) (active : G × G → Bool) {parent T rho Phi error : ℝ} (hT : 0 ≤ T) (hf : ∀ r, 0 ≤ f r ∧ f r ≤ 1) (hg : ∀ r, 0 ≤ g r ∧ g r ≤ 1) (hchild : ∀ z ∈ Z, active z = true → CellBilinearBound (shape z) a T) (hpotential : (𝔼 z ∈ Z, if active z = true then centerChildPotential L S f g z (shape z) else 0) ≤ rho * Phi) (hparent : parent ≤ (𝔼 z ∈ Z, if active z = true then centerChildIntegral L S (fun r => a (origin + r)) f g z (shape z) else 0) + error) : parent ≤ T * rho * Phi + error := by have hsum := active_center_integral_le Z L S a f g origin shape active hf hg hchild calc _ ≤ T * (𝔼 z ∈ Z, if active z = true then centerChildPotential L S f g z (shape z) else 0) + error := hparent.trans (add_le_add hsum le_rfl) _ ≤ T * (rho * Phi) + error := add_le_add (mul_le_mul_of_nonneg_left hpotential hT) le_rfl _ = _ := by rw [mul_assoc]
end Erdos3.CellRefinement
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435import Mathlib.Data.Matrix.ColumnRowPartitionedimport OAI.Combinatorics.Progressions.Estimates.SplitSmoothProductProfileimport OAI.Combinatorics.Progressions.Geometry.SpatialPivotNormalizationimport OAI.Combinatorics.Progressions.Probability.PivotDensityCap
namespace OAI
section
namespace Erdos3
open MeasureTheory
variable {I J N : Type*} [Fintype I] [Fintype J] [Fintype N]
noncomputable def splitFreeColumns (B : (J → ℝ) →L[ℝ] (I → ℝ)) (C : (N → ℝ) →L[ℝ] (I → ℝ)) : (J ⊕ N → ℝ) →L[ℝ] (I → ℝ) := B.comp (ContinuousLinearMap.pi fun j => ContinuousLinearMap.proj (.inl j)) + C.comp (ContinuousLinearMap.pi fun n => ContinuousLinearMap.proj (.inr n))
omit [Fintype I] [Fintype J] [Fintype N] intheorem splitFreeColumns_apply (B : (J → ℝ) →L[ℝ] (I → ℝ)) (C : (N → ℝ) →L[ℝ] (I → ℝ)) (y : J ⊕ N → ℝ) : splitFreeColumns B C y = B (fun j => y (.inl j)) + C (fun n => y (.inr n)) := rfl
noncomputable def splitFreeProfile (f : (J → ℝ) × (I → ℝ) → ℝ) (g : (N → ℝ) → ℝ) (p : (J ⊕ N → ℝ) × (I → ℝ)) : ℝ := f ((fun j => p.1 (.inl j)), p.2) * g (fun n => p.1 (.inr n))
omit [Fintype I] [Fintype J] [Fintype N] intheorem splitFreeProfile_continuous {f : (J → ℝ) × (I → ℝ) → ℝ} {g : (N → ℝ) → ℝ} (hf : Continuous f) (hg : Continuous g) : Continuous (splitFreeProfile f g) := by unfold splitFreeProfile fun_prop
omit [Fintype I] [Fintype J] [Fintype N] intheorem splitFreeProfile_nonneg {f : (J → ℝ) × (I → ℝ) → ℝ} {g : (N → ℝ) → ℝ} (hf : ∀ p, 0 ≤ f p) (hg : ∀ n, 0 ≤ g n) (p) : 0 ≤ splitFreeProfile f g p := mul_nonneg (hf _) (hg _)
theorem splitFreeProfile_zero_outside {f : (J → ℝ) × (I → ℝ) → ℝ} {g : (N → ℝ) → ℝ} {R S : ℝ} (hf : ∀ p, R < ‖p‖ → f p = 0) (hg : ∀ n, S < ‖n‖ → g n = 0) (p : (J ⊕ N → ℝ) × (I → ℝ)) (hp : max R S < ‖p‖) : splitFreeProfile f g p = 0 := by let y : J → ℝ := fun j => p.1 (.inl j) let n : N → ℝ := fun n => p.1 (.inr n) by_cases hy : R < ‖(y, p.2)‖ · exact mul_eq_zero_of_left (hf _ hy) _ · have hn : S < ‖n‖ := by by_contra! hn have hy' : ‖(y, p.2)‖ ≤ R := le_of_not_gt hy have hnorm : ‖p‖ ≤ max R S := by rw [Prod.norm_def] apply max_le · rw [← splitCoordinates_norm p.1, Prod.norm_def] exact max_le ((norm_fst_le (y, p.2)).trans (hy'.trans (le_max_left _ _))) (hn.trans (le_max_right _ _)) · exact (norm_snd_le (y, p.2)).trans (hy'.trans (le_max_left _ _)) exact (not_le_of_gt hp) hnorm exact mul_eq_zero_of_right _ (hg _ hn)
theorem splitFreeProfile_slice_integrable (A : (I → ℝ) ≃L[ℝ] (I → ℝ)) (B : (J → ℝ) →L[ℝ] (I → ℝ)) (C : (N → ℝ) →L[ℝ] (I → ℝ)) {f : (J → ℝ) × (I → ℝ) → ℝ} {g : (N → ℝ) → ℝ} (hf : Continuous f) (hg : Continuous g) {R S : ℝ} (hfs : ∀ p, R < ‖p‖ → f p = 0) (hgs : ∀ n, S < ‖n‖ → g n = 0) (v : I → ℝ) : Integrable (fun p : (J → ℝ) × (N → ℝ) => f (p.1, A.symm (v - (B p.1 + C p.2))) * g p.2) := by have hc : Continuous (fun p : (J → ℝ) × (N → ℝ) => f (p.1, A.symm (v - (B p.1 + C p.2))) * g p.2) := by fun_prop apply hc.integrable_of_hasCompactSupport apply HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall (0 : (J → ℝ) × (N → ℝ)) (max R S)) intro p hp rw [Metric.mem_closedBall, dist_zero_right] by_contra! h apply hp have heq : ‖Sum.elim p.1 p.2‖ = ‖p‖ := (splitCoordinates_norm (Sum.elim p.1 p.2)).symm have hz := splitFreeProfile_zero_outside hfs hgs (Sum.elim p.1 p.2, A.symm (v - (B p.1 + C p.2))) (h.trans_le (heq ▸ norm_fst_le (Sum.elim p.1 p.2, A.symm (v - (B p.1 + C p.2))))) exact hz
end Erdos3
end
section
namespace Erdos3
open scoped Matrix
variable {I J N : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] [Fintype N] [DecidableEq N]
theorem normalizedIntegerColumns_entry (B : Matrix I J ℤ) (T : J → ℝ) (P : I → ℝ) (i : I) (j : J) : normalizedIntegerColumns B T P i j = (P i)⁻¹ * B i j * T j := by simp [normalizedIntegerColumns, Matrix.diagonal_mul, Matrix.mul_diagonal]
theorem normalizedIntegerColumns_fromCols (B : Matrix I J ℤ) (C : Matrix I N ℤ) (T : J → ℝ) (Q : N → ℝ) (P : I → ℝ) : normalizedIntegerColumns (Matrix.fromCols B C) (Sum.elim T Q) P = Matrix.fromCols (normalizedIntegerColumns B T P) (normalizedIntegerColumns C Q P) := by ext i k cases k <;> simp [normalizedIntegerColumns_entry]
omit [DecidableEq I] [DecidableEq J] [DecidableEq N] intheorem matrixSupCLM_fromCols (B : Matrix I J ℝ) (C : Matrix I N ℝ) : matrixSupCLM (Matrix.fromCols B C) = splitFreeColumns (matrixSupCLM B) (matrixSupCLM C) := by apply ContinuousLinearMap.ext intro y rw [matrixSupCLM_apply, splitFreeColumns_apply, matrixSupCLM_apply, matrixSupCLM_apply] exact Matrix.fromCols_mulVec B C y
theorem normalizedIntegerColumns_split (B : Matrix I J ℤ) (C : Matrix I N ℤ) (T : J → ℝ) (Q : N → ℝ) (P : I → ℝ) : matrixSupCLM (normalizedIntegerColumns (Matrix.fromCols B C) (Sum.elim T Q) P) = splitFreeColumns (matrixSupCLM (normalizedIntegerColumns B T P)) (matrixSupCLM (normalizedIntegerColumns C Q P)) := by rw [normalizedIntegerColumns_fromCols, matrixSupCLM_fromCols]
end Erdos3
end
section
namespace Erdos3
open scoped NNReal
variable {I J N : Type*} [Fintype I] [Fintype J] [Fintype N]
theorem splitFreeCoordinates_norm_le (p : (J ⊕ N → ℝ) × (I → ℝ)) : ‖((fun j => p.1 (.inl j)), p.2)‖ ≤ ‖p‖ ∧ ‖fun n => p.1 (.inr n)‖ ≤ ‖p‖ := by have hleft : ‖fun j => p.1 (.inl j)‖ ≤ ‖p.1‖ := (pi_norm_le_iff_of_nonneg (norm_nonneg _)).mpr fun j => norm_le_pi_norm p.1 (.inl j) have hright : ‖fun n => p.1 (.inr n)‖ ≤ ‖p.1‖ := (pi_norm_le_iff_of_nonneg (norm_nonneg _)).mpr fun n => norm_le_pi_norm p.1 (.inr n) refine ⟨?_, hright.trans (norm_fst_le p)⟩ rw [Prod.norm_def] exact max_le (hleft.trans (norm_fst_le p)) (norm_snd_le p)
theorem splitFreeProfile_lipschitz {f : (J → ℝ) × (I → ℝ) → ℝ} {g : (N → ℝ) → ℝ} {Kf Kg Hf Hg : ℝ≥0} (hf : LipschitzWith Kf f) (hg : LipschitzWith Kg g) (hfcap : ∀ p, ‖f p‖ ≤ Hf) (hgcap : ∀ n, ‖g n‖ ≤ Hg) : LipschitzWith (Hf * Kg + Hg * Kf) (splitFreeProfile f g) := by let F := fun p : (J ⊕ N → ℝ) × (I → ℝ) => f ((fun j => p.1 (.inl j)), p.2) let G := fun p : (J ⊕ N → ℝ) × (I → ℝ) => g (fun n => p.1 (.inr n)) have hkernel : LipschitzWith 1 (fun p : (J ⊕ N → ℝ) × (I → ℝ) => ((fun j => p.1 (.inl j)), p.2)) := by apply LipschitzWith.of_dist_le_mul intro p q rw [NNReal.coe_one, one_mul, dist_eq_norm, dist_eq_norm] exact (splitFreeCoordinates_norm_le (p - q)).1 have hnonkernel : LipschitzWith 1 (fun p : (J ⊕ N → ℝ) × (I → ℝ) => fun n => p.1 (.inr n)) := by apply LipschitzWith.of_dist_le_mul intro p q rw [NNReal.coe_one, one_mul, dist_eq_norm, dist_eq_norm] exact (splitFreeCoordinates_norm_le (p - q)).2 have hF : LipschitzWith Kf F := by simpa only [mul_one, Function.comp_def] using hf.comp hkernel have hG : LipschitzWith Kg G := by simpa only [mul_one, Function.comp_def] using hg.comp hnonkernel apply LipschitzWith.of_dist_le_mul intro p q change dist (F p * G p) (F q * G q) ≤ _ rw [dist_eq_norm] have heq : F p * G p - F q * G q = F p * (G p - G q) + (F p - F q) * G q := by ring rw [heq] calc _ ≤ ‖F p * (G p - G q)‖ + ‖(F p - F q) * G q‖ := norm_add_le _ _ _ = ‖F p‖ * ‖G p - G q‖ + ‖F p - F q‖ * ‖G q‖ := by rw [norm_mul, norm_mul] _ ≤ Hf * (Kg * dist p q) + (Kf * dist p q) * Hg := by apply add_le_add · exact mul_le_mul (hfcap _) (by simpa only [dist_eq_norm] using hG.dist_le_mul p q) (norm_nonneg _) Hf.coe_nonneg · exact mul_le_mul (by simpa only [dist_eq_norm] using hF.dist_le_mul p q) (hgcap _) (norm_nonneg _) (mul_nonneg Kf.coe_nonneg dist_nonneg) _ = _ := by push_cast; ring
end Erdos3
end
section
namespace Erdos3
theorem normalizedIntegerColumns_entry_div {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (A : Matrix I J ℤ) (T : J → ℝ) (P : I → ℝ) (i : I) (j : J) : normalizedIntegerColumns A T P i j = (A i j : ℝ) * T j / P i := by rw [normalizedIntegerColumns_entry] simp only [div_eq_mul_inv] ring
theorem normalizedIntegerColumns_entry_bound {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (A : Matrix I J ℤ) (T : J → ℝ) {H C : ℝ} (hH : 0 < H) (hT : ∀ j, 0 ≤ T j) (hA : ∀ i j, |(A i j : ℝ)| * T j ≤ C * H) : ∀ i j, |normalizedIntegerColumns A T (fun _ => H) i j| ≤ C := by intro i j rw [normalizedIntegerColumns_entry_div, abs_div, abs_mul, abs_of_nonneg (hT j), abs_of_pos hH] exact (div_le_iff₀ hH).mpr (hA i j)
theorem normalizedIntegerColumns_norm_bound {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (A : Matrix I J ℤ) (T : J → ℝ) {H C : ℝ} (hH : 0 < H) (hC : 0 ≤ C) (hT : ∀ j, 0 ≤ T j) (hA : ∀ i j, |(A i j : ℝ)| * T j ≤ C * H) : ‖matrixSupCLM (normalizedIntegerColumns A T (fun _ => H))‖ ≤ Fintype.card J * C := matrixSupCLM_norm_le _ hC (normalizedIntegerColumns_entry_bound A T hH hT hA)
theorem normalizedIntegerColumns_displacement {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (A : Matrix I J ℤ) (T : J → ℝ) {H C R : ℝ} (hH : 0 < H) (hC : 0 ≤ C) (_hR : 0 ≤ R) (hT : ∀ j, 0 ≤ T j) (hA : ∀ i j, |(A i j : ℝ)| * T j ≤ C * H) (g : (J → ℝ) → ℝ) (hg : ∀ x, R < ‖x‖ → g x = 0) : ∀ x, g x ≠ 0 → ‖matrixSupCLM (normalizedIntegerColumns A T (fun _ => H)) x‖ ≤ Fintype.card J * C * R := by intro x hx have hnorm : ‖x‖ ≤ R := le_of_not_gt (fun h => hx (hg x h)) exact (ContinuousLinearMap.le_opNorm _ x).trans (mul_le_mul (normalizedIntegerColumns_norm_bound A T hH hC hT hA) hnorm (norm_nonneg _) (mul_nonneg (Nat.cast_nonneg _) hC))
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped NNReal ContDiff BigOperators
noncomputable def smoothSplitProfile (J I : Type*) [Fintype J] [Fintype I] (p : (J → ℝ) × (I → ℝ)) : ℝ := smoothProductProfile J p.1 * smoothProductProfile I p.2
theorem smoothSplitProfile_join (J I : Type*) [Fintype J] [Fintype I] (p : (J → ℝ) × (I → ℝ)) : smoothSplitProfile J I p = smoothProductProfile (J ⊕ I) (Sum.elim p.1 p.2) := (smoothProductProfile_sum J I p.1 p.2).symm
theorem smoothSplitProfile_contDiff (J I : Type*) [Fintype J] [Fintype I] : ContDiff ℝ ∞ (smoothSplitProfile J I) := ((smoothProductProfile_contDiff J).comp contDiff_fst).mul ((smoothProductProfile_contDiff I).comp contDiff_snd)
theorem smoothSplitProfile_range (J I : Type*) [Fintype J] [Fintype I] (p : (J → ℝ) × (I → ℝ)) : 0 ≤ smoothSplitProfile J I p ∧ smoothSplitProfile J I p ≤ 1 := by rw [smoothSplitProfile_join] exact smoothProductProfile_range _ _
theorem smoothSplitProfile_norm_le (J I : Type*) [Fintype J] [Fintype I] (p : (J → ℝ) × (I → ℝ)) : ‖smoothSplitProfile J I p‖ ≤ 1 := by rw [smoothSplitProfile_join] exact smoothProductProfile_norm_le _ _
theorem sumElim_norm {J I : Type*} [Fintype J] [Fintype I] (p : (J → ℝ) × (I → ℝ)) : ‖Sum.elim p.1 p.2‖ = ‖p‖ := (splitCoordinates_norm (Sum.elim p.1 p.2)).symm
theorem smoothSplitProfile_zero_outside (J I : Type*) [Fintype J] [Fintype I] (p : (J → ℝ) × (I → ℝ)) (hp : 1 < ‖p‖) : smoothSplitProfile J I p = 0 := by rw [smoothSplitProfile_join] exact smoothProductProfile_zero_outside _ _ (by rwa [sumElim_norm])
theorem smoothSplitProfile_integral (J I : Type*) [Fintype J] [Fintype I] : (∫ p, smoothSplitProfile J I p) = 1 := by change (∫ p : (J → ℝ) × (I → ℝ), smoothProductProfile J p.1 * smoothProductProfile I p.2 ∂(volume.prod volume)) = 1 rw [integral_prod_mul, smoothProductProfile_integral, smoothProductProfile_integral, one_mul]
theorem smoothSplitProfile_lipschitz (J I : Type*) [Fintype J] [Fintype I] : LipschitzWith ((Fintype.card J + Fintype.card I) * probabilityProfileLipschitz) (smoothSplitProfile J I) := by have hj : LipschitzWith 1 (fun p : (J → ℝ) × (I → ℝ) => Sum.elim p.1 p.2) := by apply LipschitzWith.of_dist_le_mul intro p q rw [NNReal.coe_one, one_mul, dist_eq_norm, dist_eq_norm] have he : Sum.elim p.1 p.2 - Sum.elim q.1 q.2 = Sum.elim (p-q).1 (p-q).2 := by funext k cases k <;> rfl rw [he, sumElim_norm] have h := (smoothProductProfile_lipschitz (J ⊕ I)).comp hj simpa only [mul_one, Fintype.card_sum, Nat.cast_add, Function.comp_def, ← smoothSplitProfile_join] using h
theorem splitFreeProfile_smooth (J I N : Type*) [Fintype J] [Fintype I] [Fintype N] : splitFreeProfile (smoothSplitProfile J I) (smoothProductProfile N) = smoothSplitProfile (J ⊕ N) I := by funext p have h := smoothProductProfile_sum J N (fun j => p.1 (.inl j)) (fun n => p.1 (.inr n)) have he : Sum.elim (fun j => p.1 (.inl j)) (fun n => p.1 (.inr n)) = p.1 := by funext k cases k <;> rfl rw [he] at h simp only [splitFreeProfile, smoothSplitProfile, h] ring
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped NNReal
noncomputable def selectedFreeFirstEquiv {I J : Type*} [Fintype I] (s : I ↪ J) : UnselectedColumn s ⊕ I ≃ J := (Equiv.sumComm _ _).trans (selectedColumnEquiv s)
noncomputable def selectedCoefficientEquiv {I J : Type*} [Fintype I] (s : I ↪ J) (R : Type*) : (UnselectedColumn s → R) × (I → R) ≃ (J → R) := (Equiv.sumPiEquivProdPi (fun _ : UnselectedColumn s ⊕ I => R)).symm.trans (Equiv.arrowCongr (selectedFreeFirstEquiv s) (Equiv.refl R))
theorem selectedCoefficientEquiv_apply {I J R : Type*} [Fintype I] (s : I ↪ J) (p : (UnselectedColumn s → R) × (I → R)) (j : J) : selectedCoefficientEquiv s R p j = Sum.elim p.1 p.2 ((selectedFreeFirstEquiv s).symm j) := rfl
theorem selectedCoefficientEquiv_norm {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) (p : (UnselectedColumn s → ℝ) × (I → ℝ)) : ‖selectedCoefficientEquiv s ℝ p‖ = ‖p‖ := by change ‖(Sum.elim p.1 p.2) ∘ (selectedFreeFirstEquiv s).symm‖ = _ exact ((selectedFreeFirstEquiv s).symm.surjective.pi_norm_comp (Sum.elim p.1 p.2)).trans (sumElim_norm p)
theorem selectedCoefficientEquiv_lipschitz {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) : LipschitzWith 1 (selectedCoefficientEquiv s ℝ) := by apply LipschitzWith.of_dist_le_mul intro p q rw [NNReal.coe_one, one_mul, dist_eq_norm, dist_eq_norm] have he : selectedCoefficientEquiv s ℝ p - selectedCoefficientEquiv s ℝ q = selectedCoefficientEquiv s ℝ (p - q) := by funext j simp only [Pi.sub_apply, selectedCoefficientEquiv_apply] cases (selectedFreeFirstEquiv s).symm j <;> rfl rw [he, selectedCoefficientEquiv_norm]
noncomputable def selectedCoefficientProfile {I J : Type*} [Fintype I] (s : I ↪ J) (f : (J → ℝ) → ℝ) : (UnselectedColumn s → ℝ) × (I → ℝ) → ℝ := f ∘ selectedCoefficientEquiv s ℝ
theorem selectedCoefficientProfile_nonneg {I J : Type*} [Fintype I] (s : I ↪ J) {f : (J → ℝ) → ℝ} (hf : ∀ x, 0 ≤ f x) : ∀ p, 0 ≤ selectedCoefficientProfile s f p := fun p => hf (selectedCoefficientEquiv s ℝ p)
theorem selectedCoefficientProfile_norm_le {I J : Type*} [Fintype I] (s : I ↪ J) {f : (J → ℝ) → ℝ} {H : ℝ} (hf : ∀ x, ‖f x‖ ≤ H) : ∀ p, ‖selectedCoefficientProfile s f p‖ ≤ H := fun p => hf (selectedCoefficientEquiv s ℝ p)
theorem selectedCoefficientProfile_lipschitz {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) {f : (J → ℝ) → ℝ} {K : ℝ≥0} (hf : LipschitzWith K f) : LipschitzWith K (selectedCoefficientProfile s f) := by simpa only [mul_one, selectedCoefficientProfile] using hf.comp (selectedCoefficientEquiv_lipschitz s)
theorem selectedCoefficientProfile_zero_outside {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) {f : (J → ℝ) → ℝ} {R : ℝ} (hf : ∀ x, R < ‖x‖ → f x = 0) : ∀ p, R < ‖p‖ → selectedCoefficientProfile s f p = 0 := by intro p hp exact hf _ (by rwa [selectedCoefficientEquiv_norm])
theorem selectedCoefficientProfile_integral {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) (f : (J → ℝ) → ℝ) : (∫ p, selectedCoefficientProfile s f p) = ∫ x, f x := by let e := selectedFreeFirstEquiv s have hsum := (volume_measurePreserving_sumPiEquivProdPi_symm (fun _ : UnselectedColumn s ⊕ I => ℝ)).integral_comp (MeasurableEquiv.sumPiEquivProdPi (fun _ : UnselectedColumn s ⊕ I => ℝ)).symm.measurableEmbedding (fun z => f (z ∘ e.symm)) have hpi := (volume_measurePreserving_piCongrLeft (fun _ : J => ℝ) e).integral_comp (MeasurableEquiv.piCongrLeft (fun _ : J => ℝ) e).measurableEmbedding f apply hsum.trans simpa only [MeasurableEquiv.coe_piCongrLeft, Equiv.piCongrLeft, Equiv.piCongrLeft', Equiv.coe_fn_symm_mk, eq_rec_constant, Function.comp_def] using hpi
end Erdos3
end
section
namespace Erdos3
variable {I J R : Type*} [Fintype I] (s : I ↪ J)
theorem selectedCoefficientEquiv_on_selected (p : (UnselectedColumn s → R) × (I → R)) (i : I) : selectedCoefficientEquiv s R p (s i) = p.2 i := by have h : selectedFreeFirstEquiv s (Sum.inr i) = s i := rfl rw [← h, selectedCoefficientEquiv_apply, Equiv.symm_apply_apply] rfl
theorem selectedCoefficientEquiv_on_unselected (p : (UnselectedColumn s → R) × (I → R)) (i : UnselectedColumn s) : selectedCoefficientEquiv s R p i.val = p.1 i := by have h : selectedFreeFirstEquiv s (Sum.inl i) = i.val := rfl rw [← h, selectedCoefficientEquiv_apply, Equiv.symm_apply_apply] rfl
theorem selectedCoefficientEquiv_eq_of_coordinates (f : J → R) (p : (UnselectedColumn s → R) × (I → R)) (hfree : ∀ i : UnselectedColumn s, f i.val = p.1 i) (hselected : ∀ i, f (s i) = p.2 i) : f = selectedCoefficientEquiv s R p := by classical funext j by_cases hj : j ∈ Set.range s · obtain ⟨i, rfl⟩ := hj exact (hselected i).trans (selectedCoefficientEquiv_on_selected s p i).symm · exact (hfree ⟨j, hj⟩).trans (selectedCoefficientEquiv_on_unselected s p ⟨j, hj⟩).symm
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485import OAI.Combinatorics.Progressions.Linear.RationalTaggedSpanProjection
namespace OAI
section
namespace Erdos3
open scoped Matrix NNReal
theorem exists_selected_image_corrections {η ι κ σ : Type*} [Fintype η] [Fintype ι] [Fintype κ] (A : Matrix η κ ℚ) (ρ : ι → η) {H l : ℕ} (hH : 1 ≤ H) (hl : 0 < l) (hA : ∀ i j, RationalHeightLE (A i j) H) {p : ℝ} (hp : 0 ≤ p) (hη : (Fintype.card η : ℝ) ≤ p) (hι : (Fintype.card ι : ℝ) ≤ p) (hκ : (Fintype.card κ : ℝ) ≤ p) (hHp : (H : ℝ) ≤ Real.exp p) (hlp : (l : ℝ) ≤ Real.exp p) (T : σ → ℝ) (hT : ∀ i, Real.exp (separationBudget p) ≤ T i) : ∃ (S : Matrix κ ι ℚ) (m : ℕ), 0 < m ∧ (m : ℝ) ≤ Real.exp ((p + 2) ^ 3 + (p + 2) ^ 36) ∧ ∀ (α : σ →₀ ℕ), α ≠ 0 → ∀ (a b : ι → ℝ) (x : η → ℝ), x ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) → ‖a‖ ≤ Real.exp p / monomialScale T α → b ∈ realDenominatorGrid l → (∀ i, x (ρ i) = a i + b i) → let e := (fun i j => (A i j : ℝ)) *ᵥ ((fun i j => (S i j : ℝ)) *ᵥ a) let q := (fun i j => (A i j : ℝ)) *ᵥ ((fun i j => (S i j : ℝ)) *ᵥ b) e ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) ∧ q ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) ∧ (∀ i, e (ρ i) = a i) ∧ (∀ i, q (ρ i) = b i) ∧ ‖e‖ ≤ Real.exp ((p + 2) ^ 3 + (p + 2) ^ 18 + p) / monomialScale T α ∧ q ∈ realDenominatorGrid m ∧ x - e - q ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) ∧ ∀ i, (x - e - q) (ρ i) = 0 := by let C : Matrix ι κ ℚ := fun i j => A (ρ i) j obtain ⟨S, m, hm, hmp, hsolve⟩ := exists_controlled_linear_splitting C hH hl (fun i j => hA (ρ i) j) hp hι hκ hHp hlp T hT have hHp' : (H : ℝ) ≤ Real.exp ((p + 2) ^ 1) := hHp.trans (Real.exp_le_exp.mpr (by simp)) have hden : (matrixDenominator A : ℝ) ≤ Real.exp ((p + 2) ^ 3) := matrixDenominator_le_exp_power A hp 1 hη hκ (fun i j => (Nat.cast_le.mpr (hA i j).2).trans hHp') have hfac : ((Fintype.card κ : ℝ) + 1) * (H + 1) ≤ Real.exp ((p + 2) ^ 3) := by apply le_trans _ (matrix_weighted_factor_le_exp_power (Fintype.card κ) hp hκ 1 (by decide)) exact mul_le_mul_of_nonneg_left (add_le_add hHp' le_rfl) (by positivity) have hnorm (y : κ → ℝ) : ‖(fun i j => (A i j : ℝ)) *ᵥ y‖ ≤ Real.exp ((p + 2) ^ 3) * ‖y‖ := (norm_matrix_mulVec_le _ (H : ℝ≥0) (fun i j => (hA i j).abs_real_le) y).trans (mul_le_mul_of_nonneg_right hfac (norm_nonneg y)) refine ⟨S, matrixDenominator A * m, Nat.mul_pos (matrixDenominator_pos A) hm, ?_, ?_⟩ · rw [Nat.cast_mul] exact (mul_le_mul hden hmp (Nat.cast_nonneg _) (Real.exp_pos _).le).trans_eq (Real.exp_add _ _).symm · intro α hα a b x hx ha hb hselect e q obtain ⟨z, hz⟩ := hx have hC : (fun i j => (C i j : ℝ)) *ᵥ z = a + b := by funext i exact (congrFun hz (ρ i)).trans (hselect i) obtain ⟨hSa, hSb, hslow, hgrid, _⟩ := hsolve α hα a b z ha hb hC have he : e ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) := ⟨(fun i j => (S i j : ℝ)) *ᵥ a, rfl⟩ have hq : q ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) := ⟨(fun i j => (S i j : ℝ)) *ᵥ b, rfl⟩ have heq (i : ι) : e (ρ i) = a i := congrFun hSa i have hqq (i : ι) : q (ρ i) = b i := congrFun hSb i refine ⟨he, hq, heq, hqq, ?_, real_matrix_denominator_grid A m _ hgrid, Submodule.sub_mem _ (Submodule.sub_mem _ ⟨z, hz⟩ he) hq, ?_⟩ · calc ‖e‖ ≤ Real.exp ((p + 2) ^ 3) * ‖(fun i j => (S i j : ℝ)) *ᵥ a‖ := hnorm _ _ ≤ Real.exp ((p + 2) ^ 3) * (Real.exp ((p + 2) ^ 18 + p) / monomialScale T α) := mul_le_mul_of_nonneg_left hslow (Real.exp_pos _).le _ = _ := by rw [← mul_div_assoc, ← Real.exp_add] congr 2 ring · intro i change x (ρ i) - e (ρ i) - q (ρ i) = 0 rw [hselect i, heq i, hqq i] ring
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117import OAI.Combinatorics.Progressions.Geometry.SelectedCenteredJointSupportimport OAI.Combinatorics.Progressions.Lattices.RoundedAffineLifts
namespace OAI
section
namespace Erdos3.VectorPolynomial
open Module Submodule
variable {m : ℕ} {G V : Type*} [Fintype G] {I : Fin m → Type*} [∀ j, Fintype (I j)]variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type*) [∀ a, Fintype (B a)]variable {J : Fin m → Type*} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ))variable (b : ∀ j, Basis (Fin (n j)) ℝ (euclideanSubspace (U j))ᗮ)variable (hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))variable (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j)))variable (R σ : Fin m → ℝ) (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j) (L₀ : ℕ)
theorem translatedSelectedPhysicalDensity_lifts (hσ1 : ∀ j, σ j ≤ 1) (C : Fin m → ℝ) (hC : ∀ j, 0 ≤ C j) (hchart : ∀ j v, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (b j)).symm v‖ ≤ C j * ‖v‖) (hsmall : ∀ j, C j * ((Fintype.card (I j) : ℝ) + 1) * R j ≤ 1 / 4) (p : ∀ j, VectorPolynomial V ℝ (J j → ℝ)) (hp : ∀ j, DegreeLE (1 : V → ℕ) (j.val + 1) (p j)) (hm : ∀ j d, coefficients (p j) d ∈ U j) (center : CoefficientTorus (K := LayerSamplerVariables G I n B) U) (c : ∀ j, U j) (hc : center = -(QuotientAddGroup.mk' (coefficientIntegerLattice U) (constantCoefficientArray U (fun s => c s.1)))) (z : Option (LayerSamplerVariables G I n B) × V → ℤ) (hz : translatedSelectedPhysicalDensity B U b hb o R σ hR hσ L₀ center p hm z ≠ 0) : HasQuarterAffinePolynomialLifts p (fun j => (c j).val) (fun k v => (z (k,v) : ℝ)) (layerSamplerBox B U b (selectedLayerSamplerScale B U b R σ hR hσ L₀)) := by apply allocatedAffineDensity_quarter_lifts B U b hb o hR hσ (selectedLayerSamplerScale B U b R σ hR hσ L₀) p hm c hσ1 C hC hchart hsmall hp change selectedCoefficientDensity B U b hb o R σ hR hσ L₀ (centeredAffineCoefficientTorus U p hm c (fun k v => (z (k,v) : ℝ))) ≠ 0 rw [centeredAffineCoefficientTorus_eq_subtractive, ← hc] exact hz
end Erdos3.VectorPolynomial
end
section
namespace Erdos3.VectorPolynomial
open Module Submodule BooleanCubeKernelopen scoped BigOperators
variable {m : ℕ} {G X : Type*} [Fintype G] [Fintype X]variable {I : Fin m → Type*} [∀ j, Fintype (I j)]variable {n : Fin m → ℕ} (B : LayerSamplerAxis I n → Type*) [∀ a, Fintype (B a)]variable {J : Fin m → Type*} [∀ j, Fintype (J j)] (U : ∀ j, Submodule ℝ (J j → ℝ))variable (b : ∀ j, Basis (Fin (n j)) ℝ (euclideanSubspace (U j))ᗮ)variable (hb : ∀ j, span ℤ (Set.range (b j)) = projectedIntegerLattice (euclideanSubspace (U j)))variable (o : ∀ j, OrthonormalBasis (I j) ℝ (euclideanSubspace (U j)))variable (R σ : Fin m → ℝ) (hR : ∀ j, 0 < R j) (hσ : ∀ j, 0 < σ j) (L₀ : ℕ)variable (p : ∀ j, VectorPolynomial X ℝ (J j → ℝ)) (hm : ∀ j d, coefficients (p j) d ∈ U j)
noncomputable def jointSelectedPhysicalDensity (center : CoefficientTorus (K := LayerSamplerVariables G I n B) U) (a : X → ℤ) : (Option (LayerSamplerVariables G I n B) × X → ℤ) → ℝ := translatedSelectedPhysicalDensity B U b hb o R σ hR hσ L₀ (coefficientConstantCenter U center) (fun j => translate (fun i => (a i : ℝ)) (p j)) (fun j => coefficients_translate_mem (U j) (fun i => (a i : ℝ)) (p j) (hm j))
variable [∀ j, IsZLattice ℝ (latticeSection (standardEuclideanLattice (J j)) (euclideanSubspace (U j)))]
omit [Fintype X] intheorem jointSelectedPhysicalDensity_nonneg (center : CoefficientTorus (K := LayerSamplerVariables G I n B) U) (a : X → ℤ) (z : Option (LayerSamplerVariables G I n B) × X → ℤ) : 0 ≤ jointSelectedPhysicalDensity B U b hb o R σ hR hσ L₀ p hm center a z := translatedSelectedPhysicalDensity_nonneg B U b hb o R σ hR hσ L₀ _ _ _ _
theorem exists_selectedJointFiniteLaw_lifts (hσ1 : ∀ j, σ j ≤ 1) (C : Fin m → ℝ) (hC : ∀ j, 0 ≤ C j) (hchart : ∀ j v, ‖(normalizedOrthogonalChart (euclideanSubspace (U j)) (b j)).symm v‖ ≤ C j * ‖v‖) (hsmall : ∀ j, C j * ((Fintype.card (I j) : ℝ) + 1) * R j ≤ 1 / 4) (hp : ∀ j, DegreeLE (1 : X → ℕ) (j.val + 1) (p j)) (A : Finset (X → ℤ)) (hA : A.Nonempty) (modulus : X → ℕ) (T : Finset (ColumnResiduePattern (Option (LayerSamplerVariables G I n B)) X modulus)) (W : Option (LayerSamplerVariables G I n B) × X → ℝ) (hW : ∀ z, 0 < W z) (hZ : 0 < ∑' z, selectedResidueSmoothWeight modulus T W z) (center : CoefficientTorus (K := LayerSamplerVariables G I n B) U) (hD : 0 < selectedJointDensityMass A modulus T W (jointSelectedPhysicalDensity B U b hb o R σ hR hσ L₀ p hm center)) : ∃ c : ∀ j, U j, coefficientConstantCenter U center = -(QuotientAddGroup.mk' (coefficientIntegerLattice U) (constantCoefficientArray U (fun s => c s.1))) ∧ ∀ z : A × rectangularWeightIndices 0 W 1, 0 < (selectedJointFiniteLaw A hA modulus T W hW hZ (jointSelectedPhysicalDensity B U b hb o R σ hR hσ L₀ p hm center) (jointSelectedPhysicalDensity_nonneg B U b hb o R σ hR hσ L₀ p hm center) hD).weight z → HasQuarterAffinePolynomialLifts p (fun j => (c j).val) (fun k i => (jointIntegerFrame (z.1.val,z.2.val) k i : ℝ)) (layerSamplerBox B U b (selectedLayerSamplerScale B U b R σ hR hσ L₀)) := by obtain ⟨c, hc⟩ := exists_subtractive_constant_center U center refine ⟨c, hc, ?_⟩ intro z hz have hd := (selectedJointFiniteLaw_support A hA modulus T W hW hZ (jointSelectedPhysicalDensity B U b hb o R σ hR hσ L₀ p hm center) (jointSelectedPhysicalDensity_nonneg B U b hb o R σ hR hσ L₀ p hm center) hD z hz).2 apply HasQuarterAffinePolynomialLifts.joint_frame z.1.val z.2.val exact translatedSelectedPhysicalDensity_lifts B U b hb o R σ hR hσ L₀ hσ1 C hC hchart hsmall (fun j => translate (fun i => (z.1.val i : ℝ)) (p j)) (fun j => degreeLE_translate (1 : X → ℕ) (fun _ => by norm_num) _ (p j) (hp j)) (fun j => coefficients_translate_mem (U j) (fun i => (z.1.val i : ℝ)) (p j) (hm j)) (coefficientConstantCenter U center) c hc z.2.val hd.ne'
end Erdos3.VectorPolynomial
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import OAI.Combinatorics.Progressions.Probability.PositiveDensityNormalization
namespace OAI
section
namespace Erdos3
open BooleanCubeKernelopen scoped BigOperators Classical
theorem selectedJointFiniteLaw_site_excess {K I X T : Type*} [Fintype K] [Fintype I] [Fintype X] [Nonempty X] [Fintype T] [Nonempty T] (A : Finset (I → ℤ)) (hA : A.Nonempty) (modulus : I → ℕ) (cells : Finset (ColumnResiduePattern (Option K) I modulus)) (W : Option K × I → ℝ) (hW : ∀ z, 0 < W z) (hZ : 0 < ∑' z, selectedResidueSmoothWeight modulus cells W z) (D : (I → ℤ) → (Option K × I → ℤ) → ℝ) (hD : ∀ a z, 0 ≤ D a z) (htotal : 0 < selectedJointDensityMass A modulus cells W D) (hlower : 1 / 2 ≤ selectedJointDensityMass A modulus cells W D) (e : X → I → ℝ) (he : Function.Injective e) (root : T → K → ℤ) (F : (A × rectangularWeightIndices 0 W 1) → T → X) (hF : ∀ z t, e (F z t) = (fun i => (z.1.val i : ℝ)) + physicalAffineSite (root t) z.2.val) (hcard : (Fintype.card X : ℝ) / A.card ≤ 2) {M ε : ℝ} (hM : 0 ≤ M) (hlocal : ∀ (a : I → ℤ) (t : T) (φ : (I → ℝ) → ℝ), (∀ u, φ u ∈ Set.Icc (0 : ℝ) 1) → (∑' z, (selectedResidueSmoothPMF modulus cells W hW hZ z).toReal * (φ ((fun i => (a i : ℝ)) + physicalAffineSite (root t) z) * D a z)) ≤ M * (∑' z, (selectedResidueSmoothPMF modulus cells W hW hZ z).toReal * φ ((fun i => (a i : ℝ)) + physicalAffineSite (root t) z)) + ε) : (FiniteProbabilityWeights.uniform X).excessMass ((selectedJointFiniteLaw A hA modulus cells W hW hZ D hD htotal).siteLaw F) (4 * M) ≤ 2 * ε := by let : Nonempty A := hA.to_subtype let q := selectedResidueFiniteLaw modulus cells W hW hZ apply FiniteProbabilityWeights.siteLaw_excessMass_le_of_test_bound intro φ hφ t let ψ : (I → ℝ) → ℝ := fun u => φ (Function.invFun e u) have hψ (u) : ψ u ∈ Set.Icc (0 : ℝ) 1 := hφ _ have hvalue (z : A × rectangularWeightIndices 0 W 1) : ψ ((fun i => (z.1.val i : ℝ)) + physicalAffineSite (root t) z.2.val) = φ (F z t) := by rw [← hF z t] exact congrArg φ (Function.leftInverse_invFun he (F z t)) have hinj (z : rectangularWeightIndices 0 W 1) : Function.Injective (fun a : A => F (a, z) t) := by intro a b hab have hc := congrArg e hab rw [hF, hF] at hc have hd := add_right_cancel hc apply Subtype.ext funext i exact_mod_cast congrFun hd i have hlocal' (a : A) : q.mean (fun z => D a.val z.val * φ (F (a, z) t)) ≤ M * q.mean (fun z => φ (F (a, z) t)) + ε := by have h := hlocal a.val t ψ hψ rw [← selectedResidueFiniteLaw_mean, ← selectedResidueFiniteLaw_mean] at h have hv (z : rectangularWeightIndices 0 W 1) : ψ ((fun i => (a.val i : ℝ)) + physicalAffineSite (root t) z.val) = φ (F (a, z) t) := hvalue (a, z) simpa only [hv, mul_comm] using h have hz : 0 < ((FiniteProbabilityWeights.uniform A).prod q).mean (fun z => D z.1.val z.2.val) := by change 0 < (selectedJointReference A hA modulus cells W hW hZ).mean _ rw [selectedJointReference_densityMass] exact htotal have hl : 1 / 2 ≤ ((FiniteProbabilityWeights.uniform A).prod q).mean (fun z => D z.1.val z.2.val) := by change 1 / 2 ≤ (selectedJointReference A hA modulus cells W hW hZ).mean _ rw [selectedJointReference_densityMass] exact hlower have h := FiniteProbabilityWeights.uniform_base_reweight_test_le q (fun z => D z.1.val z.2.val) (fun z => hD z.1.val z.2.val) hz (fun z => F z t) hinj φ (fun x => (hφ x).1) hM (by norm_num : (0 : ℝ) < 1 / 2) hl hlocal' change (selectedJointFiniteLaw A hA modulus cells W hW hZ D hD htotal).mean (fun z => φ (F z t)) ≤ _ at h apply h.trans have hn := (FiniteProbabilityWeights.uniform X).mean_nonneg (fun x => (hφ x).1) have hr : (Fintype.card X : ℝ) / Fintype.card A ≤ 2 := by simpa using hcard have hm := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hr hM) hn nlinarith
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import OAI.Combinatorics.Progressions.Probability.PositiveDensityNormalization
namespace OAI
section
namespace Erdos3
open scoped BigOperators
theorem selectedJointFiniteLaw_weighted_reference_comparison {B K I : Type*} [Fintype K] [Fintype I] (A : Finset B) (hA : A.Nonempty) (modulus : I → ℕ) (T : Finset (ColumnResiduePattern K I modulus)) (V : K × I → ℝ) (hV : ∀ z, 0 < V z) (hZ : 0 < ∑' z, selectedResidueSmoothWeight modulus T V z) (D : B → (K × I → ℤ) → ℝ) (hD0 : ∀ a z, 0 ≤ D a z) (hD : 0 < selectedJointDensityMass A modulus T V D) (f : B → (K × I → ℤ) → ℂ) (hf : ∀ a z, ‖f a z‖ ≤ 1) {ε η : ℝ} (hmass : ∀ a, |selectedResidueDensityMass modulus T V (D a) - 1| ≤ η) (htest : ∀ a, ‖(∑' z, ((selectedResidueSmoothPMF modulus T V hV hZ z).toReal : ℂ) * (f a z * (D a z : ℂ))) - ∑' z, ((selectedResidueSmoothPMF modulus T V hV hZ z).toReal : ℂ) * f a z‖ ≤ ε) : ‖(selectedJointFiniteLaw A hA modulus T V hV hZ D hD0 hD).complexMean (fun z => f z.1.val z.2.val) - (selectedJointReference A hA modulus T V hV hZ).complexMean (fun z => f z.1.val z.2.val)‖ ≤ η + ε := by let p := FiniteProbabilityWeights.uniformFinset A hA let q := selectedResidueFiniteLaw modulus T V hV hZ let test (z : A × rectangularWeightIndices 0 V 1) := f z.1.val z.2.val let density (z : A × rectangularWeightIndices 0 V 1) := D z.1.val z.2.val have hraw := p.norm_complexMean_sub_le (fun a => q.complexMean (fun z => (D a.val z.val : ℂ) * f a.val z.val)) (fun a => q.complexMean (fun z => f a.val z.val)) (fun _ => ε) (by intro a _ change ‖(selectedResidueFiniteLaw modulus T V hV hZ).complexMean (fun z => (D a.val z.val : ℂ) * f a.val z.val) - (selectedResidueFiniteLaw modulus T V hV hZ).complexMean (fun z => f a.val z.val)‖ ≤ ε rw [selectedResidueFiniteLaw_complexMean modulus T V hV hZ (fun z => (D a.val z : ℂ) * f a.val z), selectedResidueFiniteLaw_complexMean modulus T V hV hZ (f a.val)] simpa only [mul_comm (D a.val _ : ℂ)] using htest a.val) rw [p.mean_const] at hraw have hraw' : ‖(p.prod q).complexMean (fun z => (density z : ℂ) * test z) - (p.prod q).complexMean test‖ ≤ ε := by simpa only [FiniteProbabilityWeights.complexMean_prod, density, test] using hraw have hglobal : 0 < (selectedJointReference A hA modulus T V hV hZ).mean density := by rw [selectedJointReference_densityMass] exact hD have hnorm := (selectedJointReference A hA modulus T V hV hZ).normalizedDensityTest_remove_normalization density (fun z => hD0 z.1.val z.2.val) hglobal test (fun z => hf z.1.val z.2.val) rw [selectedJointReference_densityMass] at hnorm have hnorm' := hnorm.trans (selectedJointDensityMass_close A hA modulus T V D hmass) rw [selectedJointFiniteLaw_complexMean] exact (norm_sub_le_norm_sub_add_norm_sub _ _ _).trans (add_le_add hnorm' hraw')
theorem selectedJointFiniteLaw_weighted_reference_real_comparison {B K I : Type*} [Fintype K] [Fintype I] (A : Finset B) (hA : A.Nonempty) (modulus : I → ℕ) (T : Finset (ColumnResiduePattern K I modulus)) (V : K × I → ℝ) (hV : ∀ z, 0 < V z) (hZ : 0 < ∑' z, selectedResidueSmoothWeight modulus T V z) (D : B → (K × I → ℤ) → ℝ) (hD0 : ∀ a z, 0 ≤ D a z) (hD : 0 < selectedJointDensityMass A modulus T V D) (f : B → (K × I → ℤ) → ℝ) (hf : ∀ a z, |f a z| ≤ 1) {ε η : ℝ} (hmass : ∀ a, |selectedResidueDensityMass modulus T V (D a) - 1| ≤ η) (htest : ∀ a, |(∑' z, (selectedResidueSmoothPMF modulus T V hV hZ z).toReal * (f a z * D a z)) - ∑' z, (selectedResidueSmoothPMF modulus T V hV hZ z).toReal * f a z| ≤ ε) : |(selectedJointFiniteLaw A hA modulus T V hV hZ D hD0 hD).mean (fun z => f z.1.val z.2.val) - (selectedJointReference A hA modulus T V hV hZ).mean (fun z => f z.1.val z.2.val)| ≤ η + ε := by have h := selectedJointFiniteLaw_weighted_reference_comparison A hA modulus T V hV hZ D hD0 hD (fun a z => (f a z : ℂ)) (fun a z => by simpa only [Complex.norm_real, Real.norm_eq_abs] using hf a z) hmass (fun a => by simpa only [← Complex.ofReal_mul, ← Complex.ofReal_tsum, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] using htest a) simpa only [FiniteProbabilityWeights.complexMean_ofReal, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] using h
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107import Mathlib.MeasureTheory.Integral.Prodimport OAI.Combinatorics.Progressions.Geometry.ContinuousOutputBoximport OAI.Combinatorics.Progressions.Probability.SelectedDensityNormalization
namespace OAI
section
namespace Erdos3
open MeasureTheoryopen scoped NNReal
noncomputable def selectedOutputSlice {I J : Type*} [Fintype J] (s : J ↪ I) (f : (I → ℝ) → ℝ) (x : UnselectedColumn s → ℝ) (y : J → ℝ) : ℝ := f (selectedCoefficientEquiv s ℝ (x, y))
theorem selectedOutputSlice_lipschitz {I J : Type*} [Fintype I] [Fintype J] (s : J ↪ I) {f : (I → ℝ) → ℝ} {K : ℝ≥0} (hf : LipschitzWith K f) (x : UnselectedColumn s → ℝ) : LipschitzWith K (selectedOutputSlice s f x) := by change LipschitzWith K (selectedCoefficientProfile s f ∘ Prod.mk x) simpa only [mul_one] using (selectedCoefficientProfile_lipschitz s hf).comp (LipschitzWith.prodMk_left x)
theorem selectedOutputSlice_support_right {I J : Type*} [Fintype I] [Fintype J] (s : J ↪ I) {f : (I → ℝ) → ℝ} {R : ℝ} (hf : ∀ v, R < ‖v‖ → f v = 0) (x : UnselectedColumn s → ℝ) (y : J → ℝ) (hy : R < ‖y‖) : selectedOutputSlice s f x y = 0 := by apply hf rw [selectedCoefficientEquiv_norm] exact hy.trans_le (norm_snd_le (x, y))
theorem selectedOutputSlice_support_left {I J : Type*} [Fintype I] [Fintype J] (s : J ↪ I) {f : (I → ℝ) → ℝ} {R : ℝ} (hf : ∀ v, R < ‖v‖ → f v = 0) (x : UnselectedColumn s → ℝ) (y : J → ℝ) (hx : R < ‖x‖) : selectedOutputSlice s f x y = 0 := by apply hf rw [selectedCoefficientEquiv_norm] exact hx.trans_le (norm_fst_le (x, y))
noncomputable def retainedSelectedOutputEquiv {W I J : Type*} [MeasurableSpace W] [Fintype I] [Fintype J] (s : J ↪ I) : (W × (UnselectedColumn s → ℝ)) × (J → ℝ) ≃ᵐ W × (I → ℝ) := MeasurableEquiv.prodAssoc.trans ((MeasurableEquiv.refl W).prodCongr (selectedCoefficientMeasurableEquiv s))
theorem retainedSelectedOutputEquiv_preserving {W I J : Type*} [MeasurableSpace W] [Fintype I] [Fintype J] (s : J ↪ I) (μ : Measure W) [SFinite μ] : MeasurePreserving (retainedSelectedOutputEquiv (W := W) s) ((μ.prod volume).prod volume) (μ.prod volume) := ((MeasurePreserving.id μ).prod (selectedCoefficientMeasurableEquiv_preserving s)).comp (measurePreserving_prodAssoc μ volume volume)
theorem retainedSelectedOutput_integrable {W I J : Type*} [MeasurableSpace W] [Fintype I] [Fintype J] (s : J ↪ I) (μ : Measure W) [SFinite μ] {f : W × (I → ℝ) → ℝ} (hf : Integrable f (μ.prod volume)) : Integrable (fun p : (W × (UnselectedColumn s → ℝ)) × (J → ℝ) => f (p.1.1, selectedCoefficientEquiv s ℝ (p.1.2, p.2))) ((μ.prod volume).prod volume) := (retainedSelectedOutputEquiv_preserving s μ).integrable_comp_of_integrable hf
theorem retainedSelectedOutput_integral {W I J : Type*} [MeasurableSpace W] [Fintype I] [Fintype J] (s : J ↪ I) (μ : Measure W) [SFinite μ] (f : W × (I → ℝ) → ℝ) : (∫ p : (W × (UnselectedColumn s → ℝ)) × (J → ℝ), f (p.1.1, selectedCoefficientEquiv s ℝ (p.1.2, p.2)) ∂(μ.prod volume).prod volume) = ∫ p, f p ∂μ.prod volume := (retainedSelectedOutputEquiv_preserving s μ).integral_comp (retainedSelectedOutputEquiv (W := W) s).measurableEmbedding f
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped NNReal
theorem selectedOutput_restricted_l1 {W I J : Type*} [MeasurableSpace W] [Fintype I] [Fintype J] (s : J ↪ I) (μ : Measure W) [SFinite μ] (R : ℝ≥0) (f : W × (I → ℝ) → ℝ) (hf : Integrable f (μ.prod volume)) {ε : ℝ} (he : (∫ p, |f p| ∂μ.prod volume) ≤ ε) : let ν := μ.prod (continuousOutputBoxMeasure (UnselectedColumn s) R) let F := fun p : (W × (UnselectedColumn s → ℝ)) × (J → ℝ) => f (p.1.1, selectedCoefficientEquiv s ℝ (p.1.2, p.2)) Integrable F (ν.prod volume) ∧ (∫ p, |F p| ∂ν.prod volume) ≤ ε := by dsimp only have hi := retainedSelectedOutput_integrable s μ hf have hle : (μ.prod (continuousOutputBoxMeasure (UnselectedColumn s) R)).prod volume ≤ (μ.prod (volume : Measure (UnselectedColumn s → ℝ))).prod (volume : Measure (J → ℝ)) := Measure.prod_mono (Measure.prod_mono le_rfl (continuousOutputBoxMeasure_le _ R)) le_rfl refine ⟨hi.mono_measure hle, ?_⟩ have ha : Integrable (fun p : (W × (UnselectedColumn s → ℝ)) × (J → ℝ) => |f (p.1.1, selectedCoefficientEquiv s ℝ (p.1.2, p.2))|) ((μ.prod volume).prod volume) := by simpa only [Real.norm_eq_abs] using hi.norm calc _ ≤ ∫ p : (W × (UnselectedColumn s → ℝ)) × (J → ℝ), |f (p.1.1, selectedCoefficientEquiv s ℝ (p.1.2, p.2))| ∂(μ.prod volume).prod volume := integral_mono_measure hle (Filter.Eventually.of_forall (fun _ => abs_nonneg _)) ha _ = ∫ p, |f p| ∂μ.prod volume := retainedSelectedOutput_integral s μ (fun p => |f p|) _ ≤ ε := he
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import OAI.Combinatorics.Progressions.Lattices.ResiduePhysicalCap
namespace OAI
section
namespace Erdos3.BooleanCubeKernel
open scoped BigOperators Classical
variable {K I : Type*} [Fintype K] [Fintype I]variable (root : K → ℤ) (modulus : I → ℕ) (hmodulus : ∀ i, 0 < modulus i)variable (T : Finset (ColumnResiduePattern (Option K) I modulus)) (hT : T.Nonempty)variable (W : Option K × I → ℝ) (hW : ∀ z, 0 < W z)variable (hZ : 0 < ∑' z, selectedResidueSmoothWeight modulus T W z)variable (hc : ∀ r : T, 0 < shiftedSmoothProductMass (residueProfileCenter (columnResidueRepresentative modulus r.val) modulus) (residueProfileWidth modulus W))variable (hbase : ∀ i, 8*(probabilityProfileLipschitz : ℝ) ≤ residueProfileWidth modulus W (none,i))
include hmodulus hT hc hbase intheorem selectedResidueSmoothPMF_physical_cap (y : I → ℝ) : ((selectedResidueSmoothPMF modulus T W hW hZ).map (physicalAffineSite root) y).toReal ≤ ∏ i, 2*(modulus i : ℝ)/W (none,i) := by obtain ⟨_, h⟩ := selectedResidueSmoothPMF_bound_of_cells (ε := ∏ i, 2*(modulus i : ℝ)/W (none,i)) modulus hmodulus T hT W hW hc (fun z => if physicalAffineSite root z = y then (1 : ℂ) else 0) (by intro r exact (pmf_point_indicator_norm _ (physicalAffineSite root) y).trans_le (residueSmoothPMF_physical_cap root (columnResidueRepresentative modulus r.val) modulus hmodulus W hW (hc r) hbase y)) exact (pmf_point_indicator_norm _ (physicalAffineSite root) y).symm.trans_le h
include hmodulus hT hc hbase intheorem selectedResidueSmoothPMF_physical_finite_event (E : Finset (I → ℝ)) : (∑ y ∈ E, ((selectedResidueSmoothPMF modulus T W hW hZ).map (physicalAffineSite root) y).toReal) ≤ (E.card : ℝ) * ∏ i, 2*(modulus i : ℝ)/W (none,i) := by calc _ ≤ ∑ _y ∈ E, ∏ i, 2*(modulus i : ℝ)/W (none,i) := Finset.sum_le_sum (fun y _ => selectedResidueSmoothPMF_physical_cap root modulus hmodulus T hT W hW hZ hc hbase y) _ = _ := by simp
end Erdos3.BooleanCubeKernel
namespace Erdos3
open scoped BigOperators
theorem spatialBaseCap_volume_bound {I : Type*} [Fintype I] (modulus : I → ℕ) (W H : I → ℝ) (hW : ∀ i, 0 < W i) (hH : ∀ i, 0 ≤ H i) {S ρ : ℝ} (hρ : 0 < ρ) (hS : 0 ≤ S) (hmodulus : ∀ i, (modulus i : ℝ) ≤ S) (hwidth : ∀ i, ρ*H i ≤ W i) : (∏ i, H i) * (∏ i, 2*(modulus i : ℝ)/W i) ≤ (2*S/ρ)^Fintype.card I := by have hi (i : I) : H i * (2*(modulus i : ℝ)/W i) ≤ 2*S/ρ := by have hr : H i / W i ≤ 1/ρ := (div_le_div_iff₀ (hW i) hρ).mpr (by simpa only [one_mul, mul_one, mul_comm] using hwidth i) calc _ = 2*(modulus i : ℝ)*(H i/W i) := by ring _ ≤ 2*S*(1/ρ) := mul_le_mul (mul_le_mul_of_nonneg_left (hmodulus i) (by norm_num)) hr (div_nonneg (hH i) (hW i).le) (mul_nonneg (by norm_num) hS) _ = _ := by ring rw [← Finset.prod_mul_distrib] calc _ ≤ ∏ _i : I, 2*S/ρ := Finset.prod_le_prod₀ (fun i _ => mul_nonneg (hH i) (div_nonneg (mul_nonneg (by norm_num) (Nat.cast_nonneg _)) (hW i).le)) (fun i _ => hi i) _ = _ := by rw [Finset.prod_const, Finset.card_univ]
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334import Mathlib.Algebra.BigOperators.Fieldimport Mathlib.Data.Fintype.Cardimport Mathlib.Tactic
namespace OAI
section
namespace Erdos3
open scoped BigOperators
theorem selected_nonnegative_product_le {A D : Type*} [Fintype A] [Fintype D] (f : D → ℝ) (hf : ∀ d, 0 ≤ f d) (selected : A → D) (hselected : Function.Injective selected) : (∏ a, f (selected a)) ≤ (1 + ∑ d, f d) ^ Fintype.card D := by let C := 1 + ∑ d, f d have hs : 0 ≤ ∑ d, f d := Finset.sum_nonneg (fun d _ => hf d) have hC : 1 ≤ C := by dsimp only [C]; linarith have hbound (a : A) : f (selected a) ≤ C := by have h := Finset.single_le_sum (fun d _ => hf d) (Finset.mem_univ (selected a)) dsimp only [C] linarith calc _ ≤ ∏ _a : A, C := Finset.prod_le_prod₀ (fun index _ => hf (selected index)) (fun index _ => hbound index) _ = C ^ Fintype.card A := by simp only [Finset.prod_const, Finset.card_univ] _ ≤ C ^ Fintype.card D := pow_le_pow_right₀ hC (Fintype.card_le_of_injective selected hselected)
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import OAI.Combinatorics.Progressions.Lattices.AffineProfileTranslationL1
namespace OAI
section
namespace Erdos3
open MeasureTheory
theorem selectedCoefficientProfile_translation_l1 {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) (f : (J → ℝ) → ℝ) {D : ℝ} (hD : 0 ≤ D) (hm : ∀ a b, (∫ x, |f (x + a) - f (x + b)|) ≤ D * dist a b) (a b : (UnselectedColumn s → ℝ) × (I → ℝ)) : (∫ p, |selectedCoefficientProfile s f (p + a) - selectedCoefficientProfile s f (p + b)|) ≤ D * dist a b := by have hadd (u v : (UnselectedColumn s → ℝ) × (I → ℝ)) : selectedCoefficientEquiv s ℝ (u + v) = selectedCoefficientEquiv s ℝ u + selectedCoefficientEquiv s ℝ v := by funext j simp only [selectedCoefficientEquiv_apply, Pi.add_apply] cases (selectedFreeFirstEquiv s).symm j <;> rfl have he : (fun p => |selectedCoefficientProfile s f (p + a) - selectedCoefficientProfile s f (p + b)|) = selectedCoefficientProfile s (fun x => |f (x + selectedCoefficientEquiv s ℝ a) - f (x + selectedCoefficientEquiv s ℝ b)|) := by funext p simp only [selectedCoefficientProfile, Function.comp_apply, hadd] rw [he, selectedCoefficientProfile_integral] apply (hm _ _).trans apply mul_le_mul_of_nonneg_left _ hD simpa only [NNReal.coe_one, one_mul] using (selectedCoefficientEquiv_lipschitz s).dist_le_mul a b
theorem affineSelectedPivot_translation_l1 {I J : Type*} [Fintype I] [Fintype J] (s : I ↪ J) (A : (I → ℝ) ≃L[ℝ] (I → ℝ)) (B : (UnselectedColumn s → ℝ) →L[ℝ] (I → ℝ)) (c w : J → ℝ) {δ : ℝ} (hδ : 0 < δ) (hw : ∀ j, δ ≤ w j) (a b : I → ℝ) : (∫ v, |pivotOutputDensity A B (selectedCoefficientProfile s (affineProductProfile c w)) (v + a) - pivotOutputDensity A B (selectedCoefficientProfile s (affineProductProfile c w)) (v + b)|) ≤ ((Fintype.card J * (4 * (probabilityProfileLipschitz : ℝ) / δ)) * ‖A.symm.toContinuousLinearMap‖) * dist a b := by have hi := selectedCoefficientProfile_integrable s (affineProductProfile_integrable c w (fun j => hδ.trans_le (hw j))) apply (pivotOutputDensity_translation_l1 A B _ hi a b).trans have he := selectedCoefficientProfile_translation_l1 s (affineProductProfile c w) (D := Fintype.card J * (4 * (probabilityProfileLipschitz : ℝ) / δ)) (by positivity) (affineProductProfile_translation_l1 c w hδ hw) (0, A.symm a) (0, A.symm b) apply he.trans have hd : dist (A.symm a) (A.symm b) ≤ ‖A.symm.toContinuousLinearMap‖ * dist a b := by rw [dist_eq_norm, ← map_sub, dist_eq_norm] exact A.symm.toContinuousLinearMap.le_opNorm _ simp only [Prod.dist_eq, dist_self, max_eq_right dist_nonneg] exact (mul_le_mul_of_nonneg_left hd (by positivity)).trans_eq (by ring)
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235import OAI.Combinatorics.Progressions.Probability.SelectedSingletonSmoothIndexLaw
namespace OAI
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators NNReal
theorem normalizedRealQuadrature_error {A M T E F : ℝ} (hM : 1 / 2 ≤ M) (hA : |A - T| ≤ E) (hm : |M - 1| ≤ F) (hT : |T| ≤ 1) : |A / M - T| ≤ 2 * (E + F) := by have hMp : 0 < M := by linarith have hF : 0 ≤ F := (abs_nonneg _).trans hm have hE : 0 ≤ E := (abs_nonneg _).trans hA have he : A / M - T = ((A - T) + T * (1 - M)) / M := by field_simp ring rw [he, abs_div, abs_of_pos hMp] apply (div_le_iff₀ hMp).mpr calc _ ≤ |A - T| + |T| * |1 - M| := by simpa only [abs_mul] using abs_add_le (A - T) (T * (1 - M)) _ ≤ E + F := by rw [abs_sub_comm (1 : ℝ) M] exact add_le_add hA ((mul_le_mul hT hm (abs_nonneg _) zero_le_one).trans_eq (one_mul F)) _ ≤ 2 * (E + F) * M := by nlinarith
theorem shiftedSmoothProductMass_pos_of_mesh {I : Type*} [Fintype I] (a S : I → ℝ) (hS : ∀ i, 0 < S i) {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hmesh : ∀ i, 1 / S i ≤ δ) (hsmall : (4 : ℝ) ^ Fintype.card I * ((Fintype.card I : ℝ) * probabilityProfileLipschitz) * δ ≤ 1 / 2) : 0 < shiftedSmoothProductMass a S := (div_pos (Finset.prod_pos (fun i _ => hS i)) (by norm_num)).trans_le (shiftedSmoothProductMass_lower a S hS hδ hδ1 hmesh hsmall)
theorem smoothProductProfile_test_lipschitz {I : Type*} [Fintype I] (φ : (I → ℝ) → ℝ) {L : ℝ≥0} (hLip : LipschitzWith L φ) (hφ : ∀ x, ‖φ x‖ ≤ 1) : LipschitzWith (L + Fintype.card I * probabilityProfileLipschitz) (fun x => smoothProductProfile I x * φ x) := by simpa only [one_mul] using lipschitz_real_mul_of_bounds (smoothProductProfile I) φ (Bf := 1) (Bg := 1) (smoothProductProfile_lipschitz I) hLip (fun x => smoothProductProfile_norm_le I x) hφ
theorem smoothProductProfile_real_test_integral_norm_le {I : Type*} [Fintype I] (φ : (I → ℝ) → ℝ) (hφ : ∀ x, ‖φ x‖ ≤ 1) : ‖∫ x, smoothProductProfile I x * φ x‖ ≤ 1 := by have hi : Integrable (smoothProductProfile I) := (smoothProductProfile_contDiff I).continuous.integrable_of_hasCompactSupport (smoothProductProfile_compact I) rw [← smoothProductProfile_integral I] apply norm_integral_le_of_norm_le hi filter_upwards [] with x rw [norm_mul, Real.norm_of_nonneg (smoothProductProfile_range I x).1] exact mul_le_of_le_one_right (smoothProductProfile_range I x).1 (hφ x)
theorem shiftedSmoothProductPMF_test_quadrature {I : Type*} [Fintype I] (a S : I → ℝ) (hS : ∀ i, 0 < S i) (hZ : 0 < shiftedSmoothProductMass a S) {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hmesh : ∀ i, 1 / S i ≤ δ) (hsmall : (4 : ℝ) ^ Fintype.card I * ((Fintype.card I : ℝ) * probabilityProfileLipschitz) * δ ≤ 1 / 2) (φ : (I → ℝ) → ℝ) {L : ℝ≥0} (hLip : LipschitzWith L φ) (hφ : ∀ x, ‖φ x‖ ≤ 1) : |(∑' k, (shiftedSmoothProductPMF a S hS hZ k).toReal * φ (rectangularLatticePoint a S k)) - ∫ x, smoothProductProfile I x * φ x| ≤ 2 * (4 : ℝ) ^ Fintype.card I * ((L : ℝ) + 2 * ((Fintype.card I : ℝ) * probabilityProfileLipschitz)) * δ := by let f := fun x => smoothProductProfile I x * φ x have hsupp (x : I → ℝ) (hx : 1 < ‖x‖) : f x = 0 := by simp only [f, smoothProductProfile_zero_outside I x hx, zero_mul] have he := rectangularLattice_quadrature f (smoothProductProfile_test_lipschitz φ hLip hφ) a S hS zero_le_one hδ hδ1 hmesh hsupp have hm := rectangularLattice_quadrature (smoothProductProfile I) (smoothProductProfile_lipschitz I) a S hS zero_le_one hδ hδ1 hmesh (smoothProductProfile_zero_outside I) simp only [NNReal.coe_add, NNReal.coe_mul, NNReal.coe_natCast, show 2 * (1 : ℝ) + 2 = 4 by norm_num] at he hm rw [smoothProductProfile_integral I] at hm change |shiftedSmoothProductMass a S / (∏ i, S i) - 1| ≤ _ at hm have hp : 0 < ∏ i, S i := Finset.prod_pos (fun i _ => hS i) have hlo : 1 / 2 ≤ shiftedSmoothProductMass a S / (∏ i, S i) := by apply (le_div_iff₀ hp).mpr simpa only [div_eq_mul_inv, one_mul, mul_comm] using shiftedSmoothProductMass_lower a S hS hδ hδ1 hmesh hsmall have hn := normalizedRealQuadrature_error hlo he hm (smoothProductProfile_real_test_integral_norm_le φ hφ) have heq : (∑' k, (shiftedSmoothProductPMF a S hS hZ k).toReal * φ (rectangularLatticePoint a S k)) = ((∑' k, f (rectangularLatticePoint a S k)) / (∏ i, S i)) / (shiftedSmoothProductMass a S / (∏ i, S i)) := by simp only [shiftedSmoothProductPMF_toReal, rectangularWeight, div_mul_eq_mul_div, ← tsum_div_const] dsimp only [f] field_simp rw [heq] exact hn.trans_eq (by ring)
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators NNReal
variable {I : Type*} [Fintype I]
theorem smoothProductProfile_complex_test_integrable (φ : (I → ℝ) → ℂ) (hφ : Continuous φ) : Integrable (fun x => (smoothProductProfile I x : ℂ) * φ x) := by apply ((Complex.continuous_ofReal.comp (smoothProductProfile_contDiff I).continuous).mul hφ).integrable_of_hasCompactSupport apply HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall (0 : I → ℝ) 1) intro x hx rw [Metric.mem_closedBall, dist_zero_right] by_contra! hn apply hx change (smoothProductProfile I x : ℂ) * φ x = 0 simp only [smoothProductProfile_zero_outside I x hn, Complex.ofReal_zero, zero_mul]
theorem shiftedSmoothProductPMF_complex_test_quadrature (a S : I → ℝ) (hS : ∀ i, 0 < S i) (hZ : 0 < shiftedSmoothProductMass a S) {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hmesh : ∀ i, 1 / S i ≤ δ) (hsmall : (4 : ℝ) ^ Fintype.card I * ((Fintype.card I : ℝ) * probabilityProfileLipschitz) * δ ≤ 1 / 2) (φ : (I → ℝ) → ℂ) {L : ℝ≥0} (hLip : LipschitzWith L φ) (hφ : ∀ x, ‖φ x‖ ≤ 1) : ‖(∑' k, ((shiftedSmoothProductPMF a S hS hZ k).toReal : ℂ) * φ (rectangularLatticePoint a S k)) - ∫ x, (smoothProductProfile I x : ℂ) * φ x‖ ≤ 4 * (4 : ℝ) ^ Fintype.card I * ((L : ℝ) + 2 * ((Fintype.card I : ℝ) * probabilityProfileLipschitz)) * δ := by have hreLip : LipschitzWith L (fun x => (φ x).re) := by apply LipschitzWith.of_dist_le_mul intro x y rw [Real.dist_eq, ← Complex.sub_re] exact (Complex.abs_re_le_norm _).trans (by simpa only [dist_eq_norm] using hLip.dist_le_mul x y) have himLip : LipschitzWith L (fun x => (φ x).im) := by apply LipschitzWith.of_dist_le_mul intro x y rw [Real.dist_eq, ← Complex.sub_im] exact (Complex.abs_im_le_norm _).trans (by simpa only [dist_eq_norm] using hLip.dist_le_mul x y) have hre := shiftedSmoothProductPMF_test_quadrature a S hS hZ hδ hδ1 hmesh hsmall (fun x => (φ x).re) hreLip (fun x => by simpa only [Real.norm_eq_abs] using (Complex.abs_re_le_norm (φ x)).trans (hφ x)) have him := shiftedSmoothProductPMF_test_quadrature a S hS hZ hδ hδ1 hmesh hsmall (fun x => (φ x).im) himLip (fun x => by simpa only [Real.norm_eq_abs] using (Complex.abs_im_le_norm (φ x)).trans (hφ x)) have hs : Summable (fun k => ((shiftedSmoothProductPMF a S hS hZ k).toReal : ℂ) * φ (rectangularLatticePoint a S k)) := finite_weighted_test_summable _ (rectangularWeightIndices a S 1) (shiftedSmoothProductPMF_toReal_zero_off a S hS hZ) _ have hi := smoothProductProfile_complex_test_integrable φ hLip.continuous have hire : (∫ x, (smoothProductProfile I x : ℂ) * φ x).re = ∫ x, smoothProductProfile I x * (φ x).re := by simpa only [RCLike.re_eq_complex_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] using (integral_re hi).symm have hiim : (∫ x, (smoothProductProfile I x : ℂ) * φ x).im = ∫ x, smoothProductProfile I x * (φ x).im := by simpa only [RCLike.im_eq_complex_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero] using (integral_im hi).symm let C := 2 * (4 : ℝ) ^ Fintype.card I * ((L : ℝ) + 2 * ((Fintype.card I : ℝ) * probabilityProfileLipschitz)) * δ calc _ ≤ |((∑' k, ((shiftedSmoothProductPMF a S hS hZ k).toReal : ℂ) * φ (rectangularLatticePoint a S k)) - ∫ x, (smoothProductProfile I x : ℂ) * φ x).re| + |((∑' k, ((shiftedSmoothProductPMF a S hS hZ k).toReal : ℂ) * φ (rectangularLatticePoint a S k)) - ∫ x, (smoothProductProfile I x : ℂ) * φ x).im| := Complex.norm_le_abs_re_add_abs_im _ _ ≤ C + C := by apply add_le_add · simpa only [Complex.sub_re, Complex.re_tsum hs, hire, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] using hre · simpa only [Complex.sub_im, Complex.im_tsum hs, hiim, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero] using him _ = _ := by dsimp only [C]; ring
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators NNReal Classical
variable {K X : Type*} [Fintype K] [Fintype X]
theorem selectedResidueSmoothPMF_singleton_complex_quadrature (modulus : X → ℕ) (hmodulus : ∀ x, 0 < modulus x) (r : ColumnResiduePattern K X modulus) (V : K × X → ℝ) (hV : ∀ z, 0 < V z) (hZ : 0 < ∑' z, selectedResidueSmoothWeight modulus {r} V z) {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hmesh : ∀ z, (modulus z.2 : ℝ) / V z ≤ δ) (hsmall : (4 : ℝ) ^ Fintype.card (K × X) * ((Fintype.card (K × X) : ℝ) * probabilityProfileLipschitz) * δ ≤ 1 / 2) (φ : (K × X → ℝ) → ℂ) {A : ℝ≥0} (hLip : LipschitzWith A φ) (hφ : ∀ x, ‖φ x‖ ≤ 1) : ‖(∑' z, ((selectedResidueSmoothPMF modulus {r} V hV hZ z).toReal : ℂ) * φ (fun k => (z k : ℝ) / V k)) - ∫ x, (smoothProductProfile (K × X) x : ℂ) * φ x‖ ≤ 4 * (4 : ℝ) ^ Fintype.card (K × X) * ((A : ℝ) + 2 * ((Fintype.card (K × X) : ℝ) * probabilityProfileLipschitz)) * δ := by rw [selectedResidueSmoothPMF_singleton_normalized_expectation modulus hmodulus r V hV hZ] apply shiftedSmoothProductPMF_complex_test_quadrature _ _ (residueProfileWidth_pos modulus V hmodulus hV) (selectedResidueSmooth_singleton_indexMass_pos modulus hmodulus r V hV hZ) hδ hδ1 _ hsmall φ hLip hφ intro z simpa only [residueProfileWidth, one_div_div] using hmesh z
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576import OAI.Combinatorics.Progressions.Lattices.JointAffineL1Parameter
namespace OAI
section
namespace Erdos3
open MeasureTheory
noncomputable def selectedSplitMeasurableEquiv {I J N : Type*} [Fintype I] [Fintype J] [Fintype N] (s : I ↪ J) : ((UnselectedColumn s ⊕ N → ℝ) × (I → ℝ)) ≃ᵐ (J ⊕ N → ℝ) := (splitFreeCoordinates I (UnselectedColumn s) N).trans (((selectedCoefficientMeasurableEquiv s).prodCongr (MeasurableEquiv.refl (N → ℝ))).trans (MeasurableEquiv.sumPiEquivProdPi (fun _ : J ⊕ N => ℝ)).symm)
theorem selectedSplitMeasurableEquiv_apply {I J N : Type*} [Fintype I] [Fintype J] [Fintype N] (s : I ↪ J) (p : (UnselectedColumn s ⊕ N → ℝ) × (I → ℝ)) : selectedSplitMeasurableEquiv s p = selectedSplitCoefficients s p := rfl
theorem selectedSplitMeasurableEquiv_symm_apply {I J N : Type*} [Fintype I] [Fintype J] [Fintype N] (s : I ↪ J) (r : J ⊕ N → ℝ) : (selectedSplitMeasurableEquiv s).symm r = (Sum.elim (fun j : UnselectedColumn s => r (.inl j.val)) (fun n => r (.inr n)), fun i => r (.inl (s i))) := rfl
theorem measurableEquiv_inverse_law {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] (e : X ≃ᵐ Y) (μ : Measure X) (ν : Measure Y) (he : μ.map e = ν) : ν.map e.symm = μ := by rw [← he, Measure.map_map e.symm.measurable e.measurable] simp only [Function.comp_def, MeasurableEquiv.symm_apply_apply, Measure.map_id']
theorem affineProductProfile_map_law {I Y : Type*} [Fintype I] [MeasurableSpace Y] (c w : I → ℝ) (hw : ∀ i, 0 < w i) (F : (I → ℝ) → Y) (hF : Measurable F) : (realDensityMeasure volume (smoothProductProfile I)).map (fun r => F (fun i => c i+w i*r i)) = (realDensityMeasure volume (affineProductProfile c w)).map F := by have hm : Measurable (fun r : I → ℝ => fun i => c i+w i*r i) := by fun_prop change Measure.map (F ∘ (fun (r : I → ℝ) i => c i+w i*r i)) _ = _ rw [← Measure.map_map hF hm, affineProductProfile_law c w hw]
theorem selectedSplit_affine_law {I J N : Type*} [Fintype I] [Fintype J] [Fintype N] (s : I ↪ J) (c w : J ⊕ N → ℝ) (hw : ∀ j, 0 < w j) : (realDensityMeasure volume (affineSelectedJetProfile s c w)).map (selectedSplitMeasurableEquiv s) = realDensityMeasure volume (affineProductProfile c w) := by have hf := selectedSplitCoefficients_law s (affineProductProfile (fun j => c (.inl j)) (fun j => w (.inl j))) (affineProductProfile (fun n => c (.inr n)) (fun n => w (.inr n))) (affineProductProfile_contDiff _ _).continuous.measurable (affineProductProfile_contDiff _ _).continuous.measurable (affineProductProfile_integrable _ _ (fun j => hw (.inl j))) (affineProductProfile_integrable _ _ (fun n => hw (.inr n))) (affineProductProfile_nonneg _ _ (fun j => hw (.inl j))) (affineProductProfile_nonneg _ _ (fun n => hw (.inr n))) change (realDensityMeasure volume (affineSelectedJetProfile s c w)).map (selectedSplitMeasurableEquiv s) = _ at hf rw [← affineProductProfile_joined] at hf exact hf
theorem selectedSplit_unit_law {I J N : Type*} [Fintype I] [Fintype J] [Fintype N] (s : I ↪ J) (c w : J ⊕ N → ℝ) (hw : ∀ j, 0 < w j) : (realDensityMeasure volume (smoothProductProfile (J ⊕ N))).map (fun r => (selectedSplitMeasurableEquiv s).symm (fun j => c j+w j*r j)) = realDensityMeasure volume (affineSelectedJetProfile s c w) := by exact (affineProductProfile_map_law c w hw _ (selectedSplitMeasurableEquiv s).symm.measurable).trans (measurableEquiv_inverse_law (selectedSplitMeasurableEquiv s) _ _ (selectedSplit_affine_law s c w hw))
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224import Mathlib.MeasureTheory.Constructions.Piimport Mathlib.MeasureTheory.Integral.Bochner.Basicimport OAI.Combinatorics.Progressions.Probability.PMFPointMassMixture
namespace OAI
section
namespace Erdos3
open scoped BigOperators Classical
theorem normalized_complex_point_error (f g : ℂ) {N ε : ℝ} (hN : 0 < N) (he : ‖(N : ℂ) * f - g‖ ≤ ε) : ‖f - g / (N : ℂ)‖ ≤ ε / N := by have hn : (N : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hN.ne' have hid : f - g / (N : ℂ) = ((N : ℂ) * f - g) / (N : ℂ) := by field_simp rw [hid, norm_div, Complex.norm_real, Real.norm_of_nonneg hN.le] exact div_le_div_of_nonneg_right he hN.le
theorem finite_window_normalized_l1_error {X : Type*} (W : Finset X) (f g : X → ℂ) {N C ε : ℝ} (hN : 0 < N) (hε : 0 ≤ ε) (hcard : (W.card : ℝ) ≤ C * N) (hzero : ∀ x ∉ W, f x = 0 ∧ g x = 0) (he : ∀ x, ‖(N : ℂ) * f x - g x‖ ≤ ε) : (∑' x, ‖f x - g x / (N : ℂ)‖) ≤ ε * C := by have hz (x) (hx : x ∉ W) : ‖f x - g x / (N : ℂ)‖ = 0 := by rw [(hzero x hx).1, (hzero x hx).2, zero_div, sub_self, norm_zero] rw [(hasSum_sum_of_ne_finset_zero hz).tsum_eq] calc _ ≤ ∑ _x ∈ W, ε / N := Finset.sum_le_sum (fun x _ => normalized_complex_point_error _ _ hN (he x)) _ = (W.card : ℝ) * (ε / N) := by simp _ ≤ (C * N) * (ε / N) := mul_le_mul_of_nonneg_right hcard (div_nonneg hε hN.le) _ = ε * C := by field_simp
theorem finite_window_normalized_test_error {X : Type*} (W : Finset X) (f g test : X → ℂ) {N C ε : ℝ} (hN : 0 < N) (hε : 0 ≤ ε) (hcard : (W.card : ℝ) ≤ C * N) (hzero : ∀ x ∉ W, f x = 0 ∧ g x = 0) (he : ∀ x, ‖(N : ℂ) * f x - g x‖ ≤ ε) (htest : ∀ x, ‖test x‖ ≤ 1) : ‖∑' x, (f x - g x / (N : ℂ)) * test x‖ ≤ ε * C := by have hz (x) (hx : x ∉ W) : (f x - g x / (N : ℂ)) * test x = 0 := by rw [(hzero x hx).1, (hzero x hx).2, zero_div, sub_self, zero_mul] have hzn (x) (hx : x ∉ W) : ‖f x - g x / (N : ℂ)‖ = 0 := by rw [(hzero x hx).1, (hzero x hx).2, zero_div, sub_self, norm_zero] rw [(hasSum_sum_of_ne_finset_zero hz).tsum_eq] calc _ ≤ ∑ x ∈ W, ‖(f x - g x / (N : ℂ)) * test x‖ := norm_sum_le _ _ _ ≤ ∑ x ∈ W, ‖f x - g x / (N : ℂ)‖ := Finset.sum_le_sum (fun x _ => by rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (htest x)) _ = ∑' x, ‖f x - g x / (N : ℂ)‖ := (hasSum_sum_of_ne_finset_zero hzn).tsum_eq.symm _ ≤ ε * C := finite_window_normalized_l1_error W f g hN hε hcard hzero he
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators Classical
variable {X Y : Type*} [Countable X] [DecidableEq X] [MeasurableSpace X] [MeasurableSingletonClass X] [MeasurableSpace Y]
theorem finite_window_weighted_integrable (W : Finset X) (f : X → ℂ) (μ : Measure Y) (z : Y → X) (w : Y → ℂ) (hz : Measurable z) (hw : Measurable w) (hzero : ∀ x ∉ W, f x = 0) (hweight : Integrable (fun y => if z y ∈ W then ‖w y‖ else 0) μ) : Integrable (fun y => w y * f (z y)) μ := by let C : ℝ := ∑ x ∈ W, ‖f x‖ apply (hweight.mul_const C).mono' (hw.mul ((measurable_of_countable f).comp hz)).aestronglyMeasurable apply ae_of_all intro y change ‖w y * f (z y)‖ ≤ (if z y ∈ W then ‖w y‖ else 0) * C by_cases hy : z y ∈ W · simp only [ite_eq_left hy, norm_mul] exact mul_le_mul_of_nonneg_left (Finset.single_le_sum (fun x _ => norm_nonneg (f x)) hy) (norm_nonneg (w y)) · simp only [ite_eq_right hy, hzero (z y) hy, mul_zero, norm_zero, zero_mul, le_refl]
theorem finite_window_weighted_integral_error (W : Finset X) (f g : X → ℂ) (μ : Measure Y) (z : Y → X) (w : Y → ℂ) (hz : Measurable z) (hw : Measurable w) {N ε : ℝ} (hN : 0 < N) (hzero : ∀ x ∉ W, f x = 0 ∧ g x = 0) (he : ∀ x, ‖(N : ℂ) * f x - g x‖ ≤ ε) (hweight : Integrable (fun y => if z y ∈ W then ‖w y‖ else 0) μ) : ‖(∫ y, w y * f (z y) ∂μ) - (∫ y, w y * g (z y) ∂μ) / (N : ℂ)‖ ≤ (ε / N) * ∫ y, if z y ∈ W then ‖w y‖ else 0 ∂μ := by have hf := finite_window_weighted_integrable W f μ z w hz hw (fun x hx => (hzero x hx).1) hweight have hg := finite_window_weighted_integrable W g μ z w hz hw (fun x hx => (hzero x hx).2) hweight rw [← integral_div, ← integral_sub hf (hg.div_const (N : ℂ)), ← integral_const_mul] apply norm_integral_le_of_norm_le (hweight.const_mul (ε / N)) apply ae_of_all intro y by_cases hy : z y ∈ W · simp only [ite_eq_left hy, mul_div_assoc, ← mul_sub, norm_mul] exact (mul_le_mul_of_nonneg_left (normalized_complex_point_error _ _ hN (he (z y))) (norm_nonneg (w y))).trans_eq (mul_comm _ _) · simp only [ite_eq_right hy, (hzero (z y) hy).1, (hzero (z y) hy).2, mul_zero, zero_div, sub_self, norm_zero, le_refl]
end Erdos3
end
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators Classical
variable {A : Type*} [Fintype A] {X : A → Type*}variable (selected : A → Prop) [DecidablePred selected]
noncomputable def selectedProductExtension (p : ∀ a, X a → ℝ) (g : (∀ a : {a // selected a}, X a.val) → ℂ) (N : ℝ) (z : ∀ a, X a) : ℂ := g (fun a => z a.val) / (N : ℂ) * ((∏ a : {a // ¬selected a}, p a.val (z a.val) : ℝ) : ℂ)
theorem selectedProductExtension_error (p : ∀ a, X a → ℝ) (hp : ∀ a z, 0 ≤ p a z) (W : ∀ a, Finset (X a)) (g : (∀ a : {a // selected a}, X a.val) → ℂ) {N ε : ℝ} (hN : 0 < N) (hzero : ∀ z, (∃ a, z a ∉ W a.val) → (∏ a : {a // selected a}, p a.val (z a)) = 0 ∧ g z = 0) (he : ∀ z, ‖(N : ℂ) * ((∏ a : {a // selected a}, p a.val (z a) : ℝ) : ℂ) - g z‖ ≤ ε) (z : ∀ a, X a) : ‖((∏ a, p a (z a) : ℝ) : ℂ) - selectedProductExtension selected p g N z‖ ≤ (ε / N) * ∏ a, if selected a then (W a : Set (X a)).indicator (fun _ => (1 : ℝ)) (z a) else p a (z a) := by have hc : 0 ≤ ∏ a : {a // ¬selected a}, p a.val (z a.val) := Finset.prod_nonneg (fun a _ => hp a.val _) have hprod := Fintype.prod_subtype_mul_prod_subtype selected (fun a => p a (z a)) have hweight := Fintype.prod_subtype_mul_prod_subtype selected (fun a => if selected a then (W a : Set (X a)).indicator (fun _ => (1 : ℝ)) (z a) else p a (z a)) simp only [Subtype.property, ite_true] at hweight have hright (a : {a // ¬selected a}) : (if selected a.val then (W a.val : Set (X a.val)).indicator (fun _ => (1 : ℝ)) (z a.val) else p a.val (z a.val)) = p a.val (z a.val) := ite_eq_right a.property simp only [hright] at hweight rw [← hprod, Complex.ofReal_mul, selectedProductExtension, ← sub_mul, norm_mul, Complex.norm_real, Real.norm_of_nonneg hc, ← hweight] by_cases hz : ∀ a : {a // selected a}, z a.val ∈ W a.val · have hi : (∏ a : {a // selected a}, (W a.val : Set (X a.val)).indicator (fun _ => (1 : ℝ)) (z a.val)) = 1 := by apply Finset.prod_eq_one intro a _ exact Set.indicator_of_mem (hz a) _ rw [hi, one_mul] exact mul_le_mul_of_nonneg_right (normalized_complex_point_error _ _ hN (he (fun a => z a.val))) hc · obtain ⟨a, ha⟩ := not_forall.mp hz obtain ⟨htrue, hg⟩ := hzero (fun a : {a // selected a} => z a.val) ⟨a, ha⟩ have hi : (∏ a : {a // selected a}, (W a.val : Set (X a.val)).indicator (fun _ => (1 : ℝ)) (z a.val)) = 0 := Finset.prod_eq_zero (Finset.mem_univ a) (Set.indicator_of_notMem ha _) rw [htrue, hg, Complex.ofReal_zero, zero_div, sub_zero, norm_zero, zero_mul, hi, zero_mul, mul_zero]
theorem selectedProductExtension_measurable [∀ a, MeasurableSpace (X a)] (p : ∀ a, X a → ℝ) (hp : ∀ a, Measurable (p a)) (g : (∀ a : {a // selected a}, X a.val) → ℂ) (hg : Measurable g) (N : ℝ) : Measurable (selectedProductExtension selected p g N) := by have hr : Measurable (fun z : ∀ a, X a => fun a : {a // selected a} => z a.val) := Measurable.of_eval (fun coordinate => measurable_pi_apply coordinate.val) have hc : Measurable (fun z : ∀ a, X a => ∏ a : {a // ¬selected a}, p a.val (z a.val)) := Finset.measurable_prod _ (fun a _ => (hp a.val).comp (measurable_pi_apply a.val)) exact ((hg.comp hr).div_const _).mul hc.complex_ofReal
theorem selectedWindow_volume_cancel {N ε V M : ℝ} (hN : 0 < N) (hε : 0 ≤ ε) (hM : 0 ≤ M) {C : ℝ} (hC : C ≤ V * N) : (ε / N) * (C * M) ≤ (ε * V) * M := by calc _ ≤ (ε / N) * ((V * N) * M) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hC hM) (div_nonneg hε hN.le) _ = _ := by field_simp
end Erdos3
end
section
namespace Erdos3
open scoped BigOperators Classical
theorem selectedProductExtension_windowIndicator {A : Type*} [Fintype A] {X : A → Type*} (selected : A → Prop) [DecidablePred selected] (p : ∀ a, X a → ℝ) (W : ∀ a, Finset (X a)) (N : ℝ) (z : ∀ a, X a) : selectedProductExtension selected p (fun x => if ∀ a : {a // selected a}, x a ∈ W a.val then 1 else 0) N z = ((∏ a, if selected a then (W a : Set (X a)).indicator (fun _ => (1 : ℝ)) (z a) else p a (z a) : ℝ) : ℂ) / (N : ℂ) := by have hweight := Fintype.prod_subtype_mul_prod_subtype selected (fun a => if selected a then (W a : Set (X a)).indicator (fun _ => (1 : ℝ)) (z a) else p a (z a)) simp only [Subtype.property, ite_true] at hweight have hright (a : {a // ¬selected a}) : (if selected a.val then (W a.val : Set (X a.val)).indicator (fun _ => (1 : ℝ)) (z a.val) else p a.val (z a.val)) = p a.val (z a.val) := ite_eq_right a.property simp only [hright] at hweight rw [← hweight, Complex.ofReal_mul] unfold selectedProductExtension dsimp only by_cases hz : ∀ a : {a // selected a}, z a.val ∈ W a.val · have hi : (∏ a : {a // selected a}, (W a.val : Set (X a.val)).indicator (fun _ => (1 : ℝ)) (z a.val)) = 1 := by apply Finset.prod_eq_one intro a _ exact Set.indicator_of_mem (hz a) _ rw [ite_eq_left hz, hi, Complex.ofReal_one] ring · obtain ⟨a, ha⟩ := not_forall.mp hz have hi : (∏ a : {a // selected a}, (W a.val : Set (X a.val)).indicator (fun _ => (1 : ℝ)) (z a.val)) = 0 := Finset.prod_eq_zero (Finset.mem_univ a) (Set.indicator_of_notMem ha _) simp only [ite_eq_right hz, hi, Complex.ofReal_zero, zero_div, zero_mul]
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768import Mathlib.Tacticimport OAI.Combinatorics.Progressions.Geometry.RightCosetMetricMap
namespace OAI
section
namespace Erdos3
open scoped ENNReal NNReal
variable {G : Type*} [Group G] [MetricSpace G] [IsIsometricSMul Gᵐᵒᵖ G]
theorem dist_le_dist_mul_of_separated_ball (Γ : Subgroup G) (z : G) (R : ℝ) (hsep : ∀ γ ∈ Γ, γ ≠ 1 → 4 * R ≤ dist z (z * γ)) {x y : G} (hx : dist x z ≤ R) (hy : dist y z ≤ R) (γ : Γ) : dist x y ≤ dist x (y * γ) := by by_cases hγ : (γ : G) = 1 · simp only [hγ, mul_one, le_refl] · have hs := hsep γ γ.property hγ have hchain : dist z (z * γ) ≤ dist z x + dist x (y * γ) + dist (y * γ) (z * γ) := (dist_triangle z x (z * γ)).trans (by linarith [dist_triangle x (y * γ) (z * γ)]) rw [dist_mul_right] at hchain have hxy := dist_triangle x z y rw [dist_comm z x] at hchain rw [dist_comm z y] at hxy linarith
theorem rightCosetEDist_eq_edist_of_separated_ball (Γ : Subgroup G) (z : G) (R : ℝ) (hsep : ∀ γ ∈ Γ, γ ≠ 1 → 4 * R ≤ dist z (z * γ)) {x y : G} (hx : dist x z ≤ R) (hy : dist y z ≤ R) : rightCosetEDist Γ x y = edist x y := by apply le_antisymm (rightCosetEDist_le Γ x y) apply le_iInf intro γ simp only [edist_dist] exact ENNReal.ofReal_le_ofReal (dist_le_dist_mul_of_separated_ball Γ z R hsep hx hy γ)
omit [IsIsometricSMul Gᵐᵒᵖ G] intheorem separated_ball_of_lipschitz_left (Γ : Subgroup G) {δ R : ℝ} {C : ℝ≥0} (hC : 0 < C) (hgap : ∀ γ ∈ Γ, γ ≠ 1 → δ ≤ dist 1 γ) (hR : 4 * R * C ≤ δ) (z : G) (hleft : LipschitzWith C (fun x => z⁻¹ * x)) : ∀ γ ∈ Γ, γ ≠ 1 → 4 * R ≤ dist z (z * γ) := by intro γ hγ hne have hLip : dist 1 γ ≤ (C : ℝ) * dist z (z * γ) := by simpa only [inv_mul_cancel, inv_mul_cancel_left] using hleft.dist_le_mul z (z * γ) have hC' : (0 : ℝ) < C := hC have hg := hgap γ hγ hne nlinarith
variable [IsTopologicalGroup G]
theorem quotient_dist_eq_of_separated_ball (Γ : Subgroup G) (hΓ : IsClosed (Γ : Set G)) (z : G) (R : ℝ) (hsep : ∀ γ ∈ Γ, γ ≠ 1 → 4 * R ≤ dist z (z * γ)) : letI := rightCosetMetricSpace Γ hΓ ∀ {x y : G}, dist x z ≤ R → dist y z ≤ R → dist (QuotientGroup.mk x : G ⧸ Γ) (QuotientGroup.mk y) = dist x y := by let := rightCosetMetricSpace Γ hΓ intro x y hx hy have h : edist (QuotientGroup.mk x : G ⧸ Γ) (QuotientGroup.mk y) = edist x y := rightCosetEDist_eq_edist_of_separated_ball Γ z R hsep hx hy simpa only [edist_dist, ENNReal.toReal_ofReal dist_nonneg] using congrArg ENNReal.toReal h
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104import Mathlib.LinearAlgebra.Lagrangeimport Mathlib.Tactic
namespace OAI
section
namespace Erdos3
open Polynomialopen scoped BigOperators
theorem coeff_X_sub_C_mul_abs_le (p : ℝ[X]) {M y : ℝ} (hM : 0 ≤ M) (hp : ∀ n, |p.coeff n| ≤ M) (hy : |y| ≤ 1) (n : ℕ) : |((X - C y) * p).coeff n| ≤ 2 * M := by cases n with | zero => simp only [mul_coeff_zero, coeff_sub, coeff_X_zero, coeff_C_zero, zero_sub, neg_mul, abs_neg, abs_mul] calc |y| * |p.coeff 0| ≤ 1 * M := mul_le_mul hy (hp 0) (abs_nonneg _) zero_le_one _ ≤ 2 * M := by linarith | succ n => rw [coeff_X_sub_C_mul] calc |p.coeff n - y * p.coeff (n + 1)| ≤ |p.coeff n| + |y * p.coeff (n + 1)| := abs_sub _ _ _ = |p.coeff n| + |y| * |p.coeff (n + 1)| := by rw [abs_mul] _ ≤ M + 1 * M := add_le_add (hp n) (mul_le_mul hy (hp (n + 1)) (abs_nonneg _) zero_le_one) _ = 2 * M := by ring
theorem coeff_prod_X_sub_C_abs_le {ι : Type*} (s : Finset ι) (v : ι → ℝ) (hv : ∀ i ∈ s, |v i| ≤ 1) (n : ℕ) : |(∏ i ∈ s, (X - C (v i))).coeff n| ≤ (2 : ℝ) ^ s.card := by classical induction s using Finset.induction_on generalizing n with | empty => simp only [Finset.prod_empty, Finset.card_empty, pow_zero, coeff_one] split_ifs <;> norm_num | @insert i s hi ih => rw [Finset.prod_insert hi, Finset.card_insert_of_notMem hi, pow_succ] have hp (k : ℕ) : |(∏ j ∈ s, (X - C (v j))).coeff k| ≤ (2 : ℝ) ^ s.card := by exact ih (fun j hj => hv j (Finset.mem_insert_of_mem hj)) k simpa only [mul_comm] using coeff_X_sub_C_mul_abs_le (∏ j ∈ s, (X - C (v j))) (by positivity : 0 ≤ (2 : ℝ) ^ s.card) hp (hv i (Finset.mem_insert_self i s)) n
theorem lagrange_basis_coeff_abs_le {ι : Type*} [DecidableEq ι] (s : Finset ι) (v : ι → ℝ) (i : ι) {r : ℝ} (hr : 0 < r) (hv : ∀ j ∈ s, |v j| ≤ 1) (hsep : ∀ j ∈ s.erase i, r ≤ |v i - v j|) (n : ℕ) : |(Lagrange.basis s v i).coeff n| ≤ (2 / r) ^ (s.erase i).card := by have heq : Lagrange.basis s v i = C (∏ j ∈ s.erase i, (v i - v j)⁻¹) * ∏ j ∈ s.erase i, (X - C (v j)) := by simp only [Lagrange.basis, Lagrange.basisDivisor, Finset.prod_mul_distrib, map_prod] have hprod : (∏ j ∈ s.erase i, |(v i - v j)⁻¹|) ≤ (r⁻¹) ^ (s.erase i).card := by apply (Finset.prod_le_prod₀ (fun j _ => abs_nonneg _) (fun j hj => ?_)).trans_eq (Finset.prod_const _) rw [abs_inv] simpa only [one_div] using one_div_le_one_div_of_le hr (hsep j hj) rw [heq, coeff_C_mul, abs_mul, Finset.abs_prod] calc _ ≤ (r⁻¹) ^ (s.erase i).card * (2 : ℝ) ^ (s.erase i).card := mul_le_mul hprod (coeff_prod_X_sub_C_abs_le (s.erase i) v (fun j hj => hv j (Finset.mem_of_mem_erase hj)) n) (abs_nonneg _) (by positivity) _ = _ := by rw [← mul_pow]; congr 1; ring
end Erdos3
end
section
namespace Erdos3
open Polynomialopen scoped BigOperators
theorem polynomial_coeff_le_of_separated_samples (p : ℝ[X]) (t : Finset ℝ) {r u : ℝ} (hr : 0 < r) (hu : 0 ≤ u) (hdeg : p.degree < t.card) (ht : ∀ x ∈ t, |x| ≤ 1) (hval : ∀ x ∈ t, |p.eval x| ≤ u) (hsep : ∀ x ∈ t, ∀ y ∈ t, x ≠ y → r ≤ |x - y|) (n : ℕ) : |p.coeff n| ≤ (t.card : ℝ) * u * (2 / r) ^ (t.card - 1) := by classical have heq : p = Lagrange.interpolate t id (fun x => p.eval x) := Lagrange.eq_interpolate (fun _ _ _ _ h => h) hdeg have hterm (x : ℝ) (hx : x ∈ t) : |(C (p.eval x) * Lagrange.basis t id x).coeff n| ≤ u * (2 / r) ^ (t.card - 1) := by rw [coeff_C_mul, abs_mul] apply mul_le_mul (hval x hx) _ (abs_nonneg _) hu have h := lagrange_basis_coeff_abs_le t id x hr ht (fun y hy => hsep x hx y (Finset.mem_of_mem_erase hy) (Finset.ne_of_mem_erase hy).symm) n simpa only [Finset.card_erase_of_mem hx] using h calc |p.coeff n| = |(∑ x ∈ t, C (p.eval x) * Lagrange.basis t id x).coeff n| := congrArg (fun q : ℝ[X] => |q.coeff n|) heq _ = |∑ x ∈ t, (C (p.eval x) * Lagrange.basis t id x).coeff n| := by rw [finsetSum_coeff] _ ≤ ∑ x ∈ t, |(C (p.eval x) * Lagrange.basis t id x).coeff n| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _x ∈ t, u * (2 / r) ^ (t.card - 1) := Finset.sum_le_sum hterm _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul]; ring
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586import OAI.Combinatorics.Progressions.Estimates.LipschitzExtensionAlongMapimport OAI.Combinatorics.Progressions.Lattices.CircleResiduePartition
namespace OAI
section
namespace Erdos3
open scoped NNReal
theorem exists_bounded_extension_on_separated_labels {A Y X : Type*} [PseudoMetricSpace Y] [PseudoMetricSpace X] (embed : A → Y) (D L B : ℝ≥0) (hsep : ∀ a b, a ≠ b → (1 : ℝ) ≤ D * dist (embed a) (embed b)) (f : A → X → ℂ) (hf : ∀ a, LipschitzWith L (f a)) (hb : ∀ a x, ‖f a x‖ ≤ B) : ∃ g : Y × X → ℂ, LipschitzWith (2 * max L (2 * B * D)) g ∧ (∀ a x, g (embed a, x) = f a x) ∧ ∀ z, ‖g z‖ ≤ 2 * B := by classical let S : Set (Y × X) := {z | z.1 ∈ Set.range embed} let label (z : S) : A := Classical.choose z.property have hlabel (z : S) : embed (label z) = z.val.1 := Classical.choose_spec z.property let F : S → ℂ := fun z => f (label z) z.val.2 let K : ℝ≥0 := max L (2 * B * D) have hLK : (L : ℝ) ≤ K := by exact_mod_cast le_max_left L (2 * B * D) have hDK : (2 * B * D : ℝ≥0) ≤ K := le_max_right _ _ have hF : LipschitzWith K F := by apply LipschitzWith.of_dist_le_mul intro z w have hY : dist z.val.1 w.val.1 ≤ dist z w := by change dist z.val.1 w.val.1 ≤ max (dist z.val.1 w.val.1) (dist z.val.2 w.val.2) exact le_max_left _ _ have hX : dist z.val.2 w.val.2 ≤ dist z w := by change dist z.val.2 w.val.2 ≤ max (dist z.val.1 w.val.1) (dist z.val.2 w.val.2) exact le_max_right _ _ by_cases h : label z = label w · have he : dist (F z) (F w) ≤ (L : ℝ) * dist z.val.2 w.val.2 := by simpa only [F, h] using (hf (label w)).dist_le_mul z.val.2 w.val.2 exact he.trans ((mul_le_mul_of_nonneg_left hX L.coe_nonneg).trans (mul_le_mul_of_nonneg_right hLK dist_nonneg)) · have hs := hsep (label z) (label w) h rw [hlabel z, hlabel w] at hs have hs' : (1 : ℝ) ≤ D * dist z w := hs.trans (mul_le_mul_of_nonneg_left hY D.coe_nonneg) have hnorm : dist (F z) (F w) ≤ 2 * (B : ℝ) := by rw [dist_eq_norm] exact (norm_sub_le _ _).trans ((add_le_add (hb (label z) z.val.2) (hb (label w) w.val.2)).trans_eq (two_mul (B : ℝ)).symm) calc _ ≤ 2 * (B : ℝ) := hnorm _ ≤ (2 * (B : ℝ)) * (D * dist z w) := by simpa only [mul_one] using mul_le_mul_of_nonneg_left hs' (by positivity : 0 ≤ 2 * (B : ℝ)) _ = ((2 * B * D : ℝ≥0) : ℝ) * dist z w := by simp only [NNReal.coe_mul, NNReal.coe_ofNat] ring _ ≤ (K : ℝ) * dist z w := mul_le_mul_of_nonneg_right (by exact_mod_cast hDK) dist_nonneg obtain ⟨g, hg, heq, hgB⟩ := exists_complex_extension_from_subset S F K B hF (fun z => hb (label z) z.val.2) refine ⟨g, hg, ?_, hgB⟩ intro a x let z : S := ⟨(embed a, x), ⟨a, rfl⟩⟩ have ha : label z = a := by by_contra h have hs := hsep (label z) a h rw [hlabel z] at hs change (1 : ℝ) ≤ D * dist (embed a) (embed a) at hs simp only [dist_self, mul_zero] at hs norm_num at hs simpa only [F, ha, z] using heq z
theorem exists_residue_real_extension {q : ℕ} [NeZero q] (f : ZMod q → ℝ → ℂ) (L : ℝ≥0) (hf : ∀ r, LipschitzWith L (f r)) (hb : ∀ r x, ‖f r x‖ ≤ 1) : ∃ g : AddCircle (1 : ℝ) × ℝ → ℂ, LipschitzWith (2 * max L (2 * (q : ℝ≥0))) g ∧ (∀ r x, g (ZMod.toAddCircle r, x) = f r x) ∧ ∀ z, ‖g z‖ ≤ 2 := by simpa using exists_bounded_extension_on_separated_labels (fun r : ZMod q => ZMod.toAddCircle r) (q : ℝ≥0) L 1 (fun r s hrs => by exact_mod_cast CircleFourier.one_le_mul_dist_toAddCircle hrs) f hf hb
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import Mathlib
namespace OAI
section
namespace Erdos3
open scoped NNReal
theorem separated_tsum_lipschitz {ι X : Type*} [PseudoMetricSpace X] (f : ι → X → ℝ) {K : ℝ≥0} (hf : ∀ i, LipschitzWith K (f i)) (hpos : ∀ i x, 0 ≤ f i x) (hsep : ∀ x i j, f i x ≠ 0 → f j x ≠ 0 → i = j) : LipschitzWith K (fun x => ∑' i, f i x) := by have hsingle (x : X) (i : ι) (hi : f i x ≠ 0) : (∑' j, f j x) = f i x := by apply tsum_eq_single i intro j hji by_contra hj exact hji (hsep x j i hj hi) have hdom (x : X) (i : ι) : f i x ≤ ∑' j, f j x := by by_cases hi : f i x = 0 · rw [hi] exact tsum_nonneg (fun j => hpos j x) · rw [hsingle x i hi] have hsub (x y : X) : (∑' i, f i x) - (∑' i, f i y) ≤ K * dist x y := by by_cases hx : ∃ i, f i x ≠ 0 · obtain ⟨i, hi⟩ := hx rw [hsingle x i hi] have h := (le_abs_self (f i x - f i y)).trans ((hf i).dist_le_mul x y) linarith [hdom y i] · have hz : ∀ i, f i x = 0 := fun i => not_ne_iff.mp (fun hi => hx ⟨i, hi⟩) simp only [hz, tsum_zero, zero_sub] exact le_trans (neg_nonpos.mpr (tsum_nonneg (fun i => hpos i y))) (mul_nonneg K.coe_nonneg dist_nonneg) apply LipschitzWith.of_dist_le_mul intro x y rw [Real.dist_eq, abs_le] have hxy := hsub x y have hyx := hsub y x rw [dist_comm y x] at hyx constructor <;> linarith
end Erdos3
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677import Mathlib.MeasureTheory.Measure.Lebesgue.Basicimport Mathlib.MeasureTheory.Measure.Realimport Mathlib.Tactic
namespace OAI
section
namespace Erdos3
open MeasureTheoryopen scoped BigOperators
theorem real_interval_cover_measure_le (t : Finset ℝ) {r : ℝ} (hr : 0 ≤ r) : volume.real (⋃ y ∈ t, Set.Ioo (y - r) (y + r)) ≤ 2 * (t.card : ℝ) * r := by apply (measureReal_biUnion_finset_le t (fun y => Set.Ioo (y - r) (y + r))).trans have hlen (y : ℝ) : volume.real (Set.Ioo (y - r) (y + r)) = 2 * r := by rw [Real.volume_real_Ioo_of_le (by linarith)] ring simp only [hlen, Finset.sum_const, nsmul_eq_mul] ring_nf exact le_rfl
theorem exists_separated_real_samples (s : Set ℝ) {r : ℝ} (hr : 0 < r) (n : ℕ) (hlarge : 2 * (n : ℝ) * r < volume.real s) : ∃ t : Finset ℝ, t.card = n ∧ (↑t : Set ℝ) ⊆ s ∧ ∀ x ∈ t, ∀ y ∈ t, x ≠ y → r ≤ |x - y| := by classical induction n with | zero => exact ⟨∅, rfl, by simp, by simp⟩ | succ n ih => have hsmall : 2 * (n : ℝ) * r < volume.real s := by push_cast at hlarge nlinarith obtain ⟨t, hcard, hts, hsep⟩ := ih hsmall let cover := ⋃ y ∈ t, Set.Ioo (y - r) (y + r) have hfinite : volume cover ≠ ⊤ := by apply measure_biUnion_ne_top t.finite_toSet intro y _ simp only [Real.volume_Ioo, ne_eq, ENNReal.ofReal_ne_top, not_false_eq_true] have hnot : ¬s ⊆ cover := by intro hsub have h := (measureReal_mono hsub hfinite).trans (real_interval_cover_measure_le t hr.le) rw [hcard] at h linarith obtain ⟨x, hxs, hxc⟩ := Set.not_subset.mp hnot have hfar (y : ℝ) (hy : y ∈ t) : r ≤ |x - y| := by by_contra! h have hxy := abs_lt.mp h apply hxc exact Set.mem_iUnion.mpr ⟨y, Set.mem_iUnion.mpr ⟨hy, ⟨by linarith, by linarith⟩⟩⟩ have hxt : x ∉ t := by intro hx have h := hfar x hx simp only [sub_self, abs_zero] at h linarith refine ⟨insert x t, by rw [Finset.card_insert_of_notMem hxt, hcard], ?_, ?_⟩ · intro y hy rcases Finset.mem_insert.mp hy with rfl | hy · exact hxs · exact hts hy · intro a ha b hb hab rcases Finset.mem_insert.mp ha with hax | hat · subst a rcases Finset.mem_insert.mp hb with rfl | hbt · exact False.elim (hab rfl) · exact hfar b hbt · rcases Finset.mem_insert.mp hb with hbx | hbt · subst b simpa only [abs_sub_comm] using hfar a hat · exact hsep a hat b hbt hab
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import OAI.Combinatorics.Progressions.Results.Basic
namespace OAI
section
namespace Erdos3
theorem eq_zero_of_integer_mul_of_abs_lt {x D : ℝ} (hD : 0 < D) (hgrid : ∃ z : ℤ, D * x = z) (hsmall : |x| < 1 / D) : x = 0 := by obtain ⟨z, hz⟩ := hgrid have hzsmall : |(z : ℝ)| < 1 := by rw [← hz, abs_mul, abs_of_pos hD] have h := (lt_div_iff₀ hD).mp hsmall nlinarith have hz0 : z = 0 := by have h : |z| < (1 : ℤ) := by exact_mod_cast hzsmall have hnonneg := abs_nonneg z have habs : |z| = 0 := by omega exact abs_eq_zero.mp habs rw [hz0, Int.cast_zero] at hz exact (mul_eq_zero.mp hz).resolve_left hD.ne'
theorem separate_kernel {V ι : Type*} [AddCommGroup V] [Module ℝ V] (Q : V →ₗ[ℝ] (ι → ℝ)) (a b : V) {D : ℝ} (hD : 0 < D) (hsum : Q (a + b) = 0) (hgrid : ∀ i, ∃ z : ℤ, D * Q b i = z) (hsmall : ∀ i, |Q a i| < 1 / D) : Q a = 0 ∧ Q b = 0 := by have hcoords : ∀ i, Q a i + Q b i = 0 := by intro i have h := congrFun hsum i simpa only [map_add, Pi.add_apply, Pi.zero_apply] using h have hb : Q b = 0 := by funext i apply eq_zero_of_integer_mul_of_abs_lt hD (hgrid i) have hneg : Q b i = -(Q a i) := by linarith [hcoords i] simpa only [hneg, abs_neg] using hsmall i refine ⟨?_, hb⟩ funext i change Q a i = 0 have hbi : Q b i = 0 := congrFun hb i linarith [hcoords i]
end Erdos3
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687import OAI.Combinatorics.Progressions.Linear.SharedFreeComparisonKernel
namespace OAI
section
namespace Erdos3
noncomputable def rankUnitDescentConstant (s : ℕ) : ℕ := (RationalFilteredNilmanifold.UnitVerticalObservable.exists_lower_rank_family.{0, 0, 0} s).choose
end Erdos3
namespace Erdos3.NativeRankRelation.CommonData
open Moduleopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
theorem CoefficientBases.comparison_lower_rank_family (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B.freeFrequency D) (pM : ℝ) (hpM : 0 ≤ pM) : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let hS := D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil ∀ [TopologicalSpace (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1))] [IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1))] [ContinuousSMul ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1))] [T2Space (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1))] (J : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j)) (M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1)))) (U : M.DegreeRankStructure (r + 1)), U.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree → U.ComplexityLE pM → ∀ Z : M.UnitVerticalObservable (U.realSubgroup s (r + 1)) (Fin W.family.outputDim × Fin W.family.outputDim) pM, Z.frequency = (pairDifferenceFunctional V.frequency).comp (SubspaceFreeLift.evaluation S J (RationalFilteredNilmanifold.piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration hS).toLinearMap → ∀ u : M.filtration.realification.PolynomialOrbit (fun _ : Unit => 1), RationalFilteredNilmanifold.HasLowerRankUnitFamily M U Z.observable u ((pM + rankUnitDescentConstant s) ^ rankUnitDescentConstant s) := by intro S hS _ _ _ _ J M U hU hUc Z hZ u have hzero := B.native_comparison_frequency_zero D E T hbQ hT V g hg D' hTfil hfreq J M U hU Z.frequency hZ obtain ⟨n, hn, Q', U', hQF, _, _, hU'c, hK⟩ := (RationalFilteredNilmanifold.UnitVerticalObservable.exists_lower_rank_family.{0, 0, 0} s).choose_spec.2 M U Z u hpM hUc hzero refine ⟨n, hn, Q', U', hU'c, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] (SubspaceFreeLift.Algebra S (r + 1) ⧸ U.filtration.layerIdeal s (r + 1))) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] (SubspaceFreeLift.Algebra S (r + 1) ⧸ U.filtration.layerIdeal s (r + 1))) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 Q'.basis obtain ⟨K, hKo, hKn, hKc, hKu, _, hKe⟩ := hK exact ⟨U.rankQuotientOrbit Q' hQF u, K, hKo, hKn, hKc, hKu, hKe⟩
end Erdos3.NativeRankRelation.CommonData
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879import OAI.Combinatorics.Progressions.Estimates.SharedFreeComparisonOrbitimport OAI.Combinatorics.Progressions.Linear.SharedFreeComparisonBasis
namespace OAI
section
namespace Erdos3
theorem four_projection_petal_add_invariant {R I E : Type*} {V : I → Type*} [CommRing R] [∀ i, AddCommGroup (V i)] [∀ i, Module R (V i)] [AddCommGroup E] (f : (∀ i, V i) → E) (K : ∀ i, Submodule R (Fin 4 → V i)) (hK : ∀ z : ∀ i, Fin 4 → V i, (∀ i, z i ∈ K i) → fourFunctionDifference f z = 0) (x p : ∀ i, V i) (hx : ∀ i, x i ∈ (K i).map (LinearMap.proj 0)) (hp : ∀ i, LinearMap.single R (fun _ : Fin 4 => V i) 0 (p i) ∈ K i) : f (x + p) = f x := by classical have hlift (i : I) : ∃ z ∈ K i, z 0 = x i := hx i choose z hz hz0 using hlift let y (i : I) := z i + LinearMap.single R (fun _ : Fin 4 => V i) 0 (p i) have hy (i : I) : y i ∈ K i := (K i).add_mem (hz i) (hp i) have hy0 : (fun i => y i 0) = x + p := by funext i simp only [y, Pi.add_apply, LinearMap.single_apply, Pi.single_eq_same, hz0] have hy1 : (fun i => y i 1) = fun i => z i 1 := by funext i simp [y, LinearMap.single_apply] have hy2 : (fun i => y i 2) = fun i => z i 2 := by funext i simp [y, LinearMap.single_apply] have hy3 : (fun i => y i 3) = fun i => z i 3 := by funext i simp [y, LinearMap.single_apply] have h₀ := hK z hz have h₁ := hK y hy rw [fourFunctionDifference, hy0, hy1, hy2, hy3] at h₁ rw [fourFunctionDifference, show (fun i => z i 0) = x from funext hz0] at h₀ simp only [sub_eq_add_neg] at h₀ h₁ exact add_right_cancel (add_right_cancel (add_right_cancel (h₁.trans h₀.symm)))
end Erdos3
end
section
namespace Erdos3
open Moduleopen scoped TensorProduct Matrix NNReal
theorem realifyCoordinateMap_eq_coordinates {V ι : Type*} [AddCommGroup V] [Module ℚ V] [Fintype ι] (φ : V →ₗ[ℚ] (ι → ℚ)) (x : ℝ ⊗[ℚ] V) : realifyCoordinateMap φ x = realRationalCoordinateEquiv (φ.baseChange ℝ x) := by induction x using TensorProduct.inductionOn with | tmul a v => funext i rw [realifyCoordinateMap_tmul, LinearMap.baseChange_tmul, realRationalCoordinateEquiv_tmul] | add x y hx hy => simp only [map_add, hx, hy]
theorem exists_controlled_subspace_image_section {μ ι κ V : Type*} [Fintype μ] [Fintype ι] [Fintype κ] [AddCommGroup V] [Module ℚ V] (b : Basis μ ℚ V) (U : Submodule ℚ V) (v : κ → V) (hv : Submodule.span ℚ (Set.range v) = U) (φ : V →ₗ[ℚ] (ι → ℚ)) {H l : ℕ} (hH : 1 ≤ H) (hl : 0 < l) (hvH : ∀ j i, RationalHeightLE (b.repr (v j) i) H) (hφH : ∀ j i, RationalHeightLE (φ (v j) i) H) {p : ℝ} (hp : 0 ≤ p) (hμ : (Fintype.card μ : ℝ) ≤ p) (hι : (Fintype.card ι : ℝ) ≤ p) (hκ : (Fintype.card κ : ℝ) ≤ p) (hHp : (H : ℝ) ≤ Real.exp p) (hlp : (l : ℝ) ≤ Real.exp p) : ∃ (σ : (ι → ℝ) →ₗ[ℝ] (ℝ ⊗[ℚ] V)) (m : ℕ), 0 < m ∧ (m : ℝ) ≤ Real.exp ((p + 2) ^ 3 + (p + 2) ^ 36) ∧ (∀ y, σ y ∈ U.baseChange ℝ) ∧ (∀ x ∈ U.baseChange ℝ, realifyCoordinateMap φ (σ (realifyCoordinateMap φ x)) = realifyCoordinateMap φ x) ∧ (∀ y, ‖(b.baseChange ℝ).equivFun (σ y)‖ ≤ Real.exp ((p + 2) ^ 3 + (p + 2) ^ 18) * ‖y‖) ∧ ∀ y ∈ realDenominatorGrid l, (b.baseChange ℝ).equivFun (σ y) ∈ realDenominatorGrid m := by classical let A : Matrix ι κ ℚ := fun i j => φ (v j) i let B : Matrix μ κ ℚ := fun i j => b.repr (v j) i obtain ⟨S, hS, hSH⟩ := exists_bounded_rational_image_section A hH (fun i j => hφH j i) let σ := (b.baseChange ℝ).equivFun.symm.toLinearMap.comp ((Matrix.mulVecLin (fun i j => (B i j : ℝ))).comp (Matrix.mulVecLin (fun i j => (S i j : ℝ)))) have hσ (y : ι → ℝ) : σ y = realGeneratorCombination v ((fun i j => (S i j : ℝ)) *ᵥ y) := by apply (b.baseChange ℝ).equivFun.injective change (b.baseChange ℝ).equivFun ((b.baseChange ℝ).equivFun.symm ((fun i j => (B i j : ℝ)) *ᵥ ((fun i j => (S i j : ℝ)) *ᵥ y))) = _ rw [LinearEquiv.apply_symm_apply, realGeneratorCombination_coordinates] have hcoord (y : ι → ℝ) : (b.baseChange ℝ).equivFun (σ y) = (fun i j => (B i j : ℝ)) *ᵥ ((fun i j => (S i j : ℝ)) *ᵥ y) := by rw [hσ, realGeneratorCombination_coordinates] have hvU (j : κ) : v j ∈ U := hv ▸ Submodule.subset_span (Set.mem_range_self j) have hvφ : Submodule.span ℚ (Set.range (fun j => φ (v j))) = U.map φ := by rw [← hv, Submodule.map_span, ← Set.range_comp] rfl have hHp' : (H : ℝ) ≤ Real.exp ((p + 2) ^ 1) := hHp.trans (Real.exp_le_exp.mpr (by simp)) have hBden : (matrixDenominator B : ℝ) ≤ Real.exp ((p + 2) ^ 3) := matrixDenominator_le_exp_power B hp 1 hμ hκ (fun i j => (Nat.cast_le.mpr (hvH j i).2).trans hHp') have hSden := real_image_section_denominator_bound S H l hSH hp hι hκ hHp hlp have hfac : ((Fintype.card κ : ℝ) + 1) * (H + 1) ≤ Real.exp ((p + 2) ^ 3) := by apply le_trans _ (matrix_weighted_factor_le_exp_power (Fintype.card κ) hp hκ 1 (by decide)) exact mul_le_mul_of_nonneg_left (add_le_add hHp' le_rfl) (by positivity) have hBnorm (y : κ → ℝ) : ‖(fun i j => (B i j : ℝ)) *ᵥ y‖ ≤ Real.exp ((p + 2) ^ 3) * ‖y‖ := (norm_matrix_mulVec_le _ (H : ℝ≥0) (fun i j => (hvH j i).abs_real_le) y).trans (mul_le_mul_of_nonneg_right hfac (norm_nonneg y)) refine ⟨σ, matrixDenominator B * (matrixDenominator S * l), Nat.mul_pos (matrixDenominator_pos B) (Nat.mul_pos (matrixDenominator_pos S) hl), ?_, ?_, ?_, ?_, ?_⟩ · rw [Nat.cast_mul] exact (mul_le_mul hBden hSden (Nat.cast_nonneg _) (Real.exp_pos _).le).trans_eq (Real.exp_add _ _).symm · intro y rw [hσ] exact realGeneratorCombination_mem U v hvU _ · intro x hx have himg : realifyCoordinateMap φ x ∈ LinearMap.range (Matrix.mulVecLin (fun i j => (A i j : ℝ))) := by rw [← realRationalCoordinateSpan_eq_image (U.map φ) (fun j => φ (v j)) hvφ, realifyCoordinateMap_eq_coordinates] refine ⟨φ.baseChange ℝ x, ?_, rfl⟩ rw [realification_map] exact ⟨x, hx, rfl⟩ rw [hσ, realifyCoordinateMap_eq_coordinates, realGeneratorCombination_map_coordinates] exact real_matrix_image_section_apply A S hS _ himg · intro y rw [hcoord] calc _ ≤ Real.exp ((p + 2) ^ 3) * ‖(fun i j => (S i j : ℝ)) *ᵥ y‖ := hBnorm _ _ ≤ Real.exp ((p + 2) ^ 3) * (Real.exp ((p + 2) ^ 18) * ‖y‖) := mul_le_mul_of_nonneg_left (real_image_section_norm_bound S H hSH hp hι hκ hHp y) (Real.exp_pos _).le _ = _ := by rw [← mul_assoc, ← Real.exp_add] · intro y hy rw [hcoord] exact real_matrix_denominator_grid B _ _ (real_matrix_denominator_grid S l y hy)
end Erdos3
end
section
namespace Erdos3
open Moduleopen scoped TensorProduct
theorem realify_basis_coordinates {V ι : Type*} [AddCommGroup V] [Module ℚ V] [Fintype ι] (b : Basis ι ℚ V) (x : ℝ ⊗[ℚ] V) : realifyCoordinateMap b.equivFun.toLinearMap x = (b.baseChange ℝ).equivFun x := by induction x using TensorProduct.inductionOn with | tmul a v => funext i rw [realifyCoordinateMap_tmul] change a * (b.repr v i : ℝ) = (b.baseChange ℝ).repr (a ⊗ₜ[ℚ] v) i rw [Basis.baseChange_repr_tmul] simp only [Rat.smul_def, mul_comm] | add x y hx hy => simp only [map_add, hx, hy]
theorem exists_controlled_subspace_projector {μ κ V : Type*} [Fintype μ] [Fintype κ] [AddCommGroup V] [Module ℚ V] (b : Basis μ ℚ V) (U : Submodule ℚ V) (v : κ → V) (hv : Submodule.span ℚ (Set.range v) = U) (l : ℕ) (hl : 0 < l) {p : ℝ} (hp : 0 ≤ p) (hμ : (Fintype.card μ : ℝ) ≤ p) (hκ : (Fintype.card κ : ℝ) ≤ p) (hvH : ∀ j i, rationalLogHeight (b.repr (v j) i) ≤ p) (hlp : (l : ℝ) ≤ Real.exp p) : let q := p + 1 ∃ (P : (ℝ ⊗[ℚ] V) →ₗ[ℝ] (ℝ ⊗[ℚ] V)) (m : ℕ), 0 < m ∧ (m : ℝ) ≤ Real.exp ((q + 2) ^ 3 + (q + 2) ^ 36) ∧ (∀ x, P x ∈ U.baseChange ℝ) ∧ (∀ x ∈ U.baseChange ℝ, P x = x) ∧ (∀ x, ‖(b.baseChange ℝ).equivFun (P x)‖ ≤ Real.exp ((q + 2) ^ 3 + (q + 2) ^ 18) * ‖(b.baseChange ℝ).equivFun x‖) ∧ ∀ x, (b.baseChange ℝ).equivFun x ∈ realDenominatorGrid l → (b.baseChange ℝ).equivFun (P x) ∈ realDenominatorGrid m := by intro q have hpq : p ≤ q := by dsimp [q]; linarith obtain ⟨σ, m, hm, hmp, hσU, hσfix, hσnorm, hσgrid⟩ := exists_controlled_subspace_image_section b U v hv b.equivFun.toLinearMap (one_le_ceil_exp p) hl (fun j i => rationalHeightLE_ceil_exp (hvH j i)) (fun j i => rationalHeightLE_ceil_exp (hvH j i)) (hp.trans hpq) (hμ.trans hpq) (hμ.trans hpq) (hκ.trans hpq) (ceil_exp_le_exp_add_one hp) (hlp.trans (Real.exp_le_exp.mpr hpq)) let P := σ.comp (b.baseChange ℝ).equivFun.toLinearMap refine ⟨P, m, hm, hmp, (fun x => hσU _), ?_, (fun x => hσnorm _), ?_⟩ · intro x hx apply (b.baseChange ℝ).equivFun.injective change (b.baseChange ℝ).equivFun (σ ((b.baseChange ℝ).equivFun x)) = _ simpa only [realify_basis_coordinates] using hσfix x hx · intro x hx exact hσgrid _ hx
end Erdos3
end
section
namespace Erdos3
open Moduleopen scoped TensorProduct
theorem exists_logHeight_subspace_image_section {μ ι κ V : Type*} [Fintype μ] [Fintype ι] [Fintype κ] [AddCommGroup V] [Module ℚ V] (b : Basis μ ℚ V) (U : Submodule ℚ V) (v : κ → V) (hv : Submodule.span ℚ (Set.range v) = U) (φ : V →ₗ[ℚ] (ι → ℚ)) (l : ℕ) (hl : 0 < l) {p : ℝ} (hp : 0 ≤ p) (hμ : (Fintype.card μ : ℝ) ≤ p) (hι : (Fintype.card ι : ℝ) ≤ p) (hκ : (Fintype.card κ : ℝ) ≤ p) (hvH : ∀ j i, rationalLogHeight (b.repr (v j) i) ≤ p) (hφH : ∀ i j, rationalLogHeight (φ (b i) j) ≤ p) (hlp : (l : ℝ) ≤ Real.exp p) : let t := (p + 2) ^ 4 + 1 ∃ (σ : (ι → ℝ) →ₗ[ℝ] (ℝ ⊗[ℚ] V)) (m : ℕ), 0 < m ∧ (m : ℝ) ≤ Real.exp ((t + 2) ^ 3 + (t + 2) ^ 36) ∧ (∀ y, σ y ∈ U.baseChange ℝ) ∧ (∀ x ∈ U.baseChange ℝ, realifyCoordinateMap φ (σ (realifyCoordinateMap φ x)) = realifyCoordinateMap φ x) ∧ (∀ y, ‖(b.baseChange ℝ).equivFun (σ y)‖ ≤ Real.exp ((t + 2) ^ 3 + (t + 2) ^ 18) * ‖y‖) ∧ ∀ y ∈ realDenominatorGrid l, (b.baseChange ℝ).equivFun (σ y) ∈ realDenominatorGrid m := by intro t have hp4 : p ≤ (p + 2) ^ 4 := le_power_budget hp (by decide) have hpt : p ≤ t := hp4.trans (le_add_of_nonneg_right (by norm_num)) have ht : 0 ≤ t := hp.trans hpt apply exists_controlled_subspace_image_section b U v hv φ (one_le_ceil_exp ((p + 2) ^ 4)) hl _ _ ht (hμ.trans hpt) (hι.trans hpt) (hκ.trans hpt) (ceil_exp_le_exp_add_one (by positivity)) (hlp.trans (Real.exp_le_exp.mpr hpt)) · intro j i exact rationalHeightLE_ceil_exp ((hvH j i).trans hp4) · intro j i apply rationalHeightLE_ceil_exp exact linearMap_coordinate_logHeight b (Pi.basisFun ℚ ι) φ hp hμ hφH (v j) (hvH j) i
end Erdos3
end
section
namespace Erdos3.SubspaceFreeLift
open Module NilpotentLieBCHGroup RationalFilteredNilmanifoldopen scoped TensorProduct
theorem exists_native_pair_model (s : ℕ) : ∃ C : ℕ, 2 ≤ C ∧ ∀ (L I : Type*) [LieRing L] [LieAlgebra ℚ L] [Fintype I] [TopologicalSpace (ℝ ⊗[ℚ] L)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [T2Space (ℝ ⊗[ℚ] L)] [TopologicalSpace (ℝ ⊗[ℚ] (Fin 2 → L))] [IsTopologicalAddGroup (ℝ ⊗[ℚ] (Fin 2 → L))] [ContinuousSMul ℝ (ℝ ⊗[ℚ] (Fin 2 → L))] [T2Space (ℝ ⊗[ℚ] (Fin 2 → L))] (r d : ℕ) (D : RationalFilteredNilmanifold L s d) (T : D.DegreeRankStructure r) (S : Fin s → Submodule ℚ (Fin 2 → L)) (B : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j)) (hS : ∀ j, S j ≤ (piRank (fun _ : Fin 2 => D) (fun _ => T)).filtration.layer (j.val + 1) 0) (p : ℝ), 2 ≤ p → T.ComplexityLE p → (∀ j a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => D.basis)).repr (B j a : Fin 2 → L) i) ≤ p) → ∀ U : D.UnitVerticalObservable (T.realSubgroup s r) I p, let φ := evaluation S B (piRank (fun _ : Fin 2 => D) (fun _ => T)).filtration hS ∃ E : RationalFilteredNilmanifold (Algebra S r) s (finrank ℚ (Algebra S r)), ∃ Q : E.DegreeRankStructure r, Q.filtration = filtration S T.filtration.rank_le_degree ∧ Q.ComplexityLE ((p + C) ^ C) ∧ IsCentralLieBasis E.basis ∧ Nonempty (FreeCoordinateFrame E.basis ((p + C) ^ C)) ∧ (∀ i j, rationalLogHeight ((pi (fun _ : Fin 2 => D)).basis.repr (φ (E.basis j)) i) ≤ (p + C) ^ C) ∧ E.lattice ≤ (pi (fun _ : Fin 2 => D)).lattice.comap (mapOfSteps (hL := E.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => D)).filtration.lowerCentralSeries_eq_bot) φ) ∧ (letI := moduleTopology ℝ (ℝ ⊗[ℚ] Algebra S r) letI : IsTopologicalAddGroup (ℝ ⊗[ℚ] Algebra S r) := IsModuleTopology.isTopologicalAddGroup ℝ _ letI := realification_moduleTopology_t2 E.basis ∃ V : E.UnitVerticalObservable (Q.realSubgroup s r) (I × I) ((p + C) ^ C), V.frequency = (pairDifferenceFunctional U.frequency).comp φ.toLinearMap ∧ ∀ i x, V.observable i (QuotientGroup.mk x) = U.pairedObservable T i (QuotientGroup.mk (realificationMap (hnil := E.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => D)).filtration.lowerCentralSeries_eq_bot) φ x))) := by obtain ⟨a, _, hfree⟩ := exists_native_model s let K₀ : Polynomial ℕ := (Polynomial.X + 2) ^ 2 + (Polynomial.X + (Polynomial.X ^ 2 + Polynomial.X + 3) ^ 2 + 2) obtain ⟨C, hC, hbudget⟩ := exists_natPolynomial_eval_budget ((K₀ + Polynomial.C a) ^ a) refine ⟨C, hC, ?_⟩ intro L I _ _ _ _ _ _ _ _ _ _ _ r d D T S B hS p hp hT hB U φ have hp₀ : 0 ≤ p := by linarith let P := p + (p ^ 2 + p + 3) ^ 2 + 2 let K := (p + 2) ^ 2 + P have hP : 0 ≤ P := by dsimp only [P]; positivity have hpP : p ≤ P := by dsimp only [P]; nlinarith [sq_nonneg (p ^ 2 + p + 3)] have hPK : P ≤ K := le_add_of_nonneg_left (sq_nonneg (p + 2)) have hGK : (p + 2) ^ 2 ≤ K := le_add_of_nonneg_right hP have hK : 0 ≤ K := hP.trans hPK have hbound : (K + a) ^ a ≤ (p + C) ^ C := by simpa [K₀, K, P, Polynomial.eval₂_pow] using hbudget p hp₀ let D₂ := pi (fun _ : Fin 2 => D) let T₂ := piRank (fun _ : Fin 2 => D) (fun _ => T) have hT₂ : T₂.ComplexityLE K := (piRank_complexity (fun _ : Fin 2 => D) (fun _ => T) hp₀ (by simpa using hp) (fun _ => hT)).mono T₂ hGK have hB₂ (j : Fin s) (k : Fin (finrank ℚ (S j))) (i) : rationalLogHeight (D₂.basis.repr (B j k : Fin 2 → L) i) ≤ K := by change rationalLogHeight ((productFinBasis (fun _ : Fin 2 => D)).repr _ i) ≤ K rw [productFinBasis, Basis.repr_reindex_apply] exact (hB j k _).trans (hpP.trans hPK) obtain ⟨E, Q, hQ, hQc, hcentral, ⟨frame⟩, hmatrix, hlattice, hV⟩ := hfree (Fin 2 → L) (I × I) r _ D₂ T₂ S B hS K hK hT₂ hB₂ ((U.paired T hp hT.1).mono hPK) let := moduleTopology ℝ (ℝ ⊗[ℚ] Algebra S r) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] Algebra S r) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 E.basis obtain ⟨V, hfreq, hobs⟩ := hV exact ⟨E, Q, hQ, hQc.mono Q hbound, hcentral, ⟨frame.mono hbound⟩, (fun i j => (hmatrix i j).trans hbound), hlattice, V.mono hbound, hfreq, hobs⟩
end Erdos3.SubspaceFreeLift
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Moduleopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P : ℝ} {W : NativeDegreeRankFamily s r (ZMod N) b} {out : Fin W.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W out H p q} (D : R.CommonData P) (e : Basis (Fin (finrank ℚ D.CoefficientFreeLieAlgebra)) ℚ D.CoefficientFreeLieAlgebra) {Q : ℝ} (F : FreeCoordinateFrame e Q)
include F
theorem exists_coefficientFreeSpan_projector (hs : 1 ≤ s) (d : Fin s) (l : ℕ) (hl : 0 < l) {A : ℝ} (hA : 0 ≤ A) (hQA : Q ≤ A) (hdim : (finrank ℚ D.CoefficientFreeLieAlgebra : ℝ) ≤ A) (hlA : (l : ℝ) ≤ Real.exp A) : let t := A + 1 ∃ (P : (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra) →ₗ[ℝ] (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)) (m : ℕ), 0 < m ∧ (m : ℝ) ≤ Real.exp ((t + 2) ^ 3 + (t + 2) ^ 36) ∧ (∀ x, P x ∈ (D.coefficientFreeSpan d).baseChange ℝ) ∧ (∀ x ∈ (D.coefficientFreeSpan d).baseChange ℝ, P x = x) ∧ (∀ x, ‖(e.baseChange ℝ).equivFun (P x)‖ ≤ Real.exp ((t + 2) ^ 3 + (t + 2) ^ 18) * ‖(e.baseChange ℝ).equivFun x‖) ∧ ∀ x, (e.baseChange ℝ).equivFun x ∈ realDenominatorGrid l → (e.baseChange ℝ).equivFun (P x) ∈ realDenominatorGrid m := by obtain ⟨c, hc⟩ := D.exists_coefficientFreeSpan_basis e F hs d have hcspan : Submodule.span ℚ (Set.range (fun j => (c j : D.CoefficientFreeLieAlgebra))) = D.coefficientFreeSpan d := by change Submodule.span ℚ (Set.range ((D.coefficientFreeSpan d).subtype ∘ c)) = _ rw [Set.range_comp, ← Submodule.map_span, c.span_eq, Submodule.map_top, Submodule.range_subtype] apply exists_controlled_subspace_projector e (D.coefficientFreeSpan d) (fun j => (c j : D.CoefficientFreeLieAlgebra)) hcspan l hl hA · simpa only [Fintype.card_fin] using hdim · have hd : (finrank ℚ (D.coefficientFreeSpan d) : ℝ) ≤ finrank ℚ D.CoefficientFreeLieAlgebra := by exact_mod_cast Submodule.finrank_le (D.coefficientFreeSpan d) simpa only [Fintype.card_fin] using hd.trans hdim · exact fun j i => (hc j i).trans hQA · exact hlA
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3
noncomputable def sharedFreeCommonCorrectionBudget (s : ℕ) (q p : ℝ) : ℝ := let Λ := (p + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s let t := (q + p + Λ) + 1 (t + 2) ^ 3 + (t + 2) ^ 36 + Λ
theorem refined_firstProjection_le_common {R V : Type*} [CommRing R] [AddCommGroup V] [Module R V] (C D : Submodule R V) (hDC : D ≤ C) (K : Submodule R (Fin 4 → V)) : (fourRefinedRelation C D K).map (LinearMap.proj 0) ≤ C := by rintro v ⟨w, hw, rfl⟩ exact ((mem_fourCommonModulo C D w).mp (fourRefinedRelation_le_common C D hDC K hw)).1 0
end Erdos3
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial CyclicCrootSisaskopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_shared_free_filtered_common (hs : 2 ≤ s) (hp' : 0 ≤ p') (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hpp' : p' ≤ P') (ξ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hsplit : ∀ h, g h = ξ * v h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.commonFreeSpan d).baseChange ℝ) (hv : ∀ h (d : Fin s), coefficients (v h).log (Finsupp.single () (d.val + 1)) ∈ (D.dependentFreeSpan d).baseChange ℝ) (hN : Real.exp ((P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s) ≤ (N : ℝ)) : let L := sharedFreeCommonCorrectionBudget s Q P' ∃ (m : Fin s → ℕ) (γ e q : Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra), ∀ d, 0 < m d ∧ (m d : ℝ) ≤ Real.exp L ∧ γ d ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ ∧ γ d ∈ (D.coefficientFreeSpan d).baseChange ℝ ∧ e d ∈ (D.coefficientFreeSpan d).baseChange ℝ ∧ q d ∈ (D.coefficientFreeSpan d).baseChange ℝ ∧ coefficients ξ.log (Finsupp.single () (d.val + 1)) = γ d + e d + q d ∧ ‖(E.basis.baseChange ℝ).equivFun (e d)‖ ≤ Real.exp L / (N : ℝ) ^ (d.val + 1) ∧ (E.basis.baseChange ℝ).equivFun (q d) ∈ realDenominatorGrid (m d) := by intro L classical obtain ⟨l, γ, e, q, hdata⟩ := D.exists_shared_free_common_projection E T hbQ hT F V g hg D' hs hp' hP' hQP' hpp' ξ v hsplit hξ hv hN let Λ := (P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s let A := Q + P' + Λ let t := A + 1 let C := (t + 2) ^ 3 + (t + 2) ^ 18 have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 have hΛ : 0 ≤ Λ := pow_nonneg (add_nonneg hP' (Nat.cast_nonneg _)) _ have hA : 0 ≤ A := add_nonneg (add_nonneg hQ hP') hΛ have hQA : Q ≤ A := (le_add_of_nonneg_right hP').trans (le_add_of_nonneg_right hΛ) have hPA : P' ≤ A := (le_add_of_nonneg_left hQ).trans (le_add_of_nonneg_right hΛ) have hΛA : Λ ≤ A := le_add_of_nonneg_left (add_nonneg hQ hP') have hprojectors (d : Fin s) : ∃ (P : (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra) →ₗ[ℝ] (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)) (m : ℕ), 0 < m ∧ (m : ℝ) ≤ Real.exp ((t + 2) ^ 3 + (t + 2) ^ 36) ∧ (∀ x, P x ∈ (D.coefficientFreeSpan d).baseChange ℝ) ∧ (∀ x ∈ (D.coefficientFreeSpan d).baseChange ℝ, P x = x) ∧ (∀ x, ‖(E.basis.baseChange ℝ).equivFun (P x)‖ ≤ Real.exp C * ‖(E.basis.baseChange ℝ).equivFun x‖) ∧ ∀ x, (E.basis.baseChange ℝ).equivFun x ∈ realDenominatorGrid (l d) → (E.basis.baseChange ℝ).equivFun (P x) ∈ realDenominatorGrid m := by exact D.exists_coefficientFreeSpan_projector E.basis F (by omega) d (l d) (hdata d).1 hA hQA ((hT.1.1.trans hQP').trans hPA) ((hdata d).2.1.trans (Real.exp_le_exp.mpr hΛA)) choose P m hm hmb hPU hPfix hPnorm hPgrid using hprojectors have ht : 0 ≤ t := add_nonneg hA zero_le_one have h18 : (t + 2) ^ 18 ≤ (t + 2) ^ 36 := pow_le_pow_right₀ (by linarith only [ht]) (by decide) have hL : L = (t + 2) ^ 3 + (t + 2) ^ 36 + Λ := rfl have hCL : C + Λ ≤ L := add_le_add (add_le_add (le_refl ((t + 2) ^ 3)) h18) (le_refl Λ) refine ⟨m, γ, (fun d => P d (e d)), (fun d => P d (q d)), ?_⟩ intro d obtain ⟨_hl, _hlb, hγ, heq, herr, hgrid⟩ := hdata d have hγC : γ d ∈ (D.coefficientFreeSpan d).baseChange ℝ := Submodule.baseChange_mono ℝ (refined_firstProjection_le_common _ _ (D.dependentFreeSpan_le_coefficientFreeSpan d) _) hγ have hξC : coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.coefficientFreeSpan d).baseChange ℝ := Submodule.baseChange_mono ℝ (D.commonFreeSpan_le_coefficientFreeSpan d) (hξ d) have hsum : e d + q d ∈ (D.coefficientFreeSpan d).baseChange ℝ := by have hh : e d + q d = coefficients ξ.log (Finsupp.single () (d.val + 1)) - γ d := by rw [heq] abel rw [hh] exact ((D.coefficientFreeSpan d).baseChange ℝ).sub_mem hξC hγC have hsumfix := hPfix d (e d + q d) hsum rw [map_add] at hsumfix refine ⟨hm d, (hmb d).trans (Real.exp_le_exp.mpr (le_add_of_nonneg_right hΛ)), hγ, hγC, hPU d _, hPU d _, ?_, ?_, hPgrid d _ hgrid⟩ · calc _ = γ d + (e d + q d) := by rw [heq, add_assoc] _ = γ d + (P d (e d) + P d (q d)) := by rw [hsumfix] _ = _ := (add_assoc _ _ _).symm · calc _ ≤ Real.exp C * ‖(E.basis.baseChange ℝ).equivFun (e d)‖ := hPnorm d _ _ ≤ Real.exp C * (Real.exp Λ / (N : ℝ) ^ (d.val + 1)) := mul_le_mul_of_nonneg_left herr (Real.exp_pos _).le _ = Real.exp (C + Λ) / (N : ℝ) ^ (d.val + 1) := by rw [← mul_div_assoc, ← Real.exp_add] _ ≤ _ := div_le_div_of_nonneg_right (Real.exp_le_exp.mpr hCL) (pow_nonneg (Nat.cast_nonneg N) _)
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Moduleopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
theorem CoefficientBases.comparison_space_top_frequency (hfreq : V.frequency = B.freeFrequency D) (n : ℕ) (d : Fin n → Fin s) (a : FreeMagma (Fin n)) (hd : lieTreeWeight (fun i => (d i).val + 1) a = s) (hr : a.length = r) (z : Fin n → Fin 2 → D.CoefficientFreeLieAlgebra) (hz : ∀ i, z i ∈ petalComparisonSpace ((fourRefinedRelation (D.coefficientFreeSpan (d i)) (D.dependentFreeSpan (d i)) (D'.coefficientFourSpace ⟨(d i).val + 1, by omega⟩)).map (LinearMap.proj 0)) (fourPetalSpace (D.dependentFreeSpan (d i)) (fourRefinedRelation (D.coefficientFreeSpan (d i)) (D.dependentFreeSpan (d i)) (D'.coefficientFourSpace ⟨(d i).val + 1, by omega⟩))) (D.coefficientFreeFiltration.layer ((d i).val + 1) 2)) : pairDifferenceFunctional (B.freeFrequency D) (lieTreeEval z a) = 0 := by have hC (j : Fin s) : (fourRefinedRelation (D.coefficientFreeSpan j) (D.dependentFreeSpan j) (D'.coefficientFourSpace ⟨j.val + 1, by omega⟩)).map (LinearMap.proj 0) ≤ D.coefficientFreeFiltration.layer (j.val + 1) 1 := (refined_firstProjection_le_common _ _ (D.dependentFreeSpan_le_coefficientFreeSpan j) _).trans (D.coefficientFreeSpan_le_layer j) apply petalComparisonSpace_top_tree D.coefficientFreeFiltration (fun i => (d i).val + 1) _ _ (fun i => hC (d i)) (fun i => (fourPetalSpace_le_first _ _).trans (hC (d i))) (B.freeFrequency D) a hd hr _ z hz intro c p hc hp apply four_projection_petal_add_invariant (fun x => B.freeFrequency D (lieTreeEval x a)) (fun i => fourRefinedRelation (D.coefficientFreeSpan (d i)) (D.dependentFreeSpan (d i)) (D'.coefficientFourSpace ⟨(d i).val + 1, by omega⟩)) (B.correlation_refined_four_identity D E T hbQ hT V g hg D' hfreq n d a hd hr) c p hc exact fun i => ((mem_fourPetalSpace _ _ _).mp (hp i)).2
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Moduleopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
noncomputable def comparisonCoefficientSpace (d : Fin s) : Submodule ℚ (Fin 2 → D.CoefficientFreeLieAlgebra) := petalComparisonSpace ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)) (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))) (D.coefficientFreeFiltration.layer (d.val + 1) 2)
theorem comparisonCoefficientSpace_le_layer (hTfil : T.filtration = D.coefficientFreeFiltration) (d : Fin s) : D.comparisonCoefficientSpace E T hbQ hT V g hg D' d ≤ (RationalFilteredNilmanifold.piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration.layer (d.val + 1) 0 := by have hC : (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0) ≤ D.coefficientFreeFiltration.layer (d.val + 1) 1 := (refined_firstProjection_le_common _ _ (D.dependentFreeSpan_le_coefficientFreeSpan d) _).trans (D.coefficientFreeSpan_le_layer d) change petalComparisonSpace _ _ _ ≤ Submodule.pi Set.univ (fun _ : Fin 2 => T.filtration.layer (d.val + 1) 0) rw [hTfil, D.coefficientFreeFiltration.rank_zero_eq_one] exact petalComparisonSpace_le_pi _ _ _ _ hC ((fourPetalSpace_le_first _ _).trans hC) (D.coefficientFreeFiltration.lex_antitone (Or.inr ⟨rfl, by omega⟩))
include F intheorem exists_comparisonCoefficientBases (hTfil : T.filtration = D.coefficientFreeFiltration) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') : ∃ B : ∀ d : Fin s, Basis (Fin (finrank ℚ (D.comparisonCoefficientSpace E T hbQ hT V g hg D' d))) ℚ (D.comparisonCoefficientSpace E T hbQ hT V g hg D' d), ∀ d a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => E.basis)).repr (B d a : Fin 2 → D.CoefficientFreeLieAlgebra) i) ≤ sharedFreeComparisonBasisBudget Q P' := by classical choose B hB using fun d => D.exists_sharedFreeComparisonSpace_basis E T hbQ hT F V g hg D' hTfil hs hP' hQP' d exact ⟨B, hB⟩
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3
noncomputable def nativePairModelConstant (s : ℕ) : ℕ := (SubspaceFreeLift.exists_native_pair_model.{0, 0} s).choose
noncomputable def sharedFreeComparisonModelBudget (s : ℕ) (q p : ℝ) : ℝ := (q + 2 + sharedFreeComparisonBasisBudget q p + nativePairModelConstant s) ^ nativePairModelConstant s
theorem sharedFreeComparisonBasisBudget_nonneg {q p : ℝ} (hq : 0 ≤ q) (hp : 0 ≤ p) : 0 ≤ sharedFreeComparisonBasisBudget q p := by have hA := add_nonneg hq (fourRefinementBasisBudget_nonneg (add_nonneg hq (coefficientFourHeightBudget_nonneg hp))) exact add_nonneg hA (preimageBasisBudget_nonneg (mul_nonneg (by norm_num) hA))
theorem exists_sharedFreeComparisonModelBudget_bound (s : ℕ) : ∃ C : ℕ, 2 ≤ C ∧ ∀ q p : ℝ, 0 ≤ q → q ≤ p → 0 ≤ p → sharedFreeComparisonModelBudget s q p ≤ (p + C) ^ C := by obtain ⟨b, _, hb⟩ := exists_sharedFreeComparisonBasisBudget_bound let a := nativePairModelConstant s let K : Polynomial ℕ := Polynomial.X + 2 + (Polynomial.X + Polynomial.C b) ^ b obtain ⟨C, hC, hbudget⟩ := exists_natPolynomial_eval_budget ((K + Polynomial.C a) ^ a) refine ⟨C, hC, ?_⟩ intro q p hq hqp hp have hsmall : q + 2 + sharedFreeComparisonBasisBudget q p + a ≤ p + 2 + (p + b) ^ b + a := by linarith [hb q p hq hqp hp] have hzero : 0 ≤ q + 2 + sharedFreeComparisonBasisBudget q p + a := by have := sharedFreeComparisonBasisBudget_nonneg hq hp positivity apply (pow_le_pow_left₀ hzero hsmall a).trans simpa [K, Polynomial.eval₂_pow] using hbudget p hp
end Erdos3
namespace Erdos3.NativeRankRelation.CommonData
open Module NilpotentLieBCHGroup RationalFilteredNilmanifoldopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_native_comparison_model (hTfil : T.filtration = D.coefficientFreeFiltration) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let hS := D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil ∃ B : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j), (∀ j a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => E.basis)).repr (B j a : Fin 2 → D.CoefficientFreeLieAlgebra) i) ≤ sharedFreeComparisonBasisBudget Q P') ∧ let φ := SubspaceFreeLift.evaluation S B (piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration hS ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S r) s (finrank ℚ (SubspaceFreeLift.Algebra S r)), ∃ U : M.DegreeRankStructure r, U.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ U.ComplexityLE (sharedFreeComparisonModelBudget s Q P') ∧ IsCentralLieBasis M.basis ∧ Nonempty (FreeCoordinateFrame M.basis (sharedFreeComparisonModelBudget s Q P')) ∧ (∀ i j, rationalLogHeight ((pi (fun _ : Fin 2 => E)).basis.repr (φ (M.basis j)) i) ≤ sharedFreeComparisonModelBudget s Q P') ∧ M.lattice ≤ (pi (fun _ : Fin 2 => E)).lattice.comap (mapOfSteps (hL := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => E)).filtration.lowerCentralSeries_eq_bot) φ) ∧ (letI := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S r) letI : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S r) := IsModuleTopology.isTopologicalAddGroup ℝ _ letI := realification_moduleTopology_t2 M.basis ∃ Z : M.UnitVerticalObservable (U.realSubgroup s r) (Fin W.family.outputDim × Fin W.family.outputDim) (sharedFreeComparisonModelBudget s Q P'), Z.frequency = (pairDifferenceFunctional V.frequency).comp φ.toLinearMap ∧ ∀ i x, Z.observable i (QuotientGroup.mk x) = V.pairedObservable T i (QuotientGroup.mk (realificationMap (hnil := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => E)).filtration.lowerCentralSeries_eq_bot) φ x))) := by intro S hS have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 have hH := sharedFreeComparisonBasisBudget_nonneg hQ hP' let K := Q + 2 + sharedFreeComparisonBasisBudget Q P' have h2 : 2 ≤ K := by dsimp only [K]; linarith have hQK : Q ≤ K := by dsimp only [K]; linarith have hHK : sharedFreeComparisonBasisBudget Q P' ≤ K := by dsimp only [K]; linarith obtain ⟨B, hB⟩ := D.exists_comparisonCoefficientBases E T hbQ hT F V g hg D' hTfil hs hP' hQP' refine ⟨B, hB, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] (Fin 2 → D.CoefficientFreeLieAlgebra)) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] (Fin 2 → D.CoefficientFreeLieAlgebra)) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 (Pi.basis (fun _ : Fin 2 => E.basis)) exact (SubspaceFreeLift.exists_native_pair_model s).choose_spec.2 D.CoefficientFreeLieAlgebra (Fin W.family.outputDim) r _ E T S B hS K h2 (hT.mono T hQK) (fun j a i => (hB j a i).trans hHK) (V.mono hQK)
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomialopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
theorem exists_native_factored_comparison_orbit (hTfil : T.filtration = D.coefficientFreeFiltration) (hs : 1 ≤ s) (A K U : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hA0 : E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 A = 1) (hK0 : E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 K = 1) (hU0 : E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 U = 1) (hA : ∀ d : Fin s, coefficients A.log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) (hK : ∀ d : Fin s, coefficients K.log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ) (hU : ∀ d : Fin s, coefficients U.log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let hS := D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil let a : Fin 2 → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1) := ![A * K * U, A] ∀ (B : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j)) (M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S r) s (finrank ℚ (SubspaceFreeLift.Algebra S r))) (Q' : M.DegreeRankStructure r), Q'.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree → let φ := SubspaceFreeLift.evaluation S B (RationalFilteredNilmanifold.piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration hS ∃ u : M.filtration.realification.PolynomialOrbit (fun _ : Unit => 1), M.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 u = 1 ∧ (∀ j : Fin s, coefficients u.log (Finsupp.single () (j.val + 1)) ∈ (SubspaceFreeLift.generatorSpan S r j).baseChange ℝ) ∧ ∀ i x, RationalFilteredNilmanifold.productProjectionHom (fun _ : Fin 2 => E) i (NilpotentLieBCHGroup.realificationMap (hnil := M.filtration.lowerCentralSeries_eq_bot) (hM := (RationalFilteredNilmanifold.pi (fun _ : Fin 2 => E)).filtration.lowerCentralSeries_eq_bot) φ (M.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x u)) = E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (a i) := by intro S hS a B M Q' hQ' φ apply SubspaceFreeLift.exists_native_pair_orbit E T S B hS M Q' hQ' a · intro i fin_cases i · change E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (A * K * U) = 1 rw [map_mul, map_mul, hA0, hK0, hU0, mul_one, mul_one] · exact hA0 · intro j have h := D.paired_affine_orbit_coefficient_mem_comparison E T hbQ hT V g hg D' hTfil hs A K U hA hK hU j have heq : (fun i => coefficients (a i).log (Finsupp.single () (j.val + 1))) = ![coefficients (A * K * U).log (Finsupp.single () (j.val + 1)), coefficients A.log (Finsupp.single () (j.val + 1))] := by funext i fin_cases i <;> rfl rw [heq] exact h
end Erdos3.NativeRankRelation.CommonData
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109import OAI.Combinatorics.Progressions.Fourier.SharedFreeFactorizationFrequency
namespace OAI
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomialopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
theorem paired_affine_orbit_coefficient_mem_comparison (hTfil : T.filtration = D.coefficientFreeFiltration) (hs : 1 ≤ s) (A K U : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hA : ∀ d : Fin s, coefficients A.log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) (hK : ∀ d : Fin s, coefficients K.log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ) (hU : ∀ d : Fin s, coefficients U.log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) (d : Fin s) : (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 2 => D.CoefficientFreeLieAlgebra)).symm ![coefficients (A * K * U).log (Finsupp.single () (d.val + 1)), coefficients A.log (Finsupp.single () (d.val + 1))] ∈ (petalComparisonSpace ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)) (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))) (D.coefficientFreeFiltration.layer (d.val + 1) 2)).baseChange ℝ := by have h₁ := T.polynomialOrbit_mul_coefficient_sub_mem_rank_two hs (fun _ : Unit => 1) (Finsupp.single () (d.val + 1)) A K have h₂ := T.polynomialOrbit_mul_coefficient_sub_mem_rank_two hs (fun _ : Unit => 1) (Finsupp.single () (d.val + 1)) (A * K) U simp only [Finsupp.weight_single, smul_eq_mul, mul_one] at h₁ h₂ have herr : coefficients (A * K * U).log (Finsupp.single () (d.val + 1)) - (coefficients A.log (Finsupp.single () (d.val + 1)) + coefficients U.log (Finsupp.single () (d.val + 1))) ∈ (D.coefficientFreeFiltration.layer (d.val + 1) 2).baseChange ℝ := by rw [← hTfil] convert ((T.filtration.layer (d.val + 1) 2).baseChange ℝ).add_mem (((T.filtration.layer (d.val + 1) 2).baseChange ℝ).add_mem h₂ h₁) (hK d) using 1 abel have hp : ![coefficients (A * K * U).log (Finsupp.single () (d.val + 1)), coefficients A.log (Finsupp.single () (d.val + 1))] ∈ petalComparisonSpace (((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) ((fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) ((D.coefficientFreeFiltration.layer (d.val + 1) 2).baseChange ℝ) := by apply (mem_petalComparisonSpace _ _ _ _).mpr constructor · exact Submodule.mem_sup_left (hA d) · apply Submodule.mem_sup.mpr refine ⟨_, hU d, _, herr, ?_⟩ change coefficients U.log (Finsupp.single () (d.val + 1)) + (coefficients (A * K * U).log (Finsupp.single () (d.val + 1)) - (coefficients A.log (Finsupp.single () (d.val + 1)) + coefficients U.log (Finsupp.single () (d.val + 1)))) = coefficients (A * K * U).log (Finsupp.single () (d.val + 1)) - coefficients A.log (Finsupp.single () (d.val + 1)) abel rw [← realification_petalComparisonSpace] at hp obtain ⟨y, hy, heq⟩ := hp have hy' : (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 2 => D.CoefficientFreeLieAlgebra)).symm ![coefficients (A * K * U).log (Finsupp.single () (d.val + 1)), coefficients A.log (Finsupp.single () (d.val + 1))] = y := by rw [← heq] exact LinearEquiv.symm_apply_apply _ _ rw [hy'] exact hy
end Erdos3.NativeRankRelation.CommonData
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220import OAI.Combinatorics.Progressions.Dynamics.SharedFreeCorrelationBudget
namespace OAI
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial RationalFilteredNilmanifoldopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_correlated_lower_factorization (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hp' : 0 ≤ p') (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hpp' : p' ≤ P') (hf : ∀ x, ‖f x‖ ≤ 1) (Hsource : Finset (ZMod N)) (hsource : Hsource.Nonempty) (hsourceDense : Real.exp (-Q) * Fintype.card (ZMod N) ≤ (Hsource.card : ℝ)) (hHsource : H' ⊆ Hsource) (hcorr : ∀ h ∈ Hsource, Nonempty (NativeVectorCorrelation (s - 1) N Q (W.replacedRankResidual h (fun i x => V.observable i (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) (fun _ => (x.val : ℤ)) (g h))))))) (ξ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hsplit : ∀ h, g h = ξ * v h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.commonFreeSpan d).baseChange ℝ) (hv : ∀ h (d : Fin s), coefficients (v h).log (Finsupp.single () (d.val + 1)) ∈ (D.dependentFreeSpan d).baseChange ℝ) (hN : Real.exp (sharedFreeCorrelationBudget s hs P') ≤ (N : ℝ)) : let Λ := (P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s let C := sharedFreeCorrelationBudget s hs P' let Qc := C + sharedFreeComparisonBasisBudget Q P' + 2 let Lv := sharedFreePetalLiftBudget s Q P' let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' ∃ J ⊆ H', J.Nonempty ∧ Real.exp (-(Λ + C)) * H'.card ≤ (J.card : ℝ) ∧ ∃ (r₀ : ℕ) (R₀ : Fin r₀ → ℕ) (η : (Fin r₀ → ℤ) →+ ZMod N) (h₀ : ZMod N) (Γ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (α : Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra) (β : Fin r₀ → Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra), (r₀ : ℝ) ≤ Λ ∧ Set.InjOn η {x | ∀ j, |x j| ≤ (R₀ j : ℤ)} ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 Γ = 1 ∧ (∀ d : Fin s, coefficients Γ.log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) ∧ (∀ d, α d ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ‖(E.basis.baseChange ℝ).equivFun (α d)‖ ≤ Real.exp Lv) ∧ (∀ j d, β j d ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ‖(E.basis.baseChange ℝ).equivFun (β j d)‖ ≤ Real.exp Lv) ∧ ∃ (x : {h // h ∈ J} → Fin r₀ → ℤ) (A K U : {h // h ∈ J} → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)), (∀ h : {h // h ∈ J}, (∀ j, |x h j| ≤ (R₀ j : ℤ)) ∧ h.val = h₀ + η (x h) ∧ (A h).log = Γ.log + positiveUnivariate (fun d => α d + ∑ j, (x h j : ℝ) • β j d) ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (A h) = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (K h) = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (U h) = 1 ∧ ∀ d : Fin s, coefficients (K h).log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ ∧ coefficients (U h).log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) ∧ ∃ Δ : Subgroup E.filtration.Group, Δ ≤ E.lattice ∧ (Δ.subgroupOf E.lattice).Characteristic ∧ (Δ.subgroupOf E.lattice).Normal ∧ (Δ.subgroupOf E.lattice).FiniteIndex ∧ (Δ.relIndex E.lattice : ℝ) ≤ Real.exp C ∧ ∃ (l : ℕ) (hl : 0 < l) (hin : scaledIntegerGrid l ⊆ bchSubgroupCoordinates E.basis Δ) (hout : bchSubgroupCoordinates E.basis Δ ⊆ denominatorGrid l), (T.withLattice Δ l hl hin hout).ComplexityLE C ∧ ∃ V₁ : (E.withLattice Δ l hl hin hout).UnitVerticalObservable ((T.withLattice Δ l hl hin hout).realSubgroup s (r + 1)) (Fin W.family.outputDim) C, V₁.frequency = V.frequency ∧ (∀ h : {h // h ∈ J}, Nonempty (NativeVectorCorrelation (s - 1) N C (W.replacedRankResidual h.val (fun i z => V₁.observable i (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) (fun _ => (z.val : ℤ)) (A h * K h * U h))))))) ∧ ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ Tm : M.DegreeRankStructure (r + 1), Tm.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ Tm.ComplexityLE ((Qc + nativePairModelConstant s) ^ nativePairModelConstant s) ∧ M.HasLowerRankOrbitFamily Tm (fun _ : Unit => 1) (fun h (i : Fin W.family.outputDim × Fin W.family.outputDim) z => V₁.observable i.1 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (A h * K h * U h))) * star (V₁.observable i.2 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (A h))))) (nativeLowerPairModelBudget s Qc) := by intro Λ C Qc Lv S classical let P₀ := sharedFreeCorrelationInput s P' have hQ0 : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 obtain ⟨hP₀, hQP₀, hΛP₀, hdenP₀, hslowP₀, hperiodP₀⟩ := sharedFreeCorrelationInput_bounds s hQ0 hQP' hP' have hP₀C : P₀ ≤ C := sharedFreeCorrelationInput_le_budget s hs hP' have hC0 : 0 ≤ C := (show 0 ≤ P₀ by linarith).trans hP₀C obtain ⟨D₁, _, _, J, hJH, hJ, hcard, r₀, R₀, η, h₀, m, Γ, α, β, hrank, hproper, hm, hmb, hΓ0, hΓ, hα, hβ, x, ε, A, K, U, ρ, hdata, hperiod, _⟩ := B₀.exists_shared_free_lower_factorization D E T hbQ hT F V g hg D' hTfil hfreq hs hp' hP' hQP' hpp' ξ v hsplit hξ hv ((Real.exp_le_exp.mpr (hΛP₀.trans hP₀C)).trans hN) obtain ⟨M₀, hM₀, hM₀b, hperiod, _⟩ := hperiod let X := W.replaceRank E T hbQ hT V g hg Hsource hsource hsourceDense hcorr let ε' (h : ZMod N) := if hh : h ∈ J then ε ⟨h, hh⟩ else 1 let a' (h : ZMod N) := if hh : h ∈ J then A ⟨h, hh⟩ * K ⟨h, hh⟩ * U ⟨h, hh⟩ else 1 let ρ' (h : ZMod N) := if hh : h ∈ J then ρ ⟨h, hh⟩ else 1 have hprod' (h : ZMod N) (hh : h ∈ J) : ε' h * a' h * ρ' h = X.family.orbit h := by rcases hdata ⟨h, hh⟩ with ⟨_, _, _, _, _, _, _, _, _, _, hprod, _⟩ change ε' h * a' h * ρ' h = g h simp only [ε', a', ρ', dite_eq_left hh] simpa only [mul_assoc] using hprod have hε' (h : ZMod N) (hh : h ∈ J) : CoefficientBound (E.basis.baseChange ℝ) (fun _ : Unit => (N : ℝ)) (Real.exp ((P₀ + 2) ^ 1)) (ε' h).log := by rcases hdata ⟨h, hh⟩ with ⟨_, _, _, _, _, _, _, _, hε, _, _, _⟩ simp only [ε', dite_eq_left hh] exact CoefficientBound.mono _ _ (fun _ => Nat.cast_pos.mpr (NeZero.pos N)) hε hslowP₀ have hρ' (h : ZMod N) (hh : h ∈ J) : CoefficientGrid (E.basis.baseChange ℝ) m (ρ' h).log := by rcases hdata ⟨h, hh⟩ with ⟨_, _, _, _, _, _, _, _, _, hρ, _, _⟩ simpa only [ρ', dite_eq_left hh] using hρ have hperiod' (h : ZMod N) (hh : h ∈ J) (z z' : Unit → ℤ) (hres : ∀ j, (M₀ : ℤ) ∣ z j - z' j) : (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (ρ' h)) : E.Space) = QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z' (ρ' h)) := by simpa only [ρ', dite_eq_left hh] using (hperiod ⟨h, hh⟩ z z' hres).1 obtain ⟨Δ, hΔ, hchar, hnormal, hfinite, hindex, l, hl, hin, hout, hRank, J₂, hsub, hJ₂, hdense, V₁, hfreq₁, hcorr₁⟩ := (exists_shared_factor_correlations s hs).choose_spec.2 X hf hP₀ hQP₀ m M₀ hm (hmb.trans (Real.exp_le_exp.mpr hdenP₀)) hM₀ (hM₀b.trans (Real.exp_le_exp.mpr hperiodP₀)) J (fun h hh => hHsource (hJH hh)) hJ ε' a' ρ' hprod' hε' hρ' hperiod' hN let lift (h : {h // h ∈ J₂}) : {h // h ∈ J} := ⟨h.val, hsub h.property⟩ refine ⟨J₂, (fun h hh => hJH (hsub hh)), hJ₂, ?_, r₀, R₀, η, h₀, Γ, α, β, hrank, hproper, hΓ0, hΓ, hα, hβ, (fun h => x (lift h)), (fun h => A (lift h)), (fun h => K (lift h)), (fun h => U (lift h)), ?_, Δ, hΔ, hchar, hnormal, hfinite, hindex, l, hl, hin, hout, hRank, V₁, hfreq₁, ?_, ?_⟩ · calc _ = Real.exp (-C) * (Real.exp (-Λ) * H'.card) := by rw [← mul_assoc, ← Real.exp_add] congr 2 ring _ ≤ Real.exp (-C) * J.card := mul_le_mul_of_nonneg_left hcard (Real.exp_pos _).le _ ≤ _ := hdense · intro h rcases hdata (lift h) with ⟨hx, hs, hA, _, hA0, hK0, hU0, _, _, _, _, hKU⟩ exact ⟨hx, hs, hA, hA0, hK0, hU0, hKU⟩ · intro h have hc := hcorr₁ h.val h.property change Nonempty (NativeVectorCorrelation (s - 1) N C (W.replacedRankResidual h.val (fun i z => V₁.observable i (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) (fun _ => (z.val : ℤ)) (a' h.val)))))) at hc have ha : a' h.val = A (lift h) * K (lift h) * U (lift h) := by simp only [a', dite_eq_left (hsub h.property), lift] rw [ha] at hc exact hc · apply B₀.exists_covered_factored_family D E T hbQ hT F V g hg D' hTfil hfreq hs hP' hQP' Δ l hl hin hout hC0 hRank V₁ hfreq₁ (fun h => A (lift h)) (fun h => K (lift h)) (fun h => U (lift h)) · intro h rcases hdata (lift h) with ⟨_, _, _, _, hA0, _, _, _, _, _, _, _⟩ exact hA0 · intro h rcases hdata (lift h) with ⟨_, _, _, _, _, hK0, _, _, _, _, _, _⟩ exact hK0 · intro h rcases hdata (lift h) with ⟨_, _, _, _, _, _, hU0, _, _, _, _, _⟩ exact hU0 · intro h d rcases hdata (lift h) with ⟨_, _, hA, _, _, _, _, _, _, _, _, _⟩ rw [hA] exact affine_refined_coefficient_mem D.coefficientFreeSpan D.dependentFreeSpan (fun d : Fin s => D'.coefficientFourSpace ⟨d.val + 1, by omega⟩) Γ.log α β (fun j => (x (lift h) j : ℝ)) hΓ (fun d => (hα d).1) (fun j d => (hβ j d).1) d · intro h d rcases hdata (lift h) with ⟨_, _, _, _, _, _, _, _, _, _, _, hKU⟩ exact (hKU d).1 · intro h d rcases hdata (lift h) with ⟨_, _, _, _, _, _, _, _, _, _, _, hKU⟩ exact (hKU d).2
end Erdos3.NativeRankRelation.CommonData
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423import OAI.Combinatorics.Progressions.Dynamics.SharedFreeLowerComparisonBudget
namespace OAI
section
namespace Erdos3
noncomputable def nativeLowerPairModelBudget (s : ℕ) (p : ℝ) : ℝ := ((p + nativePairModelConstant s) ^ nativePairModelConstant s + rankUnitDescentConstant s) ^ rankUnitDescentConstant s
theorem exists_nativeLowerPairModelBudget_bound (s : ℕ) : ∃ C : ℕ, 2 ≤ C ∧ ∀ p : ℝ, 0 ≤ p → (p + nativePairModelConstant s) ^ nativePairModelConstant s ≤ (p + C) ^ C ∧ nativeLowerPairModelBudget s p ≤ (p + C) ^ C := by let a := nativePairModelConstant s let b := rankUnitDescentConstant s let A : Polynomial ℕ := (Polynomial.X + Polynomial.C a) ^ a obtain ⟨C, hC, hbudget⟩ := exists_natPolynomial_eval_budget (A + (A + Polynomial.C b) ^ b) refine ⟨C, hC, ?_⟩ intro p hp have ha : 0 ≤ (p + a) ^ a := by positivity have hb : 0 ≤ ((p + a) ^ a + b) ^ b := by positivity have hsum : (p + a) ^ a + ((p + a) ^ a + b) ^ b ≤ (p + C) ^ C := by simpa [A, Polynomial.eval₂_pow] using hbudget p hp exact ⟨(le_add_of_nonneg_right hb).trans hsum, (le_add_of_nonneg_left ha).trans hsum⟩
end Erdos3
namespace Erdos3.SubspaceFreeLift
open Module NilpotentLieBCHGroup RationalFilteredNilmanifoldopen scoped TensorProduct
theorem exists_uniform_lower_pair_model {L I : Type} [LieRing L] [LieAlgebra ℚ L] [Fintype I] [TopologicalSpace (ℝ ⊗[ℚ] L)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [T2Space (ℝ ⊗[ℚ] L)] {s r d : ℕ} (D : RationalFilteredNilmanifold L s d) (T : D.DegreeRankStructure (r + 1)) (S : Fin s → Submodule ℚ (Fin 2 → L)) (B : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j)) (hS : ∀ j, S j ≤ (piRank (fun _ : Fin 2 => D) (fun _ => T)).filtration.layer (j.val + 1) 0) {p : ℝ} (hp : 2 ≤ p) (hT : T.ComplexityLE p) (hB : ∀ j a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => D.basis)).repr (B j a : Fin 2 → L) i) ≤ p) (V : D.UnitVerticalObservable (T.realSubgroup s (r + 1)) I p) (hzero : ∀ x ∈ (filtration S T.filtration.rank_le_degree).layer s (r + 1), pairDifferenceFunctional V.frequency (evaluation S B (piRank (fun _ : Fin 2 => D) (fun _ => T)).filtration hS x) = 0) : let pM := (p + nativePairModelConstant s) ^ nativePairModelConstant s let φ := evaluation S B (piRank (fun _ : Fin 2 => D) (fun _ => T)).filtration hS ∃ M : RationalFilteredNilmanifold (Algebra S (r + 1)) s (finrank ℚ (Algebra S (r + 1))), ∃ U : M.DegreeRankStructure (r + 1), U.filtration = filtration S T.filtration.rank_le_degree ∧ U.ComplexityLE pM ∧ (letI := moduleTopology ℝ (ℝ ⊗[ℚ] Algebra S (r + 1)) letI : IsTopologicalAddGroup (ℝ ⊗[ℚ] Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ letI := realification_moduleTopology_t2 M.basis ∃ Z : M.UnitVerticalObservable (U.realSubgroup s (r + 1)) (I × I) pM, (∀ i x, Z.observable i (QuotientGroup.mk x) = V.pairedObservable T i (QuotientGroup.mk (realificationMap (hnil := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => D)).filtration.lowerCentralSeries_eq_bot) φ x))) ∧ M.HasUniformLowerRankUnitFamily U Z.observable (fun _ : Unit => 1) (nativeLowerPairModelBudget s p)) := by intro pM φ let := moduleTopology ℝ (ℝ ⊗[ℚ] (Fin 2 → L)) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] (Fin 2 → L)) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 (Pi.basis (fun _ : Fin 2 => D.basis)) obtain ⟨M, U, hU, hUc, _, _, _, _, hZ⟩ := (exists_native_pair_model.{0, 0} s).choose_spec.2 L I (r + 1) d D T S B hS p hp hT hB V refine ⟨M, U, hU, hUc, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] Algebra S (r + 1)) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 M.basis obtain ⟨Z, hfreq, hobs⟩ := hZ refine ⟨Z, hobs, ?_⟩ have hZzero : ∀ x ∈ U.filtration.layer s (r + 1), Z.frequency x = 0 := by intro x hx rw [hfreq] exact hzero x (by simpa only [hU] using hx) exact UnitVerticalObservable.hasUniformLowerRankUnitFamily M U Z (fun _ : Unit => 1) ((Nat.cast_nonneg _).trans hUc.1.1) hUc hZzero
end Erdos3.SubspaceFreeLift
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module NilpotentLieBCHGroup RationalFilteredNilmanifoldopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_covered_comparison (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (Λ : Subgroup E.filtration.Group) (m : ℕ) (hm : 0 < m) (hin : scaledIntegerGrid m ⊆ bchSubgroupCoordinates E.basis Λ) (hout : bchSubgroupCoordinates E.basis Λ ⊆ denominatorGrid m) {p₁ : ℝ} (hp₁ : 0 ≤ p₁) (hT₁ : (T.withLattice Λ m hm hin hout).ComplexityLE p₁) (V₁ : (E.withLattice Λ m hm hin hout).UnitVerticalObservable ((T.withLattice Λ m hm hin hout).realSubgroup s (r + 1)) (Fin W.family.outputDim) p₁) (hV₁ : V₁.frequency = V.frequency) : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let hS := D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil let q₁ := p₁ + sharedFreeComparisonBasisBudget Q P' + 2 let E₁ := E.withLattice Λ m hm hin hout let T₁ := T.withLattice Λ m hm hin hout let pM := (q₁ + nativePairModelConstant s) ^ nativePairModelConstant s ∃ J : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j), (∀ j a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => E.basis)).repr (J j a : Fin 2 → D.CoefficientFreeLieAlgebra) i) ≤ sharedFreeComparisonBasisBudget Q P') ∧ let φ := SubspaceFreeLift.evaluation S J (piRank (fun _ : Fin 2 => E₁) (fun _ => T₁)).filtration hS ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ U : M.DegreeRankStructure (r + 1), U.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ U.ComplexityLE pM ∧ (letI := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) letI : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ letI := realification_moduleTopology_t2 M.basis ∃ Z : M.UnitVerticalObservable (U.realSubgroup s (r + 1)) (Fin W.family.outputDim × Fin W.family.outputDim) pM, (∀ i x, Z.observable i (QuotientGroup.mk x) = V₁.pairedObservable T₁ i (QuotientGroup.mk (realificationMap (hnil := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => E₁)).filtration.lowerCentralSeries_eq_bot) φ x))) ∧ M.HasUniformLowerRankUnitFamily U Z.observable (fun _ : Unit => 1) (nativeLowerPairModelBudget s q₁)) := by intro S hS q₁ E₁ T₁ pM have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 have hB := sharedFreeComparisonBasisBudget_nonneg hQ hP' have hq : 2 ≤ q₁ := by dsimp only [q₁]; linarith have hpq : p₁ ≤ q₁ := by dsimp only [q₁]; linarith have hBq : sharedFreeComparisonBasisBudget Q P' ≤ q₁ := by dsimp only [q₁]; linarith obtain ⟨J, hJ⟩ := D.exists_comparisonCoefficientBases E T hbQ hT F V g hg D' hTfil hs hP' hQP' refine ⟨J, hJ, ?_⟩ apply SubspaceFreeLift.exists_uniform_lower_pair_model E₁ T₁ S J hS hq (hT₁.mono T₁ hpq) (fun j a i => (hJ j a i).trans hBq) (V₁.mono hpq) intro x hx change pairDifferenceFunctional V₁.frequency (SubspaceFreeLift.evaluation S J (piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration hS x) = 0 rw [hV₁] exact B₀.comparison_free_top_frequency D E T hbQ hT V g hg D' hTfil hfreq J x hx
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial RationalFilteredNilmanifoldopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_covered_factored_family {τ : Type*} (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (Λ : Subgroup E.filtration.Group) (m : ℕ) (hm : 0 < m) (hin : scaledIntegerGrid m ⊆ bchSubgroupCoordinates E.basis Λ) (hout : bchSubgroupCoordinates E.basis Λ ⊆ denominatorGrid m) {p₁ : ℝ} (hp₁ : 0 ≤ p₁) (hT₁ : (T.withLattice Λ m hm hin hout).ComplexityLE p₁) (V₁ : (E.withLattice Λ m hm hin hout).UnitVerticalObservable ((T.withLattice Λ m hm hin hout).realSubgroup s (r + 1)) (Fin W.family.outputDim) p₁) (hV₁ : V₁.frequency = V.frequency) (A K U : τ → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hA0 : ∀ t, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (A t) = 1) (hK0 : ∀ t, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (K t) = 1) (hU0 : ∀ t, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (U t) = 1) (hA : ∀ t (d : Fin s), coefficients (A t).log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) (hK : ∀ t (d : Fin s), coefficients (K t).log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ) (hU : ∀ t (d : Fin s), coefficients (U t).log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let q₁ := p₁ + sharedFreeComparisonBasisBudget Q P' + 2 ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ Tm : M.DegreeRankStructure (r + 1), Tm.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ Tm.ComplexityLE ((q₁ + nativePairModelConstant s) ^ nativePairModelConstant s) ∧ M.HasLowerRankOrbitFamily Tm (fun _ : Unit => 1) (fun t (i : Fin W.family.outputDim × Fin W.family.outputDim) x => V₁.observable i.1 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (A t * K t * U t))) * star (V₁.observable i.2 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (A t))))) (nativeLowerPairModelBudget s q₁) := by intro S q₁ let E₁ := E.withLattice Λ m hm hin hout let T₁ := T.withLattice Λ m hm hin hout obtain ⟨J, _, M, Tm, hTm, hTmc, hZ⟩ := B₀.exists_covered_comparison D E T hbQ hT F V g hg D' hTfil hfreq hs hP' hQP' Λ m hm hin hout hp₁ hT₁ V₁ hV₁ refine ⟨M, Tm, hTm, hTmc, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 M.basis obtain ⟨Z, hobs, huniform⟩ := hZ apply huniform.realizeFamily intro t obtain ⟨u, hu0, _, hu⟩ := D.exists_native_factored_comparison_orbit E T hbQ hT V g hg D' hTfil (by omega) (A t) (K t) (U t) (hA0 t) (hK0 t) (hU0 t) (hA t) (hK t) (hU t) J M Tm hTm refine ⟨u, hu0, ?_⟩ intro i x exact SubspaceFreeLift.native_pair_observable_eval E₁ T₁ S J (D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil) M Tm V₁ Z hobs ![A t * K t * U t, A t] u hu i x
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3
noncomputable def sharedFreeFrozenCoverBudget (s : ℕ) (p : ℝ) : ℝ := (p + (RationalFilteredNilmanifold.exists_shared_frozen_unit_observable.{0, 0, 0} s 1).choose) ^ (RationalFilteredNilmanifold.exists_shared_frozen_unit_observable.{0, 0, 0} s 1).choose
end Erdos3
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial RationalFilteredNilmanifoldopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_frozen_comparison {τ : Type} (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hf : ∀ x, ‖f x‖ ≤ 1) {pF ε : ℝ} (hpF : 0 ≤ pF) (hQF : Q ≤ pF) (hε : 0 < ε) (hεF : 1 / ε ≤ Real.exp pF) (q₀ : ℕ) (hq₀ : 0 < q₀) (hqF : (q₀ : ℝ) ≤ Real.exp pF) (J₀ : Finset τ) (hJ₀ : J₀.Nonempty) (a u : τ → E.RealGroup) (ha : ∀ t ∈ J₀, ∀ i, |(E.basis.baseChange ℝ).repr (a t).coord i| ≤ Real.exp ((pF + 2) ^ 1)) (hu : ∀ t ∈ J₀, ∀ i, |(E.basis.baseChange ℝ).repr (u t).coord i| ≤ Real.exp ((pF + 2) ^ 1)) (hugrid : ∀ t ∈ J₀, (E.basis.baseChange ℝ).equivFun (u t).coord ∈ realDenominatorGrid q₀) (A K U : τ → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hA0 : ∀ t ∈ J₀, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (A t) = 1) (hK0 : ∀ t ∈ J₀, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (K t) = 1) (hU0 : ∀ t ∈ J₀, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (U t) = 1) (hA : ∀ t ∈ J₀, ∀ d : Fin s, coefficients (A t).log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) (hK : ∀ t ∈ J₀, ∀ d : Fin s, coefficients (K t).log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ) (hU : ∀ t ∈ J₀, ∀ d : Fin s, coefficients (U t).log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) : let p₁ := sharedFreeFrozenCoverBudget s pF let q₁ := p₁ + sharedFreeComparisonBasisBudget Q P' + 2 let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' ∃ Λ : Subgroup E.filtration.Group, Λ ≤ E.lattice ∧ (Λ.subgroupOf E.lattice).Characteristic ∧ (Λ.subgroupOf E.lattice).Normal ∧ (Λ.subgroupOf E.lattice).FiniteIndex ∧ (Λ.relIndex E.lattice : ℝ) ≤ Real.exp p₁ ∧ ∃ (m : ℕ) (hm : 0 < m) (hin : scaledIntegerGrid m ⊆ bchSubgroupCoordinates E.basis Λ) (hout : bchSubgroupCoordinates E.basis Λ ⊆ denominatorGrid m), (T.withLattice Λ m hm hin hout).ComplexityLE p₁ ∧ ∃ J : Finset τ, J ⊆ J₀ ∧ J.Nonempty ∧ Real.exp (-p₁) * J₀.card ≤ (J.card : ℝ) ∧ ∃ V₁ : (E.withLattice Λ m hm hin hout).UnitVerticalObservable ((T.withLattice Λ m hm hin hout).realSubgroup s (r + 1)) (Fin W.family.outputDim) p₁, V₁.frequency = V.frequency ∧ (∀ t ∈ J, ∀ i (b c : E.RealGroup), ‖V.observable i (QuotientGroup.mk (a t * b * u t)) - ∑ j, (V₁.observable i (QuotientGroup.mk b) * star (V₁.observable j (QuotientGroup.mk c))) * V₁.observable j (QuotientGroup.mk c)‖ ≤ (V.lipBound : ℝ) * ε) ∧ (∀ t ∈ J, ∀ (h : ZMod N) (v : ZMod N → E.RealGroup) (pC : ℝ), (V.lipBound : ℝ) * ε ≤ Real.exp (-(2 * pC)) / 2 → Nonempty (NativeVectorCorrelation (s - 1) N pC (W.replacedRankResidual h (fun i x => V.observable i (QuotientGroup.mk (a t * v x * u t))))) → Nonempty (NativeVectorCorrelation (s - 1) N (pC + 1) (W.replacedRankResidual h (fun i x => V₁.observable i (QuotientGroup.mk (v x)))))) ∧ ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ Tm : M.DegreeRankStructure (r + 1), Tm.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ Tm.ComplexityLE ((q₁ + nativePairModelConstant s) ^ nativePairModelConstant s) ∧ M.HasLowerRankOrbitFamily Tm (fun _ : Unit => 1) (fun (t : {t // t ∈ J}) (i : Fin W.family.outputDim × Fin W.family.outputDim) x => V₁.observable i.1 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (A t.val * K t.val * U t.val))) * star (V₁.observable i.2 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (A t.val))))) (nativeLowerPairModelBudget s q₁) := by intro p₁ q₁ S obtain ⟨Λ, hΛ, hchar, hnormal, hfinite, hindex, m, hm, hin, hout, hT₁, J, hsub, hJ, hdense, V₁, hV₁, happ⟩ := (RationalFilteredNilmanifold.exists_shared_frozen_unit_observable.{0, 0, 0} s 1).choose_spec.2 E T hpF (hT.mono T hQF) hε hεF q₀ hq₀ hqF (V.mono hQF) J₀ a u hJ₀ ha hu hugrid refine ⟨Λ, hΛ, hchar, hnormal, hfinite, hindex, m, hm, hin, hout, hT₁, J, hsub, hJ, hdense, V₁, hV₁, ?_, ?_, ?_⟩ · intro t ht i b c rw [← complex_unit_vector_resolution (fun j => V₁.observable j (QuotientGroup.mk c)) (V₁.unit (QuotientGroup.mk c)) (V₁.observable i (QuotientGroup.mk b))] exact happ t ht i b · intro t ht h v pC hsmall hcorr obtain ⟨C⟩ := hcorr apply C.exists_of_uniform_approx intro ij x exact (W.replacedRankResidual_norm_sub_le hf h _ _ ij x).trans ((happ t ht ij.2 (v x)).trans hsmall) · exact B₀.exists_covered_factored_family D E T hbQ hT F V g hg D' hTfil hfreq hs hP' hQP' Λ m hm hin hout ((Nat.cast_nonneg _).trans hT₁.1.1) hT₁ V₁ hV₁ (fun t : {t // t ∈ J} => A t.val) (fun t : {t // t ∈ J} => K t.val) (fun t : {t // t ∈ J} => U t.val) (fun t => hA0 t.val (hsub t.property)) (fun t => hK0 t.val (hsub t.property)) (fun t => hU0 t.val (hsub t.property)) (fun t => hA t.val (hsub t.property)) (fun t => hK t.val (hsub t.property)) (fun t => hU t.val (hsub t.property))
end Erdos3.NativeRankRelation.CommonData
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686import OAI.Combinatorics.Progressions.Dynamics.SharedFreeFullOrbitBudgetimport OAI.Combinatorics.Progressions.Dynamics.SharedFreeLowerComparisonBudgetimport OAI.Combinatorics.Progressions.Lattices.AffineRefinedCoefficientsimport OAI.Combinatorics.Progressions.Polynomial.PolynomialOrbitLogSumimport OAI.Combinatorics.Progressions.Polynomial.SharedFreeCommonPolynomialCorrections
namespace OAI
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial CyclicCrootSisaskopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_shared_free_full_orbit_factorization (hTfil : T.filtration = D.coefficientFreeFiltration) (hs : 2 ≤ s) (hp' : 0 ≤ p') (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hpp' : p' ≤ P') (ξ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hsplit : ∀ h, g h = ξ * v h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.commonFreeSpan d).baseChange ℝ) (hv : ∀ h (d : Fin s), coefficients (v h).log (Finsupp.single () (d.val + 1)) ∈ (D.dependentFreeSpan d).baseChange ℝ) (hN : Real.exp ((P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s) ≤ (N : ℝ)) : let B := (P' + 2) ^ 3 + 2 * P' let Λ := (P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s let Lc := sharedFreeCommonCorrectionBudget s Q P' let Lv := sharedFreePetalLiftBudget s Q P' ∃ D₁ : R'.CommonData B, D₁.quadruples ⊆ D'.quadruples ∧ D₁.spaces = D'.spaces ∧ ∃ J ⊆ H', J.Nonempty ∧ Real.exp (-Λ) * H'.card ≤ (J.card : ℝ) ∧ ∃ (r₀ : ℕ) (R₀ : Fin r₀ → ℕ) (η : (Fin r₀ → ℤ) →+ ZMod N) (h₀ : ZMod N) (m : ℕ) (Γ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (α : Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra) (β : Fin r₀ → Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra), (r₀ : ℝ) ≤ Λ ∧ Set.InjOn η {x | ∀ j, |x j| ≤ (R₀ j : ℤ)} ∧ 0 < m ∧ (m : ℝ) ≤ Real.exp ((s : ℝ) * (Lc + Lv)) ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 Γ = 1 ∧ (∀ d : Fin s, coefficients Γ.log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) ∧ (∀ d, α d ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ‖(E.basis.baseChange ℝ).equivFun (α d)‖ ≤ Real.exp Lv) ∧ (∀ j d, β j d ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ‖(E.basis.baseChange ℝ).equivFun (β j d)‖ ≤ Real.exp Lv) ∧ ∀ h ∈ J, ∃ x : Fin r₀ → ℤ, (∀ j, |x j| ≤ (R₀ j : ℤ)) ∧ h = h₀ + η x ∧ ∃ ε A K U ρ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1), A.log = Γ.log + positiveUnivariate (fun d => α d + ∑ j, (x j : ℝ) • β j d) ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 ε = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 A = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 K = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 U = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 ρ = 1 ∧ CoefficientBound (E.basis.baseChange ℝ) (fun _ : Unit => (N : ℝ)) (Real.exp Lc + Real.exp Lv) ε.log ∧ CoefficientGrid (E.basis.baseChange ℝ) m ρ.log ∧ ε * A * K * U * ρ = g h ∧ ∀ d : Fin s, coefficients K.log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ ∧ coefficients U.log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ := by intro B Λ Lc Lv classical obtain ⟨mc, Γ, εc, ρc, hmc, hmcb, hΓ0, hεc0, hρc0, hεc, hρc, hcommon⟩ := D.exists_shared_free_common_polynomial_corrections E T hbQ hT F V g hg D' hTfil hs hp' hP' hQP' hpp' ξ v hsplit hξ hv hN obtain ⟨D₁, hsub, hspaces, J, hJH, hJ, hcard, r₀, R₀, η, h₀, mv, α, β, hrank, hproper, hmv, hmvb, hα, hβ, hfamily⟩ := D.exists_shared_free_affine_orbit_family E T hbQ hT F V g hg D' hTfil hs hp' hP' hQP' hpp' ξ v hsplit hξ hv hN let m := mc * mv have hm : 0 < m := Nat.mul_pos hmc hmv have hmcdiv : mc ∣ m := ⟨mv, rfl⟩ have hmvdiv : mv ∣ m := ⟨mc, Nat.mul_comm _ _⟩ have hmb : (m : ℝ) ≤ Real.exp ((s : ℝ) * (Lc + Lv)) := by change ((mc * mv : ℕ) : ℝ) ≤ _ rw [Nat.cast_mul] calc _ ≤ Real.exp ((s : ℝ) * Lc) * Real.exp ((s : ℝ) * Lv) := mul_le_mul hmcb hmvb (Nat.cast_nonneg _) (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add]; congr 1; ring have hρcM : CoefficientGrid (E.basis.baseChange ℝ) m ρc.log := fun a => realDenominatorGrid_subset_of_dvd hmc hmcdiv (hρc a) refine ⟨D₁, hsub, hspaces, J, hJH, hJ, hcard, r₀, R₀, η, h₀, m, Γ, α, β, hrank, hproper, hm, hmb, hΓ0, (fun d => (hcommon d).1), hα, hβ, ?_⟩ intro h hh obtain ⟨x, hx, hspace, Av, εv, ρv, U, hAv, hAv0, hεv0, hρv0, hU0, hεv, hρv, hdependent⟩ := hfamily h hh let ε := εc.logSum εv let ρ := ρc.logSum ρv let A := Γ.logSum Av have hε0 := εc.logSum_normalized εv hεc0 hεv0 have hρ0 := ρc.logSum_normalized ρv hρc0 hρv0 have hA0 := Γ.logSum_normalized Av hΓ0 hAv0 have hρvM : CoefficientGrid (E.basis.baseChange ℝ) m ρv.log := fun a => realDenominatorGrid_subset_of_dvd hmv hmvdiv (hρv a) have hcoeff (d : Fin s) : coefficients (g h).log (Finsupp.single () (d.val + 1)) - (coefficients ε.log (Finsupp.single () (d.val + 1)) + coefficients A.log (Finsupp.single () (d.val + 1)) + coefficients U.log (Finsupp.single () (d.val + 1)) + coefficients ρ.log (Finsupp.single () (d.val + 1))) ∈ (T.filtration.layer (Finsupp.weight (fun _ : Unit => 1) (Finsupp.single () (d.val + 1))) 2).baseChange ℝ := by have hp := T.polynomialOrbit_mul_coefficient_sub_mem_rank_two (by omega) (fun _ : Unit => 1) (Finsupp.single () (d.val + 1)) ξ (v h) rw [← hsplit h, (hcommon d).2, (hdependent d).2] at hp convert hp using 1 simp only [ε, ρ, A, NilpotentLieFiltration.PolynomialOrbit.logSum_log, map_add, Finsupp.add_apply] abel obtain ⟨K, hK0, hprod, hK⟩ := T.exists_polynomialOrbit_factorization_rank_two (by omega) (fun _ : Unit => 1) (fun d : Fin s => Finsupp.single () (d.val + 1)) (g h) ε A U ρ (hg h) hε0 hA0 hU0 hρ0 hcoeff refine ⟨x, hx, hspace, ε, A, K, U, ρ, ?_, hε0, hA0, hK0, hU0, hρ0, CoefficientBound.add _ _ hεc hεv, CoefficientGrid.add _ _ hρcM hρvM, hprod, ?_⟩ · exact congrArg (fun z => Γ.log + z) hAv · intro d exact ⟨by simpa only [Finsupp.weight_single, smul_eq_mul, mul_one] using hK d, (hdependent d).1⟩
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.RationalFilteredNilmanifold
open VectorPolynomialopen scoped TensorProduct NNReal
theorem exists_sharedFreeFactorFreezing (s : ℕ) : ∃ C : ℕ, 2 ≤ C ∧ ∀ {L : Type*} [LieRing L] [LieAlgebra ℚ L] [TopologicalSpace (ℝ ⊗[ℚ] L)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] L)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] L)] [T2Space (ℝ ⊗[ℚ] L)] {d : ℕ} (D : RationalFilteredNilmanifold L s d) {q p : ℝ}, 0 ≤ q → q ≤ p → 0 ≤ p → D.GeometryComplexityLE q → ∀ m : ℕ, 0 < m → (m : ℝ) ≤ Real.exp ((s : ℝ) * (sharedFreeCommonCorrectionBudget s q p + sharedFreePetalLiftBudget s q p)) → ∃ M : ℕ, 0 < M ∧ (M : ℝ) ≤ Real.exp ((p + C) ^ C) ∧ (∀ ρ : D.filtration.realification.PolynomialOrbit (fun _ : Unit => 1), CoefficientGrid (D.basis.baseChange ℝ) m ρ.log → ∀ x y : Unit → ℤ, (∀ j, (M : ℤ) ∣ x j - y j) → ((QuotientGroup.mk (D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x ρ) : D.Space) = QuotientGroup.mk (D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y ρ)) ∧ ((QuotientGroup.mk (D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x ρ)⁻¹ : D.Space) = QuotientGroup.mk (D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y ρ)⁻¹)) ∧ ∀ (Φ : D.Space → ℂ) (K : ℝ≥0), (∀ z, ‖Φ z‖ ≤ 1) → (letI := D.metricSpace; LipschitzWith K Φ) → (K : ℝ) ≤ Real.exp q → ∀ ε a ρ g : D.filtration.realification.PolynomialOrbit (fun _ : Unit => 1), ε * a * ρ = g → ∀ T : ℝ, 0 < T → CoefficientBound (D.basis.baseChange ℝ) (fun _ : Unit => T) (Real.exp (sharedFreeCommonCorrectionBudget s q p) + Real.exp (sharedFreePetalLiftBudget s q p)) ε.log → CoefficientGrid (D.basis.baseChange ℝ) m ρ.log → ∀ (x y : Unit → ℤ) (δ : ℝ), 0 ≤ δ → (∀ j, |(x j : ℝ)| ≤ T) → (∀ j, |(y j : ℝ)| ≤ T) → (∀ j, |(x j : ℝ) - y j| ≤ T * δ) → (∀ j, (M : ℤ) ∣ x j - y j) → ‖Φ (QuotientGroup.mk (D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x g)) - Φ (QuotientGroup.mk (D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y ε * D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x a * D.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y ρ))‖ ≤ Real.exp ((p + C) ^ C) * δ := by obtain ⟨a, _, hfull⟩ := exists_sharedFreeFullOrbitBudget_bound s obtain ⟨b, _, hperiod⟩ := exists_native_orbit_rational_period s obtain ⟨c, _, hfreeze⟩ := exists_orbit_factor_freezing s 1 let B : Polynomial ℕ := (Polynomial.X + Polynomial.C a) ^ a + Polynomial.X + 2 obtain ⟨C, hC, hbudget⟩ := exists_natPolynomial_eval_budget ((B + Polynomial.C b) ^ b + (B + Polynomial.C c) ^ c) refine ⟨C, hC, ?_⟩ intro L _ _ _ _ _ _ d D q p hq hqp hp hD m hm hmb let t := (p + a) ^ a + p + 2 have hpow : 0 ≤ (p + a) ^ a := by positivity have ht : 0 ≤ t := by dsimp only [t]; positivity have hqt : q ≤ t := by dsimp only [t]; linarith have hbt : (p + a) ^ a ≤ t := by dsimp only [t]; linarith have ht1 : (1 : ℝ) ≤ t := by dsimp only [t]; linarith have hsum : (t + b) ^ b + (t + c) ^ c ≤ (p + C) ^ C := by simpa [B, t, Polynomial.eval₂_pow] using hbudget p hp have hbC : (t + b) ^ b ≤ (p + C) ^ C := by linarith [show 0 ≤ (t + c) ^ c by positivity] have hcC : (t + c) ^ c ≤ (p + C) ^ C := by linarith [show 0 ≤ (t + b) ^ b by positivity] obtain ⟨_, _, _, hden, hslow⟩ := hfull q p hq hqp hp obtain ⟨M, hM, hMb, hsolve⟩ := hperiod D (fun _ : Unit => 1) (fun _ => Nat.zero_lt_one) t ht (hD.mono D hqt) (by simpa only [Fintype.card_unit, Nat.cast_one] using ht1) m hm (hmb.trans (Real.exp_le_exp.mpr (hden.trans hbt))) refine ⟨M, hM, hMb.trans (Real.exp_le_exp.mpr hbC), hsolve, ?_⟩ intro Φ K hΦ hLip hK ε a₀ ρ g hprod T hT hε hρ x y δ hδ hx hy hxy hres have hε' : CoefficientBound (D.basis.baseChange ℝ) (fun _ : Unit => T) (Real.exp ((t + 2) ^ 1)) ε.log := CoefficientBound.mono _ _ (fun _ => hT) hε (hslow.trans (Real.exp_le_exp.mpr (by simpa only [pow_one] using (hbt.trans (show t ≤ t + 2 by linarith))))) exact (hfreeze D (fun _ : Unit => 1) (fun _ => Nat.zero_lt_one) t ht (hD.mono D hqt) (by simpa only [Fintype.card_unit, Nat.cast_one] using ht1) Φ K hΦ hLip (hK.trans (Real.exp_le_exp.mpr hqt)) ε a₀ ρ g hprod (fun _ : Unit => T) (fun _ => hT) hε' x y δ hδ hx hy hxy (hsolve ρ hρ x y hres).1).trans (mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr hcC) hδ)
end Erdos3.RationalFilteredNilmanifold
namespace Erdos3
noncomputable def sharedFreeFactorFreezingConstant (s : ℕ) : ℕ := (RationalFilteredNilmanifold.exists_sharedFreeFactorFreezing.{0} s).choose
end Erdos3
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module NilpotentLieBCHGroup RationalFilteredNilmanifoldopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_invariant_native_comparison_model (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let hS := D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil ∃ B : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j), (∀ j a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => E.basis)).repr (B j a : Fin 2 → D.CoefficientFreeLieAlgebra) i) ≤ sharedFreeComparisonBasisBudget Q P') ∧ let φ := SubspaceFreeLift.evaluation S B (piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration hS ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S r) s (finrank ℚ (SubspaceFreeLift.Algebra S r)), ∃ U : M.DegreeRankStructure r, U.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ U.ComplexityLE (sharedFreeComparisonModelBudget s Q P') ∧ IsCentralLieBasis M.basis ∧ Nonempty (FreeCoordinateFrame M.basis (sharedFreeComparisonModelBudget s Q P')) ∧ (∀ i j, rationalLogHeight ((pi (fun _ : Fin 2 => E)).basis.repr (φ (M.basis j)) i) ≤ sharedFreeComparisonModelBudget s Q P') ∧ M.lattice ≤ (pi (fun _ : Fin 2 => E)).lattice.comap (mapOfSteps (hL := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => E)).filtration.lowerCentralSeries_eq_bot) φ) ∧ (letI := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S r) letI : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S r) := IsModuleTopology.isTopologicalAddGroup ℝ _ letI := realification_moduleTopology_t2 M.basis ∃ Z : M.UnitVerticalObservable (U.realSubgroup s r) (Fin W.family.outputDim × Fin W.family.outputDim) (sharedFreeComparisonModelBudget s Q P'), Z.frequency = (pairDifferenceFunctional V.frequency).comp φ.toLinearMap ∧ (∀ x ∈ U.filtration.layer s r, Z.frequency x = 0) ∧ (∀ i z, z ∈ U.realSubgroup s r → ∀ x, Z.observable i (z • x) = Z.observable i x) ∧ ∀ i x, Z.observable i (QuotientGroup.mk x) = V.pairedObservable T i (QuotientGroup.mk (realificationMap (hnil := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => E)).filtration.lowerCentralSeries_eq_bot) φ x))) := by intro S hS obtain ⟨J, hJ, M, U, hU, hUc, hcentral, hframe, hmatrix, hlattice, hZ⟩ := D.exists_native_comparison_model E T hbQ hT F V g hg D' hTfil hs hP' hQP' refine ⟨J, hJ, M, U, hU, hUc, hcentral, hframe, hmatrix, hlattice, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S r) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S r) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 M.basis obtain ⟨Z, hfreqZ, hobs⟩ := hZ have hzero := B₀.native_comparison_frequency_zero D E T hbQ hT V g hg D' hTfil hfreq J M U hU Z.frequency hfreqZ exact ⟨Z, hfreqZ, hzero, (fun i z hz x => Z.rank_invariant_of_frequency_zero U hzero z hz i x), hobs⟩
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module NilpotentLieBCHGroup RationalFilteredNilmanifoldopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_uniform_lower_comparison_model (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' let hS := D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil ∃ B : ∀ j, Basis (Fin (finrank ℚ (S j))) ℚ (S j), (∀ j a i, rationalLogHeight ((Pi.basis (fun _ : Fin 2 => E.basis)).repr (B j a : Fin 2 → D.CoefficientFreeLieAlgebra) i) ≤ sharedFreeComparisonBasisBudget Q P') ∧ let φ := SubspaceFreeLift.evaluation S B (piRank (fun _ : Fin 2 => E) (fun _ => T)).filtration hS ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ U : M.DegreeRankStructure (r + 1), U.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ U.ComplexityLE (sharedFreeComparisonModelBudget s Q P') ∧ (letI := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) letI : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ letI := realification_moduleTopology_t2 M.basis ∃ Z : M.UnitVerticalObservable (U.realSubgroup s (r + 1)) (Fin W.family.outputDim × Fin W.family.outputDim) (sharedFreeComparisonModelBudget s Q P'), (∀ i x, Z.observable i (QuotientGroup.mk x) = V.pairedObservable T i (QuotientGroup.mk (realificationMap (hnil := M.filtration.lowerCentralSeries_eq_bot) (hM := (pi (fun _ : Fin 2 => E)).filtration.lowerCentralSeries_eq_bot) φ x))) ∧ M.HasUniformLowerRankUnitFamily U Z.observable (fun _ : Unit => 1) (sharedFreeLowerComparisonBudget s Q P')) := by intro S hS obtain ⟨J, hJ, M, U, hU, hUc, _, _, _, _, hZ⟩ := B₀.exists_invariant_native_comparison_model D E T hbQ hT F V g hg D' hTfil hfreq hs hP' hQP' refine ⟨J, hJ, M, U, hU, hUc, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 M.basis obtain ⟨Z, _, hzero, _, hobs⟩ := hZ refine ⟨Z, hobs, ?_⟩ have hpM : 0 ≤ sharedFreeComparisonModelBudget s Q P' := (Nat.cast_nonneg _).trans hUc.1.1 exact UnitVerticalObservable.hasUniformLowerRankUnitFamily M U Z (fun _ : Unit => 1) hpM hUc hzero
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial RationalFilteredNilmanifoldopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B�� : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_lower_factored_family {τ : Type*} (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (A K U : τ → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hA0 : ∀ t, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (A t) = 1) (hK0 : ∀ t, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (K t) = 1) (hU0 : ∀ t, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (U t) = 1) (hA : ∀ t (d : Fin s), coefficients (A t).log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) (hK : ∀ t (d : Fin s), coefficients (K t).log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ) (hU : ∀ t (d : Fin s), coefficients (U t).log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) : let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ Tm : M.DegreeRankStructure (r + 1), Tm.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ Tm.ComplexityLE (sharedFreeComparisonModelBudget s Q P') ∧ M.HasLowerRankOrbitFamily Tm (fun _ : Unit => 1) (fun t (i : Fin W.family.outputDim × Fin W.family.outputDim) x => V.observable i.1 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (A t * K t * U t))) * star (V.observable i.2 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) x (A t))))) (sharedFreeLowerComparisonBudget s Q P') := by intro S obtain ⟨J, _, M, Tm, hTm, hTmc, hZ⟩ := B₀.exists_uniform_lower_comparison_model D E T hbQ hT F V g hg D' hTfil hfreq hs hP' hQP' refine ⟨M, Tm, hTm, hTmc, ?_⟩ let := moduleTopology ℝ (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) let : IsTopologicalAddGroup (ℝ ⊗[ℚ] SubspaceFreeLift.Algebra S (r + 1)) := IsModuleTopology.isTopologicalAddGroup ℝ _ let := realification_moduleTopology_t2 M.basis obtain ⟨Z, hobs, huniform⟩ := hZ apply huniform.realizeFamily intro t obtain ⟨u, hu0, _, hu⟩ := D.exists_native_factored_comparison_orbit E T hbQ hT V g hg D' hTfil (by omega) (A t) (K t) (U t) (hA0 t) (hK0 t) (hU0 t) (hA t) (hK t) (hU t) J M Tm hTm refine ⟨u, hu0, ?_⟩ intro i x exact SubspaceFreeLift.native_pair_observable_eval E T S J (D.comparisonCoefficientSpace_le_layer E T hbQ hT V g hg D' hTfil) M Tm V Z hobs ![A t * K t * U t, A t] u hu i x
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomial RationalFilteredNilmanifoldopen scoped TensorProduct BigOperators
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s (r + 1) N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (B₀ : D.CoefficientBases Q) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure (r + 1)) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s (r + 1)) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem CoefficientBases.exists_shared_free_lower_factorization (hTfil : T.filtration = D.coefficientFreeFiltration) (hfreq : V.frequency = B₀.freeFrequency D) (hs : 2 ≤ s) (hp' : 0 ≤ p') (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hpp' : p' ≤ P') (ξ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hsplit : ∀ h, g h = ξ * v h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.commonFreeSpan d).baseChange ℝ) (hv : ∀ h (d : Fin s), coefficients (v h).log (Finsupp.single () (d.val + 1)) ∈ (D.dependentFreeSpan d).baseChange ℝ) (hN : Real.exp ((P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s) ≤ (N : ℝ)) : let B := (P' + 2) ^ 3 + 2 * P' let Λ := (P' + sharedFreeAffineConstant s) ^ sharedFreeAffineConstant s let Lc := sharedFreeCommonCorrectionBudget s Q P' let Lv := sharedFreePetalLiftBudget s Q P' ∃ D₁ : R'.CommonData B, D₁.quadruples ⊆ D'.quadruples ∧ D₁.spaces = D'.spaces ∧ ∃ J ⊆ H', J.Nonempty ∧ Real.exp (-Λ) * H'.card ≤ (J.card : ℝ) ∧ ∃ (r₀ : ℕ) (R₀ : Fin r₀ → ℕ) (η : (Fin r₀ → ℤ) →+ ZMod N) (h₀ : ZMod N) (m : ℕ) (Γ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (α : Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra) (β : Fin r₀ → Fin s → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra), (r₀ : ℝ) ≤ Λ ∧ Set.InjOn η {x | ∀ j, |x j| ≤ (R₀ j : ℤ)} ∧ 0 < m ∧ (m : ℝ) ≤ Real.exp ((s : ℝ) * (Lc + Lv)) ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 Γ = 1 ∧ (∀ d : Fin s, coefficients Γ.log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ) ∧ (∀ d, α d ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ‖(E.basis.baseChange ℝ).equivFun (α d)‖ ≤ Real.exp Lv) ∧ (∀ j d, β j d ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ‖(E.basis.baseChange ℝ).equivFun (β j d)‖ ≤ Real.exp Lv) ∧ ∃ (x : {h // h ∈ J} → Fin r₀ → ℤ) (ε A K U ρ : {h // h ∈ J} → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)), (∀ h : {h // h ∈ J}, (∀ j, |x h j| ≤ (R₀ j : ℤ)) ∧ h.val = h₀ + η (x h) ∧ (A h).log = Γ.log + positiveUnivariate (fun d => α d + ∑ j, (x h j : ℝ) • β j d) ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (ε h) = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (A h) = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (K h) = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (U h) = 1 ∧ E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (ρ h) = 1 ∧ CoefficientBound (E.basis.baseChange ℝ) (fun _ : Unit => (N : ℝ)) (Real.exp Lc + Real.exp Lv) (ε h).log ∧ CoefficientGrid (E.basis.baseChange ℝ) m (ρ h).log ∧ ε h * A h * K h * U h * ρ h = g h.val ∧ ∀ d : Fin s, coefficients (K h).log (Finsupp.single () (d.val + 1)) ∈ (T.filtration.layer (d.val + 1) 2).baseChange ℝ ∧ coefficients (U h).log (Finsupp.single () (d.val + 1)) ∈ (fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩))).baseChange ℝ) ∧ (∃ M₀ : ℕ, 0 < M₀ ∧ (M₀ : ℝ) ≤ Real.exp ((P' + sharedFreeFactorFreezingConstant s) ^ sharedFreeFactorFreezingConstant s) ∧ (∀ (h : {h // h ∈ J}) (y z : Unit → ℤ), (∀ j, (M₀ : ℤ) ∣ y j - z j) → ((QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y (ρ h)) : E.Space) = QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (ρ h))) ∧ ((QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y (ρ h))⁻¹ : E.Space) = QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (ρ h))⁻¹)) ∧ ∀ (h : {h // h ∈ J}) i (y z : Unit → ℤ) (δ : ℝ), 0 ≤ δ → (∀ j, |(y j : ℝ)| ≤ N) → (∀ j, |(z j : ℝ)| ≤ N) → (∀ j, |(y j : ℝ) - z j| ≤ (N : ℝ) * δ) → (∀ j, (M₀ : ℤ) ∣ y j - z j) → ‖V.observable i (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y (g h.val))) - V.observable i (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (ε h) * E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y (A h * K h * U h) * E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) z (ρ h)))‖ ≤ Real.exp ((P' + sharedFreeFactorFreezingConstant s) ^ sharedFreeFactorFreezingConstant s) * δ) ∧ let S := D.comparisonCoefficientSpace E T hbQ hT V g hg D' ∃ M : RationalFilteredNilmanifold (SubspaceFreeLift.Algebra S (r + 1)) s (finrank ℚ (SubspaceFreeLift.Algebra S (r + 1))), ∃ Tm : M.DegreeRankStructure (r + 1), Tm.filtration = SubspaceFreeLift.filtration S T.filtration.rank_le_degree ∧ Tm.ComplexityLE (sharedFreeComparisonModelBudget s Q P') ∧ M.HasLowerRankOrbitFamily Tm (fun _ : Unit => 1) (fun h (i : Fin W.family.outputDim × Fin W.family.outputDim) y => V.observable i.1 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y (A h * K h * U h))) * star (V.observable i.2 (QuotientGroup.mk (E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) y (A h))))) (sharedFreeLowerComparisonBudget s Q P') := by intro B Λ Lc Lv classical obtain ⟨D₁, hsub, hspaces, J, hJH, hJ, hcard, r₀, R₀, η, h₀, m, Γ, α, β, hrank, hproper, hm, hmb, hΓ0, hΓ, hα, hβ, hfamily⟩ := D.exists_shared_free_full_orbit_factorization E T hbQ hT F V g hg D' hTfil hs hp' hP' hQP' hpp' ξ v hsplit hξ hv hN choose x hx hspace ε A K U ρ hAl hε0 hA0 hK0 hU0 hρ0 hε hρ hprod hKU using (fun h : {h // h ∈ J} => hfamily h.val h.property) have hAc : ∀ (h : {h // h ∈ J}) (d : Fin s), coefficients (A h).log (Finsupp.single () (d.val + 1)) ∈ ((fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).map (LinearMap.proj 0)).baseChange ℝ := by intro h d rw [hAl h] exact affine_refined_coefficient_mem D.coefficientFreeSpan D.dependentFreeSpan (fun d : Fin s => D'.coefficientFourSpace ⟨d.val + 1, by omega⟩) Γ.log α β (fun j => (x h j : ℝ)) hΓ (fun d => (hα d).1) (fun j d => (hβ j d).1) d refine ⟨D₁, hsub, hspaces, J, hJH, hJ, hcard, r₀, R₀, η, h₀, m, Γ, α, β, hrank, hproper, hm, hmb, hΓ0, hΓ, hα, hβ, x, ε, A, K, U, ρ, ?_, ?_, ?_⟩ · intro h exact ⟨hx h, hspace h, hAl h, hε0 h, hA0 h, hK0 h, hU0 h, hρ0 h, hε h, hρ h, hprod h, hKU h⟩ · have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 obtain ⟨M₀, hM₀, hM₀b, hperiod, hfreeze⟩ := (RationalFilteredNilmanifold.exists_sharedFreeFactorFreezing.{0} s).choose_spec.2 E hQ hQP' hP' hT.1 m hm hmb refine ⟨M₀, hM₀, hM₀b, (fun h y z hres => hperiod (ρ h) (hρ h) y z hres), ?_⟩ intro h i y z δ hδ hy hz hyz hres exact hfreeze (V.observable i) V.lipBound (V.norm i) (V.lipschitz i) V.lip_bound (ε h) (A h * K h * U h) (ρ h) (g h.val) (by simpa only [mul_assoc] using hprod h) (N : ℝ) (by exact_mod_cast NeZero.pos N) (hε h) (hρ h) y z δ hδ hy hz hyz hres · exact B₀.exists_lower_factored_family D E T hbQ hT F V g hg D' hTfil hfreq hs hP' hQP' A K U hA0 hK0 hU0 hAc (fun h d => (hKU h d).1) (fun h d => (hKU h d).2)
end Erdos3.NativeRankRelation.CommonData
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845import OAI.Combinatorics.Progressions.Dynamics.SharedRefinementBudgetimport OAI.Combinatorics.Progressions.Linear.RealFourBalancedDual
namespace OAI
section
namespace Erdos3.NativeRankRelation.CommonData
open Module RationalFilteredNilmanifold VectorPolynomialopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {κ : Type*} {s r N : ℕ} [NeZero N] {b p q P : ℝ} {W : NativeDegreeRankFamily s r (ZMod N) b} {out : Fin W.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W out H p q} (D : R.CommonData P)
theorem exists_native_full_coefficient_corrections (hs : 1 ≤ s) (hP : 0 ≤ P) (c : Basis κ ℚ W.L) (τ : κ → ℕ) (hG : ∀ j, W.rank.filtration.associatedDegree.layer j = Submodule.span ℚ (c '' {i | j ≤ τ i})) (t : ZMod N × ZMod N × ZMod N) (ht : t ∈ D.quadruples) : let I := R.interval ⟨t, D.subset ht⟩ let V : I.SunflowerWitness P := D.witness t ht ∃ E Q : ∀ α : Unit →₀ ℕ, (W.rank.filtration.fourHorizontalLayer (Finsupp.weight (fun _ : Unit => 1) α)).baseChange ℝ, (∀ α j, |(W.fourRankBasis.baseChange ℝ).repr (E α).val j| ≤ Real.exp ((P + 3) ^ 2) / monomialScale (fun _ : Unit => (I.length : ℝ)) α) ∧ (∀ α, (W.fourRankBasis.baseChange ℝ).equivFun (Q α).val ∈ realDenominatorGrid V.projectedDenominator) ∧ ∀ (α : Unit →₀ ℕ) (hα : Finsupp.weight (fun _ : Unit => 1) α ≤ s), (fun k => coefficients (W.orbit (rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k))).log α) - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) (E α).val - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) (Q α).val ∈ D.realCoefficientFourSpace ⟨Finsupp.weight (fun _ : Unit => 1) α, Nat.lt_succ_of_le hα⟩ := by intro I V obtain ⟨E, Q, hE, hQ, hres⟩ := D.exists_bounded_coefficient_corrections hs hP t ht refine ⟨E, Q, hE, hQ, ?_⟩ intro α hα let d : Fin (s + 1) := ⟨Finsupp.weight (fun _ : Unit => 1) α, Nat.lt_succ_of_le hα⟩ let e4 := TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L) let u := e4 (V.projectedOrbitCoefficient α).val let β : Fin 4 → ℝ ⊗[ℚ] W.L := fun k => coefficients (W.orbit (rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k))).log α let e := e4 (E α).val let a := e4 (Q α).val have hu : u - e - a ∈ D.realCoefficientFourSpace d := by have h := (D.mem_real_coefficientFourSpace d (V.projectedOrbitCoefficient α - E α - Q α)).mpr (hres α hα) simpa only [Submodule.coe_sub, map_sub] using h have hk (k : Fin 4) : (u - e - a) k - (β - e - a) k ∈ (W.rank.filtration.layer d.val 2).baseChange ℝ := by have heq : (u - e - a) k - (β - e - a) k = u k - β k := by simp only [Pi.sub_apply] abel rw [heq] exact V.projectedOrbitCoefficient_native_log_mod_kernel hs c τ hG α k exact (D.realCoefficientFourSpace_congr_mod_kernel d _ _ hk).mp hu
theorem native_full_scaled_correction (hs : 1 ≤ s) (hp : 0 ≤ p) (hP : 0 ≤ P) (c : Basis κ ℚ W.L) (τ : κ → ℕ) (hG : ∀ j, W.rank.filtration.associatedDegree.layer j = Submodule.span ℚ (c '' {i | j ≤ τ i})) (l : ℕ) (hdenom : ∀ t (ht : t ∈ D.quadruples), (D.witness t ht).projectedDenominator = l) (α : Unit →₀ ℕ) (hα : Finsupp.weight (fun _ : Unit => 1) α ≤ s) (t : ZMod N × ZMod N × ZMod N) (ht : t ∈ D.quadruples) : ∃ E Q : ℝ ⊗[ℚ] (Fin 4 → W.L), ‖(W.fourRankBasis.baseChange ℝ).equivFun E‖ ≤ Real.exp ((P + 3) ^ 2 + (s : ℝ) * p) / monomialScale (fun _ : Unit => (N : ℝ)) α ∧ (W.fourRankBasis.baseChange ℝ).equivFun Q ∈ realDenominatorGrid l ∧ (fun k => coefficients (W.orbit (rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k))).log α) - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) E - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) Q ∈ D.realCoefficientFourSpace ⟨Finsupp.weight (fun _ : Unit => 1) α, Nat.lt_succ_of_le hα⟩ := by obtain ⟨E, Q, hE, hQ, hres⟩ := D.exists_native_full_coefficient_corrections hs hP c τ hG t ht let I := R.interval ⟨t, D.subset ht⟩ have hlength : (0 : ℝ) < I.length := by exact_mod_cast I.length_pos have hnorm : ‖(W.fourRankBasis.baseChange ℝ).equivFun (E α).val‖ ≤ Real.exp ((P + 3) ^ 2) / monomialScale (fun _ : Unit => (I.length : ℝ)) α := by apply (pi_norm_le_iff_of_nonneg (div_nonneg (Real.exp_pos _).le (monomialScale_pos _ (fun _ => hlength) α).le)).mpr exact fun j => hE α j refine ⟨(E α).val, (Q α).val, ?_, ?_, hres α hα⟩ · have h := I.norm_bound_on_modulus hp α hα (Real.exp_pos _).le ((W.fourRankBasis.baseChange ℝ).equivFun (E α).val) hnorm simpa only [Real.exp_add] using h · simpa only [hdenom t ht] using hQ α
theorem exists_uniform_native_full_scaled_corrections (hs : 1 ≤ s) (hp : 0 ≤ p) (hP : 0 ≤ P) (c : Basis κ ℚ W.L) (τ : κ → ℕ) (hG : ∀ j, W.rank.filtration.associatedDegree.layer j = Submodule.span ℚ (c '' {i | j ≤ τ i})) : let B := (P + 2) ^ 3 + 2 * P ∃ (C : R.CommonData B) (l : ℕ), C.quadruples ⊆ D.quadruples ∧ C.spaces = D.spaces ∧ 0 < l ∧ (l : ℝ) ≤ Real.exp ((P + 2) ^ 3 + P) ∧ ∀ (α : Unit →₀ ℕ) (hα : Finsupp.weight (fun _ : Unit => 1) α ≤ s) (t : ZMod N × ZMod N × ZMod N), t ∈ C.quadruples → ∃ E Q : ℝ ⊗[ℚ] (Fin 4 → W.L), ‖(W.fourRankBasis.baseChange ℝ).equivFun E‖ ≤ Real.exp ((B + 3) ^ 2 + (s : ℝ) * p) / monomialScale (fun _ : Unit => (N : ℝ)) α ∧ (W.fourRankBasis.baseChange ℝ).equivFun Q ∈ realDenominatorGrid l ∧ (fun k => coefficients (W.orbit (rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k))).log α) - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) E - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) Q ∈ C.realCoefficientFourSpace ⟨Finsupp.weight (fun _ : Unit => 1) α, Nat.lt_succ_of_le hα⟩ := by intro B obtain ⟨C, l, hCD, hspaces, hl, hbound, hdenom⟩ := D.exists_common_projected_denominator hP refine ⟨C, l, hCD, hspaces, hl, hbound, ?_⟩ intro α hα t ht exact C.native_full_scaled_correction hs hp (by positivity) c τ hG l hdenom α hα t ht
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3
open Module VectorPolynomialopen scoped TensorProduct
noncomputable def sharedLogCoefficientTuple {L : Type*} [LieRing L] [LieAlgebra ℚ L] {s N : ℕ} (F : NilpotentLieFiltration L s) (ξ : F.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → F.realification.PolynomialOrbit (fun _ : Unit => 1)) (α : Unit →₀ ℕ) (t : ZMod N × ZMod N × ZMod N) : Fin 4 → ℝ ⊗[ℚ] L := fun k => coefficients ξ.log α + coefficients (v (rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k))).log α
theorem sharedLogCoefficientTuple_mem_common {L : Type*} [LieRing L] [LieAlgebra ℚ L] {s N : ℕ} (F : NilpotentLieFiltration L s) (C D : Submodule ℚ L) (hDC : D ≤ C) (ξ : F.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → F.realification.PolynomialOrbit (fun _ : Unit => 1)) (α : Unit →₀ ℕ) (t : ZMod N × ZMod N × ZMod N) (hξ : coefficients ξ.log α ∈ C.baseChange ℝ) (hv : ∀ h, coefficients (v h).log α ∈ D.baseChange ℝ) : sharedLogCoefficientTuple F ξ v α t ∈ fourCommonModulo (C.baseChange ℝ) (D.baseChange ℝ) := by apply (mem_fourCommonModulo _ _ _).mpr constructor · intro k exact (C.baseChange ℝ).add_mem hξ (Submodule.baseChange_mono ℝ hDC (hv _)) · intro k change (coefficients ξ.log α + coefficients (v _).log α) - (coefficients ξ.log α + coefficients (v _).log α) ∈ D.baseChange ℝ rw [add_sub_add_left_eq_sub] exact (D.baseChange ℝ).sub_mem (hv _) (hv _)
namespace NativeRankRelation.CommonData
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {κ : Type*} {s r N : ℕ} [NeZero N] {b p q P : ℝ} {W : NativeDegreeRankFamily s r (ZMod N) b} {out : Fin W.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W out H p q} (D : R.CommonData P)
theorem native_shared_scaled_correction (hs : 1 ≤ s) (hp : 0 ≤ p) (hP : 0 ≤ P) (c : Basis κ ℚ W.L) (τ : κ → ℕ) (hG : ∀ j, W.rank.filtration.associatedDegree.layer j = Submodule.span ℚ (c '' {i | j ≤ τ i})) (ξ : W.model.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → W.model.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (horbit : ∀ h, W.orbit h = ξ * v h) (l : ℕ) (hdenom : ∀ t (ht : t ∈ D.quadruples), (D.witness t ht).projectedDenominator = l) (α : Unit →₀ ℕ) (hα : Finsupp.weight (fun _ : Unit => 1) α ≤ s) (t : ZMod N × ZMod N × ZMod N) (ht : t ∈ D.quadruples) : ∃ E Q : ℝ ⊗[ℚ] (Fin 4 → W.L), ‖(W.fourRankBasis.baseChange ℝ).equivFun E‖ ≤ Real.exp ((P + 3) ^ 2 + (s : ℝ) * p) / monomialScale (fun _ : Unit => (N : ℝ)) α ∧ (W.fourRankBasis.baseChange ℝ).equivFun Q ∈ realDenominatorGrid l ∧ sharedLogCoefficientTuple W.model.filtration ξ v α t - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) E - (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) Q ∈ D.realCoefficientFourSpace ⟨Finsupp.weight (fun _ : Unit => 1) α, Nat.lt_succ_of_le hα⟩ := by obtain ⟨E, Q, hE, hQ, hres⟩ := D.native_full_scaled_correction hs hp hP c τ hG l hdenom α hα t ht refine ⟨E, Q, hE, hQ, ?_⟩ apply (D.realCoefficientFourSpace_congr_mod_kernel _ _ _ ?_).mp hres intro k let a := rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k) let e := (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) E k let z := (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)) Q k change (coefficients (W.orbit a).log α - e - z) - (coefficients ξ.log α + coefficients (v a).log α - e - z) ∈ _ rw [horbit a] have heq : (coefficients (ξ * v a).log α - e - z) - (coefficients ξ.log α + coefficients (v a).log α - e - z) = coefficients (ξ * v a).log α - (coefficients ξ.log α + coefficients (v a).log α) := by abel rw [heq] exact W.rank.orbit_log_mul_mod_rank_two hs c τ hG (fun _ : Unit => 1) α ξ (v a)
end NativeRankRelation.CommonDataend Erdos3
end
section
namespace Erdos3
open VectorPolynomialopen scoped TensorProduct
theorem sharedLogCoefficientTuple_annihilator_decomposition {L J : Type*} [LieRing L] [LieAlgebra ℚ L] [Fintype J] {s N : ℕ} (F : NilpotentLieFiltration L s) (C D : Submodule ℚ L) (hDC : D ≤ C) (ℓ : (Fin 4 → L) →ₗ[ℚ] (J → ℚ)) (hℓ : fourBalancedDependent D ≤ LinearMap.ker ℓ) (ξ : F.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → F.realification.PolynomialOrbit (fun _ : Unit => 1)) (α : Unit →₀ ℕ) (t : ZMod N × ZMod N × ZMod N) (hξ : coefficients ξ.log α ∈ C.baseChange ℝ) (hv : ∀ h, coefficients (v h).log α ∈ D.baseChange ℝ) : let φ := ℓ.comp (LinearMap.single ℚ (fun _ : Fin 4 => L) 0) let a := fun h => realifyCoordinateMap φ (coefficients (v h).log α) realFourCoordinateMap ℓ (sharedLogCoefficientTuple F ξ v α t) = realifyCoordinateMap (ℓ.comp (fourDiagonalMap (R := ℚ))) (coefficients ξ.log α) + (a (rankQuadrupleParameters t 1) + a (rankQuadrupleParameters t 2) - a (rankQuadrupleParameters t 0) - a (rankQuadrupleParameters t 3)) := by intro φ a have h := realFourCoordinateMap_shared_decomposition C D hDC ℓ hℓ (coefficients ξ.log α) hξ (fun k => coefficients (v (rankQuadrupleParameters t ((![1, 2, 0, 3] : Fin 4 → Fin 4) k))).log α) (fun k => hv _) change realFourCoordinateMap ℓ (sharedLogCoefficientTuple F ξ v α t) = realifyCoordinateMap (ℓ.comp (fourDiagonalMap (R := ℚ))) (coefficients ξ.log α) + realifyCoordinateMap φ (coefficients (v (rankQuadrupleParameters t 1)).log α + coefficients (v (rankQuadrupleParameters t 2)).log α - coefficients (v (rankQuadrupleParameters t 0)).log α - coefficients (v (rankQuadrupleParameters t 3)).log α) at h simpa only [map_add, map_sub] using h
end Erdos3
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomialopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P : ℝ} {W : NativeDegreeRankFamily s r (ZMod N) b} {out : Fin W.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W out H p q} (D : R.CommonData P)
theorem exists_uniform_shared_refinement (hs : 2 ≤ s) (hp : 0 ≤ p) (hP : 0 ≤ P) (hbP : b ≤ P) (hpP : p ≤ P) (U V : Fin s → Submodule ℚ W.L) (hVU : ∀ d, V d ≤ U d) (u : ∀ d, Basis (Fin (finrank ℚ (U d))) ℚ (U d)) (v : ∀ d, Basis (Fin (finrank ℚ (V d))) ℚ (V d)) (hu : ∀ d a i, rationalLogHeight (W.model.basis.repr (u d a : W.L) i) ≤ P) (hv : ∀ d a i, rationalLogHeight (W.model.basis.repr (v d a : W.L) i) ≤ P) (ξ : W.model.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (g : ZMod N → W.model.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (horbit : ∀ h, W.orbit h = ξ * g h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (U d).baseChange ℝ) (hg : ∀ h (d : Fin s), coefficients (g h).log (Finsupp.single () (d.val + 1)) ∈ (V d).baseChange ℝ) (hN : Real.exp (separationBudget (8 * sharedRefinementInputBudget s P + 1)) ≤ (N : ℝ)) : let B := (P + 2) ^ 3 + 2 * P let z := 8 * sharedRefinementInputBudget s P + 1 ∃ D₁ : R.CommonData B, D₁.quadruples ⊆ D.quadruples ∧ D₁.spaces = D.spaces ∧ ∀ d : Fin s, ∃ m : ℕ, 0 < m ∧ (m : ℝ) ≤ Real.exp (z + ((z + 2) ^ 3 + (z + 2) ^ 36)) ∧ ∀ t ∈ D₁.quadruples, ∃ E Q : ℝ ⊗[ℚ] (Fin 4 → W.L), ‖(W.fourRankBasis.baseChange ℝ).equivFun E‖ ≤ (Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z)) / monomialScale (fun _ : Unit => (N : ℝ)) (Finsupp.single () (d.val + 1)) ∧ (W.fourRankBasis.baseChange ℝ).equivFun Q ∈ realDenominatorGrid m ∧ (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L)).symm (sharedLogCoefficientTuple W.model.filtration ξ g (Finsupp.single () (d.val + 1)) t) - E - Q ∈ (fourRefinedRelation (U d) (V d) (D.coefficientFourSpace ⟨d.val + 1, by omega⟩)).baseChange ℝ := by intro B z classical let A := sharedRefinementInputBudget s P obtain ⟨hB, hPB, hA, hPA, hHA, hEA, hLA⟩ := sharedRefinementInputBudget_bounds s hP have hAz : A ≤ z := by dsimp only [z, A]; linarith have hdim : (Fintype.card (Fin W.dim) : ℝ) ≤ A := by simpa only [Fintype.card_fin] using W.complexity.1.1.trans (hbP.trans hPA) let : FiniteDimensional ℚ W.L := W.model.basis.finiteDimensional_of_finite obtain ⟨c, τ, _, _, hF⟩ := W.rank.filtration.associatedDegree.exists_sorted_adapted_basis obtain ⟨D₁, l, hsub, hspaces, hl, hlbound, hdenom⟩ := D.exists_common_projected_denominator hP refine ⟨D₁, hsub, hspaces, ?_⟩ intro d let δ : Fin (s + 1) := ⟨d.val + 1, by omega⟩ let α : Unit →₀ ℕ := Finsupp.single () (d.val + 1) have hα : Finsupp.weight (fun _ : Unit => 1) α = δ.val := by simp only [α, δ, Finsupp.weight_single, smul_eq_mul, mul_one] have hαs : Finsupp.weight (fun _ : Unit => 1) α ≤ s := by rw [hα]; exact Nat.le_of_lt_succ δ.isLt have hα0 : α ≠ 0 := by simp [α] obtain ⟨k, hk⟩ := D₁.exists_coefficientFour_basis hs hB (hbP.trans hPB) δ have hlA : (l : ℝ) ≤ Real.exp A := hlbound.trans (Real.exp_le_exp.mpr hLA) obtain ⟨m, hm, hmp, _, hsolve⟩ := exists_fourRefinedRelation_correction W.model.basis (U d) (V d) (hVU d) (D₁.coefficientFourSpace δ) (u d) (v d) k hA hdim (fun a i => (hu d a i).trans hPA) (fun a i => (hv d a i).trans hPA) (fun a i => (hk a i).trans hHA) l hl hlA (fun _ : Unit => (N : ℝ)) (fun _ => hN) refine ⟨m, hm, hmp, ?_⟩ intro t ht obtain ⟨E₀, Q₀, hE₀, hQ₀, hres⟩ := D₁.native_shared_scaled_correction (by omega) hp hB c τ hF ξ g horbit l hdenom α hαs t ht have hδ : (⟨Finsupp.weight (fun _ : Unit => 1) α, Nat.lt_succ_of_le hαs⟩ : Fin (s + 1)) = δ := Fin.ext hα rw [hδ] at hres let e4 := TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => W.L) let β := sharedLogCoefficientTuple W.model.filtration ξ g α t let x := e4.symm β have hxK : x - E₀ - Q₀ ∈ (D₁.coefficientFourSpace δ).baseChange ℝ := by change β - e4 E₀ - e4 Q₀ ∈ ((D₁.coefficientFourSpace δ).baseChange ℝ).map e4.toLinearMap at hres have h := (Submodule.mem_map_equiv _).mp hres change e4.symm (β - e4 E₀ - e4 Q₀) ∈ _ at h rw [map_sub, map_sub, e4.symm_apply_apply, e4.symm_apply_apply] at h exact h have hxS : x ∈ (fourCommonModulo (U d) (V d)).baseChange ℝ := by have h := sharedLogCoefficientTuple_mem_common W.model.filtration (U d) (V d) (hVU d) ξ g α t (hξ d) (fun h => hg h d) rw [← realification_fourCommonModulo] at h exact (Submodule.mem_map_equiv _).mp h have herror : (B + 3) ^ 2 + (s : ℝ) * p ≤ z := by have hmul := mul_le_mul_of_nonneg_left hpP (Nat.cast_nonneg s : (0 : ℝ) ≤ s) exact (add_le_add_right hmul _).trans (hEA.trans hAz) have hEbound : ‖(W.fourRankBasis.baseChange ℝ).equivFun E₀‖ ≤ Real.exp z / monomialScale (fun _ : Unit => (N : ℝ)) α := by apply hE₀.trans apply div_le_div_of_nonneg_right (Real.exp_le_exp.mpr herror) exact (monomialScale_pos _ (fun _ => by exact_mod_cast NeZero.pos N) α).le obtain ⟨E, Q, hE, hQ, hmem⟩ := hsolve α hα0 x E₀ Q₀ hxK hxS hEbound hQ₀ have hK : D₁.coefficientFourSpace δ = D.coefficientFourSpace δ := by rw [D₁.coefficientFourSpace_eq_sup, D.coefficientFourSpace_eq_sup, hspaces] rw [hK] at hmem exact ⟨E, Q, hE, hQ, hmem⟩
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Moduleopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_correlation_refined_basis (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (d : Fin s) : ∃ a : Basis (Fin (finrank ℚ (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)))) ℚ (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)), ∀ j i, rationalLogHeight ((Pi.basis (fun _ : Fin 4 => E.basis)).repr (a j : Fin 4 → D.CoefficientFreeLieAlgebra) i) ≤ fourRefinementBasisBudget (Q + coefficientFourHeightBudget P') := by obtain ⟨c, hc⟩ := D.exists_coefficientFreeSpan_basis E.basis F (by omega) d obtain ⟨b, hb⟩ := D.exists_dependentFreeSpan_basis E.basis F (by omega) d obtain ⟨k, hk⟩ := D'.exists_coefficientFour_basis hs hP' hQP' ⟨d.val + 1, by omega⟩ have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 have hB := coefficientFourHeightBudget_nonneg hP' have hQA : Q ≤ Q + coefficientFourHeightBudget P' := le_add_of_nonneg_right hB have hBA : coefficientFourHeightBudget P' ≤ Q + coefficientFourHeightBudget P' := le_add_of_nonneg_left hQ apply exists_fourRefinedRelation_basis_logHeight E.basis _ _ (D.dependentFreeSpan_le_coefficientFreeSpan d) _ c b k (add_nonneg hQ hB) (by simpa only [Fintype.card_fin] using hT.1.1.trans hQA) (fun a i => (hc a i).trans hQA) (fun a i => (hb a i).trans hQA) exact fun a i => (hk a i).trans hBA
theorem exists_correlation_refined_annihilator (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (d : Fin s) : ∃ m : ℕ, m ≤ 4 * finrank ℚ D.CoefficientFreeLieAlgebra ∧ ∃ ℓ : (Fin 4 → D.CoefficientFreeLieAlgebra) →ₗ[ℚ] (Fin m → ℚ), Function.Surjective ℓ ∧ LinearMap.ker ℓ = fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩) ∧ (∀ k i j, rationalLogHeight (ℓ (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) k (E.basis i)) j) ≤ fourRefinementAnnihilatorBudget (Q + coefficientFourHeightBudget P')) ∧ (∀ x ∈ D.dependentFreeSpan d, ℓ (fourDiagonalMap (R := ℚ) x) = 0) ∧ (∀ z ∈ fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩), ℓ (fourDiagonalMap (R := ℚ) (z 0)) + ℓ (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) 0 (z 0 + z 1 - z 2 - z 3)) = 0) ∧ fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)) = D.dependentFreeSpan d ⊓ LinearMap.ker (ℓ.comp (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) 0)) := by obtain ⟨c, hc⟩ := D.exists_coefficientFreeSpan_basis E.basis F (by omega) d obtain ⟨b, hb⟩ := D.exists_dependentFreeSpan_basis E.basis F (by omega) d obtain ⟨k, hk⟩ := D'.exists_coefficientFour_basis hs hP' hQP' ⟨d.val + 1, by omega⟩ have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 have hB := coefficientFourHeightBudget_nonneg hP' have hQA : Q ≤ Q + coefficientFourHeightBudget P' := le_add_of_nonneg_right hB have hBA : coefficientFourHeightBudget P' ≤ Q + coefficientFourHeightBudget P' := le_add_of_nonneg_left hQ simpa only [Fintype.card_fin] using exists_fourRefinedRelation_annihilator E.basis _ _ (D.dependentFreeSpan_le_coefficientFreeSpan d) _ c b k (add_nonneg hQ hB) (by simpa only [Fintype.card_fin] using hT.1.1.trans hQA) (fun a i => (hc a i).trans hQA) (fun a i => (hb a i).trans hQA) (fun a i => (hk a i).trans hBA)
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Module VectorPolynomialopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_controlled_shared_free_refinement (hs : 2 ≤ s) (hp' : 0 ≤ p') (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hpp' : p' ≤ P') (ξ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hsplit : ∀ h, g h = ξ * v h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.commonFreeSpan d).baseChange ℝ) (hv : ∀ h (d : Fin s), coefficients (v h).log (Finsupp.single () (d.val + 1)) ∈ (D.dependentFreeSpan d).baseChange ℝ) (hN : Real.exp (separationBudget (8 * sharedRefinementInputBudget s P' + 1)) ≤ (N : ℝ)) : let B := (P' + 2) ^ 3 + 2 * P' let z := 8 * sharedRefinementInputBudget s P' + 1 ∃ D₁ : R'.CommonData B, D₁.quadruples ⊆ D'.quadruples ∧ D₁.spaces = D'.spaces ∧ ∀ d : Fin s, ∃ m : ℕ, 0 < m ∧ (m : ℝ) ≤ Real.exp (z + ((z + 2) ^ 3 + (z + 2) ^ 36)) ∧ ∀ t ∈ D₁.quadruples, ∃ A S : ℝ ⊗[ℚ] (Fin 4 → D.CoefficientFreeLieAlgebra), ‖((Pi.basis (fun _ : Fin 4 => E.basis)).baseChange ℝ).equivFun A‖ ≤ (Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z)) / monomialScale (fun _ : Unit => (N : ℝ)) (Finsupp.single () (d.val + 1)) ∧ ((Pi.basis (fun _ : Fin 4 => E.basis)).baseChange ℝ).equivFun S ∈ realDenominatorGrid m ∧ (TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra)).symm (sharedLogCoefficientTuple E.filtration ξ v (Finsupp.single () (d.val + 1)) t) - A - S ∈ (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)).baseChange ℝ := by have hC := fun d : Fin s => D.exists_coefficientFreeSpan_basis E.basis F (by omega) d have hD := fun d : Fin s => D.exists_dependentFreeSpan_basis E.basis F (by omega) d choose c hc using hC choose a ha using hD exact D'.exists_uniform_shared_refinement hs hp' hP' hQP' hpp' D.coefficientFreeSpan D.dependentFreeSpan D.dependentFreeSpan_le_coefficientFreeSpan c a (fun d j i => (hc d j i).trans hQP') (fun d j i => (ha d j i).trans hQP') ξ v hsplit (fun d => Submodule.baseChange_mono ℝ (D.commonFreeSpan_le_coefficientFreeSpan d) (hξ d)) hv hN
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3.NativeRankRelation.CommonData
open Moduleopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_real_correlation_refined_equations (hs : 2 ≤ s) (hP' : 0 ≤ P') (hQP' : Q ≤ P') (d : Fin s) : ∃ m : ℕ, m ≤ 4 * finrank ℚ D.CoefficientFreeLieAlgebra ∧ ∃ ℓ : (Fin 4 → D.CoefficientFreeLieAlgebra) →ₗ[ℚ] (Fin m → ℚ), Function.Surjective ℓ ∧ LinearMap.ker ℓ = fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩) ∧ (∀ k i j, rationalLogHeight (ℓ (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) k (E.basis i)) j) ≤ fourRefinementAnnihilatorBudget (Q + coefficientFourHeightBudget P')) ∧ (∀ v : Fin 4 → ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra, v ∈ fourRefinedRelation ((D.coefficientFreeSpan d).baseChange ℝ) ((D.dependentFreeSpan d).baseChange ℝ) (D'.realCoefficientFourSpace ⟨d.val + 1, by omega⟩) ↔ ∀ j, realifyFunctional ((LinearMap.proj j).comp ℓ) ((TensorProduct.piRight ℚ ℝ ℝ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra)).symm v) = 0) ∧ (∀ v : ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra, v ∈ fourPetalSpace ((D.dependentFreeSpan d).baseChange ℝ) (fourRefinedRelation ((D.coefficientFreeSpan d).baseChange ℝ) ((D.dependentFreeSpan d).baseChange ℝ) (D'.realCoefficientFourSpace ⟨d.val + 1, by omega⟩)) ↔ v ∈ (D.dependentFreeSpan d).baseChange ℝ ∧ ∀ j, realifyFunctional (((LinearMap.proj j).comp ℓ).comp (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) 0)) v = 0) := by obtain ⟨m, hm, ℓ, hsurj, hker, hheight, _, _, _⟩ := D.exists_correlation_refined_annihilator E T hbQ hT F V g hg D' hs hP' hQP' d have hspace := realification_fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩) change _ = fourRefinedRelation ((D.coefficientFreeSpan d).baseChange ℝ) ((D.dependentFreeSpan d).baseChange ℝ) (D'.realCoefficientFourSpace ⟨d.val + 1, by omega⟩) at hspace refine ⟨m, hm, ℓ, hsurj, hker, hheight, ?_, ?_⟩ · intro v rw [← hspace] exact mem_real_four_annihilator_iff _ ℓ hker v · intro v have hpetal := realification_fourPetalSpace (D.dependentFreeSpan d) (fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩)) rw [hspace] at hpetal rw [← hpetal] exact mem_real_petal_annihilator_iff _ _ ℓ hker v
end Erdos3.NativeRankRelation.CommonData
end
section
namespace Erdos3
noncomputable def sharedFreeEquationInputBudget (s : ℕ) (q p : ℝ) : ℝ := let z := 8 * sharedRefinementInputBudget s p + 1 4 * p + (fourRefinementAnnihilatorBudget (q + coefficientFourHeightBudget p) + 1) + (z + ((z + 2) ^ 3 + (z + 2) ^ 36))
theorem sharedFreeEquationInputBudget_bounds (s : ℕ) {q p : ℝ} (hq : 0 ≤ q) (hp : 0 ≤ p) : let z := 8 * sharedRefinementInputBudget s p + 1 let a := fourRefinementAnnihilatorBudget (q + coefficientFourHeightBudget p) let A := sharedFreeEquationInputBudget s q p 0 ≤ A ∧ 4 * p ≤ A ∧ a + 1 ≤ A ∧ z + ((z + 2) ^ 3 + (z + 2) ^ 36) ≤ A := by intro z a A have hi := (sharedRefinementInputBudget_bounds s hp).2.2.1 have hz : 0 ≤ z := by dsimp only [z]; linarith have ha : 0 ≤ a := fourRefinementAnnihilatorBudget_nonneg (add_nonneg hq (coefficientFourHeightBudget_nonneg hp)) have hZ : 0 ≤ z + ((z + 2) ^ 3 + (z + 2) ^ 36) := by positivity have hA : A = 4 * p + (a + 1) + (z + ((z + 2) ^ 3 + (z + 2) ^ 36)) := rfl exact ⟨by linarith, by linarith, by linarith, by linarith⟩
namespace NativeRankRelation.CommonData
open Module VectorPolynomialopen scoped TensorProduct
attribute [local instance] NativeDegreeRankFamily.lie NativeDegreeRankFamily.algebra NativeDegreeRankFamily.topology NativeDegreeRankFamily.topologicalAdd NativeDegreeRankFamily.continuousSMul NativeDegreeRankFamily.hausdorff NativeIntegerExpansion.lie NativeIntegerExpansion.algebra NativeIntegerExpansion.topology NativeIntegerExpansion.topologicalAdd NativeIntegerExpansion.continuousSMul NativeIntegerExpansion.hausdorff
variable {s r N : ℕ} [NeZero N] {b p q P Q : ℝ} {f : ZMod N → ℂ} {W : NativeCorrelationStructure s r N b f} {out : Fin W.family.outputDim} {H : Finset (ZMod N)} {R : NativeRankRelation W.family out H p q} (D : R.CommonData P) (E : RationalFilteredNilmanifold D.CoefficientFreeLieAlgebra s (finrank ℚ D.CoefficientFreeLieAlgebra)) (T : E.DegreeRankStructure r) (hbQ : b ≤ Q) (hT : T.ComplexityLE Q) (F : FreeCoordinateFrame E.basis Q) [TopologicalSpace (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [IsTopologicalAddGroup (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [ContinuousSMul ℝ (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] [T2Space (ℝ ⊗[ℚ] D.CoefficientFreeLieAlgebra)] (V : E.UnitVerticalObservable (T.realSubgroup s r) (Fin W.family.outputDim) Q) (g : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hg : ∀ h, E.filtration.realification.polynomialOrbitEval (fun _ : Unit => 1) 0 (g h) = 1)
variable {out' : Fin W.family.outputDim} {H' : Finset (ZMod N)} {p' q' P' : ℝ} {R' : NativeRankRelation (W.replacementFamily E T hbQ hT V g hg) out' H' p' q'} (D' : R'.CommonData P')
include F
theorem exists_controlled_shared_free_equations (hs : 2 ≤ s) (hp' : 0 ≤ p') (hP' : 0 ≤ P') (hQP' : Q ≤ P') (hpp' : p' ≤ P') (ξ : E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (v : ZMod N → E.filtration.realification.PolynomialOrbit (fun _ : Unit => 1)) (hsplit : ∀ h, g h = ξ * v h) (hξ : ∀ d : Fin s, coefficients ξ.log (Finsupp.single () (d.val + 1)) ∈ (D.commonFreeSpan d).baseChange ℝ) (hv : ∀ h (d : Fin s), coefficients (v h).log (Finsupp.single () (d.val + 1)) ∈ (D.dependentFreeSpan d).baseChange ℝ) (hN : Real.exp (separationBudget (8 * sharedRefinementInputBudget s P' + 1)) ≤ (N : ℝ)) : let B := (P' + 2) ^ 3 + 2 * P' let z := 8 * sharedRefinementInputBudget s P' + 1 let A := sharedFreeEquationInputBudget s Q P' ∃ D₁ : R'.CommonData B, D₁.quadruples ⊆ D'.quadruples ∧ D₁.spaces = D'.spaces ∧ ∀ d : Fin s, ∃ n : ℕ, n ≤ 4 * finrank ℚ D.CoefficientFreeLieAlgebra ∧ ∃ ℓ : (Fin 4 → D.CoefficientFreeLieAlgebra) →ₗ[ℚ] (Fin n → ℚ), Function.Surjective ℓ ∧ LinearMap.ker ℓ = fourRefinedRelation (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D'.coefficientFourSpace ⟨d.val + 1, by omega⟩) ∧ (∀ k i j, rationalLogHeight (ℓ (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) k (E.basis i)) j) ≤ fourRefinementAnnihilatorBudget (Q + coefficientFourHeightBudget P')) ∧ ∃ m : ℕ, 0 < m ∧ (m : ℝ) ≤ Real.exp ((A + 2) ^ 4) ∧ let α := Finsupp.single () (d.val + 1) let φ := ℓ.comp (LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) 0) let a := fun h => realifyCoordinateMap φ (coefficients (v h).log α) let c := realifyCoordinateMap (ℓ.comp (fourDiagonalMap (R := ℚ))) (coefficients ξ.log α) ∀ t ∈ D₁.quadruples, ∃ q ∈ realDenominatorGrid m, ‖c + (a (rankQuadrupleParameters t 1) + a (rankQuadrupleParameters t 2) - a (rankQuadrupleParameters t 0) - a (rankQuadrupleParameters t 3)) - q‖ ≤ Real.exp ((A + 2) ^ 3) * ((Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z)) / monomialScale (fun _ : Unit => (N : ℝ)) α) := by intro B z A classical have hQ : 0 ≤ Q := (Nat.cast_nonneg _).trans hT.1.1 obtain ⟨hA, hdimA, hheightA, hdenomA⟩ := sharedFreeEquationInputBudget_bounds s hQ hP' obtain ⟨D₁, hsub, hspaces, hcorr⟩ := D.exists_controlled_shared_free_refinement E T hbQ hT F V g hg D' hs hp' hP' hQP' hpp' ξ v hsplit hξ hv hN refine ⟨D₁, hsub, hspaces, ?_⟩ intro d obtain ⟨n, hn, ℓ, hsurj, hker, hheight, _, _, _⟩ := D.exists_correlation_refined_annihilator E T hbQ hT F V g hg D' hs hP' hQP' d obtain ⟨l, hl, hlp, hcorr⟩ := hcorr d let e4 := Pi.basis (fun _ : Fin 4 => E.basis) let H := ⌈Real.exp (fourRefinementAnnihilatorBudget (Q + coefficientFourHeightBudget P'))⌉₊ have hheightH : ∀ j i, RationalHeightLE (ℓ (e4 i) j) H := by intro j i apply rationalHeightLE_ceil_exp have he : e4 i = LinearMap.single ℚ (fun _ : Fin 4 => D.CoefficientFreeLieAlgebra) i.1 (E.basis i.2) := by simp only [e4, Pi.basis_apply, LinearMap.single_apply] rw [he] exact hheight i.1 i.2 j have hdim : (4 : ℝ) * finrank ℚ D.CoefficientFreeLieAlgebra ≤ 4 * P' := mul_le_mul_of_nonneg_left (hT.1.1.trans hQP') (by norm_num) have hI : (Fintype.card (Σ _ : Fin 4, Fin (finrank ℚ D.CoefficientFreeLieAlgebra)) : ℝ) ≤ A := by simpa only [Fintype.card_sigma, Fintype.card_fin, Finset.sum_const, Finset.card_univ, smul_eq_mul, Nat.cast_mul, Nat.cast_ofNat] using hdim.trans hdimA have hJ : (Fintype.card (Fin n) : ℝ) ≤ A := by have hn' := (Nat.cast_le (α := ℝ)).mpr hn simp only [Nat.cast_mul, Nat.cast_ofNat] at hn' simpa only [Fintype.card_fin] using hn'.trans (hdim.trans hdimA) have hH : (H : ℝ) ≤ Real.exp A := (ceil_exp_le_exp_add_one (fourRefinementAnnihilatorBudget_nonneg (add_nonneg hQ (coefficientFourHeightBudget_nonneg hP')))).trans (Real.exp_le_exp.mpr hheightA) have hlA : (l : ℝ) ≤ Real.exp A := hlp.trans (Real.exp_le_exp.mpr hdenomA) obtain ⟨m, hm, hmA, _, hsolve⟩ := exists_real_annihilator_correction e4 ℓ hheightH hA hI hJ hH hl hlA refine ⟨n, hn, ℓ, hsurj, hker, hheight, m, hm, hmA, ?_⟩ intro α φ a c t ht obtain ⟨E₀, Q₀, hE₀, hQ₀, hmem⟩ := hcorr t ht rw [← hker] at hmem obtain ⟨q, hq, hbound⟩ := hsolve _ E₀ Q₀ _ hmem hE₀ hQ₀ refine ⟨q, hq, ?_⟩ have hbalanced : fourBalancedDependent (D.dependentFreeSpan d) ≤ LinearMap.ker ℓ := by rw [hker] exact fourBalancedDependent_le_refined _ _ _ have hdecomp := sharedLogCoefficientTuple_annihilator_decomposition E.filtration (D.coefficientFreeSpan d) (D.dependentFreeSpan d) (D.dependentFreeSpan_le_coefficientFreeSpan d) ℓ hbalanced ξ v α t (Submodule.baseChange_mono ℝ (D.commonFreeSpan_le_coefficientFreeSpan d) (hξ d)) (fun h => hv h d) change realFourCoordinateMap ℓ (sharedLogCoefficientTuple E.filtration ξ v α t) = c + (a (rankQuadrupleParameters t 1) + a (rankQuadrupleParameters t 2) - a (rankQuadrupleParameters t 0) - a (rankQuadrupleParameters t 3)) at hdecomp change ‖realFourCoordinateMap ℓ (sharedLogCoefficientTuple E.filtration ξ v α t) - q‖ ≤ _ at hbound rw [hdecomp] at hbound exact hbound
end NativeRankRelation.CommonDataend Erdos3
end
section
namespace Erdos3
theorem sharedFree_rounding_small {A z : ℝ} (hA : 0 ≤ A) (hz : 0 ≤ z) (hbudget : z + ((z + 2) ^ 3 + (z + 2) ^ 36) ≤ A) (N l d : ℕ) [NeZero N] (hd : 1 ≤ d) (hl : (l : ℝ) ≤ Real.exp ((A + 2) ^ 4)) (hN : Real.exp ((A + 2) ^ 5) ≤ (N : ℝ)) : 2 * (l : ℝ) * (Real.exp ((A + 2) ^ 3) * ((Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z)) / (N : ℝ) ^ d)) ≤ 1 := by have hzA : z ≤ A := by have h3 : 0 ≤ (z + 2) ^ 3 := by positivity have h36 : 0 ≤ (z + 2) ^ 36 := by positivity linarith have h18 : (z + 2) ^ 18 ≤ (z + 2) ^ 36 := pow_le_pow_right₀ (by linarith) (by decide) have hwA : (z + 2) ^ 3 + (z + 2) ^ 18 + z ≤ A := by linarith have hsum : Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z) ≤ 2 * Real.exp A := by linarith [Real.exp_le_exp.mpr hzA, Real.exp_le_exp.mpr hwA] have hpoly : (A + 2) ^ 4 + (A + 2) ^ 3 + A + 4 ≤ (A + 2) ^ 5 := by have hh : 0 ≤ A ^ 5 + 9 * A ^ 4 + 31 * A ^ 3 + 50 * A ^ 2 + 35 * A + 4 := by positivity nlinarith have hnum : 2 * (l : ℝ) * (Real.exp ((A + 2) ^ 3) * (Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z))) ≤ Real.exp ((A + 2) ^ 5) := by calc _ ≤ 2 * Real.exp ((A + 2) ^ 4) * (Real.exp ((A + 2) ^ 3) * (2 * Real.exp A)) := by gcongr _ = 4 * Real.exp ((A + 2) ^ 4 + (A + 2) ^ 3 + A) := by simp only [Real.exp_add] ring _ ≤ Real.exp 4 * Real.exp ((A + 2) ^ 4 + (A + 2) ^ 3 + A) := by apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le linarith [Real.add_one_le_exp (4 : ℝ)] _ = Real.exp ((A + 2) ^ 4 + (A + 2) ^ 3 + A + 4) := by rw [← Real.exp_add] congr 1 ring _ ≤ _ := Real.exp_le_exp.mpr hpoly have hN1 : (1 : ℝ) ≤ N := by exact_mod_cast NeZero.pos N have hpower : (N : ℝ) ≤ (N : ℝ) ^ d := by simpa only [pow_one] using pow_le_pow_right₀ hN1 hd have hdenpos : (0 : ℝ) < (N : ℝ) ^ d := by positivity have hquot := (div_le_one hdenpos).mpr (hnum.trans (hN.trans hpower)) simpa only [mul_div_assoc] using hquot
noncomputable def sharedFreeRecoveryThreshold (s : ℕ) (q p : ℝ) : ℝ := max (separationBudget (8 * sharedRefinementInputBudget s p + 1)) ((sharedFreeEquationInputBudget s q p + 2) ^ 5)
theorem sharedFreeRecoveryThreshold_spec (s : ℕ) {q p : ℝ} (hq : 0 ≤ q) (hp : 0 ≤ p) (N : ℕ) [NeZero N] (hN : Real.exp (sharedFreeRecoveryThreshold s q p) ≤ (N : ℝ)) : let z := 8 * sharedRefinementInputBudget s p + 1 let A := sharedFreeEquationInputBudget s q p Real.exp (separationBudget z) ≤ (N : ℝ) ∧ ∀ (l d : ℕ), 1 ≤ d → (l : ℝ) ≤ Real.exp ((A + 2) ^ 4) → 2 * (l : ℝ) * (Real.exp ((A + 2) ^ 3) * ((Real.exp z + Real.exp ((z + 2) ^ 3 + (z + 2) ^ 18 + z)) / (N : ℝ) ^ d)) ≤ 1 := by intro z A constructor · exact (Real.exp_le_exp.mpr (le_max_left _ _)).trans hN · intro l d hd hl have hb := sharedFreeEquationInputBudget_bounds s hq hp have hz : 0 ≤ z := by have h := (sharedRefinementInputBudget_bounds s hp).2.2.1 dsimp only [z] linarith exact sharedFree_rounding_small hb.1 hz hb.2.2.2 N l d hd hl ((Real.exp_le_exp.mpr (le_max_right _ _)).trans hN)
end Erdos3
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243import OAI.Combinatorics.Progressions.Geometry.SpatialNumericEnvelopeFunctoriality
namespace OAI
section
namespace Erdos3
theorem sharedWidthPreparedChoice {T : Type*} (width : T → ℝ) (Plate : ℝ) (hpositive : ∀ t, 0 < width t) (hreciprocal : ∀ t, (width t)⁻¹ ≤ Real.exp Plate) : let ξ := Real.exp (-Plate) 0 < ξ ∧ ξ⁻¹ = Real.exp Plate ∧ ∀ t, ξ ≤ width t := by refine ⟨Real.exp_pos _, ?_, ?_⟩ · simp only [Real.exp_neg, inv_inv] · intro t have h := (inv_le_inv₀ (Real.exp_pos Plate) (inv_pos.mpr (hpositive t))).2 (hreciprocal t) simpa only [Real.exp_neg, inv_inv] using h
theorem sharedWidthPreparedChoice_le_one {Plate : ℝ} (hPlate : 0 ≤ Plate) : Real.exp (-Plate) ≤ 1 := by exact Real.exp_le_one_iff.mpr (neg_nonpos.mpr hPlate)
theorem sharedWidthNormalizedTuplePreparedChoice {T G N X : Type*} [Fintype G] [Fintype N] [Fintype X] (q M : T → ℕ) (selection : ∀ t, Fin (q t) ↪ G) (p E : T → ℝ) (Plate : ℝ) (hreciprocal : ∀ t, (normalizedTupleNarrowWidth X N (selection t) (M t) (p t) (E t))⁻¹ ≤ Real.exp Plate) : let ξ := Real.exp (-Plate) 0 < ξ ∧ ξ⁻¹ = Real.exp Plate ∧ ∀ t, ξ ≤ normalizedTupleNarrowWidth X N (selection t) (M t) (p t) (E t) := by exact sharedWidthPreparedChoice (fun t => normalizedTupleNarrowWidth X N (selection t) (M t) (p t) (E t)) Plate (fun t => normalizedTupleNarrowWidth_pos X N (selection t) (M t) (p t) (E t)) hreciprocal
end Erdos3
end
end OAIlean/OAI/Combinatorics/Progressions/Estimates/SampledNativeModel.leanAdded+585
lean/OAI/Combinatorics/Progressions/Estimates/SampledSliceFixedModelPartners.leanAdded+120
lean/OAI/Combinatorics/Progressions/Estimates/SaturatedFlag.leanAdded+599
lean/OAI/Combinatorics/Progressions/Estimates/ScalarBadSublevelRamp.leanAdded+44
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeBoundaryCost.leanAdded+77
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeBoundaryVolume.leanAdded+117
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeCokernelCutoff.leanAdded+132
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeDomain.leanAdded+233
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeFaceSlab.leanAdded+363
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeRootTranslation.leanAdded+82
lean/OAI/Combinatorics/Progressions/Estimates/ScalarCubeWindowDomain.leanAdded+88
lean/OAI/Combinatorics/Progressions/Estimates/ScalarDominatedSlack.leanAdded+481
lean/OAI/Combinatorics/Progressions/Estimates/ScalarExtensionSubstitution.leanAdded+32
lean/OAI/Combinatorics/Progressions/Estimates/ScalarInitialThreshold.leanAdded+74
lean/OAI/Combinatorics/Progressions/Estimates/ScalarInputLogFactor.leanAdded+26
lean/OAI/Combinatorics/Progressions/Estimates/ScalarWindowPartitions.leanAdded+58
lean/OAI/Combinatorics/Progressions/Estimates/ScaledConditionedComparison.leanAdded+605
lean/OAI/Combinatorics/Progressions/Estimates/ScaledFloorPerturbation.leanAdded+38
lean/OAI/Combinatorics/Progressions/Estimates/ScaledJointFrozenSource.leanAdded+161
lean/OAI/Combinatorics/Progressions/Estimates/ScaledLinearResidual.leanAdded+48
lean/OAI/Combinatorics/Progressions/Estimates/ScaledSectionGram.leanAdded+73
lean/OAI/Combinatorics/Progressions/Estimates/SecondDifferenceVectorEquivalence.leanAdded+143
lean/OAI/Combinatorics/Progressions/Estimates/SecondaryMeshGeometry.leanAdded+112
lean/OAI/Combinatorics/Progressions/Estimates/SelectedChildBound.leanAdded+53
lean/OAI/Combinatorics/Progressions/Estimates/SelectedCoefficientEvaluation.leanAdded+435
lean/OAI/Combinatorics/Progressions/Estimates/SelectedImageCorrections.leanAdded+85
lean/OAI/Combinatorics/Progressions/Estimates/SelectedJointLifts.leanAdded+117
lean/OAI/Combinatorics/Progressions/Estimates/SelectedJointSiteDomination.leanAdded+91
lean/OAI/Combinatorics/Progressions/Estimates/SelectedJointWeightedReferenceComparison.leanAdded+91
lean/OAI/Combinatorics/Progressions/Estimates/SelectedOutputL1.leanAdded+107
lean/OAI/Combinatorics/Progressions/Estimates/SelectedPhysicalReferenceCap.leanAdded+75
lean/OAI/Combinatorics/Progressions/Estimates/SelectedProductEnvelope.leanAdded+34
lean/OAI/Combinatorics/Progressions/Estimates/SelectedProfileTranslationL1.leanAdded+59
lean/OAI/Combinatorics/Progressions/Estimates/SelectedSingletonSmoothTestQuadrature.leanAdded+235
lean/OAI/Combinatorics/Progressions/Estimates/SelectedSplitUnitSource.leanAdded+76
lean/OAI/Combinatorics/Progressions/Estimates/SelectedWindowIndicator.leanAdded+224
lean/OAI/Combinatorics/Progressions/Estimates/SeparatedCosetBalls.leanAdded+68
lean/OAI/Combinatorics/Progressions/Estimates/SeparatedInterpolationBound.leanAdded+104
lean/OAI/Combinatorics/Progressions/Estimates/SeparatedLabelExtension.leanAdded+86
lean/OAI/Combinatorics/Progressions/Estimates/SeparatedPositiveSum.leanAdded+48
lean/OAI/Combinatorics/Progressions/Estimates/SeparatedRealSamples.leanAdded+77
lean/OAI/Combinatorics/Progressions/Estimates/Separation.leanAdded+48
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeComparisonDescent.leanAdded+87
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeComparisonLift.leanAdded+879
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeComparisonOrbit.leanAdded+109
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeCorrelatedFactorization.leanAdded+220
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeFrozenComparison.leanAdded+423
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeLowerFactorization.leanAdded+686
lean/OAI/Combinatorics/Progressions/Estimates/SharedFreeRoundingThreshold.leanAdded+845
lean/OAI/Combinatorics/Progressions/Estimates/SharedWidthPreparedChoice.leanAdded+43