Semantic invariants of the streaming complement protocol #
This module interprets the protocol's canonical row scans in the finite ranked graph of
width-preserving source configurations. It is deliberately independent of the later LBA
compiler: all arguments concern ProtocolStep and finite graph reachability.
The source row carried by a protocol run.
Equations
- CertifiedRowSystem.Complement.protocolSource D input = List.map D.inputCell input
Instances For
The source vertex in the ranked width-|input| graph.
Equations
Instances For
Bounded reachability in the ranked source graph.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A plateau layer is the complete reflexive-transitive reachable set.
A strict cardinal increase leaves room for the following depth numeral.
Source rejection can be stated entirely in the finite ranked graph.
Vertices already classified before the current outer enumeration position.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Boolean accumulated while scanning old-reachable predecessors of one outer vertex.
Equations
- CertifiedRowSystem.Complement.foundFrom D input outer selected = decide (∃ inner ∈ selected, inner = outer ∨ CertifiedRowSystem.Complement.rankEdge D input.length inner outer)
Instances For
If the selected inner scan is exactly the old reachable layer, its accumulated flag is precisely membership in the next reachable layer.
Extending the outer prefix classifies exactly its new rank.
Cardinal form of classifiedPrefix_succ.
Semantic states of a protocol run #
A nonempty row cannot carry two different replicated phases.
Tracks shared by every state inside one inductive-counting round.
Instances For
Transcript of the partial canonical inner scan for one outer vertex. selected
contains precisely the old-reachable rows for which a path witness was supplied so far;
soundness only needs the subset and cardinal facts recorded here.
Instances For
A boundary state at the start of a counting round.
- phase : HasPhase ProtocolPhase.roundStart row
Instances For
A state ready either to skip the current inner row or start its path witness.
- phase : HasPhase ProtocolPhase.chooseInner row
Instances For
State inside a bounded path witness for the current inner row.
- phase : HasPhase ProtocolPhase.path row
Instances For
The inner enumeration has overflowed and the current outer classification is ready to be committed. A malformed run may arrive here with too few witnesses; the next action's exact-count check then blocks it.
- phase : HasPhase ProtocolPhase.finishOuter row
Instances For
Boundary state after every outer vertex has been classified.
- phase : HasPhase ProtocolPhase.finishRound row
Instances For
Tracks shared by the final all-nonfinal scan after an exact count plateau.
Instances For
Partial transcript of the final canonical scan.
- found_false : HasFound false row
Instances For
State ready to skip or witness the current row in the final scan.
- found_false : HasFound false row
- phase : HasPhase ProtocolPhase.finalChoose row
Instances For
State inside a final-scan reachability witness.
- found_false : HasFound false row
- phase : HasPhase ProtocolPhase.finalPath row
Instances For
The final enumeration has overflowed and awaits its exact-count check.
- found_false : HasFound false row
- phase : HasPhase ProtocolPhase.finalFinish row
Instances For
Local preservation lemmas #
The canonical boot target is the initial exact count state (depth = 0, count
= 1).
Entering a round creates the empty inner-scan transcript at outer and inner rank zero.
Skipping the current inner row advances its canonical rank. The last rank moves
to finishOuter; every earlier rank stays in chooseInner.
Committing an exhaustively checked outer row advances the outer enumeration and the exact next-layer count.
Finishing an exact count round either records a genuine plateau and starts the final scan, or advances to the next exact depth/count pair.
Skipping a row in the final scan advances the same canonical enumeration.
The exact final scan proves that every globally reachable ranked row is nonfinal.
Full semantic invariant covering every control phase of a protocol run.
- input {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} : ProtocolInvariant D input (List.map (inputProtocolCell D.inputCell) input)
- roundStart {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth count : ℕ} : RoundStartInvariant D input row depth count → ProtocolInvariant D input row
- chooseInner {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth oldCount newCount outerIndex innerIndex : ℕ} {selected : Finset (RankVertex A input.length)} : ChooseInnerInvariant D input row depth oldCount newCount outerIndex innerIndex selected → ProtocolInvariant D input row
- countingPath {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth oldCount newCount outerIndex innerIndex : ℕ} {selected : Finset (RankVertex A input.length)} {pathIndex fuel : ℕ} : CountingPathInvariant D input row depth oldCount newCount outerIndex innerIndex selected pathIndex fuel → ProtocolInvariant D input row
- finishOuter {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth oldCount newCount outerIndex : ℕ} {selected : Finset (RankVertex A input.length)} : FinishOuterInvariant D input row depth oldCount newCount outerIndex selected → ProtocolInvariant D input row
- finishRound {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth oldCount newCount : ℕ} : FinishRoundInvariant D input row depth oldCount newCount → ProtocolInvariant D input row
- finalChoose {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth count innerIndex : ℕ} {selected : Finset (RankVertex A input.length)} : FinalChooseInvariant D input row depth count innerIndex selected → ProtocolInvariant D input row
- finalPath {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth count innerIndex : ℕ} {selected : Finset (RankVertex A input.length)} {pathIndex fuel : ℕ} : FinalPathInvariant D input row depth count innerIndex selected pathIndex fuel → ProtocolInvariant D input row
- finalFinish {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} {depth count : ℕ} {selected : Finset (RankVertex A input.length)} : FinalFinishInvariant D input row depth count selected → ProtocolInvariant D input row
- accept {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] {D : CertifiedRowSystem I A Unit Q F} {input : List I} {row : ProtocolRow A} : SourceRejects D input → HasPhase ProtocolPhase.accept row → List.length row = input.length → ProtocolInvariant D input row
Instances For
Compiled versus semantic protocol reachability #
Replacing the integrated finite scanner by its declarative action union preserves all finite protocol runs.
Membership in the compiled deterministic-source complement is semantic protocol acceptance, together with the certified-row model's nonempty-input convention.