Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Logic and CS / Girard. Proofs and Types.pdf
Скачиваний:
38
Добавлен:
10.08.2013
Размер:
947.15 Кб
Скачать

8.5. THE FUNCTION-SPACE

61

If A and B are two coherence spaces, we de ne A N B by:

jA N Bj = jAj + jBj = f1g jAj [ f2g jBj

(1; ) ^_ (1; 0)

(mod

 

 

)

i ^_ 0

(mod

)

 

(2; ) _ (2; 0)

(mod

A N B)

i _ 0

(mod

A)

 

^

 

A

B

^

 

 

 

B

 

^

(mod

A N B

)

for all

2 jAj

and

2 jBj

(1; ) _ (2; )

N

 

 

 

 

In particular, the points of A N B (coherent subsets of jA N Bj) can be written uniquely as f1g a [ f2g b with a 2 A, b 2 B. The reader is invited to show that this is the product in the categorical sense (we shall return to this in the next chapter when we de ne the interpretation).

to C by:

A

B

to

C

, we de ne a function G from

A N B

Given a stable function F from

;

 

 

 

G(f1g a [ f2g b) = F (a; b)

It is immediate that G is stable; conversely the same formula de nes, from a stable unary function G, a stable binary function F , and the two transformations are inverse.

8.5The Function-Space

We started with the idea that \type = coherence space". The previous section de nes a product of coherence spaces corresponding to the product of types, but what do we do with the arrow? We would like to de ne A ! B as the set of stable functions from A to B, but this is not presented as a coherence space. So we shall give a particular representation of the set of stable functions in such a way as to make it a coherence space.

8.5.1The trace of a stable function

Lemma Let F be a stable function from A to B, and let a 2 A, 2 F (a); then

i)it is possible to nd a a nite such that 2 F (a ).

ii)if a is chosen minimal for the inclusion among the solutions to (i), then a is least, and is in particular unique.

62

 

 

 

 

 

 

 

 

 

CHAPTER 8. COHERENCE SPACES

Proof

 

 

ISFi2(Iai),i

 

 

 

 

 

 

 

 

 

 

 

i)

F (a) =

 

i"

and if

 

F (a),i

 

 

F (ai0 ) for some i0

 

I.

Then

 

Write a =

"

a ,

where

the

a

are

the

nite subsets

of a.

 

 

S

2

 

 

 

2

 

 

 

2

 

 

2

 

 

ii)

Suppose

a

is

minimal, and

 

let

a0

a

such that 2 F (a0).

Then

 

a [ a0

a 2 A, so a [ a0

2 A and

2 F (a ) \ F (a0) = F (a \ a0). As

 

a is minimal,

this

forces a a [ a0,

so a a0, and a is indeed

least.

 

To put this another way, we have said that we intend stability to mean the

 

intersection of an arbitrary family which is bounded above, and here we are

 

just taking the intersection of the nite a0 a such that 2 F (a0).

 

The trace Tr(F ) is the set of pairs (a ; ) such that:

i)a is a nite point of A and 2 jBj

ii)2 F (a )

iii)if a0 a and 2 F (a0) then a0 = a .

Tr(F ) determines F uniquely by the formula

(App) F (a) = f : 9a a (a ; ) 2 Tr(F )g

which results immediately from the lemma. In particular the function F 7!rT(F ) is 1{1.

Consider for example the stable function F1 from Bool NBool to Bool introduced in 8.3.2. The elements of its trace Tr(F1) are:

(f(1; t)g; t)

(f(1; f); (2; t)g; t)

(f(1; f); (2; f)g; f)

We can read this as the speci cation:

if the rst argument is true, the result is true;

if the rst argument is false and the second true, the result is true;

if the rst argument is false and the second false, the result is false.

8.5. THE FUNCTION-SPACE

63

8.5.2Representation of the function space

Proposition As F varies over the stable functions from A to B, their traces give the points of a coherence space, written A ! B.

Proof Let us de ne the coherence space C by jCj = An jBj (An is the set ofnite points of A) where (a1; 1) _^ (a2; 2) (mod C) if

i)a1 [ a2 2 A ) 1 _^ 2 (mod B)

ii)a1 [ a2 2 A ^ a1 6= a2 ) 1 6= 2 (mod B)

In 12.3, we shall see a more symmetrical way of writing this.

If F is stable, then Tr(F ) is a subset of jCj by construction. We verify the coherence modulo C of (a1; 1) and (a2; 2) 2 Tr(F ):

i) If a1 [ a2 2 A then f 1; 2g F (a1 [ a2) so 1 _^ 2 (mod B).

ii) If 1 = 2 and a1 [ a2 2 A, then the lemma applied to 1 2 F (a1 [ a2) gives us a1 = a2.

Conversely, let f be a point of C. We de ne a function from A to B by the

formula:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(App)

 

F (a) = f :

 

9a a (a ; ) 2 fg

 

 

 

 

i) F is monotone: immediate.

 

 

 

 

 

 

 

 

 

 

ii) If

a =

i"2I ai,

then

 

i"2I F (ai) F (a) by

 

monotonicity.

Conversely, if

 

2

F

a

 

 

 

 

there is an a

0

nite, a

0

 

a, such that

2

F (a

); but

 

 

(S), this means S

 

 

 

 

0

 

since a0

i"2I ai, we have a0

ak

for some k (that is why I was chosen

 

 

 

 

so

2

F (a

 

) and the converse inclusion is established.

 

 

directed!)

S

 

k

 

 

 

 

 

 

 

 

 

 

 

iii) If a1 [ a2 2 A, then F (a1 \ a2) F (a1) \ F (a2) by monotonicity. Conversely, if 2 F (a1) \ F (a2), this means that (a01; ); (a02; ) 2 f for some appropriate a01 a1 and a02 a2. But (a01; ) and (a02; ) are coherent and a01 [ a02 a1 [ a2 2 A, so a01 = a02, a01 a1 \ a2 and 2 F (a1 \ a2).

iv) We nearly forgot to show that F maps A into B: F (a), for a 2 A, is a subset of jBj, of which it is again necessary to show coherence! Now, if0; 00 2 F (a), this means that (a0; 0); (a00; 00) 2 f for appropriate a0; a00 a; but then a0 [ a00 a 2 A, so, as (a0; 0) and (a00; 00) are coherent, 0 _^ 00 (mod B).

Finally, it is easy to check that these constructions are mutually inverse.

In fact, the same application formula occurs in Scott's domain theory [Scott76], but the corresponding notion of \trace" is more complicated.

64

CHAPTER 8. COHERENCE SPACES

8.5.3The Berry order

Being a coherence space, A ! B is naturally ordered by inclusion. The bijection between A ! B and the stable functions from A to B then induces an order relation:

F B G

i

In fact B, the Berry order, is given by:

Tr(F ) Tr(G)

 

 

 

F B G

 

 

 

i

 

 

 

8a0; a 2 A (a0 a ) F (a0) = F (a) \ G(a0))

Proof If F

B

G then

F (a)

 

G(a) for all a (take

a = a0).

Let (a; )

r(F );

then

 

 

 

 

 

 

 

 

 

 

 

r(G). Let a0

 

 

2 T

2

F (a)

 

G(a). We seek to show that (a; )

 

 

a such that

 

 

 

 

 

 

 

F (a)

 

 

 

 

2 T

 

 

 

2

G(a0); then

2

\

G(a0) = F (a0), which forces a0 = a.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Conversely, if Tr(F ) Tr(G), it is easy to see that F (a) G(a) for all a. In particular if a0 a, then F (a0) F (a) \ G(a0). Now, if 2 F (a) \ G(a0), one cannd a a, a0 a0 such that

(a ; ) 2 Tr(F ) Tr(G) 3 (a0 ; )

 

 

 

 

 

 

 

 

 

 

 

 

[

 

a

2 A

, we have a

 

 

so (a

; ) and (a0 ; ) are coherent, and since a

 

a0

 

 

 

= a0 ,

and

 

2

F (a0

) = F (a

)

 

F (a0).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

As an example, it is easy to see (using one of the characterisations of B) that

6

 

 

 

 

 

 

 

 

 

 

 

 

 

2 B

 

 

F

B

F1

(see 8.3.2) although F3(a; b)

 

F1(a; b) for all a; b

 

ool. The reader is

also invited to show that the identity is maximal.

The Berry order says that evaluation preserves the pullback (cf. the one in section 8.4)

(G; a)

I@

@

@

(G; a0)

(F; a)

@I

(F; a0)

for a0 a in (A ! B) N A, so this is exactly the order relation we need on A ! B to make evaluation stable.

Соседние файлы в папке Logic and CS