The Limits of the Curry-Howard Isomorphism Reinhard Kahle 1 and Anton - - PowerPoint PPT Presentation

the limits of the curry howard isomorphism
SMART_READER_LITE
LIVE PREVIEW

The Limits of the Curry-Howard Isomorphism Reinhard Kahle 1 and Anton - - PowerPoint PPT Presentation

The Limits of the Curry-Howard Isomorphism Reinhard Kahle 1 and Anton Setzer 2 1 DM and CENTRIA, FCT Universidade Nova de Lisboa, Portugal 2 Dept. of Computer Science, Swansea University, Swansea, UK T ubingen, FRC workshop, 21 February 2014


slide-1
SLIDE 1

The Limits of the Curry-Howard Isomorphism

Reinhard Kahle1 and Anton Setzer2

1DM and CENTRIA, FCT

Universidade Nova de Lisboa, Portugal

  • 2Dept. of Computer Science, Swansea University, Swansea, UK

T¨ ubingen, FRC workshop, 21 February 2014

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 1/ 37

slide-2
SLIDE 2

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 2/ 37

slide-3
SLIDE 3

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 3/ 37

slide-4
SLIDE 4

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

◮ Martin-L¨

  • f Type Theory (MLTT) can be considered as “radical

formalisation Curry-Howard Isomorphism”

◮ Propositions as types

◮ No distinction between data types and propositions.

◮ Propositions are true if they are inhabited (have a proof). ◮ Because of the last two items, elements of types (Set = collection of

types) must be total:

◮ Otherwise we can prove

p : A p = p

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 4/ 37

slide-5
SLIDE 5

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Function Type in MLTT

◮ An element of A → B is a program which for a : A returns b : B. ◮ Implicitly contains an implication.

So implication explained by an implication.

◮ In order to overcome this, Martin-L¨

  • f refers to that we

we know what a program is that takes input a : A and returns b : B.

◮ Doesn’t mean that we know what an arbitrary program is but

◮ when we introduce a program we need to explain that it is a program

  • f its type, and

◮ we know how to apply a program.

◮ Therefore programs are always typed.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 5/ 37

slide-6
SLIDE 6

Inductive Data Types and Universes

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 6/ 37

slide-7
SLIDE 7

Inductive Data Types and Universes

Inductive Data Types

◮ As in other axiomatic systems proof theoretic strength obtained by

adding data types and their introduction/elimination/equality rules.

◮ Inductive data types – in Agda notation

data N : Set where : N S : N → N

◮ Elimination rule is higher type primitive recursion.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 7/ 37

slide-8
SLIDE 8

Inductive Data Types and Universes

Universes

◮ Universes = collection of sets. ◮ Formulated if using the logical framework as:

U0 : Set T0 : U0 → Set

◮ U0 = set of codes for sets. ◮ To = decoding function.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 8/ 37

slide-9
SLIDE 9

Inductive Data Types and Universes

Universe closed under W

mutual data U0 : Set where

  • N

: U0

  • W

: (x : U0) → (T0 x → U0) → U0 · · · T0 : U0 → Set T0 N = N T0 ( W a b) = Wx : T0 a.T0 (b x) · · ·

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 9/ 37

slide-10
SLIDE 10

Steps towards the Mahlo Universe

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 10/ 37

slide-11
SLIDE 11

Steps towards the Mahlo Universe

Universe Operator (Palmgren)

◮ If A : Fam(Set) where the type of families of sets is

Fam(Set) = ΣX : Set.X → Set then U+ A : Set is a universe containing (codes for) A.

◮ U+ A can be defined as well as a universe closed under

f : Fam(Set) → Fam(Set) f X = A

◮ (Usage of Fam(Set) can be avoided by Currying)

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 11/ 37

slide-12
SLIDE 12

Steps towards the Mahlo Universe

Super Universe Operator (Palmgren)

◮ If A : Fam(Set) then

SU A : Set is a super universe containing A, i.e. a universe closed under U+.

◮ SU A can be defined as well as a universe closed under

f : Fam(Set) → Fam(Set) f X = A ∪ (U+ X)

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 12/ 37

slide-13
SLIDE 13

Steps towards the Mahlo Universe

External Mahlo Universe

◮ Generalise the above to allow formation of universes closed under

arbitrary operators:

◮ If f : Fam(Set) → Fam(Set) then

Uf : Set is a universe closed under f .

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 13/ 37

slide-14
SLIDE 14

Steps towards the Mahlo Universe

Internal Mahlo Universe

◮ The internal Mahlo universe V is a universe internalising closure

under λf .Uf : If f : Fam(V) → Fam(V) then

  • Uf : V

is a code for a subuniverse Uf : Set

  • f V closed under f

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 14/ 37

slide-15
SLIDE 15

Steps towards the Mahlo Universe

Illustration of the Mahlo Universe

V f

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 15/ 37

slide-16
SLIDE 16

Steps towards the Mahlo Universe

Illustration of the Mahlo Universe

V f

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 15/ 37

slide-17
SLIDE 17

Steps towards the Mahlo Universe

Illustration of the Mahlo Universe

f Uf f V

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 15/ 37

slide-18
SLIDE 18

Steps towards the Mahlo Universe

Illustration of the Mahlo Universe

Uf f

  • Uf

f V

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 15/ 37

slide-19
SLIDE 19

Extended Predicative Mahlo

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 16/ 37

slide-20
SLIDE 20

Extended Predicative Mahlo

Problems of Mahlo Universe

◮ Constructor

  • U : (Fam(V) → Fam(V)) → V

refers to

◮ the set of total functions

Fam(V) → Fam(V)

◮ which depends on the totality of V.

◮ So the reason for defining an element of V depends on the totality of

V.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 17/ 37

slide-21
SLIDE 21

Extended Predicative Mahlo

Idea for an Extended Predicative Mahlo Universe

◮ However, for defining Uf , only the restriction of f to Fam(Uf ) is

required to be total.

◮ Only local knowledge of V is needed.

◮ Idea: For f partial object, we try to define a subuniverse

Pre V f

  • f V closed under f .

◮ If we succeed then add a code

Uf for Pre V f to V.

◮ Requires that we have the notion of a partial object f .

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 18/ 37

slide-22
SLIDE 22

Extended Predicative Mahlo

Explicit Mathematics (EM)

◮ Problem: In MLTT we have no reference of the set of partial objects

(“potential programs”, collection of terms of our language).

◮ In Feferman’s explicit mathematics (EM) this exist. ◮ We will work in EM, but use syntax borrowed from type theory,

◮ however write a ∈ B instead of a : B. Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 19/ 37

slide-23
SLIDE 23

Extended Predicative Mahlo

Basics of EM

◮ EM more Russell-style, therefore we can have

◮ V ∈ Set, ◮ V ⊂ Set, ◮ no need to distinguish between

U and U.

◮ We can encode Fam(V) into V, therefore need only to consider

functions f : V → V

◮ We define now f , X ∈ Set, X ⊆ Set

Pre f X ∈ Set Pre f X ⊆ X

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 20/ 37

slide-24
SLIDE 24

Extended Predicative Mahlo

Pre f X

c f c f b b X Pre f X

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 21/ 37

slide-25
SLIDE 25

Extended Predicative Mahlo

Closure of Pre f X

◮ Pre f X is closed under universe constructions, if result is in X. ◮ Closure under Σ (called join in EM):

∀a ∈ Pre f X. ∀b ∈ a → Pre f X. Σ a b ∈ X → Σ a b ∈ Pre f X

◮ Pre f X is closed under f , if result is in X:

∀a ∈ Pre f X. f a ∈ X → f a ∈ Pre f X

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 22/ 37

slide-26
SLIDE 26

Extended Predicative Mahlo

Independence of Pre f X

◮ If, whenever a universe construction or f is applied to elements of

Pre f X we get elements in X, then Pre f X is independent of future extensions of X. Indep(f , Pre f X, X) := (∀a ∈ Pre f X. ∀b ∈ a → Pre f X. Σ a b ∈ X) ∧ · · · ∧ ∀a ∈ Pre f X. f a ∈ X

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 23/ 37

slide-27
SLIDE 27

Extended Predicative Mahlo

Indep A f

f b f b X u := Pre f X Indep(f , u, X)

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 24/ 37

slide-28
SLIDE 28

Extended Predicative Mahlo

Introduction Rule for V

◮ ∀f . Indep(f , Pre f V, V) → (Uf ∈ Set

∧ Uf =ext Pre f V ∧ Uf ∈ V) .

◮ V admits an elimination rule expressing that V is the smallest

universe closed under universe constructions and introduction of Uf .

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 25/ 37

slide-29
SLIDE 29

Extended Predicative Mahlo

Introduction Rule for V

f b f b U f Pre f M Indep(f , Pre f V, V) V

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 26/ 37

slide-30
SLIDE 30

Extended Predicative Mahlo

Interpretation of Axiomatic Mahlo

◮ It easily follows:

∀f ∈ V → V. Indep(f , Pre f V, V) therefore ∀f ∈ V → V. Uf ∈ V ∧ Univ(f ) ∧ f ∈ Uf → Uf

◮ So V closed under axiomatic Mahlo constructions. ◮ Therefore extended predicative Mahlo has at least strength of

axiomatic Mahlo.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 27/ 37

slide-31
SLIDE 31

Curry-Howard isomorphism

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 28/ 37

slide-32
SLIDE 32

Curry-Howard isomorphism

Curry-Howard isomorphism

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 29/ 37

slide-33
SLIDE 33

Curry-Howard isomorphism

Curry-Howard isomorphism

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 29/ 37

slide-34
SLIDE 34

Partial Functions

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 30/ 37

slide-35
SLIDE 35

Partial Functions

Total Functions

◮ Traditionally, (mathematical) functions were always considered as

total (maybe on a restricted domain).

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 31/ 37

slide-36
SLIDE 36

Partial Functions

Total Functions

◮ Traditionally, (mathematical) functions were always considered as

total (maybe on a restricted domain).

◮ It was an essential feature of the Ackermann Function, the

first example of a intuitively computable functions which is not primitive recursive, that it is total.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 31/ 37

slide-37
SLIDE 37

Partial Functions

Total Functions

◮ Traditionally, (mathematical) functions were always considered as

total (maybe on a restricted domain).

◮ It was an essential feature of the Ackermann Function, the

first example of a intuitively computable functions which is not primitive recursive, that it is total.

◮ The distinguished logician David Kaplan once

expressed his conviction: “A function carries its domain.”

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 31/ 37

slide-38
SLIDE 38

Partial Functions

Total Functions

◮ Traditionally, (mathematical) functions were always considered as

total (maybe on a restricted domain).

◮ It was an essential feature of the Ackermann Function, the

first example of a intuitively computable functions which is not primitive recursive, that it is total.

◮ The distinguished logician David Kaplan once

expressed his conviction: “A function carries its domain.”

◮ Do you agree?

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 31/ 37

slide-39
SLIDE 39

Partial Functions

Total Functions

◮ Traditionally, (mathematical) functions were always considered as

total (maybe on a restricted domain).

◮ It was an essential feature of the Ackermann Function, the

first example of a intuitively computable functions which is not primitive recursive, that it is total.

◮ The distinguished logician David Kaplan once

expressed his conviction: “A function carries its domain.”

◮ Do you agree?

“Generic Ackermann”

If there is an inductive scheme to generate “all” total functions, one can always diagonalize over it to construct a new Ackermann-style total function outside of this class.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 31/ 37

slide-40
SLIDE 40

Partial Functions

Partial Functions

Kleene, 1981

When Church proposed this thesis, I sat down to disprove it by diagonalizing out of the class of the λ-definable functions. But, quickly realizing that the diagonalisation cannot be done effectively, I became overnight a supporter of the thesis.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 32/ 37

slide-41
SLIDE 41

Partial Functions

Partial Functions

Kleene, 1981

When Church proposed this thesis, I sat down to disprove it by diagonalizing out of the class of the λ-definable functions. But, quickly realizing that the diagonalisation cannot be done effectively, I became overnight a supporter of the thesis. Partiality blocks Diagonalization

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 32/ 37

slide-42
SLIDE 42

Partial Functions

Partial Functions

◮ Partiality blocks Diagonalization . . .

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 33/ 37

slide-43
SLIDE 43

Partial Functions

Partial Functions

◮ Partiality blocks Diagonalization . . .

◮ technical note: we assume a strict evaluation strategy of functions. Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 33/ 37

slide-44
SLIDE 44

Partial Functions

Partial Functions

◮ Partiality blocks Diagonalization . . .

◮ technical note: we assume a strict evaluation strategy of functions.

◮ . . . but it comes for the price of Undecidability.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 33/ 37

slide-45
SLIDE 45

Partial Functions

Partial Functions

Nachum Dershowitz (2005): full ‘one-minute proof’ of undecidability

Consider any programming language supporting programs as data [...], which has some sort of conditional (if . . . then . . . else . . . ) and includes at least one non-terminating program (which we denote loop). Consider the decision problem of determining whether a program X diverges on itself, that is, X(X) = ⊥, where ⊥ denotes a non-halting computation. Suppose A were a program that purported to return true (T) for (exactly) all such X. Then A would perforce fail to answer correctly regarding the behavior of the following (Lisp-ish) program: C(Y ) := if A(Y ) then T else loop(), since we would be faced with the following contradiction: C(C) returns T ⇔ A(C) returns T ⇔ C(C) diverges.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 34/ 37

slide-46
SLIDE 46

Partial Functions

Partial Functions

Nachum Dershowitz (2005): full ‘one-minute proof’ of undecidability

Consider any programming language supporting programs as data [...], which has some sort of conditional (if . . . then . . . else . . . ) and includes at least one non-terminating program (which we denote loop). Consider the decision problem of determining whether a program X diverges on itself, that is, X(X) = ⊥, where ⊥ denotes a non-halting computation. Suppose A were a program that purported to return true (T) for (exactly) all such X. Then A would perforce fail to answer correctly regarding the behavior of the following (Lisp-ish) program: C(Y ) := if A(Y ) then T else loop(), since we would be faced with the following contradiction: C(C) returns T ⇔ A(C) returns T ⇔ C(C) diverges.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 34/ 37

slide-47
SLIDE 47

Discussion

Martin-L¨

  • f Type Theory and Curry Howard Isomorphism

Inductive Data Types and Universes Steps towards the Mahlo Universe Extended Predicative Mahlo Curry-Howard isomorphism Partial Functions Discussion

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 35/ 37

slide-48
SLIDE 48

Discussion

Discussion

◮ The introduction of partial functions sould be seen as one of the

major conceptional advances in Mathematics in the XXth century.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 36/ 37

slide-49
SLIDE 49

Discussion

Discussion

◮ The introduction of partial functions sould be seen as one of the

major conceptional advances in Mathematics in the XXth century.

◮ As shown, the idea of partial functions is fundamental for the

extended predicative construction of a Mahlo Universe.

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 36/ 37

slide-50
SLIDE 50

Discussion

Discussion

◮ The introduction of partial functions sould be seen as one of the

major conceptional advances in Mathematics in the XXth century.

◮ As shown, the idea of partial functions is fundamental for the

extended predicative construction of a Mahlo Universe.

Question

How could the Curry-Howard isomorphism be extended to partial functions?

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 36/ 37

slide-51
SLIDE 51

Discussion

Discussion

Question

What could be partial proofs?

Reinhard Kahle, Anton Setzer The limits of the Curry-Howard isomorphism 37/ 37