Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Roux
Iris
Commits
a241bf9d
Commit
a241bf9d
authored
4 years ago
by
Simon Friis Vindum
Browse files
Options
Downloads
Patches
Plain Diff
Add natural numbers with min RA
parent
995dc37b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/algebra/cmra.v
+35
-0
35 additions, 0 deletions
theories/algebra/cmra.v
with
35 additions
and
0 deletions
theories/algebra/cmra.v
+
35
−
0
View file @
a241bf9d
...
@@ -1085,6 +1085,7 @@ Section nat.
...
@@ -1085,6 +1085,7 @@ Section nat.
Proof
.
by
intros
????
?
%
Nat
.
add_cancel_l
.
Qed
.
Proof
.
by
intros
????
?
%
Nat
.
add_cancel_l
.
Qed
.
End
nat
.
End
nat
.
(** ** Natural numbers with [max] as the operation. *)
Definition
mnat
:=
nat
.
Definition
mnat
:=
nat
.
Section
mnat
.
Section
mnat
.
...
@@ -1120,6 +1121,40 @@ Section mnat.
...
@@ -1120,6 +1121,40 @@ Section mnat.
Proof
.
by
constructor
.
Qed
.
Proof
.
by
constructor
.
Qed
.
End
mnat
.
End
mnat
.
(** ** Natural numbers with [min] as the operation. *)
Record
min_nat
:=
MinNat
{
min_nat_car
:>
nat
}
.
Canonical
Structure
min_natO
:=
leibnizO
min_nat
.
Section
min_nat
.
Instance
min_nat_valid
:
Valid
min_nat
:=
λ
x
,
True
.
Instance
min_nat_validN
:
ValidN
min_nat
:=
λ
n
x
,
True
.
Instance
min_nat_pcore
:
PCore
min_nat
:=
Some
.
Instance
min_nat_op
:
Op
min_nat
:=
λ
n
m
,
MinNat
(
n
`
min
`
m
)
.
Definition
min_nat_op_min
x
y
:
MinNat
x
⋅
MinNat
y
=
MinNat
(
x
`
min
`
y
)
:=
eq_refl
.
Lemma
min_nat_included
(
x
y
:
min_nat
)
:
x
≼
y
↔
(
min_nat_car
x
)
≥
(
min_nat_car
y
)
.
Proof
.
split
.
-
intros
[
z
->
]
.
simpl
.
lia
.
-
exists
y
.
rewrite
/
op
/
min_nat_op
.
rewrite
Nat
.
min_r
;
last
lia
.
by
destruct
y
.
Qed
.
Lemma
min_nat_ra_mixin
:
RAMixin
min_nat
.
Proof
.
apply
ra_total_mixin
;
apply
_
||
eauto
.
-
intros
[
x
]
[
y
]
[
z
]
.
repeat
rewrite
min_nat_op_min
.
by
rewrite
Nat
.
min_assoc
.
-
intros
[
x
]
[
y
]
.
by
rewrite
min_nat_op_min
Nat
.
min_comm
.
-
intros
[
x
]
.
by
rewrite
min_nat_op_min
Min
.
min_idempotent
.
Qed
.
Canonical
Structure
min_natR
:
cmraT
:=
discreteR
min_nat
min_nat_ra_mixin
.
Global
Instance
min_nat_cmra_discrete
:
CmraDiscrete
min_natR
.
Proof
.
apply
discrete_cmra_discrete
.
Qed
.
Global
Instance
min_nat_core_id
(
x
:
min_nat
)
:
CoreId
x
.
Proof
.
by
constructor
.
Qed
.
End
min_nat
.
(** ** Positive integers. *)
(** ** Positive integers. *)
Section
positive
.
Section
positive
.
Instance
pos_valid
:
Valid
positive
:=
λ
x
,
True
.
Instance
pos_valid
:
Valid
positive
:=
λ
x
,
True
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment