Matching deadlines from a ready text-phase state
ProvedExactPatternStream.ImplementationProof.counted_windows_from_waitingexact-pattern-matchingstreaming-algorithmsword-ram
Let be the pattern and text, with lengths , , over an alphabet of size . The machine uses words of bits.
Suppose that after reading the matcher is waiting at its text-read address with empty output, the learned payload is ready, the write history lies in its arena and the row routines interpret every reachable text visit correctly. For a sufficiently large width multiplier, every text prefix of length completes with
answers. Each answer is the corresponding packet-matcher bit, and at the complete list is the seeded matcher's list. The coin cursor stays fixed. The heap remains in its arena and every feed obeys the logarithmic space bound.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.ImplementationProof open DynBrooks MachineProof PackedRAM CounterProof SoundProof SeedRow OnlineReport Dispatch
Formal statement
theorem ExactPatternStream.ImplementationProof.counted_windows_from_waiting (k : ℕ) : ∃ W : ℕ,∀ cw,W≤ cw → ∃ K : ℕ,
∀ {σ : ℕ} (P T : List (Fin σ)) (seed : Seeds σ P.length) (a : ZMod (residualPrime T.length P.length σ).val)
(sweep : Program) (row : ℕ→Program),1≤ P.length → P.length≤ T.length → T.length≤2*P.length → 3≤ T.length → σ≤ T.length^k →
let w:=cw*ell T.length
let B:=seededBuild P T seed
let Q:=countedPatternProgram sweep row
∀ (ω : Tape w) (z : Config w) (payload : ℕ→List Bool) (meaning : ℕ→TextRowMeaning LaneMemory),
streamState Q P T ω P.length=some z → z.pc=learnedReadAddress sweep → z.output=[] →
z.written⊆trainedParentArena w σ P.length T.length B (topIndex B) → TextPhaseReady P T seed a payload z →
CountedTextRowsAt P T seed a sweep row ω payload meaning → CountedTextWindows P T seed a Q ω K z.coinPos := by sorrySource
Gawrychowski, Janczewski, Jin and Nelson, An Improved Streaming Algorithm for Exact Pattern Matching, STOC 2027 submission, §9, Lemma 9.2, p. 29 (PDF p. 30). Derived implementation lemma in Stage.PatternLastWindows, declaration counted_windows_from_waiting.