Lemma 7.1 — one random map creates a false occurrence with probability
ProvedExactPatternStream.lemma_7_1fingerprintingp2o-gran-per-chapterp2o-plan-paperp2o-v1pattern-matchingrandomized-algorithmsstreaming-algorithmsstring-algorithms
Let be a finite field and , , . For a uniformly random ,
A single random linear map thus avoids all false positives at once with small error.
Differences from the source:
- 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_LinearMaps import Definitions.Def_ExactPatternStream_HashFamily
Formal statement
namespace ExactPatternStream
/-- Gawrychowski, Janczewski, Jin, Nelson, *An Improved Streaming Algorithm for Exact Pattern Matching* (preprint, STOC 2027 submission, sha256 351218cb…), Lemma 7.1, p.17 (PDF 18).
For a finite field `F` and vector strings `P ∈ (F³)^m`, `T ∈ (F³)^n`, `1 ≤ m ≤ n`, a uniform `(a, b) ∈ F²` has `Pr[Occ(P, T) ≠ Occ(M_{a,b}(P), M_{a,b}(T))] = O((n/m) log(2m)/|F|)`.
**Formalization Note.** `O(·)` is an absolute `K` before the field; `log₂`; the quotients are real. -/
theorem lemma_7_1 : ∃ K : ℝ, ∀ (F : Type*) [Field F] [Fintype F] [DecidableEq F]
(P T : List (Fin 3 → F)), 1 ≤ P.length → P.length ≤ T.length →
unifProb (fun s : F × F => occ P T ≠ occ (P.map (mab s.1 s.2)) (T.map (mab s.1 s.2))) ≤
K * ((T.length : ℝ) / P.length) * Real.logb 2 (2 * P.length) / (Fintype.card F : ℝ) := by sorry
end ExactPatternStream
Source
Gawrychowski, Janczewski, Jin, Nelson, An Improved Streaming Algorithm for Exact Pattern Matching (preprint, STOC 2027 submission, sha256 351218cb…), Lemma 7.1, p.17 (PDF 18)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.