Skip to content

Commit cf0cafe

Browse files
committed
Adapt to MathComp 2.0.0
1 parent de30740 commit cf0cafe

File tree

4 files changed

+35
-23
lines changed

4 files changed

+35
-23
lines changed

README.md

+20-8
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ Definitions of the algebraic structure of dioid following the style of
44
ssralg in the Mathcomp library.
55

66
The main algebraic structures defined are:
7-
* semirigns: rings without oppositve for the additive law
87
* dioids: idempotent semirings (i.e., forall x, x + x = x)
98
* complete dioids: dioids whose canonical order (x <= y wen x + y = y)
109
yields a compelete lattice
1110
* commutative variants (multiplicative law is commutative)
1211

13-
More details can be found in comments at the beginning of each file.
12+
More details can be found in comments at the beginning of each .v file.
1413

1514
Installation
1615
------------
1716

18-
This is available as an OPAM (>= 2.0) package:
17+
This is currently not available as an OPAM (>= 2.0) package:
18+
19+
When MathComp Analysis for MathComp 2 will be released, this will be
20+
installable by typing:
1921

2022
```
2123
% opam repo add coq-released https://coq.inria.fr/opam/released
@@ -25,16 +27,26 @@ This is available as an OPAM (>= 2.0) package:
2527
Dependencies
2628
------------
2729

28-
* Coq (>= 8.13)
29-
* The Mathcomp library (>= 1.12.0)
30-
* Hierarchy Builder (= 1.0.0)
31-
* Mathcomp Analysis (>= 0.3.9)
30+
* Coq (>= 8.16)
31+
* The Mathcomp library (>= 2.0.0)
32+
* Hierarchy Builder (= 1.4.0)
33+
* Mathcomp Analysis (hierarchy-builder branch)
3234

3335
Dependencies can be installed with OPAM (>= 2.0) by typing:
3436

3537
```
3638
% opam repo add coq-released https://coq.inria.fr/opam/released
37-
% opam install coq-mathcomp-ssreflect.1.12.0 coq-hierarchy-builder.1.0.0 coq-mathcomp-analysis.0.3.5
39+
% opam install coq-mathcomp-algebra.2.0.0
40+
```
41+
42+
Except MathComp Analysis (or only its mathcomp-classical package) that
43+
must currently be installed from source:
44+
45+
```
46+
% git clone https://github.com/math-comp/analysis
47+
% git checkout hierarchy-builder
48+
% make -j4 -C classical
49+
% make -C classical install
3850
```
3951

4052
Compilation

complete_lattice.v

+12-12
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ Lemma omorphI : Order.meet_morphism f.
464464
Proof. by move=> x y; rewrite -!set_meet2 omorphSM !image_setU !image_set1. Qed.
465465
HB.instance Definition _ := Order.isMeetLatticeMorphism.Build d L d' L' f
466466
omorphI.
467-
Lemma omorph1 : f 1 = 1.
468-
Proof. by rewrite -[1 in LHS]set_meet0 omorphSM image_set0 set_meet0. Qed.
467+
Lemma omorph1 : f \top = \top.
468+
Proof. by rewrite -[\top in LHS]set_meet0 omorphSM image_set0 set_meet0. Qed.
469469
HB.instance Definition _ := Order.isTLatticeMorphism.Build d L d' L' f omorph1.
470470
HB.instance Definition _ := isSetMeetMorphism.Build d L d' L' f omorphSM.
471471
HB.end.
@@ -481,8 +481,8 @@ Lemma omorphU : Order.join_morphism f.
481481
Proof. by move=> x y; rewrite -!set_join2 omorphSJ !image_setU !image_set1. Qed.
482482
HB.instance Definition _ := Order.isJoinLatticeMorphism.Build d L d' L' f
483483
omorphU.
484-
Lemma omorph0 : f 0 = 0.
485-
Proof. by rewrite -[0 in LHS]set_join0 omorphSJ image_set0 set_join0. Qed.
484+
Lemma omorph0 : f \bot = \bot.
485+
Proof. by rewrite -[\bot in LHS]set_join0 omorphSJ image_set0 set_join0. Qed.
486486
HB.instance Definition _ := Order.isBLatticeMorphism.Build d L d' L' f omorph0.
487487
HB.instance Definition _ := isSetJoinMorphism.Build d L d' L' f omorphSJ.
488488
HB.end.
@@ -613,7 +613,7 @@ HB.factory Record isMeetCompleteLatticeClosed d (T : completeLatticeType d)
613613
}.
614614

615615
HB.builders Context d T S of isMeetCompleteLatticeClosed d T S.
616-
Lemma opred1 : 1 \in S. Proof. by rewrite -set_meet0 opredSM. Qed.
616+
Lemma opred1 : \top \in S. Proof. by rewrite -set_meet0 opredSM. Qed.
617617
HB.instance Definition _ := Order.isTLatticeClosed.Build d T S opred1.
618618
Lemma opredI : meet_closed S.
619619
Proof. by move=> x y xS yS; rewrite -set_meet2 opredSM// => _ [] ->. Qed.
@@ -627,7 +627,7 @@ HB.factory Record isJoinCompleteLatticeClosed d (T : completeLatticeType d)
627627
}.
628628

629629
HB.builders Context d T S of isJoinCompleteLatticeClosed d T S.
630-
Lemma opred0 : 0 \in S. Proof. by rewrite -set_join0 opredSJ. Qed.
630+
Lemma opred0 : \bot \in S. Proof. by rewrite -set_join0 opredSJ. Qed.
631631
HB.instance Definition _ := Order.isBLatticeClosed.Build d T S opred0.
632632
Lemma opredU : join_closed S.
633633
Proof. by move=> x y xS yS; rewrite -set_join2 opredSJ// => _ [] ->. Qed.
@@ -650,12 +650,12 @@ Arguments opredSM {d T} _.
650650
Arguments opredSJ {d T} _.
651651

652652
HB.mixin Record isMeetSubCompleteLattice d (T : completeLatticeType d)
653-
(S : pred T) d' U of Sub T S U & CompleteLattice d' U := {
653+
(S : pred T) d' U of SubType T S U & CompleteLattice d' U := {
654654
valSM_subproof : set_meet_morphism (val : U -> T);
655655
}.
656656

657657
HB.mixin Record isJoinSubCompleteLattice d (T : completeLatticeType d)
658-
(S : pred T) d' U of Sub T S U & CompleteLattice d' U := {
658+
(S : pred T) d' U of SubType T S U & CompleteLattice d' U := {
659659
valSJ_subproof : set_join_morphism (val : U -> T);
660660
}.
661661

@@ -718,7 +718,7 @@ Qed.
718718
HB.instance Definition _ := POrder_isMeetCompleteLattice.Build d' U
719719
set_meetU_is_glb.
720720

721-
Lemma val1 : (val : U -> T) 1 = 1.
721+
Lemma val1 : (val : U -> T) \top = \top.
722722
Proof. by rewrite subK image_set0 set_meet0. Qed.
723723
HB.instance Definition _ := Order.isTSubLattice.Build d T S d' U val1.
724724

@@ -770,7 +770,7 @@ Qed.
770770
HB.instance Definition _ := POrder_isJoinCompleteLattice.Build d' U
771771
set_joinU_is_lub.
772772

773-
Lemma val0 : (val : U -> T) 0 = 0.
773+
Lemma val0 : (val : U -> T) \bot = \bot.
774774
Proof. by rewrite subK image_set0 set_join0. Qed.
775775
HB.instance Definition _ := Order.isBSubLattice.Build d T S d' U val0.
776776

@@ -835,11 +835,11 @@ Qed.
835835
HB.instance Definition _ := POrder_isCompleteLattice.Build d' U
836836
set_meetU_is_glb set_joinU_is_lub.
837837

838-
Lemma val0 : (val : U -> T) 0 = 0.
838+
Lemma val0 : (val : U -> T) \bot = \bot.
839839
Proof. by rewrite subK image_set0 set_join0. Qed.
840840
HB.instance Definition _ := Order.isBSubLattice.Build d T S d' U val0.
841841

842-
Lemma val1 : (val : U -> T) 1 = 1.
842+
Lemma val1 : (val : U -> T) \top = \top.
843843
Proof. by rewrite subK image_set0 set_meet0. Qed.
844844
HB.instance Definition _ := Order.isTSubLattice.Build d T S d' U val1.
845845

coq-mathcomp-dioid.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ build: [
1515
install: [make "install"]
1616

1717
depends: [
18-
"coq" { >= "8.15" & < "8.18~" }
18+
"coq" { >= "8.16" & < "8.18~" }
1919
"coq-mathcomp-algebra" { >= "2.0" & < "2.1~" }
20-
"coq-mathcomp-classical" { >= "0.6.0" & < "0.7~" }
20+
"coq-mathcomp-classical" { >= "1.0" & < "1.1~" }
2121
"coq-hierarchy-builder" { >= "1.4.0" }
2222
]
2323
synopsis: "Dioid"

dioid.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ move=> a b c; rewrite /le_dioid => /eqP baa /eqP <-.
150150
by rewrite -[in X in _ == X]baa addrA.
151151
Qed.
152152

153-
HB.instance Definition _ := Order.isLePOrdered.Build d D
153+
HB.instance Definition _ := Order.Le_isPOrder.Build d D
154154
le_refl_dioid le_anti_dioid le_trans_dioid.
155155

156156
Lemma le_def (a b : D) : (a <= b) = (a + b == b).

0 commit comments

Comments
 (0)