AFTD Auto-Formalizing Theoretical Domains

pathOddRunFinish_identity

theoremverified

The pending parity counter agrees with the existing odd-run counter.

Statement

open scoped BigOperators in
theorem pathOddRunFinish_identity (ir odd : Bool) (xs : List Bool) :
    odd_run_aux ir odd (xs ++ [false]) = pathOddRunFinish (ir && odd) xs
Source
Finite-state path cut-matching certificate for OP-827; exhaustive transition check in experiment 22529.
Verified
11 Nov 2026
Axioms
propext
Built on 2
  • odd_run_auxodd_run_aux inRun oddLen l scans the boolean list l left to right, keeping a flag inRun (currently inside a run of trues) and…
  • pathOddRunFinishCount odd true runs while retaining a pending run parity.
Used by 1

Lean source view module on GitHub

open scoped BigOperators in
theorem pathOddRunFinish_identity (ir odd : Bool) (xs : List Bool) :
    odd_run_aux ir odd (xs ++ [false]) = pathOddRunFinish (ir && odd) xs := by
  induction xs generalizing ir odd with
  | nil => cases ir <;> cases odd <;> rfl
  | cons b bs ih =>
    cases ir <;> cases odd <;> cases b <;> simp [odd_run_aux, pathOddRunFinish, ih]
See it in the graphDiscuss this resultChallenge it