Documentation

CslibFrontier.Foundations.Data.BitString.ListParity

Parity of Boolean lists #

Executable exclusive-or folding agrees with addition in the Boolean ring and with the existing finite-tuple Cslib.parityOn. The empty word has parity zero. These bridges let list-based programs reuse the finite-coordinate parity API without changing the mathematical relation.

Exclusive or of every bit, with zero for the empty word.

Instances For
    @[simp]
    theorem Cslib.BitString.wordParity_cons (b : Bool) (word : List Bool) :
    wordParity (b :: word) = (b ^^ wordParity word)

    List parity is the sum in the existing Boolean ring.

    Folding a finite tuple computes its existing finite-set parity.