Proof of Theorem 1 (p. 340) — a query answered in steps reaches only nodes accessible in steps
ProvedHarelTarjan.PointerLB.answered_mem_accConsider a list structure in which every node has two pointer fields. Let be the input nodes of a query and a node. If the query with answer can be answered in steps, that is, some run of at most pointer-following steps from holds a pointer to , then
where is the set of nodes accessible from in steps or less.
Contrapositively, a node accessible from neither input in steps cannot be returned in steps. This is the step from the machine to accessibility in the proof of Theorem 1: "w would be accessible from neither x nor y in k steps, and an nca query on x and y would be unanswerable in k steps."
import Mathlib import Definitions.Def_HarelTarjan_PointerLB_BinaryTree import Definitions.Def_HarelTarjan_PointerLB_PointerMachine
namespace HarelTarjan.PointerLB
theorem answered_mem_acc {N : Type*} (ptr : N → Fin 2 → Option N) (a b target : N) (k : ℕ)
(hans : AnsweredIn ptr a b target k) :
target ∈ acc ptr k a ∪ acc ptr k b := by sorry
end HarelTarjan.PointerLB
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be any type of nodes. Let be a pointer structure: it assigns to each node and field either a node or nil. Let , and be nodes, and let .
The accessible sets are defined by:
A run works as follows:
- It starts at step holding the list .
- Each step picks a held node and a field with non-nil, and adds to the held list.
Hypothesis: some run of steps holds .
Conclusion:
Degenerate cases. With , the hypothesis means , and the conclusion is the same statement. If , the conclusion is . No finiteness or other condition is placed on or .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.