proposition: Lemma bin_invert_double n: (bin_invert n.*2) = (bin_invert n).*2.
proof: Proof. case:n => // n; rewrite /bin_invert. set x := (list_of_num (bin_of_nat n.+1)). have ->:(list_of_num (bin_of_nat (n.+1).*2)) = false::x by rewrite bin_of_nate. rewrite {1}/bin_invert_aux -/bin_invert_aux {1}/num_of_list. have: exists a b, bin_invert_aux x = a :: b. move: (nat_list_succ n); rewrite -/x; case x => // b l _ /=; case:b. by exists true, [seq ~~ i | i <- l]. by exists false, (bin_invert_aux l). by move => [a [b ->]]; rewrite /= natTrecE. Qed.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat) mathcomp(seq choice fintype order bigop ssralg) mathcomp(div ssrnum ssrint rat prime path binomial) mathcomp(tuple finset) gaia(fibm)