Theorem 1 (explicit form proved on p. 341) — any pointer machine needs steps per nca query
ProvedHarelTarjan.PointerLB.theorem1_lower_boundLet be a complete binary tree of height with leaves. Let be represented in an arbitrary list structure: a collection of nodes, each with two pointer fields, and an injective map assigning to each tree vertex the node that represents it (other nodes may exist). Suppose that for every two leaves of some run of at most steps from the input nodes holds a pointer to , where each step follows one pointer field of a node already held. Then
This is the explicit form, proved on p. 341, of Harel and Tarjan's Theorem 1: any pointer machine requires time to answer an nca query in the worst case, independently of how the tree is represented. It shows that van Leeuwen's -per-query pointer-machine algorithm is optimal up to a constant factor, and separates pointer machines from random-access machines, on which the paper answers queries in time.
Formalization Note is Real.logb 2. For Lean's convention makes the claim read , which is true; for , is the honest value. The list structure (N, ptr, rep) is universally quantified, which is "independent of the representation". The hypothesis concerns only queries on two leaves, which is weaker than all queries, so the theorem is at least as strong as the paper's. The paper's reduction of any fixed number of pointers per node to two is not formalized: the model has two pointer fields. Time is measured by pointer-following steps, each of which costs at least one unit of time on the machine.
import Mathlib import Definitions.Def_HarelTarjan_PointerLB_BinaryTree import Definitions.Def_HarelTarjan_PointerLB_PointerMachine
namespace HarelTarjan.PointerLB
theorem theorem1_lower_bound (h k : ℕ) {N : Type*} (ptr : N → Fin 2 → Option N)
(rep : Vertex h → N) (hrep : Function.Injective rep)
(hk : AnswersLeafQueriesIn ptr rep k) :
Real.logb 2 (Real.logb 2 ((2 : ℝ) ^ h)) - 2 < (k : ℝ) := by sorry
end HarelTarjan.PointerLB
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let and be natural numbers. Let be an arbitrary type, whose elements we call nodes. No finiteness, nonemptiness or other structure is assumed on . Let
be a pointer structure on . Each node has two pointer slots, labelled and . For each slot , is either a node of or the value ("no pointer"). Let be the type named Vertex h from the imported definitions file Def_HarelTarjan_PointerLB_BinaryTree. That code was not provided, so this read-back cannot say what the elements of are or how many there are. Let
be an injective map, so distinct elements of go to distinct nodes.
The one remaining hypothesis is the predicate AnswersLeafQueriesIn applied to . It comes from the imported file Def_HarelTarjan_PointerLB_PointerMachine, and its definition was also not provided. So this read-back can only say that the hypothesis holds for this pointer structure, this representation map and this number . Its content (what counts as a "leaf query", what "answering" means, and whether bounds steps, pointer traversals or something else) cannot be stated here and has to be checked against that file.
Under these hypotheses the theorem concludes the strict real inequality
where is the real base-2 logarithm and is the real number 2 raised to the natural-number power . Since exactly, the conclusion is the same as
Because is an integer, this is equivalent to when .
The degenerate cases are as follows:
- : the logarithm is total, and the base-2 logarithm of is defined as . So the left side is and the conclusion holds for every , including .
- : , so the conclusion is again , which is automatically true.
- and : the conclusion is and roughly . Both hold for every natural number .
- : only here does the conclusion say anything. It requires when and when , and in general .
- : the conclusion holds exactly when .
- Empty : an injective map into an empty exists only if is also empty. Whether that can happen depends on the unseen definition of
Vertex. - Vacuous cases: if has more elements than , no injective exists and the statement is vacuous for that . It is also vacuous whenever
AnswersLeafQueriesIncannot be satisfied for a given , which cannot be judged without its definition. - Other binders: no hypothesis links to or to beyond the unseen predicate. No hypothesis restricts which nodes may point to, or requires any pointer to be present.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.