Download data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/FarOffsetBuffer.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.49 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/FarOffsetBuffer.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/FarOffsetBuffer.lean
-
curl -L -o FarOffsetBuffer.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MeasureTheory/FalconerCompletion/Recursion/FarOffsetBuffer.lean
8.49 kB
| import Mathlib | |
| import OAI.MeasureTheory.Falconer.Angular.AngularNearProgress | |
| import OAI.MeasureTheory.Falconer.Estimates.ActualFarBuffer | |
| import OAI.MeasureTheory.Falconer.Model | |
| import OAI.MeasureTheory.Falconer.Recursion.BranchCounts | |
| import OAI.MeasureTheory.Falconer.Recursion.BranchTransitions | |
| import OAI.MeasureTheory.Falconer.Recursion.DirectPolicyWitness | |
| import OAI.MeasureTheory.Falconer.Recursion.InteriorPolicy | |
| import OAI.MeasureTheory.Falconer.Recursion.PolicyDescriptors | |
| import OAI.MeasureTheory.Falconer.Recursion.PolicyInteriorInterval | |
| import OAI.MeasureTheory.FalconerCompletion.Graphs.GraphJetMul | |
| namespace OAI | |
| /-! Recursive policies and quantitative depth estimates. -/ | |
| open _root_.OAI.PlanarFalconer | |
| section | |
| section | |
| open Set MeasureTheory | |
| open scoped ComplexConjugate RealInnerProductSpace | |
| namespace GraphLiteralSupport | |
| namespace CurrentFalconer.DimensionalPolicy | |
| open PlanarFalconer | |
| lemma uniform_far_offset_buffer {sig : β} (hsig : 0 < sig) (offset : β) : | |
| β Nβ : β, β N β₯ Nβ, β L t a : β, | |
| a < t-2*sourceFarBuffer N L sig β | |
| t-2*sourceFarBuffer N L sig+offset < t := by | |
| obtain β¨Nβ,hββ© := exists_nat_gt (((offset:β)+1)/sig) | |
| refine β¨Nβ,?_β© | |
| intro N hN L t a ha | |
| have hn := hβ.trans_le (Nat.cast_le.mpr hN) | |
| have hh := (div_lt_iffβ hsig).mp hn | |
| have hs := sourceFarBuffer_ge_slack N L sig | |
| have hmul : 0 β€ sig*(N:β) := mul_nonneg hsig.le (Nat.cast_nonneg _) | |
| have hb : offset < 2*sourceFarBuffer N L sig := by | |
| exact_mod_cast (show (offset:β) < 2*(sourceFarBuffer N L sig:β) by nlinarith) | |
| omega | |
| inductive BranchStep (A : β β β) (N q offset : β) (sig : β) : | |
| BranchState β BranchLabel β BranchState β Prop where | |
| | suffix {a t i : β} (wide : a+100*q < t) | |
| (side : a+t < 2*policyDepth A N q a t) : | |
| BranchStep A N q offset sig (.D a t i) .suffix (.D a (policyDepth A N q a t) (i+1)) | |
| | low {a t i v : β} (wide : a+100*q < t) | |
| (mem : v β Finset.Ioc a t) (gap : sig*N β€ (t:β)-v) : | |
| BranchStep A N q offset sig (.D a t i) .low (.D a v (i+1)) | |
| | high {a t i v : β} (wide : a+100*q < t) | |
| (side : 2*policyDepth A N q a t β€ a+t) | |
| (mem : v β Finset.Ioc a t) (gap : (t:β)-v < sig*N) : | |
| BranchStep A N q offset sig (.D a t i) .high (.H a t (policyDepth A N q a t) v i) | |
| | near {aβ tβ a t i : β} (wide : a+100*q < t) | |
| (side : a < (BranchState.H aβ tβ a t i).nearDepth A N q sig) : | |
| BranchStep A N q offset sig (.H aβ tβ a t i) .near | |
| (.H aβ tβ ((BranchState.H aβ tβ a t i).nearDepth A N q sig) t i) | |
| | far {aβ tβ a t i b : β} (wide : a+100*q < t) | |
| (side : a < (BranchState.H aβ tβ a t i).nearDepth A N q sig) | |
| (mem : b β Finset.Icc (a+1) ((BranchState.H aβ tβ a t i).nearDepth A N q sig+offset)) : | |
| BranchStep A N q offset sig (.H aβ tβ a t i) .far (.D b t (i+1)) | |
| | direct {aβ tβ a t i : β} {e : PolicyDescriptor} (wide : a+100*q < t) | |
| (witness : DirectPolicyWitness A N q aβ tβ a t sig e) : | |
| BranchStep A N q offset sig (.H aβ tβ a t i) .direct (.H aβ tβ (descriptorAnchor e) t i) | |
| end CurrentFalconer.DimensionalPolicy | |
| end GraphLiteralSupport | |
| end | |
| end | |
| section | |
| section | |
| open Set MeasureTheory | |
| open scoped ComplexConjugate RealInnerProductSpace | |
| namespace GraphLiteralSupport | |
| namespace CurrentFalconer.DimensionalPolicy | |
| open PlanarFalconer | |
| namespace BranchStep | |
| variable {A : β β β} {N q offset : β} {sig : β} | |
| variable {s u : BranchState} {label : BranchLabel} | |
| theorem nonterminal (h : BranchStep A N q offset sig s label u) : s.start+100*q < s.finish := by | |
| cases h <;> assumption | |
| theorem nested (h : BranchStep A N q offset sig s label u) (hq : 0 < q) | |
| (hv : s.Valid N sig) : s.start β€ u.start β§ u.finish β€ s.finish := by | |
| cases h with | |
| | suffix hw _ => | |
| have hp := policyDepth_interior A hq (policyBlocks_nonempty hq hv.2 hw) | |
| simp only [BranchState.start,BranchState.finish] | |
| omega | |
| | low _ hm _ => | |
| have hm := Finset.mem_Ioc.mp hm | |
| exact β¨le_rfl,hm.2β© | |
| | high hw _ hm _ => | |
| have hp := policyDepth_interior A hq (policyBlocks_nonempty hq hv.2 hw) | |
| have hm := Finset.mem_Ioc.mp hm | |
| exact β¨by dsimp [BranchState.start]; omega,hm.2β© | |
| | near _ hs => exact β¨hs.le,le_rflβ© | |
| | far _ _ hm => | |
| have hm := Finset.mem_Icc.mp hm | |
| exact β¨by dsimp [BranchState.start]; omega,le_rflβ© | |
| | direct _ hw => exact β¨hw.anchor_gt.le,le_rflβ© | |
| theorem index_change (h : BranchStep A N q offset sig s label u) : | |
| u.index = s.index + (if label = .suffix β¨ label = .low β¨ label = .far then 1 else 0) := by | |
| cases h <;> simp [BranchState.index] | |
| theorem episode_balance (h : BranchStep A N q offset sig s label u) : | |
| u.angular + (if label = .far then 1 else 0) = | |
| s.angular + (if label = .high then 1 else 0) := by | |
| cases h <;> simp [BranchState.angular] | |
| theorem suffix_decrease (h : BranchStep A N q offset sig s .suffix u) (hq : 0 < q) | |
| (hv : s.Valid N sig) : u.finish+q β€ s.finish := by | |
| cases h with | |
| | suffix hw _ => | |
| have hp := policyDepth_interior A hq (policyBlocks_nonempty hq hv.2 hw) | |
| dsimp only [BranchState.finish] | |
| omega | |
| theorem low_decrease (h : BranchStep A N q offset sig s .low u) : | |
| (u.finish:β)+sig*N β€ s.finish := by | |
| cases h with | |
| | low _ _ hg => dsimp only [BranchState.finish]; linarith | |
| theorem graph_charge (h : BranchStep A N q offset sig s label u) (hq : 0 < q) | |
| (hv : s.Valid N sig) (hg : label = .high β¨ label = .direct) : | |
| s.start < u.start β§ u.start β policyRepresentatives A N q := by | |
| cases h with | |
| | high hw _ _ _ => | |
| have hn := policyBlocks_nonempty hq hv.2 hw | |
| have hp := policyDepth_interior A hq hn | |
| exact β¨by dsimp [BranchState.start]; omega,policyDepth_mem_representatives A hnβ© | |
| | direct _ hw => | |
| exact β¨hw.anchor_gt,policyDescriptor_anchor_mem A hq (Finset.mem_filter.mp hw.mem).1β© | |
| | _ => simp at hg | |
| end BranchStep | |
| end CurrentFalconer.DimensionalPolicy | |
| end GraphLiteralSupport | |
| end | |
| end | |
| section | |
| section | |
| open Set MeasureTheory | |
| open scoped ComplexConjugate RealInnerProductSpace | |
| namespace GraphLiteralSupport | |
| namespace CurrentFalconer.DimensionalPolicy | |
| open PlanarFalconer | |
| def ChargedNear (A : β β β) (N q : β) (s u : BranchState) : Prop := | |
| u.start+100*q < u.finish β§ β e β s.descriptors A N q, | |
| descriptorLength e = (s.descriptors A N q).sup descriptorLength β§ | |
| s.start < descriptorAnchor e β§ descriptorAnchor e β€ u.start | |
| theorem near_uncharged_next_direct {A : β β β} {N q offset : β} {sig : β} | |
| (hq : 0 < q) (hceil : β10*sig*(N:β)ββ < q) | |
| {s u w : BranchState} {label : BranchLabel} | |
| (h : BranchStep A N q offset sig s .near u) (hn : Β¬ ChargedNear A N q s u) | |
| (hnext : BranchStep A N q offset sig u label w) : label = .direct := by | |
| have hw := hnext.nonterminal | |
| cases h with | |
| | near hwide hnear => | |
| obtain ht | hp | he := actual_near_progress A hq hceil hnear | |
| Β· exact (not_lt_of_ge ht hw).elim | |
| Β· obtain β¨e,hm,hL,ha,hb,_β© := hp | |
| exact (hn β¨hw,e,hm,hL,ha,hbβ©).elim | |
| Β· simp only [BranchState.finish] at he | |
| cases hnext with | |
| | near _ hs => | |
| simp only [BranchState.nearDepth,BranchState.finish,BranchState.descriptors] at hs | |
| rw [he.2] at hs | |
| exact (Nat.lt_irrefl _ hs).elim | |
| | far _ hs _ => | |
| simp only [BranchState.nearDepth,BranchState.finish,BranchState.descriptors] at hs | |
| rw [he.2] at hs | |
| exact (Nat.lt_irrefl _ hs).elim | |
| | direct _ _ => rfl | |
| def branchCount (label : β β BranchLabel) (n : β) (kind : BranchLabel) : β := | |
| β j β Finset.range n, if label j = kind then 1 else 0 | |
| theorem branchCount_card (label : β β BranchLabel) (n : β) (kind : BranchLabel) : | |
| branchCount label n kind = ((Finset.range n).filter fun j => label j = kind).card := by | |
| simp [branchCount] | |
| theorem branchCount_succ (label : β β BranchLabel) (n : β) (kind : BranchLabel) : | |
| branchCount label (n+1) kind = branchCount label n kind + if label n = kind then 1 else 0 := by | |
| simp only [branchCount,Finset.sum_range_succ] | |
| structure PolicyBranch (A : β β β) (N q offset : β) (sig : β) (n : β) where | |
| state : β β BranchState | |
| label : β β BranchLabel | |
| valid : β j β€ n, (state j).Valid N sig | |
| step : β j < n, BranchStep A N q offset sig (state j) (label j) (state (j+1)) | |
| end CurrentFalconer.DimensionalPolicy | |
| end GraphLiteralSupport | |
| end | |
| end | |
| end OAI | |