Lemma 8.4 — one step of the descent
ProvedExactPatternStream.lemma_8_4fingerprintingp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1pattern-matchingrandomized-algorithmsstreaming-algorithmsstring-algorithms
Let and . If (20) holds at , then, for ,
A candidate at level thereby descends to a candidate at level with the same raw endpoint, and at level a candidate is a true occurrence.
Differences from the source:
- generalization: the standing assumptions of footnote 1 and of p.1 → every (with ) and every alphabet size; reason: the proof uses no lower bound on and no bound on (only and ), and the source case is included
- generalization: of (14), fixed by §7 → an arbitrary
Fof the form (6); reason: the proof uses only that a label is a function of the labels of its group, so (14) is a special case - encoding: an alphabet → characters are natural numbers; reason: every finite alphabet embeds
- encoding: → a preimage in exists and every preimage has the two properties; reason: is a bijection on (p.11), so this is the same statement
Preamble
import Mathlib import Definitions.Def_ExactPatternStream_Strings import Definitions.Def_ExactPatternStream_Pad import Definitions.Def_ExactPatternStream_ParseTree import Definitions.Def_ExactPatternStream_Build import Definitions.Def_ExactPatternStream_Candidates
Formal statement
namespace ExactPatternStream
/-- Gawrychowski, Janczewski, Jin, Nelson, *An Improved Streaming Algorithm for Exact Pattern Matching* (preprint, STOC 2027 submission, sha256 351218cb…), Lemma 8.4, p.24 (PDF 25).
Let `0 ≤ i < h` and `x_{i+1} ∈ M_{i+1}`. If (20) holds at `(i + 1, x_{i+1})`, then for `x_i = jump_i^{-1}(x_{i+1})`, `x_i ∈ M_i` and `γ_i(e_i(x_i)) = γ_{i+1}(e_{i+1}(x_{i+1}))`.
**Formalization Note.** Holds for every choice of the hash functions. `jump_i^{-1}` is spelled out: a preimage in `U^(T)_i` exists (p.22), and every preimage has the two properties. -/
theorem lemma_8_4 (F : GroupHash) (P T : List ℕ) (hm : 1 ≤ P.length) (hmn : P.length ≤ T.length)
(hn : T.length ≤ 2 * P.length) :
let B := build F P T
∀ i < topIndex B, ∀ y ∈ (lvl B (i + 1)).Mi, Implication20 (lvl B i) (lvl B (i + 1)) y →
(∃ x ∈ (lvl B i).UT, (lvl B i).jump x = y) ∧
∀ x ∈ (lvl B i).UT, (lvl B i).jump x = y →
x ∈ (lvl B i).Mi ∧
(lvl B i).γ ((lvl B i).e x) = (lvl B (i + 1)).γ ((lvl B (i + 1)).e y) := by sorry
end ExactPatternStream
Source
Gawrychowski, Janczewski, Jin, Nelson, An Improved Streaming Algorithm for Exact Pattern Matching (preprint, STOC 2027 submission, sha256 351218cb…), Lemma 8.4, p.24 (PDF 25)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.