Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

A uniform gap makes dyadic selector-table lookups stable off a periodic set of small density

Proved
OAI.Problem310.exists_windowData_selector_stability

by Shuze Chen · Oct 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

measure-theoryoai-mathreal-analysis

Fix natural numbers MMM and ddd and a real number p>0p>0p>0. Words over the alphabet {0,1,…,M}\{0,1,\dots,M\}{0,1,…,M} are the vertices of the complete (M+1)(M+1)(M+1)-ary rooted tree: the empty word is the root and PcPcPc is the child ccc of PPP. The letter MMM is the default child and the letters 0,…,M−10,\dots,M-10,…,M−1 are the nondefault children. A word PPP of length ∣P∣<d|P|<d∣P∣<d is an internal node, and a nonempty word PPP with ∣P∣≤d|P|\le d∣P∣≤d is an edge (the edge entering the vertex PPP).

Window data. For q,d,g,r0∈Nq,d,g,r_0\in\mathbb{N}q,d,g,r0​∈N, a window datum WWW with parameters (q,d,g,r0)(q,d,g,r_0)(q,d,g,r0​) consists of a function r:N→Nr:\mathbb{N}\to\mathbb{N}r:N→N and three functions a,b,b∗a,b,b^{*}a,b,b∗ from words over {0,…,q−1}\{0,\dots,q-1\}{0,…,q−1} to N\mathbb{N}N such that, writing ℓ(P)=r(d+1−∣P∣)\ell(P)=r(d+1-|P|)ℓ(P)=r(d+1−∣P∣), the following hold for all edges P,QP,QP,Q:

  • ℓ(P)≥1\ell(P)\ge 1ℓ(P)≥1 and ℓ(P)≥r0\ell(P)\ge r_0ℓ(P)≥r0​;
  • aP≥3a_P\ge 3aP​≥3 and bP+1=aP+ℓ(P)b_P+1=a_P+\ell(P)bP​+1=aP​+ℓ(P), so the window of PPP is the integer interval [aP,bP][a_P,b_P][aP​,bP​] of length ℓ(P)\ell(P)ℓ(P);
  • if PPP is a proper prefix of QQQ, then bP+g<aQb_P+g<a_QbP​+g<aQ​;
  • if P=UiP=UiP=Ui and Q=UjVQ=UjVQ=UjV for words U,VU,VU,V and letters i<ji<ji<j, then bP+g<aQb_P+g<a_QbP​+g<aQ​;
  • if PPP is a prefix of QQQ (including P=QP=QP=Q), then bP≤bQ≤bP∗b_P\le b_Q\le b^{*}_PbP​≤bQ​≤bP∗​;
  • bP∗+1≤aP+2ℓ(P)b^{*}_P+1\le a_P+2\ell(P)bP∗​+1≤aP​+2ℓ(P).

Cells and selector tables. For β∈N\beta\in\mathbb{N}β∈N and x∈Rx\in\mathbb{R}x∈R let

κβ(x)=⌊2β+2{x}⌋∈{0,1,…,2β+2−1},{x}=x−⌊x⌋,\kappa_\beta(x)=\bigl\lfloor 2^{\beta+2}\{x\}\bigr\rfloor\in\{0,1,\dots,2^{\beta+2}-1\},\qquad \{x\}=x-\lfloor x\rfloor,κβ​(x)=⌊2β+2{x}⌋∈{0,1,…,2β+2−1},{x}=x−⌊x⌋,

the index of the cell of the grid 2−(β+2)Z2^{-(\beta+2)}\mathbb{Z}2−(β+2)Z, taken modulo 111, that contains xxx. For a window datum WWW with parameters (M+1,d,g,r0)(M+1,d,g,r_0)(M+1,d,g,r0​), an internal node PPP and i∈{0,…,M−1}i\in\{0,\dots,M-1\}i∈{0,…,M−1}, put βW(P,i)=bPi\beta_W(P,i)=b_{Pi}βW​(P,i)=bPi​, the right endpoint of the window of the edge from PPP to its nondefault child iii. A selector table for WWW is an arbitrary function ω\omegaω assigning a bit ω(P,i,k)∈{0,1}\omega(P,i,k)\in\{0,1\}ω(P,i,k)∈{0,1} to every internal node PPP, every i∈{0,…,M−1}i\in\{0,\dots,M-1\}i∈{0,…,M−1} and every k∈{0,…,2βW(P,i)+2−1}k\in\{0,\dots,2^{\beta_W(P,i)+2}-1\}k∈{0,…,2βW​(P,i)+2−1}; its selector value at x∈Rx\in\mathbb{R}x∈R is Sω(P,i,x)=ω(P,i,κβW(P,i)(x))S_\omega(P,i,x)=\omega\bigl(P,i,\kappa_{\beta_W(P,i)}(x)\bigr)Sω​(P,i,x)=ω(P,i,κβW​(P,i)​(x)).

Theorem. There is a natural number g≥2g\ge 2g≥2, depending only on MMM, ddd and ppp, such that for every r0∈Nr_0\in\mathbb{N}r0​∈N and every window datum WWW with parameters (M+1,d,g,r0)(M+1,d,g,r_0)(M+1,d,g,r0​) there is a set G⊆RG\subseteq\mathbb{R}G⊆R with the following properties:

  1. GGG is a Borel set;
  2. GGG is 111-periodic: x+1∈Gx+1\in Gx+1∈G if and only if x∈Gx\in Gx∈G, for every x∈Rx\in\mathbb{R}x∈R;
  3. λ((R∖G)∩[0,1])≤p\lambda\bigl((\mathbb{R}\setminus G)\cap[0,1]\bigr)\le pλ((R∖G)∩[0,1])≤p, where λ\lambdaλ denotes Lebesgue measure;
  4. for every x∈Gx\in Gx∈G, every internal node PPP, every i∈{0,…,M−1}i\in\{0,\dots,M-1\}i∈{0,…,M−1}, every n∈Nn\in\mathbb{N}n∈N with βW(P,i)+g<n\beta_W(P,i)+g<nβW​(P,i)+g<n, every t∈[1,2]t\in[1,2]t∈[1,2] and every selector table ω\omegaω for WWW,
Sω(P,i,  x+t 2−n)=Sω(P,i,x).S_\omega\bigl(P,i,\;x+t\,2^{-n}\bigr)=S_\omega(P,i,x).Sω​(P,i,x+t2−n)=Sω​(P,i,x).

Because ω\omegaω is arbitrary, item 4 says equivalently that κβW(P,i)(x+t2−n)=κβW(P,i)(x)\kappa_{\beta_W(P,i)}(x+t2^{-n})=\kappa_{\beta_W(P,i)}(x)κβW​(P,i)​(x+t2−n)=κβW​(P,i)​(x): every trial point x+t2−nx+t2^{-n}x+t2−n at a scale more than ggg steps beyond the window endpoint βW(P,i)\beta_W(P,i)βW​(P,i) lies in the same dyadic cell of mesh 2−(βW(P,i)+2)2^{-(\beta_W(P,i)+2)}2−(βW​(P,i)+2) (modulo 111) as xxx.

In a random tree-routing construction in which the decision at node PPP about child iii is read from the cell of the current point at resolution βW(P,i)\beta_W(P,i)βW​(P,i), this result supplies a large periodic set of stable centers: for x∈Gx\in Gx∈G the trial points x+t2−nx+t2^{-n}x+t2−n at all sufficiently fine dyadic scales read exactly the same selector bits as xxx, whatever the tables are. The order of quantifiers is essential: ggg is fixed before r0r_0r0​ and before the window datum (whose construction may itself depend on ggg), and the exceptional density ppp does not depend on the window resolutions.

Formalization Note Words are lists over Fin (M+1); the internal nodes form the subtype Node M d of lists of length less than ddd, and a nondefault child iii of type Fin M is the letter i.castSucc, the default child being Fin.last M. A window datum is the structure WindowData q d g r₀ with fields r, a, b, bstar and the six axioms listed above, which are required only on edges (ValidWindowEdge). The cell index κβ\kappa_\betaκβ​ is GridSeparation.dyadicKey β, valued in Fin (2 ^ (β + 2)); a selector table is a Boolean function on the addresses ⟨(P,i),k⟩\langle (P,i),k\rangle⟨(P,i),k⟩ (SelectorTable), and selectorValue reads it at selectorAddress (it is defined on all lists but is only evaluated at internal nodes here). Measurability (MeasurableSet G) refers to the Borel σ\sigmaσ-algebra of R\mathbb{R}R, Lebesgue measure is MeasureTheory.volume, the measure bound reads volume (Gᶜ ∩ Icc 0 1) ≤ ENNReal.ofReal p, and the displacement is written t * (2⁻¹) ^ n.

Preamble
import Mathlib
import Definitions.Def_DyadicAvoidance
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_PeriodicBasic
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_GridSeparation
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_FiniteTableModel
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_OrderedRouting
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_RoutingPath
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_CenterRouteExposure
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_ExceptionalCenters
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_CenterFailureBound
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_FirstDefault
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_ConcreteLabelMeasures
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_CenterFirstDefault
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_RandomSetDensity
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_RoutedSetDensity
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_RoutedExposure
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_FirstDefaultSelection
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_FiniteLocalPredicate
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowData
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowTableModel
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_StableRoutingBridge
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowExceptionalTransfer
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_TrialAddresses
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowTrialAddresses
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_ConcreteWindowAtom
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_PeriodicEnvelope
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_GlobalFromPeriodic
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_GridGeometry
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_GridMeasure
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_GridStability
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowPlacement
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowRecursion
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_PackedWindowSpan
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_TreePreorder
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_TreePreorderRank
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_PreorderIndex
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowSpanSum
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_TreeSpanBridge
import Definitions.Def_OAI_MeasureTheory_DyadicAvoidance_WindowDataExistence

open OAI OAI.Problem310
open FiniteTableModel
Formal statement
theorem OAI.Problem310.exists_windowData_selector_stability (M d : ℕ) (p : ℝ) (hp : 0 < p) :
    ∃ g : ℕ, 2 ≤ g ∧ ∀ r₀ : ℕ, ∀ W : WindowData (M + 1) d g r₀,
      ∃ G : Set ℝ, MeasurableSet G ∧
        (∀ x : ℝ, x + 1 ∈ G ↔ x ∈ G) ∧
        MeasureTheory.volume (Gᶜ ∩ Set.Icc (0 : ℝ) 1) ≤ ENNReal.ofReal p ∧
        ∀ x ∈ G, ∀ P : Node M d, ∀ i : Fin M, ∀ n : ℕ,
          W.b (P.val ++ [i.castSucc]) + g < n →
          ∀ t ∈ Set.Icc (1 : ℝ) 2,
          ∀ ω : SelectorTable (fun P : Node M d => fun i : Fin M =>
            W.b (P.val ++ [i.castSucc])),
          selectorValue (fun P : Node M d => fun i : Fin M =>
            W.b (P.val ++ [i.castSucc])) ω P.val i (x + t * ((2 : ℝ)⁻¹) ^ n) =
          selectorValue (fun P : Node M d => fun i : Fin M =>
            W.b (P.val ++ [i.castSucc])) ω P.val i x := by sorry
Source
https://github.com/openai/math/blob/1581d4cbdd69a0faf34b2089614fe2a814316a6a/lean/OAI/MeasureTheory/DyadicAvoidance/WindowDataStability.lean#L12-L43

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me