Skip to content

Commit dfbb14f

Browse files
authored
Merge pull request #118 from math-comp/finmap144
Adapt to math-comp/finmap#144
2 parents b3a9b94 + 5c7e910 commit dfbb14f

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
image:
1111
- mathcomp/mathcomp:2.4.0-coq-8.20
1212
- mathcomp/mathcomp:2.4.0-rocq-prover-9.0
13-
- mathcomp/mathcomp-dev:coq-8.20
13+
- mathcomp/mathcomp-dev:rocq-prover-9.0
14+
- mathcomp/mathcomp-dev:rocq-prover-dev
1415
fail-fast: false
1516
steps:
1617
- uses: actions/checkout@v2

src/monalg.v

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ Record malg : predArgType := Malg { malg_val : {fsfun K -> G with 0} }.
196196

197197
Fact malg_key : unit. Proof. by []. Qed.
198198

199+
#[deprecated(since="multinomials 2.5.0", note="Use Malg instead")]
199200
Definition malg_of_fsfun k := locked_with k Malg.
201+
#[warning="-deprecated-reference"]
200202
Canonical malg_unlockable k := [unlockable fun malg_of_fsfun k].
201203

202204
HB.instance Definition _ := [isNew for @malg_val].
@@ -209,6 +211,9 @@ Bind Scope ring_scope with malg.
209211

210212
Notation "{ 'malg' G [ K ] }" := (@malg K G) : type_scope.
211213
Notation "{ 'malg' K }" := {malg int[K]} : type_scope.
214+
Notation "[ 'malg' x 'in' aT => E ]" :=
215+
(Malg [fsfun[malg_key] x in aT => E]) : ring_scope.
216+
Notation "[ 'malg' x => E ]" := (Malg [fsfun[malg_key] x => E]) : ring_scope.
212217

213218
(* -------------------------------------------------------------------- *)
214219
Section MalgBaseOp.
@@ -217,26 +222,25 @@ Context {K : choiceType} {G : nmodType}.
217222

218223
Definition mcoeff (x : K) (g : {malg G[K]}) : G := malg_val g x.
219224

225+
#[deprecated(since="multinomials 2.5.0", note="Use Malg instead")]
220226
Definition mkmalg : {fsfun K -> G with 0} -> {malg G[K]} := @Malg K G.
221227

222-
Definition mkmalgU (k : K) (x : G) := mkmalg [fsfun y => [fmap].[k <- x] y].
228+
Definition mkmalgU (k : K) (x : G) := [malg y in [fset k] => x].
223229

224230
Definition msupp (g : {malg G[K]}) : {fset K} := finsupp (malg_val g).
225231

226232
End MalgBaseOp.
227233

228234
Arguments mcoeff {K G} x%_monom_scope g%_ring_scope.
235+
#[warning="-deprecated-reference"]
229236
Arguments mkmalg {K G} _.
230237
Arguments mkmalgU {K G} k%_monom_scope x%_ring_scope.
231238
Arguments msupp {K G} g%_ring_scope.
232239

233240
(* -------------------------------------------------------------------- *)
234241
Notation "g @_ k" := (mcoeff k g).
235242

236-
Notation "[ 'malg' g ]" := (mkmalg g) : ring_scope.
237-
Notation "[ 'malg' x 'in' aT => E ]" :=
238-
(mkmalg [fsfun x in aT => E]) : ring_scope.
239-
Notation "[ 'malg' x => E ]" := (mkmalg [fsfun x => E]) : ring_scope.
243+
Notation "[ 'malg' g ]" := (Malg g) : ring_scope.
240244
Notation "<< z *g k >>" := (mkmalgU k z) : ring_scope.
241245
Notation "<< k >>" := << 1 *g k >> : ring_scope.
242246

@@ -252,7 +256,7 @@ Context {K : choiceType} {G : nmodType}.
252256

253257
Implicit Types (g : {malg G[K]}) (k : K) (x y : G).
254258

255-
Lemma mkmalgK (g : {fsfun K -> G with 0}) : malg_val (mkmalg g) = g.
259+
Lemma mkmalgK (g : {fsfun K -> G with 0}) : malg_val (Malg g) = g.
256260
Proof. by []. Qed.
257261

258262
Lemma malgP (g1 g2 : {malg G[K]}) : (forall k, g1@_k = g2@_k) <-> g1 = g2.
@@ -327,7 +331,7 @@ Lemma mcoeffD k : {morph mcoeff k: x y / x + y}. Proof. exact: raddfD. Qed.
327331
Lemma mcoeffMn k n : {morph mcoeff k: x / x *+ n} . Proof. exact: raddfMn. Qed.
328332

329333
Lemma mcoeffU k x k' : << x *g k >>@_k' = x *+ (k == k').
330-
Proof. by rewrite mcoeff_fnd fnd_set fnd_fmap0; case: eqVneq. Qed.
334+
Proof. by rewrite [LHS]fsfunE inE mulrb eq_sym. Qed.
331335

332336
Lemma mcoeffUU k x : << x *g k >>@_k = x.
333337
Proof. by rewrite mcoeffU eqxx. Qed.
@@ -1365,7 +1369,9 @@ Coercion cmonom_val : cmonom >-> fsfun.
13651369

13661370
Fact cmonom_key : unit. Proof. by []. Qed.
13671371

1372+
#[deprecated(since="multinomials 2.5.0", note="Use CMonom instead")]
13681373
Definition cmonom_of_fsfun k := locked_with k CMonom.
1374+
#[warning="-deprecated-reference"]
13691375
Canonical cmonom_unlockable k := [unlockable fun cmonom_of_fsfun k].
13701376

13711377
End CmonomDef.
@@ -1374,11 +1380,13 @@ Notation "{ 'cmonom' I }" := (cmonom I) : type_scope.
13741380
Notation "''X_{1..' n '}'" := (cmonom 'I_n) : type_scope.
13751381
Notation "{ 'mpoly' R [ n ] }" := {malg R['X_{1..n}]} : type_scope.
13761382

1383+
#[deprecated(since="multinomials 2.5.0", note="Use CMonom instead"),
1384+
warning="-deprecated-reference"]
13771385
Notation mkcmonom := (cmonom_of_fsfun cmonom_key).
13781386
Notation "[ 'cmonom' E | i 'in' P ]" :=
1379-
(mkcmonom [fsfun i in P%fset => E%N | 0%N]) : monom_scope.
1387+
(CMonom [fsfun[cmonom_key] i in P%fset => E%N | 0%N]) : monom_scope.
13801388
Notation "[ 'cmonom' E | i : P ]" :=
1381-
(mkcmonom [fsfun i : P%fset => E%N | 0%N]) : monom_scope.
1389+
(CMonom [fsfun[cmonom_key] i : P%fset => E%N | 0%N]) : monom_scope.
13821390

13831391
(* -------------------------------------------------------------------- *)
13841392
Section CmonomCanonicals.
@@ -1391,13 +1399,18 @@ HB.instance Definition _ := [Choice of cmonom I by <:].
13911399
(* -------------------------------------------------------------------- *)
13921400
Implicit Types (m : cmonom I).
13931401

1402+
#[deprecated(since="multinomials 2.5.0", note="Use CMonom instead of mkcmonom"),
1403+
warning="-deprecated-syntactic-definition"]
13941404
Lemma cmE (f : {fsfun of _ : I => 0%N}) : mkcmonom f =1 CMonom f.
1395-
Proof. by rewrite unlock. Qed.
1405+
Proof.
1406+
#[warning="-deprecated-syntactic-definition"]
1407+
by rewrite [mkcmonom]unlock.
1408+
Qed.
13961409

13971410
Lemma cmP m1 m2 : reflect (forall i, m1 i = m2 i) (m1 == m2).
13981411
Proof. by apply: (iffP eqP) => [->//|eq]; apply/val_inj/fsfunP. Qed.
13991412

1400-
Definition onecm : cmonom I := mkcmonom [fsfun of _ => 0%N].
1413+
Definition onecm : cmonom I := CMonom [fsfun of _ => 0%N].
14011414

14021415
Definition ucm (i : I) : cmonom I := [cmonom 1 | _ in fset1 i]%M.
14031416

@@ -1409,18 +1422,18 @@ Definition divcm m1 m2 : cmonom I := [cmonom m1 i - m2 i | i in finsupp m1]%M.
14091422
Definition expcmn m n : cmonom I := iterop n mulcm m onecm.
14101423

14111424
Lemma onecmE i : onecm i = 0%N.
1412-
Proof. by rewrite cmE fsfun_ffun insubF. Qed.
1425+
Proof. by rewrite fsfun_ffun insubF. Qed.
14131426

14141427
Lemma ucmE i j : ucm i j = (i == j) :> nat.
1415-
Proof. by rewrite cmE fsfun_fun in_fsetE; case: eqVneq. Qed.
1428+
Proof. by rewrite fsfun_fun in_fsetE; case: eqVneq. Qed.
14161429

14171430
Lemma mulcmE m1 m2 i : mulcm m1 m2 i = (m1 i + m2 i)%N.
14181431
Proof.
1419-
by rewrite cmE fsfun_fun in_fsetE; case: (finsuppP m1); case: (finsuppP m2).
1432+
by rewrite fsfun_fun in_fsetE; case: (finsuppP m1); case: (finsuppP m2).
14201433
Qed.
14211434

14221435
Lemma divcmE m1 m2 i : divcm m1 m2 i = (m1 i - m2 i)%N.
1423-
Proof. by rewrite cmE fsfun_fun; case: finsuppP. Qed.
1436+
Proof. by rewrite fsfun_fun; case: finsuppP. Qed.
14241437

14251438
Lemma mulcmA : associative mulcm.
14261439
Proof. by move=> m1 m2 m3; apply/eqP/cmP=> i; rewrite !mulcmE addnA. Qed.

0 commit comments

Comments
 (0)