(** Bitwise operations and log2 *)

(* Specifications: *)
Lemma log2_bits_unique : forall a n,
a.[n] = true ->
(forall m, n<m -> a.[m] = false) ->
log2 a == n.
Lemma log2_shiftr : forall a n, log2 (a >> n) == log2 a - n.
Lemma log2_shiftl : forall a n, a~=0 -> log2 (a << n) == log2 a + n.
Lemma log2_lor : forall a b,
log2 (lor a b) == max (log2 a) (log2 b).
Lemma log2_land : forall a b,
log2 (land a b) <= min (log2 a) (log2 b).
Lemma log2_lxor : forall a b,
log2 (lxor a b) <= max (log2 a) (log2 b).