Langlib

Langlib.Automata.LinearBounded.CertifiedRowSystem.Complement.PathActions

Path actions for the certified-row complement protocol #

These scanners implement the path-witnessing part of inductive counting. The source system supplied here has Unit certificates; in the complete construction it is the subset-construction system CertifiedRowSystem.determinize.

Small scanner utilities #

Extend a possibly-unset replicated bit, rejecting a disagreement.

Equations
Instances For

    Extend a possibly-unset replicated phase, rejecting a disagreement.

    Equations
    Instances For

      State of a uniform-value scan. bad is distinct from the initially unset state, so a disagreement cannot be erased by a later matching cell.

      Instances For
        Equations
        Instances For
          @[simp]
          theorem CertifiedRowSystem.Complement.scanBits_mismatch (expected bit : Bool) (bits : List Bool) (h : bit expected) :

          A disagreement is an absorbing rejection for the replicated-bit scanner.

          @[simp]
          theorem CertifiedRowSystem.Complement.scanPhases_mismatch (expected phase : ProtocolPhase) (phases : List ProtocolPhase) (h : phase expected) :
          scanPhases (UniformScan.value expected) (phase :: phases) = UniformScan.bad

          A disagreement is an absorbing rejection for the replicated-phase scanner.

          @[simp]

          Regression test: a later matching bit cannot erase an earlier disagreement.

          def CertifiedRowSystem.Complement.noteEq {A : Type u_2} [DecidableEq A] (ok : Bool) (old new : A) :

          Equality accumulator for an aligned pair of tracks.

          Equations
          Instances For
            def CertifiedRowSystem.Complement.checkPairs {α : Type u_5} {β : Type u_6} (p : αβBool) :
            List αList βBool

            Boolean scan of a cell-local relation on two aligned lists.

            Equations
            Instances For
              @[simp]
              theorem CertifiedRowSystem.Complement.checkPairs_eq_true_iff {α : Type u_5} {β : Type u_6} (p : αβBool) (xs : List α) (ys : List β) :
              checkPairs p xs ys = true List.Forall₂ (fun (x : α) (y : β) => p x y = true) xs ys

              Every list of unit certificates is the canonical replicated unit list.

              theorem CertifiedRowSystem.Complement.rowStep_iff_evalUnit {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} (D : CertifiedRowSystem I A Unit Q F) (old new : List A) :
              D.RowStep old new ∃ (q : Q), D.evalStep D.stepStart old new (List.replicate old.length ()) = some q D.stepDone q = true

              For a unit-certified system there is only one certificate row of a given length.

              theorem CertifiedRowSystem.Complement.exists_evalStep_unit_of_length {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} (D : CertifiedRowSystem I A Unit Q F) (q : Q) (old new : List A) (hlen : old.length = new.length) :
              ∃ (out : Q), D.evalStep q old new (List.replicate old.length ()) = some out

              A deterministic unit-certified verifier has a unique run on every aligned pair.

              Starting a path #

              noncomputable def CertifiedRowSystem.Complement.startPathLocalOK {A : Type u_2} [Fintype A] [Nonempty A] [DecidableEq A] (oldPhase newPhase : ProtocolPhase) (old new : ProtocolCell A) :

              Cell-local part of path initialization. All persistent tracks are copied, the path is reset to the immutable source row, and fuel is reset to zero.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[reducible, inline]

                State of a path-initialization scan.

                Equations
                Instances For
                  noncomputable def CertifiedRowSystem.Complement.startPathStepCell {A : Type u_2} [Fintype A] [Nonempty A] [DecidableEq A] (oldPhase newPhase : ProtocolPhase) (ok : StartPathVerifier) (old new : ProtocolCell A) :

                  One cell of a path-initialization scan.

                  Equations
                  Instances For

                    Successful terminal state for path initialization.

                    Equations
                    Instances For

                      Run a path-initialization scanner on aligned protocol rows.

                      Equations
                      Instances For
                        def CertifiedRowSystem.Complement.StartsPath {A : Type u_2} [Fintype A] [Nonempty A] [DecidableEq A] (oldPhase newPhase : ProtocolPhase) (old new : ProtocolRow A) :

                        Exact list-level specification of path initialization.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem CertifiedRowSystem.Complement.evalStartPath_done_iff {A : Type u_2} [Fintype A] [Nonempty A] [DecidableEq A] (oldPhase newPhase : ProtocolPhase) (old new : ProtocolRow A) :
                          evalStartPath oldPhase newPhase true old new = some true StartsPath oldPhase newPhase old new

                          The finite scanner accepts exactly the list-level path-initialization relation.

                          Track/phase projection of the list-level path initialization relation.

                          @[reducible, inline]

                          Ordinary counting-round path initialization.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[reducible, inline]

                            Final-rejection path initialization.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Extending a bounded path #

                              Finite state of the synchronous bounded-path scanner.

                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  def CertifiedRowSystem.Complement.pathStepStart {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} (D : CertifiedRowSystem I A Unit Q F) :

                                  Initial state for a bounded path-extension scan.

                                  Equations
                                  Instances For

                                    Persistent cell-local conditions of a path extension.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      noncomputable def CertifiedRowSystem.Complement.pathStepCell {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) (phase : ProtocolPhase) (q : PathStepVerifier Q) (old new : ProtocolCell A) :

                                      One cell of a path extension. It simultaneously runs the deterministic source edge verifier, the stuttering check, the fuel successor, and fuel < depth.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def CertifiedRowSystem.Complement.pathStepDone {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} (D : CertifiedRowSystem I A Unit Q F) (q : PathStepVerifier Q) :

                                        A path extension succeeds exactly for a proper bounded fuel increment and either a stutter or a source edge.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          noncomputable def CertifiedRowSystem.Complement.evalPathStep {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) (phase : ProtocolPhase) :

                                          Run the path-extension scanner on aligned rows.

                                          Equations
                                          Instances For

                                            Exact componentwise behavior of the path-extension scan. This theorem is the bridge from the finite product state to the list-level source, counter, comparison, and preservation checks.

                                            def CertifiedRowSystem.Complement.IsPathStep {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) (phase : ProtocolPhase) (old new : ProtocolRow A) :

                                            List-level semantics of one bounded path extension.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For

                                              Phase and persistent-track projection of a bounded path step.

                                              theorem CertifiedRowSystem.Complement.evalPathStep_done_iff {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) (phase : ProtocolPhase) (old new : ProtocolRow A) :
                                              (∃ (out : PathStepVerifier Q), evalPathStep D phase (pathStepStart D) old new = some out pathStepDone D out = true) IsPathStep D phase old new

                                              The path scanner accepts exactly a persistent, proper fuel increment whose path component either stutters or follows one determinized source edge.

                                              @[reducible, inline]
                                              noncomputable abbrev CertifiedRowSystem.Complement.countingPathStepCell {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) (q : PathStepVerifier Q) (old new : ProtocolCell A) :

                                              Counting-round path extension.

                                              Equations
                                              Instances For
                                                @[reducible, inline]
                                                noncomputable abbrev CertifiedRowSystem.Complement.finalPathStepCell {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) (q : PathStepVerifier Q) (old new : ProtocolCell A) :

                                                Final-rejection path extension.

                                                Equations
                                                Instances For

                                                  Completing a counting-round witness #

                                                  Finite state for completing a reachability witness in a counting round.

                                                  Instances For
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.

                                                      Initial state of the witness-completion scan.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For

                                                        Persistent and reset conditions of counting-round witness completion.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          noncomputable def CertifiedRowSystem.Complement.finishWitnessCell {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) (q : FinishWitnessVerifier Q) (old new : ProtocolCell A) :

                                                          One cell of witness completion.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            def CertifiedRowSystem.Complement.finishWitnessDone {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} (D : CertifiedRowSystem I A Unit Q F) (q : FinishWitnessVerifier Q) :

                                                            Successful witness completion. The phase is determined by whether advancing the canonical inner enumeration overflows.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              noncomputable def CertifiedRowSystem.Complement.evalFinishWitness {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) :

                                                              Run counting-round witness completion on aligned rows.

                                                              Equations
                                                              Instances For

                                                                Exact componentwise behavior of counting-round witness completion.

                                                                def CertifiedRowSystem.Complement.IsFinishWitness {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) :

                                                                List-level specification of completing a counting-round reachability witness.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For

                                                                  Persistent/reset-track projection of counting-round witness completion.

                                                                  theorem CertifiedRowSystem.Complement.evalFinishWitness_done_iff {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) :

                                                                  The finite scanner accepts exactly the list-level witness-completion action.

                                                                  Completing a final-rejection witness #

                                                                  Finite state for completing one witness in the final all-nonfinal scan.

                                                                  Instances For
                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.

                                                                      Initial state for final witness completion.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For

                                                                        Persistent/reset conditions for final witness completion.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          noncomputable def CertifiedRowSystem.Complement.finalWitnessCell {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) (q : FinalWitnessVerifier F) (old new : ProtocolCell A) :

                                                                          One cell of final witness completion.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            def CertifiedRowSystem.Complement.finalWitnessDone {I : Type u_1} {A : Type u_2} {Q : Type u_3} {F : Type u_4} (D : CertifiedRowSystem I A Unit Q F) (q : FinalWitnessVerifier F) :

                                                                            Successful final witness completion also requires the witnessed source row to be nonfinal.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              noncomputable def CertifiedRowSystem.Complement.evalFinalWitness {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) :

                                                                              Run final witness completion on aligned rows.

                                                                              Equations
                                                                              Instances For

                                                                                Exact componentwise behavior of final witness completion.

                                                                                def CertifiedRowSystem.Complement.IsFinalWitness {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) :

                                                                                List-level specification of completing one final all-nonfinal witness.

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For

                                                                                  Persistent/reset-track projection of final witness completion.

                                                                                  theorem CertifiedRowSystem.Complement.evalFinalWitness_done_iff {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) :

                                                                                  The final witness scanner accepts exactly a reachable-row witness whose source final predicate is false.