Download data/lean/OAI/NumberTheory/Jacobsthal/Analysis/TerminalForceIntegral.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.41 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Analysis/TerminalForceIntegral.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Jacobsthal/Analysis/TerminalForceIntegral.lean
-
curl -L -o TerminalForceIntegral.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Analysis/TerminalForceIntegral.lean
9.41 kB
| import OAI.NumberTheory.Jacobsthal.Estimates.ScalarTailRecurrence | |
| namespace OAI | |
| namespace Erdos970 | |
| open scoped _root_.Erdos970 | |
| section | |
| open _root_.Set _root_.MeasureTheory | |
| namespace ErdosOmissionTail | |
| open ErdosContinuousOmission ErdosContinuousBoundary ErdosOmissionBindings | |
| open NumberTheoryLean.FinitePathGeometry | |
| theorem terminalBlock_mask (S y : β) {b : β} (_hb1 : 1 β€ b) (hb2 : b β€ 2) : | |
| terminalBlock (2*y+2-S) b= | |
| β« a in Icc (1:β) b,if S/2+a β€ y then | |
| gate omissionForce .even (2*y+2-S-a) a/(max 1 a) else 0 := by | |
| have hset : Ioc (1:β) (upperCutoff .odd (2*y+2-S) b)= | |
| Ioc (1:β) b β© {a : β | S/2+a β€ y} := by | |
| ext a | |
| constructor | |
| Β· intro ha | |
| obtain β¨ha1,ha2,hab,hgateβ© := (mem_upperCutoff .odd (2*y+2-S) b a).mp ha | |
| have hh := (strong_gate_below_two ha2).mp hgate | |
| exact β¨β¨ha1,habβ©,by change S/2+a β€ y; linarithβ© | |
| Β· rintro β¨β¨ha1,habβ©,hyβ© | |
| apply (mem_upperCutoff .odd (2*y+2-S) b a).mpr | |
| refine β¨ha1,hab.trans hb2,hab,?_β© | |
| apply (strong_gate_below_two (hab.trans hb2)).mpr | |
| change S/2+a β€ y at hy | |
| linarith | |
| have hm : MeasurableSet {a : β | S/2+a β€ y} := | |
| measurableSet_le (measurable_const.add measurable_id) measurable_const | |
| change (β« a : β in 1..upperCutoff .odd (2*y+2-S) b, | |
| gate omissionForce .even (2*y+2-S-a) a/(max 1 a))=_ | |
| rw [intervalIntegral.integral_of_le (upperCutoff_bounds .odd (2*y+2-S) b).1, | |
| hset,β setIntegral_indicator hm,β integral_Icc_eq_integral_Ioc] | |
| rfl | |
| noncomputable def terminalOuterIntegrand (S : β) (p : βΓβ) : β := | |
| if S/2+p.2 β€ p.1 then | |
| 2*p.1^2*gate omissionForce .even (2*p.1+2-S-p.2) p.2/(max 1 p.2) else 0 | |
| theorem terminalOuterIntegrand_measurable (S : β) : Measurable (terminalOuterIntegrand S) := by | |
| have hc0 : Continuous (fun p : βΓβ => gate omissionForce .even p.1 p.2) := | |
| gate_continuous omissionForce_continuous .even | |
| have hp : Continuous (fun p : βΓβ => (2*p.1+2-S-p.2,p.2)) := by fun_prop | |
| have hc : Continuous (fun p : βΓβ => gate omissionForce .even (2*p.1+2-S-p.2) p.2) := hc0.comp hp | |
| exact Measurable.ite (measurableSet_le (measurable_const.add measurable_snd) measurable_fst) | |
| (((measurable_const.mul (measurable_fst.pow_const 2)).mul hc.measurable).div | |
| (measurable_const.max measurable_snd)) measurable_const | |
| theorem terminalOuterIntegrand_bound (S a : β) {y Y : β} (hy0 : 0 β€ y) (hyY : y β€ Y) : | |
| |terminalOuterIntegrand S (y,a)| β€ 2*Y^2 := by | |
| unfold terminalOuterIntegrand | |
| split_ifs | |
| Β· have hp := gate_nonnegative omissionForce_nonnegative .even (2*y+2-S-a) a | |
| have hu := gateIterate_force_le_one 1 .even (2*y+2-S-a) a | |
| change gate omissionForce .even (2*y+2-S-a) a β€ 1 at hu | |
| have hn : 0 β€ 2*y^2*gate omissionForce .even (2*y+2-S-a) a := by positivity | |
| have hm := mul_le_mul_of_nonneg_left hu (mul_nonneg (by norm_num : (0:β)β€2) (sq_nonneg y)) | |
| rw [abs_of_nonneg (div_nonneg hn (zero_le_one.trans (le_max_left _ _)))] | |
| apply (div_le_self hn (le_max_left (1:β) a)).trans | |
| nlinarith | |
| Β· simpa only [abs_zero] using mul_nonneg (by norm_num : (0:β)β€2) (sq_nonneg Y) | |
| theorem scalarTailMass_zero_outer {S b : β} (hS : 0 β€ S) (hb1 : 1 β€ b) (hb2 : b β€ 2) : | |
| scalarTailMass 0 S b= | |
| β« a : β in 1..b,(2/a)*(β« y : β in S/2+a..S/2+4, | |
| y^2*gate omissionForce .even (2*y+2-S-a) a) := by | |
| let Y : β := S/2+4 | |
| have hY : 0 β€ Y := by dsimp [Y]; linarith | |
| have hl (y : β) : scalarTailIntegrand 0 S b y=β« a in Icc (1:β) b,terminalOuterIntegrand S (y,a) := by | |
| change 2*y^2*terminalBlock (2*y+2-S) b=_ | |
| rw [terminalBlock_mask S y hb1 hb2,β integral_const_mul] | |
| apply integral_congr_ae | |
| filter_upwards with a | |
| dsimp only [terminalOuterIntegrand] | |
| split_ifs <;> ring | |
| have hs := bounded_rectangle_swap (terminalOuterIntegrand_measurable S) 0 Y 1 b (2*Y^2) | |
| (fun y hy a _ha => terminalOuterIntegrand_bound S a hy.1 hy.2) | |
| have hr (a : β) (ha : a β Icc (1:β) b) : | |
| (β« y in Icc (0:β) Y,terminalOuterIntegrand S (y,a))= | |
| (2/a)*(β« y : β in S/2+a..Y,y^2*gate omissionForce .even (2*y+2-S-a) a) := by | |
| have ha2 : a β€ 2 := ha.2.trans hb2 | |
| have hlo : 0 β€ S/2+a := by linarith [ha.1] | |
| have hhi : S/2+a β€ Y := by dsimp [Y]; linarith | |
| have hset : Icc (0:β) Y β© Ici (S/2+a)=Icc (S/2+a) Y := by | |
| ext y | |
| constructor | |
| Β· rintro β¨hy,hyloβ©; exact β¨hylo,hy.2β© | |
| Β· intro hy; exact β¨β¨hlo.trans hy.1,hy.2β©,hy.1β© | |
| have he : (fun y : β => terminalOuterIntegrand S (y,a))= | |
| (Ici (S/2+a)).indicator (fun y => (2/a)*(y^2*gate omissionForce .even (2*y+2-S-a) a)) := by | |
| funext y | |
| unfold terminalOuterIntegrand | |
| by_cases h : S/2+a β€ y | |
| Β· rw [ite_eq_left h,indicator_of_mem (show y β Ici (S/2+a) from h),max_eq_right ha.1] | |
| ring | |
| Β· rw [ite_eq_right h,indicator_of_notMem (show y β Ici (S/2+a) from h)] | |
| rw [he,setIntegral_indicator measurableSet_Ici,hset,integral_const_mul, | |
| integral_Icc_eq_integral_Ioc,β intervalIntegral.integral_of_le hhi] | |
| rw [scalarTailMass_bounded 0 S b Y hY (by dsimp [Y]; norm_num), | |
| intervalIntegral.integral_of_le hY,β integral_Icc_eq_integral_Ioc] | |
| simp_rw [hl] | |
| rw [hs,intervalIntegral.integral_of_le hb1,β integral_Icc_eq_integral_Ioc] | |
| exact setIntegral_congr_fun measurableSet_Icc hr | |
| end ErdosOmissionTail | |
| end | |
| section | |
| open _root_.Set _root_.MeasureTheory | |
| namespace ErdosOmissionTail | |
| open ErdosContinuousOmission ErdosContinuousBoundary ErdosOmissionBindings | |
| open NumberTheoryLean.FinitePathGeometry | |
| theorem evenGate_weighted_swap (S a l Y : β) (ha1 : 1 β€ a) (ha2 : a β€ 2) | |
| (hl : 0 β€ l) (hlY : l β€ Y) : | |
| (β« y : β in l..Y,y^2*gate omissionForce .even (2*y+2-S-a) a)= | |
| β« u : β in 1..a,(β« y : β in l..Y,y^2*omissionForce .odd (2*y+2-S-a-u) u)/u := by | |
| let G : βΓβ β β := fun p => p.1^2*omissionForce .odd (2*p.1+2-S-a-p.2) p.2/(max 1 p.2) | |
| have hpmap : Continuous (fun p : βΓβ => (2*p.1+2-S-a-p.2,p.2)) := by fun_prop | |
| have hc : Continuous (fun p : βΓβ => omissionForce .odd (2*p.1+2-S-a-p.2) p.2) := | |
| (omissionForce_continuous .odd).comp hpmap | |
| have hG : Continuous G := by | |
| apply ((continuous_fst.pow 2).mul hc).div (continuous_const.max continuous_snd) | |
| intro p | |
| exact ne_of_gt ((by norm_num : (0:β)<1).trans_le (le_max_left _ _)) | |
| have hbnd : β y β Icc l Y,β u β Icc (1:β) a,|G (y,u)| β€ Y^2 := by | |
| intro y hy u _hu | |
| have hy0 : 0 β€ y := hl.trans hy.1 | |
| have hp := omissionForce_nonnegative .odd (2*y+2-S-a-u) u | |
| have hu := omissionForce_le_one .odd (2*y+2-S-a-u) u | |
| have hn : 0 β€ y^2*omissionForce .odd (2*y+2-S-a-u) u := by positivity | |
| have hh := mul_le_mul_of_nonneg_left hu (sq_nonneg y) | |
| dsimp only [G] | |
| rw [abs_of_nonneg (div_nonneg hn (zero_le_one.trans (le_max_left _ _)))] | |
| apply (div_le_self hn (le_max_left (1:β) u)).trans | |
| nlinarith [hy.2] | |
| have hs := bounded_rectangle_swap hG.measurable l Y 1 a (Y^2) hbnd | |
| have hs' : (β« y : β in l..Y,β« u : β in 1..a,G (y,u))= | |
| β« u : β in 1..a,β« y : β in l..Y,G (y,u) := by | |
| simpa only [integral_Icc_eq_integral_Ioc,β intervalIntegral.integral_of_le hlY, | |
| β intervalIntegral.integral_of_le ha1] using hs | |
| have hl' : (β« y : β in l..Y,y^2*gate omissionForce .even (2*y+2-S-a) a)= | |
| β« y : β in l..Y,β« u : β in 1..a,G (y,u) := by | |
| apply intervalIntegral.integral_congr | |
| intro y _hy | |
| dsimp only | |
| rw [gate,show upperCutoff .even (2*y+2-S-a) a=a from baseCutoff_on ha1 ha2, | |
| β intervalIntegral.integral_const_mul] | |
| apply intervalIntegral.integral_congr | |
| intro u _hu | |
| dsimp only [G,Side.flip] | |
| ring | |
| rw [hl',hs'] | |
| apply intervalIntegral.integral_congr | |
| intro u hu | |
| rw [uIcc_of_le ha1] at hu | |
| dsimp only | |
| rw [β intervalIntegral.integral_div] | |
| apply intervalIntegral.integral_congr | |
| intro y _hy | |
| dsimp only [G] | |
| rw [max_eq_right hu.1] | |
| theorem scalarTailMass_zero_triple {S b : β} (hS : 0 β€ S) (hb1 : 1 β€ b) (hb2 : b β€ 2) : | |
| scalarTailMass 0 S b= | |
| β« a : β in 1..b,β« u : β in 1..a,β« c : β in 1..u, | |
| lastWindowCoefficient S a u c/(a*u*c) := by | |
| rw [scalarTailMass_zero_outer hS hb1 hb2] | |
| apply intervalIntegral.integral_congr | |
| intro a ha | |
| rw [uIcc_of_le hb1] at ha | |
| have ha2 : a β€ 2 := ha.2.trans hb2 | |
| have hl : 0 β€ S/2+a := by linarith [ha.1] | |
| have hlY : S/2+a β€ S/2+4 := by linarith | |
| dsimp only | |
| rw [evenGate_weighted_swap S a (S/2+a) (S/2+4) ha.1 ha2 hl hlY, | |
| β intervalIntegral.integral_const_mul] | |
| apply intervalIntegral.integral_congr | |
| intro u hu | |
| rw [uIcc_of_le ha.1] at hu | |
| have hu2 : u β€ 2 := hu.2.trans ha2 | |
| have hw := integrated_force_window (S+a+u) (S/2+a) (S/2+4) u 0 hl hu.1 hu2 | |
| (by linarith [hu.1]) (by linarith) | |
| simp only [sub_zero,zero_mul] at hw | |
| have hgap (y : β) : 2*y+2-S-a-u=2*y+2-(S+a+u) := by ring | |
| dsimp only | |
| simp_rw [hgap] | |
| rw [hw,β intervalIntegral.integral_div,β intervalIntegral.integral_const_mul] | |
| apply intervalIntegral.integral_congr | |
| intro c hc | |
| rw [uIcc_of_le hu.1] at hc | |
| have ha0 : a β 0 := by linarith [ha.1] | |
| have hu0 : u β 0 := by linarith [hu.1] | |
| have hc0 : c β 0 := by linarith [hc.1] | |
| dsimp only [lastWindowCoefficient] | |
| field_simp | |
| ring | |
| end ErdosOmissionTail | |
| end | |
| end Erdos970 | |
| end OAI | |