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#1256 #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 2 additions & 0 deletions theories/algo_closures.v
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
rewrite addrAC !binSz /annotated_recs_d.Sn_cf0_0_0; [ | lia ..].
have b1_pos: 0 < binomialz n m by apply: bin_nonneg; lia.
have b2_pos: 0 < binomialz (n + m) m by apply: bin_nonneg; lia.
have ->: @GRing.add (int : nmodType) n m = n + m by [].

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.16)

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.17)

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

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

all matches of The LHS of __top_assumption_

Check failure on line 51 in theories/algo_closures.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.19)

all matches of The LHS of __top_assumption_
by field; ring_lia.
Qed.

Expand All @@ -65,6 +66,7 @@
rewrite /annotated_recs_d.Sm_cf0_0_0.
have b1_pos: 0 < binomialz n m by apply: bin_nonneg; lia.
have b2_pos: 0 < binomialz (n + m) m by apply: bin_nonneg; lia.
have ->: @GRing.add (int : nmodType) n m = n + m by [].
by field; ring_lia.
Qed.

Expand Down
6 changes: 3 additions & 3 deletions theories/bigopz.v
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Proof.
suff -> : index_iotaz (m + a) n = map (fun i => i + a) (index_iotaz m (n - a)).
by rewrite big_map.
apply: (@eq_from_nth _ 0).
by rewrite size_map !size_index_iotaz lerBDl addrC -addrA opprD.
by rewrite size_map !size_index_iotaz lerBDl [m + a]addrC -addrA opprD.
move=> i; rewrite size_index_iotaz; case: ifP => // hman hi.
rewrite nth_index_iotaz // (nth_map 0); last first.
rewrite size_index_iotaz lerBDr hman.
Expand Down Expand Up @@ -290,7 +290,7 @@ apply: (@eq_from_nth _ 0); rewrite size_cat !size_index_iotaz hmn hnp.
have hmn' : `|n - m | = n - m by apply: ger0_norm; rewrite subr_gte0.
rewrite nth_index_iotaz //; last first.
rewrite -subzn; last by rewrite leqNgt hi2.
by rewrite lterBDr addrC h ltz_nat.
by rewrite lterBDr [ltRHS]addrC h ltz_nat.
rewrite nth_index_iotaz //; last exact: le_trans hnp.
rewrite -subzn; last by rewrite leqNgt hi2.
move: hmn'; rewrite abszE; move->. rewrite addrCA opprB.
Expand All @@ -311,7 +311,7 @@ Lemma big_int_recr m n F : m <= n ->
op (\big[op/idx]_(m <= i < n :> int) F (i)) (F n).
Proof.
move=> hmn; rewrite (@big_cat_int n) ?ler_wpDr //=.
rewrite big_addz2l (@big_ltz 0 1) // add0r (@big_geqz 1 1) // add0r.
rewrite big_addz2l (@big_ltz 0 1) //= [0 + n]add0r (@big_geqz 1 1) //.
by rewrite Monoid.Theory.mulm1.
Qed.

Expand Down
4 changes: 2 additions & 2 deletions theories/multinomial.v
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ rewrite {}/s; elim/last_ind: l n m => [|l a ihl] n m /=.
- move=> leqnm; rewrite size_rcons big_rcons /= exprDn.
set s := size l.
pose tlast s (t : s.-tuple 'I_m.+1) := last ord0 t.
have -> P F :
have -> P (F : _ -> R) :
\sum_(t : s.+1.-tuple 'I_m.+1 | P t) F t =
\sum_(j < m.+1) \sum_(t | P t && (tlast _ t == j)) F t.
exact: partition_big.
Expand All @@ -171,7 +171,7 @@ rewrite {}/s; elim/last_ind: l n m => [|l a ihl] n m /=.
by apply: (leq_trans (leq_subr _ _)); apply: (leq_trans leqnm).
rewrite mulr_suml -sumrMnl.
pose tsum a (t : a.-tuple 'I_m.+1) b := ((\sum_(j <- t) j) == b)%N.
have -> F :
have -> (F : _ -> R) :
\sum_(t : s.+1.-tuple 'I_m.+1 | tsum _ t n && (tlast _ t == i)) F t =
\sum_(t : s.-tuple 'I_m.+1 | tsum _ t (n - i)%N) F [tuple of (rcons t i)].
pose indx (t : s.-tuple 'I_m.+1) := [tuple of rcons t i].
Expand Down
2 changes: 1 addition & 1 deletion theories/posnum.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
(* Require Import Reals. *)
From mathcomp Require Import all_ssreflect all_algebra all_field.

Check warning on line 3 in theories/posnum.v

View workflow job for this annotation

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

Notations "[ seq _ | _ <- _ ]" defined at level 0 with arguments

Check warning on line 3 in theories/posnum.v

View workflow job for this annotation

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

Notations "\pi ( _ )" defined at level 2 and "\pi"
(* Require Import boolp reals. *)

(******************************************************************************)
Expand Down Expand Up @@ -46,7 +46,7 @@
Lemma inferP (P : Prop) : P -> infer P. Proof. by []. Qed.

Lemma splitr (R : numFieldType) (x : R) : x = x / 2%:R + x / 2%:R.
Proof. by rewrite -mulr2n -mulr_natr mulfVK //= pnatr_eq0. Qed.
Proof. by rewrite -mulr2n -[RHS]mulr_natr mulfVK //= pnatr_eq0. Qed.

Record posnum_def (R : numDomainType) := PosNumDef {
num_of_pos :> R;
Expand Down Expand Up @@ -100,7 +100,7 @@

Lemma pos_Sn (n : nat) : 0 < n.+1%:R :> R.
Proof. by []. Qed.
Canonical Sn_posnum n := PosNum (pos_Sn n).

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.16)

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.17)

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 103 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.19)

Ignoring canonical projection to GRing.natmul by num_of_pos in

Lemma posnumSz (n : nat) : 0 < n.+1%:~R :> R.
Proof. by rewrite ltr0z. Qed.
Expand All @@ -112,13 +112,13 @@

Lemma posnum_factn (n : nat) : 0 < n`!%:~R :> R.
Proof. rewrite ltr0z; exact: fact_gt0. Qed.
Canonical posum_factn n := PosNum (posnum_factn n).

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.16)

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.17)

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 115 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.19)

Ignoring canonical projection to intmul by num_of_pos in


Lemma one_pos_gt0 : 0 < 1 :> R. Proof. by rewrite ltr01. Qed.
Canonical oner_posnum := PosNum one_pos_gt0.

End PosNum.

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.16)

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.16)

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.17)

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.17)

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

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

Ignoring canonical projection to intmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.19)

Ignoring canonical projection to GRing.natmul by num_of_pos in

Check warning on line 121 in theories/posnum.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.2.0-coq-8.19)

Ignoring canonical projection to intmul by num_of_pos in
#[export] Hint Extern 0 ((0 <= _)%R = true) => exact: posnum_ge0 : core.
#[export] Hint Extern 0 ((_ != 0)%R = true) => exact: posnum_neq0 : core.

Expand Down
Loading