The first promoted row initializes the packed pattern pass
ProvedExactPatternStream.ImplementationProof.pattern_first_storestreaming-algorithmsstring-algorithmsword-ram
Fix an alphabet exponent . One constant suffices for every input of lengths , , every alphabet of size and every word width . Suppose the root count is , the first promotion is present, and the machine enters the bootstrap code at address with the prescribed parameter registers and promotion storage. On any tape it reaches a configuration with
Its packed store represents the first pattern pass at height one, with the promoted row in slot zero and all other slots empty. The specified registers retain their values. Outside the second hash field, the row agrees bit for bit with the canonical initial promotion row.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.ImplementationProof open DynBrooks MachineProof PackedRAM CounterProof SoundProof OnlineReport HashProof SeedRow
Formal statement
theorem ExactPatternStream.ImplementationProof.pattern_first_store (k : ℕ) : ∃ C : ℕ,∀ {w σ e : ℕ} {Q : Program}
(P T : List (Fin σ)) (seed : Seeds σ P.length) (hm : 1≤ P.length) (mn : P.length≤ T.length)
(twice : T.length≤2*P.length) (hn : 3≤ T.length) (alpha : σ≤ T.length^k) (wide : C*ell T.length≤ w)
(j : ℕ) (lt : j< P.length) (live : 1≤ topIndex (seededBuild P T seed)) (count : (lvl (seededBuild P T seed) 0).c=j)
(ω : Tape w) (c : Config w) (site : PatternBootstrapAt Q e) (pc : c.pc=e),
let m:=P.length
let n:=T.length
let B:=seededBuild P T seed
let g:=w/(2*hashQ (hashB σ m))
(c.mem 170).toNat=n → (c.mem 171).toNat=σ → (c.mem 32).toNat=m-1 →
(c.mem 258).toNat=j → (c.mem 194).toNat=g → (c.mem 14).toNat=1 →
(c.mem 192).toNat=hashPrime (hashB σ m) → (c.mem 193).toNat=blockLen σ m → FirstPromotionStorage P T seed c →
∃ z row initial,BootExec Q ω c z ∧ z.pc=e+199 ∧ PatternPassStorage P T seed 1 z (Function.update (fun _=>[]) 0 row) initial ∧
(∀ r,r<18 ∨ 18≤ r ∧ r<75 ∨ 75< r ∧ r<141 ∨ 141< r ∧ r<327 ∨ 368≤ r → z.mem r=c.mem r) ∧
∀ u< row.length, u< countHashBits σ m 0 (lvl B 0).c ∨ 2*countHashBits σ m 0 (lvl B 0).c≤ u →
row[u]?.getD false=(promotionInitialRow (w:=w) P T seed 0)[u]?.getD false := 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/PatternPassFirstStore.lean, lines 13–77.