Notation bs := (list bool).Definition unary (v : bs) := forallb id v.(** * Boolean interpretation of bitstrings *)

Definition bs2bool (v:bs) : bool := hd false v.Definition bool2bs (b:bool) : bs :=
  if b then true::nil else nil.

(* Specifications: *)
Lemma bs_nat2bool_true : forall v, bs2bool v = true -> length v <> 0.
Lemma bs_nat2bool_true_conv : forall v, unary v = true -> length v <> 0 -> bs2bool v = true.
Lemma bs_nat2bool_false v : unary v = true -> bs2bool v = false -> length v = 0.
Lemma bs_nat2bool_false_conv v : length v = 0 -> bs2bool v = false.