Download data/lean/OAI/NumberTheory/Jacobsthal/Paths/ExpandedHardCapture.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 14.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Paths/ExpandedHardCapture.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Jacobsthal/Paths/ExpandedHardCapture.lean
-
curl -L -o ExpandedHardCapture.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Paths/ExpandedHardCapture.lean
14.2 kB
| import OAI.NumberTheory.Jacobsthal.Probability.RegularStoppedEvent | |
| namespace OAI | |
| namespace Erdos970 | |
| open scoped _root_.Erdos970 | |
| namespace NumberTheoryLean.RegularStoppedMass | |
| open FinitePathGeometry PrimeHistories PrimeBinMembership SourceStopPredicate ActualWordSelection ActualRegularBoxes | |
| open LogarithmicBinScale LogarithmicBinEndpoints LogarithmicBinLabels LogarithmicBinPartition | |
| open ActualRegularAdmission ActualPrefixClearance RegularBadTagWords SourceMarkedStopping | |
| open StoppedTraceSets StoppedCountAdapters PriorPrimeWindow MissingWindowPrimeMass | |
| open StrongReferenceTransport StrongSourceFamilies ActualPrimeHigh ReferenceAdmission | |
| open ErdosPrimeInputs.PrimePrefixMass ErdosPrimeInputs.PrimePrefixTail | |
| open ErdosPrimeInputs.HarmonicPrimeMeasure ErdosInverseAlignment | |
| open RegularStoppedEvent | |
| attribute [local instance] Classical.propDecidable | |
| theorem uncaptured_mass_le_exceptions {w top xi Cs eta Clen B K bβ bβ : β} | |
| (hw : 1 < w) (htop : w < top) (hxi : 0 < xi) (hC : 0 β€ Clen) | |
| (hcomp : Real.log B β€ 2*Real.log w) (hmesh : 2*(xi/Real.log w) β€ 6*(2*Clen*xi)) | |
| (hbβ : 0 < bβ) (hCs : Cs < 2*bβ) (hsearch : bβ < w^((1/4:β))) | |
| (hh : xi/Real.log w β€ bβ) (hsmall : 2*Clen*xi+(206/100)*(xi/Real.log w) β€ (4/100)*bβ) | |
| (Y : β) (a : β β β) (z : Node) (hs : Valid z.side z.ratio) (hz : Consistent z) | |
| (hg : StrongState z) (hclosed : z.closed=true) (hcap : w^z.cutoff=top) (hroot : bβ/2 < z.cutoff) | |
| (Q : (Fin (binCount w top xi) β β) β Finset β) : | |
| (β ps β uncapturedRegular hw htop hxi Y Cs eta Clen B K bβ bβ a z Q,prefixWeight ps) β€ | |
| (β ps β regularBadWords (Y := Y) (Cs := Cs) (eta := eta) hw htop hxi Clen B K z Q (sourceClass a),prefixWeight ps) + | |
| (β ps β missingWindowPrefixes w 1 K bβ bβ z,prefixWeight ps) := by | |
| have hsub := uncaptured_subset_exceptions (eta := eta) (K := K) hw htop hxi hC hcomp hmesh hbβ hCs hsearch hh hsmall | |
| Y a z hs hz hg hclosed hcap hroot Q | |
| apply (Finset.sum_le_sum_of_subset_of_nonneg hsub (fun ps _ _ => prefixWeight_nonneg ps)).trans | |
| have he : | |
| (β ps β regularBadWords (Y := Y) (Cs := Cs) (eta := eta) hw htop hxi Clen B K z Q (sourceClass a) βͺ | |
| missingWindowPrefixes w 1 K bβ bβ z,prefixWeight ps) + | |
| (β ps β regularBadWords (Y := Y) (Cs := Cs) (eta := eta) hw htop hxi Clen B K z Q (sourceClass a) β© | |
| missingWindowPrefixes w 1 K bβ bβ z,prefixWeight ps) = _ := Finset.sum_union_inter | |
| have hn : 0 β€ β ps β regularBadWords (Y := Y) (Cs := Cs) (eta := eta) hw htop hxi Clen B K z Q (sourceClass a) β© | |
| missingWindowPrefixes w 1 K bβ bβ z,prefixWeight ps := Finset.sum_nonneg (fun ps _ => prefixWeight_nonneg ps) | |
| linarith | |
| end NumberTheoryLean.RegularStoppedMass | |
| namespace NumberTheoryLean.StoppedGeometryInvariance | |
| open FinitePathGeometry StoppedCountVertex StoppedCountAdapters StoppedEvaluation StoppedTraceSets | |
| open RegularStoppedEvent SourceStopPredicate LogarithmicBinScale LogarithmicBinEndpoints LogarithmicBinLabels | |
| open LogarithmicBinPartition | |
| open PrimeHistories | |
| attribute [local instance] Classical.propDecidable | |
| theorem traces_eq_of_geometry (w : β) (stop : List β β Prop) (n : β) (v v' : Vertex) | |
| (hn : v.node=v'.node) (hp : v.past=v'.past) (ha : v.available=v'.available) : | |
| traces w stop n v=traces w stop n v' := by | |
| induction n generalizing v v' with | |
| | zero => | |
| simp only [traces] | |
| apply ite_cond_congr | |
| simp only [lowerStop,hn,hp] | |
| | succ n ih => | |
| have hstop : lowerStop stop v β lowerStop stop v' := by simp only [lowerStop,hn,hp] | |
| have hinc : includedPrimes w v=includedPrimes w v' := by simp only [includedPrimes,hn,ha] | |
| have hchild : β p,traces w stop n (child w v p)=traces w stop n (child w v' p) := by | |
| intro p | |
| exact ih (child w v p) (child w v' p) (by simp only [child,hn]) | |
| (by simp only [child,hp]) (by simp only [child,ha]) | |
| simp only [traces,hstop,hinc,hchild] | |
| theorem root_stopped_independent (w : β) (stop : List β β Prop) (n : β) (z : Node) | |
| (P H H' : Finset β) (mu mu' : β) : | |
| stopped w stop n (rootVertex z H P mu)=stopped w stop n (rootVertex z H' P mu') := | |
| congrArg Prod.snd (traces_eq_of_geometry w stop n _ _ rfl rfl rfl) | |
| theorem hasSourceStop_iff_original_root {w top xi : β} | |
| (hw : 1 < w) (htop : w < top) (hxi : 0 < xi) | |
| (Y : β) (Cs eta Clen B bβ bβ : β) (a : β β β) (z : Node) (ps : List β) | |
| (H : Finset β) (mu : β) : | |
| hasSourceStop hw htop hxi Y Cs eta Clen B bβ bβ a z ps β | |
| β pre tail : List β,ps=pre++tail β§ pre β stopped w | |
| (stopCandidate Y w Cs eta Clen B xi bβ bβ (lower w top xi) (width w top xi) | |
| (label (zero_lt_one.trans hw) htop hxi) a z) | |
| (sourcePrimeSet w top).card (rootVertex z H (sourcePrimeSet w top) mu) := by | |
| unfold hasSourceStop | |
| rw [root_stopped_independent w _ _ z (sourcePrimeSet w top) β H 1 mu] | |
| end NumberTheoryLean.StoppedGeometryInvariance | |
| namespace NumberTheoryLean.ExpandedNoStop | |
| open StoppedCountVertex StoppedEvaluation StoppedVertexHistory StoppedTraceSets FirstStopSemantics | |
| open FinitePathGeometry StoppedCountAdapters RegularStoppedEvent StoppedGeometryInvariance | |
| open SourceStopPredicate LogarithmicBinScale LogarithmicBinEndpoints LogarithmicBinLabels LogarithmicBinPartition | |
| attribute [local instance] Classical.propDecidable | |
| theorem expanded_no_lower_stop (w : β) (stop : List β β Prop) (n : β) (v : Vertex) | |
| {ps : List β} (hp : ps β expanded w stop n v) : | |
| β pre tail : List β,ps=pre++tail β Β¬lowerStop stop (after w v pre) := by | |
| induction n generalizing v ps with | |
| | zero => | |
| unfold expanded at hp | |
| rw [traces] at hp | |
| split_ifs at hp with hs | |
| Β· exact False.elim (Finset.notMem_empty _ hp) | |
| Β· have he : ps=[] := Finset.mem_singleton.mp hp | |
| subst ps | |
| intro pre tail heq | |
| have hpre := (List.append_eq_nil_iff.mp heq.symm).1 | |
| simpa only [hpre,after] using hs | |
| | succ n ih => | |
| unfold expanded at hp | |
| rw [traces] at hp | |
| split_ifs at hp with hs | |
| Β· exact False.elim (Finset.notMem_empty _ hp) | |
| Β· rcases Finset.mem_insert.mp hp with he | hp | |
| Β· subst ps | |
| intro pre tail heq | |
| have hpre := (List.append_eq_nil_iff.mp heq.symm).1 | |
| simpa only [hpre,after] using hs | |
| Β· obtain β¨p,_hinc,hpsβ© := Finset.mem_biUnion.mp hp | |
| obtain β¨qs,hqs,rflβ© := Finset.mem_image.mp hps | |
| intro pre tail heq | |
| cases pre with | |
| | nil => exact hs | |
| | cons q pre => | |
| rw [List.cons_append] at heq | |
| obtain β¨he,htailβ© := List.cons.inj heq | |
| subst q | |
| exact ih (child w v p) hqs pre tail htail | |
| theorem expanded_no_stopped_prefix (w : β) (stop : List β β Prop) (n N : β) (v : Vertex) | |
| {ps : List β} (hp : ps β expanded w stop n v) : | |
| Β¬β pre tail : List β,ps=pre++tail β§ preβstopped w stop N v := by | |
| rintro β¨pre,tail,he,hstopβ© | |
| exact expanded_no_lower_stop w stop n v hp pre tail he (stopped_first w stop N v hstop).1 | |
| theorem expanded_no_source_stop {w top xi : β} | |
| (hw : 1 < w) (htop : w < top) (hxi : 0 < xi) | |
| (Y : β) (Cs eta Clen B bβ bβ : β) (a : β β β) (z : PrimeHistories.Node) | |
| (H : Finset β) (mu : β) (n : β) {ps : List β} | |
| (hp : psβexpanded w | |
| (stopCandidate Y w Cs eta Clen B xi bβ bβ (lower w top xi) (width w top xi) | |
| (label (zero_lt_one.trans hw) htop hxi) a z) | |
| n (rootVertex z H (sourcePrimeSet w top) mu)) : | |
| Β¬hasSourceStop hw htop hxi Y Cs eta Clen B bβ bβ a z ps := by | |
| rw [hasSourceStop_iff_original_root hw htop hxi Y Cs eta Clen B bβ bβ a z ps H mu] | |
| exact expanded_no_stopped_prefix w _ n _ _ hp | |
| end NumberTheoryLean.ExpandedNoStop | |
| namespace NumberTheoryLean.PaperRegularStopping | |
| open _root_.Filter FinitePathGeometry PrimeHistories PrimeBinMembership SourceStopPredicate SourceNodeCoordinates | |
| open JacobsthalSourceScale PaperMissingPrimeWindow ActualRegularBoxes ActualPrefixClearance | |
| open RegularStoppedEvent RegularStoppedMass PaperRegularTagCapture MovingStopMargins | |
| open ActualBinOwners StrongReferenceTransport LogarithmicBinScale | |
| attribute [local instance] Classical.propDecidable | |
| theorem paper_regular_uncaptured_mass {R Clen Cs eta xi : β} (hR : 3 β€ R) (hC : 1 β€ Clen) (hCs : 0 β€ Cs) | |
| (heta0 : 0 < eta) (heta : eta < 1/2) (hxi : 0 < xi) (hxi1 : xi β€ 1) | |
| (hDelta : 2*Clen*xi β€ 1) (H : β) (epsilon : β) (hepsilon : 0 < epsilon) : | |
| β rho : β,10 < rho β§ β K : β,0 < K β | |
| βαΆ top : β in atTop,β hw : 1 < sourceW (Real.log top),β htop : sourceW (Real.log top) < top, | |
| β Y : β,Y β€ βtop^2/(Real.log top)^2ββ β β (z : Node) (a : β β β), | |
| z.side=.even β 199/100 β€ z.ratio β z.ratio β€ 23/10 β Consistent z β z.cutoff=sourceB (Real.log top) β z.closed=true β | |
| β Q : (Fin (binCount (sourceW (Real.log top)) top xi) β β) β Finset β, | |
| (β mult β regularBoxes hw htop hxi Clen (sourceB (Real.log top)) R z,(Q mult).card β€ H) β | |
| (β mult β regularBoxes hw htop hxi Clen (sourceB (Real.log top)) R z, | |
| β q β Q mult,eligible Y (sourceW (Real.log top)) Cs q) β | |
| (sourceB (Real.log top))^2 * | |
| (β ps β uncapturedRegular hw htop hxi Y Cs eta Clen (sourceB (Real.log top)) R | |
| (K*(Real.log (sourceW (Real.log top)))^2) | |
| (rho*K*(Real.log (sourceW (Real.log top)))^2) a z Q, | |
| ErdosPrimeInputs.PrimePrefixMass.prefixWeight ps) β€ epsilon := by | |
| obtain β¨rho,hrho,hKβ© := paper_missing_prime_window_mass R (epsilon/2) hR (by positivity) | |
| refine β¨rho,hrho,?_β© | |
| intro K hKpos | |
| obtain β¨Lβ,_hLβ,hmissβ© := hK K hKpos | |
| have hwT := sourceW_tendsto.comp Real.tendsto_log_atTop | |
| have hBT := sourceB_tendsto.comp Real.tendsto_log_atTop | |
| filter_upwards [paper_regular_bad_tag_mass hR hC hCs heta0 heta hxi hxi1 hDelta H (epsilon/2) (by positivity), | |
| hwT.eventually (moving_stop_margins Cs Clen xi hxi (by linarith : 0 < rho) hKpos), | |
| Real.tendsto_log_atTop.eventually source_scale_eventually, | |
| Real.tendsto_log_atTop.eventually sourceW_le_sourceB_eventually, | |
| hBT.eventually_ge_atTop 3,Real.tendsto_log_atTop.eventually_ge_atTop Lβ, | |
| eventually_gt_atTop (1:β)] with top htag hmargin hscale hWB hB3 hL htop1 | |
| obtain β¨hw,htop,htagβ© := htag | |
| obtain β¨_hw,hlog,hbβ,hCsWin,hsearch,hh,hsmall,hbelowβ© := hmargin | |
| refine β¨hw,htop,?_β© | |
| intro Y hY z a hi h199 h23 hz hcut hclosed Q hcard helig | |
| have hs := (source_node_bounds hscale.2.1 z hi h199 h23 hz hcut).1 | |
| have hg := source_strong_state hB3 z hi h199 hz hcut | |
| have hcap : (sourceW (Real.log top))^z.cutoff=top := by | |
| rw [hcut] | |
| exact (sourceW_pow_sourceB hw).trans (Real.exp_log (zero_lt_one.trans htop1)) | |
| have hroot : (rho*K*(Real.log (sourceW (Real.log top)))^2)/2 < z.cutoff := by | |
| rw [hcut] | |
| exact hbelow _ hWB | |
| have hm := uncaptured_mass_le_exceptions (eta := eta) (K := R) hw htop hxi (by linarith : 0 β€ Clen) hscale.2.2.2.2 | |
| (source_mesh_clearance_condition hlog hxi.le hC) hbβ hCsWin hsearch hh hsmall | |
| Y a z hs hz hg hclosed hcap hroot Q | |
| have htagmass := htag Y hY z (sourceClass a) hi h199 h23 hz hcut hclosed Q hcard helig | |
| have hmissmass := hmiss (Real.log top) hL 1 (by norm_num) (by norm_num) z hi h199 h23 hz hcut | |
| have hm' := mul_le_mul_of_nonneg_left hm (sq_nonneg (sourceB (Real.log top))) | |
| rw [mul_add] at hm' | |
| simp only [Function.comp_def] at hm' | |
| linarith | |
| end NumberTheoryLean.PaperRegularStopping | |
| namespace NumberTheoryLean.ExpandedHardCapture | |
| open FinitePathGeometry PrimeHistories SourceStopPredicate ActualRegularBoxes ActualWordSelection | |
| open StoppedCountAdapters StoppedTraceSets RegularStoppedEvent ExpandedNoStop | |
| open LogarithmicBinScale LogarithmicBinEndpoints LogarithmicBinLabels LogarithmicBinPartition | |
| open ErdosPrimeInputs.HarmonicPrimeMeasure ErdosPrimeInputs.PrimePrefixMass ErdosPrimeInputs.PrimePrefixTail | |
| open ErdosInverseAlignment | |
| attribute [local instance] Classical.propDecidable | |
| theorem expanded_listed_subset_uncaptured {w top xi : β} | |
| (hw : 1 < w) (htop : w < top) (hxi : 0 < xi) | |
| (Y : β) (Cs eta Clen B K bβ bβ : β) (a : β β β) (z : Node) | |
| (H : Finset β) (mu : β) (n : β) | |
| (Q : (Fin (binCount w top xi) β β) β Finset β) (F : Finset (List β)) | |
| (hexp : F β expanded w | |
| (stopCandidate Y w Cs eta Clen B xi bβ bβ (lower w top xi) (width w top xi) | |
| (label (zero_lt_one.trans hw) htop hxi) a z) | |
| n (rootVertex z H (sourcePrimeSet w top) mu)) | |
| (hreg : F β regularWords hw htop hxi Clen B K z) | |
| (halign : β psβF,β qβQ (wordMultiplicity (label (zero_lt_one.trans hw) htop hxi) ps), | |
| β pβps,Cs < primeExponent w p β aligns (sourceClass a) q p) : | |
| F β uncapturedRegular hw htop hxi Y Cs eta Clen B K bβ bβ a z Q := by | |
| intro ps hp | |
| exact Finset.mem_filter.mpr β¨hreg hp,halign ps hp, | |
| expanded_no_source_stop hw htop hxi Y Cs eta Clen B bβ bβ a z H mu n (hexp hp)β© | |
| theorem expanded_listed_mass_le {w top xi : β} | |
| (hw : 1 < w) (htop : w < top) (hxi : 0 < xi) | |
| (Y : β) (Cs eta Clen B K bβ bβ : β) (a : β β β) (z : Node) | |
| (H : Finset β) (mu : β) (n : β) | |
| (Q : (Fin (binCount w top xi) β β) β Finset β) (F : Finset (List β)) | |
| (hexp : F β expanded w | |
| (stopCandidate Y w Cs eta Clen B xi bβ bβ (lower w top xi) (width w top xi) | |
| (label (zero_lt_one.trans hw) htop hxi) a z) | |
| n (rootVertex z H (sourcePrimeSet w top) mu)) | |
| (hreg : F β regularWords hw htop hxi Clen B K z) | |
| (halign : β psβF,β qβQ (wordMultiplicity (label (zero_lt_one.trans hw) htop hxi) ps), | |
| β pβps,Cs < primeExponent w p β aligns (sourceClass a) q p) : | |
| (β psβF,prefixWeight ps) β€ | |
| β psβuncapturedRegular hw htop hxi Y Cs eta Clen B K bβ bβ a z Q,prefixWeight ps := | |
| Finset.sum_le_sum_of_subset_of_nonneg | |
| (expanded_listed_subset_uncaptured hw htop hxi Y Cs eta Clen B K bβ bβ a z H mu n Q F hexp hreg halign) | |
| (fun ps _ _ => prefixWeight_nonneg ps) | |
| end NumberTheoryLean.ExpandedHardCapture | |
| end Erdos970 | |
| end OAI | |