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

Fix compilation with master #94

Merged
merged 1 commit into from
Nov 2, 2023
Merged
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
17 changes: 11 additions & 6 deletions theories/common.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From elpi Require Import elpi.
From Coq Require Import QArith.
From Coq.micromega Require Import OrderedRing RingMicromega.
From mathcomp Require Import all_ssreflect ssralg ssrnum ssrint.

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key N to N_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key Z to Z_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Hiding binding of key N to N_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:coq-dev)

Hiding binding of key Z to Z_scope

Check warning on line 4 in theories/common.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

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key Z to Z_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key N to N_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key Z to Z_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key N to N_scope

Check warning on line 4 in theories/common.v

View workflow job for this annotation

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

Hiding binding of key Z to Z_scope
From mathcomp.zify Require Import ssrZ zify.

Import Order.TTheory GRing.Theory Num.Theory.
Expand Down Expand Up @@ -414,7 +414,7 @@
have ->: (Reval e1 ^ n)%num = Reval e1 ^+ N.to_nat n by lia.
by rewrite rmorphXn IHe1.
- move=> p e1 IHe1 f.
by rewrite add_pos_natE rmorphD IHe1 -[Pos.to_nat p]natn rmorph_nat.
by rewrite add_pos_natE rmorphD IHe1 -[Pos.to_nat p in LHS]natn rmorph_nat.
- by move=> n f; rewrite -[nat_of_large_nat _]natn rmorph_nat -large_nat_N_nat.
- by move=> n f; rewrite -[RHS](rmorph_nat f); congr (f _); lia.
- by move=> R S g e1 IHe1 f; rewrite -/(comp f g _) IHe1.
Expand Down Expand Up @@ -594,7 +594,7 @@
- move=> e1 IHe1 [|p|p] f; rewrite ?(rmorph0, rmorph1) //=.
by rewrite /Rnorm -/Rnorm -IHe1 -rmorphXn /=; congr (f _); lia.
- move=> p e1 IHe1 f.
by rewrite add_pos_natE rmorphD IHe1 -[Pos.to_nat p]natn rmorph_nat.
by rewrite add_pos_natE rmorphD IHe1 -[Pos.to_nat p in LHS]natn rmorph_nat.
- move=> n f.
by rewrite -[nat_of_large_nat _]natn rmorph_nat pmulrn -large_nat_Z_int.
- by move=> e1 IHe1 f; rewrite -[Posz _]intz rmorph_int /intmul IHe1.
Expand Down Expand Up @@ -801,7 +801,7 @@
by rewrite /Rnorm -/Rnorm -IHe1 -rmorphXn /=; congr (f _); lia.
- by move=> R e1 IHe1 f; rewrite fmorphV IHe1.
- move=> p e1 IHe1 f.
by rewrite add_pos_natE rmorphD IHe1 -[Pos.to_nat p]natn rmorph_nat.
by rewrite add_pos_natE rmorphD IHe1 -[Pos.to_nat p in LHS]natn rmorph_nat.
- move=> n f.
by rewrite -[nat_of_large_nat _]natn rmorph_nat pmulrn -large_nat_Z_int.
- by move=> e1 IHe1 f; rewrite -[Posz _]intz rmorph_int /intmul IHe1.
Expand Down Expand Up @@ -1000,7 +1000,8 @@
Mnorm f zero add opp sub one mul exp inv invb m e =
Mnorm f' zero add opp sub one mul exp inv invb m e.
move: f f' invb m ff'.
elim e using (@RExpr_ind' P P0); rewrite {R e}/P {}/P0 //=.
elim e using (@RExpr_ind' P P0); rewrite {R e}/P {}/P0 /=.
- by [].
- move=> R e1 IHe1 e2 IHe2 f f'.
by case=> m ff'; [congr inv|]; (congr add; [exact: IHe1|exact: IHe2]).
- move=> e1 IHe1 e2 IHe2 f f'.
Expand All @@ -1017,6 +1018,7 @@
by case=> m ff'; [congr inv|]; (congr sub; [exact: IHe1|exact: IHe2]).
- move=> R e1 IHe1 e2 IHe2 f f' invb m ff'.
by congr mul; [exact: IHe1|exact: IHe2].
- by [].
- move=> R e1 IHe1 e2 IHe2 f f' invb m ff'.
by congr mul; [exact: IHe1|exact: IHe2].
- move=> e1 IHe1 e2 IHe2 f f' invb m ff'.
Expand Down Expand Up @@ -1049,6 +1051,8 @@
- by move=> R g e IHe f f' invb m ff'; congr mul; exact: IHe.
- by move=> R g e IHe f f' invb m ff'; congr mul; exact: IHe.
- by move=> R g e IHe f f' invb m ff'; congr mul; exact: IHe.
- by [].
- by [].
- move=> V e1 IHe1 e2 IHe2 f f'.
by case=> m ff'; [congr inv|]; (congr add; [exact: IHe1|exact: IHe2]).
- move=> V e1 IHe1 e2 IHe2 f f' invb m ff'.
Expand All @@ -1061,6 +1065,7 @@
- by move=> V g e IHe f f' invb m ff'; congr mul; exact: IHe.
- by move=> V g e IHe f f' invb m ff'; congr mul; exact: IHe.
- by move=> V g e IHe f f' invb m ff'; congr mul; exact: IHe.
- by [].
Qed.

Section correct.
Expand Down Expand Up @@ -1124,8 +1129,8 @@
rewrite /Rnorm /= -/(Rnorm _) -IHe1 (fun_if (fun x => GRing.exp x _)).
by rewrite exprVn -rmorphXn; congr (if _ then (f _)^-1 else f _); lia.
- by move=> R e1 IHe1 invb f; rewrite fmorphV invrK -if_neg IHe1.
- move=> p e1 IHe1 invb f.
by rewrite add_pos_natE rmorphD (IHe1 false) -[Pos.to_nat p]natn rmorph_nat.
- move=> p e1 IHe1 invb f; rewrite add_pos_natE rmorphD (IHe1 false).
by rewrite -[Pos.to_nat p in LHS]natn rmorph_nat.
- move=> n invb f.
by rewrite -[nat_of_large_nat _]natn rmorph_nat pmulrn -large_nat_Z_int.
- move=> e1 IHe1 invb f; rewrite -[Posz _]intz rmorph_int -pmulrn.
Expand Down
Loading