First promotion and later locks hold on the same random tapes
ProvedExactPatternStream.ImplementationProof.public_pattern_loop_jointstreaming-algorithmsstring-algorithmsword-ram
Fix an alphabet exponent and a minimum multiplier . One can choose and constants uniformly over patterns and texts with , and . At word width , the hierarchy hash prime and residual modulus fit. For every choice of the no-change address, sweep code, cache initialization, text code and optional raw exit, the canonical tape draw has the uniform joint law of hierarchy seeds and a residual field element. Under the same tape measure,
The first handoff uses the program’s actual setup and raw-exit addresses. The lock handoff uses its callback and dispatcher, with the respective space constants and .
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_pattern_loop_joint (k : ℕ) (minimum : ℕ := 0) : ∃ cw K₀ K₁ : ℕ, minimum≤ cw ∧ ∀ {σ : ℕ}
(P T : List (Fin σ)) (hm : 1≤ P.length),P.length≤ T.length → T.length≤2*P.length →
3≤ T.length → σ≤ T.length^k → ∀ (noChange : ℕ) (sweep cacheInit text : Program) (rawExit : Option ℕ),
let m:=P.length
let n:=T.length
let w:=cw*ell n
let pr : ℕ:=residualPrime n m σ
letI : NeZero pr:=⟨(residualPrime n m σ).property.ne_zero⟩
let callback:=3312+sweep.length
let dispatch:=callback+2858
let setup:=dispatch+4
let trained:=setup+cacheInit.length+1
let Q:=publicPatternLoop noChange sweep cacheInit text rawExit
∃ (hf : hashPrime (hashB σ m)≤2^w) (rf : pr≤2^w),
let Φ:=fun ω=>((filledSeedDraw σ m pr w hf rf).run ω).1
(∀ E : Set (Seeds σ m×ZMod pr),MeasurableSet (Φ ⁻¹' E) ∧
coinMeasure w (Φ ⁻¹' E)=ENNReal.ofReal (unifProb (fun z=> z∈E))) ∧
∀ᵐ ω ∂coinMeasure w,PublicBootHandoff P T hm Q setup (rawExit.getD trained) K₀ ω (Φ ω) ∧
PublicLockHandoff P T Q callback dispatch K₁ ω (Φ ω) := 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/AlternatePublicLoop.lean, lines 65–115.