aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jadep <jade.philipoom@gmail.com>2018-09-19 10:12:00 -0400
committerGravatar Jason Gross <jasongross9@gmail.com>2018-12-21 10:22:41 -0500
commite2305a40e51ca58f710bfec982ce4a4f9b51ae09 (patch)
treea8b11868860e51fe5012daa76c331c51a1f75f7e /src
parent179fa67e398ddd2ea4d720b1653972d34f6d2617 (diff)
prove [small_sub_then_maybe_add]
Diffstat (limited to 'src')
-rw-r--r--src/Experiments/NewPipeline/Arithmetic.v13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Experiments/NewPipeline/Arithmetic.v b/src/Experiments/NewPipeline/Arithmetic.v
index 8949f8b4b..b94979b11 100644
--- a/src/Experiments/NewPipeline/Arithmetic.v
+++ b/src/Experiments/NewPipeline/Arithmetic.v
@@ -3412,7 +3412,18 @@ Module WordByWordMontgomery.
apply Z.mod_small.
break_match; Z.ltb_to_lt; lia.
Qed.
- Local Axiom small_sub_then_maybe_add : forall a b, small (sub_then_maybe_add a b).
+ Local Lemma small_sub_then_maybe_add : forall a b, small a -> small b -> small (sub_then_maybe_add a b).
+ Proof using small_N lgr_big R_numlimbs_nz.
+ pose proof mask_r_sub1 as mask_r_sub1.
+ clear - small_N lgr_big R_numlimbs_nz mask_r_sub1.
+ intros; autounfold with loc; cbv [sub_then_maybe_add].
+ repeat match goal with H : small _ |- _ =>
+ rewrite H; clear H end.
+ rewrite Rows.sub_then_maybe_add_partitions by (distr_length; autorewrite with push_eval; auto with zarith).
+ autorewrite with push_eval.
+ apply partition_eq_mod; auto; [ ].
+ auto with zarith.
+ Qed.
Local Opaque T addT drop_high_addT' divmod zero scmul conditional_sub sub_then_maybe_add.
Create HintDb push_mont_eval discriminated.