(*********************)
(* Alternating words *)
(*********************)

(* (alt b w) == w = [b ~b b ~b ...]  *)

Inductive alt : bool -> word -> Prop :=
  | alt_empty : forall b : bool, alt b empty
  | alt_bit : forall (b : bool) (w : word), alt (negb b) w -> alt b (bit b w).(*********************)
(* Alternating words *)
(*********************)

(* (alt b w) == w = [b ~b b ~b ...]  *)

Inductive alt : bool -> word -> Prop :=
  | alt_empty : forall b : bool, alt b empty
  | alt_bit : forall (b : bool) (w : word), alt (negb b) w -> alt b (bit b w).(*********************)
(* Alternating words *)
(*********************)

(* (alt b w) == w = [b ~b b ~b ...]  *)

Inductive alt : bool -> word -> Prop :=
  | alt_empty : forall b : bool, alt b empty
  | alt_bit : forall (b : bool) (w : word), alt (negb b) w -> alt b (bit b w).

(* Specifications: *)
Lemma alt_neg_intro : forall (b b' : bool) (w : word), alt b (bit b' w) -> alt (negb b) w.
Lemma alt_neg_elim : forall (b b' : bool) (w : word), alt (negb b) (bit b' w) -> alt b w.
Lemma alt_eq : forall (b b' : bool) (w : word), alt b (bit b' w) -> b = b'.
Lemma alt_back : forall (b b' : bool) (w : word), alt b (bit b' w) -> b = b' /\ alt (negb b) w.