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.
@[simp]
Serialization sends Fin.append to list append: toList (x ++ y) = x.toList ++ y.toList.