Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt to MC#1229 #92

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion refinements/binord.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Require Import ZArith.

From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq zmodp.

Check warning on line 3 in refinements/binord.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.1.0-coq-8.18)

Hiding binding of key N to N_scope
From mathcomp Require Import path choice fintype tuple finset ssralg ssrnum bigop ssrint.

From CoqEAL Require Import hrel param refinements binnat.
Expand Down Expand Up @@ -118,7 +118,7 @@

#[export] Instance Rord_mul n1 n2 (rn : nat_R n1 n2) :
refines (Rord (nat_R_S_R rn) ==> Rord (nat_R_S_R rn) ==> Rord (nat_R_S_R rn))
(@Zp_mul n1) *%C.
(@Zp_mul _) *%C.
Proof.
rewrite refinesE=> x x' hx y y' hy /=.
exact: refinesP.
Expand Down
24 changes: 11 additions & 13 deletions refinements/boolF2.v
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,40 @@ Proof. by rewrite refinesE. Qed.

#[export] Instance Rbool_opp : refines (Rbool ==> Rbool) -%R -%C.
Proof.
rewrite refinesE=> x []; rewrite /Rbool /F2_of_bool /fun_hrel /= => <- //.
by rewrite GRing.mulr0n GRing.oppr0.
rewrite refinesE => x.
by case; rewrite /Rbool /F2_of_bool /fun_hrel /= => <-; apply/val_inj.
Qed.

#[export] Instance Rbool_add : refines (Rbool ==> Rbool ==> Rbool) +%R +%C.
Proof.
rewrite refinesE /Rbool /F2_of_bool /fun_hrel => x [] <- y [] <- //=.
by rewrite -GRing.natrD char_Zp.
by rewrite GRing.add0r.
rewrite refinesE /Rbool /F2_of_bool /fun_hrel.
by move=> x [] <- y [] <-; apply/val_inj.
Qed.

(* TODO: lemma for sub *)
#[export] Instance Rbool_sub :
refines (Rbool ==> Rbool ==> Rbool) (fun x y => x - y) sub_op.
Proof.
rewrite refinesE /Rbool /F2_of_bool /fun_hrel=> x [] <- y [] <- //=;
by apply/eqP; rewrite eq_sym GRing.subr_eq0.
rewrite refinesE /Rbool /F2_of_bool /fun_hrel.
by move=> x [] <- y [] <-; apply/val_inj.
Qed.

#[export] Instance Rbool_mul : refines (Rbool ==> Rbool ==> Rbool) *%R *%C.
Proof.
rewrite refinesE /Rbool /F2_of_bool /fun_hrel => x [] <- y [] <- //=.
+ by rewrite GRing.mulr0.
+ by rewrite GRing.mul0r.
by rewrite GRing.mul0r.
rewrite refinesE /Rbool /F2_of_bool /fun_hrel.
by move=> x [] <- y [] <-; apply/val_inj.
Qed.

#[export] Instance Rbool_inv : refines (Rbool ==> Rbool) GRing.inv inv_bool.
Proof.
by rewrite refinesE=> x []; rewrite /Rbool /F2_of_bool /fun_hrel /= => <- //.
rewrite refinesE => x.
by case; rewrite /Rbool /F2_of_bool /fun_hrel /= => <-; apply/val_inj.
Qed.

#[export] Instance Rbool_eq :
refines (Rbool ==> Rbool ==> bool_R) eqtype.eq_op eq_op.
Proof.
by rewrite refinesE /Rbool /F2_of_bool /fun_hrel=> x [] <- y [] <-.
by rewrite refinesE /Rbool /F2_of_bool /fun_hrel=> x [] <- y [] <-.
Qed.

(*
Expand Down
Loading