Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

A successful child-local test is a terminal hit of the root router

Proved
OAI.Problem310.FiniteLocalHit.local_test_implies_root_hit

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

combinatoricsmeasure-theoryoai-math

Setting. Fix M,d∈NM,d\in\mathbb{N}M,d∈N. The children of a vertex are labelled 0,1,…,M0,1,\dots,M0,1,…,M: child MMM is the default child, and 0,…,M−10,\dots,M-10,…,M−1 are the nondefault children, ordered as integers. A node is a finite sequence PPP of children (the path from the root) of length ∣P∣<d|P|<d∣P∣<d, and a leaf is a sequence of children of length exactly ddd; P⌢jP\frown jP⌢j denotes PPP followed by the child jjj. Bits are written 000 (false) and 111 (true). For β∈N\beta\in\mathbb{N}β∈N and y∈Ry\in\mathbb{R}y∈R let

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

be the index of the cell containing yyy in the 111-periodic grid of mesh 2−β−22^{-\beta-2}2−β−2.

Let bS(P,j)∈Nb_S(P,j)\in\mathbb{N}bS​(P,j)∈N be a resolution for every node PPP and nondefault child jjj, and bT(L)∈Nb_T(L)\in\mathbb{N}bT​(L)∈N one for every leaf LLL. A selector table ωS\omega_SωS​ assigns a bit ωS(P,j,m)\omega_S(P,j,m)ωS​(P,j,m) to every node PPP, nondefault child jjj and cell index m<2bS(P,j)+2m<2^{b_S(P,j)+2}m<2bS​(P,j)+2; a terminal table ωT\omega_TωT​ assigns a bit ωT(L,m)\omega_T(L,m)ωT​(L,m) to every leaf LLL and m<2bT(L)+2m<2^{b_T(L)+2}m<2bT​(L)+2. The selector value of jjj at a sequence PPP and a point y∈Ry\in\mathbb{R}y∈R is σ(P,j,y)=ωS(P,j,κbS(P,j)(y))\sigma(P,j,y)=\omega_S\big(P,j,\kappa_{b_S(P,j)}(y)\big)σ(P,j,y)=ωS​(P,j,κbS​(P,j)​(y)) if ∣P∣<d|P|<d∣P∣<d, and σ(P,j,y)=0\sigma(P,j,y)=0σ(P,j,y)=0 otherwise. The first-success choice c(P,y)c(P,y)c(P,y) is the smallest nondefault jjj with σ(P,j,y)=1\sigma(P,j,y)=1σ(P,j,y)=1, and the default child MMM if there is none. Routing appends the chosen child repeatedly: ρ0(P,y)=P\rho_0(P,y)=Pρ0​(P,y)=P and ρn+1(P,y)=ρn(P,y)⌢c(ρn(P,y),y)\rho_{n+1}(P,y)=\rho_n(P,y)\frown c(\rho_n(P,y),y)ρn+1​(P,y)=ρn​(P,y)⌢c(ρn​(P,y),y); write ρn(y)=ρn(∅,y)\rho_n(y)=\rho_n(\varnothing,y)ρn​(y)=ρn​(∅,y) for the route from the root, so that ρd(y)\rho_d(y)ρd​(y) is the leaf reached by the router at yyy.

Theorem. Let k,r∈Nk,r\in\mathbb{N}k,r∈N, let UUU be a node, i∈{0,…,M−1}i\in\{0,\dots,M-1\}i∈{0,…,M−1} a nondefault child and x,y∈Rx,y\in\mathbb{R}x,y∈R, with ∣U∣+1+r=d|U|+1+r=d∣U∣+1+r=d. Assume:

  1. ρk(x)=U\rho_k(x)=Uρk​(x)=U, and c(ρl(x),x)≠Mc(\rho_l(x),x)\neq Mc(ρl​(x),x)=M for every l<kl<kl<k (the route of xxx reaches UUU without taking a default child);
  2. for every l<kl<kl<k and every nondefault child j≤c(ρl(x),x)j\le c(\rho_l(x),x)j≤c(ρl​(x),x) one has σ(ρl(x),j,x)=σ(ρl(x),j,y)\sigma(\rho_l(x),j,x)=\sigma(\rho_l(x),j,y)σ(ρl​(x),j,x)=σ(ρl​(x),j,y) (along the route of xxx, the selectors up to and including the chosen one take the same values at yyy);
  3. c(U,x)=Mc(U,x)=Mc(U,x)=M (the route of xxx takes the default child at UUU);
  4. σ(U,j,x)=σ(U,j,y)\sigma(U,j,x)=\sigma(U,j,y)σ(U,j,x)=σ(U,j,y) for every nondefault j<ij<ij<i;
  5. the local test of child iii succeeds at yyy: ωS(U,i,κbS(U,i)(y))=1\omega_S\big(U,i,\kappa_{b_S(U,i)}(y)\big)=1ωS​(U,i,κbS​(U,i)​(y))=1 and ωT(L′,κbT(L′)(y))=1\omega_T\big(L',\kappa_{b_T(L')}(y)\big)=1ωT​(L′,κbT​(L′)​(y))=1, where L′=ρr(U⌢i, y)L'=\rho_r(U\frown i,\,y)L′=ρr​(U⌢i,y) is the leaf reached by routing at yyy from the child U⌢iU\frown iU⌢i.

Then the terminal lookup of the root router at yyy succeeds:

ωT(ρd(y), κbT(ρd(y))(y))=1.\omega_T\big(\rho_d(y),\ \kappa_{b_T(\rho_d(y))}(y)\big)=1.ωT​(ρd​(y), κbT​(ρd​(y))​(y))=1.

In the random construction of the avoiding set, a point yyy belongs to the random set exactly when the terminal lookup of the root router at yyy succeeds. The lemma converts a success of a child-local test, which only involves the selector of child iii at UUU and the subtree below U⌢iU\frown iU⌢i, into membership of yyy in that set. Its only inputs relating yyy to the center xxx are equalities of finitely many selector values; later siblings of iii at UUU and all choices off the route of xxx are unrestricted.

Formalization Note Children are Fin (M + 1): a nondefault child jjj is j.castSucc and the default is Fin.last M. The selector value σ\sigmaσ is selectorValue bS ωS, defined on all lists and equal to false on lists of length at least ddd; the choice rule is select (selectorValue bS ωS) (i.e. chooseChild applied to the selector values), routes are routeFrom, and localLeaf packages a route of the right length as a leaf in List.Vector (Fin (M + 1)) d, carrying the depth proof hdepth. Table cells are addressed by selectorAddress and terminalAddress as dependent pairs (table name, cell index).

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
open FiniteTableModel StableRouting RoutingPath OrderedRouting FiniteLocalPredicate
variable {M d : ℕ}
Formal statement
theorem OAI.Problem310.FiniteLocalHit.local_test_implies_root_hit
    (bS : Node M d → Fin M → ℕ) (bT : Leaf M d → ℕ)
    (ωS : SelectorTable bS) (ωT : TerminalTable bT)
    (k r : ℕ) (U : Node M d) (i : Fin M) (x y : ℝ)
    (hdepth : (U.val ++ [i.castSucc]).length + r = d)
    (hU : routeFrom (select (selectorValue bS ωS)) k [] x = U.val)
    (hnd : ∀ l < k, select (selectorValue bS ωS)
      (routeFrom (select (selectorValue bS ωS)) l [] x) x ≠ Fin.last M)
    (hprefix : ∀ l < k, ∀ j : Fin M,
      j.castSucc ≤ select (selectorValue bS ωS)
        (routeFrom (select (selectorValue bS ωS)) l [] x) x →
      selectorValue bS ωS (routeFrom (select (selectorValue bS ωS)) l [] x) j x =
      selectorValue bS ωS (routeFrom (select (selectorValue bS ωS)) l [] x) j y)
    (hdefault : select (selectorValue bS ωS) U.val x = Fin.last M)
    (hearlier : ∀ j < i, selectorValue bS ωS U.val j x = selectorValue bS ωS U.val j y)
    (hlocal : (ωS (selectorAddress bS U i y) &&
      ωT (terminalAddress bT
        (localLeaf (select (selectorValue bS ωS)) r (U.val ++ [i.castSucc]) hdepth y) y)) = true) :
    ωT (terminalAddress bT
      (localLeaf (select (selectorValue bS ωS)) d [] (by simp) y) y) = true := by sorry
Source
https://github.com/openai/math/blob/1581d4cbdd69a0faf34b2089614fe2a814316a6a/lean/OAI/MeasureTheory/DyadicAvoidance/FiniteLocalHit.lean#L14-L58

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