@@ -3,6 +3,7 @@ From Coq Require Import Lia.
3
3
Require Import Crypto.Util.ZUtil.Tactics.PullPush.
4
4
From Coq Require Import NArith.
5
5
From Coq Require Import ZArith.
6
+ Require Import Crypto.Util.ZUtil.Testbit.
6
7
Require Import Crypto.AbstractInterpretation.ZRange.
7
8
Require Import Crypto.Util.ErrorT.
8
9
Import Coq.Lists.List. (* [map] is [List.map] not [ErrorT.map] *)
@@ -1345,6 +1346,18 @@ Proof using Type.
1345
1346
3: enough (0 <= Z.land v3 (Z.of_N n - 1)) by lia; eapply Z.land_nonneg; right.
1346
1347
1,2,3:pose_operation_size_cases; intuition (subst; cbn; clear; lia). }
1347
1348
1349
+ Unshelve . all : match goal with H : context[Syntax.shld] |- _ => idtac | _ => shelve end ; shelve_unifiable.
1350
+ { repeat match goal with H : ?x = Some _, H' : ?x = Some _ |- _ => rewrite H' in *; Option.inversion_option end .
1351
+ progress subst.
1352
+ replace (Z.land (Z.of_N n) (Z.ones (Z.of_N n))) with (Z.of_N n)
1353
+ by (rewrite Z.land_ones, Z.mod_small; try split; try lia; apply Zpow_facts.Zpower2_lt_lin; lia).
1354
+ assert (0 <= Z.of_N n - 1) by (pose_operation_size_cases; intuition (subst; cbn; clear; lia)).
1355
+ rewrite <- !Z.shiftl_opp_r.
1356
+ rewrite !Z.shiftl_lor.
1357
+ rewrite <- !Z.land_lor_distr_l, <- Z.land_assoc, Z.land_diag.
1358
+ rewrite !Z.shiftl_shiftl by (try apply Z.land_nonneg; lia).
1359
+ f_equal; f_equal; f_equal; try lia. }
1360
+
1348
1361
Unshelve . all : match goal with H : context[Syntax.shlx] |- _ => idtac | _ => shelve end ; shelve_unifiable.
1349
1362
{ rewrite <- Z.land_assoc.
1350
1363
f_equal; f_equal; [].
0 commit comments