Definition log2ceil (n: nat): nat :=
  match n with
  | 0 => 0
  | S n' => ceil_log2_S n'
  end.Function floor_log2_S (n: nat) {wf lt n}: nat :=
  match n with
  | 0 => 0
  | S n' => S (floor_log2_S (div2 n'))
  end.

Lemma pow2_ceil_log2: forall n, S n <= pow 2 (ceil_log2_S n).