The final probe and digest of batch pattern training
ProvedExactPatternStream.ImplementationProof.batch_terminal_probeexact-pattern-matchingstreaming-algorithmsword-ram
Let and be strings of lengths over an alphabet of size . Fix the hierarchy seeds and a residual fingerprint point . Write for the last level of the resulting hierarchy and choose a starting level with a training budget satisfying
Start batch training on the head and tail of level , with any previously learned row list and the zero initial digest. Its final probe and digest equal the pair obtained by a single discovery scan of the head and tail at level . This identifies the terminal state that the pattern pass must produce.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.ImplementationProof open OnlineReport SoundProof CompletenessProof Dispatch
Formal statement
theorem ExactPatternStream.ImplementationProof.batch_terminal_probe {σ p : ℕ} (P T : List (Fin σ)) (seed : Seeds σ P.length)
(a : ZMod p) (hm : 1≤ P.length) (hmn : P.length≤ T.length) (hn : T.length≤2*P.length)
(fuel j : ℕ) (reach : j≤ topIndex (seededBuild P T seed))
(cap : topIndex (seededBuild P T seed)≤ j+fuel) (rows : List LearnedRow) :
let B := seededBuild P T seed
let L := lvl B j
let D := lvl B (topIndex B)
let z := batchTraining (canonicalRowInstaller seed T.length) a fuel L.i L.w rows
(.symbol (patternHead L)) (0,0) (patternTail L)
(z.probe,z.digest)=(discoverDigest a (.symbol (patternHead D)) (0,0) (patternTail D)).1 := by sorrySource
Gawrychowski, Janczewski, Jin and Nelson, An Improved Streaming Algorithm for Exact Pattern Matching, STOC 2027 submission 1330, §9, Lemma 9.2, p. 29 (PDF p. 30). Derived implementation lemma in Stage/TrainingTerminalProbe.lean, line 11, batch_terminal_probe.