A Spatial Model of the Lambda Calculus
Total Page:16
File Type:pdf, Size:1020Kb
A Spatial Model o f t h e Lambda Calculus by Jeroen Goudsmit under the supervision of prof. dr. I. Moerdijk second examiner: dr. J. van Oosten A is thesis has been wrien as a master’s thesis at the University of Utret, in order to complete the master’s program ‘Mathematical Sciences’. Several people helped me in writing this, and I would like to take this opportunity to thank them. My supervisor prof. dr. Ieke Moerdijk helped me these months, guiding me through the literature, for whi I am very thankful. My understanding of the spatial cover greatly benefited from our meetings. I very mu appreciate the time we spent working on this thesis, I believe to have learned a great deal due to his guidance. Furthermore I would like to thank my second examiner dr. Jaap van Oosten, for steering me in the right direction when I came across a difficult design oice. My understanding of λ-calculus profited from the conversations I had with prof. dr Vincent van Oostrom, for whi am mu obliged. Several times I worked together with Sori Lee, his company boosted my performance quite a bit. I am especially grateful for his presence during my final rehearsal. On a more personal note I would like to thank Barbara Harzevoort. She proof-read my work and pointed out anything in need of refinement. e quality of this work greatly improved due to her suggestions. When the time came to prepare a talk, she was there to rehearse it with me. She provided me with the aentive audience I needed to condense my ideas into the appropriate time span. Finally, I would like to thank my parents for supporting me throughout my time as a student. iii C Anowledgements iii Introduction Grothendie Toposes . Sheaves .................................................. . Etale´ Spaces ............................................... .. Sheaves and Etale´ Spaces .................................... .. Base Change ........................................... .. Locally Connected Etale´ Spaces ................................ .. Points .............................................. . Grothendie Topology ......................................... . Geometric Morphisms .......................................... Spatial Cover . Enumeration Space ............................................ . e Space of Points ............................................ . A Be–Chevalley Condition ...................................... λ-Calculus . Cartesian Closed Categories ....................................... . e λ-Calculus .............................................. . Models of λ-Calculus .......................................... Bibliography v I In this master’s thesis we will construct a complete and functionally complete model of the λ-calculus . In the fol- lowing it will become clear what most of these terms mean, and how this result relates to earlier work. For reasons of brevity, we skip over a great deal of details in these few pages, but rest assured that all will be made precise in the following three apters. e λ-calculus is, in its most basic form, a theory of functions. In order for this thesis to be self-contained, we cover it with a fair amount of detail in Chapter . For the moment, think of λ-calculus as the formal system of equations on terms generated by the following inference system. We say that M is a λ-term of type ϕ within the context Γ whenever Γ ` M : ϕ can be deduced from the inference system below. We remain purposely vague on what types and context are precisely, this will all be specified to great detail in Section .. It is important to see however that the types ϕ mentioned within this system are elements of the closure of some set V (the set of basic types) under the type-forming operation (−) ) (−). () Γ; x : ϕ ` x : ϕ Γ; x : ϕ ` M : Γ ` M : ϕ ) ∆ ` N : ϕ ()I) ()E) Γ ` λxϕ:M : ϕ ) Γ; ∆ ` MN : Terms of this system include for example (i) λxϕ:xϕ of type ϕ ) ϕ; (ii) λxϕ.λy :xϕ of type ϕ ) ) ϕ; (iii) λf ϕ) )χ.λgϕ) .λxϕ:(f x)(g x) of type (ϕ ) ) χ) ) (ϕ ) ) ) ϕ ) χ, all within the empty context. e term (i) can be thought of as the identity function, (ii) is the ‘constant-function function’ and (iii) ‘distributes’ its third argument to its first and second argument. e types of the two laer terms are precisely the axioms of Hilbert-style zeroth-order logic.¹ Of course, the above intuitive description makes no sense at all until we introduce equations on λ-terms. e reason that λxϕ:xϕ resembles the identity function is that when ‘applied’ to a λ-term of type ϕ, it ‘yields’ this term. e two basic equalities are concerned with extensionality and reduction, and given by λxϕ:M x ≡ M (λxϕ:M) N ≡ M [x 7! N] ; where M [x 7! N] is to be read as ‘the term resulting from replacing all occurrences of x within M with N’. It thus follows from the second equality that (λxϕ:xϕ) M ≡ M holds for any term M of type ϕ within some context. ¹e calculus concerned with these three combinators was studies by S¨onfinkel, , who called these terms respectively I (Identiteits- funktion), C (Konstantfunktion) and S (Versmelzungsfunktion). Nowadays these are called the SKI-combinators, their relation with λ-calculus and logic is discussed in Sørensen and Urzyczyn (, Chapter ). Suppose one assigns to ea element p of V a set JpK. is mapping can be extended inductively so as to send the typeQϕ ) to the set Set (JϕK; J K).² A context, being a finite set of variables, can thus be sent to some J K product x : γ2Γ γ . One can interpret terms M of type ϕ within a context Γ as set-theoretic functions from the interpretation of their context to the interpretation of their type. e mapping is inductive along the deduction used to construct them with the inference system given above, and defined below. ϕ () JΓ; x : ϕ ` x : ϕK : JΓ; x : ϕK ! JϕK; p 7! px Γ; x : ϕ ` M : ( ) ()I) JΓ ` λxϕ:M : ϕ ) K : JΓK ! Set (JϕK; J K) ; p 7! x 7! JΓ; x : ϕ ` M : K(p; x) Γ ` M : ϕ ) ∆ ` N : ϕ ( )( ) ()E) JΓ; ∆ ` MN : K : JΓ; ∆K ! J K; (p; q) 7! JΓ ` M : ϕ ) K p J∆ ` N : ϕK(q) is interpretation provides a model for the simply typed λ-calculus. Indeed, one can interpret an equality M ≡ N of λ-terms M and N of the same type ϕ within the same context Γ as the actual equality of the functions JΓ ` M : ϕK = JΓ ` N : ϕK: We call this interpretation a model because every equation whi holds in the theory (of equations between λ-terms within a given context), is interpreted as a valid equation. e interpretation given here is a very concrete version of the interpretation described in Section .. It is easy to see that the λ-terms (i) and (ii) are mapped to the functions below, when interpreted within the empty context. ( ) ( ( ) ∗ 7! x 7! x ∗ 7! x 7! y 7! x) It has been proven by Plotkin () that the collection of models in Set where ea basic type is interpreted by a finite set is complete for this λ-calculus.³ A collection of models is said to be complete when an expression holds in the theory if the interpretation of said expression holds in all models. is means that if the interpretation of an equality holds in all models with ‘finite basic types’, then it must hold in the λ-calculus as well. is does not mean that if an equality holds in some model in Set with finite interpretations of basic types, it also holds in the theory. Let us demonstrate this lile fact. Suppose that the symbol N is contained within the set of basic types V. is means that we have the type N := (N ) N) ) N ) N. For ea natural number n we have the a term within the empty context of this type N. ese are the so-called Cur numerals, defined as n := λsN)N.λxN:sn x; where sn x is to be read as the n-fold application of s to x. e equation below on the le is an actual syntactic equality, the equality on the right follows from the imposed equations. 0 = λsN)N.λxN:x n + 1 ≡ λsN)N.λxN:n s (s x) When we interpret the type N as the set N, then it is clear that n ≡ m holds precisely if n = m. Note that we obtain this result quite easily through our model, whereas it would be a lot harder to prove purely syntacticly. From this we deduce that there are infinitely many ‘really’ distinct terms of type N. So if we were to interpret the type N as a finite set, it would follow that N is interpreted as a finite set. Now suppose that this model is complete, that is, every equality whi holds in the model holds in the theory as well. is would force a non-existent equality in the ²We will oen use the notation C (X; Y ) to denote the set of arrows between the objects X and Y in the category C. In this particular instance, we refer to the set of set-theoretic functions between JϕK and J K. is is sometimes denoted J KJϕK but due to ideologic and cosmetic reasons we do not adopt this laer notation at all. ³See Selinger (, Section ) for a small description of this theorem. e following example is motivated by his notes. theory of equations governing this λ-calculus, a contradiction. Friedman () proved the existence of a complete model of the λ-calculus as defined above with only one basic type. Let us now take a small step ba. We can construct a model for the λ-calculus given any set V of basic types, and the entirety of su models where the basic types are interpreted by finite sets is complete. If we restrict V to be a one-point set, then we can find a single model whi is complete.