- •Sense, Denotation and Semantics
- •Sense and denotation in logic
- •The algebraic tradition
- •The syntactic tradition
- •The two semantic traditions
- •Tarski
- •Heyting
- •Natural Deduction
- •The calculus
- •The rules
- •Interpretation of the rules
- •The Curry-Howard Isomorphism
- •Lambda Calculus
- •Types
- •Terms
- •Operational significance
- •Conversion
- •Description of the isomorphism
- •Relevance of the isomorphism
- •The Normalisation Theorem
- •The weak normalisation theorem
- •Proof of the weak normalisation theorem
- •Degree and substitution
- •Degree and conversion
- •Conversion of maximal degree
- •Proof of the theorem
- •The strong normalisation theorem
- •Sequent Calculus
- •The calculus
- •Sequents
- •Structural rules
- •The intuitionistic case
- •Logical rules
- •Some properties of the system without cut
- •The last rule
- •Subformula property
- •Asymmetrical interpretation
- •Sequent Calculus and Natural Deduction
- •Properties of the translation
- •Strong Normalisation Theorem
- •Reducibility
- •Properties of reducibility
- •Atomic types
- •Product type
- •Arrow type
- •Reducibility theorem
- •Pairing
- •Abstraction
- •The theorem
- •The calculus
- •Types
- •Terms
- •Intended meaning
- •Conversions
- •Normalisation theorem
- •Expressive power: examples
- •Booleans
- •Integers
- •Expressive power: results
- •Canonical forms
- •Representable functions
- •Coherence Spaces
- •General ideas
- •Coherence Spaces
- •The web of a coherence space
- •Interpretation
- •Stable functions
- •Parallel Or
- •Direct product of two coherence spaces
- •The Function-Space
- •The trace of a stable function
- •Representation of the function space
- •The Berry order
- •Partial functions
- •Denotational Semantics of T
- •Simple typed calculus
- •Types
- •Terms
- •Properties of the interpretation
- •Booleans
- •Integers
- •Sums in Natural Deduction
- •Defects of the system
- •Standard conversions
- •The need for extra conversions
- •Subformula Property
- •Extension to the full fragment
- •Commuting conversions
- •Properties of conversion
- •The associated functional calculus
- •Empty type
- •Sum type
- •Additional conversions
- •System F
- •The calculus
- •Comments
- •Representation of simple types
- •Booleans
- •Product of types
- •Empty type
- •Sum type
- •Existential type
- •Representation of a free structure
- •Free structure
- •Representation of the constructors
- •Induction
- •Representation of inductive types
- •Integers
- •Lists
- •Binary trees
- •Trees of branching type U
- •The Curry-Howard Isomorphism
- •Coherence Semantics of the Sum
- •Direct sum
- •Lifted sum
- •dI-domains
- •Linearity
- •Characterisation in terms of preservation
- •Linear implication
- •Linearisation
- •Linearised sum
- •Tensor product and units
- •Cut Elimination (Hauptsatz)
- •The key cases
- •The principal lemma
- •The Hauptsatz
- •Resolution
- •Strong Normalisation for F
- •Idea of the proof
- •Reducibility candidates
- •Remarks
- •Reducibility with parameters
- •Substitution
- •Universal abstraction
- •Universal application
- •Reducibility theorem
- •Representation Theorem
- •Representable functions
- •Numerals
- •Total recursive functions
- •Provably total functions
- •Proofs into programs
- •Formulation of HA2
- •Translation of HA2 into F
- •Representation of provably total functions
- •Semantics of System F
- •What is Linear Logic?
120 |
CHAPTER 15. REPRESENTATION THEOREM |
15.1Representable functions
15.1.1Numerals
Proposition Any closed normal term t of type Int = X: X!(X!X)!X is a numeral n for some n 2 N.
Proof The notion of head normal form (section 3.4) is applicable to system F, and from it we deduce that t must be of the form
X: xX : yX!X : v
where v is of type X, and so cannot be an abstraction. We prove by induction that v is of the form
y (y (y : : : (y x) : : :))
| {z } n occurrences
where n is an integer.
Suppose that v is w u or w U, where w 6= y. Since v is normal, w must be of the form w0 u0 or w0 U0. But the types of x and y are simpler than that of w0, so w0 is an abstraction and w is a redex: contradiction. So v is x, in which case our
result holds with n = 0, or v is y v0 |
and we apply the induction hypothesis to v0 |
of type X. |
|
Remark If we had taken the variant X: (X!X)!(X!X) we would have obtained almost the same result, but in addition there is a variant for 1:
X: yX!X : y
This phenomenon is one of the little imperfections of the syntax. Similar features arise with inductive data types, i.e. the closed normal forms of type T are \almost" the terms obtained by combining the functions fi, but in general only \almost".
Having said this, the recursion scheme for inductive types, de ned (morally) in terms of the fi, shows that (in a sense to be made precise) the terms constructed from the fi are \dense" among the others. To return to our pet subject, the syntax seems to be too rigid and much too arti cial to allow a satisfactory study of such di culties. Undoubtedly they cannot be resolved otherwise than by means of an operational semantics which would allow us to identify (or distinguish between) algorithms beyond what can be done with normalisation, which is only an approximation to that semantics.
15.1. REPRESENTABLE FUNCTIONS |
121 |
15.1.2Total recursive functions
Let us return to the original question, which was to characterise the functions which are representable in F. We have seen that such functions are recursive, i.e. calculable.
Proposition There is a total recursive function which is not representable in F.
Proof The function which we shall take is the normalisation operation. We represent terms in a formal language as a string of symbols from a xed nite alphabet and hence as an integer. Then this function takes one term (represented by an integer) and yields another. This function is universal (in the sense of Turing) with respect to the functions representable in F, and so cannot itself be represented in F.
More precisely:
N(n) = m if n codes the term t, m codes u and u is the normal form of t.
N(n) = 0 if n does not code any term of F.
On the other hand we have the functions:
A(m; n) |
= p if m; n; p are the codes of t; u; v such that v = t u, with |
A(m; n) |
= 0 otherwise. |
](n) = m if m codes n.
[(m) = n if m is the code of the numeral n, with [(m) = 0 otherwise. Now consider:
D(n) = [(N(A(n; ](n)))) + 1
This is certainly a total recursive function, but it cannot be represented in F. Indeed, suppose that t of type Int!Int represents D and let n be the
code of t. Then A(n; ](n)) is the |
code |
of t |
|
|
, and N(A(n; ](n))) that |
of |
its |
|||
n |
||||||||||
|
|
|
|
|
|
|||||
normal form. But by de nition of t, t |
|
|
|
D(n), so N(A(n; ](n))) = ](D(n)) and |
||||||
n |
||||||||||
[(N(A(n; ](n)))) = D(n) whence D(n) = D(n) + 1: contradiction. |
|
|
||||||||
For any reasonable coding, A, |
] and |
|
[ are obviously representable |
in |
F, |
|||||
so N itself is not representable in F. |
|
|
|
|
|
|
|
|
|
|
This result is of course a variant of a very famous result in Recursion Theory (due to Turing), namely that the set of total recursive functions cannot be enumerated by a single total recursive function. In particular it applies to all sorts of calculi, typed or untyped, which satisfy the normalisation theorem.
122 |
CHAPTER 15. REPRESENTATION THEOREM |
15.1.3Provably total functions
A recursive function f which is total from N to N is called provably total in a system of arithmetic A if A proves the formula which expresses \for all n, the program e, with input n, terminates and returns an integer" for some algorithm e representing f. The precise formulation depends on how we write programs formally in A. For example, with the Kleene notation:
A proves 8n: 9m: T1(e; n; m)
where T1(e; n; m) means that the program e terminates with output m if given input n. This may itself be expressed as 9m0: P (n; m; m0) where P is a primitive recursive predicate and m0 is the \transcript" of the computation. The two quanti ers 9m: 9m0: can be replaced by a single one 9p: using some (primitive recursive) coding of pairs. We prefer to be no more speci c about this precise formulation, but we notice that termination is expressed by a 02 formula1.
In 7.4, we saw that the functions representable in T are provably total in Peano arithmetic PA, and the converse is also true. Here we have:
Proposition The functions representable in F are provably total in second order Peano arithmetic PA2.
Proof An object f of type Int!Int gives rise to an algorithm which, given an integer n, returns jfj(n); we have described how to do this already. Now we want to show that this program terminates. We make use of the strong normalisation theorem, and by examining the mathematical principles employed in the proof we obtain the result.
What matters is essentially the reducibility of f alone (together with that of the numerals, which is immediate). We only use nitely many reducibilities, which saves us from the fact that (as in T) reducibility is not globally de nable. The reducibility predicates are de nable by second order quanti cation over sets of (terms coded as) integers. The mathematical principles we have used are:
induction on the reducibility predicates for the types involved in f,
the comprehension scheme and second order quanti cation, which allow us to de ne a reducibility candidate from a parametrised reducibility.
But PA2 is precisely the system of arithmetic with induction, comprehension and
second order quanti cation. |
|
1See footnote page 57.