Lemma 1 — the height of is the largest with
ProvedHarelTarjan.SymOrder.lemma1_height_eq_max_pow_two_dvdbinary-treenumber-theoryp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1trees
Let be the complete binary tree of depth , numbered in symmetric order. The height of a vertex is the largest integer such that divides :
Lemma 1 lets the height of a vertex be read off its number, the 2-adic valuation of .
Preamble
import Mathlib import Definitions.Def_HarelTarjan_SymOrder_Tree import Definitions.Def_HarelTarjan_SymOrder_Sym
Formal statement
namespace HarelTarjan.SymOrder
/-- Lemma 1 (p. 342): the height of a vertex `v` is the largest integer `h` such that `2^h`
divides `sym(v)`. -/
theorem lemma1_height_eq_max_pow_two_dvd {d : ℕ} (v : Vertex d) :
2 ^ height v ∣ sym v ∧ ¬ 2 ^ (height v + 1) ∣ sym v := by sorry
end HarelTarjan.SymOrder
Source
Harel, Tarjan, Fast Algorithms for Finding Nearest Common Ancestors, SIAM J. Comput. 13 (1984), p. 342, Lemma 1
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
This theorem relates height to divisibility of . Let and let be the set of boolean sequences of length . The height of is . The number counts the with . The key replaces false by and true by and appends , and the order is lexicographic with a proper prefix counting as smaller.
For every vertex , the theorem asserts
In other words, is exactly the exponent of in .
Degenerate cases:
- Leaves have , so the claim there is that is odd.
- For , the claim is that the root's number, , is odd.
- Since , the case " divides " never arises.
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.