Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Windows of selectors tested earlier on a route end before every later edge window begins

Proved
OAI.Problem310.WindowLocalHit.ancestor_selector_gap

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

combinatoricsmeasure-theoryoai-math

Window data. Let q,d,g,r0∈Nq,d,g,r_0\in\mathbb{N}q,d,g,r0​∈N. Words over the alphabet {0,…,q−1}\{0,\dots,q-1\}{0,…,q−1} are the vertices of the complete qqq-ary tree; ∣P∣|P|∣P∣ is the length of a word PPP, PiPiPi is PPP followed by the letter iii, and P⊑QP\sqsubseteq QP⊑Q means that PPP is a prefix of QQQ. A word PPP is a valid edge if P≠∅P\neq\varnothingP=∅ and ∣P∣≤d|P|\le d∣P∣≤d (it names the edge entering the vertex PPP). A window datum WWW with parameters (q,d,g,r0)(q,d,g,r_0)(q,d,g,r0​) consists of a function rW:N→Nr_W:\mathbb{N}\to\mathbb{N}rW​:N→N and maps a,b,b∗a,b,b^*a,b,b∗ from words to N\mathbb{N}N such that, writing ℓ(P)=rW(d+1−∣P∣)\ell(P)=r_W(d+1-|P|)ℓ(P)=rW​(d+1−∣P∣) and letting P,QP,QP,Q range over valid edges:

  1. 1≤ℓ(P)1\le\ell(P)1≤ℓ(P), r0≤ℓ(P)r_0\le\ell(P)r0​≤ℓ(P) and a(P)≥3a(P)\ge3a(P)≥3;
  2. b(P)+1=a(P)+ℓ(P)b(P)+1=a(P)+\ell(P)b(P)+1=a(P)+ℓ(P), so the edge PPP carries the window of dyadic scales a(P),…,b(P)a(P),\dots,b(P)a(P),…,b(P);
  3. (prefix gap) if P⊑QP\sqsubseteq QP⊑Q and P≠QP\neq QP=Q, then b(P)+g<a(Q)b(P)+g<a(Q)b(P)+g<a(Q);
  4. (sibling gap) for every word VVV, letters i<ji<ji<j and word TTT such that ViViVi and VjTVjTVjT are valid edges, b(Vi)+g<a(VjT)b(Vi)+g<a(VjT)b(Vi)+g<a(VjT);
  5. (descendant bounds) if P⊑QP\sqsubseteq QP⊑Q, then b(P)≤b(Q)≤b∗(P)b(P)\le b(Q)\le b^*(P)b(P)≤b(Q)≤b∗(P);
  6. (padding) b∗(P)+1≤a(P)+2ℓ(P)b^*(P)+1\le a(P)+2\ell(P)b∗(P)+1≤a(P)+2ℓ(P).

Routing. Let XXX be any set and let χ\chiχ be any child-choice map assigning a letter χ(P,x)∈{0,…,q−1}\chi(P,x)\in\{0,\dots,q-1\}χ(P,x)∈{0,…,q−1} to every word PPP and every x∈Xx\in Xx∈X. For x∈Xx\in Xx∈X the route from the root is ρ0(x)=∅\rho_0(x)=\varnothingρ0​(x)=∅ and ρn+1(x)=ρn(x) cn(x)\rho_{n+1}(x)=\rho_n(x)\,c_n(x)ρn+1​(x)=ρn​(x)cn​(x), where cn(x)=χ(ρn(x),x)c_n(x)=\chi(\rho_n(x),x)cn​(x)=χ(ρn​(x),x) is the child chosen at stage nnn.

Theorem. Let WWW be a window datum with parameters (q,d,g,r0)(q,d,g,r_0)(q,d,g,r0​), let x∈Xx\in Xx∈X, let k<l<dk<l<dk<l<d, and let i,j∈{0,…,q−1}i,j\in\{0,\dots,q-1\}i,j∈{0,…,q−1} with j≤ck(x)j\le c_k(x)j≤ck​(x). Then

b(ρk(x) j)+g<a(ρl(x) i).b\bigl(\rho_k(x)\,j\bigr)+g<a\bigl(\rho_l(x)\,i\bigr).b(ρk​(x)j)+g<a(ρl​(x)i).

Under first-success routing, the selectors examined at the stage-kkk node ρk(x)\rho_k(x)ρk​(x) are those of the children j≤ck(x)j\le c_k(x)j≤ck​(x): the rejected ones and the chosen one. The theorem says that the window of every such edge ends more than ggg scales before the window of any edge leaving a later node ρl(x)\rho_l(x)ρl​(x) of the same route begins. It is a purely deterministic consequence of the prefix-gap and sibling-gap axioms, and it is used to separate the ranges of scales involved at different stages of a route.

Formalization Note The window datum is W : WindowData q d g r₀ (all axioms listed above are part of the structure, though only the two gap axioms are used here); the choice map is choose : List (Fin q) → X → Fin q, the route is routeFrom choose n [] x, and letters are compared in Fin q.

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

open OAI OAI.Problem310
universe u_X
open RoutingPath StableRouting GridSeparation
variable {q d g r₀ : ℕ} {X : Type u_X}
Formal statement
theorem OAI.Problem310.WindowLocalHit.ancestor_selector_gap (W : WindowData q d g r₀)
    (choose : List (Fin q) → X → Fin q) (x : X)
    {k l : ℕ} (hkl : k < l) (hld : l < d) (i j : Fin q)
    (hj : j ≤ choose (routeFrom choose k [] x) x) :
    W.b (routeFrom choose k [] x ++ [j]) + g <
      W.a (routeFrom choose l [] x ++ [i]) := by sorry
Source
https://github.com/openai/math/blob/1581d4cbdd69a0faf34b2089614fe2a814316a6a/lean/OAI/MeasureTheory/DyadicAvoidance/WindowLocalHit.lean#L18-L54

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