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
David Swasey
coq-stdpp
Commits
46304c52
Commit
46304c52
authored
Jun 24, 2013
by
Robbert Krebbers
Browse files
Misc prelude changes.
parent
472ccca0
Changes
3
Hide whitespace changes
Inline
Side-by-side
theories/decidable.v
View file @
46304c52
...
...
@@ -24,10 +24,10 @@ Lemma decide_rel_correct {A B} (R : A → B → Prop) `{∀ x y, Decision (R x y
(
x
:
A
)
(
y
:
B
)
:
decide_rel
R
x
y
=
decide
(
R
x
y
).
Proof
.
done
.
Qed
.
Lemma
decide_
t
rue
{
A
}
`
{
Decision
P
}
(
x
y
:
A
)
:
Lemma
decide_
T
rue
{
A
}
`
{
Decision
P
}
(
x
y
:
A
)
:
P
→
(
if
decide
P
then
x
else
y
)
=
x
.
Proof
.
by
destruct
(
decide
P
).
Qed
.
Lemma
decide_
f
alse
{
A
}
`
{
Decision
P
}
(
x
y
:
A
)
:
Lemma
decide_
F
alse
{
A
}
`
{
Decision
P
}
(
x
y
:
A
)
:
¬
P
→
(
if
decide
P
then
x
else
y
)
=
y
.
Proof
.
by
destruct
(
decide
P
).
Qed
.
...
...
theories/option.v
View file @
46304c52
...
...
@@ -137,6 +137,13 @@ Tactic Notation "case_option_guard" "as" ident(Hx) :=
Tactic
Notation
"case_option_guard"
:
=
let
H
:
=
fresh
in
case_option_guard
as
H
.
Lemma
option_guard_True
{
A
}
(
P
:
Prop
)
`
{
Decision
P
}
(
x
:
option
A
)
:
P
→
guard
P
;
x
=
x
.
Proof
.
intros
.
by
case_option_guard
.
Qed
.
Lemma
option_guard_False
{
A
}
(
P
:
Prop
)
`
{
Decision
P
}
(
x
:
option
A
)
:
¬
P
→
guard
P
;
x
=
None
.
Proof
.
intros
.
by
case_option_guard
.
Qed
.
Tactic
Notation
"simplify_option_equality"
"by"
tactic3
(
tac
)
:
=
repeat
match
goal
with
|
_
=>
progress
(
unfold
default
in
*)
...
...
theories/proof_irrel.v
View file @
46304c52
...
...
@@ -30,10 +30,9 @@ Proof. destruct b; simpl; apply _. Qed.
Lemma
sig_eq_pi
`
(
P
:
A
→
Prop
)
`
{
∀
x
,
ProofIrrel
(
P
x
)}
(
x
y
:
sig
P
)
:
x
=
y
↔
`
x
=
`
y
.
Proof
.
split
.
*
destruct
x
,
y
.
apply
proj1_sig_inj
.
*
destruct
x
as
[
x
Hx
],
y
as
[
y
Hy
]
;
simpl
;
intros
;
subst
.
f_equal
.
apply
proof_irrel
.
split
;
[
by
intros
<-
|].
destruct
x
as
[
x
Hx
],
y
as
[
y
Hy
]
;
simpl
;
intros
;
subst
.
f_equal
.
apply
proof_irrel
.
Qed
.
Lemma
exists_proj1_pi
`
(
P
:
A
→
Prop
)
`
{
∀
x
,
ProofIrrel
(
P
x
)}
...
...
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