Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
\end{proof}

\begin{thm}\ollabel{thm:cr}
$\bered$ satisfies Church--Rosser property.
$\bered$ satisfies the Church--Rosser property.
\end{thm}

\begin{proof}
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/church-rosser/beta-reduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

$\bred \subseteq \xred$: Suppose $M \bred M'$, i.e., $M \ident M_1
\bredone \dots \bredone M_k \ident M'$. By \olref{lem:one-par}, $M
\ident M_1 \bredpar \dots \bredpar M_k \ident M'$. Since is $\xred$
\ident M_1 \bredpar \dots \bredpar M_k \ident M'$. Since $\xred$
contains $\bredpar$ and is transitive, $M \xred M'$.

$\xred \subseteq \bred$: Suppose $M \xred M'$, i.e., $M
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

We can view the lambda calculus as a model of computation in which
terms in normal form are ``values'' and a reducibility relation on
terms are the ``calculation rules.'' The Church--Rosser property states
is that when there is more than one way to proceed with a calculation,
terms supplies the ``calculation rules.'' The Church--Rosser property states
that when there is more than one way to proceed with a calculation,
there is still only a single value of the expression.

To take an example from elementary algebra, there's more than one way
Expand Down Expand Up @@ -61,7 +61,7 @@
M & \xredone Q_1 \xredone \dots \xredone Q_n.
\end{align*}
We will prove the theorem by constructing a grid $N$ of terms of
height is $m + 1$ and width $n + 1$. We use $N_{i,j}$ to denote the
height $m + 1$ and width $n + 1$. We use $N_{i,j}$ to denote the
term in the $i$-th row and $j$-th column.

We construct $N$ in such a way that $N_{i,j} \xredone N_{i+1,j}$ and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
\olsection{Parallel $\beta$-reduction}

We introduce the notion of \emph{parallel $\beta$-reduction}, and
prove the it has the Church--Rosser property.
prove that it has the Church--Rosser property.

\begin{defn}[parallel $\beta$-reduction, $\bredpar$] \ollabel{defn:bredpar}
Parallel reduction ($\bredpar$) of terms is inductively defined as follows:
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/introduction/basic-pr-lambda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$\Zero$ is just
$\lambd[x][\lambd[y][y]]$.

The successor function~$\Succ$, is
The successor function~$\Succ$ is
defined by $\fn{Succ}(u) = \lambd[x][\lambd[y][x(uxy)]]$. You should
think about why this works; for each numeral $\num{n}$, thought of as
an iterator, and each function~$f$, $\fn{Succ}(\num{n},f)$ is a function that,
Expand Down
4 changes: 2 additions & 2 deletions content/lambda-calculus/introduction/currying.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
\olsection{Currying}

A $\lambd$-abstract $\lambd[x][M]$ represents a function of one
argument, which is quite a limitation when we want to define function
argument, which is quite a limitation when we want to define a function
accepting multiple arguments. One way to do this would be by
extending the $\lambd$-calculus to allow the formation of pairs,
triples, etc., in which case, say, a three-place function
Expand Down Expand Up @@ -53,7 +53,7 @@
$\lambd[x_1][\lambd[x_2][\ldots\lambd[x_n][N]]]$. If we apply $n$ arguments
to it we get:
\begin{multline*}
(\lambd[x_1][\lambd[x_2][\ldots\lambd[x_n][N]]]) M_1 \dots M_n \bredone\\
(\lambd[x_1][\lambd[x_2][\ldots\lambd[x_n][N]]]) M_1 \dots M_n\\
\begin{aligned}
\bredone {} & (\Subst{(\lambd[x_2][\ldots\lambd[x_n][N]])}{M_1}{x_1}) M_2
\dots M_n\\
Expand Down
5 changes: 2 additions & 3 deletions content/lambda-calculus/introduction/lambda-computable.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
\begin{proof}
Suppose a function~$f$ is !!{lambda defined} by a lambda term~$X$. Let us
describe an informal procedure to compute~$f$. On input $m_0$,
\dots,~$m_{n-1}$, write down the term $X \num m_0 \ldots \num
m_{n-1}$. Build a tree, first writing down all the one-step reductions
\dots,~$m_{n-1}$, write down the term $X \num{m_0} \ldots \num{m_{n-1}}$. Build a tree, first writing down all the one-step reductions
of the original term; below that, write all the one-step reductions of
those (i.e., the two-step reductions of the original term); and keep
going. If you ever reach a numeral, return that as the answer;
Expand All @@ -28,7 +27,7 @@
An appeal to Church's thesis tells us that this function is
computable. A better way to prove the theorem would be to give a
recursive description of this search procedure. For example, one
could define a sequence primitive recursive functions and relations,
could define a sequence of primitive recursive functions and relations,
``$\fn{IsASubterm}$,'' ``$\fn{Substitute}$,''
``$\fn{ReducesToInOneStep}$,'' ``$\fn{ReductionSequence}$,''
``$\fn{Numeral}$,'' etc. The partial recursive procedure for computing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
F\, \num{n_0}\, \num{n_1} \dots \num{n_{k-1}} \red \num{f(n_0, n_1, \dots,
n_{k-1})}
\]
if $f(n_0, \dots, n_{k-1})$ is defined, and $F, \num{n_0}\, \num{n_1}
if $f(n_0, \dots, n_{k-1})$ is defined, and $F\, \num{n_0}\, \num{n_1}
\dots \num{n_{k-1}}$ has no normal form otherwise.
\end{defn}

Expand Down
4 changes: 2 additions & 2 deletions content/lambda-calculus/introduction/reduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
\item Also, some terms can be reduced in more than one way; for
example,
\[
(\lambd[x][(\lambd[y][yx]) z)] v \redone (\lambd[y][yv]) z
(\lambd[x][(\lambd[y][yx]) z]) v \redone (\lambd[y][yv]) z
\]
by contracting the outermost application; and
\[
(\lambd[x][(\lambd[y][yx]) z)] v \redone (\lambd[x][zx]) v
(\lambd[x][(\lambd[y][yx]) z]) v \redone (\lambd[x][zx]) v
\]
by contracting the innermost one. Note, in this case, however, that
both terms further reduce to the same term, $zv$.
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/introduction/syntax.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
to right. For example, if $M$, $N$, $P$, and $Q$ are terms, then
$MNPQ$ abbreviates $(((MN)P)Q)$.
\item Again, when parentheses are left out, lambda abstraction is to
be given the widest scope possible. From example, $\lambd[x][MNP]$ is
be given the widest scope possible. For example, $\lambd[x][MNP]$ is
read $(\lambd[x][((MN)P)])$.
\item A lambda can be used to abstract multiple variables. For
example, $\lambd[xyz][M]$ is short for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% Part: lambda-calculus
% Chapter: lambda-definablity
% Chapter: lambda-definability
% Section: arithmetical-functions

\documentclass[../../../include/open-logic-section]{subfiles}
Expand Down Expand Up @@ -65,7 +65,7 @@
\intertext{or, alternatively,}
\fn{Add}' & \ident \lambd[{a}{b}][{a}\, \fn{Succ} \, {b}].
\intertext{The first addition works as follows: $\fn{Add}$ first
accept two numbers ${a}$ and ${b}$. The result is a function that
accepts two numbers ${a}$ and ${b}$. The result is a function that
accepts $f$ and $x$ and returns $af(bfx)$. If $a$ and $b$ are Church
numerals $\num{n}$ and $\num{m}$, this reduces to $f^{n+m}(x)$,
which is identical to $f^{n}(f^{m}(x))$. Or, slowly:}
Expand Down Expand Up @@ -141,7 +141,7 @@
$\eta$-reduction, this does not work for exponent~$0$ however.
\end{editorial}

Predecessor and subtraction on Church numeral are not as easy to
Predecessor and subtraction on Church numerals are not as easy to
define as we might think: it requires encoding of pairs.

\end{document}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
\num{n_1} \dots \num{n_{k-1}}$ has no normal form otherwise.
\end{defn}

A very simple example are the constant functions. The term $C_k \ident
Very simple examples are the constant functions. The term $C_k \ident
\lambd[x][\num{k}]$ !!{lambda define}s the function $c_k\colon \Nat \to
\Nat$ such that $c(n) = k$. For $C_k \, \num n \ident
(\lambd[x][\num{k}])\num n \redone \num{k}$ for any~$n$. The identity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

\begin{proof}
We only sketch the proof. First, we arithmetize $\lambd$-terms,
i.e., systematially assign G\"odel numbers to $\lambd$-terms, using
i.e., systematically assign G\"odel numbers to $\lambd$-terms, using
the usual power-of-primes coding of sequences. Then we define a
partial recursive function $\fn{normalize}(t)$ operating on the
G\"odel number~$t$ of a lambda term as argument, and which returns
the G\"odel number of the normal form if it has one, or is undefined
otherwise. Then define two partial recursive functions
$\fn{toChurch}$ and $\fn{fromChurch}$ that maps natural numbers to
$\fn{toChurch}$ and $\fn{fromChurch}$ that map natural numbers to
and from the G\"odel numbers of the corresponding Church numeral.

Using these recursive functions, we can define the function~$f$ as a
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/lambda-definability/lists.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
\lambd[l][l \, (\lambd[xa][\fn{Add} \, a \, \num{1}]) \num{0}]
\end{align*}

$\fn{Sum}$ calculates the sum of a list of church numerals. It works
$\fn{Sum}$ calculates the sum of a list of Church numerals. It works
by doing an accumulation on the list, where the initial value is
$\num{0}$ and for each element, return $\fn{Add} \, x\, a$ as the new
value (where $x$ is the current element and $a$ is the accumulated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
function and a fixpoint combinator:
\begin{align*}
\fn{Search} & \ident \lambd[g][\lambd[f\,\vec{x}\,y][
\fn{IsZero} (f\, \vec{x}\, y)\, y\, (g\, f\, \vec{x} (\fn{Succ}\, y)]]]\\
\fn{IsZero} (f\, \vec{x}\, y)\, y\, (g\, f\, \vec{x} (\fn{Succ}\, y))]]\\
H & \ident \lambd[\vec x][(Y \, \fn{Search}) F\, \vec{x}\, \num{0}],
\end{align*}
where $Y$ is any fixpoint combinator. Informally speaking,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

Partial recursive functions are those obtained from the basic
functions by composition, primitive recursion, and unbounded
minimization. They differ from general recursive function in that the
minimization. They differ from general recursive functions in that the
functions used in unbounded search are not required to be regular.
Not requiring regularity means that functions defined by minimization
may sometimes not be defined.
Expand All @@ -23,7 +23,7 @@
!!{lambda define}d by $\lambd[x][F (G x)]$ if $f$ and $g$ are
!!{lambda define}d by terms $F$ and~$G$, respectively. However, when the
functions are partial, this is problematic. When $g(x)$ is undefined,
meaning $G x$ has no normal form. In most cases this means that $F (G
$G x$ has no normal form. In most cases this means that $F (G
x)$ has no normal forms either, which is what we want. But consider
when $F$ is $\lambd[x][\lambd[y][y]]$, in which case $F (G x)$ does
have a normal form ($\lambd[y][y]$).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
Informally speaking, the primitive recursive definition iterates the
application of the function $g$ $y$ times and applies it to $f(x_1,
\dots, x_n)$. This is reminiscent of the definition of Church
numerals, which is also defined as a iterator.
numerals, which are also defined as iterators.

For simplicity, we give the definition and proof for a single
additional argument~$x$. The function $h$ is !!{lambda define}d by:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
\end{align*}

Truth values are represented as \emph{selectors}, i.e., functions that
accept two arguments and returning one of them. The truth value
accept two arguments and return one of them. The truth value
$\fn{true}$ selects its first argument, and $\fn{false}$ its
second. For example, $\fn{true}\, M N$ always reduces to $M$, while
$\fn{false}\, M N$ always reduces to~$N$.
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/syntax/abbreviated-syntax.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
to right. For example, if $M$, $N$, $P$, and~$Q$ are terms, then
$MNPQ$ abbreviates $(((MN)P)Q)$.
\item Again, when parentheses are left out, lambda abstraction is
given the widest scope possible. From example, $\lambd[x][MNP]$ is
given the widest scope possible. For example, $\lambd[x][MNP]$ is
read as $(\lambd[x][MNP])$.
\item A lambda can be used to abstract multiple variables. For
example, $\lambd[xyz][M]$ is short for
Expand Down
14 changes: 7 additions & 7 deletions content/lambda-calculus/syntax/alpha.tex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

\begin{defn}[Compatibility of relation]
A relation $R$ on terms is said to be \emph{compatible}
if it satisfies following conditions:
if it satisfies the following conditions:
\begin{enumerate}
\item If $R N N'$ then $R \lambd[x][N] \lambd[x][N']$
\item If $R P P'$ then $R (PQ) (P'Q)$
Expand All @@ -39,7 +39,7 @@
Thus let's rephrase the definition:
\begin{defn}[Change of bound variable, $\aconvone$]
\emph{Change of bound variable} ($\redone[\alpha]$) is
the smallest compatible relation on terms satisfying following
the smallest compatible relation on terms satisfying the following
condition:
\begin{align*}
&\lambd[x][N] \redone[\alpha] \lambd[y][\Subst{N}{y}{x}] && \text{if
Expand Down Expand Up @@ -70,7 +70,7 @@
exercise. From now on we will use the inductive definition.

\begin{defn}[$\alpha$-conversion, $\aconv$]
\emph{$\alpha$-conversion} ($\aconv$) is the smallest reflexitive
\emph{$\alpha$-conversion} ($\aconv$) is the smallest reflexive
and transitive relation on terms containing $\aconvone$.
\end{defn}

Expand All @@ -92,7 +92,7 @@
$\lambd[x][f x]$ $\alpha$-converts to $\lambd[y][f
y]$, and conversely. Informally
speaking, they are both functions that accept an argument and
return $f$ of that argument, refering to the environment variable~$f$.
return $f$ of that argument, referring to the environment variable~$f$.

$\lambd[x][f x]$ does not $\alpha$-convert to $\lambd[x][g
x]$. Informally speaking, they refer to the environment variables
Expand Down Expand Up @@ -134,7 +134,7 @@
\item If $x \notin FV(N)$, then:
\begin{align*}
\FV{\lambd[y][\Subst{N}{y}{x}]}
& = FV{\Subst{N}{y}{x}} \setminus \{y\} \\
& = \FV{\Subst{N}{y}{x}} \setminus \{y\} \\
& = \FV{N} \setminus \{x\}
&& \text{by \olref[sub]{thm:notinfv}} \\
& = \FV{\lambd[x][N]}.
Expand Down Expand Up @@ -181,8 +181,8 @@
\begin{enumerate}
\item For each term $M$, $M$ can be changed to $M$ by
\emph{zero} changes of bound variables.
\item If $P$ is $\alpha$-converts to $Q$ by a series of changes
of bound variables, then from $Q$ we can just inverse these
\item If $P$ $\alpha$-converts to $Q$ by a series of changes
of bound variables, then from $Q$ we can just reverse these
changes (by \olref{lem:inv}) in
opposite order to obtain~$P$.
\item If $P$ $\alpha$-converts to $Q$ by a series of changes of
Expand Down
4 changes: 2 additions & 2 deletions content/lambda-calculus/syntax/beta.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% Part: lambda-calculus
% Chapter: introduction
% Chapter: syntax
% Section: beta

\documentclass[../../../include/open-logic-section]{subfiles}
Expand Down Expand Up @@ -94,7 +94,7 @@
strategy has the useful property that a term can be reduced to a
normal form by some strategy iff it can be reduced to normal form
using the natural strategy. In what follows we will use the natural
stratuegy unless otherwise specified.
strategy unless otherwise specified.
\end{digress}

\begin{defn}[$\beta$-equivalence, $\equal$]
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/syntax/conversion.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
\olfileid{lam}{int}{con}
\olsection{Conversion and Reduction}

There three type of conversions or reductions in lambda calculus. The
There are three types of conversions or reductions in lambda calculus. The
difference between conversion and reduction is whether the
``transformation'' is unidirectional or bidirectional, as we will see.

Expand Down
16 changes: 8 additions & 8 deletions content/lambda-calculus/syntax/de-bruijn.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
this parameter. In the de Bruijn index, however, parameters have no
name and reference to them in the function body is denoted by a number
denoting the levels of abstraction between them. For example, consider
the example of $\lambd[x][\lambd[y][y x]]$: the outer abstraction is on
the example of $\lambd[x][\lambd[y][y x]]$: the outer abstraction
binds the variable~$x$; the inner abstraction binds the variable
is~$y$; the sub-term $y x$ lies in the scope of the inner abstraction:
$y$; the sub-term $y x$ lies in the scope of the inner abstraction:
there is no abstraction between $y$ and its abstract~$\lambd[y]$, but
one abstract between $x$ and its abstract~$\lambd[x]$. Thus we write
$0\, 1$ for $y x$, and $\lambd[][\lambd[][01]]$ for the entire term.
$0\, 1$ for $y x$, and $\lambd[][\lambd[][0\,1]]$ for the entire term.

\begin{defn}
De Bruijn terms are inductively defines as follows:
De Bruijn terms are inductively defined as follows:
\begin{enumerate}
\item $n$, where $n$ is any natural number.
\item $PQ$, where $P$ and $Q$ are both De Bruijn terms.
Expand All @@ -50,8 +50,8 @@
For example, if $\Gamma$ is $x,y,z$, then $\Gamma(x)$ is $0$ and
$\Gamma(z)$ is $2$.

$x,\Gamma$ denotes the list resulted from pushing $x$ to the head of
$\Gamma$; for instance, continuing the $\Gamma$ in last example,
$x,\Gamma$ denotes the list resulting from pushing $x$ to the head of
$\Gamma$; for instance, continuing the $\Gamma$ in the last example,
$w,\Gamma$ is $w,x,y,z$.
\end{defn}

Expand All @@ -68,8 +68,8 @@
$\Gamma[n]$ denotes the variable in position~$n$. For example,
if $\Gamma$ is $x,y,z$, then $\Gamma[1]$ is $y$.

The variable $x$ in last equation is chosen to be any variable that
not in $\Gamma$.
The variable $x$ in the last equation is chosen to be any variable that
is not in $\Gamma$.
\end{defn}

Here we give some results without proving them:
Expand Down
4 changes: 2 additions & 2 deletions content/lambda-calculus/syntax/eta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
\begin{defn}[$\beta\eta$-reduction, $\bered$] \ollabel{defn:bered}
\emph{$\beta\eta$-reduction} ($\bered$) is the smallest reflexive,
transitive relation on terms containing $\bredone$ and $\eredone$,
i.e., the rules of reflexivity and transitive plus the following two
i.e., the rules of reflexivity and transitivity plus the following two
rules:
\begin{enumerate}
\item If $M \bredone N$ then $M \bered N$. \ollabel{defn:bered3}
Expand Down Expand Up @@ -76,7 +76,7 @@
\equal N$ derived by the \ext{} rule, we have $Mx
\equal[\eta] Nx$ as premise. Then we have $\lambd[x][Mx]
\equal[\eta] \lambd[x][Nx]$ by a rule of $\equal$, applying $\eta$
on both side gives us $M \equal[\eta] N$.
on both sides gives us $M \equal[\eta] N$.

Similarly we prove that the $\eta$ rule is contained in
$\equal[ext]$. For any $\lambd[x][Mx]$ and $M$ with $x \notin
Expand Down
2 changes: 1 addition & 1 deletion content/lambda-calculus/syntax/free-variables.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% Part: lambda-calculus
% Chapter: introduction
% Chapter: syntax
% Section: free-variables

\documentclass[../../../include/open-logic-section]{subfiles}
Expand Down
Loading
Loading