Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rodolphe Lepigre
stdpp
Commits
cbb67c16
Commit
cbb67c16
authored
Jan 29, 2019
by
Robbert Krebbers
Browse files
Make rtc an instance of PreOrder.
parent
9883e152
Changes
1
Hide whitespace changes
Inline
Sidebyside
theories/relations.v
View file @
cbb67c16
...
@@ 65,19 +65,20 @@ Section rtc.
...
@@ 65,19 +65,20 @@ Section rtc.
Hint
Constructors
rtc
nsteps
bsteps
tc
:
core
.
Hint
Constructors
rtc
nsteps
bsteps
tc
:
core
.
Lemma
rtc_transitive
x
y
z
:
rtc
R
x
y
→
rtc
R
y
z
→
rtc
R
x
z
.
Proof
.
induction
1
;
eauto
.
Qed
.
(* We give this instance a lowerthanusual priority because [setoid_rewrite]
(* We give this instance a lowerthanusual priority because [setoid_rewrite]
queries for [@Reflexive Prop ?r] in the hope of [iff_reflexive] getting
queries for [@Reflexive Prop ?r] in the hope of [iff_reflexive] getting
picked as the instance. [rtc_reflexive] overlaps with that, leading to
picked as the instance. [rtc_reflexive] overlaps with that, leading to
backtracking. We cannot set [Hint Mode] because that query must not fail,
backtracking. We cannot set [Hint Mode] because that query must not fail,
but we can at least avoid picking [rtc_reflexive].
but we can at least avoid picking [rtc_reflexive].
See Coq bug https://github.com/coq/coq/issues/7916. *)
See Coq bug https://github.com/coq/coq/issues/7916 and the test
Global
Instance
rtc_reflexive
:
Reflexive
(
rtc
R
)

10
.
[tests.typeclasses.test_setoid_rewrite]. *)
Proof
.
exact
(@
rtc_refl
A
R
).
Qed
.
Global
Instance
rtc_po
:
PreOrder
(
rtc
R
)

10
.
Lemma
rtc_transitive
x
y
z
:
rtc
R
x
y
→
rtc
R
y
z
→
rtc
R
x
z
.
Proof
.
split
.
exact
(@
rtc_refl
A
R
).
exact
rtc_transitive
.
Qed
.
Proof
.
induction
1
;
eauto
.
Qed
.
Global
Instance
:
Transitive
(
rtc
R
).
Proof
.
exact
rtc_transitive
.
Qed
.
Lemma
rtc_once
x
y
:
R
x
y
→
rtc
R
x
y
.
Lemma
rtc_once
x
y
:
R
x
y
→
rtc
R
x
y
.
Proof
.
eauto
.
Qed
.
Proof
.
eauto
.
Qed
.
Lemma
rtc_r
x
y
z
:
rtc
R
x
y
→
R
y
z
→
rtc
R
x
z
.
Lemma
rtc_r
x
y
z
:
rtc
R
x
y
→
R
y
z
→
rtc
R
x
z
.
...
@@ 160,7 +161,7 @@ Section rtc.
...
@@ 160,7 +161,7 @@ Section rtc.
Lemma
tc_transitive
x
y
z
:
tc
R
x
y
→
tc
R
y
z
→
tc
R
x
z
.
Lemma
tc_transitive
x
y
z
:
tc
R
x
y
→
tc
R
y
z
→
tc
R
x
z
.
Proof
.
induction
1
;
eauto
.
Qed
.
Proof
.
induction
1
;
eauto
.
Qed
.
Global
Instance
:
Transitive
(
tc
R
).
Global
Instance
tc_transitive'
:
Transitive
(
tc
R
).
Proof
.
exact
tc_transitive
.
Qed
.
Proof
.
exact
tc_transitive
.
Qed
.
Lemma
tc_r
x
y
z
:
tc
R
x
y
→
R
y
z
→
tc
R
x
z
.
Lemma
tc_r
x
y
z
:
tc
R
x
y
→
R
y
z
→
tc
R
x
z
.
Proof
.
intros
.
etrans
;
eauto
.
Qed
.
Proof
.
intros
.
etrans
;
eauto
.
Qed
.
...
...
Write
Preview
Supports
Markdown
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