Download data/lean/OAI/Probability/JammingConcavity/GaussianStepRight.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 33.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/JammingConcavity/GaussianStepRight.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/JammingConcavity/GaussianStepRight.lean
-
curl -L -o GaussianStepRight.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/JammingConcavity/GaussianStepRight.lean
33.6 kB
| import Mathlib | |
| import OAI.Probability.JammingConcavity.GaussianStepSlope | |
| namespace OAI | |
| /-! Gaussian Step Right. -/ | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Set | |
| open scoped NNReal ENNReal | |
| open Set Filter | |
| open scoped Topology | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped ENNReal NNReal Topology BigOperators | |
| open MeasureTheory Filter Set | |
| open scoped ENNReal NNReal BigOperators | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal Topology | |
| open scoped NNReal ENNReal Topology | |
| open scoped NNReal Topology | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped Topology | |
| namespace MicroscopicJamming | |
| def gaussianStepRightCoefficient : List (β Γ β) β β β β | |
| | [], _ => 0 | |
| | (a,T)::rs,t => if t < T then a else gaussianStepRightCoefficient rs (t-T) | |
| lemma gaussianStepRightCoefficient_bounds {rs : List (β Γ β)} | |
| (hrs : β r β rs, 0 β€ r.1 β§ r.1 β€ 1 β§ 0 β€ r.2) (t : β) : | |
| 0 β€ gaussianStepRightCoefficient rs t β§ gaussianStepRightCoefficient rs t β€ 1 := by | |
| induction rs generalizing t with | |
| | nil => simp [gaussianStepRightCoefficient] | |
| | cons r rs ih => | |
| have hr := hrs r (by simp) | |
| have htail : β v β rs, 0 β€ v.1 β§ v.1 β€ 1 β§ 0 β€ v.2 := fun v hv => hrs v (by simp [hv]) | |
| by_cases h : t < r.2 | |
| Β· simpa [gaussianStepRightCoefficient,h] using And.intro hr.1 hr.2.1 | |
| Β· simpa [gaussianStepRightCoefficient,h] using ih htail (t-r.2) | |
| lemma gaussianStepRightCoefficient_trace (rs : List (β Γ β)) (t : β) : | |
| β Ξ΅ : β, 0 < Ξ΅ β§ β s β Ioo t (t+Ξ΅), | |
| gaussianStepCoefficient rs s=gaussianStepRightCoefficient rs t := by | |
| induction rs generalizing t with | |
| | nil => exact β¨1,by norm_num,fun _ _ => rflβ© | |
| | cons r rs ih => | |
| by_cases h : t < r.2 | |
| Β· refine β¨r.2-t,sub_pos.mpr h,?_β© | |
| intro s hs | |
| have hsT : s β€ r.2 := by linarith [hs.2] | |
| simp [gaussianStepCoefficient,gaussianStepRightCoefficient,h,hsT] | |
| Β· obtain β¨Ξ΅,hΞ΅,heβ© := ih (t-r.2) | |
| refine β¨Ξ΅,hΞ΅,?_β© | |
| intro s hs | |
| have hsT : Β¬s β€ r.2 := by linarith [hs.1,le_of_not_gt h] | |
| have hs' : s-r.2 β Ioo (t-r.2) (t-r.2+Ξ΅) := by | |
| constructor <;> linarith [hs.1,hs.2] | |
| simpa [gaussianStepCoefficient,gaussianStepRightCoefficient,h,hsT] using he (s-r.2) hs' | |
| lemma gaussianStepRightCoefficient_close {rs ss : List (β Γ β)} {Q Ξ΄ : β} | |
| (hΞ΄ : β t β Icc 0 Q, |gaussianStepCoefficient rs t-gaussianStepCoefficient ss t| β€ Ξ΄) | |
| {t : β} (ht : t β Ico 0 Q) : | |
| |gaussianStepRightCoefficient rs t-gaussianStepRightCoefficient ss t| β€ Ξ΄ := by | |
| obtain β¨r,hr,hrtraceβ© := gaussianStepRightCoefficient_trace rs t | |
| obtain β¨s,hs,hstraceβ© := gaussianStepRightCoefficient_trace ss t | |
| let Ξ΅ := min r (min s (Q-t)) | |
| have hΞ΅ : 0 < Ξ΅ := lt_min hr (lt_min hs (sub_pos.mpr ht.2)) | |
| have hΞ΅r : Ξ΅ β€ r := min_le_left _ _ | |
| have hΞ΅s : Ξ΅ β€ s := (min_le_right _ _).trans (min_le_left _ _) | |
| have hΞ΅Q : Ξ΅ β€ Q-t := (min_le_right _ _).trans (min_le_right _ _) | |
| have hr' : t+Ξ΅/2 β Ioo t (t+r) := by constructor <;> linarith | |
| have hs' : t+Ξ΅/2 β Ioo t (t+s) := by constructor <;> linarith | |
| have ht' : t+Ξ΅/2 β Icc 0 Q := by constructor <;> linarith [ht.1] | |
| have hh := hΞ΄ (t+Ξ΅/2) ht' | |
| rwa [hrtrace _ hr',hstrace _ hs'] at hh | |
| lemma gaussianStepPath_cons_ge (r : β Γ β) (rs : List (β Γ β)) | |
| (hrs : β v β rs, 0 β€ v.2) (u : β β β) {t : β} (ht : r.2 β€ t) : | |
| gaussianStepPath (r::rs) u t=gaussianStepPath rs u (t-r.2) := by | |
| rcases ht.lt_or_eq with h | h | |
| Β· exact gaussianStepPath_cons_gt r rs u h | |
| Β· rw [β h,gaussianStepPath_cons_le r rs u le_rfl,sub_self,gaussianStepPath_zero hrs u] | |
| funext x | |
| exact gaussianRowOperator_zero _ _ _ | |
| lemma gaussianStepPath_right_pde {u : β β β} {A B C ΞΊ Q : β} | |
| (hQ : 0 < Q) (hu : RowAnalyticTerminal u A B C ΞΊ Q) | |
| {rs : List (β Γ β)} (hrs : β r β rs, 0 β€ r.1 β§ r.1 β€ 1 β§ 0 β€ r.2) | |
| (hsum : gaussianStepTime rs β€ Q) {t : β} (ht : t β Ico 0 (gaussianStepTime rs)) (x : β) : | |
| HasDerivWithinAt (fun s => gaussianStepPath rs u s x) | |
| (-(1/2:β)*(deriv (deriv (gaussianStepPath rs u t)) x+ | |
| gaussianStepRightCoefficient rs t*(deriv (gaussianStepPath rs u t) x)^2)) (Ici t) t := by | |
| induction rs generalizing t with | |
| | nil => simp [gaussianStepTime] at ht | |
| | cons r rs ih => | |
| have hr := hrs r (by simp) | |
| have htail : β v β rs, 0 β€ v.1 β§ v.1 β€ 1 β§ 0 β€ v.2 := fun v hv => hrs v (by simp [hv]) | |
| have htailT : β v β rs, 0 β€ v.2 := fun v hv => (htail v hv).2.2 | |
| have htot : gaussianStepTime (r::rs)=r.2+gaussianStepTime rs := by simp [gaussianStepTime] | |
| have hR : gaussianStepTime rs β€ Q := by rw [htot] at hsum; linarith | |
| by_cases h : t < r.2 | |
| Β· have htw := gaussian_composition_twice hQ hu htail hR | |
| have hd0 := (Twice.gaussianRowOperator_calculus htw hr.1 (sub_pos.mpr h)).2.2 x | |
| have hd := hd0.comp_const_sub r.2 t | |
| have he : (fun s => gaussianStepPath (r::rs) u s x) =αΆ [π t] | |
| (fun s => gaussianRowOperator r.1 (r.2-s) (gaussianRowComposition rs u) x) := by | |
| filter_upwards [eventually_lt_nhds h] with s hs | |
| exact congrFun (gaussianStepPath_cons_le r rs u hs.le) x | |
| have hh := hd.congr_of_eventuallyEq he | |
| rw [gaussianStepPath_cons_le r rs u h.le] | |
| simpa only [gaussianStepRightCoefficient,ite_eq_left h,neg_mul] using hh.hasDerivWithinAt (s := Ici t) | |
| Β· have hge : r.2 β€ t := le_of_not_gt h | |
| have ht' : t-r.2 β Ico 0 (gaussianStepTime rs) := by | |
| rw [htot] at ht | |
| constructor <;> linarith [ht.2] | |
| have hi := ih htail hR ht' | |
| have hdsub : HasDerivWithinAt (fun s : β => s-r.2) 1 (Ici t) t := | |
| ((hasDerivAt_id t).sub_const r.2).hasDerivWithinAt | |
| have hmap : MapsTo (fun s : β => s-r.2) (Ici t) (Ici (t-r.2)) := by | |
| intro s hs | |
| exact sub_le_sub_right hs r.2 | |
| have hd := hi.scomp t hdsub hmap | |
| have he : (fun s => gaussianStepPath (r::rs) u s x) =αΆ [π[Ici t] t] | |
| (fun s => gaussianStepPath rs u (s-r.2) x) := by | |
| filter_upwards [self_mem_nhdsWithin] with s hs | |
| exact congrFun (gaussianStepPath_cons_ge r rs htailT u (hge.trans hs)) x | |
| have hh := hd.congr_of_eventuallyEq_of_mem he (show t β Ici t from by simp) | |
| rw [gaussianStepPath_cons_ge r rs htailT u hge] | |
| simpa only [Function.comp_def,one_smul,gaussianStepRightCoefficient,ite_eq_right h] using hh | |
| end MicroscopicJamming | |
| open Set Filter | |
| open scoped Topology | |
| namespace MicroscopicJamming | |
| lemma localMax_second_deriv_nonpos {f : β β β} {x : β} | |
| (hf : Differentiable β f) (hm : IsLocalMax f x) : deriv (deriv f) x β€ 0 := by | |
| by_contra hn | |
| have hp : 0 < deriv (deriv f) x := lt_of_not_ge hn | |
| have hzero : deriv f x=0 := hm.deriv_eq_zero | |
| have hsign := eventually_nhdsWithin_sign_eq_of_deriv_pos hp hzero | |
| have hright : βαΆ y in π[>] x, 0 < deriv f y := | |
| deriv_pos_right_of_sign_deriv (hsign.filter_mono nhdsWithin_le_nhds) | |
| obtain β¨r,hr,hhβ© := Metric.mem_nhdsWithin_iff.mp hright | |
| obtain β¨s,hs,hmaxβ© := Metric.eventually_nhds_iff.mp hm | |
| let y := x+min r s/2 | |
| have hry : x<y := by dsimp [y]; linarith [lt_min hr hs] | |
| have hdy : dist y x < r := by | |
| rw [Real.dist_eq,abs_of_pos (sub_pos.mpr hry)] | |
| dsimp [y]; linarith [min_le_left r s] | |
| have hsy : dist y x < s := by | |
| rw [Real.dist_eq,abs_of_pos (sub_pos.mpr hry)] | |
| dsimp [y]; linarith [min_le_right r s] | |
| have hmono : StrictMonoOn f (Icc x y) := by | |
| apply strictMonoOn_of_deriv_pos (convex_Icc _ _) hf.continuous.continuousOn | |
| intro z hz | |
| rw [interior_Icc] at hz | |
| apply hh β¨?_,hz.1β© | |
| rw [Metric.mem_ball,Real.dist_eq,abs_of_pos (sub_pos.mpr hz.1)] | |
| have hd : y-x<r := by simpa [Real.dist_eq,abs_of_pos (sub_pos.mpr hry)] using hdy | |
| linarith [hz.2] | |
| exact (not_lt_of_ge (hmax hsy)) (hmono β¨le_rfl,hry.leβ© β¨hry.le,le_rflβ© hry) | |
| lemma backward_strict_compact {Q R : β} (hQ : 0 < Q) (hR : 0 < R) | |
| {U b d : β β β β β} | |
| (hc : ContinuousOn (fun p : β Γ β => U p.1 p.2) (Icc 0 Q ΓΛ’ Icc (-R) R)) | |
| (hx : β t β Icc 0 Q, Differentiable β (U t)) | |
| (ht : β t β Ico 0 Q, β x, HasDerivWithinAt (fun s => U s x) (d t x) (Ici t) t) | |
| (hp : β t β Ico 0 Q, β x β Ioo (-R) R, | |
| 0 < d t x+(1/2:β)*deriv (deriv (U t)) x+b t x*deriv (U t) x) | |
| (hterm : β x β Icc (-R) R, U Q x β€ 0) | |
| (hleft : β t β Icc 0 Q, U t (-R) β€ 0) | |
| (hright : β t β Icc 0 Q, U t R β€ 0) : | |
| β t β Icc 0 Q, β x β Icc (-R) R, U t x β€ 0 := by | |
| have hne : (Icc 0 Q ΓΛ’ Icc (-R) R).Nonempty := | |
| β¨(0,0),β¨le_rfl,hQ.leβ©,by constructor <;> linarithβ© | |
| obtain β¨p,hpS,hmaxβ© := (isCompact_Icc.prod isCompact_Icc).exists_isMaxOn hne hc | |
| suffices h : U p.1 p.2 β€ 0 by | |
| intro t ht' x hx' | |
| exact (hmax (show (t,x) β Icc 0 Q ΓΛ’ Icc (-R) R from β¨ht',hx'β©)).trans h | |
| by_contra hn | |
| have hpos : 0 < U p.1 p.2 := lt_of_not_ge hn | |
| have htQ : p.1 < Q := lt_of_le_of_ne hpS.1.2 (by | |
| intro he | |
| have hh := hterm p.2 hpS.2 | |
| rw [β he] at hh | |
| exact (not_le_of_gt hpos) hh) | |
| have hxl : -R < p.2 := lt_of_le_of_ne hpS.2.1 (by | |
| intro he | |
| have hh := hleft p.1 hpS.1 | |
| rw [he] at hh | |
| exact (not_le_of_gt hpos) hh) | |
| have hxr : p.2 < R := lt_of_le_of_ne hpS.2.2 (by | |
| intro he | |
| have hh := hright p.1 hpS.1 | |
| rw [β he] at hh | |
| exact (not_le_of_gt hpos) hh) | |
| have hxmax : IsMaxOn (U p.1) (Icc (-R) R) p.2 := | |
| fun x hx' => hmax (show (p.1,x) β Icc 0 Q ΓΛ’ Icc (-R) R from β¨hpS.1,hx'β©) | |
| have hxlocal : IsLocalMax (U p.1) p.2 := | |
| hxmax.isLocalMax (Icc_mem_nhds hxl hxr) | |
| have hzero := hxlocal.deriv_eq_zero | |
| have hsecond := localMax_second_deriv_nonpos (hx p.1 hpS.1) hxlocal | |
| have htmax : IsMaxOn (fun t => U t p.2) (Icc p.1 Q) p.1 := | |
| fun t ht' => hmax (show (t,p.2) β Icc 0 Q ΓΛ’ Icc (-R) R from β¨β¨hpS.1.1.trans ht'.1,ht'.2β©,hpS.2β©) | |
| have htan : Q-p.1 β posTangentConeAt (Icc p.1 Q) p.1 := | |
| sub_mem_posTangentConeAt_of_segment_subset (segment_eq_Icc htQ.le βΈ Subset.rfl) | |
| have hd := (ht p.1 β¨hpS.1.1,htQβ© p.2).mono (show Icc p.1 Q β Ici p.1 from fun _ h => h.1) | |
| have hnonpos : (Q-p.1)*d p.1 p.2 β€ 0 := by | |
| simpa only [ContinuousLinearMap.smulRight_apply,ContinuousLinearMap.toSpanSingleton_apply,one_apply_eq_self,smul_eq_mul] using | |
| htmax.isLocalMaxOn.hasFDerivWithinAt_nonpos hd htan | |
| have hdt : d p.1 p.2 β€ 0 := by nlinarith [sub_pos.mpr htQ] | |
| have hstrict := hp p.1 β¨hpS.1.1,htQβ© p.2 β¨hxl,hxrβ© | |
| rw [hzero,mul_zero,add_zero] at hstrict | |
| linarith | |
| def quarticBarrier (Ξ΅ c Q t x : β) : β := | |
| Ξ΅*Real.exp (c*(Q-t))*(1+x^2)^2 | |
| lemma quarticBarrier_space (Ξ΅ c Q t x : β) : | |
| HasDerivAt (quarticBarrier Ξ΅ c Q t) | |
| (Ξ΅*Real.exp (c*(Q-t))*(4*x*(1+x^2))) x := by | |
| unfold quarticBarrier | |
| convert (((hasDerivAt_const x 1).add ((hasDerivAt_id x).pow 2)).pow 2).const_mul | |
| (Ξ΅*Real.exp (c*(Q-t))) using 1 <;> first | rfl | (simp only [Pi.add_apply,Pi.pow_apply,id_eq]; ring) | |
| lemma quarticBarrier_space2 (Ξ΅ c Q t x : β) : | |
| HasDerivAt (deriv (quarticBarrier Ξ΅ c Q t)) | |
| (Ξ΅*Real.exp (c*(Q-t))*(4+12*x^2)) x := by | |
| have he : deriv (quarticBarrier Ξ΅ c Q t)= | |
| fun y => Ξ΅*Real.exp (c*(Q-t))*(4*y*(1+y^2)) := | |
| funext fun y => (quarticBarrier_space Ξ΅ c Q t y).deriv | |
| rw [he] | |
| convert (((hasDerivAt_id x).const_mul 4).mul | |
| ((hasDerivAt_const x 1).add ((hasDerivAt_id x).pow 2))).const_mul | |
| (Ξ΅*Real.exp (c*(Q-t))) using 1 <;> first | rfl | (simp only [Pi.add_apply,Pi.pow_apply,id_eq]; ring) | |
| lemma quarticBarrier_time (Ξ΅ c Q t x : β) : | |
| HasDerivAt (fun s => quarticBarrier Ξ΅ c Q s x) | |
| (-c*quarticBarrier Ξ΅ c Q t x) t := by | |
| unfold quarticBarrier | |
| convert ((((hasDerivAt_const t Q).sub (hasDerivAt_id t)).const_mul c).exp.const_mul Ξ΅).mul_const | |
| ((1+x^2)^2) using 1 <;> first | rfl | (simp only [Pi.sub_apply,id_eq]; ring) | |
| lemma quartic_transport_neg {K b x : β} (hK : 0 β€ K) | |
| (hb : |b| β€ K*(1+|x|)) : | |
| -(8*K+8)*(1+x^2)^2+(1/2:β)*(4+12*x^2)+b*(4*x*(1+x^2)) < 0 := by | |
| have hnorm : (1+|x|)*|x| β€ 2*(1+x^2) := by | |
| nlinarith [sq_abs x,sq_nonneg (|x|-1)] | |
| have hbx : b*x β€ 2*K*(1+x^2) := calc | |
| b*x β€ |b*x| := le_abs_self _ | |
| _ = |b| * |x| := abs_mul _ _ | |
| _ β€ K*(1+|x|)*|x| := mul_le_mul_of_nonneg_right hb (abs_nonneg _) | |
| _ β€ 2*K*(1+x^2) := by nlinarith [mul_le_mul_of_nonneg_left hnorm hK] | |
| have ht := mul_le_mul_of_nonneg_left hbx (show 0 β€ 4*(1+x^2) by positivity) | |
| nlinarith [sq_nonneg x,sq_nonneg (x^2)] | |
| lemma backward_quartic_bound {Q K C : β} (hQ : 0 < Q) (hK : 0 β€ K) (hC : 0 β€ C) | |
| {U b d : β β β β β} | |
| (hc : ContinuousOn (fun p : β Γ β => U p.1 p.2) (Icc 0 Q ΓΛ’ univ)) | |
| (hx : β t β Icc 0 Q, Differentiable β (U t) β§ Differentiable β (deriv (U t))) | |
| (ht : β t β Ico 0 Q, β x, HasDerivWithinAt (fun s => U s x) (d t x) (Ici t) t) | |
| (hb : β t β Icc 0 Q, β x, |b t x| β€ K*(1+|x|)) | |
| (hg : β t β Icc 0 Q, β x, U t x β€ C*(1+x^2)) | |
| (hp : β t β Ico 0 Q, β x, | |
| 0 β€ d t x+(1/2:β)*deriv (deriv (U t)) x+b t x*deriv (U t) x) | |
| (hterm : β x, U Q x β€ 0) | |
| {Ξ΅ : β} (hΞ΅ : 0 < Ξ΅) : | |
| β t β Icc 0 Q, β x, U t x β€ quarticBarrier Ξ΅ (8*K+8) Q t x := by | |
| let c := 8*K+8 | |
| have hcpos : 0 β€ c := by dsimp [c]; positivity | |
| let V : β β β β β := fun t x => U t x-quarticBarrier Ξ΅ c Q t x | |
| let vd : β β β β β := fun t x => d t x+c*quarticBarrier Ξ΅ c Q t x | |
| have hvx (t : β) (ht' : t β Icc 0 Q) (x : β) : | |
| HasDerivAt (V t) (deriv (U t) x-Ξ΅*Real.exp (c*(Q-t))*(4*x*(1+x^2))) x := | |
| ((hx t ht').1 x).hasDerivAt.sub (quarticBarrier_space Ξ΅ c Q t x) | |
| have hvxx (t : β) (ht' : t β Icc 0 Q) (x : β) : | |
| deriv (deriv (V t)) x=deriv (deriv (U t)) x-Ξ΅*Real.exp (c*(Q-t))*(4+12*x^2) := by | |
| have he : deriv (V t)=fun y => deriv (U t) y-deriv (quarticBarrier Ξ΅ c Q t) y := by | |
| ext y | |
| rw [(hvx t ht' y).deriv,(quarticBarrier_space Ξ΅ c Q t y).deriv] | |
| rw [he] | |
| exact (((hx t ht').2 x).hasDerivAt.sub (quarticBarrier_space2 Ξ΅ c Q t x)).deriv | |
| have hvtime (t : β) (ht' : t β Ico 0 Q) (x : β) : | |
| HasDerivWithinAt (fun s => V s x) (vd t x) (Ici t) t := by | |
| convert (ht t ht' x).sub (quarticBarrier_time Ξ΅ c Q t x).hasDerivWithinAt using 1; first | rfl | (dsimp [V,vd]; ring) | |
| have hvp (t : β) (ht' : t β Ico 0 Q) (x : β) : | |
| 0 < vd t x+(1/2:β)*deriv (deriv (V t)) x+b t x*deriv (V t) x := by | |
| have htcc : t β Icc 0 Q := β¨ht'.1,ht'.2.leβ© | |
| rw [hvxx t htcc x,(hvx t htcc x).deriv] | |
| have hneg := quartic_transport_neg hK (hb t htcc x) | |
| have hneg' := mul_neg_of_pos_of_neg (mul_pos hΞ΅ (Real.exp_pos (c*(Q-t)))) hneg | |
| have hP := hp t ht' x | |
| dsimp [vd,quarticBarrier,c] at * | |
| nlinarith | |
| intro t ht' x | |
| let R := |x|+C/Ξ΅+1 | |
| have hdiv : 0 β€ C/Ξ΅ := div_nonneg hC hΞ΅.le | |
| have hR1 : 1 β€ R := by dsimp [R]; linarith [abs_nonneg x] | |
| have hR : 0 < R := by linarith | |
| have hxR : x β Icc (-R) R := by | |
| dsimp [R]; constructor <;> linarith [le_abs_self x,neg_abs_le x] | |
| have hCR : C β€ Ξ΅*(1+R^2) := by | |
| have hr : C/Ξ΅ β€ 1+R^2 := by dsimp [R] at hR1 β’; nlinarith [abs_nonneg x,sq_nonneg R] | |
| have hh := (div_le_iffβ hΞ΅).mp hr | |
| nlinarith | |
| have hB (s : β) (hs : s β Icc 0 Q) : | |
| C*(1+R^2) β€ quarticBarrier Ξ΅ c Q s R := by | |
| have he : 1 β€ Real.exp (c*(Q-s)) := | |
| Real.one_le_exp_iff.mpr (mul_nonneg hcpos (sub_nonneg.mpr hs.2)) | |
| have hh := mul_le_mul_of_nonneg_right hCR (show 0 β€ 1+R^2 by positivity) | |
| have he' := mul_le_mul_of_nonneg_right he (show 0 β€ Ξ΅*(1+R^2)^2 by positivity) | |
| dsimp [quarticBarrier] | |
| nlinarith | |
| have hVc : ContinuousOn (fun p : β Γ β => V p.1 p.2) (Icc 0 Q ΓΛ’ Icc (-R) R) := by | |
| apply (hc.mono (by intro p hp'; exact β¨hp'.1,mem_univ _β©)).sub | |
| have hh : Continuous (fun p : β Γ β => quarticBarrier Ξ΅ c Q p.1 p.2) := by | |
| unfold quarticBarrier | |
| fun_prop | |
| exact hh.continuousOn | |
| have hcomp := backward_strict_compact (b := b) hQ hR hVc | |
| (fun s hs y => (hvx s hs y).differentiableAt) hvtime (fun s hs y _ => hvp s hs y) | |
| (fun y _ => by | |
| dsimp [V] | |
| have hn : 0 β€ quarticBarrier Ξ΅ c Q Q y := by unfold quarticBarrier; positivity | |
| linarith [hterm y]) | |
| (fun s hs => by | |
| dsimp [V] | |
| have hh := hg s hs (-R) | |
| have hh' := hB s hs | |
| simp only [neg_sq] at hh | |
| have he : quarticBarrier Ξ΅ c Q s (-R)=quarticBarrier Ξ΅ c Q s R := by simp [quarticBarrier] | |
| rw [he] | |
| linarith) | |
| (fun s hs => by dsimp [V]; linarith [hg s hs R,hB s hs]) | |
| have hh := hcomp t ht' x hxR | |
| dsimp [V] at hh | |
| linarith | |
| def BackwardComparisonStatement : Prop := | |
| β (Q K C : β), 0 < Q β 0 β€ K β 0 β€ C β | |
| β (U b d : β β β β β), | |
| ContinuousOn (fun p : β Γ β => U p.1 p.2) (Icc 0 Q ΓΛ’ univ) β | |
| (β t β Icc 0 Q, Differentiable β (U t) β§ Differentiable β (deriv (U t))) β | |
| (β t β Ico 0 Q, β x, HasDerivWithinAt (fun s => U s x) (d t x) (Ici t) t) β | |
| (β t β Icc 0 Q, β x, |b t x| β€ K*(1+|x|)) β | |
| (β t β Icc 0 Q, β x, U t x β€ C*(1+x^2)) β | |
| (β t β Ico 0 Q, β x, | |
| 0 β€ d t x+(1/2:β)*deriv (deriv (U t)) x+b t x*deriv (U t) x) β | |
| (β x, U Q x β€ 0) β | |
| β t β Icc 0 Q, β x, U t x β€ 0 | |
| theorem backward_comparison : BackwardComparisonStatement := by | |
| intro Q K C hQ hK hC U b d hc hx ht hb hg hp hterm t ht' x | |
| by_contra hn | |
| have hpos : 0 < U t x := lt_of_not_ge hn | |
| let M := Real.exp ((8*K+8)*(Q-t))*(1+x^2)^2 | |
| have hM : 0 < M := by dsimp [M]; positivity | |
| let Ξ΅ := U t x/(2*M) | |
| have hΞ΅ : 0 < Ξ΅ := div_pos hpos (by positivity) | |
| have hh := backward_quartic_bound hQ hK hC hc hx ht hb hg hp hterm hΞ΅ t ht' x | |
| have he : quarticBarrier Ξ΅ (8*K+8) Q t x=U t x/2 := by | |
| dsimp only [quarticBarrier] | |
| rw [mul_assoc] | |
| change (U t x/(2*M))*M=U t x/2 | |
| field_simp | |
| rw [he] at hh | |
| linarith | |
| end MicroscopicJamming | |
| open Set Filter | |
| open scoped Topology | |
| namespace MicroscopicJamming | |
| def quadraticSourceBarrier (D c Q t x : β) : β := | |
| D*(Q-t)*Real.exp (c*(Q-t))*(1+x^2) | |
| lemma quadraticSourceBarrier_space (D c Q t x : β) : | |
| HasDerivAt (quadraticSourceBarrier D c Q t) | |
| (D*(Q-t)*Real.exp (c*(Q-t))*(2*x)) x := by | |
| unfold quadraticSourceBarrier | |
| convert ((hasDerivAt_const x 1).add ((hasDerivAt_id x).pow 2)).const_mul | |
| (D*(Q-t)*Real.exp (c*(Q-t))) using 1 <;> | |
| first | rfl | (simp only [id_eq]; ring) | |
| lemma quadraticSourceBarrier_space2 (D c Q t x : β) : | |
| HasDerivAt (deriv (quadraticSourceBarrier D c Q t)) | |
| (2*D*(Q-t)*Real.exp (c*(Q-t))) x := by | |
| have he : deriv (quadraticSourceBarrier D c Q t)= | |
| fun y => D*(Q-t)*Real.exp (c*(Q-t))*(2*y) := | |
| funext fun y => (quadraticSourceBarrier_space D c Q t y).deriv | |
| rw [he] | |
| convert ((hasDerivAt_id x).const_mul 2).const_mul | |
| (D*(Q-t)*Real.exp (c*(Q-t))) using 1 <;> first | rfl | ring | |
| lemma quadraticSourceBarrier_time (D c Q t x : β) : | |
| HasDerivAt (fun s => quadraticSourceBarrier D c Q s x) | |
| (-D*Real.exp (c*(Q-t))*(1+c*(Q-t))*(1+x^2)) t := by | |
| unfold quadraticSourceBarrier | |
| have hs := (hasDerivAt_const t Q).sub (hasDerivAt_id t) | |
| convert (((hs.const_mul D).mul (hs.const_mul c).exp).mul_const (1+x^2)) using 1 <;> | |
| first | rfl | (simp only [Pi.sub_apply,id_eq]; ring) | |
| lemma quadratic_transport_bound {D K Q t x b : β} | |
| (hD : 0 β€ D) (hK : 0 β€ K) (ht : t β€ Q) (hb : |b| β€ K*(1+|x|)) : | |
| -D*Real.exp ((4*K+2)*(Q-t))*(1+(4*K+2)*(Q-t))*(1+x^2)+ | |
| (1/2:β)*(2*D*(Q-t)*Real.exp ((4*K+2)*(Q-t)))+ | |
| b*(D*(Q-t)*Real.exp ((4*K+2)*(Q-t))*(2*x)) β€ -D*(1+x^2) := by | |
| have hnorm : (1+|x|)*|x| β€ 2*(1+x^2) := by | |
| nlinarith [sq_abs x,sq_nonneg (|x|-1)] | |
| have hbx : b*x β€ 2*K*(1+x^2) := calc | |
| b*x β€ |b*x| := le_abs_self _ | |
| _ = |b| * |x| := abs_mul _ _ | |
| _ β€ K*(1+|x|)*|x| := mul_le_mul_of_nonneg_right hb (abs_nonneg _) | |
| _ β€ 2*K*(1+x^2) := by nlinarith [mul_le_mul_of_nonneg_left hnorm hK] | |
| have hpoly : 1+2*b*x-(4*K+2)*(1+x^2) β€ 0 := by nlinarith [sq_nonneg x] | |
| have he : 1 β€ Real.exp ((4*K+2)*(Q-t)) := | |
| Real.one_le_exp_iff.mpr (mul_nonneg (by positivity) (sub_nonneg.mpr ht)) | |
| have hx : 0 β€ 1+x^2 := by positivity | |
| have h1 := mul_nonpos_of_nonneg_of_nonpos | |
| (show 0 β€ D*(Q-t)*Real.exp ((4*K+2)*(Q-t)) by positivity) hpoly | |
| have h2 := mul_le_mul_of_nonneg_left he (mul_nonneg hD hx) | |
| nlinarith | |
| def BackwardSourceComparisonStatement : Prop := | |
| β (Q K C D : β), 0 < Q β 0 β€ K β 0 β€ C β 0 β€ D β | |
| β (U b d : β β β β β), | |
| ContinuousOn (fun p : β Γ β => U p.1 p.2) (Icc 0 Q ΓΛ’ univ) β | |
| (β t β Icc 0 Q, Differentiable β (U t) β§ Differentiable β (deriv (U t))) β | |
| (β t β Ico 0 Q, β x, HasDerivWithinAt (fun s => U s x) (d t x) (Ici t) t) β | |
| (β t β Icc 0 Q, β x, |b t x| β€ K*(1+|x|)) β | |
| (β t β Icc 0 Q, β x, U t x β€ C*(1+x^2)) β | |
| (β t β Ico 0 Q, β x, | |
| -D*(1+x^2) β€ d t x+(1/2:β)*deriv (deriv (U t)) x+b t x*deriv (U t) x) β | |
| (β x, U Q x β€ 0) β | |
| β t β Icc 0 Q, β x, U t x β€ quadraticSourceBarrier D (4*K+2) Q t x | |
| theorem backward_source_comparison : BackwardSourceComparisonStatement := by | |
| intro Q K C D hQ hK hC hD U b d hc hx ht hb hg hp hterm | |
| let c := 4*K+2 | |
| let V : β β β β β := fun t x => U t x-quadraticSourceBarrier D c Q t x | |
| let vd : β β β β β := fun t x => d t x+ | |
| D*Real.exp (c*(Q-t))*(1+c*(Q-t))*(1+x^2) | |
| have hvx (t : β) (ht' : t β Icc 0 Q) (x : β) : | |
| HasDerivAt (V t) (deriv (U t) x-D*(Q-t)*Real.exp (c*(Q-t))*(2*x)) x := | |
| ((hx t ht').1 x).hasDerivAt.sub (quadraticSourceBarrier_space D c Q t x) | |
| have hvxx (t : β) (ht' : t β Icc 0 Q) (x : β) : | |
| HasDerivAt (deriv (V t)) (deriv (deriv (U t)) x-2*D*(Q-t)*Real.exp (c*(Q-t))) x := by | |
| have he : deriv (V t)=fun y => deriv (U t) y-deriv (quadraticSourceBarrier D c Q t) y := by | |
| ext y | |
| rw [(hvx t ht' y).deriv,(quadraticSourceBarrier_space D c Q t y).deriv] | |
| rw [he] | |
| exact ((hx t ht').2 x).hasDerivAt.sub (quadraticSourceBarrier_space2 D c Q t x) | |
| have hvtime (t : β) (ht' : t β Ico 0 Q) (x : β) : | |
| HasDerivWithinAt (fun s => V s x) (vd t x) (Ici t) t := by | |
| convert (ht t ht' x).sub (quadraticSourceBarrier_time D c Q t x).hasDerivWithinAt using 1; | |
| first | rfl | (dsimp [V,vd]; ring) | |
| have hvp (t : β) (ht' : t β Ico 0 Q) (x : β) : | |
| 0 β€ vd t x+(1/2:β)*deriv (deriv (V t)) x+b t x*deriv (V t) x := by | |
| have htcc : t β Icc 0 Q := β¨ht'.1,ht'.2.leβ© | |
| rw [(hvxx t htcc x).deriv,(hvx t htcc x).deriv] | |
| have hneg := quadratic_transport_bound hD hK htcc.2 (hb t htcc x) | |
| have hP := hp t ht' x | |
| dsimp [vd,c] at * | |
| linarith | |
| have hVc : ContinuousOn (fun p : β Γ β => V p.1 p.2) (Icc 0 Q ΓΛ’ univ) := by | |
| apply hc.sub | |
| have hh : Continuous (fun p : β Γ β => quadraticSourceBarrier D c Q p.1 p.2) := by | |
| unfold quadraticSourceBarrier | |
| fun_prop | |
| exact hh.continuousOn | |
| have hVg (t : β) (ht' : t β Icc 0 Q) (x : β) : V t x β€ C*(1+x^2) := by | |
| have hn : 0 β€ quadraticSourceBarrier D c Q t x := by | |
| unfold quadraticSourceBarrier | |
| exact mul_nonneg (mul_nonneg (mul_nonneg hD (sub_nonneg.mpr ht'.2)) | |
| (Real.exp_pos _).le) (by positivity) | |
| dsimp [V] | |
| linarith [hg t ht' x] | |
| have hVterm (x : β) : V Q x β€ 0 := by | |
| simpa [V,quadraticSourceBarrier] using hterm x | |
| have hcomp := backward_comparison Q K C hQ hK hC V b vd hVc | |
| (fun t ht' => β¨fun x => (hvx t ht' x).differentiableAt, | |
| fun x => (hvxx t ht' x).differentiableAtβ©) hvtime hb hVg hvp hVterm | |
| intro t ht' x | |
| have hh := hcomp t ht' x | |
| dsimp [V,c] at hh | |
| linarith | |
| end MicroscopicJamming | |
| open Set Filter | |
| open scoped Topology | |
| namespace MicroscopicJamming | |
| lemma variance_difference_le {Q C L Ξ΄ : β} (hQ : 0 < Q) (hC : 0 β€ C) | |
| (hL : 0 β€ L) (hΞ΄ : 0 β€ Ξ΄) {F G : β β β β β} {m n : β β β} | |
| (hcF : ContinuousOn (fun p : β Γ β => F p.1 p.2) (Icc 0 Q ΓΛ’ univ)) | |
| (hcG : ContinuousOn (fun p : β Γ β => G p.1 p.2) (Icc 0 Q ΓΛ’ univ)) | |
| (hxF : β t β Icc 0 Q, Differentiable β (F t) β§ Differentiable β (deriv (F t))) | |
| (hxG : β t β Icc 0 Q, Differentiable β (G t) β§ Differentiable β (deriv (G t))) | |
| (htF : β t β Ico 0 Q, β x, HasDerivWithinAt (fun s => F s x) | |
| (-(1/2:β)*(deriv (deriv (F t)) x+m t*(deriv (F t) x)^2)) (Ici t) t) | |
| (htG : β t β Ico 0 Q, β x, HasDerivWithinAt (fun s => G s x) | |
| (-(1/2:β)*(deriv (deriv (G t)) x+n t*(deriv (G t) x)^2)) (Ici t) t) | |
| (hm : β t β Icc 0 Q, 0 β€ m t β§ m t β€ 1) | |
| (hclose : β t β Ico 0 Q, |m t-n t| β€ Ξ΄) | |
| (hboundF : β t β Icc 0 Q, β x, |F t x| β€ C*(1+x^2)) | |
| (hboundG : β t β Icc 0 Q, β x, |G t x| β€ C*(1+x^2)) | |
| (hgradF : β t β Icc 0 Q, β x, |deriv (F t) x| β€ L*(1+|x|)) | |
| (hgradG : β t β Icc 0 Q, β x, |deriv (G t) x| β€ L*(1+|x|)) | |
| (hterm : β x, F Q x=G Q x) : | |
| β t β Icc 0 Q, β x, | |
| F t x-G t x β€ quadraticSourceBarrier (Ξ΄*L^2) (4*L+2) Q t x := by | |
| let U : β β β β β := fun t x => F t x-G t x | |
| let b : β β β β β := fun t x => m t*(deriv (F t) x+deriv (G t) x)/2 | |
| let d : β β β β β := fun t x => | |
| -(1/2:β)*(deriv (deriv (F t)) x+m t*(deriv (F t) x)^2)- | |
| (-(1/2:β)*(deriv (deriv (G t)) x+n t*(deriv (G t) x)^2)) | |
| have hdx (t : β) (ht : t β Icc 0 Q) (x : β) : | |
| HasDerivAt (U t) (deriv (F t) x-deriv (G t) x) x := | |
| ((hxF t ht).1 x).hasDerivAt.sub ((hxG t ht).1 x).hasDerivAt | |
| have hdx2 (t : β) (ht : t β Icc 0 Q) (x : β) : | |
| HasDerivAt (deriv (U t)) (deriv (deriv (F t)) x-deriv (deriv (G t)) x) x := by | |
| have he : deriv (U t)=fun y => deriv (F t) y-deriv (G t) y := | |
| funext fun y => (hdx t ht y).deriv | |
| rw [he] | |
| exact ((hxF t ht).2 x).hasDerivAt.sub ((hxG t ht).2 x).hasDerivAt | |
| have hc : ContinuousOn (fun p : β Γ β => U p.1 p.2) (Icc 0 Q ΓΛ’ univ) := hcF.sub hcG | |
| have hx (t : β) (ht : t β Icc 0 Q) : | |
| Differentiable β (U t) β§ Differentiable β (deriv (U t)) := | |
| β¨fun x => (hdx t ht x).differentiableAt,fun x => (hdx2 t ht x).differentiableAtβ© | |
| have htime (t : β) (ht : t β Ico 0 Q) (x : β) : | |
| HasDerivWithinAt (fun s => U s x) (d t x) (Ici t) t := (htF t ht x).sub (htG t ht x) | |
| have hb (t : β) (ht : t β Icc 0 Q) (x : β) : |b t x| β€ L*(1+|x|) := by | |
| have hsum : |deriv (F t) x+deriv (G t) x| β€ 2*L*(1+|x|) := by | |
| calc | |
| _ β€ |deriv (F t) x|+|deriv (G t) x| := abs_add_le _ _ | |
| _ β€ L*(1+|x|)+L*(1+|x|) := add_le_add (hgradF t ht x) (hgradG t ht x) | |
| _ = _ := by ring | |
| have hmul := mul_le_mul_of_nonneg_left hsum (hm t ht).1 | |
| have hmul' := mul_le_mul_of_nonneg_right (hm t ht).2 (show 0 β€ 2*L*(1+|x|) by positivity) | |
| dsimp [b] | |
| rw [abs_div,abs_mul,abs_of_nonneg (hm t ht).1,abs_of_pos (by norm_num : (0:β)<2)] | |
| linarith | |
| have hg (t : β) (ht : t β Icc 0 Q) (x : β) : U t x β€ (2*C)*(1+x^2) := by | |
| dsimp [U] | |
| have h1 := hboundF t ht x | |
| have h2 := hboundG t ht x | |
| nlinarith [le_abs_self (F t x),neg_abs_le (G t x)] | |
| have hp (t : β) (ht : t β Ico 0 Q) (x : β) : | |
| -(Ξ΄*L^2)*(1+x^2) β€ d t x+(1/2:β)*deriv (deriv (U t)) x+b t x*deriv (U t) x := by | |
| have htcc : t β Icc 0 Q := β¨ht.1,ht.2.leβ© | |
| rw [(hdx2 t htcc x).deriv,(hdx t htcc x).deriv] | |
| have he : d t x+(1/2:β)*(deriv (deriv (F t)) x-deriv (deriv (G t)) x)+ | |
| b t x*(deriv (F t) x-deriv (G t) x)= | |
| -(m t-n t)*(deriv (G t) x)^2/2 := by dsimp [d,b]; ring | |
| rw [he] | |
| have hsquare : (deriv (G t) x)^2 β€ 2*L^2*(1+x^2) := by | |
| have hs := pow_le_pow_leftβ (abs_nonneg (deriv (G t) x)) (hgradG t htcc x) 2 | |
| rw [sq_abs] at hs | |
| have hab : (1+|x|)^2 β€ 2*(1+x^2) := by nlinarith [sq_abs x,sq_nonneg (|x|-1)] | |
| have hh := mul_le_mul_of_nonneg_left hab (sq_nonneg L) | |
| nlinarith | |
| have h1 := mul_le_mul_of_nonneg_right (abs_le.mp (hclose t ht)).2 (sq_nonneg (deriv (G t) x)) | |
| have h2 := mul_le_mul_of_nonneg_left hsquare hΞ΄ | |
| nlinarith | |
| have hterm' (x : β) : U Q x β€ 0 := by simp [U,hterm x] | |
| exact backward_source_comparison Q L (2*C) (Ξ΄*L^2) hQ hL (by positivity) (by positivity) | |
| U b d hc hx htime hb hg hp hterm' | |
| end MicroscopicJamming | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped NNReal Topology | |
| namespace MicroscopicJamming | |
| def GaussianStepStabilityStatement : Prop := | |
| β A B C ΞΊ Q : β, 0 < Q β 0 β€ A β 0 β€ C β 0 β€ ΞΊ β ΞΊ*Q < 1 β | |
| β L : β, 0 β€ L β§ β u : β β β, RowAnalyticTerminal u A B C ΞΊ Q β | |
| β rs ss : List (β Γ β), | |
| (β r β rs, 0 β€ r.1 β§ r.1 β€ 1 β§ 0 β€ r.2) β | |
| (β r β ss, 0 β€ r.1 β§ r.1 β€ 1 β§ 0 β€ r.2) β | |
| gaussianStepTime rs=Q β gaussianStepTime ss=Q β | |
| β Ξ΄ : β, 0 β€ Ξ΄ β | |
| (β t β Icc 0 Q, |gaussianStepCoefficient rs t-gaussianStepCoefficient ss t| β€ Ξ΄) β | |
| β t β Icc 0 Q, β x, | |
| |gaussianStepPath rs u t x-gaussianStepPath ss u t x| β€ Ξ΄*L*(1+x^2) | |
| theorem gaussian_step_stability : GaussianStepStabilityStatement := by | |
| intro A B C ΞΊ Q hQ hA hC hΞΊ hΞΊQ | |
| obtain β¨D,L,hD,hL,hpathβ© := gaussian_step_path A B C ΞΊ Q hQ hA hC hΞΊ hΞΊQ | |
| refine β¨L^2*Q*Real.exp ((4*L+2)*Q),by positivity,?_β© | |
| intro u hu rs ss hrs hss hTr hTs Ξ΄ hΞ΄ hclose | |
| obtain β¨_,htermR,htimeR,hspaceRβ© := hpath u hu rs hrs hTr.le | |
| obtain β¨_,htermS,htimeS,hspaceSβ© := hpath u hu ss hss hTs.le | |
| have hxr (t : β) (ht : t β Icc 0 Q) : | |
| Differentiable β (gaussianStepPath rs u t) β§ Differentiable β (deriv (gaussianStepPath rs u t)) := by | |
| have hh := hspaceR t ht.1 (hTr βΈ ht.2) | |
| exact β¨hh.1,hh.2.1β© | |
| have hxs (t : β) (ht : t β Icc 0 Q) : | |
| Differentiable β (gaussianStepPath ss u t) β§ Differentiable β (deriv (gaussianStepPath ss u t)) := by | |
| have hh := hspaceS t ht.1 (hTs βΈ ht.2) | |
| exact β¨hh.1,hh.2.1β© | |
| have hgr (t : β) (ht : t β Icc 0 Q) (x : β) : | |
| |deriv (gaussianStepPath rs u t) x| β€ L*(1+|x|) := | |
| ((hspaceR t ht.1 (hTr βΈ ht.2)).2.2 x).1 | |
| have hgs (t : β) (ht : t β Icc 0 Q) (x : β) : | |
| |deriv (gaussianStepPath ss u t) x| β€ L*(1+|x|) := | |
| ((hspaceS t ht.1 (hTs βΈ ht.2)).2.2 x).1 | |
| have hcr := gaussianStepPath_jointly_continuous hD hL hTr htimeR | |
| (fun t ht htR => β¨(hspaceR t ht htR).1,fun x => ((hspaceR t ht htR).2.2 x).1β©) | |
| have hcs := gaussianStepPath_jointly_continuous hD hL hTs htimeS | |
| (fun t ht htS => β¨(hspaceS t ht htS).1,fun x => ((hspaceS t ht htS).2.2 x).1β©) | |
| have hpr (t : β) (ht : t β Ico 0 Q) (x : β) := | |
| gaussianStepPath_right_pde hQ hu hrs hTr.le (hTr βΈ ht) x | |
| have hps (t : β) (ht : t β Ico 0 Q) (x : β) := | |
| gaussianStepPath_right_pde hQ hu hss hTs.le (hTs βΈ ht) x | |
| have hb : 0 β€ |B|+A*(1+Q) := by positivity | |
| have hvr (t : β) (ht : t β Icc 0 Q) (x : β) := | |
| gaussianStepPath_global_value_bound hQ hu hrs hTr ht x | |
| have hvs (t : β) (ht : t β Icc 0 Q) (x : β) := | |
| gaussianStepPath_global_value_bound hQ hu hss hTs ht x | |
| have hmr (t : β) (_ : t β Icc 0 Q) := gaussianStepRightCoefficient_bounds hrs t | |
| have hms (t : β) (_ : t β Icc 0 Q) := gaussianStepRightCoefficient_bounds hss t | |
| have hΞ΄r (t : β) (ht : t β Ico 0 Q) := gaussianStepRightCoefficient_close hclose ht | |
| have hΞ΄s (t : β) (ht : t β Ico 0 Q) : | |
| |gaussianStepRightCoefficient ss t-gaussianStepRightCoefficient rs t| β€ Ξ΄ := by | |
| rw [abs_sub_comm] | |
| exact hΞ΄r t ht | |
| have hterm (x : β) : gaussianStepPath rs u Q x=gaussianStepPath ss u Q x := by | |
| simpa only [hTr,hTs] using (htermR x).trans (htermS x).symm | |
| have hr := variance_difference_le hQ hb hL hΞ΄ hcr hcs hxr hxs hpr hps hmr hΞ΄r hvr hvs hgr hgs hterm | |
| have hs := variance_difference_le hQ hb hL hΞ΄ hcs hcr hxs hxr hps hpr hms hΞ΄s hvs hvr hgs hgr | |
| (fun x => (hterm x).symm) | |
| intro t ht x | |
| have hab : |gaussianStepPath rs u t x-gaussianStepPath ss u t x| β€ | |
| quadraticSourceBarrier (Ξ΄*L^2) (4*L+2) Q t x := by | |
| rw [abs_le] | |
| constructor | |
| Β· linarith [hs t ht x] | |
| Β· exact hr t ht x | |
| have he : Real.exp ((4*L+2)*(Q-t)) β€ Real.exp ((4*L+2)*Q) := | |
| Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (by linarith [ht.1]) (by positivity)) | |
| have htq : (Q-t)*Real.exp ((4*L+2)*(Q-t)) β€ Q*Real.exp ((4*L+2)*Q) := | |
| mul_le_mul (by linarith [ht.1]) he (Real.exp_pos _).le hQ.le | |
| calc | |
| _ β€ quadraticSourceBarrier (Ξ΄*L^2) (4*L+2) Q t x := hab | |
| _ = (Ξ΄*L^2)*((Q-t)*Real.exp ((4*L+2)*(Q-t)))*(1+x^2) := by | |
| unfold quadraticSourceBarrier | |
| ring | |
| _ β€ (Ξ΄*L^2)*(Q*Real.exp ((4*L+2)*Q))*(1+x^2) := | |
| mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left htq (by positivity)) (by positivity) | |
| _ = Ξ΄*(L^2*Q*Real.exp ((4*L+2)*Q))*(1+x^2) := by ring | |
| end MicroscopicJamming | |
| namespace MicroscopicJamming | |
| def GaussianStepThirdStatement : Prop := | |
| β (u : β β β) (A B C ΞΊ Q : β), 0 < Q β RowAnalyticTerminal u A B C ΞΊ Q β | |
| β H : β, 0 β€ H β§ | |
| β rs : List (β Γ β), (β r β rs, 0 β€ r.1 β§ r.1 β€ 1 β§ 0 β€ r.2) β | |
| gaussianStepTime rs β€ Q β β t : β, 0 β€ t β t β€ gaussianStepTime rs β | |
| Differentiable β (deriv (deriv (gaussianStepPath rs u t))) β§ | |
| β x, |deriv (deriv (deriv (gaussianStepPath rs u t))) x| β€ H | |
| end MicroscopicJamming | |
| end | |
| end OAI | |