The trained pattern loop places its bootstrap, return jump and text suffix
ProvedExactPatternStream.ImplementationProof.public_trained_bootstrap_sitesstreaming-algorithmsstring-algorithmsword-ram
In the public trained pattern program , choose any no-change address, sweep code, text code and optional raw exit. If , then for the instruction at is instruction of the bootstrap at . Immediately afterward,
For every , lookup at in equals lookup at in the supplied text code, including when that lookup is outside the code.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.ImplementationProof open DynBrooks MachineProof PackedRAM CounterProof HashProof SoundProof OnlineReport SeedRow MeasureTheory
Formal statement
theorem ExactPatternStream.ImplementationProof.public_trained_bootstrap_sites (noChange : ℕ) (sweep text : Program) (rawExit : Option ℕ := none) :
let setup:=(3312+sweep.length)+2858+4
let Q:=publicTrainedLoop noChange sweep text rawExit
(∀ i<199,Q[setup+i]?=(patternBootstrapCode setup)[i]?) ∧
Q[setup+199]?=some (.jmp 3310) ∧ Q[3310]?=some (.read 18) ∧
∀ i,Q[(setup+200)+i]?=text[i]? := by sorrySource
Derived word-RAM implementation lemma for 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). Accompanying Lean formalization, InProgress/Stage/PublicPatternLoopLayout.lean, lines 67–83.