(* Decode is just decode_aux with an empty head *)
Definition decode (c : list (A * list bool)) (m : list bool) :=
  decode_aux c nil m.

Theorem decode_correct : forall c : code, unique_prefix c -> not_null c -> forall (m1 m2 : list bool) (a : A), find_val m1 c = Some a -> decode c (m1 ++ m2) = a :: decode c m2.