Exponentials with infinite multiplicities - Irif

4 downloads 0 Views 392KB Size Report
Rel validates the Taylor expansion formula, any model of the pure lambda-. 3 In the .... are no ambiguities, these indices will not be separated by commas. ..... one proves that if M and M are beta-equivalent, and x is a repetition-free list of.
Exponentials with innite multiplicities Alberto Carraro

1,2

2,?

, Thomas Ehrhard

1,??

, and Antonino Salibra

Department of Computer Science, Ca' Foscari University, Venice Laboratory Preuves, Programmes & Systèmes, UMR 7126, University Paris Diderot  Paris 7 and CNRS 1

2

Given a semi-ring with unit which satises some algebraic conditions, we dene an exponential functor on the category of sets and relations which allows to dene a denotational model of dierential linear logic and of the lambda-calculus with resources. We show that, when the semi-ring has an element which is innite in the sense that it is equal to its successor, this model does not validate the Taylor formula and that it is possible to build, in the associated Kleisli cartesian closed category, a model of the pure lambda-calculus which is not sensible. This is a quantitative analogue of the standard graph model construction in the category of Scott domains. We also provide examples of such semi-rings. Keywords: lambda-calculus, linear logic, denotational semantics, dierential lambda-calculus, resource lambda-calculus, non sensible models. Abstract.

Introduction The category of sets and relations is a quite standard denotational model of linear logic which underlies most denotational models of this system (coherence spaces, hypercoherence spaces, totality spaces, niteness spaces. . . ). In this completely elementary setting, a formula is interpreted as a set, and a proof of that formula is interpreted as a subset of the set interpreting the formula. Logical connectives are interpreted very simply: tensor product, par and linear implication are interpreted as cartesian products whereas direct product (with) and direct sums (plus) are interpreted as disjoint union. The linear negation of a set is the same set: it is a remarkable feature of linear logic that it admits such a degenerate semantics of types, which is nonetheless non trivial in the sense that proofs are not identied. Exponentials are traditionally interpreted by the operation which maps a set

X

to the set of all nite multisets of elements of

X

(the origin of this idea

can be found in [Gir88]). One might be tempted to use nite sets instead of nite multisets since, in the coherence space semantics, the exponential can be interpreted by an operation which maps a coherence space to the sets of its nite cliques (with a suitable coherence). In the relational model however, such an interpretation of the exponentials based on nite sets is not possible as it leads to a dereliction which is not natural (in the categorical sense). ? ??

Work partially funded by the ANR project CHOCO, ANR-07-BLAN-0324. Work partially funded by the MIUR project CONCERTO

With this standard multiset-based interpretation of exponentials, the relational model interprets also the dierential extensions of linear logic and of the lambda-calculus presented in [ER03,ER06b,EL10]. In the dierential lambdacalculus, terms can be derived (dierentiated): a term transformed into a term

M0

of type

A → (A → B)

M

of type

A→B

can be

which is linear in its second

A (using a linear implication symbol  ( , the type of M 0 could be written A → (A ( B)). The word linear can be taken here in its stan-

parameter of type

dard algebraic sense, or in its operational sense of using its argument exactly

nth derivative M (n) : A → (An → B) which is n-linear in its n last arguments of type A, that (n) is M : A → (A ⊗ · · · ⊗ A ( B). The introduction of this new construction

once. This dierentiation operation can be iterated, yielding a

requires the possibility of freely adding terms of the same type: in the model

Rel,

this addition operation is interpreted as set union (remember that terms

as interpreted as subsets of the interpretations of types). Also, each type has to

0

contain a

element which, here, is the empty set.

This strongly suggests to consider the following Taylor series, given a term

P∞ 1 (n) M (0) · (N, . . . , N ). In this N of type A: n=0 n! 1 (n) formula, the map N 7→ M (0) · (N, . . . , N ) is the approximation of degree n n! of the function M , that is the part of the function M which uses its argument exactly n times. For simplifying the setting and for dealing easily with untyped M

of type

A→B

and a term

terms, it is suitable to consider a version of that formula where coecients are all equal to one, and where addition of terms is an idempotent operation: terms form a complete lattice and the Taylor expansion of simply

W∞

M

can be written more

(n) (0) · (N, . . . , N ). n=0 M

With Regnier, the second author studied this operation in [ER08,ER06a], introducing a

lambda-calculus with resources which can be seen as the dierential

lambda-calculus where ordinary term to

0:

3 application can be used only for applying a

this is the only ordinary application needed if we want to Taylor

expand all the applications occurring in lambda-terms. In these two papers we proved in an untyped setting that, Taylor expanding completely a lambda-term

M,

one obtains a (generally innite) linear combination of resource terms and

4

that, if one normalizes each resource term occurring in that formal sum , one obtains the Taylor expansion of the Böhm tree of

M.

This result implies that, in a denotational model which validates the Taylor expansion formula in the sense that the interpretation of a term

M

is equal to

the interpretation of its Taylor expansion, the interpretation of an unsolvable

5 is necessarily equal to

lambda-term

Rel 3

4 5

0.

Since the multiset-based exponential of

validates the Taylor expansion formula, any model of the pure lambda-

In the dierential lambda-calculus, there are two kinds of application: the ordinary application of a term to an argument, and the application of the nth derivative of a term to a n-tuple of terms. This latter application is n-linear in its arguments whereas the former is not linear. Resource terms are strongly normalizing, even if they are not typeable. We recall that a term is solvable i its head reduction terminates, see [Kri93, Chapter 4].

calculus in the corresponding cartesian closed category, such as the model presented in [BEM07,BEM09], seems to be bound to be sensible (at least if dierential operations are interpreted in the standard way). This seems to be a serious limitation in the equational expressive power of this kind of semantics. This problem arose during a general investigation undertaken by the authors, whose scope is to develop an algebraic setting for dierential extensions of the lambda-calculus, in the spirit of [PS98,MS09].

Content.

The present paper proposes a solution to this problem, by introducing

new exponential operations on

Rel. The idea is quite simple: we replace the set N

of natural numbers (which are used for counting multiplicities of elements in mul-

ω ω +1 = ω . Mutatis mutandis, the various structures of the exponentials

tisets) with more general semi-rings which typically contain innite elements such that

(functorial action, dereliction etc) are interpreted as with the ordinary multisetbased exponentials. For these structures to satisfy the required equations, some rather restrictive conditions have to be satised by the considered semi-ring: the semi-rings which satisfy these conditions are called multiplicity semi-rings. We show that such a semi-ring must contain

N and we exhibit multiplicity semi-rings

with innite elements. In these models with innite multiplicities, the dierential constructions are available, but the Taylor formula does not hold. It is possible to nd morphisms

f :A→B

6= 0 but are f (n) (0) : An → B is equal to 0. The the 0 map, and hence the function is

(in the associated cartesian closed category) which are

such that, for all

n,

the

nth

derivative

Taylor expansion of such a function is

dierent from its Taylor expansion. This is analogous to the well known smooth

f : R → R dened by f (0) = 0 and f (x) = e−1/|x| for x 6= 0: all the derivatives of f at 0 are equal to 0 and hence there is no neighborhood of 0 where f coincides with its Taylor expansion at 0. In some sense, f is innitely at at 0, and we obtain a similar eect with our innite multiplicities. (C



) map

For any multiplicity semi-ring which contains an innite element, we build a model of the pure lambda-calculus, which is not sensible and, more precisely, where the term

Ω = (λx (x) x) λx (x) x

has a non-empty interpretation (we also

exhibit a non solvable term whose interpretation is distinct from that of use Krivine's notation for lambda-terms: the application of as

M

to

N

Ω ).

We

is denoted

(M ) N .

Warning.

Most proofs are omitted and will be available in a longer version of

this article.

1

The relational model of linear logic

Rel is the category whose objects are sets and with hom-sets Rel(X, Y ) = P(X × Y ). In this category, composition is the ordinary composition of relations: if R ∈ Rel(X, Y ) and S ∈ Rel(Y, Z), then S · R = {(a, c) ∈ X × Z | ∃b ∈ Y (a, b) ∈ R

and

(b, c) ∈ S} .

and identities are the diagonal relations:

IdX = {(a, a) | a ∈ X}.

This category has a well known symmetric monoidal structure (compact closed actually), with tensor product given on objects by

X1 ⊗ X2 = X1 × X2

and on morphisms by

R1 ⊗ R2 = {((a1 , a2 ), (b1 , b2 )) | (ai , bi ) ∈ Ri for any

Ri ∈ Rel(Xi , Yi ) (i = 1, 2).

for

i = 1, 2}

The associativity and symmetry isomor-

phisms are the obvious bijections, the neutral object of the tensor product is the singleton set

1 = {∗}.

X to Y X ( Y = X × Y , with evaluation morphism ev ∈ Rel((X ( Y ) ⊗ X, Y ) given by ev = {(((a, b), a), b) | a ∈ X, b ∈ Y }. Given R ∈ Rel(Z ⊗ X, Y ), the linear currycation of R is cur(R) ∈ Rel(Z, X ( Y ). This category is starautonomous, with dualizing object ⊥ = 1. The category Rel is also cartesian: the cartesian product of a family of obQ S jects (Xi )i∈I is i∈I Xi = i∈I ({i} × Xi ). The binary cartesian product of X and Y is denoted as X & Y and the terminal object is > = ∅. The projecQ tion πi ∈ Rel( i∈I Xi , Xi ) is πi = {((i, a), a) | a ∈ Xi } and, given a family (Ri )i∈I Q of morphisms Ri ∈ Rel(Y, Xi ), the corresponding morphism hRi ii∈I ∈ Rel(Y, i∈I Xi ) is given by hRi ii∈I = {(b, (i, a)) | i ∈ I and (b, a) ∈ Ri }. This monoidal category is closed: the object of morphisms from

is

2

Exponentials

We present a way of building exponential functors, once a notion of multiplicity is given, as a semi-ring satisfying strong conditions.

2.1 Multiplicity semi-rings Notational convention for indices.

We shall use quite often multiple indices,

written as subscript as in  aijk  which has three indices

i, j

and

k.

When there

are no ambiguities, these indices will not be separated by commas. We insert commas when we use multiplication on these indices, as in  ai,2j,k  for instance. A semi-ring

M

is a

multiplicity semi-ring

if it is commutative, has a multi-

plicative unit and satises (MS1) (MS2) (MS3)

∀n1 , n2 ∈ M n1 + n2 = 0 ⇒ n1 = n2 = 0 (we say that M is positive ) ∀n1 , n2 ∈ M n1 + n2 = 1 ⇒ n1 = 0 or n2 = 0 (we say that M is discrete ) ∀n1 , n2 , p1 , p2 ∈ M n1 + n2 = p1 + p2 ⇒ ∃r11 , r12 , r21 , r22 ∈ M n1 = r11 + r12 , n2 = r21 + r22 , p1 = r11 + r21 , p2 = r12 + r22 (we say that M has the

(MS4)

additive splitting property )

∀m, p, n1 , n2 ∈ M pm = n1 +n2 ⇒ ∃p1 , p2 , m11 , m12 , m21 , m22 ∈ M m11 + m21 = m12 + m22 = m, p1 m11 + p2 m12 = n1 , p1 m21 + p2 m22 = n2 and p1 + p2 = p (we say that M has the multiplicative splitting property ).

Remark 1.

The motivation for Condition (MS4) is mainly technical: it is essential

in the proof of Lemma 7. It has also an intuitive content, describing what happens when an element of

M

can be written both as a sum and as a product. The proof

that this property holds in

N is based on Euclidean division. We conjecture that

this property is independent from Conditions (MS1), (MS2) and (MS3).

Generalized splitting properties.

The splitting conditions are expressed in

a binary way, we must generalize them to arbitrary arities. We rst generalize Condition (MS3).

Lemma 1. Let M be a semi-ring satisfying (MS1) and (MS3). Let n1 , . . . , nl ∈ P P and p1 , . . . , pr ∈ M be such that li=1 ni = rj=1 pj . Then there is a family Pr (sij )l,r i=1,j=1 of elements of M such that ∀i ∈ {1, . . . , l} ni = j=1 sij and ∀j ∈ Pl {1, . . . , r} pj = i=1 sij . M

Similarly, we generalize Condition (MS4).

Lemma 2. Let M be a semi-ring satisfying (MS1), (MS3) and (MS4). Let k ∈ with k 6= 0. Let l = 2k−1 . For all n1 , . . . , nk , m, p ∈ M , if pm = n1 + · · · + nk , then there exist (pj )lj=1 ∈ M and (mij )k,l i=1,j=1 with

N

• p1 + · · · + pl = p • m1j + · · · + mkj = m for j = 1, . . . , l • and p1 mi1 + · · · + pl mil = ni for i = 1, . . . , k .

Proposition 1. Any multiplicity semi-ring M contains an isomorphic copy of N.

We shall simply say that

M

contains

N,

that is

multiplicity semi-ring cannot be nite. An element to be

innite

if it satises

m

N ⊆ M.

In particular, a

of a semi-ring will be said

m = m + 1.

Examples of multiplicity semi-rings.

The elements of a multiplicity semi-

ring should be considered as generalized natural numbers. We give here examples of such semi-rings.

Natural numbers. N N

The most canonical example of multiplicity semi-ring is the set

of natural numbers, with the ordinary addition and multiplication. Of course, has no innite element.

Proposition 2.

N

is a multiplicity semi-ring.

Completed natural numbers.

N = N ∪ {ω} be the completed set of natural n+ω = ω+n = ω , and multiplication nω = ωn = ω for n 6= 0, so that N has exactly one innite Let

numbers. We extend addition to this set by by

0ω = ω0 = 0

and

element, namely

ω.

Proposition 3.

N

is a multiplicity semi-ring.

A semi-ring with innite and non-idempotent elements.

A more interesting ex-

N2 = (N+ × N) ∪ {0}. The element (n, d) of this set (with n 6= 0) will d be denoted as nω . We extend this notation to the case where n = 0, identifying d 0ω with 0, which is quite natural with these notations. Addition is dened as follows (0 being of course neutral for this operation)  0 d 0  if d = d (n + n )ω d 0 d0 d 0 nω + n ω = nω if n 6= 0 and d < d  0  0 d 0 0 nω if n 6= 0 and d < d ample is

nitely many innite elements:

0

0

nω d n0 ω d = nn0 ω d+d . This semi-ring has ind all the elements nω of N2 with n 6= 0 and d 6= 0

and multiplication is dened by are innite.

Proposition 4.

N2

From now on,

M

is a multiplicity semi-ring. denotes a multiplicity semi-ring.

2.2 The exponential functor Given a set

X , we dene !M X

as the free M-module MhXi generated by X , that µ : X → M such that supp(µ) = {a ∈ X | µ(a) 6= nite. These functions will be called M-multisets (of

is, as the set of all functions

0}

(the

support

of

X ). a ∈ X,

µ)

is

elements of

[a] ∈ !M X the function given by [a](b) = δa,b (the 0 ∈ M if a 6= b and 1 ∈ M if a = b). We use the standard algebraic notations for denoting the operations in the M-module P !M X . If µ ∈ !M X , we dene the cardinality of µ by #µ = a∈supp(µ) µ(a) ∈ M. Given R ∈ Rel(X, Y ), we dene !M R ∈ Rel(!M X, !M Y ) as the set of all pairs (µ, ν) such that one can nd σ ∈ MhX × Y i with supp(σ) ⊆ R and X X ∀a ∈ X µ(a) = σ(a, b) and ν(b) = σ(a, b) . Given

we denote as

Kronecker symbol which takes value

b∈Y

σ is a witness σ ∈ MhX × Y i.

We say then that nite because

a∈X

of (µ, ν) for R. Observe that all these sums are

IdX = Id!M X . Let R ∈ Rel(X, Y ) and S · R ∈ Rel(X, Z) the relational composition of R

It is clear from this denition that !M

S ∈ Rel(Y, Z). and S .

Lemma 3. Proof.

We denote as

!M (S · R) = !M S · !M R.

This is essentially an application of Lemma 1.

2

Lemma ⊆ X × Y and let (µi , νi ) ∈ !M R and pi ∈ M for i = 1, . . . , n. P4. Let RP

Then (

n i=1

pi µi ,

n i=1

pi νi ) ∈ !M R.

Proof.

Pn a witness σi Pn i, choose ( i=1 pi µi , i=1 pi νi ) for R.

For each

witness of

of

(µi , νi )

for

R.

Then

Pn

i=1

pi σi

is a

2

2.3 Comonad structure of the exponential We introduce the fundamental comonadic structure of the exponential functor, which consists of two natural transformations usually called counit of the comonad) and

Dereliction. Lemma 5. Proof.

dereliction

is a natural transformation from !M to Id. 2

One applies Conditions (MS1) and (MS2).

Remark 2. would have

(the

(the comultiplication of the comonad).

dX = {([a], a) | a ∈ X} ∈ Rel(!M X, X).

We set

dX

digging

One could consider taking

!M X = Pfin (X),

M = {0, 1}

with

1 + 1 = 1, and then we X . But this semi-

the set of all nite subsets of

ring does not satisfy Condition (MS2) and, indeed, dereliction is not natural as already mentioned in the Introduction.

Digging.

This operation is more problematic and some preliminaries are re-

quired.

Lemma 6. Let X and Y be sets and let R ⊆ X × Y . Let ν1 , ν2 ∈ !M Y µ ∈ !M X . If (µ, ν1 + ν2 ) ∈ !M R, then one can nd µ1 , µ2 ∈ !M X such µ1 + µ2 = µ and (µi , νi ) ∈ !M R for i = 1, 2. Proof.

2

We use Lemma 1.

Given

M ∈ !M !M X ,

and that

we set

Σ(M ) =

X

M (m)m ∈ !M X .

m∈!M X Since

M

has a nite support, this sum is actually a nite sum (the linear com-

M (m) ∈ M, is pX ∈ Rel(!M X, !M !M X) by

bination, with coecients We dene

taken in the module !M X ).

pX = {(Σ(M ), M ) | M ∈ !M !M X} . The next lemma is the main tool for proving the naturality of digging. It combines the two generalized splitting properties of

Lemma 7. Let

M.

X and Y be sets and let R ⊆ X × Y be nite. There exists q(R) ∈ N with the following property: for any µ ∈ !M X, π ∈ !M Y and p ∈ M, if (µ, pπ) ∈ !M R, then one can nd p1 , . . . , pq(R) ∈ M and µ1 , . . . , µq(R) ∈ !M X such Pq(R) P that q(R) j=1 pj = p, j=1 pj µj = µ and (µj , π) ∈ !M R for each j = 1, . . . , q(R).

Proof.

Let I = {a ∈ X | ∃b ∈ Y (a, b) ∈ R} and J = {b ∈ Y | ∃a ∈ X (a, b) ∈ R}. b ∈ J , let degb (R) = #{a ∈ X | (a, b) ∈ R} − 1 ∈ N and let deg(R) = P deg b (R). We prove the result by induction on deg(R). b∈J Assume rst that deg(R) = 0, so that, for any b ∈ J , there is exactly one a ∈ I such that (a, b) ∈ R, let us set a = g(b): g is a surjective function from J to I whose graph coincides with R (in the sense that R = {(g(b), b) P| b ∈ J}). Let σ be a witness of (µ, pπ) for R. For all b ∈PJ we have pπ(b) =P a∈X σ(a, b) = σ(g(b), b) and for all a ∈ I we have µ(a) = g(b)=a σ(a, b) = p g(b)=a π(b). Let τ ∈ MhX × Y i be dened by ( π(b) if g(b) = a τ (a, b) = 0 otherwise.

Given

supp(τ )P⊆ R and τ is a witness of (µ0 , π) for R, where µ0 ∈ !M X 0 0 is given by µ (a) = g(b)=a π(a). Since pµ = µ, we have obtained the required 0 property (with q(R) = 1, p1 = p and µ1 = µ ). Assume now that deg(R) > 0 and let us pick some b ∈ J such that k = degb (R)+1 > 1. Let σ be a witness of (µ, pπ) for R. Let a1 , . . . , ak be a repetitionfree enumeration of the elements a of I such that (a, b) ∈ R. We have

then clearly

pπ(b) =

k X

σ(ai , b) .

i=1

l = 2k−1 . By Lemma 2, there exist p1 , . . . , pl ∈ M and (mij )k,l i=1,j=1 M with

Let of

elements

• p1 + · · · + pl = p • m1j + · · · + mkj = π(b) for j = 1, . . . , l • and p1 mi1 + · · · + pl mil = σ(ai , b) for i = 1, . . . , k . b1 , . . . , bk be pairwise distinct new elements, which do not belong to X nor Y , and let Y 0 = (Y \ {b}) ∪ {b1 , . . . , bk }. We dene a new relation to which

Let to

we shall be able to apply the inductive hypothesis as follows:

S = {(a, b0 ) ∈ R | b0 6= b} ∪ {(ai , bi ) | i = 1, . . . , k} . Then we have

deg(S) = deg(R) − k + 1 < deg(R).

Let

τ ∈ MhX × Y 0 i

be given

by

  σ(a, c) τ (a, c) = σ(ai , b)   0 It is clear that where

supp(τ ) ⊆ S .

πj ∈ !M Y 0

if if

c∈ / {b1 , . . . , bk } c = bi and a = ai

otherwise.

Moreover,

τ

is a witness of

is given by

( π(c) πj (c) = mij

if if

c∈ / {b1 , . . . , bk } c = bi .

(µ,

Pl

j=1

p j πj )

for

S,

j ∈ {1, . . . , l}.

for each

X

Indeed, for

X

τ (a, c) =

c∈Y 0

a∈X

we have

τ (a, c) +

c∈Y 0 \{b1 ,...,bk }

X

=

σ(a, c) +

X

τ (a, bi )

i=1

c∈Y 0 \{b1 ,...,bk }

=

k X

k X

δa,ai σ(ai , b)

i=1

σ(a, c) + σ(a, b) =

c∈Y 0 \{b1 ,...,bk } and for

X

c ∈ Y 0 \ {b1 , . . . , bk }

τ (a, c) =

a∈X and last, for

X

σ(a, c) = pπ(c) =

l X

( pj πj (c)

since

j=1 (with

X

i ∈ {1, . . . , k}),

τ (a, c) = σ(ai , b) = 

µ,

Pl

j=1

pj πj



∀j πj (c) = π(c) Pl j=1 pj = p

we have

l X

pj mij =

j=1

a∈X By Lemma 6, since

σ(a, b) = µ(a)

b∈Y

we have

a∈X

c = bi

X

∈ !M S ,

l X

pj πj (c) .

j=1 we can nd

µ1 , . . . , µl ∈ !M X

Pl

such

j=1 µj = µ and (µj , pj πj ) ∈ !M S for each j ∈ l = {1, . . . , l}. Since deg(S) < deg(R), we can apply the inductive hypothesis for each j ∈ l. So we Pq(S) l,q(S) can nd a family (pjs )j=1,s=1 of elements of M such that pj = s=1 pjs and we Pq(S) l,q(S) can nd a family (µjs )j=1,h=1 of elements of !M X such that s=1 pjs µjs = µj , and moreover (µjs , πj ) ∈ !M S for each j ∈ l and s ∈ q(S). We conclude the proof 0 by showing that (µjs , π) ∈ !M R. Let τjs ∈ MhX × Y i be a witness of (µjs , πj ) for S . Let σjs ∈ MhX × Y i be given by ( 0 τjs (a, b0 ) if b 6= b 0 σjs (a, b ) = Pk 0 i=1 τjs (a, bi ) if b = b. P P 0 0 0 0 0 For b ∈ Y \ {b}, we have a∈X σjs (a, b ) = a∈X τjs (a, b ) = πj (b ) = π(b ).

that

Next we have

X

σjs (a, b) =

k XX

τjs (a, bi )

a∈X i=1

a∈X

=

k X X

τjs (a, bi )

i=1 a∈X

=

k X i=1

πj (bi ) =

k X i=1

mij = π(b) .

On the other hand we have

X

σjs (a, b0 ) =

b0 ∈Y

X b0 ∈Y

=

σjs (a, b0 ) + σjs (a, b)

\{b}

X

τjs (a, b0 ) +

b0 ∈Y \{b}

=

X

k X

τjs (a, bi )

i=1

τjs (a, c) = µjs (a) .

c∈Y 0 It remains to prove that denition of

σjs

Observe that we can

Lemma 8. Proof.

pX

supp(σjs ) ⊆ R, but this results immediately from the supp(τjs ) ⊆ S . deg(R) take q(R) = lq(S), so that in general q(R) = 2 . 2

and from the fact that

is a natural transformation from !M to !M !M . 2

This is essentially an application of Lemma 7.

Comonad equations

d!M X · pX = Id!M X . Let (µ, µ0 ) ∈ !M X × !M X . Assume rst that (µ, µ ) ∈ d!M X · pX . Then we can nd M ∈ !M !M X such 0 0 that (µ, M ) ∈ pX and (M, µ ) ∈ d!M X . This means that M = [µ ] and hence Σ(M ) = µ0 , hence µ = µ0 . Conversely, for µ ∈ !M X we have (µ, [µ]) ∈ pX , therefore (µ, µ) ∈ d!M X · pX . 0 Next we prove that !M dX · pX = Id!M X . Let (µ, µ ) ∈ !M dX · pX . Let M ∈ !M !M X be such that (µ, M ) ∈ pX , that is Σ(M ) = µ, and (M, µ0 ) ∈ !M dX . 0 0 Let σ ∈ Mh!M X × Xi be a witness of (M, µ ) for dX . This means that µ (a) = P (ν) = σ([a], a) if ν∈!M X σ(ν, a) = σ([a], a) since supp(σ) ⊆ dX , and that MP νP= [a], and M (ν) = 0 if #ν 6= 1. It follows that Σ(M ) = ν∈!M X M (ν)ν = 0 0 a∈X σ([a], a)[a] = µ and hence µ = µ . Conversely, one has (µ, µ) ∈ !M dX · pX , because M ∈ !M !M X dened by M (ν) = µ(a) if ν = [a] and M (ν) = 0 if #ν 6= 0 satises (µ, M ) ∈ pX and (M, µ) ∈ !M dX . P Lemma 9. Let M ∈ !M !M !M X . Then Σ(Σ(M)) = N ∈!M !M X M(N )Σ(N ).

Proof.

We prove that

0

We have

Σ(Σ(M)) =

X

Σ(M)(ν)ν

ν∈!M X

! =

X

X

ν∈!M X

N ∈!M !M X

M(N )N (ν) ν !

=

X N ∈!M !M X

M(N )

X ν∈!M X

N (ν)ν

2

and we are done. Using Lemma 9, one proves the last comonad equation, namely

!M pX · pX .

Fundamental isomorphism.

p!M X · pX =

One of the most important properties of the

exponential is that it maps cartesian products to tensor products. Combined with the monoidal closure of of the Kleisli category

Rel,

this property leads to the cartesian closeness

Rel! .

Proposition 5. Given two sets X1 and X2 , there is an natural bijection nX ,X !M X1 ⊗ !M X2 → !M (X1 & X2 )

1

and a bijection n0 : 1 → !M >.

2

:

(µ1 , µ2 ) ∈ !M X1 ⊗ !M X2 , we dene ν = n(µ1 , µ2 ) ∈ !M (X1 & X2 ) by ν(i, a) = µi (a) for i = 1, 2, and n0 (∗) is unique element of !M > (the empty

Given

multiset).

Structural morphisms.

They are used for interpreting the

structural rules

of linear logic, associated with the exponentials. The weakening morphism is

weakX : !M X → 1 is weakX = {([], ∗)}. The contraction morphism is contrX : !M X → !M X ⊗ !M X is obtained by applying the !M functor to the diagonal map X → X & X , so that contrX = {(λ + ρ, (λ, ρ)) | λ, ρ ∈ !M X}. There are other equations to check for proving that we have dened a model of linear logic (see [Bie95]), the corresponding verications are straightforward.

2.4 The Kleisli cartesian closed category Rel! of the comonad  !M  are the sets, Rel! (X, Y ) = Rel(!M X, Y ). Identity in this category is dereliction dX ∈ Rel! (X, X) and composition is dened as follows: let R ∈ Rel! (X, Y ) and S ∈ Rel! (Y, Z), then S ◦ R = S · !M R · pX . We give a direct characterization of

The objects of the Kleisli category and

this composition law.

Proposition 6. Let b1 , . . . , b n ∈ Y

such that

(µ, c) ∈ !M X × Z , we have (µ, c) ∈ S ◦ R i there exist (not necessarily distinct), p1 , . . . , pn ∈ M and µ1 , . . . , µn ∈ !M X

∀i ∈ {1, . . . , n} (µi , bi ) ∈ R ,

n X i=1

Proof.

! pi [bi ], c

∈S

and µ =

n X

pi µi .

i=1

(µ, c) ∈ S ◦ R. Let M ∈ !M !M X such that (µ, M ) ∈ pX ν ∈ !M Y be such that (ν, c) ∈ S and (M, ν) ∈ !M R. We have Σ(M ) = µ. Let σ ∈ Mh!M X × Y i be a witness of (M, ν) for R, and let (µ1 , b1 ), . . . , (µn , bn ) be a repetition-free enumeration of the set supp(σ) ⊆ R. Taking pi = σ(µi , bi ), Pn Pn Pn we have i=1 pi [bi ] = ν and i=1 pi [µi ] = M , and therefore µ = i=1 pi µi . Assume conversely that (µ, c) satises the conditions stated in the proposiPn Pn tion. Then we take ν = i=1 pi [bi ] and M = i=1 pi [µi ]. We have (ν, c) ∈ S and let

Assume rst that

and

σ=

(µ, M ) ∈ pX and we have just P n i=1 pi [(µi , bi )]; this is a witness

(M, ν) ∈ !M R. We R, as easily checked.

to check that of

(M, ν)

for

dene

2

and Y in this category is X & π1 and π2 with dX&Y in Rel. The function space of X and Y is !M X ( Y . Evaluation Ev ∈ Rel! (X & (!M X ( Y ), Y ) ' Rel(!M X ⊗ !M (!M X ( Y ), Y ) is We recall that the cartesian product of

Y,

X

with projections obtained by composing

Ev = {((µ, [(µ, b)]), b) | µ ∈ !M X

and

b ∈ Y }.

R ∈ Rel! (Z & X, Y ) ' Rel(!M Z ⊗ Cur(R) = {(π, (µ, b)) | ((π, µ), b) ∈ R} ∈ Rel! (Z, !M X ( Y ).

Currycation is dened as follows: let

!M X, Y ),

then

Dierential structure and the Taylor expansion. cise denitions, let us mention that the

Without giving pre-

dierential structure

of this model,

∂ X ∈ Rel (X, !M X) (codereliction ), coweakX ∈ Rel (1, !M X) (coweakening ) and cocontrX ∈ Rel (!M X ⊗ !M X, !M X) (cocontraction ) allows to associate, with any morphism R ∈ Rel! (X, Y ), its ∗ ∗ Taylor expansion R ∈ Rel! (X, Y ). When M = N, one has M = M but this equation does not hold anymore when M has an innite element ω . In that case, ∗ if R = {(ω[∗], ∗)} ∈ Rel! (1, 1), one has R = ∅ = 6 R. which consists of natural linear morphisms

3

Graph models in Rel

Graph models [Bar84] have been isolated by Scott and Engeler in the continuous semantics. We develop here a similar construction, in the relational semantics.

A be a non-empty set whose elements will be called atoms, and are not pairs. ι : A → (!M A ( A) be a partial injective map. ι ι ι ι We dene a sequence (Dn )n∈N of sets as follows: D0 = A and Dn+1 = Dn ∪ S ι ι ι ι is monotone, and we set D = ((!M Dn ( Dn ) \ ι(A)). This n∈N Dn . S sequence ι ι ι ι We have !M D ( D = n∈N (!M Dn ( Dn ). ι ι ι We dene a function ϕ : D → (!M D ( D ) by ( ι(a) if α = a ∈ A ϕ(α) = α if α ∈ /A Let Let

and a function

ψ : (!M Dι ( Dι ) → Dι by ( a if (µ, α) = ι(a) where a ∈ A ψ(µ, α) = (µ, α) if (µ, α) ∈ / ι(A) .

ι is injective, and because, if (µ, α) ∈ ι (!M Dnι ( Dnι ) \ ι(A), then (µ, α) ∈ Dn+1 ⊆ Dι . Let (µ, α) ∈ !M Dι ( Dι . If (µ, α) ∈ ι(A), let a be the unique element of A such that ι(a) = (µ, α). We have ϕ(ψ(µ, α)) = ϕ(a) = ι(a) = (µ, α). If (µ, α) ∈ / ι(A), we have ϕ(ψ(µ, α)) = ϕ(µ, α) = (µ, α) because (µ, α) ∈ / A, since no element of A is a pair. This denition makes sense because

So we have ϕ ◦ ψ = Id. We dene two morphisms App = {([α], ϕ(α)) | α ∈ Dι } ∈ Rel! (Dι , !M Dι ( Dι ) and Lam = {([(µ, α)], ψ(µ, α)) | (µ, α) ∈ !M Dι ( Dι } ∈ Rel! (!M Dι ( Dι , Dι ). Then we have App ◦ Lam = Id!M Dι (Dι , so that Dι is a reexive object in Rel! , whatever be the choice of the multiplicity semi-ring M.

3.1 Interpreting terms Given a lambda-term

M

Dι n

(where

induction on

M,

the interpretation

is the cartesian product of

M

x = (x1 , . . . , xn ) [M ]x ∈ Rel! (Dι n , Dι ) n times) is dened by

and a repetition-free list of variables

which contains all free variables of



with itself,

as follows

n

• [xi ]x = πi (the ith projection from (Dι ) to Dι ) • [λx N ]x = Lam ◦ Cur([M ]x,x ), assuming that x does • [(N ) P ]x = Ev ◦ hApp ◦ [N ]x , [P ]x i

not occur in

x

Rel! and the fact that App ◦ Lam = Id!M Dι (Dι , x is a repetition-free list of 0 0 variables which contain all the free variables of M and M , one has [M ]x = [M ]x . Using the cartesian closeness of

one proves that if

M

and

M0

are beta-equivalent, and

This requires to prove rst a substitution lemma, see [AC98]. We present now this interpretation as a typing system (a variation of de Carvalho's system R [DC08]). A type is an element of

α∈D

ι

Dι .

Given

µ ∈ !M D ι

and

µ → α = ψ(µ, α). A typing context is a nite partial function ι from variables to !M D . If Γ1 , . . . , Γk are contexts with the same domain and Pk p1 , . . . , pk ∈ M, the sum i=1 pi Γi is dened pointwise (using the addition of !M Dι ). The typing rules are , we set

Γ, x : µ ` M : α x1 : [], . . . , xn : [], x : [α] ` x : α Γ ` λx M : µ → α Pn Γ ` M : ( i=1 pi [βi ]) → α ∀i ∈ n Γi ` N : βi Pn Γ + i=1 pi Γi ` (M ) N : α In the last rule, all contexts involved must have same domain, and the

βi 's

need

not be distinct.

Proposition 7. The judgment Γ

` M : α is derivable i (Γ (x1 ), . . . , Γ (xn ), α) ∈ [M ]x where x = (x1 , . . . , xn ) is a repetition-free enumeration of the domain of Γ , which is assumed to contain all the free variables of M .

Proof.

Straightforward induction on the judgment, using Proposition 6.

ω ω + 1 = ω ). Let A = {a}, ι : A → (!M A ( A) ι(a) = (ω[a], a), so that (ω[a] → a) = a. Let Ω = (δ) δ where

We take for

M

a multiplicity semi-ring which contains an innite element

(remember that this means that be dened by

2

δ = λx (x) x.

Proposition 8. In the model Dι , we have [Ω] = {a}.

Proof.

We have the following deduction tree (we have inserted in this tree the

equations between types or

M-multisets

of types that we use)

x : [a] ` x : a = ω[a] → a x : [a] ` x : a x : [a] + ω[a] = ω[a] ` (x) x : a (same derivation) ` λx (x) x : ω[a] → a ` λx (x) x : ω[a] → a = a ` (λx (x) x) λx (x) x : a Therefore

a ∈ [Ω].

α ∈ Dι and assume that ` Ω : α. There must exist µ ∈ !M Dι such that ` δ : µ → α and ∀β ∈ supp(µ) ` δ : β . Form the rst of these two ι judgments we get x : µ ` (x) x : α and hence there must exist ν ∈ !M D such that µ = ν + [ν → α]. From the second judgment we get ` δ : ν → α and ∀β ∈ supp(ν) ` δ : β . Iterating this process, we build a sequence (µi )∞ i=1 of ι elements of !M D such that ` δ : µi → α, ∀β ∈ supp(µi ) ` δ : β and µi = µi+1 + [µi+1 → α] for all i. Let βi = µi → α, it follows that ∀i βi ∈ supp(µ1 ) and since supp(µ1 ) is nite, we can nd i and n > 0 such that βi+n = βi . We have βi = (µi → α) = ((µi+1 +[βi+1 ]) → α) = · · · = ((µi+n +[βi+1 ]+· · ·+[βi+n ]) → α) and since βi = βi+n = (µi+n → α), we get µi+n = µi+n + [βi+1 ] + · · · + [βi+n ] (because ψ is injective) and hence βi+n ∈ supp(µi+n ). But βi+n = (µi+n → α) and hence we must have βi+n = a. Indeed, if βi+n ∈ / A then by denition of ψ we have βi+n = (µi+n , α) and, if k is the least integer such that βi+n ∈ Dkι , ι we have k > 0 and β ∈ Dk−1 for all β ∈ supp(µi+n ). This is impossible since βi+n ∈ supp(µi+n ). Since (µi+n → α) = a, we have α = a and we are done. 2 Conversely, let

Since

([] → a) ∈ [λy Ω] and a 6= ([] → a), we have found Ω and λy Ω ) with distinct interpretations in Dι

terms (namely

two unsolvable and hence this

model is not sensible.

Conclusion We have introduced the algebraic concept of multiplicity semi-ring, which can be used for generalizing the standard exponential construction of the relational model of linear logic. Such a semi-ring must contain also have innite elements

ω

such that

N as a sub-semi-ring but can ω +1 = ω . In that case, the corresponding

model of linear logic is a model of the dierential lambda-calculus which does not satisfy the Taylor formula, and it is possible to build non sensible models of the lambda-calculus in the corresponding Kleisli cartesian closed category. This shows that models of the pure dierential lambda-calculus can have non sensible theories and provides a new way of building models of the pure lambda-calculus where non termination is taking into account in a quantitative way by means of these innite multiplicities.

References [AC98]

Roberto Amadio and Pierre-Louis Curien. Domains and lambda-calculi, volume 46 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1998. [Bar84] Henk Barendregt. The Lambda Calculus, volume 103 of Studies in Logic and the Foundations of Mathematics. North Holland, 1984. [BEM07] Antonio Bucciarelli, Thomas Ehrhard, and Giulio Manzonetto. Not enough points is enough. In Proceedings of the 21st Annual Conference of the European Association for Computer Science Logic (CSL'07), Lecture Notes in Computer Science. Springer-Verlag, September 2007. [BEM09] Antonio Bucciarelli, Thomas Ehrhard, and Giulio Manzonetto. A relational model of a parallel and non-deterministic lambda-calculus. In Sergei N. Artëmov and Anil Nerode, editors, LFCS, volume 5407 of Lecture Notes in Computer Science, pages 107121. Springer, 2009. [Bie95] Gavin Bierman. What is a categorical model of intuitionistic linear logic? In Mariangiola Dezani-Ciancaglini and Gordon D. Plotkin, editors, Proceedings of the second Typed Lambda-Calculi and Applications conference, volume 902 of Lecture Notes in Computer Science, pages 7393. Springer-Verlag, 1995. [DC08] Daniel De Carvalho. Execution Time of λ-Terms via Denotational Semantics and Intersection Types. Research Report RR-6638, INRIA, 2008. [EL10] Thomas Ehrhard and Olivier Laurent. Interpreting a nitary pi-calculus in dierential interaction nets. Information and Computation, 208(6), 2010. Special Issue: 18th International Conference on Concurrency Theory (CONCUR 2007). [ER03] Thomas Ehrhard and Laurent Regnier. The dierential lambda-calculus. Theoretical Computer Science, 309(1-3):141, 2003. [ER06a] Thomas Ehrhard and Laurent Regnier. Böhm trees, Krivine machine and the Taylor expansion of ordinary lambda-terms. In Arnold Beckmann, Ulrich Berger, Benedikt Löwe, and John V. Tucker, editors, Logical Approaches to Computational Barriers, volume 3988 of Lecture Notes in Computer Science, pages 186197. Springer-Verlag, 2006. [ER06b] Thomas Ehrhard and Laurent Regnier. Dierential interaction nets. Theoretical Computer Science, 364(2):166195, 2006. [ER08] Thomas Ehrhard and Laurent Regnier. Uniformity and the Taylor expansion of ordinary lambda-terms. Theoretical Computer Science, 403(2-3):347372, 2008. [Gir88] Jean-Yves Girard. Normal functors, power series and the λ-calculus. Annals of Pure and Applied Logic, 37:129177, 1988. [Kri93] Jean-Louis Krivine. Lambda-Calculus, Types and Models. Ellis Horwood Series in Computers and Their Applications. Ellis Horwood, 1993. Translation by René Cori from French 1990 edition (Masson). [MS09] Giulio Manzonetto and Antonino Salibra. Applying universal algebra to lambda calculus. Journal of Logic and Computation, 2009. To appear. [PS98] Don Pigozzi and Antonino Salibra. Lambda Abstraction Algebras: Coordinatizing Models of Lambda Calculus. Fundamenta Informaticae, 33(2):149200, 1998.