(** * Fixed-width binary words *)
Set Default Goal Selector "!".
Inductive bin : nat -> Type :=
| bb : bin 0
| b0 {k} : bin k -> bin (S k)
| b1 {k} : bin k -> bin (S k).
Reserved Notation "c -S-> c'" (at level 40, c' at next level).
Inductive bin_succ : forall {k}, bin k -> bin k -> Prop :=
| succ_b0 {k} (n : bin k)    : (b0 n) -S-> (b1 n)
| succ_b1 {k} (n n' : bin k) : n -S-> n'  ->  b1 n -S-> b0 n'
where "c -S-> c'" := (bin_succ c c').
Inductive bin_plus {k} : N -> bin k -> bin k -> Prop :=
| plus_0 n : bin_plus N0 n n
| plus_S u n n' n'' :
n -S-> n' ->
bin_plus         u  n' n'' ->
bin_plus (N.succ u) n n''.
Local Hint Constructors bin_succ bin_plus : core.

Lemma bin_plus_b0 : forall k u (n n' : bin k),
bin_plus u n n' ->
bin_plus (N.double u) (b0 n) (b0 n').