Lemma 4.16 —
ProvedExactPatternStream.lemma_4_16fingerprintingp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1pattern-matchingrandomized-algorithmsstreaming-algorithmsstring-algorithms
For every choice of the hash functions,
Wide levels are paid for by there being few of them; this is the telescoping behind the total.
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.16, p.13 (PDF 14).
`Σ_{0≤i<h} log(c_i + 2) = O(log m)`, for every choice of the hash functions.
**Formalization Note.** `O(log m)` is one absolute `K` before all variables, with `log₂` throughout. At `m = 1` the sum is empty. -/
theorem lemma_4_16 : ∃ K : ℝ, ∀ (F : GroupHash) (P T : List ℕ), 1 ≤ P.length → P.length ≤ T.length →
T.length ≤ 2 * P.length →
let B := build F P T
∑ i ∈ Finset.range (topIndex B), Real.logb 2 (((lvl B i).c : ℝ) + 2) ≤
K * Real.logb 2 P.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.16, p.13 (PDF 14)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.