Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marianna Rapoport
iris-coq
Commits
cddfb22f
Commit
cddfb22f
authored
Nov 16, 2016
by
Robbert Krebbers
Browse files
Decidable equality of Qp.
parent
a9f7431c
Changes
1
Hide whitespace changes
Inline
Side-by-side
prelude/numbers.v
View file @
cddfb22f
...
...
@@ -517,13 +517,18 @@ Infix "-" := Qp_minus : Qp_scope.
Infix
"*"
:
=
Qp_mult
:
Qp_scope
.
Infix
"/"
:
=
Qp_div
:
Qp_scope
.
Instance
Qp_inhabited
:
Inhabited
Qp
:
=
populate
1
%
Qp
.
Lemma
Qp_eq
x
y
:
x
=
y
↔
Qp_car
x
=
Qp_car
y
.
Proof
.
split
;
[
by
intros
->|].
destruct
x
,
y
;
intros
;
simplify_eq
/=
;
f_equal
;
apply
(
proof_irrel
_
).
Qed
.
Instance
Qp_inhabited
:
Inhabited
Qp
:
=
populate
1
%
Qp
.
Instance
Qp_eq_dec
:
EqDecision
Qp
.
Proof
.
refine
(
λ
x
y
,
cast_if
(
decide
(
Qp_car
x
=
Qp_car
y
)))
;
by
rewrite
Qp_eq
.
Defined
.
Instance
Qp_plus_assoc
:
Assoc
(=)
Qp_plus
.
Proof
.
intros
x
y
z
;
apply
Qp_eq
,
Qcplus_assoc
.
Qed
.
Instance
Qp_plus_comm
:
Comm
(=)
Qp_plus
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment