Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtrager committed Sep 26, 2023
1 parent 80b52fd commit cc2ba13
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions coq/FHE/zp_prim_root.v
Original file line number Diff line number Diff line change
Expand Up @@ -1531,13 +1531,10 @@ Section add_self.
rewrite /rotate_index_right_ord /cancel /modn_ord /=.
intros.
apply ord_inj=> /=.
rewrite -(modnDm x e n).
rewrite modnDml.
rewrite -(modnDm x e n) modnDml.
generalize (ltn_pmod e npos); intros.
replace (x %% n + e %% n + (n - e %% n))%N with
(x%%n + n)%N by lia.
rewrite -modnDmr modnn addn0 modn_mod.
rewrite modn_small //.
replace (x %% n + e %% n + (n - e %% n))%N with (x%%n + n)%N by lia.
rewrite -modnDmr modnn addn0 modn_mod modn_small //.
Qed.

Definition rot_perm e := perm (can_inj (rotate_ind_right_ord_cancel e)).
Expand All @@ -1555,8 +1552,7 @@ Section add_self.
: row_sum_naive_rot v == \sum_(j < n) v 0 j.
Proof.
rewrite/row_sum_naive_rot/row_sum_naive_rot_row.
rewrite /rotate_row_right/rotate_index_right_ord.
rewrite summxE /=.
rewrite /rotate_row_right/rotate_index_right_ord summxE /=.
apply/eqP.
apply eq_bigr=> k _.
rewrite !mxE.
Expand Down

0 comments on commit cc2ba13

Please sign in to comment.