Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flocq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Flocq
flocq
Commits
b5a603bd
Commit
b5a603bd
authored
Oct 26, 2011
by
Guillaume Melquiond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some lemmas about digits.
parent
eb0c7276
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
src/Core/Fcore_digits.v
src/Core/Fcore_digits.v
+74
-0
No files found.
src/Core/Fcore_digits.v
View file @
b5a603bd
...
...
@@ -347,6 +347,21 @@ apply sym_eq.
now
apply
(
Zmult_pow
beta
e
1
).
Qed
.
Theorem
Zdigit_not_0
:
forall
e
n
,
(
0
<=
e
)
%
Z
->
(
Zpower
beta
e
<=
Zabs
n
<
Zpower
beta
(
e
+
1
))
%
Z
->
Zdigit
n
e
<>
Z0
.
Proof
.
intros
e
n
He
Hn
.
destruct
(
Zle_or_lt
0
n
)
as
[
Hn
'
|
Hn
'
].
rewrite
(
Zabs_eq
_
Hn
'
)
in
Hn
.
now
apply
Zdigit_not_0_pos
.
intros
H
.
rewrite
(
Zabs_non_eq
n
)
in
Hn
by
now
apply
Zlt_le_weak
.
apply
(
Zdigit_not_0_pos
_
_
He
Hn
).
now
rewrite
Zdigit_opp
,
H
.
Qed
.
Theorem
Zdigit_mul_pow
:
forall
n
k
k
'
,
(
0
<=
k
'
)
%
Z
->
Zdigit
(
n
*
Zpower
beta
k
'
)
k
=
Zdigit
n
(
k
-
k
'
).
...
...
@@ -1049,4 +1064,63 @@ apply IHn.
now
apply
Zlt_lt_succ
.
Qed
.
Theorem
Zdigit_ge
:
forall
n
k
,
(
Zdigits
n
<=
k
)
%
Z
->
Zdigit
n
k
=
Z0
.
Proof
.
intros
n
k
Hk
.
apply
Zdigit_ge_Zpower
with
(
2
:=
Hk
).
apply
Zdigits_correct
.
Qed
.
Theorem
Zdigit_digits
:
forall
n
,
n
<>
Z0
->
Zdigit
n
(
Zdigits
n
-
1
)
<>
Z0
.
Proof
.
intros
n
Zn
.
apply
Zdigit_not_0
.
apply
Zlt_0_le_0_pred
.
now
apply
Zdigits_gt_0
.
ring_simplify
(
Zdigits
n
-
1
+
1
).
apply
Zdigits_correct
.
Qed
.
Theorem
Zpower_lt_Zpower
:
forall
e1
e2
,
(
Zpower
beta
(
e1
-
1
)
<
Zpower
beta
e2
)
%
Z
->
(
e1
<=
e2
)
%
Z
.
Proof
.
intros
e1
e2
He
.
apply
Znot_gt_le
.
intros
H
.
apply
Zlt_not_le
with
(
1
:=
He
).
destruct
(
Zle_or_lt
0
e2
)
as
[
He2
|
He2
].
rewrite
<-
(
Zmult_1_r
(
beta
^
e2
)).
replace
(
e1
-
1
)
%
Z
with
(
e2
+
(
e1
-
1
-
e2
))
%
Z
by
ring
.
assert
(
0
<=
e1
-
1
-
e2
)
%
Z
by
omega
.
rewrite
<-
Zmult_pow
by
assumption
.
apply
Zmult_le_compat_l
.
apply
(
Zlt_le_succ
0
).
now
apply
Zpower_gt_0
.
apply
Zpower_ge_0
.
replace
(
beta
^
e2
)
%
Z
with
Z0
by
now
destruct
e2
.
apply
Zpower_ge_0
.
Qed
.
Theorem
Zdigits_slice
:
forall
n
k
l
,
(
0
<=
l
)
%
Z
->
(
Zdigits
(
Zslice
n
k
l
)
<=
l
)
%
Z
.
Proof
.
intros
n
k
l
Hl
.
unfold
Zslice
.
rewrite
Zle_bool_true
with
(
1
:=
Hl
).
destruct
(
Zdigits_correct
(
Zscale
n
(
-
k
)
mod
beta
^
l
))
as
(
H1
,
H2
).
apply
Zpower_lt_Zpower
.
apply
Zle_lt_trans
with
(
1
:=
H1
).
rewrite
<-
(
Zabs_eq
(
beta
^
l
))
at
2
by
apply
Zpower_ge_0
.
apply
ZOmod_lt
.
apply
Zgt_not_eq
.
now
apply
Zpower_gt_0
.
Qed
.
End
Fcore_digits
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment