Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
58cf2c4
cut-elimination: the falsity constant, contraction with cuts, the exi…
KokunoYumeto Nov 28, 2026
122d9c0
proof-theory: fix calculus overview and minimal-logic conventions
KokunoYumeto Nov 29, 2026
34a3643
proof-theory/sequent-calculus+proof-theory/proof-search: fix rule con…
KokunoYumeto Nov 29, 2026
26299b3
proof-theory/cut-elimination: fix cut transformations, measures and m…
KokunoYumeto Nov 29, 2026
4d85981
proof-theory/natural-deduction: fix grafting, quantifier conditions a…
KokunoYumeto Nov 29, 2026
9dbd373
proof-theory/normalization: fix reduction measures and normalization …
KokunoYumeto Nov 29, 2026
a01bc6b
proof-theory/propositions-as-types: fix typing rules, proof terms and…
KokunoYumeto Nov 29, 2026
24bfa87
lambda-calculus/introduction: fix substitution and combinator computa…
KokunoYumeto Nov 29, 2026
62f97ac
lambda-calculus/syntax: fix binding, substitution and conversion nota…
KokunoYumeto Nov 29, 2026
9d468b1
lambda-calculus/church-rosser: fix parallel-reduction arguments and r…
KokunoYumeto Nov 29, 2026
873d593
lambda-calculus/lambda-definability: fix numeral, pair, list and recu…
KokunoYumeto Nov 29, 2026
99e89bc
lambda calculus, proof theory: line breaks for formulas the correctio…
KokunoYumeto Nov 29, 2026
4e5ef43
lambda-calculus/syntax: cite the alpha and eta sections in their chapter
KokunoYumeto Nov 30, 2026
6e737c0
lambda-calculus/introduction: drop a stray closing quotation mark
KokunoYumeto Nov 30, 2026
aae3451
proof-theory/propositions-as-types: verb agreement after the correction
KokunoYumeto Nov 30, 2026
cd9f6fa
proof-theory/sequent-calculus: G3c also has the axioms with falsum on…
KokunoYumeto Nov 30, 2026
b572f1c
proof-theory/cut-elimination: the conclusion is about Gamma_2
KokunoYumeto Nov 30, 2026
bfe85d7
proof-theory/normalization: the end-sequent of the main branch is no …
KokunoYumeto Nov 30, 2026
c37e6cc
proof-theory/normalization: repair a run-on sentence in the conjuncti…
KokunoYumeto Nov 30, 2026
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
16 changes: 10 additions & 6 deletions content/lambda-calculus/church-rosser/beta-eta-reduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@
\olsection{$\beta\eta$-reduction}

The Church--Rosser property holds for
$\beta\eta$-reduction ($\bered$).
$\beta\eta$-reduction ($\bered$). Write $M\beredone N$ when either
$M\bredone N$ or $M\eredone N$; thus $\beredone$ is the union of the
two compatible one-step contraction relations.

\begin{lem}\ollabel{lem:one-par}
If $M \beredone M'$, then $M \beredpar M'$.
\end{lem}

\begin{proof}
By induction on the !!{derivation} of $M \beredone M'$. If $M \bredone
M'$ by $\eta$-conversion (i.e., \olref[syn][eta]{defn:beredone}), we
use \olref[pbe]{thm:refl}. The other cases are as in
\olref[b]{lem:one-par}.
Induct on the compatible one-step contraction derivation. For a
root $\eta$-contraction, $M=\lambd[x][Nx]$, $M'=N$, and
$x\notin\FV{N}$. Use $N\beredpar N$ from
\olref[pbe]{thm:refl}, followed by \olref[pbe]{defn:beredpar5}.
The root $\beta$ case and the abstraction and application contexts
are as in \olref[b]{lem:one-par}.
\end{proof}


Expand Down Expand Up @@ -49,7 +53,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
13 changes: 10 additions & 3 deletions content/lambda-calculus/church-rosser/beta-reduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
\begin{lem}\ollabel{lem:one-par}
If $M \bredone M'$, then $M \bredpar M'$.
\end{lem}
\begin{proof} If $M \bredone M'$, then $M$ is
\begin{proof}
Induct on the compatible one-step contraction derivation. In the
root-redex case, $M$ is
$(\lambd[x][N])Q$, $M'$ is $\Subst{N}{Q}{x}$, for some
$x$, $N$, and~$Q$. Since $N \bredpar N$ and $Q \bredpar Q$ by
\olref[pb]{thm:refl}, we immediately have $(\lambd[x][N])Q
\bredpar \Subst{N}{Q}{x}$ by \olref[pb]{defn:bredpar}\olref[pb]{defn:bredpar4}.
For a contraction inside an abstraction, lift the induction
hypothesis by \olref[pb]{defn:bredpar2}. For a contraction in either
child of an application, combine the induction hypothesis with
\olref[pb]{thm:refl} on the unchanged child and use
\olref[pb]{defn:bredpar3}.
\end{proof}

\begin{lem}\ollabel{lem:par-red}
Expand All @@ -40,7 +47,7 @@
by the reduction $Q \bred Q'$.
\item The last rule is \olref[pb]{defn:bredpar4}: $M$ is
$(\lambd[x][N])Q$ and $M'$ is $\Subst{N'}{Q'}{x}$ for some $x$,
$N$, $M'$, $Q$, $Q'$, where $N \bredpar N'$ and $Q \bredpar Q'$.
$N$, $N'$, $Q$, $Q'$, where $N \bredpar N'$ and $Q \bredpar Q'$.
By induction hypothesis we get $Q \bred Q'$ and $N \bred N'$. So
$(\lambd[x][N])Q \bred \Subst{N'}{Q'}{x}$ by $N \bred N'$ followed
by $Q \bred Q'$ and finally contraction of $(\lambd[x][N'])Q'$ to
Expand All @@ -58,7 +65,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 @@ -19,7 +19,7 @@
inductively defined as follows:
\begin{enumerate}
\item \ollabel{defn:beredpar1} $x \beredpar x$.
\item \ollabel{defn:beredpar2} If $N \xrightarrow{\beta} N'$ then $\lambd[x][N] \beredpar
\item \ollabel{defn:beredpar2} If $N \beredpar N'$ then $\lambd[x][N] \beredpar
\lambd[x][N']$.
\item \ollabel{defn:beredpar3} If $P \beredpar P'$ and $Q \beredpar Q'$ then $PQ \beredpar
P'Q'$.
Expand Down Expand Up @@ -47,7 +47,9 @@
as follows:
\begin{align}
\becd{x} &= x \ollabel{defn:becd1} \\
\becd{(\lambd[x][N])} &= \lambd[x][\becd{N}] \ollabel{defn:becd2}\\
\becd{(\lambd[x][N])} &= \lambd[x][\becd{N}]
&&\text{if $\lambd[x][N]$ is not an $\eta$-redex}
\ollabel{defn:becd2}\\
\becd{(PQ)} &= \becd{P}\becd{Q} && \text{if $P$ is not a $\lambd$-abstract}
\ollabel{defn:becd3} \\
\becd{((\lambd[x][N])Q)} &= \Subst{\becd{N}}{\becd{Q}}{x}
Expand All @@ -67,7 +69,7 @@

The first four cases are exactly like those in \olref[pb]{lem:comp}.
If the last rule is \olref{defn:beredpar5}, then $M$ is
$\lambd[x][Nx]$, $M'$ is $N'$ for some $x$ and~$N'$ where $x \notin
$\lambd[x][Nx]$, $M'$ is $N'$ for some $x$, $N$, and~$N'$ where $x \notin
FV(N)$, and $N \beredpar N'$. We want to show that
$\Subst{(\lambd[x][Nx])}{R}{y} \beredpar \Subst{N'}{R'}{y}$, i.e.,
$\lambd[x][\Subst{N}{R}{y} x] \beredpar \Subst{N'}{R'}{y}$. It
Expand All @@ -80,14 +82,52 @@
\end{lem}

\begin{proof}
By induction on the !!{derivation} of $M \beredpar M'$.

The first four cases are like those in \olref[pb]{lem:cont}. If the
last rule is \olref{defn:beredpar5}, then $M$ is $\lambd[x][Nx]$ and
$M'$ is $N'$ for some $x$, $N$, $N'$ where $x \notin FV(N)$ and $N
\beredpar N'$. We want to show that $N' \beredpar
\becd{(\lambd[x][Nx])}$, i.e., $N' \beredpar \becd{N}$, which is
immediate by induction hypothesis.
Use strong induction on the size of $M$, with representatives chosen
fresh whenever needed. Induction on parallel-reduction derivations
first gives $\FV{A'}\subseteq\FV{A}$ whenever $A\beredpar A'$.
Also $A\beredpar\becd{A}$ follows from the development clauses by
structural induction. These facts preserve every freshness
condition used below.

The variable case is immediate. Suppose $M=\lambd[x][N]$ is not an
$\eta$-redex. Its parallel reduct is $\lambd[x][N']$, where
$N\beredpar N'$. The induction hypothesis and the abstraction rule
give $\lambd[x][N']\beredpar\lambd[x][\becd{N}]=\becd{M}$.

Now suppose $M=\lambd[x][Px]$ with $x\notin\FV{P}$, so that
$\becd{M}=\becd{P}$. An outer $\eta$ step gives a reduct $P'$ of $P$,
and induction gives $P'\beredpar\becd{P}$. An abstraction step gives
$\lambd[x][N']$ where $Px\beredpar N'$. If this body step uses the
application rule, $N'=P'x$, and induction followed by the $\eta$
rule gives $\lambd[x][P'x]\beredpar\becd{P}$. If it uses the
$\beta$ rule, write $P=\lambd[y][T]$ and
$N'=\Subst{T'}{x}{y}$, where $T\beredpar T'$. Since $x$ is fresh,
$\lambd[x][\Subst{T'}{x}{y}]\aeq\lambd[y][T']$.
The latter is a parallel reduct of the smaller term $P$, so induction
again gives a parallel reduction to $\becd{P}$.

Suppose next that $M=PQ$ and $P$ is not an abstraction. Only the
application rule can be last, and induction gives
$P'Q'\beredpar\becd{P}\becd{Q}=\becd{M}$.

Finally let $M=(\lambd[x][N])Q$. If the last rule is the $\beta$
rule, induction and \olref{lem:comp} give
$\Subst{N'}{Q'}{x}\beredpar\Subst{\becd{N}}{\becd{Q}}{x}
=\becd{M}$. If the last rule is application, the reduct is $P'Q'$
with $\lambd[x][N]\beredpar P'$ and $Q\beredpar Q'$.
When the function reduction uses abstraction, $P'=\lambd[x][N']$;
induction and the $\beta$ rule give the same target.

The remaining function reduction uses $\eta$: then $N=Sx$,
$x\notin\FV{S}$, and $S\beredpar P'$. If $S$ is not an abstraction,
the target is $\becd{S}\becd{Q}$, reached from $P'Q'$ by induction
and application. If $S=\lambd[y][T]$, the target is
$\Subst{\becd{T}}{\becd{Q}}{y}$, by the capture-free substitution
identity and freshness of $x$. But $P'Q'$ is a parallel reduct of
$SQ$, a term strictly smaller than the original
$(\lambd[x][Sx])Q$. The strong induction hypothesis for $SQ$ gives
exactly that target. This covers both overlaps between $\beta$ and
$\eta$.
\end{proof}

\begin{thm}\ollabel{thm:cr}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
\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:
\begin{enumerate}
\item \ollabel{defn:bredpar1} $x \bredpar x$.
\item \ollabel{defn:bredpar2} If $N \xrightarrow{\beta} N'$ then $\lambd[x][N] \bredpar
\item \ollabel{defn:bredpar2} If $N \bredpar N'$ then $\lambd[x][N] \bredpar
\lambd[x][N']$.
\item \ollabel{defn:bredpar3} If $P \bredpar P'$ and $Q \bredpar Q'$ then $PQ \bredpar
P'Q'$.
Expand Down Expand Up @@ -86,7 +86,7 @@
$\Subst{(\lambd[x][N])}{R}{y} \bredpar
\Subst{(\lambd[x][N'])}{R'}{y}$, i.e.,
$\lambd[x][\Subst{N}{R}{y}] \bredpar
\lambd[x][\Subst{N'}{R}{y}]$. This follows immediately by
\lambd[x][\Subst{N'}{R'}{y}]$. This follows immediately by
\olref{defn:bredpar2} and the induction hypothesis.
\item The last step is \olref{defn:bredpar3}: Exercise.
\item The last step is \olref{defn:bredpar4}: $M$ is
Expand Down
6 changes: 3 additions & 3 deletions content/lambda-calculus/introduction/basic-pr-lambda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
\end{lem}

\begin{proof}
$\Zero$ is just
$\lambd[x][\lambd[y][y]]$.
$\Zero$ is !!{lambda defined} by
$\lambd[z][\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
8 changes: 7 additions & 1 deletion content/lambda-calculus/introduction/composition.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
\end{lem}

\begin{proof}
We first prove this for total component functions. The general
partial case follows from the independent computability equivalence
completed in \olref[min]{sec}.
Suppose $f$ is defined by composition from $h$, $g_0,$
\dots,~$g_{k-1}$. Assuming $h$, $g_0$, \dots,~$g_{k-1}$ are
!!{lambda defined} by $H$, $G_0$, \dots,~$G_{k-1}$,
Expand All @@ -24,7 +27,10 @@
\dots, G_{k-1}(x_0, \dots, x_{l-1})).
\]
In other words, the language of the lambda calculus is well suited to
represent composition.
represent composition for total components. For partial components
this term alone need not work: a constant-zero outer term can erase
a nonnormalizing inner term, although strict numeric composition is
then undefined.
\end{proof}

\end{document}
29 changes: 19 additions & 10 deletions content/lambda-calculus/introduction/computable-lambda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,25 @@
\end{thm}

\begin{proof}
We need to show that every partial computable function~$f$ is
!!{lambda defined} by a lambda term~$F$. By Kleene's normal form
theorem, it suffices to show that every primitive recursive function
is !!{lambda defined} by a lambda term, and then that the functions
!!{lambda definable} are closed under suitable compositions and
unbounded search. To show that every primitive recursive function is
!!{lambda defined} by a lambda term, it suffices to show that the
initial functions are !!{lambda definable}, and that the partial
functions that are !!{lambda definable} are closed under
composition, primitive recursion, and unbounded search.
By Kleene's normal form theorem, for every partial computable
function~$f$ there are primitive recursive functions $r$ and $u$ such
that
\[
f(\vec x)\simeq u(\umin{t}{r(\vec x,t)}).
\]
First we represent
the initial functions and prove closure under composition and
primitive recursion for \emph{total} functions. This supplies terms
for $r$ and $u$. We then implement a search that returns the decoded
value $u(t)$ only in its successful branch; the construction at the
end of \olref[min]{sec} also proves that an unsuccessful search has
no normal form. This proves the theorem without assuming that
ordinary lambda application preserves undefinedness.

After this construction, the general partial closure results follow
from the computability of lambda-definable functions
(\olref[cmp]{thm:lambda-computable}) and the corresponding strict
closure operations on partial computable functions.
\end{proof}

We will use a more conventional notation to make the rest of the proof
Expand Down
12 changes: 7 additions & 5 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 @@ -41,7 +41,8 @@
accepts an argument~$x$ and returns the function~$\lambd[y][x]$. The
function $\lambd[y][x]$ accepts another argument~$y$, but drops it,
and always returns~$x$. Let's see what happens when we apply
$\lambd[x][\lambd[y][x]]$ to two arguments:
$\lambd[x][\lambd[y][x]]$ to two arguments, choosing $y$ not free
in $M$ by renaming the bound variable first if necessary:
\begin{align*}
(\lambd[x][\lambd[y][x]])MN
\bredone & (\lambd[y][M])N \\
Expand All @@ -51,16 +52,17 @@
In general, to write a function with parameters $x_1$, \dots,~$x_n$
defined by some term~$N$, we can write
$\lambd[x_1][\lambd[x_2][\ldots\lambd[x_n][N]]]$. If we apply $n$ arguments
to it we get:
to it, first choose the $x_i$ pairwise distinct and not free in any
$M_j$, renaming bound variables as necessary. Then 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\\
\eqs {} & (\lambd[x_2][\ldots\lambd[x_n][\Subst{N}{M_1}{x_1}]]) M_2
\dots M_n \\
\vdots & \\
\bredone {} &\Subst{\Subst{P}{M_1}{x_1}\ldots}{M_n}{x_n}
\bredone {} &\Subst{\Subst{N}{M_1}{x_1}\ldots}{M_n}{x_n}
\end{aligned}
\end{multline*}
The last line literally means substituting $M_i$ for $x_i$ in the body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
\olsection{Fixed-Point Combinators}

Suppose you have a lambda term $g$, and you want another term $k$ with
the property that $k$ is $\beta$-equivalent to $gk$. Define terms
the property that $k$ is $\beta$-equivalent to $gk$. Choose $x$ not free in
$g$, and define terms
\[
\fn{diag}(x) = xx
\]
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
6 changes: 3 additions & 3 deletions content/lambda-calculus/introduction/lambda-definability.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
\begin{defn}
For each natural number~$n$, define the \emph{Church numeral}
$\num{n}$ to be the lambda term $\lambd[x][\lambd[y][(x(x(x(\dots
x(y)))))]]$, where there are $n$ $x$'s in all.
x(y)))))]]$, where the body contains $n$ occurrences of $x$.
\end{defn}

The terms $\num{n}$ are ``iterators'': on input $f$, $\num{n}$ returns
Expand All @@ -27,14 +27,14 @@
a function on the natural numbers.

\begin{defn}
Let $f(x_0, \dots, x_{k-1})$ be an $n$-ary partial function from $\Nat$
Let $f(x_0, \dots, x_{k-1})$ be a $k$-ary partial function from $\Nat^k$
to $\Nat$. We say a $\lambd$-term~$F$ \emph{!!{lambda define}s}~$f$ iff for every
sequence of natural numbers $n_0$, \dots,~$n_{k-1}$,
\[
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
Loading
Loading