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
1dd9856f
Commit
1dd9856f
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
Multiplications of fractions.
parent
b66c9739
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/numbers.v
+16
-0
16 additions, 0 deletions
theories/numbers.v
with
16 additions
and
0 deletions
theories/numbers.v
+
16
−
0
View file @
1dd9856f
...
@@ -501,6 +501,8 @@ Next Obligation. by intros x y; apply Qcplus_pos_pos. Qed.
...
@@ -501,6 +501,8 @@ Next Obligation. by intros x y; apply Qcplus_pos_pos. Qed.
Definition
Qp_minus
(
x
y
:
Qp
)
:
option
Qp
:=
Definition
Qp_minus
(
x
y
:
Qp
)
:
option
Qp
:=
let
z
:=
(
x
-
y
)
%
Qc
in
let
z
:=
(
x
-
y
)
%
Qc
in
match
decide
(
0
<
z
)
%
Qc
with
left
Hz
=>
Some
(
mk_Qp
z
Hz
)
|
_
=>
None
end
.
match
decide
(
0
<
z
)
%
Qc
with
left
Hz
=>
Some
(
mk_Qp
z
Hz
)
|
_
=>
None
end
.
Program
Definition
Qp_mult
(
x
y
:
Qp
)
:
Qp
:=
mk_Qp
(
x
*
y
)
_
.
Next
Obligation
.
intros
x
y
.
apply
Qcmult_pos_pos
;
apply
Qp_prf
.
Qed
.
Program
Definition
Qp_div
(
x
:
Qp
)
(
y
:
positive
)
:
Qp
:=
mk_Qp
(
x
/
(
'
y
)
%
Z
)
_
.
Program
Definition
Qp_div
(
x
:
Qp
)
(
y
:
positive
)
:
Qp
:=
mk_Qp
(
x
/
(
'
y
)
%
Z
)
_
.
Next
Obligation
.
Next
Obligation
.
intros
x
y
.
assert
(
0
<
(
'
y
)
%
Z
)
%
Qc
.
intros
x
y
.
assert
(
0
<
(
'
y
)
%
Z
)
%
Qc
.
...
@@ -512,6 +514,7 @@ Qed.
...
@@ -512,6 +514,7 @@ Qed.
Notation
"1"
:=
Qp_one
:
Qp_scope
.
Notation
"1"
:=
Qp_one
:
Qp_scope
.
Infix
"+"
:=
Qp_plus
:
Qp_scope
.
Infix
"+"
:=
Qp_plus
:
Qp_scope
.
Infix
"-"
:=
Qp_minus
:
Qp_scope
.
Infix
"-"
:=
Qp_minus
:
Qp_scope
.
Infix
"*"
:=
Qp_mult
:
Qp_scope
.
Infix
"/"
:=
Qp_div
:
Qp_scope
.
Infix
"/"
:=
Qp_div
:
Qp_scope
.
Instance
Qp_inhabited
:
Inhabited
Qp
:=
populate
1
%
Qp
.
Instance
Qp_inhabited
:
Inhabited
Qp
:=
populate
1
%
Qp
.
...
@@ -535,6 +538,19 @@ Proof.
...
@@ -535,6 +538,19 @@ Proof.
destruct
(
decide
_)
as
[|[]];
auto
.
by
f_equal
;
apply
Qp_eq
.
destruct
(
decide
_)
as
[|[]];
auto
.
by
f_equal
;
apply
Qp_eq
.
Qed
.
Qed
.
Instance
Qp_mult_assoc
:
Assoc
(
=
)
Qp_mult
.
Proof
.
intros
x
y
z
;
apply
Qp_eq
,
Qcmult_assoc
.
Qed
.
Instance
Qp_mult_comm
:
Comm
(
=
)
Qp_mult
.
Proof
.
intros
x
y
;
apply
Qp_eq
,
Qcmult_comm
.
Qed
.
Lemma
Qp_mult_plus_distr_r
x
y
z
:
(
x
*
(
y
+
z
)
=
x
*
y
+
x
*
z
)
%
Qp
.
Proof
.
apply
Qp_eq
,
Qcmult_plus_distr_r
.
Qed
.
Lemma
Qp_mult_plus_distr_l
x
y
z
:
((
x
+
y
)
*
z
=
x
*
z
+
y
*
z
)
%
Qp
.
Proof
.
apply
Qp_eq
,
Qcmult_plus_distr_l
.
Qed
.
Lemma
Qp_mult_1_l
x
:
(
1
*
x
)
%
Qp
=
x
.
Proof
.
apply
Qp_eq
,
Qcmult_1_l
.
Qed
.
Lemma
Qp_mult_1_r
x
:
(
x
*
1
)
%
Qp
=
x
.
Proof
.
apply
Qp_eq
,
Qcmult_1_r
.
Qed
.
Lemma
Qp_div_1
x
:
(
x
/
1
=
x
)
%
Qp
.
Lemma
Qp_div_1
x
:
(
x
/
1
=
x
)
%
Qp
.
Proof
.
Proof
.
apply
Qp_eq
;
simpl
.
apply
Qp_eq
;
simpl
.
...
...
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