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
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
Thibaut Pérami
stdpp
Commits
e8560422
Commit
e8560422
authored
7 years ago
by
Johannes Kloos
Browse files
Options
Downloads
Patches
Plain Diff
Provide more Inj instances in numbers
parent
173b3078
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/numbers.v
+8
-0
8 additions, 0 deletions
theories/numbers.v
theories/pretty.v
+3
-6
3 additions, 6 deletions
theories/pretty.v
with
11 additions
and
6 deletions
theories/numbers.v
+
8
−
0
View file @
e8560422
...
...
@@ -347,6 +347,14 @@ Proof.
Qed
.
Close
Scope
Z_scope
.
(** * Injectivity of casts *)
Instance
N_of_nat_inj
:
Inj
(
=
)
(
=
)
N
.
of_nat
:=
Nat2N
.
inj
.
Instance
nat_of_N_inj
:
Inj
(
=
)
(
=
)
N
.
to_nat
:=
N2Nat
.
inj
.
Instance
nat_of_pos_inj
:
Inj
(
=
)
(
=
)
Pos
.
to_nat
:=
Pos2Nat
.
inj
.
Instance
pos_of_Snat_inj
:
Inj
(
=
)
(
=
)
Pos
.
of_succ_nat
:=
SuccNat2Pos
.
inj
.
Instance
Z_of_N_inj
:
Inj
(
=
)
(
=
)
Z
.
of_N
:=
N2Z
.
inj
.
(* Add others here. *)
(** * Notations and properties of [Qc] *)
Open
Scope
Qc_scope
.
Delimit
Scope
Qc_scope
with
Qc
.
...
...
This diff is collapsed.
Click to expand it.
theories/pretty.v
+
3
−
6
View file @
e8560422
(* Copyright (c) 2012-2017, Coq-std++ developers. *)
(* This file is distributed under the terms of the BSD license. *)
From
stdpp
Require
Export
strings
.
From
stdpp
Require
Import
relations
.
From
stdpp
Require
Import
relations
numbers
.
From
Coq
Require
Import
Ascii
.
Set
Default
Proof
Using
"Type"
.
...
...
@@ -72,8 +72,5 @@ Instance pretty_Z : Pretty Z := λ x,
end
%
string
.
Instance
pretty_nat
:
Pretty
nat
:=
λ
x
,
pretty
(
N
.
of_nat
x
)
.
Instance
pretty_nat_inj
:
Inj
(
@
eq
nat
)
(
=
)
pretty
.
Proof
.
unfold
pretty
,
pretty_nat
.
apply
compose_inj
with
(
R2
:=
eq
)
(
f
:=
N
.
of_nat
),
_
.
exact
Nat2N
.
inj
.
Qed
.
Proof
.
apply
_
.
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