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
Model registry
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
Iris
stdpp
Commits
0eaae21d
Commit
0eaae21d
authored
4 years ago
by
Michael Sammler
Browse files
Options
Downloads
Patches
Plain Diff
rename Z2Nat_inj_div and Z2Nat_inj_mod
parent
fd5ab7ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!161
rename Z2Nat_inj_div and Z2Nat_inj_mod
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
theories/numbers.v
+8
-8
8 additions, 8 deletions
theories/numbers.v
with
12 additions
and
8 deletions
CHANGELOG.md
+
4
−
0
View file @
0eaae21d
...
...
@@ -3,6 +3,10 @@ API-breaking change is listed.
## std++ master
-
Rename
`Z2Nat_inj_div`
and
`Z2Nat_inj_mod`
to
`Nat2Z_inj_div`
and
`Nat2Z_inj_mod`
to follow the naming convention of
`Nat2Z`
and
`Z2Nat`
. The names
`Z2Nat_inj_div`
and
`Z2Nat_inj_mod`
have been
repurposed for be the lemmas they should actually be.
-
Added
`rotate`
and
`rotate_take`
functions for accessing a list with
wrap-around. Also added
`rotate_nat_add`
and
`rotate_nat_sub`
for
computing indicies into a rotated list.
...
...
This diff is collapsed.
Click to expand it.
theories/numbers.v
+
8
−
8
View file @
0eaae21d
...
...
@@ -436,7 +436,7 @@ Qed.
Lemma
Z2Nat_divide
n
m
:
0
≤
n
→
0
≤
m
→
(
Z
.
to_nat
n
|
Z
.
to_nat
m
)
%
nat
↔
(
n
|
m
)
.
Proof
.
intros
.
by
rewrite
<-
Nat2Z_divide
,
!
Z2Nat
.
id
by
done
.
Qed
.
Lemma
Z2
Nat_inj_div
x
y
:
Z
.
of_nat
(
x
`
div
`
y
)
=
x
`
div
`
y
.
Lemma
Nat
2Z
_inj_div
x
y
:
Z
.
of_nat
(
x
`
div
`
y
)
=
x
`
div
`
y
.
Proof
.
destruct
(
decide
(
y
=
0
%
nat
));
[
by
subst
;
destruct
x
|]
.
apply
Z
.
div_unique
with
(
x
`
mod
`
y
)
%
nat
.
...
...
@@ -444,7 +444,7 @@ Proof.
apply
Nat
.
mod_bound_pos
;
lia
.
}
by
rewrite
<-
Nat2Z
.
inj_mul
,
<-
Nat2Z
.
inj_add
,
<-
Nat
.
div_mod
.
Qed
.
Lemma
Z2
Nat_inj_mod
x
y
:
Z
.
of_nat
(
x
`
mod
`
y
)
=
x
`
mod
`
y
.
Lemma
Nat
2Z
_inj_mod
x
y
:
Z
.
of_nat
(
x
`
mod
`
y
)
=
x
`
mod
`
y
.
Proof
.
destruct
(
decide
(
y
=
0
%
nat
));
[
by
subst
;
destruct
x
|]
.
apply
Z
.
mod_unique
with
(
x
`
div
`
y
)
%
nat
.
...
...
@@ -452,21 +452,21 @@ Proof.
apply
Nat
.
mod_bound_pos
;
lia
.
}
by
rewrite
<-
Nat2Z
.
inj_mul
,
<-
Nat2Z
.
inj_add
,
<-
Nat
.
div_mod
.
Qed
.
Lemma
Nat
2Z
_inj_div
x
y
:
Lemma
Z2
Nat_inj_div
x
y
:
0
≤
x
→
0
≤
y
→
Z
.
to_nat
(
x
`
div
`
y
)
=
(
Z
.
to_nat
x
`
div
`
Z
.
to_nat
y
)
%
nat
.
Proof
.
intros
.
destruct
(
decide
(
y
=
0
%
nat
));
[
by
subst
;
destruct
x
|]
.
pose
proof
(
Z
.
div_pos
x
y
)
.
apply
(
inj
Z
.
of_nat
)
.
by
rewrite
Z2
Nat_inj_div
,
!
Z2Nat
.
id
by
lia
.
apply
(
inj
Z
.
of_nat
)
.
by
rewrite
Nat
2Z
_inj_div
,
!
Z2Nat
.
id
by
lia
.
Qed
.
Lemma
Nat
2Z
_inj_mod
x
y
:
Lemma
Z2
Nat_inj_mod
x
y
:
0
≤
x
→
0
≤
y
→
Z
.
to_nat
(
x
`
mod
`
y
)
=
(
Z
.
to_nat
x
`
mod
`
Z
.
to_nat
y
)
%
nat
.
Proof
.
intros
.
destruct
(
decide
(
y
=
0
%
nat
));
[
by
subst
;
destruct
x
|]
.
pose
proof
(
Z_mod_pos
x
y
)
.
apply
(
inj
Z
.
of_nat
)
.
by
rewrite
Z2
Nat_inj_mod
,
!
Z2Nat
.
id
by
lia
.
apply
(
inj
Z
.
of_nat
)
.
by
rewrite
Nat
2Z
_inj_mod
,
!
Z2Nat
.
id
by
lia
.
Qed
.
Lemma
Z_succ_pred_induction
y
(
P
:
Z
→
Prop
)
:
P
y
→
...
...
@@ -894,7 +894,7 @@ Lemma rotate_nat_add_lt base offset len :
Proof
.
unfold
rotate_nat_add
.
intros
?
.
pose
proof
(
Nat
.
mod_upper_bound
(
base
+
offset
)
len
)
.
rewrite
Nat
2Z
_inj_mod
,
Z2Nat
.
inj_add
,
!
Nat2Z
.
id
;
lia
.
rewrite
Z2
Nat_inj_mod
,
Z2Nat
.
inj_add
,
!
Nat2Z
.
id
;
lia
.
Qed
.
Lemma
rotate_nat_sub_lt
base
offset
len
:
0
<
len
→
rotate_nat_sub
base
offset
len
<
len
.
...
...
@@ -934,7 +934,7 @@ Lemma rotate_nat_add_add base offset len n:
(
rotate_nat_add
base
offset
len
+
n
)
`
mod
`
len
.
Proof
.
intros
?
.
unfold
rotate_nat_add
.
rewrite
!
Nat
2Z
_inj_mod
,
!
Z2Nat
.
inj_add
,
!
Nat2Z
.
id
by
lia
.
rewrite
!
Z2
Nat_inj_mod
,
!
Z2Nat
.
inj_add
,
!
Nat2Z
.
id
by
lia
.
by
rewrite
plus_assoc
,
Nat
.
add_mod_idemp_l
by
lia
.
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