Observation 4.8 — the root path of the LPF′-tree spells LZ77(S)
ProvedDynLZ77.Main.observation_4_8lempel-zivp2o-gran-per-chapterp2o-plan-paperp2o-v1string-algorithms
Let be the path from node to the root of the LPF′-tree . The number of edges of is
and for every , if the -th edge of is , then the -th phrase of is . In Lean, the -th edge starts at pathNode S (k-1), and the first clause says that the walk of edges from ends at the root, i.e. it is . This is the link that lets a dynamic tree on answer LZ77-queries.
Differences from the source:
- encoding: π, the path from 1 to the root, with |π| = depth_S(1) → pathNode S (depth S 1) = |S| + 1, and the k-th edge starts at pathNode S (k − 1); reason: states explicitly that the depth_S(1)-edge walk from 1 is the root path
- encoding: the kth phrase is equal to S[i..i + LPF′_S(i)) → the kth entry of LZ77 S is the position pair (i, i + LPF′_S(i) − 1); reason: phrases are kept with their positions, which is the paper's meaning of a phrase S[a..b]
Preamble
import Mathlib import Definitions.Def_DynLZ77_Main_Strings import Definitions.Def_DynLZ77_Main_Structure set_option autoImplicit false
Formal statement
namespace DynLZ77.Main
/-- **Observation 4.8** (p. 18). The path `π` from node `1` to the root `n + 1` of the LPF′-tree
has `depth_S(1) = |LZ77(S)|` edges, and for `k ≤ |π|`, if the `k`-th edge of `π` is
`(i, i + LPF′_S(i))` then the `k`-th phrase of `LZ77(S)` is `S[i..i + LPF′_S(i))`. -/
theorem observation_4_8 {α : Type} [DecidableEq α] (S : List α) :
pathNode S (depth S 1) = S.length + 1 ∧ depth S 1 = (LZ77 S).length ∧
∀ k : ℕ, 1 ≤ k → k ≤ depth S 1 →
(LZ77 S)[k - 1]? =
some (pathNode S (k - 1), pathNode S (k - 1) + lpf' S (pathNode S (k - 1)) - 1) := by sorry
end DynLZ77.Main
Source
Boneh, Fried, Golan, Kraus, Dynamic LZ77: No Space for Improvement, STOC 2027 submission (manuscript sha256 2a15e146…), p. 18 (PDF 20), Observation 4.8
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.