Lemma 4.15 — , ,
ProvedExactPatternStream.lemma_4_15fingerprintingp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1pattern-matchingrandomized-algorithmsstreaming-algorithmsstring-algorithms
For every choice of the hash functions, the number of levels satisfies , and for every ,
These bounds underlie the space analysis, Lemma 4.16, and the degree count of Lemma 7.7.
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
- encoding: of the form (6), "specified in Section 7.3" → an arbitrary argument
F, with values ; reason: §§4–5 of the source are written for any such , and (14) is one - encoding: an alphabet → characters are natural numbers; reason: every finite alphabet embeds
- encoding: → one absolute before all variables, with ; reason: the same bounds up to a constant
Preamble
import Mathlib import Definitions.Def_ExactPatternStream_Strings import Definitions.Def_ExactPatternStream_Pad import Definitions.Def_ExactPatternStream_ParseTree import Definitions.Def_ExactPatternStream_Build
Formal statement
namespace ExactPatternStream
/-- Gawrychowski, Janczewski, Jin, Nelson, *An Improved Streaming Algorithm for Exact Pattern Matching* (preprint, STOC 2027 submission, sha256 351218cb…), Lemma 4.15, p.12 (PDF 13).
`h = O(log m)`, and the unrolled strings grow by at most a factor `2` per level, for every choice of the hash functions.
**Formalization Note.** `O(log m)` is one absolute `K` before all variables, with `log₂`. At `m = 1`, `log₂ m = 0` and indeed `h = 0`, as `$ ◦ P` is a single run after the guard. -/
theorem lemma_4_15 : ∃ K : ℝ, ∀ (F : GroupHash) (P T : List ℕ), 1 ≤ P.length → P.length ≤ T.length →
T.length ≤ 2 * P.length →
let B := build F P T
(topIndex B : ℝ) ≤ K * Real.logb 2 P.length ∧
∀ i ≤ topIndex B,
(lvl B i).Pbar.length ≤ 2 ^ (i + 1) * P.length ∧
(lvl B i).Tbar.length ≤ 2 ^ i * T.length := by sorry
end ExactPatternStream
Source
Gawrychowski, Janczewski, Jin, Nelson, An Improved Streaming Algorithm for Exact Pattern Matching (preprint, STOC 2027 submission, sha256 351218cb…), Lemma 4.15, p.12 (PDF 13)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.