(***********************)
(* Shuffling two words *)
(***********************)

Inductive shuffle : word -> word -> word -> Prop :=
  | shuffle_empty : shuffle empty empty empty
  | shuffle_bit_left :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle (bit b u) v (bit b w)
  | shuffle_bit_right :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle u (bit b v) (bit b w).(***********************)
(* Shuffling two words *)
(***********************)

Inductive shuffle : word -> word -> word -> Prop :=
  | shuffle_empty : shuffle empty empty empty
  | shuffle_bit_left :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle (bit b u) v (bit b w)
  | shuffle_bit_right :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle u (bit b v) (bit b w).(***********************)
(* Shuffling two words *)
(***********************)

Inductive shuffle : word -> word -> word -> Prop :=
  | shuffle_empty : shuffle empty empty empty
  | shuffle_bit_left :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle (bit b u) v (bit b w)
  | shuffle_bit_right :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle u (bit b v) (bit b w).(***********************)
(* Shuffling two words *)
(***********************)

Inductive shuffle : word -> word -> word -> Prop :=
  | shuffle_empty : shuffle empty empty empty
  | shuffle_bit_left :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle (bit b u) v (bit b w)
  | shuffle_bit_right :
      forall u v w : word,
      shuffle u v w -> forall b : bool, shuffle u (bit b v) (bit b w).

(* Specifications: *)
Lemma Shuffling : forall u v w : word, shuffle u v w -> forall b : bool, alt b u -> odd u /\ (odd v /\ (alt (negb b) v -> paired w) /\ (alt b v -> paired_bet b w) \/ even v /\ (alt b v -> paired_odd_l b w) /\ (alt (negb b) v -> paired_odd_r (negb b) w)) \/ even u /\ (odd v /\ (alt (negb b) v -> paired_odd_r b w) /\ (alt b v -> paired_odd_l b w) \/ even v /\ (alt b v -> paired_rot b w) /\ (alt (negb b) v -> paired w)).