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 #
Cslib.InductiveCounting.BinaryExtension: a vertex extends a partial binary guess.Cslib.InductiveCounting.Honest: the assertion maintained by honest choices.
References #
v can be obtained from the partial guess g by appending bits binary choices.
- done (g : ℕ) : BinaryExtension 0 g g
- bit {n g v : ℕ} (b : Bool) (h : BinaryExtension n (2 * g + b.toNat) v) : BinaryExtension (n + 1) g v
Instances For
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) :
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) :
Honest next instructions pass both executable checks.