Linear Type Theories, Semantics and Action Calculi

Andrew Graham Barber LFCS, Department of Computing Science,

Edinburgh University

Doctor of Philosophy University of Edinburgh

To my wife, for her trust

Abstract

In this thesis, we study linear type-theories and their semantics. We present a general framework for such type-theories, and prove certain decidability properties of its equality. We also present intuitionistic linear logic and Milner’s action calculi as instances of the framework, and use our results to show decidability of their respective equality judgements.

Firstly, we motivate our development by giving a split-context logic and typetheory, called dual intuitionistic linear logic (DILL), which is equivalent at the level of term equality to the familiar type-theory derived from intuitionistic linear logic (ILL). We give a semantics for the type-theory DILL, and prove soundness and completeness for it; we can then deduce these results for the type-theory ILL by virtue of our translation.

Secondly, we generalise DILL to obtain a general logic, type-theory and semantics based on an arbitrary set of operators, or general natural deduction rules. We again prove soundness and completeness results, augmented in this case by an initiality result. We introduce Milner’s action calculi, and present example instances of our framework which are isomorphic to them. We extend this isomorphism to three significant higher-order variants of the action calculi, having functional properties, and compare the induced semantics for these action calculi with those given previously.

Thirdly, motivated by these functional extensions, we define higher-order instances of our general framework, which are equipped with functional structure, proceeding as before to give logic, type-theory and semantics. We show that the logic and type-theory DILL arise as a higher-order instance of our general framework. We then define the higher-order extension of any instance of our framework, and use a Yoneda lemma argument to show that the obvious embedding from an instance into its higher-order extension is conservative. This has the corollary that the embeddings from the action calculi into the higher-order action calculi are all conservative, extending a result of Milner.

Finally, we introduce relations, a syntax derived from proof-nets, for our general framework, and use them to show that certain instances of our framework, including some higher-order instances, have decidable equality judgements. This immediately shows that the equalities of DILL, ILL, the action calculi and the higher-order action calculi are decidable.

Acknowledgements

I am hugely grateful to my supervisor, Gordon Plotkin, for his insight and ability to communicate it, his encouragement, and for his detailed comments at each stage of my thesis.

I also thank Philippa Gardner, my second supervisor, for her attention, her enthusiasm and for pointing me in the direction of many interesting problems.

Other than my supervisors, I have benefited greatly during my time at Edinburgh from the insight of many people here, particularly Masahito Hasegawa, John Power, Alex Simpson, Paul-Andre Mellies and Marcello Fiore, whom I thank, and from the good-humour of my office partner Thomas Schreiber.

Finally, I thank my wife for all her support, encouragement and proof-reading– her efforts have immeasurably improved this thesis and my time in Edinburgh.

Declaration

I declare that this thesis was composed by myself and that the work contained therein is my own, except where explicitly stated otherwise in the text.

(Andrew Graham Barber

LFCS, Department of Computing Science, Edinburgh University)

Table of Contents

Chapter 1 Introduction 4 1.1 Motivating Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3 Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 29 1.5 Historical Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Chapter 2 An Alternative Formulation of ILL 32 2.1 The Logic DILL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.2 The Type Theory DILL(ℂ) . . . . . . . . . . . . . . . . . . . . . . 35 2.3 The Type Theory ILL(ℂ) . . . . . . . . . . . . . . . . . . . . . . . 42 2.4 Relating DILL and ILL . . . . . . . . . . . . . . . . . . . . . . . . 45

Chapter 3 The Semantics of DILL 60 3.1 The Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.2 Soundness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.3 The Term Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.4 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.5 ILL and Other Models . . . . . . . . . . . . . . . . . . . . . . . . 79

Chapter 4 Linear Type Theories 81 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.2 The Generalised Logic . . . . . . . . . . . . . . . . . . . . . . . . 84 4.3 The Typing System Lin(𝕆) . . . . . . . . . . . . . . . . . . . . . . 87 4.4 The Type Theory Lin(𝕆, 𝔸) . . . . . . . . . . . . . . . . . . . . . 91

Chapter 5 The Semantics of Lin(𝕆, 𝔸) 95 5.1 The Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . 95 5.2 Soundness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 5.3 The Term Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.4 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 5.5 Initiality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.6 Output Naturality . . . . . . . . . . . . . . . . . . . . . . . . . . 114

Chapter 6 Action Calculi and Extensions 120 6.1 Action Calculi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 6.2 Generalised Linear Type Theory . . . . . . . . . . . . . . . . . . . 124 6.3 The Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 6.5 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

Chapter 7 Higher-Order Type Theories 148 7.1 Higher-Order Type Theories . . . . . . . . . . . . . . . . . . . . . 148 7.2 Higher-Order Semantics . . . . . . . . . . . . . . . . . . . . . . . 153 7.3 Conservativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 7.4 Corollaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 7.5 Action Calculi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 7.6 Linear Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Chapter 8 Normal Forms for Lin(𝕆, 𝔸) 178 8.1 Proof Nets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 8.2 Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 8.3 Relational Equality . . . . . . . . . . . . . . . . . . . . . . . . . . 196 8.4 Terms to Relations . . . . . . . . . . . . . . . . . . . . . . . . . . 199 8.5 Relations to Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 204

Chapter 9 Normal Forms and Decidability 215 9.1 Proof-Nets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 9.2 The F -Equalities . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 9.3 Deciding the Equality . . . . . . . . . . . . . . . . . . . . . . . . . 218 9.4 The Higher-Order Case . . . . . . . . . . . . . . . . . . . . . . . . 227 9.5 Corollaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

Chapter 10 Conclusions 239 10.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 10.2 Extending Lin(𝕆, 𝔸) . . . . . . . . . . . . . . . . . . . . . . . . . 241 10.3 Aims and Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 246 10.4 Final Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Appendix A Basic Definitions 250

A.1 Syntactic Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . 250 A.2 Categorical Definitions . . . . . . . . . . . . . . . . . . . . . . . . 251

Bibliography 255 Index to Notation 265 Index to Definitions 267

Chapter 1

Introduction

The central concept in this thesis is that of linearity. We can say that linearity is an attribute of systems in which unrestricted duplication of computations or information is not allowed. There are many practical situations in which this is the case—computations with side effects, where duplicating the computation also duplicates the side-effect, manipulating large data-structures, where a duplication may bear an unacceptable computational cost, or simply efficient implementations where duplicating computation is to be avoided except where necessary. Areas as diverse as optimal λ-calculus implementations, the study of process calculi and denotational semantics can all utilise linearity in this broad sense.

Although such systems have been studied for many years, a new and striking development occurred when Girard introduced linear logic [Gir87]. Unlike conventional intuitionistic and classical logics, linear logic is built on the underlying idea that assumptions should be treated linearly, which is to say that an assumption should not be used twice in a deduction. Starting from this basis, Girard built a complete classical linear logic, which, just as in the conventional case, has both minimal and intuitionistic fragments.

Since the introduction of linear logic, many researchers have used it as an underlying logic for systems which exhibit linearity in our general sense, for example in the study of optimal λ-calculus reductions [GAL92a], in the analysis of implementation issues such as garbage collection, references and others [Wad90, GH90] and to control interference in imperative languages [OTPT95]. It has become the logic of choice for such applications in much the same way as conventional logic underpins a huge range of theory in computer science. In the case of conventional logics, one large section of applications are those which are based on conventional intuitionistic logic as a typing system for a syntax of some sort. A variety of systems can be typed in this way, and the general principles underlying such typings are well understood.

In this thesis, we present a first step towards a similar unifying programme for systems with linearity. We give a general operator theory, logic, and type-theory over a linear underlying structure, and show how it can be used to present a number of typing systems exhibiting linearity. We also give a semantics for our theory, and prove some general results about it.

As an introduction, we give a motivating summary in a simple setting, provide brief tutorials and summaries of related work on the concepts we work with, and then outline the work contained in the thesis. A chapter summary can be found in section 1.4.

We assume a basic understanding of elementary intuitionistic logic, its type theory, simple category theory, and the various relationships of a familiar triangle, particularly including the Curry-Howard correspondence between logic and typetheory:

Logic

[GLT89]  [Lam89, Sol90]
[figure: Type Theory; [LS86]; Category Theory [Mac71]]

1.1 Motivating Sketch

Consider the typed λ-calculus. Although it forms the basis of many developments in computer science, from functional programming languages to foundational semantics, it is very frequently augmented with additional constructs, for example those for pairing, sums, or other data types, or that for recursion. In the case of each such extension the definition of terms must be extended, and new typing rules given, and as a result of these extensions, many simple definitions and results must be at least rechecked. Such a procedure not only repeats work, but also guarantees that many slightly differing presentations of each alternative calculus exist, each with its own development. We might try to avoid this by using a general theory of operators, due to Aczel [Acz80, Acz78].

Minimal Intuitionistic Logic

We start by considering minimal intuitionistic logic over a given set of formulae or proposition letters (ranged over by A, B …) and given by the abstract grammar:

A ::= p ∈ P | A → A

with the rules:

\begin{aligned}& Γ, A ⊢ A & (Ax) \\ {Γ, A ⊢ B \atop Γ ⊢ A → B} (Abs) & & & \begin{matrix}Γ ⊢ A → B & Γ ⊢ A \\ Γ ⊢ B \end{matrix} (App) \end{aligned}

where the turnstile ⊢ is a relation holding between sets of formulae (denoted Γ, Δ …) and formulae. We call the axiom rule, along with the (admissible) cut and weakening rules:

\begin{matrix}Γ ⊢ A & Γ, A ⊢ B \\ Γ ⊢ B \end{matrix} (Cut) {Γ ⊢ B \atop Γ, A ⊢ B} (W eak)

the structural rules of the logic. Note that the rules for the arrow connective occur as an introduction-elimination pair (or I/E-pair); the abstraction introduces the → and the application rule eliminates it. Such I/E-pairs are characteristic of natural deduction.

Now there are many possible ways to strengthen this logic, by adding new connectives and rules for those connectives. Let us try to give a general schema for such natural deduction rules. As a first attempt, we might say that an arbitrary rule, given a number of deductions Γ ⊢ A_{i} for i = 1 … r, gives us a deduction Γ ⊢ B for some new conclusion B:

\begin{aligned}Γ ⊢ A_{1} & … & Γ ⊢ A_{r} \\ & Γ ⊢ B \end{aligned}

This is a reasonable attempt, as all but one of the rules of minimal intuitionistic logic are instances of this schema, as are the rules for pairing amongst others. However, the abstraction rule is not; this is because an assumption is discharged in this rule. Given a deduction Γ, A ⊢ B, we end up with a deduction in which A is no longer an assumption. Hence we could refine our schema; given a number of deductions Γ, Δ_{i} ⊢ A_{i} for i = 1 … r, we have a deduction Γ ⊢ B in which all the assumptions Δ_{i} for each i = 1 … r have been discharged. This gives a general rule:

\begin{aligned}Γ, Δ_{1} ⊢ A_{1} & … & Γ, Δ_{r} ⊢ A_{r} \\ & Γ ⊢ B \end{aligned}

Now all the rules of minimal intuitionistic logic and many others arise as instances of this schema.

It is important to note, however, that some do not, because of implicit or explicit side-conditions. One common situation in which a side-condition is imposed is when a modality is used; for example in the presence of a unary connective □, we might have an introduction rule:

{Γ ⊢ A \atop Γ ⊢ □A}

only where each formula in Γ has the form □B for some B.

Another (apparent!) possible behaviour which is not captured by our rule schema is that where an assumption is introduced in a deduction, as for example in an alternative formulation of the →-elimination rule:

{Γ ⊢ A → B \atop Γ, A ⊢ B}

Although rules of this form are not instances of our rule schema, in the presence of the structural rules we can show that they are interderivable with the instances of our rule schema. In the case of this alternative rule for →, the appropriate instance is exactly the normal →-elimination rule.

Given our general description of a natural deduction rule, we can see that any particular instance is characterised by the number r, the sets of formulae Δ_{i} which are discharged, the conclusions A_{i} and the final conclusion B′. We might then write all this information as the arity of the rule:

\begin{aligned}(A⃗_{1})B_{1} & … & (A⃗_{r})B_{r} \\ & B′ \end{aligned}

where the set of elements in the sequence A⃗_{i} is Δ_{i} for each i = 1 … r. As an example, consider the sequent-style presentation of the natural deduction rule for choice:

\begin{aligned}Γ ⊢ A ∨ B & Γ, A ⊢ C & Γ, B ⊢ C \\ & Γ ⊢ C \end{aligned} (∨E)

where formulae A and B are discharged from the assumptions. This would then have the arity:

\begin{aligned}()A ∨ B & (A)C & (B)C \\ & C \end{aligned}

We can characterise any extension of minimal intuitionistic logic with rules of this general form by giving just the basic formulae, and the arities of the rules. Together, we call these two bits of information a signature for the logic. In fact, as we shall see, the most important feature of minimal intuitionistic logic is not the rules for the connective →, but rather the admissible structural rules. Given these structural rules, we can express the underlying behaviour of any connective such as → in the arity of its rules.

Using the definition of proofs in a logic with general rules, we can also define a sensible notion of equivalence between proofs based on eliminating certain redundant proof sequences. For example, in minimal logic, any proof which ends:

\begin{aligned}Γ ⊢ A & {Γ, A ⊢ B \atop Γ ⊢ A → B} \\ & Γ ⊢ B \end{aligned}

should be equivalent to the proof obtained from the admissible cut rule applied to the deductions Γ ⊢ A and Γ, A ⊢ B. We could extend such a notion of proofequivalence to the extensions of minimal logic with instances of our rule schema by allowing arbitrary equivalences over proofs of the extended logic. However, this is more easily done in the framework of the type-theory we will present in the next subsection.

The Typed λ-calculus

We now recall that via the Curry-Howard correspondence, proofs of minimal logic can be represented by the typed λ-calculus, using the annotations:

\begin{aligned}& Γ, x:A ⊢ x:A & (Ax) \\ {Γ, x:A ⊢ t:B \atop Γ ⊢ λx:A.t:A → B} (Abs) & & & \begin{matrix}Γ ⊢ t:A → B & Γ ⊢ u:A \\ Γ ⊢ tu:B \end{matrix} (App) \end{aligned}

Moreover, in the example of the previous subsection, the (∨ − E) rule is often annotated with a cases_{A,B,C}-construct

Γ ⊢ t:A ∨ B Γ, x:A ⊢ u:C Γ, y:B ⊢ v:B
Γ ⊢ cases_{A,B,C} t of x in u or y in v:C

which acts as a choice operator. In general, we can give an annotation for an instance of our rule schema having arity

\begin{aligned}(A⃗_{1})B_{1} & … & (A⃗_{r})B_{r} \\ & B′ \end{aligned}

in an extension of the typed λ-calculus by adding a term construct O((x⃗)t, …, (x⃗)t) with the introduction rule

\begin{matrix}Γ, x⃗_{1}:A⃗_{1} ⊢ t_{1}:B_{1} & … Γ, x⃗_{r}:A⃗_{r} ⊢ t_{r}:B_{r} \\ Γ ⊢ O((x⃗_{1})t_{1}, …, (x⃗_{r})t_{r}):B′ \end{matrix}

In this way we can build a typed λ-calculus over a signature of formulae and rules with associated arities. Many common extensions of typed λ-calculus arise as instances of this, including pairing constructs, choice constructs and recursion operators.

Having defined a typing system based on the logic having as rules arbitrary instances of our rule schema, we can give a notion of equality judgement over such a typing system. An equality judgement takes the form Γ ⊢ t = u:A for terms Γ ⊢ t:A and Γ ⊢ u:A, and asserts that the proofs denoted by the terms t and u are equivalent. Equality judgements are commonly built inductively as congruences over axiomatic equalities which arise from proof equivalences. These often take one of the general forms:

⋮ . ; I ; E ≡ ⋮ ⋮ . ; E ; I ≡ ⋮

where the I and E denote the introduction and elimination rules for a particular connective. We shall call these respectively the β- and η-equivalences for a given connective. They give rise respectively to β- and η-equalities on the proof terms.

In minimal logic, the β- and η-equivalences for the → connective are:

\begin{matrix}{Γ, x:A ⊢ t:B \atop Γ ⊢ λx:A.t:A → B} (→ I) & Γ ⊢ u:A \\ Γ ⊢ (λx:A.t)u:B \end{matrix} (→ E) \begin{matrix}\begin{matrix}Γ, x:A ⊢ t:B & Γ, x:A ⊢ x:A \\ Γ, x:A ⊢ tx:B \end{matrix} & (→ E) \\ Γ ⊢ λx:A.(tx):A → B \end{matrix} ; (→ I)
|||  |||
\begin{matrix}Γ, x:A ⊢ t:B & Γ ⊢ u:A \\ Γ ⊢ t\{u/x\}:B \end{matrix} (Cut)  Γ ⊢ t:A → B

under the condition on the second of these that x does not occur free in t (and where t{u/x} stands for the substitution of u for x in t).

The equivalences then yield the familiar βη-equalities of the → type:

(β) Γ ⊢ (λx:A.t)u = t{u/x}:B (η) Γ ⊢ λx:A.(tx) = t:A → B (x not free in t)

We can extend the equality judgement in the case of logics built on general instances of our rule schema by allowing arbitrary axiomatic equality judgements over terms of the general term calculus over the logics.

Cartesian Closed Categories

We turn to the question of semantics. It is well-known that minimal intuitionistic logic has models which are cartesian closed categories. In these, a proof Γ ⊢ A is modelled as a morphism [[Γ]] → [[A]], with a suitable interpretation of the basic types. We can see that any rule of the logic takes a certain number of morphisms from the appropriate hom-sets, and returns another. Being more precise, given a rule having arity

\begin{aligned}(A⃗_{1})B_{1} & … & (A⃗_{r})B_{r} \\ & B′ \end{aligned}

to interpret it in a c.c.c. C we would require for each possible context Γ a function

α_{Γ} : ∏_{i=1...r} C([[Γ]] × [[A⃗_{i}]], [[B_{i}]]) → C([[Γ]], [[B′]])

This is sufficient to give a sound interpretation of the operator theory we have described. However, when we extend this interpretation to the type theory, a complication arises. Consider the choice operator cases_{A,B,C} we have already introduced:

Γ ⊢ cases_{A,B,C} t of x in u or y in v:C

If Γ contains just the typing x′: A′, and we have a proof ⊢ t′: A′, we would expect the typing

⊢ (cases_{A,B,C} t of x in u or y in v){t′/x′}:C

to be modelled by the composition

[[ ⊢ t′:A′]]; α_{x′:A′}([[x′:A′ ⊢ t:A ∨ B]], [[x′:A′, x:A ⊢ u:C]], [[x′:A′, y:B ⊢ v:C]])

where α_{x′:A′} is the function interpreting the choice construct. However, the term (cases_{A,B,C} t of x in u or y in v){t′/x′} is precisely

cases_{A,B,C} (t{t′/x′}) of x in (u{t′/x′}) or y in (v{t′/x′})

and so we would expect this term to be interpreted as

α (f; [[x′:A′ ⊢ t:A ∨ B]], f; [[x′:A′, x:A ⊢ u:C]], f; [[x′:A′, y:B ⊢ v:C]])

where f = [[ ⊢ t′:A′]]. Clearly, though, we would wish these two interpretations to be equal. This is achieved by imposing the condition that α_{A′} be the instance at [[A′]] of a natural transformation

C( , [[A ∨ B]]) × C( × [[A]], [[C]]) × C( × [[B]], [[C]]) → C( , [[C]])

Further, we can then model an equality judgement over general axiomatic equalities as a c.c.c. such that the interpretation of the terms is sound with respect to the axiomatic equalities.

We might summarise the situation presented here in a familiar form as follows:

Minimal Logic with arbitrary rules

Type Theory with binding operators

[figure]

Cartesian Closed Category with natural transformations

[figure]

1.2 Background

We aim to extend the account of the previous section by starting with a linear logic, λ-calculus and semantics. First, however, we need to recall some background material in a number of different areas touched on in the previous section.

Linear Logic

Linear logic was introduced by Girard in 1987 [Gir87], and is a resource logic in which contraction and weakening are allowed only on certain formulae, those labelled with the connective !.

Consider what we might call minimal intuitionistic linear logic, which is the simple logic with formulae

A ::= p ∈ P | A ⊸ A

and rules

\begin{aligned}& A ⊢ A & (Ax) \\ {Γ, A ⊢ B \atop Γ ⊢ A ⊸ B} (Abs) & & & \begin{matrix}Γ ⊢ A & Δ ⊢ A ⊸ B \\ Γ, Δ ⊢ B \end{matrix} (App) \end{aligned}

where the turnstile ⊢ is now a relation holding between multisets of formulae and formulae. We call the axiom rule, together with the admissible cut rule

\begin{matrix}Γ ⊢ A & Δ, A ⊢ B \\ Γ, Δ ⊢ B \end{matrix} (Cut)

the structural rules of this logic. Note that weakening is no longer admissible.

In fact, there are two obvious differences between this minimal intuitionistic linear logic and our presentation of minimal intuitionistic logic in the previous section. The first of these occurs in the (Ax) rules; in the linear logic, we are only allowed to assume the one formula which is deduced, whereas in minimal logic we can also make any number of other assumptions. The second is more pervasive, but is seen particularly in comparing the rules for application in the two logics. In the linear logic, each proof uses a separate multiset of assumptions and the multiset union of these proves the conclusion. Hence we are able to measure the number of uses of an assumption in a derivation by the number of times it appears in the multiset of assumptions. On the other hand, in minimal logic the same assumptions are used to prove both premises and the conclusion, and therefore we have no information about how the assumptions are used, if at all. However, this new way of handling contexts also has more wide-ranging effects. One could present minimal logic equivalently with the elimination rule for the arrow given in the linear logic. Hence the differences between these two logic are all implicit in those between the structural rules. The importance of such rules in logics has been studied: for a general overview, see [Avr94], and in the particular case of those considered here, see [Lam89, Lam90a, Sza75].

We now add to this minimal linear logic rules for the exponential, as presented for example in [Abr93]. Now the formulae are given by:

A ::= p ∈ P | A ⊸ A | !A

where given a multiset of formulae Γ = {A_{1}, …, A_{r}}, we write !Γ as shorthand for the multiset of formulae {!A_{1}, …,!A_{r}}, and the rules are augmented with the promotion, dereliction, copy and discard rules:

{!Γ ⊢ A \atop !Γ ⊢!A} (P rom)  {Γ ⊢!A \atop Γ ⊢ A} (Der)
\begin{aligned}Γ ⊢!A & Δ,!A,!A ⊢ B \\ & Γ, Δ ⊢ B \end{aligned} (Copy)  \begin{matrix}Γ ⊢!A & Δ ⊢ B \\ Γ, Δ ⊢ B \end{matrix} (Disc)

Of these, the copy and discard rules allow us to duplicate or discard assumptions of the form !A for some A. Although these rules complicate the situation, the promotion and dereliction rules can be seen as an I/E-pair for the !-connective. Altogether, these connectives and rules allow us to encode minimal logic into intuitionistic linear logic using the translation given by (A → B) ↦ (!A ⊸ B).

Other connectives in the intuitionistic fragment of linear logic are the binary tensor, ⊗, the nullary unit, I (which acts as a unit for the tensor), the binary product, & (sometimes written ×) and the binary coproduct, ⊕. In this thesis, we will focus on the multiplicative fragment of intuitionistic linear logic, which has all these connectives except the product and coproduct (the additive connectives). Extending techniques used in the study of the multiplicative fragment to treat the additives is known to be non-trivial, and this is also the case for our work.

Although we will work exclusively with intuitionistic linear logic, we briefly present the corresponding classical linear logic, which has sequents Γ ⊢ Δ, and two important new connectives, linear negation ( )^{⊥} (originally presented as a defined connective except on the atomic propositions) and the ‘par’ connective, written & . This has the introduction (or right) rule

{Γ ⊢ A, B, Δ \atop Γ ⊢ A & B, Δ}

It turns out that &is the de Morgan dual of ⊗, and that in this logic A ⊸ B can be defined A^{⊥} & B.

This logic is of more than passing interest to us because of its position as a predecessor of the system LU [Gir93] introduced by Girard in 1993. LU has a number of interesting features, but the most relevant to our study is its use of a split context. In LU, a general sequent has the form Γ; Δ ⊢ Δ′; Γ′, where the positions occupied by the Γ, Γ′ are known as intuitionistic zones and those occupied by the Δ, Δ′ are linear zones. Hence the above sequent should be read (roughly): “using formulae Γ intuitionistically and formulae Δ linearly, we can prove formulae Δ′ linearly or formulae Γ′ intuitionistically”. Although LU is essentially a classical logic, it contains as subsystems minimal logic, classical logic, intuitionistic linear logic and classical linear logic, and we will take advantage in particular of the fact that it contains intuitionistic linear logic as a subsystem to present an alternative formulation of that logic. We will sketch this later in this introduction, but for now it is interesting to note that the structural rules of LU include (amongst others) admissible weakening in both intuitionistic zones, and two flavours of cut:

Γ; ⊢ A; Γ′ Γ, A; Δ ⊢ Δ′, Γ′ Γ; Δ ⊢ Δ′; Γ′ (I-Cut) Γ; Δ_{2} ⊢ Δ′_{2}, A; Γ′ Γ; Δ_{1}, A ⊢ Δ′_{1}; Γ′ Γ; Δ_{1}, Δ_{2} ⊢ Δ′_{1}, Δ′_{2}; Γ′ (L-Cut)

The presence of zones adds complexity to the structural rules, and this complexity will be crucial in capturing the interaction between linear and intuitionistic types and computations.

Linear Term Calculi

The first stage in assigning terms to proofs in a natural deduction formulation of intuitionistic linear logic is to consider the minimal intuitionistic linear logic defined above. Just as the minimal intuitionistic logic can be annotated with the typed λ-calculus, the minimal intuitionistic linear logic can be annotated with a linear typed λ-calculus, and this was done by a number of people, mostly along the lines of [Abr93]. Most of these systems also went on to annotate the I/E-pair for the tensor connective in what has since become the standard way:

\begin{matrix}Δ_{1} ⊢ t:A & Δ_{2} ⊢ u:B \\ Δ_{1}, Δ_{2} ⊢ t ⊗ u:A ⊗ B \end{matrix} (⊗I)  Δ_{1} ⊢ t:A ⊗ B Δ_{2}, x:A, y:B ⊢ u:C Δ_{1}, Δ_{2} ⊢ let x ⊗ y:A ⊗ B be t in u:C (⊗E)

From now on we may omit type annotations in terms, where they can be reconstructed from derivations. It should be noted that in some accounts, which include those of Abramsky [Abr93] and Wadler [Wad93] the syntax let t be x ⊗ y in v and slight variants of it were used instead of that given here. The term construct t⊗v is self-explanatory, and the term construct let x ⊗ y be t in u is a pattern-matching constructor which can be thought of as decoding its argument t into two parts which are then substituted for the bound variables x and y in its argument u.

As in minimal logic, we can give an equality judgement which is a congruence over axiomatic equalities corresponding to proof-equivalences. The β- and ηequivalences for the ⊗ connective are easily given, and they generate β- and η-axiomatic equality judgements as follows:

(β) Γ ⊢ let x ⊗ y be t ⊗ u in v = v{t, u/x, y}:C
(η) Γ ⊢ let x ⊗ y be t in x ⊗ y = t:A ⊗ B

Unlike minimal logic, however, when we consider the whole equality judgement on terms corresponding to proof equivalence and normalisation, the term calculus as presented so far already has one particular drawback which is inherent in much work on linear logic. Whereas in the type-theory arising from minimal logic with no additional rules, the equality judgement is simply based on the familiar βηequality of the typed λ-calculus, in the case of linear logic equalities arise which are not β- or η-equalities, the so-called “commuting conversions”. For example, consider the following proofs:

\begin{matrix}\begin{matrix}Γ_{1}, A ⊢ B ⊗ B′ & Γ_{2}, B, B′, A ⊢ C \\ Γ_{1}, Γ_{2}, A ⊢ C \end{matrix} & (⊗E) \\ Γ_{1}, Γ_{2} ⊢ A ⊸ C \end{matrix} ; (⊸ I) \begin{matrix}Γ_{1} ⊢ B ⊗ B′ & {Γ_{2}, B, B′, A ⊢ C \atop Γ_{2}, B, B′ ⊢ A ⊸ C} (⊸ I) \\ Γ_{1}, Γ_{2} ⊢ A ⊸ C \end{matrix} ; (⊗E)

where the proof Γ_{1}, A ⊢ B ⊗ B′ is obtained from the proof Γ_{1} ⊢ B ⊗ B′ by weakening. The difference between these two proofs arises because we have used the two essentially independent rules in two different orders. However, semantically and intuitively, it is sensible to ask that they be equivalent. This gives us the axiomatic equality:

Γ ⊢ λx.let y ⊗ y′ be t in u = let y ⊗ y′ be t in λx.u:A ⊸ C

which holds under appropriate free and bound variable conditions. There are a variety of such proof equivalences and corresponding axiomatic equalities. Categorically, these equalities are soundly modelled by virtue of the interaction of the ⊗-functor with composition.

Another way of thinking of them is to recall the intuitive reading given above of the let -⊗ constructor as a pattern matching substitution. Then it should have the usual properties of substitution, for example commuting with other substitutions and term structure, under suitable free variable conditions. A similar situation arises in a more familiar setting; if we consider the terms:

Γ ⊢ cases_{A,A′,B→C} t of x in (λy.u) or x′ in (λy.v):B → C

and

Γ ⊢ λy.(cases_{A,A′,C} t of x in u or x′ in v):B → C

it seems very plausible that they be equal, since the functions they describe are intuitively the same. However, such an equality is not derivable from the βηequalities of the construct, and hence must be added as an axiomatic equality.

Given term annotations for this system, the most difficult problem remaining is the annotation of the intuitionistic rules for the connective !. A first attempt, by Abramsky [Abr93], simply annotated the key promotion rule:

{Γ ⊢ t:A \atop Γ ⊢!t :!A} (P rom)

where Γ is a sequence of typings x_{1} :!A_{1} … x_{r} :!A_{r}. However, Wadler [Wad92] and Mitchell and Lincoln [LM92] noticed that there was a technical problem with this presentation, because of the failure of a linear substitution lemma (given a typing judgement Δ ⊢ t:A and one Δ′, x:A ⊢ u:B, there should be a typing judgement Δ, Δ′ ⊢ u{t/x}:B). This is connected to the fact that the !-connective does not have a “real” natural deduction presentation, since it has four rules rather than an I/E-pair.

In order to avoid the problem, Benton, Bierman, dePaiva and Hyland gave a syntax [BBdPH93b, BBdPH93a] which changed the form of each rule except (Der) by adding an element of substitution for each of the fresh assumptions (each of !Δ in the case of P rom). This gave the rule

Promotion

Δ_{i} ⊢ M_{i} :!A_{i} (i = 1..r) x_{1} :!A_{1}, …, x_{r} :!A_{r} ⊢ N:B
Δ′′ ⊢ promote M⃗ for x⃗ in N :!B

Benton proved strong normalisation for the β − cc fragment of the equality of this system [Ben95b]. We present this system in full in chapter 2. However, this system is complex, notably in its equality judgement. Since the !-connective does not have an I/E-pair in the logic, it is not immediately clear what its axiomatic equalities should be, and in fact there are a large number of axiomatic equalities involving the term constructs associated with it.

Considering classical logics, although Abramsky [Abr93] gave an annotation for classical linear logic, it had been thought that term calculi were not the most appropriate presentation of the proofs of classical linear logic, partly because of the huge number of proof equivalences induced by the possibility of selecting more than one formula on the right of the turnstile as the primary formula of a rule. Hyland and dePaiva [HdP93] gave a system of term assignment for a linear logic with multiple conclusions, having the par constructor, which also exhibited these characteristic equivalences.

A more significant development occurred when Parigot presented a system of term assignment for classical logic [Par92, Par93] which has since been adapted by Bierman [Bie96b, Bie96a] to give a linear form. The main feature of Parigot’s system and its linear derivatives is that there is an identified formula on the right which is always the active formula in introduction rules, and there are explicit structural rules allowing the exchange of this identified formula with another formula on the right, thereby recapturing the power of classical logic.

As yet there have been no attempts to give a syntax for the proofs of the unified logic LU. However, a preliminary linear version of the logical framework [HHP93] based on a natural deduction presentation of its intuitionistic fragment was given in [MPP92], based on a logic having sequents of the form Γ; Δ ⊢ A. This presentation independently inspired the annotations of [Plo93b] and [Wad93], and the linear logical frameworks of Pfenning and Cervesato [CP96, Pfe94] and Ishtiaq and Pym [IP]. We will sketch the annotation of [Plo93b] in the next section, and present a full development in chapters 2 and 3 of this thesis. This work was done in the academic year 1994-1995, published initially in [Bar96].

Meanwhile, Benton has given [Ben95a, Ben94] a type-theory in this style for a general categorical model which encompasses the monoidal adjunction models of intuitionistic linear logic, and Benton and Wadler [BW96] have used this typetheory to relate the computational λ-calculus, due to Moggi [Mog91], to linear logic.

Systems with split contexts have also proved popular in the logic programming community. A system similar to those mentioned above was presented by Miller [Mil94a, HM94] again building on the work of Miller, Plotkin and Pym [MPP92], and another by Harland and Pym [PH94, HPW96].

Proof nets

Although term calculi are a popular syntax for the proofs of many kinds of logics, mostly intuitionistic, Girard’s original presentation of linear logic [Gir87] employed an alternative graphical syntax, that of proof nets. These are essentially graphs in which edges, labelled with formulae, represent assumptions and conclusions occuring in a derivation, and nodes, labelled with rule names, represent the application of the various rules. The main advantage of this approach is that rules are not applied globally, as a term construct is applied to a whole term, but only apply to the edges labelled with the formulae involved in the rule application.

In the intuitionistic case, therefore, proof nets have the distinct advantage over term-calculi that two proofs which differ by a proof equivalence which would induce a commuting conversion on terms are assigned the same proof net. Further, since the βη-equalities which hold between proofs are essentially local in the proofnet representation, we can decide them using a local rewrite system.

Figure 1.1: A Proof Net

To see how proof nets work, let us consider the translation from a term calculus for a split-context linear logic to proof nets for that logic, due to the author. We represent the proof net corresponding to a deduction Γ; Δ ⊢ A as in figure 1.1, where a wire with a stroke through it represents a number of wires, the dashed wires labelled with Γ represent the intuitionistic assumptions and the plain wires labelled with Δ represent the linear assumptions.

We can see how proof nets avoid commuting conversions by considering the translation of terms into proof nets via a translation Φ. Consider the action of Φ on the tensor introduction term Γ; Δ ⊢ t ⊗ u:A ⊗ B, which can be seen in figure 1.2. In this proof net, we can see that the edges representing the conclusions of the two subterms t and u are connected to a node for the rule instance ⊗I, and a new trailing edge representing the conclusion of the whole term is added.

Figure 1.2: Tensor Introduction

Also, notice the treatment of the intuitionistic assumptions. Since both subterms are typed using the same set of intuitionistic assumptions Γ, we need to duplicate each assumption in Γ to provide one copy for each sub-proof. This behaviour will be repeated for the translation of any rule with two premises.

Now consider the tensor elimination rule. The derivation

Γ; Δ ⊢ let x ⊗ y be t in u:C

is mapped by Φ to the proof net in figure 1.3. Again, we copy the intuitionistic

Figure 1.3: Tensor Elimination

assumptions, once for each sub-net, but in this case, the new node which is added to represent the ⊗E rule is only connected to the edges labelled by x: A, y: B and A⊗B. Hence, the trailing edge representing the conclusion of the term is the same trailing edge representing the conclusion of the sub-term u. This property of the proof-net representation of the ⊗E rule accounts for the fact that terms equal via commuting conversions due to ⊗E are mapped to equal proof nets, as the reader may verify by drawing some sample proof nets. At this point it is worth noting that although proof nets do remove the proof-equivalences due to commuting conversions, those which arise in connection with the linear analogue of ∨ and its corresponding cases constructor do not map to equalities in the same way. The proper treatment of the additives is an ongoing research area.

Figure 1.4: Tensor β-η-rewrites

Now, we can give rewrites capturing the βη-equality for the ⊗-construct as seen in figure 1.4. These should be read as saying that any proof net containing the redex as a subnet rewrites to the proof net having that redex replaced by the reduct. It is obvious just from the form of this presentation that these are local. It is worth noting that the η-rewrite is given the form of an expansion, rather than the more familiar contraction. This is technically in order to make the rewrite confluent, but is also motivated by work of Ghani [Gha95].

Since their introduction, proof-net systems have been given for most, if not all, linear logics, for example [GAL92b, Gir96]. Beyond these, graphical forms based on proof nets have been used in a number of areas. For example, the nets of [CS97, BCS95], used in categorical coherence reasoning, are very close neighbours of proof nets for intuitionistic linear logic, for example as given in [DR89]. More generally, Lafont has defined interaction nets [Laf90, Laf95], which are a general graphical syntax based on proof nets extended with arbitrary node types. This development is similar to our addition of general rules to minimal logic, and allows interaction nets to apply to a wide range of computational situations.

Possibly the most far-reaching impact of proof nets has been on the optimal λ-reduction problem [Lév80, Wad71] in the untyped λ-calculus. In defining an efficient evaluation strategy for λ-terms, it quickly becomes obvious that, for example, in a term such as (λx.xx)((λx.y)z) we should first reduce the application ((λx.y)z), since this will otherwise be reduced twice, one in each copy replacing an x in xx. The optimal λ-reduction problem is to efficiently mechanise the strategy for deciding which rewrite is appropriate at each stage. There is no simple solution, but Lamping [Lam90b] gave a graphical method based upon a system of λ-graphs with added connectives. Gonthier, Abadi and Lévy [GAL92a] then showed that this extra structure corresponded in the typed case to that of proof nets for intuitionistic linear logic, and that the required reduction strategy could be explained systematically under this interpretation. Mackie [Mac94] also investigated implementation issues for λ-calculus using graphical frameworks.

Action Calculi

Action calculi were first presented by Milner in [Mil93c]; the definitive reference is [Mil96]. They can be understood as a structural framework equipped with general operator rules determined by arities similar to those of binding operators. Originally designed to allow a uniform presentation of various process calculi in order to compare them, action calculi are powerful enough to represent a wide range of interesting systems. A particular action calculus is determined by a signature, which in Milner’s presentation [Mil96] consists of a set of prime arities, similar to basic types in a term calculus, and a set of operators having arities built over those prime arities, called controls. Given a signature, actions, similar to terms, are constructed, themselves having arities which are analogous to the types assigned to terms in a type-theory. However, in contrast to the situation in a type theory, actions are constructed combinatorially from the internal language of a symmetric monoidal category with certain other constructors (in something of the sense of Curien’s categorical combinators [Cur86, Cur85]). In this framework, variables, which are called names, are reserved for a purpose analogous to that of variables in the intuitionistic term calculus, with the linearity springing directly from the categorical language. In fact, Gardner [Gar95] has shown that each action calculus is equivalent to a closed action calculus which does not have free names.

A significant amount of theory supports action calculi. They are equipped with normal forms, called molecular forms. These, interestingly, can be given in a graphical form, as action graphs, which are related to proof nets. They have a semantics, which has been steadily refined since Milner’s original paper introduced action structures [Mil93c]. Control structures [MMP95], which are categories with naming structure, were followed by a fibrational equivalent not requiring naming structure, due to Hermida and Power [HP95]. This was proved equivalent by Power [Pow96] to an alternative formulation, which is closely related to the structural fragment of models of linear logic. Minor variants of these models were used in the work of Gardner et al. [HG, BGHP97].

A higher-order extension of the action calculus was given by Milner in [Mil94b, Mil93a], and a reflexive extension in [Mil94c], providing a facility for recursion. Normal (molecular) forms [Mil93b] exist for these extensions, although not for their combination. Hasegawa and Gardner have related the higher-order extension of action calculi to Moggi’s computational λ-calculus [HG].

Categorical Semantics

We now introduce and motivate the semantics we will use to model linear logic. The models we will consider are based on linear-non-linear models. These are pairs of categories (C, S) such that C is a cartesian closed category (CCC, or CC category) and S is a symmetric monoidal closed category (SMCC, or SMC category) and there is a monoidal adjunction between them:

C [figure: F; ⊥; \underline{G}] S

The intention behind the construction is that the normal power of intuitionistic logic, arising from the exponential, should be modelled in the CCC, with the intuitionistic linear logic being as usual modelled in the SMCC. This idea emerged in 1993 from discussions between a number of people, including Plotkin, Benton and Hyland. However, it was only during further work by Benton [Ben95a] and Bierman [Bie95] that the details became clear, and in particular that it was necessary to impose the requirement that the adjunction be monoidal. In [Ben94] there is an extensive comparison between these models and the previously proposed models [BBdPH93b]. In fact, although Benton required that the cartesian category be closed, this is not essential for our purposes, and we take the more general definition.

Let us consider the intuition behind this in a little more detail. Imagine that the category C is a category of total functions, and that the category S is a category of ‘computations’, or processes—we are deliberately being vague about the precise nature of this, but we certainly mean to allow the possibility of nontermination or non-functional behaviour of other kinds. Note that the category of total functions must be cartesian: there can only be one function from any type to the unit type, that which returns the unique element of the unit type; and, further, the function f; ⟨g, h⟩, which evaluates f and uses the result in g and h respectively, must be the same as the function ⟨f; g, f; h⟩ which evaluates f twice in evaluating the functions f; g and f; h.

By contrast, the category of computations cannot be cartesian, at least because there are potentially many computations returning no result. These might include nonterminating computations, processes which interact with the user, or ones which have other side-effects. Also, it is not the case that doing a computation once and using the result as the input to two other computations is the same as doing the first computation twice, once for each computation. This equality will fail, for example, if the first computation has any side effects.

Now consider the action of the functors in our intuitive model. The functor F takes functions to computations, intuitively saying that all functions can be computed, or that functions are a subset of processes. This is a natural requirement on any notion of computation. The existence of the functor G then corresponds to a kind of completeness; it says that for each computation or process, there must be a function simulating it on a suitable representation of its input. The adjunction F ⊣ G specifies that there must exist natural transformations F G ⇒ Id and Id ⇒ GF. The first of these then implies that we can reconstruct a computation from the function representing it, and the second that from a function we can construct a function representing its computation.

Not all candidate notions of total function and computation satisfy the above intuitive representability and completeness conditions. Partly for this reason, we will later be considering an important fragment of this model, which we might call the structural fragment. This consists of a cartesian category C, a (not necessarily closed) symmetric monoidal category S and a strong monoidal functor F : C → S (which may not have an adjoint):

C  \overline{F ^{}}S

Now in order for notions of total function and computation intuitively to provide a model of this fragment, we require only that functions yield computations, or equivalently can be computed by processes.

The basic components of this model are all very familiar to category theorists, and substantially predated the introduction of linear logic; for example, the definitions of symmetric monoidal category (also tensor category), cartesian closed category and monoidal adjunction can all be found in [Mac71]. One major area of research in category theory is the study of coherence problems for various types of categories. In particular, coherence in monoidal categories has been the subject of much study, for example in [KM72, KL80, Mac71, Sol90].

The coherence problem for a class of categories is the problem of deciding which diagrams (made up from elementary natural transformations present in each instance of the class) commute in every category in the class. One classical result due to MacLane [Mac71, Mac63] is that in (symmetric) monoidal categories, every such diagram commutes. However, the situation is not uniformly this simple; in the case of symmetric monoidal closed categories, we do not have that every diagram made out of the elementary natural transformations commutes [KM72]. For these, there is a famous counter-example which we will present in chapter 8. The theories of monoidal categories and cartesian categories have further been clarified by work on general classes of categorical structure by Kelly, Power and Robinson [BKP89, PR94].

One interesting approach to such problems uses syntactic methods. Considering the case of cartesian closed categories, we know that a category built from the terms of typed λ-calculus (the term category) is complete for the class of cartesian closed categories, which is to say that any equality between elementary natural transformations holds in every cartesian closed category if and only if it holds in the term category. Since the equality of arrows in the term category is based on the equality judgement of the typed λ-calculus, to decide this is to solve the coherence problem for cartesian closed categories. More generally, to decide the equality on any accurate representation of the proofs of minimal logic is to solve this coherence problem. Along these lines, in [MRA93], Mackie, Román and Abramsky used a type theory for multiplicative linear logic to approach the problem of coherence for symmetric monoidal closed categories. Another natural question is whether proof nets help in the solution of coherence problems, as they are an efficient representation of proofs, and indeed, Seely et al. [CS97, BCST96] have adapted proof-net technology for the ⊗ − & -fragment of classical linear logic to this end.

Since the advent of linear logic, its models have been of major interest. Barr [Bar91] initially gave a semantics for the ⊗ − ⊥ fragment of classical linear logic in his ∗-autonomous categories, which have a symmetric monoidal structure with a dualising object [Bar79] (again substantially predating linear logic itself). Then Seely [See89] and the group at Cambridge [Bie95, Ben95a, BBdPH93a] developed the underlying ideas for different fragments of the full logic.

For the purposes of this thesis, we are particularly interested in the work of Day [Day70b, Day73, Day70a] on the Yoneda embedding of a category C into its presheaf category Set^{C^{op}}. He showed that given a symmetric monoidal category, the presheaf category is symmetric monoidal closed, and the Yoneda embedding functor is symmetric monoidal. The analogous result holds for cartesian categories. We will use these results to generate a model of multiplicative intuitionistic linear logic from one of the structural fragment, so obtaining conservative extension results.

1.3 Development

Having motivated our approach, and surveyed the relevant background material, we now give an overview of the original work in this thesis.

We start by presenting, in chapter 2, the reformulation of intuitionistic linear logic based on LU which was mentioned in the previous section. Known consequently as DILL, dual intuitionistic linear logic has sequents of the general form Γ; Δ ⊢ A, where Γ is a set of intuitionistic assumptions, and Δ is a multiset of linear assumptions.

The basic axioms are:

Γ, A; ⊢ A (I-Ax)  Γ; A ⊢ A (L-Ax)

which, together with the admissible rules:

{Γ; Δ ⊢ B \atop Γ, A; Δ ⊢ B} (W eak)
\begin{matrix}Γ; ⊢ A & Γ, A; Δ ⊢ B \\ Γ; Δ ⊢ B \end{matrix} (I-Cut)  \begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2}, A ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (L-Cut)

make up the structural rules of the logic. As might be expected from our previous discussion of the relationship between the structural rules and those for the connectives, in rules having two premises the intuitionistic contexts are shared and the linear contexts are kept separate; for example, consider the tensor I/E-pair:

\begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2} ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ A ⊗ B \end{matrix} (⊗I) \begin{matrix}Γ; Δ ⊢ A ⊗ B & Γ; Δ_{2}, A, B ⊢ C \\ Γ; Δ_{1}, Δ_{2} ⊢ C \end{matrix} (⊗E)

Now, the rules for the !-connective are presented as an I/E-pair, in conventional natural deduction fashion:

{Γ; ⊢ A \atop Γ; ⊢!A} (!I)  \begin{matrix}Γ; Δ_{1} ⊢!A & Γ, A; Δ_{2} ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (!E)

The rules of the logic, and particularly this I/E-pair for the !-connective, make the proof structure much simpler than that of intuitionistic linear logic in its conventional presentation. One characterising proof equivalence of the logic is as follows:

{Γ; !A, Δ ⊢ B \atop Γ, A; Δ ⊢ B}

In the same way as we did above for minimal logic, we proceed in chapter 2 to give a type-theory in which the rules of the logic become typing rules, using the Curry-Howard correspondence. We build this type theory over a signature of primitive types and constants, and given a typing judgement Γ; Δ ⊢ t:A we have that variables typed in Γ may occur many times (or not at all) free in t, whereas variables typed in Δ must occur exactly once free in t. The variables typed in Γ must be disjoint from those typed in Δ. The most significant difference between this type theory and that due to [BBdPH93b], presented above, occurs in the treatment of the !-connective and its rules. The straightforward term assignment

{Γ; ⊢ t:A \atop Γ; ⊢!t :!A} (!I)  Γ; Δ_{1} ⊢ t :!A Γ, x:A; Δ_{2} ⊢ u:B Γ; Δ_{1}, Δ_{2} ⊢ let !x be t in u:B (!E)

allows us to prove the two substitution lemmas corresponding to the cut rules. Further, the β- and η-equivalences for the !-connective arising from its presentation with an I/E-pair generate β- and η-axiomatic equalities for it:

(β) Γ; Δ ⊢ let !x be !t in u = u{t/x}:A (η) Γ; Δ ⊢ let !x be t in !x = t :!A

This is in contrast to the complex treatment of the connective forced in the case of the single-context linear logic presented above.

We then complete the linear version of the familiar triangle by giving, in chapter 3, a categorical semantics for the type-theory of DILL, which is based on the adjunction model of linear logic described earlier. We show that the type theory is sound and complete with respect to these models in the standard way, using a term model construction.

Now, just as we sketched the construction of a general theory of operators over the structural fragment of minimal logic, it is profitable to consider a general theory of rules and hence operators built on the structural fragment of DILL, but with one slight alteration. Instead of assuming that there is just one set of primitive propositions, as in DILL, we assume two sets; a set of primitive linear propositions (or types) and a set of primitive intuitionistic propositions (or types). We further assume that any primitive intuitionistic type is also a primitive linear type. In this definition, we are intuitively saying that some linear types are in fact value types, for example natural numbers or booleans, elements of which can be copied.

We construct this logic in chapter 4; a sequent has the general form Γ; Δ ⊢ A where Γ is a set of primitive intuitionistic propositions, Δ is a multiset of primitive linear propositions, and A is a primitive linear proposition. Because we have replaced the set of primitive propositions of DILL with two sets, the new logic has another structural rule, the I-L-rule, which holds for any intuitionistic proposition Q:

\begin{matrix}Γ; Δ_{1} ⊢ Q & Γ, Q; Δ_{2} ⊢ A \\ Γ; Δ_{1}, Δ_{2} ⊢ A \end{matrix} (I-L)

We build a theory of general operators on this structural foundation, and proceed to annotate it in chapter 4, as we did for minimal logic. Considering equivalence between proofs in this two-zoned setting raises substantial naturality issues, which we discuss at length before presenting the equality judgement of the type-theory. We parameterise this equality judgement over a set of axiomatic equalities, giving us an expressive theory of binding operators in the setting of a linear type-theory, which we call general linear type-theory.

We then consider the categorical semantics of this general framework, using natural transformations, in chapter 5. The basis of the model is the structural fragment of models of linear logic mentioned above.

Having developed the theory of this general linear type theory, it is helpful to consider an example, and in fact we provide a set of examples by showing that each instance of Milner’s (static) action calculi, presented earlier, is equivalent to an instance of our general type theory in which the controls correspond to binding operators of a certain restricted form. In chapter 6, we first define action calculi and show the equivalence to instances of our theory, and then go on to consider three higher-order extensions of action calculi, one of which is due to Milner [Mil94b], one of which is largely folklore, and one of which is due to the author. We show that these extensions, and various structure-preserving translations which exist between them, correspond to extensions of the typetheories corresponding to action calculi and translations between them in our theory. Finally in chapter 6, we consider the semantics for action calculi inherited from that of the instances of our general theory, and compare it to the semantics of action calculi given by Power [Pow96].

Inspired by the generality of the higher-order extensions of action calculi, in chapter 7 we define higher-order general linear type theories, which are a subset of general linear type-theories having operators and equalities based on those of linear logic for the ⊸, ⊗ and ! connectives. We can then define the higher-order extension of a given instance of our theory as that theory with the connectives, operators and the corresponding equalities ‘freely’ added. It is not immediately clear that this addition does not yield a trivial structure (as is the case with some extensions of action calculi, see [Mil94b]), but we are able via the semantics to use a presheaf construction to show that the obvious embedding of a theory into its higher-order extension is conservative. As a corollary, this shows the same conservativity property for the morphisms of action calculi described earlier.

We complete our development in chapters 8 and 9 by considering decidability issues for the type-theories and equalities we have introduced. Historically, deciding equality judgements in linear type-theories has been complex, because of the commuting conversions mentioned earlier, and because of confluence problems with the reductive orientation of the axiomatic equalities. The situation is much clearer in the case of proof nets, since it is not complicated by the commuting conversions.

We might, therefore, consider a system of proof nets for our general linear type-theory. However, to define such a graphical system and prove the delicate results on its rewrites would be cumbersome. Hence we present a system of relations, which are non-graphical analogues of proof nets for general linear typetheories. It is worth noting that the proof nets which we use for intuition can be formally presented, and in fact that this has been done by the author [Bar] for a closely-related system of proof nets for the logic DILL.

A proof net labelling a derivation of Γ; Δ ⊢ A corresponds to a relation D relating variables x⃗ of type Γ, y⃗ of type Δ to a variable z of type A. Each proof-rule corresponds to a primitive relation, and cut is modelled by a multiary relational composition. Let us take, for example, the proof net (for DILL) in figure 1.3.

This corresponds to the term

; x′:A ⊗ C, y:B ⊢ let x_{1} ⊗ x_{2} be x′ in x_{1} ⊗ (y ⊗ x_{2}):A ⊗ (B ⊗ C)

and the relation

R(x′, y, z) = ∃x_{1}:A, x_{2}:C, y′:B ⊗ C.(z = x_{1} ⊗ y′) ∧ (y′ = y ⊗ x_{2}) ∧ (x_{1} ⊗ x_{2} = x′)

If we were then to abstract y from this, to give the term

; x′:A ⊗ C ⊢ λy:B.let x_{1} ⊗ x_{2} be x′ in x_{1} ⊗ (y ⊗ x_{2}):B ⊸ (A ⊗ (B ⊗ C))

this would have the relation

S(z′, x′) = ∀y:B.∃z:(A ⊗ (B ⊗ C)).(z′y = z) ∧ R(x′, y, z)

Figure 1.5:

Just as we have that commuting conversion proof equivalences correspond to equalities on the proof nets, we can see that the commuting-conversion equivalent form of this proof (constructed as on page 14), which has the term

; x′:A ⊗ C ⊢ let x_{1} ⊗ x_{2} be x′ in (λy:B.x_{1} ⊗ (y ⊗ x_{2})):B ⊸ (A ⊗ (B ⊗ C))

has a relation

S′(z′, x′) = ∃x_{1}:A, x_{2}:C.(x_{1} ⊗ x_{2} = x′) ∧

∀y:B.∃z:(A ⊗ (B ⊗ C)), y′:B ⊗ C.(z′y = z) ∧ (y′ = y ⊗ x_{2}) ∧ (z = x_{1} ⊗ y′)

which is the same as S(z′, x′) up to certain obvious syntactic manipulations of the quantifiers.

Using these relations, we can give a syntactic representation of the proofs of our general linear type-theory. We can then define rewrites on them which are confluent and strongly normalising, such that two relations have the same normal form under rewriting if and only if they correspond to terms which are judged equal in an instance of the type-theory over an empty axiom set. We call such an instance pure. This strongly-normalising rewrite then provides a decision procedure for any pure instance of our general linear type-theory.

Furthermore, this result immediately provides a complete solution to the coherence problem for the structural fragment of linear logic. Via our completeness result, a diagram commutes in all models of any suitable pure instance if and only if it does in the term-model, and checking this amounts to checking a term equality in the pure instance, which is therefore decidable.

However, it must be said that there are few useful systems which arise as pure instances of our general linear type theory; in order to present systems for action calculi and linear logic we have had to incorporate extra axiomatic equalities, which mean that our decidability result no longer applies. We proceed, therefore, to extend the system of relations and rewrites to the higher-order case. We define pure higher-order instances to be instances of our higher-order general linear type theory over an empty axiom set. We then give relations and rewrites on them which again are confluent and normalising, and such that two relations have the same normal form if and only if they correspond to terms which are judged equal in the pure higher-order instance of the type-theory. As before, this provides a decision procedure for such pure higher-order instances, and this time provides a complete solution to the coherence problem for models of our higher-order general linear type-theory, in the same way as before.

This result is more substantial. It has as corollaries the decidability of the equality of all the action calculi fragments studied (by virtue of our conservativity results), the decidability of the equality judgement in the type theory of DILL, and hence the decidability of the equality judgement in the ‘Cambridge’ type theory [BBdPH93b]. We should also note that Ghani [Gha96] independently decided the βη − cc equality of DILL(ℂ), working within the term syntax and using expansionary η-rewrites.

Finally, we note that the system of relations and rewrites for a pure instance of our general linear type-theory embeds soundly and fully into the system of relations and rewrites for the higher-order extension of the pure instance. In this way we obtain a syntactic conservativity proof for conservativity on pure instances, a subcase of the problem solved semantically in chapter 7.

1.4 Chapter Summary

Having introduced our approach, and the main concepts involved, we summarise the contents of the rest of this thesis.

2) An Alternative Formulation of ILL This chapter introduces our alternative formulation of intuitionistic linear logic built over sequents Γ; Δ ⊢ A. Having given the alternative logic, we give the derived type theory and some useful results, and then proceed to show that the type theory is equivalent to the familiar Cambridge type theory [BBdPH93b] over ILL, up to provable equality.

3) The Semantics of DILL In this chapter, we give a semantics for the type theory based on DILL, and show it to be sound and complete by the construction of a term model. We also consider the relation between the models we have chosen and another influential notion of model, first stated for the Cambridge type theory.

4) Linear Type Theories In this chapter, we move away from linear logic. We present a generalisation of Aczel’s binding operators, and then introduce a general linear logic over the structural rules of DILL, which incorporates rules derived from these binding operators. We then give the type-theory Lin(𝕆, 𝔸) based on this logic.

5) The Semantics of Lin(𝕆, 𝔸) In this chapter we develop a semantics of the generalised type-theory presented in the previous chapter. This is based around the structural fragment of the models of ILL.

6) Action Calculi and Extensions In this chapter we introduce Milner’s action calculi and show how they can also be viewed as instances of our general linear type theory. We also show the same for various higher-order extensions of action calculi, including that given by Milner himself. Further, we consider the semantics induced by our semantics for the general linear type theory.

7) Higher-Order Extensions In this chapter we introduce higher-order type theories in general, give the canonical higher-order extension of a general linear type theory, inspired by linear logic, and use a categorical argument to show that the embedding of any general linear type-theory into its higherorder extension is conservative. We then consider various implications of this result for the theory of action calculi. We also introduce an instance of the higher-order type theory which is equivalent to the system DILL(ℂ).

8) Normal Forms for Lin(𝕆, 𝔸) In this chapter, we introduce relations, our syntax for proofs based on proof nets. We show that using a rewrite and an equality on relations, we can give a system which is equivalent to the familiar general linear type-theory under a restricted derivable equality.

9) Normal Forms and Decidability This chapter extends the results of the previous chapter by showing that the full provable equality of any pure instance of our general linear type theory is equivalent to a rewrite over and equality on relations. We further show that this rewrite is strongly normalising, and the equality is decidable, thereby showing that the provable equality judgement of the general linear type-theory with empty axiom set is decidable. This result is then extended by giving rewrites for the higherorder type-theories which decide the axiomatic equality of the higher-order theory without arbitrary axioms.

10) Conclusion We discuss the implications of this work, future directions and questions raised, in particular discussing classical linear logics, enriching our general linear type-theory with a rewrite, and applications to process calculi.

1.5 Historical Notes

The work in chapters 2 and 3 is based on a talk [Plo93b] and unpublished notes [Plo93a] by Gordon Plotkin, whilst the work on action calculi, higherorder action calculi and conservativity in chapters 6 and 7 is a reformulation of work done in collaboration with Philippa Gardner, Gordon Plotkin and Masahito Hasegawa in [BGHP97].

An Alternative Formulation of ILL

We introduce an alternative natural deduction formulation of ILL, dual intuitionistic linear logic (henceforth DILL), in which we use two kinds of assumptions, linear and intuitionistic. The exponential is introduced with rules allowing a deduction of a formula !A from a formula A when no linear assumptions have been used, and eliminated by allowing a conclusion !A to substitute for an intuitionistic assumption A.

When we express this natural deduction formulation in a sequent style, the general form of a sequent is Γ; Δ ⊢ A, which is interpreted as meaning that from intuitionistic assumptions in Γ and linear assumptions in Δ we can deduce A. This splitting of the context leads to an extra intuitionistic axiom form, but the remainder of the rules are very similar to their counterparts in the natural deduction formulation of ILL.

Having outlined the form of the logic, we can see that it is easy to give a term assignment calculus. The introduction and elimination rules for ! are reflected in two new term constructs, an introduction construct !t and an elimination construct let !x be u in t, together forming a constructor-destructor pair.

In this chapter, we first present the logic DILL, and then give the type theory based upon it. We then present the type theory ILLand show its relation to the type theory based on DILL.

2.1 The Logic DILL

In order to present the logic, we assume a base set P_{L} of primitive propositions, ranged over by l, k …, and then define formulae, ranged over by A, B, C …:

A ::= l ∈ P_{L} | I | A ⊗ A | A ⊸ A | !A

Now we define an logical context to be a pair of a set of formulae and a multiset of formulae, where we overload comma for the (set/multiset) union and for the empty (set/multiset). We will write such a pair as Γ; Δ, where the Γ is the intuitionistic part and Δ is the linear part.

We now assume a set C of formulae, the primitive assumptions. These are assumptions which we may use in a deduction with no further justification. We give the rules of the logic over P_{L} and C, which we call D(P_{L}, C).

Definition 2.1.1 (Logical Rules of D(P_{L}, C)) We say that a sequent Γ; Δ ⊢ A can be derived for a formula A in D(P_{L}, C) if it can be shown using the following rules:

(Int − Ax) Γ, A; ⊢ A  (Lin − Ax) Γ; A ⊢ A

(Ass) Γ; ⊢ A (A ∈ C)

(I − I) Γ; ⊢ I  \begin{matrix}Γ; Δ_{1} ⊢ I & Γ; Δ_{2} ⊢ A \\ Γ; Δ_{1}, Δ_{2} ⊢ A \end{matrix} (I − E)
\begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2} ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ A ⊗ B \end{matrix} (⊗ − I) \begin{matrix}Γ; Δ_{1} ⊢ A ⊗ B & Γ; Δ_{2}, A, B ⊢ C \\ Γ; Δ_{1}, Δ_{2} ⊢ C \end{matrix} (⊗ − E)
{Γ; Δ, A ⊢ B \atop Γ; Δ ⊢ A ⊸ B} (⊸ I)  \begin{matrix}Γ; Δ_{1} ⊢ A ⊸ B & Γ; Δ_{2} ⊢ A \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (⊸ E)
{Γ; ⊢ A \atop Γ; ⊢!A} (! − I)  \begin{matrix}Γ; Δ_{1} ⊢!A & Γ, A; Δ_{2} ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (! − E)

As remarked in the introduction, we have replaced the four rules involving the !-connective in the original form of ILL with the introduction-elimination pair seen above. The contraction and weakening rules previously used are now derivable by virtue of the fact that we allow contraction and weakening in the intuitionistic side of the context.

The Structural Rules

We can now give three structural rules for this logic: we have intuitionistic weakening and two flavours of cut, one intuitionistic and one linear.

{Γ; Δ ⊢ B \atop Γ, A; Δ ⊢ B} W eakening
\begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2}, A ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (L − Cut) \begin{matrix}Γ; ⊢ A & Γ, A; Δ ⊢ B \\ Γ; Δ ⊢ B \end{matrix} (I − Cut)

These three structural rules can be shown to be admissible, by which we mean that given a derivation of the premise of each rule, we can construct a derivation of its conclusion. Further, using these structural rules we can prove the lemma:

Lemma 2.1.2 (L-Transfer) The following structural rule is admissible:

{Γ; A, Δ ⊢ B \atop Γ, A; Δ ⊢ B}

We now go on to state a number of defining equivalences for the connectives, which characterise their behaviour. One of the main motivations for this logic is the equivalence for ! presented here:

Lemma 2.1.3 (!-Equivalence) In the presence of the structural rules, the two-way proof rule:

{Γ; !A, Δ ⊢ B \atop Γ, A; Δ ⊢ B}

is equivalent to the (! − I), (! − E) pair introduced earlier, in the sense that in a system having the structural rules we would be able to derive the same sequents using the two way proof rule as we could with the introduction-elimination pair.

Proof If we have the two-way proof rule and the cut rules, then we can derive ! − I:

\begin{matrix}Γ; ⊢ A & {; !A ⊢!A \atop A; ⊢!A} \\ Γ; ⊢!A \end{matrix} (I − Cut)

Further, we can derive ! − E:

Γ; Δ_{1} ⊢!A {Γ, A; Δ_{2} ⊢ B \atop Γ; !A, Δ_{2} ⊢ B}

Γ; Δ_{1}, Δ_{2} ⊢ B (L − Cut)

Going the other way, it is easy to derive both directions of the equivalence given the (! − I), (! − E) pair. The forward direction follows from one use of !-E, and the other direction is an instance of linear cut and weakening:

{Γ, A; ⊢ A \atop Γ, A; ⊢!A} {Γ; !A, Δ ⊢ B \atop Γ, A; !A, Δ ⊢ B}
Γ, A; Δ ⊢ B
□

We give similar results for the other connectives:

Lemma 2.1.4 (Equivalences) In the presence of the structural rules:

• The two-way proof rule {Γ; Δ, I ⊢ C \atop Γ; Δ ⊢ C} is equivalent to the I − I, I − E pair.

• The two way proof rule {Γ; Δ, A ⊗ B ⊢ C \atop Γ; Δ, A, B ⊢ C} is equivalent to the ⊗ − I, ⊗ − E pair.

• The two way proof rule {Γ; Δ ⊢ A ⊸ B \atop Γ; Δ, A ⊢ B} is equivalent to the ⊸ −I, ⊸ −E pair.

These are all proved in a similar way to that for !.

2.2 The Type Theory DILL (ℂ)

We can now annotate the assumptions with variables, and obtain a type-theory from our logic. The types of the type theory (over primitive types P_{L}) are precisely the formulae of the logic (over primitive propositions P_{L}). We assume a countably infinite set of variables X ranged over by x, y … (which will be ubiquitous in this thesis), and we now assume a set of constants C ranged over by c …, each of which has a type of DILL. We write c:A to indicate that the constant c has the type A. We refer to the pair (P_{L}, C) as a DILL-signature , and let ℂ … range over DILL-signatures. We will also assume that ℂ = (P_{L}, C), ℂ′ = (P′_{L}, C′) and similarly.

Definition 2.2.1 (Pre-Terms) We define pre-terms, ranged over by t, u …, as follows:

t ::= x | c:A | ∗ | let ∗ be t in t | t ⊗ t | let x ⊗ x:A ⊗ A be t in t
| λx:A.t | tt | !t | let !x:A be t in t

Having given pre-terms with type annotations, we omit them where possible for brevity. We define the usual capture-avoiding substitution t{u/x}, and also use a simultaneous form t{u⃗/x⃗}, where u⃗ is a sequence of pre-terms and x⃗ is a sequence of variables. In pre-terms, let x ⊗ y be t in u binds x and y in u, λx.t binds x in t, and let !x be t in u binds x in u. We will identify pre-terms up to α-equivalence on bound variables. The multiset of free variables of a pre-term t, written FV(t), is defined inductively, where the mixed complement M − S for M a multiset and S a set removes all copies of anything in S from M:

FV(x) = {x}
FV(c) = ∅
FV(∗) = ∅
FV(let ∗ be u in t) = FV(u) ∪ FV(t)
FV(t ⊗ u) = FV(t) ∪ FV(u)
FV(let x ⊗ y be u in t) = FV(u) ∪ (FV(t) − {x, y})
FV(λx.t) = FV(t) − {x}
FV(tu) = FV(t) ∪ FV(u)
FV(let !x be u in t) = FV(u) ∪ (FV(t) − {x})
FV(!t) = FV(t)

Now we recall from appendix A the definitions of typing and (dual) typing context along with their auxiliary definitions, for the variable set X and the set of types of DILL.

We will now give a type theory with judgements of the form Γ; Δ ⊢ t: A, where Γ; Δ is a typing context, t is a pre-term and A is a type (or formula of the logic). We call this type-theory DILL(ℂ).

In order to give the typing rules of DILL(ℂ), we recall the merge relation Δ = Δ_{1}#Δ_{2}, read as Δ is a merge of Δ_{1} and Δ_{2}, from appendix A.

Definition 2.2.2 (The Typing Judgement of DILL(ℂ)) The rules for deriving typing judgements Γ; Δ ⊢ t:A are as follows, where Δ′ = Δ_{1}#Δ_{2}:

(Int − Ax) Γ_{1}, x:A, Γ_{2}; ⊢ x:A  (Lin − Ax) Γ; x:A ⊢ x:A
(Ass) Γ; ⊢ c:A
(I − I) Γ; ⊢ ∗:I  (I − E) \begin{matrix}Γ; Δ_{1} ⊢ t:I & Γ; Δ_{2} ⊢ u:A \\ Γ; Δ′ ⊢ let ∗ be t in u:A \end{matrix}
(⊗ − I) \begin{matrix}Γ; Δ_{1} ⊢ t:A & Γ; Δ_{2} ⊢ u:B \\ Γ; Δ′ ⊢ t ⊗ u:A ⊗ B \end{matrix} (⊗ − E) \begin{matrix}Γ; Δ_{1} ⊢ u:A ⊗ B & Γ; Δ_{2}, x:A, y:B ⊢ t:C \\ Γ; Δ′ ⊢ let x ⊗ y:A ⊗ B be u in t:C \end{matrix}
(⊸ I) {Γ; Δ, x:A ⊢ t:B \atop Γ; Δ ⊢ (λx:A.t):(A ⊸ B)}  (⊸ E) \begin{matrix}Γ; Δ_{1} ⊢ u:A ⊸ B & Γ; Δ_{2} ⊢ t:A \\ Γ; Δ′ ⊢ (ut):B \end{matrix}
(! − I) {Γ; ⊢ t:A \atop Γ; ⊢!t :!A}  (! − E) \begin{matrix}Γ; Δ_{1} ⊢ u :!A & Γ, x:A; Δ_{2} ⊢ t:B \\ Γ; Δ′ ⊢ let !x :!A be u in t:B \end{matrix}

Definition 2.2.3 (Term) A Γ; Δ term t of type A in DILL(ℂ) for some typing context Γ; Δ and type A is a pre-term such that Γ; Δ ⊢ t:A is a valid typing judgement. We will often indicate that a pre-term t is a Γ; Δ term of type A by writing Γ; Δ ⊢ t: A, or omit the context and typing where it is clear.

We now say that for a term Γ; Δ ⊢ t:A, a variable x ∈ FV(t) is an intuitionistic free variable of t if it occurs in occurs in dom(Γ), and x ∈ FV(t) is a linear free variable of t if it occurs in dom(Δ).

Lemma 2.2.4 (Typing Properties) We have the following in the type system DILL(ℂ):

Free Variables I If Γ; Δ ⊢ t:A, then the underlying set of the multiset FV(t) is a subset of dom(Γ) ∪ dom(Δ).

Free Variables II If Γ; Δ, x:A ⊢ t:B, then x occurs precisely once in FV(t).

Strengthening If Γ, x:A; Δ ⊢ t:B and x ∉ FV(t), then Γ; Δ ⊢ t:B.

I-Transfer If Γ; Δ, x:A ⊢ t:B, then Γ, x:A; Δ ⊢ t:B.

Unique Derivation Given a Γ; Δ term t of type A, there is a unique derivation of the typing judgement Γ; Δ ⊢ t:A.

The proofs of these properties are straightforward. Given the unique derivation lemma, we will interchangeably refer to terms and derivations of typing judgements.

We now present some admissible annotated structural rules, where Δ′ = Δ_{1}#Δ_{2}.

{Γ, y:B, x:A, Γ′ ⊢ t:C \atop Γ, x:A, y:B, Γ′ ⊢ t:C} (I − Exch)  {Γ; Δ_{1}, y:B, x:A, Δ_{2} ⊢ t:C \atop Γ; Δ_{1}, x:A, y:B, Δ_{2} ⊢ t:C} (L − Exch)
{Γ; Δ ⊢ t:B \atop Γ, x:A; Δ ⊢ t:B} (W eak)  {Γ, x:A, y:A; Δ ⊢ t:B \atop Γ, x:A; Δ ⊢ t\{x/y\}:B} (Cont)
\begin{matrix}Γ; ⊢ u:A & Γ, x:A; Δ ⊢ t:B \\ Γ; Δ ⊢ t\{u/x\}:B \end{matrix} (I − Cut) \begin{matrix}Γ; Δ_{1} ⊢ u:A & Γ; Δ_{2}, x:A ⊢ t:B \\ Γ; Δ′ ⊢ t\{u/x\}:B \end{matrix} (L − Cut)

These are shown to be admissible easily- notably, the linear exchange is shown by virtue of the merging we have incorporated into the typing rules. We outline the proof of the linear cut lemma. The proof proceeds by induction on the structure of t, and we consider only a few example cases in the proof; the rest are similar.

Proof: Note that since x:A is a linear typing, x must occur precisely once in FV(t), by our lemma.

• If t is y then y is x, since x is free in y, and hence the required sequent is the second premise.

• If t is λy:B.t′ then by considering the unique derivation, it must end:

{Γ; Δ_{1}, x:A, y:B ⊢ t′:C \atop Γ; Δ_{1}, x:A ⊢ (λy:B.t′):B ⊸ C}

By the induction hypothesis on the premise, we now have:

Γ; Δ_{1}, Δ_{2}, y′:B ⊢ t′{y′/y, u/x}:C

where y′ is a fresh variable not occuring in Δ_{2}, and the required sequent follows by abstraction (up to α-conversion).

• If t is let !y:C be t_{1} in t_{2} then we know that we have a derivation:

Γ; Δ′_{1} ⊢ t_{1} :!C Γ, y:C; Δ′′_{1} ⊢ t_{2}:B
Γ; Δ_{1} ⊢ let !y:C be t_{1} in t_{2}:B

where Δ_{1} = Δ′_{1}#Δ′′_{1} and x: A occurs in either Δ′_{1} or Δ′′_{1}. In either case we can use the induction hypothesis to obtain the result required, possibly using α-conversion as before.

We now need to define a notion of (term-)contexts, where these may be linear (ie, use their ‘argument’ linearly) or intuitionistic (ie, use their argument inside a !-construct).

We define a general pre-context, written C[ ], as follows:

C[ ] ::= | let ∗ be C[ ] in t | let ∗ be t in C[ ] | t ⊗ C[ ] | C[ ] ⊗ t |

let x ⊗ x be C[ ] in t | let x ⊗ x be t in C[ ] | λx.C[ ] | C[ ]t | tC[ ] |

!C[ ] | let !x be C[ ] in t | let !x be t in C[ ]

It is easily shown there will be precisely one occurrence of the symbol in every pre-context. We extend the definition of free variable multiset to pre-contexts FV(C[ ]) in the obvious way by saying FV( ) = ∅.

Definition 2.2.5 (Instantiation of Pre-contexts) Define C[t] for a given pre-context C[ ] and pre-term t to be the pre-context C[ ] with the unique occurrence of the symbol replaced by t. We can easily show by induction over contexts that C[t] is a pre-term.

Definition 2.2.6 (Context) A Γ; Δ, A-Γ′; Δ′, B context is a pre-context C[ ] such that for any term Γ; Δ ⊢ t: A, we have a derivation of the judgement Γ′; Δ′ ⊢ C[t]:B.

Although this definition is not constructive, it can be formulated in an equivalent but much more lengthy constructive form, using a system of judgements of the form Γ; Δ ⊢ C : Γ; Δ, A − Γ′; Δ′, B. For the pre-contexts we will claim are contexts, it will be easy to see that the definition above is satisfied.

Definition 2.2.7 (Linear and Binding Contexts) We say that a context is linear if it does not contain the clause !C[ ]. Further, a context binds a variable x if the context is constructed with the use of a clause instance let x ⊗ y be t in C[ ], let y ⊗ x be t in C[ ], λx.C[ ] or let !x be t in C[ ].

Now we can define our contextual equality judgement.

Definition 2.2.8 (The Equality Judgement) We say that two terms Γ; Δ ⊢ t:A and Γ; Δ ⊢ u:A are provably equal of type A in an environment Γ; Δ, written Γ; Δ ⊢ t = u:A, if their equality is provable using the following rules:

{Γ; Δ ⊢ t:A \atop Γ; Δ ⊢ t = t:A} \begin{matrix}Γ; Δ ⊢ t = t′:A & Γ; Δ ⊢ t′ = t′′:A \\ Γ; Δ ⊢ t = t′′:A \end{matrix} {Γ; Δ ⊢ t = u:A \atop Γ; Δ ⊢ u = t:A}

{Γ; Δ ⊢ t = u:A \atop Γ′; Δ′ ⊢ C[t] = C[u]:B}

where C[ ] is a Γ; Δ, A-Γ′; Δ′, B-context.

(β)  (η)
Γ; Δ ⊢ let ∗ be ∗ in t = t:A  Γ; Δ ⊢ let ∗ be t in ∗ = t:I
Γ; Δ ⊢ let x ⊗ y be u_{1} ⊗ u_{2} in t = t{u_{1}/x, u_{2}/y}:A Γ; Δ ⊢ let x ⊗ y be t in x ⊗ y = t:A ⊗ B
Γ; Δ ⊢ (λx:A.t)u = t{u/x}:A  Γ; Δ ⊢ λx:A.(tx) = t:A ⊸ B

where x is not free in t

Γ; Δ ⊢ let !x:A be !u in t = t{u/x}:A  Γ; Δ ⊢ let !x:A be t in !x = t :!A

In these, C is supposed to be a linear context. Γ; Δ ⊢ let ∗ be t in C[u] = C[let ∗ be t in u]:A

Γ; Δ ⊢ let x ⊗ y be t in C[u] = C[let x ⊗ y be t in u]:A

Γ; Δ ⊢ let !x be t in C[u] = C[let !x be t in u]:A where C[ ] does not bind x or contain it free

These commuting conversions are the equality judgements which correspond to the trivial proof permutations which exist in linear logics. In other presentations of term calculi for ILL, the proof permutations are expressed as a large number of primitive typed equality judgements such as:

Γ; Δ ⊢ let x ⊗ y be t in u_{1} ⊗ u_{2} = u_{1} ⊗ (let x ⊗ y be t in u_{2}):A ⊗ B

where x, y are not free in u.

These many individual typed equalities all occur as examples of one of our commuting conversion schemas. For example, the typed equality above would be an instance of our second commuting conversion axiom, where the context C is v ⊗ .

Note 2.2.9 (Commuting Conversions of ! − E) Notice that the restriction on the context in the !-commuting conversion, means that it does not have as an instance the following equality judgement:

y :!A; ⊢!(let !x be y in x) = let !x be y in !x:A

This cannot be motivated from the proof structure of linear logic, and it corresponds to imposing an extra requirement on models (idempotency of the comonad !).

From now on, we will assume that whenever we write t = u, there exists an appropriate equality judgement Γ; Δ ⊢ t = u:A.

Equivalences

We can now prove a lemma extending our results on equivalences to the typed case.

Lemma 2.2.10 (Equivalences) • If Γ; Δ, x: I ⊢ t: A, then Γ; Δ ⊢ t{∗/x}: A, and if Γ; Δ ⊢ u: A, then Γ; x: I, Δ ⊢ let ∗ be x in u: A, where x is fresh. Further, these maps are inverse up to provable term equality.

• If Γ; Δ, x_{1} : A, x_{2} : B ⊢ t: C, then Γ; Δ, y: A ⊗ B ⊢ let x_{1} ⊗ x_{2} be y in t: C where y is fresh, and if Γ; Δ, y: A ⊗ B ⊢ u: C, then Γ; Δ, x_{1} : A, x_{2} : B ⊢ u{x_{1} ⊗ x_{2}/y}:C where x_{1} and x_{2} are fresh. Further, these maps are inverse up to provable term equality.

• If Γ; Δ ⊢ t: A ⊸ B, then Γ; Δ, x: A ⊢ tx: B where x is fresh, and if Γ; Δ, x:A ⊢ u:B, then Γ; Δ ⊢ λx:A.u:A ⊸ B. Further, these maps are inverse up to provable term equality.

• If Γ; x :!A, Δ ⊢ t:B, then Γ, y:A; Δ ⊢ t{!y/x}:B where y is fresh, and if Γ, y: A; Δ ⊢ u: B, then Γ; x :!A, Δ ⊢ let !y be x in u: B where x is fresh. Further, these maps are inverse up to provable term equality.

It is interesting to note that we could use these equivalences to define the term equality. If we consider the typing system without any notion of equality judgement, and read the equivalences above as isomorphisms on proofs, they say the following:

Proofs Γ; Δ, x:I ⊢ t:A are isomorphic to proofs Γ; Δ, x:I ⊢ let ∗ be x in t{∗/x}:A Proofs Γ; Δ ⊢ u:A are isomorphic to proofs Γ; Δ ⊢ let ∗ be ∗ in u:A

Proofs Γ; Δ, x_{1}:A, x_{2}:B ⊢ t:C are isomorphic to proofs

Γ; Δ, x_{1}:A, x_{2}:B ⊢ let x ⊗ y be x ⊗ y in t:C

Proofs Γ; Δ, y:A ⊗ B ⊢ u:C are isomorphic to proofs Γ; Δ, y:A ⊗ B ⊢ let x_{1} ⊗ x_{2} be y in u{x_{1} ⊗ x_{2}/y}:C

Proofs Γ; Δ, x:A ⊢ t:B are isomorphic to proofs Γ; Δ, x:A ⊢ (λx.t)x:B Proofs Γ; Δ ⊢ u:A ⊸ B are isomorphic to proofs Γ; Δ ⊢ λx.(ux):A ⊸ B

Proofs Γ, x:A; Δ ⊢ t:B are isomorphic to proofs Γ, x:A; Δ ⊢ let !x be !x in t:B Proofs Γ; y :!A, Δ ⊢ u:B are isomorphic to proofs Γ; y :!A, Δ ⊢ let !x be y in u{!x/y}:B

Now the alternative equality judgement with the symmetric, transitivity, reflexivity and congruence rules already defined, with the addition of two cut rules:

\begin{matrix}Γ; Δ_{1} ⊢ u:A & Γ; x:A, Δ_{2} ⊢ t = t′:B \\ Γ; Δ′ ⊢ t\{u/x\} = t′\{u/x\}:B \end{matrix} \begin{matrix}Γ; ⊢ u:A & Γ, x:A; Δ ⊢ t = t′:B \\ Γ; Δ ⊢ t\{u/x\} = t′\{u/x\}:B \end{matrix}

(where Δ′ = Δ_{1}#Δ_{2}) and with the axiomatic equalities induced by the proof isomorphisms listed above is equivalent in strength to the equality judgement first defined.

A Definable Intuitionistic Function Space

We now briefly present a definable extension to the logic and term calculus given above. In order to make the syntax more usable, we show how we can define the types and terms associated with an intuitionistic arrow type purely in terms of the structures we already have.

Definition 2.2.11 (The Intuitionistic Arrow) Types Define the type A → B in our new system as the type !A ⊸ B. Terms Define the intuitionistic abstraction and application term constructs as follows (where we use γ for the abstraction, and y is fresh):

\begin{aligned}γx:A.t & = & λy :!A let !x :!A be y in t \\ tu & = & t(!u) \end{aligned}

Now we have the following lemma:

Lemma 2.2.12 (Typing and Equality Rules for →) The following introduction and elimination rules are admissible in DILL(ℂ):

{Γ, x:A; Δ ⊢ t:B \atop Γ; Δ ⊢ γx:A.t:A → B} → −I \begin{matrix}Γ; Δ ⊢ t:A → B & Γ; ⊢ u:A \\ Γ; Δ ⊢ tu:B \end{matrix} → −E

The following equality judgements are admissible in DILL(ℂ):

Γ; Δ ⊢ (γx:A.t)u = t[u/x]:A Γ; Δ ⊢ γx:A.(tx) = t:A → B

Clearly we can erase the typings from the introduction and elimination rules to obtain admissible introduction and elimination rules for → in the logic DILL(ℂ).

This construct and its associated terms and equalities can by virtue of this lemma be used without changing the development to follow. Other definitions of this function space are possible via more complex embeddings of intuitionistic logic into linear logic; for example see Benton [BW96] or Schellinx [Sch94].

2.3 The Type Theory ILL(ℂ)

We present the type-theory based on ILL due to Benton et al. [BBdPH93b], with two amendments. Firstly, we build the type theory over a dill-signature, in the analogous way to DILL, and secondly we have adapted the presentation of the equality in op. cit. using contexts to express the commuting conversions, and giving an equality judgement. For brevity we do not present the logic; this can be found in [BBdPH93b].

We assume the same set X of variables as used in DILL(ℂ). The types of ILL(ℂ) are exactly those of DILL(ℂ). Given this, we define pre-terms, ranged over by M, N … as follows:

M ::=x | c:A | ∗ | let ∗ be M in M | M ⊗ M | let x ⊗ x:A ⊗ A be M in M |

λx:A.M | MM | promote M⃗ for x :!A … x :!A in M | derelict(M) | copy M for x, x :!A in M | discard M in M

As before, we will omit type information in pre-terms where convenient. Following Benton et al., we use the form (discard M⃗ in N) to abbreviate

(discard M_{1} in … in discard M_{r} in N)

We also use (copy M⃗ for x⃗, y⃗ in N) to abbreviate

(copy M_{1} for x_{1}, y_{1} in … copy M_{r} for x_{r}, y_{r} in N)

We now summarise the binding behaviour of the pre-terms: the pre-terms let x ⊗ y be M in N and copy M for x, y in N bind x and y in N; the pre-term λx.M binds x in M and the pre-term promote M⃗ for X⃗ in N bind each of the x⃗ in N. Again, we will require a standard capture-avoiding notion of substitution M{N/x}, and its simultaneous counterpart t{u⃗/x⃗}.

Now we define an ILL typing context as a single typing context over the variable set X and the types of DILL(ℂ). We give the contextual typing judgement Δ ⊢ M:A as follows:

Definition 2.3.1 (The Typing Judgement) The rules for deriving judgements Δ ⊢ M:A are as follows, where Δ′ = Δ_{1}#Δ_{2} and Δ′′ = Δ_{1}# … #Δ_{r}:

(Lin − Ax) x:A ⊢ x:A  (Ass) ⊢ c:A
(I − I) ⊢ ∗:I  (I − E) \begin{matrix}Δ_{1} ⊢ M:I & Δ_{2} ⊢ N:A \\ Δ′ ⊢ let ∗ be M in N:A \end{matrix}
(⊗ − I) \begin{matrix}Δ_{1} ⊢ M:A & Δ_{2} ⊢ N:B \\ Δ′ ⊢ M ⊗ N:A ⊗ B \end{matrix} (⊗ − E) \begin{matrix}Δ_{1} ⊢ N:A ⊗ B & Δ_{2}, x:A, y:B ⊢ M:C \\ Δ′ ⊢ let x ⊗ y:A ⊗ B be N in M:C \end{matrix}
(⊸ I) {Δ, x:A ⊢ M:B \atop Δ ⊢ (λx:A.M):(A ⊸ B)}  (⊸ E) \begin{matrix}Δ_{1} ⊢ M:A ⊸ B & Δ_{2} ⊢ N:A \\ Δ′ ⊢ (MN):B \end{matrix}
(Weak) Δ_{1} ⊢ M :!A Δ_{2} ⊢ N:B Δ′ ⊢ discard M in N:B  (Der) Δ ⊢ M :!A Δ ⊢ derelict(M):A

Contraction

Δ_{1} ⊢ M :!A Δ_{2}, x :!A, y :!A ⊢ N:B
Δ′ ⊢ copy M as x, y in N:B

Promotion

i = 1..r Δ_{i} ⊢ M_{i} :!A_{i} x_{1} :!A_{1}, …, x_{r} :!A_{r} ⊢ N:B
Δ′′ ⊢ promote M⃗ for x⃗ in N :!B

Definition 2.3.2 (Term) We define a Δ term t of type A in ILL(ℂ) to be a pre-term t of ILL(ℂ) such that we can derive the typing judgement Δ ⊢ t:A.

We can now give admissible exchange and linear cut rules.

Definition 2.3.3 (Pre-contexts) We define pre-contexts for ILL(ℂ) inductively as follows:

C[ ] ::= | let ∗ be C[ ] in t | let ∗ be t in C[ ] | t ⊗ C[ ] | C[ ] ⊗ t |

let x ⊗ x be C[ ] in t | let x ⊗ x be t in C[ ] | λx.C[ ] | C[ ]t | tC[ ] | promote M⃗_{1}, C[ ], M⃗_{2} for x⃗ in N | promote M⃗ for x⃗ in C[ ] copy C[ ] for x, y in N | copy M for x, y in C[ ]derelict(C[ ]) discard C[ ] in N | discard M in C[ ]

We define the instantiation of a pre-context C[ ] with a pre-term M again to be the pre-context with the unique occurrence of the symbol replaced by the pre-term M. We say that any pre-context constructed with no instance of the schema promote M⃗ for x⃗ in C[ ] is linear.

Definition 2.3.4 (Context) We define a Δ, A-Δ′, B′ context to be a pre-context C[ ] such that for any term Δ ⊢ t:A, we have Δ′ ⊢ C[t]:B.

Again, this definition of contexts is not inductive, but as in the case of contexts for DILL(ℂ), it could easily be equivalently given inductively.

Definition 2.3.5 (The Equality Judgement) We define a contextual equality judgement Δ ⊢ M = N:A, where M and N are Δ terms of type A, by the following rules (where for brevity we write M = N for Δ ⊢ M = N:A): The Congruence Rules

{Δ ⊢ M:A \atop Δ ⊢ M = M:A} \begin{matrix}Δ ⊢ M = M′:A & Δ ⊢ M′ = M′′:A \\ Δ ⊢ M = M′′:A \end{matrix} {Δ ⊢ M = N:A \atop Δ ⊢ N = M:A}

{Δ ⊢ t = u:A \atop Δ′ ⊢ C[t] = C[u]:B}

where C[ ] is a Δ, A-Δ′, B-context.

The Basic Equalities

let ∗ be ∗ in M = M  (2.1)
let ∗ be M in ∗ = M  (2.2)
let x ⊗ y be M_{1} ⊗ M_{2} in N = N{M_{1}/x, M_{2}/y}  (2.3)
let x ⊗ y be M in x ⊗ y =M  (2.4)
(λx.M)N = M{N/x}  (2.5)
λx.(Mx) = M  (2.6)

The Commuting Conversions For linear C[ ],

let ∗ be M in C[N] = C[let ∗ be M in N]  (2.7)
let x ⊗ y be M in C[N] = C[let x ⊗ y be M in N]  (2.8)
discard M in C[N] = C[discard M in N]  (2.9)
copy M for x, y in C[N] = C[copy M for x, y in N]  (2.10)

The Exponential Equalities

derelict (promote M⃗ for x⃗ in N) = N{M⃗/x⃗}  (1)
discard (promote M⃗ for x⃗ in N) in N′ = discard M⃗ in N′  (2)
promote M for x in derelict (x) = M  (3)
copy M for x, y in N = copy M for y, x in N  (4)
copy M for x, y in (discard x in N) = N{M/y}  (5)
copy M for x, y in copy y for x′, y′ in N = copy M for y, y′ in copy y for x, x′ in N (6)
promote M′, M⃗ for x′, x⃗ = discard M′ in (promote M⃗ for x⃗ in N) (7)

in (discard x′ in N)

copy (promote M⃗ for x⃗ in N) = copy M⃗ for x⃗_{1}, x⃗_{2} in N′{p_{1}, p_{2}/y_{1}, y_{2}} (8)
for y_{1}, y_{2} in N′

(where p_{1} = promote x⃗_{1} for x⃗ in N and p_{2} = promote x⃗_{2} for x⃗ in N)

promote M′, M⃗ for x′, x⃗ = copy M′ for y′_{1}, y′_{2} in p_{3}  (9)
in (copy x′ for y_{1}, y_{2} in N)

(where p_{3} = promote M⃗, y′_{1}, y′_{2} for x⃗, y_{1}, y_{2} in N)

promote (promote y⃗_{1} for x⃗_{1} in M), y⃗_{2} = promote y⃗_{1}, y⃗_{2} for y⃗_{3}, x⃗_{2} in N{p_{4}/x′} (10)
for x′, x⃗_{2} in N

(where p_{4} = promote y⃗_{3} for x⃗_{1} in M)

2.4 Relating DILL and ILL

We now show that DILL is essentially equivalent to ILL at the level of the respective type-theories, by which we mean firstly that we can give a translation from DILL(ℂ) to the type-theory ILL(ℂ), and one in the reverse direction, such that two terms are equal in ILL(ℂ) if and only if their images are equal in DILL(ℂ)and secondly that we can give a translation from the terms of DILL(ℂ) derivable with no intuitionistic assumptions, ; Δ ⊢ t: A, to the terms of ILL(ℂ). Wherever numbers are used to refer to particular equalities of ILL(ℂ), those numbers are as given in section 2.3. Of course these translations easily yield translations on the logics DILL and ILL.

In the following, we will use the abbreviation (let !x⃗ be u⃗ in t) to indicate the term

let !x_{1} be u_{1} in … let !x_{r} be u_{r} in t

in DILL(ℂ). We use the turnstile ⊢_{ILL(ℂ)} to indicate the typing and equality judgements of ILL(ℂ) and similarly the turnstile ⊢_{DILL(ℂ)} to indicate those of DILL(ℂ) where the distinction is unclear.

We will define two translations, Φ taking ILL(ℂ) to DILL(ℂ), and Ψ taking DILL(ℂ) to ILL(ℂ). These translations will be the identity on types.

Lemma 2.4.1 (Properties of the Translations) The following are properties of Φ and Ψ:

1. If Δ ⊢_{ILL(ℂ)} M:A, then ; Δ ⊢_{DILL(ℂ)} Φ(M):A

2. If x_{1}:A_{1} … x_{r}:A_{r}; Δ ⊢_{DILL(ℂ)} u:A, then x_{1} :!A_{1} … x_{r} :!A_{r}, Δ ⊢_{ILL(ℂ)} Ψx⃗(u): A

3. If Δ ⊢_{ILL(ℂ)} M = N:A, then ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N):A

4. If x_{1} : A_{1} … x_{r}: A_{r}; Δ ⊢_{DILL(ℂ)} t = u: A, then x_{1} :!A_{1} … x_{r}: A_{r}, Δ ⊢_{ILL(ℂ)} Ψx⃗(t) = Ψx⃗(u):A

5. If Δ ⊢_{ILL(ℂ)} M:A, then Δ ⊢_{ILL(ℂ)} Ψ_{ε}(Φ(M)) = M:A

6. If ; Δ ⊢_{DILL(ℂ)} t:A, then ; Δ ⊢_{DILL(ℂ)} Φ(Ψ_{ε}(t)) = t:A

Given these lemmas, we can prove:

Theorem 1 (Equivalence) 1. Δ ⊢_{ILL(ℂ)} M = N:A iff ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N):A

2. ; Δ ⊢_{DILL(ℂ)} t = u:A iff Δ ⊢_{ILL(ℂ)} Ψ_{ε}(t) = Ψ_{ε}(u):A

Proof The two proofs are almost identical. Consider the first case. We already have the implication

Δ ⊢_{ILL(ℂ)} M = N:A implies ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N):A

Now assume ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N) : A. By lemma 2.4.1 (4), we have that Δ ⊢_{ILL(ℂ)} Ψ_{ε}(Φ(M)) = Ψ_{ε}(Φ(N)):A, but we also have by lemma 2.4.1 (5) that Δ ⊢_{ILL(ℂ)} Ψ_{ε}(Φ(M)) = M: A, and hence the other direction of the implication holds.

The proof of the second case uses the analogous results in lemma 2.4.1 (3) and 2.4.1 (6) □

We now proceed to give the details of the translations, and prove lemma 2.4.1, thereby showing that the results of theorem 1 hold.

From Intuitionistic Linear Logic to DILL

Now we can define the translation Φ from the intuitionistic linear type theory ILL(ℂ) to DILL(ℂ).

Definition 2.4.2 (The Translation Φ) On Types we define Φ to be the identity. On Pre-Terms we define Φ as follows:

Φ(x)  =  x
Φ(c)  =  c
Φ(∗)  =  ∗
Φ(let ∗ be M in N)  =  let ∗ be Φ(M) in Φ(N)
Φ(M ⊗ N)  =  Φ(M) ⊗ Φ(N)
Φ(let x ⊗ y be M in N) =  let x ⊗ y be Φ(M) in Φ(N)
Φ(λx.M)  =  λx.Φ(M)
Φ(MN)  =  Φ(M)Φ(N)
Φ(discard M in N)  =  let !x_{1} be Φ(M) in Φ(N)
Φ(copy M for x, y in N) = let !x_{1} be Φ(M) in Φ(N)[!x_{1}/x, y]
Φ(derelict(M)) = let !x_{1} be Φ(M) in x_{1}
Φ(promote M⃗ for x⃗ in N) = let !x⃗_{1} be Φ⃗(M) in !(Φ(N)[!x⃗_{1}/x⃗])

where in the last four rules x_{1} is a fresh variable from X.

Now we need to prove the lemma.

Lemma 2.4.1 (1) If Δ ⊢_{ILL(ℂ)} M:A, then ; Δ ⊢_{DILL(ℂ)} Φ(M):A.

Proof This proof is by induction over the structure of the term t. We give a summary proof only.

Axiom Instance: In this case, we have x:A ⊢ x:A, so that the translation is ; x:A ⊢ x:A, which is derivable.

Assumption and Unit-I In these cases there is almost nothing to show, as the corresponding typing rules in DILL(ℂ) are analogous. We note the requirement that we have the same constants in each type theory.

⊗-Introduction: We present this case as an example of the simple cases not involving the exponential. We have the derivation

\begin{matrix}Δ_{1} ⊢ M:A & Δ_{2} ⊢ N:B \\ Δ ⊢ M ⊗ N:A ⊗ B \end{matrix} (⊗ − I)

where Δ = Δ_{1}#Δ_{2}. By the inductive hypothesis, we have ; Δ_{1} ⊢ Φ(M):A, and ; Δ_{2} ⊢ Φ(N): A, so we have ; Δ ⊢ Φ(M) ⊗ Φ(N):A ⊗ B via the ⊗-introduction rule of DILL(ℂ). But Φ(M ⊗ N) = Φ(M) ⊗ Φ(N), so we are done.

⊗-E,⊸-I and ⊸-E: Again these rules in ILL(ℂ) are exactly parallelled in DILL(ℂ).

Weakening Rule: In this case, we have the derivation

Δ_{2} ⊢ M :!A Δ_{1} ⊢ N:B Δ ⊢ discard M in N:B

where Δ = Δ_{1}#Δ_{2}. By intuitionistic weakening and our inductive hypothesis, in DILL(ℂ) we have x_{1} : A; Δ_{1} ⊢ Φ(N) : B. Now one application of our !-E rule gives us ; Δ ⊢ let !x_{1} be Φ(M) in Φ(N) : B, but Φ(discard M in N) is precisely let !x_{1} be Φ(M) in Φ(N).

Contraction: In this case, we have the derivation in ILL(ℂ):

Δ_{1} ⊢ M :!A Δ_{2}, x :!A, y :!A ⊢ N:B
Δ ⊢ copy M for x, y in N:B

where Δ = Δ_{1}#Δ_{2}. Now by the inductive hypothesis, in DILL(ℂ) we have the derivations:

; Δ_{1} ⊢ Φ(M) :!A

and

; Δ_{2}, x :!A, y :!A ⊢ Φ(N):B

But now, using the substitution lemmas of DILL(ℂ) and the !-I,E pair, we have the following derivation:

; Δ ⊢ let !x_{1} be Φ(M) in Φ(N){!x_{1}/x, y}:B

which proves the case.

Dereliction: In this case we have the derivation

Δ ⊢ M :!A Δ ⊢ derelict M :A

in ILL(ℂ). Using the inductive hypothesis, we have in DILL(ℂ) that

; Δ ⊢ Φ(M) :!A

so using one instance of !-E and an intuitionistic axiom, we have

; Δ ⊢ let !x_{1} be Φ(M) in x_{1}:A

as required.

Promotion Rule: The derivation here is

i = 1..r Δ_{i} ⊢ M_{i} :!A_{i} x_{1} :!A_{1} … x_{r} :!A_{r} ⊢ N:B
Δ ⊢ promote M⃗ for x⃗ in N:B

where Δ = Δ_{1}# … #Δ_{r}. By the substitution lemma and the inductive hypothesis, we have y_{1} : A_{1} … y_{r} : A_{r}; ⊢ Φ(N){!y⃗/x⃗}:B. Hence, by the promotion rule of DILL(ℂ), we have

y_{1}:A_{1} … y_{r}:A_{r}; ⊢!Φ(N){!y⃗/x⃗} :!B

We also have by induction ; Δ_{i} ⊢ Φ(M_{i}) :!A_{i} for each i = 1..r. Hence, by r applications of the !-E rule, we have

; Δ_{i} ⊢ let !y⃗ be Φ⃗(M) in !Φ(N){!y⃗/x⃗}:B

This is precisely what is given in the translations. □

We now give one auxiliary lemma:

Lemma 2.4.3 We have that for terms Δ_{1}, x:A ⊢ M:B and Δ_{2} ⊢ N:A of ILL(ℂ),

; Δ ⊢ Φ(M{N/x}) = Φ(M){Φ(N)/x}:B

where Δ = Δ_{1}#Δ_{2}.

This is easily proved by induction over the first term, M, and we leave it to the reader.

We now prove the lemma on derivable equality judgements.

Lemma 2.4.1 (3) If Δ ⊢_{ILL(ℂ)} M = N:A, then ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N):A.

Proof This is proved by induction over the derivation of the derivable equality judgement Δ ⊢ M = N : A in ILL(ℂ). First we consider all the one-step derivations, ie axioms. However, since there are a large number of these, most of which are identical to those already given in DILL(ℂ), we give the proof only for the substantially different ones, that is the exponential axioms. It is routine for the other equality axioms and the reflexivity, symmetry and transitivity rules. In the following, we show it for the exponential axioms based on the numbering given in the definition of the equality judgement of ILL(ℂ). We omit contexts and types for equality judgements in this proof for brevity, as they will always be reconstructible from those present in the relevant axiomatic equality.

1): In this case, the image of the left-hand side is

let !y be (let !z be Φ⃗(M) in !Φ(N){!z⃗/x⃗}) in y

This is equivalent by a commuting conversion (since w and z_{i} are fresh) to

let !z be Φ⃗(M) in (let !y be !Φ(N){!z⃗/x⃗} in y)

However, (let !y be !Φ(N){!z⃗/x⃗} in y) = Φ(N){!z⃗/x⃗}. Hence the image of the left-hand side of the equality is

let !z be Φ⃗(M) in (Φ(N){!z⃗/x⃗})

But now by commuting conversions and η-equality, this is equal to Φ(N){Φ⃗(M)/x⃗}, which is the image of the right-hand side of the equality.

2): In this case, the image of the left-hand side is:

let !y be (let !z be Φ⃗(M) in !Φ(N){!z⃗/x⃗}) in Φ(N′)

This is equivalent by a commuting conversion (since y and z_{i} are fresh) to

let !z be Φ⃗(M) in (let !y be !Φ(N){!z⃗/x⃗} in Φ(N′))

We know, however, that y does not occur in Φ(N′), as it is fresh, so this is equal to let !z be Φ⃗(M) in Φ(N′), which is precisely the image of the righthand side.

3): In this case, the image of the left-hand side is:

let !y be Φ(M) in !(let !z be !y in z)

which is β-equal to

let !y be Φ(M) in !y

which is η-equal to the image of the right-hand side.

4): In this case, the image of the left-hand side is:

let !z be Φ(M) in Φ(N){!z/x, y}

which is easily seen to be the image of the right-hand side by analogous reasoning.

5): In this case the image of the left-hand side is

let !z be Φ(M) in (let !z′ be x in Φ(N)){!z/x, y}

which is equal to

let !z be Φ(M) in (let !z′ be !z in Φ(N)){!z/y}

but by one β-equality this is

let !z be Φ(M) in Φ(N){!z/y}

so we can now see that via commuting conversions and an η-equality this is Φ(N){Φ(M)/y}, which is the image of the right-hand side.

6): In this case the left hand side of the equality has image

let !z be Φ(M) in (let !z′ be y in Φ(N){!z′/x′, y′}){!z/x, y}

but this is equal to

let !z be Φ(M) in (let !z′ be !z in Φ(N){!z′/x′, y′}){!z/x}

However, by a β-equality this is equal to

let !z be Φ(M) in Φ(N){!z/x, y′, x′}

and by a similar process we can see that the image of the right-hand side is also equal to this term.

7): In this case, the image of the left-hand side is:

let !z′,!z⃗ be Φ(M′), Φ⃗(M) in !(let !z′′ be x′ in Φ(N)){!z′,!z⃗/x′, x⃗}

which is

let !z′,!z⃗ be Φ(M′), Φ⃗(M) in !(let !z′′ be !z′ in Φ(N)){!z⃗/x⃗}

which is β-equal to

let !z′,!z⃗ be Φ(M′), Φ⃗(M) in !(Φ(N)){z′,!z⃗/z′′, x⃗}

This is

let !z′ be Φ(M′) in (let !z⃗ be Φ⃗(M) in !Φ(N){z′,!z⃗/z′′, x⃗})

but we know that z′′ does not occur in Φ(N), so this is

let !z′ be Φ(M′) in (let !z⃗ be Φ⃗(M) in !Φ(N){!z⃗/x⃗})

which is the image of the right-hand side. 8): In this case, the image of the left-hand side is:

let !z′ be (let !z⃗ be Φ⃗(M) in !Φ(N){!z⃗/x⃗}) in Φ(N′){!z′/y_{1}, y_{2}} This is equivalent, again by a commuting conversion, to

let !z⃗ be Φ⃗(M) in (let !z′ be !Φ(N){!z⃗/x⃗} in Φ(N′){!z′/y_{1}, y_{2}}) Now this is β-equal to

let !z⃗ be Φ⃗(M) in (!Φ(N){!Φ(N′){!z⃗/x⃗}/y_{1}, y_{2}})

But !Φ(N){!Φ(N′){!z⃗/x⃗}/y_{1}, y_{2}} is β-equal to

!Φ(N){let !z⃗′′ be !z⃗ in !Φ(N′){!z⃗′′/x⃗}/y_{1}, y_{2}}

And this in turn is the same as

!Φ(N){(let !z⃗′′ be x⃗′ in !Φ(N′){!z⃗′′/x⃗}), (let !z⃗′′ be x⃗′′ in !Φ(N′){!z⃗′′/x⃗})/y_{1}, y_{2}}{!z⃗/x⃗′, x⃗′′}

which is Φ(N{(promote x⃗′ for x⃗ in N′), (promote x⃗′′ for x⃗ in N′)/y_{1}, y_{2}}{!z⃗/x⃗′, x⃗′′}) Therefore, the image of the left-hand side is

let !z⃗′′ be Φ⃗(M) in

(Φ(N{(promote x⃗′ for x in N′), (promote x⃗′′ for x in N′)/y_{1}, y_{2}}{!z⃗′′/x⃗′, x⃗′′})) But this is precisely the image of the right-hand side, so we are done.

9): In this case, the image of the left-hand side is:

let !z′,!z⃗ be Φ(M′), Φ⃗(M) in !(let !z′′ be !z′ in Φ(N){!z′′/y_{1}, y_{2}}){!z⃗/x⃗} This is

let !z′,!z⃗ be Φ(M′), Φ⃗(M) in !(let !z′′ be !z′ in Φ(N){!z′′/y_{1}, y_{2}}{!z⃗/x⃗}) which is β-equal to

let !z′,!z⃗ be Φ(M′), Φ⃗(M) in !(Φ(N){!z′/y_{1}, y_{2}}{!z⃗/x⃗})

and this is equal to

let !z′ be Φ(M′) in (let !z⃗ be Φ⃗(M) in !(Φ(N){!z′/y_{1}, y_{2}}{!z⃗/x⃗})) But this is η-equal to the translation of the right-hand side.

10): The image of the left-hand side of this equality is let !z′,!z⃗′′ be (let !z⃗′′′ be y⃗_{1} in !Φ(M)[!z⃗′′′/x⃗_{1}]), y⃗_{2} in !Φ(N){!z′,!z⃗′′/x′, x⃗_{2}} By commuting conversions this is equal to let !z⃗′′′ be y⃗_{1} in (let !z′,!z⃗′′ be !Φ(M){!z⃗′′′/x⃗_{1}}, w⃗ in !Φ(N){!z′1,!z⃗′′/x′, x⃗_{2}}) This then is η-equal to

let !z⃗′′′ be y⃗_{1} in (let !z⃗′′ be y⃗_{2} in !Φ(N){!Φ(M){!z⃗′′′/x⃗_{1}},!z⃗′′/x′, x⃗_{2}}) This is abbreviated to

let !z⃗′′′,!z⃗′′ be y⃗_{1}, , y⃗_{2} in (!Φ(N){!Φ(M){!z⃗′′′/x⃗_{1}},!z⃗′′/x′, x⃗_{2}}) But by an η-equality this is equal to let !z⃗′′′,!z⃗′′ be y⃗_{1}, y⃗_{2} in (!Φ(N){(let !z⃗′′′′ be !z⃗′′′ in !Φ(M){!z⃗′′′′/x⃗_{1}}),!z⃗′′/x′, x⃗_{2}}) and this can be written as let !z⃗′′′,!z⃗′′ be y⃗_{1}, y⃗_{2} in (!Φ(N){(let !z⃗′′′′ be !z⃗ in !Φ(M){!z⃗′′′′/x⃗_{1}})/x′}){!z⃗′′′,!z⃗′′/z⃗, x⃗_{2}} But now this is the image of the right-hand side.

□

From DILL (ℂ) to ILL(ℂ)

For each term of DILL(ℂ) x_{1} : A_{1} … x_{r} : A_{r}; Δ ⊢ t : A, we give a term x_{1} : !A_{1} … x_{r} :!A_{r}, Δ ⊢ Ψx⃗(t):A in ILL(ℂ).

Definition 2.4.4 (The Translation Ψ) On Types define Ψ as the identity. On Terms define Ψ as follows:

Ψy⃗(x:A) = \begin{cases}discard y⃗_{1}y⃗_{2} in derelict(x) & if y⃗ = y⃗_{1}xy⃗_{2} \\ discard y⃗ in x & otherwise \end{cases}
Ψy⃗(c) = discard y⃗ in c
Ψy⃗(∗) = discard y⃗ in ∗
Ψy⃗(let ∗ be t in u) = copy y⃗ for y⃗_{1}, y⃗_{2} in (let ∗ be Ψy⃗_{1}(t{y⃗_{1}/y⃗}) in Ψy⃗_{2}(u{y⃗_{2}/y⃗}))
Ψy⃗(t ⊗ u) = copy y⃗ for y⃗_{1}, y⃗_{2} in Ψy⃗_{1}(t{y⃗_{1}/y⃗}) ⊗ Ψy⃗_{2}(u{y⃗_{2}/y⃗})
Ψy⃗(let x_{1} ⊗ x_{2} be t in u) = copy y⃗ for y⃗_{1}, y⃗_{2} in p_{1}

where p_{1} = let x_{1} ⊗ x_{2} be Ψy⃗_{1}(t{y⃗_{1}/y⃗}) in Ψy⃗_{2}(u{y⃗_{2}/y⃗})

Ψy⃗(λx.t) = λx.Ψy⃗(t)
Ψy⃗(tu) = copy y⃗ for y⃗_{1}, y⃗_{2} in Ψy⃗_{1}(t{y⃗_{1}/y⃗})Ψy⃗_{2}(u{y⃗_{2}/y⃗})
Ψy⃗(!t) = promote y⃗ for y⃗_{1} in Ψy⃗_{1}(t{y⃗_{1}/y⃗})
Ψy⃗(let !x be t in u) = copy y⃗ for y⃗_{1}, y⃗_{2} in Ψ_{y⃗_{2}x}(u{y⃗_{2}/y⃗}){Ψy⃗_{1}(t{y⃗_{1}/y⃗})/x}

where y⃗_{1} and y⃗_{2} are vectors of fresh variables.

We first make an abbreviation; given a sequence of types A⃗ = A_{1} … A_{r}, we will write !A⃗ for !A_{1} …!A_{r}. Similarly, given a sequence of typings Γ = x_{1} :A_{1} … x_{r}: A_{r}, we will write !Γ for x_{1}:!A_{1} … x_{r}:!A_{r}.

Lemma 2.4.1 (2) If Γ; Δ ⊢_{DILL(ℂ)} t:A, then !Γ, Δ ⊢_{ILL(ℂ)} Ψy⃗(t):A.

Proof This is proved by induction over the first derivation. We leave most of this proof, as it is routine, but we consider the tensor introduction as a sample case, and also the rules for ! as they are significantly different.

Tensor Introduction We have in this case that there is a deduction in DILL(ℂ)

\begin{matrix}Γ; Δ_{1} ⊢ u:A & Γ; Δ_{2} ⊢ v:B \\ Γ; Δ ⊢ u ⊗ v:A ⊗ B \end{matrix}

where Δ = Δ_{1}#Δ_{2}. By the inductive hypothesis we have that there exist derivations in ILL(ℂ) (using some α-conversion, and assuming that Γ = y⃗: C⃗):

y⃗_{1} :!C⃗, Δ_{1} ⊢ Ψy⃗_{1}(u{y⃗_{1}/y⃗}):A ⊗ B

and

y⃗_{2} :!C⃗, Δ_{2} ⊢ Ψy⃗_{2}(v{y⃗_{2}/y⃗}):A ⊗ B

Now we have by the tensor introduction in ILL(ℂ)

y⃗_{1} :!C⃗, y⃗_{2} :!C⃗, Δ ⊢ Ψy⃗_{1}(u{y⃗_{1}/y⃗}) ⊗ Ψy⃗_{2}(v{y⃗_{2}/y⃗}):A ⊗ B

But by a sequence of copies, we can now obtain:

!Γ, Δ ⊢ copy y⃗ for y⃗_{1}, y⃗_{2} in Ψy⃗_{1}(u{y⃗_{1}/y⃗}) ⊗ Ψy⃗_{2}(v{y⃗_{2}/y⃗}):A ⊗ B

which is precisely the image of the tensor. In fact, the technique of modelling the shared intuitionistic context with repeated contractions accounts for all of the copy constructs in the definition of Ψ.

!-Introduction In this case, we have the following deduction in DILL(ℂ):

{Γ; ⊢ t:A \atop Γ; ⊢!t :!A}

By the inductive hypothesis, we have a derivation in ILL(ℂ)(using some α-conversion)

y⃗′ :!B⃗ ⊢ Ψy⃗′(t{y⃗′/y⃗}):A

where Γ = y⃗:B⃗. Now by one use of promotion, we have

!Γ ⊢ promote y⃗ for y⃗′ in Ψy⃗′(t{y⃗′/y⃗}) :!A

which is precisely the image of !t.

!-Elimination In this case, we have the following derivation in DILL(ℂ).

Γ; Δ_{1} ⊢ t :!A Γ, x:A; Δ_{2} ⊢ u:B
Γ; Δ ⊢ let !x be t in u:B

where Δ = Δ_{1}#Δ_{2}. Hence again by the inductive hypothesis we have the following derivations in ILL(ℂ) (using some α-conversion:

y⃗_{1} :!C⃗, Δ_{1} ⊢ Ψy⃗_{1}(t{y⃗_{1}/y⃗}) :!A

where Γ = y⃗:C⃗, and

y⃗_{2} :!C⃗, x :!A, Δ ⊢ Ψy⃗_{2}(u{y⃗_{2}/y⃗}):B

Now by the admissible cut rule in ILL(ℂ) we have

y⃗_{1} :!C⃗, y⃗_{2} :!C⃗, Δ ⊢ Ψy⃗_{2}(u{y⃗_{2}/y⃗}){Ψy⃗_{1}(t{y⃗_{1}/y⃗})/x}:B

Now by the familiar series of contractions, we have

!Γ, Δ ⊢ copy y⃗ for y⃗_{1}, y⃗_{2} in Ψy⃗_{2}(u{y⃗_{2}/y⃗}){Ψy⃗_{1}(t{y⃗_{1}/y⃗})/x}:B
□

We now give auxiliary lemmas relating intuitionistic and linear substitutions in DILL(ℂ) to substitution in ILL(ℂ).

Lemma 2.4.5 (Linear Substitution) If we consider the substitution:

Γ; Δ_{1}, x:A ⊢_{DILL(ℂ)} t:B Γ; Δ_{2} ⊢_{DILL(ℂ)} u:A
Γ; Δ_{1}, Δ_{2} ⊢_{DILL(ℂ)} t[u/x]:B

where Γ = y⃗:C⃗, then

Ψy⃗(t[u/x]) = copy y⃗ for y⃗_{1}, y⃗_{2} in Ψy⃗_{1}(t{y⃗_{1}/x⃗}){Ψ(u)y⃗_{2}{y⃗_{2}/x⃗}/x}

Lemma 2.4.6 (Intuitionistic Substitution) If we consider the substitution:

Γ, x:A; Δ ⊢_{DILL(ℂ)} t:B Γ; ⊢_{DILL(ℂ)} u:A
Γ; Δ ⊢_{DILL(ℂ)} t[u/x]:B

where Γ = y⃗:C⃗, then we have that

Ψy⃗(t[u/x]) = copy y⃗ for y⃗_{1}, y⃗_{2} in Ψ_{y⃗_{1},x}(t{y⃗_{1}/y⃗}){promote y⃗_{2} for y⃗_{3} in Ψy⃗_{3}(u{y⃗_{3}/y⃗})/x}

These are both routine inductions over the structure of the first term, and are left to the reader.

Now we can prove the equality lemma:

Lemma 2.4.1.4 If Γ; Δ ⊢_{DILL(ℂ)} t = u: A, then !Γ, Δ ⊢_{ILL(ℂ)} Ψy⃗(t) = Ψy⃗(u) : A where Γ = y⃗:A⃗.

Proof This is proved again by induction over the length of the derivation of equality in DILL(ℂ). We consider only the exponential equalities, as it is easy but time-consuming to show that the other components of the equality rule system over DILL(ℂ) correspond to equalities on ILL(ℂ).

!-β This equality is:

Γ; Δ ⊢ let !x be !u in v = v{u/x}:A

The image of the left-hand side of this is:

copy y⃗ for y⃗_{1}, y⃗_{2} in Ψy⃗_{1}(v[y⃗_{1}/y⃗])[promote y⃗_{2} for y⃗_{3} in Ψy⃗_{3}(u[y⃗_{3}/y⃗]/x])

assuming that Γ = y⃗:C⃗. But this is just the image of intuitionistic substitution in ILL(ℂ).

!-η This equality is

Γ; Δ ⊢ let !x be t in !x = t:!A

The image of the left-hand side is

copy y⃗ for y⃗_{1}, y⃗_{2} in (discard y⃗_{2} in promote x for x′ in derelict x′ ){Ψy⃗_{1}(t{y⃗_{1}/y⃗})/x}

assuming that Γ = y⃗: B⃗. By equality (5) of ILL(ℂ) we have that this is precisely

copy y⃗ for y⃗_{1}, y⃗_{2} in (discard y⃗_{2} in Ψy⃗_{1}(t{y⃗_{1}/y⃗}))

However, using equality (7) this is just Ψy⃗(t)

Commuting Conversions are dealt with easily, as they translate to the commuting conversions in ILL(ℂ). □

Lemma 2.4.1.5 For any term Δ ⊢_{ILL(ℂ)} M: A of ILL, Δ ⊢_{ILL(ℂ)} Ψ_{ε}(Φ(M)) =_{A} M.

Proof We note first that the translation Φ is effectively the identity on terms other than those containing the exponential constructors. Moreover, since Φ translates sequents to sequents derivable from no intuitionistic assumptions, applying Ψ to these sequents gives the identity (as we need no copy or discard constructs). Hence we know that Ψ(Φ(t)) is the identity except perhaps on terms involving the exponential constructors.

We prove that the translation satisfies the property above by consideration of the structure of t. We consider only the exponential cases. derelict: In this case, we have that M has the form derelict(N), and hence that

Φ(M) has the form let !z be Φ(N) in z. This must have the following derivation in DILL(ℂ):

z:A; ⊢ z:A ; Δ ⊢ Φ(N) :!A
; Δ ⊢ let !z be Φ(N) in z:A

The translation Ψ takes this derivation to

z :!A ⊢ derelict (z):A Δ ⊢ Ψ⟨⟩(Φ(N)) :!A

Ψ(Δ) ⊢ derelict (z){Ψ_{ε}(Φ(N))/z}:A

which is derelict(Ψ_{ε}(Φ(u))), but this is βη-equal to derelict (u) by the inductive hypothesis.

discard: In this case, M has the form discard N in N′, so that Φ(M) is let !z be Φ(N) in Φ(N′). This must have the following derivation in DILL(ℂ):

; Δ_{1} ⊢ Φ(N) :!A z:A; Δ_{2} ⊢ Φ(N′):B
; Δ ⊢ let !z be Φ(N) in Φ(N′):B

where Δ = Δ_{1}#Δ_{2}. Ψ applied to this derivation gives the following:

z :!A, Δ_{1} ⊢ discard z in Ψ_{ε}(Φ(N′)):B Δ_{2} ⊢ Ψ_{ε}(Φ(N)) :!A
Δ ⊢ discard z in (Ψ_{ε}(Φ(N′))){Ψ_{ε}(Φ(N))/z}:B

but since z does not occur in Φ(N′) and hence in Ψ_{ε}(Φ(N′)), this is precisely discard Ψ_{ε}(Φ(N)) in (Ψ_{ε}(Φ(N′))) which is βη-equal to discard N in N′ by hypothesis.

copy: Here, Φ(M) has the form let !z be Φ(N) in Φ(N′){!z/x, y}, and therefore has the derivation:

z:A; Δ_{1} ⊢ Φ(N′){!z/x, y}:B ; Δ_{2} ⊢ Φ(N) :!A
; Δ ⊢ let !z be Φ(N) in Φ(N′){!z/x, y}:B

Under Ψ, this derivation becomes

z :!A, Δ_{1} ⊢ copy z for x, y in Ψ_{ε}(Φ(N′)):B Δ_{2} ⊢ Ψ_{ε}(Φ(N)) :!A
Δ ⊢ copy z for x, y in Ψ_{ε}(Φ(N′)){Ψ_{ε}(Φ(N))/z}:B

which is copy Ψ_{ε}(Φ(N)) for x, y in Ψ_{ε}(Φ(N′)), which is by hypothesis equal to copy N for x, y in N′, or M.

promote: In this case, M has the form promote N⃗ for x⃗ in N′. Hence Φ(M) is let !z⃗ be Φ(N⃗) in !Φ(N′){!z⃗/x⃗}.

This has the derivation

z⃗:A⃗; ⊢!Φ(N′)[!z⃗/x⃗]:B ; Δ_{i} ⊢ Φ(N_{i}) :!A_{i} (i = 1 … r)

; Δ ⊢ let !z⃗ be Φ⃗(N) in !Φ(N′){!z⃗/x⃗}:B

where Δ = Δ_{1}# … #Δ_{r}. When Ψ is applied, this becomes z⃗ : !A ⊢ promote z⃗ for x⃗ in Ψ_{ε}(Φ(N′)):B Δ_{i} ⊢ Ψ_{ε}(Φ(N_{i})) :!A_{i} (i = 1 … r) Δ ⊢ (promote z⃗ for x⃗ in Ψ_{ε}(Φ(N′))){Ψ_{ε}(Φ(N_{1})) … Ψ_{ε}(Φ(N_{r}))/z_{1} … z_{r}}:B but this final term is just promote Ψ⃗_{ε}(Φ(N)) for x⃗ in Ψ_{ε}(Φ(N′)), which is equal to the original term by induction.

We can prove an analogous lemma for the alternative direction: Lemma 2.4.1 )(6) For any term ; Δ ⊢ t:A of DILL(ℂ), ; Δ ⊢ Φ(Ψ_{ε}(t)) = t:A.

This is easily proved in the same manner as the previous lemma. Now by virtue of the proof at the beginning of this section, we have the results:

Theorem 1.1 Δ ⊢_{ILL(ℂ)} M = N:A iff ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N):A Theorem 1.2 ; Δ ⊢_{DILL(ℂ)} t = u:A iff Δ ⊢_{ILL(ℂ)} Ψ_{ε}(t) = Ψ_{ε}(u):A

The Semantics of DILL

We now show that DILL(ℂ) can be soundly and completely mapped into a class of models for linear logic. By this we mean that we can map terms Γ; Δ ⊢ t:A to morphisms in the model in such a way that the Γ; Δ terms t and u of type A are judged to be equal Γ; Δ ⊢ t = u : A if and only if the interpretations of the derivations are equal in every model of the class.

The models we will consider are based on linear-non-linear models, which were introduced by Benton [Ben95a] and studied by Bierman [Bie95]. These are pairs of categories (C, S) such that C is a CCC and S is a SMCC and there is a monoidal adjunction between them. The intention behind the construction is that the normal power of intuitionistic logic, arising from the exponential, should be modelled in the CCC, with the intuitionistic linear logic being as usual modelled in the SMCC. This idea emerged in 1993 from discussions between a number of people, including Plotkin, Benton and Hyland. However, it was only during further work by Benton [Ben95a] that the details became clear, and in particular that it was necessary to impose the requirement that the adjunction be monoidal. In [Ben94] there is an extensive comparison between these models and the previously proposed models [BBdPH93b]. In fact, although Benton required that the cartesian category be closed, this is not essential for our purposes, and we take the more general definition.

3.1 The Interpretation

We will make extensive use of the primitive categorical definitions in appendix A.2, and in particular will refer to equations there using their numbers with no further comment.

The carrier of a DILL(ℂ)-model is a quadruple (C, S, F, G), such that C is a CC, S is a SMCC and F ⊣ G : C → S is a strong monoidal functor. We will write un for the unit of the monoidal adjunction, and nu for its counit.

Definition 3.1.1 (DILL(ℂ)-Model) A DILL(ℂ)-model, which we will write L, is a carrier (C, S, F, G) together with a primitive interpretation function [[ ]]_{P_{L}}^{L} : P_{L} → obj(S) and a morphism [[c]]_{C}^{L} ∈ S(I, [[A]]) for each constant c:A in C, where the interpretation function is extended to arbitrary types in the obvious way, as defined shortly.

Where the particular model we are referring to is clear, we may omit the superscript L on the interpretation [[ ]]^{L}.

We now make some definitions to simplify the interpretation. For a sequence of objects in the category S, X⃗ = X_{1} … X_{r}, we define ⨂ X⃗ to be the left-bracketed tensor of this sequence, ⊗X⃗ = (..(X_{1} ⊗ X_{2}) ⊗ … X_{r}) Also, for a sequence of typings x⃗:A⃗, we define !(x⃗:A⃗) = x⃗ :!A⃗.

Given a DILL(ℂ)-model L over signature (P_{L}, C), we now define an interpretation [[ ]]^{L} which takes the types and typing contexts of DILL(ℂ) to objects in S, and takes the terms of DILL(ℂ) to morphisms in S.

Definition 3.1.2 (The Interpretation on Types and Contexts) On Types We define [[ ]]^{L} on types as follows:

\begin{aligned}[[l]] & = & [[l]]_{P_{L}} for l ∈ P_{L} \\ [[I]] & = & I \\ [[A ⊗ B]] & = & [[A]] ⊗ [[B]] \\ [[A ⊸ B]] & = & [[A]] ⊸ [[B]] \\ [[!A]] & = & F G([[A]]) \end{aligned}

On Typing Contexts We extend this firstly to sequences of types by saying that [[A_{1} … A_{r}]] = ⨂([[A_{1}]] … [[A_{r}]]). We then say that for a sequence of typings Δ, [[Δ]] = [[|Δ|]]. We then extend the definition to typing contexts by saying that for a typing context Γ; Δ, [[Γ; Δ]] = [[!|Γ|, |Δ|]].

We can now define some context-manipulation arrows, using the structure we have in the model.

Define

perm_{A,B,A′,B′} :(A ⊗ B) ⊗ (A′ ⊗ B′) → (A ⊗ A′) ⊗ (B ⊗ B′)
mge_{Δ,Δ_{1},Δ_{2}} :[[Δ]] → [[Δ_{1}, Δ_{2}]] where Δ = Δ_{1}#Δ_{2}
sep_{Δ_{1},Δ_{2}} :[[Δ_{1}, Δ_{2}]] → [[Δ_{1}]] ⊗ [[Δ_{2}]]
dup_{Γ} :[[!|Γ|]] → [[!|Γ|]] ⊗ [[!|Γ|]]
split_{Γ,Δ,Δ_{1},Δ_{2}} :[[Γ; Δ]] → [[Γ; Δ_{1}]] ⊗ [[Γ; Δ_{2}]] where Δ = Δ_{1}#Δ_{2}
disc_{Γ} :[[!|Γ|]] → I
prom_{Γ} :[[Γ; ]] →![[Γ; ]]

61

as follows:

perm_{A,B,A′,B′} = a_{A,B,A′⊗B′}; (id_{A} ⊗ a_{B,A′,B′}^{−1}); (id_{A} ⊗ (s_{B,A′} ⊗ id_{[[B′]]}));
(id_{A} ⊗ a_{A′,B,B′}); a_{A,A′,B⊗B′)}^{−1}

mge_{Δ,Δ_{1},Δ_{2}} = \begin{cases}sep_{x:A,Δ′}; & (id_{[[A]]} ⊗ mge_{Δ′,Δ′_{1},Δ_{2}}); sep_{x:A,(Δ′_{1},Δ_{2})}^{−1} \\ & if Δ = x:A, Δ′ and Δ_{1} = x:A, Δ′_{1} \\ sep_{x:A,Δ′}; & (id_{[[A]]} ⊗ mge_{Δ′,Δ_{1},Δ′_{2}}); (id_{[[A]]} ⊗ sep_{Δ_{1},Δ′_{2}}); \\ & a_{[[A]],[[Δ_{1}]],[[Δ′_{2}]]}; (s_{[[A]],[[Δ_{1}]]} ⊗ id_{Δ′_{2}})(sep_{Δ_{1},A}^{−1} ⊗ id_{Δ′_{2}}); sep_{(Δ_{1},A),Δ′_{2}}^{−1} \\ & if Δ = x:A, Δ′ and Δ_{2} = x:A, Δ′_{2} \\ id_{I} & if Δ = Δ_{1} = Δ_{2} = \end{cases}

sep_{Δ_{1},Δ_{2}} = \begin{cases}(sep_{Δ_{1},Δ′_{2}} ⊗ id_{[[A]]}); a_{[[Δ_{1}]],[[Δ_{2}]],[[A]]}; \\ id_{[[Δ_{1}]]} ⊗ sep_{Δ′_{2},A}^{−1}) & where Δ_{1} ≠ and Δ_{2} = x:A, Δ′_{2} \\ ri_{[[Δ_{2}]]}^{−1} & if Δ_{1} = \\ li_{[[Δ_{1}]]}^{−1} & if Δ_{2} = \end{cases}

dup_{Γ} = \begin{cases}dup_{Γ′,x:A} ⊗ (F (c_{G[[B]]}); m_{G[[B]],G[[B]]}^{−1}); \\ perm_{!(Γ′,x:A),!(Γ′,x:A),y:!B,y:!B} & if Γ = Γ′, x : A, y : B \\ F (c_{G[[A]]}); m_{G[[A]],G[[A]]}^{−1} & if Γ = x:A \\ ri_{I} & if Γ = \end{cases}

split_{Γ,Δ,Δ_{1},Δ_{2}} = sep_{!Γ,Δ}; (dup_{Γ} ⊗ mge_{Δ,Δ_{1},Δ_{2}}); (id_{[[Γ]]⊗[[Γ]]} ⊗ sep_{Δ_{1},Δ_{2}})
; perm_{[[!Γ]],[[!Γ]],[[Δ_{1}]],[[Δ_{2}]]}; (sep_{!Γ,Δ_{1}}^{−1} ⊗ sep_{!Γ,Δ_{2}}^{−1})
disc_{Γ} = \begin{cases}disc_{Γ′,y:B} ⊗ (F (d_{G[[A]]}); mi^{−1}); ri_{I}^{−1} & if Γ = Γ′, y:B, x:A \\ F (d_{G[[A]]}); mi^{−1} & if Γ = x:A \\ id_{I} & if Γ = \end{cases}

prom_{Γ} = \begin{cases}prom_{Γ′,y:B} ⊗ F (un_{G[[A]]}) & if Γ = Γ′, y:B, x:A \\ F (un_{G[[A]]}) & if Γ = x:A \\ mi & if Γ = \end{cases}

where m_{X,Y} and mi are the monoidality natural transformations for the functor F G.

The interpretation will take a term Γ; Δ ⊢ t:A to an arrow

[[Γ; Δ ⊢ t:A]] : [[Γ; Δ]] → [[A]]

in the SMCC part of L.

Definition 3.1.3 (The Interpretation on Sequents) First we recall that given a Γ; Δ term t of type A, there is a unique derivation of the typing judgement Γ; Δ ⊢ t: A. We now define [[ ]]^{L} inductively over the structure of this unique derivation as follows:

Linear Axiom Here we have:

[[Γ; x:A ⊢ x:A]] : [[Γ; A]] → [[A]]

= sep_{,!Γ,A}; (disc_{Γ} ⊗ id_{[[A]]}); ri_{[[A]]}

Intuitionistic Axiom Here, we have

[[Γ, x:A, Γ′; ⊢ x:A]] : [[Γ, A, Γ′; ]] → [[A]]
= sep_{(!Γ,x:!A),!Γ′}; (sep_{(!Γ),!x:A} ⊗ id_{[[!Γ′]]});((disc_{Γ} ⊗ der_{A}) ⊗ disc_{Γ′}); li_{I⊗[[A]]}; ri_{[[A]]}

Constant Axiom Here. we have

[[Γ; ⊢ c:A]] : [[Γ; ]] → [[A]]
=disc_{Γ}; [[c]]_{C}

I-introduction Here we have:

[[Γ; ⊢ ∗:I]] : [[Γ; ]] → [[I]]

= disc_{Γ}

I-elimination We need to interpret the derivation

Γ; Δ_{1} ⊢ t:I Γ; Δ_{2} ⊢ u:A
Γ; Δ ⊢ let ∗ be t in u:A

where Δ = Δ_{1}#Δ_{2}. In this case, we have arrows

f : [[Γ; Δ_{1}]] → [[I]]
g : [[Γ; Δ_{2}]] → [[A]]

Hence we have

[[Γ; Δ ⊢ let ∗ be t in u:A]] : [[Γ; Δ]] → [[A]]
=split_{Γ,Δ,Δ_{1},Δ_{2}}; (f ⊗ g); ri_{[[A]]}

⊗-introduction The rule is:

\begin{matrix}Γ; Δ_{1} ⊢ t:A & Γ; Δ_{2} ⊢ u:B \\ Γ; Δ ⊢ t ⊗ u:A ⊗ B \end{matrix}

where Δ = Δ_{1}#Δ_{2}. Using the premises, we already have arrows

f : [[Γ; Δ_{1}]] → [[A]]
g : [[Γ; Δ_{2}]] → [[B]]

Hence we have

[[Γ; Δ ⊢ t ⊗ u:A ⊗ B]] : [[Γ; Δ]] → [[A ⊗ B]]
=str_{Γ,Δ,Δ_{1},Δ_{2}}; (f ⊗ g)

⊗-Elimination The rule is

Γ; Δ_{1} ⊢ u:(A ⊗ B) Γ; Δ_{2}, x:A, y:B ⊢ t:C

Γ; Δ ⊢ let x ⊗ y be u in t:C

where Δ = Δ_{1}#Δ_{2}. We have arrows:

f : [[Γ; Δ_{1}]] → [[A ⊗ B]]
g : [[Γ; Δ_{2}, A, B]] → [[C]]

Hence we have

[[Γ; Δ ⊢ let x ⊗ y be u in t:C]] :[[Γ; Δ]] → [[C]]
=split_{Γ,Δ,Δ_{2},Δ_{1}}; (id_{[[Γ;Δ_{2}]]} ⊗ f); sep_{(!Γ,Δ_{2}),(A⊗B)}^{−1}; g

⊸-introduction The rule is as follows:

{Γ; Δ, x:A ⊢ t:B \atop Γ; Δ ⊢ λx.t:A ⊸ B}

so we have an arrow:

f : [[Γ; Δ, A]] → [[B]]

Hence we have

[[Γ; Δ ⊢ λx.t:A ⊸ B]] :[[Γ; Δ]] → [[A ⊸ B]]
=λ(sep_{(!Γ,Δ),A}^{−1}; f)

⊸-elimination The rule is:

\begin{matrix}Γ; Δ_{1} ⊢ u:(A ⊸ B) & Γ; Δ_{2} ⊢ t:A \\ Γ; Δ ⊢ (ut):B \end{matrix}

where Δ = Δ_{1}#Δ_{2}, so we have arrows:

f : [[Γ; Δ_{1}]] → [[A ⊸ B]]
g : [[Γ; Δ_{2}]] → [[A]]

Hence we have

[[Γ; Δ ⊢ (ut):B]] : [[Γ; Δ]] → [[B]]
=split_{Γ,Δ,Δ_{1},Δ_{2}}; (f ⊗ g); ap_{[[A]],[[B]]}

!-introduction The rule is:

{Γ; ⊢ t:A \atop Γ; ⊢!t :!A}

so we have an arrow:

f : [[Γ; ]] → [[A]]

Hence we have

[[Γ; ⊢!t :!A]] :[[Γ; ]] → [[!A]]
=prom_{Γ}; F G(f)

!-elimination The rule is:

Γ; Δ_{1} ⊢ u :!A Γ, x:A; Δ_{2} ⊢ t:B
Γ; Δ ⊢ let !x be u in t:B

where Δ = Δ_{1}#Δ_{2}. Hence we have arrows:

f : [[Γ; Δ_{1}]] → [[!A]]
g : [[Γ, A; Δ_{2}]] → [[B]]

Hence we have

[[Γ; Δ ⊢ let !x be u in t:B]] : [[Γ; Δ]] → [[B]]
= str_{Γ,Δ,Δ_{1},Δ_{2}};(f ⊗ id_{[[Γ;Δ_{2}]]}); sep_{!A,(!Γ,Δ_{2})}^{−1}; mge_{(!A,!Γ,Δ_{2}),!Γ,(!A,Δ_{2})}; g

3.2 Soundness

Having given the interpretation function [[ ]]^{L}, we now need to show that the interpretation is sound. That is, we need to demonstrate that the equality judgement we have given for DILL(ℂ) is respected by the interpretation [[ ]]^{L} for any model L.

First we need to prove two technical lemmas, which give the interpretations of the two substitutions in the model:

Lemma 3.2.1 If [[Γ; Δ_{1} ⊢ t:A]] = f and [[Γ; Δ_{2}, x:A ⊢ u:B]] = g, and Δ = Δ_{1}#Δ_{2}, then

[[Γ; Δ ⊢ u[t/x]:B]] = split_{Γ,Δ,Δ_{2},Δ_{1}};(id_{[[Γ;Δ′]]} ⊗ f); sep_{(!Γ,Δ),A}^{−1}; g

Lemma 3.2.2 If [[Γ; ⊢ t:A]] = f and [[Γ, x:A; Δ ⊢ u:B]] = g, then

[[Γ; Δ ⊢ u[t/x]:B]] = split_{Γ,Δ, ,Δ};((prom_{Γ}; F G(f)) ⊗ id_{[[Γ;Δ]]}); admin_{Γ,Δ,A}; g

where admin_{Γ,Δ,A} : [[!A]] ⊗ [[Γ; Δ]] → [[Γ, A; Δ]] is defined:

admin_{Γ,Δ,A} = (id_{[[!A]]} ⊗ sep_{!Γ,Δ}); (s_{[[!A]],[[!Γ]]} ⊗ id_{[[Δ]]}); (sep_{!Γ,!A}^{−1} ⊗ id_{[[Δ]]}); sep_{!(Γ,A),Δ}^{−1}

These lemmas are proved by induction over the structure of the first term. The proofs are again left to the reader, but as an example we prove the intuitionistic lemma in the case where u is the term Γ, x:A; ⊢ x:A. Clearly, in this case the result of the substitution {t/x} is just the term Γ; ⊢ t:A, so we need to show:

f = split_{Γ, , ,} ; ((prom_{Γ}; F G(f)) ⊗ id_{[[Γ; ]]}); admin_{Γ, ,A}; sep_{(!Γ,x:!A),} ;
(sep_{(!Γ),!x:A} ⊗ id_{[[ ]]}); ((disc_{Γ} ⊗ der_{A}) ⊗ disc ); li_{I⊗[[A]]}; ri_{[[A]]}

We can see that admin_{Γ, ,A} = s_{[[!A]],[[!Γ]]}; sep_{!Γ,!x:A}^{−1}, and hence the right-hand side of this simplifies to

split_{Γ, , ,} ; ((prom_{Γ}; F G(f))⊗id_{[[Γ; ]]}); s_{[[!A]],[[!Γ]]}; sep_{!Γ,!x:A}^{−1}; sep_{(!Γ),!x:A}; (disc_{Γ}⊗der_{A}); ri_{[[A]]}

But this is precisely

split_{Γ, , ,} ; ((prom_{Γ}; F G(f)) ⊗ id_{[[Γ; ]]}); (der_{A} ⊗ disc_{Γ}); s_{[[A]],I}; ri_{[[A]]}

By the adjunction and the tensor rules, this is

split_{Γ, , ,} ; (f ⊗ disc_{Γ}); li_{[[A]]}

which is

split_{Γ, , ,} ; (id_{[[Γ; ]]} ⊗ disc_{Γ}); ri_{[[Γ; ]]}; f

But we can prove that split_{Γ, , ,} ; (id_{[[Γ; ]]} ⊗ disc_{Γ}); ri_{[[Γ; ]]} = id_{[[!Γ]]}, so that the result holds.

Now we are able to prove soundness by considering the derivation of equality judgements in DILL(ℂ).

Theorem 2 (Soundness) If Γ; Δ ⊢ tu : A then

[[Γ; Δ ⊢ t:A]] = [[Γ; Δ ⊢ u:A]]

Proof

I − β In this case, we have

Γ; Δ ⊢ let ∗ be ∗ in t = t : A

The interpretation of the left hand side is the arrow

str_{Γ, ,Δ}; (disc_{Γ} ⊗ g); ri_{[[A]]}

but

str_{Γ, ,Δ}; (disc_{Γ} ⊗ id_{[[Γ;Δ]]}) = ri_{[[Γ;Δ]]}^{−1}

so this is just g by naturality of ri. I − η In this case we have

Γ; Δ ⊢ let ∗ be t in ∗ = t : I

The interpretation of the left-hand side of this is the arrow

str_{Γ,Δ,} ; (f ⊗ disc_{Γ}); ri_{I}

but by a symmetric equality to that used above we have that this is

li_{[[Γ;Δ]]}^{−1}; (f ⊗ id_{I}); ri_{I}

but now since ri_{I} = li_{I} this is just f. ⊗ − η First, note that

[[Γ; x:A, y:B ⊢ x ⊗ y:A ⊗ B]] = str_{Γ,A,B}; ((lcon_{!Γ,A}; (disc_{Γ} ⊗ id_{[[A]]}); ri_{[[A]]})
⊗ (lcon_{!Γ,B}; (disc_{Γ} ⊗ id_{[[B]]}); ri_{[[B]]}))
= lcon_{!Γ,(A,B)}; (disc_{Γ} ⊗ id_{[[A⊗B]]}); ri_{[[A⊗B]]}

This means that

[[Γ; Δ ⊢ let x ⊗ y be t in x ⊗ y]] = str_{Γ, ,Δ}; (id_{[[Γ; ]]} ⊗ f); a_{[[Γ; ]],A,B}^{−1}; lcon_{!Γ,(AB)};
(disc_{Γ} ⊗ id_{A⊗B}); ri_{[[A]]})
= str_{Γ, ,Δ}; (id_{[[Γ; ]]} ⊗ f); (disc_{Γ} ⊗ id_{A⊗B}); ri_{A⊗B}
= str_{Γ, ,Δ}; (disc_{Γ} ⊗ f); ri_{A⊗B}
= f

! − β In this case,

[[Γ; Δ ⊢ let !x be !t in u:B]] =str_{Γ, ,Δ}; ((prom_{Γ}; F G(f)) ⊗ id_{[[Γ;Δ]]}); (id_{[[!A]]} ⊗ lcon_{!Γ,Δ_{2}});
(s_{[[!A]],[[!Γ]]} ⊗ id_{[[Δ_{2}]]}); (lcon_{!Γ,!A}^{−1} ⊗ id_{[[Δ_{2}]]}); lcon_{!(Γ,A),Δ_{2}}^{−1}; g

which is just the interpretation of u[t/x]. λ − β In this case, assuming that [[Γ; Δ_{1}, A ⊢ t:B]] = f and [[Γ; Δ_{2} ⊢ u:A]] = g,

we have

[[Γ; Δ_{1}, Δ_{2} ⊢ (λx.t)u:B]] =str_{Γ,(Δ_{1},A),Δ_{2}}; (λ(lcon_{(!Γ,Δ_{1}),A}^{−1}; f) ⊗ g); ap_{[[A]],[[B]]}
=str_{Γ,Δ_{1},Δ_{2}}; (id_{[[Γ;Δ_{1}]]} ⊗ g); lcon_{!Γ,Δ_{1}}^{−1}; f
=[[Γ; Δ_{1}, Δ_{2} ⊢ t[u/x]:B]]

Congruence These cases are easily shown, firstly because categorical equality is an equivalence, and secondly since given a context C[ ] and a term t, the interpretation of a term having the form C[t] is a term of the internal language of the category containing a sub-term the interpretation of t.

This shows soundness. □

3.3 The Term Model

The first stage in establishing completeness is to define the term model of DILL(ℂ). It is clear that we will as normal construct the term category to form the SMCC part of the model, but we will need to use a somewhat more complex construction to provide the CCC part.

Definition 3.3.1 (The Term Category) We define the term category S_{T} for the signature (P_{L}, C) as follows:

• The objects of S_{T} are the types of DILL(ℂ).

• S_{T} (A, B) = {[(x, t)^{A,B}]| ; x:A ⊢ t:B}, where we write [(x, t)^{A,B}] to denote the equivalence class of (x, t)^{A,B} under the equivalence ≡ defined by:

(x, t)^{A,B} ≡ (y, u)^{A,B} if ; x:A ⊢ t = u{x/y} : B

For now on, we will write [(x, t)]^{A,B} as [x, t^{A,B}] for clarity, and omit the type information where possible. Also, we will assume where necessary that in referring to [x, t] and [y, u] etc., the pairs (x, t) and (y, u) are chosen from their equivalence classes in such a way that the variables x and y are distinct, unless they are explicitly identified.

Now define identities and substitution:

• id_{A} = [x, x]

• [x, t]; [y, u] = [x, u{t/y}]

Now it is easily demonstrated that these definitions give a category, given primitive results on substitution. Further, we certainly have appropriate primitive interpretation functions [[ ]]_{P_{L}} : P_{L} → obj(S), given by the identity, and [[c]]_{C} given by [x, let ∗ be x in c] for each constant c in C. The next step is to show that S_{T} is in fact a SMCC. First we define the tensor of two objects A and B as the object A⊗B, and on arrows we define the tensor and its associated natural isomorphisms as follows:

[x_{1}, t] ⊗ [x_{2}, u] = [y, let x_{1} ⊗ x_{2} be y in t ⊗ u]
ri_{A} : I ⊗ A → A = [y, let x_{1} ⊗ x_{2} be y in let ∗ be x_{1} in x_{2}]
li_{A} : A ⊗ I → A = [y, let x_{1} ⊗ x_{2} be y in let ∗ be x_{2} in x_{1}]
a_{A,B,C} = [y_{1}, let x_{1} ⊗ y_{2} be y_{1} in let x_{2} ⊗ x_{3} be y_{2} in (x_{1} ⊗ x_{2}) ⊗ x_{3}]
: A ⊗ (B ⊗ C) → (A ⊗ B) ⊗ C
s_{A,B} : A ⊗ B → B ⊗ A = [y, let x_{1} ⊗ x_{1} be y in x_{2} ⊗ x_{1}]

We can easily now show:

ri_{A}^{−1} = [x, ∗ ⊗ x]
li_{A}^{−1} = [x, x ⊗ ∗]
a_{A,B,C}^{−1} = [y_{1}, let y_{2} ⊗ x_{3} be y_{1} in let x_{1} ⊗ x_{2} be y_{2} in x_{1} ⊗ (x_{2} ⊗ x_{3})]
s_{A,B}^{−1} = s_{B,A}

We give the proof of the fact that ri_{A} has the inverse given above as an example. In order to show that the given arrow ri has the inverse [x, ∗ ⊗ x], there are two cases to consider. Firstly we consider the composition ri_{A}; [x, ∗ ⊗ x], which is

[y, ∗ ⊗ (let x_{1} ⊗ x_{2} be y in let ∗ be x_{1} in x_{2})]

Now in DILL(ℂ) we have by two commuting conversions the equality judgement

; y:I ⊗ A ⊢ ∗ ⊗ (let x_{1} ⊗ x_{2} be y in let ∗ be x_{1} in x_{2})
= let x_{1} ⊗ x_{2} be y in (let ∗ be x_{1} in ∗) ⊗ x_{2}:I ⊗ A

and by η equalities for ⊗ and I the equality judgement

; y:I ⊗ A ⊢ let x_{1} ⊗ x_{2} be y in (let ∗ be x_{1} in ∗) ⊗ x_{2} = y:A ⊗ A

and hence

[y, ∗ ⊗ (let x_{1} ⊗ x_{2} be y in let ∗ be x_{1} in x_{2})] = [y, y]

as required. Secondly, we consider the composition [x, ∗ ⊗ x]; ri_{A}, which is

[x, let x_{1} ⊗ x_{2} be ∗ ⊗ x in let ∗ be x_{1} in x_{2}]

But in DILL(ℂ) we have by ⊗ and I − β-equalities the equality judgement

; x:A ⊢ let x_{1} ⊗ x_{2} be ∗ ⊗ x in let ∗ be x_{1} in x_{2} = x:A

so that we have

[x, let x_{1} ⊗ x_{2} be ∗ ⊗ x in let ∗ be x_{1} in x_{2}] = [x, x]

as required. □

In future we omit the explicit statements of the equality judgements which justify the equalities between equivalence classes, and merely annotate some of these equalities with the axiomatic equalities of DILL(ℂ) used to derive them.

⨂ is a Functor

We need to show that the definition given above of the tensor is functorial. This amounts to showing that identities are preserved:

[x, x] ⊗ [x′, x′] = [y, let x ⊗ x′ be y in x ⊗ x′]
(by ⊗ − η) =  [y, y]

and that composition is preserved. We show this in the second place of the functor; the proof for the first place is analogous.

[x, x] ⊗ ([y, t]; [y′, u])

=  [x′, let x ⊗ y be x′ in x ⊗ (u{t/y′})]
(by ⊗-cc and β) = [x′, let x′′ ⊗ y′ be (let x ⊗ y be x′ in x ⊗ t) in x′′ ⊗ u]
=  ([x, x] ⊗ [y, t]); ([x′′, x′′] ⊗ [y′, u])

We now need to check that the specified natural transformations ri, li, a and s have the correct properties:

ri_{A} There is one diagram to check here for naturality, and two equalities for isomorphism.

ri_{A}; [x, t]
= [y, t{let x′ ⊗ x be y in let ∗ be x′ in x/x}]
(by cc) =  [y, let x′ ⊗ x be y in let ∗ be x′ in t]
(by cc and ⊗ − β) = [y, let y′ ⊗ y′′ be let x′ ⊗ x be y in x′ ⊗ t in let ∗ be y′ in y′′]
=  (id_{I} ⊗ [x, t]); ri_{B}

This shows the naturality of ri. We previously demonstrated that ri_{A} was an isomorphism.

li_{A} The diagrams in this case are exactly analogous to the above ones, and hence are omitted. a_{A,B,C} We first check naturality for this arrow.

a_{A_{1},A_{2},A_{3}}; ([x_{1}, t_{1})] ⊗ [x_{2}, t_{2}]) ⊗ [x_{3}, t_{3}]

= [y′, let x_{1} ⊗ x′
be let y_{1} ⊗ y′′ be y′ in let y_{2} ⊗ y_{3} be y′′ in (y_{1} ⊗ y_{2}) ⊗ y_{3}

in let x_{2} ⊗ x_{3} be x′ in (t_{1} ⊗ t_{2}) ⊗ t_{3}] (by cc, α-conv. and ⊗ − β)

= [y′, let x_{1} ⊗ x′ be y′ in let x_{2} ⊗ x_{3} be x′ in (t_{1} ⊗ t_{2}) ⊗ t_{3}]

(by cc and ⊗ − β)

= [y′, let y_{1} ⊗ y′′
be let x_{1} ⊗ x′ be y′ in let x_{2} ⊗ x_{3} be x′ in t_{1} ⊗ (t_{2} ⊗ t_{3})

in let y_{2} ⊗ y_{3} be y′ in (y_{1} ⊗ y_{2}) ⊗ y_{3}]

= [x_{1}, t_{1}] ⊗ ([x_{2}, t_{2}] ⊗ [x_{3}, t_{3}]); a_{B_{1},B_{2},B_{3}}

The isomorphism is easily seen.

s_{A,B} We need to show naturality:

[x, t] ⊗ [y, u]; s_{B_{1},B_{2}}
= [y′′, let x′ ⊗ y′ be let x ⊗ y be y′′ in t ⊗ u in y′ ⊗ x′]
(by cc and ⊗ − β) =  [y′′, let x ⊗ y be y′′ in u ⊗ t]
(by cc, α-conv. and ⊗ − β) = [y′′, let y ⊗ x be let x′ ⊗ y′ be y′′ in y′ ⊗ x′ in u ⊗ t]
=  s_{A_{1},A_{2}}; [y, u] ⊗ [x, t]

Again, the isomorphism is easily seen.

From now on we will omit the justifications of equality steps for brevity. Now we need to show that the coherence equalities given earlier hold in S_{T}. We

check these by number based on the numbering given in appendix A.2. Because the demonstration for larger equalities consists of equalities between huge terms of DILL(ℂ), we check here only equalities A.2.2, A.2.3, A.2.5 and A.2.6.

A.2.2

LHS =[y′, let x_{1} ⊗ x_{2}
be let y′′ ⊗ x′′′ be y′ in let x′ ⊗ x′′ be y′′ in x′ ⊗ (x′′ ⊗ x′′′)
in x_{1} ⊗ (let y_{1} ⊗ y_{2} be x_{2} in let ∗ be y_{1} in y_{2})]
=[y′, let y′′ ⊗ x′′′ be y′ in let x′ ⊗ x′′ be y′′ in x′ ⊗ (let ∗ be x′′ in x′′′)]
=[y′, let y′′ ⊗ x′′′ be y′ in (let x′ ⊗ x′′ be y′′ in let ∗ be x′′ in x′) ⊗ x′′′]

A.2.3

LHS =[y′, let x ⊗ y be y′ in let ∗ be y in x]
=[y′, let x ⊗ y be y′ in let ∗ be y in let ∗ be x in ∗]
=[y′, let x ⊗ y be y′ in let ∗ be x in y]
=RHS

A.2.5 We show this by demonstrating s_{A,B}; s_{B,A} = id.

LHS =[y′′, let x ⊗ y be let x′ ⊗ y′ be y′′ in y′ ⊗ x′ in y ⊗ x]
=[y′′, y′′]

A.2.6

LHS =[y′′, let x ⊗ y be let x′ ⊗ y′ be y′′ in y′ ⊗ x′ in let ∗ be y in x]
=[y′′, let x′ ⊗ y′ be y′′ in let ∗ be x′ in y′]
=RHS

At this point we have shown that the term category is an s.m. category. It remains to demonstrate that a suitable candidate exists for the right adjoint of the tensor.

Closedness of the SMC

We will define the functor ⊸ on types in the obvious way, and on morphisms [x, t] : A → B, [y, u] : A′ → B′ and [x′, t′] : A ⊗ B → C as follows:

[x, t] ⊸ [y, u] : (B ⊸ A′) → (A ⊸ B′) = [x′, λx:A.(u{(x′t)/y})]
λ[x′, t′] : A → (B ⊸ C) = [x′′, λy′:B.(t′{(x′′ ⊗ y′)/x′})]
ap_{A,B} : A ⊗ (A ⊸ B) → B = [y, let x_{1} ⊗ x_{2}:(A ⊸ B) ⊗ A be y in x_{1}x_{2}]

It is easy to show that these definitions give a functor, and that it is right adjoint to the tensor, using lemma 2.2.10. Hence the term category S_{T} is an SMCC.

Having shown that S_{T} is a SMCC, and hence forms part of a DILL(ℂ)-model, we now need to find a suitable candidate for the CCC part of this model.

The Intuitionistic Term category

We now give an explicit construction of a strict cartesian category which we will show to be adjoint to the term category.

Definition 3.3.2 (The Intuitionistic Term Category) We define the intuitionistic term category C_{T} as follows:

• The objects of C_{T} are sequences of types of DILL(ℂ).

• C_{T} (A⃗, B⃗) = {[(x⃗, t⃗)^{A⃗,B⃗}]|x⃗ : A⃗; ⊢ t_{i} : B_{i} for t_{i} ∈ t⃗}, where we write [(x⃗, t⃗)^{A⃗,B⃗}] to denote the equivalence class of (x⃗, t⃗)^{A⃗,B⃗} under the equivalence ≡_{C} defined by:

(x⃗, t⃗)^{A⃗,B⃗} ≡_{C} (y⃗, u⃗)^{A⃗,B⃗} if for all t_{i} ∈ t⃗, x⃗:A⃗; ⊢ t_{i} = u_{i}{x⃗/y⃗} : B_{i}

As before, we write [x⃗, t⃗]^{A⃗,B⃗} for [(x⃗, t⃗)]^{A⃗,B⃗} for clarity, omit type information where possible and assume that the variables x⃗ and y⃗ in the arrows [x⃗, t⃗] [y⃗, u⃗] are always chosen from the equivalence classes so as to make all the variables in the concatenation x⃗y⃗ distinct, except where explicitly identified.

Now define identities and substitution:

• idA⃗ = [x⃗, x⃗]

• [x⃗, t⃗]; [y⃗, u⃗] = [x⃗, u⃗{t⃗/y⃗}]

It is again easy to show that these definitions make C_{T} into a category. We now specify the strict cartesian structure on sequences of types to be concatenation, and on morphisms where [x⃗, t⃗] : A⃗_{1} → B⃗_{1} and [y⃗, u⃗] : A⃗_{2} → B⃗_{2}:

[x⃗, t⃗] × [y⃗, u⃗] : A⃗_{1}A⃗_{2} → B⃗_{1}B⃗_{2} = [x⃗y⃗, t⃗u⃗]
⟨[x⃗, t⃗], [x⃗, u⃗]⟩ : A⃗_{1} → B⃗_{1}B⃗_{2} = [x⃗, t⃗u⃗]
p_{i,r} : A_{1} … A_{r} → A_{i} = [x⃗, x_{i}]

These definitions make C_{T} into a strict cartesian category; as an example, we show the defining equality of the projections:

⟨[x⃗, t_{1}] … [x⃗, t_{r}]⟩; p_{i,r} = [x⃗, t_{1} … t_{r}]; [y⃗, y_{i}]
= [x⃗, t_{i}]

It is possible to make this category into a CCC by defining an arrow type A → B =!A ⊸ B, but we do not do this here.

S_{T} is monoidally adjoint to C_{T}

Now, in order to construct a term model for DILL(ℂ), we need to show that the categories S_{T} and C_{T} which we have constructed are monoidally adjoint.

Note 3.3.3 (Strict Tensor) Firstly, since we will be mapping a strict cartesian structure into the category S_{T}, we will need to define some new term constructors. Define the tensor of ⊗t_{1} … t_{r}

⊗t_{1}, … t_{r} = \begin{cases}∗ & if r = 0 \\ t_{1} & if r = 1 \\ (⊗t_{1} … t_{r−1}) ⊗ t_{r} & otherwise \end{cases}

Further, we need to define a let term construct to eliminate sequences of variables, which we again do as follows:

let ⊗x_{1} … x_{r} be t in u = \begin{cases}let ∗ be t in u & if r = 0 \\ u[t/x_{1}] & if r = 1 \\ let z ⊗ x_{r} be t \\ in (let ⊗x_{1} … x_{r−1} be z in u) & otherwise \end{cases}

Now, assume that Γ; Δ′′, x⃗:A⃗ ⊢ u:B, that Γ; Δ′′′ ⊢ u′:⊗A⃗, and that Γ; Δ′_{i} ⊢ t:A_{i} for i = 1 … r, where A⃗ = A_{1} … A_{r}. Then, using the β and η equalities of DILL(ℂ), we can derive equality judgements:

Γ; Δ ⊢ let ⊗x⃗ be ⊗t⃗ in u = u{t⃗/x⃗}:B  Γ; Δ′′′ ⊢ let ⊗x⃗ be u′ in ⊗x⃗ = u′:⊗A⃗

where Δ = Δ′′#Δ′_{1}# … #Δ′_{r}. Now assume we have a Γ_{1}; Δ_{1}, A_{1} − Γ_{2}; Δ_{2}, A_{2} linear term context C[ ]. Given Γ_{1}; Δ_{1}, x⃗:B⃗ ⊢ u:A_{1}, Γ_{2}; Δ′ ⊢ t′:⊗B⃗ and Γ; Δ′′_{i} ⊢ t_{i} :!B_{i} for i = 1 … r, where B⃗ = B_{1} … B_{r}, we have:

Γ; Δ ⊢ let !x⃗ be t⃗ in ⊗!x⃗ = ⊗t⃗⊗!A⃗
Γ_{2}; Δ′′′ ⊢ C[let ⊗x⃗ be t′ in u] = let ⊗x⃗ be t′ in C[u]:A_{2}

where Δ′′′ = Δ′#Δ_{2} and Δ = Δ′_{1}# … #Δ_{r}.

Definition 3.3.4 (The Functors F_{T} and G_{T}) We define the functors F_{T} : C_{T} → S_{T} and G_{T} : S_{T} → C_{T}:

F_{T} (A⃗) = ⊗!A⃗
F_{T} ([x⃗, t⃗]) = [y, let ⊗x⃗_{1} be y in let !x⃗ be x⃗_{1} in ⊗!t⃗]
G_{T} (A) = A
G_{T} ([x, t]) = [x, t]

We show that these definitions are functorial. It is easy to see that G preserves identities and composition, but more tricky for F. To show that it preserves identities:

F_{T} (idA⃗) = F_{T} ([x⃗, x⃗])
= [y, let ⊗x⃗_{1} be y in let !x⃗ be x⃗_{1} in ⊗!x⃗]
= [y, let ⊗x⃗_{1} be y in ⊗x⃗_{1}]
= [y, y]

To show that it preserves composition:

F_{T} ([x⃗, t⃗]; [y⃗, u⃗]) = F_{T} ([x⃗, u⃗{t⃗/y⃗}])
= [y′, let ⊗x⃗_{1} be y′ in let !x⃗ be x⃗_{1} in ⊗!(u⃗{t⃗/y⃗})]
= [y′, let ⊗x⃗_{1} be y′ in let !x⃗ be x⃗_{1} in let !y⃗ be !t⃗ in ⊗!u⃗]
= [y′, let ⊗ x⃗_{3}
be let ⊗x⃗_{1} be y′ in let !x⃗ be x⃗_{1} in ⊗!t⃗
in let ⊗x⃗_{2} be ⊗x⃗_{3} in let !y⃗ be x⃗_{2} in ⊗!u⃗]
= F_{T} ([x⃗, t⃗]); F_{T} ([y⃗, u⃗])

We now need to show that both F_{T} and G_{T} are monoidal functors. This means we must give natural transformations m_{A,B}^{G} : G(A)G(B) → G(A ⊗ B), mi^{G} : → G(I), m_{A,B}^{F} : F (A⃗) ⊗ F (B⃗) → F (A⃗B⃗) and mi^{F} : I → F ( ).

m_{A,B}^{G} = [xy, x ⊗ y]
mi^{G} = [ε, ∗]
m_{A⃗,B⃗}^{F} = [y′, let x_{1} ⊗ x_{2} be y′ in let ⊗y⃗_{1} be x_{1} in let ⊗y⃗_{2} be x_{2} in ⊗y⃗_{1}y⃗_{2}]
mi^{F} = [x, x]

We must now check naturality and certain coherence conditions. Naturality of m^{G} Assume that f = [x, t] and that g = [y, u]. Then

LHS = (G(f) × G(g)); m^{G}
= [xy, tu]; [x′y′, x′ ⊗ y′]
= [xy, t ⊗ u]
= [xy, x ⊗ y]; [y′, let x ⊗ y be y′ in t ⊗ u]
= m^{G}; G(f ⊗ g)
= RHS

A.2.8) for m^{F}

LHS = [y′, let x_{1} ⊗ x_{2} be y′ in let ∗ be x_{1} in x_{2}]
= [y′, let x_{1} ⊗ x_{2} be y′ in x_{1} ⊗ x_{2}];
[x′, let x_{1} ⊗ x_{2} be x′ in let ∗ be x_{1} in x_{2}]; [x′, x′]

A.2.9) for m^{F}

LHS = [y′, let x_{1} ⊗ x_{2} be y′ in x_{2} ⊗ x_{1}];
[x′, let x_{1} ⊗ x_{2} be x′ in let ⊗y⃗_{1} be x_{1} in let ⊗y⃗_{2} be x_{2} in ⊗y⃗_{1}y⃗_{2}]

= [y′, let x_{1} ⊗ x_{2} be y′ in let ⊗y⃗_{1} be x_{2} in let ⊗y⃗_{2} be x_{1} in ⊗y⃗_{1}y⃗_{2}

= [y′, let x_{1} ⊗ x_{2} be y′ in let ⊗y⃗_{1} be x_{1} in let ⊗y⃗_{2} be x_{2} in ⊗y⃗_{1}y⃗_{2}];
[x′, let ⊗x⃗_{1}x⃗_{2} be x′ in ⊗x⃗_{2}x⃗_{1}]

A.2.8) for m^{G}

LHS = [x, x]
= [x, ∗ ⊗ x]; [y′, let x ⊗ y be y′ in let ∗ be x in y]
= [x, ∗x]; [xy, x ⊗ y]; G([y′, let x ⊗ y be y′ in let ∗ be x in y])
= RHS

A.2.9) for m^{G}

LHS = [xy, yx]; [xy, x ⊗ y]
= [xy, y ⊗ x]
= [xy, x ⊗ y]; [y′, let x ⊗ y be y′ in y ⊗ x]
= [xy, x ⊗ y]; G([z, let x ⊗ y be z in y ⊗ x])
= RHS

We need to establish that there is an adjunction between S_{T} and C_{T}. First we give the counit and unit:

[x, let !y be x in y] = nu_{A} : F GA → A
[x⃗, ⊗!x⃗] = unA⃗ : A⃗ → GF (A⃗)

Now, consider an arbitrary morphism [x, t] : F A⃗ → B in S_{T}. Define [x, t]^{∗} to be the morphism [y⃗, t{⊗!y⃗/x}] : A⃗ → GB in C_{T}. But now:

F ([x, t]^{∗}); nu_{B} = [y′, let ⊗x⃗′ be y′ in let !y⃗ be x⃗′ in !t{⊗!y⃗/x}]; [x, let !y be x in y]
= [y′, let ⊗x⃗′ be y′ in let !y⃗ be x⃗′ in t{⊗!y⃗/x}]
= [y′, t{y′/x}]

Therefore the adjunction triangle commutes. Now assume that it does so for [y⃗, u] : A⃗ → GB, that is to say

[y′, let ⊗x⃗′ be y′ in let !y⃗ be x⃗′ in !u] = [y′, t{y′/x}]

This equality implies that

; y′:⊗!A⃗ ⊢ let ⊗x⃗′ be y′ in let !y⃗ be x⃗′ in !u = t{y′/x}:B

and by substituting ⊗!y⃗ for y′ this implies that

y⃗:A⃗; ⊢!u = t{⊗!y⃗/x}:B

This implies that our choice of [x, t]^{∗} is the unique such making the adjunction triangle commute. Hence we have the required adjunction. We now need to check that the adjunction is monoidal, ie that the unit and counit of the adjunction are monoidal natural transformations. In order to check this, we need the maps m^{F G}, mi^{F G}, m^{GF} and mi^{GF}:

[x, let ∗ be x in !∗] = m_{I}^{F G}
I → F GI
[x′, let x_{1} ⊗ x_{2} be x′ in let !x′_{1} be x_{1} in let !x′_{2} be x_{2} in !(x′_{1} ⊗ x′_{2})] = m_{A,B}^{F G}
F GA ⊗ F GB → F G(A ⊗ B)
[ε, ∗] = m^{GF}
→ GF ( )
[xy, let ⊗x⃗_{1} be x in let ⊗x⃗_{2} be y in ⊗x⃗_{1}x⃗_{2}] = m_{A⃗,B⃗}^{GF}
(GF A⃗)(GF B⃗) → GF (A⃗B⃗)

We now need to check certain coherence conditions:

A.2.10) for nu

LHS = [x′, let x_{1} ⊗ x_{2} be x′ in let !x′_{1} be x_{1} in let !x′_{2} be x_{2} in !(x′_{1} ⊗ x′_{2})];
[x, let !y be x in y]
= [y′, let x_{1} ⊗ x_{2} be y′ in let !x′_{1} be x_{1} in let !x′_{2} be x_{2} in x′_{1} ⊗ x′_{2}]

A.2.11) for nu

LHS = [x, let ∗ be x in !∗]; [x, let !y be x in y]
= [x, let ∗ be x in ∗]
= [x, x]

A.2.10) for un

LHS = [x⃗_{1}x⃗_{2}, ⊗!x⃗_{1}x⃗_{2}]

= [x⃗_{1}x⃗_{2}, (⊗!x⃗_{1})(⊗!x⃗_{2})]; [xy, let ⊗x⃗_{1} be x in let ⊗x⃗_{2} be y in ⊗x⃗_{1}x⃗_{2}]

A.2.11) for un

LHS = [ε, ∗]
= RHS

We have now demonstrated that S_{T} is monoidally adjoint to C_{T}. We now make the definition:

Definition 3.3.5 (DILL(ℂ) Term Model) Define the term model of DILL(ℂ) which we will call L_{T}, to be the carrier (S_{T} , C_{T} , F_{T} , G_{T}) equipped with the primitive interpretation functions [[ ]]_{P_{L}} : P_{L} → obj(S) given by the identity and [[c]]_{C} = [x, let ∗ be x in c].

We have by our previous calculations that this is a DILL(ℂ)-model over signature (P_{L}, C).

3.4 Completeness

In order to prove completeness, it now suffices to prove a lemma:

Lemma 3.4.1 [[x′:Γ; x′′:Δ ⊢ t:A]]_{L_{T}} = [x, let ⊗y⃗x′′ be x in let !x′ be y⃗ in t] in the SMCC part of the term model L_{T}.

We prove this lemma by induction over the structure of the term. Now completeness is easy:

Theorem 3 (Soundness and Completeness) Suppose we have terms Γ; Δ ⊢ t: A and Γ;: Δ ⊢ u: A, where Γ = x′: B⃗′ and Δ = x′′:B⃗′′. Then Γ; Δ ⊢ t = u : A if and only if [[Γ; Δ ⊢ t:A]]^{L} = [[Γ; Δ ⊢ u:A]]^{L} in every DILL(ℂ)-model,L.

Proof We have the forward direction of the implication, soundness, proved earlier. As for the other direction, assume that [[Γ; Δ ⊢ t: A]]^{L} = [[Γ; Δ ⊢ u: A]]^{L} for all DILL(ℂ)-models L. Then since L_{T} is an DILL(ℂ)-model we have by lemma 3.4.1 that

[x, let y⃗x′′ be x in let !x′ be y⃗ in t] = [x, let y⃗x′′ be x in let !x′ be y⃗ in u]

and hence we have

; x : ⊗!B⃗′, B⃗′′ ⊢ let y⃗x′′ be x in let !x′ be y⃗ in t = let y⃗x′′ be x in let !x′ be y⃗ in u : A

But now it follows that if we substitute ⨂!x′, x′′ for x in both terms we still have an equality. However, under this substitution, we have:

Γ; Δ ⊢ let y⃗x′′ be (⨂!x′, x′′) in let !x′ be y⃗ in t = t:A

and hence

Γ; Δ ⊢ t = u : A

as required. □

3.5 ILL and Other Models

Our proof of completeness above has certain easy corollaries. Firstly, since we have shown that the type theory ILL(ℂ) together with its βη-cc equality is isomorphic to a subsystem of DILL(ℂ), with its βη-cc equality, we know that the models of DILL(ℂ) will be very closely related to models of ILL(ℂ). We give some results which are easily proved.

Lemma 3.5.1 (Interpretation for ILL(ℂ)) If Δ ⊢_{ILL(ℂ)} M:A, then we have an arrow [[ ; Δ ⊢ Φ(M):A]] : [[Δ]] → [[A]] in the SMCC part of any DILL(ℂ)-model.

This is obvious from the form of the maps [[ ]] and Φ.

Corollary 3.1 (Soundness for ILL(ℂ)) If Δ ⊢_{ILL(ℂ)} M = N : A, then the arrows [[ ; Δ ⊢ Φ(M):A]] and [[ ; Δ ⊢ Φ(N):A]] are equal in the SMCC part of any DILL(ℂ)-model.

This follows from the fact that Φ preserves equalities, and from the fact that [[ ]] is sound.

Corollary 3.2 (Soundness and Completeness for ILL(ℂ)) For terms Δ ⊢_{ILL(ℂ)} M:A and Δ ⊢_{ILL(ℂ)} N:A, Δ ⊢ M = N : A if and only if

[[ ; Δ ⊢ Φ(M):A]] = [[ ; Δ ⊢ Φ(N):A]]

in the SMCC part of every DILL(ℂ)-model.

Proof Clearly by completeness, [[ ; Δ ⊢ Φ(M) : A]] = [[ ; Δ ⊢ Φ(N) : A]] iff ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N) : A, and this is true iff Δ ⊢ M = N : A by our translation results.

Hence we have shown that ILL(ℂ) is complete for DILL(ℂ)-models.

Relating DILL (ℂ)-models and Cambridge Models

We now recall that together with the original presentation of ILL(ℂ), in [BBdPH93b], a categorical model was given based on a SMCC with a comonoidal comonad. These models were referred to as linear categories, or sometimes as Cambridge categories. It is natural to ask how this model of linear logic relates to the DILL(ℂ)-models we have used, and indeed this question has been considered in detail by Benton in [Ben95a], with respect to his LNL-models. We summarise two of his results.

Lemma 3.5.2 ([Ben95a], Corollary 8) Any LNL-model has as its SMCC part a linear category.

Lemma 3.5.3 ( [Ben95a], Corollary 17) Any linear category is the SMCC part of at least one LNL-model.

This last lemma is of particular interest because the construction of a suitable CC part to make the LNL-model can be accomplished in a variety of ways. We can now prove the following lemma, which neatly confirms the claim made in [BBdPH93a]:

Theorem 4 (ILL(ℂ) and linear categories) For two terms Δ ⊢_{ILL(ℂ)} M:A and Δ ⊢_{ILL(ℂ)} N:A of ILL(ℂ), Δ ⊢_{ILL(ℂ)} M = N : A iff

[[ ; Δ ⊢ Φ(M):A]]^{L} = [[ ; Δ ⊢ Φ(N):A]]^{L}

in every DILL(ℂ)-model L.

Proof We have via completeness that [[ ; Δ ⊢ Φ(M):A]]_{L} = [[ ; Δ ⊢ Φ(N):A]]_{L} iff ; Δ ⊢_{DILL(ℂ)} Φ(M) = Φ(N) : A, and by translation results that this is true iff Δ ⊢_{ILL(ℂ)} M = N : A. □

Linear Type Theories

We now present a generalised linear type-theory, which consists of a basic structural part similar to the structural part of DILL, operator rules for operators in a given signature, and axiomatic equalities over terms given by a primitive axiom set. This linear type-theory is general enough to have as instances both DILL(ℂ) and also all the static action calculi of Milner.

4.1 Introduction

Operators

Historically, many intuitionistic logics and typing systems have been constructed on the familiar foundation of the intuitionistic axiom Γ, A ⊢ A and cut rule

\begin{matrix}Γ ⊢ A & Γ, A ⊢ B \\ Γ ⊢ B \end{matrix}

including some typing systems which are not based on any other logical structure. In order to consider such systems, we recall Aczel’s general binding operators [Acz80]. In an natural deduction formulation, consider the usual rule for ∨-elimination:

\begin{aligned}(A) ; ⋮ . ; C & (B) ; ⋮ . ; C & A ∨ B \\ & C \end{aligned}

where formulae A and B are discharged from the assumptions. More generally, we will allow a general operator rule to take an arbitrary number of proofs as arguments, and to discharge any assumptions from those proofs, giving a deduction of any formula. A suitable definition of operator along these lines encompasses all the common introduction and elimination rules of most logics based on these structural rules. Now consider annotations of proofs with terms in such a system. The type theoretic formulation corresponding to the ∨-elimination rule given above involves a “cases construction”:

Γ, x:A ⊢ u:C Γ, y:B ⊢ v:C Γ ⊢ t:A ∨ B

Γ ⊢ cases((x:A)u, (y:B)v, t):C

Here, notice that the discharging of assumptions A and B in the operator rule corresponds via the Curry-Howard correspondence to the binding of the variables x and y in u and v, the annotations of the corresponding deduction, respectively. The typing rule for a general such operator is:

{Γ, x⃗_{1}:A⃗_{1} ⊢ t_{1}:B_{1} … Γ, x⃗_{r}:A⃗_{r} ⊢ t_{r}:B_{r} Γ ⊢ u_{1}:C_{1} … Γ ⊢ u_{s}:C_{s} \atop Γ ⊢ K((x⃗_{1}:A⃗_{1})t_{1}, …, (x⃗_{r}:A⃗_{r})t_{r}, u_{1}, …, u_{s}):B}

where each x⃗_{i}:A⃗_{i} denotes the sequence of distinct variables which are bound in the ith component. This general theory can be pushed through into the semantics as well, yielding a model in which operators are interpreted as natural transformations between the hom-sets representing proofs of the appropriate types.

Linearity

Considering DILL(ℂ) and its properties, we notice that many of the characterising rules, which in ILL(ℂ) involve the type constructor !, in DILL(ℂ) arise as properties of the structural rules. Consider the ‘structural fragment’ of the logic DILL(ℂ), which consists of the following rules:

(Int − Ax) Γ, A; ⊢ A  (Lin − Ax) Γ; A ⊢ A

and the (derivable) cut rules:

\begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2}, A ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (L − Cut) \begin{matrix}Γ; ⊢ A & Γ, A; Δ_{2} ⊢ B \\ Γ; Δ ⊢ B \end{matrix} (I − Cut)

We can see within the rules which are admissible in this very restricted system that we clearly have intuitionistic structure, given by the intuitionistic axiom and cut rules, and correspondingly linear structure, given by the linear axiom and cut rules. In the same way as many systems are viewed as intuitionistic by virtue of the structural rules they have as a basis, many systems are viewed and described as ‘linear’ due to their use of the linear structural rules and context maintenance disciplines, whilst not being based on the full linear logic. Hence we might well wish to consider a system of general operators based on the structural fragment of DILL(ℂ), along the same lines as that described above.

First, however, there is one more important generalisation to make. When we consider the logic DILL(ℂ), we see that a sequent Γ; Δ ⊢ A is equivalent to a sequent ; !Γ; Δ ⊢ A. This reflects an underlying fact about the logic, which is that all types are viewed as linear, and the intuitionistic fragment of the logical system is constructed over the linear types. Now in many applications, for example Moggi’s computational λ-calculus [Mog89], exactly the opposite view is taken, which is to say that all types are essentially intuitionistic (or value types), and that the linearly constructed type-system over them is viewed as a a system of computations. Clearly, in order to account for these equally valid and interchangeable views, it makes sense for us to allow both intuitionistic and linear types. In keeping however with the approach of DILL(ℂ), which is focussed more on the linearity of a system, we will view intuitionistic types or formulae as a subset of linear types or formulae.

Therefore, we will take a general sequent Γ; Δ ⊢ A in which the formulae in Γ must be intuitionistic, and those in Δ, A are linear, although since each intuitionistic type is also linear they may be intuitionistic. If we write Q for a general intuitionistic formula and A for a general linear formula, then the structural rules are as follows:

(Int − Ax) Γ, Q; ⊢ Q  (Lin − Ax) Γ; A ⊢ A

with the (derivable) cut rules:

\begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2}, A ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} (L − Cut) \begin{matrix}Γ; ⊢ Q & Γ, Q; Δ_{2} ⊢ A \\ Γ; Δ ⊢ A \end{matrix} (I − Cut)

and the new rule:

\begin{matrix}Γ; Δ_{1} ⊢ Q & Γ, Q; Δ_{2} ⊢ A \\ Γ; Δ_{1}, Δ_{2} ⊢ A \end{matrix} (F)

Now this new F -rule is needed because in general, we have another cut-like operation which allows us to use the image of the intuitionistic structure (weakening and contraction) in the linear part on an intuitionistic type. This was not needed previously as we had no intuitionistic types.

Given this framework, a general operator will be able to bind arbitrary sequences of linear and intuitionistic variables in each of its arguments. It is also convenient to allow a sequent-style presentation of the operator theory, in which as well as discharging assumptions (binding variables) an operator instance can introduce new assumptions (free variables). This generalisation does not change the expressive power of the system, but is convenient for the representation of the operators we shall consider. We will discuss this further after the typing system has been introduced.

The final amendment which we will make to the straightforward introduction of operators into this framework is in considering naturality. As can be seen simply by considering the form of the typing rule for the cases-construct and its corresponding operator, substitution for any variable in the intuitionistic context Γ commutes through the application of the operator transparently. This corresponds to the interpretation of operators of this kind as natural transformations in the semantics. However, in the case where we have two distinct parts to the typing context, we might ask what the corresponding property is on interpretation. It turns out that to allow such transparent substitution on the intuitionistic context is to insist that an operator be natural in the linear category over the intuitionistic category, and to allow such transparent substitution in the linear context is to insist that an operator be natural in the linear category over the linear category.

Considering the operators we will be using, not all of them are linearly natural in each argument, and so we allow a general operator to have two sets of arguments, one in which it is only intuitionistically natural and one in which it is linearly natural as well.

4.2 The Generalised Logic

Firstly, we present the propositions of the logic. We assume two sets M_{I} ⊆ M_{L} of primitive intuitionistic propositions and primitive linear propositions, ranged over by Q, R … and A, B … respectively. (Note that we have overloaded A, B … to refer both to formulae of DILL and linear arities; where it is not clear from the context, we shall explicitly state which reading is intended.) Now a generalised logical context is a pair consisting of a set of intuitionistic formulae and a multiset of linear formulae. In the usual way, we write such a pair as Γ; Δ, where Γ is the intuitionistic part, or set of intuitionistic formulae, and Δ is the linear part, or multiset of linear formulae.

We also assume two sets O_{I} ⊆ O_{L} of operators, ranged over by O . . .. To each of these operators is associated an arity of the form:

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

where we insist that any operator in O_{I} which we will call intuitionistic, must have an arity of the form:

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r}; \\ & (; )R \end{aligned}

Together, the sets M_{I}, M_{L}, O_{I} and O_{L} make up a generalised signature ; we let such generalised signatures be ranged over by 𝕆 = (M_{I}, M_{L}, O_{I}, O_{L}).

The general form of the arity of an operator given above should be read as saying that the operator O has r arguments in which it is intuitionistically natural, and s arguments in which it is intuitionistically and linearly natural. We consider operators which have arguments that they are not linearly natural in because several operators of interest fall into this category, notably the !- operator of DILL(ℂ) and the operators of Milner’s action calculi, which all are only intuitionistically natural. The general form for the arity of an intuitionistic operator also given above is more restricted because of certain properties we will require of all such operators, in the equality of the type-theory. The leading example of an intuitionistic operator is given by the !-introduction of DILL(ℂ), which in this framework will be an intuitionistic operator of arity:

{(; )A; \atop (; )!A}

because intuitively it represents the lifting of a general linear term to be in the intuitionistic world.

Though the general operator signature is quite complex, it would be possible to start with a signature containing just intuitionistically natural operators, and to define these less primitive notions using the equality theory; for example we could equip a simple type theory with a linearly natural operator by giving it a family of intuitionistically natural operators and adding certain equality judgements to the set of axioms of the type theory.

Before proceeding, we introduce some notation. Many operators that we will introduce have a general arity in which either r or s is zero, or they have no binding behaviour for a given argument. We will represent this absence of arguments or binding behaviour by the absence of any marker- for example, the operator ! with no linearly natural arguments and just one intuitionistically natural argument with no binding behaviour has arity:

\begin{matrix}(; )A & ; \\ (; )!A \end{matrix}

We can now present the logic, which we call Lin(𝕆).

Definition 4.2.1 (The Logic Lin(𝕆)) We say that a sequent Γ; Δ ⊢ A can be derived, for a linear formula A and a generalised logical context Γ; Δ, if this can be shown using the following rules:

(Int − Ax) Γ, Q; ⊢ Q  (Lin − Ax) Γ; A ⊢ A
\begin{matrix}Γ; Δ_{1} ⊢ Q & Q, Γ; Δ_{2} ⊢ A \\ Γ; Δ_{1}, Δ_{2} ⊢ A \end{matrix} F

{Γ, Q⃗_{1}; A⃗_{1} ⊢ B_{1} … Γ, Q⃗_{r}; A⃗_{r} ⊢ B_{r} \atop Γ, Q⃗′_{1}; Δ_{1}, A⃗′_{1} ⊢ B′_{1} … Γ, Q⃗′_{s}; Δ_{s}, A⃗′_{s} ⊢ B′_{s}} Γ; Δ′_{1} ⊢ Q′′_{1} … Γ; Δ′_{r′} ⊢ Q′′_{r′}

Γ; Δ′′_{1} ⊢ A′′_{1} … Γ; Δ′′_{s′} ⊢ A′′_{s′}

Γ; Δ ⊢ B′′ (O)

where Δ = Δ_{1}, …, Δ_{s}, Δ′_{1}, … Δ′_{r′}, Δ′′_{1}, …, Δ′′_{s′} and where this last rule may be used for any operator O ∈ O_{L} having arity:

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

where Q⃗′′ = Q′′_{1} … Q′′_{r′} and A⃗′′ = A′′_{1} … A′′_{s′}.

We briefly explain these rules. The axioms are self-explanatory, and familiar from the presentation of DILL. The F -rule, which resembles a non-conventional intuitionistic cut, is justified because it is only allowed in the case where the ‘cut’ formula is intuitionistic. For the operator rule, we assume a derivation of each of the sequents appearing above the line in order to deduce the sequent below the line. The rule assumes firstly premises for the linearly natural and the intuitionistically natural arguments of the operator, and secondly premises demonstrating the propositions which are the fresh inputs of the conclusion of the operator. These are necessary so that both the appropriate cut rules will be admissible for the logic, or equivalently to give an adequate notion of substitution in the type theory.

The Structural rules

Given the operator rule presented above, we have the following three structural rules, as expected; a weakening rule and linear and intuitionistic cut rules:

{Γ; Δ ⊢ A \atop Γ, Q; Δ ⊢ A} W eak
\begin{matrix}Γ; Δ_{1} ⊢ A & Γ; Δ_{2}, A ⊢ B \\ Γ; Δ_{1}, Δ_{2} ⊢ B \end{matrix} L  \begin{matrix}Γ; ⊢ Q & Γ, Q; Δ ⊢ A \\ Γ; Δ ⊢ A \end{matrix} I

These are all admissible. We note that the intuitionistic cut is redundant in this logical setting since it is a special case of the F -rule. This redundancy will disappear in the type-theory because these two rules will have different actions on terms, in general.

4.3 The Typing System Lin(𝕆)

Having given this logic, we can now proceed to annotate its contexts and derivations with variables and terms respectively. We assume the same set of variables used in DILL(ℂ), X, ranged over as before by x, y …, and construct pre-terms as follows:

Definition 4.3.1 (Pre-Terms) We define pre-terms over a signature (M_{I}, M_{L}, O_{I}, O_{L}), ranged over by v, w … as follows:

v ::=x | let x:Q be v in v

| O((x⃗:Q⃗; x⃗:A⃗)v, …, (x⃗:Q⃗; x⃗:A⃗)v; (x⃗:Q⃗; x⃗:A⃗)v, …, (x⃗:Q⃗; x⃗:A⃗)v)(v⃗; v⃗)

where we have an operator clause for every operator O ∈ O_{L}.

We omit typing information in pre-terms where convenient. The binding behaviour of the let construct is familiar, and the operator construct

O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′_{1}, …, v′_{r′}; w′_{1}, …, w′_{s′})

binds the variables x⃗_{i} and y⃗_{i} in v_{i} for all i from 1 to r, and the variables x′_{j} and y′_{j} in w_{j} respectively for all j = 1 … s. We assume the usual capture-avoiding substitution v{w/x} and we may also use a simultaneous form v{w⃗/x⃗}.

We can now define the notion of the multiset of free variables of a pre-term v, which we write FV(v), unambiguously overloading our previous notation. In the following, we again use the mixed complement M − S, where M is a multiset and S is a set, for the multiset resulting when all copies of anything in S are removed from M.

FV(x) = {x}
FV(let x be v in w) = (FV(w) − {x}) ∪ FV(v)
FV(O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′))

= (⋃_{i=1...r}FV(v_{i}) − {x⃗_{i}y⃗_{i}}) ∪ ( ⋃_{j=1...s}FV(w_{j}) − {x′_{j}y′_{j}}) ∪

( ⋃_{i′=1...r′}FV(v′_{i′})) ∪ ( ⋃_{j′=1...s′}FV(w′_{j′}))

We again recall the definitions of appendix A, and add to them by saying that a linear typing is a typing of a variable from the set X with a linear type, and conversely an intuitionistic typing is a typing of a variable with an intuitionistic type. Then an intuitionistic typing sequence is a sequence of intuitionistic typings, and similarly for linear typing sequences. Then a typing context is a pair of an intuitionistic typing sequence and a linear typing sequence, written as usual as Γ; Δ where Γ is the intuitionistic part and Δ is the linear part.

We now give the typing rules of the generalised type system over a signature 𝕆, which we will refer to again as Lin(𝕆).

Definition 4.3.2 (The Typing Rules of Lin(𝕆)) We say a typing judgement Γ; Δ ⊢ v: A can be derived, for a typing context Γ; Δ, a pre-term v and a linear type A, when this can be shown using the following rules:

(I − Ax) Γ, x:Q, Γ′; ⊢ x:Q  (L − Ax) Γ; x:A ⊢ x:A

Γ; Δ_{1} ⊢ v:Q x:Q, Γ; Δ_{2} ⊢ w:A Γ; Δ ⊢ let x:Q be v in w:A (F) (where Δ = Δ_{1}#Δ_{2})

Γ, x⃗_{1}:Q⃗_{1}; y⃗_{1}:A⃗_{1} ⊢ v_{1}:B_{1} … Γ, x⃗_{r}:Q⃗_{r}; y⃗_{r}:A⃗_{r} ⊢ v_{r}:B_{r} ; Γ, x′_{1}:Q⃗′_{1}; Δ_{1}, y′_{1}:A⃗′_{1} ⊢ w_{1}:B′_{1} …; Γ, x′_{s}:Q⃗′_{s}; Δ_{s}, y′_{s}:A⃗′_{s} ⊢ w_{s}:B′_{s} Γ; Δ′_{1} ⊢ v′_{1}:Q′′_{1} … Γ; Δ′_{r′} ⊢ v′_{s}:Q′′_{r′}

Γ; Δ′′_{1} ⊢ w′_{1}:A′′_{1} … Γ; Δ′′_{s′} ⊢ w′_{s′}:A′′_{s′}

Γ; Δ ⊢ O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′_{1}, …, v′_{r′}; w′_{1}, …, w′_{s′}):B′′ (O)

where Δ = Δ_{1}# … #Δ_{s}#Δ′_{1}# … #Δ′_{r′}#Δ′′_{1} … Δ′′_{s′}, and there is an instance of this last rule for any operator O with arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

where Q⃗′′ = Q′′_{1} … Q′′_{r′} and A⃗′′ = A′′_{1} … A′′_{s′}.

Definition 4.3.3 (Term) For a typing context Γ; Δ and a linear type A, a Γ; Δ-term v having type A of Lin(𝕆) is a pre-term of Lin(𝕆) such that we can derive Γ; Δ ⊢ v: A. We will often say “the term Γ; Δ ⊢ v:A” meaning “the Γ; Δ term v of type A”.

We now say that, given a typing judgement Γ; Δ ⊢ v:A, a variable x ∈ FV(v) is an intuitionistic free variable of v if it occurs in dom(Γ), and x ∈ FV(v) is an linear free variable of v if it occurs in dom(Δ).

Operators and Natural Deduction

Now that we have presented the basic typing system and shown how operators are assigned arities, it is worth discussing the process by which a sequent-style operator rule becomes a natural deduction typing rule. Our presentation of operators as primitives has been sequent-style from the outset, since we allow new assumptions in the result of an operator. If we were to directly adopt the operator arity rule as the logical rule for the operator, then in our natural deduction system a cut into one of these new assumptions would not be eliminable. In fact, this problem is a generalisation of a problem which historically arose in connection with the promotion rule of ILL, which was first presented for example in [Abr93] as:

{!Γ ⊢ A \atop !Γ ⊢!A} P rom

In that rule, we intuitively bind all the inputs !Γ and introduce fresh ones of the same types, since this operator is not linearly natural. However, if we take this rule then it is not possible to eliminate a cut into one of the assumptions. The solution to this problem as proposed by Benton et al. was to incorporate the possibility of a cut into any of the assumptions, giving the rule:

\begin{aligned}Δ_{1} ⊢!B_{1} & … & Δ_{r} ⊢!B_{r} & !B_{1} …!B_{r} ⊢ A \\ & Δ_{1}, … Δ_{r} ⊢!A \end{aligned} P rom′

This is precisely the approach we have adopted, incorporating the possibility of a cut into any new assumption in the output of an operator, and this approach is the canonical way of turning a sequent system into a natural deduction one.

We choose to work with sequent-style operators partly because they are easier to work with and also since Milner’s action calculi have a sequent-style approach inherited from their categorical underpinning.

We can now prove the following typing properties of Lin(𝕆).

Lemma 4.3.4 (Typing Properties) We have the following in the system Lin(𝕆):

Free Variables I If Γ; Δ ⊢ v:A, then the underlying set of the multiset FV(v) is a subset of dom(Γ) ∪ dom(Δ).

Free Variables II If Γ; x:A, Δ ⊢ v:B, then x occurs precisely once in FV(v).

Strengthening If Γ, x:Q; Δ ⊢ v:B and x ∉ FV(v), then Γ; Δ ⊢ v:B.

I-Transfer If Γ; Δ, x:Q ⊢ v:A, then Γ, x:Q; Δ ⊢ v:A.

Unique Derivation Given a typing context Γ; Δ and a linear type A, for each Γ; Δ term v of type A there is a unique derivation of the typing judgement Γ; Δ ⊢ v:A. Further, given a pre-term v ad a typing context Γ; Δ, there is at most one A such that v is a Γ; Δ-term of type A.

The proofs of these properties are simple. For example, we prove that every term has a unique derivation.

Proof We can prove this by induction over the pre-term structure of v. If the pre-term is a variable, it is clear that there is only one possible derivation, which will use the intuitionistic or linear axiom depending on where the variable is typed in the context. If the pre-term is a let-clause, say let x:Q be v in w, we know that all the linear free variables of v and w are typed in Δ. But then since each distinct free variable must occur either in v or w, we know that Δ = Δ_{1}#Δ_{2} where Δ_{2} is the unique subsequence of Δ which types precisely the linear free variables of v and Δ_{2} is the unique subsequence which types precisely the linear free variables in w. Now, if we take Δ = Δ′_{1}#Δ′_{2}, where Δ_{1} ≠ Δ′_{1} and Δ_{2} ≠ Δ′_{2}, we can see by our free variable lemma that v will not be a Γ; Δ′_{1} − Q term and w will not be a Γ; Δ′_{2} term of type A. Hence the only possible typing derivation of the let x:Q be v in w is constructed from the unique derivation of the typings Γ; Δ_{1} ⊢ v:Q and Γ; Δ_{2} ⊢ w:A. If the pre-term is an operator instance

O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′)

we have precisely the multiary case of the same problem, where we have a unique partition of Δ into subsequences based on the linear free variables of the w⃗v′w′. □

The Substitution Rules

We can now give typed versions of the two cut rules given earlier, with some other typed structural rules:

{Γ, x:Q, y:R, Γ′; Δ ⊢ v:A \atop Γ, y:R, x:Q, Γ′; Δ ⊢ v:A} (I − Exch)  {Γ; Δ, y:B, x:A, Δ′ ⊢ v:C \atop Γ; Δ, x:A, y:B, Δ′ ⊢ v:C} (L − Exch)
{Γ; Δ ⊢ v:A \atop Γ, x:Q; Δ ⊢ v:A} (W eak)  {Γ, x:Q, y:Q; Δ ⊢ v:A \atop Γ, x:Q; Δ ⊢ v\{x/y\}:A} (Cont)
\begin{matrix}Γ; ⊢ w:Q & Γ, x:Q; Δ ⊢ v:A \\ Γ; Δ ⊢ v\{w/x\}:A \end{matrix} (I − Cut)  \begin{matrix}Γ; Δ_{1} ⊢ w:A & Γ; Δ_{2}, x:A ⊢ v:B \\ Γ; Δ ⊢ v\{w/x\}:B \end{matrix} (L − Cut)

where in the linear cut rule, Δ = Δ_{1}#Δ_{2}. These are all admissible typing rules. In particular, the linear exchange is admissible by virtue of the merging that we have incorporated into the F and O rules.

Constants

It will be convenient to consider a particular class of operators, those with arity

{; \atop (; )A}

for some A ∈ M_{L}. An operator O of this form for a given A will have a typing rule of the form:

Γ; ⊢ O(; )(; ):A

We will refer to such an operator as a constant of arity A, and abbreviate the term form O(; )(; ) as O where convenient.

4.4 The Type Theory Lin(𝕆, 𝔸)

We will now present the equality judgement of the type theory. This has two parts, in a similar way to the typing system. We have the structural equality judgements for congruence and the F -equality, and we also assume an axiom set of typed equalities (to capture the behaviour of the operators).

First we need to define the notion of term-context, in order to define congruence. We define a pre-context, written C[ ], as follows:

C[ ] ::= | let x be C[ ] in v | let x be v in C[ ] |
O((x⃗; x⃗)v, …, (x⃗; x⃗)C[ ], …, (x⃗; x⃗)v; (x⃗; x⃗)v, …, (x⃗; x⃗)v)(v⃗; v⃗)
| O((x⃗; x⃗)v, …, (x⃗; x⃗)v; (x⃗; x⃗)v, …, (x⃗; x⃗)C[ ], …, (x⃗; x⃗)v)(v⃗; v⃗)
| O((x⃗; x⃗)v, …, (x⃗; x⃗)v; (x⃗; x⃗)v, …, (x⃗; x⃗)v)(v … C[ ] … v; v⃗)
| O((x⃗; x⃗)v, …, (x⃗; x⃗)v; (x⃗; x⃗)v, …, (x⃗; x⃗)v)(v⃗; v … C[ ] … v)

Now define the instantiation of a pre-context C[ ] by a pre-term v, written C[v], as the pre-context C[ ] but with the unique occurrence of replaced by the pre-term v. It is easy to show that the instantiation of any pre-context by a pre-term is a pre-term.

Definition 4.4.1 (Term Context) A Γ; Δ − A/Γ′; Δ′ − B-term context of Lin(𝕆) is a pre-context C[ ] such that for any term Γ; Δ ⊢ v: A of Lin(𝕆), we have a derivation of the typing judgement Γ′; Δ′ ⊢ C[v]:B.

As before, this definition of contexts is not inductive, but could be equivalently presented in an inductive form.

An equality judgement over the typing system Lin(𝕆) has the form Γ; Δ ⊢ v = w:A, where v and w are both Γ; Δ-terms of type A.

An axiom set is a set of typed equality judgements. We let 𝔸 range over axiom sets. We now define intuitionistic terms:

Definition 4.4.2 (Intuitionistic Term) A Γ; -term is intuitionistic if it is an instance of the following inductive definition:

v ::= x | O((x⃗; x⃗)v, …, (x⃗; x⃗)v; )(; )

for some intuitionistic operator O.

We can now define the derivable equality judgements of the type-theory Lin(𝕆) over the axiom set 𝔸.

Definition 4.4.3 (The Equality of Lin(𝕆) over 𝔸) An equality judgement Γ; Δ ⊢ v = w:A is derivable if it is present in the axiom set 𝔸 or is derivable using the following rules:

(Refl) Γ; Δ ⊢ v = v:A \begin{matrix}Γ; Δ ⊢ v = w:A & Γ; Δ ⊢ w = w′:A \\ Γ; Δ ⊢ v = w′:A \end{matrix} (T rans)
{Γ; Δ ⊢ v = w:A \atop Γ; Δ ⊢ w = v:A} (Sym)  {Γ; Δ ⊢ v = w:A \atop Γ′; Δ′ ⊢ C[v] = C[w]:B} (Cong)

where C[ ] is a Γ; Δ − A/Γ′; Δ′ − B term-context.

(F − β_{v})  Γ; Δ ⊢ let x be v in w = w{v/x}:A

where Γ; ⊢ v:Q is an intuitionistic term

(F − η)  Γ; Δ ⊢ let x be v in x = v:Q
(cc − 1)  Γ; Δ ⊢ let x be v in (let y be w in w′) = let y be (let x be v in w) in w′:A

where x is not free in w′ and y is not free in v

(cc − 2)  Γ; Δ ⊢ let x be v in (let y be w in w′) = let y be w in (let x be v in w′):A

where x is not free in w and y is not free in v

(cc − 3) Γ; Δ ⊢ let x be v in O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′_{1} … w′_{s′}) =

O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′_{1} … (let x be v in w′_{i}) … w′_{s′}):A where x does not occur free other than possibly in w′_{i}

(cc − 4) Γ; Δ ⊢ let x be v in O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′_{1} … v′_{r′}; w′) =

O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′_{1} … (let x be v in v′_{i}) … v′_{r′}; w′):A where x does not occur free other than possibly in v′_{i}

(cc − 5)  Γ; Δ ⊢ let x′ be w in O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(w′; v′) =

O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x⃗_{i}; y⃗_{i})(let x be w in w_{i}), …, (x′_{s}; y′_{s})w_{s})(w′; v′):A where x′ does not occur free other than possibly in v_{i}

We refer to the type-theory with typing system Lin(𝕆) over axiom set 𝔸 as Lin(𝕆, 𝔸).

In considering the axioms, the least intuitive are clearly the commuting conversions. These can be understood by noting that we allow the let -construct to commute into any linearly natural argument place of an operator, or into any of the terms which are incorporated for the free assumptions, as these are not bound by the operator.

Output Naturality

The notion of output naturality is less important than those of intuitionistic and linear naturality, but it is still worth defining as it will prove very convenient. In fact, every operator corresponding to an elimination rule of DILL(ℂ) will be output-natural, and the equalities in the definition will be precisely the commuting conversions of these operators.

Definition 4.4.4 (Output-Parameterised Family) We say that a typing system Lin(𝕆) has an output-parameterised family of operators O if O is a set of operators indexed by the set M_{L}, and the element of the set indexed by the type (or proposition) C, written O_{C}, has arity;

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})(C) \atop (Q⃗′′; A⃗′′)(C)}

where position s is distinguished and s ≥ 1. We will say that the outputparameterised family has arity:

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})( ) \atop (Q⃗′′; A⃗′′)( )}

Definition 4.4.5 (Output Naturality) Given a type-theory Lin(𝕆, 𝔸), an output-parameterised family O with arity:

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})( ) \atop (Q⃗′′; A⃗′′)( )}

is output natural if assuming the following:

• that we have Γx⃗_{i}:Q⃗_{i}; y⃗_{i}:A⃗_{i} ⊢ v_{i}:B_{i} for i = 1 … r

• that we have Γ, y′_{j}:Q⃗′_{j}; Δ_{j}, x⃗_{j}:A⃗′_{j} ⊢ w_{j}:B_{j} for j = 1 … s,

• that we have Γ; Δ′, x′′:B_{s} ⊢ w:C,

• that we have Γ; Δ′′_{i′} ⊢ w′_{i′}:Q′′_{i′} for i′ = 1 … r′, where Q⃗′′ = Q′′_{1} … Q′′_{r′},

• and that we have Γ; Δ′′′_{j′} ⊢ v′_{j′}:A′′_{j′} for j′ = 1 … s′, where A⃗′′ = A′′_{1} … A′′_{s′}. we have the following equality judgement:

Γ; Δ ⊢w{O_{B_{s}}((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′)/x′′}

= O_{C}((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w{w_{s}/x′′})(v′; w′):C

where Δ = Δ_{1}# … #Δ_{s}#Δ′#Δ′_{1}# … #Δ′_{r′}#Δ′′_{1}# … #Δ′′_{s′}. We let ONat(𝕆, O) be the set of all such equalities for an operator O in the typing system Lin(𝕆).

We note here that since any operator which is part of an output-parameterised set of operators in a given typing system Lin(𝕆) has at least one linearly-natural argument (by definition), no such operator can be intuitionistic.

As an example of an output-natural operator, consider the set of operators given by the ⊗ − L-rule of DILL(ℂ). In this framework, it is an output-natural operator set of arity:

{; (; AB)( ) \atop (; A ⊗ B)( )}

and the equalities specified by the definition of output-naturality are just the commuting conversions of this term construct in DILL(ℂ).

The Semantics of Lin(𝕆, 𝔸)

We will now give a semantics for the type theory Lin(𝕆, 𝔸). Just as the underlying structural rules of the logic and type-theory capture the essence of the interaction between linear and intuitionistic behaviour, we expect the models of the underlying structural rules of the type theory to have just the essential structure required to model this interaction. In fact, the models we will use for Lin(𝕆, 𝔸) will be based on a cartesian category interpreting the intuitionistic types, a symmetric monoidal category interpreting the linear types, and a monoidal functor from the cartesian category to the symmetric monoidal category. Operators will then be modelled as natural transformations on hom-sets, and theories will be imposed as sets of equalities on arrows. Having given this framework, we then get soundness and completeness results for the models, and further we get an initiality result for an appropriate category of small models and morphisms.

5.1 The Interpretation

We refer once again to the primitive categorical definitions of appendix A.2, and their numbered equalities.

The carrier of a Lin(𝕆)-model is a triple (C, S, F) such that C is a strict cartesian category, S is a strict symmetric monoidal category and F : C → S is a strict monoidal functor.

Definition 5.1.1 (Lin(𝕆)-Interpretation) An interpretation of the typing system Lin(𝕆), which we write G, is a carrier (C, S, F) together with:

• primitive interpretation functions [[ ]]_{M_{I}}^{G} : M_{I} → obj(C) and [[ ]]_{M_{L}}^{G} : M_{L} → obj(S) such that for all Q ∈ M_{I} we have [[Q]]_{M_{L}}^{G} = F ([[Q]]_{M_{I}}^{G}), • for each operator O ∈ O_{L} having arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

a natural transformation

[[O]]_{O_{L}}^{G} :(×_{i=1...r}S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]]^{G}, [[B_{i}]]_{M_{L}}^{G})) ×
(×_{j=1...s}S(F (_{=}) ⊗ [[Q⃗′_{j}]] ⊗ ( _{j}) ⊗ [[A⃗′_{j}]]^{G}, [[B′_{j}]]_{M_{L}}^{G}))

→ S(F (_{=}) ⊗ [[Q⃗′′]] ⊗ (⊗_{j=1...s}( _{s})) ⊗ [[A⃗′′]]^{G}, [[B′′]]_{M_{L}}^{G})

which is natural independently in each of the s + 1 arguments (_{=}) and ( _{1}), …, ( _{s}), and where the interpretation [[ ]]^{G} is extended to arbitrary contexts in the obvious way, as given shortly,

• for each operator O ∈ O_{I} having arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r}; \\ & (; )R \end{aligned}

a natural transformation

[[O]]_{O_{I}}^{G} : ×_{i=1...r} S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]]^{G}, [[B_{i}]]_{M_{L}}^{G})
→ C(_{=}, [[Q′′]]_{C}^{G})

where the interpretation is again given shortly, such that for all objects X of C and all arrows f_{i} : F (X) ⊗ [[Q⃗_{i}; A⃗_{i}]] → [[B_{i}]] where i = 1 … r in S,

[[O]]_{O_{L}}^{G}(X)(f_{1}, …, f_{r}) = F ([[O]]_{O_{I}}^{G}(X)(f_{1}, …, f_{r}))

Where the particular interpretation we are referring to is clear, we will omit the superscript G on the interpretation function [[ ]].

We now proceed to extend the definition of the interpretation function [[ ]]^{G} to terms for an arbitrary model G of Lin(𝕆).

Definition 5.1.2 (The Interpretation on Contexts) First, for a sequence of linear types A_{1} … A_{r}, define [[A_{1} … A_{r}]]^{G} = A_{1} ⊗ … ⊗ A_{r}. Further, define [[Q_{1} … Q_{s}]]_{C}^{G} = Q_{1} × … × Q_{s} for a sequence of intuitionistic types Q_{1} … Q_{s}. Now, for a pair of a sequence of intuitionistic types and a sequence of linear types Q⃗; A⃗, define [[Q⃗; A⃗]]^{G} = F ([[Q⃗]]_{C}^{G}) ⊗ [[A⃗]]^{G}. Finally overload these notations to sequences of typings and typing contexts using the function | |; for example, for a generalised typing context Γ; Δ define [[Γ; Δ]]^{G} = [[|Γ|; |Δ|]]^{G}. Note that [[Γ; Δ]]^{G} = [[ ; Γ, Δ]]^{G}.

We now define some useful arrows:

disc′ ; Q⃗ : [[Q⃗]] → I
dup′ ; Q⃗ : [[Q⃗]] → [[Q⃗]] ⊗ [[Q⃗]]
merge_{Δ_{1},Δ_{2},Δ} : [[Δ]] → [[Δ_{1}]] ⊗ [[Δ_{2}]]
mmerge_{Δ_{1},... ,Δ_{r},Δ}^{r} : [[Δ]] → [[Δ_{1}]] ⊗ … ⊗ [[Δ_{r}]]
str′_{Γ,Δ_{1},Δ_{2},Δ} : [[Γ; Δ]] → [[Γ; Δ_{1}]] ⊗ [[Γ; Δ_{2}]]
mstr_{Γ,Δ_{1},... ,Δ_{r},Δ}^{r} : [[Γ; Δ]] → [[Γ; Δ_{1}]] ⊗ … ⊗ [[Γ; Δ_{r}]]

as follows:

disc′ ; Q⃗ = F (d_{[[Q⃗]]_{C}})
dup′ ; Q⃗ = F (c_{[[Q⃗]]_{C}})

merge_{Δ_{1},Δ_{2},Δ} = \begin{cases}id_{I} & where Δ = Δ_{1} = Δ_{2} = \\ id_{[[A]]} ⊗ merge_{Δ′_{1},Δ_{2},Δ′} & where Δ_{1} = x:A, Δ′_{1} and Δ = x:A, Δ′ \\ id_{[[A]]} ⊗ merge_{Δ_{1},Δ′_{2},Δ′}; \\ s_{[[A]],[[Δ_{1}]]} ⊗ id_{[[Δ′_{2}]]} & where Δ_{2} = x:A, Δ′_{2} and Δ = x:A, Δ′ \end{cases}

mmerge_{Δ_{1},... ,Δ_{r},Δ}^{r} = \begin{cases}id_{[[Δ]]} & if r = 1 \\ merge_{Δ_{1},(Δ_{2},... ,Δ_{s+2})}; id_{[[Δ_{1}]]} ⊗ mmerge_{Δ_{2},... ,Δ_{s+2}}^{s+1} & where r = s + 2 \end{cases}
str′_{Γ,Δ_{1},Δ_{2},Δ} = dup′_{Γ} ⊗ merge_{Δ_{1},Δ_{2},Δ}; id_{[[Γ]]} ⊗ s_{[[Γ]],[[Δ]]} ⊗ id_{[[Δ_{2}]]}
mstr_{Γ,Δ_{1},... ,Δ_{r},Δ}^{r} = \begin{cases}id_{[[Γ;Δ]]} & if r = 1 \\ str_{Γ,Δ_{1},(Δ_{2},... ,Δ_{s+2})}; id_{[[Γ;Δ_{1}]]} ⊗ mstr_{Γ,Δ_{2},... ,Δ_{s+2}}^{s+1} & if r = s + 2 \end{cases}

Definition 5.1.3 (The Interpretation on Terms) We will interpret a term Γ; Δ ⊢ v:A by induction over the unique derivation of the typing judgement.

Intuitionistic Axiom In this case, we take

[[Γ, x:Q, Γ′; ⊢ x:Q]] = disc′_{Γ} ⊗ id_{[[Q]]} ⊗ disc′_{Γ′}

Linear Axiom In this case, we take

[[Γ; x:A ⊢ x:A]] = disc′_{Γ} ⊗ id_{[[A]]}

The F Rule Assuming that [[Γ; Δ_{1} ⊢ v:Q]] = f and [[Γ, x:Q; Δ_{2} ⊢ w:A]] = g, we take

[[Γ; Δ ⊢ let x be v in w:A]] = str′_{Γ,Δ_{1},Δ_{2},Δ}; f ⊗ id_{[[Γ;Δ_{2}]]}; s_{[[Γ]],[[Q]]} ⊗ id_{[[Δ_{2}]]}; g The Operator Rule Given an operator O of arity:

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

where Q⃗′ = Q′_{1} … Q′_{s} and A⃗′ = A′_{1} … A′_{s′}, assume • that [[Γ, x⃗_{i}:Q⃗_{i}; y⃗_{i}:A⃗_{i} ⊢ v_{i}:B_{i}]] = f_{i} for i = 1 … r,

• that [[Γ; x′_{j}:Q⃗′_{j}; Δ_{j}, y⃗_{j};:A⃗′_{j} ⊢ w_{j}:B′_{j}]] = g_{j} for j = 1 … s,

• that [[Γ; Δ′_{i′} ⊢ v_{i′}:Q′′_{i′}]] = f′_{i′} for i′ = 1 … r′,

• that [[Γ; Δ′′_{j′} ⊢ w′_{j′}:A′′_{j′}]] = g′_{j′} for j′ = 1 … s′ Now we take

[[Γ; Δ ⊢ O((x⃗_{1}; y⃗_{1})v_{1} … (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1} … (x′_{s}; y′_{s})w_{s})(v′; w′):B′′]] = mstr_{Γ,Δ′_{1},... ,Δ′_{r′},Δ_{1},... ,Δ_{s},Δ′′_{1},... ,Δ′′_{s′},Δ}^{r′+s+s′}; (f′_{1} ⊗ … ⊗ f′_{r′} ⊗ id_{[[Δ_{1},... ,Δ_{s}]]} ⊗ ‘g′_{1} ⊗ … ⊗ g′_{s′});

[[O]]_{O_{L}}([[Γ]]_{C}, [[Δ_{1}]], …, [[Δ_{s}]])(f_{1}, …, f_{r}, g_{1}, …, g_{s})

We can also make an auxiliary definition:

Definition 5.1.4 (The Interpretation on Intuitionistic Terms) Define the interpretation [[ ]]_{C}^{G} which takes intuitionistic terms Γ; ⊢ v:A to arrows [[Γ; ]]_{C}^{G} → [[A]]_{M_{I}}^{G} in the cartesian part of the model as follows: Intuitionistic Axiom In this case, we take

[[Γ, x:Q, Γ′; ⊢ x:Q]]_{C} = π_{r+1}^{r+1+s}

where Γ = y_{1}:R_{1} … y_{r}:R_{r} and Γ′ = y′_{1}:R′_{1} … y′_{s}:R′_{s}.

The Operator Rule In this case, we take

[[Γ; ⊢ O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; )(; ):R]]_{C} = [[O]]_{C}([[Γ]]_{C})(f_{1}, …, f_{r}) where for i = 1 … r we have [[Γ, x⃗_{i}:Q⃗_{i}; y⃗_{i}:A⃗_{i} ⊢ v_{i}:B_{i}]] = f_{i} in S.

We now define the models of the type theory Lin(𝕆, 𝔸).

Definition 5.1.5 (Lin(𝕆, 𝔸)-Model) A Lin(𝕆, 𝔸) model G is a Lin(𝕆) interpretation such that: for each typed equality judgement Γ; Δ ⊢ v = w:A in 𝔸, we have [[Γ; Δ ⊢ v:A]]^{G} = [[Γ; Δ ⊢ w:A]]^{G}.

5.2 Soundness

We now show that the equality judgement of Lin(𝕆, 𝔸) is soundly mapped into any model of the type theory Lin(𝕆, 𝔸).

First we state two lemmas on the interpretations of the two admissible substitution rules.

Lemma 5.2.1 (Intuitionistic Substitution) For any Lin(𝕆, 𝔸) model G, given [[Γ, Γ′; ⊢ v:Q]]^{G} = f, where v is intuitionistic and [[Γ, x:Q, Γ′; Δ ⊢ w:A]]^{G} = g, we have:

[[Γ, Γ′; Δ ⊢ w{v/x}:A]]^{G} = str′_{(Γ,Γ′),Δ, ,Δ}; f ⊗ id_{[[Γ,Γ′;Δ]]}; s_{[[Q]],[[Γ]]} ⊗ id_{[[Γ′;Δ]]}; g

Lemma 5.2.2 (Linear Substitution) For any Lin(𝕆, 𝔸) model G, given the interpretations [[Γ; Δ_{1} ⊢ v: A]]^{G} = f and [[Γ; Δ_{2}, x:A, Δ′_{2} ⊢ w:B]]^{G} = g, we have:

[[Γ; Δ ⊢ w{v/x}:B]]^{G} = str′_{Γ,Δ_{1},(Δ_{2},Δ′_{2}),Δ}; f ⊗ id_{[[Γ;Δ_{2},Δ′_{2}]]}; s_{[[A]],[[Γ;Δ_{2}]]} ⊗ id_{[[Δ′_{2}]]}; g

where Δ = Δ_{1}#(Δ_{2}, Δ′_{2}).

Theorem 5 (Soundness) Given a Lin(𝕆, 𝔸) model G and a provable equality Γ; Δ ⊢ v = w:A in Lin(𝕆, 𝔸), we have that:

[[Γ; Δ ⊢ v:A]]^{G} = [[Γ; Δ ⊢ w:A]]^{G}

in the symmetric monoidal part of G.

Proof First we observe that equality of arrows is an equivalence relation, and further that given a Γ; Δ − A/Γ′; Δ′ − A′ context C[ ] and a term Γ; Δ ⊢ t:A, the interpretation of Γ′; Δ′ ⊢ C[t] : A′ in the internal language of the category contains as a sub-term the interpretation of Γ; Δ ⊢ t:A. This implies that our context-equality rule and equivalence rules are sound. Now by definition any typed equality in 𝔸 is soundly interpreted in G, and hence we need only to show that the 7 axiomatic equalities of the let construct are soundly mapped into G. Here, we give as examples the proofs for the first two equalities.

• Considering the equality Γ; Δ ⊢ let x be v in w = w{v/x}: A, we have that:

[[Γ; Δ ⊢ let x be v in w:A]]
= str′_{Γ, ,Δ,Δ}; (f ⊗ id_{[[Γ;Δ]]}); s_{[[|Γ|]],[[Q]]_{M_{L}}} ⊗ id_{[[|Δ|]]}; g

where [[Γ; ⊢ v: Q]] = f and [[Γ, x: Q; Δ ⊢ w: A]] = g, which is precisely [[Γ, y:Q, Γ′; Δ ⊢ v{y/x}:A]] according to our lemma.

• Considering the equality Γ; Δ ⊢ let x be v in x = v:Q, we have that:

[[Γ; Δ ⊢ let x be v in x:Q]]
= str′_{Γ,Δ, ,Δ}; f ⊗ id_{[[Γ;Δ]]}; s_{[[|Γ|]],[[Q]]_{M_{L}}} ⊗ id_{[[|Δ|]]}; (disc_{Γ} ⊗ id_{[[Q]]_{M_{L}}})
= str′_{Γ,Δ, ,Δ}; (f ⊗ disc_{Γ})
= f

again as required.

Constants

We consider the interpretation of a constant in this semantics. By definition, a constant O of arity A in Lin(𝕆, 𝔸) has an interpretation in a Lin(𝕆, 𝔸)-model G as follows:

[[O]]_{O_{L}}^{G} : {i} → S(F (_{=}), [[A]]_{M_{L}}^{G})

However, natural transformations of this form are isomorphic to arrows S(I, [[A]]_{M_{L}}^{G}), and so we will frequently refer to the interpretation of a constant as having this latter form.

We now want to show completeness of Lin(𝕆, 𝔸) with respect to its models, which is to say that if two Γ; Δ terms of type A have the same interpretation in every Lin(𝕆, 𝔸) model, then they are provably equal in Lin(𝕆, 𝔸). This is a familiar result for type theories and their models, and it is commonly proved by the construction of a term model, in which the objects are types and the morphisms are terms. In such a term model, we use the structure of the typetheory to build the categorical structure required of the model. However, such constructions normally depend on the existence of the appropriate functors in the model as type constructors, for example as ⊗ occurs explicitly in DILL(ℂ). Typetheories such as ours which have no type-constructors as basic must therefore be treated differently. The most one can normally hope for in these cases is that there exists a term category in which the objects and morphisms are freely constructed in a simple way from the types and terms of the theory; the best example of this is the construction of a term cartesian category from sequences of types and terms of the basic intuitionistic type-theory having only axiom and cut rules. Operators can be added in this example, and the result extended to show that given any operator over the objects of the free strict cartesian category on the types of the theory, there exists a set of operators such that the term model of the type theory over this set is isomorphic to the free strict cartesian category with the original operator.

This result tells us that working in the type theory without an explicit product constructor is the same as working in the type theory with that constructor added, even when we are allowed arbitrary operators over the types of the theory with explicit product constructors. As an example of the method, imagine a nullary operator (a constant) (A)B × C c in the theory with products. Clearly there is no one operator which represents this in the theory without explicit products, since B × C is not a type of that theory. However, we can represent the operator as a pair of operators c_{1}, c_{2} having arities (A)B c_{1} and (A)C c_{2}, both of which can exist in the theory without products, and prove that the resulting type theory is equivalent to the type theory with products over the original operator c.

Unfortunately, there is no result of this kind for SMC’s and the basic linear type theory except for the case with no operators. The problem is that given for example a constant (A)B ⊗ C c′ in the theory with tensor, there is no equivalent set of operators in the theory without tensors- it is not possible to represent this as a pair since linearity demands that B and C be produced and used together. This behaviour is inherited by our system, since it clearly incorporates the basic linear type theory but without an explicit tensor type constructor.

The implication of this discussion is that our type theory is only expressive enough to represent SMC’s having a certain subclass of the obvious operators, ie those not mentioning the tensor or the unit in the outputs of either the arguments or the results of the operator.

5.3 The Term Model

It is normal to define the term model of a type-theory using categories having as objects and arrows elementary constructions over the types and terms of the type theory. In particular, it is normal in the case of a linear type-theory to construct a symmetric monoidal term category using sequences of types and terms of the type theory. However, in this case such a construction is not rich enough in arrows, as can be seen from the fact that any interpretation of Lin(𝕆) has in its s.m.c. part an arrow F X → F X ⊗F X for any object X of C. The natural next step is therefore to allow constructions of the form let x be v in ...(let y be v′ in w_{1} … w_{r}) which augment the sequence construction sufficiently to allow us to express the correct arrows. Unfortunately, once we have made this construction certain obvious equalities appear between constructed elements, notably the equalities which would be commuting conversions in a type-theoretic setting. Whilst the construction could be pushed through, it seems clearer to present a slightly amended type-theory which we can use directly to construct the term-model, and then to relate this extended type theory to the original type theory.

We will therefore define the term Lin(𝕆, 𝔸)-model by giving its objects and morphisms as the types and terms of this slightly extended type theory, and then show that this new type theory is a full and faithful extension of Lin(𝕆, 𝔸). Hence the completeness result follows.

Definition 5.3.1 (The Type Theory Lin^{⊗}(𝕆, 𝔸)) For a signature 𝕆 = (M_{I}, M_{L}, O_{I}, O_{L}) and an axiom set 𝔸 we define the type theory Lin^{⊗}(𝕆, 𝔸) as Lin((M_{I}^{⊗}, M_{L}^{⊗}, O_{I}^{⊗}, O_{L}^{⊗}), 𝔸^{⊗}), where we define M_{I}^{⊗}, M_{L}^{⊗}, O_{I}^{⊗}, O_{L}^{⊗} and 𝔸^{⊗} as follows:

• M_{I}^{⊗} is the set of sequences of length one each containing an element of M_{I}, which we will refer to briefly as singleton sequences.

• M_{L}^{⊗} is the set of sequences of elements of M_{L}. We will write a sequence A⃗ of elements of M_{L} as ⊗A⃗ and may write the empty sequence of such elements as I.

We will refer to typing contexts of Lin^{⊗}(𝕆, 𝔸) using the familiar Γ; Δ, and we define a function to convert Lin(𝕆) typing contexts to Lin^{⊗}(𝕆, 𝔸) typing contexts. On sequences of linear types A_{1} … A_{r}, define \overbrace{A_{1} … A_{r}} as the sequence of singleton sequences containing A_{1} to A_{r} respectively. We extend this function to sequences of typings and hence typing contexts by defining \overbrace{x:A} = x:\overbrace{A}. We also extend to pre-terms simply by applying it to each type annotation in the pre-term, but when we omit type annotations on pre-terms, we also omit on pre-terms.

Although in fact one might argue that \overbrace{Γ; Δ} = Γ; Δ, by identifying singletons and the single element they contain, we retain the syntax here to help make the distinction between the two type theories clear.

Now,

• O_{L}^{⊗} is the set containing an operator O of arity

\begin{aligned}(\overbrace{Q⃗_{1}; A⃗_{1}}) \overbrace{B_{1}}, & …, & (\overbrace{Q⃗_{r}; A⃗_{r}}) \overbrace{B_{r}} & ; & (\overbrace{Q⃗′_{1}; A⃗′_{1}}) \overbrace{B′_{1}}, & …, & (\overbrace{Q⃗′_{s}; A⃗′_{s}}) \overbrace{B′_{s}} \\ & & (\overbrace{Q⃗′′; A⃗′′}) \overbrace{A′′} \end{aligned}

for each operator O ∈ O_{L} having arity:

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

with the addition of a weak tensor operator ⊗r ; B⃗ of arity:

\begin{aligned}; & (; )B_{1}, & …, & (; )B_{r} \\ & (; ) ⊗ (B_{1} … B_{r}) \end{aligned}

for each r ≠ 1, such that each B_{i} is a singleton sequence.

• O_{I}^{⊗} is the subset of O_{L}^{⊗} containing those operators induced by operators in O_{I} ⊆ O_{L}.

• 𝔸^{⊗} is the set containing \overbrace{Γ; Δ} ⊢ v = w:\overbrace{A} for each equality Γ; Δ ⊢ v = w: A in 𝔸.

It is fairly obvious that given a term Γ; Δ ⊢ v:A of Lin(𝕆, 𝔸), we have that \overbrace{Γ; Δ} ⊢ v:\overbrace{A} in Lin^{⊗}(𝕆, 𝔸). We will write ⊗^{r}(; ()v_{1}, …, ()v_{r})(; ) as ⊗(v_{1}, …, v_{r}) for clarity, and we define the abbreviation ⊗(v) = v, noting that there is no instance of the operator when r = 1 by definition.

It is important to note that although we are now using arbitrary sequences of the types of Lin(𝕆, 𝔸) for types, the operators of Lin^{⊗}(𝕆, 𝔸) have arities only involving singleton sequences, with the exception of the tensor operators. In particular, any set of operators which is output natural in Lin(𝕆, 𝔸) will not be output natural in Lin^{⊗}(𝕆, 𝔸), since there can be no instance of the operator family for any case where the indexing type is not a singleton sequence. This is a consequence of our preceding discussion, where we remarked that only a certain subclass of the operators which could be given over the type set with explicit tensor can be given in Lin(𝕆, 𝔸).

Now say that a pre-term of Lin^{⊗}(𝕆, 𝔸) is in canonical form if it is an instance of the following inductive definition, where the v are pre-terms of Lin(𝕆, 𝔸):

v_{c} ::= ⊗v⃗ | let x be v in v_{c}

Now we can prove a crucial lemma:

Lemma 5.3.2 Given a typing judgement \overbrace{Γ; Δ} ⊢ v:⊗A⃗ of Lin^{⊗}(𝕆, 𝔸), v is identically in canonical form with the various pre-terms of Lin(𝕆, 𝔸) in v being terms of Lin(𝕆, 𝔸). Note that the typing contexts Γ′; Δ′ which the pre-terms are typable in are uniquely determined from the typing context Γ; Δ and the form of the pre-term.

This lemma bears some explanation before we prove it. The reason we have defined the tensor of the theory Lin^{⊗}(𝕆, 𝔸) weakly is so that this lemma is provable. This lemma then shows that the only terms provably of tensor type in Lin^{⊗}(𝕆, 𝔸) are simply built up from tensors of terms of Lin(𝕆, 𝔸) with shared intuitionistic variables. Further, an important implication of the lemma is that in the case where ⊗A⃗ is a singleton B, v is identically a Γ; Δ-term of type B in Lin(𝕆, 𝔸).

Proof We prove this by induction over the unique derivation of the typing judgement \overbrace{Γ; Δ} ⊢ v:⊗(A_{1} … A_{s}).

Intuitionistic Axiom In this case we must have a derivation \overbrace{Γ′, x′:Q′}; ⊢ x′: Q′, where the sequence ⊗(A⃗) must be the singleton Q, and hence the term is in the correct form.

Linear Axiom In this case, we must have a derivation \overbrace{Γ; x′:A′} ⊢ x′: A′ and hence again we have that the derivation is in the correct form.

F Rule In this case we must have a derivation:

\overbrace{Γ; Δ′′_{1}} ⊢ w:Q′ \overbrace{Γ, x′:Q′; Δ′′_{2}} ⊢ v:⊗(A_{1} … A_{s})
\overbrace{Γ; Δ} ⊢ let x′ be w in v:⊗(B_{1} … B_{s})

where Δ = Δ′′_{1}#Δ′′_{2}. However, in this case, we know by induction that there exist terms of Lin(𝕆, 𝔸) v′, v′′ and variables x⃗ such that v is:

let x_{1} be v′_{1} in … let x_{r} be v′_{r} in ⊗v′′

But since w must be a Γ; Δ′′_{2}-term of Lin(𝕆, 𝔸) by induction, we have that \overbrace{Γ; Δ} ⊢ let x′ be w in v:⊗(A_{1} … A_{s}) has the correct form.

Operator Rule In this case we need to consider first the operators of O_{L}. Since these are operators over the types M_{L}, it is impossible that one should exist with result having output of a tensor type. Hence they can be disregarded. Now considering an instance of the tensor rule, we have a derivation:

\begin{matrix}\overbrace{Γ; Δ′′_{1}} ⊢ v_{1}:A_{1}, & …, & \overbrace{Γ; Δ′′_{s}} ⊢ v_{s}:A_{s} \\ \overbrace{Γ; Δ} ⊢ ⊗v⃗:⊗(A_{1} … A_{s}) \end{matrix}

where Δ = Δ′′_{1}# … #Δ′′_{s} (and the A_{s} are singletons). However, by induction on the the \overbrace{Γ; Δ′′_{i}} ⊢ v_{i}:A_{i} for i = 1 … s, we know that these must be Γ; Δ′′_{i}- terms of Lin(𝕆, 𝔸), and hence \overbrace{Γ; Δ} ⊢ ⊗v⃗: ⊗(A_{1} … A_{s}) has the correct form.

□

We can now define the term model of Lin(𝕆, 𝔸), G_{T} (𝕆, 𝔸).

Definition 5.3.3 (The Linear Term Category) We define the linear term category, S_{T}, as follows:

• The objects of S_{T} are the sequences of linear types of Lin(𝕆).

• S_{T} (A⃗, B⃗) = \{[(x⃗, v)^{A⃗,B⃗}]| ; \overbrace{x⃗:A⃗} ⊢ v: ⊗(B⃗)\}, where we write [(x⃗, v)^{A⃗,B⃗}] to denote the equivalence class of (x⃗, v)^{A⃗,B⃗} under the equivalence ≡′ defined by

(x⃗, v)^{A⃗,B⃗} ≡′ (y⃗, w)^{A⃗,B⃗} if ; \overbrace{x⃗:A⃗} ⊢ v = w\{x⃗/y⃗\}:⊗B⃗

As in previous definitions of this sort, we write [x⃗, v]^{A⃗,B⃗} for [(x⃗, v)]^{A⃗,B⃗}, omit type information where possible and assume that when writing the equivalence classes of arrows [x⃗, v] and [y⃗, w], the variable sequences are chosen to make all the variables in the concatenation x⃗y⃗ distinct, unless explicitly identified.

• idA⃗ = [x⃗, ⊗x⃗]

• [x⃗, v]; [y⃗, w] =

[x⃗, let x_{1} be v′_{1} in … let v′_{r} be v′_{r} in (w{v′′/y⃗})]

where by our previous lemma v is let x′_{1} be v′_{1} in … let x′_{r} be v′_{r} in ⊗v′′.

It is easy to show that these definitions give a category. We proceed to define a strict s.m. structure on S_{T}. First define the tensor on objects, which are sequences of types, as concatenation. Then define [x⃗, v] ⊗ [y⃗, w] as

[x⃗y⃗, let x′_{1} be v′_{1} in … let x′_{r} be v′_{r} in let y′_{1} be w′_{1} in … let y′_{r′} be w′_{r′} in ⊗(v′′w′′)]

where again by our previous lemma v is let x′_{1} be v′_{1} in … let x′_{r} be v′_{r} in ⊗v′′ and w is let y′_{1} be w′_{1} in … let y′_{r′} be w′_{s′} in ⊗w′′.

In order to define the intuitionistic term category, we need an auxiliary definition.

Definition 5.3.4 (Intuitionistic Equality) We say that two intuitionistic terms Γ; ⊢ v:Q and Γ; ⊢ w:Q are intuitionistically equal, which we write Γ; ⊢ v =_{I} w:Q, if they are identically equal, or if v is O((x⃗_{1}; y⃗_{1})v′_{1}, …, (x⃗_{r}; y⃗_{r})v′_{r}; )(; ), w is O((x⃗_{1}; y⃗_{1})w′_{1}, …, (x⃗_{r}; y⃗_{r})w′_{r}; )(; ) and

Γ, x⃗_{i}:Q⃗_{i}; y⃗_{i}:A⃗_{i} ⊢ v′_{i} = w′_{i}:B_{i}

for all i = 1 … r.

Definition 5.3.5 (The Intuitionistic Term Category) We define the intuitionistic term category, C_{T}, as follows:

• The objects of C_{T} are sequences of intuitionistic types of Lin(𝕆, 𝔸).

• The arrows are given:

C_{T} (Q⃗, R⃗) = \{[(x⃗, v⃗)^{Q⃗,R⃗}]| \overbrace{x⃗:Q⃗}; ⊢ v_{i}:R_{i} (where the v_{i} are

intuitionistic for i = 1 … s)}

where R⃗ = R_{1} … R_{s} and we write [(x⃗, v⃗)^{Q⃗,R⃗}] to denote the equivalence class of (x⃗, v⃗)^{Q⃗,R⃗} under the equivalence ≡′_{C} defined by

(x⃗, v⃗) ≡′_{C} (y⃗, w⃗) if v⃗ = v_{1} … v_{r}, w⃗ = w_{1} … w_{r}
and x⃗:Q⃗; ⊢ v_{i} =_{I} w_{i}{y⃗/x⃗}:R_{i} for i = 1 … r

Again, we write [x⃗, v⃗]^{Q⃗,R⃗} for [(x⃗, v⃗)]^{Q⃗,R⃗}, omit type information where possible and assume that when writing the equivalence classes of arrows [x⃗, v⃗] and [y⃗, w⃗], the variable sequences are chosen to make all the variables in the concatenation x⃗y⃗ distinct, unless explicitly identified.

• idQ⃗ = [x⃗, x⃗]

• [x⃗, v⃗]; [y⃗, w⃗] = [x⃗, w⃗{v⃗/y⃗}]

We can equip C_{T} with a cartesian structure by defining the product to be concatenation on sequences, and giving the arrow structure as follows:

⟨[x⃗, v⃗], [x⃗, w⃗]⟩ = [x⃗, v⃗w⃗]
p_{i} = [x⃗, x_{i}]

This construction is familiar, as it is almost identical to that which we used for the intuitionistic part of the term model of DILL(ℂ). Similar proofs show that these definitions make C_{T} into a cartesian category.

We can now define the functor F_{T} : C_{T} → S_{T} as the identity on objects of C_{T}, and on arrows by:

F ([x⃗, v⃗]) = [y⃗, let x⃗ be y⃗ in ⊗v⃗]

We can easily check that this definition is functorial, and further that F is a strict monoidal functor. We now define the term model G_{T} (𝕆, 𝔸) of Lin(𝕆, 𝔸).

Definition 5.3.6 (The Term Lin(𝕆, 𝔸)-Model) The carrier of the term model G_{T} (𝕆, 𝔸) is the triple (C_{T} , S_{T} , F_{T}), and the primitive interpretation functions are given as follows:

• [[ ]]_{M_{I}}^{G_{T} (𝕆,𝔸)} takes the intuitionistic types to the singleton sequences containing them in C_{T}.

• [[ ]]_{M_{L}}^{G_{T} (𝕆,𝔸)} takes the linear types to the singleton sequences containing them in S_{T}. Clearly for all Q ∈ M_{I} we have [[Q]]_{M_{L}}^{G_{T}} = F ([[Q]]_{M_{I}}^{G_{T}}).

• Given an operator O ∈ O_{I} having arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r}; \\ & (; )R \end{aligned}

define the natural transformation [[O]]_{O_{I}}^{G_{T} (𝕆,𝔸)} at Q⃗′ on arrows [x′x⃗_{i}y⃗_{i}, v_{i}] for i = 1 … r to be the arrow

[(x′, O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; )()]

• Given an operator O ∈ O_{L} having arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

define the natural transformation [[O]]_{O_{L}}^{G_{T} (𝕆,𝔸)} to be that which when applied at R⃗, C⃗_{1} … C⃗_{s} to the arrows [z⃗x⃗_{i}y⃗_{i}, v_{i}] for i = 1 … r and [z⃗x′_{j}z′_{j}y′_{j}, w_{j}] for j = 1 … s gives the arrow

[z⃗x′′z′_{1} … z′_{s}y′′, O((x⃗_{1}; y⃗_{1})(v_{1}), …, (x⃗_{r}; y⃗_{r})(v_{r}); (x′_{1}; y′_{1})(w_{1}), …, (x′_{s}; y′_{s})(w_{s}))(x′′; y′′)]

Clearly these two definitions satisfy the condition on the interpretation of operators in the two categories.

In order to show that this is indeed a model, we need to observe that the conditions on Lin(𝕆)-interpretations and Lin(𝕆, 𝔸)-models hold. This is easily done once we have proved the following lemma.

Lemma 5.3.7 Given a term x⃗:Q⃗; y⃗:A⃗ ⊢ v:B of Lin(𝕆, 𝔸) such that [[x⃗:Q⃗; y⃗:A⃗ ⊢ v:B]]^{G_{T} (𝕆,𝔸)} = [x⃗y⃗, w]^{Q⃗A⃗,B}, we can derive the equality judgement in Lin^{⊗}(𝕆, 𝔸):

\overbrace{x⃗:Q⃗; y⃗:A⃗} ⊢ w = v:B

5.4 Completeness

We now present a lemma relating Lin(𝕆, 𝔸) to Lin^{⊗}(𝕆, 𝔸).

Lemma 5.4.1 Given an equality judgement \overbrace{Γ; Δ} ⊢ v = w: \overbrace{A} in Lin^{⊗}(𝕆, 𝔸), we have an equality judgement Γ; Δ ⊢ v = w:A in Lin(𝕆, 𝔸).

Proof Firstly, we know that both v and w are Γ; Δ terms of type A in Lin(𝕆, 𝔸) by the lemma 5.3.2. We prove the lemma by induction over the structure of the proof of the equality judgement \overbrace{Γ; Δ} ⊢ v = w:\overbrace{A} in Lin^{⊗}(𝕆, 𝔸). If the last rule was any of the reflexivity, symmetry or transitivity rules then by the induction hypothesis the proof is easy. If the last rule was the term-context rule then it is easy to see that the \overbrace{Γ; Δ} − \overbrace{A} / \overbrace{Γ′; Δ′} − \overbrace{B} term context of Lin^{⊗}(𝕆, 𝔸) used in the rule is also a Γ; Δ − A/Γ′Δ′ − B term context of Lin(𝕆, 𝔸), and hence that the result follows from the induction hypothesis. Considering the axiomatic equalities, those generated from equalities in 𝔸 are clearly the images of equalities in Lin(𝕆, 𝔸), the naturality equations clearly must mention the operator ⊗ and hence are not terms in the appropriate context (since if they were they would be pre-terms of Lin(𝕆, 𝔸), which is a contradiction) and finally, the axiomatic equalities which are commuting conversions for the let -construct Lin^{⊗}(𝕆, 𝔸) are the images of instances of the same equalities in Lin(𝕆, 𝔸). □

This shows that the embedding from Lin(𝕆, 𝔸) into Lin^{⊗}(𝕆, 𝔸) is faithful. We also know that it is full by virtue of lemma 5.3.2.

We can use these results to relate the term model and Lin(𝕆, 𝔸) as follows:

Lemma 5.4.2 The arrows A⃗ → B in the symmetric monoidal category of the term model, S_{T}, are isomorphic to the terms ; x⃗: A⃗ ⊢ v: B of Lin(𝕆, 𝔸) quotiented by provable equality.

Proof Firstly consider arrows A⃗ → B in S_{T}. These are equivalence classes of terms of Lin^{⊗}(𝕆, 𝔸) ; \overbrace{x⃗:A⃗} ⊢ v:B quotiented by term equality and α-conversion on free variables. But we know that such terms of Lin^{⊗}(𝕆, 𝔸) are isomorphic to terms of Lin(𝕆) ; x⃗:A⃗ ⊢ w:B by our lemmas relating the two type theories, and hence the result follows. □

Now we can prove soundness and completeness:

Theorem 6 (Soundness and Completeness) Given Γ; Δ terms v and w of type A in Lin(𝕆, 𝔸), Γ; Δ ⊢ v = w:A if and only if [[Γ; Δ ⊢ v:A]]^{G} = [[Γ; Δ ⊢ w:A]]^{G} for all Lin(𝕆, 𝔸)-models G.

Proof This proof is largely by standard means. We already have the forward direction thanks to our proof of soundness. To show the other direction, assume that:

[[Γ; Δ ⊢ v:A]]^{G_{T} (𝕆,𝔸)} = [x⃗y⃗, v′] = [x⃗y⃗, w′] = [[Γ; Δ ⊢ w:A]]^{G_{T} (𝕆,𝔸)}

where Γ = x⃗: Q⃗ and Δ = y⃗: B⃗, for the particular Lin(𝕆, 𝔸)-model G_{T} (𝕆, 𝔸). Now by lemma 5.3.7 and the definition of equality in G_{T} (𝕆, 𝔸) we have that:

\overbrace{Γ; Δ} ⊢ v = v′:\overbrace{A} and \overbrace{Γ; Δ} ⊢ w = w′:\overbrace{A}

and \overbrace{; Γ, Δ} ⊢ v′ = w′:\overbrace{A}.

From this last equality we can construct an equality judgement \overbrace{Γ; Δ} ⊢ v′ = w′:\overbrace{A} using the \overbrace{Γ; Δ} − \overbrace{A} / \overbrace{; Γ, Δ} − \overbrace{A} term context , and hence by transitivity we have the equality judgement \overbrace{Γ; Δ} ⊢ v = w:\overbrace{A}. But now using our last lemma, we have the required equality judgement of Lin(𝕆, 𝔸):

Γ; Δ ⊢ v = w:A
□

5.5 Initiality

We now define suitable Lin(𝕆)-maps and prove that the term model G_{T} (𝕆, 𝔸) is (strictly) initial in the category of small Lin(𝕆, 𝔸)-categories and Lin(𝕆)-maps.

Definition 5.5.1 (Lin(𝕆)-Maps) Define a Lin(𝕆)-map F : G → G′ for Lin(𝕆)-interpretations G and G′ having carriers (C, S, F) and (C′, S′, F′) respectively as a pair of functors (F_{C} : C → C′, F_{S} : S → S′) such that:

• F_{C} is strict cartesian and F_{S} is strict symmetric monoidal,

• the following diagram commutes:

[figure: C; F; S; C′; F_{C}; F′; S′; F_{S}]

• F_{C}([[ ]]_{M_{I}}^{G}) = [[ ]]_{M_{I}}^{G′} : M_{I} → obj(C′),

• F_{S}([[ ]]_{M_{L}}^{G}) = [[ ]]_{M_{L}}^{G′} : M_{L} → obj(S′),

• for each operator O ∈ O_{I} with arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r}; \\ & (; )R \end{aligned}

object X of C and arrows f_{i} : F (X) ⊗ [[Q⃗_{i}; A⃗_{i}]] → [[B_{i}]] for i = 1 … r of S,

F_{C}([[O]]_{O_{I}}^{G}(X)(f_{1} … f_{r})) = [[O]]_{O_{I}}^{G′}(F_{C}(X)(F_{S}(f_{1}), …, F_{S}(f_{r})))

• for each O ∈ O_{L}, object X of C, objects Y_{1} … Y_{s} and arrows of S f_{i} : F (X)⊗ [[Q⃗_{i}; A⃗_{i}]] → [[B_{i}]] for i = 1 … r and g_{j} : F (X) ⊗ [[Q⃗′_{j}]] ⊗ Y_{j} ⊗ [[A⃗′_{j}]] → [[B′_{j}]] for j = 1 … s,

F_{S}([[O]]_{O_{L}}^{G}(X, Y_{1}, …, Y_{s})(f_{1} … f_{r}, g_{1} … g_{s})) =

[[O]]_{O_{L}}^{G′}(F_{C}(X), F_{S}(Y_{1}), …, F_{S}(Y_{s}))(F_{S}(f_{1}), …, F_{S}(f_{r}), F_{S}(g_{1}), …, F_{S}(g_{s}))

Now define the category of small Lin(𝕆, 𝔸)-models, Cat_{Lin}(𝕆, 𝔸), to be the category having objects the small Lin(𝕆, 𝔸)-models and morphisms the Lin(𝕆)- morphisms between them.

Now we will prove that each Lin(𝕆, 𝔸)-model canonically yields a Lin^{⊗}(𝕆, 𝔸)- model, simply by interpreting sequences of types as the tensor of the interpretation and interpreting the tensor operator on a sequence of terms as the obvious tensor of the interpretations of the terms, with the intuitionistic context duplicated.

Lemma 5.5.2 Given a Lin(𝕆, 𝔸)-model G, we can construct a Lin^{⊗}(𝕆, 𝔸)-model G′ as follows:

• The carrier of G′ will be the carrier of G, (C, S, F).

• The primitive interpretation function [[ ]]_{M_{I}^{⊗}}^{G′}, which takes singleton sequences of elements of M_{I} to objects of C, is just the function which takes the singleton sequence containing Q to [[Q]]_{M_{I}}^{G}.

• The primitive interpretation function [[ ]]_{M_{L}^{⊗}}^{G′}, which takes sequences of elements of M_{L} to objects of S, is just the function which takes the sequence A_{1} … A_{r} to [[A_{1}]]_{M_{L}}^{G} ⊗ … ⊗ [[A_{r}]]_{M_{L}}^{G}. These two definitions clearly satisfy the equality [[ ]]_{M_{L}^{⊗}}^{G′} = F ([[ ]]_{M_{I}^{⊗}}^{G′}) over singleton sequences of intuitionistic types.

• Since [[\overbrace{Γ; Δ}]]^{G′} = [[Γ; Δ]]^{G} on objects of S, as is easily seen from the definitions, the natural transformation [[O]]_{O_{L}^{⊗}}^{G′} is just the natural transformation [[O]]_{O_{L}}^{G} on operators of Lin(𝕆, 𝔸), and similarly for O_{I}. Clearly this definition satisfies the condition on these interpretation functions.

• For the tensor operator of Lin^{⊗}(𝕆, 𝔸),

\begin{matrix}; (; )A_{1}, & …, & (; )A_{r} \\ (; ) ⊗ (A_{1} … A_{r}) \end{matrix} ⊗_{Γ,Δ_{1},...Δ_{r},A⃗}^{r}

say [[⊗^{r}]](X, Y_{1}, …, Y_{r})_{O_{L}^{⊗}}^{G′} is the function which given f_{i} : F (X) ⊗ Y_{i} → [[A⃗]] for i = 1 … r, takes value:

n_{X,Y_{1},... ,Y_{r}}^{r}; (f_{1} ⊗ … ⊗ f_{r})

where n_{X,Y_{1},... ,Y_{r}}^{r} is the obvious map taking

F (X) ⊗ A_{1} ⊗ … ⊗ A_{r} → ⊗(F (X) ⊗ A_{1}), …, (F (X) ⊗ A_{r})

It can now easily be shown that G′ is a Lin^{⊗}(𝕆, 𝔸)-model, and further that on terms of Lin^{⊗}(𝕆, 𝔸) \overbrace{Γ; Δ} ⊢ v:A which are the images of terms of Lin(𝕆, 𝔸) Γ; Δ ⊢ v:A, we have:

[[\overbrace{Γ; Δ} ⊢ v:A]]^{G′} = [[Γ; Δ ⊢ v:A]]^{G′}

in the s.m. category S.

Definition 5.5.3 (Canonical Morphism) Given a Lin(𝕆, 𝔸)-model G, define the morphism FT^{G} : G_{T} (𝕆, 𝔸) → G as follows, where FT^{G} = (FT _{C}^{G}, FT _{S}^{G}):

• On objects of C_{T}, which are sequences of intuitionistic types of Lin(𝕆), Q⃗, define FT_{C}(Q⃗) = [[Q⃗]]_{C}^{G}.

• On arrows of C_{T}, which are equivalence classes [x⃗, v⃗]^{Q⃗,R⃗} for intuitionistic terms v of Lin^{⊗}(𝕆, 𝔸), define FT_{C}([x⃗, v⃗]) as ⟨f_{1}, …, f_{r}⟩, where f_{i} = [[ ; \overbrace{x⃗:A⃗} ⊢ v_{i}:⊗B⃗]]_{C}^{G′}for i = 1 … r, where G′ is the model of Lin^{⊗}(𝕆, 𝔸) which is generated from the Lin(𝕆, 𝔸)-model G. Note that since the models have the same carrier, the interpretation takes arrows of C_{T} to arrows in the cartesian part of G as required.

• On objects of S_{T}, which are sequences of linear types of Lin(𝕆), A⃗, define FT_{S}(A⃗) = [[A⃗]]^{G}.

• On arrows of S_{T}, which are equivalence classes [x⃗, v]^{A⃗,B⃗} for terms v of Lin^{⊗}(𝕆, 𝔸), define FT_{S}([x⃗, v]) as [[ ; \overbrace{x⃗:A⃗} ⊢ v:⊗B⃗]]^{G′} where G′ is the model of Lin^{⊗}(𝕆, 𝔸) which is generated from the Lin(𝕆, 𝔸)-model G. Note that since the models have the same carrier, the interpretation takes arrows of S_{T} to arrows in the s.m.c. part of G as required.

We now prove two auxiliary lemmas:

Lemma 5.5.4 Given a term \overbrace{y⃗:Q⃗; x⃗:A⃗} ⊢ v: ⊗B⃗ of Lin^{⊗}(𝕆, 𝔸), we have that for an arbitrary Lin(𝕆)-morphism (F_{C}, F_{S}) : G_{T} (𝕆, 𝔸) → G′:

F_{S}([y′x⃗, let y⃗ be y′ in v]) = [[\overbrace{y⃗:Q⃗; x⃗:A⃗} ⊢ v:⊗B⃗]]^{G′}

Proof The proof proceeds by induction over the derivation \overbrace{y⃗:Q⃗; x⃗:A⃗} ⊢ v:⊗B⃗.

• In the case of an intuitionistic axiom instance \overbrace{x⃗:Q⃗, y:R, x′:Q⃗′}; ⊢ y:R, we have that:

[x′′y′x′′′, let x⃗yx′ be x′′y′x′′′ in y] = F_{T} (d_{[[Q⃗]]_{C}^{G_{T} (𝕆,𝔸)}} × id_{[[R]]_{C}^{G_{T} (𝕆,𝔸)}} × d_{[[Q⃗′]]_{C}^{G_{T} (𝕆,𝔸)}})

But all of these constructs are preserved by the fact that F_{T}; F_{S} = F_{C}; F and that F_{C} strictly preserves the cartesian structure, and so we have:

F_{S}([x′′y′x′′′, let x⃗yx′ be x′′y′x′′′ in y]) = F (d_{[[Q⃗]]_{C}^{G}} × id_{[[R]]_{C}^{G}} × d_{[[Q⃗′]]_{C}^{G}})

as required.

• In the case of a linear axiom instance \overbrace{y⃗:Q⃗; x:A} ⊢ x:A we have that:

[y′x, let y⃗ be y′ in x] = F_{T} (d_{[[Q⃗]]_{C}^{G_{T} (𝕆,𝔸)}}) ⊗ id_{[[A]]^{G_{T} (𝕆,𝔸)}}

But again, these constructs are preserved since F preserves F and the monoidal structure, and so we have:

F_{S}([y′x, let y⃗ be y′ in x]) = F (d_{[[Q⃗]]_{C}^{G}}) ⊗ id_{[[A]]^{G}}

• In the case of an instance of the F -rule:

\begin{matrix}\overbrace{y⃗:Q⃗; x′:A⃗′} ⊢ v:Q′ & \overbrace{y⃗:Q⃗, y′:Q′; X⃗′′:A⃗′′} ⊢ w:⊗B⃗ \\ \overbrace{y⃗:Q⃗; x⃗:A⃗} ⊢ let y′ be v in w:⊗B⃗ \end{matrix} (F)

where x⃗:A⃗ = (x′:A⃗′)#(x′′:A⃗′′), we have that

[y′′x⃗, let y′ be v in w] = str′_{Q⃗,A⃗′,A⃗′′,A⃗}; ([y′′x′, let y⃗ be y′ in v] ⊗ id_{[[Q⃗;A⃗′′]]^{G_{T} (𝕆,𝔸)}});

(s_{[[Q⃗]]^{G_{T} (𝕆,𝔸)},[[Q′]]^{G_{T} (𝕆,𝔸)}} ⊗ id_{[[A⃗′′]]^{G_{T} (𝕆,𝔸)}}); [y′′y′′′, let y⃗y′ be y′′y′′′ in w]

In this expression, the two arrows still in the form […] are preserved by induction since they annotate the premises of the F-rule, and the rest of the structure excepting the str′ construct is preserved by the fact that F_{S} is strict symmetric monoidal. It is fairly easy to show that the str′ construct is also preserved by considering its construction.

• In the case of an operator rule instance not due to the tensor operator, the proof proceeds similarly, as the operator clause must be preserved.

• In the case where we have an instance of the tensor introduction rule,

\begin{matrix}\overbrace{y⃗:Q⃗; x⃗_{1}:A⃗_{1}} ⊢ v_{1}:B_{1}, & …, & \overbrace{y⃗:Q⃗; x⃗_{r}:A⃗_{r}} ⊢ v_{r}:B_{r} \\ \overbrace{y⃗:Q⃗; x⃗:A⃗} ⊢ ⊗^{r}(v_{1} … v_{r}):⊗(B_{1} … B_{r}) \end{matrix} ⊗^{r}

where x⃗:A⃗ = (x⃗_{1}:A⃗_{1})# … #(x⃗_{r}:A⃗_{r}), we have that:

[y′x⃗, let y⃗ be y′ in ⊗^{r}(v_{1} … v_{r})] =

mstr_{Q⃗,A⃗_{1}...A⃗_{r},A⃗}^{r}; ([y′x⃗_{1}, let y⃗ be y′ in v_{1}] ⊗ … ⊗ [y′x⃗_{r}, let y⃗ be y′ in v_{r}])

But now since we can show that mstr^{r} is preserved by F_{S}, and we know that the tensor must be, we have the required result. □

Similarly, we can show:

Lemma 5.5.5 Given an arbitrary intuitionistic term \overbrace{x⃗:Q⃗;} ⊢ v: R of Lin^{⊗}(𝕆, 𝔸), (which also must be an intuitionistic term x⃗: Q⃗; ⊢ v: R of Lin(𝕆, 𝔸)) we have that for an arbitrary Lin(𝕆)-morphism (F_{C}, F_{S}) : G_{T} (𝕆, 𝔸) → G′:

F_{C}([x⃗, v]) = [[\overbrace{x⃗:Q⃗;} ⊢ v:R]]_{C}^{G′}

This is proved in an exactly analogous way, except that there are only two cases, one for the variable which is preserved because it is a projection, and one for the operator case which follows from the previous lemma and the preservation of the operator interpretations by the Lin(𝕆)-morphism.

Lemma 5.5.6 (Uniqueness) The morphism FT^{G} : G_{T} (𝕆, 𝔸) → G is a Lin(𝕆)-map, and it is the unique such Lin(𝕆)-map.

Proof We prove this by considering the definition. Assume we have an arbitrary Lin(𝕆)-map F : G_{T} (𝕆, 𝔸) → G.

On Objects of C_{T}, which are sequences of intuitionistic types of Lin(𝕆), we know that F_{C}(Q_{1} … Q_{r}) = [[Q_{1}]]_{M_{I}}^{G} × … × [[Q_{r}]]_{M_{I}}^{G} since F strictly preserves the cartesian structure. But we have:

[[Q_{1}]]_{M_{I}}^{G} × … × [[Q_{r}]]_{M_{I}}^{G} = [[Q_{1} … Q_{r}]]_{C}^{G} = FT _{C}^{G}(Q_{1} … Q_{r})

On Arrows of C_{T}, which are equivalence classes [x⃗, t⃗]^{Q⃗,R⃗}, by definition we have F_{C}([x⃗, v⃗]^{Q⃗,R⃗}) = ⟨F_{C}([x⃗, v_{1}]), …, F_{C}([x⃗, v_{s}])⟩ since F_{C} strictly preserves the cartesian structure. But now we can see by our lemma that these arrows [x⃗, v_{i}] must all be mapped according to the definition of FT_{C}.

On Objects of S_{T}, which are sequences of linear primes of Lin(𝕆), we know that F_{S}(A_{1} … A_{s}) = [[A_{1}]]^{G} ⊗ … ⊗ [[A_{s}]]^{G} because F_{S} is strict monoidal. But we have:

[[A_{1}]]^{G} ⊗ … ⊗ [[A_{s}]]^{G} = [[A_{1} … A_{s}]]^{G} = FT _{S}^{G}(A_{1} … A_{s})

On Arrows of S_{T}, which are equivalence classes [x⃗, v]^{A⃗,B⃗}, we use our result;

given

F_{S}([y′x⃗, let y⃗ be y′ in v]) = [[\overbrace{y⃗:Q⃗; x⃗:A⃗} ⊢ v:⊗B⃗]]^{G′}

we can easily see that in the special case of arrows in S_{T}, this means that F_{S} agrees with FT_{S}. Hence it follows that the arbitrary map F is the same as the canonical map FT , which is therefore unique. □

This immediately implies that G_{T} (𝕆, 𝔸) is initial in the category Cat_{Lin}(𝕆, 𝔸).

5.6 Output Naturality

We now consider our defined notion of output naturality of a given operator in a type theory Lin(𝕆, 𝔸). Clearly, just as we have specified that linearly natural operators be interpreted by appropriate natural transformations, we might expect that output-natural operators be interpreted as natural transformations which are natural in the output-place of the appropriate argument. However, it is immediately obvious that not every model of Lin(𝕆, 𝔸) interprets its output natural operators as such natural transformations, simply because in the model we only have candidates for the components of the natural transformations for objects which are the interpretation of types. We now proceed by defining a sub-class of models which do interpret output natural operators as natural transformations of this kind, and show how they relate to the original models.

Definition 5.6.1 (Output Natural Lin(𝕆)-Interpretation) Given a typing system Lin(𝕆) with an output-parameterised set of operators O having arity:

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})( ) \atop (Q⃗′′; A⃗′′)( )}

114 we define an output-natural-in-O interpretation of the typing system Lin(𝕆), which we again write G, to be an interpretation of the typing system Lin(𝕆) with a natural transformation

[[O]]_{O_{L}}^{G} :(×_{i=1...r}S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]]^{G}, [[B_{i}]]_{M_{L}}^{G})) ×
(×_{j=1...(s−1)}S(F (_{=}) ⊗ [[Q⃗′_{j}]]^{G} ⊗ ( _{j}) ⊗ [[A⃗′_{j}]]^{G}, [[B′_{j}]]_{M_{L}}^{G})) ×
(S(F (_{=}) ⊗ [[Q⃗′_{s}]]^{G} ⊗ ( _{s}) ⊗ [[A⃗′_{s}]]^{G}, (_{≡})))
→ S(F (_{=}) ⊗ [[Q⃗′′]]^{G} ⊗ (⊗_{i=1...s}( _{s})) ⊗ [[A⃗′′]]^{G}, (_{≡}))

which is natural independently in each of the arguments (_{=}),(_{≡}) and ( _{1}) … ( _{s}) such that each operator O_{A} in the set has interpretation

[[O_{A}]]_{O_{L}}^{G} = [[O]]_{O_{L}}^{G}(_{=}, _{1}, … _{s}, [[A]]_{M_{L}}^{G})

We now note that each output-natural-in-O interpretation of a typing system Lin(𝕆) induces an interpretation of Lin(𝕆) by the obvious map which forgets the natural transformation [[O]]_{O_{L}}.

This enables us to map the typing system Lin(𝕆) into an output-natural-in-O interpretation of Lin(𝕆).

Definition 5.6.2 Given a typing system Lin(𝕆) with an output-parameterised set of operators O, we define the map [[ ]]^{G} which takes the typing system Lin(𝕆) to an output-natural-in-O interpretation G simply by defining it to be the map taking Lin(𝕆) to the underlying interpretation of G.

Given this map, we can go on to give a definition of output-natural Lin(𝕆, 𝔸)- model.

Definition 5.6.3 (Output-Natural-in-O Lin(𝕆, 𝔸)-Model) Given a typing system Lin(𝕆) with an output-parameterised set of operators O, we define an output-natural-in-O model of the type theory Lin(𝕆, 𝔸), which we also write G, to be an output-natural-in-O interpretation of Lin(𝕆) such that for each equality judgement Γ; Δ ⊢ v = w:A in 𝔸, we have

[[Γ; Δ ⊢ v:A]]^{G} = [[Γ; Δ ⊢ w:A]]^{G}

in the s.m. part of G.

Given this definition, soundness is an easy corollary of soundness for our first definition of interpretation.

Lemma 5.6.4 (Soundness) Given a typing system Lin(𝕆) with an output-parameterised set of operators O, and an output-natural-in-O Lin(𝕆, 𝔸)-model G, for every provable equality judgement Γ; Δ ⊢ v = w:A of Lin(𝕆, 𝔸), we have:

[[Γ; Δ ⊢ v:A]]^{G} = [[Γ; Δ ⊢ w:A]]^{G}

The important property of output-natural-in-O interpretations which distinguishes them from plain interpretations is the following:

Lemma 5.6.5 Given a typing system Lin(𝕆) with an output-parameterised set of operators O and an output-natural-in-O interpretation G, for every provable equality Γ; Δ ⊢ v = w:A of the type theory Lin(𝕆, ONat(𝕆, O)), we have:

[[Γ; Δ ⊢ v:A]]^{G} = [[Γ; Δ ⊢ w:A]]^{G}

This is easily provable adapting the proof of the previous soundness lemma. We only need to prove that the axiomatic equality judgements in the set ONat(𝕆, O) are soundly mapped to the output-natural-in-O interpretation, which follows by virtue of the fact that the operators in O are all interpreted as instances of a natural transformation.

Now we can define output-natural-in-O morphisms.

Definition 5.6.6 (Output-Natural-in-O Lin(𝕆)-morphism) Given a typing system Lin(𝕆) with an output-parameterised set of operators O having arity

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})( ) \atop (Q⃗′′; A⃗′′)( )}

an output-natural-in-O Lin(𝕆)-morphism F : G → G′ between two output-natural-in-O Lin(𝕆, 𝔸)-models is a Lin(𝕆)-morphism on the underlying Lin(𝕆)-interpretations of G and G′ with the additional property that for any object X of C, objects Y_{1}, …, Y_{s−1} and Y′ of S, and arrows of S:

f_{i} : F (X) ⊗ [[Q⃗_{i}; A⃗_{i}]] → [[B_{i}]] for i = 1 … r
g_{j} : F (X) ⊗ [[Q⃗′_{j}]] ⊗ Y_{j} ⊗ [[A⃗′_{j}]] → [[B′_{j}]] for j = 1 … (s − 1)
g_{s} : F (X) ⊗ [[Q⃗′_{j}]] ⊗ Y_{j} ⊗ [[A⃗′_{j}]] → Y′

we have,

F_{S}([[O]]_{O_{L}}^{G}(X, Y_{1}, …, Y_{s}, Y′)(f_{1}, … f_{r}, g_{1}, …, g_{s})) = [[O]]_{O_{L}}^{G′}(F_{C}(X), F_{S}(Y_{1}), … F_{S}(Y_{s}), F_{S}(Y′))(F_{S}(f_{1}), … F_{S}(f_{r}), F_{S}(g_{1}), …, F_{S}(g_{s}))

We now write Cat_{Lin}^{O}(𝕆, 𝔸) for the category of small output-natural-in-O models and morphisms. Clearly by the forgetful map mentioned earlier from outputnatural-in-O Lin(𝕆, 𝔸)-models to Lin(𝕆, 𝔸)-models and its obvious extension to output-natural-in-O morphisms, we have a functor Cat_{Lin}^{O}(𝕆, 𝔸) → Cat_{Lin}(𝕆, 𝔸). In the opposite direction, given an a type theory Lin(𝕆, 𝔸) having an outputparameterised set of operators O, there may be no candidate natural transformation to make it into an output-natural-in-O model, or there may be one or many.

However, considering the term-model in particular, it is not the case that the term model G_{T} (𝕆, 𝔸) for a type-theory Lin(𝕆, 𝔸) with an output-parameterised set of operators O can be extended to an output-natural-in-O model simply by picking an existing natural transformation for [[O]]_{O_{L}}^{G_{T} (𝕆,𝔸)}. This is simply because there is no appropriate operator set, since no operator acts on arguments having as outputs for example 2-element sequences. All operators of Lin^{⊗}(𝕆, 𝔸) act only on arguments with singleton outputs.

The Output-Natural Term Model

Since it is not the case that the term model G_{T} (𝕆, 𝔸) can be extended to an output natural model, we need to reconsider the questions of completeness and initiality. We will sketch a variation on the construction of the term model which will give us an output-natural term Lin(𝕆, 𝔸)-model, and indicate how it can be proved initial for the category Cat_{Lin}^{O}(𝕆, 𝔸).

First consider an extension of the type theory Lin^{⊗}(𝕆, 𝔸).

Definition 5.6.7 (The Type Theory Lin_{O}^{⊗}(𝕆, 𝔸)) For a signature 𝕆 = (M_{I}, M_{L}, O_{I}, O_{L}) and an axiom set 𝔸, such that the typing system Lin(𝕆) has an output-parameterised set of operators O with arity

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})( ) \atop (Q⃗′′; A⃗′′)( )}

we define the type theory Lin_{O}^{⊗}(𝕆, 𝔸) as Lin((M_{I}^{⊗}, M_{L}^{⊗}, O_{L}^{⊗}_{O}), 𝔸_{O}^{⊗}), where M_{I}^{⊗}, M_{L}^{⊗} and O_{I}^{⊗} are as defined as for Lin^{⊗}(𝕆, 𝔸), and we define O_{L}^{⊗}_{O} and 𝔸_{O} as follows:

• O_{L}^{⊗}_{O} is the set O_{L}^{⊗} augmented with new operators O_{⊗C⃗} of arity

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})(⊗C⃗) \atop (Q⃗′′; A⃗′′)(⊗C⃗)}

for any non-singleton sequence ⊗C⃗ ∈ M_{L}^{⊗}. Note that there already exists instances in the case where the sequence is a singleton.

• 𝔸_{O}^{⊗} is the set 𝔸^{⊗} augmented for each output-natural set of operators O of Lin(𝕆, 𝔸) with the equality judgements in the set ONat((M_{I}^{⊗}, M_{L}^{⊗}, O_{I}^{⊗}, O_{L}^{⊗}_{O}), O′), where O′ is the set O∪(O_{L}^{⊗}_{O} −O_{L}^{⊗}), which is to say the set O with the extra operator instances added in the definition of O_{L}^{⊗}_{O}.

This type-theory differs from Lin^{⊗}(𝕆, 𝔸) in that the output-natural set of operators O of Lin(𝕆, 𝔸) is extended canonically to be an output-natural set of operators in Lin_{O}^{⊗}(𝕆, 𝔸). Now say that a pre-term of Lin_{O}^{⊗}(𝕆, 𝔸) is in canonical form if it is an instance of the following inductive definition, where the v are pre-terms of Lin(𝕆, 𝔸):

v_{c} ::= ⊗v⃗ | let x be v in v_{c} | OA⃗((x⃗; x⃗)v⃗, …, (x⃗; x⃗)v⃗; (x⃗; x⃗)v⃗, …, (x⃗; x⃗)v⃗, (x⃗; x⃗)v_{c})(v⃗; v⃗)

We then have the following extended version of lemma 5.3.2:

Lemma 5.6.8 Given a typing judgement \overbrace{Γ; Δ} ⊢ v:⊗A⃗ of Lin_{O}^{⊗}(𝕆, 𝔸), v is identically in canonical form with the various pre-terms of Lin(𝕆, 𝔸) being terms.

This is proved in a very similar way to the original version of the lemma, with the one extension that we now have additional operators in O_{O}^{⊗} which may return results having outputs of tensor type. However, we know this can only occur when they are applied to an argument (in their output-parameterised place) which is of tensor type, and so we can use induction to show that the term is still in canonical form.

Given this result, we then proceed to define the term categories in much the same way as before, and define the output-natural-in-O term model of Lin(𝕆, 𝔸) exactly as we do the term model of Lin(𝕆, 𝔸) with the exception that we interpret the output-natural set of operators O in Lin(𝕆, 𝔸) into the appropriate natural transformation which exists in the term model by virtue of the extension of O to incorporate instances O_{A} for any type A of M_{L}^{⊗} (which is a sequence of types of M_{L}) and the addition of the output-naturality equalities to 𝔸.

Similarly, the definition of the canonical morphism from the output-natural-in-O term model to an arbitrary output-natural-in-O model is identical to the previous one with the exception that for the output-natural set of operators O we map the natural transformation which exists in the output-natural term model to the natural transformation in the arbitrary model.

Given this development, we have that the output-natural-in-O Lin(𝕆, 𝔸)-term model, which we will call G_{T}^{O}(𝕆, 𝔸), is initial in the category Cat_{Lin}^{O}(𝕆, 𝔸).

Multiary Output-Natural Models

Most of the leading examples of linear type-theories which we will present have more than one output-natural set of operators, and so we briefly consider the situation in this case. In fact, it is easy to extend all the definitions of “outputnatural-in-O” constructions into the analogous “output-natural-in-O-and… -and-O′” forms, and the constructions go through as before, with the same results being provable.

Action Calculi and Extensions

We now present an important example of a system having a linear structural framework, Milner’s action calculus [Mil93c]. The action calculus is similar to our general linear type-theory in that it is a general framework in which many different systems can be presented, particularly process calculi. The leading example of an action calculus is the π-calculus [MPW92], but systems ranging from petri-nets to the λ-calculus have been shown to correspond to action calculi.

The essential idea is that we have certain underlying structure, including a monoidal structure and a discipline of names, and in addition, for each instance we have a signature containing a set of intuitionistically natural operators (called controls) and associated reaction rules which depend on the particular calculus we wish to describe. For example, there is a set of controls K_{π} and a set of reaction rules ↘_{π} such that the action calculus AC(K_{π}, ↘_{π}) is isomorphic to the π-calculus, and there are other sets of controls and reaction rules serving the same purpose for other languages such as petri-nets and the λ-calculus.

We will actually present a slight generalisation of Milner’s original action calculi as found in [Mil96], which will incorporate a notion of linear prime arity in addition to Milner’s primes, which have intuitionistic behaviour. This generalisation is motivated by our discussion of general linear type-theories, which can have both linear and intuitionistic primitive types; further, we have an example of an action calculus of this more general form which is not isomorphic to an action calculus as defined by Milner. This is the action calculus corresponding to the linear λ-calculus, which we will call AC_{⊠,⊸}(𝕂). However, we note that all Milner’s action calculi are instances of this more general form.

We will also define several higher-order extensions of the basic action calculi, inspired variously by Milner’s higher order action calculi [Mil94b] and the higherorder structure present in linear logic.

6.1 Action Calculi

We first assume a set P_{I} of intuitionistic primes, ranged over by p, q … and a set P_{L} of linear primes, ranged over by l, k …, such that P_{I} ⊆ P_{L}. We can now define the set of (tensor) arities over the set of linear primes, written M(P_{L}), as the set of sequences of primes in P_{L}. We use m, n … for (tensor) arities (henceforth just arities), and write (infix) ⊗ for concatenation and ε for the empty sequence. Further, we will omit the argument P_{L} of M where it is clear from the context.

We can now give the definition of signature:

Definition 6.1.1 (Action Calculus Signature) An action calculus signature 𝕂 is a triple (P_{I}, P_{L}, K) of sets such that P_{I} ⊆ P_{L} and each K in K has an arity of the form:

((m_{1}, n_{1}), …, (m_{r}, n_{r})) → (m, n)

where the m’s and n’s are from the set M(P_{L}).

Definition 6.1.2 (Intuitionistic Action Calculus Signature) An action calculus signature 𝕂 = (P_{I}, P_{L}, K) is intuitionistic if P_{I} = P_{L}.

Intuitionistic action calculus signatures give rise to intuitionistic action calculi, which are equivalent to Milner’s original action calculi.

In order to simplify definitions, in the following we assume that a signature 𝕂 has components (P_{I}, P_{L}, K) unless otherwise stated, and similarly 𝕂′ has components (P′_{I}, P′_{L}, K′) etc.

In order to define the terms of the action calculus, we use the familiar variable set X. However, in this context these variables are known as names, and further it is necessary to assume that each name x has an associated intuitionistic prime arity p; we may write x^{p} to denote this.

Definition 6.1.3 (Terms) Terms over an action calculus signature 𝕂, written a, b …, are constructed from the basic operators identity, id_{m}, permutation, p_{m,n}, composition, ·, tensor, ⊗, abstraction, (x^{p}) , datum, ⟨x^{p}⟩ and the control operators, K. A term a is assigned an (action) arity a : m → n where m, n are tensor arities, using the following rules:

\begin{matrix}id_{m} : m → m & \frac{a : m → m′  b : m′ → n}{a · b : m → n} \\ \frac{a : m_{1} → n_{1}  b : m_{2} → n_{2}}{a ⊗ b : m_{1} ⊗ m_{2} → n_{1} ⊗ n_{2}} & p_{m,n} : m ⊗ n → n ⊗ m \\ \frac{a : m → n}{(x^{p})a : p ⊗ m → n} & ⟨x^{p}⟩ : ε → p \end{matrix}

\begin{matrix}a_{1} : m_{1} → n_{1} & … & a_{r} : m_{r} → n_{r} \\ K(a_{1}, …, a_{r}) : m → n \end{matrix} K

where the control operator K from the signature 𝕂 has the arity

((m_{1}, n_{1}), …, (m_{r}, n_{r})) → (m, n)

We will omit arity annotations, both in terms and of terms, where these are apparent. The construct (x)a binds the free name x in the term a, and the name x occurs free in the term ⟨x⟩. We write a{b/⟨x⟩} to denote the usual captureavoiding substitution of terms for subterms of the form ⟨x⟩. Note that all free occurrences of x are in subterms of this form.

Given a sequence of names x_{1}^{p_{1}} … x_{r}^{p_{r}}, we write |x_{1} … x_{r}| to denote the arity p_{1} … p_{r}. Further, we define the constructs (x_{1} … x_{r})a = (x_{1}) … (x_{r})a and ⟨x_{1} … x_{r}⟩ = ⟨x_{1}⟩ ⊗ … ⊗ ⟨x_{r}⟩, where this is the left-bracketed tensor. Note, however, that since the tensor will be strict, the choice is unimportant.

We give the equality on the terms, which is adapted slightly from that of Milner.

Definition 6.1.4 (The Theory AC) An equality holds between two terms of AC in the equational theory AC if it can be proved using the following axioms, annotated with action arities, and the obvious reflexivity, transitivity and congruence rules:

a · (b · c) = (a · b) · c  (A1)
a · id_{n} = a = id_{m} · a  (A2)
(a · b) ⊗ (c · d) = (a ⊗ c) · (b ⊗ d)  (A3)
id_{m} ⊗ id_{n} = id_{m⊗n}  (A4)
a ⊗ (b ⊗ c) = (a ⊗ b) ⊗ c  (A5)
a ⊗ id_{ε} = a = id_{ε} ⊗ a  (A6)
p_{m,n} · (b ⊗ a) = (a ⊗ b) · p_{m′,n′}  (ζ_{1})
p_{m⊗n,m′} = (id_{m} ⊗ p_{n,m′}) · (p_{m,m′} ⊗ id_{n})  (ζ_{2})
p_{ε,m} = id_{m}  (ζ_{3})
p_{m,n} · p_{n,m} = id_{m⊗n}  (ζ_{4})

augmented with the two naming axioms:

(⟨y⟩ ⊗ id_{m}) · (x)a = a{⟨y⟩/⟨x⟩}  (σ)
(x)((⟨x⟩ ⊗ id) · a) = a, where x ∉ fn(a)  (δ)

It is an immediate consequence of these axioms that id_{m} = (x⃗)⟨x⃗⟩ and p_{m,n} = (x⃗y⃗)⟨y⃗x⃗⟩, where |x⃗| = p⃗ = m and |y⃗| = q⃗ = n.

Definition 6.1.5 (Action Calculus) The action calculus AC(𝕂, ↘) is the quotient of the terms of AC(𝕂) by the equational theory AC, together with the reaction relation ↘, which is a transitive relation closed under tensor, composition, abstraction and equality, and such that there is no action a such that id ↘ a.

We refer to the terms of the theory as actions. From now on we will consider only the static case, which is to say the case in which the reaction relation is empty. Possible extensions of these definitions and the following results to the case with a non-empty reaction relation are discussed in chapter 10.

We now briefly show how this definition relates to Milner’s original definition, found in [Mil96].

Definition 6.1.6 (Intuitionistic Action Calculus) An action calculus AC(𝕂) is intuitionistic if it is constructed over an intuitionistic action calculus signature.

We can now show:

Lemma 6.1.7 An intuitionistic action calculus AC(𝕂) where 𝕂 = (P_{I}, P_{I}, K) is isomorphic to Milner’s action calculus AC(K) built over the primes P_{I}, up to equality in the appropriate theory.

Proof This is proved by giving inverse translations. To translate from an intuitionistic action calculus AC(𝕂) to the corresponding instance of Milner’s action calculus, the translation is the identity on terms except on p_{m,n}, which we map to the term (x⃗)(y⃗)⟨y⃗⟩ ⊗ ⟨x⃗⟩. Conversely, to translate from Milner’s action calculus back to the intuitionistic action calculus AC(𝕂), we simply map terms to themselves. It is easy to show that these two translations are sound with respect to the appropriate theories, and they are inverse simply because in the action calculus AC(𝕂), given sequences of intuitionistic primes m and n,

p_{m,n} = (x⃗)(y⃗)⟨y⃗⟩ ⊗ ⟨x⃗⟩
□

6.2 Generalised Linear Type Theory

We now present a generalised linear type-theory which corresponds to the static action calculus AC(𝕂).

Definition 6.2.1 (The Type Theory Lin^{A}(𝕂)) Given an action calculus signature 𝕂 = (P_{I}, P_{L}, K), we define the type theory Lin^{A}(𝕂) to be the instance Lin(𝕆^{A}, 𝔸^{A}), where 𝕆^{A} = (M_{I}^{A}, M_{L}^{A}, O_{I}^{A}, O_{L}^{A}) and M_{I}^{A}, M_{L}^{A}, O_{I}^{A}, O_{L}^{A} and 𝔸^{A} are defined as follows:

• The set M_{I}^{A} is the set of all singleton sequences of elements of P_{I}.

• The set M_{L}^{A} is the set of all sequences of elements of P_{L}. For consistency with the action calculus, we may write m, n … for arbitrary sequences of elements of P_{L} l_{1} … l_{r}, and further we may write ⊗ for concatenation and ε for the empty sequence.

• The set O_{I}^{A} is the empty set.

• The set O_{L}^{A} contains:

1. For each control K from K of arity

((l⃗_{1}, n_{1}), …, (l⃗_{r}, n_{r})) → (l⃗′, n′)

an operator O^{K} of arity

\begin{aligned}(; l⃗_{1})n_{1}, & …, & (; l⃗_{r})n_{r} & ; \\ & (; l⃗′)n′ \end{aligned}

where we overload notation to write l⃗ for the sequence of singleton sequences of the elements of l⃗. We will abbreviate the general operator form

O^{K}((; x⃗_{1}:l⃗_{1})v_{1}, …, (; x⃗_{r}:l⃗_{r})v_{r}; )(; w⃗)

as K((x⃗_{1}:l⃗_{1})v_{1}, …, (x⃗_{r}:l⃗_{r})v_{r}, w⃗)

2. For each r and m_{1} … m_{r}, an operator ⊗_{m_{1}...m_{r}}^{R} of arity:

\begin{aligned}; & (; )m_{1} & … & (; )m_{r} \\ & (; )m_{1} ⊗ … ⊗ m_{r} \end{aligned}

In terms of the type theory, we will write v_{1} ⊗ … v_{r} or occasionally ⊗(v_{1} … v_{r}) as an abbreviation for ⊗_{m_{1}...m_{r}}^{R}(; (; )v_{1}, … (; )v_{r})(; ).

3. For each r and m_{1} … m_{r}, each of an output-parameterised set of operators ⊗_{m_{1}...m_{r}}^{L} with arity:

\begin{matrix}; & (; m_{1} … m_{r})( ) \\ (; m_{1} ⊗ … ⊗ m_{r})( ) \end{matrix}

In terms of the type theory, we will write let ⊗x⃗:m⃗ be v⃗ in w as an abbreviation for ⊗_{m_{1}...m_{r}}^{L}(; (; x⃗)w)(; v), where m⃗ = m_{1} … m_{r}.

• The set 𝔸^{A} contains:

1. All well-formed equalities of the form:

(⊗ − β) Γ; Δ ⊢ let ⊗x⃗y⃗ be w_{1} ⊗ w_{2} in v = let ⊗x⃗ be w_{1} in let ⊗y⃗ be w_{2} in v:n

where Γ; Δ_{1} ⊢ w_{1} : ⊗m⃗, Γ; Δ_{2} ⊢ w_{2} : m′, Γ; Δ′, x⃗: m⃗, y⃗: m′ ⊢ v: n and Δ = Δ′#Δ_{1}#Δ_{2}.

2. All well-formed equalities of the form:

(⊗ − η) Γ; Δ ⊢ let ⊗x⃗ be v in ⊗x⃗ = v : ⊗m⃗

3. All well-formed equalities of the form:

(⊗ − 1) Γ; Δ ⊢ ⊗(⊗v⃗_{1}, …, ⊗v⃗_{r}) = ⊗(v⃗_{1} … v⃗_{r}):n

4. All well-formed equalities of the form:

(⊗ − 2) Γ; Δ ⊢ ⊗(v) = v:n

5. For any r, all equality judgements in any of the sets ONat(𝕆^{A}, ⊗_{m_{1}...m_{r}}^{L}) for any m_{1} … m_{r}.

Having given this definition, it is worth noting that we could present an equivalent type theory without any type constructors if we used general sequents of the form Γ; Δ ⊢ Δ′, where the sequence Δ′ on the right is intended to be read as a tensor of linear prime arities, as is the sequence Δ on the left. Given this logic we could annotate each sequent having such a form with a term v such that the typing Γ; Δ ⊢ v:Δ′ would correspond to an action a:|Δ| → |Δ′| having free names in Γ. This is the approach taken in [BGHP97].

6.3 The Translations

We present the translations which make Lin^{A}(𝕂) isomorphic to the action calculus AC(𝕂).

Action Calculi to Type Theory

We first give a translation which will take the action calculus AC(𝕂) to the type theory Lin^{A}(𝕂). We define the function ( )^{†} which takes pairs of a sequence of distinct variables and an action to pre-terms of Lin^{A}(𝕂), where the sequence of variables has the same length as the sequence of prime arities m for the action a:m → n.

Definition 6.3.1 (The Translation ( )^{†}) We define the translation over the structure of actions as follows:

(y⃗, id_{m})^{†} = ⊗(y_{1} … y_{r}) (where m = l_{1} … l_{r})
(y⃗, a · b)^{†} = let ⊗y′ be (y⃗, a)^{†} in (y′, b)^{†}
(y⃗y′, a ⊗ b)^{†} = (y⃗, a)^{†} ⊗ (y′, b)^{†} (where y⃗ = y_{1} … y_{r} and a:l_{1} … l_{r} → n)
(y⃗y′, p_{m,n})^{†} = (⊗y′) ⊗ (⊗y⃗) (where y⃗ = y_{1} … y_{r} and m = l_{1} … l_{r})
(y′y⃗, (x^{p})a)^{†} = let x be y′ in (y⃗, a)^{†}
(ε, ⟨x^{p}⟩)^{†} = x
(y′, K(a_{1} … a_{r}))^{†} = K((y⃗_{1})(y⃗_{1}, a_{1})^{†} … (y⃗_{r})(y⃗_{r}, a_{r})^{†}, y′)

where the y′ and y_{i} for all i are fresh in each clause.

We can now easily show by induction over the structure of actions the following lemma:

Lemma 6.3.2 Given an action a : m → n with free names x⃗ such that |x⃗| = p⃗, we have that x⃗:p⃗; y⃗:l⃗ ⊢ (y⃗, a)^{†}:n in Lin^{A}(𝕂), where y⃗ = y_{1} … y_{r} and m = l⃗ = l_{1} … l_{r}.

Further, we can show that this map translates equalities between terms in AC(𝕂) to equality judgements of Lin^{A}(𝕂). In order to do this we first prove an easy lemma.

Lemma 6.3.3 Given an action a: m → n with free names x⃗ such that |x⃗| = p⃗ and where m = l⃗ = l_{1} … l_{r}, we have that:

x⃗:p⃗; z⃗:l⃗ ⊢ let ⊗y⃗ be ⊗z⃗ in (y⃗, a)^{†} = (z⃗, a)^{†}:n

Lemma 6.3.4 (Soundness) Given action a:m → n and b:m → n, whose free names are included in x⃗ such that |x⃗| = p⃗, we have that if a = b in the theory of AC(𝕂),

x⃗:p⃗; y⃗:l⃗ ⊢ (y⃗, a)^{†} = (y⃗, b)^{†}:n

where y⃗ = y_{1} … y_{r} and m = l_{1} … l_{r}.

Proof We prove this simply by considering each axiomatic equality of AC(𝕂), since the congruence, symmetry, transitivity and reflexivity rules of AC(𝕂) are duplicated in Lin^{A}(𝕂). For brevity we will write (y⃗, a)^{†} as a† ; y⃗ from now on, and we assume that in all the clauses below Γ = x⃗:p⃗.

A1) In this case, we need to show the equality

Γ; y⃗:l⃗ ⊢let ⊗y′ be a† ; y⃗ in let ⊗y′′ be b_{y′}^{†} in c_{y′′}^{†}

= let ⊗y′′ be (let ⊗y′ be a† ; y⃗ in b_{y′}^{†}) in c_{y′′}^{†}:n′

However, this is one of the output-naturality equalities for this operator.

A2) In this case, we need to show the equality:

Γ; y⃗:l⃗ ⊢ let ⊗y′ be a† ; y⃗ in ⊗y′ = a† ; y⃗:n

which is clearly just one of the η-equalities we have given for this typetheory.

A3) In this case, we need to show the equality:

Γ; y⃗_{1}:l⃗_{1}, y⃗_{2}:l⃗_{2} ⊢let ⊗y′_{1} be a† ; y⃗_{1} in b_{y′_{1}}^{†} ⊗ let ⊗y′_{2} be c† ; y⃗_{2} in d_{y′_{2}}^{†}

= let ⊗y′_{1}y′_{2} be a† ; y⃗_{1} ⊗ c† ; y⃗_{2} in b_{y′_{1}}^{†} ⊗ d_{y′_{2}}^{†}:⊗(n′_{1}n′_{2})

which holds via a use of ⊗ − β and some commuting conversions which are due to output naturality.

A4) In this case, we need to show the equality:

; y⃗_{1}:l⃗_{1}, y⃗_{2}:l⃗_{2} ⊢ (⊗y⃗_{1}) ⊗ (⊗y⃗_{2}) = ⊗y⃗_{1}y⃗_{2}:⊗(l⃗_{1}l⃗_{2})

but this follows from our tensor equality. A5) In this case we need to show the equality:

Γ; y⃗_{1}:l⃗_{1}, y⃗_{2}:l⃗_{2}, y⃗_{3}:l⃗_{3} ⊢ a† ; y⃗_{1} ⊗ (b† ; y⃗_{2} ⊗ c† ; y⃗_{3}) = (a† ; y⃗_{1} ⊗ b† ; y⃗_{2}) ⊗ c† ; y⃗_{3} :⊗(n_{1}n_{2}n_{3})

But again this follows directly from our tensor equality. A6) In this case, we need to show the equality:

Γ; y⃗:l⃗ ⊢ a† ; y⃗ ⊗ (⊗ε) = a† ; y⃗:n

and its symmetric variant. However, these again follow from our tensor equality.

ζ_{1}) In this case we need to show the the equality: Γ; y⃗_{1} : l⃗_{2}, y⃗_{2} : l⃗_{2} ⊢ let ⊗y′_{2}y⃗′_{1} be (⊗y⃗_{2}) ⊗ (⊗y⃗_{1}) in b_{y′_{2}}^{†} ⊗ a_{y′_{1}}^{†} = a_{y′_{1}}^{†}⊗b_{y′_{2}}^{†} : ⊗(n_{1}n_{2}) which is true via the α-conversion result lemma 6.3.3.

ζ_{2}) In this case, we need to show the equality:

Γ; y⃗_{1}:l⃗_{1}, y⃗_{2}:l⃗_{2}, y⃗_{3}:l⃗_{3} ⊢(⊗y⃗_{3}) ⊗ (⊗y⃗_{2}y⃗_{1}) =

let ⊗y′_{1}y′_{3}y′_{2} be (⊗y⃗_{1}) ⊗ (⊗y⃗_{3}y⃗_{2}) in (⊗y′_{3}y′_{1}) ⊗ (⊗y′_{2}):⊗(l⃗_{3}l⃗_{1}l⃗_{2})

which is true by virtue of the tensor equality, the ⊗ − β-equality and our result on α-conversion lemma 6.3.3.

ζ_{3}) In this case we need to show the equality:

; y⃗:l⃗ ⊢ ⊗(y⃗ε) = ⊗y⃗:⊗l⃗

which is true by definition since ε is the empty sequence. ζ_{4}) In this case we need to show the equality:

; y⃗_{1}:l⃗_{1}, y⃗_{2}:l⃗_{2} ⊢ let ⊗y′_{2}y′_{1} be ⊗y⃗_{2}y⃗_{1} in ⊗y′_{1}y′_{2} = ⊗y⃗_{1}y⃗_{2}:⊗(l⃗_{1}l⃗_{2})

which follows by ⊗ − β and our α-conversion result lemma 6.3.3.

σ) In this case we need to show the equality:

Γ, y:p; z⃗:l⃗ ⊢ let ⊗z′′z′ be y ⊗ (⊗z⃗) in let x be z′′ in a_{z′}^{†} = a† ; z⃗{y/x}:n

which follows by ⊗ − β, F − β and our α-conversion result lemma 6.3.3.

δ) In this case we need to show the equality:

Γ; y′:p, y⃗:l⃗ ⊢ let x be y′ in let ⊗z′z⃗ be x ⊗ y⃗ in a_{z′z⃗}^{†} = a_{y′y⃗}^{†}:n

which follows by ⊗ − β, cc − 4, F − η and an instance of linear naturality, using our α-conversion result lemma 6.3.3. □

Type Theory to Action Calculi

We now give a translation which maps the type theory Lin^{A}(𝕂) to the action calculus AC(𝕂). In contrast to the previous translations, we proceed in this case by defining an action corresponding to each Γ; Δ term.

Definition 6.3.5 (The Translation ( )^{‡}) We define the translation ( )^{‡} on Γ; Δ-terms of Lin^{A}(𝕂) as follows, where we write (v)_{Γ;Δ}^{‡} for the action which is the image of the Γ; Δ-term v.

(x)_{Γ,x:p,Γ′;}^{‡} = ⟨x⟩
(x)_{Γ;x:m}^{‡} = id_{m}
(let x:p be v in w)_{Γ;Δ}^{‡} = perm_{Δ,Δ_{1}Δ_{2}} · ((v)_{Γ;Δ_{1}}^{‡} ⊗ id_{⊗|Δ_{2}|}) · (x)(w)_{Γ,x:p,Δ_{2}}^{‡}
(K((y⃗_{1}:l⃗_{1})v_{1} … (y⃗_{r}:l⃗_{r})v_{r}, w⃗))_{Γ;Δ}^{‡} = mperm_{Δ,Δ_{1}...Δ_{s}} · ((w_{1})_{Γ;Δ_{1}}^{‡} ⊗ … ⊗ (w_{s})_{Γ;Δ_{s}}^{‡}) ·
K((v_{1})_{Γ;y⃗_{1}:l⃗_{1}}^{‡} … (v_{r})_{Γ;y⃗_{r}:l⃗_{r}}^{‡})
(⊗(v_{1} … v_{r}))_{Γ;Δ}^{‡} = mperm_{Δ,Δ_{1}...Δ_{r}} · ((v_{1})_{Γ;Δ_{1}}^{‡} ⊗ … ⊗ (v_{1})_{Γ;Δ_{1}}^{‡})
(let ⊗y⃗:m⃗ be v in w)_{Γ;Δ}^{‡} = perm_{Δ,Δ_{2},Δ_{1}} · (id_{⊗|Δ_{2}|} ⊗ (v)_{Γ;Δ_{1}}^{‡}) · (w)_{Γ;Δ_{2},y⃗:m⃗}^{‡}

where firstly, perm_{Δ,Δ_{1},Δ_{2}} is the canonical action with arity ⊗|Δ| → (⊗|Δ_{1}|) ⊗ (⊗|Δ_{2}|), where Δ = Δ_{1}#Δ_{2} and Δ_{1} and Δ_{2} are uniquely determined from the derivation of the terms v and w, and secondly mperm_{Δ,Δ_{1}...Δ_{r}} is the multiary version.

We now show that this translation is sound with respect to equality judgements Γ; Δ ⊢ v = w:n in Lin^{A}(𝕂). This is done by induction over the structure of equality judgements, but by familiar arguments we need only show it for the axiomatic equalities of Lin^{A}(𝕂). First we prove a substitution lemma.

Lemma 6.3.6 Given that Γ; Δ_{1} ⊢ v:m and Γ; Δ_{2}, y:m ⊢ w:n, we have that:

(w{v/y})_{Γ;Δ}^{‡} = perm_{Δ,Δ_{2},Δ_{1}} · (id_{|Δ_{2}|} ⊗ (v)_{Γ;Δ_{1}}^{‡}) · (w)_{Γ;Δ_{2},y:m}^{‡}

where Δ = Δ_{1}#Δ_{2}.

Lemma 6.3.7 (Soundness) Given an equality judgement Γ; Δ ⊢ v = w: m of Lin^{A}(𝕂), we have that the actions (a)_{Γ;Δ}^{‡} and (b)_{Γ;Δ}^{‡} are equal in the theory AC.

Proof This is proved by induction over the structure of equality judgements, but by familiar arguments we need only show it for the axiomatic equalities of Lin^{A}(𝕂). Considering firstly the axiomatic equalities common to all the typetheories Lin(𝕆), we have:

F − β_{V}) In this case we need to show the equality between actions:

perm_{Δ, Δ} · ((y)_{Γ,y:p,Γ′;}^{‡} ⊗ id_{⊗|Δ|}) · (x)(w)_{Γ,y:p,Γ′,x:p;Δ}^{‡} = (v{x/y})_{Γ,y:p,Γ′;Δ}^{‡}

This is a direct consequence of the σ axiom of the action calculus, given the fact that the permutation perm_{Δ, ,Δ} is just the identity.

F − η) In this case we need to show the equality between actions:

((v)_{Γ;Δ}^{‡} ⊗ id_{ε}) · (x)(x)_{Γ,x:p;}^{‡} = (v)_{Γ;Δ}^{‡}

But this follows directly as an instance of the δ equality.

cc’s) In the case of the cc’s (1-4) and cc-5 for the linearly natural operators ⊗ and let − ⊗, the equalities are preserved by properties of tensor and composition.

Now, considering the axiomatic equalities in the set 𝔸^{A}, we have:

1. Considering the ⊗−β equality, we need to show the equality between actions

perm_{Δ,Δ_{2},Δ′}·(id_{⊗|Δ_{2}|} ⊗ (perm_{Δ′,Δ′_{1},Δ′_{2}} · (w_{1})_{Γ;Δ′_{1}}^{‡} ⊗ (w_{2})_{Γ;Δ′_{1}}^{‡})) · (v)_{Γ;Δ_{2},x⃗:m⃗,y⃗:m′}^{‡} =
perm_{Δ,Δ′′,Δ′_{1}} · (id_{|Δ′|} ⊗ (w_{1})_{Γ;Δ′_{1}}^{‡}) · perm_{Δ′′,(Δ_{2},x⃗:m⃗),Δ′_{2}}
· (id_{|Δ_{2},x⃗:m⃗|} ⊗ (w_{2})_{Γ;Δ′_{2}}^{‡}) · (v)_{Γ;Δ_{2},x⃗:m⃗,y⃗:m′}^{‡}

where Δ′′ is the unique sequence of typings satisfying Δ = Δ′′#Δ′_{1}. This is true by virtue of tensor and composition properties, and the definition of perm.

2. Considering the ⊗−η equality, we need to show the equality between terms:

perm_{Δ, ,Δ} · (id_{ε} ⊗ (v)_{Γ;Δ}^{‡}) · id_{⊗m⃗} = (v)_{Γ;Δ}^{‡}

which is clear since perm_{Δ, ,Δ} = id_{|Δ|}.

3. Considering the ⊗ − 1 equality, the appropriate equality holds by virtue of the uniqueness of the multi-permutation action mperm.

4. Considering the ⊗ − 2 equality, we need to show the equality on actions;

mperm_{Δ,Δ} · (v)_{Γ;Δ}^{‡} = (v)_{Γ;Δ}^{‡}

which clearly holds since by uniqueness mperm_{Δ,Δ} must be the identity.

5. Considering the let − n equality, we need to show the following equality on actions.

perm_{Δ,Δ_{1},Δ′}·(id_{|Δ_{1}|} ⊗ (perm_{Δ′,Δ′_{2},Δ′_{1}} · (id_{|Δ′_{2}|} ⊗ (v′)_{Γ;Δ′_{1}}^{‡} · (w′)_{Γ;Δ′_{2},x⃗:m⃗}^{‡})))
· (w)_{Γ;Δ_{1},y:m′}^{‡} =
perm_{Δ,Δ′′,Δ′_{1}} · (id_{|Δ′′|} ⊗ (v′)_{Γ;Δ′_{1}}^{‡}) · perm_{(Δ′′,x⃗:m⃗),Δ_{1},(Δ′_{2},x⃗:m⃗)}
· (id_{|Δ_{1}|} ⊗ (w′)_{Γ;Δ′_{2},x⃗:m⃗}^{‡}) · (w)_{Γ;Δ_{1},y:m′}^{‡}

where Δ′′ is the unique sequence of typings satisfying Δ = Δ′′#Δ′_{1}. This clearly holds using the substitution lemma 6.3.6.

Hence we have completed the proof. □

The Translations are Inverse

We can now show that these two translations make an inverse pair.

Lemma 6.3.8 (Inverse Pair) The translations ( )^{†} and ( )^{‡} are inverse up to provable equality, in the sense that for any action a:m → n of AC(𝕂) having free names x⃗ where m = l_{1} … l_{r}, y⃗ = y_{1} … y_{r} and |x⃗| = p⃗,

((a)† ; y⃗)_{x⃗:p⃗;y⃗:l⃗}^{‡} = a

holds in the equational theory AC, and for any Γ; Δ-term v of Lin^{A}(𝕂) we have the equality judgement:

Γ; Δ ⊢ ((v)_{Γ;Δ}^{‡})† ; y⃗ = v:n

where n is the unique type ascribed to v in the context Γ; Δ and Δ = y⃗:m⃗.

Proof We prove this as before by induction over the structure of actions and terms. Assume in the following that Γ = x⃗: p⃗. Firstly, considering actions a: m → n, we have: Identity In this case we have that:

((idl⃗)† ; y⃗)_{;y⃗:l⃗}^{‡} = (⊗y⃗)_{;y⃗:l⃗}^{‡} = mperm_{y⃗:l⃗,(y_{1}:l_{1})...(y_{r}:l_{r})} · id_{l_{1}} ⊗ … ⊗ id_{l_{r}}

but this is clearly equal to idl⃗. Composition In this case, we have that:

((a · b)† ; y⃗)_{Γ;y⃗:l⃗}^{‡} = (let ⊗y′ be (a)† ; y⃗ in (b)† ; y⃗′)_{Γ;y⃗:l⃗}^{‡}

= perm_{y⃗:l⃗, ,y⃗:l⃗} · ((a)† ; y⃗)_{Γ;y⃗:l⃗}^{‡} · ((b)_{y′}^{†})_{Γ;y′:l⃗′}^{‡}

but by induction we have that this is equal to a · b. Tensor In this case we have that:

((a ⊗ b)_{y⃗_{1}y⃗_{2}}^{†})_{Γ:y⃗_{1}:l⃗_{1},y⃗_{2}:l⃗_{2}}^{‡} = ((a)† ; y⃗_{1} ⊗ (b)† ; y⃗_{2})_{Γ:y⃗_{1}:l⃗_{1},y⃗_{2}:l⃗_{2}}^{‡}

= perm_{(l⃗_{1}l⃗_{2}),l⃗_{1},l⃗_{2}} · ((a)† ; y⃗_{1})_{Γ:y⃗_{1}:l⃗_{1}}^{‡} ⊗ ((a)† ; y⃗_{2})_{Γ;y⃗_{:}l⃗_{2}}^{‡}

but again by induction this is the identity. Permutation In this case we have that:

((p_{l⃗_{1},l⃗_{2}})_{y⃗_{1}y⃗_{2}}^{†})_{;y⃗_{2}:l⃗_{2},y⃗_{1}:l⃗_{1}}^{‡} = (⊗y⃗_{2}y⃗_{1})_{;y⃗_{2}:l⃗_{2},y⃗_{1}:l⃗_{1}}^{‡}
= perm_{(l⃗_{1}l⃗_{2}),l⃗_{2},l⃗_{1}} · (idl⃗_{2} ⊗ idl⃗_{1})
but by uniqueness perm_{(l⃗_{1}l⃗_{2}),l⃗_{2},l⃗_{1}} is just p_{l⃗_{1},l⃗_{2}}.

Abstraction In this case we have that:

(((x′^{q})a)_{y′y⃗}^{†})_{Γ;y′:q,y⃗:l⃗}^{‡} = (let x′ be y′ in (a)† ; y⃗)_{Γ;y′:q,y⃗:l⃗}^{‡}

= perm_{(y′:q,y⃗:l⃗)(y′:q),y⃗:l⃗} · (id_{q} ⊗ idl⃗)der : ·(x′)((a)† ; y⃗)_{Γ,x′:q;y⃗:l⃗}^{‡}

but by induction this is equal to (x′)a. Datum In this case we have that:

((⟨x^{p}⟩)_{ε}^{†})_{x:p;}^{‡} = (x)_{x:p;}^{‡} = ⟨x⟩ Control In this case we have:

((K(a_{1} … a_{r}))_{y′}^{†})_{Γ;y′:l⃗′}^{‡} = (K((y⃗_{1})(a_{1})† ; y⃗_{1} … (y⃗_{r})(a_{r})† ; y⃗_{r}, y′))_{Γ;y′:l⃗′}^{‡}
= mperm_{(y′:l⃗),y′_{1}:l′_{1}...y′_{s}:l′_{s}} · (id_{l_{1}} ⊗ … ⊗ id_{l_{s}}) ·

K(((a_{1})† ; y⃗_{1})_{Γ;y⃗_{1}:l⃗_{1}}^{‡} … ((a_{r})† ; y⃗_{r})_{Γ;y⃗_{r}:l⃗_{r}}^{‡})

But again this is by induction just K(a_{1} … a_{r}). For the second part, we prove the result over the structure of the unique

derivation of the Γ; Δ term. I-Ax In this case we have:

((x)_{Γ,x:p,Γ′;}^{‡} )_{ε}^{†} = (⟨x^{p}⟩)_{ε}^{†} = x

and so the appropriate equality judgement is easy by reflexivity. L-Ax In this case we have:

((x)_{Γ;x:l}^{‡})_{x}^{†} = (id_{l})_{x}^{†} = x

and so the appropriate equality judgement is easy by reflexivity. F-Rule In this case we have:

((let x^{p} be v in w)_{Γ;Δ}^{‡})_{y⃗_{1}y⃗_{2}}^{†} = (perm_{Δ,Δ_{2},Δ_{1}} · (id_{|Δ_{2}|} ⊗ (v)_{Γ;Δ_{1}}^{‡}) · (x)(w)_{Γ,x:p;Δ_{2}}^{‡})_{y⃗_{1}y⃗_{2}}^{†} = let ⊗y′_{2}y′_{1} be y⃗ in let ⊗y′′_{2}, z be ⊗y′_{2} ⊗ ((v)_{Γ;Δ_{1}}^{‡})_{y′_{1}}^{†} in let x be z in ((w)_{Γ;Δ_{2}}^{‡})_{y′′_{2}}^{†} and the required equality judgement is obtainable by induction using ⊗−η, ⊗ − β and cc equalities.

Control In this case we have: ((K((y⃗_{1}:l⃗_{1})v_{1} … (y⃗_{2}:l⃗_{2})v_{2}, w⃗))_{Γ;Δ′}^{‡})_{y′}^{†} = (mperm_{Δ′,Δ′_{1}...Δ′_{s}} · ((w_{1})_{Γ;Δ′_{1}}^{‡} ⊗ … ⊗ (w_{s})_{Γ;Δ′_{s}}^{‡}) · K((v_{1})_{Γ;Δ_{1}}^{‡} … (v_{r})_{Γ;Δ_{r}}^{‡}))_{y′}^{†}

= let ⊗z⃗_{1} … z⃗_{s} be y′ in let ⊗z′ be ((w_{1})_{Γ;Δ′_{1}}^{‡})_{y′_{1}}^{†} ⊗ … ⊗ ((w_{s})_{Γ;Δ′_{s}}^{‡})_{y′_{s}}^{†} in K((y⃗_{1})((v_{1})_{Γ;Δ_{1}}^{‡})† ; y⃗_{1} … ((y⃗_{r})(v_{r})_{Γ;Δ_{r}}^{‡})† ; y⃗_{r}, z⃗)

and the required equality can again be obtained by induction using ⊗ − β, ⊗ − η and cc equalities.

Tensor-Intro In this case, we have:

((⊗(v_{1} … v_{r}))_{Γ;Δ}^{‡})_{y′}^{†} = (mperm_{Δ,Δ_{1}...Δ_{r}} · ((v_{1})_{Γ;Δ_{1}}^{‡} ⊗ … ⊗ (v_{r})_{Γ;Δ_{r}}^{‡}))_{y′}^{†}

= let ⊗y⃗_{1} … y⃗_{r} be y′ in ((v_{1})_{Γ;Δ_{1}}^{‡})† ; y⃗_{1} ⊗ … ((v_{r})_{Γ;Δ_{r}}^{‡})† ; y⃗_{r}

and by induction using ⊗ − β and our α-conversion result lemma 6.3.3 the required equality can be deduced.

Tensor-Elim In this case, we have:

((let ⊗y⃗:m⃗ be v in w)_{Γ;Δ′}^{‡})_{y′}^{†} = (perm_{Δ′,Δ_{2},Δ_{1}} · (id_{⊗|Δ_{2}|} ⊗ (v)_{Γ;Δ_{1}}^{‡}) · (w)_{Γ;Δ_{2},y⃗:m⃗}^{‡})_{y′}^{†}

= let ⊗y⃗_{1}y⃗_{2} be y′ in let ⊗y′_{2}y⃗ be ⊗y⃗_{2} ⊗ ((v)_{Γ;Δ_{1}}^{‡})† ; y⃗_{1} in ((w)_{Γ;Δ_{2},y⃗:m⃗}^{‡})_{y⃗_{2}y⃗}^{†}

and the required equality can again be obtained by induction using ⊗ − β, ⊗ − η and cc equalities.

6.4 Extensions

We now present three extensions of action calculi, which add functional or higherorder behaviour to the basic action calculi. Essentially, these work by adding certain higher-order operators to the standard definition of action calculi, and certain axiomatic equalities on them to the theory of action calculi. This idea was first introduced by Milner in [Mil94b], where he extends the action calculus by adding an abstraction operator and an application operator similar to the abstraction and application of the λ-calculus. The first higher-order action calculus we present is just this one as amended by Hasegawa [HG], generalised to allow linear and intuitionistic primes in the same way as we have generalised Milner’s action calculi.

Definition 6.4.1 (Higher-Order Action Calculus) Given a signature 𝕂 = (P_{I}, P_{L}, K), the higher-order action calculus AC_{⇒}(𝕂) is given by extending the definition of generalised action calculi as follows:

1. the derived sets P\overrightarrow{I} and P\overrightarrow{L} of primes and the set M^{⇒} of arities are constructed from the following abstract grammars:

set of intuitionistic primes P\overrightarrow{I} p ::= p ∈ P_{I} | m ⇒ m
set of linear primes P\overrightarrow{L}  l ::= l ∈ P_{L} | p ∈ P\overrightarrow{I}
set of arities M^{⇒}  m ::= l ∈ P\overrightarrow{L} | m ⊗ m | ε

2. the terms of AC_{⇒}(𝕂) are generated by the rules in definition 6.1.3, plus the rules

\frac{a : m → n}{λ λ λa : ε → m ⇒ n}  ap : (m ⇒ n) ⊗ m → n

3. the equational theory of AC_{⇒} is that generated from the axioms in definition 6.1.4, plus the axioms

((λ λ λa) ⊗ id_{m}) · ap = a  (β)
λ λ λ((⟨x⟩ ⊗ id_{m}) · ap) = ⟨x⟩  (η_{V})
(λ λ λ(a) ⊗ id) · (x)b = b{λ λ λ(a)/⟨x⟩}  (σ)

The action calculus AC_{⇒}(𝕂) is the quotient of the terms by the equality.

Extensionality The amendment made by Hasegawa [HG] to Milner’s original definition is the addition of a η_{V} -equality similar to that given here in the case of Milner’s action calculi. If we say that the η-equality for an action a: ε → (n ⇒ m) is the equality

λ λ λ((a ⊗ id_{m}) · ap) = a

then in AC_{⇒}(𝕂) we can derive η-equalities for any copyable action of AC_{⇒}(𝕂), and in fact the converse is true. We can read this as saying that the functional structure is extensional over copyable actions, which we might regard as the intuitionistic subsystem of the action calculus. We could ask what would happen if we replaced η_{V} by the η-equality for all actions a of the appropriate arities. In [Mil94b], Milner points out that this addition collapses the structure of action calculi by making it simply that of a cartesian closed category. We can see this in the syntax since if we add the η rule in general, then all actions of the appropriate arity would become copyable and hence fall into the intuitionistic subsystem, so that this subsystem would then be the whole system.

We now present two systems based on a linear decomposition of the arrow constructor in the previous system. The first of these has just the ⊠ operator, which corresponds to the ! of linear logic, and which acts as a ‘coding’ operator in this setting. This was discovered independently by the author and Masahito Hasegawa.

Definition 6.4.2 (Action Calculus with Code) Given a signature 𝕂 = (P_{I}, P_{L}, K), the action calculus with code AC_{⊠}(𝕂) is given by extending the definition of action calculi as follows:

1. the sets P_{I}^{⊠} and P_{L}^{⊠} of intuitionistic and linear primes and the set M^{⊠} of arities are constructed from the following abstract grammars:

set of intuitionistic primes P_{I}^{⊠} p ::= p ∈ P_{I} | ⊠ (m)
set of linear primes P_{L}^{⊠}  l ::= l ∈ P_{L} | p ∈ P_{I}^{⊠}
set of arities M^{⊠}  m ::= l ∈ P_{L}^{⊠} | m ⊗ m | ε

2. the terms of AC_{⊠}(𝕂) are generated by the rules in definition 6.1.3, plus the rules

\frac{a : ε → m}{code(a) : ε → ⊠(m)}  decode : ⊠(m) → m

3. the equational theory of AC_{⊠} is that generated from the axioms in definition 6.1.4, plus the axioms

code(a) · decode = a  (β)
code(⟨x⟩ · decode) = ⟨x⟩  (η)
(code(a) ⊗ id) · (x)b = b{code(a)/⟨x⟩}  (σ)

The action calculus AC_{⊠}(K) is the quotient of the terms by the equality.

Secondly, we introduce a system which extends AC_{⊠}(𝕂) by adding the linear function type, with abstraction and application operators.

Definition 6.4.3 (Linear Higher-Order Action Calculus) Given a signature 𝕂 = (P_{I}, P_{L}, K), the linear higher-order action calculus AC_{⊠,⊸}(𝕂) is given by extending the definition of action calculi as follows:

1. the sets P_{I} and P_{L} of intuitionistic and linear primes and the set M^{⊠,⊸} of arities are constructed as follows:

set of intuitionistic primes P_{I}^{⊠,⊸} p ::= p ∈ P_{I} | ⊠ (m)
set of linear primes P_{L}^{⊠,⊸}  l ::= l ∈ P_{L} | p ∈ P_{I}^{⊠,⊸} | l ⊸ n
set of arities M^{⊠,⊸}  m ::= l ∈ P_{L}^{⊠,⊸} | m ⊗ m | ε

2. the terms of AC_{⊠,⊸}(𝕂) are generated by the rules in definition 6.1.3 and definition 6.4.2, plus the rules

\frac{a : m ⊗ l → n}{λ λ λ_{L}^{l}a : m → (l ⊸ n)} where l ∈ P_{L}  ap_{L}^{l} : (l ⊸ n) ⊗ l → n

3. the equational theory AC_{⊠,⊸} is the set of equations upon terms generated from the axioms in definitions 6.1.4 and 6.4.2, plus the axioms

((λ λ λ_{L}^{l}a) ⊗ id_{p}) · ap_{L}^{l} = a  (β)
λ λ λ_{L}^{l}((a ⊗ id_{p}) · ap_{L}^{l}) = a  (η)
λ λ λ_{L}^{l}((x)a) = (x)(λ λ λ_{L}^{l}a) where a : m ⊗ p → n  (cc)
λ λ λ_{L}^{l}(a ⊗ id_{p} · b) = a · (λ λ λ_{L}^{l}b)  (cc)
where a : m → n and b : n ⊗ p → n′

The action calculus AC_{⊠,⊸}(K) is the quotient of the terms by the equality.

Extensionality Revisited We note that in contrast to the situation with the extended action calculus AC_{⇒}(𝕂), the η-equality holds in the system AC_{⊠,⊸}(𝕂) for all actions of the appropriate arity. However, the structure does not collapse to that of a CCC in the case of AC_{⊠,⊸}(𝕂) since it is no longer possible to prove that any action for which the η-equality holds is copyable. Hence this theory provides an account of extensional functions at a linear level.

We can extend the definition of the linear arrow type to arbitrary arities. Given an arity m = l_{1} … l_{r}, define on arities m ⊸ n = l_{1} ⊸ (… (l_{r} ⊸ n)..), and on actions λ λ λ_{L}^{m}(a) = λ λ λ_{L}^{l_{1}}(…λ λ λ_{L}^{l_{r}}(a)..) and ap_{L}^{m} = (ap_{L}^{l_{1}} ⊗id_{l_{2}} ⊗… l_{r})·. . .·ap_{L}^{l_{r}}. Note that this definition makes ε ⊸ m = m, and correspondingly on term constructs makes λ λ λ_{L}^{ε}(a) = a and ap_{L}^{ε} = id.

Relating the Extensions

Having presented these extensions, we can give some relationships between them. It is clear firstly that there are trivial embeddings ι_{1} : AC(𝕂) → AC_{⊠}(𝕂) and ι_{2} : AC_{⊠}(𝕂) → AC_{⊠,⊸}(𝕂). However, there also exist translations ι_{3} : AC_{⊠}(𝕂) → AC_{⇒}(𝕂) and ι_{4} : AC_{⇒}(𝕂) → AC_{⊠,⊸}(𝕂).

Definition 6.4.4 (The Translation ι_{3}) Define the translation ι_{3} : AC_{⊠}(𝕂) → AC_{⇒}(𝕂) as the obvious embedding on shared constructs, augmented with:

ι_{3}(⊠(m)) = (ε ⇒ m)
ι_{3}(code(a)) = λ λ λ(ι_{3}(a))
ι_{3}(decode) = ap

Definition 6.4.5 (The Translation ι_{4}) Define the translation ι_{4} : AC_{⇒}(𝕂) → AC_{⊠,⊸}(𝕂) as the obvious embedding on shared constructs, augmented with:

ι_{4}(m ⇒ n) = ⊠(m ⊸ n)
ι_{4}(λ λ λ(a)) = code(λ λ λ_{L}^{m}(ι_{4}(a))) where a : m → n
ι_{4}(ap) = decode ⊗ id · ap

AC(𝕂)

AC_{⊠}(𝕂)^{^{}ι_{1}}

[figure: AC_{⇒}(𝕂); ι_{4}; ι_{3}; AC_{⊠,⊸}(𝕂); ι_{2}]

Figure 6.1: Translations between AC(𝕂) and its extensions

We summarise the translations in figure 6.1. It can easily be shown that the triangle at the bottom of this diagram commutes up to equality in AC_{⊠,⊸}(𝕂).

Extending Lin^{A}(𝕂)

We now extend our generalised linear type-theory Lin^{A}(𝕂) to provide type-theories corresponding to the extended action calculi defined previously. We introduce some notation for these definitions, where E denotes any extension from ⊠, → or ⊠, ⊸:

• When we say that an operator set O_{L}^{A^{E}} contains all control operators we will mean that it contains every operator O_{K} of O_{L}^{A}.

• When we say that an operator set O_{L}^{A^{E}} contains all ⊗_{m_{1}...m_{r}}^{R} operators we will mean that it contains instances of the operator ⊗_{m_{1}...m_{r}}^{R} for all m_{1} … m_{r} ∈ M_{L}^{A^{E}}.

• When we say that an operator set O_{L}^{A^{E}} contains all ⊗_{m_{1}...m_{r}}^{L} operators we will mean that it contains instances of every operator in the outputparameterised set ⊗_{m_{1}...m_{r}}^{L} for all m_{1} … m_{r} ∈ M_{L}^{A^{E}}.

• When we say that an axiom set 𝔸^{A^{E}} contains all l-equalities, for some identifying label l, we will mean that contains every well-formed equality having the form of the equality l in the typing system Lin^{A}(𝕆^{E}).

Definition 6.4.6 (The Type Theory Lin^{A^{⇒}}(𝕂)) We define the type theory Lin^{A^{⇒}}(𝕂) over a signature 𝕂 = (P_{I}, P_{L}, K) as the type theory LNat(𝕆^{A^{⇒}}, 𝔸^{A^{⇒}}) where 𝕆^{A^{⇒}} = (M_{I}^{A^{⇒}}, M_{I}^{A^{⇒}}, O_{I}^{A^{⇒}}, O_{L}^{A^{⇒}}) and we define these objects as follows:

• The set M_{I}^{A^{⇒}} is the set of singleton sequences of elements of P\overrightarrow{I}.

• The set M_{L}^{A^{⇒}} is the set of sequences of elements of P\overrightarrow{L}.

• The set O_{L}^{A^{⇒}} contains all control operators, all ⊗_{m_{1}...m_{r}}^{R} operators and all ⊗_{m_{1}...m_{r}}^{L} operators and also:

1. For each m and n in M_{L}^{A^{⇒}}, an operator λ λ λ_{m,n} of arity:

\begin{matrix}(; m)n & ; \\ (; )m ⇒ n \end{matrix}

We will write the general operator application λ λ λ_{m,n}((; x)v; )(; ) in the form λx:m.v.

2. For each m and n in M_{L}^{A^{⊠}} an operator ap of arity:

{; \atop (; (m ⇒ n), m)n}

We will write ap(; )(; vw) in the familiar way as vw.

• The set O_{I}^{A^{⇒}} is the subset of O_{L}^{A^{⇒}} containing for each m and n the operator λ λ λ_{m,n}.

• The set 𝔸^{A^{⇒}} contains all ⊗ − β, ⊗ − η, ⊗ − 1 and ⊗ − 2 equalities and also:

1. All well formed equality judgements of the form:

(λ λ λ − β) Γ; Δ ⊢ (λx.v)w = v{w/x}:m

2. All well formed equality judgements of the form:

(λ λ λ − η_{V}) Γ, y:m ⇒ n; ⊢ λx.(yx) = y:m ⇒ n

3. All the equality judgements in the sets ONat(𝕆^{A^{⇒}}, ⊗_{m_{1}...m_{r}}^{L}), for any m_{1} … m_{r}.

Definition 6.4.7 (The Type Theory Lin^{A^{⊠}}(𝕂)) We define the type theory Lin^{A^{⊠}}(𝕂) over a signature 𝕂 = (P_{I}, P_{L}, K) as the type theory LNat(𝕆^{A^{⊠}}, 𝔸^{A^{⊠}}) where 𝕆^{A^{⊠}} = (M_{I}^{A^{⊠}}, M_{I}^{A^{⊠}}, O_{I}^{A^{⊠}}, O_{L}^{A^{⊠}}) and we define these objects as follows:

• The set M_{I}^{A^{⊠}} is the set of singleton sequences of elements of P_{I}^{⊠}.

• The set M_{L}^{A^{⊠}} is the set of sequences of elements of P_{L}^{⊠}.

• The set O_{L}^{A^{⊠}} contains all control operators, all ⊗_{m_{1}...m_{r}}^{R} operators and all ⊗_{m_{1}...m_{r}}^{L} operators and also:

1. For each m ∈ M_{L}^{A^{⊠}} an operator code_{m} of arity:

\begin{matrix}(; )m & ; \\ (; ) ⊠ (m) \end{matrix}

We will write the general operator application code_{m}((; )v; )(; ) as code(v).

2. For each m ∈ M_{L}^{A^{⊠}} an operator decode_{m} of arity:

{; \atop (; ⊠(m))m}

We will write the general operator application decode_{m}(; )(; v) as decode(v).

• The set O_{I}^{A^{⊠}} is the subset of O_{L}^{A^{⊠}} containing for each m the code_{m} operator.

• The set 𝔸^{A^{⊠}} contains all ⊗ − β, ⊗ − η, ⊗ − 1 and ⊗ − 2 equalities and also:

1. All well formed equality judgements of the form:

(⊠ − β) Γ; ⊢ decode(code(v)) = v:m

2. All well formed equality judgements of the form:

(⊠ − η) Γ; ⊢ code(decode(x)) = x:⊠(m)

3. All equality judgements in the sets ONat(𝕆^{A^{⊠}}, ⊗_{m_{1}...m_{r}}^{L}), for all m_{1} … m_{r}.

Definition 6.4.8 (The Type Theory Lin^{A^{⊠,⊸}}(𝕂)) We define the type theory Lin^{A^{⊠,⊸}}(𝕂) over a signature 𝕂 = (P_{I}, P_{L}, K) as the type theory LNat(𝕆^{A^{⊠,⊸}}, 𝔸^{A^{⊠,⊸}}) where 𝕆^{A^{⊠,⊸}} = (M_{I}^{A^{⊠,⊸}} , M_{I}^{A^{⊠,⊸}} , O_{I}^{A^{⊠,⊸}} , O_{L}^{A^{⊠,⊸}}) and we define these objects as follows:

• The set M_{I}^{A^{⊠,⊸}} is the set of singleton sequences of elements of P_{I}^{⊠,⊸}.

• The set M_{L}^{A^{⊠,⊸}} is the set of sequences of elements of P_{L}^{⊠,⊸}.

• The set O_{L}^{A^{⊠,⊸}} contains all control operators, all ⊗_{m_{1}...m_{r}}^{R} operators and all

⊗_{m_{1}...m_{r}}^{L} operators and also: 1. For each m ∈ M_{L}^{A^{⊠}} an operator code_{m} of arity:

\begin{matrix}(; )m & ; \\ (; ) ⊠ (m) \end{matrix}

We will write the general operator application code_{m}((; )v; )(; ) as code(v).

2. For each m ∈ M_{L}^{A^{⊠}} an operator decode_{m} of arity:

{; \atop (; ⊠(m))m}

We will write the general operator application decode_{m}(; )(; v) as decode(v).

3. For each l ∈ P_{L}^{⊠,⊸} and each n ∈ M_{L}^{A^{⊠,⊸}}, an operator λ λ λ_{l,n}^{L} of arity:

\begin{matrix}; & (; l)n \\ (; )l ⊸ n \end{matrix}

We will write the general operator application λ λ λ_{l,n}^{L}(; (; x)v)(; ) as λ^{L}x: l.v.

4. For each l ∈ P_{L}^{A^{⊠,⊸}} and n ∈ M_{L}^{A^{⊠}} an operator ap_{l,n}^{L} of arity:

{; \atop (; l, (l ⊸ n))n}

We will write ap_{l,n}^{L}(; )(; vw) as vw.

• The set O_{I}^{A^{⊠,⊸}} is the subset of O_{L}^{A^{⊠,⊸}} containing just the code_{m} operators for each m ∈ M_{L}^{A^{⊠,⊸}}.

• The set 𝔸^{A^{⊠,⊸}} contains all ⊗ − β, ⊗ − η, ⊗ − 1, ⊗ − 2, ⊠ − β and ⊠ − η

equalities and also:

1. All well formed equality judgements of the form:

(λ − β) Γ; Δ ⊢ (λx.v)w = v{w/x}:m

2. All well formed equality judgements of the form:

(λ − η) Γ; Δ ⊢ λx.(vx) = v:l ⊸ n 3. All equality judgements in the sets ONat(𝕆^{A^{⊠,⊸}}, ⊗_{m_{1}...m_{r}}^{L}) for m_{1} … m_{r} ∈

M_{L}^{A^{⊠,⊸}}.

We can see that the embeddings and translations ι_{1} … ι_{4} induce similar embeddings and translations amongst our extended type theories. We overload notation to call these ι_{1} … ι_{4} as well.

We can extend our functions ( )^{†} and ( )^{‡} to relate each extended action calculus with its corresponding type theory. Here, we just summarise all of these translations together by giving their definitions on the various arity and term constructs.

Definition 6.4.9 (The Extended Translation ( )^{†}) We define the translation ( )^{†} on the various extended action calculi as follows:

(y⃗,λ λ λ(a))^{†} = λz.(let ⊗y⃗ be z in (zy⃗, a)^{†})
(y_{1}y_{2}, ap)^{†} = y_{1}y_{2}
(ε, code(a))^{†} = code((ε, a)^{†})
(y, decode)^{†} = decode(y)
(y⃗,λ λ λ_{L}^{l}(a))^{†} = λ_{L}z.(y⃗z, a)^{†}
(y_{1}y_{2}, ap_{L}^{l})^{†} = y_{1}y_{2}

Definition 6.4.10 (The Extended Translation ( )^{‡}) We define the translation ( )^{‡} on the various type theories corresponding to extended action calculi as follows:

(λx:m.v)_{Γ}^{‡} = λ λ λ(v)_{Γ;x:m}^{‡}
(vw)_{Γ;Δ}^{‡} = perm_{Δ,Δ_{1},Δ_{2}} · ((v)_{Γ;Δ_{1}}^{‡} ⊗ (w)_{Γ;Δ_{2}}^{‡}) · ap
(code(v))_{Γ;}^{‡} = code((v)_{Γ;}^{‡} )
(decode(v))_{Γ;Δ}^{‡} = (v)_{Γ;Δ}^{‡} · decode
(λx:l.v)_{Γ;Δ}^{‡} = λ λ λ_{L}^{l}(v)_{Γ;Δ,x:l}^{‡}
(vw)_{Γ;Δ}^{‡} = perm_{Δ,Δ_{1},Δ_{2}} · ((v)_{Γ;Δ_{1}}^{‡} ⊗ (w)_{Γ;Δ_{2}}^{‡}) · ap_{L}

We can now easily extend our results on the basic translations to these extensions.

Lemma 6.4.11 (The Extended Translations) The extended translations ( )^{†} and ( )^{‡} make AC_{⇒}(𝕂) and Lin^{A^{⇒}}(𝕂) isomorphic, they make AC_{⊠}(𝕂) and Lin^{A^{⊠}}(𝕂) isomorphic, and they make AC_{⊠,⊸}(𝕂) and Lin^{A^{⊠,⊸}}(𝕂) isomorphic.

6.5 Semantics

Since the theory of action calculi itself is a relatively recent development, there is less work on the semantics of action calculi than on that of ILL. A semantics was first given in the form of control structures [MMP95], which are symmetric monoidal categories with abstractors to represent the name-structure. A fibrational equivalent not requiring naming structure was given by Hermida and Power [HP95]. Then this was proved equivalent by Power to an alternative formulation using an adjunction [Pow96]. These models were used as the basis for the models of Gardner et al. [HG, BGHP97], and in this section we will use this definition. In the higher-order case, there has been less work, but definitions of models have been given [HG, BGHP97], which we will use in the following.

In this section, we will say “Lin^{A}(𝕂)-model” to mean “output-natural-in- ⊗_{m_{1}...m_{r}}^{L}-for-all-r, m_{1} … m_{r} Lin^{A}(𝕂)-model”.

The Basic Case

Since we are not using precisely the original definition of action calculi, we will need to recast the definition of [HG] slightly, to take account of our linear prime arities.

The carrier of an action model is a triple (C, S, F), where C is a strict cartesian closed category, S is a symmetric monoidal closed category, and F : C → S is an injective-on-objects strict symmetric monoidal functor.

Definition 6.5.1 (Action Model) Action models over an action calculus signature 𝕂, ranged over by A …, are given by a carrier (C, S, F) supplemented with:

• a function [[ ]]_{P_{I}} : P_{I} → obj(C) and a function [[ ]]_{P_{L}} : P_{L} → obj(S) such that for p ∈ P_{I}, we have [[p]]_{P_{I}} = [[p]]_{P_{L}} in S,

• for each control K with arity ((m_{1}, n_{1}), …, (m_{r}, n_{r})) → (m, n) we have a natural transformation

[[K]]_{K} : ∏_{i=1...r} S(F ( ) ⊗ [[m_{i}]], [[n_{i}]]), S(F ( ) ⊗ [[m]], [[n]])

under the obvious interpretation of arities into S given by

[[l_{1} … l_{r}]] = ⊗([[l_{1}]] … [[l_{r}]])

Now this definition is very reminiscent of our definition of models for our general linear logic. We can in fact prove:

Lemma 6.5.2 Every action model gives rise to a Lin^{A}(𝕂)-model.

Proof This is easily shown; given an action model A, we will construct a Lin^{A}(𝕂)-model G^{A}. Firstly, the carrier of G^{A} is exactly the carrier of A. The interpretation of intuitionistic prime arities in M_{I} is exactly the interpretation of P_{I} given by A, since the two sets are the same, and the interpretation on elements of M_{L}, which are sequences of elements of P_{L}, is simply given by the strict tensor of the the interpretations of the elements of P_{L} using the interpretation function from A. Finally, the interpretation of the operators corresponding to the controls is exactly the interpretation of the controls themselves, and the interpretation of the ⊗^{R} and ⊗^{L}-operators is given in the obvious way using the tensor structure on the s.m.c. □

We can also define action morphisms:

Definition 6.5.3 (Action Morphisms) An action morphism over an action calculus signature 𝕂, F : A → A′ between two action models A and A′ having carriers (C, S, F) and (C′, S′, F′) respectively is a pair (F_{C} : C → C′, F_{S} : S → S′) of morphisms such that:

• F_{C} is strict cartesian and F_{S} is strict symmetric monoidal,

• the following diagram commutes:

[figure: C; F; S; C′; F_{C}; F′; S′; F_{S}]

• F_{C}([[ ]]_{P_{I}}^{A}) = [[ ]]_{P_{I}}^{A′} : P_{I} → obj(C′),

• F_{S}([[ ]]_{P_{L}}^{A}) = [[ ]]_{P_{L}}^{A′} : P_{L} → obj(S′), • for every control K with arity ((m_{1}, n_{1}), …, (m_{r}, n_{r})) → (m, n) from the

signature 𝕂, and for every element X of C and morphisms of S f_{i} : F (X) ⊗ [[m_{i}]] → [[n_{i}]] for i = 1 … r, we have:

F_{S}([[K]]_{K}^{A}(X)(f_{1}, …, f_{r})) = [[K]]_{K}^{A′}(F_{C}(X))(F_{S}(f_{1}), …, F_{S}(f_{r}))

Given this definition, we have:

Lemma 6.5.4 Any action morphism F gives rise to a Lin^{A}(𝕂)-morphism.

It is easy to check the necessary conditions, which are very close to those of the definition of Lin^{A}(𝕂)-morphism.

We can now define the category Cat_{AC}(𝕂) of small action models and morphisms over a signature 𝕂. Further, call the category of small Lin^{A}(𝕂)-models and Lin^{A}(𝕂)-morphisms Cat_{Lin}_{A}(𝕂). From our results, we can see that we have a functor Cat_{AC}(𝕂) → Cat_{Lin}_{A}(𝕂).

It is clear that a general Lin^{A}(𝕂)-model may fail to be an action model, firstly because the functor F of the carrier may well not be injective on objects. We can, however, use a result of Power and Robinson [PR94], in the intuitionistic case.

Lemma 6.5.5 For an intuitionistic action calculus signature 𝕂, any Lin^{A}(𝕂)-model gives rise to an action model.

Proof Given a Lin^{A}(𝕂)-model G, we will construct an action model A^{G}. First note that by section 5, corollary 5.1 of [PR94] given that the carrier G is (C, S, F), we have a strict symmetric monoidal category S′, an identity-on-objects functor F_{1} : C → S′ and a fully faithful functor F_{2} : S′ → S, such that F = F_{1}; F_{2}. These are unique up to unique isomorphism. Take the carrier of A^{G} to be (C, S′, F_{1}). Then take the interpretation on intuitionistic prime arities to be [[ ]]_{M_{I}} : P_{I} → obj(C) of G. Take the interpretation on linear prime arities (which because the signature is intuitionistic are precisely the same as the intuitionistic prime arities) to be given

[[ ]]_{P_{L}} = F_{1}([[ ]]_{M_{I}}) : P_{I} → obj(S′)

Now note that using the natural transformations present in S that

[[p_{1} ⊗ … ⊗ p_{r}]]_{M_{L}} ≃ [[p_{1}]] ⊗ … ⊗ [[p_{r}]]

Using these isomorphisms, and the full faithfulness of F_{2}, we can obtain natural transformations interpreting the controls over the carrier. □

The Higher-Order Case

We now consider the case of Milner’s higher-order extension of an action calculus, AC_{⇒}(𝕂). Again, we slightly adapt the definition given in [HG] to take account of our linear prime arities.

Definition 6.5.6 (Higher-Order Action Model) Higher-order action models over an action calculus signature 𝕂, again ranged over by A …, are action models over 𝕂 such that the functor F ( ) ⊗ X : C → S has a right adjoint X ⇒ : S → C, where the interpretation [[ ]]_{P_{I}} : P_{I} → obj(C) is extended by saying that [[m ⇒ n]]_{P_{I}} = [[m]]_{P_{L}} ⇒ [[n]]_{P_{L}}.

We can now prove

Lemma 6.5.7 Each higher-order action model gives rise to a Lin^{A^{⇒}}(𝕂)-model.

Proof This is quite easy to show since we know that the higher-order action model is in fact an action model over signature 𝕂, and hence we know that it gives rise to a Lin^{A}(𝕂)-model. However, this Lin^{A}(𝕂)-model has the required interpretation of the new intuitionistic prime arities of Lin^{A^{⇒}}(𝕂) by virtue of the functor ⇒, and the abstraction and application are interpreted using natural transformations existing because of the adjunction. □

Definition 6.5.8 (Higher-Order Action Morphism) A higher-order action morphism over an action calculus signature 𝕂, F : A → A′, between two higher-order action calculus models A and A′ is an action morphism (F_{C}, F_{S}) such that functors per-serve the functor ⇒ and the adjunction (which is to say that the following diagrams commute):

[figure: S; X ⇒; C; S′; F_{S}; F_{C}(X) ⇒′; C′; F_{C}]

S(F (X) ⊗ Y_{1}, Y_{2})  \overline{( )^{∗}  ^{}}C(X, Y_{1} ⇒ Y_{2})

[figure: S′(F_{S}(F (X) ⊗ Y_{1}), F_{S}(Y_{2})); F_{S}; C′(F_{C}(X), F_{C}(Y_{1} ⇒ Y_{2})); F_{C}]
||  ||
S′(F′F_{C}(X) ⊗′ F_{S}(Y_{1}), F_{S}(Y_{2})) \overline{( )^{∗}^{}}C′(F_{C}(X), F_{S}(Y_{1}) ⇒′ F_{S}(Y_{2}))

As before, we have:

Lemma 6.5.9 Any higher-order action morphism gives rise to a Lin^{A^{⇒}}(𝕂)-morphism.

Proof The underlying action morphism gives rise to a Lin^{A}(𝕂)-morphism, and this is seen also to preserve the added structure of Lin^{A^{⇒}}(𝕂) since it preserves the adjunction which underlies that structure. □

Now we can define the category of small higher-order action models and morphisms, written Cat_{AC}^{⇒}(𝕂), and the category of small Lin^{A^{⇒}}(𝕂)-models and morphisms, written Cat\overrightarrow{Lin^{A}}(𝕂). We then have a functor Cat_{AC}^{⇒}(𝕂) → Cat\overrightarrow{Lin^{A}}(𝕂) as before, but we also have the obvious forgetful reducts Cat_{AC}^{⇒}(𝕂) → Cat_{AC}(𝕂) and Cat\overrightarrow{Lin^{A}}(𝕂) → Cat_{Lin}_{A}(𝕂).

Following the definition of higher-order action models for Milner’s higherorder action calculus AC_{⇒}(𝕂), we could define models for AC_{⊠}(𝕂), based on the functor F having an adjoint, and for AC_{⊠,⊸}(𝕂), based on F having an adjoint and S being strict symmetric monoidal closed. Then results analogous to those above relating AC_{⊠}(𝕂)-models and Lin^{A^{⊠}}(𝕂)-models and morphisms, and AC_{⊠,⊸}(𝕂)- models and Lin^{A^{⊠,⊸}}(𝕂)-models and morphisms would hold. This development is pursued in [BGHP97], and the reader is referred there for the details. However, we prefer to develop a more uniform account of higher-order behaviour in the context of our generalised linear type-theory. This we will give in the next chapter.

Higher-Order Type Theories

In this chapter we give a general higher-order (functional) version of our generalised linear type-theory. We see how any generalised linear type-theory gives rise to a higher order extension, and show that the embedding of the original theory into the higher-order extension is conservative, using a semantic argument. We consider some consequences of this for our case study in action calculi.

Then, we introduce a higher-order type-theory which is isomorphic to our type theory DILL(ℂ), hence showing that the notion of higher-order extension which we have given is well founded.

7.1 Higher-Order Type Theories

It will be the case that a higher-order generalised linear type-theory (which henceforth we will call just a higher-order type-theory) is an instance of a generalised type-theory with certain higher-order operators and axioms. We will need to give a generalised signature for this instance.

First, given type-sets M_{I} and M_{L}, define the higher-order type sets M_{I}^{H} and M_{L}^{H} as follows, inductively:

Q ∈ M_{I}^{H} ::= Q ∈ M_{I} | !A (for A ∈ M_{L}^{H})
A ∈ M_{L}^{H} ::= A ∈ M_{L} | I | A ⊗ A | A ⊸ A | !A

We can now define a higher-order signature, which is essentially a signature in which the operators may use higher-order types over the primitive types given in the signature.

Definition 7.1.1 (Higher-Order Signature) Define a higher-order signature, ranged over by ℍ, to be a quadruple (M_{I}, M_{L}, O_{I}, O_{L}) such that (M_{I}^{H}, M_{L}^{H}, O_{I}, O_{L}) is a generalised signature.

Now, given a higher-order signature (M_{I}, M_{L}, O_{I}, O_{L}), define the higher-order operator sets O_{I}^{H} and O_{L}^{H} as follows, again inductively:

O ∈ O_{I}^{H} ::= O ∈ O_{I} | !
O ∈ O_{L}^{H} ::= O ∈ O_{L} | I^{R} | I_{A}^{L} | ⊗_{A,B}^{R} | ⊗_{A,B−C}^{L} | λ_{A,B} | ap_{A,B} | !_{A} | !_{A}

for A, B, C ∈ M_{L}^{H}, where:

• the operator I^{R} is a constant with arity I,

• the output-parameterised set of operators I^{L} have arity:

\begin{aligned}; & (; )( ) \\ & (; I)( ) \end{aligned}

• for each A and B, the operator ⊗_{A,B}^{R} has arity:

\begin{aligned}; & (; )A & (; )B \\ & (; )A ⊗ B \end{aligned}

• for each A and B, the output-parameterised set of operators ⊗_{A,B}^{L} has arity:

\begin{matrix}; & (; A, B)( ) \\ (; A ⊗ B)( ) \end{matrix}

• for each A and B, the operator λ_{A,B} has arity:

\begin{matrix}; & (; A)B \\ (; )A ⊸ B \end{matrix}

• for each A and B, the operator ap_{A,B} has arity:

{; \atop (; A, A ⊸ B)B}

• for each A, the operator !_{A} has arity:

\begin{matrix}(; )A & ; \\ (; )!A \end{matrix}

• for each A, the operator !_{A} has arity:

{; \atop (; !A)A}

From now on, we will use standard abbreviations for these operators as follows:

∗ for I^{R}
let ∗ be v in w for I_{A}^{L}(; ()w)(; v)
w ⊗ v for ⊗_{A,B}^{R} (; ()w, ()v)()
let x ⊗ y : A ⊗ B be v in w for ⊗_{A,B−C}^{L} (; (; x:A, y:B)w)(; v)
λx:A.v for λ_{A,B}(; (; x:A)v)()
vw for ap_{A,B}(; )(; v, w)
!v for !_{A}(v; )()
!v for !_{A}(; )(; v)

We will write 𝕆^{ℍ} for the generalised signature (M_{I}^{H}, M_{L}^{H}, O_{I}^{H}, O_{L}^{H}), where ℍ is the higher-order signature (M_{I}, M_{L}, O_{I}, O_{L}).

Now we can define the higher-order typing-system.

Definition 7.1.2 (Higher-Order Typing System) The higher-order typing system over a higher-order signature ℍ, which we will write Lin^{H}(ℍ), is just the generalised linear typing system Lin(𝕆^{ℍ}).

Say that a higher order axiom set is just an axiom set 𝔸 over the higher-order typing system Lin^{H}(ℍ).

Definition 7.1.3 (Basic Higher-Order Axiom Set) Define the basic higher order axiom set 𝔸^{ℍ} over a higher-order signature ℍ to be the axiom set containing the equality judgements in the sets ONat(𝕆^{ℍ}, I^{L}) and ONat(𝕆^{ℍ}, ⊗_{A,B}^{L}) for all A, B ∈ M_{L}^{H}, and every instance for types of ℍ of the equality judgements:

β  η
Γ; Δ ⊢ let ∗ be ∗ in v = v:A  Γ; Δ ⊢ let ∗ be v in ∗ = v:I
Γ; Δ ⊢ let x ⊗ y be v_{1} ⊗ v_{2} in w = w{v_{1}, v_{2}/x, y}:A Γ; Δ ⊢ let x ⊗ y be v in x ⊗ y:A ⊗ B
Γ; Δ ⊢ (λx.v)w = w{v/x}:A  Γ; Δ ⊢ λx.(vx):A ⊸ B
Γ; ⊢ !(!v) = v:A  x :!A; ⊢!( !x) = x :!A

We are now in a position to define the higher-order type-theory over a given higher-order signature and axiom set.

Definition 7.1.4 (Higher-Order Type-Theory) Given a higher-order signature ℍ and a higher-order axiom set 𝔸, define the higher-order type theory over ℍ and 𝔸, written Lin^{H}(ℍ, 𝔸), as the generalised linear type-theory Lin(𝕆^{ℍ}, 𝔸 ∪ 𝔸^{ℍ}).

Derived Typing Rules

Given this definition, Lin^{H}(ℍ, 𝔸) has the following typing rules for its higher-order operators:

Γ; ⊢ ∗:I

Γ; Δ_{1} ⊢ v:I Γ; Δ_{2} ⊢ w:A
Γ; Δ ⊢ let ∗ be v in w:A

\begin{matrix}Γ; Δ_{1} ⊢ v:A & Γ; Δ_{2} ⊢ w:B \\ Γ; Δ ⊢ v ⊗ w:A ⊗ B \end{matrix} Γ; Δ_{1} ⊢ v:A ⊗ B Γ; Δ_{2}, x:A, y:B ⊢ w:C

Γ; Δ ⊢ let x ⊗ y be v in w:C
{Γ; Δ′, x:A ⊢ v:B \atop Γ; Δ′ ⊢ λx.v:A ⊸ B}  \begin{matrix}Γ; Δ_{1} ⊢ v:A ⊸ B & Γ; Δ_{2} ⊢ w:A \\ Γ; Δ ⊢ vw:B \end{matrix}
{Γ; ⊢ v:A \atop Γ; ⊢!v :!A}  {Γ; Δ′ ⊢ v :!A \atop Γ; Δ′ ⊢ !(v):A}

where Δ = Δ_{1}#Δ_{2}.

The Higher-Order Extension of Lin(𝕆, 𝔸)

Having defined higher-order type-theories, we can now show that we immediately have a family of such things. Firstly, note that given any generalised signature 𝕆 = (M_{I}, M_{L}, O_{I}, O_{L}), we have another generalised signature (M_{I}^{H}, M_{L}^{H}, O_{I}, O_{L}). Therefore, 𝕆 is itself a higher-order signature. Further, the embedding on preterms in fact maps Γ; Δ-terms of Lin(𝕆) to Γ; Δ-terms of Lin^{H}(𝕆).

Now, note that if 𝔸 is an axiom set over the generalised linear typing system Lin(𝕆), then it is also one over the generalised typing system (M_{I}^{H}, M_{L}^{H}, O_{I}, O_{L}). Hence, it is itself a higher-order axiom set. We have, therefore, that Lin^{H}(𝕆, 𝔸) is a higher-order type-theory, and we call this higher-order type-theory the higherorder extension of the original type-theory. It follows easily that the embedding on terms Lin(𝕆, 𝔸) → Lin^{H}(𝕆, 𝔸) is sound; later in this chapter, we will use semantic methods to demonstrate that it is also conservative.

Operators as Higher-Order Constants

One advantage of higher-order structure is that it allows us to code general operators as constants of higher types. Unfortunately, there is a slight problem with encoding operators in O_{I}, which arises since we need to make the image of any instance of such an operator copyable in the higher-order type-theory. In general, there is no way to give a constant encoding of the operator which will achieve this without adding equalities to the system. However, we can prove a result:

Lemma 7.1.5 The arbitrary linear type-theory Lin(𝕆, 𝔸) is equivalent to the linear type theory Lin((M_{I}, M_{L}, ∅, O_{L}), 𝔸 ∪ ⋃_{O∈O_{I}} Int(𝕆, O)), where Int(𝕆, O) is defined as the set of all equality judgements of the form

Γ; Δ ⊢let x be O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; )() in w
= w{O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}); )()/x}:A

in the typing system Lin(𝕆).

Proof This can be seen using the translations which are the identity on types and terms in both directions. The only issue is whether these translations preserve provable equality, but this is easily seen since in one direction we map an instance of the F -rule for the operator O to an equality judgement in Int(𝕆, O), and in the other direction we map an equality judgement in a set Int(𝕆, O) back to an instance of the F − β-axiom for the intuitionistic operator O. □

This result assures us that any linear type-theory is equivalent to one with no intuitionistic operators at the level of terms and provable equality.

Given a linear operator set O_{L}, define the operator constant set corresponding to it, written O_{L}^{C}, to be the set which contains for each operator O ∈ O_{L} having arity:

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

a constant c_{O} with arity:

(⊗_{i=1...r}!(⊗Q⃗_{i}A⃗_{i} ⊸ B_{i})) ⊗ (⊗_{j=1...s}(⊗Q⃗′_{j}A⃗′_{j} ⊸ B′_{j})) ⊸ (⊗Q⃗′′A⃗′′ ⊸ B′′)

where ⊗A⃗ is the standard left-bracketed tensor.

Now, given a higher-order signature ℍ = (M_{I}, M_{L}, ∅, O_{L}), we can easily see that (M_{I}, M_{L}, ∅, O_{L}^{C}) is another higher-order signature. Write Lin^{HC}(ℍ) for the higher-order typing system Lin^{H}(M_{I}, M_{L}, ∅, O_{L}^{C}).

Having made this definition, we can give a translation from Lin^{H}(ℍ) to Lin^{HC}(ℍ)˙ Definition 7.1.6 (The Translation ( )^{□}) Define the translation ( )^{□} from Lin^{H}(ℍ) to Lin^{HC}(ℍ) as the identity on types, and on pre-terms as follows:

(x)^{□} = x
(let x be v in w)^{□} = let x be (v)^{□} in (w)^{□}

(O((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′))^{□} = c_{O}(⊗_{i=1...r}!(λz.let ⊗x′′_{i}y⃗_{i} be z in let x⃗_{i} be x′′_{i} in (v_{i})^{□})) ⊗ (⊗_{j=1...s}(λz.let ⊗x′′′_{j}y′_{j} be z in let x′_{j} be x′′′_{j} in (w_{j})^{□})) (⊗(v′w′)^{□})

This translation can be shown to take Γ; Δ-terms of Lin^{H}(ℍ) to Γ; Δ-terms of Lin^{HC}(ℍ).

Now, given a higher-order signature ℍ = (M_{I}, M_{L}, ∅, O_{L}), we can define the generalised linear type theory Lin^{HC}(ℍ, 𝔸) to be the higher-order type-theory Lin^{H}((M_{I}, M_{L}, ∅, O_{L}^{C}), 𝔸^{□}). Given this definition, the translation ( )^{□} is sound.

7.2 Higher-Order Semantics

Having given our definition of higher-order type theories, we now need to consider the semantics of such type-theories. Since every higher-order type theory is in fact an instance of a generalised linear type theory, we already have a definition of model for any higher-order signature. However, this inherited definition of model is not ideal, for example because it requires us to give a primitive interpretation of all the new higher-order types which exist in a general higher-order type-theory. We would much prefer that these, and indeed the operators which exists in every higher-order type theory, were interpreted into primitive structure already present in the models in a standard way.

We can make such a definition by considering the semantics of DILL(ℂ). It is no coincidence that in fact many of the operators of the higher-order type theory have typing rules very similar to those of DILL(ℂ), or that the models of DILL(ℂ) which we defined were built on a carrier having a cartesian category with a strong monoidal functor to a symmetric monoidal category, augmented with extra structure. In fact, we will define models of higher-order type theories using most of the structure of DILL(ℂ)-models.

The carrier of a Lin^{H}(ℍ, 𝔸)-model is a quadruple (C, S, F, G) such that C is a cartesian category, S is a symmetric monoidal closed category, F : C → S is strict monoidal and G ⊢ F. Note that C need not necessarily be closed, and that neither C nor S need be strict.

Now, the carrier of a Lin^{H}(ℍ, 𝔸)-model easily yields a carrier for a Lin(𝕆, 𝔸)- model, which we call the underlying carrier; simply take the triple (C, S, F) with the strict cartesian structure on C given by the left-bracketed product, and the strict symmetric monoidal structure on S given by the left-bracketed tensor, and F as before.

Definition 7.2.1 (Higher-Order Lin^{H}(ℍ)-interpretation) A higher-order interpretation of the higher-order typing system Lin^{H}(ℍ), which we write H, is a carrier (C, S, F, G) together with:

• primitive interpretation functions [[ ]]_{M_{I}}^{H} : M_{I} → obj(C) and [[ ]]_{M_{L}}^{H} : M_{L} → obj(S) such that for all Q ∈ M_{I}, we have [[Q]]_{M_{L}}^{H} = F ([[Q]]_{M_{I}}^{H})

• for each operator O ∈ O_{L} having arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r} & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1}, & …, & (Q⃗′_{s}; A⃗′_{s})B′_{s} \\ & & (Q⃗′′; A⃗′′)B′′ \end{aligned}

a natural transformation

[[O]]_{O_{L}}^{H} :(×_{i=1...r}S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]]^{G}, [[B_{i}]]_{M_{L}}^{G})) ×
(×_{j=1...s}S(F (_{=}) ⊗ [[Q⃗′_{j}]] ⊗ ( _{j}) ⊗ [[A⃗′_{j}]]^{G}, [[B′_{j}]]_{M_{L}}^{G}))

→ S(F (_{=}) ⊗ [[Q⃗′′]] ⊗ (⊗_{j=1...s}( _{s})) ⊗ [[A⃗′′]]^{G}, [[B′′]]_{M_{L}}^{G})

which is natural independently in each of the s + 1 arguments (_{=}) and ( _{1}), …, ( _{s}), and where the interpretation [[ ]]^{G} is extended to arbitrary contexts in the obvious way, as given shortly,

• for each operator O ∈ O_{I} having arity

\begin{aligned}(Q⃗_{1}; A⃗_{1})B_{1}, & …, & (Q⃗_{r}; A⃗_{r})B_{r}; \\ & (; )R \end{aligned}

a natural transformation

[[O]]_{O_{I}}^{H} : ×_{i=1...r} S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]]^{G}, [[B_{i}]]_{M_{L}}^{G})
→ C(_{=}, [[Q′′]]_{C}^{G})

where the interpretation is again given shortly, such that for all objects X of C and all arrows f_{i} : F (X) ⊗ [[Q⃗_{i}; A⃗_{i}]] → [[B_{i}]] where i = 1 … r in S,

[[O]]_{O_{L}}^{G}(X)(f_{1}, …, f_{r}) = F ([[O]]_{O_{I}}^{G}(X)(f_{1}, …, f_{r}))

We can now easily extend the interpretation functions [[ ]] to higher order types:

[[I]] = I
[[A ⊗ B]] = [[A]] ⊗ [[B]]
[[A ⊸ B]] = [[A]] ⊸ [[B]]
[[!A]] = F G([[A]])
[[!A]]_{C} = G([[A]])

and to sequences of such types using the left-bracketed product and tensor in the familiar way. Further, we can extend the interpretation of operators as follows:

[[∗]](X) = F (d_{X})
[[I_{A}^{L}]](X; Y)(f) = li_{F (_{=})⊗} ; f
[[⊗_{A,B}^{R}]](X; Y_{1}Y_{2})(f_{1}f_{2}) = admin_{1}; (f_{1} ⊗ f_{2})
[[⊗_{A,B−C}^{L}]](X; Y)(f) = admin_{2}; f
[[λ_{A,B}]](X; Y)(f) = λf
[[ap_{A,B}]](X; ) = (F (d_{X}) ⊗ ap); ri_{[[B]]}
[[!_{A}]](X)(f) = F (un_{X}; G(f))
[[ !_{A}]](X) = (F (d_{X}) ⊗ nu_{[[A]]}); ri_{[[A]]}
[[!_{A}]]_{C}(X)(f) = un_{X}; G(f)

where admin_{!} and admin_{2} are the obvious morphisms in the s.m.c.:

admin_{1} :(F X ⊗ Y_{1}) ⊗ Y_{2} → (F X ⊗ Y_{1}) ⊗ (F X ⊗ Y_{2})
admin_{2} :((F X ⊗ [[A]]) ⊗ [[B]]) ⊗ Y → (F X ⊗ ([[A]] ⊗ [[B]])) ⊗ Y

Now, we have a lemma:

Lemma 7.2.2 Given a Lin^{H}(ℍ)-interpretation, its underlying carrier (with the strict left-bracketed product and tensor) and the extended interpretation functions defined above make up all the information required for a Lin(𝕆^{ℍ})-interpretation.

We can therefore interpret terms of Lin^{H}(ℍ) into our model by the derived interpretation, and henceforth we will use this derived interpretation of Lin^{H}(ℍ) into Lin^{H}(ℍ)-interpretations. Given this derived interpretation, we have a lemma on the axiom set 𝔸^{ℍ}.

Lemma 7.2.3 Any Lin^{H}(ℍ)-interpretation H interprets the equality judgements in the axiom set 𝔸^{ℍ} as categorical equalities in the s.m.c. part of H.

This is easily shown by analogy with soundness for DILL(ℂ) in DILL(ℂ)- models, since we have the same underlying categorical structure. With this lemma, we can now define Lin^{H}(ℍ, 𝔸)-models.

Definition 7.2.4 (Lin^{H}(ℍ, 𝔸)-model) A Lin^{H}(ℍ, 𝔸)-model is a Lin^{H}(ℍ)-interpretation H such that the derived interpretation given by lemma 7.2.2 maps equality judgements of the higher-order axiom set 𝔸 to equalities in the category S which is the s.m.c. part of the carrier of H.

Soundness for these models is easy to prove:

Lemma 7.2.5 (Soundness) Given a Lin^{H}(ℍ, 𝔸)-model H, and equality judgement Γ; Δ ⊢ v = w : A of Lin^{H}(ℍ, 𝔸), we have that:

[[Γ; Δ ⊢ v:A]]^{H} = [[Γ; Δ ⊢ w:A]]^{H}

Proof The equality rules are soundly interpreted since categorical equality is a congruence, the basic axioms of the generalised linear type-theory are soundly interpreted by virtue of the fact that the interpretation is derived from a generalised linear type-theory interpretation for which we already have soundness, the axioms in the set 𝔸^{ℍ} are soundly interpreted by lemma 7.2.3 and finally the axioms in the set 𝔸 of the higher-order signature are soundly interpreted by definition. □

We now consider completeness. As usual, we will proceed by defining a term model.

Definition 7.2.6 (The Linear Term Category) We define the linear term category, HS_{T}, as follows:

• The objects of HS_{T} are linear types of Lin^{H}(ℍ, 𝔸).

• HS_{T} (A, B) = {[(x, v)^{A,B}]| ; x: A ⊢ v: B}, where we write [(x, v)^{A,B}] as normal to denote the equivalence class of (x, v)^{A,B} under the equivalence ≡′′ defined by

(x, v)^{A,B} ≡′′ (y, w)^{A,B} if ; x:A ⊢ v = w{x/y}:A

156 As before, we omit type annotations where convenient and write [(x, v)] as [x, v].

Identities and composition are defined as for the term model of DILL(ℂ), and further, the closed monoidal structure is also defined as for the term model of DILL(ℂ).

Definition 7.2.7 (The Intuitionistic Term Category) We define the intuitionistic term category, HC_{T}, as follows:

• The objects of HC_{T} are sequences of intuitionistic types of Lin^{H}(ℍ, 𝔸).

• HC_{T} (A⃗, B⃗) = {[(x⃗, v⃗)^{A⃗,B⃗}]|x⃗: A⃗; ⊢ v_{i} : ⊗B_{i} and each v_{i} is intuitionistic}, where we write [(x⃗, v⃗)^{A⃗,B⃗}] to denote the equivalence class of (X⃗, V⃗)^{A⃗,B⃗} under the equivalence ≡′′_{C} defined by:

(x⃗, v⃗)^{A⃗,B⃗} ≡′′_{C} (y⃗, w⃗)^{A⃗,B⃗}

if the sequences v⃗ and w⃗ are the same length, the sequence x⃗ and y⃗ are the same length, and for each i, we have x⃗:A⃗; ⊢ v_{i} =_{I} w_{i}{x⃗/y⃗}:B_{i}. As before, we omit type information where convenient, abbreviate [(x⃗, v⃗)] to [x⃗, v⃗] and assume that in such an arrow, all the variables in x⃗ are distinct.

We define identities, composition and a strict cartesian structure over this just as for the term model of DILL(ℂ).

Now we define F_{T} on objects of HC_{T} as the left-bracketed tensor, and on arrows as

F_{T} ([x⃗, v⃗]) = [y, let ⊗x′ be y in let x⃗ be x′ in ⊗v⃗]

This can be seen to be functorial. Define G_{T} on objects of HS_{T} to take A to the intuitionistic type !A. On objects, define

G_{T} ([x, v]) = [y,!(v{ !y/x})]

Now we can define the term model:

Definition 7.2.8 (Higher-Order Term Model) Define the higher-order term model, written H_{T}, to have carrier (HC_{T} , HS_{T} , F_{T} , G_{T}), with interpretation functions given in the obvious way.

It is a straightforward exercise to give these interpretation functions and show that the definitions given make H_{T} into a Lin^{H}(ℍ, 𝔸)-model.

We can also easily show that Lemma 7.2.9 Given a Γ; Δ-term v of Lin^{H}(ℍ, 𝔸) having type A, we have:

[[Γ; Δ ⊢ v:A]]^{H_{T}} = [z, let ⊗x⃗′y⃗ be z in let x⃗ be x′ in v]

where z and x′ are fresh, Γ = x⃗:Q⃗ and Δ = y⃗:A⃗.

Now we can prove completeness by the standard method.

Lemma 7.2.10 (Completeness) Given two Γ; Δ-terms v and w of type A in Lin^{H}(ℍ, 𝔸), we have a provable equality judgement Γ; Δ ⊢ v = w:A iff in all Lin^{H}(ℍ, 𝔸)-models, we have:

[[Γ; Δ ⊢ v:A]] = [[Γ; Δ ⊢ w:A]]

This is proved as normal.

We can define Lin^{H}(ℍ)-morphisms as follows:

Definition 7.2.11 (Lin^{H}(ℍ)-morphisms) A Lin^{H}(ℍ)-morphism is a pair of functors (F_{C} : C → C′, F_{S} : S → S′) such that:

• F_{C} is strict cartesian and F_{S} is strict monoidal closed,

• the following diagrams commute:

[figure: C; F; S; C′; F_{C}; F′; S′; F_{S}; C; G; S; C′; F_{C}; G′; S′; F_{S}]

• (F_{C}, F_{S}) is a Lin(𝕆^{ℍ})-morphism.

It is easy to see that the third of these conditions can be replaced by the weaker condition that the pair of functors preserve the primitive interpretations on M_{I},M_{L},O_{I} and O_{L}, as the condition as stated can be deduced from the fact that they preserve the structure of the carrier of the Lin^{H}(ℍ)-interpretation.

Define Cat_{Lin}_{H}(ℍ, 𝔸) to be the category of small Lin^{H}(ℍ, 𝔸)-models and morphisms. Further, define Cat_{Lin}_{HC}(𝕆, 𝔸) to be the category of small Lin^{HC}(𝕆, 𝔸)- models and morphisms

It is now possible to define a Lin^{H}(ℍ, 𝔸)-morphism from H_{T} to any arbitrary Lin^{H}(ℍ, 𝔸)-model H using the interpretation.

Definition 7.2.12 (Initiality Morphism) Given a Lin^{H}(ℍ, 𝔸)-model H, we have a Lin^{H}(ℍ, 𝔸)-morphism FT = (FT_{C}, FT_{S}) : H_{T} → H. Define FT_{C} on objects of HC_{T} as the left-bracketed product of the interpretations of the sequence of types, and on arrows [x⃗, v⃗] as the pairing of the [[x⃗:A⃗; ⊢ v_{i}]]_{C}^{H}.

Further, define FT_{C} on objects just as their interpretation, and on arrows [x, v] as the interpretation [[ ; x:A ⊢ v:B]]^{H}.

Now we can show that this initiality morphism is a Lin^{H}(ℍ, 𝔸)-morphism and is unique up to isomorphism.

It is now worth noting that since we know that every Lin^{H}(ℍ, 𝔸)-model gives rise to a Lin(𝕆^{ℍ}, 𝔸 ∪ 𝔸^{ℍ}) model and similarly for morphisms, we have a functor from Cat_{Lin}_{H}(ℍ, 𝔸) to the category of Lin(𝕆^{ℍ}, 𝔸 ∪ 𝔸^{ℍ})-models and morphisms.

7.3 Conservativity

In this section we will use the Yoneda Lemma to prove that the translation of the Lin(𝕆, 𝔸) into its higher-order extension Lin^{HC}(𝕆, 𝔸) is sound and conservative. Since we know by lemma 7.1.5 that every generalised linear type-theory is isomorphic to one without any intuitionistic operators, for the remainder of this section we only consider generalised signatures of this form.

Summary of the Proof To show conservativity of the translation, the basic procedure is as follows. Given the term model of Lin(𝕆, 𝔸), we can construct via the Yoneda lemma a new Ĉ, Ŝ and F̂ derived from the carrier of the term model such that Ĉ is a cartesian closed, Ŝ is s.m. closed, and F̂ has a right adjoint G : Ŝ → Ĉ which is symmetric monoidal. These elements can be used to construct a Lin^{HC}(𝕆, 𝔸)-model φ(G_{T} (𝕆, 𝔸)), and further this Lin^{HC}(𝕆, 𝔸)-model induces a Lin(𝕆, 𝔸)-model κ(φ(G_{T} (𝕆, 𝔸))). But the Yoneda lemma also tells us that there exist a fully faithful cartesian functor Y_{C} : C → Ĉ and a fully faithful s.m. functor Y_{S} : S → Ŝ such that Y_{C} ∘ F̂ ≃ F ∘ Y_{S} up to monoidal natural isomorphism. These can be used to construct a Lin(𝕆)-morphism G_{T} (𝕆, 𝔸) → κ(φ(G_{T} (𝕆, 𝔸))) which is fully faithful in its s.m. component.

Now, assume that the translations from Lin(𝕆, 𝔸) to Lin^{HC}(𝕆, 𝔸) of two Γ; Δterms of type A are provably equal in Lin^{HC}(𝕆, 𝔸). Then by soundness their interpretations must be equal in φ(G_{T} (𝕆, 𝔸)). Now we use the fact that their interpretations in the s.m.c. part of this model must be the same as the interpretation of the original Γ; Δ terms of Lin(𝕆, 𝔸) in the s.m.c. part of the induced model κ(φ(G_{T} (𝕆, 𝔸))). But by initiality we know that the fully faithful Lin(𝕆)- morphism we constructed must be the canonical Lin(𝕆)-morphism from the term category, which takes each term arrow to its interpretation. Hence the interpretations of our two terms in the induced Lin(𝕆, 𝔸)-model are the images under the morphism of their interpretations in the term model G_{T} (𝕆, 𝔸), but since their interpretations are equal in the induced category by faithfulness their interpretations in the term model will be equal, and hence by completeness the terms themselves are equal.

The outline of the proof is simple, but there are a number of problems to be overcome which we have glossed over in this account under the phrase “can be used to construct”. These include size problems and strictness issues.

Preliminaries

We now give some type-theoretic results which will be used in the proof of conservativity.

Definition 7.3.1 We define an embedding of categories κ : Cat_{Lin}_{HC}(𝕆, 𝔸) → Cat_{Lin}(𝕆, 𝔸) as follows: Given a Lin^{HC}(𝕆, 𝔸)-model G with carrier (C, S, F, G) and interpretation functions [[ ]]^{G}, let κ(G) have carrier (C, S, F) with the strict left-bracketed product and tensor, interpretation functions on types those of G, and finally the interpretation on operators in O_{L} given via the interpretation of constants in G and the following isomorphism:

S(I, [[ ⨂_{i=1...r}!(⊗Q⃗_{i}A⃗_{i} ⊸ B_{i}) ⊗ ( ⨂_{j=1...s}(⊗Q⃗′_{j}A⃗′_{j} ⊸ B′_{j})) ⊸ (⊗Q⃗′′A⃗′′ ⊸ B′′)]])

≃Nat_{S,... ,S,C}( ∏_{i=1...r} S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]], [[B_{i}]]) × ∏_{j=1...s} S(F (_{=}) ⊗ _{j} ⊗ [[Q⃗′_{j}; A⃗′_{j}]], [[B′_{j}]]),
S(F (_{=}) ⊗ _{1} ⊗ … ⊗ _{s} ⊗ [[Q⃗′′; A⃗′′]], [[B′′]]))

Having defined this embedding, we give a lemma on interpretations in Lin(𝕆, 𝔸)- models.

Lemma 7.3.2 For any Γ; Δ-term v of type A in Lin(𝕆, 𝔸), and any Lin(𝕆, 𝔸)-model G, [[Γ; Δ ⊢ v:A]]^{G} = FT^{G}([[Γ; Δ ⊢ v:A]]), where FT^{G} : G_{T} (𝕆, 𝔸) → G is the unique initiality map.

This is easily seen from the definition of the canonical morphism (definition 5.5.3, on page 111). We also need a lemma relating the interpretations of Lin(𝕆, 𝔸) and Lin^{HC}(𝕆, 𝔸).

Lemma 7.3.3 Given a Lin^{HC}(𝕆, 𝔸)-model G and a Γ; Δ-term v of type A in Lin(𝕆, 𝔸), then [[Γ; Δ ⊢ v^{□}:A]]^{G} = [[Γ; Δ ⊢ v:A]]^{κ(G)} in the s.m. category which is common to G and κ(G).

In order to see this, we need to note firstly that the structure used by both interpretations is all on the carrier and hence shared apart from the primitive interpretation of the operators, and it is straightforward isomorphism-chasing to show that the interpretation of any operator instance is the same when it is first mapped to Lin^{HC}(𝕆, 𝔸) as it is when interpreted directly from Lin(𝕆, 𝔸) into κ(G).

Given this last result, we can now show soundness of the translation ( )^{□} using our semantic results.

Lemma 7.3.4 (Soundness) If Γ; Δ ⊢ v = w:A in Lin(𝕆, 𝔸), then Γ; Δ ⊢ (v)^{□} = (w)^{□}:A in Lin^{HC}(𝕆, 𝔸).

Proof Assume that we have an arbitrary Lin^{HC}(𝕆, 𝔸)-model G, and two terms Γ; Δ ⊢ v = w:A in Lin(𝕆, 𝔸). Now by soundness of the Lin(𝕆, 𝔸)-interpretation we must have that [[Γ; Δ ⊢ v : A]]^{κ(G)} = [[Γ; Δ ⊢ w : A]]^{κ(G)} in the induced Lin(𝕆, 𝔸)- model, and also by our lemma [[Γ; Δ ⊢ v^{□}: A]]^{G} = [[Γ; Δ ⊢ w^{□}: A]]^{G} under the interpretation of Lin^{HC}(𝕆, 𝔸) in the arbitrary Lin^{HC}(𝕆, 𝔸)-model. But then by completeness of Lin^{HC}(𝕆, 𝔸), we must have that Γ; Δ ⊢ v^{□} = w^{□}:A as required. □

The Yoneda Construction

We now consider the details of the Yoneda construction which we will use to obtain a Lin^{HC}(𝕆, 𝔸)-model φ(G) from any given Lin(𝕆, 𝔸)-model G, and also to show that the unique Lin(𝕆)-morphism FT^{κ(φ(G_{T} (𝕆,𝔸)))} : G_{T} (𝕆, 𝔸) → κ(φ(G_{T} (𝕆, 𝔸))) has a fully faithful s.m. part. As we noted at the beginning of this section, there are some technical problems which we must consider carefully. First we state the Yoneda lemma in the form that we will use it.

Lemma 7.3.5 (Yoneda) Given a locally small category C, define Ĉ to be the functor category Set^{C^{op}}, and define Y_{C} : C → Ĉ to be the functor which takes any object of C, X, to the hom-functor C( , X) and which takes any arrow of C, f : X → Y, to the natural transformation C( , f) : C( , X) → C( , Y) with the obvious compositional action. This construction has the following properties [Day70a, Day70b, Day73]:

• If C is symmetric monoidal, then Ĉ is symmetric monoidal closed, and Y_{C} is strong symmetric monoidal.

• If C is cartesian, then Ĉ is cartesian closed, and Y_{C} is strong cartesian.

• Given a strong symmetric monoidal functor F : C → S, we have a strong symmetric monoidal functor F̂ : Ĉ → Ŝ which is unique up to isomorphism, has a right adjoint and such that we have a symmetric monoidal natural isomorphism F̂ ∘ Y_{C} ≃ Y_{S} ∘ F.

As we have previously said, given this lemma there are some technical difficulties to overcome before we can achieve our aim, which is to find a small Lin^{HC}(𝕆, 𝔸)-model, based on the Yoneda construction over the term model, such that the initiality morphism to κ of this model in the category Cat_{Lin}(𝕆, 𝔸) is faithful in its s.m. part.

The first problem is a size problem. The categories yielded by the Yoneda construction are not small in general, and hence no model we construct directly using them will be in any of our categories of models. However, we can avoid this by taking full subcategories of the categories Ĉ containing (the image of) C and closed under the relevant operations.

The second difficulty is that although models of Lin(𝕆, 𝔸) have strict tensor structure and strict cartesian structure, the Yoneda construction yields categories which have corresponding structure which may not be strict. We therefore present our first proposition:

Proposition 7.3.6 (Strictness) Given a symmetric monoidal category C, there exists a strict symmetric monoidal category C_{s} which is equivalent to C. Similarly, given a cartesian category C, there exists a strict cartesian category C_{s} which is equivalent to C. Also, given a symmetric monoidal functor F : C → C′, there exists a strict symmetric monoidal functor F_{s} : C_{s} → C′_{s} such that the following diagram commutes, where U_{C} and S_{C} are the fully faithful functors witnessing the equivalence:

[figure: C; F; C′; C_{s}; S_{C}; U_{C}; F_{s}; C′_{s}; S_{C′}; U_{C′}]

The final difficulty is that given a Lin(𝕆, 𝔸)-model G with carrier (C, S, F), the candidate carrier for a Lin^{HC}(𝕆, 𝔸)-model, (Ĉ_{s}, Ŝ_{s}, F̂, G) has the property that Y_{C}; F̂ ≃ F; Y_{S}, where we will want to use the Yoneda functors Y_{C} and Y_{S} to construct a Lin(𝕆, 𝔸)-map from G to the Lin^{HC}(𝕆, 𝔸)-model based on the Yoneda construction. Hence we recall the following proposition:

Proposition 7.3.7 (Skeleton) Given a category C, there exists a category sk(C) which is equivalent to C such that any two objects of sk(C) which are isomorphic are equal and any two arrows of sk(C) which are isomorphic in the arrow category of sk(C) are equal, where the arrow category of a category S has objects the arrows of S and as arrows (f : X → Y) → (g : X′ → Y′) pairs of arrows of S, (h_{1}, h_{2}) where h_{1} : X → X′ and h_{2} : Y → Y′ and the obvious diagram commutes.

Note that the fully faithful functors K : S → sk(S) and I : sk(S) → S given by this proposition are strict symmetric monoidal under the obvious (strict) s.m. structure over the skeleton. Given this machinery, we can now define a small Lin^{HC}(𝕆, 𝔸)-model using the Yoneda construction over a small Lin(𝕆, 𝔸)-model.

Lemma 7.3.8 Given a small Lin(𝕆, 𝔸)-model G, we can define a small Lin^{HC}(𝕆, 𝔸)-model φ(G).

Proof For the purposes of this proof, we will assume that the categories Ĉ and Ŝ are the small categories obtained by taking full subcategories of the Yoneda constructions as mentioned earlier.

Firstly, we consider the carrier. Given that the carrier of G is (C, S, F), we make the following definitions. Let S_{C} : Ĉ → Ĉ_{s} and U_{C} : Ĉ_{s} → Ĉ be the fully faithful cartesian functors given by the equivalence of Ĉ and Ĉ_{s}, such that S; U ≃

: Ĉ → Ĉ. Also, let S_{S} : Ŝ → Ŝ_{s}and U_{S} : Ŝ_{s} → Ŝ be the fully faithful symmetric monoidal functors given by the equivalence of Ŝ and S. Finally, let K : Ŝ_{s} → sk(Ŝ_{s}) and I : sk(Ŝ_{s}) → Ŝ_{s} be the fully faithful strict symmetricmonoidal functors given by the equivalence of Ŝ_{s} and sk(Ŝ_{s}).

Now, let the carrier of φ(G) be (Ĉ_{s}, sk(Ŝ_{s}), F̂_{s}; K, I; G_{s}) where F̂ ⊣ G. In order to show that this has the right form we need just to show that F̂_{s}; K ⊣ I; G_{s}, but this follows from the original adjunction via the diagram of proposition 7.3.6 and the properties of K and I.

We will now define Y′_{C} : C → Ĉ_{s} as Y_{C}; S_{C} and Y′_{S} : S → sk(Ŝ_{s}) as Y_{S}; S_{S}; K. Now we consider the interpretation functions. Firstly, define [[ ]]_{M_{L}^{H}}^{φ(G)} as follows:

[[A ∈ M_{L}]]_{M_{L}^{H}}^{φ(G)} = Y′_{S}([[A]]_{M_{L}}^{G})
[[I]]_{M_{L}^{H}}^{φ(G)} = I
[[A ⊗ B]]_{M_{L}^{H}}^{φ(G)} = [[A]]_{M_{L}^{H}}^{φ(G)} ⊗ [[B]]_{M_{L}^{H}}^{φ(G)}
[[A ⊸ B]]_{M_{L}^{H}}^{φ(G)} = [[A]]_{M_{L}^{H}}^{φ(G)} ⊸ [[B]]_{M_{L}^{H}}^{φ(G)}
[[!A]]_{M_{L}^{H}}^{φ(G)} = F̂_{s}G_{s}[[A]]_{M_{L}^{H}}^{φ(G)}

and define [[ ]]_{M_{I}^{H}}^{φ(G)} as follows:

[[Q ∈ M_{I}]]_{M_{I}^{H}}^{φ(G)} = Y′_{C}([[Q]]_{M_{I}}^{G})
[[!A]]_{M_{I}^{H}}^{φ(G)} = G_{s}[[A]]_{M_{L}^{H}}^{φ(G)}

Now these two definitions satisfy the required property:

F̂_{s}([[ ]]_{M_{I}^{H}}^{φ(G)}) = [[ ]]_{M_{L}^{H}}^{φ(G)} : M_{I}^{H} → Ŝ_{s}

by virtue of the natural isomorphism:

Y′_{C}; F̂_{s}; K ≃ Y_{C}; S_{C}; F̂_{s}; K ≃ Y_{C}; F̂; S_{S}; K ≃ F; Y_{S}; S_{S}; K ≃ F; Y′_{S}

and the fact that since any two isomorphic objects or arrows in sk(Ŝ_{s}) are equal, Y′_{C}; F̂_{s} = F; Y′_{S}.

Finally, we need to give the operator interpretation on elements of O_{L}. Since we know that the isomorphism

sk(Ŝ_{s})(I, [[ ⨂_{i=1...r}!(⊗Q⃗_{i}A⃗_{i} ⊸ B_{i}) ⊗ ( ⨂_{j=1...s}(⊗Q⃗′_{j}A⃗′_{j} ⊸ B′_{j})) ⊸ (⊗Q⃗′′A⃗′′ ⊸ B′′)]])

≃Nat_{sk(Ŝ_{s}),... ,sk(Ŝ_{s}),Ĉ_{s}}( ∏_{i=1...r} sk(Ŝ_{s})(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]], [[B_{i}]])

× ∏_{j=1...s} sk(Ŝ_{s})(F (_{=}) ⊗ _{j} ⊗ [[Q⃗′_{j}; A⃗′_{j}]], [[B′_{j}]]),

sk(Ŝ_{s})(F (_{=}) ⊗ _{1} ⊗ … ⊗ _{s} ⊗ [[Q⃗′′; A⃗′′]], [[B′′]]))

holds given the interpretations we have already defined, it suffices to show that for each operator we have an instance of the second natural transformation. By consideration of the equivalences, though, these natural transformations arise from natural transformations:

Nat_{Ŝ,... ,Ŝ,Ĉ}( ∏_{i=1...r} Ŝ(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]], [[B_{i}]]) × ∏_{j=1...s} Ŝ(F (_{=}) ⊗ _{j} ⊗ [[Q⃗′_{j}; A⃗′_{j}]], [[B′_{j}]]),

Ŝ(F (_{=}) ⊗ _{1} ⊗ … ⊗ _{s} ⊗ [[Q⃗′′; A⃗′′]], [[B′′]]))

but this set is isomorphic by virtue of the Yoneda embedding to the set:

Nat_{S,... ,S,C}( ∏_{i=1...r} S(F (_{=}) ⊗ [[Q⃗_{i}; A⃗_{i}]], [[B_{i}]]) × ∏_{j=1...s} S(F (_{=}) ⊗ _{j} ⊗ [[Q⃗′_{j}; A⃗′_{j}]], [[B′_{j}]]),

S(F (_{=}) ⊗ _{1} ⊗ … ⊗ _{s} ⊗ [[Q⃗′′; A⃗′′]], [[B′′]]))

Hence we have given the model φ(G). □

Lemma 7.3.9 (Fully Faithful) The initiality map FT^{κ(φ(G_{T} (𝕆,𝔸)))} : G_{T} (𝕆, 𝔸) → κ(φ(G_{T} (𝕆, 𝔸))) is fully faithful in both its component functors.

Proof We can prove this by showing that the pair of the two fully faithful functors Y′_{C} and Y′_{S} is a Lin(𝕆)-morphism with the appropriate domain and codomain. This will then imply the result since the initiality map is unique and hence must be this map. In order to check that (Y′_{C}, Y′_{S}) is a Lin(𝕆)-morphism, we need simply to check that it has the right behaviour with respect to the primitive interpretation and the functor F of the model, both of which hold by virtue of the equality Y′_{C}; F̂_{s} = F; Y′_{S} for a general Yoneda construction, and with respect to the operator interpretation, the result is given by the isomorphisms of lemma 7.3.8. □

Theorem 7 (Conservativity of ( )^{□}) If, given two Γ; Δ-terms v and w of type A in Lin(𝕆, 𝔸), we can derive the equality judgement Γ; Δ ⊢ v^{□} = w^{□}:A in Lin^{HC}(𝕆, 𝔸), then we must be able to derive the equality judgement Γ; Δ ⊢ v = w:A in Lin(𝕆, 𝔸).

Proof Consider the (small) Lin^{HC}(𝕆, 𝔸)-model φ(G_{T} (𝕆, 𝔸)). Given the derivable equality judgement Γ; Δ ⊢ v^{□} = w^{□}:A in Lin^{HC}(𝕆, 𝔸), we know that

[[Γ; Δ ⊢ v^{□}:A]]^{φ(G_{T} (𝕆,𝔸))} = [[Γ; Δ ⊢ w^{□}:A]]^{φ(G_{T} (𝕆,𝔸))}

in φ(G_{T} (𝕆, 𝔸)).

Now this means that [[Γ; Δ ⊢ v: A]]^{κ(φ(G_{T} (𝕆,𝔸)))} = [[Γ; Δ ⊢ w: A]]^{κ(φ(G_{T} (𝕆,𝔸)))} in κ(φ(G_{T} (𝕆, 𝔸))), by lemma 7.3.3. But since we know by lemma 7.3.9 that the s.m. part of the initiality Lin(𝕆)-morphism FT^{κ(φ(G_{T} (𝕆,𝔸)))} is faithful, this implies that [[Γ; Δ ⊢ v:A]]^{G_{T} (𝕆,𝔸)} = [[Γ; Δ ⊢ w:A]]^{G_{T} (𝕆,𝔸)}. This then gives the result by completeness. □

7.4 Corollaries

We note some simple consequences of this result in general. Firstly, we give a lemma:

Lemma 7.4.1 For any linear type theory Lin(𝕆′, 𝔸′) such that the following diagram commutes:

Lin(𝕆, 𝔸)  \overline{( )^{□}  ^{}}Lin^{HC}(𝕆, 𝔸)

[figure: Lin(𝕆′, 𝔸′); θ_{2}; θ_{1}]

and θ_{1} and θ_{2} are sound, θ_{1} is conservative.

Proof Given θ_{1}(Γ; Δ) ⊢ θ_{1}(Γ; Δ ⊢ v:A) = θ_{1}(Γ; Δ ⊢ w:A):θ_{1}(A) in Lin(𝕆′, 𝔸′), we have that

θ_{2}(θ_{1}(Γ; Δ)) ⊢ θ_{2}(θ_{1}(Γ; Δ ⊢ v:A)) = θ_{2}(θ_{1}(Γ; Δ ⊢ w:A)):θ_{2}(θ_{1}(A))

and hence Γ; Δ ⊢ (v)^{□} = (w)^{□}:A. But by the conservativity of ( )^{□}, this means that Γ; Δ ⊢ v = w:A. □

This then gives us the most important corollary; that our conservativity result implies that for the more primitive embedding:

Corollary 7.1 The trivial embedding Lin(𝕆, 𝔸) → Lin^{H}(𝕆, 𝔸) is conservative for any generalised signature 𝕆.

Proof First note that since the map ( )^{□} : Lin^{H}(𝕆, 𝔸) → Lin^{HC}(𝕆, 𝔸) is sound for signatures having no intuitionistic operators, by our lemma the trivial embedding Lin(𝕆, 𝔸) → Lin^{H}(𝕆, 𝔸) is conservative for such signatures. But now note that any generalised type theory is isomorphic to one having no intuitionistic operators, and furthermore that the following square commutes, where 𝕆′ and 𝔸′ are the signature with no intuitionistic operators and the associated axiom set:

Lin(𝕆′, 𝔸′) \overline{emb_{}}Lin^{H}(𝕆′, 𝔸′)

[figure: Lin(𝕆, 𝔸); emb; Lin^{H}(𝕆, 𝔸)]

This implies that the trivial embedding is also conservative in the general case where the signature may have intuitionistic operators, since isomorphisms are conservative. □

Output Natural Operators

We now use this result to show how we can represent any output-natural set of operators in a linear type-theory as a single constant in the higher-order extension of the type-theory. The idea behind this is best seen through an example. Consider the output-natural set of operators O with arity

\begin{aligned}(Q⃗; A⃗)B & ; & (Q⃗′_{1}; A⃗′_{1})B′_{1} & (Q⃗′_{2}; A⃗′_{2})( ) \\ & & (Q⃗′′; A⃗′′)( ) \end{aligned}

We claim that this can be represented in a higher-order setting by the constant c_{O} with arity:

!(⊗Q⃗A⃗ ⊸ B) ⊗ (⊗Q⃗′_{1}A⃗′_{1} ⊸ B_{1}) ⊸ (⊗Q⃗′′A⃗′′ ⊸ ⊗Q⃗′_{2}A⃗′_{2})

In order to see how this works, consider the translation of a general operator instance:

O_{C}((x⃗; y⃗)v; (x′_{1}; y′_{1})w_{1}, (x′_{2}; y′_{2})w_{2})(v′w′)

↦let ⊗ zy′_{2} be (c_{O}!(λz′.let ⊗x′′y⃗ be z′ in let x⃗ be x′′ in v) ⊗
(λz′.let ⊗x′′y′_{1} be z′ in let x′_{1} be x′′ in w_{1})(⊗v′w′))
in w_{2}

We can clearly see that this term has output-natural behaviour inherited from that of the let -construct. Now consider the arity of the constant c_{O_{C}} which represents the operator O_{C} in the standard encoding given earlier in this chapter:

!(⊗Q⃗A⃗ ⊸ B) ⊗ (⊗Q⃗′_{1}A⃗′_{1} ⊸ B_{1}) ⊗ (⊗Q⃗′_{2}A⃗′_{2} ⊸ B_{2}) ⊸ (⊗Q⃗′′A⃗′′ ⊸ C)

We can now express c_{n} in terms of this set of constants as follows:

c_{n} ↦ λx.c_{O_{⊗Q⃗′_{2}A⃗′}}(x ⊗ (λy.y))

and also, when we compose the mappings taking the output-natural set of operators to the (system with the) constant c_{n} and taking the (system with the) constant c_{n} to the (standard higher-order system with) constants c_{O_{C}}, the results are the same up to provable equality, by a simple application of the output-naturality axioms.

To state this formally, given a higher-order signature (M_{I}, M_{L}, ∅, O_{L}∪O) where the set of operators O is output-parameterised over the set M_{L} and has arity:

{(Q⃗_{1}; A⃗_{1})B_{1}, …, (Q⃗_{r}; A⃗_{r})(B_{r}); (Q⃗′_{1}; A⃗′_{1})B′_{1}, …, (Q⃗′_{s−1}; A⃗′_{s−1})B′_{s−1}, (Q⃗′_{s}; A⃗′_{s})( ) \atop (Q⃗′′; A⃗′′)( )}

we say that the output-natural-in-O operator constant set, written (O_{L} ∪ O)^{OC} is defined as O_{L}^{C} ∪ {c_{O}}, where c_{O} is a constant with arity:

( ⨂_{i=1...r}!(⊗Q⃗_{i}A⃗_{i} ⊸ B_{i}) ⊗ ⨂_{j=1...(s−1)}(⊗Q⃗′_{j}A⃗′_{j} ⊸ B′_{j})) ⊸ (⊗Q⃗′′A⃗′′ ⊸ ⊗Q⃗′_{s}A⃗′_{s})

Now, we have as before that given a higher-order signature ℍ = (M_{I}, M_{L}, ∅, O_{L}) such that O_{L} contains an output-parameterised-in-M_{L} set of operators,

ℍ_{O}^{OC}(M_{I}, M_{L}, ∅, O_{L}^{OC})

is another higher-order signature. Write Lin_{O}^{HC}(ℍ) for the higher-order typing system over this higher-order signature ℍ_{O}^{OC}.

Definition 7.4.2 (The Translation ( )^{■}) Define the translation ( )^{■} from Lin^{H}(M_{I}, M_{L}, ∅, O_{L}) to Lin^{H}(M_{I}, M_{L}, ∅, O_{L}^{OC})as the identity on types and on pre-terms as follows:

(x)^{■} = x
(let x be v in w)^{■} = let x be (v)^{■} in (w)^{■}

(O′((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′))^{■} = c_{O}(⊗_{i=1...r}!(λz.let ⊗x′′_{i}y⃗_{i} be z in let x⃗_{i} be x′′_{i} in (v_{i})^{■})) ⊗ (⊗_{j=1...s}(λz.let ⊗x′′′_{j}y′_{j} be z in let x′_{j} be x′′′_{j} in (w_{j})^{■})) (⊗(v′w′)^{■})

on operators O′ ∉ O

(O_{C}((x⃗_{1}; y⃗_{1})v_{1}, …, (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, …, (x′_{s}; y′_{s})w_{s})(v′; w′))^{■} =

let ⊗ z⃗y′_{s} be c_{n}(⊗_{i=1...r}!(λz.let ⊗x′′_{i}y⃗_{i} be z in let x⃗_{i} be x′′_{i} in (v_{i})^{■}))

(⊗_{j=1...(s−1)}(λz.let ⊗x′′′_{j}y′_{j} be z in let x′_{j} be x′′′_{j} in (w_{j})^{■}))

(⊗(v′w′)^{■})
in let x′_{s} be z⃗ in w_{s}

We can extend the typing system Lin_{O}^{HC}(M_{I}, M_{L}, ∅, O_{L}) to a type theory by letting Lin_{O}^{HC}((M_{I}, M_{L}, ∅, O_{L}), 𝔸) be defined as the higher-order type theory

Lin^{H}((M_{I}, M_{L}, ∅, O_{L}^{OC}), (𝔸)^{■})

This translation can be shown to be easily invertible.

7.5 Action Calculi

We now consider the action calculi we have defined in the light of our conservativity result. First we need to define another translation.

Definition 7.5.1 (The Translation ι_{5}) Define the translation ι_{5} : Lin^{A^{⊠,⊸}}(𝕂) → Lin^{H}(𝕆^{A}, 𝔸^{A}) as follows:

ι_{5}(⊠m) =!(ι_{5}(m))
ι_{5}(l ⊸ m) = ι_{5}(l) ⊸ ι_{5}(m)
ι_{5}(m ⊗ l) = ι_{5}(m) ⊗ ι_{5}(l)
ι_{5}(x) = x
ι_{5}(let x be v in w) = let x be ι_{5}(v) in ι_{5}(w)
ι_{5}(⊗(v⃗)) = ⊗ι_{5}(v⃗)
ι_{5}(let ⊗x⃗ be v in w) = let ⊗x⃗ be ι_{5}(v) in ι_{5}(w)
ι_{5}(K((x⃗_{1})v_{1}, …, (x⃗_{r})v_{r}, w_{1} … w_{s})) = K((x⃗_{1})ι_{5}(v_{1}), …, (x⃗_{r})ι_{5}(v_{r}), ι_{5}(w_{1}) … ι_{5}(w_{s}))
ι_{5}(code(v)) =!ι_{5}(v)
ι_{5}(decode(v)) = !ι_{5}(v)
ι_{5}(λx:l.v) = λx:l.ι_{5}(v)
ι_{5}(vw) = ι_{5}(v)ι_{5}(w)

This translation is easily shown to be sound. Further, we have the following translation lemma:

Lemma 7.5.2 (AC Translations) The following diagram of translations commutes:

Lin^{A^{⊠}}(𝕂) ^{_{}ι_{1}} Lin^{A}(𝕂) =Lin(𝕆^{A}, 𝔸^{A})

[figure: Lin^{A^{⇒}}(𝕂); ι_{4}; ι_{3}; Lin^{A^{⊠,⊸}}(𝕂); ι_{2}; ι_{5}; Lin^{H}(𝕆^{A}, 𝔸^{A}); emb]

Now we can use our conservativity result as follows:

Corollary 7.2 The maps ι_{1} : Lin^{A}(𝕂) → Lin^{A^{⊠}}(𝕂), ι_{1}; ι_{2} : Lin^{A}(𝕂) → Lin^{A^{⊠,⊸}}(𝕂) and ι_{1}; ι_{3} : Lin^{A}(𝕂) → Lin^{A^{⇒}}(𝕂) are all conservative. Equivalently, the embeddings AC(𝕂) → AC_{⊠}(𝕂), AC(𝕂) → AC_{⊠,⊸}(𝕂) and AC(𝕂) → AC_{⇒}(𝕂) are all conservative.

Proof The first statement is immediate by lemma 7.4.1, the diagram of the previous lemma and corollary 7.1 of the conservativity theorem. The second follows by the isomorphisms between the various action calculi and the corresponding linear type theories. □

7.6 Linear Logic

We now show that we can present the type theory of linear logic, in the form of DILL, as an instance of our higher-order generalised linear type theory. This demonstrates that our notion of general linear type theory captures at least the notion of linearity found in the canonical example, linear logic.

Consider an arbitrary DILL-signature ℂ = (P_{L}, C). Let O_{L}^{C} be the set of operators just consisting of the constants C and their types. Now define the higher-order signature ℍ^{ℂ} = (∅, P_{L}, ∅, O_{L}^{C}). We claim that the higher-order type theory Lin^{H}(ℍ^{ℂ}, ∅), which we will refer to as Lin^{D}(ℂ), is isomorphic to DILL(ℂ). Having now defined the type-theory Lin^{D}(ℂ), we proceed to translate the typetheory DILL(ℂ) into Lin^{D}(ℂ), and show the soundness of this translation.

Translating DILL (ℂ) to Lin^{D}(ℂ)

We define a map ( )^{∘} which will take a pair of a sequence of variables and a pre-term of DILL(ℂ), and return a pre-term of Lin^{D}(ℂ). The intuition behind this translation is that whenever the pre-term t is a Γ; Δ-term such that Γ = y⃗:A⃗, the translation on that pre-term and sequence y⃗ and the pre-term t will give a y⃗ :!A⃗; Δ-term of Lin^{D}(ℂ).

Definition 7.6.1 (The Translation ( )^{∘}) We define the translation ( )^{∘}, which takes pairs of a sequence of distinct variables and a pre-term of DILL(ℂ), and returns a pre-term of Lin^{D}(ℂ), as follows:

(y⃗xy′, x)^{∘} = !x
(y⃗, x)^{∘} = x if x ∉ y⃗
(y⃗, c)^{∘} = c
(y⃗, ∗)^{∘} = ∗
(y⃗, let ∗ be t in u)^{∘} = let ∗ be (y⃗, t)^{∘} in (y⃗, u)^{∘}
(y⃗, t ⊗ u)^{∘} = (y⃗, t)^{∘} ⊗ (y⃗, u)^{∘}
(y⃗, let x ⊗ x′ be t in u)^{∘} = let x ⊗ x′ be (y⃗, t)^{∘} in (y⃗, u)^{∘}
(y⃗, λx.t)^{∘} = λx.(y⃗, t)^{∘}
(y⃗, tu)^{∘} = (y⃗, t)^{∘}(y⃗, u)^{∘}
(y⃗,!t)^{∘} =!(y⃗, t)^{∘}
(y⃗, let !x be t in u)^{∘} = let x be (y⃗, t)^{∘} in (y⃗x, u)^{∘}

It is now easy to show that for terms x⃗:Γ; Δ ⊢ t:A of DILL(ℂ), we have the typing judgement x⃗ :!Γ; Δ ⊢ (x⃗, t)^{∘}:A in Lin^{D}(ℂ). We give two lemmas to show the action of the translation on substitutions.

Lemma 7.6.2 (Intuitionistic Substitution) Given a Γ; -term t of type A in DILL(ℂ) and a x:A, Γ; Δ-term u of type B in DILL(ℂ), we have the following derivable equality judgement in Lin^{D}(ℂ):

y⃗ :!A⃗′; Δ ⊢ (y⃗, u{t/x})^{∘} = (y⃗x, u)^{∘}{!(y⃗, t)^{∘}/x}:B

where Γ = y⃗:A⃗′.

Proof This is proved by induction over the structure of the x:A, Γ; Δ-term u of type B in DILL(ℂ). We give the key cases.

Firstly assume that u is an intuitionistic variable x (and hence that A = B). Then (y⃗x, x)^{∘} = !x, and so

(y⃗x, x)^{∘}{!(y⃗, t)^{∘}/x} = !!(y⃗, t)^{∘}

and y⃗:A⃗′; ⊢ (y⃗, t)^{∘} = !!(y⃗, t)^{∘} :!A, so that the result holds.

Secondly assume that u is a linear variable y′. Then (y⃗x, y′)^{∘} = y′, and so

(y⃗x, y′)^{∘}{!(y⃗, t)^{∘}/x} = y′

and y⃗:A⃗′; y′:C ⊢ (y⃗, y′{t/x}) = y′:C so that we have the result. The inductive cases follow easily. □

Lemma 7.6.3 (Linear Substitution) Given a Γ; Δ_{1}-term t of type A in DILL(ℂ) and a Γ; Δ_{2}, x:A-term u of type B in DILL(ℂ), we have the following derivable equality judgement in Lin^{D}(ℂ):

y⃗ :!A⃗; Δ ⊢ (y⃗, u{t/x})^{∘} = (y⃗, u)^{∘}{(y⃗, t)^{∘}/x}:B

where Γ = y⃗:A⃗ and Δ = Δ_{1}#Δ_{2}.

The proof of this lemma is very similar to that of the last, but simpler. It again goes by induction over the term u.

We can now prove that the translation is sound:

Lemma 7.6.4 (Soundness of ( )^{∘}) Given an equality judgement y⃗:Γ; Δ ⊢ t = u:A of DILL(ℂ), we have an equality judgement y⃗ :!Γ; Δ ⊢ (y⃗, t)^{∘} = (y⃗, u)^{∘}:A in Lin^{D}(ℂ).

Proof The proof is by considering the structure of equality judgements in DILL(ℂ). Clearly the reflexivity, transitivity, symmetry and context rules are translated to the corresponding rules of Lin^{D}(ℂ). The βη-equalities of DILL(ℂ) are translated to the corresponding equalities of Lin^{D}(ℂ), which is clear except in the case of the !-βη equalities; in the case of ! − β, we have the typed equality in DILL(ℂ):

y⃗:Γ; Δ ⊢ let !x be !t in u = u{t/x}:B

In Lin^{D}(ℂ), we have (y⃗, let !x be !t in u)^{∘} = let x be !(y⃗, t)^{∘} in (y⃗x, u)^{∘}. If (y⃗, t)^{∘} = v and (y⃗, u)^{∘} = w, then we can derive the equality judgement:

y⃗ :!Γ; Δ ⊢ let x be !v in w = w{!v/x}:B

since ! is intuitionistic, but now by our lemma we have the equality judgement:

y⃗ :!Γ; Δ ⊢ (y⃗, u{t/x})^{∘} = w{!v/x}:B

In the case of ! − η, we have the typed equality in DILL(ℂ):

y⃗:Γ; Δ ⊢ let !x be t in !x = t :!A

In Lin^{D}(ℂ), we have (y⃗, let !x be t in !x)^{∘} = let x be (y⃗, t)^{∘} in ! !x . Now using the ! − η equality of Lin^{D}(ℂ) and the let -rule, we have the equality judgement:

!Γ; Δ ⊢ let x be (y⃗, t)^{∘} in ! !x = (y⃗, t)^{∘} :!A

as required.

Finally, we have to consider the commuting conversions. These are provable using output-naturality and lemma 7.6.3. □

Translating Lin^{D}(ℂ) to DILL (ℂ)

We now define a map ( )^{•} from the type-theory Lin^{D}(ℂ) into the type theory DILL(ℂ), along exactly the same lines as in the previous subsection.

Definition 7.6.5 (The Translation ( )^{•}) As before, we define the translation ( )^{•}, which takes a pair of a sequence of distinct variables and a pre-term of Lin^{D}(ℂ), and gives a pre-term of DILL(ℂ), as follows:

(y⃗xy′, x)^{•} =!x
(y⃗, x)^{•} = x if x ∉ y⃗
(y⃗, let x be v in w)^{•} = let !x be (y⃗, v)^{•} in (y⃗x, w)^{•}
(y⃗, c)^{•} = c
(y⃗, ∗)^{•} = ∗
(y⃗, let ∗ be v in w)^{•} = let ∗ be (y⃗, v)^{•} in (y⃗, w)^{•}
(y⃗, v ⊗ w)^{•} = (y⃗, v)^{•} ⊗ (y⃗, w)^{•}
(y⃗, λx.v)^{•} = λx.(y⃗, v)^{•}
(y⃗, vw)^{•} = (y⃗, v)^{•}(y⃗, w)^{•}
(y⃗,!v)^{•} =!(y⃗, v)^{•}
(y⃗, !v)^{•} = let !x be (y⃗, v)^{•} in x

We can now easily show that if y⃗ :!Γ; Δ ⊢ v:A in Lin^{D}(ℂ), we have the typing judgement y⃗:Γ; Δ ⊢ (y⃗, v)^{•}:A in DILL(ℂ).

We have the following lemmas on substitution:

Lemma 7.6.6 (Intuitionistic Substitution) Given a Γ; -term v of type A in Lin^{D}(ℂ) and a Γ, x:A; Δ-term w of type B in Lin^{D}(ℂ), we have the derivable equality judgement:

y⃗:A⃗′; Δ ⊢ (y⃗, w{v/x})^{•} = (y⃗x, w)^{•}{(y⃗, v)^{•}/!x}:B

where Γ = y⃗; !A⃗′.

We can see from the definition of the translation that the variable x always occurs in a subterm of the form !x in the pre-term (y⃗x, v)^{•}.

Lemma 7.6.7 (Linear Substitution) Given a Γ; Δ_{1}-term v of type A in Lin^{D}(ℂ) and a Γ; Δ_{2}, x:A-term w of type B in Lin^{D}(ℂ), we have the derivable equality judgement:

y⃗:A⃗; Δ ⊢ (y⃗, w{v/x})^{•} = (y⃗, w)^{•}{(y⃗, v)^{•}/x}:B

where Δ = Δ_{1}#Δ_{2} and Γ = y⃗ :!A⃗.

Now we can prove that the translation is sound.

Lemma 7.6.8 (Soundness of ( )^{•}) Given an equality judgement y⃗ :!Γ; Δ ⊢ v = w:A in Lin^{D}(ℂ), we have an equality judgement y⃗:Γ; Δ ⊢ (y⃗, v)^{•} = (y⃗, w)^{•} in DILL(ℂ).

Proof Again the proof is by considering the structure of equality judgements if Lin^{D}(ℂ). Again, the symmetry, reflexivity, transitivity and context rules are easily seen to be sound under the translation. Further, the F − β_{v} rule is sound since firstly, if the intuitionistic term is a variable, we have:

(y⃗y′, let x be y′ in w)^{•} = let !x be !y′ in (y⃗, w)^{•}

and secondly, for the case where the intuitionistic term is an instance of !, we have that

(y⃗, let x be !v in w)^{•} = let !x be !(y⃗, v)^{•} in (y⃗x, w)^{•}

But then we have that in DILL(ℂ),

Γ; Δ ⊢ let !x be !(y⃗, v)^{•} in (y⃗x, w)^{•} = (y⃗x, w)^{•}{(y⃗, v)^{•}/x}

However, the image of the right-hand side of the σ-equality is (y⃗x, w)^{•}{!(y⃗, v)^{•}/!x} and since x always occurs in a subterm of the form !x in the image of (y⃗x, w), this is equal to the translation of the left-hand side.

Now for the F − η rule we have that

(y⃗, let x be w in x)^{•} = let !x be (y⃗, w)^{•} in !x

and from these definitions the required typed equality judgements can be shown. The other let -rules are instances of commuting conversions which hold of the let !x be t in u-construct in DILL(ℂ).

As for the output naturality equalities for the operators I^{L} and ⊗_{A,B}^{L}, these are soundly mapped into DILL(ℂ) by virtue of the commuting conversions of let ∗ be t in u and let x ⊗ y be t in u.

This leaves us just with the βη-equalities. Those for I, ⊗ and λ are translated directly to their counterparts in DILL(ℂ). For the ! − β equality of Lin^{D}(ℂ), we have:

y⃗ :!Γ; Δ ⊢ !!v = v:A

Now (y⃗, !!v)^{•} = let !x be !(y⃗, v)^{•} in x and so we have the required equality judgement:

y⃗:Γ; Δ ⊢ let !x be !(y⃗, v)^{•} in x = (y⃗, v)^{•}:A

by virtue of the ! − β equality of DILL(ℂ). For the ! − η equality of Lin^{D}(ℂ), we have:

x :!A; ⊢!( !x) = x :!A

Now (x,!( !x))^{•} =!(let !x be !x in x) and so we have the required equality judgement:

x:A; ⊢!(let !x be !x in x) =!x :!A

again by virtue of the ! − β equality of DILL(ℂ). □

The Translations are Inverse

Having given translations relating Lin^{D}(ℂ) and DILL(ℂ), we now show that they form an inverse pair.

Lemma 7.6.9 (Inverse Pair) The translations ( )^{∘} and ( )^{•} are inverse up to provable equality, in the sense that for any term of DILL(ℂ) y⃗:Γ; Δ ⊢ t:A, we have the equality judgement:

y⃗ : Γ; Δ ⊢ (y⃗, (y⃗, t)^{∘})^{•} = t:A

and for any term of Lin^{D}(ℂ) y⃗ :!Γ; Δ ⊢ v:A we have the equality judgement:

y⃗ :!Γ; Δ ⊢ (y⃗, (y⃗, v)^{•})^{∘} = v:A

Proof We prove this by considering the structure of the pre-terms of the source type theory. Considering firstly (y⃗, (y⃗, t)^{∘})^{•}, we have:

(y⃗xy′, (y⃗xy′, x)^{∘})^{•}  =  (y⃗xy′, !x)^{•}  =  let !x be !x in x
(y⃗, (y⃗, x)^{∘})^{•}  =  (y⃗, x)^{•}  =  x
(y⃗, (y⃗, c)^{∘})^{•}  =  (y⃗, c)^{•}  =  c
(y⃗, (y⃗, ∗)^{∘})^{•}  =  (y⃗, ∗)^{•}  =  ∗
(y⃗, (y⃗, let ∗ be t in u)^{∘})^{•} =  (y⃗, let ∗ be v in w)^{•}  =  let ∗ be t′ in u′
(y⃗, (y⃗, t ⊗ u)^{∘})^{•}  =  (y⃗, v ⊗ w)^{•}  =  t′ ⊗ u′
(y⃗, (y⃗, let x ⊗ y be t in u)^{∘})^{•} = (y⃗, let x ⊗ y be v in w)^{•} =  let x ⊗ y be t′ in u′
(y⃗, (y⃗, λx.t)^{∘})^{•}  =  (y⃗, λx.v)^{•}  =  λx.t′
(y⃗, (y⃗, tu)^{∘})^{•}  =  (y⃗, vw)^{•}  =  t′u′
(y⃗, (y⃗,!t)^{∘})^{•}  =  (y⃗,!v)^{•}  =  !t′
(y⃗, (y⃗, let !x be t in u)^{∘})^{•} = (y⃗, let x be v in (y⃗x, u)^{∘})^{•} = let !x be t′ in (y⃗x, (y⃗x, u)^{∘})^{•}

where v = (y⃗, t)^{∘}, w = (y⃗, u)^{∘}, t′ = (y⃗, v)^{•} and u′ = (y⃗, v)^{•}. Now we can easily prove the result by induction over the unique derivation of the typing judgement y⃗: Γ; Δ ⊢ t: A of DILL(ℂ), using the ! − β rule in the case of an intuitionistic axiom, and reflexivity in all other cases.

Now considering (y⃗, (y⃗, v)^{•})^{∘}, we have:

(y⃗xy′, (y⃗xy′, x)^{•})^{∘}  =  (y⃗xy′,!x)^{∘}  =  !!x
(y⃗, (y⃗, x)^{•})^{∘}  =  (y⃗, x)^{∘}  =  x
(y⃗, (y⃗, let x be v in w)^{•})^{∘} = (y⃗, let !x be t in (y⃗x, w)^{•})^{∘} = let x be v′ in (y⃗x, (y⃗x, w)^{•})^{∘}
(y⃗, (y⃗, c)^{•})^{∘}  =  (y⃗, c)^{∘}  =  c
(y⃗, (y⃗, ∗)^{•})^{∘}  =  (y⃗, ∗)^{∘}  =  ∗
(y⃗, (y⃗, let ∗ be v in w)^{•})^{∘} =  (y⃗, let ∗ be t in u)^{∘}  =  let ∗ be v′ in w′
(y⃗, (y⃗, v ⊗ w)^{•})^{∘}  =  (y⃗, t ⊗ u)^{∘}  =  v′ ⊗ w′
(y⃗, (y⃗, let x ⊗ y be v in w)^{•})^{∘} = (y⃗, let x ⊗ y be t in u)^{∘} =  let x ⊗ y be v′ in w′
(y⃗, (y⃗, λx.v)^{•})^{∘}  =  (y⃗, λx.t)^{∘}  =  λx.v′
(y⃗, (y⃗, vw)^{•})^{∘}  =  (y⃗, tu)^{∘}  =  v′w′
(y⃗, (y⃗,!v)^{•})^{∘}  =  (y⃗,!t)^{∘}  =  !v′
(y⃗, (y⃗, !v)^{•})^{∘}  =  (y⃗, let !x be t in x)^{∘}  =  let x be v′ in !x

where v′ = (y⃗, t)^{∘}, w′ = (y⃗, u)^{∘}, t = (y⃗, v)^{•} and u = (y⃗, v)^{•}. Now again we can prove the result by induction over the unique derivation of the typing judgement y⃗ :!Γ; Δ ⊢ v:A in Lin^{D}(ℂ), using the ! − β rule for the intuitionistic axiom case and using two let -rules in the !v case. □

Induced Semantics

Since we have given semantics for both DILL(ℂ) and Lin^{D}(ℂ), it is natural to ask how these may be related. Since Lin^{D}(ℂ) is a higher-order theory, its models are closely related to those of DILL(ℂ). In fact, it is a trivial observation that;

Lemma 7.6.10 Any Lin^{D}(ℂ)-model H yields a DILL(ℂ)-model.

Proof Clearly we can take the carrier of the DILL(ℂ)-model to be the carrier of the Lin^{D}(ℂ)-model. Further, the interpretation function on the primitive types P_{L} is given directly by [[ ]]_{M_{L}}. Finally, the operator interpretation of the Lin^{D}(ℂ)- model gives the interpretation of the constants. □

Before extending this to morphisms, we need to define the concept of morphism between two DILL(ℂ)-models.

Definition 7.6.11 (DILL(ℂ)-Morphism) A DILL(ℂ)-morphism F : L → L′ between two DILL(ℂ)-models is a pair of functors (F_{C} : C → C′, F_{S} : S → S′) such that:

• F_{C} is strict cartesian and F_{S} is strict monoidal closed,

• the following diagrams commute:

[figure: C; F; S; C′; F_{C}; F′; S′; F_{S}; C; G; S; C′; F_{C}; G′; S′; F_{S}]

• F_{S}([[ ]]_{P_{I}}^{L}) = [[ ]]_{P_{I}}^{L′} : P_{I} → obj(S′),

• F_{S}([[c]]_{C}^{L}) = [[c]]_{C}^{L′} for each c:A in C. We now call the category of DILL(ℂ)-models and morphisms Cat_{DILL}(ℂ).

Now we can extend our previous result to morphisms:

Lemma 7.6.12 Any Lin^{D}(ℂ)-morphism F between two Lin^{D}(ℂ)-models yields a DILL(ℂ)-morphism between the resultant DILL(ℂ)-models.

Proof Again, it is clear that the Lin^{D}(ℂ)-morphism has the right form to be a DILL(ℂ)-morphism, and it is only necessary to show that it preserves the interpretation functions, which it must do by virtue of their derivation from the Lin^{D}(ℂ)-interpretations. □

Now, call the category of Lin^{D}(ℂ)-models and morphisms Cat_{Lin}_{D}(ℂ). In fact, we can show also that any DILL(ℂ)-morphism between two DILL(ℂ)-models arising from Lin^{D}(ℂ)-models itself arises from a Lin^{D}(ℂ)-morphism, which implies that we have a functor Cat_{Lin}_{D}(ℂ) → Cat_{DILL}(ℂ) which is an embedding.

Further, using our translation results we can see that the term Lin^{D}(ℂ)-model yields the term DILL(ℂ)-model defined in chapter 3, and hence that the term DILL(ℂ)-model is initial up to isomorphism in the full subcategory of DILL(ℂ)- models which arise from Lin^{D}(ℂ)-models.

Normal Forms for Lin(𝕆, 𝔸)

Having introduced a general linear type-theory, given its semantics and shown how it has interesting systems as instances, we are now motivated to look more closely at the properties we can prove of the framework in general. In our conservativity result of the previous chapter, we have made one step in this direction, and in this chapter and the next we want to discuss another, larger issue.

The aim of our general linear type-theory is to provide a framework in which the ‘programs’ (or processes, or functions, etc) of a particular language can be written and equipped with as much typing information as required, and also in which definitional equality between programs can be proved. What we mean by ‘definitional equality’ is very basic, for example the associativity of sequential composition would be a definitional equality, whereas any kind of β-evaluation of a function would not. Given that the idea of definitional equality is so basic, it seems imperative that we be able to decide whether two terms are definitionally equal or not, and yet with the machinery we have so far this is certainly not generally provable.

We present in this chapter and the next a system of normal forms for the terms of the type-theory Lin(𝕆, 𝔸) which will decide the equality of the system in the particular case when the axiom set 𝔸 is empty. We will further extend the system to show that the equality of any system of the form Lin(𝕆, ONat(𝕆, O)) for some 𝕆 can be decided, as can the higher-order system Lin^{H}(ℍ, ∅).

These results then have as simple corollaries the decidability of DILL(ℂ) and of the higher-order action calculi.

8.1 Proof Nets

One of the innovations associated with the introduction of linear logic by Girard [Gir87] was the definition of proof nets, which have since become objects of study in their own right. One key property of proof nets is that two proofs which are equivalent by commuting conversions, which we have already seen in the various linear type-theories we have introduced, are mapped to equal proof nets. Further, many familiar equalities in type-theories such as the βη-equality of Lin^{D}(ℂ) can be presented as the the symmetric transitive closure of a set of local rewrites, which can then be shown to be confluent.

In this chapter we will define relations, which are a syntactic presentation of proof-nets. Proof-nets have shown themselves to be a very natural language for the proofs of linear logic in particular, as mentioned in the introduction. However, as they are a graphical syntax, it is difficult to formulate and prove rigidly the delicate lemmas involved in proving normalisation and confluence, as we wish to do. Hence rather than working directly with proof-nets, we will briefly present the theory of proof-nets, but present our development in the language of relations, which are a non-graphical syntax for proof-nets.

First we outline the theory of nets for the particular case of Lin^{D}(ℂ), which raises most of the issues.

Fundamentals

Proof-nets for the type-theory Lin^{D}(ℂ) differ from those for ILL(ℂ), just as the type-theories do. The most significant difference is that to reflect the distinction between the linear context and the intuitionistic context, we will define proof-nets for Lin^{D}(ℂ) using two “colours” of wire, linear and intuitionistic, which in this monochrome environment will be represented by full and dashed lines respectively.

As a convention, where we want to indicate an arbitrary number of wires at some point in a net, we will use a short dash across the line, as in figure 8.1, which represents a number of intuitionistic wires.

Figure 8.1: Multiple Wires

Now, proof-nets are built out of basic components, which in the case of the type-theory Lin^{D}(ℂ) are as given in figure 8.2. Note that each input and output of a component is typed with a type of DILL(ℂ), except for the unit elimination which has a possibly unexpected output labelled v. This can be seen as a kind of zero width multiple wire; we call it a vestigial, and its rôle will be discussed shortly.

Unit Introduction Tensor Introduction Abstraction Exponential Introduction

Unit Elimination Tensor Elimination  Application  Exponential Elimination

Replicator  The F -Rule  I − Ax

Note that the replicator also has a vestigial in the case when it has no outputs.

Figure 8.2: The Elementary Components

A net for Lin^{D}(ℂ) is a finite set of components which are connected with wires. Nets correspond to pre-terms in the sense that so far we have imposed no restrictions on the typings of wires, or their colours. Now, a path in a net is simply a sequence of components each of which is connected to the next by a wire or a vestigial which is not a binding wire (one which is connected to the output port labelled A of an abstraction A ⊸ B). A maximal path is one which cannot be extended, and the length of the path is the number of wires it contains. Now, a proof-net for Lin^{D}(ℂ) is a net for Lin^{D}(ℂ) which satisfies a number of conditions:

Colouring Wires must be well-coloured, ie they must be connected to inputs and outputs of the same colour.

Linearity Wires must be linear, ie they be must connected to at most one output and at most one input. If a wire is connected to one output only, then we say it is a free output, and if it is connected to one input only, we say it is a free input.

Typing Wires must be well-typed, ie they must connect inputs and outputs of the same type.

Intuitionistic The net must have only one free output wire, which must be linear.

Boxing Any collection of components occuring inside a box must be a proof-net having no linear free inputs.

Acyclicity There must not exists two components c and c′ in the net such that there exist a path from c to c′ and a non-zero length path from c′ to c.

Abstraction For each abstraction component in the net, all maximal paths starting from the binding output of the abstraction must include the input wire of the same abstraction component.

Most of these conditions are self-explanatory, and we will consider a couple of examples of proof-net constructions to demonstrate their motivation. We assume a function Φ which maps terms of Lin^{D}(ℂ) to proof-nets for Lin^{D}(ℂ). Firstly consider the proof-net corresponding to an application Γ; Δ ⊢ vw:B, where we have Γ; Δ_{1} ⊢ v: A ⊸ B and Γ; Δ_{2} ⊢ w: A, and Δ = Δ_{1}#Δ_{2}. The proof net corresponding to the application is seen in figure 8.3.

The key elements are common to many of the constructions. We use a replicator to copy the intuitionistic context for both sub-nets corresponding to v and w, and bind the output wires of both subnets, creating a new free output wire which has the type of the application instance.

Now we can consider the proof-net corresponding to the abstraction Γ; Δ ⊢ λx.v:A ⊸ B with the obvious derivation, which is seen in figure 8.4.

In this case, the interesting feature is that we have bound the input labelled x of the subnet corresponding to v using an output of the λ-component. This output is called a binding output because it must always be used in this way, Figure 8.3: Application in Proof Nets

Figure 8.4: Abstraction in Proof Nets

and the acyclicity condition on proof-nets is not violated since such outputs are specifically excluded from being part of paths. Notice that the linear naturality of the λ-operator in Lin^{D}(ℂ) is achieved simply by not binding the other linear inputs of the subnet corresponding to v.

Finally, consider the net corresponding to the derivation Γ; ⊢!v :!A, which can be seen in figure 8.5. The key points about this construction are firstly that we enclose the entire subnet corresponding to v in a ‘box’ since the !-operator of Lin^{D}(ℂ) is not linearly natural with respect to this argument, and secondly that we represent the fact that the !-operator is intuitionistic by allowing it to return an intuitionistic wire as its result. We then need to regain intuitionistic naturality by allowing certain components (intuitionistic operator instances and replicators) to permeate into the box.

The general pattern for the implementation of an arbitrary operator is that we

Figure 8.5: !-Introduction in Proof-Nets

enclose all the arguments in which it is not linearly natural in a box, as motivated in the above example, and bind only the variables in the bound positions of those arguments which it is natural in. Finally, if the operator is intuitionistic, then we let the box which necessarily exists have an intuitionistic output.

Vestigials

Having given a brief account of proof nets for this specific case, we have still to explain the role of vestigials. Vestigials are wires which do not correspond to assumptions and have no types, but which are necessary to establish the scoping of elimination constructs having no other outputs. Consider the two derivations Γ; Δ, x : I ⊢ λy : A.(let ∗ be x in v) : A ⊸ B and Γ; Δ, x : I ⊢ let ∗ be x in (λy : A.v) : A ⊸ B. If we used no vestigials, both of these terms would map to the proof-net in figure 8.6, and hence the scope of the unitelimination construct would be lost.

Now this particular case is not a problem because in fact the two derivations we have given are equal up to commuting conversion equality. However, there are cases in which this loss of scope causes two terms which are not equal by commuting conversions to have equal images under Φ. One example, which we present, is derived from the coherence problem for symmetric monoidal closed categories, and is due to Kelly and MacLane.

In [KM72] a diagram of natural transformations is presented which does not commute in every symmetric monoidal category. Hence, by virtue of our completeness result for DILL(ℂ), we would expect that the the diagram does not com-

Figure 8.6: Abstraction without vestigials

mute in the term-model, and in particular that the two terms which correspond to the two possible unequal morphisms are not made equal by the type-theory DILL(ℂ). The first of these two terms is (where we abbreviate B ⊸ I as B^{I}):

; x:A^{I^{I^{I}}} ⊢ λy_{1}:A^{I^{I}}.let ∗ be x(λy_{2}:A^{I}.let ∗ be y_{1}(λy_{3}:A.let ∗ be y_{2}y_{3} in ∗) in ∗) in ∗:A^{I^{I^{I}}}

The second of the two terms is:

; x:A^{I^{I^{I}}} ⊢ λy_{1}:A^{I^{I}}.let ∗ be y_{1}(λy_{3}:A.let ∗ be x(λy_{2}:A^{I}.let ∗ be y_{2}y_{3} in ∗) in ∗) in ∗:A^{I^{I^{I}}}

On inspection, it is clear that the first of these two terms equal to the term ; x:A^{I^{I^{I}}} ⊢ x:A^{I^{I^{I}}}, as we would expect since one of the morphisms in the Kelly-MacLane diagram is the identity.

Figure 8.7: Kelly and MacLane’s Counterexample

Now, the left-hand proof-net of figure 8.7 represents the first term, and the right-hand one the second. They are not equal as they stand, with vestigials, but we can see that if we were to erase the vestigials from each of the I-elimination boxes, they would be identical. Hence we can see that vestigials are necessary in this framework, to distinguish the proof-nets of unequal proofs.

This result shows that we need vestigials in order to distinguish separate nets. However, one problem with vestigials is that proof-nets with different vestigial positionings (such as the two in figure 8.7) may represent terms which are equal via commuting conversions. Hence we must reintroduce a vestigial equality on nets. This will be decidable.

Proof-Net Rewrites

One of the key properties of proof-nets is that we can give local rewrites over them which will be confluent and normalising. We show as an example in figure 8.8 the two rewrites which describe the β and η-rules of the arrow type ⊸.

Figure 8.8: The λ-β and η-Rewrites

An interesting point here is that we use an expansionary η-rewrite, following Ghani [Gha95]. If we use η-reductions, we cannot obtain confluence due to a problem with the unit rewrites.

8.2 Relations

We now introduce relations, which are non-graphical analogues of proof-nets for a general linear typing system Lin(𝕆). Although proof-nets are a very intuitive language for proofs, and capture very effectively the intuitions involved especially in proof equivalence, to prove delicate lemmas relating proof-nets to terms is clumsy, because it involves extended case analysis of graphical situations. In particular, it is easy to overlook unfamiliar cases. Hence, we have chosen to use a non-graphical syntax which, however, closely mirrors the behaviour of proof-nets.

First consider some simple examples. The proof net (for Lin^{D}(ℂ)) is given in figure 8.2.

Figure 8.9:

This corresponds to the term

; x′:A ⊗ C, y:B ⊢ let x_{1} ⊗ x_{2} be x′ in x_{1} ⊗ (y ⊗ x_{2}):A ⊗ (B ⊗ C)

and the relation

R(x′, y, z) = ∃x_{1}:A, x_{2}:C, y′:B ⊗ C.(z = x_{1} ⊗ y′) ∧ (y′ = y ⊗ x_{2}) ∧ (x_{1} ⊗ x_{2} = x′)

where by convention we let the (unique) output variable be the last parameter of the relation, in this case z.

As we can see, each rule instance in the proof is reflected in the proof net by a component, in the term by a constructor, and in the relation by a clause. Intuitively, we obtain relations from nets by giving a clause for each component of the net, conjoining them and binding the variables corresponding to internal wires. Now consider the term

; x′:A ⊗ C ⊢ λy:B.let x_{1} ⊗ x_{2} be x′ in x_{1} ⊗ (y ⊗ x_{2}):B ⊸ (A ⊗ (B ⊗ C))

which has the relation

S(x′, z′) = ∀y:B.∃z:(A ⊗ (B ⊗ C)).(z′y = z) ∧ R(x′, y, z)

The only extension to our intuition is that in this case the binding variable of the term is bound in the relation using a universal quantifier rather than the existential. This will hold for all binding variables of binding operators.

Now, we can make some simplifications to our syntax. Firstly, note that because of the associativity of the ∧-operator on relations, and the familiar prenex normal forms of the expressions we have written, in general a relation can be written as a sequence of quantifiers followed by the conjunction of a set of clauses:

Qx_{1}…. Qx_{r}.c_{1} ∧ … ∧ c_{s}

Clearly, not all relations of this form represent valid proof-nets. We can exactly characterise those that do, however, as the relations satisfying a certain set of conditions based on the net conditions of page 181.

Note in particular that all relations corresponding to proof nets will mention a variable twice exactly iff it is bound, and once exactly iff it is free. Hence we can decide whether a variable is bound, and since precisely the binding variables of operator clauses are universally quantified, we can reconstruct the sequence of quantifiers from the set of clauses. This procedure may seem to introduce scoping concerns, but we will show by translating our relations soundly to terms (up to commuting conversion equality) that suitable scopes for all binders can be inferred from the clause set.

Therefore, from now on we will give relations as sets of clauses. We will work with the variable set X as usual. Firstly, we construct pre-relations as follows:

Definition 8.2.1 (Pre-Relations) We define pre-relations and clauses over a generalised signature 𝕆 = (M_{I}, M_{L}, O_{I}, O_{L}) mutually inductively as follows:

• Pre-relations, ranged over by D, E … are finite sets of clauses, and

• clauses, ranged over by d, e … have one of the following forms, where M is a nonempty finite set of variables and D is a pre-relation:

d ::=( =^{x:A} x:Q) | (M:Q = x:Q) | (x:Q = F (x:Q)) | (F (x:Q) = x:Q)

| x:A = (x⃗:Q⃗; x⃗:A⃗)O((x⃗:Q⃗; x⃗:A⃗)D(x:A), …, (x⃗:Q⃗; x⃗:A⃗)D(x:A);

(x⃗:Q⃗; x⃗:A⃗)(x:A), …, (x⃗:Q⃗; x⃗:A⃗)(x:A))

where we allow the operator clauses respectively for any operator O ∈ O_{L}. We will refer to the variable x in the clause ( =^{x:A} y:Q) as a vestigial.

In this definition, the form (x⃗:Q⃗; y⃗:A⃗)D(z:B) binds the inputs x⃗ and y⃗ and the output z in the pre-relation D. The form (x⃗:Q⃗; y⃗:A⃗)(z:B) is similar except that the variables are bound not in a particular pre-relation but in the whole pre-relation containing the clause. To further clarify the operator clause, which is the most complex of the definition, we use two familiar examples. First consider the case where we have an operator ! of arity:

\begin{matrix}(; )A & ; \\ ( ; )!A \end{matrix}

The operator clause in this case is (x :!A = ()!(()D(y : A); ). In this, we take a prerelation D with output y:A and apply the operator to it to give the pre-relation with the same intuitionistic inputs and the one output x:A. Now consider the operator ⊗^{R} having arity:

\begin{aligned}; & ( ; )A & ( ; )B \\ & ( ; )A ⊗ B \end{aligned}

The operator clause here is (x:A ⊗ B = () ⊗ (; ()(y_{1} :A), ()(y_{2} :B))), and in this case because the operator is linearly natural in the arguments, we do not ‘box’ them in the syntax but instead, as in proof-nets, allow the operator clause to bind variables elsewhere in the body of the pre-relation it occurs in.

We henceforth omit type information except where necessary, in the familiar way, and further where it is convenient we will omit some details of a general operator clause for brevity; for example, we might write

(x = (y⃗_{1}; y′_{2})O(…, (x′_{1}; x′_{2})D(x′′), …; …))

to indicate a general operator clause containing the argument (x′_{1}; x′_{2})D(x′′).

Clauses are equipped with inputs and outputs (which we will call polarities) and typings similarly to the components of proof nets. Each variable in a clause will either occur as an input, an output, a binding occurrence or a vestigial, and will have an associated type (except in the case of vestigials). Intuitively, clauses are analogous to term constructors or equivalently to rules. The first and second clauses in the inductive definition are exceptions to this, in that they correspond to the admissible weakening and contraction rules respectively. We will discuss the need for such explicit syntax later. The third and fourth clauses in the definition correspond respectively to the intuitionistic axiom and I-L rule, and the fifth corresponds to the general operator rule.

Preliminary Definitions

First we define what it means for a pre-relation D to contain a clause.

Definition 8.2.2 We say that a pre-relation D contains a clause c (at depth r) if c ∈ D (and r = 0) or if for some operator clause:

(y = (y′_{1}; y′_{2})O(… (x′_{1}; x′_{2})D′(x′′) …; …)) ∈ D

where D′ contains c (at depth r − 1). Note that for any pre-relation there is an upper bound on the depth of clauses contained within it.

Having referred informally to clauses having inputs and outputs, we now need to define these notions.

Definition 8.2.3 (Input) A variable x is an input of the clause c if • either c is ( =^{z} x), (M = x), (y = F (x)) or (F (y) = x),

• or c is (y = (x⃗_{1}; x⃗_{2})O(…)) where x ∈ x⃗_{1}x⃗_{2},

• or c is (y = (y′_{1}; y′_{2})O(…; … (x′_{1}; x′_{2})(x) …))

• or c is (y = (y′_{1}; y′_{2})O(… (x′_{1}; x′_{2})D′(x) …; …)). Further, we will say that x occurs as an input in a pre-relation D if D contains

a clause c of which x is an input.

Definition 8.2.4 (Output) A variable x is an output of the clause c if • either c is (M = y) where x ∈ M, is (F (x) = y), or is (x = F (y)),

• or c is (x = (x⃗_{1}; x⃗_{2})O(…; …)), Similarly, we will say that x occurs as an output in the pre-relation D if a

clause c having x as an output is contained in D.

We also define the notion of binding occurrence:

Definition 8.2.5 (Binder) A variable x is a binder in a clause c if • c is (x = (x′_{1}; x′_{2})O(…; … (y⃗_{1}; y⃗_{2})(x′′) …)) where x ∈ y⃗_{1}y⃗_{2},

• or c is (y = (y′_{1}; y′_{2})O(… (x′_{1}; x′_{2})D′(x′′) …; …)) where x ∈ x′_{1}x′_{2}.

Again, a variable x occurs as a binder in a pre-relation D if there is a clause contained in D which has x as a binder.

A variable x occurs as a vestigial in a pre-relation D if D contains a clause ( =^{x} y), and we may say that the clause has vestigial x. A child of a variable x is a clause which has an input occurrence of x. A clause c has a dependent x if c has vestigial x or c has an output x. Note that every clause has exactly one dependent.

Definition 8.2.6 (Connectedness) Two clauses c and c′ are connected by a variable x in a pre-relation D if x is a dependent of c and has child c′.

We must now define a notion of path over a pre-relation, which will be central to our development. Intuitively, a path through a pre-relation is analogous to a path through the corresponding net. For the following definitions, we fix a particular pre-relation D.

Definition 8.2.7 (Path) A path between two clauses c and c′ in a pre-relation D is a pair of sequences (c_{1} … c_{r}, x_{1}, … x_{r−1}) such that c_{1} = c, c_{r} = c′ and x_{i} connects c_{i} and c_{i+1} for i = 1 … r − 1.

Paths may be concatenated in the obvious way, so that a path from c to c′ and one from c′ to c′′ yield a path from c to c′′. A complete path from a clause c to another c′ in a pre-relation D is a path such that c′ has a dependent which occurs only as an output. Complete paths cannot be extended by post-concatenation.

Now we need to define linear and intuitionistic occurrences.

Definition 8.2.8 (Intuitionistic Occurrence) A variable x occurs intuitionistically in a pre-relation D if

• D contains a clause ( =^{z} x) or a clause (M = y) where x ∈ M or y = x,

• or D contains a clause:

– (y = F (x)),

– (F (x) = y),

– (y = (y⃗_{1}; y⃗_{2})O(… (x⃗; y′)D′(x′) …; …)) where x ∈ x⃗,

– (y = (y⃗_{1}; y⃗_{2})O(…; … (x⃗; y′)(x′) …)) where x ∈ x⃗,

– (x = (; )O((x⃗_{1}; y⃗_{1})v_{1} … (x⃗_{r}; y⃗_{r})v_{r}; )) where O ∈ O_{I},

We now say that a variable occurs linearly in a pre-relation if it has an occurrence in a clause which is not intuitionistic.

Definition 8.2.9 (Free Variable) A variable x is a free input of a pre-relation D if it occurs as an input in D but does not occur as an output or a binder. Similarly, a variable x is a free output of the pre-relation if it occurs as an output in D but does not occur as an input.

With this grounding, we can now define relations. Note that rather than being a construction-based definition like the definition of terms (a term is a pre-term that can be typed using these rules) it is a definition based on global properties.

Definition 8.2.10 (Relation) Given a generalised typing context Γ; Δ and a type A ∈ M_{L}, a Γ; Δ-relation D of type A over 𝕆 is a pre-relation over 𝕆 having the following properties:

Linearity Each variable must occur in D at most once as an input, and at most once as an output or binder.

Colouring Each variable occurring twice must do so both times intuitionistically or both times linearly.

Typing Each variable occurring twice must do so both times with the same type annotation.

Boxing Each pre-relation D that occurs in a clause of D

(y = (x′_{1}; x′_{2})O(… (Γ′; Δ′)D′(y′:A′) …; …))

must be a Γ′; Δ′-relation of type A′ with result variable y′.

Output There must be at most one variable x which occurs in D only as an output. If such a variable exists, it must occur linearly and with type A. If not, there must exist a unique variable x of type A in Δ but not occurring as an input, output or binder in D. We refer to the unique variable picked out by this requirement as the result variable of D for the typing context Γ; Δ.

Inputs Γ must type at least the intuitionistically-occurring free inputs with the types they are annotated with in their occurrences. Also, if the result variable x is not a free output of D, then Δ must type exactly each free input of D with the type annotating it in D and x: A. If x is a free output of D, then Δ must type exactly each free input of D with the type annotating it in D.

Binding For any variable y which occurs as a binder in D in a clause c of the

form

(y′ = (x′_{1}; x′_{2})O(…; … (y′_{1}; y′_{2})(x′′) …))

where y ∈ y′_{1}y′_{2}, either y = x′′, or any complete path from a child of y must contain the clause c as its i + 1th with the ith wire being x′′.

Acyclicity No clause in D may have a path starting and ending at itself which is not the trivial path (c, ε).

Vestigial If D contains a clause of the form ( =^{y} x′), then y must be the result variable of D or must occur linearly as an input in D.

Although this definition seems circular, because of the references to relations occuring within the intuitionistic arguments of an operator clause, it is easy to decide whether any given pre-relation is a relation. This can be done by induction on the depth of operator clauses, since for any pre-relation there must be a bound on the depth of operator clauses contained in it.

Having defined relations over a generalised signature, we will let the set of all relations over the generalised signature 𝕆 be denoted by Rel(𝕆).

Basic Results

We now prove some useful lemmas about relations.

Lemma 8.2.11 (Properties of Relations) Children In a Γ; Δ relation D of type A, any variable has precisely one child except the result variable, which is childless.

Complete Paths I The last clause in any complete path from any clause c must have the result variable as a dependent.

Complete Paths II In a Γ; Δ relation D of type A, for any clause c there is at least one complete path from c to some other clause.

Unique Typing Given a generalised typing context Γ; Δ and a pre-relation D, there is at most one type A such that D is a Γ; Δ-relation of type A.

Result Variable Given a Γ; Δ-relation D of type A, the result variable can be determined effectively.

Proof

Children To prove this, note that the output property specifies that every variable except the result variable x must not be a free output, and hence must occur as an output and also as an input. Therefore any such variable must occur as the input to some clause which is then its child. However, such a variable must only occur once as an input, so there must be precisely one such clause. Since x is a free output, it cannot be the input of any clause, and hence it must be childless.

Complete Paths I This is obvious since the result variable is the only possible variable only occurring as an output.

Complete Paths II To show this, we need to demonstrate that every path which is not complete can be extended. Note first that every clause has at least one dependent. Now given a path from c to c′ in a relation D, if c′ has as a dependent the result variable we are done. If not, take a dependent of c′ and its unique child; these extend the path.

Unique Typing Consider the two possibilities in the output condition of the definition of relations. If the result variable occurs as an output in D, then it must occur with a typing and for every typing context Γ; Δ it must have the same typing given as an annotation in D. If on the other hand the result variable does not occur in D but is typed in Δ, then it clearly follows that given the typing context there can only be one type assigned to the result variable.

Result Variable There are efficient ways to do this, but to see that it is true simply take the finite number of variables occurring linearly in D or typed in Δ, and for each test whether it occurs as an input in D, which is effective. Precisely one will not and this is the result variable.

We will now define a useful abbreviation. Abbreviate the pre-relation D containing the clauses (M_{1} = x_{1}), …, (M_{r} = x_{r}) by removing these clauses and replacing them with the form (M_{1} … M_{r} = x_{1} … x_{r}) which we will henceforth call a clause, overloading notation insignificantly. Further, we will in the same way abbreviate a pre-relation D containing the clauses ( =^{y} x_{1}), …, ( =^{y} x_{r}) by removing them and replacing them with the form ( =^{y} x_{1} … x_{r}), which we will again call a clause.

Now define the family of a variable x occuring as a dependent in a relation D to be the set of clauses c such that every complete path in D from c contains the variable x. We will write this fam(x, D), omitting the relation D where it is obvious. Intuitively the family of a variable in a relation corresponds its maximal sub-relation which has x as its result variable.

We now prove two results on families.

Lemma 8.2.12 Given a relation D, if a clause c is in two families fam(x, D) and fam(y, D), then either the variable x must have a child in fam(y, D), or y must have a child in fam(x, D).

Proof We know if a clause c is in two families fam(x, D) and fam(y, D), then we have that every complete path in D from c contains both x and y. Note that both x and y must occur as inputs and as dependents since otherwise they could not occur in a path. Now it must be the case that the unique children c_{x} and c_{y} respectively of x and y must both occur in every complete path from c in D. Now assume that in some complete paths from c in D the clause c_{x} occurs before c_{y} and in others c_{y} occurs before c_{x}. Then, by taking appropriate sub-paths of these paths we can construct a cyclic path from c_{x} to itself in D, which is a contradiction. Therefore, one occurs first in every complete path from c in D. Say w.l.o.g. that it is c_{x}. Then every complete path from c_{x} in D must be part of a complete path from c in D, and further it occurs in that path before c_{y}, so that y is in any complete path from c_{x} in D. Therefore, c_{x} is in fam(y, D). □

Lemma 8.2.13 Given a Γ; Δ-relation D and a variable x which occurs linearly in D, fam(x, D) is a Γ′; Δ′-relation for some Γ′; Δ′.

Proof We can prove this by considering each clause in turn. Clearly linearity, colouring, typing, boxing and acyclicity are inherited from D.

Of those that are left, first consider the output condition. Note that either x does not occur as an output in fam(x, D) because it is the empty relation, or because it occurs only as an output. This is trivial since if it were to occur as an input it would imply that the child of x, c_{x}, had a complete path in D which contained x, which would induce a cycle in D. Further, if any clause c is contained in fam(x, D) then a clause having x as dependent must, since each complete path in D from c must contain x as a connection between a dependent of x and its child. Now, having established that x is an appropriate candidate for the result variable, we must show that there can never be another variable y occuring only as an output in fam(x, D). For a contradiction, assume there is such a y. Then y must occur as the output of a clause c′ in fam(x, D). Now if y has a child c_{y} in D then there must be a complete path from c′ in D containing y, which is the completion of the path (cc_{y}, y). But there is some complete path from c_{y} in D not containing x, or c_{y} would be in fam(x, D) and y would occur also as an input. Hence we can construct a complete path from c′ in D which does not contain x. So y must be childless in D, and hence the result variable of D. But then the empty path from c′ by definition must contain x, which is a contradiction. Hence the result variable of D cannot occur only as an output in fam(x, D), and x is the only such possible variable.

Considering the input condition, we can take Γ′ to be the typing sequence that types all the intuitionistically occuring variables with the types they are annotated with, and Δ′ to be the typing sequence which types all the linearly occuring ones with the types they are annotated with, and types the result variable x with any type A if it does not occur in fam(x, D). This will make fam(x, D) a Γ′; Δ′-relation of some type.

Considering the binding condition, we can see that if an operator clause c with a binder y occurs in fam(x, D), then any complete path in D from a child of y must contain the clause c, and must therefore contain a complete path from c in D as a final segment. But this final segment must contain x, and so every complete path from the child of the binder must contain x and the child of the binder must be in fam(x, D), and the condition must be satisfied.

Considering the vestigial condition, assume we have a clause ( =^{y} y′) such that y is not the result variable of fam(x, D) and does not occur as an input in it. But if this clause occurs in fam(x, D), then it must be the case that there is a complete path from the clause in D, and such a path must contain x, implying that the child of y is in fam(x, D), which is a contradiction. □

Now define a Γ′; Δ′ sub-relation E of a Γ; Δ-relation D to be a subset of D which is a Γ′; Δ′ relation. A fundamental property of subrelations which we will need is the following:

Lemma 8.2.14 Given a relation R with a subrelation R′ ⊆ R, any complete path in R from a clause c ∈ R′ must pass through a clause c′ having as dependent the result variable of R′.

Proof Assume not. Now take the maximal non-zero initial segment of the path which is within R′. The last clause in this segment must have a dependent which is not the input of a clause in R′. If the dependent is a vestigial, the vestigial condition on R′ implies that the dependent is the result variable of R′, which is a contradiction. If it is not a vestigial, then it is a variable which does not occur as an input in R′ and does occur as an output (of the last clause in the initial segment) and hence it must be the output variable of R′. □

8.3 Relational Equality

We now define the various parts of the equality over relations. Since we are interested in proving that term equality is decidable via a translation into the full relational equality, we will need to make sure that each part of the equality is decidable. This will often be achieved by making a part of the equality the transitive reflexive closure of a confluent terminating rewrite.

Vestigial Moves

First, we introduce the concept of vestigial moves on a relation. As we shall see, the vestigial x in a clause of the form ( =^{x} y) gives us essential information about scoping in the derivations corresponding to the relation. If we do not have this information, then two relations representing derivations not of provable equal terms may be the same. However, there is redundancy in that several relations with different vestigials may correspond to several provably equal terms. Hence we need to give an equality between such relations. We call this equality =_{vm}, and we make a definition:

Definition 8.3.1 (Vestigial Moves) The Γ; Δ-relations D ∪ {( =^{x} y)} and D ∪ {( =^{x′} y)} of type A are one-step equal via vestigial moves, if

1. There exists a path in D ∪ {( =^{x} y)} from the child of x to a clause having dependent x′. Note that such a path cannot contain the clause ( =^{x} y) or a cycle would result.

2. For any clause c of the form

(y′ = (x′_{1}; x′_{2})O(…; … (y′_{1}; y′_{2})(x′′) …))

with z ∈ y⃗_{1}y⃗_{2} such that there is a path from the child of z to ( =^{x} y) in D ∪ {( =^{x} y)}, all complete paths from the dependent of x′ must contain the clause c as their i + 1th and the variable x′′ as their ith.

We now say that D =_{vm} D′ if these two relations are shown to be equal by a finite sequence of one-step vestigial moves.

Having given this definition, it is imperative that we show that it is decidable.

Lemma 8.3.2 (Decidability) Vestigial equality is decidable.

Proof We can prove this by considering the following effective procedure:

Given any finite set of relations, pick any relation, pick any vestigial and make any valid vestigial move. If the result is not in the set, add it and continue until no relation in the set has a vestigial move resulting in a new relation.

First we show that this is effective; note that determining whether a vestigial move is valid is a matter of considering a finite number of paths in a relation, and hence is effective. Since we start out with a finite set of relations, each of which have a finite number of vestigials, it is effectively possible to check whether any relation has a vestigial move on a particular vestigial.

Now, given this effective procedure, start it with the singleton set containing any relation. Since there are only a finite number of variables which may be used as each vestigial (by the vestigial condition, since the variable must occur elsewhere in the body of the relation not as a vestigial), there are at most a finite number of relations which may be equal by a vestigial move to any given relation. Since there must be a finite sequence of one-step vestigial moves relating any two relations which are equal via vestigial moves (since an infinite sequence would of necessity repeat in the finite set of vestigially-equal relations), this procedure must result in the finite set of all relations vestigially equal to the relation we initially considered. Since the set is finite, we can now simply check to see if the relation is vestigially equal to another relation by checking to see if it is in the finite set resulting from the procedure. □

The Δ-rewrite

We now recall that our system includes clauses corresponding not only to the rules of our logic, but also to its admissible weakening and contraction rules. This is to ensure that we can express the equality of the system using local rewrites. Consider DILL(ℂ). Recall from page 41 that in the presence of admissible cut rules for equality, the equality of DILL(ℂ) is given by axioms which do not involve substitutions (the substitutions which appear in the η-rules can be equivalently rewritten as side-conditions on the equalities). However, there is still an infinite set of these axiomatic equalities parameterised over terms, for example as in the equality Γ; Δ ⊢ let ∗ be x in t{∗/x} = t:A. It is possible in the presence of the commuting conversions to derive these equalities from a finite set of axioms not parameterised over terms. Our rewrites on the system of relations for DILL(ℂ) will be suitable orientations of these.

However, this still leaves us with the problem of giving rewrites verifying the the admissible cut rules for equality. To do this in a local way for intuitionistic substitution we need to give a low-level implementation for the copying and discarding of intuitionistic relations, which is provided by the rewrite →_{Δ}.

Definition 8.3.3 (The Rewrite →_{Δ}) We define the rewrite →_{Δ} firstly over pre-relations as the transitive closure of the following one-step rewrites, where M and M′ may be any non-empty sets:

D ∪ {( =^{x} y′), (M ∪ {z′, y′} = z)} →_{Δ} D ∪ {(M ∪ {z′} = z)}
D ∪ {({x} = y)} →_{Δ} D{y/x}
D ∪ {(M′ = y), (M ∪ {z′, y} = x)} →_{Δ} D ∪ {(M ∪ {z′} ∪ M′ = x)}

We call the clauses which are explicitly mentioned in the redex the key clauses of the rewrite.

Now it is easy to show that if D →_{Δ} D′, where D is a Γ; Δ-relation of type A, then D′ is a Γ; Δ-relation of type A. We note here that →_{Δ} is clearly terminating since in each one-step rewrite the number of clauses is reduced. Given this result, we now also need to prove the confluence of →_{Δ} over =_{vm}.

Lemma 8.3.4 (Confluence) The rewrite →_{Δ} is confluent over the equality =_{vm} on Rel(𝕆).

Proof First we note that if D_{1} →_{Δ} D_{2} by a one-step Δ-rewrite and D′_{1} =_{vm} D_{1}, then D′_{1} →_{Δ} D′_{2} by a one-step Δ-rewrite of the same kind, and D′_{2} =_{vm} D_{2}. We can see this in the case where the vestigial moves are one-step by noticing that since no linear variables are involved in any Δ-rewrite (as all the variables in the key clauses are occurring intuitionistically), any such rewrite is independent of the vestigial move. It is also trivial to see that the effect of the Δ-rewrite on paths cannot disrupt the vestigial move.

Given this, in order to prove the result it suffices to show that if one relation D has two Δ-rewrites to D_{1} and D_{2} respectively, that there exist Δ-rewrites D_{1} →_{Δ} D′_{1} and D_{2} →_{Δ} D′_{2} such that D′_{1} and D′_{2} are equal via vestigial moves. This is trivial by inspection except in the case where D is

D′ ∪ {( =^{x} y_{1}), ( =^{x′} y_{2}), ({y_{1}, y_{2}} = y)}

198 In this case D_{1} is D′ ∪ {( =^{x} y)} and D_{2} is D′ ∪ {( =^{x′} y)}. Hence we need to show that these two are equal via vestigial moves. Consider an arbitrary binding clause in D′ ∪ {( =^{x} y_{1}), ( =^{x′} y_{2}), ({y_{1}, y_{2}} = y)} having a binding variable z with a path from the child of z to the clause ( =^{x′} y_{2}). Clearly there must also exist a path from the child of z to the clause ( =^{x} y_{2}). Hence any binding clause must contain both discard clauses in its scope or either. Now, by virtue of this any complete path from either of the vestigial clauses must contain all the binding clauses that bind them both, and furthermore in each path they must occur in the same order (or else we could construct a path which omitted one). Take the binding clause which occurs first in an arbitrary complete path from either clause, and call it c. We know further that there is an input to c, say x′′, which equally must be in every complete path. Now we claim that D_{1} and D_{2} are both equal by a one-step vestigial move to D′ ∪ {( =^{x′′} y)}. To show this note that the second part of the requirement is satisfied by virtue of our earlier discussion. The first part, that there exists a path from a child of x or x′ respectively to a clause having x′′ as dependent in both D_{1} and D_{2}, can be shown since in each case, any complete path from the vestigial clause, including the one passing through the child of x or x′, must contain c and x′′. □

Having defined these two equalities, we will refer to the system of relations quotiented by the equality generated by the transitive closure of the rewrite →_{Δ} over the equality =_{vm} as Rel(𝕆, =_{vm,Δ}).

8.4 Terms to Relations

We now map Lin(𝕆) to Rel(𝕆, =_{vm,Δ}) in such a way that when we quotient Lin(𝕆) by the subset of the provable equality judgements constructed using only the ccaxioms, it will be isomorphic to Rel(𝕆, =_{vm,Δ}).

Definition 8.4.1 (The Translation ρ) The translation ρ takes Γ; Δ-terms of type A in Lin(𝕆) to Γ; Δ-relations of type A in Rel(𝕆) as follows, where Γ = y_{1}:R_{1} … y_{r′′}:R_{r′′}:

ρ_{Γ}(x) = {( =^{x} y⃗)}  (where x is not typed in Γ)
ρ_{Γ,x:Q}(x) = {(x′ = F (x)), ( =^{x′} y⃗)}
ρ_{Γ}(let x:Q be v in w) = {(F (x) = z_{v}), ({y′_{1}, y′′_{1}} … {y′_{r′′}, y′′_{r′′}} = y⃗)}

∪ ρ_{y⃗:R⃗}(v){y′/y⃗} ∪ ρ_{y⃗:R⃗,x:Q}(w){y′′/y⃗}

(On O ∈ O_{I}) ρ_{Γ}(op) = {(M_{1} … M_{r′′} = y⃗), (x′ = F (x′′))} ∪

{(x′′ = (; )O((y^{v_{1}} x⃗_{1}; y⃗_{1})D_{1}, …, (y^{v_{r}} x⃗_{r}; y⃗_{r})D_{r})}

(On O ∈ O_{L} − O_{I}) ρ_{Γ}(op′) = (⋃_{i=1...s}E_{i}) ∪ ( ⋃_{j=1...r′} D′_{j}) ∪ ( ⋃_{i′=1...s′} E′_{i′}) ∪ {(M′_{1}, … M′_{r′′} = y⃗)} ∪
{(x′′ = (z′; z′′)O((y^{v_{1}} x⃗_{1}; y⃗_{1})D_{1}, …, (y^{v_{r}} x⃗_{r}; y⃗_{r})D_{r}; (x′_{1}; y′_{1})(z_{w_{1}}), …, (x′_{s}; y′_{s})(z_{w_{s}})))}

where x′, x′′ and all the y′, y′′ and y^{v} for terms v are fresh variables and:

E_{i} = ρ_{Γ,x′_{i}:Q⃗′_{i}}(w_{i}){y^{w_{i}}/y⃗}
D′_{j} = ρ_{Γ}(v′_{j}){y^{v′_{j}}/y⃗}
E′_{i′} = ρ_{Γ}(w′_{i′}){y^{w′_{i′}}/y⃗}
D_{j′} = ρ_{Γ,x⃗_{j′}:Q⃗_{j′}}(v_{j′})
z′ = z_{v′_{1}} … z_{v′_{r′}}
z′′ = z_{w′_{1}} … z_{w′_{s′}}
M_{i} = {y_{1}^{v_{1}}, …, y_{1}^{v_{r}}}
M′_{i} = {y_{1}^{v_{1}}, …, y_{1}^{v_{r}}, y_{1}^{w_{1}}, …, y_{1}^{w_{s}}, y_{1}^{v′_{1}}, …, y_{1}^{v′_{r′}}, y_{1}^{w′_{1}}, …, y_{1}^{w′_{s′}}}
op = O((x⃗_{1}:Q⃗_{1};y⃗_{1}:A⃗_{1})v_{1}, …, (x⃗_{r}:Q⃗_{r}; y⃗_{r}:A⃗_{r})v_{r}; )()
op′ = O((x⃗_{1}:Q⃗_{1};y⃗_{1}:A⃗_{1})v_{1}, …, (x⃗_{r}:Q⃗_{r}; y⃗_{r}:A⃗_{r})v_{r};

(x′_{1}:Q⃗′; y′_{1}:A⃗′)w_{1}, …, (x′_{s}:Q⃗′; y′_{s}:A⃗′)w_{s})(v′_{1}, …, v′_{r′}; w′_{1}, …, w′_{s′})

and where we write z_{v} for the result variable of ρ_{Γ}(v) and similarly for the terms w, v⃗, w⃗, v′ and w′.

We need to show that definition is well-formed, ie that ρ applied to a term is always a relation. We can do this by induction over derivations of terms. Consider the conditions on relations in turn.

Linearity To show that each variable only occurs at most once as an input and at most once as an output or binder, first consider the axiom clauses. The result obviously follows in this case since x and y⃗ must be distinct, and x′ is fresh. Now consider the inductive clauses. In each of these, when we refer inductively to another instance of the translation ρ_{Γ}(v), we only introduce another occurrence of free variables in the translation instance, and in fact we only introduce new occurrences of variables which are free inputs of ρ_{Γ}(v) as outputs and vice versa. Hence this property is satisfied.

Colouring We can show in a very similar way that the translation preserves colouring.

Typing Again, we need only to show firstly that the base clauses of the definition satisfy the typing property, which is obvious since in each case there is only ever one reference to each variable, which has an obvious type, and secondly by showing that in the inductive clauses we only ever refer twice to variables which are free in an instance ρ_{Γ}(v) of the translation, and in this case since all the free variables in the instance of the translation are typed in the typing context Γ; Δ of the term v, we can see that they are assigned the correct types in their other occurrence.

Boxing This clearly follows by induction, since we only ever use instances of the translation in boxed clauses.

Output Consider the base cases. In these, the unique result variable is clear; it is x in the first and x′ in the second. We can then show that the result variables of the two inductive cases are z_{w} and x′′ respectively.

Inputs This condition is easy to establish in the base cases, and in the inductive cases it can be shown by observing that we bind precisely the correct variables of the operator arguments using the binding occurrences of the operator clause.

Binding In order to show this, we consider the only situation in which we introduce a binder, which is in the operator clause of the definition. But we can easily see that we only introduce binders which are bound variables in the ith argument of an operator term. Now we know by induction that in the image of a term under ρ, which is a relation, there must exist a complete path from any child of a free input. Also, because we know that no variable in the image of the argument apart from its free variables is referred to elsewhere in the translation of the operator instance, the only paths from a child of a binder must contain as initial sequences complete paths of the translation of the argument. But we can easily show that every complete path of the translation can only be extended in the translation of the operator term by adding the ith output variable and the operator clause itself, and further that each complete path through the translation of the argument can be extended in this way in the translation of the operator term.

Acyclicity This is again seen by induction; in the base cases is is clear that there is no cyclic path, in the let case if there is no cycle in the inductive instances of the translation then we can show by inspecting the form of the definition that there is no cycle possible in the image, and finally in the operator clause we can do the same thing.

Vestigial This is easy to see by considering the base case, which is the only point at which we add a vestigial. Clearly in that case it is the result variable of the image of the translation. □

Now we can show that the fragment of the provable equality defined by the c-axioms and the rules of Lin(𝕆, 𝔸) is mapped soundly by this translation into relational equality up to =_{Δ}.

Lemma 8.4.2 (Soundness) If two terms are provably equal Γ; Δ ⊢ v = w: A in the fragment of Lin(𝕆, 𝔸) using just the cc axioms and the symmetry, reflexivity, transitivity and congruence rules, then their images ρ_{Γ}(v) and ρ_{Γ}(w) are equal up to =_{vm,Δ} on relations.

Proof We prove this by considering the structure of a derivation of an equality judgement in this fragment of the theory. Since the rewrite is congruent, and we are taking the transitive reflexive closure of it, we have that the equality =_{Δ} is a congruence. Hence we need only check that the cc equalities are soundly mapped to relations. We consider some sample cases.

cc − 1) In this case, the image of the left hand side easily reduces using the free variable condition to the relation

ρ_{Γ,y:Q}(w′){y′/x′}∪ρ_{Γ,x:R}(v){y′′/x′} ∪ ρ_{Γ}(w){y′′′/x′}

∪ {({y′_{1}, y′′′_{1}}, … {y′_{r}, y′′′_{r}} = x′′), ({y′′_{1}, x′′_{1}}, … {y′′_{r}, x′′_{r}} = x′)}

where Γ = x′_{1}:Q′_{1} … x′_{r}:Q′_{r}. But this reduces to

ρ_{Γ,y:Q}(w′){y′/x′} ∪ ρ_{Γ,x:R}(v){y′′/x′} ∪ ρ_{Γ}(w){y′′′/x′}
∪ {({y′′_{1}, y′_{1}, y′′′_{1}}, … {y′′_{r}, y′_{r}, y′′′_{r}} = x′)}

and the image of the right-hand side easily reduces using the free variable condition to the relation

ρ_{Γ,y:Q}(w′){y′/x′} ∪ ρ_{Γ,x:R}(v){y′′/x′} ∪ ρ_{Γ}(w){y′′′/x′}

∪ {({y′′_{1}, y′′′_{1}}, … {y′′_{r}, y′′′_{r}} = x′′), ({y′_{1}, x′′_{1}}, … {y′_{r}, x′′_{r}} = x′)}

which has the same reduct as the left hand side.

cc − 2) This is almost identical to the previous case.

cc − 3) and cc − 4) These cases follow the same principle as that of cc − 1 since we have a union of the sets ρ_{Γ}(v) and ρ_{Γ}(v′_{i}).

cc − 5) This is the crucial case, since it shows that our relational equality handles linear naturality correctly. In order to make the process clearer, we only prove this in the case we there are no intuitionistically natural arguments (since these are peripheral to the equality) and precisely two linearly natural arguments. The more general case is proved using exactly the same techniques. In the restricted case, the equality is as follows:

Γ; Δ ⊢let x′ be v in O(; (x⃗_{1}; y⃗_{1})w_{1}, (x⃗_{2}; y⃗_{2})w_{2})(v′; w′)
= O(; (x⃗_{1}; y⃗_{1})w_{1}, (x⃗_{2}; y⃗_{2})(let x′ be v in w_{2}))(v′; w′)

The image of this easily reduces under the free variable condition to the relation

(∪_{i=1...r′}ρ_{Γ}(v′_{i}){y^{v′_{i}}/y⃗}) ∪ (∪_{j=1...s′}ρ_{Γ}(w′_{j}){y^{w′_{j}}/y⃗}) ∪ ρ_{Γ,x⃗_{1}:Q⃗_{1}}(w_{1}){y^{w_{1}}/y⃗} ∪ ρ_{Γ,x′:Q′,x⃗_{2}:Q⃗_{2}}(w_{2}){y^{w_{2}}/y⃗} ∪ ρ_{Γ}(v){y^{v}/y⃗} ∪ {({y′_{1}, y_{1}^{v}}, …, {y′_{r}, y_{r}^{v}} = y⃗), ({y_{1}^{v′_{1}}, …, y_{1}^{v′_{r′}}, y_{1}^{w′_{1}}, …, y_{1}^{w′_{s′}}, y_{1}^{w_{1}}, y_{1}^{w_{2}}}, …, {y_{r}^{v′_{1}}, …, y_{r}^{v′_{r′}}, y_{r}^{w′_{1}}, …, y_{r}^{w′_{s′}}, y_{r}^{w_{1}}, y_{r}^{w_{2}}} = y′)}

where Γ = y_{1}:R_{1} … y_{r}:R_{r}. But this has reduct

(∪_{i=1...r′}ρ_{Γ}(v′_{i}){y^{v′_{i}}/y⃗}) ∪ (∪_{j=1...s′}ρ_{Γ}(w′_{j}){y^{w′_{j}}/y⃗}) ∪ ρ_{Γ,x⃗_{1}:Q⃗_{1}}(w_{1}){y^{w_{1}}/y⃗} ∪ ρ_{Γ,x′:Q′,x⃗_{2}:Q⃗_{2}}(w_{2}){y^{w_{2}}/y⃗} ∪ ρ_{Γ}(v){y^{v}/y⃗} ∪ {({y_{1}^{v′_{1}}, …, y_{1}^{v′_{r′}}, y_{1}^{w′_{1}}, …, y_{1}^{w′_{s′}}, y_{1}^{w_{1}}, y_{1}^{w_{2}}, y_{1}^{v}}, …,

{y_{r}^{v′_{1}}, …, y_{r}^{v′_{r′}}, y_{r}^{w′_{1}}, …, y_{r}^{w′_{s′}}, y_{r}^{w_{1}}, y_{r}^{w_{2}}, y_{r}^{v}} = y⃗)}

But in a similar way the right-hand side has precisely this reduct. □

8.5 Relations to Terms

Having given the sound translation from terms to relations, we now need to give a translation in the reverse direction. In fact, this is a complex procedure, largely because relations are not inherently a sequential syntax, whereas terms are. Hence the problem of inverting ρ is a version of what is historically known as the sequentialisation problem, first stated for proof-nets. As we already know, there is no one canonical proof derivation associated with a particular relation, although each relation does have an associated equivalence class of derivations (under the fragment of equality we are considering).

It is not clear how to give a direct translation from relations to terms, as we have no direct inductive characterisation of relations, and although we do for prerelations, not all pre-relations can be mapped to terms in a uniform way. Hence, the way we will define the inverse translation is non-standard. First we define a class of intermediates, which are as the name suggests half-way houses between relations and terms, and then we define a rewrite on these which is confluent and terminating up to an equality on these intermediates. Such a rewrite defines a function on intermediates, and we use it in conjunction with a map from relations to intermediates and a map from intermediates to terms to give a function from relations to terms.

First we define intermediates.

Definition 8.5.1 (Intermediates) A Γ′; Δ′-intermediate of type A over a signature 𝕆 is a triple (v, D, (Γ; Δ)) such that v is a Γ; Δ-term of type A, D is a finite set of clauses, (the clause set), ρ_{Γ}(v) ∪ D is a Γ′Δ′ relation of type A, all the variables occuring only as outputs in D are typed in Γ; Δ and there are no clauses in D having dependents variables occuring as outputs in ρ_{γ}(v).

We will write the set of intermediates over a signature 𝕆 as Int(𝕆), ranged over by I …, and identify intermediates up to permutation on the linear and intuitionistic parts of the typing context.

Now we define a rewrite on intermediates, →_{S}:

Definition 8.5.2 (The Sequentialisation Rewrite) We define the one-step sequentialisation rewrite →_{S} on intermediates as follows:

1)  (v, D ∪ {( =^{x} y:Q)}, (Γ; Δ, x:A)) →_{S} (v, D, (Γ, y:Q; Δ, x:A))
2)  (v, D ∪ {(M = x:Q)}, (Γ, M:Q; Δ)) →_{S} (v{x/M}, D, (Γ, x:Q; Δ))
3)  (v, D ∪ {(x = F (y):Q)}, (Γ; Δ, x:Q)) →_{S} (v{y/x}, D, (Γ, y:Q; Δ))
4)  (v, D ∪ {(F (x) = y:Q)}, (Γ, x:Q; Δ)) →_{S} (let x be y in v, D, (Γ; Δ, y:Q))
5a)  (v, D ∪ {op}, (Γ, x:Q; Δ)) →_{S} (v{w/x}, D, (Γ, Γ′′; Δ)
5b) (v, D ∪ D′_{1} ∪ … ∪ D′_{s} ∪ {op′}, (Γ; Δ, y:B′′)) →_{S} (v{w′/y}, D, (Γ, Γ′; Δ, Δ′))

where this last rewrite holds if D has no clauses ( =^{x′′} y′′) for x′′ occurring as an output in D′_{1} … D′_{s}, for all i = 1 … r and all j = 1 … s, we have:

(z_{v_{i}}, D_{i}, ( ; z_{v_{i}}:B_{i})) →_{S} (v_{i}, ∅, (Γ^{v_{i}}, x⃗_{i}:Q⃗_{i}; y⃗_{i}:A⃗_{i}))
(z_{w_{j}}, D′_{j}, ( ; z_{w_{j}}:B′_{j})) →_{S} (w_{j}, ∅, (Γ^{w_{j}}, x′_{j}:Q⃗′_{j}; Δ^{w_{j}}, y′_{j}:A⃗′_{j}))

and given Γ^{v_{i}} = x^{v_{i}}:A⃗^{v_{i}} for i = 1 … r, we abbreviate:

op = (y = (; )O((x^{v_{1}} x⃗_{1}; y⃗_{1})D_{1}, …, (x^{v_{r}} x⃗_{r}; y⃗_{r})D_{r}; ))
op′ = (y = (x′′; y′′)O((x^{v_{1}} x⃗_{1}; y⃗_{1})D_{1}, …, (x^{v_{r}} x⃗_{r}; y⃗_{r})D_{r}; (x′_{1}; y′_{1})z_{w_{1}}, …, (x′_{s}; y′_{s})z_{w_{s}}))
w = O((x⃗_{1}; y⃗_{1})v_{1}, … (x⃗_{r}; y⃗_{r})v_{r}; )(; )
w′ = O((x⃗_{1}; y⃗_{1})v_{1}, … (x⃗_{r}; y⃗_{r})v_{r}; (x′_{1}; y′_{1})w_{1}, … (x′_{s}; y′_{s})w_{s})(x′′; y′′)
Γ′′ = Γ^{v_{1}}, …, Γ^{v_{r}}
Γ′ = Γ^{v_{1}}, …, Γ^{v_{r}}, Γ^{w_{1}} …, Γ^{w_{s}}
Δ′ = Δ, x′′:Q⃗′′, y′′:A⃗′′, Δ^{w_{1}}, …, Δ^{w_{s}}

We specify further that a one-step rewrite of type 3 or 5b removing a variable x from the linear typing context here can only occur when there is no clause ( =^{x} y) for some y which could be rewritten by a rewrite of type 1.

We need to check that this definition is well-formed, ie that the reduct of an intermediate is still an intermediate. This can be seen using simple properties of relations and of the translation ρ.

Intuitively, a sequentialisation rewrite on Γ′′; Δ′′-A-intermediates

(v, D, (Γ; Δ)) →_{S} (v′, D′, (Γ′; Δ′))

moves structure from the relation part of the intermediate to the term part in a sound way. By this we mean that the Γ′′; Δ′′-A-relations ρ_{Γ}(v)∪D and ρ_{Γ′}(v′)∪D′ will be equal up to =_{Δ,vm}.

We can now start to prove the results which we need about this rewrite. First note that each rewrite reduces the clause set by at least one clause. In the case of rewrites 1 − 4 this is the obvious one, in 5a it is op, and in 5b it is op′. We call this clause the active clause in a rewrite. Further, note that any rewrite may only occur if all the output variables of its active clause are present in the typing context. This is not a sufficient condition because of the 1st rewrite and the restriction on rewrite order. We will refer to the rewrites which are given as conditions for the 5bth rewrite as subsidiary rewrites of that main rewrite. Similarly, we will call the intermediates which are rewritten by the subsidiary rewrites the subsidiary intermediates.

Now since ρ_{Γ}(v) ∪ D must be a Γ′; Δ′-relation of type A, we know that no variable in D can occur more than once as an output, and hence we know that it may only be the output variable of one clause. This implies that any two instances of rewrites with a shared output variable must have the same active clause. In the cases of rewrites 2 − 4 this implies that they are the same. We also note that variables are only added to the typing context when they are the inputs of active clauses in rewrites. This is clear except in the case of rewrite 5b, but can be seen by induction even in that case.

We can also easily see that the only way of removing a clause from the clause set is via a rewrite of which it is an active clause, or equivalently via a rewrite which removes its output variables from the typing context. We will say that an intermediate rewrites totally if it rewrites to an intermediate with an empty clause set.

We firstly now show that every intermediate rewrites totally. This will require two lemmas.

Lemma 8.5.3 Under the assumption:

For all D containing fewer than n clauses, if (v, D, (x⃗:Q⃗; y⃗:A⃗)) has a clause c with all its dependents in x⃗y⃗, then it has a sequence of one-step rewrites whose last rewrite has active clause c.

we can show that any intermediate with a clause set having less than n elements rewrites totally.

Proof To show this, we prove that any intermediate with a non-empty clause set has at least one rewrite. Then note that given any intermediate since the clause set must be finite, the result follows. Firstly, take any intermediate with clause set having less than n elements. If it has no elements then we are done. If it has at least one then take one arbitrarily. This clause then must have at least one dependent, and these dependents are either all free output variables, in which case they are all in x⃗y⃗ and by the assumption there exists a rewrite, or there is one dependent of the clause which is the input of another clause c′. Using this clause we can then either find a rewrite or a third clause, and this procedure if continued will give us a rewrite with active clause the ith clause we select, or it will give us an infinite sequence of clauses such that each has as input a dependent of the previous one. However, since the clause set must be finite, such a sequence of clauses must contain a cycle, and it is easy to see that from the clauses and the dependents we can therefore construct a cyclic path in the clause set, which is a contradiction. □

Having proved this conditional result, we now go on to prove the main lemma, which is also the assumption of the conditional in the general case:

Lemma 8.5.4 If (v, D, (x⃗:Q⃗; y⃗:A⃗)) has a clause c with all its dependents in x⃗y⃗, then it has a sequence of one-step rewrites whose last rewrite has active clause c.

Proof We will prove this by induction over the size of the clause set. If the clause set D is empty the lemma is vacuous. If the clause set has n + 1 elements, then assume it has a clause c satisfying the premise of the lemma. There are now three possible cases. Firstly we may have that this clause has the form ( =^{x} y), in which case the assumption implies that the rewrite (of type 1) can proceed. Secondly we may have that this clause is not an operator clause and is not a clause ( =^{x} y), in which case we know that the assumption must allow the rewrite unless there is a possible rewrite of type 1 which may take precedence. Note however that if there are such rewrites, there can only be finitely many of them, and note also that they merely increase the size of the typing context, and therefore do not block the rewrite removing the clause c. Hence we can perform the sequence of rewrites of type 1 followed by the rewrite having active clause c. The third and most complex case is when the clause is an operator clause. In this case the assumption is that the sole output variable of the operator is in x⃗y⃗, but we also need to know that there exists suitable subsidiary intermediates and rewrites on them. However, since such intermediate must have smaller clause sets than D, we know that any subsidiary intermediate of the appropriate form must rewrite totally. Hence it suffices to show that suitable subsidiary intermediates exist. However, since we know that the family of any variable is a relation, we can simply take as subsidiary intermediates (z_{w_{j}}, fam(z_{w_{j}}, D ∪ ρ_{Γ′}(v)), ( ; z_{w_{j}})). These are disjoint since we know that no clause can be in the families of two distinct variables unless one is in the family of the other, and this is clearly impossible since the active clause of the operator rewrite cannot be in any family of the z_{w_{j}}. Further, they are all subsets of D since any complete path in D ∪ ρ_{Γ′}(v) from a clause in ρ_{Γ′}(v) cannot contain z_{w_{j}} or it would induce a cycle. Hence we have appropriate subsidiary intermediates and the rewrite can occur, and so the result follows by induction. □

Now using our previous lemma, we can see that we have the consequence:

Proposition 8.5.5 Any intermediate rewrites totally.

This is clear since we know that for any intermediate with a clause set having n elements, it follows from the result we have just proved, for intermediates with clause sets of n or fewer elements. However, we have just proved this last result for all n, and hence the proposition holds.

We now proceed to prove confluence of →_{S} up to the cc-fragment of provable equality on the term part of intermediates.

Lemma 8.5.6 (Relative Confluence) If an intermediate I has two rewrites, I →_{S} I_{1} and I →_{S} I_{2}, then I_{1} and I_{2} respectively have rewrites I_{1} →_{S} I′_{1} and I_{2} → I′_{2} such that I′_{1} and I′_{2} differ only on their term part, and if I′_{1} has term part v_{1} and I′_{2} has term part v_{2}, these two terms are provably equal in the fragment of the equality theory having only the cc axioms and the rules.

Proof We prove this by considering all possible pairs of one-step rewrites in turn. Note that some combinations are prohibited by the restriction on the order of rewrites.

1 and 1 If we have two different rewrites of type 1, then clearly the resultant intermediate forms are the same up to exchange on the intuitionistic part of the typing context, and hence we have the result.

Any choice of two from {2, 3, 5a} In these cases the result follows again by exchange on the typing context and by commutation of independent substitutions.

2 and 4, 3 and 4 In these cases the result follows by exchange and since the substitutions go through the let -construct.

4 and 4 In this case the result follows by the commuting conversion which allows two let -constructs to commute under appropriate free-variable restrictions.

5b and 2, 5b and 3, 5b and 4 Say that the rewrite 2, 3 or 4 is I →_{S} I_{1}, called rewrite a, and that the other rewrite I →_{S} I_{2} of type 5b is called rewrite b. Now, we know that the active clause of rewrite a is the only clause containing any output variables of the clause, because any other occurrence in D would have to be an input occurrence, which is not possible by our earlier discussion. Now if we consider the subsidiary rewrites of rewrite b, we can see that the output variable of the active clause of the rewrite a can never be introduced into the typing context, and hence the rewrite a can never take place as part of a subsidiary rewrite of rewrite b. This then means that after rewrite b, rewrite a is still possible since its output variable is still in the typing context and the clause is still in the clause set. On the other hand, if we first do rewrite a, clearly we can still do rewrite b since the active clause of rewrite a was not involved, and we have merely altered the typing context in a way which will not affect rewrite b. Having established that the rewrites can be done in either order, the equality of the resultant intermediate forms is given by the commutativity of substitution.

5b and 5b This is the most complex case, since there are two subcases. The first is the case in which the two rewrites of type 5b have different active clauses, and the second is the case in which the active clauses are the same but the sets D′_{i} are different. First consider the case in which the active clauses are different. In this case we first note that no clause in one of the sets D_{i} for one rewrite can be in any of the corresponding set for the other rewrite. This is because any two such sets are sub-relations of the relation D ∪ ρ_{Γ}(v), and hence by lemma 8.2.14 any maximal path in D ∪ ρ_{Γ}(v) from such a shared clause must pass through one clause having dependent the result variable of the first subrelation and another having dependent the result variable of the second subrelation. If these clauses are the same, then both active clauses, which are the children of the respective result variables, are the same, which is a contradiction. Otherwise, we must have that there is a path from the clause having dependent the result variable of (say) the first subrelation to that having dependent the result variable of the second subrelation. But this then implies that there exists a path from the child of the result variable of the first subrelation to the child of the result variable of the second relation, or in other words a path from the active clause of the first rewrite to that of the second rewrite. This then implies that the first rewrite cannot occur until the second has, which is again a contradiction. Thus it follows that the two rewrites are independent as they do not affect any of the same clauses or variables, and so they can be performed in either order. The resulting intermediates in each case are the same, by virtue of the commutativity of substitution. Now consider the second case, in which the active clauses of the two rewrites are the same. In order for the two rewrites to be distinct, it must be the case that one of the sets D′_{j} differs from its counterpart E′_{j}. Note that for this to be the case, at least one of the sets must contain a clause having dependent z_{w_{j}} or else both sets would be empty and hence equal. Now we can see that both the sets D′_{j} and E′_{j} must be subsets of fam(z_{w_{j}}) since if not, we would have that some clause having a complete path from itself not including z_{w_{j}} would be rewritten in the subsidiary rewrite of the 5b-rewrite. This is impossible since we know that for a rewrite to occur all its dependents must be in the typing context, and inductively this is only possible for variables whose children are in the family of the initial variable. Given this and the fact that since fam(z_{w_{j}}), it suffices to show that the two rewrites using D′_{j} and using fam(z_{w_{j}}) respectively have a common reduct. This follows by observations on substitution, however, since any clause which is not in D′_{j} but in fam(z_{w_{j}}) must be rewriteable after the 5b-rewrite using D′_{j} because we simply add the typing context present after the subsidiary rewrite to the main typing context. □

Now we can define a function based on the rewrite →_{S}. Note that for any Γ; Δrelation D of type A with result variable x, (x, D, ( ; x: A)) is an intermediate and hence rewrites totally.

Definition 8.5.7 (The Translation σ) Given a Γ; Δ-relation D such that

(x, D, ( ; x:A)) →_{S} (v, ∅, Γ′; Δ′)

define σ_{Γ;Δ}(D) = v.

This is a total function by the earlier remarks. Further, we can easily show that v is a Γ; Δ-term of type A by considering the structure of the sequentialisation rewrite.

We now need to show that this translation is sound with respect to the equality =_{vm,Δ}. In order to do this we will first prove a lemma:

Lemma 8.5.8 Given an intermediate (v, D ∪ D′, (Γ, x⃗: Q⃗; y⃗: A⃗, Δ)) which has a one-step sequentialisation rewrite to another intermediate (f(v), D, (Γ, x′:Q⃗′; y′:A⃗′, Δ)), we have for any other intermediate (w, E ∪ D′, (Γ′, x⃗:Q⃗; y⃗:A⃗, Δ′)) a rewrite:

(w, E ∪ D′, (Γ′, x⃗:Q⃗; y⃗:A⃗, Δ′)) →_{S} (f(w), E, (Γ′, x′:Q⃗′; y′:A⃗′, Δ′))

if E has no clause with a vestigial occurrence of any variable in y⃗, where f is a function constructed from substitutions of terms for variables and the primitive function which takes v to let x be y in v.

Proof We can prove this by simple consideration of the form of the one-step rewrite. In the case of the first to 5ath rewrite, the set D′ must consist of the single clause which is the active clause of the relevant rewrite. Further, the typing sequences x⃗: Q⃗ and y⃗: A⃗ must be precisely the output variables of the active clause. Now given that the intermediate (w, E ∪ D′, (Γ′, x⃗: Q⃗; y⃗ : A⃗, Δ′)) also has the active clause and the output variables of the active clause in the typing context, the only reason the required rewrite might not take place is because of the restriction that a rewrite of type 1 must take precedence over a rewrite of type 3 or 5a on the same output variable. But since the y⃗ are the linear output variables of the active clause, the condition on the lemma makes sure this cannot happen. □

Lemma 8.5.9 (Soundness) If two Γ; Δ-relations of type A, D_{1} and D_{2} are equal under the equality =_{vm,Δ}, then Γ; Δ ⊢ σ_{Γ;Δ}(D_{1}) = σ_{Γ;Δ}(D_{2}):A using just the cc-fragment of the provable equality.

Proof In order to show this there are two proof obligations, firstly to show that the rewrite →_{S} is mapped to a provable equality and secondly to show that the equality =_{vm} is preserved by σ_{Γ;Δ}.

For the first, taking each rewrite in turn, we first take the starting intermediate of a relation, (x, D, (Γ; Δ)), and rewrite until the first dependent of a key clause of the rewrite appears in the typing context. Now the result of rewriting the redex and the result of rewriting the reduct at this point are the same, modulo the α-conversion in one case. Therefore the result holds in this case.

The second is much more complex. Imagine that two Γ; Δ-relations of type A, D ∪ { =^{x} y)} and D ∪ {( =^{x′} y)} are equal via a one-step vestigial move. Without loss of generality, suppose that the path that exists by the first clause of the definition of vestigial move is from the child of x to a clause having dependent x′. Now consider the Γ; Δ-intermediates (z, D ∪ { =^{x} y)}, ( ; z:A)) and (z, D ∪ {( =^{x′} y)}, ( ; z : A)) of type A, where z is the result variable of both the relations. Taking the second of these, we first claim that there must exist a sequence of rewrites not containing any rewrite with an active clause having output variable x and not containing any rewrite with active clause ( =^{x′} y) as follows:

(z, D ∪ {( =^{x′} y)}, ( ; z:A)) →_{S}^{∗} (f(z), D′ ∪ {( =^{x′} y)}, (Γ′; x′:A′, Δ′))

We first note that since the vestigial clause ( =^{x′} y) cannot rewrite unless the variable x′ is present in the typing context, any rewrite sequence to an intermediate with empty clause set must pass through an intermediate with the variable x′ present in the typing context and the vestigial clause ( =^{x′} y) in the clause set.

We can now prove by induction over the size of the part of the clause set D of the intermediate that given a path from a child of x to a clause having x′ as a dependent, there must either be a rewrite of the intermediate not having active clause with output x, or the typing context contains x′.

Firstly, if the set D is empty, then since any intermediate with non-empty clause set has a rewrite and the only possible rewrite is the one having active clause the only clause in the clause set ( =^{x′} y), and this means that x′ must be in the typing context, or the rewrite would not be possible.

Secondly, if the set D has r + 1 elements, it suffices to find one rewrite which satisfies the criteria, as then the resulting intermediate must have a smaller set D. Now since there exists a rewrite by the termination of →_{S}, assume that this rewrite has active clause with output x. Then x must occur in the typing context of the intermediate. But we can see from this that if the intermediate is (v, D∪{( =^{x′} y)}, (Γ; x: B, Δ′)) every path from x in ρ_{Γ′;x:B,Δ′}(v)∪D∪( =^{x′} y)} must be entirely within ρ_{Γ′;x:B,Δ′}(v) and hence cannot contain x′, which is a contradiction.

But now we need only check the vestigial condition of the previous lemma to see that by repeated applications of it, we have that there exist rewrites:

(z, D ∪ { =^{x} y)}, ( ; z:A)) →_{S}^{∗} (f(z), D′ ∪ { =^{x} y)}, (Γ′; x′:A′, Δ′))

The vestigiality condition is guaranteed by the existence of the rewrites on the intermediate (z, D ∪ { =^{x′} y)}, ( ; z:A)) for all variables except x. So we need to check that at no point in the sequence of rewrites does a rewrite occur which has an active clause with the output variable x. But we already know this.

Now we have a one-step rewrite:

(f(z), D′ ∪ {( =^{x′} y)}, (Γ′; x′:A′, Δ′)) → (f(z), D′, (Γ′; x′:A′, Δ′))

Also, we have a sequence of rewrites

(f(z), D′, (Γ′; x′:A′, Δ′)) →_{S} (f′(f(x)), D′′, (Γ′′; x:B, Δ′′))

and hence by our previous lemma we also have a sequence of rewrites:

(f(z), D′ ∪ { =^{x} y)}, (Γ′; x′:A′, Δ′)) →_{S} (f′(f(x)), D′′ ∪ { =^{x} y)}, (Γ′′; x:B, Δ′′))

The vestigial condition on that lemma is satisfied obviously. Now we have a rewrite

(f′(f(x)), D′′ ∪ { =^{x} y)}, (Γ′′; x:B, Δ′′)) →_{S} (f′(f(x)), D′′, (Γ′′; x:B, Δ′′))

and therefore we have that both (z, D ∪ { =^{x} y)}, ( ; z:A)) and (z, D ∪ {( =^{x′} y)}, ( ; z: A)) rewrite to (f′(f(x)), D′′, (Γ′′; x: B, Δ′′)) so that they must rewrite by confluence to the same intermediate with empty clause set, which then implies that σ is sound with respect to vestigial moves. □

We can now prove that σ_{Γ;Δ}(ρ_{Γ}(v)) = v by straightforward calculation on each term construct.

Lemma 8.5.10 (Inversion) Given a Γ; Δ-term v of type A, σ_{Γ;Δ}(ρ_{Γ}(v)) = v.

This then shows by standard arguments that:

Lemma 8.5.11 Γ; Δ ⊢ v = w : A using the cc-fragment of provable equality if and only if ρ_{Γ}(v) =_{Δ} ρ_{Γ}(w)

We can go further and show that relations under the equality =_{vm,Δ} are exactly equivalent to terms quotiented by the provable cc-equality. First we prove a lemma:

Lemma 8.5.12 (Invariant) Given a Γ; Δ-intermediate of type A, (v, D, (Γ′; Δ′)), such that (v, D, (Γ′; Δ′)) →_{S} (w, E, (Γ′′; Δ′′)), we have that:

ρ_{Γ′;Δ′}(v) ∪ D =_{vm,Δ} ρ_{Γ′′;Δ′′}(w) ∪ E

as Γ; Δ-relations of type A.

This is easily proved by considering each sequentialisation rewrite in turn. This then allows us to prove the following result:

Lemma 8.5.13 (Inversion II) Given a Γ; Δ-relation D of type A, ρ_{Γ;Δ}(σ_{Γ;Δ}(D)) =_{vm,Δ} D.

Proof First note that we have a rewrite:

(x, D, ( ; x:A)) →_{S} (σ_{Γ;Δ}(D), ∅, (Γ; Δ))

where D has the result variable x in the context Γ; Δ. But then by the invariant lemma, we have that

ρ _{;x:A}(x) ∪ D =_{vm,Δ} ρ_{Γ;Δ}(σ_{Γ;Δ}(D)) ∪ ∅

which immediately gives us the required result. □

Hence we have that Rel(𝕆, =_{vm,Δ}) is isomorphism to Lin(𝕆) quotiented by the provable equality built from the cc axioms and the rules. In the next chapter we consider rewrites on relations which will correspond to the F − β_{V} η equality judgements on Lin(𝕆)-terms.

Normal Forms and Decidability

In this chapter we continue the study of relations as normal forms for linear type-theories, showing that we can extend the results proved in the previous chapter to allow us to decide the linear typing system with F − β_{V} η-axioms and further to decide the system with output-naturality equalities ONat(𝕆, O) for some signature 𝕆 having an output-parameterised set of operators O. However, to do so will involve some delicate proofs.

9.1 Proof-Nets

As in the previous chapter, we motivate our definitions and proofs using proofnets, in which we can raise all the problems we will face in a more understandable way.

In modelling not only the provable equality built over Lin(𝕆) from the commuting conversions, but the full provable equality of Lin(𝕆, 𝔸), we need to consider the F − β_{V} and F − η axiomatic equalities. However, there are three issues which are immediately raised.

Firstly, we have the issue of orientation of the rewrites that we shall give. It is by no means certain that the conventional reductive rewrite orientation is the correct one in general, and in fact we will be using a rewrite in which the β_{v}-rewrites are taken as reductions and the η-rewrites as expansions (see Ghani’s thesis [Gha95]). Secondly, the F −β_{V} -equality contains within its right-hand side an intuitionistic substitution of an intuitionistic term for a variable, and in order for our relational system to model this, we will need to augment the rewrites of the replicators to copy intuitionistic operators, amongst other administration. The techniques we will use to do this are based in a number of proof–net-like systems, notably those inherited from nets for the λ-calculus.

Thirdly, and perhaps most substantially, we need to take account of the output-naturality equalities which hold of the ⊗^{L} and I^{L} operators. In order to do this we adopt a different approach, which is based on the observation that in modelling the linear naturality of operators in proof-nets, we simply leave wires which are not bound by the operator. The intuition behind output-natural operators is that the output wire (or result) is not bound by the operator application, and so our new proof nets proceed by not binding them; for example, a representation of the DILL(ℂ)-term let x ⊗ y be t in u which does not bind the result wire is seen in figure 9.1.

Figure 9.1: Proof-Nets for Output Naturality

Given this approach, output-naturality equalities map to identities on proofnets, which is one of their major virtues. However, there is a slight complication in the treatment of operators with no binding behaviour, as for example in I^{L}. As explained in section 8.1 on page 183, such a non-binding operator requires a vestigial, since otherwise too many proof-nets would be identified.

9.2 The F -Equalities

We now introduce an additional rewrite on relations, the F -rewrite, which models the effect of the F -equalities of Lin(𝕆, 𝔸). We proceed to extend the result of the previous section to show that the derivable equality judgement of Lin(𝕆, ∅) soundly and completely maps to relations under the equality =_{vmΔF} generated in the obvious way from the rewrites →_{F} and →_{Δ} and the equality =_{vm}. First we make a definition:

Definition 9.2.1 (Resolved Variable) Say a variable x of type Q ∈ M_{I} is resolved in the relation D if it is linear and is not the input of a clause (F (z) = x) or the output of a clause (x = F (z)). Conversely, if a variable is linear and is not resolved, call it unresolved.

We must define the concept of common variable. A common variable for a clause in a relation is a linear variable which occurs in any complete path from the clause. Each clause has at least one common variable unless it has dependent the result variable, because the result variable will be a common variable. Further, for any clause having an input which occurs as a vestigial elsewhere in the relation, we can always find a common variable which is a valid vestigial move away. This holds simply by taking the common variable which occurs first in each complete path (it must always be the same one since if not a cycle would occur).

Now we define the rewrite on relations which we will use:

Definition 9.2.2 (The Rewrite →_{F}) Define the one-step rewrite →_{F} on relations using the following rules, where the F − η-rule is only permitted on unresolved variables x:

D ∪ {(F (x′) = y), (y = F (x))} →_{F −β} D{x/x′, z/y}
D{x/x′} →_{F −η} D ∪ {(F (y) = x), (x′ = F (y))}

where in the second of these, y is fresh, and in the first, z is the first common variable in every complete path from (F (x′) = y) in the relation D ∪ {(F (x′) = y), (y = F (x))}.

Now we need to extend the rewrite Δ in order to deal with intuitionistic operators. We will overload notation to refer to the extended rewrite also as →_{Δ}. We now introduce some substitution notation; for any relation D let Dσ(1) be D with all its variables replaced by fresh variables, such that if i ≠ j then Dσ(i) and Dσ(j) share no variables. We extend this to intuitionistic operator clauses, meaning that each relation within the operator instance has the substitution applied to it, with corresponding α-conversion for the binding instances.

Definition 9.2.3 (The Rewrite →_{Δ}) Let the one-step rewrite →_{Δ} be given by the following cases, extending the rewrite →_{Δ} of the previous chapter:

D ∪ {( =^{x} y), (M ∪ {z′} ∪ {y′} = z)} →_{Δ−1} D ∪ {(M ∪ {z′} = z)}
D ∪ {({x} = y)} →_{Δ−2} D{y/x}
D ∪ {(M′ = y), (M ∪ {z′} ∪ {y} = x)} →_{Δ−3} D ∪ {(M ∪ {z′} ∪ M′ = x)}
D ∪ {(z = (x⃗; y⃗)O(… (x′; y′)D′ ∪ {(M = y′′)}(x′′) …; …))} →_{Δ−4}

D ∪ {(z = (x⃗; y⃗)O(… (x′; y′)D′(x′′) …; …)), (M = y′′)}

D ∪ {(z = (x⃗; y⃗)O(… (x′; y′)D′(x′′) …; …)), (z′ = (; )O′(…; ))} →_{Δ−5}

D ∪ {(z = (x⃗; y⃗)O(… (x′; y′)D′ ∪ {(z′ = (; )O(…; ))}(x′′) …; …))} where O′ ∈ O_{I} and z′ occurs as an input only in D′

D ∪ {(M = z), (z = (; )O′(…; ))} →_{Δ−6}

D ∪ {(z′_{1} = (; )O′(…; )σ(1)), …, (z′_{r} = (; )O′(…; )σ(n)), (M′_{1} … M′_{r} = x⃗)}

where in this last rewrite, the free intuitionistic variables occurring as inputs in (; )O′(…; ) are x⃗ , we have M′_{i} = x⃗σ(i) and M = {z′_{1}, …, z′_{r}}.

We will now define the equality =_{vmΔF} in the obvious way as the reflexive transitive closure of the union of the one-step rewrites →_{Δ} and →_{F} over the equality =_{vm}.

We can now start to extend the results of the previous chapter to these new rewrites.

9.3 Deciding the Equality

Confluence

It is straightforward to check confluence for our rewrite by considering all possible critical pairs.

Lemma 9.3.1 (Confluence) The transitive closure →_{ΔF} of the union of the rewrites →_{F} and →_{Δ} is confluent over the equality =_{vm}.

Proof As before, the key to the proof is the locality of the rewrites. However, since we now have rewrites which manipulate operator clauses, we have to also allow for the possibility that redexes may occur inside the relations which are in the operator clause. We consider pairs of rewrites case by case.

Any of {Δ − 1, 2, 3} with F − β In this case we can clearly see that there is no possibility of these two rewrites sharing a clause. Hence the rewrites are independent.

Any of {Δ − 1, 2, 3} with F − η In this case we can see that an F − η-rewrite can never occur on any variable in a Δ − 1, 2, 3-redex, since F − η can only occur on linear variables and all those occurring in the rewrites Δ − 1, 2, 3 are intuitionistic. Hence the rewrites are independent.

Either of Δ − 4 or Δ − 5 with either of F − β or F − η In this case we can see that the only interaction between these two redexes can be if the F -redex occurs in an operator instance occurring in the Δ-redex. But no F -clause or linear variable in such an operator instance is affected, and so the rewrites are independent.

The Δ − 6-rewrite and either the F − β or F − η-rewrite In both these cases we can see that the F -redex may be copied any number of times (including none, when it is deleted). The result of doing the F -rewrite and then the Δ − 6 rewrite is the same as that of doing the Δ − 6-rewrite and then some number of copies of the F -rewrite.

Any combination of two from {Δ − 1, 2, 3} This case was dealt with in the previous proof.

Δ − 4 and itself In this case clearly the redexes are non-overlapping unless the two duplicators are leaving the same operator construct, in which case they are still independent.

Δ − 4 and any of {Δ − 1, 2, 3} This case is easily seen, with the rewrites only interacting if the duplicator which leaves the operator construct in the Δ−4rewrite is also involved in the Δ − 1, 2, 3-rewrite. If the rewrites do interact, the reducts will themselves have a common reduct using more instances of the same rewrites.

Δ − 6 and and any of {Δ − 1, 2, 3} This is very similar to the previous case, we the added possibility that the Δ − 1, 2, 3-rewrite might be duplicated.

Δ − 6 and Δ − 5 These rewrites interact only if the copied operator construct is the operator construct which is the active one in the Δ − 5 rewrite, or in the case where the Δ − 6-rewrite copies the Δ − 5 redex. In the second case the two reducts can easily be shown to have a common reduct by repeated Δ−5 rewrites, and in the first case another instance of Δ−6 and a number of instances of Δ − 5 are needed.

Δ − 6 and F − βη These rewrites can only interact if the F − βη-redex occurs in the operator construct duplicated by the Δ−6 rewrite, and we can easily rewrite the reducts to a common form using a number of F − βη-rewrites and aΔ − 6-rewrite.

Any two of F − βη These rewrites may share a clause, but if they do the result of performing either rewrite first is the same form.

Δ − 5 and Δ − 1, 2, 3 These rewrites must be independent, as they share no clause and no rewrite in the body of the operator clauses is affected by the Δ − 5 rewrite.

Δ − 5 and Δ − 4 In this case the rewrites may interact in two interesting ways, one for each operator construct in the Δ − 5 rewrite. In the case where the Δ − 4-rewrite places a replicator between the two operator clauses of the Δ − 5rewrite, the two reducts have a common reduct using a Δ − 6-rewrite and possibly several Δ − 5-rewrites. In the other case, the required rewrites to form a common reduct are simply two Δ − 5 rewrites.

Δ − 5 and Δ − 5 In this case, the only interesting interaction between the two instances of the rewrite can be resolved simply using more instances of Δ−5.

Normalisation

Having established the confluence of this rewrite, we need to show that it is normalising, which is to say that every one-step rewrite sequence is finite. Although this is not as hard as it is for the higher-order case, because of the presence of the expansionary rewrites F − η and Δ − 6 it is not trivial. However, it can be shown by defining a measure on terms which we will now present.

First consider the action of our rewrites on an arbitrary replicator in a relation. In each of the rewrites Δ−1, 2, 3 and Δ−6 the tendency is for a replicator to move further away from the result variable of a relation, or to disappear altogether. The problem is that in the case of the Δ−6-rewrite, this is accomplished at the cost of increasing the number of clauses, which in the previous chapter was the measure which ensured termination. This is the key to the measure we will define, but there are complexities due to the Δ − 4 and Δ − 5 rewrites.

In the case of the F − η-rewrite, we notice that the rewrite cannot occur unless the variable is unresolved. Since all the variables introduced by a F − ηrewrite are resolved, we can make such rewrites reduce the measure by weighting each unresolved variable more heavily than the subnet which replaces it after the rewrite.

First we introduce some theory. We will be using polynomials of a single variable, which we will write p(x), q(x) … for the variable x; polynomials will only be used in this section, so this slight overloading of notation will be transparent. A general polynomial in a single variable has the form ∑_{i=−r...s} c_{i}x^{i} where the c_{i} are (possibly negative) integer coefficients. We can then define addition and subtraction (and the product of two polynomials) in the obvious way We can also define an ordering on polynomials of a single variable by saying p(x) > q(x) iff the coefficient of the largest power of x in p(x) − q(x) is strictly positive.

We now need to make some definitions formalising our earlier discussion of the measure. Recall that a path from c to c′ in a relation D is a pair of sequences (c_{1} … c_{r}, x_{1} … x_{r−1}) such that c_{1} = c, c_{r} = c′ and _{i} connects c_{i} and c_{i+1} for all i = 1 … r − 1. Now say that a total path in a relation D is a path which cannot be extended by prepending or appending a pair (c, x) to it. Intuitively, the total paths go from free inputs or inputs bound by an operator clause to a clause having dependent the result variable of either the relation D, or some relation D′ in an operator clause contained in D. Write the set of all total paths in a relation D as TPath(D), and let ϕ … range over paths for this chapter only. Clearly there exists a total path containing any clause contained in D.

Definition 9.3.2 (Complexity I) Given a path ϕ, define the first complexity of it, written Com^{1}(ϕ) inductively:

Com^{1}(c, ε) = 1

Com^{1}(c⃗c′, x⃗x′) = \begin{cases}2Com^{1}(c⃗, x⃗) & if c′ is a replicator clause and x′ is resolved \\ 2Com^{1}(c⃗, x⃗) + 4 & if c′ is a replicator clause and x′ is unresolved \\ Com^{1}(c⃗, x⃗) + 1 & if c′ is not a replicator clause \\ & and x′ is resolved \\ Com^{1}(c⃗, x⃗) + 4 & if c′ is not a replicator clause \\ & and x′ is unresolved \end{cases}

Define the first complexity polynomial as follows:

Definition 9.3.3 (First Complexity Polynomial) The first complexity polynomial for a relation D is given:

p^{1C}(D)(x) = ∑_{ϕ∈TPath(D)} x^{Com^{1}(ϕ)}

Now the intuition is that all our rewrites will at worst replace one path of a certain complexity with many of lower complexity, but because in the polynomial ordering one x^{c} of higher coefficient outweighs many x^{c′} of lower coefficient, the complexity polynomial will still strictly decrease. We can now show that the one-step Δ − 1, 2, 3, 6-rewrites and one-step F − βη-rewrites decrease the first complexity polynomial of a relation.

Lemma 9.3.4 If D → D′ by a one-step Δ − 1, 2, 3, 6-rewrite or a one-step F − βη-rewrite, then p^{1C}(D)(x) > p^{1C}(D′)(x).

Proof We will refer to the form of the rewrites given on page 217. Consider the rewrites separately:

Δ − 1 In this case, any total path in D′ yields a total path in D simply by replacing any occurrence of the new replicator clause added by the rewrite with the replicator clause in D which has as output the required variables. Further, the first complexity of the generated path in D is the same as that of the original path in D′, since we have just replaced a replicator clause with another one. We can see easily that any two distinct total paths in D′ give rise to distinct total paths in D via this procedure. Moreover, there exists a total path in D which is not a total path in D′, namely that which passes through the replicator clause deleted by the rewrite. Call this total path ϕ. Now we know that the first complexity polynomial of D must have coefficients greater than or equal to those of the first complexity polynomial of D′. But the coefficient of x^{Com^{1}(ϕ)} must be strictly greater in the first complexity polynomial of D, so that this polynomial must be strictly greater than the first complexity polynomial of D′.

Δ_{2} In this case we can see that any total path of D′ arises from a total path of D either identically, or by replacing the subsequence of the variable sequence yx with y and removing the replicator clause in the clause sequence. This procedure obviously yields total paths of less than or equal first complexity in general, and in the case where the replicator clause is removed yields total paths of strictly lesser first complexity. Note that there exists at least one total path which has strictly lesser first complexity by this argument since at least one total path passes through the replicator clause. This correspondence gives a one-to-one mapping of total paths and hence since it is strictly reducing on the first complexity of at least one total path, the first complexity polynomial of the reduct D′ must be strictly less than that of D.

Δ − 3 This argument proceeds similarly to the previous one simply by constructing the obvious correspondence between total paths, which turns out to be strictly reducing of first complexity on total paths passing through the replicator clause which is deleted.

Δ − 6 This is the key case. It is easy to see that given any total path in D which is not a path of D′, we can give a total path of D′ which has strictly lesser first complexity. Further, although there are many such candidate total paths, these all have strictly lesser first complexity, and the only total paths of D′ which are not paths of D are these paths of lesser first complexity. Consider the total path ϕ that we know must exist in D passing through the replicator, and which is therefore not a path of D′. The first complexity polynomial of D has strictly greater x^{Com^{1}(ϕ)} coefficient than the first complexity polynomial of D′, and although by our discussion it may have strictly lesser coefficients of smaller powers of x, this is still enough to make the first complexity polynomial of D strictly greater than that of D′.

F − β In this case, there is a straightforward correspondence between total paths of D and D′, which strictly reduces the first complexity of any path that passes through either of the clauses which are deleted. Hence by standard reasoning the first complexity polynomial of D is strictly greater than that of D′.

F − η This is a more complicated case since the obvious correspondence between paths increases the length of paths. However, it can be shown that because the paths contain one fewer unresolved variable, the first complexity of paths is strictly reduced by going from D to D′ and hence the first complexity polynomial of D is strictly greater than that of D′. □

This forms the major part of our proof. We can proceed to consider the only two remaining rewrites, the Δ − 4 and Δ − 5-rewrites. First we note that the first-complexity polynomial is preserved by these one-step rewrites, by virtue of the lemma:

Lemma 9.3.5 If D → D′ by a one-step Δ − 4 or Δ − 5-rewrite, there is a first-complexity-preserving correspondence between the total paths of D and D′.

Proof The first-complexity-preserving correspondence is the identity. □

Let Op(D) be the set of operator clauses contained in D, and define the nesting level of a clause as follows:

Definition 9.3.6 (Nesting Level) Given a clause c ∈ D, define the nesting level of c in D, written Nest(D)(c), inductively as follows:

Nest(D)(c) = 0 if c ∈ D
Nest(D)(c) = Nest(D′)(c) + 1

if (y = (…)O(…, , (x′_{1}; x′_{2})D(x′′), …; …)) ∈ D and c is contained in D′

Now we can define the nesting polynomial.

Definition 9.3.7 (Nesting Polynomial) Define the nesting polynomial, of a relation D, written p^{N}(D)(x), as follows:

p^{N}(D)(x) = ∑_{c∈Op(D)} x^{−Nest(D)(c)}

Clearly, we can now prove:

Lemma 9.3.8 If D → D′ by a one-step Δ − 5-rewrite, then p^{N}(D)(x) > p^{N}(D′)(x).

Proof This is quite easy to see since the rewrite reduces by one the coefficient of x^{−Nest(D)(c)} where c is the intuitionistic operator clause which is moved inside the other operator clause in the rewrite, and no other operator clause of lesser nesting (which means higher power of x in the nesting polynomial) is affected.□

Also, we can quite easily see that since the one-step Δ − 4-rewrite does not affect the nesting level of any operator clause, it must preserve the nesting polynomial. Hence, we have almost completed the details of normalisation. Finally, let Rep(D) be the set of replicator clauses occurring in the relation D. We have;

Lemma 9.3.9 If D → D′ by a one-step Δ − 4 rewrite, then

∑_{c∈Rep(D)} Nest(D)(c) > ∑_{c∈Rep(D′)} Nest(D′)(c)

Proof Again, this is easily seen, since the rewrite precisely decreases the nesting level of the replicator clause involved by one, and leaves all other replicators as they are. □

We can now put all these pieces together to prove:

Lemma 9.3.10 (Normalisation) The transitive closure →_{ΔF} of the union of the rewrites →_{F} and →_{Δ} over the equality =_{vm} is normalising.

Proof Consider the set of triples (p(x), q(x), r) consisting of two polynomials and an integer, ordered by the lexicographic ordering inherited from the polynomial ordering and the integer ordering. We claim that the measure

(p^{1C}(D)(x), p^{N}(D)(x), ∑_{c∈Rep(D)} Nest(D)(c))

forces the →_{Δ−F} -rewrite to terminate.

In order to show this we need to show that the measure is bounded below in the ordering for all relations, and that every one-step rewrite strictly reduces the measure according to the given ordering. We can see firstly that the measure is bounded below by the element (0, 0, 0) of the measure set, where the polynomial 0 is that polynomial having all zero coefficients. This is the case since clearly the two polynomials must have nonnegative coefficients which are just the sizes of sets in each case (the set of total paths of complexity n and the set of operator clauses of nesting level n), and the nesting level of any clause must be nonnegative.

Secondly, to show that the measure is reduced by each one-step rewrite note that the Δ − 1, 2, 3 and F − βη-rewrites strictly reduce the first measure by lemma 9.3.4, that the Δ − 5 one-step rewrite preserves the first measure and reduces the second by lemma 9.3.8, hence reducing the measure in the lexicographic order, and finally that the Δ − 4 one-step rewrite preserves the first-complexity polynomial and the nesting polynomial, and reduces the final component of the triple by lemma 9.3.9. Hence there can only be a finite number of rewrites in any sequence of one-step Δ − 1, 2, 3, 4, 5, 6, −F − βη-rewrites. □

Hence we have that:

Theorem 8 (Decidability) The equality =_{vmΔF} is decidable.

Proof This is easy to see since any rewrite sequence on any two relations will terminate, and by confluence we must have that if the reducts are equal, then they are equal by =_{vm}, which is also decidable. □

Relations and Terms

Now we must show that the extended rewrite we have defined over terms is soundly mapped to and from term equality. We start by considering the translation ρ.

First we need a lemma on intuitionistic substitution.

Lemma 9.3.11 (Intuitionistic Substitution) Given an intuitionistic term Γ; ⊢ v:Q of Lin(𝕆, 𝔸), for any term Γ, x:Q; Δ ⊢ w:A, we have

ρ_{Γ;Δ}(let x be v in w) = ρ_{Γ;Δ}(w{v/x})

The proof is by induction on the derivation of the term w. However, we note that if the intuitionistic term w is simply some intuitionistic variable y, then ρ_{Γ;Δ}(let x be v in w) is

ρ_{z⃗_{1}:R⃗,y:Q,x:Q;Δ}(w) ∪ {({z⃗_{1}, z⃗_{2}} = z⃗), ({} =^{y′} z⃗_{2}), (y′ = F (y)), (F (x) = y′)}

and this rewrites to

ρ_{z⃗_{1}:R⃗,y:Q,x:Q;Δ}(w){z⃗, y/z⃗_{1}, x}

as required.

Lemma 9.3.12 (Soundness) If Γ; Δ ⊢ v = w:A in Lin(𝕆, ∅), then ρ_{Γ;Δ}(v) and ρ_{Γ;Δ}(w) have a common reduct in the transitive closure of →_{ΔF}.

This is again easily shown by calculation.

Now considering the translation σ, we have

Lemma 9.3.13 Given Γ; Δ-relations D and D′ of type A, if D rewrites to D′ by a one-step F - or Δ-rewrite, then

Γ; Δ ⊢ σ_{Γ;Δ}(D) = σ_{Γ;Δ}(D′):A

in Lin(𝕆, ∅).

This is proved by considering suitable rewrite sequences and the term parts of the resulting intermediates.

Given these results, we have the following corollary of theorem 8:

Corollary 8.1 (Decidability) Given two Γ; Δ-terms v and w of type A, we can decide whether or not they are provably equal in the type-theory Lin(𝕆, ∅).

This follows easily since we can see that the two terms are equal iff their images under ρ are equal, and this latter statement is decidable.

9.4 The Higher-Order Case

We now need to consider decidability in the higher-order case. We will consider the system of relations for the higher-order type-theory constructed in chapter 7. We will then give a confluent and normalising rewrite system for it built on the one we have just presented for a general linear type-theory.

Intuitively, we will take the expected β-reductions and η-expansions on unresolved variables, where we will extend the definition of unresolved variables appropriately. Then we will be able to extend the definition of complexity of a path, and define a revised version of the complexity polynomial which will still enjoy the same properties.

Firstly, however, we need to consider the system of relations for higher-order type-theories.

Higher-Order Relations

The system of higher-order relations for Lin^{H}(ℍ) is the same as the system of relations for the generalised linear type-theory which defines Lin^{H}(ℍ), with the one exception that we change the syntax for the output-natural sets of operators ⊗_{A,B}^{L} and I^{L}.

First consider the system Rel(𝕆^{ℍ}). We will use the following abbreviations:

write (x = ∗) for (x = (; )I^{R}(; ))
write (z = x ⊗ y) for (x = (; ) ⊗^{R} (; (; )(x)(; )(y)))
write (z = λx.y) for (z = (; )λ(; (; x)(y)))
write (z = xy) for (z = (; xy)ap(; ))
write (z =!(x⃗)D(y)) for (z = (; )!((x⃗; )D(y); ))
write (y = !x) for (y = (; x) !(; ))

Now we need to define the relational system Rel^{H}(ℍ), in which the I^{L} and ⊗^{L} sets of operators are captured using different syntax. Essentially, this is given by replacing every occurrence of a tensor elimination operator (z′ = (; x′) ⊗^{L} (; (x_{1}x_{2})(z))) with a clause (x_{1} ⊗ x_{2} =^{z} x′) and replacing z′ by z in the rest of the relation, and similarly for the I^{L} operator. The intuition is that the outputnaturality of the tensor-elimination and unit-elimination operators corresponds to the fact that the vestigial in the new clauses should be movable.

Definition 9.4.1 (Clauses of Rel^{H}(ℍ)) Given a higher-order signature ℍ = (M_{I}, M_{L}, O_{I}, O_{L}), the clauses of Rel^{H}(ℍ) are precisely those of Rel(M_{I}^{H}, M_{L}^{H}, O_{I}, O_{L}) with the addition of:

\begin{matrix}(x = ∗) & (z = x ⊗ y) & (z = λx.y) & (z =!(x⃗)D(y)) \\ (∗ =^{z} x) & (x ⊗ y =^{z′} z) & (z = xy) & (y = !x) \end{matrix}

Now,

• In the clause (x = ∗), x is an output occurrence.

• In the clause (z = x ⊗ y), z is an output occurrence and x and y are both input occurrences.

• In the clause (z = λx.y), z is an output occurrence, x is a binding occurrence and y is an input occurrence.

• In the clause (z =!(x⃗)D(y)), z is an output occurrence.

• In the clause (∗ =^{z} x), z is a vestigial occurrence and x is an input occurrence.

• In the clause (x ⊗ y =^{z′} z), x and y are output occurrences, z′ is a vestigial occurrence and z is an input occurrence.

• In the clause (z = xy), z is an output occurrence and x and y are input occurrences.

• In the clause (y = !x) y is an output occurrence and x is an input occurrence.

Pre-relations of Rel^{H}(ℍ) are sets of clauses of Rel^{H}(ℍ), and we now define both connectedness and paths exactly as for Rel(𝕆) given the extended definition of input, output, vestigial and binding occurrences.

Definition 9.4.2 (Relations of Rel^{H}(ℍ)) A relation of Rel^{H}(ℍ) is a pre-relation of Rel^{H}(ℍ) which satisfies the familiar conditions of definition 8.2.10 for Rel^{H}(ℍ) paths.

We can take pre-relations of Rel(𝕆^{ℍ}) to those of Rel^{H}(ℍ) by mapping each non-higher-order clause to itself, and mapping each higher-order clause to its familiar abbreviation except for the clause (z′ = (; x)I^{L}(; (; )(z)), which we map to (∗ =^{z} x) whilst substituting z for the input occurrence of z′, and the clause (z′ = (; x′) ⊗^{L} (; (; x_{1}x_{2})(z))), which we map to (x_{1} ⊗ x_{2} =^{z} x′), again substituting z for the input occurrence of z′.

Conversely, we can take pre-relations of Rel^{H}(ℍ) to those of Rel(𝕆^{H}) by mapping each non-higher-order clause to itself, and mapping each higher-order clause to its familiar abbreviation except for the clause (∗ =^{z} x), which we map to (z′ = (; x)I^{L}(; (; )(z))) where z′ is fresh, and we substitute it for the input occurrence of z, and the clause (x_{1} ⊗ x_{2} =^{z} x′), which we map to (z′ = (; x′) ⊗^{L} (; (; x_{1}x_{2})(z))) where z′ is fresh, and we substitute it for the input occurrence of z. The result we now want is as follows:

Lemma 9.4.3 The relations of Rel(𝕆^{ℍ}) are isomorphic to the relations of Rel^{H}(ℍ).

This is easily seen by considering the mappings we have already given, and observing that they map paths to paths. Further, we have more importantly that:

Lemma 9.4.4 Under the isomorphism of relations, the vestigial moves and →_{F Δ}-rewrites of Rel^{H}(ℍ) are isomorphic to the vestigial moves and →_{F Δ} augmented with the equalities in ρ(ONat(⊗^{L}, 𝕆^{n}ℍ)) and ρ(ONat(I^{L}, 𝕆^{ℍ})), where these equalities correspond to the vestigial moves of the clauses for ⊗^{L} and I^{L}.

We assume firstly that the isomorphism of relations preserves rewrites in both directions, and also preserves the vestigial equalities of operators other than the tensor and unit eliminations. This then leaves us with two proof obligations. The first of these is to show that two relations which are equal via the image under ρ of the output-naturality equalities for the tensor and unit-elimination map to relations which are vestigially equal using the vestigial equalities for those connectives. This is most easily done by demonstrating that the image under ρ of the output-naturality equalities can be derived from a larger set of simpler equalities along the lines of those sketched on page 40, which correspond directly to the individual vestigial moves.

The second proof obligation is to show that relations which are vestigially equal using the vestigial equality for the tensor and the unit map to relations which are equal via the image under ρ of the output-naturality equalities. This is done by considering the elementary vestigial moves on which the equality was built. These are all easily shown to correspond to elementary output-naturality equalities.

Rewriting

We will define a rewrite over the relations of Rel^{H}(ℍ) which extends the rewrite previously given over Rel(𝕆). Firstly, we need to extend the definition of resolved wires in order to restrict the η-rewrite.

Definition 9.4.5 (Resolved Variables) Extend the definition of resolved variables in the higher-order case so that, given a relation D:

• a variable of a type Q ∈ M_{I} is resolved if it is intuitionistic and it is not of the form !A, or if it is linear and it is the input of a clause (F (y) = x) or the output of a clause (x = F (y)),

• a variable of type I is resolved if if it is the input of a (∗ =^{z} x) clause or the output of a (x = ∗) clause,

• a variable of type A ⊗ B is resolved if is the input of a clause (x ⊗ y = x) or the output of a clause (x = y ⊗ z),

• a variable of type A ⊸ B is resolved if is the input of a clause (z = xy) or the output of a clause (x = λy.z),

• and finally, an intuitionistic variable of type !A is resolved if it is the input of a clause (y = F (x)) where y is the input of a clause (z = !y), or if it is the output of a clause (x =!(y⃗)D′(z)).

We now say that the order of a type is given by the number of connectives used in its construction, where I, ⊗, ⊸ and ! are constructors for the purpose of this definition.

We give the rewrite →_{βη} on the relational system Rel^{H}(ℍ).

Definition 9.4.6 (The Rewrite →_{βη}) Define the one-step rewrite →_{βη} to be given by the following cases:

D ∪ {(∗ =^{y} x), (x = ∗)} →_{β} D
D ∪ {(x ⊗ y = z), (z = x′ ⊗ y′)} →_{β} D{x′, y′/x, y}
D ∪ {(z = λx.y), (y′ = zx′)} →_{β} D{x′, y/x, y′}
D ∪ {(z =!(x⃗)D′(y)), (x′ = F (z)), (y′ = !x′)} →_{β} (D ∪ D′){y/y′}
D{x/x′} →_{η} D ∪ {(x′ = ∗), (∗ =^{x′} x)}
D{x/x′} →_{η} D ∪ {(x′ = y ⊗ z), (y ⊗ z = x)}
D{x/x′} →_{η} D ∪ {(x′ = λy.z), (z = xy)}
D{x/x′} →_{η} D ∪ {(x′ =!(x){(z = !y), (y = F (x))}(z))}

Here, η-rewrites are only allowed on unresolved variables, which must also in the case of the I − η rewrite be variables of type I, in the case of the ⊗ − η-rewrite must be variables of type A ⊗ B for some A and B, in the case of the η− ⊸- rewrite must be variables of type A ⊸ B for some A and B, and finally in the case of the ! − η-rewrite must be intuitionistic variables of type !A for some A.

Confluence

Confluence is shown for this system of rewrites in exactly the way we showed if for the last, which is by considering all possible interacting pairs of local rewrites. We are saved some work in this by noting that the only rewrites which can interact in the βη-rewrite are the β-rewrite and the η-rewrite corresponding to the same type constructor.

Lemma 9.4.7 (Confluence of →_{F −Δ−βη}) The transitive closure of the one-step rewrite on Rel^{H}(ℍ) defined by the various cases of →_{F}, →_{Δ} and →_{βη} is confluent.

Proof In order to do this it suffices to show that any two one-step rewrites of these kinds have reducts which in turn have a common reduct in the transitive closure. We have already seen that this is true for any two one-step rewrites of type →_{Δ−F} in the case of Rel(𝕆), and the proof in that case goes through identically in this case. Further, as we observed above, the only way any two one-step →_{βη}-rewrites might interact is if they were the β and the η-rewrite corresponding to the same constructor. In this case, any interaction is seen to be impossible by inspection. Equally, it is obvious that (excepting the case of the !- constructor) the only interaction between a βη-rewrite and a F Δ-rewrite is in the case where the βη-rewrite in an intuitionistic operator clause and is duplicated or discarded by an instance of Δ−6. In this case we can see that the confluence holds using a number of the same βη-rewrites. Finally, considering the !-constructor, we must check that the non-standard way in which the ! − βη-rewrites include instances of the clause (x = F (y)) does not interfere with confluence, but it can be see that in the critical cases, those in which we consider the F − βη-rewrites and the !−βη-rewrites, there is no failure of confluence. Hence we have the result. □

Normalisation

The intuition behind the proof of normalisation for this case is exactly the same as that in the previous case, except that in order to account for the fact that the η-rewrites are expansionary, we need to weight unresolved variables according to the order of their type. Then the intention is that when an η-rewrite occurs, an unresolved variable of a higher type order is replaced by some possibly unresolved variables of lower type order and some clauses in the relation. Hence the overall effect is to reduce the complexity of each path through the η-redex and hence the complexity polynomial.

There is also a factor which we have not mentioned, which is that the result of a β-rewrite can increase this measure of complexity for many paths since any total path whose first clause has as input the binder of the λ-clause will not be total after the rewrite since the variable is no longer bound. In order to take care of this problem, we need to weight every application clause with the maximal complexity of the highest paths above its argument input.

First we define a measure of the order of a type.

Definition 9.4.8 (Type Order) Define the order of a type A inductively, written o(A) as follows:

o(l) = 0
o(I) = 1
o(A ⊗ B) = o(A ⊸ B) = o(A) + o(B)
o(!A) = 1 + o(A)

Definition 9.4.9 (Variable Order) Given a variable x and a relation D in which it occurs, define the variable order of x in D, which we will write o_{D}(x), as:

o_{D}(x) = \begin{cases}2o(A) + 1 & if the variable x is linear of type Q in D \\ 2o(A) & otherwise \end{cases}

We now define the second complexity of a path in a relation, which is analogous to the first complexity except for the incorporation of the order of the types of wires. This amendment means that we need to be a little careful to avoid a circular definition. Call a path in a relation which cannot be extended by prepending a (c, x) pair to it an initial path.

Definition 9.4.10 (Complexity II) Given a path ϕ in a relation D, define the second complexity of it, written Com^{2}(ϕ) inductively over the sum of the lengths of the initial paths terminating at the last clause of the path ϕ:

Com^{2}(c, ε) = 1

Com^{2}(c⃗c′, x⃗x′) = \begin{cases}2Com^{2}(c⃗, x⃗) & if c′ is a replicator clause and x′ is resolved \\ 2Com^{2}(c⃗, x⃗) + 4o_{D}(x′) & if c′ is a replicator clause and x′ is unresolved \\ Com^{2}(c⃗, x⃗) + M + 1 & if c′ is an application clause and x′ is resolved \\ Com^{2}(c⃗, x⃗) + M + 4o_{D}(x′) & if c′ is an application clause and x′ is unresolved \\ Com^{2}(c⃗, x⃗) + 1 & if c′ is not a replicator or application clause \\ & and x′ is resolved \\ Com^{2}(c⃗, x⃗) + 4o_{D}(x′) & if c′ is not a replicator or application clause \\ & and x′ is unresolved \end{cases}

where M is a number greater than the maximal complexity of an initial path terminating at a clause having immediately above the application clause.

This is a definition because at any point, the sum of lengths of initial paths terminating immediately above the application clause are smaller than the sum of lengths of initial paths terminating at the application clause, and so we can always determine M.

Definition 9.4.11 (Second Complexity Polynomial) The second complexity polynomial for a relation D is given:

p^{2C}(D)(x) = ∑_{ϕ∈TPath(D)} x^{Com^{2}(ϕ)}

We now prove the crucial lemma, which shows that the second complexity polynomial is reduced by the relevant rewrites.

Lemma 9.4.12 If D → D′ by a one-step Δ − 1, 2, 3, 6-rewrite, a one-step βη-rewrite or a one-step F − βη-rewrite then

p^{2C}(D)(x) > p^{2C}(D′)(x)

Proof As before, we prove this by considering all the named reductions in turn.

Δ − 1, 2, 3 These cases are easily seen to reduce the complexity of at least one path in exactly the same way as in the previous proof.

Δ − 6 Again, this case goes through exactly as previously.

F − β As before, this rewrite reduces the complexity of any path containing it.

F − η Note that this rewrite can only occur on a variable of intuitionistic type Q. Further, there is at most one unresolved variable in the reduct. Assume that a general path ϕ contains the variable. Its complexity will be a function of the expression 4(o(Q) + 1), and that of the path with the variable replaced by the reduct will be the same function of the expression 4(o(Q)) + 2 or 2 depending on whether the type Q has the form !A or not. In either of these cases the reduct path has strictly smaller complexity than the original.

I − η,⊗ − η, ⊸ −η and ! − η In each of these cases, any path containing the variable on which the η-rewrite takes place corresponds to several paths in the relation given by the rewrite, each of which has lesser complexity than the original by virtue of the fact that the only unresolved variables which may be present after the rewrite have lower variable order.

I − β, ⊗ − β and ! − β In each of these rewrites, a path is replaced straightforwardly by another path of lesser complexity.

⊸ −β This case is the most subtle, and is the reason for the addition of the constant M to the definition of complexity. There are two possible restrictions of total paths to the redex. Consider the redex

{(z = xy), (x = λy′.z′)}

If we abbreviate the first of these clauses as c_{1} and the second as c_{2}, the two restrictions of paths are (c_{2}c_{1}, z′xz) and (c_{1}, yz). Now note that any total path having the second of these restrictions has complexity which is a function of the expression (M + 1) where M is a number greater than the maximal complexity of an initial path terminating at a clause immediately above c_{1}. Hence, when such a path is mapped to a total path in the relation given by the rewrite in which y′ and y are identified, the complexity of such a total path is still less than that of the original path, as it is the same function of some number less than M. Secondly, any total path restricting to (c_{2}c_{1}, z′xz) has complexity which is a function of some number less than M. Any total path in the relation given by the rewrite which is generated from the first total path must also be an instance of a total path generated from a total path having the other restriction. Since we know that the complexities of such total paths are strictly less than those of the corresponding total paths of the kind mentioned above, we know that we have removed one path at the cost of adding others of lesser complexity, and so the second complexity polynomial is reduced. □

As before, it is easy to see that both the Δ − 4 and Δ − 5-rewrites preserve the second complexity polynomial. Further, we again have that the nesting polynomial is reduced by the Δ − 5-rewrite, that it is preserved by the Δ − 4-rewrite, and that ∑_{c∈Rep(D)} Nest(D)(c) is reduced by the Δ − 4 rewrite.

Hence we again have the required lemma:

Lemma 9.4.13 (Normalisation) The transitive closure →_{ΔF βη} of the union of the rewrites →_{Δ}, →_{F βη} and →_{βη} over the equality =_{vm} is normalising.

Proof As before, consider the set of triples (p(x), q(x), r) consisting of two polynomials and an integer, ordered by the lexicographic ordering inherited from the polynomial ordering and the integer ordering. The argument proceeds exactly as before using the measure

(p^{2C}(D)(x), p^{N}(D)(x), ∑_{c∈Rep(D)} Nest(D)(c))

and the lower bound (0, 0, 0). □ This then gives us the required result.

Theorem 9 (Strong Normalisation) If two relations D and E are equal in the transitive reflexive closure of the rewrite relation →_{ΔF βη} and the equality =_{vm}, then any maximal sequence of one-step rewrites of either D or E will terminate after a finite number of steps in a common normal form up to =_{vm}.

This easily follows from confluence and termination of the rewrite.

Relations and Terms

Having given the rewrite on relations of Rel^{H}(ℍ), we need to establish that it corresponds to the equality of Lin^{H}(ℍ, ∅), up to vestigial equality.

Lemma 9.4.14 Given two Γ; Δ-terms v and w of type A in Lin^{H}(ℍ, ∅), Γ; Δ ⊢ v = w: A iff ρ_{Γ;Δ}(v) and ρ_{Γ;Δ}(w) have the same normal forms up to vestigial equality.

We already know by the isomorphism of relational systems that the relations Rel^{H}(ℍ) under the =_{vm,Δ,F βη}-equality are isomorphic to the typing system Lin(ℍ, Onat(ℍ, ⊗^{L}, I^{L})). Therefore, we only need to show firstly that the higherorder βη-equalities are soundly mapped to the closure of →_{βη} on Rel^{H}(ℍ), and that this rewrite is soundly mapped to higher-order βη-equality in the type theory. These proofs follow the standard pattern.

9.5 Corollaries

Firstly we present some general corollaries of our strong normalisation result.

Corollary 9.1 (Decidability) Given two Γ; Δ-terms v and w of type A in the type-theory Lin^{H}(ℍ, ∅), we can decide whether or not they are provably equal.

Proof As before, simply reduce the relations corresponding to both terms to their normal forms and test whether these are equal by =_{vm} decidably. □

Corollary 9.2 (Conservativity (Syntactic)) For Γ; Δ-terms v and w of Lin(𝕆, ∅), if Γ; Δ ⊢ v = w: A in Lin^{H}(𝕆, ∅) then Γ; Δ ⊢ v = w:A in Lin(𝕆, ∅).

Proof Just as the terms v and w of Lin(𝕆) are identically terms of Lin^{H}(𝕆), the relations D = ρ_{Γ;Δ}(v) and D′ = ρ_{Γ;Δ}(w) are identically relations in both the system Rel(𝕆) and the system Rel^{H}(𝕆). Moreover, it is easy to see by considering the form of the rules that if a higher-order relation contains no variables of higherorder types (and hence no higher-order operator clauses) no higher-order rewrite can apply to it. Hence, we have that no higher-order rewrite can be used in rewriting the two relations D and D′ to their normal forms, and so the rewrites that are used can also be used on the relations in the system Rel(𝕆). Hence the normal forms of the relations are the same in both systems, and therefore they are equal up to =_{vm} in the higher-order system iff they are in the general system. This shows that if two relations are equal in the higher-order system they must also be equal in the general system. □

We can now use our result to prove a fundamental result about the equality of DILL(ℂ). This result was first proved directly using similar methods by the author early in 1996, and subsequently proved independently by Ghani [Gha96] using a term-based method.

Corollary 9.3 (Decidability of DILL(ℂ)) DILL(ℂ) is decidable.

This follows since DILL(ℂ) is isomorphic by lemma 7.6.9 to the higher-order type-theory Lin^{H}(ℍ^{ℂ}, ∅) which is decidable by corollary 9.1.

Corollary 9.4 (Decidability of ILL(ℂ)) ILL(ℂ) is decidable.

This follows from the previous result by theorem 1.

In order to give our next corollary, we need a lemma.

Lemma 9.5.1 There is a conservative map of higher-order type-theories:

Lin^{H}(𝕆^{A}, 𝔸^{A}) → Lin^{H}(𝕆^{A}, ∅)

such that two terms in the source not involving the non-strict tensor are equal iff their images are equal in the target.

Proof We prove this by giving translations in both directions:

ι_{6} :Lin^{H}(𝕆^{A}, 𝔸^{A}) → Lin^{H}(𝕆^{A}, ∅)
ι_{7} :Lin^{H}(𝕆^{A}, ∅) → Lin^{H}(𝕆^{A}, 𝔸^{A})

such that Γ; Δ ⊢ (ι_{7}(ι_{6}(v)) = v:A is a provable equality judgement for any Γ; Δterm v of type A in Lin^{H}(𝕆^{A}, 𝔸^{A}) which does not involve the non-strict tensor.

We now define the maps. Firstly, ι_{6} is the identity except on the tensor constructs, where it maps the strict tensor types and terms to the corresponding left-bracketed forms of the non-strict tensor.

Conversely, ι_{7} is the identity except on the (non-strict) tensor constructs, where it maps these onto the strict tensor constructs.

It is easily seen that both these maps are sound, and that ι_{6} ∘ι_{7} is the identity up to provable equality on terms not containing non-strict tensors of Lin^{H}(𝕆^{A}, 𝔸^{A}). The result now follows since firstly if two such terms are equal then their images under ι_{6} are equal by soundness, and if their images under ι_{6} are equal, it follows that their images under ι_{6} ∘ ι_{7} are equal, from which we can deduce that they are equal. □

We can now prove that the equational theories of all the action calculi we have discussed are decidable. Similar results were previously obtained for the cases AC(𝕂) and AC_{⇒}(𝕂) by Milner [Mil93b], using a normal form syntax.

Corollary 9.5 (Decidability of AC(𝕂)) The theory of AC(𝕂) is decidable, and so are those of AC_{⊠}(𝕂), AC_{⇒}(𝕂) and AC_{⊠,⊸}(𝕂).

First note that we have conservative maps from Lin^{A}(𝕂), Lin^{A^{⊠}}(𝕂), Lin^{A^{⇒}}(𝕂) and Lin^{A^{⊠,⊸}}(𝕂) to Lin^{H}(𝕆^{A}, 𝔸^{A}), so that in order to decide an equality of any one of these type theories it suffices to decide the image of the equality in Lin^{H}(𝕆^{A}, 𝔸^{A}), which can be done. But we can see by the form of the map ι_{5} that no term in the image of it involves the non-strict tensors. Hence any two such terms are equal by lemma 9.5 iff their images are equal in Lin^{H}(𝕆^{A}, ∅), but this is decidable by corollary 9.1. Hence the result follows easily by the isomorphisms between the action calculi AC(𝕂), AC_{⊠}(𝕂), AC_{⇒}(𝕂) and AC_{⊠,⊸}(𝕂) and their respective type-theories.

It is interesting to note that it is straightforward to give relations for Lin^{A}(𝕂), and to prove that they have normal forms under rewriting, up to vestigial equality. These are then normal forms for the action calculus by virtue of lemma 6.3.8.

However, we also have directly normal forms for the intuitionistic action calculus, the molecular forms, due to Milner [Mil93b]. Hence it must be the case that these two normal forms are ismorphic. We give a brief intuitive outline of the translation from relations to molecular forms.

Relations map to molecular forms in which each operator clause goes to a molecule, and the input variables of each clause become the binding inputs of the molecule, and the outputs become the binding outputs of the molecule. Clauses other than the operator clauses, which is to say tensor clauses, copy and discard clauses and F -clauses are mapped to substitutions, as in the intuitionistic action calculus every arity is intuitionistic prime.

In the reverse direction each molecular form is mapped to a set by taking each molecule to an operator clause in the set, with inputs and outputs connected to F -clauses and tensor clauses as appropriate in order to give the correct arity.

Conclusions

We now conclude by summarising our results, discussing the implications of the work presented in this thesis, and then considering directions for further work, in progress and longer-term. We argue that our generalised linear type-theory is a useful general tool for the study of systems of typed computation. We showed that it is expressive enough to account for a wide range of examples, and we proved a substantial number of general results, applying to each instance of the type-theory.

10.1 Results

Although we started this thesis by introducing DILL as an alternative formulation of linear logic, in retrospect the main thread of the thesis is more clearly seen based on the generalised linear type theory we introduced, and its semantics and properties. In this view, the starting point is the following triangle:

Logic Lin(𝕆)

[figure: Type-Theory Lin(𝕆, 𝔸); Lin(𝕆, 𝔸)-Models]

In chapters 4 and 5 we gave the vertices of this diagram, and made precise their connections. Further, we showed in chapters 8 and 9 that the equality of the type-theory Lin(𝕆, ∅) is decidable. This equality is analogous to the equivalence of proofs naturally generated by some simple permutations, and perhaps more significantly, it is analogous to the equality of arrows in the initial Lin(𝕆)- interpretation. The coherence problem for Lin(𝕆)-interpretations is the problem of determining which diagrams of arrows built up from those present in every Lin(𝕆)-interpretation commute in all Lin(𝕆)-interpretations. We solved this problem using our term Lin(𝕆)-interpretation by showing that any diagram of such arrows commutes in every Lin(𝕆)-interpretation precisely when it commutes in the term Lin(𝕆)-interpretation, which by definition is when the appropriate term equality is provable. Now this is decidable, and so we have an effective procedure for determining when a diagram of arrows commutes in all Lin(𝕆)-interpretations.

We also considered an important sub-case of the triangle stated above in chapter 7, as follows:

Logic Lin^{H}(ℍ)

[figure: Type-Theory Lin^{H}(ℍ, 𝔸); Lin^{H}(ℍ, 𝔸)-models]

This is the higher-order subcase, in which the logic is equipped with an exponential and an arrow type, the type-theory incorporates a linear λ-calculus and the models also have exponential and closed structure. There is then a very natural embedding of any linear type-theory into a higher-order linear type-theory built over it, and we showed using a semantic construction that this is a conservative extension.

We then extended the techniques used to decide the equality of Lin(𝕆, ∅) in chapter 9 to decide the equality of Lin^{H}(ℍ, ∅). This corresponds to deciding the coherence problem for the higher-order Lin^{H}(ℍ)-interpretations, which is significant, since for example it includes coherence for models of multiplicative exponential linear logic. This same extension also enables us to show syntactically that Lin^{H}(𝕆, ∅) conservatively extends Lin(𝕆, ∅).

In addition to presenting this well-developed theory of linear operators in the case of the logic, the type theory and the models, we considered some examples. Firstly, we showed that DILL, its type-theory and models arise as instances of higher-order generalised linear logics, type-theories and models. We then have as an easy corollary of our decidability results that the equality of DILL(ℂ) is decidable.

Secondly, and more surprisingly, we showed that Milner’s action calculi and their models correspond to a particular range of instances of the generalised linear type-theories and models, as do their higher-order extensions. Again, our decidability results enabled us to show that all of these action calculi are decidable, and further we showed that the embedding of an action calculus into its higher-order extension is conservative, via either our semantic or our syntactic proofs.

10.2 Extending Lin(𝕆, 𝔸)

Given the results we already proved in this thesis, we go on to consider some desirable extensions to the framework, with their advantages and disadvantages. The first two of these consist of extensions to the syntax and semantics of the framework, to incorporate important computational ideas which we have so far overlooked. The last three follow the program of chapter 7, where we pick out a particular set of types, operators and equalities as a canonical expression of a certain computational concept. In chapter 7, the computational concept is higher-order behaviour, and in this section we will consider choice, recursion and the negation of linear logic.

Rewriting

In contrast to our general linear type theories, Milner’s action calculi [Mil96] are enriched with a notion of dynamics, which consists of a rewrite over the equality satisfying certain simple conditions. In the representation of process calculi, the dynamics is crucial, since as the name suggests, it captures the operational behaviour of the process calculi, whereas the equality represents a structural congruence on processes. It therefore seems an obvious idea to add a rewriting judgement to our general theory, possibly of the form Γ; Δ ⊢ v → w:A. Such a rewrite would be closed under the equality, and under certain contexts, although in action calculi dynamics are not closed under controls. It might further be subject to some conditions, for example perhaps sufficient to prove the property:

{Γ; Δ ⊢ v → u:A \atop Γ; Δ ⊢ v = u:A}

for values v. Another possibility would be to add a labelled rewrite, although we shall not consider this further here.

We might then follow the example of Power [Pow96] and consider the semantics of such a rewrite judgement, modelling it by an enrichment of the SMC part of the semantics with a preorder. This preorder should then be subject to some conditions analogous to those on the rewrite, for example possibly that morphisms in the image of the functor F are maximal in the preorder.

Such an extension opens many possible lines of enquiry. Obviously results and techniques of general term rewriting theory become immediately relevant, and may well be adaptable to this framework, and similarly it makes possible the study of process calculi dynamics, (even, perhaps, including bisimulation), in a type-theoretic setting. Another interesting possibility, which we will briefly sketch, is to relate the equality and the rewrite and study the interplay between them. Given an extension of our type-theory with a rewrite judgement, firstly define a morphism of type-theories in the obvious way based on maps on types and operators, preserving the rewrite and the equality. Then say that one instance of our type-theory implements another if Γ; Δ ⊢ v = v′:A in the first implies that there exists u in the second such that Γ; Δ ⊢ v → u:A and Γ; Δ ⊢ v′ → u:A in the second, and there is a morphism of type-theories from the second to the first.

Of course, this definition is most useful when there is a sub-rewrite of the rewrite in the first type-theory which has the Church-Rosser property. For example, an instance of our type theory with the types and terms of Lin^{D}(ℂ), but having the β and η-rewrites rather than equalities would be an implementation of the version presented with equalities. One might then be able to develop this idea to relate operational behaviours and equality relations in the same framework.

Structure on Types

We might also extend our framework by adding more structure on types. Whereas we have a complicated structure allowing us general operators on terms, the only structure present in the type set P_{L} is the distinction between members of P_{I} and non-members of P_{I}. However, in many cases there is obvious structure implicit in the choice of type set, for example in the case of higher-order instances of our theory. The type set in this case is freely closed under the binary operations ⊸, ⊗, the unary operator !, and the nullary operation I. Hence, we might specify that the type set be constructed over primitive types using type operators, which would then have arities of the general form

( ∏_{i=1...r} P_{I}) × ( ∏_{j=1...s} P_{L}) → P_{L}

This should be read as saying that the type operator would take r intuitionistic arguments and s linear ones, and return an arity. For example, the obvious type operator ⊗ would then have an arity P_{L} × P_{L} → P_{L}. Intuitionistic type operators would then be defined similarly returning arities in P_{I}.

Given this structure on types, we could refine our specification of operators. For example, the tensor introduction operator, which for every arities A and B has an instance with the arity

\begin{aligned}; & ()A & ()B \\ & ()A ⊗ B \end{aligned}

would be specified as a single operator of arity

\begin{aligned}; & () & ()_{=} \\ & () ⊗_{=} \end{aligned}

This would be interpreted as meaning that for every two arities A and B, there would be an instance taking pairs of terms of type A and terms of type B, and returning a term of type the tensor type operator applied to A and B.

This would also have a significant effect on the semantics. Clearly, type operators would be interpreted as a first step as functions on the objects of the category in question. It would then be natural to insist that in the case of the tensor, rather than having an appropriate natural transformation for each operator instance over arities A and B, we should have one for each two objects of the category. This change would substantially simplify the semantics of our examples, for example by forcing the interpretation of the tensor operator to be a tensor functor in all models of the appropriate equational theory.

Choice Constructs

Choice constructs are crucial to programming languages. However, although it is possible to represent a coproduct construction in our general type-theory using families of operators:

{; \atop (A)B ⊕ A} ^{inr^{A,B}} {; \atop (A)A ⊕ B} ^{inl^{A,B}} \begin{matrix}(CA)C′ & (CB)C′; \\ (CA ⊕ B)C′ \end{matrix} ^{cases^{A,B,C,C′}}

with appropriate equalities, this does not capture certain naturality properties of the cases operator. Consider the bound assumptions C in the above instance of the operator. The operator is natural in the assumptions C in the sense that a cut into one of these assumptions should be proof-equivalent to two cuts, one into each premiss of the operator instance.

Since the naturality we have incorporated into our type-theory is inherently a multiplicative naturality, based on the implicit tensor of the context on the left, it is insufficient to represent this additive naturality. We could amend this by adding a class of additive operators, where we rename the existing operators multiplicative operators. These additive operators would have the defining property that an operator of arity for example:

\begin{matrix}; (A)A′ & (B)B′ \\ (C)C′ \end{matrix}

would have the logical rule

\begin{matrix}Γ; Δ, A ⊢ A′ & Γ; Δ, B ⊢ B′ \\ Γ; Δ, C ⊢ C′ \end{matrix}

in which the contexts are combined additively rather than multiplicatively. Naturality would then be defined with respect to this additive context discipline, and the cases operator with its naturality would be satisfactorily captured.

However, it is not clear how this development might be extended to the semantics. It seems likely that the cases operator given above would be soundly modelled by a coproduct in our models, given suitable distributivity conditions, exactly as the additive connective + in intuitionistic linear logic is modelled by a coproduct [BBdPH93a]. However, it is not clear what would constitute a sound model of a type-theory with arbitrary additive operators. Further, we can already see that equipping such a type-theory with normal forms based on proof-nets is a difficult problem, as the proof-net technology handling the additives [Gir96] is substantially more complicated than that for the multiplicative-exponential fragment, and in general, the proper treatment of the additives is a key point in linear logic [Gir94]. Although there are presentations of proof-nets for linear logic including the additives [Gir96], they all increase the complexity of the proofnet representation substantially, and any analogous extension of relations would cause the same complication.

In view of this state of affairs, finding the best way of adding choice constructs to our framework seems to be one of the most outstanding existing problems.

Recursion

Another essential component of serious programming languages is some form of iterative or recursive construct. We may define in our framework the obvious recursion operators with arity

{; (A)A \atop ()A}

for each arity A, with the expected equalities. We would then expect this to correspond to adding a trace operator on the symmetric monoidal part of the models, in view of Hasegawa’s work [Has97]. Further, also following work of Hasegawa, such a recursion operator might well be modelled primitively in the proof-nets simply by allowing nets to be cyclic, with certain extra primitive equivalences. It is not then clear how the extended proof-net framework might be equipped with a confluent rewrite, and this problem is a substantial one.

We should also note that there are other approaches to adding recursion to our models, notably by asking that the cartesian category have a fixpoint operator, as in work of Fiore and Plotkin [Plo93b, FP94]. Since the models of our typetheories interpret operators as natural transformations on the SM part of the model, this semantic notion is not captured precisely by any instance of our general type-theory. It remains ongoing and interesting work to relate these two possible types of models for recursion.

Negation

Given that the linear type-theory corresponding to the multiplicative fragment of linear logic has been shown to have a direct relation to the higher-order action calculus, it is worth considering other connectives of linear logic, and their incorporation in general linear type-theories. We have already mentioned the choice constructions associated with the coproduct of linear logic, and clearly this is essential to practical programming languages, parallel or not. The one remaining connective is the classical negation. For as long as linear logic has existed, there have been connections postulated between it and concurrency, for example [Gir87, Abr93] and many others.

Further, there has been much work investigating the computational significance of the boundary between classical logic and intuitionistic logic in both conventional and linear situations [Par92, Bie96b, Bie96a, Ong96].

Using our framework, we can incorporate some classical behaviour, motivated by the semantics of classical linear logic. Just as intuitionistic multiplicative linear logic (without the exponentials) has as categorical models symmetric monoidal closed categories, *-autonomous categories, which are symmetric monoidal closed categories with a dualising object (intuitively modelling the nullary ⊥) are thought to be models of classical linear logic. Moreover, it has been shown in [CS97] that *-autonomous categories are equivalent to symmetric monoidal closed categories having a unary negation satisfying certain simple equalities.

Hence, we might add a unary classical negation operator (written ( )^{⊥}) to any general linear type theory by first closing the arities under the unary operator ( )^{⊥} and secondly by adding the two constants having arity:

(A^{⊥⊥})A (A)A^{⊥⊥}

and suitable equalities, based on the categorical semantics. A first question is what relationship the instance of our general type-theory corresponding to DILL(ℂ), augmented with this negation, bears to classical linear logic. Secondly, we can now consider the extension of the system corresponding to higher-order action calculi with this negation, and in particular its relationship to type-theories for process algebra.

Investigating these two questions, we will obtain a better picture of the relationship between classical linear logic and concurrency not only on the syntactic level but also via the inherited semantics of our type-theories.

10.3 Aims and Objectives

Finally, we consider general questions and directions for study which we feel are raised by the work in this thesis.

Frameworks

Some might say (and indeed have!) that there is a needless proliferation of syntaxes in general, and of those which are variants of linear λ-calculus in particular. Moreover, there are many possible syntaxes for the same underlying semantic situation.

We hope that our general linear type-theory may provide a means of correlating these syntaxes and giving them a uniform presentation. By providing a tight link between a range of interesting variants of the linear semantics and a range of our type-theories, we have made it easier to reconstruct syntaxes for particular semantic situations of this kind, and reason about their properties. In addition to this uniformity of syntax and semantics, a general framework allows us to consider a wider picture of syntaxes and translations between them, in an organised setting.

Turning to the corresponding semantics, this organised setting makes it natural to study the translations between syntaxes as morphisms between their categories of models, and characterise interpretations as initiality morphisms, amongst other things. This perspective leads to interesting insights, including the Yoneda argument of chapter 7.

On the other hand, we can see in this thesis that there is a place for diversity of syntax; certainly the action calculus and our linear type-theory for it, whilst having essentially the same semantics, each have salient features which justify their use for particular applications. It is interesting to note that although historically their connection was discovered via the syntax, the semantics provided by far the clearest indication of the connection once it was clearly established in both cases.

We feel that the way forward given these points must be towards general frameworks for syntax, with solid semantic foundations. Such constructions will limit the proliferation of syntax, if adopted, and important variant syntaxes can be presented and given semantics via translation to the appropriate instance of the framework. In order to assist in this, we aim to extend our given framework with canonical choice and recursion operators, and to consider other common computational connectives to see if they have a canonical presentation in this setting.

Proof Nets and Action Graphs

A slightly novel part of our presentation is the work on proof-nets, used to investigate the properties of various equalities. Although this work is not familiar in the context of type-theories, it is very significant that Milner [Mil96] developed a theory of action graphs. Furthermore, Milner’s molecular forms [Mil93b] are related to our relational normal forms. We know from Milner’s work [Mil93b] that two actions are equal in the theory of action calculi if and only if their molecular forms are equal. We also know that two terms of the corresponding instance of our type-theory are equal if and only if their relational normal forms are equal under the vestigial equality. Hence, it must be the case that molecular forms and relational normal forms are in one-to-one correspondence up to the relevant equalities.

This result shows that there exists a close correspondence between these two systems, but provides very little information about the intuition behind the correspondence. We aim to investigate this correspondence, and the relative advantages of the two syntaxes. More generally, we need to investigate the advantages of graphical formulations over more traditional approaches for investigating decidability.

Process Algebras and Type-Theories

On a more detailed level, the connection between action calculus and our general linear type-theory raises many questions. Particularly interesting are those which are created by the presentation of a familiar syntax in an unfamiliar setting. Consider for example the π-calculus as an action calculus, and therefore as a typetheory (given the rewriting extension proposed earlier in this chapter). This is a very unfamiliar presentation of a process algebra, which immediately highlights certain points. One such is that the π-calculus in its original form has very little typing structure compared to its term structure, in contrast with the normal pattern in type-theories. It might be more natural to also consider typed variants such as that proposed for example in [PRT93], and their relationship to the original. It might also be worth studying the form of the input and output controls in the type-theory, and comparing them with more familiar logical and type-theoretic rules. These and other considerations would have an immediate impact on process algebra theory.

In the reverse direction, we have already seen that the first-class rewriting of process algebras can profitably be incorporated into our type-theory. Such rewrites are often very different from those normally encountered in type-theory, as they are rarely confluent or normalising. However, their behaviour is the key to the theory of process algebras.

In the same way, we might expect other cross-fertilisation between these two areas due to their common semantic foundation.

Linear Logic and Process Algebras

As has been previously mentioned in this thesis, broad connections have been suggested between linear logic and process algebras. More particularly, process calculi directly built on the proof structure of classical linear logic have been given [Abr91, Abr94].

We aim to investigate this further, firstly by giving a set of instances of our framework incorporating the classical negation operator of linear logic, and then by considering the relationship between these and instances corresponding to process calculi. There are obvious disparities between the proofs of linear logic and conventional process calculi, notably the typing of linear logic contrasted with the less detailed typing of process calculi, and the dynamics of process calculi contrasted with the essentially static proof equivalence of linear logic.

However, we aim to construct a range of intermediate instances between classical linear logic and various process algebras, and thereby discover whether classical linear logic underlies them in the sense of being soundly embeddable into them.

If this is concluded positively, then it may become possible to consider a canonical foundation for process algebras and use it to classify some of them.

10.4 Final Remarks

In this thesis, we have focussed on linearity. The wide range of applications of our general framework, together with the examples in other areas of computer science, provide evidence that computation is inherently linear with an underlying intuitionistic calculus of values. Although the theory of intuitionistic logics, typetheories and their semantics is very well developed in comparison to that of our framework and similar constructions, it seems obvious from this work that once the theory of linear-non-linear situations is equally developed, it will provide a clearer foundation for studying a wide range of computational situations, from resource-sensitive though imperative to concurrent computation.

Appendix A

Basic Definitions

A.1 Syntactic Preliminaries

We need to present certain definitions which will be used throughout the thesis. For the purposes of this appendix, we let Ob be a set of objects of some sort, ranged over by o . . ..

Sequences

We will often need to discuss sequences of objects of various types, and will need to use functions on such sequences. Consequently, we give some notation:

Notation A.1.1 (Sequences) Given objects o … of some kind, we will write o⃗ to denote an arbitrary sequence of such objects. Where it is necessary to make explicit the elements of sequence, we will write it as o_{1} … o_{r}. We will generally write concatenation as juxtaposition, and ϵ for the empty sequence. Further, we will write the common operation of ‘cons-ing’ an element to the head of the sequence using a comma, so that for example the expression o′, O⃗ represents the sequence having as first element o′ and as its i + 1th element the ith element of O⃗, for i = 1 … r where r is the length of the sequence O⃗.

However, we will need to make an exception to this syntax in order to accommodate common practice in logics and type-theories; when we give sequences of formulae of a logic or a type of a type theory, A_{1} … A_{r}, we will write comma for concatenation, and for the empty sequence. We will also use this convention for typings x:A. In this framework we will elide the distinction between a oneelement sequence and the single element it contains, so that A, A⃗ can be read either as the ‘cons’ of A onto A⃗ or the concatenation of the singleton sequence A and the sequence A⃗.

Next we give some notation for applying functions to the elements of sequences. Given a function f : Ob → Ob′, we will write fo⃗ for the function which takes sequences of objects in Ob to sequences of objects in Ob′ simply by using the function f on each element of the sequence.

In the presentation of typing rules that we give, we need to say when one sequence is a merge of two others:

Definition A.1.2 (Merge Relation) For sequences of objects o⃗_{1} and o⃗_{2}, define the merge relation o⃗ = o⃗_{1}#o⃗_{2} inductively as follows:

• o⃗ = #o⃗ holds, as does o⃗ = o⃗# .

• o′, o⃗ = o′, o⃗_{1}#o⃗_{2} holds if o⃗ = o⃗_{1}#o⃗_{2} does.

• o′, o⃗ = o⃗_{1}#o′, o⃗_{2} holds if o⃗ = o⃗_{1}#o⃗_{2} does.

Typings and Typing Contexts

We define several typing systems in this thesis, and a common component of each of them is a notion of typing and typing context. Assume that we have a set of variables X ranged over by x, y, z … and a set of types T y ranged over for the purposes of this section by T . . ..

Now, a typing is a pair of a variable and a type, which we write x: T. We will let sequences of typings be ranged over by Γ, Δ . . .. Where convenient, we will write the sequence of typings x_{1}:T_{1} … x_{r}:T_{r} as x⃗:T⃗, where x⃗ and T⃗ are the obvious sequences of variables and types respectively. For a sequence of typings Γ = x⃗:T⃗, we will then say that |Γ| is the set of elements in the sequence T⃗ and further that dom(Γ) is the set of elements in the sequence x⃗.

Now, a dual typing context, which we will often refer to just as a typing context since most of our typing contexts are dual, is a pair of sequences of typings, written Γ; Δ. The intuitionistic part of the context is Γ and the linear part is Δ.

Conversely, a single typing context is just a sequence of typings.

A.2 Categorical Definitions

In general, we will refer to categories using the symbols C and S, and will use obj(C) to refer to the objects of a category C, ranged over by X, Y . . .. Also, we will use C(X, Y) to refer to the set of arrows between X and Y in the category C We will let such arrows be ranged over by f, g …, and write f : X → Y to indicate that f is in C(X, Y) where the category is clear from the context. We will write the identity arrow at object X as id_{X} and write the composition of f and g as f; g. We will let v, w … range over natural transformations, and write v : F → G to indicate that v is a natural transformation from F to G.

The following definitions can be found in [Mac71].

Definition A.2.1 (Symmetric Monoidal Category) A Symmetric Monoidal Category (SMC) is a category C with a bifunctor ⊗ : C × C → C and natural isomorphisms

\begin{aligned}a_{X_{1},X_{2},X_{3}} : & (X_{1} ⊗ X_{2}) ⊗ X_{3} & → & X_{1} ⊗ (X_{2} ⊗ X_{3}) \\ ri_{X} : & I ⊗ X & → & X \\ li_{X} : & X ⊗ I & → & X \\ s_{X,Y} : & X ⊗ Y & → & Y ⊗ X \end{aligned}

s.t.

(a_{X,Y,X′} ⊗ id_{Y′}); a_{X,(Y ⊗X′),Y′}; (id_{X} ⊗ a_{Y,X′,Y′}) = a_{(X⊗Y),X′,Y′}; a_{X,Y,(X′⊗Y′)}  (A.1)
a_{X,I,Y}; (id_{X} ⊗ li_{Y}) = (ri_{X} ⊗ id_{Y})  (A.2)
li_{I} = ri_{I}  (A.3)
(s_{X,Y} ⊗ id_{X′}); a_{Y,X,X′}; (id_{Y} ⊗ s_{X,X′}) = a_{X,Y,X′}; s_{X,(Y ⊗X′)}; a_{Y,X′,X}  (A.4)
s_{X,Y}^{−1} = s_{Y,X}  (A.5)
s_{I,X}; li_{X} = ri_{X}  (A.6)

A symmetric monoidal category is strict if the natural transformations li, ri and a are all the respective identities. This implies that the tensor and unit are strictly associative. Note that the definition does not insist that the symmetry be strict.

Definition A.2.2 (Symmetric Monoidal Closed Category) A (strict) symmetric monoidal closed category (SMCC) is a (strict) SMC s.t. the bifunctor ⊗ has a right adjoint ⊸, or

C(X ⊗ Y, X′) ≃ C(X, Y ⊸ X′)

where ≃ denotes an isomorphism natural in X, Y and X′. We write the closed structure as:

ap_{X,Y} :(X ⊸ Y) ⊗ X → Y
λ_{Y} (f) :X → (Y ⊸ X′) where f : X ⊗ Y ⊸ X′

For convenience, we will abbreviate the unit of the adjunction:

λ_{Y} (id_{X⊗Y}) = pa_{X,Y} : X → (Y ⊸ (X ⊗ Y))

Definition A.2.3 (Cartesian Closed Category) A cartesian (closed) category is a symmetric monoidal (closed) category in which the tensor product is cartesian. We shall typically use the symbol × to represent the product of a cartesian category, and use CC (CCC) to denote a cartesian (closed) category. Further, we will write the arrows giving the cartesian structure as follows:

d_{X} :X → 1
p_{i} :X_{1} × X_{2} → X_{i}
c_{X} :X → X × X
⟨f, g⟩ :X → Y_{1} × Y_{2} where f : X → Y_{1} and g : X → Y_{2}

If the cartesian (closed) category is strict, we can use the generic projections p_{i,r} : X_{1} × … × X_{r} → X_{i}.

We now need to define the concept of functor between two SMCCs.

Definition A.2.4 (Symmetric Monoidal Functor) A symmetric monoidal functor, abbreviated to SM functor,

(F, m_{X,Y} , mi) : (C, ⊗, I, a, li, ri, s) → (C′, ⊗′, I′, a′, li′, ri′, s′)

is a functor F : C → C′ with a map mi : I′ → F (I) and a natural transformation m_{X,Y} : F (X) ⊗′ F (Y) → F (X ⊗ Y) s.t.

a′_{F X,F Y,F X′}; (id_{F A} ⊗′ m_{Y,X′}); m_{X,Y ⊗X′} = (m_{X,Y} ⊗′ id_{F X′}); m_{X⊗Y,X′}; F (a_{X,Y,X′}) (A.7)
ri′_{F X} = (mi ⊗ id_{F X}); m_{I,X}; F (ri_{X})  (A.8)
s′_{F X,F Y}; m_{Y,X} = m_{X,Y}; F (s_{X,Y})  (A.9)

A SM functor is strong if mi is an isomorphism and m_{X,Y} is a natural isomorphism. It is strict when mi is the identity and m_{X,Y} is the identity transformation.

Under this definition it is easy to check that given two (strict, strong) SM functors (F, m_{X,Y} , mi) and (G, m′_{X,Y} , mi′) their compose is (strict, strong) symmetric monoidal when equipped with maps:

(GF, (m′_{F X,F Y}; G(m_{X,Y})), (mi′; G(mi)))

Remark A.2.5 Given a SM functor F : C → C′, notice that there is an induced natural transformation

k_{X,Y} = (F X ⊸ (F ap_{X,Y}; m_{X⊸Y,X})) ∘ pa′_{F X,F (X⊸Y)} : F (X ⊸ Y) → (F X ⊸ F Y)

Definition A.2.6 (Symmetric Monoidal Closed Functor) A symmetric monoidal closed functor, abbreviated SMC functor, is a SM functor. A strong SMC functor is a strong SM functor for which k_{X,Y} is a natural isomorphism, and a strict SMC functor is a strict SM functor for which k_{X,Y} is the identity transformation.

Definition A.2.7 (Cartesian (Closed) Functor) A cartesian (closed) functor between two cartesian (closed) categories is a SM (SMC) functor which preserves the cartesian structure up to isomorphism. It is strict when it preserves the cartesian structure up to equality.

Definition A.2.8 (Monoidal Natural Transformation) A monoidal natural transformation from one symmetric monoidal functor (F, m_{X,Y} , mi) : C → C′ to another (G, m′_{X,Y} , mi′) : C → C′ is a natural transformation v : F → G s.t.

m_{X,Y}; v_{X⊗Y} = (v_{X} ⊗′ v_{Y}); m′_{X,Y}  (A.10)
mi; v_{I} = mi′  (A.11)

Bibliography

[Abr91] Samson Abramsky. Proofs as processes. Unpublished Lecture Notes, 1991.

[Abr93] Samson Abramsky. Computational interpretations of linear logic. Journal of Theoretical Computer Science, vol. 111, pp. 3–57, 1993. Earlier version appeared as Imperial College Technical Report DOC 90/20, October 1990.

[Abr94] Samson Abramsky. Proofs as processes. Theoretical Computer Science, vol. 135, pp. 5–9, 1994.

[Acz78] Peter Aczel. A general church-rosser theorem. Unpublished manuscript, 1978.

[Acz80] Peter Aczel. Frege structures and the notions of proposition, truth and set. In J. Barwise, H. J. Keisler, and K. Kunen, editors, The Kleene Symposium, pp. 31–59. North-Holland Publishing Company, 1980.

[Avr94] A. Avron. What is a logical system? In D. Gabbay, editor, What is a logical system?, no. 4 in Studies in Logic and Computation, chapter 8, pp. 217–238. Oxford Science Publications, 1994.

[Bar] A. Barber. Proof nets for dual intuitionistic linear logic. Unpublished note.

[Bar79] Michael Barr. ∗-Autonomous Categories, vol. 752 of Lecture Notes in Mathematics. Springer-Verlag, 1979.

[Bar91] Michael Barr. ⋆-autonomous categories and linear logic. Mathematical Structures in Computer Science, vol. 1 no. 2, pp. 159–178, July 1991.

[Bar96] Andrew Barber. DILL- Dual Intuitionistic Linear Logic. Technical Report LFCS-96-347, LFCS, Edinburgh University, 1996.

[BBdPH93a] N. Benton, G. Bierman, V. de Paiva, and J. M. E. Hyland. Linear lambda-calculus and categorical models revisited. In Computer Science Logic ’92, Selected Papers, vol. 702 of Lecture Notes in Computer Science, pp. 61–84. Springer, 1993.

[BBdPH93b] N. Benton, G. Bierman, V. de Paiva, and J. M. E. Hyland. A term calculus for intuitionistic linear logic. In Proceedings of the International Conference on Typed Lambda Calculi and Applications, vol. 664 of Lecture Notes in Computer Science, pp. 75–90. Springer-Verlang, 1993.

[BCS95] R. F. Blute, J. R. B. Cockett, and R. A. G. Seely. Categories for computation in context and unified logic: I. electronically available, 1995.

[BCST96] Richard Blute, J. R. B. Cockett, R. A. G. Seely, and T. H. Trimble. Natural deduction and coherence for weakly distributive categories. Journal of Pure and Applied Algebra, vol. 13 no. 3, pp. 229–296, 1996.

[Ben94] N. Benton. A mixed linear and non-linear logic: Proofs, terms and models. Technical report, Computing Laboratory, University of Cambridge, November 1994.

[Ben95a] N. Benton. A mixed linear and non-linear logic; proofs, terms and models. In Proceedings of Computer Science Logic ’94, vol. 933 of Lecture Notes in Computer Science. Verlag, June 1995. 15 page version.

[Ben95b] N. Benton. Strong normalization for the linear term calculus. Journal of Functional Programming, vol. 5 no. 1, pp. 65–80, 1995.

[BGHP97] Andrew Barber, Philippa Gardner, Masahito Hasegawa, and Gordon Plotkin. From action calculi to linear logic. To Appear in CSL ’97, 1997.

[Bie95] G. Bierman. On Intuitionistic Linear Logic. PhD thesis, Computing Laboratory, University of Cambridge, 1995.

[Bie96a] G.M. Bierman. A classical linear λ-calculus. Technical Report 401, University of Cambridge Computer Laboratory, July 1996.

[Bie96b] G.M. Bierman. Towards a classical linear λ-calculus. In Proceedings of Tokyo Conference on Linear Logic, vol. 3 of Electronic Notes in Computer Science. Elsevier, 1996.

[BKP89] R. Blackwell, G. M. Kelly, and A. J. Power. Two-dimensional monad theory. The Journal of Pure and Applied Algebra, vol. 59, pp. 1–41, 1989.

[BW96] N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In Proceedings of the 11th symposium on Logic in Computer Science ’96, 1996.

[CP96] Iliano Cervesato and Frank Pfenning. A linear logical framework. In E. Clarke, editor, Proceedings of the 11th symposium on Logic in Computer Science, pp. 264–275, New Brunswick, New Jersey, July 1996. IEEE Computer Society Press.

[CS97] J. R. B. Cockett and R. A. G. Seely. Weakly distributive categories. Journal of Pure and Applied Algebra, vol. 14 no. 2, pp. 133–173, 1997.

[Cur85] P.-L. Curien. Categorical combinators. Information and Control, vol. 69, pp. 188–254, 1985.

[Cur86] P.-L. Curien. Categorical combinators, sequential algorithms and functional programming. Research notes in theoretical computer science. Pitman, London, 1986.

[Day70a] B. J. Day. Construction of Biclosed Categories. PhD thesis, University of New South Wales, Australia, 1970.

[Day70b] B. J. Day. On closed categories of functors. In Midwest Category Seminar Reports IV, no. 137 in Lecture Notes in Mathematics, pp. 1–38. Springer-Verlag, 1970.

[Day73] B. J. Day. An embedding theorem for closed categories. In Category Seminar Sydney 1972-73, no. 420 in Lecture Notes in Mathematics, pp. 55–64. Springer-Verlag, 1973.

[DR89] Vincent Danos and Laurent Regnier. The structure of multiplicatives. Archive for Mathematical Logic, vol. 28 no. 3, pp. 181–203, August 1989.

[FP94] M. P. Fiore and G. D. Plotkin. An axiomatisation of computationally adequate models of PCF. In Proceedings of the 9th symposium on Logic in Computer Science, pp. 92–102. IEEE, Computer Society Press, 1994.

[GAL92a] Georges Gonthier, Martín Abadi, and Jean-Jacques Lévy. The geometry of optimal lambda reduction. In Proceedings of ACM Symposium Principles of Programming Languages, pp. 15–26, January 1992.

[GAL92b] Georges Gonthier, Martín Abadi, and Jean-Jacques Lévy. Linear logic without boxes. In Proceedings of the 7th symposium on Logic in Computer Science, pp. 223–234. IEEE Computer Society Press, 1992.

[Gar95] P. Gardner. A name-free account of action calculi. In S. Brookes, M. Main, A. Melton, and M. Mislove, editors, Mathematical Foundations of Programming Semantics, 1995, vol. 1 of Electronic Notes in Theoretical Computer Science, Tulane Univ, New Orleans, 1995. Elsevier.

[GH90] Juan C. Guzmán and Paul Hudak. Single-threaded polymorphic lambda calculus. In Proceedings of the 5th symposium on Logic in Computer Science, pp. 333–343, Philadelphia, Pennsylvania, June 1990. IEEE Computer Society Press.

[Gha95] Neil Ghani. Adjoint Rewriting. PhD thesis, LFCS, University of Edinburgh, Nov. 1995.

[Gha96] Neil Ghani. Adjoint rewriting and the !-type constructor. draft, June 1996.

[Gir87] Jean-Yves Girard. Linear Logic. Theoretical Computer Science, vol. 50 no. 1, pp. 1–102, 1987.

[Gir93] Jean-Yves Girard. On the unity of logic. Annals of Pure and Applied Logic, vol. 59, pp. 201–217, 1993.

[Gir94] Jean-Yves Girard. Geometry of interaction III : accommodating the additives, 1994. Laboratoirs de Mathématics Discrètes, University of Marseille.

[Gir96] Jean-Yves Girard. Proof-nets; the parallel syntax for proof-theory. In P. Agliano and A. Ursini, editors, Logic and Algebra. Marcel Dekker, New York, 1996.

[GLT89] Jean-Yves Girard, Yves Lafont, and Paul Taylor. Proofs and Types, vol. 7 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1989.

[Has97] Masahito Hasegawa. Recursion from cyclic sharing: traced monoidal categories and models of cyclic λ-calculi. In Proceedings of TCLA ’97, Nancy, France, LNCS. Springer, April 1997. To appear.

[HdP93] J. M. E. Hyland and Valeria C. V. de Paiva. Full intuitionistic linear logic (extended abstract). Annals of Pure and Applied Logic, vol. 64 no. 3, pp. 273–291, 1993.

[HG] M. Hasegawa and P. Gardner. On higher order action calculi and notions of computation. To Appear, TACS ’97.

[HHP93] Robert W. Harper, Furio Honsell, and Gordon D. Plotkin. A framework for defining logics. Journal of the ACM, vol. 40 no. 1, pp. 143–184, January 1993.

[HM94] Joshua Hodas and Dale Miller. Logic programming in a fragment of intuitionistic linear logic. Information and Computation, vol. 110 no. 2, pp. 327–365, 1994. A preliminary version appeared in the Proceedings of the 6th symposium on Logic in Computer Science, pages 32–42, Amsterdam, The Netherlands, July 1991.

[HP95] C. Hermida and J. Power. Fibrational control structures. In Proceedings of CONCUR ’95, vol. 962 of Lecture Notes in Computer Science, pp. 117–129. Springer, 1995.

[HPW96] James Harland, David Pym, and Michael Winikoff. Programming in Lygon: An overview. In M. Wirsing and M. Nivat, editors, Algebraic Methodology and Software Technology, pp. 391–405, Munich, Germany, July 1996. Springer-Verlag LNCS 1101.

[IP] S. Ishtiaq and D. Pym. A relevant analysis of natural deduction. Submitted.

[KL80] G. M. Kelly and M. L. Laplaza. Coherence for compact closed categories. Journal of Pure and Applied Algebra, vol. 19, pp. 193– 213, 1980.

[KM72] G. M. Kelly and S. MacLane. Coherence for closed categories. Journal of Pure and Applied Algebra, vol. 1, pp. 97–140, 1972.

[Laf90] Yves Lafont. Interaction nets. In Proceedings of the Seventeenth ACM Symposium on Principles of Programming Languages, pp. 95– 108. ACM Press, January 1990.

[Laf95] Yves Lafont. From proof-nets to interaction nets. In Advances in Linear Logic, no. 222 in London Math. Soc. Lecture Notes, pp. 225–247. Cambridge University Press, 1995.

[Lam89] Joachim Lambek. Multicategories revisited. In J. W. Gray and A. Scedrov, editors, Categories in Computer Science and Logic, vol. 92 of Contemporary Mathematics, pp. 217–240, 1989.

[Lam90a] Joachim Lambek. Logic without structural rules. Kleene Festschrift, 1990.

[Lam90b] J. Lamping. An algorithm for optimal lambda calculus reduction. In Proc. 17th Annual ACM Symposium on Principles of Programming Languages, San Francisco, pp. 16–30. ACM Press, New York, NY, January 1990.

[Lév80] Jean-Jaques Lévy. Optimal reductions in the lambda-calculus. In J. P. Seldin and J. R. Hindley, editors, To H. B. Curry: Essays in Combinatory Logic, Lambda Calculus and Formalism, pp. 159–191. Academic Press, 1980.

[LM92] P.D. Lincoln and J.C Mitchell. Operational aspects of linear lambda calculus. In Proceedings of the 7th symposium on Logic in Computer Science, pp. 235–247, 1992.

[LS86] Joachim Lambek and Philip J. Scott. Introduction to Higher Order Categorical Logic, vol. 7 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, 1986.

[Mac63] S. MacLane. Natural associativity and commutativity. Rice University Studies, vol. 49, pp. 28–46, 1963.

[Mac71] S. MacLane. Categories for the Working Mathematician. Springer-Verlag, Berlin, 1971.

[Mac94] Ian Mackie. The Geometry of Implementation. PhD thesis, Department of Computing, Imperial College of Science Technology and Medicine, 1994.

[Mil93a] Robin Milner. Action calculi III: Higher-order calculi. Electronically available as ac3.ps at ftp://ftp.cl.cam.ac.uk/users/rm135, July 1993.

[Mil93b] Robin Milner. Action calculi IV: Molecular forms. Electronically available as ac4.ps at ftp://ftp.cl.cam.ac.uk/users/rm135, November 1993.

[Mil93c] Robin Milner. Action calculi, or syntactic action structures. In Andrzej M. Borzyszkowski and Stefan Sokolowski, editors, Mathematical Foundations of Computer Science 1993, 18th International Symposium, vol. 711 of Lecture Notes in Computer Science, pp. 105–121, Gdansk, Poland, 3 September–30 August 1993. Springer.

[Mil94a] Dale Miller. A multiple-conclusion meta-logic. In S. Abramsky, editor, Proceedings of the 9th symposium on Logic in Computer Science, pp. 272–281, Paris, France, July 1994.

[Mil94b] R. Milner. Higher order action calculi. In Computer Science Logic ’93, Selected Papers, vol. 832 of Lecture Notes in Computer Science, pp. 238–260. Springer, 1994.

[Mil94c] Robin Milner. Action calculi V: Reflexive Molecular forms. Electronically available as ac5.ps at ftp://ftp.cl.cam.ac.uk/users/rm135, June 1994.

[Mil96] Robin Milner. Calculi for interaction. Acta Informatica, vol. 33 no. 8, pp. 707–737, 1996.

[MMP95] Alex Mifsud, Robin Milner, and John Power. Control structures. In Proceedings, Tenth Annual IEEE Symposium on Logic in Computer Science, pp. 188–198, San Diego, California, 26–29 June 1995. IEEE Computer Society Press.

[Mog89] Eugenio Moggi. Computational lambda calculus and monads. In Proceedings of the 4th symposium on Logic in Computer Science, pp. 14–23. IEEE Computer Society Press, 1989.

[Mog91] Eugenio Moggi. Notions of computation and monads. Information and Computation, vol. 93 no. 1, pp. 55–92, July 1991.

[MPP92] Dale Miller, Gordon Plotkin, and David Pym. A relevant analysis of natural deduction. Talk given at the Workshop on Logical Frameworks, Bastad, Sweden, May 1992.

[MPW92] R. Milner, J. Parrow, and D. Walker. A calculus of mobile processes, Part I + II. Information and Computation, vol. 100 no. 1, pp. 1–77, 1992.

[MRA93] Ian Mackie, Leopoldo Román, and Samson Abramsky. An internal language for autonomous categories. Journal of Applied Categorical Structures, vol. 1 no. 3, pp. 311–343, 1993.

[Ong96] C.-H. L. Ong. A semantic view of classical proofs. In Proceedings of the 11th symposium on Logic in Computer Science. IEEE, Computer Society Press, 1996.

[OTPT95] P. W. O’Hearn, M. Takayama, A. J. Power, and R. D. Tennent. Syntactic control of interference revisited. In MFPS XI, conference on Mathematical Foundations of Program Semantics, vol. 1 of Electronic Notes in Theoretical Computer Science. Elsevier, March 1995.

[Par92] Michel Parigot. λμ-calculus: An algorithmic interpretation of classical natural deduction. In Proceedings of the International conference on Logic Programming and Automated Deduction, vol. 624 of Lecture Notes in Computer Science, pp. 190–201, 1992.

[Par93] Michel Parigot. Strong normalization for second order classical natural deduction. In Proceedings of the 8th symposium on Logic in Computer Science, pp. 39–46. IEEE Computer Society Press, 1993.

[Pfe94] Frank Pfenning. Structural cut-elimination in linear logic. Technical Report CMU-CS-94-222, Dept. of Computer Science, Carnegie Mellon Univ., Dec. 1994.

[PH94] David J. Pym and James A. Harland. The uniform proof-theoretic foundation of linear logic programming. Journal of Logic and Computation, vol. 4 no. 2, pp. 175–207, April 1994.

[Plo93a] G. Plotkin. Second-order propositional intuitionistic linear logic. Unpublished Notes, 1993.

[Plo93b] G. Plotkin. Type theory and recursion. In Proceedings of the 8th symposium on Logic in Computer Science, Montreal, p. 374. IEEE Computer Society Press, 1993. (Abstract).

[Pow96] A. J. Power. Elementary control structures. In Proceedings of CON-CUR ’96, vol. 1119 of Lecture Notes in Computer Science, pp. 115– 130. Springer, 1996.

[PR94] J. Power and E. P. Robinson. Premonoidal categories and notions of computation. to appear in MSCS, 1994.

[PRT93] Benjamin C. Pierce, Didier Rémy, and David N. Turner. A typed higher-order programming language based on the pi-calculus. In Workshop on Type Theory and its Application to Computer Systems, Kyoto University, jul 1993.

[Sch94] H. Schellinx. The Noble Art of Linear Decorating. PhD thesis, Institute of Logic, Language and Computation, University of Amsterdam, 1994. ILLC-Dissertation Series, 1994-1.

[See89] Robert A. G. Seely. Linear logic, ∗-autonomous categories and cofree coalgebras. In John W. Gray and Andre Scedrov, editors, Categories in Computer Science and Logic, vol. 92 of Contemporary Mathematics, pp. 371–382, Providence, Rhode Island, 1989. American Mathematical Society.

[Sol90] S. V. Soloviev. On the conditions of full coherence in closed categories. Journal of Pure and Applied Algebra, vol. 69, pp. 301–329, 1990.

[Sza75] F. Szabo. Polycategories. Communications in Algebra, vol. 3, pp. 663–689, 1975.

[Wad71] C. P. Wadsworth. Semantics and Pragmatics of the lambda calculus. PhD thesis, Oxford, 1971.

[Wad90] Philip Wadler. Linear types can change the world! In M. Broy and C. Jones, editors, Programming Concepts and Methods, Sea of Galilee, Israel, April 1990. IFIP TC2 Working Conference on Programming Concepts and Methods, North-Holland.

[Wad92] Philip Wadler. There’s no substitute for linear logic. In Eighth International Conference on the Mathematical Foundations of Programming Semantics, Oxford, April 1992.

[Wad93] Philip Wadler. A syntax for linear logic. In Ninth International Conference on the Mathematical Foundations of Programming Semantics, vol. 802 of LNCS, pp. 513–529. Springer Verlag, April 1993.

Index to Notation

a, b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .actions, or terms of the action calculus c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . constants in the type-theory DILL(ℂ) d, e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . clauses of relations and pre-relations f, g, h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .arrows in categories i, j . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . indices l, k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . linear primes in the action calculus m, n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . arities in the action calculus o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . generalised objects, only in appendix A p, q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . intuitionistic primes in the action calculus r, s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . integers for index bounds t, u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . terms of DILL(ℂ) v, w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . terms of Lin(𝕆, 𝔸) x, y, z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . variables from the set X

A, B, C . . . . . . . . . . . .formulae and types of DILL(ℂ) and linear types of Lin(𝕆, 𝔸) D, E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . relations and pre-relations F, G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .functors between categories M, N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . terms of ILL(ℂ) O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . operators of a signature 𝕆 Q, R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .intuitionistic types of Lin(𝕆, 𝔸) X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . set of variables X, Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . objects of categories

𝔸 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . axiom sets of Lin(𝕆, 𝔸) A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .action models C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . set of assumptions of DILL C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . constant set from DILL-signatures ℂ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DILL-signature G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . models of Lin(𝕆, 𝔸) ℍ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . higher-order signatures H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . higher-order models K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . controls of the action calculus 𝕂 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . action calculi signatures K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . operator sets from action calculi signatures L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . models of DILL(ℂ)

M_{L} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . linear type sets from generalised signatures M_{I} . . . . . . . . . . . . . . . . . . . . . . . . . . intuitionistic type sets from generalised signatures O_{L} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . linear operators of generalised signatures O_{I} . . . . . . . . . . . . . . . . . . . . . . . . . . . . intuitionistic operators of generalised signatures O . . . . . . . . . . . . . . . . . . . . . . . . . . output-parameterised sets of operators of Lin(𝕆, 𝔸) 𝕆 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .generalised signatures P_{L} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . linear prime sets from action calculi signatures,

and primitive type set from DILL-signatures

P_{I} . . . . . . . . . . . . . . . . . . . . . . . intuitionistic prime sets from action calculi signatures

Index to Definitions

Signatures action calculus (𝕂). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 action calculus, intuitionistic (𝕂) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 dual intuitionistic linear logic (ℂ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 generalised (𝕆). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 higher-order (ℍ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

Type Theories for action calculi (Lin^{A}(𝕂)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 for action calculi, higher-order (Lin^{A^{⇒}}(𝕂)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 for action calculi, linear higher-order (Lin^{A^{⊠,⊸}}(𝕂)) . . . . . . . . . . . . . . . . . . . . 140 for action calculi, with code (Lin^{A^{⊠}}(𝕂)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 of dual intuitionistic linear logic (DILL(ℂ)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 generalised linear (Lin(𝕆, 𝔸)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 generalised linear, higher-order (Lin^{H}(ℍ, 𝔸)) . . . . . . . . . . . . . . . . . . . . . . . . . . 150 generalised linear, higher-order constant (Lin^{HC}(ℍ, 𝔸)) . . . . . . . . . . . . . . . . 152 generalised linear, higher-order output natural (Lin_{O}^{HC}(ℍ)) . . . . . . . . . . . . . 168 of intuitionistic linear logic (ILL(ℂ)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 for linear logic, generalised linear (Lin^{D}(ℂ)) . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Models action model (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 for dual intuitionistic type-theory (L). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 for general linear type-theory (G) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 for general linear type-theory, output-natural (G) . . . . . . . . . . . . . . . . . . . . . 114 for higher-order generalised linear type-theory (H) . . . . . . . . . . . . . . . . . . . . 154

Categories of Models of small Lin^{A}(𝕂)-models (Cat_{Lin}_{A}(𝕂)). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 of small Lin^{A^{⇒}}(𝕂)-models (Cat\overrightarrow{Lin^{A}}(𝕂)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 of small Lin^{D}(ℂ)-models (Cat_{Lin}_{D}(ℂ)). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 of small Lin(𝕆, 𝔸)-models (Cat_{Lin}(𝕆, 𝔸)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 of small Lin^{HC}(𝕆, 𝔸)-models (Cat_{Lin}_{HC}(𝕆, 𝔸)) . . . . . . . . . . . . . . . . . . . . . . . . . . 158 of small Lin^{H}(ℍ, 𝔸)-models (Cat_{Lin}_{H}(ℍ, 𝔸)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 of small action models (Cat_{AC}(𝕂)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 of small dill models (Cat_{DILL}(ℂ)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 of small higher-order action models (Cat_{AC}^{⇒}(𝕂)) . . . . . . . . . . . . . . . . . . . . . . 147 of small output-natural Lin(𝕆, 𝔸)-models (Cat_{Lin}^{O}(𝕆, 𝔸)) . . . . . . . . . . . . . . . 117

268