One uniform seed experiment covers every pattern exit of the counted matcher
ProvedExactPatternStream.ImplementationProof.counted_public_pattern_outcomesexact-pattern-matchingstreaming-algorithmsword-ram
For each polynomial alphabet bound and minimum word multiplier, the counted matching program has one word width and uniform constants for its pattern phase. The joint seeds obtained from the random tape have the prescribed uniform law. With probability one, that same draw gives the homogeneous-pattern text windows, the first pattern read, the final change, and the handoff at every positive prefix lock.
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.counted_public_pattern_outcomes (k minimum : ℕ) : ∃ cw Kread Klock Klast : ℕ,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 → ∀ (sweep : Program) (row : ℕ→Program),
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 Q:=countedPatternProgram sweep row
let callback:=3312+sweep.length
∃ (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 s=> s∈E))) ∧
∀ᵐ ω ∂coinMeasure w,PublicHomogeneousWindows P T hm Q ω ∧
PublicFirstPatternRead P T hm Q Kread ω (Φ ω) ∧
PublicFinalChange P T hm Q (learnedReadAddress sweep) Klast ω (Φ ω) ∧
PublicPrefixLockHandoff P T Q callback (callback+2858) Klock ω (Φ ω) := 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 counted_public_pattern_outcomes in InProgress/Stage/AlternatePublicOutcomes.lean, line 39.