Fixed-length bit strings and lists #
Circuits consume fixed-length functions BitString n = Fin n → Bool, while
machine languages consume List Bool. This module makes List.ofFn the
canonical serialization and provides round-trip lemmas in both directions.
The variable-length equivalence is already available from Mathlib as
List.equivSigmaTuple : List Bool ≃ Σ n, BitString n.
Extend a fixed-length bit string to a total assignment by setting every
out-of-range variable to false. This is the canonical semantic bridge from
typed Boolean functions to formula and branching-program syntax.
Instances For
@[simp]
Serialization sends Fin.append to list append: toList (x ++ y) = x.toList ++ y.toList.