Showing posts with label Per Martin-Löf. Show all posts
Showing posts with label Per Martin-Löf. Show all posts

Wednesday, 3 January 2024

Discussing "Intuitionistic Type Theory"

(Link)

Author: Per Martin-Löf (University of Stockholm)

Reference: Per Martin-Löf, Intuitionistic Type Theory, Notes by Giovanni Sambin of a series of lectures given in Padua, June 1980 (1984)

Why this paper? Cited by A conservativity result for homotopy elementary types in dependent type theory, Topological Quantum Gates in Homotopy Type Theory, and A parametricity-based formalization of semi-simplicial and semi-cubical sets

5 years on from Martin-Löf’s seminal paper on type theory (on which I have written before; I will try to avoid repeating myself), he presented his approach to a mixed audience of computer scientists, mathematicians, and philosophers. As such, these notes are quite accessible to a range of audiences, with time spent on questions like “What is it we must know in order to have the right to judge something to be a set?”, plenty of examples, and a fairly light touch on metatheorems about his system. However this is not merely a teaching course on his 1975 material, and we see two major new ideas enter his type theory here (and also in his almost simultaneously published paper Constructive mathematics and computer programming, which covers similar ground but is much briefer).

The first is the reflection rule, which allows ‘propositional’ equalities proved within the system to be used freely to replace equals by equals anywhere (as a fully fledged ‘definitional’ equality). This captures the strong extensional view of equality, as opposed to the intensional view of the older work in which objects enjoy first class equality only if they are described the same way, up to some automatic conversions. This is an old concept from philosophy of language, where Superman and Clark Kent are extensionally but not intensionally equal, because there are places in language for which they are not interchangeable: “Clark Kent is a civilian identity” does not imply “Superman is a civilian identity”. Martin-Löf notably does not discuss the reasons for this change or its ramifications. In fact it is known to have unfortunate consequences computationally, violating one of the keystone theorems of his earlier paper – the decidability of type checking – among other troublesome aspects. This does not make extensional type theory useless; it is the right tool for much ‘pen and paper’ type theory in which we want to work synthetically in a particular mathematical setting but use the strong form of equality usually preferred by mathematicians.

The second new idea is the introduction of W-types (at least, I believe this is their first appearance), which gives a general tree-like syntax for inductive types such as natural numbers and lists.

Finally, I would note the interesting fact that, linguistically at least, Martin- Löf repeatedly conflates the terms ‘type’ and ‘set’. This does not reflect most modern practice, in which category theory is usually the language of choice for defining denotational semantics, opening the way for the interpretation of type theory in mathematical settings others than sets. Indeed, in homotopy type theory (invented in part to find an interesting middle way between extensional and intensional equality) the notion of type is strictly more general than that of set: a set is a type without interesting equalities.

Tuesday, 24 January 2023

Discussing "An Intuitionistic Theory of Types: Predicative Part"

(Link), although I downloaded a free copy here.

Author: Per Martin-Löf (University of Stockholm)

Reference: Per Martin-Löf, An Intuitionistic Theory of Types: Predicative Part, Editor(s): H.E. Rose, J.C. Shepherdson, Studies in Logic and the Foundations of Mathematics, Elsevier, Volume 80, 1975, Pages 73-118, https://doi.org/10.1016/S0049-237X(08)71945-1.

Why this paper? Cited by Encoding Dependently-Typed Constructions into Simple Type Theory and Normalization and coherence for ∞-type theories

After covering a few advanced and recent papers on type theory recently, this week we look at the first ever fully realised paper on type theory for formalised mathematics (previous work was either incomplete or suffered from errors). It is stated from the very first sentence that the work of this paper is “intended to be a full scale system for formalizing intuitionistic mathematics”. Charmingly, the paper ends with the self-effacing remark “What is doubtful at present is not whether computerization is possible, because we already know that, but rather whether these proof-theoretical computation procedures are at all useful in practice. So far, they do not seem to have found a single significant application”. Almost 50 years on, the vision of this paper has been thoroughly vindicated by the development of sophisticated proof assistants such as Coq and Lean capable of formalising complex mathematics such as proofs of the Four-Colour Theorem and the Odd Order Theorem.

The basic idea is to exploit the Curry-Howard isomorphism, only recently worked out in detail by William Howard (see Howard’s comments on his influence on Martin-Löf here), which identifies propositions with types and (intuitionistic) proofs with programs, to develop a (at this stage, paper-only) programming language for which which proof checking is type checking. Each logical symbol, familiar from any introductory logic course, becomes associated with a type former, as well as program formers which allow programs with that type to be introduced and eliminated (used). Less familiar to logicians, a universe (type of types) is essential to formalise many mathematical arguments, but care must be taken to avoid paradoxes that would crop up if the universe is taken to be a member of itself (very similar paradoxes must be avoided in set theory); this is the predicativity of the title. Crucially (and again, perhaps not so familiar from an introductory logical course) the decidability and other good properties of algorithms related to the type theory – reduction and type checking – is proved, paving the way for type theory to jump off the page and into real implementation.

This paper is quite a readable introduction to this brand new area, as Martin-Löf does not assume familiarity with the underlying idea of performing mathematics inside type theory, as a more recent paper might, but rather must justify his approach. The paper is full of pithy quotes (some original, some adapted from other sources) to motivate the work, such as “A proposition is defined by prescribing how we are allowed to prove it” and, justifying the importance of type checking being decidable, “we recognize a proof when we see one”.