Fixpoint get_first_None (limit:nat) (s: ENTROPY.stream): nat :=
match limit with
| O => O (* bogus *)
| S limit' =>
match s O with
| None => O
| Some _ => S (get_first_None limit' (fun i => s (S i)))
end
end
.

Lemma get_bits_stream_success_Some:
forall k s b s',
ENTROPY.success b s' = ENTROPY.get_bits k s ->
(forall i, (i < k)%nat -> s i <> None).