#[global]
Instance log2_up_wd : Proper (eq==>eq) log2_up.

(* Specifications: *)
Lemma log2_up_nonneg : forall a, 0 <= log2_up a.
Lemma log2_up_unique : forall a b, 0<b -> 2^(P b)<a<=2^b -> log2_up a == b.
Lemma log2_up_pow2 : forall a, 0<=a -> log2_up (2^a) == a.
Lemma log2_up_succ_pow2 : forall a, 0<=a -> log2_up (S (2^a)) == S a.
Lemma log2_up_1 : log2_up 1 == 0.
Lemma log2_up_2 : log2_up 2 == 1.
Lemma le_log2_log2_up : forall a, log2 a <= log2_up a.
Lemma le_log2_up_succ_log2 : forall a, log2_up a <= S (log2 a).
Lemma log2_log2_up_spec : forall a, 0<a -> 2^log2 a <= a <= 2^log2_up a.
Lemma log2_log2_up_exact : forall a, 0<a -> (log2 a == log2_up a <-> exists b, a == 2^b).
Lemma log2_up_pos : forall a, 1<a -> 0 < log2_up a.
Lemma log2_up_null : forall a, log2_up a == 0 <-> a <= 1.
Lemma log2_up_le_mono : forall a b, a<=b -> log2_up a <= log2_up b.
Lemma log2_up_lt_cancel : forall a b, log2_up a < log2_up b -> a < b.
Lemma log2_up_lt_pow2 : forall a b, 0<a -> (2^b<a <-> b < log2_up a).
Lemma log2_up_le_pow2 : forall a b, 0<a -> (a<=2^b <-> log2_up a <= b).
Lemma log2_up_lt_lin : forall a, 0<a -> log2_up a < a.
Lemma log2_up_le_lin : forall a, 0<=a -> log2_up a <= a.
Lemma log2_up_mul_above : forall a b, 0<=a -> 0<=b -> log2_up (a*b) <= log2_up a + log2_up b.
Lemma log2_up_mul_below : forall a b, 0<a -> 0<b -> log2_up a + log2_up b <= S (log2_up (a*b)).
Lemma log2_up_mul_pow2 : forall a b, 0<a -> 0<=b -> log2_up (a*2^b) == b + log2_up a.
Lemma log2_up_double : forall a, 0<a -> log2_up (2*a) == S (log2_up a).
Lemma log2_up_same : forall a b, 0<a -> 0<b -> log2_up a == log2_up b -> a < 2*b.
Lemma log2_up_succ_le : forall a, log2_up (S a) <= S (log2_up a).
Lemma log2_up_succ_or : forall a, log2_up (S a) == S (log2_up a) \/ log2_up (S a) == log2_up a.
Lemma log2_up_eq_succ_is_pow2 : forall a, log2_up (S a) == S (log2_up a) -> exists b, a == 2^b.
Lemma log2_up_eq_succ_iff_pow2 : forall a, 0<a -> (log2_up (S a) == S (log2_up a) <-> exists b, a == 2^b).
Lemma log2_up_succ_double : forall a, 0<a -> log2_up (2*a+1) == 2 + log2 a.
Lemma log2_up_add_le : forall a b, a~=1 -> b~=1 -> log2_up (a+b) <= log2_up a + log2_up b.
Lemma add_log2_up_lt : forall a b, 0<a -> 0<b -> log2_up a + log2_up b < 2 * log2_up (a+b).