Skip to content

Commit e65f3e7

Browse files
author
Alex Gryzlov
committed
changes after review
1 parent b23be09 commit e65f3e7

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

src/ProofObjects.lidr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
> module ProofObjects
44

5-
\[
6-
\say{"\textit{Algorithms are the computational content of proofs.}" - Robert
5+
\say{"\textit{Algorithms are the computational content of proofs.}" - Robert
76
Harper}
8-
\]
97

108
We have seen that Idris has mechanisms both for _programming_, using inductive
119
data types like \idr{Nat} or \idr{List} and functions over these types, and for
@@ -103,9 +101,10 @@ wants to be further applied to evidence that that number is even; its type,
103101
{n : Nat} -> Ev n -> Ev (S (S n))
104102
```
105103

106-
expresses this functionality, in the same way that the polymorphic type \idr{{x
107-
: Type} -> List x} expresses the fact that the constructor \idr{Nil} can be
108-
thought of as a function from types to empty lists with elements of that type.
104+
expresses this functionality, in the same way that the polymorphic type
105+
\idr{{x : Type} -> List x} expresses the fact that the constructor \idr{Nil} can
106+
be thought of as a function from types to empty lists with elements of that
107+
type.
109108

110109
\todo[inline]{Edit or remove}
111110

@@ -128,7 +127,8 @@ programs in the language.
128127

129128
== Proof Scripts
130129

131-
\ \todo[inline]{Rewrite, keep explanation about holes? Seems a bit late for that}
130+
\ \todo[inline]{Rewrite, keep explanation about holes? Seems a bit late for
131+
that}
132132

133133
The _proof objects_ we've been discussing lie at the core of how Idris operates.
134134
When Idris is following a proof script, what is happening internally is that it
@@ -219,7 +219,7 @@ n)} — that is, a function that takes two arguments (one number and a piece of
219219
evidence) and returns a piece of evidence! Here it is:
220220

221221
```coq
222-
Definition ev_plus4' : n, ev n -> ev (4 + n) :=
222+
Definition ev_plus4' : forall n, ev n -> ev (4 + n) :=
223223
fun (n : Nat) => fun (H : ev n) =>
224224
ev_SS (S (S n)) (ev_SS n H).
225225
```
@@ -359,12 +359,12 @@ we've been doing. We can also use it to build proofs directly, using
359359
pattern-matching. For instance:
360360
361361
```coq
362-
Definition and_comm'_aux P Q (H : P Q) :=
362+
Definition and_comm'_aux P Q (H : P /\ Q) :=
363363
match H with
364364
| conj HP HQ => conj HQ HP
365365
end.
366366
367-
Definition and_comm' P Q : P Q Q P :=
367+
Definition and_comm' P Q : P /\ Q <-> Q /\ P :=
368368
conj (and_comm'_aux P Q) (and_comm'_aux Q P).
369369
```
370370
@@ -396,11 +396,11 @@ Once again, we can also directly write proof objects for theorems involving
396396
\idr{Or}, without resorting to tactics.
397397
398398
399-
==== Exercise: 2 stars, optional (or_commut'')
399+
==== Exercise: 2 stars, optional (or_comm)
400400
401401
\ \todo[inline]{Edit}
402402
403-
Try to write down an explicit proof object for \idr{or_commut} (without using
403+
Try to write down an explicit proof object for \idr{or_comm} (without using
404404
`Print` to peek at the ones we already defined!).
405405
406406
> or_comm : Or p q -> Or q p
@@ -450,7 +450,7 @@ Complete the definition of the following proof object:
450450
$\square$
451451
452452
453-
=== \idr{Unit} and \idr{Void}
453+
\subsection{\idr{Unit} and \idr{Void}}
454454
455455
The inductive definition of the \idr{Unit} proposition is simple:
456456
@@ -465,7 +465,7 @@ a proof of\idr{Unit} is not informative.)
465465
\idr{Void} is equally simple — indeed, so simple it may look syntactically wrong
466466
at first glance!
467467
468-
\todo[inline]{Edit, this actually is wrong, stdlib uses \idr{%runElab} to define
468+
\todo[inline]{Edit, this actually is wrong, stdlib uses \idr{runElab} to define
469469
it}
470470
471471
```idris
@@ -570,8 +570,8 @@ In general, the `inversion` tactic...
570570
- adds these equalities to the context (and, for convenience, rewrites them
571571
in the goal), and
572572
573-
- if the equalities are not satisfiable (e.g., they involve things like `S n
574-
= Z`), immediately solves the subgoal.
573+
- if the equalities are not satisfiable (e.g., they involve things like
574+
\idr{S n = Z}), immediately solves the subgoal.
575575
576576
_Example_: If we invert a hypothesis built with \idr{Or}, there are two
577577
constructors, so two subgoals get generated. The conclusion (result type) of the

src/book.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- \usepackage{todonotes}
4343
-
4444
- \usepackage{ebproof}
45+
- \usepackage{dirtytalk}
4546
include-before: \frontmatter
4647
---
4748

0 commit comments

Comments
 (0)