pathOddRunFinish
def
Count odd true runs while retaining a pending run parity.
Statement
open scoped BigOperators in def pathOddRunFinish (prev : Bool) : List Bool → ℕ
- Source
- Finite-state path cut-matching certificate for OP-827; exhaustive transition check in experiment 22529.
- Verified
- 11 Nov 2026
- Axioms
- none listed
- Used by 3
- pathGreedyRun_identityThe greedy matching count and pending run parity satisfy an exact counting identity.
- pathOddRunFinish_identityThe pending parity counter agrees with the existing odd-run counter.
- pathGreedyRun_eq_count_and_oddTwice the greedy count equals the number of true edges plus the number of odd true runs.
Lean source view module on GitHub
open scoped BigOperators in def pathOddRunFinish (prev : Bool) : List Bool → ℕ | [] => if prev then 1 else 0 | b :: bs => (if prev && !b then 1 else 0) + pathOddRunFinish (b && !prev) bs