A physical decrement advances the input by twice the low-zero count plus one
ProvedPvsNP.PhysicalCountdown.decrement_clockcomplexity-theoryformal-verification
Starting at the origin in search state, suppose the first j binary digits are zero and the next is one. After exactly 2j+1 transitions the input has advanced that many positions and the work head has returned to the origin. The low zeros are raised, the first one is cleared, the highest-one marker is moved down when necessary, and the machine exhausts precisely if the origin held the highest one.
Preamble
import Definitions.Def_PhysicalBinaryCountdownClock import Mathlib.Logic.Function.Iterate import Lean.Elab.Tactic.Omega set_option autoImplicit false open PvsNP.PhysicalCountdown
Formal statement
theorem PvsNP.PhysicalCountdown.decrement_clock (tape : ℕ → Bool × Bool) (input j : ℕ) (highest : Bool)
(zeroes : ∀ i < j, tape i = (false, false)) (first : tape j = (true, highest)) :
let cleared := Function.update (raised tape j) j (false, false)
tick^[2 * j + 1] ⟨0, input, tape, .seek⟩ =
if j = 0 then
⟨0, input + (2 * j + 1), cleared, if highest then .done else .seek⟩
else
⟨0, input + (2 * j + 1), markCell cleared (j - 1) highest, .seek⟩ := by sorrySource
Local clock for scan-concurrent binary countdown.