(** We now prove that having the same bits implies equality. For that we use a notion of equality over functional streams of bits. *)
Definition eqf (f g:t -> bool) := forall n:t, f n = g n.
#[global]
Instance eqf_equiv : Equivalence eqf.
Local Infix "===" := eqf (at level 70, no associativity).
#[global]
Instance testbit_eqf : Proper (eq==>eqf) testbit.
(** Only zero corresponds to the always-false stream. *)

Lemma bits_inj_0 :
forall a, (forall n, a.[n] = false) -> a == 0.