Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
b003c3a7
Commit
b003c3a7
authored
Sep 03, 2012
by
Guillaume Melquiond
Browse files
Add a Coq realization for real.PowerInt.
parent
8f3ec6cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile.in
View file @
b003c3a7
...
...
@@ -869,7 +869,7 @@ COQLIBS_INT_FILES = Abs ComputerDivision Div2 EuclideanDivision Int MinMax Power
COQLIBS_INT_ALL_FILES
=
Exponentiation
$(COQLIBS_INT_FILES)
COQLIBS_INT
=
$(
addprefix
lib/coq/int/,
$(COQLIBS_INT_ALL_FILES)
)
COQLIBS_REAL_FILES
=
Abs ExpLog FromInt MinMax Real Square RealInfix
COQLIBS_REAL_FILES
=
Abs ExpLog FromInt MinMax
PowerInt
Real Square RealInfix
COQLIBS_REAL
=
$(
addprefix
lib/coq/real/,
$(COQLIBS_REAL_FILES)
)
COQLIBS_NUMBER_FILES
=
Divisibility Gcd Parity Prime
...
...
lib/coq/real/PowerInt.v
0 → 100644
View file @
b003c3a7
(
*
This
file
is
generated
by
Why3
'
s
Coq
driver
*
)
(
*
Beware
!
Only
edit
allowed
sections
below
*
)
Require
Import
BuiltIn
.
Require
Import
Rfunctions
.
Require
BuiltIn
.
Require
int
.
Int
.
Require
real
.
Real
.
Require
Import
Exponentiation
.
(
*
Why3
goal
*
)
Notation
power
:=
powerRZ
.
Lemma
power_is_exponentiation
:
forall
x
n
,
(
0
<=
n
)
%
Z
->
power
x
n
=
Exponentiation
.
power
_
R1
Rmult
x
n
.
Proof
.
intros
x
[
|
n
|
n
]
H
.
easy
.
2
:
now
elim
H
.
unfold
Exponentiation
.
power
,
powerRZ
.
simpl
.
induction
(
nat_of_P
n
).
easy
.
simpl
.
now
rewrite
IHn0
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Power_0
:
forall
(
x
:
R
),
((
power
x
0
%
Z
)
=
1
%
R
).
Proof
.
intros
x
.
easy
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Power_s
:
forall
(
x
:
R
)
(
n
:
Z
),
(
0
%
Z
<=
n
)
%
Z
->
((
power
x
(
n
+
1
%
Z
)
%
Z
)
=
(
x
*
(
power
x
n
))
%
R
).
Proof
.
intros
x
n
h1
.
rewrite
2
!
power_is_exponentiation
by
auto
with
zarith
.
now
apply
Power_s
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Power_1
:
forall
(
x
:
R
),
((
power
x
1
%
Z
)
=
x
).
Proof
.
exact
Rmult_1_r
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Power_sum
:
forall
(
x
:
R
)
(
n
:
Z
)
(
m
:
Z
),
(
0
%
Z
<=
n
)
%
Z
->
((
0
%
Z
<=
m
)
%
Z
->
((
power
x
(
n
+
m
)
%
Z
)
=
((
power
x
n
)
*
(
power
x
m
))
%
R
)).
Proof
.
intros
x
n
m
h1
h2
.
rewrite
3
!
power_is_exponentiation
by
auto
with
zarith
.
apply
Power_sum
;
auto
with
real
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Power_mult
:
forall
(
x
:
R
)
(
n
:
Z
)
(
m
:
Z
),
(
0
%
Z
<=
n
)
%
Z
->
((
0
%
Z
<=
m
)
%
Z
->
((
power
x
(
n
*
m
)
%
Z
)
=
(
power
(
power
x
n
)
m
))).
Proof
.
intros
x
n
m
h1
h2
.
rewrite
3
!
power_is_exponentiation
by
auto
with
zarith
.
apply
Power_mult
;
auto
with
real
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Power_mult2
:
forall
(
x
:
R
)
(
y
:
R
)
(
n
:
Z
),
(
0
%
Z
<=
n
)
%
Z
->
((
power
(
x
*
y
)
%
R
n
)
=
((
power
x
n
)
*
(
power
y
n
))
%
R
).
Proof
.
intros
x
y
n
h1
.
rewrite
3
!
power_is_exponentiation
by
auto
with
zarith
.
apply
Power_mult2
;
auto
with
real
.
Qed
.
theories/real.why
View file @
b003c3a7
...
...
@@ -236,7 +236,9 @@ theory PowerInt
use Real
clone export int.Exponentiation with
type t = real, constant one = Real.one, function (*) = Real.(*)
type t = real, constant one = Real.one, function (*) = Real.(*),
goal CommutativeMonoid.Assoc, goal CommutativeMonoid.Unit_def_l,
goal CommutativeMonoid.Unit_def_r, goal CommutativeMonoid.Comm.Comm
end
...
...
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