On Constructive Sets and Partial Structures
Total Page:16
File Type:pdf, Size:1020Kb
Formal Logic is, no doubt, safest with symbols; should, perhaps, content itself with A and B; or, at least, hardly venture beyond Y and Z. —fromLogic, Deductive and Inductive, by Carveth Read (1848–1931), Grote Professor of the Philosophy of Mind and Logic, University College London. List of papers This thesis is based on the following papers, which are referred to in the text by their Roman numerals. I Wilander, K.O. Setoids and universes, Mathematical Structures in Com- puter Science 20 (2010), 563–576. II Wilander, K.O. An E-bicategory of E-categories: exemplifying a type- theoretic approach to bicategories, U.U.D.M. Report 2005:48. III Wilander, K.O. Constructing a small category of setoids, Mathematical Structures in Computer Science, in press. ω IV Wilander, K.O. PERs in HA I: basic constructions and choice princi- ples, U.U.D.M. Report 2011:17. V Wilander, K.O. Some proof-theoretic properties of PHL and related sys- tems, U.U.D.M. Report 2010:18. Reprints were made with permission from the publishers. In addition to these papers, the author has also published Wilander, K.O. Soundness in verification of algebraic specifications with OBJ, Journal of Logic and Algebraic Programming 74 (2007-2008), 112–114. Contents 1 Introduction .................................................................................................... 9 1.1 Justifications and the BHK-interpretation ............................................. 9 1.2 Type theory ........................................................................................... 11 1.3 Setoids and E-categories ...................................................................... 13 2 Summaries of the papers ............................................................................. 15 2.1 Paper I: Setoids and universes ............................................................. 15 2.2 Paper II: An E-bicategory of E-categories .......................................... 17 2.3 Paper III: Constructing a small category of setoids ........................... 18 ω 2.4 Paper IV: PERs in HA I: basic constructions and choice principles ............................................................................................... 22 2.5 Paper V: Some proof-theoretic properties of PHL and related systems .................................................................................................. 24 3 Sammanfattning på svenska ........................................................................ 28 Acknowledgements .......................................................................................... 31 References ........................................................................................................ 32 1. Introduction When I make a claim, such as There are two irrational numbers α and β such that αβ is rational. there are several questions that can be asked. You first question may well be ‘Is this claim true?’ – and I will answer that it is true. If you are not fully satisfied by this answer, you might then ask me to justify my claim. I will then tell you to consider the two numbers α = e and β = ln2. The first thing we notice is that αβ = 2 is rational. We are both well aware that e is a transcendental irrational number – it is not the solution of any polynomial equation with rational coefficients. So all I must convince you of is that ln2 is p not rational. So suppose ln2 were rational, in fact, suppose ln2 = /q. Then we would have ep/q = 2, and consequently, ep = 2q. But this would mean that e were a solution to the polynomial equation xp = 2q (which has rational coefficients), contradicting the fact that e is transcendental. Thus, we conclude that ln2 is not rational. In this way, I have justified my original claim – and consequently, you are now (hopefully) convinced that it is true. Constructive mathematics, the subject of this thesis, seeks direct justifica- tions for mathematical statements. Having a direct justification of a statement should convince us that this statement is true – but being convinced that a certain statement is true does not necessarily mean that we can produce a jus- tification for it (not even if we are right). This idea of giving justifications for statements has been given several dif- ferent forms. I will give a brief introduction to one of them, namely Martin- Löf type theory (sometimes known as intuitionistic type theory). This will be followed by short explanations of the main objects of interest in the included papers, before the papers are summarised in the next chapter. 1.1 Justifications and the BHK-interpretation The most basic description of justifications is the so-called Brouwer-Heyting- Kolmogorov–interpretation of predicate logic (usually shortened to the BHK- interpretation). It explains what the canonical justifications are for statements on all logical forms. The discussion here is brief; for more background, see for example [24]. 9 First some notation and terminology: that p is a justification for the state- ment φ is written p:φ, and we call p a proof object for φ (often shortened simply to a proof of φ). We can now give the BHK-interpretation of the logi- cal connectives. • A proof object for a conjunction φ ∧ψ is a pair p,q, where p is a proof object for φ and q is a proof object for ψ. • A proof object for a disjunction φ ∨ ψ can be of two forms: it is either inl p for a proof object p:φ,oritisinrq for a proof object q:ψ (we can think of this as giving a proof object and pointing out which one of the disjuncts it is a proof object for). • A proof object for an implication φ → ψ is an algorithm (or method of computation) which from a hypothetical proof object for φ constructs a proof object for ψ. • A proof object for the contradiction ⊥ does not exist. • A proof object for an existential statement (∃x:A)φ(x) is a pair a, p, where a is an element of the set A, and p is a proof object for the state- ment φ(a). • A proof object for a universal statement (∀x:A)φ(x) is an algorithm which from a hypothetical element x of the set A computes a proof object for the statement φ(x). To this we must add a description of what the proof objects for our basic (atomic) propositions are. As an example, the canonical way of justifying an equality s = t between two terms is to compute the value of both terms separately, and certify that the results agree. This justification has an important property: if I tell you that two terms compute to the same value, you can easily check this, simply by carrying out the computation yourself. In other words, you can check that the justification I gave you is correct. The negation is not in the list above, since we define ¬φ to be the impli- cation φ →⊥. This means that to justify a negated statement ¬φ, we must provide an algorithm which, given a proof of φ, produces a proof of ⊥. This requires more than there being no proof objects for φ: it amounts to a proof that there can not be any proof object for φ – and absence of proof is not proof of absence. As an important example, consider what a proof object for a doubly negated statement ¬¬φ would be: it would be an algorithm that arrives at a contradic- tion from a hypothetical proof of ¬φ. This is not the same thing as a proof object for φ, and there is no obvious way to use a proof object for ¬¬φ to compute one for φ – in fact, there is no general justification for the implica- tion ¬¬φ → φ. Compare this to the situation in classical logic, where each statement is assigned one of two truth values – true or false. It is easily checked that ¬¬φ and φ must always be assigned the same truth value, and then they are even equivalent. This shows that in classical logic, there are true statements for which we can not give a direct justification. 10 In classical logic, the statements φ and ¬φ will always be assigned different truth values, so φ ∨¬φ is valid for all φ – the law of excluded middle holds. The intuitionistic logic we get from considering proof objects does not include the law of excluded middle. But a constructive mathematician does not deny the law of excluded middle, she merely notes that it can not be justified. In fact, a constructive mathematician can not deny the law of excluded middle, since its double negation ¬¬(φ ∨¬φ) can be justified. 1.2 Type theory The BHK-interpretation is informal, and particularly it leaves the notion of an algorithm undefined. Type theory can be seen as one way of specifying this notion. Type theory rests on the idea of propositions as types (which can be seen as a further development of the Curry-Howard isomorphism [13]). We simply identify a proposition with the set of its proof objects (where the word ‘set’ should be understood not in the sense of set theory, but rather as a synonym for ‘data type’). This then identifies the logical connectives with particular type-forming operations. • The contradiction ⊥ is identified with the empty set. • The conjunction φ ∧ ψ is identified with the cartesian product φ × ψ. • The disjunction φ ∨ ψ is identified with the sum type φ + ψ (a disjoint union). • The implication φ → ψ is identified with the function type ψφ . • The existentially quantified statement (∃x:A)φ(x) is identified with the sigma type (or dependent sum) (Σx:A)φ(x). • The universally quantified statement (∀x:A)φ(x) is identified with the pi type (or dependent product) (Πx:A)φ(x). Of these, the first four are familiar, but the last two should be explained. In the quantified formulas, consider the subformula φ(x), with the variable x free. It is not in itself a proposition, but rather a propositional function – it assigns a proposition φ(a) to each a:A. But since we have identified propositions with sets, this is the same as saying that φ(x) is a family of sets, indexed by A. Such families of sets are key to understanding the dependent types. To understand the dependent sum and product, we must understand what it is to be an element of these sets.