Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Asperti A.Categories,types,and structures.1991

.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
1.68 Mб
Скачать

12. Examples of Internal Models

1 is the function that takes (an equivalence class in R1R0 of) a triple < T, F, G > in (the equivalence class in R1 of) the triple < λtλm .T(pm)( 0Ft ), 0(F), 0(G) >.

Note that λtλm .T(pm)( 0Ft )) is a morphism from the retraction 0F to the retraction 0G; indeed,

0G ˚ λtλm .T(pm)( 0Ft ) ˚ 0F =

= λz. 0G(λm .T(pm)( 0Fz) )

= λz. (λxλt.G(pt)(x(pt)) ) (λm .T(pm)( 0Fz) ) = λz. λt.G(pt)( (λm .T(pm)( 0Fz) ) (pt))

= λz. λt.G(pt)( (T(pt)( 0Fz) )

= λz. λt.T(pt)( 0Fz)

 

 

because G(pt) ˚ T(pt) = T(pt)

by hypothesis

 

 

 

It should be clear that

1

is indeed a morphism in

PERT its realizer is simply obtained by

abstraction on < T, F, G >.

 

 

 

 

 

 

 

 

 

 

 

 

 

Given a variable type G

in

R

0

R0 and a type N in R , the projection proj

G

(N) from

 

0

G

 

 

 

 

 

 

 

0

 

 

 

 

to G(N) is realized by the term

λx.xN. Indeed, if

S

has type 0G

that is, S = ( 0G)S,

then

SN = 0GSN = G(N)(SN),

and thus SN has type

G(N).

 

 

 

 

 

 

We define now the isomorphism of the adjunction.

 

 

 

 

 

 

Let < T, λx.M, G > be an element in R R0, where M is a retraction and λx.M = K (M).

 

 

 

 

 

 

 

 

1

 

 

 

 

 

0

 

 

 

Define then M,G( < T, λx.M, G > ) = < λtλm .T(pm)t, M, 0G >.

 

 

 

 

 

Conversely, given

< S, M, 0(G) > in

R1,

define M,G-1( < S, M, 0(G) > ) = <

λmλt.Stm, λx.M, G >.

Note that

 

λm.λt.Stm

= λm.(λx.xm ˚ S) = λm.( projG(m) ˚ S ). Thus,

for every retraction N,

one has

 

 

 

 

 

 

 

 

 

 

 

 

G(N) ˚ λt.StN ˚ M = projG(N) ˚ S ˚ M = G(N) ˚ projG(N) ˚ S ˚ M = λt.StN . Moreover,

M,G-1( M,G( < T, λx.M, G > ) ) =

=M,G-1( < λtλm .T(pm)t , M, 0(G) > )

=< λmλt.T(pm)t, λx.M, G >

=< λm.T(pm), λx.M, G >

and clearly T and λm.T(pm) are equivalent in T R0.

As for the converse, note first that if S = 0(G) ˚ S, then

St(pm) = 0(G)(St)(pm) = (λm.G(pm)(St(pm)))(pm) = G(pm)(St(pm)) = Stm Thus: M,G( M,G-1( < S, M, 0(G) > ) ) =

=M,G( < λmλt.Stm, λx.M, G > )

=< λtλm .St(pm) , M, 0G >

=< λtλm .Stm , M, 0G >

=< S, M, 0G >

274

12. Examples of Internal Models

Define then

( < M,G, < T, λx.M, G > > ) = < M, G, < λtλm .T(pm)t , M, 0G > >

and

-1( < M,G, < S, M, 0G > > ) = <M,G, < λmλt.Stm, λx.M, G > >.

12.1.2 Remark It is possible to give an elegant categorical characterisation of the models of

λβ(η)p. Let A be a reflexive object

( AA A ) in some category

C, and let

RETA = (R0, R1,

dom, cod, comp, id) be the internal category of retractions on A in

PER

. Let

ξ: R

0

AA be as

 

 

A

 

 

 

usual the equalizer of the identity and

λf. f ˚ f. All we need to turn

RETA

in a model for λβ(η)p

is that there exist p: AAR0 such that R0 is a retract of AA via

(ξ,p). Then, in a sense, since

R0 represents all the retractions on A,

we can say that the collection of objects of

RETA is itself an

object of RETA: more formally, that RETA is internal to RETA w.r.t. PERA. We have thus the following facts:

1. (AA < A in a CCC C and RETA internal to RETA with respect to PERA ) imply A |= λβp .

2. A |= λβp implies

( AA < A in PERA and RETA internal to RETA w.r.t. PERA ). The reader should complete the details for exercise.

12.2 PER inside ω-Set

This example continues our presentation of PER an an internal category M of ω-Set (see examples 7.2.7 and 7.3.9.2, where it is shown that the construction gives also an internal model.)

Let M* be defined as c* in 11.4.2. We next define an internal right adjoint to the constant functor K : M M*, that by def. 11.4.4 will complete the construction of a model for λ2.

Again, we shall take advantage of the wise blend of set-theory and computability on which ω-Set is based, in order to avoid the most formal details.

The following lemma motivates the definition of below.

12.2.2 Lemma If <τ,F,G>ω-Set[Mo,M1] then

n A Mo τ(A) = {n}F(A)G(A) .

Proof. Suppose that m |__ <τ,F,G>. Since

0 |__ A

for any A PER , then take

n = m.0 and

observe that n |__ <τ(Α),F(A),G(A)>. Thus

τ(A) = {n}F(A)G(A).

 

As for the definition of 0, observe that the intersection of any collection {Ai}i I

of objects in

PER is still in PER, by viewing them as sets of pairs (of numbers). That is, set

 

n (i I Ai) m

iff i I (n Ai m ).

 

275

12. Examples of Internal Models

12.2.3 Definition

1.o : [Mo Mo] Mo, is given by o(F) = A MoF(A),

2.1: [M o M 1] M 1 is defined as follows. If m |_ <τ,F,G>ω-Set[M o,M 1], set

1(<τ,F,G>) = <{m.0} o(F)→ ο(G) , o(F), o(G)> .

12.2.4 Proposition. in definition 12.2.3 is well defined. In particular, 1 is realized by any number p such that , for all m , p.m = m.0 .

Proof. By definition, if F : MoMo, then o(F) is in Mo. o is realized by (any index of) any total recursive function. By lemma 12.2.2, 1 is well defined as its definition does not depend on the choice of the realizer m for <F,τ,G>. Therefore we only need to show that 1 is realized by p. Namely, that if

1.m1,m2 |__ <τ,F,G>

2.n1 o(F) n2

3.A Mo

then one has (p.m1.n1) G(A) (p.m2.n2).

Indeed,

4.

p.m1 = m1.0

(F(A)G(A)) m2.0 = p.m2 , by (1)

5.

n1 F(A) n2 ,

by (2) and (3),

and thus (p.m1.n1) G(A) (p.m2.n2) by (4), (5) and the definition of (F(A)G(A)) Mo.

12.2.5 Remark. It should be clear that lemma 12.2.2 is a very simple but crucial lemma. Note first that the morphisms in ω-Set[Mo,M1] are described as triples, <τ,F,G>, where τ: Mo A MoQ(F(A)G(A)) is such that τ(A) Q(F(A)G(A)) and F, G: Mo Mo give the source and target of τ(A). This is a sound description, since M* = ( [MoMo], [M1M1],...) may be viewed as the internal category of functors from the discrete category, whose object of objects is Mo, to M. Thus [MoM1] or ω-Set[Mo,M1] are internal natural transformations. By lemma 12.2.2, now, there is a uniform n which realizes τ(A) for all A. In a sense these internal natural transformations are “almost” constant maps and only depend on the source and target objects.

We need now to prove that there exists an internal natural isomorphism , which gives the adjunction between and K. We can use the simplicity of the intended universe and perform the construction directly. As in the proof of the internal Cartesian closure of M, the point is to show that the functional dependencies, usually implicit in the external world (or given by “indexes”: recall a,b |_ Λa,b), can be turned into internal constructions. Once more, this will be straightforward to check within ω-Set, as the realizers for the natural isomorphism and its inverse will not depend on their “indexes.”

Let K, with components ko and k1, be the internal constant functor in definition 11.4.3.

276

12.Examples of Internal Models

12.2.6Definition. For m |__ < τ,ko(B),G> ω-Set[Mo,M1] , set

B,G (< τ,ko(B),G>) = < {m.0}Β→ ο(G) ,Β, o(G)> M1 . and 1B,G ( <{m}Β→ ο(G) ,Β, o(G)> )

=< λX Mo.{m}Β→G(X) ,ko(B),G> ω-Set[Mo,M1].

12.2.7Proposition. B,G and 1B,G in 12.2.6 are well defined, for all B Mo. and G:

MoMo (= [Mo Mo]). Moreover, they are realized by p and k (respectively), such that p.m = m.0 and k.m.n = m .

Proof: By lemma 12.2.2, B,G does not depend on the choice of the particular realizer m. As for 1B,G, note that, if m(Β→ ο(G))m, then n,q ( nBq m.n (A MoG(A)) n.q), by definition of ο, and hence m.n G(A) n.q, for all A Mo. Therefore, m (Β → G(A)) m for all A Mo and 1B,G too is well defined. By definition, they are uniformly realized by p and k as above. In particular, p and k compute B,G and 1B,G for all B and G.

12.3 PL-Categories Inside Their Groethendiek Completion

This example show another way for obtaining an internal model from a PL-category, different from the internalization process of chapter 11.

12.3.1 Definition. Given any E-indexed category G, define the category G, the Grothendieck

completion of G, having as objects the pairs (e, σ) with

e ObjE and σ ObjG(e)

and as

morphisms pairs

(α, f) such that:

 

 

 

(α, f) G[(e, σ), (e', τ)] iff

α E[e,e'] and f G(e)[σ,G(α)(τ)].

 

The identity of

(e, σ)

is (ide, idσ);

the composition of

(α, f) ∫G[(e,σ),(e',τ)]

and (β,

g)∫G[(e',τ), (d,ρ)] is

(β, g) ˚ (α, f) = ( β ˚ α, G(α)(g) ˚ f).

 

 

Let (E, G, ) be an external model (that is an indexed category with the additional requirements on functor G in 12.2.1); then the Grothendieck completion ∫G assumes a particularly simple form Objects: (e, σ)∫G iff σ ObjG(e) = E[e, ]

(hence we can identify objects of G with arrows σ: e→Ω) Morphisms: (α,f)∫G[σ:e→Ω,τ:e'→Ω] iff

α E[e,e'] and f G(e)[σ,G(α)(τ)] = G(e)[σ,τ ˚ α].

The point is that ∫G contains an internal category which, in a sense, internalizes the external model (E, G, ).

277

12. Examples of Internal Models

Warning We are here forcing our terminology, since the category ∫G does not need to have all finite limits, at least not in general, and hence we could not speak of “internal categories in ∫G.” However, all the needed pullback diagrams exist in ∫G, as pointed out below.

The internal category Γ = (c0, c1, DOM, COD, COMP ,ID) Cat( G) is defined as follows:

 

c0 = tG() : Ω→Ω

the terminal object in G()

c1 = [,]0 : Ω×Ω→Ω

[,]0 is given in lemma 11.2.3

DOM = (fst, !)

! is the unique arrow from c1 to cfst in G(Ω×Ω)

COD = (snd, !)

 

ID = (<id, id>, ΛG()(snd))

snd G()[tG()×id, id], hence

 

Λ(snd) G()[tG(), idid], where idid

The situation for COMP is more delicate, since ∫G does not have all finite limits. However, the

pullback of DOM: c1c0, COD: c1c0 does exist, and it is given by

 

c2 = (p2p3)×(p1p2),

 

 

where product and exponents are in the fiber G(Ω×Ω×Ω) and pi E[Ω×Ω×Ω, ];

the pullback

projections 1, 2 : c2c1 are

 

 

1 = (<p2,p3>, id)

 

 

2 = (<p1,p2>, id).

 

 

In order to define COMP, remember that in any CCC, given three objects A, B, C,

there exists a

morphism cmp Hom[CB×BA, CA] that internalizes the composition, namely

 

cmp = Λ(eval ˚ id×eval ˚ p)

for p: (CB×BA)×ACB×(BA×A) an isomorphism.

Define then

 

 

COMP = (<p1,p3>, cmp)

for cmp G(Ω×Ω×Ω)[ c2, p1p3]

 

(recall that, in G(Ω×Ω×Ω), p1p3 = [,]0 ˚ <p1,p3>).

 

The verification that these data define an internal category is straightforward.

 

We now prove that if (E, G, )

is an external model, than ∫G is Cartesian closed.

 

The terminal object is given by tG(t), the terminal object of the local category G(t) (for t terminal in E). As for products, they can be defined by using the Cartesian structure of the local categories:

(f:e→Ω)×G(g:d→Ω) := x0 ˚ f×Eg, where

x0: Ω×Ω→Ω is the arrow obtained in lemma 11.2.3;

hence f ×G g = (f ˚ fst)×G(e×d)(g ˚ snd).

Projections are obtained as follows. We need FST:

c0×c0c1, where FST = (α, f) for some

α:Ω×Ω→Ω×Ω and f G(Ω×Ω)[c0×c0, cα]. As for

α, which intuitively takes a pair of objects (σ, τ) to (σ×τ, σ), we can take α = <x0, fst>:

Ω×Ω→Ω×Ω.

 

In order to define f G(Ω×Ω)[ tG(Ω×Ω), x0fst], we can use again the Cartesian closed structure of G(Ω×Ω) and the fact that, by lemma 11.2.3, one has

x0 = x0 ° id = x0 ° <fst,snd> = fst ×G(Ω×Ω) snd.

Define then f = Λ(fst) where fst G(Ω×Ω)[fst×snd, fst]. SND is defined analogously.

278

12. Examples of Internal Models

It remains to give the pairing isomorphism <,>; note first of all that the required pullbacks (see

definition 7.3.6, and also appendix A at the end of chapter 7) are given by the following data:

X = [,]0×G[,]0 ˚ <id×fst, id×snd> : Ω×(Ω×Ω)→Ω ∏X : Xc1×c1 (that is X [,]0 ×G [,]0)

X = ( <id×fst, id×snd>, id )

ρ : X c0×c0×c0 (that is X tG(Ω×Ω×Ω)) ρ = (id, !)

Y = [,]0 ˚ id×x0 : Ω×(Ω×Ω)→Ω ∏Y : Yc1 (that is Y [,]0 ) Y = ( id×x0, id)

ρ' : Y tG(Ω×Ω×Ω) ρ' = (id, !)

Observe now that, as we are dealing with objects of G(Ω×(Ω×Ω)), by interpreting all products and exponentials locally in G(Ω×(Ω×Ω)) ), one has

X = (fst fst ˚ snd)×(fst snd ˚ snd) Y = fst → ((fst ˚ snd)×(snd ˚ snd))

and hence X Y, since G(Ω×(Ω×Ω)) is Cartesian closed.

The isomorphism <,>: XY (in ∫G ) is then given by <,> = (id,f), where f is the

isomorphism between X and Y in G(Ω×(Ω×Ω)). The required equations are now easily verified.

Let us now come to the exponents 0 = ( [,]0 , !) : c0×c0c0,

where [,]0 is given again by

lemma 11.2.3.

 

 

EVAL : c0×c0c1 is given by a pair: EVAL = (α,f),

for α:Ω× Ω→Ω× Ω

and

f G(Ω×Ω)[c0×c0, cα]. As for α, whose intuitive content is to send a pair of objects (σ, τ)

into

(τσ×σ, τ), we can set α = <x0 ˚ < [,]0, fst>, snd>.

 

We need now f G(Ω×Ω)[tG(Ω×Ω),

[,]0 ˚ <×0

˚ < [,]0, fst>, snd>]; observe that

[,]0 ˚ <x0 ˚ < [,]0, fst>, snd> =

 

 

= (x0 ˚ < [,]0, fst>) snd

in G(Ω×Ω)

= ([,]0 × fst) snd

 

 

= ((fstsnd) × fst) snd.

 

 

Take then evalfst,snd G(Ω×Ω)[(fstsnd) × fst, snd] and set

f = Λ(evalfst,snd) G(Ω×Ω)[tG(Ω×Ω), ((fstsnd) × fst) snd].

Before giving the isomorphism Λ, we need to express the pullback diagrams of theorem 7.3.7 (see also appendix A). They can be instantiated as

279

12. Examples of Internal Models

where:

X' = [,]0 ˚ (x0× id) X' = ( x0× id, id) σ = (idΩ×Ω×Ω, !)

As before, observe that

X' = fst×(fst ˚ snd)(snd˚ snd)

Y' = fst ((fst ˚ snd)(snd˚ snd)). Therefore X' Y', by the Cartesian closure of

Y' = [,]0 ˚ ( id× [,]0 ) Y' = ( id×[,]0, id) σ' = (idΩ×Ω×Ω, !)

G(Ω×(Ω×Ω)) .

The internal Cartesian closed category Γ Cat(∫G) is actually an internal model when (E, G, ) is

an external one. In order to define the required adjunction, we need first to show that we can indeed construct the internal category Γ*; that is, the exponents c0c0 and c1c0 exist in ∫G (as for the limits, not all the exponents exist in ∫G).

12.3.2 Lemma

i. For any object e of E, c0tG(e) exists in G and it is given by tG(e). ii.For any object e of E, c1tG(e) exists in G and it is given by ([,]0 ˚ eval).

Proof Set σ = tG(e).

i. Note first that in ∫G, for any e' and τ, every arrow (β,g):τ→tG(e') has g = !. We must then show that, for c0σ = tG(e), the following diagram commutes, for any object τ and arrow (α,!):

which is immediate.

280

12.Examples of Internal Models

ii.Let τ: e'→Ω be any object of ∫G; we are looking for the unique Λ(α, f) such that the following diagram commutes:

Since α: e'×e→Ω×Ω, if we set

Λ(α,f) = (α,f),

a natural choice for α is α = Λ(α):e'(Ω×Ω)e.

Moreover, for , f):τ×σ→[,]0,

we have the following:

 

 

 

 

 

 

 

 

f G(e'×e)[τ×σ, [,]α ]

 

 

 

 

 

 

 

 

 

 

 

 

 

G(e'×e)[τ˚ fst, [,]α]

 

by σ = tG(e) and the definition of product in ∫G

 

 

G(e')[τ˚ fst, ([,]α)]

 

via the isomorphism

of the adjuction giving the

 

 

 

 

 

 

 

 

 

external model

 

 

 

 

 

 

 

 

 

 

G(e')[τ˚ fst, ([,]eval) ˚ Λ(α)]

by naturality of .

 

 

 

 

 

 

 

 

We can then define

 

 

 

 

 

 

 

 

 

 

 

 

 

 

c σ

= ([,]

 

eval) : (Ω×Ω)e→Ω

 

 

 

 

 

 

 

 

 

 

1

 

0 ˚

 

 

 

 

 

 

 

 

 

 

 

 

 

 

and take

f = (f);

the previous diagram then commutes for eval = (eval, projc0σ).

 

 

 

 

 

 

 

We can eventually give the data for the adjunction

 

 

 

 

 

 

 

 

 

: c

c0 c

0

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 = ( 0 : → Ω, !).

 

 

 

 

 

 

 

 

 

 

 

As for PROJ = (α, f): c

c0c

c0, we need

α : (Ω×Ω)and

f G()[c

0

c0, c

1

c0

˚

α].

 

 

 

 

 

0

1

 

 

 

 

 

 

 

 

For eval : ×Ω→Ω and fst: ×Ω→Ω,

set α = Λ(< 0 ˚ fst, eval>). As for

f,

note first that

c0c0

= tG()

 

 

 

 

 

 

 

 

 

 

 

 

and

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

c1c0˚ α = ([,]0

˚ eval) ˚ Λ(< 0 ˚ fst, eval>)

 

 

 

 

 

 

 

 

 

 

= ([,]0

˚ < 0 ˚ fst, eval>)

 

by naturality of

 

 

 

 

 

 

 

 

 

 

= (( 0 ˚ fst) eval)

 

by the usual isomorphims.

 

 

 

 

 

 

 

We are then looking for

f G()[tG(), (( 0 ˚ fst) eval) ];

as we did in the proof of the

previous lemma, let us look for an arrow h G(×Ω)[tG(fst, ( 0 ˚ fst) eval]. Then the f we need will then be (h). Observe now that projeval G(×Ω)[ 0 ˚ fst, eval]; this immediately gives the required h in the following diagram:

281

12. Examples of Internal Models

In conclusion, the Grothendieck completion provides yet another example of the general categorical construction of model in chapter 11. Moreover, it gives further insight into the external versus internal approach by giving a setting where the external models may be viewed as internal constructions.

References The examples in this chapter may be found, in part, in the many papers mentioned at the end of the previous chapter. Since Moggi's hint for the small completeness of the PER construction, in particular, these models have been thoroughly explored by many authors. The three sections above develop the ideas in Amadio and Longo (1986) and in Longo and Moggi (1988), and follow Asperti and Martini (1989), respectively. By this, the first two sections extend to higher order the understanding of simple types as partial equivalence relations and retractions in Scott (1976). The consistency of λβηp is shown in Berardi (1988).

282

Bibliography

BIBLIOGRAPHY

Adachi T. [1983] “A categorical characterization of lambda-calculus models” Dept. of Info. Sci. Tokyo Inst. Tech., n. C-49.

Amadio R., Bruce K., Longo G. [1986] “The finitary projections model and the solution of higher order domain equations” IEEE Conference on Logic in Computer Science, LICS'86

Boston.

Amadio R., Longo G. [1986] “Type free compiling of parametric types”, IFIP Conference, in

Formal Description of Programming Concepts-III, M. Wirsing (ed.), Ebberup (DK), North-Holland, 1987.

Arbib M., Manes E. [1975] Arrows Structures and functors: The Categorical Imperative, Academic Press, London.

Arbib M., Manes E. [1975a] “Adjoint Machines, State-Behavior Machines and Duality” J. Pure and Applied Algebra, 6, (313-344).

Asperti A. [1988] “Stability and Computability in Coherent domains” Info&Comp. (to appear).

Asperti A., Longo G. [1987] “Categories of partial morphism and the relation between typestructures” Semester on Theory of Computation, Banach Center Publications, vol. 21, Warsaw.

Asperti A., Martini S. [1989] “Categorical models of polimorphism” Note interne, Dip. di Informatica, Università di Pisa.

Bainbridge E., Freyd P., Scedrov A., Scott P.J. [1990] “Functorial Polymorphism” Theoretical Comp. Sci. 70, 35-64.

Barendregt H.P., Koymans K. [1980] Comparing some classes of lambda calculus models, in Hindley and Seldin, (287-302).

Barendregt H. [1984] The Lambda Calculus; its syntax and semantics, Revised and expanded edition, North Holland.

Barr M. [1979] *-Autonomous Categories, Springer Lecture Notes in Mathematics 752, Berlin.

Barr M. [1990] “*-Autonomous Categories and Linear Logic”, Mathematical Structures in Computer Science, to appear.

Barr M., Wells C.F. [1985] “Toposes and Theories” Gundlehren der Mathematiscgen Wissenschaffen, 273, Springer-Verlag, New York.

283

Соседние файлы в предмете Электротехника