Brauer Notes on Realizability
Brauer Notes on Realizability
Andrej Bauer
October 7, 2024
Preface
It is not an exaggeration to say that the invention of modern computers was a direct consequence of the great
advances of the 20th century logic: Hilbert’s putting a decision problem on his list, Gödel’s amazing exercise
in programming with numbers, Church’s invention of 𝜆-calculus, Gödel’s of general recursive functions,
and Turing’s of his machines. Unfortunately, by the time computers took over the world and demanded
a fitting foundation of mathematics, generations of mathematicians had been educated with little regard
or sensitivity to questions of computability and constructivity. Some even cherished living in a paradise
removed from earthly matters and encouraged others to take pride in the uselessness of their activity. Today
such mathematics persists as the generally accepted canon.
How is the working mathematician to understand and study computable mathematics? Given their unshakable
trust in classical mathematics, it is only natural for them to “bolt on computability as an afterthought”, as
was put eloquently by a friend of mine. Indeed, this is precisely how many experts practice computable
mathematics, and so shall we.
A comprehensive account of realizability theory would be a monumental work, which we may hope to see
one day in the form of a sketch of an elephant. These notes are at best a modest introduction that aims to
strike a balance between approachable concreteness and inspiring generality. Because my purpose was to
educate, I did not hesitate to include informal explanations and recollection of material that I could have
relegated to background reading. Suggestions for further reading will hopefully help direct those who seek
deeper knowledge of realizability.
Realizability theory weaves together computability theory, category theory, logic, topology and programming
languages. I therefore recommend to the enthusiastic students the adoption of the Japanese martial art
principle 修行.
An early version of these lecture notes were written to support a graduate course on computable topology,
which I taught in 2009 at the University of Ljubljana. I copiously reused part of my dissertation. In 2022
I updated the notes and added a chapter on type theory, on the occasion of my lecturing at the Midlands
Graduate School, hosted by the University of Nottingham.
Andrej Bauer
Ljubljana, March 2022
Contents
Preface ii
Contents iii
1 Introduction 1
1.1 Background material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Models of Computation 4
2.1 Turing machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Type 1 machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.2 Type 2 machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.3 Turing machines with oracles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.4 Hamkin’s infinite-time Turing machines . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Scott’s graph model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Church’s 𝜆-calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4 Reflexive domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5 Partial combinatory algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.1 Examples of partial combinatory algebras . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6 Typed partial combinatory algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7 Examples of Typed Partial Combinatory Algebras . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7.1 Partial combinatory algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7.2 Simply typed 𝜆-calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7.3 Gödel’s 𝑇 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7.4 Plotkin’s PCF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7.5 PCF∞ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.8 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.8.1 Properties of simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.8.2 Decidable simulations and 𝕂1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.8.3 An adjoint retraction from (ℙ , ℙ# ) to (𝔹 , 𝔹# ) . . . . . . . . . . . . . . . . . . . . . . . 42
3 Realizability categories 44
3.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.2 Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.2.1 Modest sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.2.2 The unit assembly 𝟙 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.2.3 Natural numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.2.4 The constant assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.2.5 Two-element assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.3 Equivalent formulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.3.1 Existence predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.3.2 Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.3.3 Partial equivalence relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.3.4 Equivalence relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.4 Applicative functors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.5 Schools of Computable Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.5.1 Recursive Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.5.2 Equilogical spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.5.3 Computable countably based spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.5.4 Computable equilogical spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.5.5 Type Two Effectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.6 The categorical structure of assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.6.1 Cartesian structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.6.2 Cocartesian structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.6.3 Monos and epis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.6.4 Regular structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.6.5 Cartesian closed structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6.6 The interpretation of 𝜆-calculus in assemblies . . . . . . . . . . . . . . . . . . . . . . 76
3.6.7 Projective assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Bibliography 105
Introduction 1
1.1 Background material
𝑛 ∫ 𝑏
X 1
∀𝑥. ℝ 𝑥 2 + 𝑦 ≥ 0 , , 𝑓 (𝑡) 𝑑𝑡,
𝑘=0 𝑘 2
𝑎
∫
the variables 𝑥 , 𝑘 , and 𝑡 are bound by the operators ∀, , and ,
P
respectively. The remaining variables are free. It is really the occurrence
of a variable that is bound or free, not the variable itself. In
the left-most occurence of 𝑥 is free whereas the other two are bound
by ∃.
Functions
Partial functions
A partial function1 𝑓 : 𝐴 ⇀ 𝐵 is a function that is defined on a subset 1: In the literature on Type Two Effectiv-
dom( 𝑓 ) ⊆ 𝐴, called the domain of 𝑓 . Sometimes there is confusion between ity the common notation is 𝑓 : ⊆ 𝐴 → 𝐵.
the domain dom( 𝑓 ) and the set 𝐴, which is also called the domain. We
therefore call dom( 𝑓 ) the support of 𝑓 . If 𝑓 : 𝐴⇀𝐵 is a partial function and
𝑥 ∈ 𝐴, we write 𝑓 𝑥↓ to indicate that 𝑓 𝑥 is defined. For an expression 𝑒 ,
we also write 𝑒↓ to indicate that 𝑒 and all of its subexpressions are defined.
The symbol ↓ is sometimes inserted into larger expressions, for example,
𝑓 𝑥↓ = 𝑦 means that 𝑓 𝑥 is defined and is equal to 𝑦 . If 𝑒1 and 𝑒2 are two
expressions whose values are possibly undefined, we write 𝑒1 ≃ 𝑒2 to
indicate that either 𝑒1 and 𝑒2 are both undefined, or they are both defined
1 Introduction 2
𝑒1 ≃ 𝑒2 ⇐⇒ 𝑒1 ⪰ 𝑒2 ∧ 𝑒2 ⪰ 𝑒1 .
ℎ(0 , 𝑛1 , . . . , 𝑛 𝑘 ) = 𝑓 (𝑛1 , . . . , 𝑛 𝑘 ),
ℎ(𝑛 + 1 , 𝑛1 , . . . , 𝑛 𝑘 ) = 𝑔(ℎ(𝑛, 𝑛1 , . . . , 𝑛 𝑘 ), 𝑛, 𝑛1 , . . . , 𝑛 𝑘 )
is primitive recursive.
Every primitive recursive function is computable, but not every com-
putable function is primitive recursive.2 2: The Ackermann function is com-
putable but not primitive recursive.
The (general) partial recursive functions are built from the above op-
erations and minimization: given a partial recursive 𝑓 : ℕ 𝑘+1 ⇀ ℕ the
function 𝑔 : ℕ 𝑘 ⇀ ℕ , defined by
Order theory
Topology
1 1 1 1 0
1 0 1 1 0 0 0
working tapes (read & write)
Once we have a universal machine, we can make it behave like any other
machine. It is just “a simple matter of programming” to tell it what to
do.
We mentioned in the introduction that many kinds of computing devices
are equivalent to Turing machines. We shall therefore not insist on
describing computation solely in terms of Turing machines, but rather
rely on familiarity with modern computers and programming languages.
2 Models of Computation 6
⌜[ ]⌝ = 0
⌜ [𝑛0 , . . . , 𝑛 𝑘 ] ⌝ = ⌜ (𝑛0 , ⌜ [𝑛1 , . . . , 𝑛 𝑘 ] ⌝ ) ⌝ .
2 Models of Computation 7
is
“Machine encoded by 𝑥 with input tape that encodes the
number 𝑦 performs a sequence of computation steps encoded
by 𝑧 and terminates.”
The amazing thing is that 𝑇 may be defined in Peano arithmetic just in
terms of 0, successor, + and ×. There is an associated computable partial
function 𝑈(𝑧) whose meaning is “the number encoded by the contents
of the output tape in the last step of computation encoded by 𝑧 ”. With
it we can extract the result of a computation. It is easy to arrange 𝑈 so
that it is defined for all 𝑧 , even those that do not encode terminating
computations.
Kleene’s normal form theorem [19] says that every partial computable [19]: Kleene (1943), “Recursive predicates
function 𝑓 : ℕ ⇀ ℕ may be written in the form and quantifiers”
These enumerations are not arbitrary, because they have the following
important properties.
𝑢(𝑥, 𝑦) ≃ 𝝋 𝑥 (𝑦).
(2)
𝝋 𝑠(𝑥,𝑦) (𝑧) ≃ 𝝋 𝑥 (𝑦, 𝑧).
and the function 𝑠 is the currying operation2 2: In Haskell the notation \x -> e
stands for 𝜆-abstraction 𝜆𝑥. 𝑒 , which in
s (f, y) = \z -> f (y, z) turn means “the function which maps 𝑥
to 𝑒 ”, see Section 2.3.
This may seem like a triviality to the programmer but is surely not con-
sidered one by the implementors of the Haskell compiler. The definition
of s uses function application, pairing, currying and 𝜆-abstraction, which
are “the essence” of functional programming, just like the utm and smn
theorems are the essence of partial computable functions.
The following theorem is important in the theory of computable functions
because it allows us to define partial computable functions by recursion.
𝜓(𝑢, 𝑥) = 𝝋 𝝋 (𝑥),
𝑢 (𝑢)
is not computable.
Proof. Let us prove the theorem in Haskell. We must show that there is
no
h :: (Integer -> Integer) -> Integer
We recall a few basic facts about the Baire space 𝔹 = ℕ ℕ . Let ℕ ∗ be the
set of all finite sequences of natural numbers. If 𝑎, 𝑏 ∈ ℕ ∗ we write 𝑎 ⊑ 𝑏
when 𝑎 is a prefix of 𝑏 . The length of a finite sequence 𝑎 is denoted by ∥𝑎∥ .
Similarly, we write 𝑎 ⊑ 𝛼 when 𝑎 is a prefix of an infinite sequence 𝛼 ∈ 𝔹.
2 Models of Computation 11
𝑎++𝔹 = {𝑎 ++ 𝛽 | 𝛽 ∈ 𝔹} = {𝛼 ∈ 𝔹 | 𝑎 ⊑ 𝛼}.
Because the basic open sets are both closed and open (clopen), 𝔹 is in fact
a countably based 0-dimensional3 Hausdorff space. It is also a complete 3: Recall that a space is 0-dimensional
separable metric space for the comparison metric 𝑑 : 𝔹 × 𝔹 → ℝ, defined when its clopen subsets form a base for
its topology.
by
𝑑(𝛼, 𝛽) = inf {2−𝑛 | 𝛼(𝑛) = 𝛽(𝑛)}.
If the first term in which 𝛼 and 𝛽 differ is the 𝑛 -th one, then 𝑑(𝛼, 𝛽) = 2−𝑛 .
The comparison metric is an ultrametric, which means that it satisfies
the inequality 𝑑(𝛼, 𝛾) ≤ max(𝑑(𝛼, 𝛽), 𝑑(𝛽, 𝛾)). In an ultrametric space
every point of a ball is its center. The clopen sets 𝑎++𝔹 are precisely the
balls of radius 2−∥𝑎∥ .
(if no such 𝑘 exists then ℓ (𝛾, 𝛼)(𝑖) is undefined), and let the map 𝜼 𝛾 : 𝔹⇀𝔹
encoded by 𝛾 be
(
ℓ (𝛾, 𝛼) if ℓ (𝛾, 𝛼) is a total map,
𝜼 𝛾 (𝛼) = (2.2)
undefined otherwise.
𝛾( ⌜ 𝑎 ⌝ ) if 𝑎 = [ ],
𝛿( ⌜ 𝑎 ⌝ ) = 𝛾( ⌜ 𝑎 ⌝ ) if 𝑎 = 𝑎 ′:: 𝑖 and 𝛿( ⌜ 𝑎 ′ ⌝ ) = 0,
𝛿( ⌜ 𝑎 ′ ⌝ ) if 𝑎 = 𝑎 ′::𝑖 and 𝛿( ⌜ 𝑎 ′ ⌝ ) ≠ 0,
The realizer 𝛿 is consistent by construction. It is easy to check that
𝜼𝛾 = 𝜼𝛿 .
𝐴 = (𝑎, 𝑖, 𝑗) ∈ ℕ ∗ × ℕ 2 |
is realized.
Finally, we formulate the utm and smn theorems for type 2 machines.
The universal u :: ([Integer] -> Integer, Baire) -> Baire is just the
transliteration of (2.2):
2 Models of Computation 15
u (a, b) i = x - 1
where x = head $
filter (/= 0) $
[a (i : map b [0..(k-1)]) | k <- [0..]]
You may entertain yourself by learning Haskell and figuring out how it
works.
The type 2 variant of the smn theorem uses the representation 𝜼(2) for
encoding partial maps 𝔹 × 𝔹 → 𝔹 by
(2)
𝜼 𝛼 (𝛽, 𝛾) = 𝜼 𝛼 (⟨𝛽, 𝛾⟩)
(2)
𝜼 𝑠(𝛼,𝛽) (𝛾) = 𝜼 𝛼 (𝛽, 𝛾).
To convince ourselves that the utm theorem holds, we think a bit how a
universal infinite-time Turing machine works. It accepts the description 𝑛
of a machine and the initial input tape 𝑥 . At successor steps the simulation
of machine 𝑀𝑛 on input 𝑥 proceeds much like it does for the ordinary
Turing machines. Thus it takes finitely many successor steps to simulate
2 Models of Computation 17
Each of these requires several infinite tapes, but since we only need
countably many of them, they may be interleaved into a single tape.
At successor steps the simulation performs the usual dovetailing
technique. At limit steps the simulation inserts extra 𝜔 bookkeeping
steps, during which it places the simulated machines in the “limit”
state and moves their head positions. The extra steps do not ruin the
limits of the simulated tapes, because those are left untouched. After
the extra steps are performed, dovetailing starts over again. As soon
as one of the simulations 𝑀(𝑥, 𝑛) terminates, we return the results 𝑛 .
Note that 𝑛 is computed from 𝑥 in a deterministic fashion (that depends
2 Models of Computation 18
↑𝑛 = {𝐴 ⊆ ℕ | 𝑛 ∈ 𝐴}.
Let us write
𝐴 ≪ 𝐵 ⇐⇒ 𝐴 ⊆ 𝐵 and 𝐴 is finite.
We may use 𝐴 ≪ ℕ as a convenient shorthand for “𝐴 is a finite subset
of ℕ ”. In the induced topology U ⊆ P(ℕ ) is open if, and only if,
[
U= {↑𝐴 | 𝐴 ∈ U ∧ 𝐴 ≪ ℕ }
or equivalently
𝐵 ∈ U ⇐⇒ ∃𝐴 ≪ 𝐵. 𝐴 ∈ U.
It follows that a Scott open set U is upward closed: if 𝐵 ∈ U and 𝐵 ⊆ 𝐶
then 𝐶 ∈ U. Henceforth we let ℙ denote P(ℕ ) by ℙ qua topological
space equipped with the Scott topology.
2 Models of Computation 19
In information processing and computation the open sets are not about
geometry but about (positively) observable properties. A basic obser-
vation about a set 𝐵 ∈ P(ℕ ) is that it contains a number 𝑛 , whence
the Scott topology is generated by sets of the form ↑𝑛 . The Scott topol-
ogy is not Hausdorff, not even a 𝑇1 -space, but is a 𝑇0 -space.4 Indeed, if 4: The 𝑇0 separation property is a form
𝐴, 𝐵 ∈ P(ℕ ) have the same neighborhoods, then they have the same of Leibniz’s principle of identity which
states that two things are equal if they
subbasic neighborhoods ↑𝑛 , but then they have the same elements. have exactly the same properties.
Another way to get the Scott topology of ℙ is to observe that P(ℕ ) is in
bijective correspondence with the set of all functions {⊥, ⊤}ℕ . If we equip
the two-element set 𝕊 = {⊥, ⊤} with the Sierpinski topology in which
the open sets are ∅, {⊤}, and 𝕊, then ℙ turns out to be homeomorphic to
𝕊ℕ equipped with the product topology.
Next we characterize the continuous maps on ℙ.
∀𝑛 ∈ ℕ . ∀𝐵 ∈ ℙ. (𝑛 ∈ 𝑓 (𝐵) ⇐⇒ ∃𝐴 ≪ 𝐵. 𝑛 ∈ 𝑓 (𝐴)),
A continuous map on ℙ is also called an enumeration operator.5 The 5: The terminology (probably) origi-
second part of the last proposition says that every enumeration operator nates from computability theory, where
the Scott continuous maps on ℙ corre-
is determined by its values on finite sets. Thus, to encode an enumeration spond to higher-order functions operat-
ing on computably enumerable sets.
2 Models of Computation 20
Λ(𝐴)(𝐵) = {𝑛 ∈ ℕ | ∃𝐶 ≪ 𝐵. ⌜ ( ⌜ 𝐶 ⌝ , 𝑛) ⌝ ∈ 𝐴},
Λ(Γ( 𝑓 ))(𝐵) = {𝑛 ∈ ℕ | ∃𝐶 ≪ 𝐵. ⌜ ( ⌜ 𝐶 ⌝ , 𝑛) ⌝ ∈ Γ( 𝑓 )}
= {𝑛 ∈ ℕ | ∃𝐶 ≪ 𝐵. 𝑛 ∈ 𝑓 (𝐶)}
[
= { 𝑓 (𝐶) | 𝐶 ≪ 𝐵}
= 𝑓 (𝐵),
and are continuous when the set of continuous maps C(ℙ , ℙ) is equipped
with the compact-open topology. Concretely, the topology of C(ℙ , ℙ) is
generated by subbasic open sets
{ 𝑓 ∈ C(ℙ , ℙ) | 𝑛 ∈ 𝑓 (𝐴)}
𝑒 |0 ⊆ 𝑒 |1 ⊆ 𝑒 |2 ⊆ · · ·
out that Church’s and Turing’s models can simulate each other.
The 𝜆-calculus is the abstract theory of functions, just like group theory
is the abstract theory of symmetries. There are two basic operations that
can be performed with functions. The first one is the application of a
function to an argument: if 𝑓 is a function and 𝑎 is an argument, then 𝑓 𝑎
is the application of 𝑓 to 𝑎 . The second operation is abstraction: if 𝑥 is a
2 Models of Computation 22
𝑥 ↦→ 𝑡,
𝜆𝑥. 𝑡.
𝜆𝑥. 𝑥 𝑥
Variable 𝑣 ::= 𝑥 | 𝑦 | 𝑧 | · · ·
Expression 𝑒 ::= 𝑣 | 𝑒1 𝑒2 | 𝜆𝑥. 𝑒
𝜆𝑥. 𝑒 𝑥 = 𝑒 ,
𝑒 ↦→ 𝑒 ′
or as
((𝜆𝑥. 𝑥) 𝑎) ((𝜆𝑦. 𝑦) 𝑏) ↦→ ((𝜆𝑥. 𝑥) 𝑎) 𝑏.
A theorem of Church and Rosser’s [9] states that 𝜆-calculus is confluent, [9]: Church et al. (1936), “Some Proper-
which means that the order of 𝛽 -reductions is not important in the ties of Conversion”
sense that two different ways of reducing and expression may always be
reconciled by further reductions. In the above example we get 𝑎 𝑏 in both
cases after one more reduction.
There are expressions which we can keep reducing forever, for example
the term 𝜔 𝜔 where 𝜔 = 𝜆𝑥. 𝑓 (𝑥 𝑥) has an infinite reduction sequence
𝜔 𝜔 ↦→ 𝑓 (𝜔 𝜔) ↦→ 𝑓 ( 𝑓 (𝜔 𝜔)) ↦→ 𝑓 ( 𝑓 ( 𝑓 (𝜔 𝜔))) ↦→ · · ·
pair = 𝜆𝑥 𝑦𝑧. 𝑧 𝑥 𝑦,
fst = 𝜆𝑝. 𝑝 (𝜆𝑥 𝑦. 𝑥),
snd = 𝜆𝑝. 𝑝 (𝜆𝑥 𝑦. 𝑦).
for instance
if = 𝜆𝑥. 𝑥,
true = 𝜆𝑥 𝑦. 𝑥,
false = 𝜆𝑥 𝑦. 𝑦.
They satisfy
The natural numbers are encoded by Church numerals. The 𝑛 -th Church
numeral is a function which maps a function to its 𝑛 -th iteration:
0 = 𝜆 𝑓 𝑥. 𝑥,
1 = 𝜆 𝑓 𝑥. 𝑓 𝑥,
2 = 𝜆 𝑓 𝑥. 𝑓 ( 𝑓 𝑥),
and in general
𝑛 = 𝜆 𝑓 𝑥. 𝑓 (· · · ( 𝑓 𝑥) · · · ).
| {z }
𝑛
succ = 𝜆𝑛 𝑓 𝑥. 𝑛 𝑓 ( 𝑓 𝑥),
add = 𝜆𝑚 𝑛 𝑓 𝑥. 𝑚 𝑓 (𝑛 𝑓 𝑥),
mult = 𝜆𝑚 𝑛 𝑓 𝑥. 𝑚(𝑛 𝑓 )𝑥.
We leave it as exercise to figure out how the following work and what
they do:11 11: Stephen Kleene recounts [20] that he
figured out how to compute predeces-
power = 𝜆𝑚 𝑛. 𝑛 𝑚, sors while at a dentist’s office. Is pro-
gramming the untyped 𝜆-calculus like
iszero = 𝜆𝑛. 𝑛 (𝜆𝑥. false) true , pulling one’s teeth out?
pred = 𝜆𝑛. snd (𝑛 (𝜆𝑝. pair (succ (fst 𝑝)) (fst 𝑝))(pair 0 0)).
𝐷𝐷 o
Γ /𝐷 (2.4)
Λ
that mediate between the two roles. These can be used to interpret each
𝜆-expression 𝑒 with free variables 𝑥1 , . . . , 𝑥 𝑛 a map
[[𝑥 1 , . . . , 𝑥 𝑛 | 𝑒]] : 𝐷 𝑛 → 𝐷
[[ 𝑥® | 𝑥 𝑖 ]] 𝑎® = 𝑎 𝑖
[[ 𝑥® | 𝑒1 𝑒2 ]] 𝑎® = Λ([[ 𝑥® | 𝑒1 ]] 𝑎®)([[ 𝑥® | 𝑒2 ]] 𝑎®), (2.5)
[[ 𝑥® | 𝜆𝑦. 𝑒]] 𝑎® = Γ(𝑏 ↦→ [[ 𝑥®, 𝑦 | 𝑒]](®𝑎 , 𝑏)).
[[𝑥, 𝑦 | 𝑥 𝑦]](Γ( 𝑓 ), 𝑎) = 𝑓 𝑎,
The only set that contains its own function space as a retract is the
singleton set. The 𝜆-calculus has no non-trivial set-theoretic models. We
need to look elsewhere, but where?
An answer was given by Dana Scott [34] who constructed a non-trivial [34]: Scott (1972), “Continuous Lattices”
topological space 𝐷∞ such that the space of continuous functions
C(𝐷∞ , 𝐷∞ ), equipped with the compact-open topology, is homeomor-
phic to 𝐷∞ . This gave a topological model of the untyped 𝜆-calculus for
𝛽𝜂-reduction. Since the construction involves more domain theory than
we wish to assume here, we shall look at the simpler case of models that
satisfy just 𝛽 -reduction.
We seek a non-trivial topological space 𝐷 that continuously retracts onto
its own function space12 12: 𝐷 must be nice enough for C(𝐷, 𝐷),
equipped with the compact-open topol-
ogy, to be an exponential in the category of
topological spaces and continuous maps.
2 Models of Computation 26
C(𝐷, 𝐷) o
Γ /𝐷 (2.6)
Λ
which we used in the last line above. You may proceed by induction
on the structure of 𝑒1 , but should first generalize the statement so that
the induction case of 𝜆-abstraction works out.
The Baire space from Subsection 2.1.2 is almost a model of the untyped
𝜆-calculus, because every 𝛼 ∈ 𝔹 may be viewed both as a (realizer of) a
function and an argument. One is then tempted to define application by
𝛼 𝛽 = 𝜼 𝛼 (𝛽), but this fails because the result 𝜼 𝛼 (𝛽) need not be defined,
whereas application in 𝜆-calculus is a total operation. We now consider a
generalization of the 𝜆-calculus which allows application to be a partial
operation, and whose example is the Baire space.
pair = S(S(KS)(S(S(KS)(S(KK)(KS)))(S(S(KS)(S(S(KS)(S(KK)(KS)))
(S(S(KS)(S(S(KS)(S(KK)(KS)))(S(KK)(KK))))(S(KK)(KK)))))
(S(S(KS)(S(KK)(KK)))(S(KK)(SKK))))))(S(S(KS)(S(KK)(KK)))
(S(S(KS)(KK))(KK))).
𝑊 = ⟨𝑥 𝑦⟩ 𝑦(𝑥 𝑥 𝑦), Y = 𝑊 𝑊,
𝑋 = ⟨𝑥 𝑦𝑧⟩ 𝑦(𝑥 𝑥 𝑦)𝑧, Z = 𝑋 𝑋.
Y 𝑓 ≃ 𝑓 (Y 𝑓 ), Z 𝑓 ↓, (Z 𝑓 ) 𝑥 ≃ 𝑓 (Z 𝑓 ) 𝑥.
The models of computation that we have considered so far are all examples
of partial combinatory algebras.
𝔹# = {𝛼 ∈ 𝔹 | 𝛼 is computable}.
Combinatory logic ℂ𝕃
ℙ# = {𝐴 ∈ ℙ | 𝐴 is computably enumerable}.
pcas and their models lack an important feature that most real-world
programming languages have, namely types that impose well-formedness
restrictions on programs. For instance, in a typical programming language
we cannot meaningfully apply an expression to itself because the typing
discipline prevents us from doing so.
In this section we look at pcas with types, which were defined by
John Longley [26]. His definition sets up a type system that limits the [26]: Longley (1999), “Unifying typed
applicability of the basic combinators, which is offset by additional basic and untyped realizability”
K𝑠,𝑡 ∈ 𝔸𝑠→𝑡→𝑠 ,
S𝑠,𝑡,𝑢 ∈ 𝔸(𝑠→𝑡→𝑢)→(𝑠→𝑡)→𝑠→𝑢 ,
pair𝑠,𝑡 ∈ 𝔸𝑠→𝑡→𝑠×𝑡 ,
fst𝑠,𝑡 ∈ 𝔸𝑠×𝑡→𝑠 ,
snd𝑠,𝑡 ∈ 𝔸𝑠×𝑡→𝑡 .
We usually omit the types in subscripts and write 𝑥 𝑦 for 𝑥 ·𝑠,𝑡 𝑦 . For
all elements 𝑥, 𝑦, 𝑧 of the appropriate types we require:
K 𝑥 𝑦 = 𝑥,
S 𝑥 𝑦↓,
S 𝑥 𝑦 𝑧 ⪰ (𝑥 𝑧)(𝑦 𝑧),
fst (pair 𝑥 𝑦) = 𝑥,
snd (pair 𝑥 𝑦) = 𝑦.
We say that the elements K𝑠,𝑡 , S𝑠,𝑡,𝑢 , pair𝑠,𝑡 , fst𝑠,𝑡 , snd𝑠,𝑡 are suitable
for 𝔸 when they satisfy the above properties.
A typed (total) combinatory algebra is a tpca whose application
operations are total.
We have required the sets 𝔸𝑡 to be non-empty. While this is not strictly
necessary, it simplifies several constructions.
In a pca the natural numbers may be encoded with the basic combinators
as the Curry numerals. In a tpca they are must be postulated separately.
0 , 1 , 2 , . . . ∈ 𝔸nat ,
succ ∈ 𝔸nat→nat ,
rec𝑠 ∈ 𝔸𝑠→(nat→𝑠→𝑠)→nat→𝑠 .
succ 𝑛 = 𝑛 + 1 ,
rec 𝑥 𝑓 0 = 𝑥,
rec 𝑥 𝑓 𝑛 + 1 = 𝑓 𝑛 (rec 𝑥 𝑓 𝑛).
We say that nat, 𝑛 , succ, rec, and the numerals satisfying these
properties are suitable for 𝔸.
Note that 𝔸nat may contain elements other than the numerals 𝑛 . An
n-tpca has primitive recursion but may lack general recursion, so we
need one more definition.
fix𝑠,𝑡 ∈ 𝔸((𝑠→𝑡)→(𝑠→𝑡))→(𝑠→𝑡)
The basic theory of typed pcas follows the theory of untyped pcas.
Expressions over 𝔸 are defined inductively:
1. every 𝑎 ∈ 𝔸𝑡 is a an expression of type 𝑡 , called a primitive constant,
2. an annotated variable 𝑥 𝑡 is an expression of type 𝑡 ,
3. if 𝑒1 is an expression of type 𝑠 → 𝑡 and 𝑒2 is an expression of type 𝑠
then 𝑒1 · 𝑒2 is an expression of type 𝑡 .
Note that variables are annotated with types. We also assume that the
type of a primitive constant is unique (if not we tag constants with their
types), so that every expression has at most one type.
A closed expression 𝑒 of type 𝑡 is defined, written 𝑒↓, when all applications
appearing in it are defined. Such an expression denotes an element of 𝔸𝑡 .
𝑡
If 𝑒 contains variables 𝑥 1𝑡1 , . . . , 𝑥 𝑛𝑛 , we write 𝑒↓ when 𝑒[𝑎 1 /𝑥 1 , . . . , 𝑎 𝑛 /𝑥 𝑛 ]
is defined for all 𝑎 1 ∈ 𝔸𝑡1 , . . . , 𝑎 𝑛 ∈ 𝔸𝑡𝑛 .
Every pca is an nr-tpca if we enrich it with the trivial type system that
contains a single type, T = {★} with (the only possible) operations
★ × ★ = ★ → ★ = ★, and 𝔸★ = 𝔸. The required combinators are the
ones we defined in Section 2.5, we just need to sprinkle ★ on K and S
everywhere.
The rules for pairing and projections are, for all 𝑒1 , 𝑒2 , 𝑒 of type 𝑠 , 𝑡 ,
𝑠 × 𝑡:
fst (𝑒1 , 𝑒2 ) = 𝑒1 ,
snd (𝑒1 , 𝑒2 ) = 𝑒2 ,
(fst 𝑒 , snd 𝑒) = 𝑒 ,
2.7.3 Gödel’s 𝑇
The pure simply typed 𝜆-calculus is not an n-tpca because it lacks the
natural numbers. To make it into an n-tpca, we add a ground type nat
and primitive constants
0 : nat
succ : nat → nat
rec𝑡 : 𝑡 → (nat → 𝑡 → 𝑡) → nat → 𝑡 (for each type 𝑡 )
rec 𝑒1 𝑒2 0 = 𝑒1
rec 𝑒1 𝑒2 (succ 𝑒3 ) = 𝑒2 𝑒3 (rec 𝑒1 𝑒2 𝑒3 ).
succ 𝑛 = 𝑛 + 1
pred 0 = 0
pred 𝑛 + 1 = 𝑛
iszero 0 = true
iszero 𝑛 + 1 = false
if𝑡 true 𝑒1 𝑒2 = 𝑒1
if𝑡 false 𝑒1 𝑒2 = 𝑒2
fix𝑡 𝑓 = 𝑒 (fix𝑡 𝑒)
2.7.5 PCF∞
func 𝑓 𝑛 = 𝑓 (𝑛).
2.8 Simulations
If you open a book on computability theory, chances are that you will
find a statement saying that “models of computation are equivalent”.
The claim refers to a collection of specific models of computation, such
as variations of Turing machines, 𝜆-calculi, and recursive functions. The
book supports the claim by describing simulations between such models,
with varying degrees of detail, after which it hurries on to core topics of
computability theory. An opportunity is missed to ask about a general
notion of simulation, and a study of its structural properties.
We seize the opportunity and study a notion of simulation between
pcas. An excellent one is John Longley’s applicative morphism [24]. His [24]: Longley (1994), “Realizability
definition extends easily to account for pcas with sub-pcas. We dare Toposes and Language Semantics”
pca
The identity simulation id(𝔼,𝔼′ ) : (𝔼 , 𝔼′) −→ (𝔼 , 𝔼′) is the identity relation
on 𝔼. It is realized by ⟨𝑥 𝑦⟩ 𝑥 𝑦 .
Pcas with sub-pcas and simulations between them therefore form a
category. We equip it with a preorder enrichment15 ⪯ as follows. Given 15: A category C is preorder enriched
pca when hom-sets C(𝑋 , 𝑌) are equipped
𝜌, 𝜎 : (𝔼, 𝔼′) −→ (𝔽 , 𝔽 ′), define 𝜌 ⪯ 𝜎 to hold when there exists a
with preorders (reflexive and transitive
translation 𝑡 ∈ 𝔽 ′ such that, for all 𝑥 ∈ 𝔼 and 𝑦 ∈ 𝜌[𝑥], 𝑡 𝑦↓ and relations) under which composition is
𝑡 𝑦 ∈ 𝜎[𝑥]. monotone.
pca pca
Exercise 2.8.3 Given 𝜌, 𝜌′ : (𝔼 , 𝔼′) −→ (𝔽 , 𝔽 ′) and 𝜎, 𝜎′ : (𝔽 , 𝔽 ′) −→
(𝔾 , 𝔾′), show that if 𝜌 ⪯ 𝜌′ and 𝜎 ⪯ 𝜎′ then 𝜎 ◦ 𝜌 ⪯ 𝜎′ ◦ 𝜌′.
pca
Definition 2.8.5 A simulation 𝜌 : (𝔼 , 𝔼′) −→ (𝔽 , 𝔽 ′) is discrete when,
for all 𝑥, 𝑦 ∈ 𝔼 if 𝜌[𝑥] ∩ 𝜌[𝑦] is in inhabited then 𝑥 = 𝑦 .
pca
Definition 2.8.6 A simulation 𝜌 : (𝔼 , 𝔼′) −→ (𝔽 , 𝔽 ′) is projective when
there is a single-valued simulation (a function) 𝜌′ such that 𝜌′ ∼ 𝜌.
pca
Exercise 2.8.7 Prove that a simulation 𝜌 : 𝔼 −→ 𝔽 is projective if, and
only if, there is 𝑡 ∈ 𝔽 ′ such that, for all 𝑥 ∈ 𝔼 and 𝑦, 𝑧 ∈ 𝔽 :
▶ if 𝑦 ∈ 𝜌[𝑥] then 𝑡 𝑦↓ and 𝑡 𝑦 ∈ 𝜌[𝑥],
▶ if 𝑦 ∈ 𝜌[𝑥] and 𝑧 ∈ 𝜌[𝑥] then 𝑡 𝑦 = 𝑡 𝑧 .
2 Models of Computation 39
pca
Definition 2.8.8 A simulation 𝜌 : (𝔼 , 𝔼′) −→ (𝔽 , 𝔽 ′) is decidable when
there is 𝑑 ∈ 𝔽 ′, called the decider for 𝜌, such that, for all 𝑥 ∈ 𝔽 ,
𝑥 ∈ 𝜌[true𝔼 ] ⇒ 𝑑 𝑥 = true𝔽 ,
𝑥 ∈ 𝜌[false𝔼 ] ⇒ 𝑑 𝑥 = false𝔽 .
pca
Exercise 2.8.9 Say that a simulation 𝜌 : (𝔼 , 𝔼′) −→ (𝔽 , 𝔽 ′) preserves
numerals when there is 𝑐 ∈ 𝔽 ′ such that, for all 𝑛 ∈ ℕ and 𝑥 ∈ 𝔽 ,
𝑥 ∈ 𝜌[𝑛 𝔼 ] =⇒ 𝑐 𝑥 = 𝑛 𝔽 .
Prove that a simulation is decidable if, and only if, it preserves numerals.
pca pca
Theorem 2.8.10 For 𝛿 : 𝔼 −→ 𝔽 and 𝛾 : 𝔽 −→ 𝔼:
1. If 𝛾 ◦ 𝛿 ⪯ id𝔼 then 𝛿 is discrete and 𝛾 is decidable.
2. If 𝛾 ⊣ 𝛿 then 𝛾 is projective.
Corollary 2.8.12 If 𝔼 and 𝔽 are equivalent pcas, then the there exist an
equivalence
pca pca
𝛿 : 𝔼 −→ 𝔽 , 𝛾 : 𝔽 −→ 𝔼 ,
Proof. We sketch the proof from [24, Theorem 2.4.18]. Given any pca 𝔸,
pca
define 𝜅 : 𝕂1 −→ 𝔸 by 𝜅[𝑛] = {𝑛 𝔸 }. Because every partial computable
function ℕ × ℕ ⇀ ℕ can be represented in 𝔸, there is 𝑟 ∈ 𝔸 such that,
for all 𝑘, 𝑚, 𝑛 ∈ ℕ ,
𝑟 𝑘 𝑚 = 𝑛 ⇐⇒ 𝝋 𝑘 (𝑚) = 𝑛.
pca
Exercise 2.8.14 Verify that for any 𝜌 : 𝔼 −→ 𝔽 there is 𝑞 ∈ 𝔽 such that
𝑞 𝑛 𝔽 ∈ 𝜌[𝑛 𝔼 ] for all 𝑛 ∈ ℕ .
The following definition and exercise verify that having decidable sim-
ulations between 𝔼 and 𝔽 implies that they both compute the same
number-theoretic functions, which is sometimes taken to be a notion of
equivalence of computational models.
𝛾[𝑡] = { ⌜ 𝑡 ′ ⌝ | 𝑡 ′ ∈ Λ ∧ 𝑡 =𝛽 𝑡 ′ }.
𝛿[𝑛] = {{𝑛}}.
2 Models of Computation 42
𝛾[𝐴] = {𝑛 ∈ ℕ | im(𝝋 𝑛 ) = 𝐴}
to be the index set16 of 𝐴, i.e., the codes of partial computable maps 16: In computability theory, the index set
whose image is 𝐴. of a set 𝐴 is the set of all numbers (the
indices) that encode elements of 𝐴.
𝑆 = { ⌜ ⟨ ⌜ {𝑚} ⌝ , 𝑛⟩ ⌝ | ∃𝑘 ∈ ℕ . 𝝋 𝑚 (𝑘) = 𝑛}
𝜄 𝛼 = { ⌜ 𝑎 ⌝ | 𝑎 ∈ ℕ ∗ ∧ 𝑎 ⊑ 𝛼}
represents a sequence 𝛼 with the set (of codes) of its initial segments. It
restricts to a map 𝔹# → ℙ# . Let us show that it is a simulation.
In Subsection 2.1.2 we defined the application 𝛼 ·𝔹 𝛽 in 𝔹 by a lookup
procedure, by which every initial segment of 𝛼 ·𝔹 𝛽 is determined by
sufficiently long initial segments of 𝛼 and 𝛽 . Thus the relation 𝑅 ⊆
ℕ ∗ × ℕ ∗ × ℕ ∗ defined by
(𝑎, 𝑏, 𝑐) ∈ 𝑅 ⇐⇒
∀𝛼, 𝛽, 𝛾 ∈ 𝔹. (𝛼 ·𝔹 𝛽)↓ ∧ 𝑎 ⊑ 𝛼 ∧ 𝑏 ⊑ 𝛽 ⇒ 𝑐 ⊑ 𝛼 ·𝔹 𝛽
pca
Let 𝛿 : ℙ −→ 𝔹 be the simulation defined by
𝛿[𝐴] = {𝛼 ∈ 𝔹 | 𝐴 = {𝑛 ∈ ℕ | ∃𝑘 ∈ ℕ . 𝛼 𝑘 = 𝑛 + 1}}.
𝑚 ∈ 𝐴 ⇐⇒ ∃𝑛 ∈ 𝐵. 𝑛 = 1 + ⌜ 𝑎 ⌝ ∧ ∃𝑖 < ∥𝑎 ∥. 𝑚 = 𝑎 𝑖 .
C(𝐷, 𝐷) o
Γ𝐷
/𝐷 C(𝐸, 𝐸) o
Γ𝐸
/𝐷
Λ𝐷 Λ𝐸
𝑠𝐷 𝑠𝐸
𝐷o /𝐸 𝐸o /𝐷
𝑟𝐷 𝑟𝐸
Realizability was introduced by Stephen Kleene [17] who used it to build [17]: Kleene (1945), “On the Interpreta-
a model of intuitionistic arithmetic. We motivate it by asking a practical tion of Intuitionistic Number Theory”
𝑟⊩𝑥
3 Realizability categories 45
and also
3.2 Assemblies
Assemblies and maps over (𝔸 , 𝔸′) form a category Asm(𝔸 , 𝔸′). Indeed,
if 𝑓 : 𝑆 → 𝑇 and 𝑔 : 𝑇 → 𝑈 are realized by f ∈ 𝔸′∥𝑆∥→∥𝑇 ∥ and
g ∈ 𝔸′∥𝑇 ∥→∥𝑈 ∥ , respectively, then their composition 𝑔 ◦ 𝑓 is realized by
⟨𝑥 ∥𝑆∥ ⟩ 𝑟 (𝑞 𝑥) = S (K 𝑟) (S (K 𝑞) (S K K)). The identity map id𝑆 : |𝑆| → |𝑆| is
realized by ⟨𝑥 ∥𝑆∥ ⟩ 𝑥 = S K K. Composition is associative because it is just
composition of maps.
When 𝔸′ = 𝔸 we write Asm(𝔸) instead of Asm(𝔸 , 𝔸).
Definition 3.2.3 A modest assembly 𝑆 , also called a modest set,3 is an 3: The terminology was suggested by
assembly in which elements do not share realizers: Dana Scott. It refers to the fact that the
cardinality of a modest set 𝑆 does not
exceed the cardinality of 𝔸 ∥𝑆∥ .
∀𝑟 ∈ 𝔸 ∥𝑆∥ . ∀𝑥, 𝑦 ∈ |𝑆|. (𝑟 ⊩𝑆 𝑥 ∧ 𝑟 ⊩𝑆 𝑦 ⇒ 𝑥 = 𝑦).
We let Mod(𝔸 , 𝔸′) be the full subcategory of Asm(𝔸 , 𝔸′) on the modest
sets.
Exercise 3.2.4 Show that 𝟙 is the terminal object4 in Asm(𝔸 , 𝔸′). Con- 4: An object 𝑇 in a category is terminal
clude from this that a different choice of unit results in an isomorphic when there is precisely one morphism to
𝑇 from every object.
copy of 𝟙.
set |𝑆| of 𝑆 . Both induce functors Asm(𝔸 , 𝔸′) → Set, which need not be
equivalent, unless 𝔸 = 𝔸′.
Exercise 3.2.5 The empty assembly 𝟘 has as its underlying set the
empty set ∅ and as its underlying type unit. Show that the choice of
the underlying type does not matter and that the empty assembly is
the initial object.
𝑓0=0 and 𝑓 (𝑛 + 1) = 𝑓 ( 𝑓 𝑛)
is realized by rec z f.
The extreme case of elements sharing the same realizer happens when
all elements of a set share all realizers. Assemblies with this property are
called the constant assemblies.
Let 𝑡 be a type such that 𝔸′𝑡 is inhabited. Such a type always exists,
because there is at least one type 𝑠 , and then 𝔸𝑠→𝑠→𝑠 contains K𝑠,𝑠 . Given
any set 𝑋 , let
∇𝑋 = (𝑋 , 𝑡, ⊩∇𝑋 )
be the assembly whose underlying set is 𝑋 and the realizability relation
is trivial, i.e., 𝑟 ⊩∇𝑋 𝑥 for all 𝑥 ∈ 𝑋 and 𝑟 ∈ 𝐴𝑡 .
If 𝑓 : 𝑋 → 𝑌 is any map between sets 𝑋 and 𝑌 then 𝑓 is a morphism
∇ 𝑓 : ∇𝑋 → ∇𝑌 because it is tracked by ⟨𝑥 𝑡 ⟩ 𝑥 . Thus ∇ is a functor
Exercise 3.2.7 Show that an assembly 𝑆 is modest if, and only if, every
assembly map ∇2 → 𝑆 is constant.
Exercise 3.2.8 Given a set 𝑋 and an assembly 𝑆 , show that every map
|𝑆| → 𝑋 is an assembly map 𝑆 → ∇𝑋 .
Exercise 3.2.9 Let Γ : Asm(𝔸 , 𝔸′) → Set be the forgetful functor which
assigns to an assembly its underlying set, and to an assembly map the
underlying set-theoretic function. Show that Γ is left adjoint to ∇.
We explore a bit what the two-element assemblies are like. For simplicity
we consider the non-relative case Asm(𝔸) of assemblies on a pca 𝔸.
Without loss of generality we may assume that a two-element assembly 𝑇
has |𝑇 | = 2 = {0 , 1} as its underlying set. Such an assembly is determined
by the sets of realizers E𝑇 0 ⊆ 𝔸 and E𝑇 1 ⊆ 𝔸, which must both be
inhabited.
We may partially order all two-element assemblies by stipulating that
𝑇 ≤ 𝑈 , where |𝑇 | = |𝑈 | = 2 when id2 is realized as an assembly map
𝑇 → 𝑈 . That is, 𝑇 ≤ 𝑈 holds when the realizers of 𝑇 are more informative
than the realizers of 𝑈 .
With respect to this ordering the largest two-element assembly is ∇2,
since every map into a constant assembly is realized. We call ∇2 the
classical truth values because it comes from classical set theory, where 2
is the object of truth values.
The least two-element assembly is 𝟚 = (2 , ⊩𝟚 ) where, for r ∈ 𝔸 and
𝑏 ∈ 2,
In your definition you should replace the maps 𝑝 with suitable realiz-
ers r. Above we already constructed Σ10 = Π00 = 𝟚 and Σ01 . Show that
Σ0𝑛 ≤ Π0𝑛+1 and Π0𝑛 ≤ Σ0𝑛+1 .
Real numbers
As our third example we ask how to equip the real numbers with a
realizability structure. Here we give the correct answer, but leave it
unexplained for the time being.
We work with an nr-tpca 𝔸 with a sub-n-tpca 𝔸′. Intuitively speaking, a
realizer for 𝑥 ∈ ℝ should allow us to compute arbitrarily good approxi-
mations of 𝑥 , so we define the relation ⊩𝑅 between 𝔸nat→nat×nat×nat by
stipulating that x ⊩𝑅 𝑥 holds if, and only if,
𝑎−𝑏
∀𝑘 ∈ ℕ . ∃𝑎, 𝑏, 𝑐 ∈ ℕ . x 𝑘 = (𝑎, 𝑏, 𝑐) ∧ |𝑥 − | < 2−𝑘 .
1+𝑐
The triple of numbers (𝑎, 𝑏, 𝑐) is just a clumsy way of encoding the
rational 𝑎−𝑏
1+𝑐 , so in essence x computes a sequence of rationals such that
the 𝑘 -th term is within 2−𝑘 of 𝑥 .
The assembly of real numbers 𝑅 = (ℝrz , nat → nat × nat × nat , ⊩𝑅 ) has
as its underlying set the realized reals
Which reals are so realized depends on the choice of 𝔸. For example, first
Kleene algebra realizes the Turing computable reals, whereas the second
Kleene algebra realizes all reals.
3.3.2 Representations
𝛿 𝑆 (𝑟) = 𝑥 ⇐⇒ 𝑟 ⊩𝑆 𝑥.
The map is surjective in the sense that for every 𝑥 ∈ |𝑆| there is 𝑟 ∈ 𝔸 ∥𝑆∥
such that 𝑥 ∈ 𝛿 𝑆 (𝑟).
To summarize, there are three ways of specifying the realizability struc-
ture of an assembly: with a realizability relation ⊩𝑆 , an existence predi-
cate E𝑆 , and a multi-valued representation 𝛿 𝑆 . Each determines the other
two by
𝑟 ⊩𝑆 𝑥 ⇐⇒ 𝑟 ∈ E𝑆 (𝑥) ⇐⇒ 𝑥 ∈ 𝛿 𝑆 (𝑟).
This formulation only works for modest sets. With each modest set 𝑆
we may associate a partial equivalence relation6 (per) ≈𝑆 on 𝔸 ∥𝑆∥ which 6: A partial equivalence relation is a
relates 𝑞 and 𝑟 when they realize the same element: transitive symmetric relation.
𝑞 ≈𝑆 𝑟 ⇐⇒ ∃𝑥 ∈ |𝑆|. 𝑞 ⊩𝑆 𝑥 ∧ 𝑟 ⊩𝑆 𝑥.
3 Realizability categories 51
The pair (∥𝑆∥, ≈𝑆 ) suffices for the reconstruction of the original modest
set, up to isomorphism, which we show next.
Let (𝔸 , 𝔸′) be a tpca with a sub-tpca. A partial equivalence relation on 𝔸
is a pair 𝑆 = (∥𝑆∥, ≈𝑆 ) where ∥𝑆∥ is a type and ≈𝑆 is a transitive and
symmetric relation on 𝔸 ∥𝑆∥ . A realizer 𝑟 ∈ 𝔸 ∥𝑆∥ is total if 𝑟 ≈𝑆 𝑟 . The set
of total realizers is denoted by ∥𝑆∥ = {𝑟 ∈ 𝔸 ∥𝑆∥ | 𝑟 ≈𝑆 𝑟}. Each 𝑟 ∈ ∥𝑆∥
determines the equivalence class [𝑟]𝑆 = {𝑞 ∈ 𝔸 ∥𝑆∥ | 𝑟 ≈𝑆 𝑞}.
An extensional realizer between pers 𝑆 and 𝑇 is 𝑝 ∈ 𝔸′∥𝑆∥→∥𝑇 ∥ such that,
for all 𝑞, 𝑟 ∈ 𝔸 ∥𝑆∥ , if 𝑞 ≈𝑆 𝑟 then 𝑝 𝑞↓, 𝑝 𝑟↓, and 𝑝 𝑞 ≈𝑇 𝑝 𝑟 . Extensional
realizers 𝑝 and 𝑝 ′ are equivalent when 𝑞 ≈𝑆 𝑟 implies 𝑝 𝑞 ≈𝑇 𝑝 ′ 𝑟 .
Pers and equivalence classes of extensional realizers form a category
Per(𝔸 , 𝔸′ ) whose objects are pers on 𝔸 and morphisms are equivalence
classes of extensional realizers. The composition of [𝑝] : 𝑆 → 𝑇 and
[𝑞] : 𝑇 → 𝑈 is [𝑞 ◦ 𝑝] : 𝑆 → 𝑈 where 𝑞 ◦ 𝑝 = ⟨𝑥 ∥𝑆∥ ⟩ 𝑞 (𝑝 𝑥). The identity
morphism id𝑆 : 𝑆 → 𝑆 is represented by ⟨𝑥 ∥𝑆∥ ⟩ 𝑥 . It is easy to check that
this forms a category.
Let 𝑆 and 𝑇 be pers over (𝔸 , 𝔸′). A morphism between them may be
alternatively described as a function 𝑓 : ∥𝑆∥/≈𝑆 → ∥𝑇 ∥/≈𝑇 between the
equivalence classes for which there exists a realizer 𝑝 ∈ 𝔸′∥𝑆∥→∥𝑇 ∥ that
tracks it: for every equivalence class [𝑟]𝑆 , 𝑝 𝑟↓ and [𝑝 𝑟]𝑇 = 𝑓 ([𝑟]𝑆 ).
Proposition 3.3.2 The categories Mod(𝔸 , 𝔸′) and Per(𝔸 , 𝔸′) are equivalent.
𝑞 ⊩𝜌𝑆
c 𝑥 ⇐⇒ ∃𝑟 ∈ 𝔼. 𝑞 ∈ 𝜌[𝑟] ∧ 𝑟 ⊩𝑆 𝑥.
pca
Proposition 3.4.2 Let 𝜌 : (𝔼 , 𝔼′) −→ (𝔽 , 𝔽 ′) be a simulation.
3 Realizability categories 53
Proof. The first three claims are subsumed by the easy part of [24,
Proposition 2.5.9], except that we are using simulations on pcas with
sub-pcas. Also, we are restricting attention to categories of assemblies
rather than realizability toposes, but this is not a problem because by
applicative functors on realizability toposes restrict to assemblies.
That equivalences of simulations induce equivalences of categories is
shown in [24, Theorem 2.5.6].
𝜌
Asm(𝔼 , 𝔼′ ) / Asm(𝔽 , 𝔽 ′)
b
e 9
∇ ∇
Set
3 Realizability categories 54
𝜌
Asm(𝔼 , 𝔼′ ) / Asm(𝔽 , 𝔽 ′)
b
Γ Γ
% y
Set
An equilogical space is a topological space with an equivalence relation [1]. [1]: Bauer et al. (1998), “Equilogical
We study equilogical spaces in some detail because they give us a Spaces”
𝑞𝑋 𝑞𝑌
𝑋/≡𝑋 / 𝑌/≡𝑌
𝑓
𝑒 𝑋 (𝑥) = {𝑛 ∈ ℕ | 𝑥 ∈ 𝑈𝑛 }.
subbasic opens, [
𝑉= 𝑖
𝑈𝑛 𝑖,1 ∩ · · · ∩ 𝑈𝑛 𝑖,𝑘 𝑖
Now
[ [
𝑒 𝑋∗ 𝑖
↑{𝑛 𝑖,1 , . . . , 𝑛 𝑖,𝑘 𝑖 } = 𝑒 ∗ (↑{𝑛 𝑖,1 , . . . , 𝑛 𝑖,𝑘 𝑖 })
𝑖 𝑋
[
= 𝑒 𝑋∗ (↑𝑛 𝑖,1 ∩ · · · ∩ ↑𝑛 𝑖,𝑘 𝑖 )
[𝑖
= 𝑒 𝑋∗ (↑𝑛 𝑖,1 ) ∩ · · · ∩ 𝑒 𝑋∗ (↑𝑛 𝑖,𝑘 𝑖 )
[𝑖
= 𝑖
𝑈𝑛 𝑖,1 ∩ · · · ∩ 𝑈𝑛 𝑖,𝑘 𝑖
= 𝑉,
therefore 𝑒 𝑋
∗
is surjective, as required.
It is continuous because
𝑔 ∗ (↑𝑛) = {𝑦 ∈ 𝑌 | 𝑛 ∈ 𝑔(𝑦)}
= {𝑦 ∈ 𝑌 | ∃𝑈. O(𝑌)𝑦 ∈ 𝑈 ∧ ∀𝑧. 𝑒 ∗ (𝑈)𝑛 ∈ 𝑓 (𝑧)}
[
= 𝑈∈O(𝑌)
{𝑈 | ∀𝑧. 𝑒 ∗ (𝑈)𝑛 ∈ 𝑓 (𝑧)} .
Let us show that 𝑔(𝑒(𝑥)) = 𝑓 (𝑥) for all 𝑥 ∈ 𝑋 . Consider the value
[ n\ o
𝑔(𝑒(𝑥)) = 𝑈 ∈O(𝑌) 𝑧∈𝑒 ∗ (𝑈)
𝑓 (𝑧) | 𝑒(𝑥) ∈ 𝑈 .
The Embedding and Extension theorems now give us the desired equiva-
lence [28]. [28]: Menni et al. (2002), “Topologi-
cal and Limit-Space Subcategories of
Countably-Based Equilogical Spaces”
Proposition 3.5.3 The categories Equ and Asm(ℙ) are equivalent.
Proof. We verify that the equivalence functors 𝐹 and 𝐺 from the proof of
Proposition 3.5.3 restrict to Equ0 and Mod(ℙ). If (𝑋 , ≡𝑋 ) is an equilogical
space whose underlying space 𝑋 is 𝑇0 , then the pre-embedding 𝑒 : 𝑋 → ℙ
is actually an embedding. Because it is injective the assembly 𝐹(𝑋) is
modest. This shows that 𝐹 restricts to a functor Equ0 → Mod(ℙ). To see
that 𝐺 restricts to a functor Mod(ℙ) → Equ0 , observe that, for a modest
assembly (𝑆, E𝑆 ), the projection 𝑋𝑆 → ℙ is an embedding, therefore 𝑋𝑆
is a 𝑇0 -space.
𝑓
𝑋 /𝑌
𝑒𝑋 𝑒𝑌
𝑔
ℙ /ℙ
𝐼𝑋 = {( ⌜ {𝑖1 , . . . , 𝑖 𝑛 } ⌝ , 𝑚) ∈ ℕ × ℕ | 𝑚 ∈ {𝑖 1 , . . . , 𝑖 𝑛 }}.
( ⌜ {𝑗1 , . . . , 𝑗 𝑘 } ⌝ , ℓ ) ∈ 𝐻 ⇐⇒
^𝑛
∃𝑖1 , . . . , 𝑖 𝑛 . ℕ ( ⌜ {𝑖 1 , . . . , 𝑖 𝑛 } ⌝ , ℓ ) ∈ 𝐺 ∧ 𝑠=1
( ⌜ {𝑗1 , . . . , 𝑗 𝑘 } ⌝ , 𝑖 𝑠 ) ∈ 𝐹.
It is easy to see that 𝐹′ satisfies all three conditions and realizes the same
function as 𝑓 .
A point 𝑥 ∈ 𝑋 is computable when the map {★} → 𝑋 which maps ★ to 𝑥 is
computable. This is equivalent to requiring that 𝑒 𝑋 (𝑥) = {𝑖 ∈ ℕ | 𝑥 ∈ 𝑈 𝑖 }
is a c.e. set.
Next, we prove effective versions of the Embedding and Extension
Theorems.
3 Realizability categories 59
𝐸𝑋 = {( ⌜ {𝑖1 , . . . , 𝑖 𝑛 } ⌝ , 𝑚) ∈ ℕ × ℕ | 𝑚 ∈ {𝑖 1 , . . . , 𝑖 𝑛 }}.
( ⌜ {𝑖0 , . . . , 𝑖 𝑛 } ⌝ , 𝑚) ∈ 𝐸𝑋 =⇒ 𝑒 𝑋 (𝑈 𝑖1 , . . . , 𝑈 𝑖 𝑛 ) ⊆ ↑𝑚,
Proof. The maps 𝑒 𝑋 and 𝑒𝑌 are the computable embeddings from Em-
bedding Theorem 3.5.6. Let 𝐹 be a c.e. realizer for 𝑓 . We define the map
𝑔 : ℙ → ℙ by specifying its graph to be 𝐹 , i.e.,
All we have to show is that this choice of 𝑔 makes the diagram commute.
For any 𝑥 ∈ 𝑋 ,
𝑚 ∈ 𝑔(𝑒 𝑋 (𝑥))
⇔ ∃𝑖 1 , . . . , 𝑖 𝑛 ∈ ℕ . 𝑥 ∈ 𝑈 𝑖1 ∩ · · · ∩ 𝑈 𝑖 𝑛 ∧ ( ⌜ {𝑖 1 , . . . , 𝑖 𝑛 } ⌝ , 𝑚) ∈ 𝐹
⇔ 𝑓 (𝑥) ∈ 𝑉𝑚
⇔ 𝑚 ∈ 𝑒𝑌 ( 𝑓 (𝑥)).
We check that we got the definition right by proving that Equ# is equivalent
to Asm(ℙ , ℙ# ).
Proof. The proof goes just as the proof of Proposition 3.5.3 that Equ and
Asm(ℙ) are equivalent. The only difference is that we refer to Embedding
Theorem 3.5.6 and Extension Theorem 3.5.7 in order to extend computable
maps to computable enumeration operators.
A popular realizability model is Kleene-Vesley function realizability [18], [18]: Kleene et al. (1965), The foundations
also known as Type Two Effectivity (TTE) [6, 39]. As the names say, it is of intuitionistic mathematics. Especially in
relation to recursive functions.
the model of realizability based on functions and type 2 machines.
[6]: Brattka et al. (2021), Handbook of Com-
TTE is traditionally expressed as a theory of representations. There are putability and Complexity in Analysis
[39]: Weihrauch (2000), Computable Anal-
actuallly three variations:
ysis
1. Rep(𝔹 , 𝔹) is the continuous version in which maps are realized by
continuous realizers.
2. Rep(𝔹 , 𝔹# ) is the relative version.
3. Rep(𝔹# , 𝔹# ) is the computable version in which all realizers must be
computable.
Mostly only the first two of these are used. Sometimes multi-valued
representations are considered also, and for these we need to move to
the larger category of assemblies Asm(𝔹 , 𝔹# ).
Specifically, a representation (𝑆, 𝛿 𝑆 ) over the Baire space is a partial
surjection 𝛿 𝑆 : 𝔹 → 𝑆 . When 𝛿 𝑆 (𝛼) = 𝑥 we say that 𝛼 is a 𝛿 𝑆 -name
of 𝑥 . A (continuously) realized map 𝑓 : (𝑆, 𝛿 𝑆 ) → (𝑇, 𝛿𝑇 ) is a map
𝑓 : 𝑆 → 𝑇 for which there exists a partial continuous map 𝑔 : 𝔹 ⇀ 𝔹
such that 𝑓 (𝛿 𝑆 (𝛼)) = 𝛿𝑇 (𝑔(𝛼)) for all 𝛼 ∈ dom(𝛿 𝑆 ). If the realizer 𝑔 is
computable we say that 𝑓 is computably realized. Recall that a computable
3 Realizability categories 61
ℎ? /𝔹
𝔹
𝑔
𝛿𝑋 𝛿𝑌
𝑋 /𝑌
𝑓
𝛿 / (𝔹 , 𝔹 )
(ℙ , ℙ# ) o #
𝜄
where
𝜄 𝛼 = { ⌜ 𝑎 ⌝ | 𝑎 ∈ ℕ ∗ ∧ 𝑎 ⊑ 𝛼}
and
𝛿[𝐴] = {𝛼 ∈ 𝔹 | 𝐴 = {𝑛 ∈ ℕ | ∃𝑘 ∈ ℕ . 𝛼 𝑘 = 𝑛 + 1}}.
The induced functors b𝜄 and b𝛿 give an adjunction between equilogical
spaces and TTE, see [3] for details. [3]: Bauer (2002), “A Relationship be-
tween Equilogical Spaces and Type Two
Effectivity”
𝑈
𝑓 𝑔
ℎ
𝑆o 𝑝1
𝑃 𝑝2
/𝑇
𝑝1 ◦ ℎ ◦ 𝑘 = 𝑞1 ◦ 𝑘 = 𝑝1 and 𝑝2 ◦ ℎ ◦ 𝑘 = 𝑞2 ◦ 𝑘 = 𝑝2 .
3 Realizability categories 63
u ⊩𝑈 𝑢 =⇒ f u ⊩𝑆 𝑓 𝑢 ∧ g u ⊩𝑇 𝑔 𝑢
=⇒ pair (f u) (g u) ⊩𝑆×𝑇 ( 𝑓 𝑢, 𝑔 𝑢)
⇐⇒ h u ⊩𝑆×𝑇 ℎ(𝑢).
𝑓
𝐸O
𝑒 /𝑆 // 𝑇
? 𝑔
𝑖
𝑘
where x ⊩𝐸 𝑥 if, and only if, x ⊩𝑆 𝑥 . The map 𝑒 : |𝐸| → |𝑆| is the
subset inclusion, 𝑒(𝑥) = 𝑥 . It is realized by ⟨𝑥 ∥𝑆∥ ⟩ 𝑥 . Clearly, 𝑒 equalizes 𝑓
and 𝑔 .
Exercise 3.6.2 Verify that the above alleged equalizer has the correct
universal property.
𝑄
𝑞1
𝑖
𝑝1
𝑃 /𝑆
𝑞2
𝑝2 𝑓
𝑇 /𝑈
𝑔
Proposition 3.6.3 The categories Asm(𝔸 , 𝔸′) and Mod(𝔸 , 𝔸′) are cartesian.
Read this as “if 𝑒 is of the form 𝜄 1 (𝑥) then 𝑒1 , else if 𝑒 is of the form 𝜄 2 (𝑦)
then 𝑒2 ”. The variables 𝑥 and 𝑦 are bound in 𝑒1 and 𝑒2 , respectively. The
definition of 𝑓 above would be written as
𝑓 𝑢 = case 𝑢 of
𝜄1 (𝑥) ↦→ 𝑓1 (𝑥)
𝜄2 (𝑦) ↦→ 𝑓2 (𝑦).
We shall use this notation. Let us mention that in Haskell 𝜄 1 and 𝜄 2 are
called Left and Right, respectively.
In a general category a (binary) coproduct of objects 𝑆 and 𝑇 is an object 𝐶
with morphisms 𝜄 1 : 𝑆 → 𝐶 and 𝜄 2 : 𝑇 → 𝐶 such that, for all morphisms
𝑓 : 𝑆 → 𝑈 and 𝑔 : 𝑇 → 𝑈 there exists a unique ℎ : 𝐶 → 𝑈 such that the
following diagram commutes:
? 𝑈O _
𝑓 𝑔
ℎ
𝑆 /𝐶o 𝑇
𝜄1 𝜄2
Notice that we have exactly reversed all the morphisms with respect to
the definition of products. We write the coproduct of 𝑆 and 𝑇 as 𝑆 + 𝑇
when it is given as an operation, and the unique morphism ℎ as [ 𝑓 , 𝑔].
Whether assemblies Asm(𝔸 , 𝔸′) have binary coproducts is an interesting
question. The answer seems to depend on the structure of the underlying
tpcas.
left𝑠,𝑡 ∈ 𝔸𝑠→(𝑠+𝑡)
right𝑠,𝑡 ∈ 𝔸𝑡→(𝑠+𝑡)
case𝑠,𝑡,𝑢 ∈ 𝔸(𝑠+𝑡)→(𝑠→𝑢)→(𝑡→𝑢)→𝑢
left𝑠,𝑡 𝑥↓,
right𝑠,𝑡 𝑦↓,
case𝑠,𝑡,𝑢 (left𝑠,𝑡 𝑥) 𝑓 𝑔 ⪰ 𝑓 𝑥,
case𝑠,𝑡,𝑢 (right𝑠,𝑡 𝑦) 𝑓 𝑔 ⪰ 𝑔 𝑦.
We say that the elements left, right, and case are suitable for sums
when they satisfy these properties.
A sub-tpca with sums is a sub-tpca 𝔸′ of 𝔸 such that there exists left,
right, case in 𝔸′ suitable for sums in 𝔸.
Proof. Suppose first that 𝔸 has sums and that 𝔸′ is a sub-tpca with sums.
3 Realizability categories 67
𝑠 + 𝑡 = ∥𝐴 𝑠 + 𝐴𝑡 ∥.
case𝑠,𝑡,𝑢 ∈ 𝔸′(𝑠+𝑡)→(𝑠→𝑢)→(𝑡→𝑢)→𝑢
which realizes ℎ . We claim that left𝑠,𝑡 , right𝑠,𝑡 , and case𝑠,𝑡,𝑢 have the
desired properties. It is obvious that left𝑠,𝑡 𝑥↓ and right𝑠,𝑡 𝑦↓ for all
𝑥 ∈ 𝔸𝑠 , 𝑦 ∈ 𝔸𝑡 . Next, because case𝑠,𝑡,𝑢 realizes ℎ , left𝑠,𝑡 realizes 𝜄1 , and
ℎ(𝜄1 (𝑥)) = 𝑎 𝑥 , we have case𝑠,𝑡,𝑢 (left𝑠,𝑡 𝑥) = 𝑎 𝑥 , therefore
case𝑠,𝑡,𝑢 (left𝑠,𝑡 𝑥) 𝑓 𝑔 ≃ 𝑎 𝑥 𝑓 𝑔 ≃ 𝑓 𝑥
The obvious question to ask is when a tpca has sums. We do not know
whether there is a tpca without sums, and we do not explore the question
further. We satisfying ourselves with a sufficient condition that covers
the instances we care about.
Definition 3.6.6 A tpca 𝔸 has booleans when there is a type bool, and
for each type 𝑡 elements
Proposition 3.6.7 A tpca 𝔸 has sums if, and only if, it has booleans.
Furthermore, a sub-tpca 𝔸′ is a sub-tpca with sums if, and only if, it is a
sub-tpca with booleans.
bool = 𝑜 + 𝑜,
true = left 𝜔 𝑜 ,
false = right 𝜔 𝑜
if𝑡 = ⟨𝑏 bool ⟩ ⟨𝑥 𝑡 ⟩ ⟨𝑦 𝑡 ⟩ case𝑜,𝑡,𝑡 𝑏 (K𝑜,𝑡 𝑥) (K𝑜,𝑡 𝑦)
It is easy to check that these satisfy the conditions from Definition 3.6.6.
Conversely, suppose 𝔸 has booleans, and let 𝑠 , 𝑡 , and 𝑢 be types. There
exist 𝜔 𝑠 ∈ 𝔸𝑠 and 𝜔𝑡 ∈ 𝔸𝑡 . Define
𝑠 + 𝑡 = bool × (𝑠 × 𝑡)
left𝑠,𝑡 = ⟨𝑥 𝑠 ⟩ pair true (pair 𝑥 𝜔𝑡 )
right𝑠,𝑡 = ⟨𝑦 𝑡 ⟩ pair false (pair 𝜔 𝑠 𝑦)
case𝑠,𝑡,𝑢 = ⟨𝑧 𝑠+𝑡 ⟩ ⟨ 𝑓 𝑠→𝑢 ⟩ ⟨𝑔 𝑠→𝑢 ⟩
if (fst 𝑧) ( 𝑓 (fst (fst 𝑧))) (𝑔 (snd (fst 𝑧)))
bool = nat ,
false = 0 ,
true = 1 ,
if𝑡 = ⟨𝑏 bool ⟩ ⟨𝑥 𝑡 ⟩ ⟨𝑦 𝑡 ⟩ rec𝑡 𝑦 (⟨𝑛 nat ⟩ ⟨𝑧 𝑡 ⟩ 𝑥) 𝑏
The other finite colimits are more easily dealt with. The initial object is
the empty assembly
0 = (∅, 𝑜, ⊩0 )
where 𝑜 is any type.9 Its universal property is that there is exactly one 9: We need not specify ⊩0 because there
morphism 0 → 𝑆 for every assembly 𝑆 . The property holds because there is only one relation between 𝔸𝑜 and ∅.
𝑓 𝑞
𝑆 // 𝑇 /𝑄
𝑔
𝑖
𝑘
𝐾
y ⊩𝑋 [𝑧]≡ ⇐⇒ ∃𝑦 ∈ 𝑇. y ⊩𝑇 𝑦 ∧ 𝑦 ≡ 𝑧.
Proposition 3.6.11 Asm(𝔸 , 𝔸′) is cocartesian10 if, and only if, 𝔸 is a tpca 10: A category is cocartesian or finitely
with sums and 𝔸′ a sub-tpca with sums. cocomplete if it has finite colimits.
Proof. Coequalizers and the initial object always exist. Therefore, all finite
colimits exist, provided binary coproducts do. By Proposition 3.6.5 this
is equivalent to the condition that 𝔸 have sums and 𝔸′ be a sub-tpca
with sums.
Proposition 3.6.12 A morphism in Asm(𝔸 , 𝔸′) is mono if, and only if, it is
mono as a map in Set, and likewise for epis.
𝑝 ⊩𝑈 𝑢 ⇐⇒ fst 𝑝 ⊩𝑆 𝑓 𝑢 ∧ snd 𝑝 ⊩𝑆 𝑔 𝑢.
The maps 𝑔 and ℎ are morphisms from 𝑈 to 𝑆 because they are realized
by fst and snd, respectively. Since 𝑓 is mono as a morphism of assemblies,
it follows that 𝑔 = ℎ .
Next we consider epis. Again, it is easy to see that a morphism 𝑓 : 𝑆 → 𝑇
is epi if it is epi in Set. Conversely, suppose 𝑓 is epi in Asm(𝔸 , 𝔸′) and
consider maps 𝑔, ℎ : 𝑇 → 𝑈 in Set such that 𝑔 ◦ 𝑓 = ℎ ◦ 𝑓 . The maps 𝑔
and ℎ are morphisms 𝑇 → ∇𝑈 because they are both trivially realized.
Since 𝑓 is epi in Asm(𝔸 , 𝔸′), we may cancel it and obtain 𝑔 = ℎ . This
shows that 𝑓 is epi in Set.
Proof. This follows directly from Proposition 3.6.12 and the fact that in
Set an epi-mono is the same thing as a bijection.
3 Realizability categories 71
𝑇 ′ = {𝑥 ∈ 𝑇 | 𝑔 𝑥 = ℎ(𝑥)}.
We repeat the story for regular epis, which are those morphisms that are
coequalizers. They are the well behaved epis which can be thought of as
quotient maps. In fact, if 𝑓 : 𝑆 → 𝑇 is a regular epi, we say that 𝑇 is a
quotient of 𝑆 .
The match between regular epis and quotients is precise in Asm(𝔸 , 𝔸′).
Note that that in the construction of coequalizers, as described above,
we may start with an arbitrary equivalence relation: given an assembly
𝑇 and an equivalence relation ≡ on 𝑇 , define the quotient assembly
𝑇/≡ = (𝑇/≡, ∥𝑇 ∥, ⊩𝑇/≡ ) whose realizability relation satisfies x ⊩𝑇/≡ [𝑦]
if, and only if, x ⊩𝑇 𝑥 and 𝑥 ≡ 𝑦 for some 𝑥 ∈ 𝑇 . The quotient map
𝑞 : 𝑇 → 𝑇/≡ is realized by ⟨𝑥 ∥𝑇 ∥ ⟩ 𝑥 , and is a coequalizer of 𝑔, ℎ : 𝑉 → 𝑇
where11 11: You should convince yourself that 𝑉
is the kernel pair of 𝑞 , i.e., the pullback
of 𝑞 with itself.
𝑉 = ({(𝑥, 𝑦) ∈ 𝑇 × 𝑇 | 𝑥 ≡ 𝑦}, ∥𝑇 ∥ × ∥𝑇 ∥, ⊩𝑉 ),
𝑝 ⊩𝑉 (𝑥, 𝑦) ⇐⇒ fst 𝑝 ⊩𝑇 𝑥 ∧ snd 𝑝 ⊩𝑇 𝑦,
𝑔(𝑥, 𝑦) = 𝑥,
ℎ(𝑥, 𝑦) = 𝑦.
Every regular epi is isomorphic to one of this form. To see this, suppose
𝑓 : 𝑇 → 𝑈 is a coequalizer of 𝑔, ℎ : 𝑈 → 𝑇 . Let ≡ be the least equivalence
relation on 𝑇 such that 𝑔 𝑥 = ℎ(𝑥) for all 𝑥 ∈ 𝑈 . Then 𝑓 is isomorphic
to 𝑞 : 𝑇 → 𝑇/≡ because 𝑔 : 𝑇 → 𝑇/≡ is the coequalizer of 𝑔 and ℎ
according to Subsection 3.6.2.
There is another characterization of regular epis which is used often.
𝑥 ≡ 𝑦 ⇐⇒ 𝑓 𝑥 = 𝑓 (𝑦).
𝑓
𝑆 /𝑇
?
𝑞 𝑖
𝑈 /𝑉
𝑏
𝑓
𝑆 /𝑇
>G
𝑞 𝑖
𝑏 /𝑉
𝑞′ 𝑈 𝑖′
𝑗 𝑘
𝑈′ / 𝑉′
𝑏′
Proposition 3.6.16 The category Asm(𝔸 , 𝔸′) is regular which means that
1. it is cartesian,
2. every morphism can be factored as a composition of a regular epi and a
mono, and
3. the pullback of a regular epi is a regular epi.
Proof. The first item was proved in Proposition 3.6.3. For the second item,
take the above factorization 𝑓 = 𝑖 ◦ 𝑏 ◦ 𝑞 and notice that 𝑞 is a regular epi
and 𝑖 ◦ 𝑏 a mono. Lastly, suppose 𝑞 : 𝑇 → 𝑇/≡ is a regular epi, where we
assumed without loss of generality that it is a quotient by an equivalence
relation. Let 𝑓 : 𝑆 → 𝑇/≡ be realized by f ∈ 𝔸′∥𝑆∥→∥𝑇 ∥ . The pullback of 𝑞
is the map 𝑟 : 𝑃 → 𝑆 , as in the diagram
𝑃 /𝑇
𝑟 𝑞
𝑆 / 𝑇/≡
𝑓
where
𝑃 = ({(𝑥, 𝑦) ∈ 𝑆 × 𝑇 | 𝑓 𝑥 ≡ 𝑦}, ∥𝑆∥ × ∥𝑇 ∥, ⊩𝑃 ),
pair x y ⊩𝑃 (𝑥, 𝑦) if, and only if, x ⊩𝑆 𝑥 and y ⊩𝑇 𝑦 and 𝑟 : (𝑥, 𝑦) ↦→ 𝑥 .
Let us use Proposition 3.6.15 to show that 𝑟 is regular epi. The realizer
i = ⟨𝑥 ∥𝑆∥ ⟩ pair 𝑥 (f 𝑥) satisfies the conditions of the proposition: if 𝑥 ∈ 𝑆
and x ⊩𝑆 𝑥 then i x = pair x (f x) is defined. There is 𝑦 ∈ 𝑇 such that
𝑓 𝑥 = [𝑦]≡ , hence 𝑟(𝑥, 𝑦) = 𝑥 , and also i x ⊩𝑃 (𝑥, 𝑦).
If 𝑆 and 𝑇 are objects in a category, we may form the set Hom (𝑆, 𝑇)
of morphisms with domain 𝑆 and codomain 𝑇 . Sometimes Hom (𝑆, 𝑇)
carries additional structure that turns it into an object of the category. For
example, in the category of partially ordered sets and monotone maps,
the set Hom (𝑃, 𝑄) of monotone maps between (𝑃, ≤𝑃 ) and (𝑄, ≤𝑄 ) is
partially ordered by 𝑓 ≤ 𝑔 ⇔ ∀𝑥. 𝑃 𝑓 𝑥 ≤𝑄 𝑔 𝑥 . The following definition
explains what it means for an object to correspond to the the set of
morphisms.
3 Realizability categories 75
𝐸 ×O 𝑆
𝑒
𝑓ˆ×id𝑆
"
𝑈 ×𝑆 /𝑇
𝑓
𝑇 𝑆 = { 𝑓 | 𝑓 is a function from 𝑆 to 𝑇}
Proposition 3.6.18 The categories Asm(𝔸 , 𝔸′) and Mod(𝔸 , 𝔸′) are carte-
sian closed.
Proof. We prove that Asm(𝔸 , 𝔸′) has exponentials. The same construction
works for modest sets. Suppose 𝑆 and 𝑇 are assemblies. Define the
assembly
where
Currying and uncurrying are useful operations, but the above notation
with “hats and checks” is not very practical. We may take better advantage
of the cartesian closed structure of Asm(𝔸 , 𝔸′) by interpreting the 𝜆-
calculus in it. The types of the 𝜆-calculus are the assemblies, where the
product and function types are interpreted as products and exponentials
of assemblies, respectively. The unit type is the terminal assembly 1.
The expressions are those of the 𝜆-calculus, except that we write the
projections as 𝜋1 and 𝜋2 instead of fst and snd, respectively. In addition
if 𝑇 is an assembly and 𝑎 ∈ 𝑇 is an element for which there exits a realizer
a ∈ 𝔸′∥𝑇 ∥ then 𝑎 is a primitive constant of type 𝑇 .
Suppose 𝑒 is an expression of type 𝑇 and the freely occurring variables
𝑆
of 𝑒 are among 𝑥 1𝑆1 , . . . , 𝑥 𝑛 𝑛 . We prefer to write the list of variables as
𝑥1 : 𝑆1 , . . . , 𝑥 𝑛 : 𝑆𝑛 , which we abbreviate as 𝑥 : 𝑆 , and call it a typing
context for 𝑒 . The expression with the typing context determines a
realized map
[[𝑥 : 𝑆 | 𝑒 : 𝑇]] : 𝑆1 × · · · × 𝑆𝑛 → 𝑇,
which we abbreviate to [[𝑒]] when no confusion may arise. We define
the meaning of [[𝑒]] inductively on the structure of 𝑒 as follows, where
𝑎 = (𝑎1 , . . . , 𝑎 𝑛 ) ∈ 𝑆1 × · · · × 𝑆𝑛 :
1. A primitive constant 𝑏 ∈ 𝑇 which is realized by b ∈ 𝔸′∥𝑇 ∥ is
interpreted as the constant map
[[𝑥 : 𝑆 | 𝑏 : 𝑇]](𝑎) = 𝑏,
[[𝑒]] 𝜋1
𝑆1 × · · · × 𝑆 𝑛 / 𝑇 ×𝑈 /𝑇
[[· | 𝑒 : 1 → 𝑇]]
instead of
𝑓 𝑥1 . . . 𝑥 𝑛 = 𝑒
instead of
𝑓 = 𝜆𝑥 1 . . . 𝑥 𝑛 . 𝑒.
When Asm(𝔸 , 𝔸′) has coproducts, and in most cases of interest it does,
the 𝜆-calculus may be extended further to encompass binary sums. If
𝑆 and 𝑇 are assemblies, viewed as types, then we have the following
expressions:
1. If 𝑒 is an expressions of type 𝑆 then 𝜄 1𝑆,𝑇 (𝑒) is an expression of type
3 Realizability categories 78
[[𝑒]] 𝜄1
𝑆1 × · · · × 𝑆 𝑛 /𝑆 / 𝑆+𝑇
(𝑆 + 𝑇) × 𝑈 𝑆 × 𝑈 + 𝑇 × 𝑈.
Let us use the 𝜆-calculus to write down the isomorphisms explicitly. The
isomorphism from left to right is
We compute
and
This proof works in any cartesian closed category with binary coproducts.
In particular, it works in Asm(𝔸 , 𝔸′). Notice how we need not worry about
the underlying realizers for the isomorphisms 𝑓 and 𝑔 . You are invited to
redo the proof by drawing the relevant commutative diagrams and using
the universal properties of products, coproducts, and exponentials.
?𝐴
𝑓
𝑒
𝐵 /𝑃
𝑓
We say that 𝑃 has the lifting property with respect to morphisms, be-
cause every 𝑓 “lifts“ to 𝑓 , as in the diagram.13 Which assemblies are 13: In a general category an object is
projective? called projective if it has the lifting prop-
erty with respect to all epis, and regular
projective if it has the liftiing property
Definition 3.6.19 An assembly 𝑆 is partitioned if each element has with respect to regular epis. However, we
are only interested in the regular pro-
precisely one realizer: if 𝑟 ⊩𝑆 𝑥 and 𝑟 ⊩𝑆 𝑦 then 𝑥 = 𝑦 .
jective objects, so we drop the qualifier
“regular”.
The following notion is useful when one has to compute with concrete
realizers.
Proof. To show that the first statement implies the second one, let 𝑆 be a
projective assembly and 𝑒 : 𝑃 → 𝑆 the regular epimorphism constructed
in Proposition 3.6.21. Because 𝑆 is projective, id𝑆 lifts along 𝑒 to an
assembly map 𝑑 : 𝑆 → 𝑃 such that 𝑒 ◦ 𝑑 = id𝑆 , hence 𝑒 is split.
If the canonical cover 𝑒 : 𝑃 → 𝑆 is split by 𝑑 : 𝑆 → 𝑃 then any realizer
of 𝑑 computes canonical realiers for 𝑆 .
If c computes canonical realizers for 𝑆 then 𝑆 is isomorphic to the
partitioned assembly 𝑄 , defined by |𝑄 | = |𝑆| , ∥𝑄 ∥ = ∥𝑆∥ and
y ⊩𝑄 𝑥 ⇐⇒ ∃x ∈ ∥𝑆∥. x ⊩𝑆 𝑥 ∧ y = c x.
3 Realizability categories 81
Finally, the fourth statement implies the first one because projectivity is
preserved by isomorphism and partitioned assemblies are projective by
Proposition 3.6.20.
Exercise 3.6.25 Show that the full subcategory on the projective modest
sets is equivalent to the category of sets of realizers, whose objects are
pairs (|𝑆|, ∥𝑆∥) where ∥𝑆∥ is a type and |𝑆| ⊆ 𝔸 ∥𝑆∥ . A morphism
𝑓 : (|𝑆|, ∥𝑆∥) → (|𝑇 |, ∥𝑇 ∥) is a map 𝑓 : |𝑆| → |𝑇 | that has a realizer
f ∈ 𝔸′∥𝑆∥→∥𝑇 ∥ satisfying f x↓ and f x ∈ |𝑇 | for all x ∈ |𝑆| .
Realizability and logic 4
The idea that the elements of a set are represented by values of a datatype
is familiar to programmers. In the previous chapter we expressed the
idea mathematically in terms of realizability relations and assemblies.
Programmers are less aware of, but still use, the fact that realizability
carries over to logic as well: a logical statement can be validated by
realizers.
Let us first recall how the usual interpretation of classical first-order logic
works. A predicate on a set 𝑆 is a Boolean function 𝑆 → 2, where 2 = {⊥, ⊤}
is the Boolean algebra on two elements. The Boolean algebra structure
carries over from 2 to predicates, e.g., the conjunction of 𝑝, 𝑞 : 𝑆 → 2 is
computed element-wise as
(𝑝 ∧ 𝑞)𝑥 = 𝑝𝑥 ∧ 𝑞𝑥,
and similarly for other predicates. With this much structure we can
interpret the propositional calculus. The quantifiers ∃ and ∀ can be
interpreted too, because 2 is complete: given a predicate 𝑝 : 𝑆 × 𝑇 → 2,
define ∃𝑆 𝑝 : 𝑇 → 2 and ∀𝑆 𝑝 : 𝑇 → 2 by
_ ^
(∃𝑆 𝑝)𝑦 = 𝑥∈𝑆
𝑝(𝑥, 𝑦) and (∀𝑆 𝑝)𝑦 = 𝑥∈𝑆
𝑝(𝑥, 𝑦).
?𝑆_
𝑢 𝑡
?
𝑈 /𝑇
𝑓
commutes. Such an 𝑓 is unique if it exists and is a mono.1 If 𝑢 ≤ 𝑡 and 1: Such basic category-theoretic observa-
𝑡 ≤ 𝑢 we say that 𝑢 and 𝑡 are isomorphic and write 𝑢 ≡ 𝑡 . The induced tions are excellent exercises. You should
prove them yourself.
4 Realizability and logic 83
|𝑆 𝑝 | = {𝑥 ∈ |𝑆| | ∃r ∈ 𝔸 ∥𝑝 ∥ . r ∈ 𝑝𝑥},
∥𝑆 𝑝 ∥ = ∥𝑆∥ × ∥𝑝 ∥,
𝑞 ⊩𝑆𝑝 𝑥 ⇐⇒ fst 𝑞 ⊩𝑆 𝑥 ∧ snd 𝑞 ⊩ 𝑝𝑥.
r ⊩ 𝑝 𝑢 𝑥 ⇐⇒ ∃𝑦 ∈ 𝑈. 𝑢 𝑦 = 𝑥 ∧ y ⊩𝑈 𝑦.
⊥𝑥 = ∅ and ⊤𝑥 = 𝔸unit .
r ⊩ (𝑝 ∧ 𝑞) 𝑥 ⇐⇒ fst r ⊩ 𝑝 ∧ snd r ⊩ 𝑞.
That is, r maps realizers for 𝑝𝑥 to realizers for 𝑞𝑥 . Note that r ∈ 𝔸 ∥𝑝 ∥→∥𝑞 ∥
and not u ∈ 𝔸′∥𝑝∥→∥𝑞∥ , so we have an example of entailment ⊢ and
implication ⇒ not “being the same thing” (about which students of logic
often wonder about).
4.4 Quantifiers
𝑈 ≤ 𝑉 × 𝑇 ⇐⇒ ∃𝑇 𝑈 ≤ 𝑉.
𝑉 × 𝑇 ≤ 𝑈 ⇐⇒ 𝑉 ≤ ∀𝑇 𝑈.
From the above adjunctions the usual laws of inference for the existential
and universal quantifiers follow. We verify that such adjoints for the
Heyting prealgebras of realizability predicates.
Weakening along 𝜋1 : 𝑆 × 𝑇 → 𝑆 takes 𝑝 ∈ Pred(𝑆) to the predicate
𝑝 × 𝑇 ∈ Pred(𝑆 × 𝑇) defined by
Exercise 4.4.1 Show that the usual inference rules for quantifiers follow
form them being adjoint to weakneing.
4.5 Substitution
We have so far ignored the most basic logical operation of all, which is
substitution. Terms may be substituted into terms and into formulas.
Substitution of terms into terms is interpreted as composition. Think of a
term 𝑠(𝑥) of type 𝑆 with a free variable 𝑥 of type 𝑇 as a map 𝑠 : 𝑇 → 𝑆 .
Given 𝑡 : 𝑈 → 𝑇 , construed as a term 𝑡(𝑦) of type 𝑇 with a free variable 𝑦
of type 𝑈 , the substitution of 𝑡(𝑦) for 𝑥 in 𝑠(𝑥) yields 𝑠(𝑡(𝑦)), which is
just (𝑠 ◦ 𝑡)(𝑦), so 𝑠 ◦ 𝑡 : 𝑈 → 𝑆 .
Substitution of terms into predicates corresponds to composition too,
by an analogous argument. Think about how it works in Set. Given a
predicate 𝑝 : 𝑇 → 2 on a set 𝑆 and a term 𝑡 : 𝑆 → 𝑇 , the composition
𝑝 ◦ 𝑡 : 𝑆 → 2 corresponds to substituting 𝑡 into 𝑝 . Indeed, if we replace 𝑦
with 𝑡(𝑥) in the formula 𝑝(𝑥) we obtain 𝑝(𝑡(𝑦)), which is just (𝑝 ◦ 𝑡)(𝑦).
Exercise 4.5.1 You may have heard the slogan “substitution is pullback”.
Explain how the slogan arises when predicates are viewed as subsets,
rather than maps into 2
𝑡∗ 𝑠 = 𝑠 ◦ 𝑡 : 𝑈 → 𝑆 and 𝑡 ∗ 𝑝 = 𝑝 ◦ 𝑡 ∈ Pred(𝑈).
We still have some work to do, namely check that substitution is functorial
and that it commutes with the logical connective and the quantifiers.
The former guarantees that the identity substitution and compositions
of substitutions act in the expected way, and the latter that substituting
preserves the logical structure of a formula. Functoriality means that
from (the opposite category of) assemblies to the category of Heyting prealge-
bras. Moreover, substitution preserves the quantifiers.
𝑡 ∗ ⊤ = ⊤,
𝑡 ∗ ⊥ = ⊥,
𝑡 ∗ (𝑝 ∧ 𝑞) = 𝑡 ∗ 𝑝 ∧ 𝑡 ∗ 𝑞,
𝑡 ∗ (𝑝 ∨ 𝑞) = 𝑡 ∗ 𝑝 ∨ 𝑡 ∗ 𝑞,
𝑡 ∗ (𝑝 ⇒ 𝑞) = 𝑡 ∗ 𝑝 ⇒ 𝑡 ∗ 𝑞.
These hold because they are defined pointwise. For instance, given
𝑝, 𝑞 ∈ Pred(𝑇), define ∧′ : P(𝔸 ∥𝑝 ∥ ) × P(𝔸 ∥𝑞∥ ) → P(𝔸 ∥𝑝 ∥×∥𝑞∥ ) by
𝑡 ∗ (𝑝 ∧ 𝑞) = ∧′ ◦ ⟨𝑝, 𝑞⟩ ◦ 𝑡 = ∧′ ◦ ⟨𝑝 ◦ 𝑡, 𝑞 ◦ 𝑡⟩ = 𝑡 ∗ 𝑝 ∧ 𝑡 ∗ 𝑞.
𝑡 ∗ (∃𝑇 𝑝) = ∃𝑇 (𝑡 ∗ 𝑝),
𝑡 ∗ (∀𝑇 𝑝) = ∀𝑇 (𝑡 ∗ 𝑝).
4.6 Equality
★ ⊩ eq(𝑥, 𝑦) ⇐⇒ 𝑥 = 𝑦.
4 Realizability and logic 88
∥⊥∥ = unit ,
∥⊤∥ = unit ,
∥𝑠 = 𝑡 ∥ = unit ,
∥𝑝 ∧ 𝑞 ∥ = ∥𝑝 ∥ × ∥𝑞 ∥,
∥𝑝 ∨ 𝑞 ∥ = ∥𝑝 ∥ + ∥𝑞 ∥,
∥𝑝 ⇒ 𝑞 ∥ = ∥𝑝 ∥ → ∥𝑞 ∥.
∥∀𝑥 ∈ 𝑇. 𝑟(𝑥, −)∥ = ∥𝑇 ∥ → ∥𝑟 ∥,
∥∃𝑥 ∈ 𝑇. 𝑟(𝑥, −)∥ = ∥𝑇 ∥ × ∥𝑟 ∥.
𝑠, 𝑡 ∈ |𝑆| :
r⊩⊥⇔⊥
r⊩⊤⇔⊤
r⊩ 𝑠 =𝑡 ⇔ 𝑠 =𝑡∧r=★
r ⊩ 𝑝𝑥 ∧ 𝑞𝑥 ⇔ fst r ⊩ 𝑝 ∧ fst r ⊩ 𝑞
r ⊩ 𝑝𝑥 ∨ 𝑞𝑥 ⇔ (∃u. r = left u ∧ u ⊩ 𝑝𝑥) ∨
(∃v. r = right v ∧ v ⊩ 𝑞𝑥).
r ⊩ (𝑝 ⇒ 𝑞) ⇔ ∀s ∈ 𝔸 ∥𝑝∥ . s ⊩ 𝑝 ⇒ r s ⊩ 𝑞
r ⊩ ∃𝑦 ∈ 𝑇. 𝑝(𝑥, 𝑦) ⇔ ∃𝑦 ∈ |𝑇 |. fst r ⊩𝑇 𝑦 ∧ snd r ⊩ 𝑝(𝑥, 𝑦)
r ⊩ ∀𝑦 ∈ 𝑇. 𝑝(𝑥, 𝑦) ⇔ ∀𝑦 ∈ |𝑇 |. ∀y. y ⊩𝑇 𝑦 ⇒ r y ⊩ 𝑞(𝑥, 𝑦).
Proof. We already proved the theorem when we checked that the pred-
icates form Heyting prealgebras and that the quantifiers validate the
desired inference rules.
A formula 𝜙 is classical4 or ¬¬-stable when ¬¬𝜙 ⇒ 𝜙 . (We do not 4: The terminology is non-standard but
require 𝜙 ⇒ ¬¬𝜙 because it holds anyway.) is vindicated below by the fact that ∇2
classifies the classical predicates. In any
case, almost any terminology seems bet-
Proposition 4.8.1 A predicate 𝑝 ∈ Pred(𝑆) is classical if, and only if, there ter than “¬¬-stable”.
exists q ∈ 𝔸′∥𝑆∥→∥𝑝 ∥ such that, if x ⊩𝑆 𝑥 and 𝑝𝑥 ≠ ∅ then q x ⊩ 𝑝𝑥 .
Show that these preorders are equivalent, and hence complete Boolean
algebras. For extra credit, explain in what sense the equivalence is
functorial.
witnesses ⊤ ⊢ 𝑝 ∨ ¬𝑝 .
⊤ ⊢ ∀𝑥 ∈ 𝑆. 𝑝𝑥 ⇔ 𝑐𝑥 = 1
The map 𝑓𝑝 is realized because every map into a constant assembly is.
We claim that 𝑓 ↦→ 𝑝 𝑓 and 𝑝 ↦→ 𝑓𝑝 form a bijective correspondence. It is
easy to check that 𝑓 = 𝑓𝑝 𝑓 for all 𝑓 : 𝑆 → ∇2. For the other direction, we
need to show that a classical 𝑝 ∈ Pred(𝑆) satisfies 𝑝 ⊣⊢ 𝑝 𝑓𝑝 . One direction
is easy, and other one not much harder with the help of Proposition 4.8.1.
It remains to be checked that 𝟚 classifies the decidable predicates. The
hard part of the proof was already done in Proposition 4.8.7, and we
leave the rest as an exercise.
4 Realizability and logic 92
The law of excluded middle states that all predicates are decidable. It is
never realized.
The law of double negation states that all predicates are classical. Because
it is inter-derivable with excluded middle, it cannot be valid in realizability
logic.
★ ⊩ 𝑞 r 𝑥 ⇐⇒ ∃𝑛 ∈ ℕ . r x 𝑛 = true.
Exercise 4.8.12 Is there a pca 𝔸 such that in Asm(𝔸) the decidable and
semidecidable predicates coincide?
To set the scene, let us review the set-theoretic model of type theory. A
family of sets is a map 𝐴 : 𝐼 → Set from an index set 𝐼 to the class of
all sets. We say that 𝐴 is indexed by 𝐼 or that it is a family over base 𝐼 . Let
Fam (𝐼) be the class of all families indexed by 𝐼 .
Each Fam (𝐼) is a category whose objects are the families indexed by 𝐼 .
A morphism 𝑓 : 𝐴 → 𝐵, where 𝐴, 𝐵 ∈ Fam (𝐼), is a map of families
𝑓 : 𝐴 → 𝐵, which is a family of maps 𝑓𝑖 : 𝐴 𝑖 → 𝐵 𝑖 , parameterized by
𝑖 ∈ 𝐼 . Such maps are composed index-wise.
Exercise 5.1.1 Recall the definition of the slice category Set/𝐼 : an object
is a map 𝑎 : 𝐴 → 𝐼 with codomain 𝐼 , and a morphism a map 𝑓 : 𝐴 → 𝐵
such that 𝑏 ◦ 𝑓 = 𝑎 :
𝑓
𝐴 /𝐵
𝑎 𝑏
𝐼
A map into 𝐼 is called a display map over the base 𝐼 , and its domain
the total space. (The terminology is inspired by a geometric picture of
a bundle over a space.)
For each 𝑖 ∈ 𝐼 we define the fiber of 𝑎 at 𝑖 to be the inverse image
𝑎 ∗ {𝑖} = {𝑥 ∈ 𝐴 | 𝑎𝑥 = 𝑖}. Thus a display map 𝑎 over 𝐼 yields an
𝐼 -indexed family 𝑖 ↦→ 𝑎 ∗ {𝑖} of fibers. Conversely, a family 𝐴 : 𝐼 → Set
determines the display map, namely the first projection Σ𝐼 𝐴 → 𝐼 .
Verify that the passages between Fam (𝐼) and Set/𝐼 constitute an equiv-
alence of categories. As a first step you should determine how the
equivalence acts on morphisms.
Π𝐼 𝐴 = {𝑢 : 𝐼 → 𝐴 𝑖 | ∀𝑖 ∈ 𝐼. 𝑢𝑖 ∈ 𝐴 𝑖 },
S
𝑖∈𝐼
Σ𝐼 𝐴 = {(𝑖, 𝑎) | 𝑖 ∈ 𝐼 ∧ 𝑎 ∈ 𝐴 𝑖 }.
The distinguishing feature of products and sums is that they are adjoint
to reindexing,
Σ𝑟 ⊣ 𝑟 ∗ ⊣ Π𝑟 .
Concretely, the above amounts to having isomorphisms, natural in
𝐴 ∈ Fam (𝐽) and 𝐵 ∈ Fam (𝐼),
and
HomFam (𝐼) (𝐵, Π𝑟 𝐴) HomFam (𝐽) (𝑟 ∗ 𝐵, 𝐴).
We spell out the second isomorphism and leave the first one as an exercise.
Given a map of families 𝑓 : 𝐵 → Π𝑟 𝐴, define 𝑓ˆ : 𝑟 ∗ 𝐵 → 𝐴 by
𝑓ˆ𝑗 𝑥 = 𝑓𝑟 𝑗 𝑥 𝑗, (5.2)
𝑔ˇ 𝑖 𝑥 𝑗 = 𝑔 𝑗 𝑥. (5.3)
Contexts
In type theory the index sets are called contexts. In practice they are
not arbitrary sets (although they can be), but are rather built up by
introduction of new parameters in an inductive fashion:
▶ the empty context is the singleton2 1 = {★}, 2: A family of sets which does not de-
▶ given a context Γ and a family of sets 𝐴 ∈ Fam (Γ), the extended pend on any parameters is just a fixed
set, so an element of Fam (1). If you think
context is the sum ΣΓ 𝐴. the empty context should be ∅, consider
what Fam (∅) is like.
By iterating context extension we obtain a telescope
ΣΣ···ΣΣ 𝐴 𝐴𝑛−1 𝐴 𝑛 .
1 ··· 𝑛−2
𝑥 1 : 𝐴1 , 𝑥 2 : 𝐴2 , . . . , 𝑥 𝑛 : 𝐴 𝑛 .
𝑎 :ℝ , 𝑏 :ℝ , 𝑓 :[𝑎, 𝑏] → ℝ , 𝑀 :ℝ .
However, there are also three hypotheses, namely that 𝑎 < 𝑏 , that 𝑓
is continuous, and that 𝑓 is bounded by 𝑀 . Mathematical tradition
would have us ignore these, because it demands that proofs and logical
statements be considered second-class. Indeed, notice how the text
introduces names 𝑎, 𝑏, 𝑓 , 𝑀 for all the entities except the hypotheses,
and even these notes refer to theorems by mere unmemorable numbers,
as if it were forbidden to name them. The correct context is, written
5 Realizability and type theory 96
𝑎 : ℝ,
𝑏 : ℝ,
𝑝 : (𝑎 < 𝑏),
𝑓 : [𝑎, 𝑏] → ℝ ,
𝑞 : continuous( 𝑓 ),
𝑀 : ℝ,
𝑟 : ∀𝑥 ∈ [𝑎, 𝑏]. 𝑓 (𝑥) ≤ 𝑀
When type theory is used to talk about set theory, we prefer to say type
and type family instead of “set” and “set family”, and write
Γ ⊢ 𝐴 type
for 𝐴 ∈ Fam (Γ). The elements of 𝐴 are its choice maps. We write
Γ⊢𝑡:𝐴
Example 5.1.5 To see why it makes sense to call the choice maps
“elements”, we translate the statement
“(𝑎 + 𝑏)/2 is an element of the closed interval [𝑎, 𝑏].”
to the type-theoretic terminology. First, the text expects us to guess
that 𝑎 and 𝑏 are reals such that 𝑎 < 𝑏 , so the context is
Over this context we define a type family 𝐶 of closed intervals by4 4: Dragging along the argument 𝑝 seems
a little bureaucratic. In practice we would
𝐶(𝑎,𝑏,𝑝) = [𝑎, 𝑏] = {𝑥 ∈ ℝ | 𝑎 ≤ 𝑥 ≤ 𝑏}. of course drop it, and in a proof assistant
we might use one of several mechanisms
that hide it.
The mid-point is map 𝑚 which assigns to each interval its mid-point,
𝑚(𝑎, 𝑏, 𝑝) = (𝑎 + 𝑏)/2, which of course is just a choice map for 𝐶 .
{𝑢 : 𝐴 𝛾 → 𝐵(𝛾,𝑎) | ∀𝑎 ∈ 𝐴 𝛾 . 𝑢𝑎 ∈ 𝐵(𝛾,𝑎) },
S
𝑎∈𝐴 𝛾
The qualifier “uniform” refers to the fact that all the members share
the same underlying type. We drop it because we only ever consider
uniform families. We write Fam𝔸,𝔸′ (𝐼) or just Fam (𝐼) for the collection of
all families of assemblies indexed by 𝐼 . For everything to work out, maps
between families of assemblies have to be uniformly realized.
i ⊩𝐼 𝑖 ∧ x ⊩𝐴𝑖 𝑥 =⇒ f i x ⊩𝐵𝑖 𝑓 𝑥.
The definition endows each Fam (𝐼) with the structure of a category. An
assembly map 𝑟 : 𝐽 → 𝐼 induces a reindexing 𝑟 ∗ : Fam (𝐼) → Fam (𝐽),
defined by
𝑟 ∗ 𝐴 = 𝐴 ◦ 𝑟.
5 Realizability and type theory 98
There is nothing here to be realized, but we shall use realizers for 𝑟 in the
construction of products and sums.
j ⊩𝐽 𝑗 =⇒ u j ⊩𝑆𝑖 𝑢 𝑗.
When this is the case, we write u ⊩(Π𝑟 𝑆)𝑖 𝑢 . Now define the product
Π𝑟 𝑆 ∈ Fam (𝐼) to be the family whose realizability relation at 𝑖 ∈ |𝐼 |
is ⊩(Π𝑟 𝑆)𝑖 and
∥Π𝑟 𝑆∥ = ∥𝐽 ∥ → ∥𝑆∥,
|(Π𝑟 𝑆)𝑖 | = {𝑢 ∈ (Π𝑟 |𝑆|)𝑖 | ∃u ∈ 𝔸 ∥𝐽 ∥→∥𝑆∥ . u ⊩(Π𝑟 𝑆)𝑖 𝑢}.
∥Σ𝑟 𝑆∥ = ∥𝐽 ∥ × ∥𝑆∥,
|(Σ𝑟 𝑆)𝑖 | = (Σ𝑟 |𝑆|)𝑖 ,
r ⊩(Σ𝑟 𝑆)𝑖 (𝑗, 𝑥) ⇔ fst r ⊩𝐽 𝑗 ∧ snd r ⊩𝑆 𝑗 𝑥.
Σ𝑟 ⊣ 𝑟 ∗ ⊣ Π𝑟 .
Half of work has been done in Subsection 5.1.1. You still need to check
that the map of families 𝑓ˆ defined in (5.2) is realized when 𝑓 is realized,
and similarly for 𝑔ˇ defined in (5.3).
Products and sums along arbitrary reindexings are perhaps a bit un-
intuitive. For better understanding we spell out the non-parameterize
sum and products. Given a family 𝑆 ∈ Fam (𝐼), its product Π𝐼 𝑆 is the
assembly
∥Π𝐼 𝑆∥ = ∥𝐼 ∥ → ∥𝑆∥,
|Π𝐼 𝑆| = {𝑢 ∈ Π|𝐼 | |𝑆| | ∃u ∈ 𝔸 ∥𝐼 ∥→∥𝑆∥ . u ⊩Π𝐼 𝑆 𝑢},
u ⊩Π𝐼 𝑆 𝑢 ⇔ ∀𝑖 ∈ |𝐼 |, i ∈ 𝔸 ∥𝐼 ∥ . i ⊩𝐼 𝑖 ⇒ u i ⊩𝑆𝑖 𝑢𝑖.
5 Realizability and type theory 99
∥Σ𝐼 𝑆∥ = ∥𝐼 ∥ × ∥𝑆∥,
|Σ𝐼 𝑆| = Σ|𝐼 | |𝑆|,
r ⊩Σ𝐼 𝑆 (𝑖, 𝑥) ⇔ fst r ⊩𝐼 𝑖 ∧ snd r ⊩𝑆𝑖 𝑥.
Contexts of assemblies are built as iterated sums, the same was as contexts
of sets. Thus a telescope of assemblies
Γ = (𝑥1 : 𝑆1 , . . . , 𝑥 𝑛 : 𝑆𝑛 )
is the assembly
In Example 5.1.4 we placed a hypothesis into the context, but for this
to make sense in needs to be a type family. How can a proposition be a
type?
In classical logic a predicate 𝜙 on a set 𝐴 is a Boolean function 𝜙 : 𝑆 →
{⊥, ⊤}. If we encode the truth values ⊥ and ⊤ with sets, 𝜙 becomes
a family of sets, which is what we want. A choice that works well is
to take ⊥ to be ∅ and ⊤ to be {★}. An even better idea is to allow any
singleton set to represent truth, they are all isomorphic anyhow. We may
do the same with assemblies.
⊥ = 𝟘,
⊤ = 𝟙,
𝑃 ∧ 𝑄 = 𝑃 × 𝑄, (5.4)
𝑃 ⇒ 𝑄 = 𝑃 → 𝑄, ,
∀𝑆 𝑅 = Π𝑆 𝑅.
5 Realizability and type theory 100
For instance, 𝑃 × 𝑄 is inhabited if, and only if, both 𝑃 and 𝑄 are, which
is precisely how conjunction is supposed to be. Similarly, the product
Π𝑆 𝑅 has a choice map only if7 all the assemblies 𝑅𝑥 are inhabited, which 7: We did not say “if and only if” because
again characterizes the universal quantifier. in assemblies choice maps must also be
realized. It is quite possible that there is
Disjunction and the existential quantifier present a bit of a challenge. no realized choice map for a family of
assemblies, even though every one of its
How about
member is inhabited. Even so, Π𝑆 𝑅 satis-
fies the rules of universal quantification,
𝑃∨𝑄 = 𝑃+𝑄 and ∃𝑆 𝑅 = Σ𝑆 𝑅 ? and so can be used as such.
𝑃 ∨ 𝑄 = ∥𝑃 ∨ 𝑄 ∥ ,
(5.5)
∃𝑆 𝑅 = ∥Σ𝑆 𝑅∥ .
𝑃 ∨ 𝑄 = 𝑃 + 𝑄,
∃𝑆 𝑅 = Σ𝑆 𝑅.
This approach is taken in Martin-Löf type theory and goes by the name
propositions as types.
Which definition of ∨ and ∃ should we adopt? Mathematical practice
uses both. The truncated sum ∥Σ𝑆 𝑅∥ is a form of abstract existence because
its element, when it exists, reveals no specific 𝑥 ∈ |𝑆| for which 𝑅𝑥 is
inhabited; whereas Σ𝑆 𝑅 is concrete existence because its elements provide
witnesses. Similarly, ∥𝑃 + 𝑄 ∥ states that one or the other disjunct holds
without revealing which one, whereas an element of 𝑃 + 𝑄 makes a
specific choice of one or the other.
Judicious use of propositional truncation thus makes it possible to
formalize aspects of mathematical practice that are not easily incorporated
into traditional first-order logic, which provides only abstract existence
and disjunction, nor into traditional Martin-Löf type theory, which
provides only concrete existence and disjunction.
Propositional truncation works both for sets and assemblies. The proposi-
tional truncation ∥𝐴∥ of a set 𝐴 is the quotient 𝐴/∼ by the full relation ∼
on 𝐴. The quotient map takes an element 𝑥 ∈ 𝐴 to its equivalence class
5 Realizability and type theory 101
|𝑥| = 𝐴. Thus, if 𝐴 has an element then ∥𝐴∥ = {𝐴} and if 𝐴 is empty then
∥𝐴∥ = ∅. A category theorist would postulate ∥𝐴∥ as the coequalizer
𝜋1
𝐴×𝐴 // 𝐴 |−|
/ / ∥𝐴∥
𝜋2
|−|
𝑆 / ∥𝑆∥
𝑓¯
𝑓
𝑃
Exercise 5.3.3 Verify that the preoder Pred′(𝑆) forms a Heyting preal-
gebra with the operations given by (5.4) and (5.5).
Theorem 5.3.4 The Heyting prealgebras (Pred(𝑆), ⊢) and (Pred′(𝑆), ⊢′) are
equivalent.
5 Realizability and type theory 102
∥𝑃𝑝 ∥ = ∥𝑝∥,
|𝑃𝑝 𝑥| = 1 ,
r ⊩𝑃𝑝 𝑥 ★ ⇔ r ⊩ 𝑝𝑥.
∥𝑝 𝑃 ∥ = ∥𝑃∥,
r ⊩ 𝑝 𝑃 𝑥 ⇔ ∃𝜉 ∈ 𝑃𝑥. r ⊩𝑃𝑥 𝜉.
𝐼 / Fam (𝑆)
Pred(𝑆) o
𝑇
Show that 𝐼 is full and faithful, 𝑇 is its left adjoint, and that 𝐼 ◦ 𝑇
is naturally isomorphic to propositional truncation. How does the
adjunction interact with reindexing?
∥∀𝑟 𝑝 ∥ = ∥𝐽 ∥ → ∥𝑝∥,
u ⊩ (∀𝑟 𝑝)𝑖 ⇔ ∀𝑗 ∈ 𝑟 ∗ {𝑖}. ∀j ∈ ∥𝐽 ∥. j ⊩𝐽 𝑗 ⇒ u j ⊩ 𝑝 𝑗.
∥∃𝑟 𝑝 ∥ = ∥𝐽 ∥ × ∥𝑝 ∥,
r ⊩ (∃𝑟 𝑝)𝑖 ⇔ ∃𝑗 ∈ |𝐽 |. fst r ⊩𝐽 𝑗 ∧ snd r ⊩ 𝑝 𝑗.
5.6 Universes
[1] A. Bauer, L. Birkedal, and D.S. Scott. “Equilogical Spaces”. Submitted for publication. 1998 (cited on
page 54).
[2] Andrej Bauer. “The Realizability Approach to Computable Analysis and Topology”. PhD thesis.
Carnegie Mellon University, 2000 (cited on page 44).
[3] Andrej Bauer. “A Relationship between Equilogical Spaces and Type Two Effectivity”. In: Mathematical
Logic Quarterly 48.S1 (2002), pp. 1–15 (cited on page 62).
[4] Andrej Bauer and Jens Blanck. “Canonical Effective Subalgebras of Classical Algebras as Constructive
Metric Completions”. In: Journal of Universal Computer Science 16.18 (2010), pp. 2496–2522 (cited on
page 44).
[5] Jens Blanck. “Domain representability of metric spaces”. In: Annals of Pure and Applied Logic 83 (1997),
pp. 225–247 (cited on page 44).
[6] Vasco Brattka and Peter Hertling, eds. Handbook of Computability and Complexity in Analysis. Theory and
Applications of Computability. Springer, 2021 (cited on page 60).
[7] Douglas Bridges and Fred Richman. Varieties of Constructive Mathematics. Vol. 97. London Mathematical
Society Lecture Notes Series. Cambridge University Press, 1987 (cited on page 54).
[8] Alonzo Church. “A set of postulates for the foundation of logic”. In: Annals of Mathematics, Series 2 33
(1932), pp. 346–366 (cited on page 21).
[9] Alonzo Church and J. B. Rosser. “Some Properties of Conversion”. In: Transactions of the American
Mathematical Society 39.3 (1936). Available at http://www.jstor.org/pss/1989762, pp. 472–482 (cited
on page 23).
[10] M. Davis. Computability and Unsolvability. Reprinted in 1982 by Dover Publications. McGraw-Hill, 1958
(cited on pages 4, 8).
[11] Yuri L. Eršov. “Handbook of Computability Theory”. In: vol. 140. Studies in Logic and the Foundations
of Mathematics. Springer, 1999. Chap. Theory of numberings, pp. 473–503 (cited on page 54).
[12] K. Gödel. “Über eine bisher noch nicht benützte Erweiterung des finiten Standpunktes”. In: Dialectica
12 (1958), pp. 280–287 (cited on page 35).
[13] H. Goldstein, J. von Neumann, and A. Burks. Report on the mathematical and logical aspects of an electronic
computing instrument. Tech. rep. Princeton Institute of advanced study, 1947 (cited on page 5).
[14] C.A. Gunter and D.S. Scott. “Semantic Domains”. In: Handbook of Theoretical Computer Science. Ed. by
J. van Leeuwen. Elsevier Science Publisher, 1990 (cited on page 26).
[15] J. D. Hamkins and A. Lewis. “Infinite time Turing machines”. In: Journal of Symbolic Logic 65.2 (2000),
pp. 567–604 (cited on page 15).
[16] Jr. H.R. Rogers. Theory of Recursive Functions and Effective Computability. 3rd. MIT Press, 1992 (cited on
page 4).
[17] S.C. Kleene. “On the Interpretation of Intuitionistic Number Theory”. In: Journal of Symbolic Logic 10
(1945), pp. 109–124 (cited on page 44).
[18] S.C. Kleene and R. Vesli. The foundations of intuitionistic mathematics. Especially in relation to recursive
functions. Studies in Logic and The Foundations of Mathematics. Amsterdam: North-Holland, 1965
(cited on page 60).
[19] Steephen Kleene. “Recursive predicates and quantifiers”. In: Transactions of the AMS 53.1 (1943), pp. 41–
73 (cited on page 7).
[20] Stephen C. Kleene. “Origins of Recursive Function Theory”. In: IEEE Annals of the History of Computing
3 (1981), pp. 52–67 (cited on page 24).
[21] B. A. Kušner. Lectures on Constructive Mathematical Analysis. Vol. 60. Translations of Mathematical
Monographs. American Mathematical Society, 1984 (cited on page 54).
[22] Peter Lietz. “From Constructive Mathematics to Computable Analysis via the Realizability Interpreta-
tion”. PhD thesis. Technischen Universität Darmstadt, 2004 (cited on page 42).
[23] J. Longley. “Realizability Toposes and Language Semantics”. PhD thesis. Edinburgh University, 1995
(cited on page 28).
[24] John Longley. “Realizability Toposes and Language Semantics”. PhD thesis. University of Edinburgh,
1994 (cited on pages 37, 39–41, 52–54).
[25] John Longley. “Matching typed and untyped realizability”. In: Electronic Notes in Theoretical Computer
Science 23.1 (1999). https://doi.org/10.1016/S1571-0661(04)00105-7, pp. 74–100 (cited on pages 4,
37).
[26] John Longley. “Unifying typed and untyped realizability”. Available at http://homepages.inf.ed.
ac.uk/jrl/Research/unifying.txt. 1999 (cited on pages 4, 31).
[27] John Longley. “Computability structures, simulations and realizability”. In: Mathematical Structures in
Computer Science 24.1 (2014). https://doi.org/10.1017/S0960129513000182 (cited on page 4).
[28] Matías Menni and Alex K. Simpson. “Topological and Limit-Space Subcategories of Countably-Based
Equilogical Spaces”. In: Mathematical Structures in Computer Science 12.6 (2002), pp. 739–770 (cited on
page 56).
[29] P. Odifreddi. Classical Recursion Theory. Vol. 125. Studies in logic and the foundations of mathematics.
North-Holland, 1989 (cited on page 4).
[30] Jaap van Oosten. Realizability: An Introduction To Its Categorical Side. Vol. 152. Studies in logic and the
foundations of mathematics. Elsevier, 2008 (cited on page 31).
[31] G. Plotkin. “𝕋 𝜔 as a Universal Domain”. In: Journal of Computer and System Sciences 17 (1978), pp. 209–236
(cited on page 26).
[32] Gordon Plotkin. “LCF Considered as a Programming Language”. In: Theoretical Computer Science 5
(1977). Available at http://homepages.inf.ed.ac.uk/gdp/publications/LCF.pdf, pp. 223–255
(cited on page 35).
[33] Matthias Schröder. “Handbook of Computability and Complexity in Analysis”. In: Springer, 2021.
Chap. Admissibly represented spaces and QCB-spaces, pp. 305–346 (cited on page 61).
[34] Dana S. Scott. “Continuous Lattices”. In: Lecture Notes in Mathematics 274. Springer, 1972, pp. 97–136
(cited on page 25).
[35] D.S. Scott. “Data Types as Lattices”. In: SIAM Journal of Computing 5.3 (1976), pp. 522–587 (cited on
page 18).
[36] D. Spreen. “On Effective Topological Spaces”. In: The Journal of Symbolic Logic 63.1 (1998), pp. 185–221
(cited on page 54).
[37] J.V. Tucker and J.I. Zucker. “Computable Functions and Semicomputable Sets on Many-Sorted Algebras”.
In: Handbook of Logic in Computer Science, Volume 5. Ed. by S. Abramsky, D.M. Gabbay, and T.S.E.
Maibaum. Oxford: Clarendon Press, 2000 (cited on page 44).
[38] Alan Turing. “On Computable Numbers, with an Application to the Entscheidungsproblem”. In:
Proceedings of the London Mathematical Society 2.42 (1937). Available at http://www.scribd.com/doc/
2937039/Alan-M-Turing-On-Computable-Numbers, pp. 230–265 (cited on pages 4, 5).
[39] Klaus Weihrauch. Computable Analysis. Berlin: Springer, 2000 (cited on pages 44, 60).
[40] N. Šanin. Constructive Real Numbers and Constructive Function Spaces. Vol. 21. Translations of Mathematical
Monographs. American Mathematical Society, 1968 (cited on page 54).