Proof of Theorem 1 (p. 340) — a nonleaf lies in for all leaves below one of its children
ProvedHarelTarjan.PointerLB.nonleaf_dichotomyLet be the complete binary tree of height , represented in a list structure with two pointers per node by a map from vertices to nodes, and suppose that every nca query on two leaves is answered in steps. For a leaf let be the set of tree vertices whose nodes are accessible from in steps or less.
Let be a nonleaf vertex of , with children and . Then either
This dichotomy is what forces every vertex to be seen from many leaves, and it drives the counting in the proof of Theorem 1.
Formalization Note The statement does not assume that is injective; the paper's representation is, and the claim holds without it.
import Mathlib import Definitions.Def_HarelTarjan_PointerLB_BinaryTree import Definitions.Def_HarelTarjan_PointerLB_PointerMachine
namespace HarelTarjan.PointerLB
theorem nonleaf_dichotomy {N : Type*} {h k : ℕ} (ptr : N → Fin 2 → Option N)
(rep : Vertex h → N) (hk : AnswersLeafQueriesIn ptr rep k)
(w : Vertex h) (hw : w.1.length < h) :
(∀ x : Vertex h, IsLeaf x → w.1 ++ [false] <+: x.1 → w ∈ A ptr rep k x) ∨
(∀ y : Vertex h, IsLeaf y → w.1 ++ [true] <+: y.1 → w ∈ A ptr rep k y) := by sorry
end HarelTarjan.PointerLB
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setup.
- , and is any type of nodes.
- assigns to each node and field a node or nil.
- is an arbitrary map, not necessarily injective, from vertices of the height- complete binary tree to nodes. A vertex is a boolean sequence of length at most ; a leaf is a vertex of length exactly .
Let be the set of nodes reachable from by following at most non-nil pointer fields. For a vertex , define:
Hypotheses.
- For every pair of leaves , some run of at most steps holds . A run starts holding , and each step adds a non-nil field of a held node . Here is the longest common prefix of and .
- is a vertex with , that is, a non-leaf.
Conclusion. At least one of the following holds:
- for every leaf whose sequence begins with followed by false: ;
- for every leaf whose sequence begins with followed by true: .
Degenerate cases.
- When , no vertex satisfies , so the statement is vacuous.
- If is not injective, "" means only that the node is reachable. That node may also represent other vertices.
- For and , the query hypothesis can be satisfied only if for all leaf pairs. This requires a non-injective ; otherwise the hypothesis is unsatisfiable.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.