Closed andres-erbsen closed 1 year ago
Unfortunately, this PR is not backward-compatible to Coq 8.16.1. The problem is in Blist.v, with Nat.Div0.mod_mul_r (which doesn't exist in 8.16.1). Can you use the following proof instead?
Lemma bvToNat_natToBv : forall n k,
bvToNat (natToBv n k) = k mod (2 ^ n).
Proof.
induction n; cbn [bvToNat natToBv]; trivial; intros.
cbn [Nat.pow]; rewrite Nat.mod_mul_r by (try apply Nat.pow_nonzero; lia).
setoid_rewrite Nat.bit0_mod.
f_equal.
rewrite IHn, Nat.div2_div, Nat.double_twice; trivial.
Qed.
testing this fix in #43 for Coq 8.17 compatibility
The
lognat
change isn't strictly required but IMO it's an improvement (N.size_nat
is there to define gcd).