Proof of Theorem 1 (pp. 340–341) —
ProvedHarelTarjan.PointerLB.sum_card_A_geLet be the complete binary tree of height with leaves, 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, and let be the set of leaves. Then
This double count of the occurrences of vertices in the sets is the lower half of the proof of Theorem 1; the upper half is the accessibility count .
Formalization Note With one has , and the inequality is stated as in (cardinalities are Set.encard), cleared of the division by . need not be injective.
import Mathlib import Definitions.Def_HarelTarjan_PointerLB_BinaryTree import Definitions.Def_HarelTarjan_PointerLB_PointerMachine
namespace HarelTarjan.PointerLB
theorem sum_card_A_ge {N : Type*} {h k : ℕ} (ptr : N → Fin 2 → Option N)
(rep : Vertex h → N) (hk : AnswersLeafQueriesIn ptr rep k) :
(h : ℕ∞) * 2 ^ h ≤ 2 * ∑ x ∈ leaves h, (A ptr rep k x).encard := by sorry
end HarelTarjan.PointerLB
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setup.
- , any node type , and a pointer structure with two fields per node, each holding a node or nil.
- An arbitrary map , not necessarily injective, from vertices of the height- complete binary tree to nodes. Vertices are boolean sequences of length ; leaves are those of length exactly .
- is the set of nodes reachable from via at most non-nil pointer fields, and
Hypothesis. For all leaves , some run of at most steps holds . The run starts holding , and each step adds a non-nil field of a held node. is the longest common prefix.
Conclusion. Computed in , with the sum over the leaves:
Degenerate cases.
- When , the left side is and the claim is trivial.
- Each is a subset of the finite vertex set, so no term is .
- The same caveats about non-injective and apply. If is constant, the hypothesis holds for every and every is the whole vertex set. For with injective and , the hypothesis is unsatisfiable.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.