Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpdt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
research
cpdt
Commits
ca54c34f
Commit
ca54c34f
authored
Sep 08, 2008
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bool
parent
f67a8a2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
InductiveTypes.v
src/InductiveTypes.v
+21
-0
No files found.
src/InductiveTypes.v
View file @
ca54c34f
...
...
@@ -121,6 +121,11 @@ Definition not (b : bool) : bool :=
|
false
=>
true
end
.
(
**
An
alternative
definition
desugars
to
the
above
:
*
)
Definition
not
'
(
b
:
bool
)
:
bool
:=
if
b
then
false
else
true
.
(
**
We
might
want
to
prove
that
[
not
]
is
its
own
inverse
operation
.
*
)
Theorem
not_inverse
:
forall
b
:
bool
,
not
(
not
b
)
=
b
.
...
...
@@ -150,3 +155,19 @@ The first subgoal follows by Coq's rules of computation, so we can dispatch it e
Restart
.
destruct
b
;
reflexivity
.
Qed
.
(
**
Another
theorem
about
booleans
illustrates
another
useful
tactic
.
*
)
Theorem
not_ineq
:
forall
b
:
bool
,
not
b
<>
b
.
destruct
b
;
discriminate
.
Qed
.
(
**
[
discriminate
]
is
used
to
prove
that
two
values
of
an
inductive
type
are
not
equal
,
whenever
the
values
are
formed
with
different
constructors
.
In
this
case
,
the
different
constructors
are
[
true
]
and
[
false
]
.
At
this
point
,
it
is
probably
not
hard
to
guess
what
the
underlying
induction
principle
for
[
bool
]
is
.
*
)
Check
bool_ind
.
(
**
[[
bool_ind
:
forall
P
:
bool
->
Prop
,
P
true
->
P
false
->
forall
b
:
bool
,
P
b
]]
*
)
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