@@ -117,16 +117,16 @@ Module Exports. HB.reexport. End Exports.
117
117
Export Exports.
118
118
119
119
(* -------------------------------------------------------------------- *)
120
- Definition mmorphism (M : monomType) (S : semiRingType ) (f : M -> S) : Prop :=
120
+ Definition mmorphism (M : monomType) (S : pzSemiRingType ) (f : M -> S) : Prop :=
121
121
(f 1%M = 1) * {morph f : x y / (x * y)%M >-> (x * y)%R}.
122
122
123
123
HB.mixin Record isMultiplicative
124
- (M : monomType) (S : semiRingType ) (apply : M -> S) := {
124
+ (M : monomType) (S : pzSemiRingType ) (apply : M -> S) := {
125
125
mmorphism_subproof : mmorphism apply;
126
126
}.
127
127
128
128
#[mathcomp(axiom="multiplicative")]
129
- HB.structure Definition MMorphism (M : monomType) (S : semiRingType ) :=
129
+ HB.structure Definition MMorphism (M : monomType) (S : pzSemiRingType ) :=
130
130
{f of isMultiplicative M S f}.
131
131
132
132
Module MMorphismExports.
@@ -143,7 +143,7 @@ Export MMorphismExports.
143
143
(* -------------------------------------------------------------------- *)
144
144
Section MMorphismTheory.
145
145
146
- Context {M : monomType} {S : semiRingType } (f : {mmorphism M -> S}).
146
+ Context {M : monomType} {S : pzSemiRingType } (f : {mmorphism M -> S}).
147
147
148
148
Lemma mmorph1 : f 1%M = 1.
149
149
Proof . exact: mmorphism_subproof.1. Qed .
@@ -191,10 +191,10 @@ Definition msupp (g : {malg G[K]}) : {fset K} := finsupp (malg_val g).
191
191
192
192
End MalgBaseOp.
193
193
194
- Arguments mcoeff {K G} x%monom_scope g%ring_scope .
194
+ Arguments mcoeff {K G} x%_monom_scope g%_ring_scope .
195
195
Arguments mkmalg {K G} _.
196
- Arguments mkmalgU {K G} k%monom_scope x%ring_scope .
197
- Arguments msupp {K G} g%ring_scope .
196
+ Arguments mkmalgU {K G} k%_monom_scope x%_ring_scope .
197
+ Arguments msupp {K G} g%_ring_scope .
198
198
199
199
(* -------------------------------------------------------------------- *)
200
200
Notation "g @_ k" := (mcoeff k g).
@@ -420,7 +420,7 @@ End MalgZmodTheory.
420
420
(* -------------------------------------------------------------------- *)
421
421
Section MalgSemiRingTheory.
422
422
423
- Context {K : choiceType} {R : semiRingType }.
423
+ Context {K : choiceType} {R : pzSemiRingType }.
424
424
425
425
Implicit Types (g : {malg R[K]}).
426
426
@@ -533,7 +533,7 @@ End MalgMonomTheory.
533
533
(* -------------------------------------------------------------------- *)
534
534
Section MalgSemiRingTheory.
535
535
536
- Context (K : monomType) (R : semiRingType ).
536
+ Context (K : monomType) (R : pzSemiRingType ).
537
537
538
538
Implicit Types (g : {malg R[K]}) (k l : K).
539
539
@@ -656,11 +656,8 @@ rewrite [LHS](big_morph (fgmul _) (fun _ _ => fgmulgDr _ _ _) (fgmulg0 _)).
656
656
by rewrite fgmulEr1; apply/eq_bigr=> k3 _; rewrite !fgmulUU mulrA mulmA.
657
657
Qed .
658
658
659
- Lemma fgoner_eq0 : fgone != 0.
660
- Proof . by apply/eqP/malgP=> /(_ 1%M) /eqP; rewrite !mcoeffsE oner_eq0. Qed .
661
-
662
- HB.instance Definition _ := GRing.Nmodule_isSemiRing.Build {malg R[K]}
663
- fgmulA fgmul1g fgmulg1 fgmulgDl fgmulgDr fgmul0g fgmulg0 fgoner_eq0.
659
+ HB.instance Definition _ := GRing.Nmodule_isPzSemiRing.Build {malg R[K]}
660
+ fgmulA fgmul1g fgmulg1 fgmulgDl fgmulgDr fgmul0g fgmulg0.
664
661
665
662
Lemma malgM_def g1 g2 : g1 * g2 = fgmul g1 g2.
666
663
Proof . by []. Qed .
@@ -674,15 +671,9 @@ Qed.
674
671
Lemma fgscaleAl c g1 g2 : c *: (g1 * g2) = (c *: g1) * g2.
675
672
Proof . by rewrite -!mul_malgC mulrA. Qed .
676
673
677
- HB.instance Definition _ :=
678
- GRing.LSemiModule_isLSemiAlgebra.Build R {malg R[K]} fgscaleAl.
679
-
680
674
Lemma mcoeffU1 k k' : (<< k >> : {malg R[K]})@_k' = (k == k')%:R.
681
675
Proof . by rewrite mcoeffU. Qed .
682
676
683
- Lemma msuppU1 k : @msupp _ R << k >> = [fset k].
684
- Proof . by rewrite msuppU oner_eq0. Qed .
685
-
686
677
Lemma malgME g1 g2 :
687
678
g1 * g2 = \sum_(k1 <- msupp g1) \sum_(k2 <- msupp g2)
688
679
<< g1@_k1 * g2@_k2 *g k1 * k2 >>.
@@ -794,14 +785,26 @@ HB.instance Definition _ :=
794
785
795
786
End MalgSemiRingTheory.
796
787
797
- (* FIXME: HB.saturate *)
798
- HB.instance Definition _ (K : monomType) (R : ringType) :=
799
- GRing.SemiRing.on {malg R[K]}.
788
+ (* -------------------------------------------------------------------- *)
789
+ Section MalgNzSemiRingTheory.
790
+
791
+ Context (K : monomType) (R : nzSemiRingType).
792
+
793
+ Lemma fgoner_eq0 : 1 != 0 :> {malg R[K]}.
794
+ Proof . by apply/eqP/malgP=> /(_ 1%M) /eqP; rewrite !mcoeffsE oner_eq0. Qed .
795
+
796
+ HB.instance Definition _ :=
797
+ GRing.PzSemiRing_isNonZero.Build {malg R[K]} fgoner_eq0.
798
+
799
+ HB.instance Definition _ :=
800
+ GRing.LSemiModule_isLSemiAlgebra.Build R {malg R[K]} (@fgscaleAl K R).
801
+
802
+ End MalgNzSemiRingTheory.
800
803
801
804
(* -------------------------------------------------------------------- *)
802
805
Section MalgComSemiRingType.
803
806
804
- Context {K : conomType} {R : comSemiRingType }.
807
+ Context {K : conomType} {R : comPzSemiRingType }.
805
808
806
809
Lemma fgmulC : @commutative {malg R[K]} _ *%R.
807
810
Proof .
@@ -811,25 +814,37 @@ by rewrite mulrC [X in X==k]mulmC.
811
814
Qed .
812
815
813
816
HB.instance Definition _ :=
814
- GRing.SemiRing_hasCommutativeMul.Build {malg R[K]} fgmulC.
817
+ GRing.PzSemiRing_hasCommutativeMul.Build {malg R[K]} fgmulC.
818
+
819
+ End MalgComSemiRingType.
820
+
821
+ (* -------------------------------------------------------------------- *)
822
+ Section MalgNzComSemiRingType.
815
823
824
+ Context {K : conomType} {R : comNzSemiRingType}.
825
+
826
+ HB.instance Definition _ := GRing.ComPzSemiRing.on {malg R[K]}.
816
827
HB.instance Definition _ :=
817
828
GRing.LSemiAlgebra_isComSemiAlgebra.Build R {malg R[K]}.
818
829
819
- End MalgComSemiRingType .
830
+ End MalgNzComSemiRingType .
820
831
821
832
(* FIXME: HB.saturate *)
822
- HB.instance Definition _ (K : monomType) (R : ringType) :=
823
- GRing.Lmodule.on {malg R[K]}.
824
- HB.instance Definition _ (K : conomType) (R : comRingType) :=
825
- GRing.Lmodule.on {malg R[K]}.
833
+ HB.instance Definition _ (K : monomType) (R : pzRingType) :=
834
+ GRing.PzSemiRing.on {malg R[K]}.
835
+ HB.instance Definition _ (K : monomType) (R : nzRingType) :=
836
+ GRing.NzSemiRing.on {malg R[K]}.
837
+ HB.instance Definition _ (K : conomType) (R : comPzRingType) :=
838
+ GRing.ComPzSemiRing.on {malg R[K]}.
839
+ HB.instance Definition _ (K : conomType) (R : comNzRingType) :=
840
+ GRing.ComNzSemiRing.on {malg R[K]}.
826
841
(* /FIXME *)
827
842
828
843
(* -------------------------------------------------------------------- *)
829
844
Section MalgMorphism.
830
845
Section Defs.
831
846
832
- Context {K : choiceType} {G : nmodType} {S : semiRingType }.
847
+ Context {K : choiceType} {G : nmodType} {S : pzSemiRingType }.
833
848
Context (f : G -> S) (h : K -> S).
834
849
835
850
Definition mmap g := \sum_(k <- msupp g) f g@_k * h k.
@@ -843,7 +858,7 @@ Local Notation "g ^[ f , h ]" := (mmap f h g).
843
858
844
859
Section SemiAdditive.
845
860
846
- Context {K : choiceType} {G : nmodType} {S : semiRingType }.
861
+ Context {K : choiceType} {G : nmodType} {S : pzSemiRingType }.
847
862
848
863
Lemma mmapEw (d : {fset K}) g : msupp g `<=` d ->
849
864
forall (f : {additive G -> S}) (h : K -> S),
@@ -879,7 +894,7 @@ End SemiAdditive.
879
894
880
895
Section Additive.
881
896
882
- Context {K : choiceType} {G : zmodType} {S : ringType }.
897
+ Context {K : choiceType} {G : zmodType} {S : pzRingType }.
883
898
Context (f : {additive G -> S}) (h : K -> S).
884
899
885
900
Lemma mmapN : {morph mmap f h: x / - x} . Proof . exact: raddfN. Qed .
@@ -890,7 +905,7 @@ End Additive.
890
905
891
906
Section CommrMultiplicative.
892
907
893
- Context {K : monomType} {R S : semiRingType }.
908
+ Context {K : monomType} {R S : pzSemiRingType }.
894
909
Context (f : {rmorphism R -> S}) (h : {mmorphism K -> S}).
895
910
896
911
Implicit Types (c : R) (g : {malg R[K]}).
@@ -922,7 +937,7 @@ End CommrMultiplicative.
922
937
(* -------------------------------------------------------------------- *)
923
938
Section Multiplicative.
924
939
925
- Context {K : monomType} {R : semiRingType } {S : comSemiRingType }.
940
+ Context {K : monomType} {R : pzSemiRingType } {S : comPzSemiRingType }.
926
941
Context (f : {rmorphism R -> S}) (h : {mmorphism K -> S}).
927
942
928
943
Lemma mmap_is_multiplicative : multiplicative (mmap f h).
@@ -937,7 +952,7 @@ End Multiplicative.
937
952
(* -------------------------------------------------------------------- *)
938
953
Section Linear.
939
954
940
- Context {K : monomType} {R : comSemiRingType } (h : {mmorphism K -> R}).
955
+ Context {K : monomType} {R : comPzSemiRingType } (h : {mmorphism K -> R}).
941
956
942
957
Lemma mmap_is_linear : scalable_for *%R (mmap idfun h).
943
958
Proof . by move=> /= c g; rewrite -mul_malgC rmorphM /= mmapC. Qed .
@@ -1037,7 +1052,7 @@ End MonalgOverOpp.
1037
1052
(* -------------------------------------------------------------------- *)
1038
1053
Section MonalgOverSemiring.
1039
1054
1040
- Context (K : monomType) (R : semiRingType ) (S : semiringClosed R).
1055
+ Context (K : monomType) (R : pzSemiRingType ) (S : semiringClosed R).
1041
1056
1042
1057
Local Notation monalgOver := (@monalgOver K R).
1043
1058
0 commit comments