Documentation

Complexity.Algorithms.Reachability.InductiveCounting.Completeness

Honest binary choices for inductive counting #

Ghost assertions describe honest scans and the as-yet unguessed suffix of a vertex identifier. They are used only to construct a successful binary-choice replay.

Main definitions #

References #

v can be obtained from the partial guess g by appending bits binary choices.

Instances For
    theorem Cslib.InductiveCounting.binaryExtension_exists {g v bits : ℕ} (hlo : g * 2 ^ bits ≤ v) (hhi : v < (g + 1) * 2 ^ bits) :
    def Cslib.InductiveCounting.FullPrefix (N : ℕ) (edge : ℕ → ℕ → Bool) (source : ℕ) (s : State) :

    The selected count includes every reachable vertex of the processed prefix.

    Instances For
      theorem Cslib.InductiveCounting.fullPrefix_start {N source : ℕ} {edge : ℕ → ℕ → Bool} (s : State) :
      FullPrefix N edge source { phase := s.phase, round := s.round, count := s.count, target := s.target, nextCount := s.nextCount, remaining := s.remaining, current := s.current, guess := s.guess, bits := s.bits, hit := s.hit, finalScan := s.finalScan }
      theorem Cslib.InductiveCounting.fullPrefix_skip {N source : ℕ} {edge : ℕ → ℕ → Bool} {s : State} (h : FullPrefix N edge source s) (hu : s.candidate ∉ roundSet N edge source s.round) :
      FullPrefix N edge source { phase := s.phase, round := s.round, count := s.count, target := s.target, nextCount := s.nextCount, candidate := s.candidate + 1, selected := s.selected, remaining := s.remaining, current := s.current, guess := s.guess, bits := s.bits, hit := s.hit, finalScan := s.finalScan }
      theorem Cslib.InductiveCounting.fullPrefix_observe {N source : ℕ} {edge : ℕ → ℕ → Bool} {s : State} (h : FullPrefix N edge source s) (hu : s.candidate ∈ roundSet N edge source s.round) :
      FullPrefix N edge source { phase := s.phase, round := s.round, count := s.count, target := s.target, nextCount := s.nextCount, candidate := s.candidate + 1, selected := s.selected + 1, remaining := s.remaining, current := s.current, guess := s.guess, bits := s.bits, hit := s.hit, finalScan := s.finalScan }
      theorem Cslib.InductiveCounting.fullPrefix_end {N source : ℕ} {edge : ℕ → ℕ → Bool} {s : State} (h : FullPrefix N edge source s) (hc : RoundCorrect N edge source s) (hu : s.candidate = N) :
      def Cslib.InductiveCounting.Honest (N _width : ℕ) (edge : ℕ → ℕ → Bool) (source : ℕ) (s : State) :

      Additional ghost information used to construct honest choices. A walk retains a possible completion; a binary guess retains a vertex extending its guessed prefix.

      Instances For
        theorem Cslib.InductiveCounting.honest_initial {N width source : ℕ} {edge : ℕ → ℕ → Bool} (hsource : source < N) :
        Honest N width edge source (initial N source)

        At a genuine binary-guess instruction, an honest choice produces a bounded prefix.

        Instances For
          theorem Cslib.InductiveCounting.exists_honest_instruction {N width source : ℕ} {edge : ℕ → ℕ → Bool} {bad : ℕ → Bool} {s : State} (hsource : source < N) (hwidth : N ≤ 2 ^ width) (hsafe : Safe N source edge bad) (hi : Invariant N edge bad source s) (hh : Honest N width edge source s) :
          ∃ (choice : Bool), Honest N width edge source (instruction N width source s (answer edge bad s) choice) ∧ ChoiceFits N s choice

          Every honest, semantically valid nonrejecting state has an honest next choice.

          theorem Cslib.InductiveCounting.bounded_instruction {N width source : ℕ} {edge : ℕ → ℕ → Bool} {bad : ℕ → Bool} {s : State} {choice : Bool} (hsource : source < N) (hi : Invariant N edge bad source s) (hb : Bounded N width s) (hc : ChoiceFits N s choice) :
          Bounded N width (instruction N width source s (answer edge bad s) choice)

          Honest guesses pass the uniform register check; no state bound is assumed of an oracle.

          theorem Cslib.InductiveCounting.exists_honest_step {N width source : ℕ} {edge : ℕ → ℕ → Bool} {bad : ℕ → Bool} {s : State} (hsource : source < N) (hwidth : N ≤ 2 ^ width) (hsafe : Safe N source edge bad) (hi : Invariant N edge bad source s) (hb : Bounded N width s) (hh : Honest N width edge source s) :
          ∃ (choice : Bool), Honest N width edge source (step N width source edge bad s choice)

          Honest next instructions pass both executable checks.

          theorem Cslib.InductiveCounting.bounded_initial {N width source : ℕ} :
          Bounded N width (initial N source)
          theorem Cslib.InductiveCounting.accepts_complete {N width source : ℕ} {edge : ℕ → ℕ → Bool} {bad : ℕ → Bool} (hsource : source < N) (hwidth : N ≤ 2 ^ width) (hsafe : Safe N source edge bad) :
          Accepts N width source edge bad

          Honest choices yield an accepting replay whenever no bad vertex is reachable.

          theorem Cslib.InductiveCounting.accepts_iff {N width source : ℕ} {edge : ℕ → ℕ → Bool} {bad : ℕ → Bool} (hsource : source < N) (hwidth : N ≤ 2 ^ width) :
          Accepts N width source edge bad ↔ Safe N source edge bad

          Correctness of the executable, binary-choice small-register controller.

          theorem Cslib.InductiveCounting.accepts_iff_not_reachable {N width source target : ℕ} {edge : ℕ → ℕ → Bool} (hsource : source < N) (hwidth : N ≤ 2 ^ width) :
          (Accepts N width source edge fun (u : ℕ) => u == target) ↔ ¬Relation.ReflTransGen (Graph N edge) source target

          In particular, the executable controller nondeterministically decides nonreachability.