Child ordinal and packed state at a pattern-row visit
ProvedExactPatternStream.ImplementationProof.pattern_group_visitexact-pattern-matchingstreaming-algorithmsword-ram
Let . Suppose the public pattern state is reading its flat-stage bank after symbols, and the next raw symbol reaches a row with a child. Its index lies strictly below the current top, and the top lies in the seeded hierarchy. The child is exactly the indexed pattern-tree label, the stage is the corresponding ordinal lane, and the packed row meanings before and after this visit represent consecutive child ordinals.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.ImplementationProof open DynBrooks MachineProof PackedRAM HashProof CounterProof SoundProof CompletenessProof OnlineReport GroupReader Dispatch
Formal statement
theorem ExactPatternStream.ImplementationProof.pattern_group_visit {σ p w : ℕ} (P T : List (Fin σ)) (s : Seeds σ P.length) (a : ZMod p)
(hm : 1≤ P.length) (mn : P.length≤ T.length) (twice : T.length≤2*P.length)
(j : ℕ) (hj : j< P.length) (fs rows top)
(prior : publicPatternState P T s a j=.reading fs rows top)
(ls : PatternBank LaneMemory) (f : FlatStage LeafItem LaneMemory) (rest : PatternBank LaneMemory) (x : Label) (tot : ℕ)
(vis : TextVisit ((2^w-1)/2) fs (.raw P[j].val) ls (f::rest) (some x) tot) :
let B:=seededBuild P T s
let i:=ls.length
let L:=lvl B i
let ord:=patternChildOrdinal P L fs i j
let base:=promotionHeapBase w σ P.length
let start:=trainedPayloadStart σ P.length T.length B i
i< top.index ∧ top.index≤ topIndex B ∧ ∃ hv : ord< L.P.length,
x=L.P[ord].label ∧ f=ordinalLane s T.length L L.P L.AP ord ∧
(∀ g,countedPatternMeaning P T s a w j i g=ordinalPayload s w T.length base start L L.P L.AP ord) ∧
(∀ g,countedPatternMeaning P T s a w (j+1) i g=ordinalPayload s w T.length base start L L.P L.AP (ord+1)) := by sorrySource
Gawrychowski, Janczewski, Jin and Nelson, An Improved Streaming Algorithm for Exact Pattern Matching, STOC 2027 submission, §9, Lemma 9.2, p. 29 (PDF p. 30). Derived implementation lemma in Stage.PatternGroupOrdinal, declaration pattern_group_visit.