Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Arthur Azevedo de Amorim
stdpp
Commits
af4cedfa
Commit
af4cedfa
authored
5 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
more instances for the empty type
parent
1ae85171
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
theories/countable.v
+5
-0
5 additions, 0 deletions
theories/countable.v
theories/decidable.v
+2
-0
2 additions, 0 deletions
theories/decidable.v
theories/finite.v
+6
-0
6 additions, 0 deletions
theories/finite.v
with
13 additions
and
0 deletions
theories/countable.v
+
5
−
0
View file @
af4cedfa
...
...
@@ -102,6 +102,11 @@ Section inj_countable'.
Next
Obligation
.
intros
x
.
by
f_equal
/=.
Qed
.
End
inj_countable'
.
(** ** Empty *)
Program
Instance
Empty_set_countable
:
Countable
Empty_set
:=
{|
encode
u
:=
1
;
decode
p
:=
None
|}
.
Next
Obligation
.
by
intros
[]
.
Qed
.
(** ** Unit *)
Program
Instance
unit_countable
:
Countable
unit
:=
{|
encode
u
:=
1
;
decode
p
:=
Some
()
|}
.
...
...
This diff is collapsed.
Click to expand it.
theories/decidable.v
+
2
−
0
View file @
af4cedfa
...
...
@@ -184,6 +184,8 @@ Instance bool_eq_dec : EqDecision bool.
Proof
.
solve_decision
.
Defined
.
Instance
unit_eq_dec
:
EqDecision
unit
.
Proof
.
solve_decision
.
Defined
.
Instance
Empty_set_eq_dec
:
EqDecision
Empty_set
.
Proof
.
solve_decision
.
Defined
.
Instance
prod_eq_dec
`{
EqDecision
A
,
EqDecision
B
}
:
EqDecision
(
A
*
B
)
.
Proof
.
solve_decision
.
Defined
.
Instance
sum_eq_dec
`{
EqDecision
A
,
EqDecision
B
}
:
EqDecision
(
A
+
B
)
.
...
...
This diff is collapsed.
Click to expand it.
theories/finite.v
+
6
−
0
View file @
af4cedfa
...
...
@@ -246,6 +246,12 @@ Qed.
Lemma
option_cardinality
`{
Finite
A
}
:
card
(
option
A
)
=
S
(
card
A
)
.
Proof
.
unfold
card
.
simpl
.
by
rewrite
fmap_length
.
Qed
.
Program
Instance
Empty_set_finite
:
Finite
Empty_set
:=
{|
enum
:=
[]
|}
.
Next
Obligation
.
by
apply
NoDup_nil
.
Qed
.
Next
Obligation
.
intros
[]
.
Qed
.
Lemma
Empty_set_card
:
card
Empty_set
=
0
.
Proof
.
done
.
Qed
.
Program
Instance
unit_finite
:
Finite
()
:=
{|
enum
:=
[
tt
]
|}
.
Next
Obligation
.
apply
NoDup_singleton
.
Qed
.
Next
Obligation
.
intros
[]
.
by
apply
elem_of_list_singleton
.
Qed
.
...
...
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