Proof of Theorem 1 (p. 340) — at most nodes are accessible in steps or less
ProvedHarelTarjan.PointerLB.acc_encard_leConsider a list structure on an arbitrary (possibly infinite) collection of nodes, in which every node has two pointer fields, each containing a node or nil. For every node and every , the set of nodes accessible from in steps or less is finite and
This is "the key point" of the proof of Theorem 1: a pointer machine that has followed pointers from a node can have seen only exponentially many nodes in .
Formalization Note The cardinality is Set.encard, valued in , so the inequality also asserts finiteness. It is written as to avoid truncated subtraction.
import Mathlib import Definitions.Def_HarelTarjan_PointerLB_BinaryTree import Definitions.Def_HarelTarjan_PointerLB_PointerMachine
namespace HarelTarjan.PointerLB
theorem acc_encard_le {N : Type*} (ptr : N → Fin 2 → Option N) (a : N) (j : ℕ) :
(acc ptr j a).encard + 1 ≤ 2 ^ (j + 1) := 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, possibly infinite. Let assign to each node and field either a node or nil. Let and . The accessible set is:
The theorem asserts, with cardinality taken in :
Because , the statement implies that is finite, with at most elements.
Degenerate cases. For it states . There are no hypotheses, so the claim covers every pointer structure, including ones where every field is nil or where pointers form cycles.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.