aboutsummaryrefslogtreecommitdiff
path: root/src/Fancy/Prod.v
diff options
context:
space:
mode:
authorGravatar jadep <jade.philipoom@gmail.com>2019-02-08 09:37:47 -0500
committerGravatar jadep <jade.philipoom@gmail.com>2019-02-08 09:37:47 -0500
commit866a4edeb17d18213b62ef124bf0f67eaaca10b8 (patch)
treea7446f78413e7c5bff14a4b078505f6567a42b64 /src/Fancy/Prod.v
parentcd4c4b1b92da4ca0a79947f2ae11bed50c47b85c (diff)
fix Montgomery proof and clean up a little
Diffstat (limited to 'src/Fancy/Prod.v')
-rw-r--r--src/Fancy/Prod.v11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Fancy/Prod.v b/src/Fancy/Prod.v
index a3f72f17d..a46a7a4f0 100644
--- a/src/Fancy/Prod.v
+++ b/src/Fancy/Prod.v
@@ -375,4 +375,15 @@ Ltac push_value_unused :=
| _ => apply not_in_cons; split;
[ try assumption; symmetry; assumption | ]
| _ => apply in_nil
+ end.
+
+(* Solves subgoals for commutativity proofs and simplifies register
+lookup expressions *)
+Ltac simplify_with_register_properties :=
+ repeat match goal with
+ | _ => rewrite reg_eqb_refl
+ | _ => rewrite reg_eqb_neq by congruence
+ | H : ?y = _ mod ?m |- 0 <= ?y < _ =>
+ rewrite H; apply Z.mod_pos_bound; lia
+ | _ => assumption
end. \ No newline at end of file