(** ** Proofs of specifications for bitwise operations *)

(* Specifications: *)
Lemma div2_spec a : div2 a = shiftr a 1.
Lemma testbit_0_l n : testbit 0 n = false.
Lemma testbit_neg_r a n : n<0 -> testbit a n = false.
Lemma testbit_odd_0 a : testbit (2*a+1) 0 = true.
Lemma testbit_even_0 a : testbit (2*a) 0 = false.
Lemma testbit_odd_succ a n : 0<=n ->
testbit (2*a+1) (succ n) = testbit a n.
Lemma testbit_even_succ a n : 0<=n ->
testbit (2*a) (succ n) = testbit a n.