proposition: Lemma leB_bounded {n} : forall (p: BITS n) m, m < 2^n -> leB p (p +# m) -> toNat p + m < 2^n.
proof: Proof. move => p m BOUND. rewrite leB_nat => H. case B:(toNat p + m < 2^n); first done. apply negbT in B. rewrite -ltnNge ltnS in B. assert (HH:= toNat_addBn_wrap BOUND B). rewrite -(leq_add2r m) in H. rewrite -HH in H. rewrite leq_add2l in H. rewrite leqNgt in H. rewrite BOUND in H. done. Qed.
imports: HB(structures) mathcomp.ssreflect.ssreflect mathcomp(ssrfun ssrbool eqtype ssrnat seq fintype tuple zmodp div) ssrextra.tuple ssrextra.nat spec spec.properties operations mathcomp(ssralg)