Download data/lean/OAI/Dynamics/StandardMap/BridgeGrid.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.05 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/StandardMap/BridgeGrid.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Dynamics/StandardMap/BridgeGrid.lean
-
curl -L -o BridgeGrid.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/StandardMap/BridgeGrid.lean
7.05 kB
| import OAI.Dynamics.StandardMap.BridgeDecay | |
| namespace OAI | |
| open MeasureTheory Set | |
| open scoped ENNReal BigOperators | |
| open MeasureTheory Set Filter Metric | |
| open scoped ENNReal Topology Classical | |
| namespace StandardMapEntropy | |
| structure BridgeGrid (Rw Rh : β) where | |
| p : β | |
| u : DyadicTime | |
| v : DyadicTime | |
| b : β€ | |
| N : β | |
| r : β | |
| large : 100β€ N | |
| narrow : (r:β)β€ (N:β)/1000 | |
| hu : ((2^p:β):β)*(u:β)=(b:β) | |
| hv : ((2^p:β):β)*(v:β)=(b:β)+(N:β) | |
| sw : Fin Rw β DyadicTime | |
| tw : Fin Rw β DyadicTime | |
| sh : Fin Rh β DyadicTime | |
| th : Fin Rh β DyadicTime | |
| aw : Fin Rw β β€ | |
| nw : Fin Rw β β | |
| ah : Fin Rh β β€ | |
| nh : Fin Rh β β | |
| pw : βj,0< nw j | |
| ph : βj,0< nh j | |
| hwleft : βj,-(r:β€)β€ aw j | |
| hwright : βj,aw j+(nw j:β€)β€ r | |
| hhleft : βj,-(r:β€)β€ ah j-(N:β€) | |
| hhright : βj,ah j+(nh j:β€)-(N:β€)β€ r | |
| hsw : βj,((2^p:β):β)*(sw j:β)=((aw j+b):β€) | |
| htw : βj,((2^p:β):β)*(tw j:β)=((aw j+b):β€)+(nw j:β) | |
| hsh : βj,((2^p:β):β)*(sh j:β)=((ah j+b):β€) | |
| hth : βj,((2^p:β):β)*(th j:β)=((ah j+b):β€)+(nh j:β) | |
| lemma aligned_scale (p l : β) (s : DyadicTime) (a : β€) | |
| (hs : ((2^p:β):β)*(s:β)=(a:β)) : | |
| ((2^(p+l):β):β)*(s:β)=((a*2^l:β€):β) := by | |
| push_cast at hs β’ | |
| rw [pow_add] | |
| nlinarith [congrArg (fun x : β => x*(2:β)^l) hs] | |
| lemma aligned_scale_end (p l : β) (s : DyadicTime) (a : β€) (m : β) | |
| (hs : ((2^p:β):β)*(s:β)=(a:β)+(m:β)) : | |
| ((2^(p+l):β):β)*(s:β)=((a*2^l:β€):β)+((m*2^l:β):β) := by | |
| have hh := aligned_scale p l s (a+(m:β€)) (by simpa only [Int.cast_add,Int.cast_natCast] using hs) | |
| push_cast at hh β’ | |
| nlinarith | |
| lemma observation_nonneg_aligned {R : β} (k : β) (hk : 0β€ k) (n : β) (hn : 0< n) | |
| (s t : Fin R β DyadicTime) (a : Fin R β β€) (m : Fin R β β) (hm : βi,0< m i) | |
| (hs : βi,(n:β)*(s i:β)=(a i:β)) (ht : βi,(n:β)*(t i:β)=(a i:β)+(m i:β)) | |
| (F : (Fin R β β) β β) (hF0 : βd,0β€ arrayObservation s t F d) : | |
| βz,0β€ shortfallObservation k a m F z := by | |
| intro z | |
| rw [βarrayObservation_sample k hk n hn s t a m hm hs ht F] | |
| exact hF0 _ | |
| lemma length_from_window (a : β€) (m r : β) (h1 : -(r:β€)β€ a) (h2 : a+(m:β€)β€ r) : mβ€ 2*r := by omega | |
| lemma BridgeGrid.sample_bound {Rw Rh : β} (B : BridgeGrid Rw Rh) | |
| (k : β) (hc : BridgeScalarControl k) (l : β) | |
| (Fw : (Fin Rw β β) β β) (Fh : (Fin Rh β β) β β) (L : NNReal) | |
| (hFw : LipschitzWith L Fw) (hFh : LipschitzWith L Fh) | |
| (hW0 : βd,0β€ arrayObservation B.sw B.tw Fw d) (hH0 : βd,0β€ arrayObservation B.sh B.th Fh d) | |
| (hlog : 1β€ Real.log (growthBase k)) (hLM : 16*Real.pi*Lβ€ growthBase k) | |
| (Ξ· : β) (hΞ· : 0<Ξ·) (hΞ΄ : growthBase k^(-(1/10:β)*((B.N*2^l:β):β))<Ξ·/2) | |
| (F : DistanceArray β β) (hF : Continuous F) (D : β) (hD : 0β€ D) | |
| (hFW : βd,F dβ€ D*arrayObservation B.sw B.tw Fw d) | |
| (hzero : βd,Β¬((999/1000:β)*((B.v:β)-(B.u:β))< d.val B.u B.v β§ Ξ·< arrayObservation B.sh B.th Fh d) β F d=0) : | |
| (β« d,F d βsampleLaw k hc.nonneg (2^(B.p+l)) (by positivity))β€ D*bridgeRealConstant* | |
| ((β« d,arrayObservation B.sw B.tw Fw d βsampleLaw k hc.nonneg (2^(B.p+l)) (by positivity))+ | |
| growthBase k^(-(1/10:β)*((B.N*2^l:β):β)))* | |
| ((β« d,arrayObservation B.sh B.th Fh d βsampleLaw k hc.nonneg (2^(B.p+l)) (by positivity))/(Ξ·/2)) := by | |
| have hp : (0:β€)β€ 2^l := by positivity | |
| have h1 : 1β€ 2^l := Nat.one_le_pow l 2 (by omega) | |
| have hwL (j) : -((B.r*2^l:β):β€)β€ B.aw j*2^l := by | |
| have hh := mul_le_mul_of_nonneg_right (B.hwleft j) hp | |
| push_cast; nlinarith | |
| have hwR (j) : B.aw j*2^l+((B.nw j*2^l:β):β€)β€ ((B.r*2^l:β):β€) := by | |
| have hh := mul_le_mul_of_nonneg_right (B.hwright j) hp | |
| push_cast; nlinarith | |
| have hhL (j) : -((B.r*2^l:β):β€)β€ B.ah j*2^l-((B.N*2^l:β):β€) := by | |
| have hh := mul_le_mul_of_nonneg_right (B.hhleft j) hp | |
| push_cast; nlinarith | |
| have hhR (j) : B.ah j*2^l+((B.nh j*2^l:β):β€)-((B.N*2^l:β):β€)β€ ((B.r*2^l:β):β€) := by | |
| have hh := mul_le_mul_of_nonneg_right (B.hhright j) hp | |
| push_cast; nlinarith | |
| have hsw (j) : ((2^(B.p+l):β):β)*(B.sw j:β)=(((B.aw j*2^l+B.b*2^l):β€):β) := by | |
| simpa only [add_mul] using aligned_scale B.p l (B.sw j) (B.aw j+B.b) (B.hsw j) | |
| have htw (j) : ((2^(B.p+l):β):β)*(B.tw j:β)=(((B.aw j*2^l+B.b*2^l):β€):β)+((B.nw j*2^l:β):β) := by | |
| simpa only [add_mul] using aligned_scale_end B.p l (B.tw j) (B.aw j+B.b) (B.nw j) (B.htw j) | |
| have hsh (j) : ((2^(B.p+l):β):β)*(B.sh j:β)=(((B.ah j*2^l+B.b*2^l):β€):β) := by | |
| simpa only [add_mul] using aligned_scale B.p l (B.sh j) (B.ah j+B.b) (B.hsh j) | |
| have hth (j) : ((2^(B.p+l):β):β)*(B.th j:β)=(((B.ah j*2^l+B.b*2^l):β€):β)+((B.nh j*2^l:β):β) := by | |
| simpa only [add_mul] using aligned_scale_end B.p l (B.th j) (B.ah j+B.b) (B.nh j) (B.hth j) | |
| have hnonnegW : βz,0β€ shortfallObservation k (fun j => B.aw j*2^l) (fun j => B.nw j*2^l) Fw z := by | |
| intro z | |
| have hh := observation_nonneg_aligned k hc.nonneg (2^(B.p+l)) (by positivity) B.sw B.tw | |
| (fun j => B.aw j*2^l+B.b*2^l) (fun j => B.nw j*2^l) (fun j => Nat.mul_pos (B.pw j) (by positivity)) hsw htw Fw hW0 | |
| (torusIter k (-(B.b*2^l)) z) | |
| rw [βshortfallObservation_shift,βtorusIter_add,add_neg_cancel,torusIter_zero] at hh | |
| exact hh | |
| have hnonnegH : βz,0β€ shortfallObservation k (fun j => B.ah j*2^l) (fun j => B.nh j*2^l) Fh z := by | |
| intro z | |
| have hh := observation_nonneg_aligned k hc.nonneg (2^(B.p+l)) (by positivity) B.sh B.th | |
| (fun j => B.ah j*2^l+B.b*2^l) (fun j => B.nh j*2^l) (fun j => Nat.mul_pos (B.ph j) (by positivity)) hsh hth Fh hH0 | |
| (torusIter k (-(B.b*2^l)) z) | |
| rw [βshortfallObservation_shift,βtorusIter_add,add_neg_cancel,torusIter_zero] at hh | |
| exact hh | |
| apply sample_bridge_integral k hc (2^(B.p+l)) (B.N*2^l) (B.r*2^l) (by positivity) | |
| (le_trans B.large (Nat.le_mul_of_pos_right _ (by positivity))) | |
| (by push_cast; nlinarith [mul_le_mul_of_nonneg_right B.narrow (show (0:β)β€ 2^l by positivity)]) | |
| B.u B.v (B.b*2^l) (aligned_scale B.p l B.u B.b B.hu) (aligned_scale_end B.p l B.v B.b B.N B.hv) | |
| B.sw B.tw B.sh B.th (fun j => B.aw j*2^l) (fun j => B.nw j*2^l) Fw | |
| (fun j => B.ah j*2^l) (fun j => B.nh j*2^l) Fh | |
| (fun j => Nat.mul_pos (B.pw j) (by positivity)) (fun j => Nat.mul_pos (B.ph j) (by positivity)) | |
| hsw htw hsh hth L hFw hFh | |
| (fun j => length_from_window _ _ _ (hwL j) (hwR j)) | |
| (fun j => length_from_window (B.ah j*2^l-((B.N*2^l:β):β€)) _ _ (hhL j) (by linarith [hhR j])) | |
| (fun j x hx hx' => by simpa only [sub_zero] using window_indices (a := B.aw j*2^l) (b := 0) (r := B.r*2^l) (by simpa only [sub_zero] using hwL j) (by simpa only [sub_zero] using hwR j) x hx hx') | |
| (fun j x hx hx' => window_indices (hhL j) (hhR j) x hx hx') | |
| hnonnegW hnonnegH hlog hLM Ξ· hΞ· hΞ΄ F hF D hD hFW hzero | |
| end StandardMapEntropy | |
| end OAI | |