Definition code_dec :
  forall (c : code) a,
  {(exists l : list bool, In (a, l) c)} +
  {(forall l : list bool, ~ In (a, l) c)}.(* Checking if a code is in an alphabet is decidable *)
Definition in_alphabet_dec :
  forall m c, {in_alphabet m c} + {~ in_alphabet m c}.(* The empty list is associated to none of element of A in the code *)
Definition not_null (c : code) := forall a : A, ~ In (a, nil) c.

(* Specifications: *)
Theorem not_null_inv : forall (a : A * list bool) l, not_null (a :: l) -> not_null l.
Theorem not_null_cons : forall a b (l : list (A * list bool)), b <> nil -> not_null l -> not_null ((a, b) :: l).
Theorem not_null_app : forall l1 l2 : list (A * list bool), not_null l1 -> not_null l2 -> not_null (l1 ++ l2).
Theorem not_null_map : forall (l : list (A * list bool)) b, not_null (map (fun v => match v with | (a1, b1) => (a1, b :: b1) end) l).