Langlib

Langlib.Automata.LinearBounded.CertifiedRowSystem.Complement.PathActionConstructors

Converse constructors for path-action specifications #

PathActions.lean projects accepted componentwise scans to track equalities. The lemmas here prove the converse direction needed to build canonical accepting runs: the same track equations imply every cell-local check.

Track equalities characterize the componentwise path-start action exactly.

Persistent-track equations plus the three global numeral/path checks construct an accepted path-step action.

theorem CertifiedRowSystem.Complement.isFinishWitness_of_tracks {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] [DecidableEq A] (D : CertifiedRowSystem I A Unit Q F) (old new : ProtocolRow A) (edgeState : Q) (innerState : RowNumeral.CarryState) (oldFound newFound : Bool) (newPhase : ProtocolPhase) (holdNe : old []) (htracks : List.length old = List.length new HasPhase ProtocolPhase.path old sourceTrack new = sourceTrack old depthTrack new = depthTrack old outerTrack new = outerTrack old pathTrack new = (vertexCodec A).zeroRow (List.length new) fuelTrack new = (vertexCodec A).zeroRow (List.length new) oldCountTrack new = oldCountTrack old newCountTrack new = newCountTrack old) (hedge : D.evalStep D.stepStart (innerTrack old) (outerTrack old) (List.replicate (List.length old) ()) = some edgeState) (hpath : pathTrack old = innerTrack old) (hfuel : fuelTrack old = depthTrack old) (hseen : (countCodec A).evalSucc RowNumeral.CarryState.carry (seenCountTrack old) (seenCountTrack new) = some RowNumeral.CarryState.done) (hinner : (vertexCodec A).evalSucc RowNumeral.CarryState.carry (innerTrack old) (innerTrack new) = some innerState) (hphase : innerState = RowNumeral.CarryState.done newPhase = ProtocolPhase.chooseInner innerState = RowNumeral.CarryState.carry newPhase = ProtocolPhase.finishOuter) (holdFound : HasFound oldFound old) (hnewFound : HasFound newFound new) (hnewPhase : HasPhase newPhase new) (hfound : newFound = (oldFound || decide (innerTrack old = outerTrack old) || D.stepDone edgeState)) :
IsFinishWitness D old new

Construct the exact ordinary witness-completion specification from its track, successor, uniformity, and source-verifier facts.

theorem CertifiedRowSystem.Complement.isFinalWitness_of_tracks {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} [Fintype A] [Nonempty A] [DecidableEq A] (D : CertifiedRowSystem I A Unit Q F) (old new : ProtocolRow A) (finalState : F) (innerState : RowNumeral.CarryState) (newPhase : ProtocolPhase) (holdNe : old []) (htracks : List.length old = List.length new HasPhase ProtocolPhase.finalPath old sourceTrack new = sourceTrack old depthTrack new = depthTrack old outerTrack new = outerTrack old pathTrack new = (vertexCodec A).zeroRow (List.length new) fuelTrack new = (vertexCodec A).zeroRow (List.length new) oldCountTrack new = oldCountTrack old newCountTrack new = newCountTrack old foundTrack new = foundTrack old) (hfinal : D.evalFinal D.finalStart (innerTrack old) = finalState) (hpath : pathTrack old = innerTrack old) (hfuel : fuelTrack old = depthTrack old) (hseen : (countCodec A).evalSucc RowNumeral.CarryState.carry (seenCountTrack old) (seenCountTrack new) = some RowNumeral.CarryState.done) (hinner : (vertexCodec A).evalSucc RowNumeral.CarryState.carry (innerTrack old) (innerTrack new) = some innerState) (hphase : innerState = RowNumeral.CarryState.done newPhase = ProtocolPhase.finalChoose innerState = RowNumeral.CarryState.carry newPhase = ProtocolPhase.finalFinish) (hnewPhase : HasPhase newPhase new) (hfinalDone : D.finalDone finalState = false) :
IsFinalWitness D old new

Construct the exact final-scan witness-completion specification.