Computational content of proofs involving coinduction Helmut - - PowerPoint PPT Presentation

computational content of proofs involving coinduction
SMART_READER_LITE
LIVE PREVIEW

Computational content of proofs involving coinduction Helmut - - PowerPoint PPT Presentation

Computational content of proofs involving coinduction Helmut Schwichtenberg (j.w.w. Kenji Miyamoto and Fredrik Nordvall Forsberg) Mathematisches Institut, LMU, M unchen Advances in Proof Theory, Universit at Bern, 13.-14. Dezember 2013


slide-1
SLIDE 1

Computational content of proofs involving coinduction

Helmut Schwichtenberg (j.w.w. Kenji Miyamoto and Fredrik Nordvall Forsberg)

Mathematisches Institut, LMU, M¨ unchen

Advances in Proof Theory, Universit¨ at Bern, 13.-14. Dezember 2013

1 / 26

slide-2
SLIDE 2

Computable functionals

Arguments of any finite type, not only numbers and functions.

◮ Principle of finite support. If H(Φ) is defined with value n,

then there is a finite approximation Φ0 of Φ such that H(Φ0) is defined with value n.

◮ Monotonicity principle. If H(Φ) is defined with value n and Φ′

extends Φ, then also H(Φ′) is defined with value n.

◮ Effectivity principle. An object is computable iff its set of

finite approximations is (primitive) recursively enumerable (or equivalently, Σ0

1-definable).

2 / 26

slide-3
SLIDE 3

Computable functionals

Arguments of any finite type, not only numbers and functions.

◮ Principle of finite support. If H(Φ) is defined with value n,

then there is a finite approximation Φ0 of Φ such that H(Φ0) is defined with value n.

◮ Monotonicity principle. If H(Φ) is defined with value n and Φ′

extends Φ, then also H(Φ′) is defined with value n.

◮ Effectivity principle. An object is computable iff its set of

finite approximations is (primitive) recursively enumerable (or equivalently, Σ0

1-definable).

2 / 26

slide-4
SLIDE 4

Computable functionals

Arguments of any finite type, not only numbers and functions.

◮ Principle of finite support. If H(Φ) is defined with value n,

then there is a finite approximation Φ0 of Φ such that H(Φ0) is defined with value n.

◮ Monotonicity principle. If H(Φ) is defined with value n and Φ′

extends Φ, then also H(Φ′) is defined with value n.

◮ Effectivity principle. An object is computable iff its set of

finite approximations is (primitive) recursively enumerable (or equivalently, Σ0

1-definable).

2 / 26

slide-5
SLIDE 5

Computable functionals

Arguments of any finite type, not only numbers and functions.

◮ Principle of finite support. If H(Φ) is defined with value n,

then there is a finite approximation Φ0 of Φ such that H(Φ0) is defined with value n.

◮ Monotonicity principle. If H(Φ) is defined with value n and Φ′

extends Φ, then also H(Φ′) is defined with value n.

◮ Effectivity principle. An object is computable iff its set of

finite approximations is (primitive) recursively enumerable (or equivalently, Σ0

1-definable).

2 / 26

slide-6
SLIDE 6

Computable functionals

Arguments of any finite type, not only numbers and functions.

◮ Principle of finite support. If H(Φ) is defined with value n,

then there is a finite approximation Φ0 of Φ such that H(Φ0) is defined with value n.

◮ Monotonicity principle. If H(Φ) is defined with value n and Φ′

extends Φ, then also H(Φ′) is defined with value n.

◮ Effectivity principle. An object is computable iff its set of

finite approximations is (primitive) recursively enumerable (or equivalently, Σ0

1-definable).

2 / 26

slide-7
SLIDE 7

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-8
SLIDE 8

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-9
SLIDE 9

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-10
SLIDE 10

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-11
SLIDE 11

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-12
SLIDE 12

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-13
SLIDE 13

Tokens, consistency and entailment at base types

Types

◮ Base types ι: free algebras, given by constructors (e.g. 0, S). ◮ Function types: ρ → σ.

Example: ι := D (derivations, or binary trees), by constructors ◦ (leaf, or nil) and C : D → D → D (branch, or cons).

◮ Token aD: ◦, C∗◦, C◦∗, C(C∗◦)◦. ◮ UD := {a1, . . . , an} consistent if

◮ all ai start with the same constructor, ◮ (proper) tokens at j-th argument positions are consistent

(example: {C∗◦, C◦∗}).

◮ UD ⊢ a (entails) if

◮ all ai ∈ U and a start with the same constructor, ◮ (proper) tokens at j-th argument positions of ai entail j-th

argument of a (example: {C∗◦, C◦∗} ⊢ C◦◦).

An ideal xρ is a (possibly infinite) set of tokens which is

◮ consistent and ◮ closed under entailment.

3 / 26

slide-14
SLIDE 14

Tokens and entailment for N

  • S∗

❅ ❅ ❅

  • S0
  • S(S∗)

❅ ❅ ❅

  • S(S0)
  • S(S(S∗))

❅ ❅ ❅

  • S(S(S0))
  • ...

{a} ⊢ b iff there is a path from a (up) to b (down).

4 / 26

slide-15
SLIDE 15

Total and cototal ideals of base type

An ideal xι is cototal if every constructor tree P(∗) ∈ x has a “≻1-predecessor” P(C ∗ ) ∈ x; it is total if it is cototal and the relation ≻1 on x is well-founded.

  • Examples. N:

◮ Every total ideal is the deductive closure of a token

S(S . . . (S0) . . . ). The set of all tokens S(S . . . (S∗) . . . ) is a cototal ideal. D (derivations):

◮ Total ideal ∼ finite derivation. ◮ Cototal ideal ∼ finite or infinite “locally correct” derivation

[Mints 78].

◮ Arbitrary ideal ∼ incomplete derivation, with “holes”.

5 / 26

slide-16
SLIDE 16

Total and cototal ideals of base type

An ideal xι is cototal if every constructor tree P(∗) ∈ x has a “≻1-predecessor” P(C ∗ ) ∈ x; it is total if it is cototal and the relation ≻1 on x is well-founded.

  • Examples. N:

◮ Every total ideal is the deductive closure of a token

S(S . . . (S0) . . . ). The set of all tokens S(S . . . (S∗) . . . ) is a cototal ideal. D (derivations):

◮ Total ideal ∼ finite derivation. ◮ Cototal ideal ∼ finite or infinite “locally correct” derivation

[Mints 78].

◮ Arbitrary ideal ∼ incomplete derivation, with “holes”.

5 / 26

slide-17
SLIDE 17

Total and cototal ideals of base type

An ideal xι is cototal if every constructor tree P(∗) ∈ x has a “≻1-predecessor” P(C ∗ ) ∈ x; it is total if it is cototal and the relation ≻1 on x is well-founded.

  • Examples. N:

◮ Every total ideal is the deductive closure of a token

S(S . . . (S0) . . . ). The set of all tokens S(S . . . (S∗) . . . ) is a cototal ideal. D (derivations):

◮ Total ideal ∼ finite derivation. ◮ Cototal ideal ∼ finite or infinite “locally correct” derivation

[Mints 78].

◮ Arbitrary ideal ∼ incomplete derivation, with “holes”.

5 / 26

slide-18
SLIDE 18

Total and cototal ideals of base type

An ideal xι is cototal if every constructor tree P(∗) ∈ x has a “≻1-predecessor” P(C ∗ ) ∈ x; it is total if it is cototal and the relation ≻1 on x is well-founded.

  • Examples. N:

◮ Every total ideal is the deductive closure of a token

S(S . . . (S0) . . . ). The set of all tokens S(S . . . (S∗) . . . ) is a cototal ideal. D (derivations):

◮ Total ideal ∼ finite derivation. ◮ Cototal ideal ∼ finite or infinite “locally correct” derivation

[Mints 78].

◮ Arbitrary ideal ∼ incomplete derivation, with “holes”.

5 / 26

slide-19
SLIDE 19

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-20
SLIDE 20

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-21
SLIDE 21

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-22
SLIDE 22

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-23
SLIDE 23

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-24
SLIDE 24

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-25
SLIDE 25

Tokens, consistency and entailment at function types

Ideals: partial continuous functionals f ρ→σ (Scott, Ershov).

◮ Tokens of type ρ → σ are pairs (U, a) with U ∈ Conρ. ◮ { (Ui, ai) | i ∈ I } ∈ Conρ→σ means

∀J⊆I(

j∈J Uj ∈ Conρ → { aj | j ∈ J } ∈ Conσ).

“Formal neighborhood”.

◮ W ⊢ρ→σ (U, a) means WU ⊢σ a, where application WU of

W = { (Ui, ai) | i ∈ I } to U is { ai | U ⊢ρ Ui }. Application of f ρ→σ to xρ is f (x) := { aσ | ∃U⊆x(U, a) ∈ f }. Principles of finite support and monotonicity hold.

6 / 26

slide-26
SLIDE 26

Computable functionals

A partial continuous functional f ρ is computable if it is a (primitive) recursively enumerable set of tokens. How to define computable functionals? By computation rules D Pi( yi) = Mi (i = 1, . . . , n) with free variables of Pi( yi) and Mi among yi, where Pi( yi) are “constructor patterns”. Terms (a common extension of G¨

  • del’s T and Plotkin’s PCF)

M, N ::= xρ | Cρ | Dρ | (λxρMσ)ρ→σ | (Mρ→σNρ)σ.

7 / 26

slide-27
SLIDE 27

Computable functionals

A partial continuous functional f ρ is computable if it is a (primitive) recursively enumerable set of tokens. How to define computable functionals? By computation rules D Pi( yi) = Mi (i = 1, . . . , n) with free variables of Pi( yi) and Mi among yi, where Pi( yi) are “constructor patterns”. Terms (a common extension of G¨

  • del’s T and Plotkin’s PCF)

M, N ::= xρ | Cρ | Dρ | (λxρMσ)ρ→σ | (Mρ→σNρ)σ.

7 / 26

slide-28
SLIDE 28

Computable functionals

A partial continuous functional f ρ is computable if it is a (primitive) recursively enumerable set of tokens. How to define computable functionals? By computation rules D Pi( yi) = Mi (i = 1, . . . , n) with free variables of Pi( yi) and Mi among yi, where Pi( yi) are “constructor patterns”. Terms (a common extension of G¨

  • del’s T and Plotkin’s PCF)

M, N ::= xρ | Cρ | Dρ | (λxρMσ)ρ→σ | (Mρ→σNρ)σ.

7 / 26

slide-29
SLIDE 29

Computable functionals

A partial continuous functional f ρ is computable if it is a (primitive) recursively enumerable set of tokens. How to define computable functionals? By computation rules D Pi( yi) = Mi (i = 1, . . . , n) with free variables of Pi( yi) and Mi among yi, where Pi( yi) are “constructor patterns”. Terms (a common extension of G¨

  • del’s T and Plotkin’s PCF)

M, N ::= xρ | Cρ | Dρ | (λxρMσ)ρ→σ | (Mρ→σNρ)σ.

7 / 26

slide-30
SLIDE 30

Computable functionals

A partial continuous functional f ρ is computable if it is a (primitive) recursively enumerable set of tokens. How to define computable functionals? By computation rules D Pi( yi) = Mi (i = 1, . . . , n) with free variables of Pi( yi) and Mi among yi, where Pi( yi) are “constructor patterns”. Terms (a common extension of G¨

  • del’s T and Plotkin’s PCF)

M, N ::= xρ | Cρ | Dρ | (λxρMσ)ρ→σ | (Mρ→σNρ)σ.

7 / 26

slide-31
SLIDE 31

Examples

+: N → N → N defined by n + 0 = n, n + Sm = S(n + m). Y : (τ → τ) → τ defined by Yf = f (Yf ). Rτ

N : N → τ → (N → τ → τ) → τ defined by

N0xf = x,

N(Sn)xf = fx(Rτ Nnxf ).

Reduction (including β, η) is non-terminating, but confluent.

8 / 26

slide-32
SLIDE 32

Examples

+: N → N → N defined by n + 0 = n, n + Sm = S(n + m). Y : (τ → τ) → τ defined by Yf = f (Yf ). Rτ

N : N → τ → (N → τ → τ) → τ defined by

N0xf = x,

N(Sn)xf = fx(Rτ Nnxf ).

Reduction (including β, η) is non-terminating, but confluent.

8 / 26

slide-33
SLIDE 33

Examples

+: N → N → N defined by n + 0 = n, n + Sm = S(n + m). Y : (τ → τ) → τ defined by Yf = f (Yf ). Rτ

N : N → τ → (N → τ → τ) → τ defined by

N0xf = x,

N(Sn)xf = fx(Rτ Nnxf ).

Reduction (including β, η) is non-terminating, but confluent.

8 / 26

slide-34
SLIDE 34

Examples

+: N → N → N defined by n + 0 = n, n + Sm = S(n + m). Y : (τ → τ) → τ defined by Yf = f (Yf ). Rτ

N : N → τ → (N → τ → τ) → τ defined by

N0xf = x,

N(Sn)xf = fx(Rτ Nnxf ).

Reduction (including β, η) is non-terminating, but confluent.

8 / 26

slide-35
SLIDE 35

Denotational semantics

How to use computation rules to define a computable functional? Inductively define ( U, a) ∈ [ [λ

xM]

] (FV(M) ⊆ { x }). Case λ

x,y, zM with

x free in M, but not y. ( U, W , a) ∈ [ [λ

x, zM]

] ( U, V , W , a) ∈ [ [λ

x,y, zM]

] (K). Case λ

xM with

x the free variables in M. U ⊢ a (U, a) ∈ [ [λxx] ](V ), ( U, V , a) ∈ [ [λ

xM]

] ( U, V ) ⊆ [ [λ

xN]

] ( U, a) ∈ [ [λ

x(MN)]

] (A). For every constructor C and defined constant D:

  • U ⊢

a∗ ( U, C a∗) ∈ [ [C] ] (C), ( V , a) ∈ [ [λ

xM]

]

  • U ⊢

P( V ) ( U, a) ∈ [ [D] ] (D), with one rule (D) for every defining equation D P( x ) = M.

9 / 26

slide-36
SLIDE 36

Denotational semantics

How to use computation rules to define a computable functional? Inductively define ( U, a) ∈ [ [λ

xM]

] (FV(M) ⊆ { x }). Case λ

x,y, zM with

x free in M, but not y. ( U, W , a) ∈ [ [λ

x, zM]

] ( U, V , W , a) ∈ [ [λ

x,y, zM]

] (K). Case λ

xM with

x the free variables in M. U ⊢ a (U, a) ∈ [ [λxx] ](V ), ( U, V , a) ∈ [ [λ

xM]

] ( U, V ) ⊆ [ [λ

xN]

] ( U, a) ∈ [ [λ

x(MN)]

] (A). For every constructor C and defined constant D:

  • U ⊢

a∗ ( U, C a∗) ∈ [ [C] ] (C), ( V , a) ∈ [ [λ

xM]

]

  • U ⊢

P( V ) ( U, a) ∈ [ [D] ] (D), with one rule (D) for every defining equation D P( x ) = M.

9 / 26

slide-37
SLIDE 37

Denotational semantics

How to use computation rules to define a computable functional? Inductively define ( U, a) ∈ [ [λ

xM]

] (FV(M) ⊆ { x }). Case λ

x,y, zM with

x free in M, but not y. ( U, W , a) ∈ [ [λ

x, zM]

] ( U, V , W , a) ∈ [ [λ

x,y, zM]

] (K). Case λ

xM with

x the free variables in M. U ⊢ a (U, a) ∈ [ [λxx] ](V ), ( U, V , a) ∈ [ [λ

xM]

] ( U, V ) ⊆ [ [λ

xN]

] ( U, a) ∈ [ [λ

x(MN)]

] (A). For every constructor C and defined constant D:

  • U ⊢

a∗ ( U, C a∗) ∈ [ [C] ] (C), ( V , a) ∈ [ [λ

xM]

]

  • U ⊢

P( V ) ( U, a) ∈ [ [D] ] (D), with one rule (D) for every defining equation D P( x ) = M.

9 / 26

slide-38
SLIDE 38

Denotational semantics

How to use computation rules to define a computable functional? Inductively define ( U, a) ∈ [ [λ

xM]

] (FV(M) ⊆ { x }). Case λ

x,y, zM with

x free in M, but not y. ( U, W , a) ∈ [ [λ

x, zM]

] ( U, V , W , a) ∈ [ [λ

x,y, zM]

] (K). Case λ

xM with

x the free variables in M. U ⊢ a (U, a) ∈ [ [λxx] ](V ), ( U, V , a) ∈ [ [λ

xM]

] ( U, V ) ⊆ [ [λ

xN]

] ( U, a) ∈ [ [λ

x(MN)]

] (A). For every constructor C and defined constant D:

  • U ⊢

a∗ ( U, C a∗) ∈ [ [C] ] (C), ( V , a) ∈ [ [λ

xM]

]

  • U ⊢

P( V ) ( U, a) ∈ [ [D] ] (D), with one rule (D) for every defining equation D P( x ) = M.

9 / 26

slide-39
SLIDE 39

Denotational semantics

How to use computation rules to define a computable functional? Inductively define ( U, a) ∈ [ [λ

xM]

] (FV(M) ⊆ { x }). Case λ

x,y, zM with

x free in M, but not y. ( U, W , a) ∈ [ [λ

x, zM]

] ( U, V , W , a) ∈ [ [λ

x,y, zM]

] (K). Case λ

xM with

x the free variables in M. U ⊢ a (U, a) ∈ [ [λxx] ](V ), ( U, V , a) ∈ [ [λ

xM]

] ( U, V ) ⊆ [ [λ

xN]

] ( U, a) ∈ [ [λ

x(MN)]

] (A). For every constructor C and defined constant D:

  • U ⊢

a∗ ( U, C a∗) ∈ [ [C] ] (C), ( V , a) ∈ [ [λ

xM]

]

  • U ⊢

P( V ) ( U, a) ∈ [ [D] ] (D), with one rule (D) for every defining equation D P( x ) = M.

9 / 26

slide-40
SLIDE 40

Denotational semantics

How to use computation rules to define a computable functional? Inductively define ( U, a) ∈ [ [λ

xM]

] (FV(M) ⊆ { x }). Case λ

x,y, zM with

x free in M, but not y. ( U, W , a) ∈ [ [λ

x, zM]

] ( U, V , W , a) ∈ [ [λ

x,y, zM]

] (K). Case λ

xM with

x the free variables in M. U ⊢ a (U, a) ∈ [ [λxx] ](V ), ( U, V , a) ∈ [ [λ

xM]

] ( U, V ) ⊆ [ [λ

xN]

] ( U, a) ∈ [ [λ

x(MN)]

] (A). For every constructor C and defined constant D:

  • U ⊢

a∗ ( U, C a∗) ∈ [ [C] ] (C), ( V , a) ∈ [ [λ

xM]

]

  • U ⊢

P( V ) ( U, a) ∈ [ [D] ] (D), with one rule (D) for every defining equation D P( x ) = M.

9 / 26

slide-41
SLIDE 41

Properties of the denotational semantics

◮ The value is preserved under standard β, η-conversion and the

computation rules.

◮ An adequacy theorem holds: whenever a closed term Mι has a

proper token in its denotation [ [M] ], then M (head) reduces to a constructor term entailing this token.

10 / 26

slide-42
SLIDE 42

Properties of the denotational semantics

◮ The value is preserved under standard β, η-conversion and the

computation rules.

◮ An adequacy theorem holds: whenever a closed term Mι has a

proper token in its denotation [ [M] ], then M (head) reduces to a constructor term entailing this token.

10 / 26

slide-43
SLIDE 43

Properties of the denotational semantics

◮ The value is preserved under standard β, η-conversion and the

computation rules.

◮ An adequacy theorem holds: whenever a closed term Mι has a

proper token in its denotation [ [M] ], then M (head) reduces to a constructor term entailing this token.

10 / 26

slide-44
SLIDE 44

A theory of computable functionals (TCF)

A variant of HAω. Formulas A and predicates P are defined simultaneously A, B ::= P r | A → B | ∀xA P ::= X | { x | A } | I (I inductively defined). ∀XA not allowed, since this would be impredicative: in the predicate existence axiom P := { x | A } the formula A could contain quantifiers with the newly created P in its range. ∀xρA is unproblematic: no such existence axioms.

11 / 26

slide-45
SLIDE 45

A theory of computable functionals (TCF)

A variant of HAω. Formulas A and predicates P are defined simultaneously A, B ::= P r | A → B | ∀xA P ::= X | { x | A } | I (I inductively defined). ∀XA not allowed, since this would be impredicative: in the predicate existence axiom P := { x | A } the formula A could contain quantifiers with the newly created P in its range. ∀xρA is unproblematic: no such existence axioms.

11 / 26

slide-46
SLIDE 46

A theory of computable functionals (TCF)

A variant of HAω. Formulas A and predicates P are defined simultaneously A, B ::= P r | A → B | ∀xA P ::= X | { x | A } | I (I inductively defined). ∀XA not allowed, since this would be impredicative: in the predicate existence axiom P := { x | A } the formula A could contain quantifiers with the newly created P in its range. ∀xρA is unproblematic: no such existence axioms.

11 / 26

slide-47
SLIDE 47

A theory of computable functionals (TCF)

A variant of HAω. Formulas A and predicates P are defined simultaneously A, B ::= P r | A → B | ∀xA P ::= X | { x | A } | I (I inductively defined). ∀XA not allowed, since this would be impredicative: in the predicate existence axiom P := { x | A } the formula A could contain quantifiers with the newly created P in its range. ∀xρA is unproblematic: no such existence axioms.

11 / 26

slide-48
SLIDE 48

A theory of computable functionals (TCF)

A variant of HAω. Formulas A and predicates P are defined simultaneously A, B ::= P r | A → B | ∀xA P ::= X | { x | A } | I (I inductively defined). ∀XA not allowed, since this would be impredicative: in the predicate existence axiom P := { x | A } the formula A could contain quantifiers with the newly created P in its range. ∀xρA is unproblematic: no such existence axioms.

11 / 26

slide-49
SLIDE 49

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-50
SLIDE 50

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-51
SLIDE 51

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-52
SLIDE 52

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-53
SLIDE 53

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-54
SLIDE 54

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-55
SLIDE 55

Brouwer - Heyting - Kolmogorov

Have →±, ∀±, I ±. BHK-interpretation:

◮ p proves A → B iff p is a construction transforming any proof

q of A into a proof p(q) of B.

◮ p proves ∀xρA(x) iff p is a construction such that for all aρ,

p(a) proves A(a). Leaves open:

◮ What is a “construction”? ◮ What is a proof of a prime formula?

Proposal:

◮ Construction: computable functional. ◮ Proof of a prime formula I

r: generation tree. Example: generation tree for Even(6) should consist of a single branch with nodes Even(0), Even(2), Even(4) and Even(6).

12 / 26

slide-56
SLIDE 56

The type τ(A) of a formula A

Distinguish non-computational (n.c.) (or Harrop) and computationally relevant (c.r.) formulas. Example:

◮ r = s is n.c. ◮ Even(n) is c.r.

Extend the use of ρ → σ to the “nulltype symbol” ◦: (ρ → ◦) := ◦, (◦ → σ) := σ, (◦ → ◦) := ◦. Define the type τ(A) of a formula A by τ(I r ) =

  • ιI

if I is c.r.,

  • if I is n.c.,

τ(A → B) := τ(A) → τ(B), τ(∀xρA) := ρ → τ(A) with ιI associated naturally with I.

13 / 26

slide-57
SLIDE 57

The type τ(A) of a formula A

Distinguish non-computational (n.c.) (or Harrop) and computationally relevant (c.r.) formulas. Example:

◮ r = s is n.c. ◮ Even(n) is c.r.

Extend the use of ρ → σ to the “nulltype symbol” ◦: (ρ → ◦) := ◦, (◦ → σ) := σ, (◦ → ◦) := ◦. Define the type τ(A) of a formula A by τ(I r ) =

  • ιI

if I is c.r.,

  • if I is n.c.,

τ(A → B) := τ(A) → τ(B), τ(∀xρA) := ρ → τ(A) with ιI associated naturally with I.

13 / 26

slide-58
SLIDE 58

The type τ(A) of a formula A

Distinguish non-computational (n.c.) (or Harrop) and computationally relevant (c.r.) formulas. Example:

◮ r = s is n.c. ◮ Even(n) is c.r.

Extend the use of ρ → σ to the “nulltype symbol” ◦: (ρ → ◦) := ◦, (◦ → σ) := σ, (◦ → ◦) := ◦. Define the type τ(A) of a formula A by τ(I r ) =

  • ιI

if I is c.r.,

  • if I is n.c.,

τ(A → B) := τ(A) → τ(B), τ(∀xρA) := ρ → τ(A) with ιI associated naturally with I.

13 / 26

slide-59
SLIDE 59

The type τ(A) of a formula A

Distinguish non-computational (n.c.) (or Harrop) and computationally relevant (c.r.) formulas. Example:

◮ r = s is n.c. ◮ Even(n) is c.r.

Extend the use of ρ → σ to the “nulltype symbol” ◦: (ρ → ◦) := ◦, (◦ → σ) := σ, (◦ → ◦) := ◦. Define the type τ(A) of a formula A by τ(I r ) =

  • ιI

if I is c.r.,

  • if I is n.c.,

τ(A → B) := τ(A) → τ(B), τ(∀xρA) := ρ → τ(A) with ιI associated naturally with I.

13 / 26

slide-60
SLIDE 60

The type τ(A) of a formula A

Distinguish non-computational (n.c.) (or Harrop) and computationally relevant (c.r.) formulas. Example:

◮ r = s is n.c. ◮ Even(n) is c.r.

Extend the use of ρ → σ to the “nulltype symbol” ◦: (ρ → ◦) := ◦, (◦ → σ) := σ, (◦ → ◦) := ◦. Define the type τ(A) of a formula A by τ(I r ) =

  • ιI

if I is c.r.,

  • if I is n.c.,

τ(A → B) := τ(A) → τ(B), τ(∀xρA) := ρ → τ(A) with ιI associated naturally with I.

13 / 26

slide-61
SLIDE 61

Realizability

Introduce a special nullterm symbol ε to be used as a “realizer” for n.c. formulas. Extend term application to ε by εt := ε, tε := t, εε := ε.

Definition (t r A, t realizes A)

Let A be a formula and t either a term of type τ(A) if the latter is a type, or the nullterm symbol ε for n.c. A. t r I s :=

  • I rt

s if I is c.r. (I r inductively defined), I s if I is n.c., t r (A → B) := ∀x(x r A → tx r B), t r ∀xA := ∀x(tx r A).

14 / 26

slide-62
SLIDE 62

Realizability

Introduce a special nullterm symbol ε to be used as a “realizer” for n.c. formulas. Extend term application to ε by εt := ε, tε := t, εε := ε.

Definition (t r A, t realizes A)

Let A be a formula and t either a term of type τ(A) if the latter is a type, or the nullterm symbol ε for n.c. A. t r I s :=

  • I rt

s if I is c.r. (I r inductively defined), I s if I is n.c., t r (A → B) := ∀x(x r A → tx r B), t r ∀xA := ∀x(tx r A).

14 / 26

slide-63
SLIDE 63

Realizability

Introduce a special nullterm symbol ε to be used as a “realizer” for n.c. formulas. Extend term application to ε by εt := ε, tε := t, εε := ε.

Definition (t r A, t realizes A)

Let A be a formula and t either a term of type τ(A) if the latter is a type, or the nullterm symbol ε for n.c. A. t r I s :=

  • I rt

s if I is c.r. (I r inductively defined), I s if I is n.c., t r (A → B) := ∀x(x r A → tx r B), t r ∀xA := ∀x(tx r A).

14 / 26

slide-64
SLIDE 64

Realizability

Introduce a special nullterm symbol ε to be used as a “realizer” for n.c. formulas. Extend term application to ε by εt := ε, tε := t, εε := ε.

Definition (t r A, t realizes A)

Let A be a formula and t either a term of type τ(A) if the latter is a type, or the nullterm symbol ε for n.c. A. t r I s :=

  • I rt

s if I is c.r. (I r inductively defined), I s if I is n.c., t r (A → B) := ∀x(x r A → tx r B), t r ∀xA := ∀x(tx r A).

14 / 26

slide-65
SLIDE 65

Realizability

Introduce a special nullterm symbol ε to be used as a “realizer” for n.c. formulas. Extend term application to ε by εt := ε, tε := t, εε := ε.

Definition (t r A, t realizes A)

Let A be a formula and t either a term of type τ(A) if the latter is a type, or the nullterm symbol ε for n.c. A. t r I s :=

  • I rt

s if I is c.r. (I r inductively defined), I s if I is n.c., t r (A → B) := ∀x(x r A → tx r B), t r ∀xA := ∀x(tx r A).

14 / 26

slide-66
SLIDE 66

Extracted terms, soundness theorem

For a derivation M of a formula A define its extracted term et(M),

  • f type τ(A). For MA with A n.c. let et(MA) := ε. Else

et(uA) := xτ(A)

u

(xτ(A)

u

uniquely associated to uA), et((λuAMB)A→B) := λxτ(A)

u

et(M), et((MA→BNA)B) := et(M)et(N), et((λxρMA)∀xA) := λxρet(M), et((M∀xA(x)r)A(r)) := et(M)r. Extracted terms for the axioms: let I be c.r. et(I +

i ) := Ci,

et(I −) := R, where both the constructor Ci and the recursion operator R refer to the algebra ιI associated with I.

  • Soundness. Let M be a derivation of A from assumptions ui : Ci.

Then we can derive et(M) r A from assumptions xui r Ci.

15 / 26

slide-67
SLIDE 67

Extracted terms, soundness theorem

For a derivation M of a formula A define its extracted term et(M),

  • f type τ(A). For MA with A n.c. let et(MA) := ε. Else

et(uA) := xτ(A)

u

(xτ(A)

u

uniquely associated to uA), et((λuAMB)A→B) := λxτ(A)

u

et(M), et((MA→BNA)B) := et(M)et(N), et((λxρMA)∀xA) := λxρet(M), et((M∀xA(x)r)A(r)) := et(M)r. Extracted terms for the axioms: let I be c.r. et(I +

i ) := Ci,

et(I −) := R, where both the constructor Ci and the recursion operator R refer to the algebra ιI associated with I.

  • Soundness. Let M be a derivation of A from assumptions ui : Ci.

Then we can derive et(M) r A from assumptions xui r Ci.

15 / 26

slide-68
SLIDE 68

Extracted terms, soundness theorem

For a derivation M of a formula A define its extracted term et(M),

  • f type τ(A). For MA with A n.c. let et(MA) := ε. Else

et(uA) := xτ(A)

u

(xτ(A)

u

uniquely associated to uA), et((λuAMB)A→B) := λxτ(A)

u

et(M), et((MA→BNA)B) := et(M)et(N), et((λxρMA)∀xA) := λxρet(M), et((M∀xA(x)r)A(r)) := et(M)r. Extracted terms for the axioms: let I be c.r. et(I +

i ) := Ci,

et(I −) := R, where both the constructor Ci and the recursion operator R refer to the algebra ιI associated with I.

  • Soundness. Let M be a derivation of A from assumptions ui : Ci.

Then we can derive et(M) r A from assumptions xui r Ci.

15 / 26

slide-69
SLIDE 69

Extracted terms, soundness theorem

For a derivation M of a formula A define its extracted term et(M),

  • f type τ(A). For MA with A n.c. let et(MA) := ε. Else

et(uA) := xτ(A)

u

(xτ(A)

u

uniquely associated to uA), et((λuAMB)A→B) := λxτ(A)

u

et(M), et((MA→BNA)B) := et(M)et(N), et((λxρMA)∀xA) := λxρet(M), et((M∀xA(x)r)A(r)) := et(M)r. Extracted terms for the axioms: let I be c.r. et(I +

i ) := Ci,

et(I −) := R, where both the constructor Ci and the recursion operator R refer to the algebra ιI associated with I.

  • Soundness. Let M be a derivation of A from assumptions ui : Ci.

Then we can derive et(M) r A from assumptions xui r Ci.

15 / 26

slide-70
SLIDE 70

Extracted terms, soundness theorem

For a derivation M of a formula A define its extracted term et(M),

  • f type τ(A). For MA with A n.c. let et(MA) := ε. Else

et(uA) := xτ(A)

u

(xτ(A)

u

uniquely associated to uA), et((λuAMB)A→B) := λxτ(A)

u

et(M), et((MA→BNA)B) := et(M)et(N), et((λxρMA)∀xA) := λxρet(M), et((M∀xA(x)r)A(r)) := et(M)r. Extracted terms for the axioms: let I be c.r. et(I +

i ) := Ci,

et(I −) := R, where both the constructor Ci and the recursion operator R refer to the algebra ιI associated with I.

  • Soundness. Let M be a derivation of A from assumptions ui : Ci.

Then we can derive et(M) r A from assumptions xui r Ci.

15 / 26

slide-71
SLIDE 71

Extracted terms, soundness theorem

For a derivation M of a formula A define its extracted term et(M),

  • f type τ(A). For MA with A n.c. let et(MA) := ε. Else

et(uA) := xτ(A)

u

(xτ(A)

u

uniquely associated to uA), et((λuAMB)A→B) := λxτ(A)

u

et(M), et((MA→BNA)B) := et(M)et(N), et((λxρMA)∀xA) := λxρet(M), et((M∀xA(x)r)A(r)) := et(M)r. Extracted terms for the axioms: let I be c.r. et(I +

i ) := Ci,

et(I −) := R, where both the constructor Ci and the recursion operator R refer to the algebra ιI associated with I.

  • Soundness. Let M be a derivation of A from assumptions ui : Ci.

Then we can derive et(M) r A from assumptions xui r Ci.

15 / 26

slide-72
SLIDE 72

Relation of TCF to type theory

◮ Main difference: partial functionals are first class citizens. ◮ “Logic enriched”: Formulas and types kept separate. ◮ Minimal logic: →, ∀ only. x = y (Leibniz equality), ∃, ∨, ∧

inductively defined (Martin-L¨

  • f).

◮ ⊥ := (False = True). Ex-falso-quodlibet: ⊥ → A provable. ◮ “Decorations” →nc, ∀nc (i) allow abstract theory (ii) remove

unused data.

16 / 26

slide-73
SLIDE 73

Relation of TCF to type theory

◮ Main difference: partial functionals are first class citizens. ◮ “Logic enriched”: Formulas and types kept separate. ◮ Minimal logic: →, ∀ only. x = y (Leibniz equality), ∃, ∨, ∧

inductively defined (Martin-L¨

  • f).

◮ ⊥ := (False = True). Ex-falso-quodlibet: ⊥ → A provable. ◮ “Decorations” →nc, ∀nc (i) allow abstract theory (ii) remove

unused data.

16 / 26

slide-74
SLIDE 74

Relation of TCF to type theory

◮ Main difference: partial functionals are first class citizens. ◮ “Logic enriched”: Formulas and types kept separate. ◮ Minimal logic: →, ∀ only. x = y (Leibniz equality), ∃, ∨, ∧

inductively defined (Martin-L¨

  • f).

◮ ⊥ := (False = True). Ex-falso-quodlibet: ⊥ → A provable. ◮ “Decorations” →nc, ∀nc (i) allow abstract theory (ii) remove

unused data.

16 / 26

slide-75
SLIDE 75

Relation of TCF to type theory

◮ Main difference: partial functionals are first class citizens. ◮ “Logic enriched”: Formulas and types kept separate. ◮ Minimal logic: →, ∀ only. x = y (Leibniz equality), ∃, ∨, ∧

inductively defined (Martin-L¨

  • f).

◮ ⊥ := (False = True). Ex-falso-quodlibet: ⊥ → A provable. ◮ “Decorations” →nc, ∀nc (i) allow abstract theory (ii) remove

unused data.

16 / 26

slide-76
SLIDE 76

Relation of TCF to type theory

◮ Main difference: partial functionals are first class citizens. ◮ “Logic enriched”: Formulas and types kept separate. ◮ Minimal logic: →, ∀ only. x = y (Leibniz equality), ∃, ∨, ∧

inductively defined (Martin-L¨

  • f).

◮ ⊥ := (False = True). Ex-falso-quodlibet: ⊥ → A provable. ◮ “Decorations” →nc, ∀nc (i) allow abstract theory (ii) remove

unused data.

16 / 26

slide-77
SLIDE 77

Relation of TCF to type theory

◮ Main difference: partial functionals are first class citizens. ◮ “Logic enriched”: Formulas and types kept separate. ◮ Minimal logic: →, ∀ only. x = y (Leibniz equality), ∃, ∨, ∧

inductively defined (Martin-L¨

  • f).

◮ ⊥ := (False = True). Ex-falso-quodlibet: ⊥ → A provable. ◮ “Decorations” →nc, ∀nc (i) allow abstract theory (ii) remove

unused data.

16 / 26

slide-78
SLIDE 78

Case study: uniformly continuous functions (U. Berger)

◮ Formalization of an abstract theory of (uniformly) continuous

real functions f : I → I (I := [−1, 1]).

◮ Let Cf express that f is a continuous real function. Assume

the abstract theory proves Cf → ∀n∃m ∀a∃b(f [Ia,m] ⊆ Ib,n)

  • Bm,nf

with Ib,n := [b − 1

2n , b + 1 2n ]

Then n → m modulus of (uniform) continuity (ω) n, a → b approximating rational function (h)

17 / 26

slide-79
SLIDE 79

Case study: uniformly continuous functions (U. Berger)

◮ Formalization of an abstract theory of (uniformly) continuous

real functions f : I → I (I := [−1, 1]).

◮ Let Cf express that f is a continuous real function. Assume

the abstract theory proves Cf → ∀n∃m ∀a∃b(f [Ia,m] ⊆ Ib,n)

  • Bm,nf

with Ib,n := [b − 1

2n , b + 1 2n ]

Then n → m modulus of (uniform) continuity (ω) n, a → b approximating rational function (h)

17 / 26

slide-80
SLIDE 80

Case study: uniformly continuous functions (U. Berger)

◮ Formalization of an abstract theory of (uniformly) continuous

real functions f : I → I (I := [−1, 1]).

◮ Let Cf express that f is a continuous real function. Assume

the abstract theory proves Cf → ∀n∃m ∀a∃b(f [Ia,m] ⊆ Ib,n)

  • Bm,nf

with Ib,n := [b − 1

2n , b + 1 2n ]

Then n → m modulus of (uniform) continuity (ω) n, a → b approximating rational function (h)

17 / 26

slide-81
SLIDE 81

Case study: uniformly continuous functions (U. Berger)

◮ Formalization of an abstract theory of (uniformly) continuous

real functions f : I → I (I := [−1, 1]).

◮ Let Cf express that f is a continuous real function. Assume

the abstract theory proves Cf → ∀n∃m ∀a∃b(f [Ia,m] ⊆ Ib,n)

  • Bm,nf

with Ib,n := [b − 1

2n , b + 1 2n ]

Then n → m modulus of (uniform) continuity (ω) n, a → b approximating rational function (h)

17 / 26

slide-82
SLIDE 82

ReadX and its witnesses

Inductively define a predicate ReadX of arity (ϕ) by the clauses ∀nc

f ∀d(f [I] ⊆ Id → X(Outd ◦ f ) → ReadXf ),

(ReadX)+ ∀nc

f (ReadX(f ◦ In−1) → ReadX(f ◦ In0) → ReadX(f ◦ In1) →

ReadXf ). (ReadX)+

1

where Id = [ d−1

2 , d+1 2 ] (d ∈ {−1, 0, 1}) and

(Outd ◦ f )(x) := 2f (x) − d, (f ◦ Ind)(x) := f (x + d 2 ). Witnesses for ReadXf : total ideals in Rα := µξ(PutSD→α→ξ, Getξ→ξ→ξ→ξ) where SD := {−1, 0, 1}.

18 / 26

slide-83
SLIDE 83

ReadX and its witnesses

Inductively define a predicate ReadX of arity (ϕ) by the clauses ∀nc

f ∀d(f [I] ⊆ Id → X(Outd ◦ f ) → ReadXf ),

(ReadX)+ ∀nc

f (ReadX(f ◦ In−1) → ReadX(f ◦ In0) → ReadX(f ◦ In1) →

ReadXf ). (ReadX)+

1

where Id = [ d−1

2 , d+1 2 ] (d ∈ {−1, 0, 1}) and

(Outd ◦ f )(x) := 2f (x) − d, (f ◦ Ind)(x) := f (x + d 2 ). Witnesses for ReadXf : total ideals in Rα := µξ(PutSD→α→ξ, Getξ→ξ→ξ→ξ) where SD := {−1, 0, 1}.

18 / 26

slide-84
SLIDE 84

ReadX and its witnesses

Inductively define a predicate ReadX of arity (ϕ) by the clauses ∀nc

f ∀d(f [I] ⊆ Id → X(Outd ◦ f ) → ReadXf ),

(ReadX)+ ∀nc

f (ReadX(f ◦ In−1) → ReadX(f ◦ In0) → ReadX(f ◦ In1) →

ReadXf ). (ReadX)+

1

where Id = [ d−1

2 , d+1 2 ] (d ∈ {−1, 0, 1}) and

(Outd ◦ f )(x) := 2f (x) − d, (f ◦ Ind)(x) := f (x + d 2 ). Witnesses for ReadXf : total ideals in Rα := µξ(PutSD→α→ξ, Getξ→ξ→ξ→ξ) where SD := {−1, 0, 1}.

18 / 26

slide-85
SLIDE 85

Write, coWrite and its witnesses

Nested inductive definition of a predicate Write of arity (ϕ): Write(Id), ∀nc

f (ReadWritef → Write f )

(Id identity function). Witnesses for Write f : total ideals in W := µξ(Stopξ, ContRξ→ξ). Define coWrite, a companion predicate of Write, by ∀nc

f (coWrite f → f = Id ∨ ReadcoWritef ).

(coWrite)− Witnesses for coWrite f : W-cototal RW-total ideals t.

19 / 26

slide-86
SLIDE 86

Write, coWrite and its witnesses

Nested inductive definition of a predicate Write of arity (ϕ): Write(Id), ∀nc

f (ReadWritef → Write f )

(Id identity function). Witnesses for Write f : total ideals in W := µξ(Stopξ, ContRξ→ξ). Define coWrite, a companion predicate of Write, by ∀nc

f (coWrite f → f = Id ∨ ReadcoWritef ).

(coWrite)− Witnesses for coWrite f : W-cototal RW-total ideals t.

19 / 26

slide-87
SLIDE 87

Write, coWrite and its witnesses

Nested inductive definition of a predicate Write of arity (ϕ): Write(Id), ∀nc

f (ReadWritef → Write f )

(Id identity function). Witnesses for Write f : total ideals in W := µξ(Stopξ, ContRξ→ξ). Define coWrite, a companion predicate of Write, by ∀nc

f (coWrite f → f = Id ∨ ReadcoWritef ).

(coWrite)− Witnesses for coWrite f : W-cototal RW-total ideals t.

19 / 26

slide-88
SLIDE 88

Write, coWrite and its witnesses

Nested inductive definition of a predicate Write of arity (ϕ): Write(Id), ∀nc

f (ReadWritef → Write f )

(Id identity function). Witnesses for Write f : total ideals in W := µξ(Stopξ, ContRξ→ξ). Define coWrite, a companion predicate of Write, by ∀nc

f (coWrite f → f = Id ∨ ReadcoWritef ).

(coWrite)− Witnesses for coWrite f : W-cototal RW-total ideals t.

19 / 26

slide-89
SLIDE 89

Write, coWrite and its witnesses

Nested inductive definition of a predicate Write of arity (ϕ): Write(Id), ∀nc

f (ReadWritef → Write f )

(Id identity function). Witnesses for Write f : total ideals in W := µξ(Stopξ, ContRξ→ξ). Define coWrite, a companion predicate of Write, by ∀nc

f (coWrite f → f = Id ∨ ReadcoWritef ).

(coWrite)− Witnesses for coWrite f : W-cototal RW-total ideals t.

19 / 26

slide-90
SLIDE 90

W-cototal RW-total ideals

are possibly non well-founded trees t: . . .

❅ ❅

. . .

  • .

. .

  • Get
  • Cont

Stop

❅ ❅

Stop

✏ ✏ ✏ ✏ ✏ ✏ ✏

Putd

  • Get

◮ Get-Put-part: well-founded, ◮ Stop-Cont-part: not necessarily well-founded.

20 / 26

slide-91
SLIDE 91

W-cototal RW-total ideals

are possibly non well-founded trees t: . . .

❅ ❅

. . .

  • .

. .

  • Get
  • Cont

Stop

❅ ❅

Stop

✏ ✏ ✏ ✏ ✏ ✏ ✏

Putd

  • Get

◮ Get-Put-part: well-founded, ◮ Stop-Cont-part: not necessarily well-founded.

20 / 26

slide-92
SLIDE 92

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-93
SLIDE 93

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-94
SLIDE 94

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-95
SLIDE 95

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-96
SLIDE 96

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-97
SLIDE 97

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-98
SLIDE 98

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-99
SLIDE 99

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-100
SLIDE 100

W-cototal RW-total ideals as stream transformers

View them as read-write machines.

◮ Start at the root of the tree. ◮ At node Putdt, output the digit d, carry on with the tree t. ◮ At node Get t−1 t0 t1, read a digit d from the input stream

and continue with the tree td.

◮ At node Stop, return the rest of the input unprocessed as

  • utput.

◮ At node Cont t, continue with the tree t.

Output might be infinite, but RW-totality ensures that the machine can only read finitely many input digits before producing another output digit. The machine represents a continuous function.

21 / 26

slide-101
SLIDE 101

Cf implies coWrite f : informal proof

The greatest-fixed-point axiom (coWrite)+ (coinduction) is ∀nc

f (Q f → ∀nc f (Q f → f = Id ∨ ReadcoWrite∨Qf ) → coWrite f ).

Theorem [Type-1 u.c.f. into type-0 u.c.f.]. ∀nc

f (Cf → coWrite f ).

  • Proof. Assume Cf . Use (coWrite)+ with competitor C. Suffices

∀nc

f (Cf → f = Id ∨ ReadcoWrite∨Cf ). Assume Cf , in particular

Bm,2f := ∀a∃b(f [Ia,m] ⊆ Ib,2) for some m. Get rhs by Lemma 1. Lemma 1. ∀m∀nc

f (Bm,2f → Cf → ReadcoWrite∨Cf ).

  • Proof. Induction on m, using Lemma 2 in the base case.

Lemma 2 [FindSD]. ∀nc

f (B0,2f → ∃d(f [I] ⊆ Id)).

  • Proof. Assume B0,2f . Then f [I0,0] ⊆ Ib,2 for some b, by definition
  • f Bn,m. Have b ≤ − 1

4, − 1 4 ≤ b ≤ 1 4 or 1 4 ≤ b. Can determine

either of Ib,2 ⊆ I−1, Ib,2 ⊆ I0 or Ib,2 ⊆ I1, hence ∃d(f [I] ⊆ Id).

22 / 26

slide-102
SLIDE 102

Cf implies coWrite f : informal proof

The greatest-fixed-point axiom (coWrite)+ (coinduction) is ∀nc

f (Q f → ∀nc f (Q f → f = Id ∨ ReadcoWrite∨Qf ) → coWrite f ).

Theorem [Type-1 u.c.f. into type-0 u.c.f.]. ∀nc

f (Cf → coWrite f ).

  • Proof. Assume Cf . Use (coWrite)+ with competitor C. Suffices

∀nc

f (Cf → f = Id ∨ ReadcoWrite∨Cf ). Assume Cf , in particular

Bm,2f := ∀a∃b(f [Ia,m] ⊆ Ib,2) for some m. Get rhs by Lemma 1. Lemma 1. ∀m∀nc

f (Bm,2f → Cf → ReadcoWrite∨Cf ).

  • Proof. Induction on m, using Lemma 2 in the base case.

Lemma 2 [FindSD]. ∀nc

f (B0,2f → ∃d(f [I] ⊆ Id)).

  • Proof. Assume B0,2f . Then f [I0,0] ⊆ Ib,2 for some b, by definition
  • f Bn,m. Have b ≤ − 1

4, − 1 4 ≤ b ≤ 1 4 or 1 4 ≤ b. Can determine

either of Ib,2 ⊆ I−1, Ib,2 ⊆ I0 or Ib,2 ⊆ I1, hence ∃d(f [I] ⊆ Id).

22 / 26

slide-103
SLIDE 103

Cf implies coWrite f : informal proof

The greatest-fixed-point axiom (coWrite)+ (coinduction) is ∀nc

f (Q f → ∀nc f (Q f → f = Id ∨ ReadcoWrite∨Qf ) → coWrite f ).

Theorem [Type-1 u.c.f. into type-0 u.c.f.]. ∀nc

f (Cf → coWrite f ).

  • Proof. Assume Cf . Use (coWrite)+ with competitor C. Suffices

∀nc

f (Cf → f = Id ∨ ReadcoWrite∨Cf ). Assume Cf , in particular

Bm,2f := ∀a∃b(f [Ia,m] ⊆ Ib,2) for some m. Get rhs by Lemma 1. Lemma 1. ∀m∀nc

f (Bm,2f → Cf → ReadcoWrite∨Cf ).

  • Proof. Induction on m, using Lemma 2 in the base case.

Lemma 2 [FindSD]. ∀nc

f (B0,2f → ∃d(f [I] ⊆ Id)).

  • Proof. Assume B0,2f . Then f [I0,0] ⊆ Ib,2 for some b, by definition
  • f Bn,m. Have b ≤ − 1

4, − 1 4 ≤ b ≤ 1 4 or 1 4 ≤ b. Can determine

either of Ib,2 ⊆ I−1, Ib,2 ⊆ I0 or Ib,2 ⊆ I1, hence ∃d(f [I] ⊆ Id).

22 / 26

slide-104
SLIDE 104

Cf implies coWrite f : informal proof

The greatest-fixed-point axiom (coWrite)+ (coinduction) is ∀nc

f (Q f → ∀nc f (Q f → f = Id ∨ ReadcoWrite∨Qf ) → coWrite f ).

Theorem [Type-1 u.c.f. into type-0 u.c.f.]. ∀nc

f (Cf → coWrite f ).

  • Proof. Assume Cf . Use (coWrite)+ with competitor C. Suffices

∀nc

f (Cf → f = Id ∨ ReadcoWrite∨Cf ). Assume Cf , in particular

Bm,2f := ∀a∃b(f [Ia,m] ⊆ Ib,2) for some m. Get rhs by Lemma 1. Lemma 1. ∀m∀nc

f (Bm,2f → Cf → ReadcoWrite∨Cf ).

  • Proof. Induction on m, using Lemma 2 in the base case.

Lemma 2 [FindSD]. ∀nc

f (B0,2f → ∃d(f [I] ⊆ Id)).

  • Proof. Assume B0,2f . Then f [I0,0] ⊆ Ib,2 for some b, by definition
  • f Bn,m. Have b ≤ − 1

4, − 1 4 ≤ b ≤ 1 4 or 1 4 ≤ b. Can determine

either of Ib,2 ⊆ I−1, Ib,2 ⊆ I0 or Ib,2 ⊆ I1, hence ∃d(f [I] ⊆ Id).

22 / 26

slide-105
SLIDE 105

Cf implies coWrite f : informal proof

The greatest-fixed-point axiom (coWrite)+ (coinduction) is ∀nc

f (Q f → ∀nc f (Q f → f = Id ∨ ReadcoWrite∨Qf ) → coWrite f ).

Theorem [Type-1 u.c.f. into type-0 u.c.f.]. ∀nc

f (Cf → coWrite f ).

  • Proof. Assume Cf . Use (coWrite)+ with competitor C. Suffices

∀nc

f (Cf → f = Id ∨ ReadcoWrite∨Cf ). Assume Cf , in particular

Bm,2f := ∀a∃b(f [Ia,m] ⊆ Ib,2) for some m. Get rhs by Lemma 1. Lemma 1. ∀m∀nc

f (Bm,2f → Cf → ReadcoWrite∨Cf ).

  • Proof. Induction on m, using Lemma 2 in the base case.

Lemma 2 [FindSD]. ∀nc

f (B0,2f → ∃d(f [I] ⊆ Id)).

  • Proof. Assume B0,2f . Then f [I0,0] ⊆ Ib,2 for some b, by definition
  • f Bn,m. Have b ≤ − 1

4, − 1 4 ≤ b ≤ 1 4 or 1 4 ≤ b. Can determine

either of Ib,2 ⊆ I−1, Ib,2 ⊆ I0 or Ib,2 ⊆ I1, hence ∃d(f [I] ⊆ Id).

22 / 26

slide-106
SLIDE 106

Cf implies coWrite f : informal proof

The greatest-fixed-point axiom (coWrite)+ (coinduction) is ∀nc

f (Q f → ∀nc f (Q f → f = Id ∨ ReadcoWrite∨Qf ) → coWrite f ).

Theorem [Type-1 u.c.f. into type-0 u.c.f.]. ∀nc

f (Cf → coWrite f ).

  • Proof. Assume Cf . Use (coWrite)+ with competitor C. Suffices

∀nc

f (Cf → f = Id ∨ ReadcoWrite∨Cf ). Assume Cf , in particular

Bm,2f := ∀a∃b(f [Ia,m] ⊆ Ib,2) for some m. Get rhs by Lemma 1. Lemma 1. ∀m∀nc

f (Bm,2f → Cf → ReadcoWrite∨Cf ).

  • Proof. Induction on m, using Lemma 2 in the base case.

Lemma 2 [FindSD]. ∀nc

f (B0,2f → ∃d(f [I] ⊆ Id)).

  • Proof. Assume B0,2f . Then f [I0,0] ⊆ Ib,2 for some b, by definition
  • f Bn,m. Have b ≤ − 1

4, − 1 4 ≤ b ≤ 1 4 or 1 4 ≤ b. Can determine

either of Ib,2 ⊆ I−1, Ib,2 ⊆ I0 or Ib,2 ⊆ I1, hence ∃d(f [I] ⊆ Id).

22 / 26

slide-107
SLIDE 107

[oh](CoRec (nat=>nat@@(rat=>rat))=>algwrite)oh ([oh0]Inr((Rec nat=>..[type]..) left(oh0(Succ(Succ Zero))) ([g,oh1] [let sd (cFindSd(g 0)) (Put sd (InR([n]left(oh1(Succ n))@ ([a]2*right(oh1(Succ n))a-SDToInt sd))))]) ([n,st,g,oh1] Get (st([a]g((a+IntN 1)/2)) ([n0]left(oh1 n0)@ ([a]right(oh1 n0)((a+IntN 1)/2)))) (st([a]g(a/2))([n0]left(oh1 n0)@ ([a]right(oh1 n0)(a/2)))) (st([a]g((a+1)/2))([n0]left(oh1 n0)@ ([a]right(oh1 n0)((a+1)/2))))) right(oh0(Succ(Succ Zero)))

  • h0))

23 / 26

slide-108
SLIDE 108

Corecursion

The corecursion operator coRτ

W has type

τ → (τ → U + RW+τ) → W. Conversion rule

coRτ WNM → [case (MN)U+R(W+τ) of

Inl → Stop | Inr x → Cont(MW

R(W+τ)(λp[case pW+τ of

Inl yW → y | Inr zτ → coRτ

WzM])

xR(W+τ)] with M a “map”-operator.

◮ Here τ is N → N × (Q → Q), for pairs of ω: N → N and

h: N → Q → Q (variable name oh).

◮ No termination; translate into Haskell for evaluation.

24 / 26

slide-109
SLIDE 109

Corecursion

The corecursion operator coRτ

W has type

τ → (τ → U + RW+τ) → W. Conversion rule

coRτ WNM → [case (MN)U+R(W+τ) of

Inl → Stop | Inr x → Cont(MW

R(W+τ)(λp[case pW+τ of

Inl yW → y | Inr zτ → coRτ

WzM])

xR(W+τ)] with M a “map”-operator.

◮ Here τ is N → N × (Q → Q), for pairs of ω: N → N and

h: N → Q → Q (variable name oh).

◮ No termination; translate into Haskell for evaluation.

24 / 26

slide-110
SLIDE 110

Corecursion

The corecursion operator coRτ

W has type

τ → (τ → U + RW+τ) → W. Conversion rule

coRτ WNM → [case (MN)U+R(W+τ) of

Inl → Stop | Inr x → Cont(MW

R(W+τ)(λp[case pW+τ of

Inl yW → y | Inr zτ → coRτ

WzM])

xR(W+τ)] with M a “map”-operator.

◮ Here τ is N → N × (Q → Q), for pairs of ω: N → N and

h: N → Q → Q (variable name oh).

◮ No termination; translate into Haskell for evaluation.

24 / 26

slide-111
SLIDE 111

Corecursion

The corecursion operator coRτ

W has type

τ → (τ → U + RW+τ) → W. Conversion rule

coRτ WNM → [case (MN)U+R(W+τ) of

Inl → Stop | Inr x → Cont(MW

R(W+τ)(λp[case pW+τ of

Inl yW → y | Inr zτ → coRτ

WzM])

xR(W+τ)] with M a “map”-operator.

◮ Here τ is N → N × (Q → Q), for pairs of ω: N → N and

h: N → Q → Q (variable name oh).

◮ No termination; translate into Haskell for evaluation.

24 / 26

slide-112
SLIDE 112

Corecursion

The corecursion operator coRτ

W has type

τ → (τ → U + RW+τ) → W. Conversion rule

coRτ WNM → [case (MN)U+R(W+τ) of

Inl → Stop | Inr x → Cont(MW

R(W+τ)(λp[case pW+τ of

Inl yW → y | Inr zτ → coRτ

WzM])

xR(W+τ)] with M a “map”-operator.

◮ Here τ is N → N × (Q → Q), for pairs of ω: N → N and

h: N → Q → Q (variable name oh).

◮ No termination; translate into Haskell for evaluation.

24 / 26

slide-113
SLIDE 113

Conclusion

TCF (theory of computable functionals) as a possible foundation for exact real arithmetic.

◮ Simply typed theory, with “lazy” free algebras as base types

(⇒ constructors are injective and have disjoint ranges).

◮ Variables range over partial continuous functionals. ◮ Constants denote computable functionals (:= r.e. ideals). ◮ Minimal logic (→, ∀), plus inductive & coinductive definitions. ◮ Computational content in abstract theories. ◮ Decorations (→, ∀ and →nc, ∀nc) for fine-tuning.

25 / 26

slide-114
SLIDE 114

References

◮ U. Berger, From coinductive proofs to exact real arithmetic.

CSL 2009.

◮ K. Miyamoto and H.S., Program extraction in exact real

  • arithmetic. To appear, MSCS.

◮ K. Miyamoto, F. Nordvall Forsberg and H.S., Program

extraction from nested definitions. ITP 2013.

◮ H.S. and S.S. Wainer, Proofs and Computations. Perspectives

in Logic, ASL & Cambridge UP, 2012.

26 / 26