proposition: Lemma adcB_bounded n (b:bool) (p1 p2: BITS n) : b + toNat p1 + toNat p2 < 2^n.+1.
proof: Proof. have B1 := toNatBounded p1. have B2 := toNatBounded p2. rewrite expnS mul2n -addnn. have B :=leq_add B1 B2. destruct b. + rewrite addnC add1n -addn1 addnC addnA add1n. apply leq_add; done. + rewrite add0n -addn1 addnC addnA add1n. apply leq_add; first done. by rewrite ltnW. 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)