Buckets:
| import Mathlib.Analysis.Normed.Group.Bounded | |
| import Mathlib.Topology.UniformSpace.HeineCantor | |
| import OAI.NumberTheory.Jacobsthal.Paths.FlaggedHarmonicTransform | |
| import OAI.NumberTheory.Jacobsthal.Probability.SourceCompactCoupling | |
| namespace OAI | |
| namespace Erdos970 | |
| open scoped _root_.Erdos970 | |
| section | |
| namespace NumberTheoryLean.SignedCompactTransfer | |
| open _root_.Set _root_.Filter _root_.Finset _root_.MeasureTheory ProbabilityTheory | |
| open scoped ENNReal Topology | |
| open FinitePathGeometry FinitePathMeasures PrimeHistories PrimeKilledChain PrimeBinMembership | |
| open CompactTestGeometry CompactTestMeasurable CompactCouplingError SourceCompactCoupling | |
| open ActualProcessCoupling PersistentFailureFlag ContinuousKilledBins LowStateHorizon | |
| open ExponentialMesh UniformBudgetRate | |
| noncomputable def primeExpectation (F : Side β βΓβ β β) (w ell S : β) (start : Node) (N : β) : β := | |
| β n β range N,β« z,primeTest F z βpathLaw w ell S start n | |
| noncomputable def continuousExpectation (F : Side β βΓβ β β) (v ell S : β) (z : CostState) (N : β) : β := | |
| β n β range N,β« y,continuousTest v F y β((continuousChain v ell S)^n) (.inl z) | |
| variable {w ell S : β} {start : Node} | |
| variable (hw : normalizationThreshold β€ w) (hell : 1 β€ ell) (hS0 : 0 β€ S) (hS : S β€ (Real.log w)^3) | |
| (hr : 0 < start.gap) (hs : Valid start.side start.ratio) (hsS : start.ratio β€ S) | |
| include hw hell hS0 hS hr hsS in | |
| theorem actual_signed_difference (F : Side β βΓβ β β) (hF : β i,Measurable (F i)) | |
| {A : β} (hA : 0 β€ A) (hbound : β i x,|F i x| β€ A) (mesh : β) (N : β) : | |
| ENNReal.ofReal |primeExpectation F w ell S start N- | |
| continuousExpectation F (Real.log start.gap) ell S (FlaggedSourceStart.sourceCostState hs) N| β€ | |
| β n β range N,β«β» q,difference (Real.log start.gap) F q βCouplingData.sourceLaw w ell S start hs mesh n := by | |
| let ΞΌ := fun n => CouplingData.sourceLaw w ell S start hs mesh n | |
| let P := fun q : FlagState (JointState w ell S start) => primeTest F q.1.1 | |
| let Q := fun q : FlagState (JointState w ell S start) => continuousTest (Real.log start.gap) F q.1.2 | |
| have hP : Measurable P := (primeTest_measurable F).comp (measurable_fst.comp measurable_fst) | |
| have hQ : Measurable Q := (continuousTest_measurable _ F hF).comp (measurable_snd.comp measurable_fst) | |
| have hIP : β n β range N,Integrable P (ΞΌ n) := by | |
| intro n _hn | |
| let := CouplingData.source_probability hw hell hS0 hS hr hs hsS mesh n | |
| exact bounded_integrable hP (fun q => primeTest_bound hA hbound q.1.1) | |
| have hIQ : β n β range N,Integrable Q (ΞΌ n) := by | |
| intro n _hn | |
| let := CouplingData.source_probability hw hell hS0 hS hr hs hsS mesh n | |
| exact bounded_integrable hQ (fun q => continuousTest_bound hA hbound _ q.1.2) | |
| have hp : primeExpectation F w ell S start N = β n β range N,β« q,P q βΞΌ n := by | |
| apply Finset.sum_congr rfl | |
| intro n _hn | |
| rw [β CouplingData.source_prime hw hell hS0 hS hr hs hsS mesh n, | |
| integral_map (Ο:=fun q : FlagState (JointState w ell S start) => q.1.1) | |
| (measurable_fst.comp measurable_fst).aemeasurable (primeTest_measurable F).aestronglyMeasurable] | |
| have hq : continuousExpectation F (Real.log start.gap) ell S (FlaggedSourceStart.sourceCostState hs) N = | |
| β n β range N,β« q,Q q βΞΌ n := by | |
| apply Finset.sum_congr rfl | |
| intro n _hn | |
| have he := FlaggedSourceStart.sourceLaw_continuous hw hell hS0 hS hr hs hsS mesh n | |
| rw [CouplingData.sourceLaw_eq hw hell hS0 hS hr hs hsS] at he | |
| rw [β he,integral_map (Ο:=fun q : FlagState (JointState w ell S start) => q.1.2) | |
| (measurable_snd.comp measurable_fst).aemeasurable (continuousTest_measurable _ F hF).aestronglyMeasurable] | |
| rw [hp,hq] | |
| exact finite_integral_difference ΞΌ P Q N hIP hIQ | |
| theorem source_signed_compact_transfer (F : Side β βΓβ β β) | |
| (hF : β i,UniformContinuous (F i)) {K A : β} (hK : 0 β€ K) (hA : 0 β€ A) | |
| (hbound : β i x,|F i x| β€ A) (hsupport : β i : Side,β r s : β,K < r β F i (r,s)=0) | |
| (d Ξ΅ : β) (hd : 0 < d) (hΞ΅ : 0 < Ξ΅) : | |
| β wβ : β,1 < wβ β§ β w : β,wβ β€ w β β ell B : β,β start : Node,β hs : Valid start.side start.ratio, | |
| 1 β€ ell β 0 < B β 2 β€ Real.log B β Real.log B β€ d*Real.log w β | |
| 0 < start.gap β start.ratio β€ 23/10 β Consistent start β start.gap β€ (23/10:β)*B β | |
| let S := (Real.log B)^2 | |
| let N := sourceHorizon S B | |
| |primeExpectation F w ell S start N- | |
| continuousExpectation F (Real.log start.gap) ell S (FlaggedSourceStart.sourceCostState hs) N| β€ Ξ΅ := by | |
| obtain β¨ΞΊβ,hΞΊβ,hcoupleβ© := source_compact_coupling F hF hK hA hbound hsupport | |
| let ΞΊ := ΞΊβ/2 | |
| have hΞΊ : 0 < ΞΊ := by dsimp [ΞΊ]; positivity | |
| obtain β¨wP,hwP,hcoupleβ© := hcouple ΞΊ hΞΊ (by dsimp [ΞΊ]; linarith) d Ξ΅ hd hΞ΅ | |
| obtain β¨wScale,hwScaleβ© := eventually_atTop.mp | |
| (Real.tendsto_log_atTop.eventually (eventually_ge_atTop (d^2))) | |
| refine β¨max wP (max normalizationThreshold wScale),hwP.trans_le (le_max_left _ _),?_β© | |
| intro w hw ell B start hs hell hB hlogB hcomp hr h23 hcons hsize | |
| dsimp only | |
| let S := (Real.log B)^2 | |
| let N := sourceHorizon S B | |
| have hnorm : normalizationThreshold β€ w := (le_trans (le_max_left _ _) (le_max_right _ _)).trans hw | |
| have hscale := source_scale_bound | |
| (hwScale w ((le_trans (le_max_right _ _) (le_max_right _ _)).trans hw)) hlogB hcomp | |
| have hS0 : 0 β€ S := sq_nonneg _ | |
| have hS3 : 3 β€ S := by dsimp [S]; nlinarith | |
| have hsS : start.ratio β€ S := by linarith | |
| have hdiff := actual_signed_difference hnorm hell hS0 hscale.1 hr hs hsS F | |
| (fun i => (hF i).continuous.measurable) hA hbound (mesh ΞΊ w) N | |
| have hsmall := hcouple w ((le_max_left _ _).trans hw) ell B start hs hell hB hlogB hcomp hr h23 hcons hsize | |
| exact (ENNReal.ofReal_le_ofReal_iff hΞ΅.le).mp (hdiff.trans hsmall) | |
| end NumberTheoryLean.SignedCompactTransfer | |
| end | |
| section | |
| namespace NumberTheoryLean.CompactInverseTest | |
| open _root_.Set | |
| open FinitePathGeometry FinitePathMeasures PrimeHistories PrimeKilledChain | |
| open DerivativeWeights CompactTestGeometry SignedCompactTransfer InvariantInverseWeights | |
| noncomputable def lowerRatio : Side β β | .even => 198/100 | .odd => 95/100 | |
| theorem valid_lower (i : Side) (s : β) : Valid i s β lowerRatio i β€ s := by cases i <;> rfl | |
| noncomputable def safeWeight (i : Side) (s : β) : β := weight i (max (lowerRatio i) s) | |
| theorem safeWeight_pos (i : Side) (s : β) : 0 < safeWeight i s := | |
| weight_pos ((valid_lower _ _).mpr (le_max_left _ _)) | |
| theorem safeWeight_eq {i : Side} {s : β} (hs : Valid i s) : safeWeight i s = weight i s := by | |
| unfold safeWeight | |
| rw [max_eq_right ((valid_lower _ _).mp hs)] | |
| theorem safeWeight_continuous (i : Side) : Continuous (safeWeight i) := by | |
| cases i with | |
| | even => | |
| apply continuous_iff_continuousAt.mpr | |
| intro x | |
| have hx : 1 < max (198/100:β) x := lt_of_lt_of_le (by norm_num) (le_max_left _ _) | |
| exact (phiEven_continuousAt hx).comp (continuous_const.max continuous_id).continuousAt | |
| | odd => exact phiOdd_continuous.comp (continuous_const.max continuous_id) | |
| noncomputable def inverseTest (H : Side β βΓβ β β) (i : Side) (x : βΓβ) : β := | |
| x.1^2*H i x/safeWeight i x.2 | |
| theorem inverseTest_continuous {H : Side β βΓβ β β} (hH : β i,Continuous (H i)) (i : Side) : | |
| Continuous (inverseTest H i) := | |
| ((continuous_fst.pow 2).mul (hH i)).div ((safeWeight_continuous i).comp continuous_snd) | |
| (fun x => (safeWeight_pos i x.2).ne') | |
| theorem inverseTest_compact {H : Side β βΓβ β β} (hH : β i,HasCompactSupport (H i)) (i : Side) : | |
| HasCompactSupport (inverseTest H i) := by | |
| have he : inverseTest H i = (fun x : βΓβ => x.1^2/safeWeight i x.2)*(H i) := by | |
| funext x | |
| dsimp [inverseTest] | |
| ring | |
| rw [he] | |
| exact (hH i).mul_left | |
| theorem inverseTest_uniform {H : Side β βΓβ β β} | |
| (hH : β i,Continuous (H i)) (hcompact : β i,HasCompactSupport (H i)) : | |
| β i,UniformContinuous (inverseTest H i) := fun i => | |
| (inverseTest_compact hcompact i).uniformContinuous_of_continuous (inverseTest_continuous hH i) | |
| theorem inverseTest_bounded {H : Side β βΓβ β β} | |
| (hH : β i,Continuous (H i)) (hcompact : β i,HasCompactSupport (H i)) : | |
| β A : β,0 β€ A β§ β i x,|inverseTest H i x| β€ A := by | |
| obtain β¨Ae,heβ© := (inverseTest_continuous hH .even).bounded_above_of_compact_support (inverseTest_compact hcompact .even) | |
| obtain β¨Ao,hoβ© := (inverseTest_continuous hH .odd).bounded_above_of_compact_support (inverseTest_compact hcompact .odd) | |
| refine β¨max 0 (max Ae Ao),le_max_left _ _,?_β© | |
| intro i x | |
| cases i with | |
| | even => | |
| have hx : |inverseTest H .even x| β€ Ae := by simpa only [Real.norm_eq_abs] using he x | |
| exact hx.trans ((le_max_left _ _).trans (le_max_right _ _)) | |
| | odd => | |
| have hx : |inverseTest H .odd x| β€ Ao := by simpa only [Real.norm_eq_abs] using ho x | |
| exact hx.trans ((le_max_right _ _).trans (le_max_right _ _)) | |
| theorem inverseTest_gap_support {H : Side β βΓβ β β} {K : β} | |
| (hH : β i : Side,β r s : β,K < r β H i (r,s)=0) : | |
| β i : Side,β r s : β,K < r β inverseTest H i (r,s)=0 := by | |
| intro i r s hr | |
| simp [inverseTest,hH i r s hr] | |
| theorem inverseTest_eq {H : Side β βΓβ β β} {i : Side} {r s : β} (hs : Valid i s) : | |
| inverseTest H i (r,s) = r^2*H i (r,s)/weight i s := by | |
| simp only [inverseTest,safeWeight_eq hs] | |
| theorem prime_inverseTest_eq {w ell S : β} {start : Node} {H : Side β βΓβ β β} | |
| (hs : Valid start.side start.ratio) (h : History w ell S start) : | |
| primeTest (inverseTest H) (some h) = | |
| h.node.gap^2*H h.node.side (h.node.gap,h.node.ratio)/weight h.node.side h.node.ratio := | |
| inverseTest_eq (terminal_valid hs h.admissible) | |
| end NumberTheoryLean.CompactInverseTest | |
| end | |
| section | |
| namespace NumberTheoryLean.CompactNormalizationCorrection | |
| open _root_.Set _root_.Finset _root_.MeasureTheory ProbabilityTheory | |
| open scoped ENNReal | |
| open FinitePathGeometry PrimeHistories PrimeKilledChain PrimeCompactVisits | |
| open CompactTestGeometry CompactTestMeasurable SignedCompactTransfer PrimeCorrectionFactor | |
| variable {w ell S : β} {start : Node} | |
| noncomputable def correctedTest (F : Side β βΓβ β β) : ChainState w ell S start β β | |
| | none => 0 | |
| | some h => (1+epsilon w)^h.primes.length*F h.node.side (h.node.gap,h.node.ratio) | |
| noncomputable def correctedExpectation (F : Side β βΓβ β β) (w ell S : β) (start : Node) (N : β) : β := | |
| β n β range N,β« z,correctedTest F z βpathLaw w ell S start n | |
| theorem correctedTest_measurable (F : Side β βΓβ β β) : | |
| Measurable (correctedTest (w:=w) (ell:=ell) (S:=S) (start:=start) F) := measurable_of_countable _ | |
| theorem correction_difference_bound {d w ell B K A : β} {start : Node} | |
| (F : Side β βΓβ β β) (_hA : 0 β€ A) (hbound : β i x,|F i x| β€ A) | |
| (hsupport : β i : Side,β r s : β,K < r β F i (r,s)=0) | |
| (hlogB : 2 β€ Real.log B) (hcomp : Real.log B β€ d*Real.log w) (hell : 1 β€ ell) | |
| (hr : 0 < start.gap) (hs : Valid start.side start.ratio) (hB : 0 < B) (hsize : start.gap β€ (23/10:β)*B) | |
| (z : ChainState w ell ((Real.log B)^2) start) : | |
| |correctedTest F z-primeTest F z| β€ (correctionBudget d w*A)*visit K z := by | |
| cases z with | |
| | none => simp [correctedTest,primeTest,visit] | |
| | some h => | |
| have hc := history_correction hlogB hcomp hell hr hs hB hsize h | |
| by_cases hh : h.node.gap β€ K | |
| Β· have hnon : 0 β€ (1+epsilon w)^h.primes.length-1 := hc.1 | |
| change |(1+epsilon w)^h.primes.length*F h.node.side (h.node.gap,h.node.ratio)-F h.node.side (h.node.gap,h.node.ratio)| β€ _ | |
| rw [show (1+epsilon w)^h.primes.length*F h.node.side (h.node.gap,h.node.ratio)-F h.node.side (h.node.gap,h.node.ratio) = | |
| ((1+epsilon w)^h.primes.length-1)*F h.node.side (h.node.gap,h.node.ratio) by ring, | |
| abs_mul,abs_of_nonneg hnon] | |
| simp only [visit,ite_eq_left hh,mul_one] | |
| exact mul_le_mul hc.2 (hbound _ _) (abs_nonneg _) ((hnon.trans hc.2)) | |
| Β· have hf := hsupport h.node.side h.node.gap h.node.ratio (lt_of_not_ge hh) | |
| simp [correctedTest,primeTest,visit,hf,hh] | |
| theorem correctedTest_bound {d w ell B A : β} {start : Node} | |
| (F : Side β βΓβ β β) (hA : 0 β€ A) (hbound : β i x,|F i x| β€ A) | |
| (hlogB : 2 β€ Real.log B) (hcomp : Real.log B β€ d*Real.log w) (hell : 1 β€ ell) | |
| (hr : 0 < start.gap) (hs : Valid start.side start.ratio) (hB : 0 < B) (hsize : start.gap β€ (23/10:β)*B) | |
| (z : ChainState w ell ((Real.log B)^2) start) : | |
| |correctedTest F z| β€ (1+correctionBudget d w)*A := by | |
| have he := history_correction hlogB hcomp hell hr hs hB hsize (History.empty : History w ell ((Real.log B)^2) start) | |
| have hb0 : 0 β€ correctionBudget d w := by simpa only [History.empty,List.length_nil,pow_zero,sub_self] using he.2 | |
| cases z with | |
| | none => change |(0:β)| β€ _; rw [abs_zero]; positivity | |
| | some h => | |
| have hc := history_correction hlogB hcomp hell hr hs hB hsize h | |
| have hpow : 0 β€ (1+epsilon w)^h.primes.length := pow_nonneg (normalizer_pos w).le _ | |
| change |(1+epsilon w)^h.primes.length*F h.node.side (h.node.gap,h.node.ratio)| β€ _ | |
| rw [abs_mul,abs_of_nonneg hpow] | |
| exact mul_le_mul (by linarith : (1+epsilon w)^h.primes.length β€ 1+correctionBudget d w) | |
| (hbound _ _) (abs_nonneg _) (by linarith) | |
| theorem actual_compact_correction {d w ell B K A : β} {start : Node} | |
| (F : Side β βΓβ β β) (hK : 0 β€ K) (hA : 0 β€ A) (hbound : β i x,|F i x| β€ A) | |
| (hsupport : β i : Side,β r s : β,K < r β F i (r,s)=0) | |
| (hw : normalizationThreshold β€ w) (hell : 1 β€ ell) (hS : (Real.log B)^2 β€ (Real.log w)^3) | |
| (hr : 0 < start.gap) (hs : Valid start.side start.ratio) (hsS : start.ratio β€ (Real.log B)^2) | |
| (hB : 0 < B) (hsize : start.gap β€ (23/10:β)*B) | |
| (hlogB : 2 β€ Real.log B) (hcomp : Real.log B β€ d*Real.log w) (N : β) : | |
| |correctedExpectation F w ell ((Real.log B)^2) start N-primeExpectation F w ell ((Real.log B)^2) start N| β€ | |
| correctionBudget d w*A*(K+1) := by | |
| have he := history_correction hlogB hcomp hell hr hs hB hsize (History.empty : History w ell ((Real.log B)^2) start) | |
| have hb0 : 0 β€ correctionBudget d w := by simpa only [History.empty,List.length_nil,pow_zero,sub_self] using he.2 | |
| have hΞ΄0 : 0 β€ correctionBudget d w*A := mul_nonneg hb0 hA | |
| have hIC : β n β range N,Integrable (correctedTest F) (pathLaw w ell ((Real.log B)^2) start n) := by | |
| intro n _hn | |
| let := pathLaw_isProbability hw hell (sq_nonneg _) hS hr hs hsS n | |
| exact bounded_integrable (correctedTest_measurable F) (correctedTest_bound F hA hbound hlogB hcomp hell hr hs hB hsize) | |
| have hIP : β n β range N,Integrable (primeTest F) (pathLaw w ell ((Real.log B)^2) start n) := by | |
| intro n _hn | |
| let := pathLaw_isProbability hw hell (sq_nonneg _) hS hr hs hsS n | |
| exact bounded_integrable (primeTest_measurable F) (primeTest_bound hA hbound) | |
| have hdiff := finite_integral_difference (fun n => pathLaw w ell ((Real.log B)^2) start n) | |
| (correctedTest F) (primeTest F) N hIC hIP | |
| have hpoint := correction_difference_bound F hA hbound hsupport hlogB hcomp hell hr hs hB hsize | |
| have hsum : (β n β range N,β«β» z,ENNReal.ofReal |correctedTest F z-primeTest F z| βpathLaw w ell ((Real.log B)^2) start n) β€ | |
| ENNReal.ofReal (correctionBudget d w*A)*(β n β range N,β«β» z,ENNReal.ofReal (visit K z) βpathLaw w ell ((Real.log B)^2) start n) := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_le_sum | |
| intro n _hn | |
| calc | |
| _ β€ β«β» z,ENNReal.ofReal (correctionBudget d w*A)*ENNReal.ofReal (visit K z) βpathLaw w ell ((Real.log B)^2) start n := by | |
| apply lintegral_mono | |
| intro z | |
| change ENNReal.ofReal |correctedTest F z-primeTest F z| β€ ENNReal.ofReal (correctionBudget d w*A)*ENNReal.ofReal (visit K z) | |
| rw [β ENNReal.ofReal_mul hΞ΄0] | |
| exact ENNReal.ofReal_le_ofReal (hpoint z) | |
| _ = _ := lintegral_const_mul' _ _ ENNReal.ofReal_ne_top | |
| have hvisit := finite_compact_visits hw hell (sq_nonneg _) hS hr hs hsS hK N | |
| have h := hdiff.trans (hsum.trans (mul_le_mul_of_nonneg_left hvisit zero_le)) | |
| rw [β ENNReal.ofReal_mul hΞ΄0] at h | |
| exact (ENNReal.ofReal_le_ofReal_iff (by positivity : 0 β€ correctionBudget d w*A*(K+1))).mp h | |
| end NumberTheoryLean.CompactNormalizationCorrection | |
| end | |
| section | |
| namespace NumberTheoryLean.ContinuousCompactHighError | |
| open _root_.Set _root_.MeasureTheory ProbabilityTheory | |
| open scoped ENNReal | |
| open FinitePathMeasures CompactTestGeometry CompactTestMeasurable CompactInverseTest | |
| open RegeneratingInverseBands InvariantInverseWeights OriginalHarmonicOccupation | |
| open ContinuousHighPartition FlaggedHarmonicTransform FiniteAdmittedOccupation | |
| open LowStateHorizon AdmittedHarmonicPaths | |
| noncomputable def baseReward (v : β) (H : FinitePathGeometry.Side β βΓβ β β) (z : CostState) : β := | |
| H (stateSide z.1) (gapValue v z,stateRatio z.1) | |
| noncomputable def inverseReward (v : β) (H : FinitePathGeometry.Side β βΓβ β β) (z : CostState) : β := | |
| continuousTest v (inverseTest H) (.inl z) | |
| theorem baseReward_measurable (v : β) {H : FinitePathGeometry.Side β βΓβ β β} | |
| (hH : β i,Continuous (H i)) : Measurable (baseReward v H) := | |
| (continuousTest_measurable v H (fun i => (hH i).measurable)).comp measurable_inl | |
| theorem inverseReward_measurable (v : β) {H : FinitePathGeometry.Side β βΓβ β β} | |
| (hH : β i,Continuous (H i)) : Measurable (inverseReward v H) := | |
| (continuousTest_measurable v (inverseTest H) (fun i => (inverseTest_continuous hH i).measurable)).comp measurable_inl | |
| theorem inverseReward_abs (v : β) (H : FinitePathGeometry.Side β βΓβ β β) (z : CostState) : | |
| ENNReal.ofReal |inverseReward v H z| = gapSquaredWeight v z*ENNReal.ofReal |baseReward v H z| := by | |
| have hs := stateRatio_valid z.1 | |
| change ENNReal.ofReal |inverseTest H (stateSide z.1) (gapValue v z,stateRatio z.1)| = _ | |
| rw [inverseTest_eq hs,β SuccessfulRewardComparison.stateWeight_eq] | |
| unfold gapSquaredWeight baseReward | |
| rw [abs_div,abs_mul,abs_of_nonneg (sq_nonneg _),abs_of_pos (stateWeight_pos z.1), | |
| β ENNReal.ofReal_mul (div_nonneg (sq_nonneg _) (stateWeight_pos z.1).le)] | |
| congr 1 | |
| ring | |
| theorem phase_compact_bound {H : FinitePathGeometry.Side β βΓβ β β} | |
| (hH : β i,Continuous (H i)) (hcompact : β i,HasCompactSupport (H i)) : | |
| β A : β,0 β€ A β§ β i x,|H i x| β€ A := by | |
| obtain β¨Ae,heβ© := (hH .even).bounded_above_of_compact_support (hcompact .even) | |
| obtain β¨Ao,hoβ© := (hH .odd).bounded_above_of_compact_support (hcompact .odd) | |
| refine β¨max 0 (max Ae Ao),le_max_left _ _,?_β© | |
| intro i x | |
| cases i with | |
| | even => | |
| have hx : |H .even x| β€ Ae := by simpa only [Real.norm_eq_abs] using he x | |
| exact hx.trans ((le_max_left _ _).trans (le_max_right _ _)) | |
| | odd => | |
| have hx : |H .odd x| β€ Ao := by simpa only [Real.norm_eq_abs] using ho x | |
| exact hx.trans ((le_max_right _ _).trans (le_max_right _ _)) | |
| theorem compact_high_error_bound {H : FinitePathGeometry.Side β βΓβ β β} | |
| (hH : β i,Continuous (H i)) (hcompact : β i,HasCompactSupport (H i)) | |
| {K : β} (hsupport : β i : FinitePathGeometry.Side,β r s : β,K < r β H i (r,s)=0) : | |
| β A : β,0 β€ A β§ β v ell S B : β,1 β€ ell β 0 < S β 0 < B β | |
| β s : State,stateRatio s β€ S β gapValue v (s,0) β€ (23/10:β)*B β | |
| ENNReal.ofReal |(β« z,inverseReward v H z βoccupation (admittedTilted v ell) (s,0))- | |
| (β« z,inverseReward v H z βoccupation (lowKernel costKernel v ell S) (s,0))| β€ | |
| ENNReal.ofReal ((Real.exp v)^2/stateWeight s)*ENNReal.ofReal A* | |
| AdmittedHighRemoval.lowHighMass v ell S (s,0) K := by | |
| obtain β¨A,hA,hbaseβ© := phase_compact_bound hH hcompact | |
| obtain β¨D,hD,hinverseβ© := inverseTest_bounded hH hcompact | |
| refine β¨A,hA,?_β© | |
| intro v ell S B hell hS hB s hs hgap | |
| have hG : β z : CostState,|inverseReward v H z| β€ D := fun z => hinverse _ _ | |
| have herr := admitted_low_signed_error v ell S B hell hS hB s hs hgap (inverseReward_measurable v hH) hG | |
| have hbaseM : Measurable (fun z => ENNReal.ofReal |baseReward v H z|) := | |
| ENNReal.measurable_ofReal.comp (baseReward_measurable v hH).abs | |
| have hb : β z : CostState,ENNReal.ofReal |baseReward v H z| β€ ENNReal.ofReal A := | |
| fun z => ENNReal.ofReal_le_ofReal (hbase _ _) | |
| have hz : β z : CostState,K < gapValue v z β ENNReal.ofReal |baseReward v H z| = 0 := by | |
| intro z hz | |
| simp [baseReward,hsupport _ _ _ hz] | |
| have hhigh := high_inverse_compact_le v ell S s hbaseM ENNReal.ofReal_ne_top hb hz | |
| have he : (fun z : CostState => ENNReal.ofReal |inverseReward v H z|) = | |
| (fun z => gapSquaredWeight v z*ENNReal.ofReal |baseReward v H z|) := funext (inverseReward_abs v H) | |
| rw [he] at herr | |
| exact herr.trans hhigh | |
| end NumberTheoryLean.ContinuousCompactHighError | |
| end | |
| section | |
| namespace NumberTheoryLean.CorrectedCompactTransfer | |
| open _root_.Set _root_.Filter _root_.MeasureTheory ProbabilityTheory | |
| open scoped ENNReal Topology | |
| open FinitePathGeometry PrimeHistories PrimeKilledChain PrimeBinMembership | |
| open CompactTestGeometry CompactNormalizationCorrection CompactInverseTest | |
| open SignedCompactTransfer PrimeCorrectionFactor UniformBudgetRate LowStateHorizon | |
| theorem source_corrected_compact_transfer (F : Side β βΓβ β β) | |
| (hF : β i,UniformContinuous (F i)) {K A : β} (hK : 0 β€ K) (hA : 0 β€ A) | |
| (hbound : β i x,|F i x| β€ A) (hsupport : β i : Side,β r s : β,K < r β F i (r,s)=0) | |
| (d Ξ΅ : β) (hd : 0 < d) (hΞ΅ : 0 < Ξ΅) : | |
| β wβ : β,1 < wβ β§ β w : β,wβ β€ w β β ell B : β,β start : Node,β hs : Valid start.side start.ratio, | |
| 1 β€ ell β 0 < B β 2 β€ Real.log B β Real.log B β€ d*Real.log w β | |
| 0 < start.gap β start.ratio β€ 23/10 β Consistent start β start.gap β€ (23/10:β)*B β | |
| let S := (Real.log B)^2 | |
| let N := sourceHorizon S B | |
| |correctedExpectation F w ell S start N- | |
| continuousExpectation F (Real.log start.gap) ell S (FlaggedSourceStart.sourceCostState hs) N| β€ Ξ΅ := by | |
| obtain β¨wP,hwP,htransferβ© := source_signed_compact_transfer F hF hK hA hbound hsupport d (Ξ΅/2) hd (by linarith) | |
| have hlimit : Tendsto (fun w : β => correctionBudget d w*A*(K+1)) atTop (π 0) := by | |
| simpa only [zero_mul] using ((correctionBudget_tendsto_zero d).mul_const A).mul_const (K+1) | |
| have hevent := (hlimit.eventually (eventually_le_nhds (show 0 < Ξ΅/2 by linarith))).and | |
| (Real.tendsto_log_atTop.eventually (eventually_ge_atTop (d^2))) | |
| obtain β¨wAux,hwAuxβ© := eventually_atTop.mp hevent | |
| refine β¨max wP (max normalizationThreshold wAux),hwP.trans_le (le_max_left _ _),?_β© | |
| intro w hw ell B start hs hell hB hlogB hcomp hr h23 hcons hsize | |
| dsimp only | |
| let S := (Real.log B)^2 | |
| let N := sourceHorizon S B | |
| have hnorm : normalizationThreshold β€ w := (le_trans (le_max_left _ _) (le_max_right _ _)).trans hw | |
| have hwe := hwAux w ((le_trans (le_max_right _ _) (le_max_right _ _)).trans hw) | |
| have hscale := source_scale_bound hwe.2 hlogB hcomp | |
| have hS3 : 3 β€ S := by dsimp [S]; nlinarith | |
| have hsS : start.ratio β€ S := by linarith | |
| have hcorrection := actual_compact_correction F hK hA hbound hsupport hnorm hell hscale.1 | |
| hr hs hsS hB hsize hlogB hcomp N | |
| have hprime := htransfer w ((le_max_left _ _).trans hw) ell B start hs hell hB hlogB hcomp hr h23 hcons hsize | |
| have htri := abs_sub_le (correctedExpectation F w ell S start N) (primeExpectation F w ell S start N) | |
| (continuousExpectation F (Real.log start.gap) ell S (FlaggedSourceStart.sourceCostState hs) N) | |
| linarith | |
| theorem source_inverse_compact_transfer (H : Side β βΓβ β β) | |
| (hH : β i,Continuous (H i)) (hcompact : β i,HasCompactSupport (H i)) | |
| {K : β} (hK : 0 β€ K) (hsupport : β i : Side,β r s : β,K < r β H i (r,s)=0) | |
| (d Ξ΅ : β) (hd : 0 < d) (hΞ΅ : 0 < Ξ΅) : | |
| β wβ : β,1 < wβ β§ β w : β,wβ β€ w β β ell B : β,β start : Node,β hs : Valid start.side start.ratio, | |
| 1 β€ ell β 0 < B β 2 β€ Real.log B β Real.log B β€ d*Real.log w β | |
| 0 < start.gap β start.ratio β€ 23/10 β Consistent start β start.gap β€ (23/10:β)*B β | |
| let S := (Real.log B)^2 | |
| let N := sourceHorizon S B | |
| |correctedExpectation (inverseTest H) w ell S start N- | |
| continuousExpectation (inverseTest H) (Real.log start.gap) ell S (FlaggedSourceStart.sourceCostState hs) N| β€ Ξ΅ := by | |
| obtain β¨A,hA,hboundβ© := inverseTest_bounded hH hcompact | |
| exact source_corrected_compact_transfer (inverseTest H) (inverseTest_uniform hH hcompact) hK hA hbound | |
| (inverseTest_gap_support hsupport) d Ξ΅ hd hΞ΅ | |
| end NumberTheoryLean.CorrectedCompactTransfer | |
| end | |
| end Erdos970 | |
| end OAI | |
Xet Storage Details
- Size:
- 25.1 kB
- Xet hash:
- 11070655d0c1f94295b791de9608c03913219e8a7e4a60de2ae09dcd7643dba5
Β·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.