@@ -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] *)
@@ -1343,6 +1344,18 @@ Proof using Type.
1343
1344
3: enough (0 <= Z.land v3 (Z.of_N n - 1)) by lia; eapply Z.land_nonneg; right.
1344
1345
1,2,3:pose_operation_size_cases; intuition (subst; cbn; clear; lia). }
1345
1346
1347
+ Unshelve . all : match goal with H : context[Syntax.shld] |- _ => idtac | _ => shelve end ; shelve_unifiable.
1348
+ { repeat match goal with H : ?x = Some _, H' : ?x = Some _ |- _ => rewrite H' in *; Option.inversion_option end .
1349
+ progress subst.
1350
+ replace (Z.land (Z.of_N n) (Z.ones (Z.of_N n))) with (Z.of_N n)
1351
+ by (rewrite Z.land_ones, Z.mod_small; try split; try lia; apply Zpow_facts.Zpower2_lt_lin; lia).
1352
+ assert (0 <= Z.of_N n - 1) by (pose_operation_size_cases; intuition (subst; cbn; clear; lia)).
1353
+ rewrite <- !Z.shiftl_opp_r.
1354
+ rewrite !Z.shiftl_lor.
1355
+ rewrite <- !Z.land_lor_distr_l, <- Z.land_assoc, Z.land_diag.
1356
+ rewrite !Z.shiftl_shiftl by (try apply Z.land_nonneg; lia).
1357
+ f_equal; f_equal; f_equal; try lia. }
1358
+
1346
1359
Unshelve . all : match goal with H : context[Syntax.shlx] |- _ => idtac | _ => shelve end ; shelve_unifiable.
1347
1360
{ rewrite <- Z.land_assoc.
1348
1361
f_equal; f_equal; [].
0 commit comments