toward naive type theories
play

Toward naive type theories David Ripley University of Connecticut - PowerPoint PPT Presentation

Toward naive type theories David Ripley University of Connecticut http://davewripley.rocks Types Why type theory? Types Why type theory? Type theories are a family of formalisms with a wide range of uses. Invented to block paradox, they


  1. Toward naive type theories David Ripley University of Connecticut http://davewripley.rocks

  2. Types Why type theory?

  3. Types Why type theory? Type theories are a family of formalisms with a wide range of uses. Invented to block paradox, they have taken on a life of their own.

  4. Types Why type theory? They have long been used in the semantics of natural languages and programming languages. proof-relevant mathematics as well. Their connection to proofs ties them to formalized, constructive, and

  5. Types Simple types and propositions

  6. Types Simple types and propositions The connection to proofs turns on the ability to see propositions as types, and vice versa. Think of each type A as the proposition ‘ A is inhabited’, or think of each proposition as the type of its proofs.

  7. Types Simple types and propositions It is usual to suppose we can form function types: given types A and B there is a type A → B of functions from A to B .

  8. Types Simple types and propositions Γ , x : A ⊢ x : A Γ , x : A ⊢ M : B Γ ⊢ M : A → B Γ ⊢ N : A Γ ⊢ λ ( x : A ) . M : A → B Γ ⊢ MN : B

  9. Types Simple types and propositions Simultaneously a logic and a theory of functions. (The logic is Int → .)

  10. Types Simple types and propositions Can add other connectives/type formers. For example, conjunctions/pairs: Γ ⊢ M : A Γ ⊢ N : B Γ ⊢ M : A × B Γ ⊢ M : A × B Γ ⊢ ⟨ M , N ⟩ : A × B Γ ⊢ fst ( M ) : A Γ ⊢ snd ( M ) : B

  11. Types Simple types and propositions Can get to full propositional Int this way. But to capture even moderately-complex reasoning, we must go beyond propositional.

  12. Types Dependent types

  13. Types Dependent types But what is its output type? How to say ‘Every natural number is ≥ 0’? We want a function type with input type N .

  14. Types Dependent types When given a natural n : N , the function should produce a proof of the proposition that n ≥ 0. That is, the output type depends on the input. (Not on the input’s type; on the input itself!) We need what’s called a dependent function type.

  15. Types Dependent types Dependent function types are usually written with a ∏ . The proposition that every natural is ≥ 0, then, is the type ∏ n ≥ 0 n : N Its inhabitants are functions that, when given an n : N , yield a proof that n ≥ 0.

  16. Types Dependent types Γ , x : A ⊢ M : B Γ ⊢ M : ∏ Γ ⊢ N : A ( x : A ) B Γ ⊢ λ ( x : A ) M : ∏ Γ ⊢ MN : B [ N / x ] ( x : A ) B When x is not free in B , this is just → again. But it can be free in B , and then this is something new.

  17. Types Dependent types Dependent function types give restricted universal quantification. (Similarly, dependent pair types give restricted particular quantification.) So with dependent types, quantification is in the mix; the resulting logic is much more expressive.

  18. Types Where do types come from?

  19. Types Where do types come from? This is all well and good as a way of forming new types from old. But it doesn’t get us anywhere without some types to start with.

  20. Types Where do types come from? One option (Martin-Löf’s original formulation) is to start by assuming Type : Type . This is surprisingly powerful.

  21. Types Where do types come from? If we have a type, we can assume a variable in it: Γ ⊢ A : Type Γ , x : A ⊢ x : A If we have Type : Type , then, we can assume our way to types.

  22. Types Where do types come from? Given any type as an argument, it returns the identity function on that type. ⊢ Type : Type X : Type ⊢ X : Type X : Type , y : X ⊢ y : X X : Type ⊢ λ ( y : X ) . y : ∏ ( y : X ) X ⊢ λ ( X : Type ) .λ ( y : X ) . y : ∏ ∏ ( X : Type ) ( y : X ) X This gives the polymorphic identity function.

  23. Types Where do types come from? Given any type as an argument, it returns the identity function on that type. ⊢ Type : Type X : Type ⊢ X : Type X : Type , y : X ⊢ y : X X : Type ⊢ λ ( y : X ) . y : X → X ⊢ λ ( X : Type ) .λ ( y : X ) . y : ∏ ( X : Type ) X → X This gives the polymorphic identity function.

  24. Types Where do types come from? We need some way to say that A is a type; But if Type isn’t a type, this is no good. More usual is a separate judgment A type . Type : Type is also elegant. A : Type works well!

  25. Types Meaning explanations

  26. Types Meaning explanations So Type : Type is powerful and elegant. But can it be justified?

  27. Types Meaning explanations One attempt to provide an understanding of types: Martin-Löf’s meaning explanations.

  28. Types Meaning explanations ME1: To define a type A : say how an object of type A is formed, and how an equality between two objects of type A is formed. ME2: Types A and B are equal when they have the same objects and the same equalities between objects.

  29. Types Meaning explanations ME1 examples: and when two are equal • to give the type Type , we say how to form a type and when two are equal. • to give the type N , we say how to form a natural • to give the type N → N , we say how to form a function from N to N and when two are equal

  30. Types Meaning explanations But ME1 and ME2 do say how to form a type and when two are equal. According to ME1, then, the two together define Type , the type of types.

  31. Types Meaning explanations The inhabitants of Type are then those things formed via ME1 and ME2. Since Type is so formed, we have Type : Type .

  32. Types Meaning explanations It is not only convenient, but justified. Thus, Type : Type follows from these meaning explanations.

  33. Paradoxes and naivete Paradox

  34. Paradoxes and naivete Paradox Few existing dependent type theories allow Type : Type .

  35. Paradoxes and naivete Paradox It tends to lead to paradoxes. every type is inhabited. That is, every proposition is provable. In Martin-Löf’s original Type : Type system,

  36. Paradoxes and naivete Paradox So in applications to proofs, Type : Type is usually jettisoned. One common replacement is a cumulative hierarchy.

  37. Paradoxes and naivete Paradox functions of this type are not fully polymorphic. Types like ∏ X : Type X → X are no good in a cumulative hierarchy. We have only ∏ X : U i X → X , with U i some level universe. But since we will not have U i : U i , We can’t use them to get an identity function on U i .

  38. Paradoxes and naivete Set-theoretic paradox

  39. Paradoxes and naivete Set-theoretic paradox This should all smell familiar to set-theoretic paradoxers.

  40. Paradoxes and naivete Set-theoretic paradox Playing the role of the meaning explanations, These are part of a fine story about sets (sets are the extensions of predicates/open sentences), but they lead to paradoxes. we have either Basic Law V or naive comprehension.

  41. Paradoxes and naivete Set-theoretic paradox Sophisticated set theories are built to avoid these paradoxes. (Many involve cumulative hierarchies.)

  42. Paradoxes and naivete Set-theoretic paradox But there are other options. Paradoxes can be blocked or ameliorated by a shift in logic instead, leading to naive set theories.

  43. Paradoxes and naivete Set-theoretic paradox Naive set theories can be split into four rough categories: • Paraconsistent • Paracomplete • Noncontractive • Nontransitive

  44. Towards naive type theories Where to make the change?

  45. Towards naive type theories Where to make the change? What I want to suggest, then, is a heterodox type theory. while blocking or ameliorating the paradoxes elsewhere. The aim is an approach that holds to Type : Type ,

  46. Towards naive type theories Where to make the change? There is much to be learned from existing naive set theories. But the type-theoretic situation is much more constrained.

  47. Towards naive type theories Where to make the change? The logic and the type theory can’t be split off from each other; There are fewer places to tinker, and each place has broader ramifications. the logic is built from the types in the first place!

  48. Towards naive type theories Where to make the change? Paraconsistent and paracomplete approaches work with distinctive theories of negation. Here, negation is → ⊥ .

  49. Towards naive type theories Where to make the change? Paracomplete theories work by blocking reductio. So this must go: Seems unpromising: Γ , x : A ⊢ M : ⊥ Γ ⊢ λ ( x : A ) . M : A → ⊥ needs to restrict λ abstraction.

  50. Towards naive type theories Where to make the change? Analogs to other naive set theories need to reject: We need some replacement for this rule. Paraconsistent approaches have nothing to offer here. Γ ⊢ M : A → B Γ ⊢ N : A Γ ⊢ MN : B How are we to see → as a function type, then?

  51. Towards naive type theories Where to make the change? This leaves noncontractive and nontransitive approaches. Both must reject: Seems awkward: can we really not substitute terms for variables? According to nontransitive approaches, really. Γ ⊢ M : A Γ , x : A ⊢ N : B Γ ⊢ N [ M / x ] : B [ M / x ]

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend