Skip to content

Commit eb28e0d

Browse files
committed
[WIP] replace the infrastructure of mpoly with monalg
1 parent 27b915c commit eb28e0d

File tree

2 files changed

+531
-1013
lines changed

2 files changed

+531
-1013
lines changed

src/monalg.v

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Reserved Notation "<< k >>" (format "<< k >>").
4444
Reserved Notation "g @_ k"
4545
(at level 3, k at level 2, left associativity, format "g @_ k").
4646
Reserved Notation "c %:MP" (format "c %:MP").
47-
Reserved Notation "''X_{1..' n '}'".
47+
Reserved Notation "''X_{1..' n '}'" (n at level 2).
4848
Reserved Notation "'U_(' n )" (format "'U_(' n )").
4949
Reserved Notation "x ^[ f , g ]" (at level 1, format "x ^[ f , g ]").
5050

@@ -982,6 +982,9 @@ HB.instance Definition _ :=
982982
HB.instance Definition _ :=
983983
GRing.LSemiModule_isLSemiAlgebra.Build R {malg R[K]} (@fgscaleAl K R).
984984

985+
(* FIXME: HB.saturate *)
986+
HB.instance Definition _ := GRing.RMorphism.on (mcoeff 1 : {malg R[K]} -> R).
987+
985988
End MalgNzSemiRingTheory.
986989

987990
(* -------------------------------------------------------------------- *)
@@ -1290,7 +1293,7 @@ Arguments monalgOver_pred _ _ _ _ /.
12901293

12911294
(* -------------------------------------------------------------------- *)
12921295
HB.mixin Record isMeasure (M : monomType) (mf : M -> nat) := {
1293-
mf0 : mf 1%M = 0%N;
1296+
mf1 : mf 1%M = 0%N;
12941297
mfM : {morph mf : m1 m2 / (m1 * m2)%M >-> (m1 + m2)%N};
12951298
mf_eq0I : forall m, mf m = 0%N -> m = 1%M
12961299
}.
@@ -1310,7 +1313,7 @@ Context (M : monomType) (G : nmodType) (mf : measure M).
13101313
Implicit Types (g : {malg G[M]}).
13111314

13121315
Lemma mf_eq0 m : (mf m == 0%N) = (m == 1%M).
1313-
Proof. by apply/eqP/eqP=> [|->]; rewrite ?mf0 // => /mf_eq0I. Qed.
1316+
Proof. by apply/eqP/eqP=> [|->]; rewrite ?mf1 // => /mf_eq0I. Qed.
13141317

13151318
Definition mmeasure g := (\max_(m <- msupp g) (mf m).+1)%N.
13161319

@@ -1332,7 +1335,7 @@ Proof. by apply/contraTN=> /mmeasure_mnm_lt; rewrite leqNgt ltnS. Qed.
13321335
Lemma mmeasureC c : mmeasure c%:MP = (c != 0%R) :> nat.
13331336
Proof.
13341337
rewrite mmeasureE msuppC; case: (_ == 0)=> /=.
1335-
by rewrite big_nil. by rewrite big_seq_fset1 mf0.
1338+
by rewrite big_nil. by rewrite big_seq_fset1 mf1.
13361339
Qed.
13371340

13381341
Lemma mmeasureD_le g1 g2 :
@@ -1389,6 +1392,8 @@ Canonical cmonom_unlockable k := [unlockable fun cmonom_of_fsfun k].
13891392

13901393
End CmonomDef.
13911394

1395+
Bind Scope monom_scope with cmonom.
1396+
13921397
Notation "{ 'cmonom' I }" := (cmonom I) : type_scope.
13931398
Notation "''X_{1..' n '}'" := (cmonom 'I_n) : type_scope.
13941399
Notation "{ 'mpoly' R [ n ] }" := {malg R['X_{1..n}]} : type_scope.
@@ -1413,7 +1418,7 @@ Implicit Types (m : cmonom I).
14131418
Lemma cmE (f : {fsfun of _ : I => 0%N}) : mkcmonom f =1 CMonom f.
14141419
Proof. by rewrite unlock. Qed.
14151420

1416-
Lemma cmP m1 m2 : reflect (forall i, m1 i = m2 i) (m1 == m2).
1421+
Lemma cmP m1 m2 : reflect (m1 =1 m2) (m1 == m2).
14171422
Proof. by apply: (iffP eqP) => [->//|eq]; apply/val_inj/fsfunP. Qed.
14181423

14191424
Definition onecm : cmonom I := mkcmonom [fsfun of _ => 0%N].
@@ -1465,6 +1470,8 @@ HB.instance Definition _ := MonomialDef_isConomialDef.Build (cmonom I) mulcmC.
14651470

14661471
End CmonomCanonicals.
14671472

1473+
HB.instance Definition _ (I : countType) := [Countable of cmonom I by <:].
1474+
14681475
(* -------------------------------------------------------------------- *)
14691476
Definition mdeg {I : choiceType} (m : cmonom I) :=
14701477
(\sum_(k <- finsupp m) m k)%N.
@@ -1659,6 +1666,8 @@ Canonical fmonom_unlockable k := [unlockable fun fmonom_of_seq k].
16591666

16601667
End FmonomDef.
16611668

1669+
Bind Scope monom_scope with fmonom.
1670+
16621671
Notation "{ 'fmonom' I }" := (fmonom I) : type_scope.
16631672

16641673
Local Notation mkfmonom s := (fmonom_of_seq fmonom_key s).
@@ -1715,6 +1724,8 @@ HB.instance Definition _ := Choice_isMonomialDef.Build (fmonom I)
17151724

17161725
End FmonomCanonicals.
17171726

1727+
HB.instance Definition _ (I : countType) := [Countable of fmonom I by <:].
1728+
17181729
(* -------------------------------------------------------------------- *)
17191730
Definition fdeg (I : choiceType) (m : fmonom I) := size m.
17201731

0 commit comments

Comments
 (0)