LTT a typetheoretic framework for foundational pluralism Zhaohui

  • Slides: 12
Download presentation
LTT: a type-theoretic framework for foundational pluralism Zhaohui Luo Dept of Computer Science Royal

LTT: a type-theoretic framework for foundational pluralism Zhaohui Luo Dept of Computer Science Royal Holloway, Univ of London

Type theory and applications Proof assistants based on TTs n Agda (Sweden/Japan) and Nu.

Type theory and applications Proof assistants based on TTs n Agda (Sweden/Japan) and Nu. PRL (USA) w implementing Martin-Löf’s type theory n Coq (France), Lego/Plastic (UK) w implementing CIC (Calculus of Inductive Constructions) and ECC/UTT (Unifying Theory of dependent Types) Application examples n Computer science w Program verification (eg, analysis of security protocols) w Dependently-typed programming n Formalisation of mathematics w Four-colour Theorem in Coq 2

Foundational pluralism Two extreme positions in FOM n n Neo-platonism (eg, set-theoretic foundation: Gödel/Maddy)

Foundational pluralism Two extreme positions in FOM n n Neo-platonism (eg, set-theoretic foundation: Gödel/Maddy) Revisionists (eg, intuitionism: Brouwer/Martin-Löf) A pragmatic position – “pluralism” n n Various maths based on different logical foundations “Foundational pluralism” Support in type theory and the associated tech? n n Theorem proving technology based on TTs is not just for constructive reasoning! Eg, Classical logic as well as intuitionistic logic 3

Consider the “combinations” of the following and their “negations”: (C) (I) Classical logic Impredicative

Consider the “combinations” of the following and their “negations”: (C) (I) Classical logic Impredicative definitions We would have n (CI) n (C°I°) n (C°I) n (CI°) Ordinary (classical, impredicative) math Classical set theory/simple type theory, HOL/Isabelle Predicative constructive math Martin-Löf’s TT, Agda/Nu. PRL Impredicative constructive math CIC/ECC/UTT, Coq/Lego/Plastic Predicative classical math Weyl, Feferman, Simpson, … Uniform foundational framework formalisation to support pluralism? 4

Set-theoretic reasoning in type theory? Current type theories n n n Strong in type-theoretic

Set-theoretic reasoning in type theory? Current type theories n n n Strong in type-theoretic reasoning (eg, inductive types) Not so strong in set-theoretic reasoning Note: Types are NOT sets! (cf, non-inductive sets) w “a : A” – judgemental, meta-level w “s S” – propositional How should set-theoretic reasoning be supported? n n Traditional (untyped) ZF set theory? (cf, Isabelle/ZF) Combining with type-theoretic reasoning? Two roles of (the usual notion of) sets: n n Domain/range of functions: f : A B Separation/selection from a domain: { x : A | P(x) } Now, types for (i) and typed sets for (ii)! 5

Type-theoretic framework LTT: structure LTT = LF + Logic-enriched TTs + Typed Sets n

Type-theoretic framework LTT: structure LTT = LF + Logic-enriched TTs + Typed Sets n n n LF – Logical framework (cf, Edin LF, Martin-Löf’s LF, PAL+, …) Logic-enriched type theories [Aczel/Gambino 02, 06] Typed sets: sets with base types (see later) LTT = Logics + Types n n Logics – specified in LF Types – inductive types + types of sets Logic Types / LF (Luo 2007, LNCS 4435. ) 6

Key components of LTT (I): types & props Types and propositions: n n Two

Key components of LTT (I): types & props Types and propositions: n n Two worlds: objects in the “real world” and their properties (cf, ECC/UTT LTT) Types w Eg, inductive types like N, x: A. B, List(A), Tree(A), … w Eg, types of sets like Set(A) n Propositions: w Describing properties of objects ( x: A. P(x) with type A) w Classical laws may be introduced n eg, double negation: DN[P, p] : Prf(P), if P : Prop and p : Prf(¬¬P). Induction rules n n Linking the world of logical propositions and that of types Enabling proofs of properties about objects of types 7

Example of inductive types: natural numbers Formation and introduction n N : Type 0:

Example of inductive types: natural numbers Formation and introduction n N : Type 0: N succ(n) : N, for n : N Elimination over types and computation: n n Elim. T(C, c, f, n) : C(n), for C(n) : Type where n : N Plus computational rules for Elim. T: eg, Elim. T(C, c, f, 0) = c Elim. T(C, c, f, succ(n)) = f(n, Elim. T(C, c, f, n)) Induction over propositions: n n Elim. P(P, c, f, n) : P(n), for P(n) : Prop where n : N Key to prove logical properties of natural numbers 8

Key components of LTT (II): typed sets Typed sets n n Set(A) : Type

Key components of LTT (II): typed sets Typed sets n n Set(A) : Type for A : Type { x: A | P(x) } : Set(A) w t { x: A | P(x) } means P(t) (cf, de Bruijn’s use of this terminology) Impredicativity and predicativity n Impredicative sets (LTTi) w A can be any type (e. g. , Set(B)) w P(x) can be any proposition n n eg, P(x) = s: Set(N). s S & x s, for S : Set(N)) Predicative sets (LTTp) w Universes of small types and small propositions w A must be small (in particular, A is not Set(…)) w P(x) must be small (not allowing quantifications over sets) 9

Implementations and case studies Plastic (Callaghan/Luo 2001) n n Proof assistant Plastic implements LF

Implementations and case studies Plastic (Callaghan/Luo 2001) n n Proof assistant Plastic implements LF and inductive types (UTT) Implemention of LTT in Plastic (Callaghan) n Simple extension of Plastic Case studies n n n Formalisation of Weyl’s predicative mathematics (Adams/Luo 2007, LNCS 4502) Analysis of security protocols (Luo 2007, LNCS 4435) OO-modelling and verification (in progress) 10

Formalisation of Weyl’s predicative math H. Weyl. The Continuum (Das Kontinuum), 1918. n n

Formalisation of Weyl’s predicative math H. Weyl. The Continuum (Das Kontinuum), 1918. n n Historical development (paradox etc. ) Predicative development of the real number system The notion of category Classical logic Weyl/Feferman/Simpson’s work on predicativity n Predicativity (E. g. , { x | φ(x) } with φ being “arithmetical” – without quantification over sets) Formalisation of Weyl’s book in Plastic n n n In LTT, use classical logic and predicative sets Weyl’s categories as types “Exact match” (and further research …) 11

OO-modelling in intensional type theory Functional model n Cf, work by Abadi, Bruce, Cardelli,

OO-modelling in intensional type theory Functional model n Cf, work by Abadi, Bruce, Cardelli, Kamin, Pierce, … OO F ? ? n Features such as bounded quantification (BQ) are problematic. Modelling OO-features in intensional type theory (ITT) n n n LTT with classical logic LTT is “intensional”: no problematic features such as BQ or extensional features such as -like equalities. A model in an intensional TT will lead to, eg, verification of programs with OO-features (eg, in Coq) OO ITT Coq/Plastic/… Work in progress (S. Han) n OO-model and verification of OO-programs in Coq Future Work n Eg, automatic translation (OO-programs models, properties propositions, … ) 12