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
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
171c94fa
Commit
171c94fa
authored
Feb 07, 2014
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Missing file added
Ca m'apprendra a commiter/pusher trop vite...
parent
056832f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
lib/coq/number/Coprime.v
lib/coq/number/Coprime.v
+69
-0
No files found.
lib/coq/number/Coprime.v
0 → 100644
View file @
171c94fa
(
*
This
file
is
generated
by
Why3
'
s
Coq
-
realize
driver
*
)
(
*
Beware
!
Only
edit
allowed
sections
below
*
)
Require
Import
BuiltIn
.
Require
Import
ZOdiv
.
Require
BuiltIn
.
Require
int
.
Int
.
Require
int
.
Abs
.
Require
int
.
EuclideanDivision
.
Require
int
.
ComputerDivision
.
Require
number
.
Parity
.
Require
number
.
Divisibility
.
Require
number
.
Gcd
.
Require
number
.
Prime
.
(
*
Why3
assumption
*
)
Definition
coprime
(
a
:
Z
)
(
b
:
Z
)
:
Prop
:=
((
number
.
Gcd
.
gcd
a
b
)
=
1
%
Z
).
Lemma
coprime_is_Zrel_prime
:
forall
a
b
,
coprime
a
b
<->
Znumtheory
.
rel_prime
a
b
.
intros
.
unfold
coprime
.
unfold
Znumtheory
.
rel_prime
.
split
;
intro
h
.
rewrite
<-
h
;
apply
Znumtheory
.
Zgcd_is_gcd
.
apply
Znumtheory
.
Zis_gcd_gcd
;
auto
with
zarith
.
Qed
.
(
*
Why3
goal
*
)
Lemma
prime_coprime
:
forall
(
p
:
Z
),
(
number
.
Prime
.
prime
p
)
<->
((
2
%
Z
<=
p
)
%
Z
/
\
forall
(
n
:
Z
),
((
1
%
Z
<=
n
)
%
Z
/
\
(
n
<
p
)
%
Z
)
->
(
coprime
n
p
)).
intros
p
.
(
*
Znumtheory
.
prime_intro
:
forall
p
:
int
,
(
1
<
p
)
%
Z
->
(
forall
n
:
int
,
(
1
<=
n
<
p
)
%
Z
->
Znumtheory
.
rel_prime
n
p
)
->
Znumtheory
.
prime
p
*
)
rewrite
Prime
.
prime_is_Zprime
.
split
.
intro
h
;
inversion
h
;
clear
h
.
split
;
auto
with
zarith
.
intros
n
h
.
rewrite
coprime_is_Zrel_prime
.
apply
H0
;
auto
.
intros
(
h1
,
h2
).
constructor
;
auto
with
zarith
.
intros
n
h
.
rewrite
<-
coprime_is_Zrel_prime
.
apply
h2
;
auto
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Gauss
:
forall
(
a
:
Z
)
(
b
:
Z
)
(
c
:
Z
),
((
number
.
Divisibility
.
divides
a
(
b
*
c
)
%
Z
)
/
\
(
coprime
a
b
))
->
(
number
.
Divisibility
.
divides
a
c
).
intros
a
b
c
(
h1
,
h2
).
apply
Znumtheory
.
Gauss
with
b
;
auto
.
rewrite
<-
coprime_is_Zrel_prime
;
auto
.
Qed
.
(
*
Why3
goal
*
)
Lemma
Euclid
:
forall
(
p
:
Z
)
(
a
:
Z
)
(
b
:
Z
),
((
number
.
Prime
.
prime
p
)
/
\
(
number
.
Divisibility
.
divides
p
(
a
*
b
)
%
Z
))
->
((
number
.
Divisibility
.
divides
p
a
)
\
/
(
number
.
Divisibility
.
divides
p
b
)).
intros
p
a
b
(
h1
,
h2
).
apply
Znumtheory
.
prime_mult
;
auto
.
now
rewrite
<-
Prime
.
prime_is_Zprime
.
Qed
.
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