Complementing certified row systems #
This module implements the inductive-counting construction used to complement the
reachability language of a finite CertifiedRowSystem.
The source system is first determinized by CertifiedRowSystem.determinize. Its
certificate alphabet is then Unit, and its verifier state after an aligned row scan is
the exact set of every source-verifier state reachable by a certificate prefix. Thus an
edge and the absence of an edge are both synchronous finite-state checks.
The complement protocol stores a constant number of tracks in each row cell. Vertex and
fuel tracks use the source row alphabet; count tracks use radix Fintype.card A + 1, so a
nonempty width-n row can represent every count up to (Fintype.card A) ^ n. All tracks
are least-significant-cell first and are scanned using RowNumeral.
The semantic finite graph #
A fixed-width source row, represented without a length proof in every operation.
Equations
- CertifiedRowSystem.Complement.FixedRow A n = (Fin n → A)
Instances For
The finite directed graph on width-n rows induced by the source row relation.
Equations
- CertifiedRowSystem.Complement.rowEdge S old new = S.RowStep old.toList new.toList
Instances For
The source final predicate on a fixed-width row.
Equations
- CertifiedRowSystem.Complement.rowFinal S row = S.Final row.toList
Instances For
The fixed-width source row obtained from an input row.
Equations
- CertifiedRowSystem.Complement.inputRow S input = S.inputCell ∘ input
Instances For
The abstract counting certificate characterizes absence of a reachable final row in
the finite graph of width-n source rows. This theorem is the semantic target of the
streaming certified-row protocol below.
Streaming protocol storage #
Canonical numbering of an arbitrary nonempty finite source alphabet.
Equations
- CertifiedRowSystem.Complement.vertexCodec A = { toFin := Fintype.equivFin A }
Instances For
Counter digits have one more value than the source alphabet. Consequently a
width-n > 0 counter can store the number of all width-n source rows.
Equations
Instances For
Canonical codec for count digits.
Equations
Instances For
The count radix is genuinely larger than one whenever the source alphabet is nonempty.
Control phases of the streaming inductive-counting protocol.
chooseInner performs the canonical scan over possible old-reachable vertices. A
positive choice enters path, which guesses a source path bounded by depth. Once every
inner vertex has been considered, finishOuter classifies the current outer vertex and
updates the next count. finishRound advances the depth enumeration. The last two phases
perform the all-nonfinal scan justified by the final exact count.
- input : ProtocolPhase
- roundStart : ProtocolPhase
- chooseInner : ProtocolPhase
- path : ProtocolPhase
- finishWitness : ProtocolPhase
- finishOuter : ProtocolPhase
- finishRound : ProtocolPhase
- finalChoose : ProtocolPhase
- finalPath : ProtocolPhase
- finalWitness : ProtocolPhase
- finalFinish : ProtocolPhase
- accept : ProtocolPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Source-alphabet tracks grouped to keep finite-instance synthesis shallow.
- source : A
- depth : A
- outer : A
- inner : A
- path : A
- fuel : A
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Larger-radix counter tracks.
- oldCount : CountDigit A
- newCount : CountDigit A
- seenCount : CountDigit A
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
One physical cell of the complement protocol.
source is immutable. depth, outer, inner, path, and fuel are source-radix
row numerals. oldCount, newCount, and seenCount use the strictly larger count radix.
The phase and Boolean flag are replicated; the verifier enforces uniformity on every scan.
- vertex : VertexTracks A
- counter : CounterTracks A
- found : Bool
- phase : ProtocolPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
A protocol row has one cell per source/input cell.
Equations
Instances For
The phase is replicated across the complete row.
Equations
- CertifiedRowSystem.Complement.HasPhase phase row = ∀ cell ∈ row, cell.phase = phase
Instances For
Extract the immutable source track.
Equations
- CertifiedRowSystem.Complement.sourceTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.vertex.source) row
Instances For
Extract the current counting depth.
Equations
- CertifiedRowSystem.Complement.depthTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.vertex.depth) row
Instances For
Extract the exact count from the preceding round.
Equations
- CertifiedRowSystem.Complement.oldCountTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.counter.oldCount) row
Instances For
Extract the accumulating next-round count.
Equations
- CertifiedRowSystem.Complement.newCountTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.counter.newCount) row
Instances For
Extract the number of old-reachable vertices selected in the current canonical scan.
Equations
- CertifiedRowSystem.Complement.seenCountTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.counter.seenCount) row
Instances For
Extract the outer vertex being classified.
Equations
- CertifiedRowSystem.Complement.outerTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.vertex.outer) row
Instances For
Extract the old vertex currently considered by the inner scan.
Equations
- CertifiedRowSystem.Complement.innerTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.vertex.inner) row
Instances For
Extract the current row of a guessed source path.
Equations
- CertifiedRowSystem.Complement.pathTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.vertex.path) row
Instances For
Extract the length of the guessed path.
Equations
- CertifiedRowSystem.Complement.fuelTrack row = List.map (fun (cell : CertifiedRowSystem.Complement.ProtocolCell A) => cell.vertex.fuel) row
Instances For
Extract the replicated inclusion flag.
Equations
Instances For
All replicated found flags have the specified value.
Equations
- CertifiedRowSystem.Complement.HasFound found row = ∀ cell ∈ row, cell.found = found
Instances For
Shape invariant shared by every protocol phase.
- uniform_phase : ∃ (phase : ProtocolPhase), HasPhase phase row
Instances For
The input image stores the source row and initializes every work track to zero. The
first protocol transition changes oldCount from the all-zero input image to the
LSD-first numeral one; doing this in a transition lets the finite verifier identify the
first cell.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Predicate describing the canonical initialized row after the boot transition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One initialized protocol cell. The first cell stores the least-significant digit one of the initial reachable count; every later count digit is zero.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Canonical initialized protocol row for a nonempty source row.
Equations
Instances For
The canonical initialized row satisfies every initialization invariant.
A transition label is repeated in the certificate row. The finite verifier rejects if different cells request different actions.
- boot : ProtocolAction
- beginRound : ProtocolAction
- beginFinal : ProtocolAction
- skipInner : ProtocolAction
- startPath : ProtocolAction
- pathStep : ProtocolAction
- finishWitness : ProtocolAction
- finishOuter : ProtocolAction
- finishRound : ProtocolAction
- finalSkip : ProtocolAction
- finalStartPath : ProtocolAction
- finalPathStep : ProtocolAction
- finalFinishWitness : ProtocolAction
- finalFinish : ProtocolAction
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.