Anni Fa Ehrhard

Regnier

Merci Ègalement

Stefano Guerrini

Simone Martini

Van Femke

Simona Raamsdonk

Ronchi

Zeinab

Elena Guillaume

Teresa Matteo

Paolo

Carole Daniel

Gwen

Nour J-J Clarisse

Axel Boris

Florent, Dina, Nick, Sarah, Khautar, Tiffaine, Aloÿs, Emna, Yousra, Massinissa, Rimez, Rabeb, Ikram, Hiba Ugo Linda

Antoine Giulia

Keywords: calcolo, guadagnando due vantaggi: innanzitutto, Lambda-calcolo, espansione di Taylor, lambda-mu-calolo, proprietà sintattiche, alberi di Böhm, logica lineare, topologia, call-by-value, fondamenti della matematica Lambda-calculus, Taylor expansion, lambda-mu-calculus, syntactical properties, Böhm trees, linear logic, topology, call-by-value, foundations of mathematics ⊥ | λx 1 . . . x n .y

di un programma scritto λ-calcolo.

"Je voudrais que ma vie et ma mort servent à quelque chose" Aurait-il-dit Prof. Samuel Paty, décapité près de Paris en 2020 par un fondamentaliste religieux, pour avoir enseigné la liberté de conscience à ses élèves.

Résumé

Il y a un peu moins de 20 ans, Ehrhard et Regnier, inspirés par la sémantique de la logique linéaire, ont découvert la possibilité d'effectuer un développement de Taylor d'un programme dans le cadre du λ-calcul. Même en oubliant les coefficients rationnels, les termes qui apparaissent dans le développement de Taylor d'un programme contiennent de l'information quantitative sur le programme lui-même. Si l'on considère ces termes sensibles aux ressources, on obtient une théorie de l'approximation qui est plus simple que l'originelle et qui est encore intéressante. Or, en mathématiques, une notion d'approximation est d'habitude vue comme un outil pour prouver des propriétés des objets que l'on approxime: ce sera également notre approche dans ce manuscrit. Dans la première partie de la thèse, on définit cette théorie de l'approximation par ressources et on l'applique à des résultats, qui sont déjà connus mais fondamentaux, du λ-calcul. On montre notamment que, dans une certaine mesure, cela subsume la théorie classique de l'approximation qui est basée sur les arbres de Böhm et sur la continuité, et on le fait en fournissant des nouvelles preuves de ces résultats importants. Nos techniques de preuves utilisent toutes les propriétés cruciales de telles notions d'approximation, notamment la linéarité, la normalisation forte et la confluence. On obtient ainsi une nouvelle formulation d'une partie importante du λ-calcul, qui en plus apporte deux avantages: premièrement, même si nos preuves ne sont pas du tout triviales, elles sont tout de même plus "basiques" que celles traditionnelles, dans le sens où elles sont basées sur l'induction (à la base de la définition du développement de Taylor) au lieu de la coinduction (à la base de la définition d'arbre de Böhm); deuxièmement, on peut voir de cette façon que tous ces résultats, qui sont d'habitude prouvés avec des techniques ad-hoc et dépendants les uns des autres, sont en réalité indépendants et proviennent tous d'une seule technique: l'approximation par ressources (et la commutation d'Ehrhard et Regnier entre la normalisation et le développement).

Cette notion d'approximation, et en général la formule du développement de Taylor, a un troisième avantage: elle est facilement transportable à d'autres langages de programmation, et cette direction de recherche a été souvent empruntée dans les années récentes. Dans une deuxième partie de la thèse, on se tourne justement vers cette optique, et on adapte l'approximation par ressources au λµ-calcul, l'un des habituels langages de programmation fonctionnels (impurs) qui sont en correspondance de Curry-Howard avec la logique classique. Même si plusieurs définitions et propriétés sont simples à adapter dans ce nouveau cadre, les preuves de normalisation forte et de confluence du calcul avec ressources associé ne sont pas immédiates. Enfin, on s'attaque à la question des applications de ces outils; on montre comment reproduire, dans le λµ-calcul, les preuves données avant pour le λ-calcul pour établir la propriété de Stabilité et celle des Lignes Perpendiculaires. Ce sont deux nouveaux résultats sur la structure mathématique du λµ-calcul. On remarquera aussi que la preuve de la propriété de Stabilité peut être également adaptée dans le cadre du λ-calcul avec appel par valeur.

On conclut le manuscrit avec des réflexions qui ont pour but de lier des méthodes d'homotopie avec la sémantique dénotationnelle de la logique linéaire, mais aussi avec des réflexions méthodologiques et philosophiques sur le statut de notre discipline de recherche.

Mot-clés: Lambda-calcul, developpement de Taylor, lambda-mu-calcul, propriétés syntaxiques, arbres de Böhm, logique linéaire, topologie, appel par valeur, fondements des mathématiques.

Brief outline of the thesis

This manuscript is organized in 5 chapters, which can be in turn organized in the three main parts which follow below. Each chapter, as well as most of the sections, begins with a "plan" where we detail its content and our contributions; in addition to that, Chapter 3 and Chapter 4 end with some conclusive comments and the main possible future works. We refer the reader to those explanations for the details. In particular:

-Part 1: Chapter 1 and Chapter 2. These first two chapters are introductory: in the present Chapter 1 we introduce the main topics which constitute the general framework of this thesis, and in Chapter 2 we quickly give some basic details about λ-calculus and Böhm trees. The content of this part is explicitly high level and less formal.

-Part 2: Chapter 3 and Chapter 4. It constitutes the main part of the thesis. In Chapter 3, whose detailed description can be found at Section 3.1, we first consider the resource approximation theory for λ-calculus and then we study its relation with the approximation theory based on Böhm trees. Details about this latter section are given at the beginning of Section 3.5. We refer to Section 3.6 for the conclusive comments. We also quickly reproduce some results in the call-by-value framework; we refer to the beginning of Section 3.4 for the details.

In Chapter 4, we introduce the resource approximation theory for λµ-calculus and show how one can reproduce some important results of the previous chapter in this framework. A detailed plan is given at Section 4.1. We also refer to Section 4.5 for the conclusive comments.

-Part 3: Chapter 5. This chapter is not about approximating programs; instead, it collects a scratch of a possible research direction (Section 5.2.2), as well as our "meditations" about some methodological and philosophical issues related to our discipline of research (Section 5.2.1 and Section 5.3). Its detailed plan is given at Section 5.1.

The λ-calculus

The λ-calculus was introduced by Alonzo Church around 1930 as a "formal calculus" for manipulating functions in their generality, with the idea of founding mathematics taking the notion of function as primitive, instead of the more common approach considering sets. The Kleene-Rosser paradox [START_REF] Kleene | The inconsistency of certain formal logics[END_REF], and Curry's paradox involving its famous "Y fixed point combinator" [START_REF] Haskell | The paradox of Kleene and Rosser[END_REF], show that, from a logical point of view, the theory does not allow to provide a sound CHAPTER 1. INTRODUCTION foundations of mathematics 1 . But, for a great part thanks to Kleene, it was understood that this calculus could be used to model the intuitive notion of computable function on integers. This same notion was being formalized in the same years by Turing with his Turing-machines, and by Herbrand-Gödel, Kleene and others with the "partial recursive functions". Gödel was initially convinced that any intuitively computable function is Turing-computable, but was not so convinced about the same for partial recursive or lambda-definable ones (see [START_REF] Davis | Why Gödel didn't have Church's thesis[END_REF], pag. 12). Turing-machines are so convincingly close to the intuitive notion of computation, that they become the unity of measure for the notion of computable functions, and one calls Turingcomplete any system which is as expressive as Turing-machines. But if Turing-machines are so intuitive, they are also, mathematically speaking, quite inelegant objects: at the end of the day, a Turing-machine essentially reduces a program to a mere sequence of instructions on some hardware 2 . At the same time, it is exactly thanks to this point of view that in this formalism the notion of step of computation is clear and elementary. That is why this approach is extremely fertile if one wants to take into account the temporal and spatial resources that a computation needs.

But if one cares about developing a real mathematical theory of algorithms (and not of what is computable), since this means to find in some way the "essence" of what an algorithm is, one should abstract as much as possible from implementation details, and turn to other formalisms. One could think that a valid alternative for achieving this goal could be the theory of partial recursive functions: in fact, they are Turing-complete. The big advantage of that approach is to completely depart from implementation details, and to have a nice mathematical definition 3 . But expressing an algorithm as such a particular kind of functions from N to N means -as in all mathematics -reducing it to sets. This is not quite satisfying, as Scott in [START_REF] Scott | A type-theoretical alternative to ISWIM, CUCH, OWHY[END_REF] would explain better than us:

For the purposes of understanding computation, however, set-theoretical formalism is not too helpful in any direct way. In the first place, too much of set theory concerns the transfinite, and ordinary computation has rather to do with finite processes. In the second place the axioms of set theory are meant to capture something essential of the idea of an arbitrary subset, while computation theory is more interested in the notion of an algorithmically defined subset (or function). Of course, one can define in set theory such notions as that of a general recursive function, but such definitions do not emphasize enough what is special about algorithms. Nor is it generally clear when a defined function is recursive. So what we want is a "restricted" system that is specially designed for algorithms.

What is so special about algorithms is. . . the fact that they compute! By reducing an algorithm to a static set of pairs, one makes the crucial notion of step of computation disappear. So recursive function have abstracted too many details. Hence, one wants to depart from having the idea of set as the basic notion, and depart from being static. Quoting again [START_REF] Scott | A type-theoretical alternative to ISWIM, CUCH, OWHY[END_REF]: a "dynamical system", as Turing-machines, and it abstracts from implementation details4 , as recursive functions, while still having a "clear" notion of step of computation, the β-reduction. The fact that the integer functions that are representable inside λ-calculus are exactly the same as the ones computable with a Turing-machine provides (together with the equivalence with partial recursive functions and other "models of computation") the major support for the so-called Church-Turing thesis: the intuitive notion of computable function from integers to integers is exactly given by any of those equivalent models of computation. The conceptual price to pay when considering λ-calculus is that we are no longer dealing with algorithms for themselves but only with one chosen representation5 of them (they will be words respecting some syntactic constraints); that is, we are dealing with (functional) programs.

It is only many decades after the introduction of λ-calculus, around the 60's and the 70's, that this formalism got much more attention in the academic community, from mathematicians but in particular from the just born community of (theoretical) computer scientists. Today, we would say that:

-for a mathematician, λ-calculus is the mathematical theory of functions as algorithms, which is rich and very different from mainstream mathematics;

-for a computer scientist, λ-calculus provides a mathematical theory of functional programming; something that does not exist -at least not in that mathematical strengthfor the other programming paradigms;

-for a logician, λ-calculus is the core of the best suited programming language for studying the several manifestations of the Curry-Howard correspondence.

Not only the mathematics of λ-calculus is non-trivial and interesting but, if one considers it together with the whole area of research in "computer science logic", it has crucial applications in real life: the birth itself of the mathematical investigation of computation, as well as of the practical idea of computers, was mainly due to mathematical logic in the first half of the XX th century, and the abstract study of programming languages (for safety reasons but not only) is nowadays done, for a great part, via λ-calculus and/or proof theory; consequently, this places those branches of mathematics among the ones with the most outstanding applications, contrary to what many usually think. Let us clarify the point of "functions as algorithms", which is clear to computer scientists but less explicit in mathematics, and is at the core of λ-calculus. Consider the following examples:

1. define functions F 1 , F 2 : N 4 → N setting, ∀x, y, z, n ∈ N, F 1 (x, y, z, n) := 0 and F 2 (x, y, z, n) := 0 if xyzn = 0 or n = 1 or n = 2 or x n + y n = z n 1 otherwise

Thanks to A. Wiles we know that F 1 = F 2 . However, it is clear that the way we defined them is radically different, independently from the truth of Fermat's last theorem.

2. let Bool := {0, 1} and let leftOr : Bool 2 → Bool, with leftOr(x, y) defined via the following algorithm: if x = 1 then 1 else y, and let rightOr : Bool 2 → Bool, with rightOr(x, y) defined via the following algorithm: if y = 1 then 1 else x. As functions, we have: leftOr = rightOr. But, seen as algorithms, then they become different; not only syntactically, but more interestingly they satisfy different properties: indeed, we can take as x an argument which loops -call it ⊥ -and obtain that leftOr(⊥, 1) is undefined while rightOr(⊥, 1) = 1. Since the years '30 we know that in order to really deal with the notion of algorithms, one has to consider partial functions. Considered as partial functions from (Bool ∪ {⊥}) 2 to Bool, leftOr and rightOr are different.

These examples show that there is an aspect, to which one usually refers by the word intentionality, which is consciously neglected in the mathematical notion of functions; this aspect is the way a function is given, i.e. the "expression" that defines it. Often, in order to reach the needed level of abstraction one deals with in mathematics, one has to employ a more abstract way of defining functions and free themselves from the actual way a function is given -typically by some "law"; it only counts the relation "input/output". Whence, the notion of function as a relation. This way of understanding functions is usually called extensional, since from this point of view two functions are equal iff the relations defining them have exactly the same points, i.e. they are equal as sets -and in set theory this property is called axiom of extensionality.

The point of λ-calculus (and of theoretical computer science, really), is not to refuse the way mathematics treats functions: the point is, on the contrary, to actually render the abstract notion of "intensional function" the object of a mathematical study.

Mathematical logic: intuitionistic vs classic

The word Logic comes from the Greek logos, which mainly meant "reason" and "language". In fact, Logic was born in Greece by Aristotle, and developed in two main topics: the (philosophical) study of (human) reason and (human) language. After Aristotle, Scolastics used it in relation to theology, then it went transcendental with Kant and dialectical with Hegel. But the real breakthrough came at the end of the XIX th , when it became (probably forever?) mathematical. The adjective mathematical is added at two different layers: first, we do not study all human reason and language anymore, but only the mathematical ones; second, we realize this study using mathematical tools and from a mathematical point of view. In other words, one is interested in the mathematical study of mathematics itself, reason for which the discipline is sometimes called "metamathematics". Quoting Bourbaki's introduction to the volume "Théorie des ensembles" of his " Élements de mathématiques": Depuis les Grecs qui dit mathématique dit démonstration. It is clear then that the mathematical reasoning is expressed by the proofs.

For what concerns the mathematical language, we mean more or less "the rest", namely axioms and in general mathematical statements. Mathematical logic can be thus divided into two main areas, which are called respectively "proof theory" and "model theory". For historical reasons 6 the second area is the one which developed faster. Starting from the years '60 proof theory knew an incredible development, thanks to computer science. Historically speaking, mathematical logic was born in the second half of the XIX th mainly due to the following situation: mathematics was becoming more and more abstract (also in the Hilbertian sense of "infinitary"), and it was natural to think about an essential unity of all the discipline, together with some justification of its solid foundation, in particular the absence of contradictions in it. However, several antinomies -that is, real contradictions -appeared. The following are the most famous:

1. Berry's paradox 7 : consider the number b defined as "the smallest integer not definable in under than 12 English words". Does b exist? Either way, we have a contradiction. 6 We would say that one of the main reasons is the fact that in order to really understand what proof theory is about, one needs at the very least a clear notion of "computable", which was not there until 1936. Furthermore, a deeper comprehension of the discipline is possible only after the notion of programming was introduced, so at least after the 50's.

7 Often named as/confused with Richard's paradox. It was written by Russel but credited to some Berry.

2. Russel paradox8 : consider the set R of all sets that do not belong to themselves. Does R belong to R? Either way, we have a contradiction. 4. Cantor's paradox: consider the set U of all sets. So P(U ) ⊆ U and thus Card(P(U )) ≤ Card(U ). This contradicts Cantor's cardinality theorem.

We know that, in any case, no contradiction will ever appear in "practical mathematics", and we can sleep more than reassured; but there is something we could do: investigate this phenomenon, maybe coming out with some arguments telling us which parts of mathematics are certainly free from contradictions, which would be very nice and reassuring. To attack this questions, one should have a "mathematical copy" of a given part of mathematics to mathematically study, eventually aiming to construct the "bigger" system possible. This is precisely how mathematical logic was born, under the influence of three of the major father founders of the discipline: Frege, Russel and Hilbert.

Even if this manuscript, strictly speaking, is not about mathematical logic, its topics are tightly related with proof theory, so let us mention some basic ideas of the discipline. One can begin with the simple remark that every mathematical statement has one of the following shapes: either it is an "atomic" statement directly expressing a property of some entity, or is constructed from other statements by means of a conjunction, or disjunction, or implication, or quantification (existential or universal ). In order to distinguish a formal statement from a mathematical one, one first fixes a series of symbols associated with the properties one wants to talk about, and then composes formal statements using the symbols ∧, ∨, →, ∃, ∀ instead of the above italics words. Formal statements thus built are known as formulas. The next step is to decide how to represent proofs as interesting mathematical objects. This is far from being trivial 9 . The most common way of representing formal proofs is through sequent calculus or natural deduction, both introduced by Gentzen in the same years. The idea is to represent a proof as a tree, called a "derivation", whose nodes are pairs (Γ, ∆) -written "Γ ∆" and called sequent or judgment -of finite multiset of formulas. Derivations are then constructed inductively by means of rules merging a finite number of inductively defined derivations within a new one, and they are defined in order to be logically correct: this means that, if we read a sequent as the implication Γ → ∆10 , then assuming all the hypotheses (the leaves of the derivation tree) the conclusion (the root of) holds as well. There are two main classes of formal systems one can construct in this way: intuitionistic and classical ones. The difference is reflected in two layers: in an intuitionistic framework, the second component of sequents is restricted to having at most one formula; moreover, one does not include the rule representing the reasoning by contradiction. The two systems so defined are very different and the intuitionistic one is strictly included in the classical one, meaning that the former is a subsystem of the latter which cannot simulate it. Let us give the main rules for a very basic system, known as "propositional intuitionistic logic" (we only give here the "implicative" framework):

A → B A B
Destructor of an implication A B A → B Constructor of an implication to which one adds an "axiom rule" saying that the one leaf tree Γ, A A is always a derivation. In order to pass from this system to "minimal propositional classical logic", one can add the following rule:

((A → B) → A) → A Peirce law
Equivalently, one can add a rule representing the reasoning by contradiction or a rule representing the tertium non datur. The equivalence means that adding any of such rules to minimal propositional intuitionistic logic, allows to prove the other two rules.

We have to mention another crucial point in proof theory: cut-elimination. Suppose to have a derivation π 1 of A, and consider the following derivation of A:

π 2 := A A A → A π 1
A It is clear that π 2 is redundant, since it already contains the "simpler" π 1 . It is important to notice that, in order for π 2 to be redundant, it has to introduce the implication A → A and, immediately after, consume it by applying it to π 1 . Such a configuration is the prototypical case of a "cut"11 in a derivation. Motivated by coherence-proofs, in the '30 Gentzen was led to study the structure of derivations. He made the fundamental discovery of a series of basic manipulations, each of them transforming a derivation of a sequent in another derivation of the same sequent, which can be consecutively applied to any starting derivation admitting some cuts in order to eventually end on a derivation (thus, a derivation of the same sequent as the first one) which do not contain cuts anymore. This result -called cut-elimination -endows the set of derivations with a dynamics, and sets the beginning of modern proof theory. In the case of intuitionistic logic, each rule of cut-elimination defines a function which transforms a given derivation into exactly another one. That is, intuitionistic derivations obey to a deterministic cut-elimination, which is in addition strongly normalising, confluent and admits non-trivial denotational semantics. The case of classical logic is more subtle: in sequent calculus 12 , there are derivations such as:

A A A A A ∨ A A, A A ∨ A A A A A A A, A A ∧ A A A ∧ A

A ∨ A A ∧ A which give rise to an infinite cut-elimination reduction sequence, thus making cut-elimination not strongly normalising. The same derivation can also produce different normal forms. This aspect is better seen in the following derivation:

π = π 1 Γ ∆, A π 2 A, Γ ∆ Γ ∆
where π 1 and π 2 are both derivations of the sequent Γ ∆. Such a proof π rewrites, by cutelimination, both in π 1 and in π 2 , which can be normal and distinct, thus making cut-elimination not confluent. This example is known as Lafont's critical pair [START_REF] Girard | Proofs and Types[END_REF]. Furthermore, this means that the equivalence induced by cut-elimination identifies all proofs, and thus any denotational semantics must be trivial. For a long time it was thought that this was it, about cut-elimination for classical logic. But, mainly thanks to Griffin's [Gri90], Girard's LC [START_REF] Girard | A new constructive logic: classic logic[END_REF], Parigot's FD [START_REF] Parigot | Free deduction: An analysis of "computations" in classical logic[END_REF] and CD [START_REF] Parigot | Lambda-mu-calculus: An algorithmic interpretation of classical natural deduction[END_REF], and Danos, Joinet, Shellinx's analysis in [START_REF] Vincent Danos | A new deconstructive logic: Linear logic[END_REF], it was understood where the "problems" of classical cut-elimination are, and in which sense one can "constructivize" classical logic by means of better syntaxes.

The Curry-Howard correspondence: intuitionistic vs classic

Let us go back to λ-calculus, and consider a restriction of it -the simply-typed λ-calculus -, introduced again by Church, and proved to be consistent by Rosser. From the point of view of computability this restriction is too strong, because the algorithms representable in it are a proper class of the always terminating ones, but it is still interesting when related with weaker notions of computability which are no more Turing-complete. We could say that the main point in the simply-typed λ-calculus is to "see" a λ-term as an ordinary mathematical function. This is easily done: if we have a function F : A → B and an element a : A, we can apply F to a and get an element F (a) : B. Let us write it as:

F : A → B a : A F (a) : B
Also, let us say we have an expression M = M {x} depending on a variable x; suppose that when we substitute x in M for an element a : A, we get an M (a) : B. Then we can "see" the expression M as a function of x, going from A to B. Such a function is denoted by λx.M . Let us write this fact as:

x : A M : B λx.M : A → B In order to compute the application F (a) of a function F = λx.M on an element a of the domain of F , one has to substitute in the expression M all the occurrences of x by a; this substitution is written M {a/x}, and the result belongs to the codomain of F . So we have:

(λx.M )(a) → β M {a/x}.
The system we just defined by those "typing rules" is the simply-typed λ-calculus (and by forgetting the information about types one gets the untyped λ-calculus). One of the main interests in this restricted calculus is the striking similarity with elementary logical rules. In particular, if we forget the λ-terms, we recognise the already mentioned rule for introducing an implication, and the rule for eliminating it. This is the first layer of the so-called Curry-Howard correspondence, which is also called "formulas-as-types correspondence" for the reason just explained. Also, one can see that -once we have fixed types for the variables -the λterms in a typing derivation carry all the information of the types one is using; actually, a typing derivation becomes, when forgetting about the λ-terms, the proof of the formula which is the type of the final λ-term, and that vice-vera any proof can be written as a typed λ-term in a given typing-context (corresponding to the hypotheses). This is why one also calls the correspondence "proofs-as-programs". Mathematically speaking, all this is quite elementary. The second layer of the Curry-Howard correspondence is much more interesting, because it says that this correspondences are not just happy coincidences. The already mentioned cutelimination algorithm -discovered by Gentzen years before the birth of programming and with completely different motivations -corresponds to execution of programs in the following sense: if a proof π of a sequent Γ A rewrites in one step of cut-elimination to a proof π (necessarly of the same sequent Γ A), then the λ-term M associated with π in the simply-typed λ-calculus13 β-rewrites in one step to the term N corresponding, in the same sense, to the proof π . Thus the correspondence lifts to the dynamics, and this is why it is also known as "Curry-Howard isomorphism". This result is, mathematically speaking, less trivial.

If this correspondence is, at a first look, perhaps surprising, one can argue that from a logical point of view it is very restricted: the logical system that we used only treats implication and, although being implication at the heart of logic, one cannot prove much in this system; it is the already mentioned minimal propositional intuitionistic logic. Now, something definitely relevant in the investigation of the mathematical nature of proofs, is that the same correspondence lifts to much more complicated systems of interest. We will not dwell on how important, from the point of view of mathematics, computer science and philosophy, this phenomenon is, but let us just say that, in a sense, it is the result which motivates the existence itself of a unique discipline of proofs and programs, which constitutes an important part of theoretical computer science 14 .

We will consider now a more specific question: extending the correspondence from minimal propositional intuitionistic logic to classical one, whose possibility was not even clear. The situation changed at the beginning of the 90's thanks to Griffin [START_REF] Griffin | A formulae-as-types notion of control[END_REF], who proposed to type control operators, such as Scheme's callcc or Felleisen's C, with Peirce law. This retrieves classical logic since we already mentioned that, in intuitionistic logic, adding Peirce's law is equivalent to adding the law of excluded middle or the law of contradiction. From this intuition, several ways of extending the correspondence to classical logic appeared. From our point of view, the most interesting ones are λµ-calculus [START_REF] Parigot | Lambda-mu-calculus: An algorithmic interpretation of classical natural deduction[END_REF] -that will occupy all Chapter 3 -and, only for this introduction, Krivine's classical realizability [START_REF] Krivine | Realizability in classical logic[END_REF]. In Krivine's realizability, one extends the simply typed λ-calculus with a new constant, called callcc (call-with-current-continuation) having the type of Peirce law, following Griffin. Then, one defines a finer relation than typing (Γ M : A), which is the "realizability relation" Γ M : A, to be thought of as the statement that the program M "computationally justifies" the formula A. Another way of seeing it is that the program M corresponds to the extraction of the computational content of the formula A. In this sense -and only in this sense, as we are going to see -one can say that we are still in the Curry-Howard perspective. Now, the deep difference between this calculus (called "λ c -calculus") and the usual one is, apart from callcc and the realizability relation, the way one models the notion of computation: in Krivine's realizability, programs are executed together with a stack 15 -to be thought of as the execution stack -playing the role of the environment 16 . This is the real difference between intuitionistic and classical: the computational content of the former lies in the internal properties of the programs, while the one of the latter lies in their interaction with the environment. In fact, the control operators are precisely instructions dealing with this aspect. The main reason why we are mentioning Krivine's realizability here is because in this setting one clearly sees what is the computational behaviour of callcc and, thus, the one of classical logic: the use of callcc consists in applying it on a term M and launching it in front of a stack; this "process" executes by, first, freezing the execution stack as a data in the memory of M , and then by launching M on the same stack; if at a certain moment the execution will need to make a decision (left/right in Figure 1.4), it can "guess" the right one (first guessing left in the figure); if this guess was wrong (the star in the figure) -say, it raises an error -the process can restore the memorized stack, thus backtracking at the moment it was first launched; now, when it will have to make the same decision again, it knows that the correct choice is the other one (on the right, in the figure), and it can continue the execution with (hopefully) no errors 17 . This is exactly the behaviour of the callcc in "real" programming languages. We will find the same behaviour also in λµ-calculus, as we will see in Section 4.2. This backtracking technique can be also stated in the form of the story of the "devil realising the excluded middle" ([Wad03, Chapter 4]), as well well as in the proof of the famous "drunk man formula": This is a classically provable formula, but not intuitionnistically provable. It says that if we place ourselves in the domain of non-empty pubs, and we read D{x} as "x is drunk", then in any non-empty pub we can always find someone (x) which is s.t. if he is drunk, then all the other clients of the pub are drunk too. It may seem a strange property, but the proof is actually very simple: take one person x 0 in the pub (there is at least one since it is non-empty); either declaring x := x 0 works, in which case we are done, or it does not. If it does not, it means that the environment (the "opponent", if we think of a proof as a dialogue) has provided us with a person x 1 which is not drunk while our x 0 is. Thus, we change our mind and declare x := x 1 . Now this choice necessarly works, thanks to the information (x 1 is not drunk) the environment itself gave us.

∃x (D{x} → ∀yD{y}).
Anyways, there is a crucial point of fracture between the Curry-Howard perspective and Krivine's one: the realizability relation is not defined via typing derivations anymore, but in a more complex and indirect way; so now one is able to prove that some formulas can be realized18 even when one does not have a proof in classical logic for that formula. This is a huge improvement, because now one can extract computational content from axioms, and thus consider much bigger parts of mathematics, such as those formalizable in ZFC -apparently Krivine has recently realized the full axiom of choice [Kri20] -which were not in the scope of the "traditional" Curry-Howard perspective simply because axioms do not have proofs, and hence cannot be typed! The price to pay is, however, that now the correspondence is not anymore an isomorphism, in the sense that the very notion of cut-elimination and/or normalization does not play any role. The notion of computation is only considered with respect to a certain set of "observable behaviours" one fixes at the beginning -playing the role of a parameter of the whole construction -and the realizability relation makes the correspondence more between formulas and programs than between proofs and programs 19 .

If one wants to stay in a "purely Curry-Howard" perspective, that is, linking cut-elimination and program execution, the most "basic" framework is maybe Parigot's λµ-calculus. Of course, the first problem to deal with in classical logic, is the intrinsic non-determinism of cut-elimination and the presence of critical pairs, as we already discussed. The solution proposed by Parigot consists in forcing cut-elimination to be deterministic, by a priori choosing the way to eliminate the cuts. In order to do so, he modifies the formal system in use to write classical proofs, and introduces its classical natural deduction (which we will briefly present in Chapter 3) -in turn a particular case of its more general free deduction. The main difference with sequent calculus is that now one has two kinds of formulas at the right side of the " "": at most one active formula, and finitely many passive formulas. The new system enjoys a strongly normalizing cut-elimination. Once properly defined the typed programming language classical natural deduction derivations describe, one can extract the underlying untyped language simply forgetting types. The problem of course is which program to associate with the new rule of contradiction, and how to handle the notions of active and passive formulas. Parigot simply adds a new constructor to the ones of λ-calculus, involving a new binding operator called the µ-abstraction, which operates on a new set of variables usually called names. In this way, one can prove that a Curry-Howard correspondence (or, better said, isomorphism) holds between the λµ-calculus and the classical natural deduction. Hence, in the same way one can say that the (untyped) λ-calculus is the Turing-complete programming language in which intuitionistic proofs express their computational content, one can say as well that the (untyped) λµ-calculus is the Turingcomplete programming language in which classical proofs express their computational content. The reader can consult [START_REF] Bonnay | Règles et signification: le point de vue de la logique classique[END_REF] for an interesting philosophically-oriented discussion about the Curry-Howard correspondence for classical logic.

Linear logic

Let id : x ∈ Bool → x ∈ Bool and let redundantId : Bool → Bool be defined via the algorithm: if x = 1 then x else x. Of course id = redundantId but while id uses its argument exactly once, redundantId uses it exactly twice in the execution: this is a fundamental difference, from both the point of view of computer science and that of logic. To understand why this is important from a computational view point, it is enough to see that λ-calculus has a kind of source of unsatisfactoriness: the notion of step of computation is clear, but it is not really elementary. In fact in a computation from (λx.M )N to M {x/N }, one has to duplicate the whole term N -independently from its size -the exact number of times (possibly zero, in which case N is erased) that x occurs in M . So it is not realistic to consider this step of computation to take place in constant time. A more "elementary version" of it would substitute N for exactly one occurrence of x at a time, but in λ-calculus there is no such thing.

To see that the point of duplication is important also from a logical point, let us mention that Girard found20 that two rules that one usually considers for building derivations21 , which were usually considered "harmless", are in fact crucial. The rules are the following:

Γ ∆, A, A Γ ∆, A Contraction Γ ∆ Γ ∆, A Weakening
and the analogous rules for the case at the left of the " " 22 . Abolishing these two rules one observes a surprising phenomenon: both the connectives ∧ and ∨ split 23 in two different connectives: the multiplicative conjunction ⊗ and the additive one &, and the multiplicative disjunction `and the additive one ⊕. This "hidden structure" of logical connectives is not ad hoc or chaotic, but is well-structured and deserves its own place as a well-behaved logical system, which is "linear logic without exponentials". Inside it, one finds two main subsystems, called the additive and the multiplicative system, which are again well-behaved systems. When we say "well-behaved" we mean that they satisfy all the properties a theory of proofs should have: namely a semantics and, most importantly, a (terminating and "natural") cut-elimination procedure. A crucial aspect is that one can define a duality relation (.) ⊥ , playing the role of negation, which satisfies non-trivial properties (namely, it is involutive and yet constructive). This allows to define the linear implication A B := A ⊥ `B. Furthermore, and most importantly for us, this system allows to decompose the implication "→" -which corresponds to λ-abstraction under the Curry-Howard correspondence -in two more elementary and intuitive operations: in order to produce an output of type B from an input of type A -this corresponds to the specification "A → B" -one, first, duplicates a certain number of times the input of type A -this has type !A in linear logic -and then uses exactly once this duplicated inputs in order to produce the output of type B. Putting things together, we have the fundamental decomposition:

A → B = (!A) B.
From a logical point of view, the new modality "!", together with its dual "?", correspond to a rehabilitation of the structural rules -weakening and contraction -in the system, but only in a controlled way. These two fundamental modalities are called exponentials because they allow to pass from the additive world to the multiplicative one -just like an exponential function -and vice-versa24 . When added to the previous system, one obtains what is usually called "full linear logic". Since we will not deal with linear logic by itself, let us just mention that Girard's discoveries have literally created a whole new discipline, bringing a new insight in the foundations of logic, on which we will come back in Chapter 5, as well as new important mathematics in the realm of proof theory, and have found in theoretical computer science -especially in the abstract theory of programming languages -considerable applications. The situation of structural rules is a typical example of how the point of view of semantical preservation of truth is blind with respect to deeper considerations, that require a finer point of view.

The Taylor expansion of a program

If the most naive interpretation of a (simply-typed) λ-term is as a function, one may wonder if it is possible, as it is often the case for functions, to "approximate" it in some sense. The answer is positive, and the historically first notion of approximation has not much to do with functions: it is given by Böhm approximants25 . This notion is related with the partial information that a program, from time to time, may output during its execution; so it is mainly "computer science driven". One may thus still wonder if a more "mathematically driven" notion of approximation exists. The answer is again positive, and was discovered by Ehrhard and Regnier in [START_REF] Ehrhard | The differential lambda-calculus[END_REF]. In this pioneering article, they introduce a derivative operator in the higher-order functional setting, defining a differential λ-calculus. This new syntax is not ad-hoc, as it finds its root in the Ehrhard's work in the semantics of linear logic [START_REF] Ehrhard | On Köthe sequence spaces and linear logic[END_REF]. Thus the differential λ-calculus is another great example of the interesting methodological phenomenon which consists in discovering a notable property in a semantical setting, and then internalising this property via a new syntax. The most exciting achievement of the differential λ-calculus is the possibility of defining a Taylor expansion of a λ-term, which has striking similarities with the usual one of analysis; the similarities are first in the shape: in the same way the Taylor expansion Θ(F ) of a real function F , near 0, is the series of functions:

Θ(F )(x) = n 1 n! (D (n) F • x n )(0)
where

D (n) F • a is the function y → F (n) (y) • a, the Taylor expansion Θ(F x) of a term F x is the formal series: Θ(F x) = n 1 n! (D (n) F • x n )0.
where D (n) F •N n is a term in the syntax. But, more deeply, the similarities are in the role of this expansion: as each polynomial appearing in the series Θ(F )(x) approximates the function F (x) (near 0), the "differential terms" occurring in Θ(F x) provide a valid notion of approximation for F x. Furthermore, in the same way a polynomial of degree n is a "simple" function which uses its argument exactly n times (in the sense of analysis26 .), the approximants of F x given in Θ(F x) are "simple" functions that use their arguments exactly n times (in the sense of computer science). The main intuition behind this notion of approximation is thus the tight connection which appears between the notion of linearity in analysis and that in programming (to use its argument exactly once during the computation).

(Θ(M )) = Θ(BT(M )).
One could even say that they give raise to "the same" approximation.

Actually, approximating via "differential terms" is not the only possibility given by the work of Ehrhard and Regnier. It turns out that even if we drop the rational factorial coefficients, and move to a much simpler syntax, we still get a valid approximation for λ-calculus. We will call this approximation the resource approximation, since the terms obtained via the mentioned restriction of differential λ-terms are called resource terms. The resource approximation can be also introduced independently from the differential λ-calculus. This kind of approximation is exactly the object of study of this manuscript.

Chapter 2

Preliminaries

We first recall the few and very simple general mathematical notions we need in this manuscript. Then, we recall the basic notions about λ-calculus we will use. In particular, even if well known, we believe it is interesting to give some details about the construction of Böhm trees, as well as the conceptual place such an approximation occupies, because an important part of the thesis is precisely about the relation between this kind of approximation and the resource one.

Notations, terminologies and basic facts

Natural numbers The set N of natural numbers start from 0. The power set of a set X is denoted by P(X); we denote by P * (X) the set P(X) -∅; we denote by P fin (X) the finite parts of X, and analogously for the other uses of the subscript "fin". The cardinality of X is denoted by Card(X).

Multisets and orders A multiset over a set X is a map from X to N. The support of a multiset A : X → N is the set X -A -1 (0). A multiset is finite when its support is finite. We denote with ! X the set of finite multisets over X. Let A be a finite multiset with support {a 1 , . . . , a k }. As usual, we write such an A as [a 1 , (A(a 1 ))

. . . , a 1 , . . . , a k , (A(a k )) . . . , a k ]. In this manuscript, when we do not need to specify the multiplicities A(a i ), we will shorten this notation to [a 1 , . . . , a k ], meaning that some of the a i might be equal. Moreover, if an operation n ± a i is defined for all i = 1, . . . , k, we will sometimes write n ± A for the multiset [n ± a 1 , . . . , n ± a k ].

We use a multiplicative notation for multisets: this means that the empty multiset is denoted with 1 and the union of two multisets A, B is denoted with A * B. The set of multisets over a set X (as well as !X) is a commutative monoid w.r.t. * , with neutral element 1.

It is well-known that, if X is a well-founded ordered set, then !X is well-founded as well, w.r.t. to an order, called the multiset order on X, which is defined by setting: A < B in ! X iff A can be obtained from B by replacing at least one occurrence of an element b of B with an arbitrary finite number (even 0, which corresponds to erasing b) of elements a 1 , . . . , a n < b.

Let X 1 , . . . , X n be ordered sets (let us simply call ≤ the order in each of them). It is well known that one can define an order on the product X 1 × • • • × X n , different from the product order and called the lexicographic order, by setting:

(x 1 , . . . , x n ) ≤ (y 1 , . . . , y n ) iff there is 1 ≤ k ≤ n s.t. x i = y i in X i for i = 1, . . . , k -1 and x k ≤ y k in X k .
The lexicographic order has the property that if each X i is well-founded, then the product (of fixed length) is well-founded.

Syntax

We will essentially deal with words on alphabets, so we will work in the free monoid of some alphabets. In particular, the words of our interest will always raise from inductive constructions, and so one calls them terms instead. As usual, we make extensive use of "Backus-Naur-like notations" and do not specify the underlying alphabet, which is inessential and clear from the context: the "real" way of looking at terms is as (higher-order) abstract-syntax trees.

Rewriting systems Our terms are not just static pieces of information: they will represent programs, whose principal feature is of course to evaluate. This is well-modelled by appropriate rewriting systems, that is, simply appropriate sets X equipped with a binary relation → ⊆ X×X.

-The reflexive closure of → is the relation → ∪ {(x, x) | x ∈ X}, usually denoted by → = .

-The transitive closure of → is the smallest transitive binary relation on X containing →.

I.e., it is the relation

{(x, y) | x → x 1 → • • • → x n → y for some x 1 , . . . , x n ∈ X, n ≥ 0}.
-The reflexive-transitive closure (i.e. the union of the reflexive and of the transitive closure) of → is denoted with . It is the smallest transitive and reflexive binary relation on X containing →.

-The symmetric closure of → is the relation

→ ∪ {(y, x) | x → y}.
-The symmetric closure of is the smallest equivalence on X containing →, and is denoted with in this preliminary section. That is, x y iff there exist x 1 , . . . , x n ∈ X s.t.

x x 1 x 2 • • • x n-1 x n y.
An element x ∈ X is reducible iff there exist y ∈ X s.t. x → y. Otherwise it is said to be normal. An element y ∈ X is a normal form of x ∈ X iff y is normal and x y. An element x ∈ X is said to be normalizable if it admits a normal form. A reduction sequence starting from an x ∈ X is a (possibly infinite) sequence x → x 1 → x 2 → • • • in X.

A rewriting system (X, →) is said to be:

-strongly normalising iff the are no elements of X admitting an infinite reduction sequence.

-diamond iff for all x, v, w ∈ X s.t. v ← x → w, there exist y ∈ X s.t. v → y ← w.

-locally confluent iff for all x, v, w ∈ X s.t. v ← x → w, there exist y ∈ X s.t. v y w.

-confluent iff (X, ) is diamond.

-Church-Rosser iff for all v, w ∈ X s.t. v w, there exist y ∈ X s.t. v y w.

It is well-known that the confluence and the Church-Rosser are equivalent properties. In a confluent rewriting system (X, →) every x ∈ X admits at most one normal form. We recall the following general and well-known result:

Lemma 2.1.1 (Newman's lemma). A strongly normalising rewriting system is confluent iff it is locally confluent.

We will also mention to the following well-known notion:

Definition 2.1.2 (Commutation of reductions). Two binary relations → 1 , → 2 on X are said to commute iff for all x, v, w ∈ X s.t. v 2 ← x → 1 w, there exist y ∈ X s.t. v → 1 y 2 ← w.
Trees We will also encounter finitely branching rooted trees with an order defined on the set of subtrees of each node. From now on, "tree" is synonymous of such trees. If B is tree, having R as root and immediate subtrees B 0 , . . . , B k ordered following the indices, we represent it via the writing

B = RB 0 • • • B k .
We mention this kind of trees because Böhm trees (discussed in Section 2.2.2 and in Section 3.5) are a special case of them; in this setting there is a one-leaf tree ⊥ (which can thus appear only as a leaf). We add from now on this constraint in our definition of tree. Moreover, in the setting of Böhm trees one can decide to "obscure" an entire subtree by contracting it to ⊥; this is why we give the following: Definition 2.1.3. We define the order on the set of trees1 by: B B iff B can be obtained from B by contracting any number of subtrees of B to ⊥.

Formal sums We describe below a construction which will be constantly used. Consider a set L (it will be some "resource sensitive language"). We call 2 L the free module generated by L over the boolean semiring2 , which simply means the quotient set of the formal sums of finitely many elements of L, quotiented by commutativity, idempotency and associativity of +. An element of 2 L will be called a sum. We denote with 0 the empty sum, which is the neutral element for +. Said differently, a sum T is just a finite subset of L, and the "+" is the union 3 .

Every operation defined on L, can be extended to 2 L by linearity, but for the seek of clarity we will specify that at each time. Of course 0 is also the annihilating element for those linearly-extended operations. Observe that the condition t / ∈ S is crucial if we want to hope for a strongly normalising reduction . Indeed, if we defined the extension to sums without bothering for that condition, we would immediately have: t = t + t T + t = T + t + t T + T + t = T + t and thus we have created a cycle in the reduction, yielding an infinite -reduction sequence. With the condition t / ∈ S, both the previous -reductions are not allowed: in the first, (the term) t belongs to (the single-element sum) t, and in the second t ∈ t + T.

However, this condition forces us to pay particular attention to successive reductions. For instance, if t u v, then in order to obtain t + u u + v (for lack of symbol, let us use the symbol for the reflexive transitive closure of ) one cannot reduce first t, otherwise we would have t + u u + u = u. In this case reducing first u, and only then t, yields to the desired result. But in general, because of the definition of reduction on sums (Definition 2.1.4), consecutive reductions -and in particular reducing a sum to the sum of the reduct of each addend -are, in general, not necessary possible.

The (untyped) λ-calculus

Basic notions and facts

The set of pre-λ-terms is defined inductively as:

M ::= x | λx.M | M M
where x ∈ Var -a countably infinite set which we fix now and for all the thesis. The sets FV(M ) and BV(M ) of free variables and of bound variables of a pre-λ-term M are defined as always. We also assume Barendregt's convention4 -that is, all the bound variables in a pre-λ-term are different. The α-equivalence is the binary relation on pre-λ-terms which equates M and N whenever there are bound variables x 1 , . . . , x n (n ≥ 0) of M and variables y 1 , . . . , y n not occurring free in N s.t. N can be obtained from M by replacing all the occurrences of x i by y i . It is clearly an equivalence relation.

The set Λ of λ-terms is the set of pre-λ-terms quotiented by α-equivalence.

Remark that the notion of free variable still makes sense for a λ-term (but not that of bound variable). We will thus just say that a variable "occurs in a λ-term M ", or that it "does not occur" (hence omitting the adjective "free"). Except if explicitly stated, when we write a pre-λterm we will always mean the associated λ-term, that is, its α-equivalence class. The following are famous λ-terms which we will happen to use in this manuscript without recalling them: I := λx.x, ∆ := λx.xx, Ω := ∆∆, True := λxy.x, False := λxy.y.

A k-context (also called a multi-hole context if we do not need to specify k) is a function

C : k Λ × • • • × Λ → Λ inductively defined as: C ::= ξ 1 | • • • | ξ k | x | λx.C | CC,
where ξ i is the i-th projection (of arity k) and x is the constantly equal to x ∈ Var function (of arity k). The functions ξ i 's occurring in the inductive definition of C are traditionally called holes. We denote by C M ∈ Λ the image of M under C. Remark that, by definition of contexts as functions, free occurrences of variables in M may become bound by a "λ" in C M , like as in C x = I, where C = λx.ξ. Thus, contrary to terms, contexts do not satisfy α-equivalence; for instance λx.ξ = λy.ξ, since (λx.ξ) x = I = λy.x = (λy.ξ) x .

A single-hole context is a 1-context with exactly one occurrence of its hole (usually denoted ξ instead of ξ 1 ). The contextual closure of a binary relation R on λ-terms is the binary relation given by set {(C M , C N ) | M RN, C single-hole context}. Thinking as contexts as defined on pre-λ-terms (instead of terms), we can give the same definition for a relation of pre-λ-terms.

We denote by M {N/x} the result of replacing the term N for all the free occurrences of x in M . One properly defines this operation through pre-λ-terms, performing the replacement only after the usual renaming of bound variables in the pre-λ-term M , to avoid capture of free variables in N . The α-equivalence coincides then with the relation on pre-λ-terms which is the contextual closure of the relation equating a pre-λ-term of shape λx.M with a pre-λ-term of shape λy.M {y/x}, whenever y / ∈ FV(M ). Lambda-terms are meant to represent programs, the notion of execution being as usual βreduction, which we will call instead λ-reduction and denote by → λ . It is the contextual closure of the relation (λx.M )N → base M {N/x}. The reflexive, symmetric and transitive closure of → λ is called λ-equivalence and is denoted by = λ .

One might be interested in equating λ-terms via an equivalence relation different from = λ . In this case the following are the standard notions to consider: a congruence is a contextual equivalence5 on Λ; a λ-theory is a congruence containing = λ ; the term algebra6 of a λ-theory R is the quotient Λ/R (endowed with the induced constructors of Λ); a λ-theory R is said to be non-trivial when its term algebra is not a singleton.

Böhm approximation

Lambda-terms can be organized in two classes, depending on their behaviour: the solvable ones, and the unsolvable ones. This is a fundamental distinction and plays a crucial role in Böhm approximation, so let us give some details. We will use as "running example" the algorithm known as the "Babylonian method" for the computation of square roots.

A λ-term M is called solvable if there exists a context C of shape

7 C = (λx 1 . . . x n .ξ)N 1 • • • N k such that C M = λ I;
it is unsolvable otherwise. A solvable term can be sent (mod = λ ) to any other term by means of some appropriate context.

An a priori unrelated notion is the one of head normal form: a λ-term M is called a head normal form (hnf for short) if it is of shape M = λx 1 . . . x n . x M 1 • • • M k for some n, k ≥ 0, and the (occurrence of the) variable x (which can be equal to some of the x i 's) is said to be in head-position for M . The terms that are not hnf's are necessarily of shape

λx 1 . . . x n . (λy.P )Q M 1 • • • M k , that
is, in their head-position there is a redex (λy.P )Q instead of a variable.

One says that a term M has an hnf iff M = λ N with N hnf. The head reduction is the partial function which is undefined exactly on the hnf's and, when it is defined, gives the term obtained by reducing the head-redex of the term it is applied to. We write → h for its graph relation.

It is well-known that one has the following fundamental characterization: M is solvable iff M has a hnf iff the head-reduction on M terminates.

The paradigmatic example of an unsolvable term is Ω.

Once a hnf N = λx 1 . . . x n . y M 1 • • • M k of a term
M is reached during λ-reduction, pursuing the reduction will only affect M 1 , . . . , M k but not the "head part" λx 1 . . . x n .y of M , nor the number k of applications of the head variable y. The information given by the pair "(head part, number of applications)" is thus a partial output of the computation, and the term will never return working on it. The existence of terms with a hnf -i.e. solvable -but that are not normalizable appears now very natural: it corresponds to algorithms that, from time to time, output a part of an ideal "fully computed" output, providing thus an increasing approximation of it, although never reaching it once and for all. The ancient Babylonians and the ancient Indians already knew8 the power of such algorithms: they knew a procedure computing each consecutive digit of √ 2. Compare it to Ω which, in turn, really produces no kind of information, as it is only capable of reducing to itself.

As first understood by Barendregt, the right way of modelling the notion of "computationally meaningful" is, in λ-calculus, exactly given by "producing partial information", that is, solvable terms -and not by normalizable ones as Church originally thought. This is supported by the "Genericity Property", on which we will come back at time (Theorem 3.5.29).

In the remaining of this Section, we are going to first give some detail about the approximation based on the notion of solvable term.

If M is normalising, then the question "what does M compute?" is easily answered: it computes nf λ (M ). But what do solvable terms compute? The Babylonian algorithm producing 1.41421 . . . is computing the ideal object √ 2, which can be thought of as the infinite sequence of its digits. The idea is then to do the same for solvable terms: we register all outputted information returned by M when reaching a hnf. The natural way of collecting it is to organize it as a tree, called the Böhm tree of M . So one gets the following: Definition 2.2.1 (Böhm trees). The Böhm tree BT(M ) of a λ-term M is defined coinductively 9 as follows:

If M is unsolvable, then BT(M ) is the single leaf ⊥ tree; If M is solvable with M h λx 1 . . . x n .yM 1 • • • M k , then BT(M )
is the finitely branching rooted tree with 10 :

λx 1 . . . x n .y as root -BT(M 1 ), . . . , BT(M k ) as immediate subtrees, ordered following the indices.

We denote by B Λ the set of all the Böhm trees of some λ-term, and by = B the equivalence on Λ given by the equality of Böhm trees.

If M is normalizable then BT(M ) = nf λ (M ), where the equality means that BT(M ) is just the tree representation of the word nf λ (M ). Thus, Böhm trees are "generalized normal forms", defined for all terms, and they answer to the question "what does M compute?". So, Böhm trees form a semantics for λ-terms (if M = λ N then BT(M ) = BT(N )), in the same way one can say that √ 2 is the "semantics" of the Babylonian method -in the sense that no matter what implementation has the algorithm, the computational meaning will always be to compute √ 2.

The analogy with the Babylonian method goes further. This method produces rational numbers ("truncations" of real numbers, if one thinks them as infinite sequences of digits) that are approximations of an irrational one. This is expressed by the fact that Q is dense in R (with their natural topologies) and by the fact that the rationals produced by the Babylonian method tend to √ 2 -in the topological sense of limit. Now, the same happens in λ-calculus, as any "truncation" of BT(M ) -what we call a "Böhm approximant" (Definition 2.2.3)turns out to be an approximation of BT(M ) in the following sense: the set B Λ of Böhm trees carries a canonical topology (its Scott-topology as cpo), with respect to which its subset App is dense into. Also, the Böhm approximants of M tend to BT(M ), in the order-theoretic sense corresponding to a limit, that is, by taking a sup (Theorem 2.2.9).

As a last parallelism, let us say that in the same way the ideal object √ 2 is of a different "nature" of its rational approximations -the former is conceived as an infinite object while the latters are finite -also Böhm approximants are finite while Böhm trees are infinite.

Historically this is the first notion of approximation that has been discovered. Let us give some details about it. Definition 2.2.2. The set B of all the Böhm-like trees is the set of trees 11 with nodes in the set {⊥} ∪ {λx 1 . . . x n .y | x 1 , . . . , x n , y ∈ Var} and s.t. the ⊥'s can only appear as leaves. Böhm-like trees are endowed with the partial order defined in Section 2.1.

Of course Böhm trees are (possibly infinite) Böhm-like trees. Definition 2.2.3 (Böhm approximants). The set App of Böhm approximants 12 is the set of finite Böhm-like trees. It can be given the following inductive characterization: Böhm approximants can be equivalently defined as follows: Definition 2.2.4. The set Λ ⊥ of λ⊥-terms is the set of λ-terms built with an additional constant ⊥, and quotiented by the equations:

λx.⊥ = ⊥ ⊥M = ⊥.
The λ⊥-terms are endowed with usual λ-reduction. Now the set of Böhm approximants can be identified with the set of λ-normal forms and, under this identification, the preorder they inherit from Böhm-like trees coincides with the contextual partial preorder on Λ ⊥ generated by the clause: ⊥ M for all M ∈ Λ ⊥ .

One extends Böhm trees to Λ ⊥ trivially setting BT(⊥) := ⊥, so that P = BT(P ) for all Böhm approximant P .

The map BT : M ∈ Λ ⊥ → BT(M ) ∈ B Λ endows a preorder (it is not antisymmetric) on Λ ⊥ (so, in particular, on Λ), defined by M N iff BT(M ) BT(N ). It is clear that = B is the equivalence induced by the preorder on Λ ⊥ (that is,

M = B N iff M N M ).
We can now give the following: Definition 2.2.5 (Böhm approximants of a λ-term). Given a λ-term M , the set A(M ) of Böhm approximants of M is defined by: that there exist a sup P 1 P 2 ∈ App, which can be inductively constructed as:

A(M ) = {P ∈ App | M λ N P
P 1 P 2 =        λ x.
P i , if P 3-i = ⊥ (i = 1, 2 ).
It is easy to see that two upper bounds of a same term must be compatible. It is also easily seen (for example by induction on P 1 ∈ Λ ⊥ ) that is associative, and thus one defines as expected a term P

P.

One can also see that: A(M ) ⊆ A(N ) iff BT(M ) BT(N ) iff M N as well (for M, N ∈ λ⊥).

An issue intrinsic to the definition of Böhm tree and Böhm approximants is the difficulty of characterising A(M N ) in terms of A(M ) and A(N ). Indeed, not only A(•) is not closed under application, but applying P Q can give rise to a term without a λ⊥-normal form, like Ω. The same problem arises for the computation of a Böhm tree. At the heart of those difficulties one can say that there is the fact that Böhm-trees are a coinductive definition, and Böhm-approximants are defined via an existential quantification on λ-reductions. Thanks to the approximation theorem however one can, in a sense, take the best from both worlds: Böhm trees are generally easy to compute (because one can follow the head reduction), while Böhm approximants are generally better suited for proving properties.

Chapter 3

The resource approximation for λ-calculus Understanding the relation between the term and its full Taylor expansion might be the starting point of a renewing of the theory of approximations (usually based on Böhm trees).

Thomas Ehrhard, Laurent

Regnier -[ER03]

Plan of the Chapter

In this chapter we study the resource approximation for the λ-calculus, and in particular how one can use it to produce results about the latter. The main parts of it, Section 3.3 and Section 3.5, are based on our work [START_REF] Barbarossa | Taylor subsumes Scott, Berry, Kahn and Plotkin[END_REF]; not only we give all the needed details, but also we reorganize the matter of the paper, in order to show which are the real dependences between the results and in order to make it a real alternative formulation of, essentially, Chapter 14 of [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF].

Even if resource approximation could be introduced independently from the differential λcalculus, it finds its roots in it and so we find it useful to begin with an introduction to the ideas of the differential λ-calculus Section 3.2). However, we do it in a different way from how this topic is usually introduced: we do not pretend to be rigorous, but instead we prefer to explain the ideas with an accent to the relation with mathematical analysis, trying to make it clear what is the real connection between this "differential calculus" and the usual one in mathematical analysis. The aim is to give a heuristics of the topic, in the same spirit one often motivates or derives some modelizations in applyied mathematics and similar fields.

After that, we restrict our attention to the world of the resource approximants: Λ r . We first of all study the properties of the (qualitative 1 ) Taylor expansion map T ( Section 3.3). In particular, in order to prove some properties, we will have to consider the rigid terms (Definition 3.3.28) -resource terms in which there are lists instead of bags -and prove some basic results about them ( Section 3.3.1). At that moment we will already be able to prove ( Section 3.3.2) two main results: Stability property (Theorem 3.3.37, for which we need the rigid terms) and Perpendicular lines property (Theorem 3.3.40). We express and prove them inside Λ/ =τ (the term algebra of the λ-theory of the Taylor normal form) and not in the usual Λ/ = B , but in the next sections we will translate them inside the latter.

In Section 3.4 we provide a quick "interlude" about the call-by-value λ-calculus (Definition 3.4.2): in fact, a nice value of our new proof of the Stability is that it is highly "syntax independent" and it can be easily adapted to this framework2 . The results we need, in order to make sure the arguments in the proof do hold, are basically all taken by [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF].

In Section 3.5 we finally show in which sense, and how, the resource approximation "subsumes" Böhm's one. The crucial ingredient here is the renowed commutation formula (Theorem 3.5.6), for which we provide a "simpler" proof: by simpler we mean that it basically uses properties which one has already found when developing the resource approximation. With the addition of some other quite natural properties (Lemma 3.5.9 and related ones), we can prove that the λ-theories induced by Taylor and Böhm approximation coincide (Corollary 3.5.13). The "moral" is that, at least in the qualitative case (no coefficients), this non-trivial result is however easier to prove than it could appear looking at the original proof in [START_REF] Ehrhard | Uniformity and the Taylor expansion of ordinary lambda-terms[END_REF]. The commutation formula means that the λ-theories = τ and = B actually coincide (Corollary 3.5.13): this provides an alternative proof of the Contextuality of Böhm trees, which is essentially reduced to the Monotonicity of Taylor normal form.

We can do much more: in fact we can already translate the Perpendicular lines and the Stability property from the realm of Taylor expansion to the one of Böhm trees. For the former, it is straightforward (Theorem 3.5.14); for the latter (Theorem 3.3.37), we need to prove some results about intersection of Taylor normal forms (Lemma 3.5.27). As it is well known, these two results (which express some forms of weak sequentiality) in fact have as immediate consequence that λ-calculus cannot implement parallel computations; we achieve therefore this important result entirely "syntactically" (the usual proofs being semantic). Finally, we turn the attention to two other fundamental results of λ-calculus: the Genericity property (Theorem 3.5.29)which motivates the identification "unsolvables = meaningless" -and the Continuity lemma (Lemma 3.5.33) -which is the crucial ingredient of the proof of the fact that all λ-definable functions are continuous. As for the Stability and for the Perpendicular Lines property, our proof technique strongly relies on the linearity of resource terms (if something is erased in the computation, it did not appear from the beginning), but also on the relation between Böhm approximants and linear/affine resource terms that we will introduce at time.

We conclude the chapter with some comments (Section 3.6) mainly about the relation between our techniques and the usual one used in order to prove the above results.

Interlude: an heuristic for the differential λ-calculus

First intuitions Let us consider a real valued function y := f (x) with x ∈ R n . Denote with R n R the dual space of R n . Suppose y is differentiable everywhere. This means, by definition, that there exists a function (the differential of y, which has no reason to be linear) dy : R n → (R n R) s.t. y(x + u) = y(x) + dy(x)(u) + o( u ) for all x and for u small. Moreover, the differential operator d :

y ∈ {differentiable functions} → dy ∈ (R n R) R n is linear (sum of functions is defined pointwise). It a basic known fact that d(y)(x)(u) = Dy(x) • u = ∂y ∂u (x)
(where • is the scalar product in R n ). Here Dy(x) is the gradient of y in x, and we used this notation instead of the more common one ∇y(x) because it is the one one finds in differential λ-calculus. Let us denote with D(.) • (.) the function:

D(.) • (.) : (y, u) ∈ {differentiable functions} × R n → ∂y ∂u ∈ R (R n )
which is linear in both its arguments.

Since we want to put some λ-calculus into those considerations, it is helpful to remember that, by currying, we can restrict to the case where all functions have arity 1; so let us consider the case n = 1. The gradient Dy of y becomes to the derivative d dx y of y and • the product • in R. Now, remember that y is defined via the "law" y = f (x), so if one wanted to explicit f in the expression "Dy • u", one would usually write "Df (x) • u". In λ-calculus notation one would instead write "D(λx.f )•u", since the declaration "y = f (x)" is written "y = λx.f ". Furthermore, since the explicit dependence of Dy • u w.r.t. the independent variable x is given by the "law" d dx f (x)•u, one would write this fact in λ-calculus notation by "Dy•u = λx. d dx f • u ". Putting this two things together, the fact that "the function Dy • u, with y = f (x), is given by the law d dx f • u", takes the form:

D(λx.f ) • u → λx. d dx f • u . (3.1)
However, what we just did is only some abuse of λ-calculus notation, and has, a priori, no serious content.

Keeping on with the heuristics The following considerations in fact provide some serious motivation for continuing the investigation. Taylor expanding f (u) near x 0 we get:

f (u) = f (x 0 ) + d dx f (x 0 ) • (u -x 0 ) + n≥2 1 n! d n dx n f (x 0 ) • (u -x 0 ) n .
Let us read this as saying that if we "force" f to use its argument u exactly once, then (for u close to x 0 ) f (u) behaves like f (x 0 ) + d dx f (x 0 ) • (u -x 0 ): in fact, in the other factors of the expansion, f needs "u" at least twice in order to compute (u

-x 0 ) n . But f (x 0 ) + d dx f (x 0 ) • (u -x 0 ) is just
a vertical and horizontal shift of d dx f (x 0 ) • u, so that (for u close to x 0 ) we get the following "moral equation":

f forced to use its argument u exactly once = d dx f (x 0 ) • u.
Of course, mathematically speaking, we are saying nothing more than the basic fact that the derivative of a function gives its best linear approximation; what we are adding here is the reference to the fact of "being forced" to use its argument exactly once, i.e. the notion of linearity in computer science.

Rembering equation (3.1), we are tempted to read the "term" D(λx.M ) • N precisely as the "name" of an expression of x, such expression being d dx M • N , which behaves as λx.M when it is applied to N under the constraint of using N exactly once. Let us say that D(λx.M ) • N is the name of the function that "linearly applies" λx.M to N , call it the linear application.

On the other hand, to force λx.M to use N exactly once during all the computation, means to make sure N goes replacing exactly one occurrence (instead of all the occurrences) of x in M and also to make sure it will be never duplicated nor erased. Thus d dx M • N can be thought of as some sort of substitution; call it linear substitution.

Consider this new linear substitution. It is clear that not all the occurrences of x in M can be used for substituting: take for instance M := (λy.yy)x; then (λx.M )N moves N in exactly one occurrence of x in M (the only one) but doing so one obtains (λy.yy)N which, during the computation, duplicates N . In a sense, this occurrence of x in this M is the prototypical "non linear" one. Let us call linear the good occurrences of a variable x in M we can use for the linear substitution we are looking for, that is, the occurrences of x in M which cannot be duplicated nor erased no matter what use of M one does. Call a constructor C(.) of λ-calculus linear when for all term S and for all variable x, the linear occurrences of x in C(S) are those linear in S. One sees that:

1. λx.(•) is linear 2. (•)Q is linear but P (•) need not be linear 3. D(•) • (•) is linear in both arguments.
Remark now a crucial fact: Remark 3.2.1. The previous constructors in 1,2,3 are linear in the sense of λ-calculus exactly when, read as a functions, they are linear in the usual sense of commutating with sums. In fact:

1. in the case λy.(•) this simply follows from the fact that summing functions is done pointwise, and in particular from the definition of function sum: the definition of the function P + Q is, reading the following λ-terms as real functions, precisely λx.(P + Q) := λx.P + λx.Q 2. in the case C = (•)Q this simply follows again from the fact that summing functions is done pointwise, and in particular from the expression defining the sum function: the expression defining (P +Q)(x) is, reading the following λ-terms as real functions, precisely (P + Q)x := P x + Qx. On the contrary, a function P (•) need not be linear in the sense of commuting with sums.

3. in the case D(•) • (•), this is just the already mentioned linearity in both arguments of D(•) • (•) seen as a real function.

If we remember that the notion of linearity in programming (and proof theory) is -a prioriunrelated with the usual notion of analysis, all the coincidences expresses by Remark 3. • N are respectively the name and the concrete expression of the algorithm which non-deterministically chooses exactly one linear occurrence of x in M , declares it not duplicable nor erasable, and then substitutes N for that occurrence. In order to perform such a linear substitution we certainly have to substitute N for exactly one linear occurrence x 0 of x in M (such an occurrence is guessed non-deterministically); call S the maximal strict subterm of M containing this chosen occurrence x 0 . If M = C(S) and C(.) is a linear constructor, we say that S is in linear position for M . If S is in linear position for M , we are sure that N will not be duplicated nor erased in the future. This happens for sure in the cases 1, 3 above, so for this cases we have:

d dx x • N := N and d dx y • N := 0 (for y = x) d dx (λy.P ) • N := λy. d dx P • N d dx (DP • Q) • N := D d dx P • N • Q + DP • d dx Q • N (3.2)
where we added the case for the variables, which is clear. The sum in the case of linear application is there to non-deterministically guess if S is P or Q.

The only remaining case is case 2 above, i.e. M = P Q and S = P or S = Q. If S = P then S is in linear position for M , so we are already sure the computation will be linear. But if

S = Q the situation
d dx (P Q) • N := d dx P • N Q + DP • d dx Q • N Q. ( 3.3)
We can finally concretized all those considerations in the following: Definition 3.2.2. Fix a commutative semiring R. The set of differential terms is the R-module given by quotienting the words (modulo α-equivalence) inductively defined as: Differential terms are endowed with the reduction → given by the union 5 of the usual λ-reduction and the relation:

M ::= 0 | x | λx.M | M M | (DM ) • M | aM + bM (for x variable
D(λx.M ) • N → ∂ λx. d dx M • N where d dx M
• N is the differential λ-term inductively defined by equations (3.2) and (3.3) 6 .

3 Remark that since an application is not linear in the argument, we didn't add linearity of M (.).

4 That is: a(M + N ) = aM + aN , (a + b)M = aM + bM , (ab)M = a(bM ) and 1M = M . 5 One has to be careful to define context closure in differential λ-calculus. But we are not concerned with technical details here. • N which comes from the fact that the linear occurrences of x in aP + bQ are clearly those linear in P and those linear in Q. This corresponds again to the fact that summing functions is done pointwise.

The following three lemmas are a confirmation that we are, indeed, doing something related to analysis. Lemma 3.2.3. One can easily prove that if x does not occur in M then d dx M • N = 0. From the perspective of analysis this read as the fact that the derivative of a constant is null. Lemma 3.2.4. If x does not occur in λy.P , the definition of linear substitution gives:

d dx ((λy.P )Q) • N = D(λy.P ) • d dx Q • N Q.
From the perspective of analysis, since the fact that x does not occur in λy.P entails that (λy.P )Q can be seen as the composition function "(λy.P ) • Q" of the independent variable x, this reads as:

d dx ((λy.P ) • Q) • N = d dy P y=Q • d dx Q • N .
It is exactly the chain rule7 for the directional derivative of the composition of two functions8 . Lemma 3.2.5. If y does not occur in Q, one has:

d dx d dy M • P • Q = d dy d dx M • Q • P + d dy M • d dx P • Q
In particular, if moreover the second summand of the previous equality is zero, a non trivial case for it to happen being if x does not occur in P9 , one has:

d dx d dy M • P • Q = d dy d dx M • Q • P
From the perspective of analysis, the hypotheses say that P is independent from x and Q is independent from y, so we get d dx

d dy M • P • Q = d dy d dx M • Q • P . Cancelling P and Q,
we recover Schwarz's theorem on the symmetry of second derivatives.

Ehrhard and Regnier found in [START_REF] Ehrhard | The differential lambda-calculus[END_REF] that all this considerations do in fact make sense. Of course history is always different from the way one can present the topic years later, and they were not at all thinking of the above heuristics; they realized that the notion of derivative present in some denotational models of linear logic, based on vector spaces and built by Ehrhard some time before [START_REF] Ehrhard | On Köthe sequence spaces and linear logic[END_REF], could be internalized in the syntax. Their differential constructions are more general than the λ-calculus framework we quickly presented here, giving life to differential linear logic [START_REF] Ehrhard | An introduction to differential linear logic: proof-nets, models and antiderivatives[END_REF] and differential interaction nets [START_REF] Ehrhard | Differential interaction nets[END_REF]. This calculus is confluent, strongly normalising on typable terms and admits interesting denotational models.

Taylor expansion Differential λ-calculus is mainly interesting because it provides the crucial tool of Taylor expansion of a program, which we describe below by carrying on our heuristic.

Put, for brevity,

D n M • (N 1 , . . . , N n ) := D(D • • • (DM • N 1 ) • • • • ) • N n-1 ) • N n and also D n M • N n := D n M • (N, . . . , N ). So, in D n M • (N 1 , . . . , N n ),
exactly n terms (the N i 's) are linearly passed to M , and the whole term is still ready to receive other arguments. Remark that, by definition of linear application, one has:

-if n > deg x M then D n (λx.M ) • (N 1 , . . . , N n ) → 0; -if n < deg x M then (D n (λx.M ) • (N 1 , .
. . , N n ))P will make deg x M -n copies of P and put those copies in M at the place of the remaining deg x M -n occurrences of x;

-if deg x M = n then D n (λx.M ) • (N 1 , . . . , N n ) applied on P will just throw it away. So if we wanted, for some reason, to force λx.M to use, linearly, exactly deg x M times an argument N , we could simply consider (D n (λx.M ) • N n )0: the lines above precisely say that, in order for it to not annihilate to 0, the only possibility is that n = deg x M . Remember that we started our heuristics remarking that, in analysis, this is precisely the behaviour produced by Taylor expansion: it decomposes a function as the sum of what is obtained by forcing it to use exactly a fixed number n of times its argument, for all possible n.

The same should hold here: if we knew that in an ordinary application M N , the term M would use its argument N exactly n times, we could in advance provide n copies of N to M and now force it to treat them linearly, obtaining necessary the same behaviour of M N . On the other hand, an M applied to an N will certainly use N a certain number n ∈ N of times, so it should be the case that the behaviour of M N is a superposition of behaviours where M uses N exactly n times, for all the possible n ∈ N. Moreover, from the point of view of analysis -say that M is a function of the independent variable x -we remark that (

D n M • N n )0 reads as d n dx n M x=0
• N n , which is just, modulo the factorial coefficient 1 n! , the n-th summand of the Taylor expansion of M (N ) in 0.

In conclusion, if all this heuristics really makes sense, we should have:

M N = n∈N 1 n! (D n M • N n )0. (3.4)
A first step in this direction in given in [START_REF] Ehrhard | The differential lambda-calculus[END_REF] where, after having properly defined the framework of differential λ-calculus, it is proved that: Proposition 3.2.6. If M N λ-reduces to a variable, then equation (3.4) holds (for = λ∂ ).

What one would now really hope for, would be on one hand to eliminate the constraint of M N of reducing to a variable and, on the other hand, to be able to Taylor expand all the applications in a term: indeed, if the above formula holds for any application one could nest the expansions in order to get, at the end of the day, only linear applications and proving thus that any application can be really obtained via a sum of purely differential terms, just like in analysis. These terms could now be really seen as a kind of approximation.

That is, we are looking for a function Θ -the quantitative (or full ) Taylor expansionmapping λ-terms in a still to be specified space s.t. Θ(x) = x, Θ(λx.M ) = λx.Θ(M ) and:

Θ(M N ) = n∈N 1 n! (D n Θ(M ) • Θ(N ) n )0.
The difficulty is that since Θ must thus be a (possibly infinite) sum, we have to make the codomain space able to sum series, multiplicate them, admit the same language's constructors etc. In [START_REF] Ehrhard | Uniformity and the Taylor expansion of ordinary lambda-terms[END_REF], Ehrhard and Regnier find such a space to be the module R Λ r ∞ of formal linear combinations, with scalars in a semiring R, of some terms in a language Λ r similar to ordinary λ-calculus but with stronger properties, called resource calculus. It is a very simple confluent and strongly normalising calculus (also in the untyped case) -with a lot of similarities to Boudol's λ-calculus with multiplicities [START_REF] Boudol | The lambda-calculus with multiplicities[END_REF] -in which resource consumption is strictly controlled and the vast majority of its "resource-terms" annihilates for lack or abundance of resources to be consumed. So the previous recursive equations for Θ do indeed define a function Θ : Λ → R Λ r ∞ , the (qualitative) Taylor expansion and moreover this function satisfies a direct characterization:

Θ(M ) = t∈T (M ) 1 m(t) t.
Here m(t) ∈ N is a certain number which has to do with the combinatorics of some groups handling permutation of resources, and T : Λ → P(Λ r ) is an easily inductively defined function, called the qualitative Taylor expansion. This function associates a λ-term with the set of resource-terms which "try to act as it" but in the resource-sensitive world of Λ r , and will be the major object of study in this thesis.

Let us conclude with two final remarks.

First, R Λ r ∞ is endowed with a structure of algebra over R by means of a product which is the natural notion of multiplication of series; one defines then the constructor (D n (.)

• (.) n )0 in R Λ r ∞ as: (D n ϑ 1 • ϑ n 2 )0 := ϑ 1 ϑ n 2 (
we mean that the former ϑ n 2 is part of the name of the constructor we are defining, while the latter is the n-th power of ϑ 2 via the product of R Λ r ∞ ). Therefore now one has:

Θ(M N ) = n∈N 1 n! Θ(M )Θ(N ) n .
Since Θ(M ) in the above sum does not depend on n, we define the map (.

) ! : R Λ r ∞ → R Λ r ∞
given by ϑ ! := n∈N ϑ n n! and obtain:

Θ(M N ) = Θ(M )Θ(N ) ! . (3.5)
The map (.) ! does not only look like the exponential power series, but it really is an exponential, as it satisfies in R Λ r ∞ the characteristic equations:

0 ! = 1 and (ϑ 1 + ϑ 2 ) ! = ϑ ! 1 ϑ ! 2 .
Reading equation (3.5) from a logical point of view, one recovers the fundamental decomposition of linear logic A → B = (!A) B. In fact, the map (.) ! corresponds to the promotion rule of linear logic.

Finally, let us remark that in [START_REF] Ehrhard | Böhm trees, Krivine's machine and the Taylor expansion of lambda-terms[END_REF] it is proven a commutation formula:

NF(Θ(M )) = Θ(BT(M ))
for a natural definition of the normal form of the full Taylor expansion and the full Taylor expansion of Böhm trees. The easier "qualitative" version (i.e. without coefficients) of this formula still holds: NF(T (M )) = T (BT(M )).

It will be a central tool in Section 3.5 and we will give an alternative proof of it (Theorem 3.5.6).

The qualitative Taylor expansion for λ-calculus

Notation 3.3.1. From now on, we will simply write M → N instead of M → λ N . We will as well omit the λ in λ . On the contrary, for any other reduction rule we will precise it, as for instance in the head-reduction M → h N .

Definition 3.3.2 (Resource λ-terms). The set Λ r of resource λ-terms is defined by induction as:

t ::= x | λx.t | t[ n t, . . . , t] for n ∈ N.
Resource terms are subject to all the usual syntactical precautions, namely α-equivalence and Barendregt convention for the writing. We call bag a multiset of resource terms. We call deg x (t) the degree of x in t, that is, the number of (free) occurrences of x in t. We define multi-hole resource contexts as expected.

Remark 3.3.3. In the following it will happen to use the size sz(t) ∈ N ≥1 of a resource λterm t, which is inductively defined as: sz(x) := 1, sz(λx.t

) := 1 + sz(t), sz(t 0 [t 1 , . . . , t k ]) := 1 + k + k i=0 sz(t i ).
We consider the extension of this syntax to sums, by means of the free Z 2 -module 2 Λ r constructed as described in Section 2.1. The application and the λ-abstraction constructors are extended, by linearity, on all sums. In particular, multihole-resource-contexts are always linear when seen as functions on 2 Λ r . Definition 3.3.4.

1. For t, t 1 , . . . , t k ∈ Λ r , we define the sum t [t 1 , . . . , t k ]/x ∈ 2 Λ r , called the linear substitution, as:

t [t 1 , . . . , t k ]/x := σ∈S k t{t σ(1) /x 1 , . . . , t σ(k) /x k } if k = deg x (t) 0 otherwise
where S n is the symmetric group over n elements, and with x i we denote the i th occurrence of x in t. This operation is well-defined as the sum makes it independent from the choice of the enumeration of the occurrences of x in t. An equivalent inductive way of defining the operation is given by Figure 3.110 .

2. This calculus is endowed with the resource λ-reduction → r ⊆ Λ r × 2 Λ r defined as the contextual closure of the relation:

(λx.t)[ u] → r t [ u]/x .
This relation is extended to a relation → r ⊆ 2 Λ r ×2 Λ r as described in the preliminaries.

x The application of function to a bag, as in (λx.s)[t 1 , . . . , t k ], should be understood as follows: the program s during its execution must perform n "calls" to its argument x, one for each occurrence of x in s, each time receiving as value a different t i non-deterministically chosen from the bag (in the reduction we consider a formal sum of all possibilities). In case of a mismatch n = k, s "raises an exception" annihilating the whole term, so the outcome of the computation is the empty sum 0. This is precisely the meaning of the following reduction → r .

[v]/x = v y 1/x = y x 1/x = x [v, w, u]/x = 0 y [v, u]/x = 0 (λy.t) [ u]/x = λy.t [ u]/x (t[v 1 , . . . , v n ]) [ u]/x = ([ w 0 ],...,[ w n ]) w.c. of [ u] t [ w 0 ]/x v 1 [ w 1 ]/x , . . . , v n [ w n ]/x
It is well known that: Proposition 3.3.5. The reduction → r ⊆ 2 Λ r × 2 Λ r is confluent and strongly normalising.

In particular, every sum T ∈ 2 Λ r admits exactly one normal form nf r (T) ∈ 2 Λ r .

The strong normalization is easy, since as there is no duplication and contracting a redex eliminates exactly one abstraction, the size sz(•) is a strictly decreasing measure. Moreover, one can check that the resource calculus is actually locally confluent, thus confluence follows from strong normalization by Newman's Lemma. Remark 3.3.6. Resource λ-terms are very similar, in the syntax, to usual λ-terms. They also have all shape λ x.s

[ u 1 ] • • • [ u n ],
with s either a r-redex or a variable. In particular, analogously to λ-normal λ-terms, the r-normal resource terms obey to the following inductive grammar:

λ x.y | λ x.y[ u 1 ] • • • [ u n ]
where the u i j 's are r-normal.

It will happen (in particular in Section 3.5), to "go by induction on the r-normal structure of a resource term" (which we already know to be r-normal). By that we simply mean that we are going by induction on the above inductive grammar of r-normal resource terms. We will denote the set of all the r-normal resource terms by nf r (Λ r ). Notation 3.3.7. We will often use the notation above for indices on bags: [ u i ] denotes some bag whose elements are denoted by u i 1 , . . . , u i k (for some k). Remember that the reduction on sums is not "well-behaved" with respect to + (see last lines of Section 2.1). The following is a special case in which we can reduce in all the addends, eliminating the terms which "go to zero". Remark 3.3.8. Suppose that T, S ∈ 2 Λ r are s.t. nf r (s) = 0 for all s ∈ S and nf r (t) = 0 for all t ∈ T. Then we have: T + S r T.

In fact, say S = s 0 + S 0 (if S = 0 there is nothing to prove). Say s 0 → r S 0 . Then we are allowed to reduce s 0 in T + S, because s 0 is different from all the other addends of the sum (it is not in S by definition, and it is not in T because nf →r (s 0 ) = 0). So T + S → r T + S 0 + S 0 = T + S 0 + S 0 , where S 0 ⊆ S 0 and S 0 + S 0 does not contain duplicates. This is due to the fact that in S 0 we may have created elements already in S 0 , so S 0 is taking into account the erasing of such duplicates. Now we have two cases:

1-either S 0 = 0, in which case we have T + s 0 + S → r T + S 0 ; 2-or S 0 = 0, say S 0 = s 1 + S 1 . In this last case we remark that the size of s 1 is strictly smaller of that of s, and that s 1 is different from all the elements of T + S 1 + S 0 . Thus, if s 1 → r S 1 , we can reduce T + S 0 + S 0 = T + s 1 + S 1 + S 0 → r T + S 1 + S 1 + S 0 . Now we can apply the same argument as before (ereasing the duplicates) and we have again the two cases 1 or 2. However, we cannot stay forever in case 2, because the (well-founded) size is stricly decreasing. Thus at a certain iteration we must fall into case 1. But if we fall into case 1, then we are done, since we have "eliminated s 0 " from S and we can start the proof again11 knowing that there is only a finite number of elements in S.

The following lemma gives another case in which we can consecutively reduce sums. Lemma 3.3.9.

1. Let c be a single-hole context.

(a) Let S 0 → r S 1 . Then: c S 0 → r c S 1 . (b) Let S 0 r S 1 . Then: c S 0 r c S 1 . 2. Let c = c ξ 1 , ξ 2 be a 2-context s.t. deg ξ 1 (c) = deg ξ 2 (c) = 1,
and T be a sum.

(a) Let S 0 → r S 1 . Then: c T, S 0 r c T, S 1 (and the same for c S 0 , T ). (b) Let S 0 r S 1 . Then: c T, S 0 r c T, S 1 (and the same for c S 0 , T ). (c) Let S 0 r S 1 and T r T 1 . Then: c T, S 0 r c T 1 , S 1 . It is easy to lift this property to the case of more than two holes (but always with degree 1).

Proof. (1a). If S 0 → r S 1 then S 0 = s + S, S 1 = S + S, with s → r S and s / ∈ S. So c s / ∈ c S . Remark that there may be duplicates in S + S. Now, since the reduction is contextual, we have c s → r c S . So c S 0 = c s + c S → r c S + c S = c S 1 , where the last equality is easily seen to hold.

(1b). Straightforward induction on the number

n ∈ N s.t. S 0 → r S 1 → r • • • → r S n-2 → r S 1 , using point (1)(a). (2a). Since c t, ξ is a single-hole context, if S 0 → r S 1 then by point (1a) we have c t, S 0 → r c t, S 1 for all t ∈ T. Let T =: k i=0 t i . Since c t 0 , S 0 = c t i , S 0 for all i = 0, we have: c T, S 0 = k i=0 c t i , S 0 → r c t 0 , S 1 + k i=1 c t i , S 0 . But c t 0 , S 1 = c t 1 , S 0 = c t i , S 0
for all i = 1, so we have:

c t 0 , S 1 + k i=1 c t i , S 0 → r c t 0 , S 1 + c t 1 , S 1 + k i=2 c t i , S 0 .
We can keep reducing in this way all the k elements of T, and we obtain as final sum

k i=0 c t i , S 1 = c T, S 1
, so we are done.

(2b). As in point (1)(b). (2c). Immediate by point (2b).

We will not explicit the use of the previous lemma.

Definition 3.3.10 (Qualitative Taylor expansion). The (qualitative) Taylor expansion of a term is the map T : Λ → P * (Λ r ) inductively defined as:

T (x) := {x} T (λx.M ) := {λx.t | t ∈ T (M )} T (M N ) := {t[ u] | t ∈ T (M ) and [ u] ∈ ! T (N )}.
For M ∈ Λ one defines the (qualitative) Taylor normal form as the possibly empty set:

NFT (M ) := t∈T (M ) nf r (t) ⊆ P(Λ r ).
The inclusion of Taylor normal forms endows Λ with a partial preorder ≤, whose induced equivalence = τ on Λ is given by the equality of Taylor normal forms.

Example 3.3.11. It is well known that NFT (Ω) = ∅. Let us compute it as an example.

For n ∈ N, let us set, in this example,

∆ n := λx.x[ n x, . . . , x]. Now we have: T (Ω) = {∆ n 0 [∆ n 1 , . . . , ∆ n k ] | k, n 0 , . . . , n k ∈ N}, and it is immediate to show, by induction on k ∈ N, that nf r (∆ n 0 [∆ n 1 , . . . , ∆ n k ]) = 0
for any generic such term. In fact, by definition of ∆ n 0 , such element reduces to 0 whenever k = n 0 + 1, and otherwise, that is if

k = n 0 + 1 ≥ 1, it reduces to ∆ n σ(1) [∆ n σ(2) , . . . , ∆ n σ(k) ],
for some permutation σ on k elements. But now we are done by the inductive hypothesis on this latter term, which has k -1 < k elements in the bag.

Lemma 3.3.12. If λx 1 . . . λx n .xM 1 • • • M k = τ λx 1 . . . λx n .yN 1 • • • N k then n = n , k = k , x = y and M i = τ N i for all i = 1, . . . , k.
Proof. This easily follows from the definitions. Indeed, since:

NFT (λx 1 . . . λx n .xM 1 • • • M k ) = λx 1 . . . λx n .x ! NFT (M 1 ) • • • ! NFT (M k )
and the same for λx 1 . . . λx n .yN 1 • • • N k , one has n = n , k = k and x = y. In order to show M i = τ N i it suffices to show M i ≤ N i , the result being symmetrical. To that end, take t ∈ NFT (M i ), i.e. [t] ∈ ! NFT (M i ). Thus:

λ x.x1 • • • 1[t]1 • • • 1 ∈ NFT (λ x.xM 1 • • • M k ) = NFT (λ x.xN 1 • • • N k ) = λ x.x ! NFT (N 1 ) • • • ! NFT (N k ), whence [t] ∈ ! NFT (N i ), i.e. t ∈ NFT (N i ).
The first important result is the following:

Theorem 3.3.13 (Monotonicity property). Any context C is monotone w.r.t. ≤.
Proof. We have to prove that for all M, N ∈ Λ s.t. NFT (M ) ⊆ NFT (N ), one has NFT (C M ) ⊆ NFT (C N ). We go by induction on C.

If C = ξ then NFT (C M ) = NFT (M ) ⊆ NFT (N ) = NFT (C N ). If C = x then NFT (C M ) = {x} = NFT (C N ). If C = λx.C then: NFT (C M ) = {λx.t | t ∈ NFT (C M )} ⊆ {λx.t | t ∈ NFT (C N )} = NFT (C N ). If C = C C then: NFT (C M ) = t∈NFT (C M ) [ u]∈ ! NFT (C M ) nf r (t[ u]) ⊆ t∈NFT (C N ) [ u]∈ ! NFT (C N ) nf r (t[ u]) = NFT (C N ).
Monotonicity also holds for multi-hole contexts. That is: if

M 1 ≤ N 1 , . . . , M n ≤ N n then C M 1 , . . . , M n ≤ C N 1 , . . . , N n for all k-context C.
This can be directly proved simply by considering a k-context C and carrying on the exact same proof as above. Or also, by considering the contexts C i ξ := C N 1 , . . . , N i-1 , ξ, M i+1 , . . . , M n (for i = 1, . . . , n), and remarking that, by Monotonicity on contexts, one has:

C M 1 , . . . , M n ≤ C N 1 , M 2 , . . . , M n ≤ • • • ≤ C N 1 , . . . , N n-1 , M n ≤ C N 1 , . . . , N n .
Monotonicity immediately implies that C U is a minimal element w.r.t ≤, for any U = τ Ω. But we can say more: Corollary 3.3.14.

1. The equivalence = τ is contextual. That is, multi-hole contexts are well defined functions on Λ/= τ .

In

Λ/= τ , if Ω ∈ Im(C) 12 then Ω is a fixed-point of C. Proof.
1. It is immediate from Theorem 3.3.13 since = τ is the induced equivalence of ≤.

As we already remarked, any

U ∈ Λ with NF(T (U )) = ∅ is minimal w.r.t ≤, that is, NFT (C M ) ⊇ NFT (C U ) for all M ∈ Λ. So NFT (C U ) = ∅ entails NFT (C M ) = ∅.
Now reading the contrapositive of what we just obtained, we obtain point (2).

Remark 3.3.15. One can easily check that for all M ∈ Λ,

(1) M is normal iff NF(T (M )) = T (M ) iff T (M ) ⊆ nf r (Λ r ).
(

) T (M ) ∩ nf r (Λ r ) ⊆ NF(T (M )). 2
(

) If M N then T (M ) ∩ nf r (Λ r ) ⊆ T (N ). 3
The following lemma says that Taylor expansion behaves well w.r.t substitutions.

Lemma 3.3.16. Let M, N ∈ Λ and x be a variable. We have:

T (M {N/x}) = t∈T (M ) [ u]∈ ! T (N ) t [ u]/x .
Proof. Case M = x:

T (M {N/x}) = T (N ) = {u | u ∈ T (N )} = u∈T (N ) x [u]/x = t∈T (M ) [ u]∈ ! T (N ) t [ u]/x .
Case M = y = x:

T (M {N/x}) = T (M ) = {y} = y 1/x = t∈T (M ) [ u]∈ ! T (N ) t [ u]/x .
Case M = λy.P :

T (M {N/x}) = T (λx. P {N/x}) = {λx.s | s ∈ T (P {N/x})} = p∈T (P ) [ u]∈ ! T (N ) λx. p [ u]/x (by inductive hypothesis) = p∈T (P ) [ u]∈ ! T (N ) (λx.p) [ u]/x = t∈T (M ) [ u]∈ ! T (N ) t [ u]/x .
Case M = P Q:

T (M {N/x}) = n∈N p∈T (P ) [ q]∈ ! T (Q) [ s 0 ],...,[ s n ]∈ ! T (N ) v[w 1 , . . . , w n ] | v ∈ p [ s 0 ]/x , w i ∈ q i [ s i ]/x
(by inductive hypothesis)

= n∈N p∈T (P ) [ q]∈ ! T (Q) [ u]∈ ! T (N ) ([ s 0 ], . . . , [ s n ]) w.c. of [ u] p [ s 0 ]/x [q 1 [ s 1 ]/x , . . . , q n [ s n ]/x ] = p∈T (P ) [ q]∈ ! T (Q) [ u]∈ ! T (N ) (p[ q]) [ u]/x (by Figure 3.1) = t∈T (M ) u∈ ! T (N ) t [ u]/x .
The following property is important. Not only one needs it in many proofs, but also it is, in some sense, the prototypical property a "notion of approximation" should satisfy (see the end of Section 3.6). Proposition 3.3.17. Let M, N ∈ Λ. If M → N then the following holds:

1. For all s ∈ T (M ), s r T for some sum T ⊆ T (N ).

2. For all s ∈ T (N ), there exist s ∈ T (M ) such that s r s + T for some sum T ⊆ T (N ).

Proof. (1) and ( 2). We can write M = C (λx.P )Q and N = C P {Q/x} , for some P, Q ∈ Λ, x variable and C = C ξ a single-hole context. Now go by induction on C. In the case C = ξ, both (1) and ( 2) are straightforward using Lemma 3.3.16. The only interesting case is C = DC .

(1). Take s ∈ T (M ). Then s = s [s 1 , . . . , s k ] for some s ∈ T (D) and s 1 , . . . , s k ∈ T (C (λx.P )Q ).

By inductive hypothesis we have that for all i = 1, . . . , k, there is a (2). For (2), take s ∈ T (N ). Then s = s [s 1 , . . . , s k ] for some s ∈ T (D) and s 1 , . . . , s k ∈ T (C P {Q/x} ). By inductive hypothesis we have that for all i = 1, . . . , k, there is an

T i ⊆ T (C P {Q/x} ) such that s i r T i . So s = s [s 1 , . . . , s k ] r s [T 1 , . . . , T k ] = s i ∈T i s [s 1 , . . . , s k ] =: T,
s i ∈ T (C (λx.P )Q ) such that s i r s i + T i for some sum T i ⊆ T (C P {Q/x} ). So T (M ) = T (D C (λx.P )Q ) s := s [ s 1 , . . . , s k ] r s [s 1 , . . . , s k ] + T = s + T for some sum T ⊆ T (N )
, and we are done.

Corollary 3.3.18. The equivalence = τ is a λ-theory.

Proof. We already know that it is contextual (Corollary 3.3.14), so it is enough to show that if M → N then NFT (M ) = NFT (N ). Let us do the two inclusions.

(⊆). If t ∈ NFT (M ) then t ∈ nf r (s), for an s ∈ T (M ). By Proposition 3.3.17 there is S ⊆ T (N ) s.t. s r S. But by confluence and being t normal, it must be t ∈ nf r (S). In particular this means that t ∈ nf r (t ) for some t ∈ S. Thus, t ∈ NFT (N ).

(⊇). If t ∈ NFT (N ) then t ∈ nf r (s ), for an s ∈ T (N ). By Proposition 3.3.17 there is s ∈ T (M ) s.t. s r s + T for a sum T. But by confluence this means t ∈ nf r (s). Thus, t ∈ NFT (M ).

Remark 3.3.19. One can easily check that for all M ∈ Λ normalizable, from remark 3.3.15(1) and Corollary 3.3.18 we obtain the commutation: T (nf λ (M )) = NF(T (M )). In the Section 3.5 we will generalize this commutation to the case when M is not normalizable.

Let us state here a fundamental result, due to [START_REF] Ehrhard | Uniformity and the Taylor expansion of ordinary lambda-terms[END_REF]. We will quickly comment on it when we will prove it in the case of λµ-calculus (Theorem 4.4.51). In particular, it will be needed in Theorem 3.3.37.

Lemma 3.3.20 (Non-interference property). Let M ∈ Λ and s, t ∈ T (M ). If nf r (s)∩nf r (t) = ∅ then s = t.
Remark that this immediately extends to arbitrary intersections: if t i ∈ T (M ) for all i ∈ I and if i∈I nf r (t i ) = ∅, then nf r (t i ) ∩ nf r (t j ) = ∅ for all i, j ∈ I, and so t i = t j for all i, j ∈ I.

A first application of Lemma 3.3.20 is given by the following Lemma, which gives a case in which reducing each addend of a sum is possible. Lemma 3.3.21.

1. Let i t i ⊆ T (M ) be a sum (thus, finite) of distinct terms. Suppose that for all i we have nf r (t i ) = 0 and t i → r T i + S i , with nf r (u) = 0 for all u ∈ T i and nf r (s) = 0 for all s ∈ S i . Then:

i t i r i T i .
2. The same of point 1 still holds without the condition "nf r (t i ) = 0 for all i".

Proof. (1). Reducing t 0 in i t i (if the sum is empty there is nothing to prove), we have:

i t i → r T 0 + S 0 + i≥1 t i =: T 1 . Now, each t i , for i ≥ 1, is not in S 0 because it does not reduce to 0; and it is not in T 0 because otherwise 0 = nf r (t i ) ⊆ nf r (T 0 ) = nf r (t 0 ). But T (M ) t 0 = t 1 ∈ T (M )
, so we would have a contradiction with Lemma 3.3.20. Therefore, we are allowed to reduce t 1 in T 1 . We obtain:

T 1 = t 1 + T 0 + S 0 + i≥2 t i → r T 1 + S 1 + T 0 + S 0 + i≥2 t i .
Remark here that we do not care about the presence of eventual duplicates. In fact, all we care is that now the same argument as before, involving Lemma 3.3.20, shows that we can reduce t 2 in the previous sum. In this way, we reduce all the t i 's, and obtain at the end:

i t i r i T i +S,
for some sum S s.t. all its element reduce to 0. Thus, by Remark 3.3.8 we are done13 . (2). Let i t i =: T + S, with nf r (u) = 0 for all u ∈ T and nf r (s) = 0 for all s ∈ S.. Remark 3.3.8 gives i t i r T and T is in the hypotheses of point 1. Whence, the result.

We will not explicit the use of the previous Lemma.

We introduce now a reduction "⇓" that captures in one (big-)step the notion of r-normal form (in the sense of Lemma 3.3.24). Definition 3.3.22 (Big-step reduction). The big-step reduction ⇓ ⊆ Λ r × Λ r is the contextual closure of the rules given in Figure 3.2.

t normal t ⇓ t t ⇓ t λx.t ⇓ λx.t t ⇓ x u 1 1 ⇓ v 1 1 • • • u 1 m 1 ⇓ v 1 m 1 • • • u k 1 ⇓ v k 1 • • • u k m k ⇓ v k m k t [u 1 1 , . . . , u 1 m 1 ] • • • [u k 1 , . . . , u k m k ] ⇓ x [v 1 1 , . . . , v 1 m 1 ] • • • [v k 1 , . . . , v k m k ] t ⇓ λx.t u 1 ⇓ v 1 • • • u k ⇓ v k w[ s 1 ] • • • [ s h ] ⇓ t w ∈ t [ v]/x t [ u] [ s 1 ] • • • [ s h ] ⇓ t Figure 3.

2: Base cases of the big-step reduction for λ-calculus

It is clear that ⇓ is not a function, in that there can be multiple t s.t. t ⇓ t . Remark 3.3.23. A t ∈ Λ r is r-normal as soon as t ⇓ t for some t ∈ Λ r . This is immediate by induction on a reduction t ⇓ t .

The next lemma says that, in fact, big-step reduction is simply an inductive characterization of nf r (•). Lemma 3.3.24. For all t, t ∈ Λ r one has: t ⇓ t iff t ∈ nf r (t).

Proof. (⇒)

. By induction on a reduction t ⇓ t we prove that t r t +T for some sum T. Since t r-normal thanks to Remark 3.3.23, this ends the proof. All the cases being immediate, let us see only the one corresponding to t

= p[ u][ s 1 ] • • • [ s h ]
, that is the one where p ⇓ λx.p ,

u i ⇓ v i for i = 1, . . . , k, and w[ s 1 ] • • • [ s h ] ⇓ t , with w ∈ p [ v]/
x . In this case, using the inductive hypothesis on the bigstep-reductions above, we get:

t = p[ u][ s 1 ] • • • [ s h ] r (λx.p )[ v][ s 1 ] • • • [ s h ] + T → r p [ v]/x [ s 1 ] • • • [ s h ] + T w[ s 1 ] • • • [ s h ] r t + T . (⇐). By induction on the size sz(t) ∈ N ≥1 of t. If sz(t) = 1 then t = x = t
t i ∈ nf r (v i ).
If n = 0 the result is immediate, and in the case n = 0 the inductive hypothesis on each v i (of strictly smaller size than t because of the presence of the bag) gives v i ⇓ t i , whence t ⇓ t by the third rule defining ⇓. We are thus left with the case t = (λx.s

0 )[ v][ s 1 ] • • • [ s h ]. But t → r s 0 [ v]/x [ s 1 ] • • • [ s h ] r nf r (s 0 ) [nf r (v 1 ), . . . , nf r (v n )]/x [ s 1 ] • • • [ s h ]. By confluence t ∈ nf r ( s[ s 1 ] • • • [ s h ]) for some s ∈ s 0 [v 1 , . . . , v n ]/x , for some s 0 ∈ nf r (s 0 ), v i ∈ nf r (v i ). Also, sz( s[ s 1 ] • • • [ s h ]) ≤ sz(t)
and thus the inductive hypothesis on it gives

s[ s 1 ] • • • [ s h ] ⇓ t .
But we can apply the inductive hypothesis also on s 0 and on each v i since their size is clearly strictly smaller than that of t, and so we get v i ⇓ v i as well as s 0 ⇓ s 0 , whence λx.s 0 ⇓ λx.s 0 . Hence, we can apply the last rule of the definition of ⇓ and obtain t = (λx.s

0 )[ v][ s 1 ] • • • [ s h ] ⇓ t .
Lemma 3.3.25. (1) For all t ∈ T (M ) and t ∈ nf r (t), there is N ∈ Λ such that M N and t ∈ T (N ).

(2) For all t ∈ T (M ), there exist N ∈ Λ such that M N and nf r (t) ⊆ T (N ).

Proof. [START_REF]An assumption: if PA does not derive ⊥, then arithmetic is coherent[END_REF]. Thanks to the previous lemma we can prove the result by induction on t ⇓ t . All the cases are similar, so let us only show the case for t

= p[ u][ s 1 ] • • • [ s h ], that is the one where p ⇓ λx.p , u i ⇓ v i for i = 1, . . . , k, and w[ s 1 ] • • • [ s h ] ⇓ t , with w ∈ p [ v]/x . In this case it must be M = P Q R, with p ∈ T (P ), [ u] ∈ ! T (Q) and [ s i ] ∈ ! T (R i ). By inductive hypothesis on each u i , for all i = 1, . . . , k there is Q i ∈ Λ s.t. Q Q i and v i ∈ T (Q i ). By confluence there exist Q ∈ Λ such that every Q i Q , and since all the v i are normal, by Remark 3.3.15(3) we have v 1 , . . . , v k ∈ T (Q ) (if k = 0 just take Q := Q).
Also, the inductive hypothesis on p ∈ T (P ) (which is such that p ⇓ λx.p ) gives a P ∈ Λ such that P λx.P and p ∈ T (P ). But then by Lemma 3.3.16 we have w

[ s 1 ] • • • [ s h ] ∈ T (P {Q /x} R),
and thus the inductive hypothesis on the fact that it ⇓-reduces to t gives an N ∈ Λ such that P {Q /x} R N and t ∈ T (N ). Now we have M (λx.P )Q R → P {Q /x} R N and we are done.

(2). By [START_REF]An assumption: if PA does not derive ⊥, then arithmetic is coherent[END_REF] we have that for all s ∈ nf r (t), there exist N s ∈ Λ such that M N s and s ∈ T (N s ). Now, if nf r (t) = 0 then one can choose N := M ; otherwise, by confluence there is an N ∈ Λ such that N s N for all s ∈ nf r (t), and since every such s is r-normal, by Remark 3.3.15(3) one has that s ∈ T (N ).

One can immediately lift the previous result to sums. This is done in the next Corollary 3.3.26, which will also be proved again, with a different method, at the end of the next Section 3.3.1.

Corollary 3.3.26. For all T ⊆ T (M ), there exist N ∈ Λ such that M N and nf r (T) ⊆ T (N ).

Proof. One can reason in the exact same way as for Lemma 3.3.25 [START_REF]First goal: reduce the coherence of all mathematics to the one of arithmetic[END_REF], remembering that by definition nf r (T) = s∈T nf r (s).

In the following of the thesis the most of the times that we will use Corollary 3.3.26 we could in fact already use the version for T = t, that is, Lemma 3.3.25 [START_REF]First goal: reduce the coherence of all mathematics to the one of arithmetic[END_REF].

Corollary 3.3.27. If N = τ λ x.xM 1 • • • M k then N λ x.xN 1 • • • N k , for some N i ∈ Λ s.t. N i = τ M i . Proof. We know that NFT (N ) = NFT (λ x.xM 1 • • • M k ) = λ x.x ! NFT (M 1 ) • • • ! NFT (M k ) = ∅. Therefore there is an h ∈ T (N ) and a λ x.x[ v 1 ] • • • [ v k ] ∈ nf r (h), with v i j ∈ NFT (M i ). By Corollary 3.3.26, N N for some N ∈ Λ s.t. λ x.x[ v 1 ] • • • [ v k ] ∈ nf r (h) ⊆ T (N ). So it must be N = λ x.xN 1 • • • N k for some N i ∈ Λ. Now, by Corollary 3.3.18 we get λ x.xM 1 • • • M k = τ λ x.xN 1 • • • N k ,
and applying Remark 3.3.12, N i = τ M i for all i = 1, . . . , k.

Rigids of a resource term

We consider in this subsection the notion of rigid term. We are mainly interested in the fact that rigid terms are canonically associated with a resource term (Definition 3.3.29). Rigid-calculi have been considered, in various forma, e.g. in [START_REF] Tsukada | Generalised species of rigid resource terms[END_REF], [START_REF] Mazza | Polyadic approximations, fibrations and intersection types[END_REF] and [START_REF] Olimpieri | On the taylor expansion of lambdaterms and the groupoid structure of their rigid approximants[END_REF], in relation to, respectively, generalized species of structures, intersection types and the combinatorial role of the factorial coefficients in the full (i.e. quantitative) Taylor expansion of a term.

The reason why we are interested in rigid terms here is double: first, as already mentioned, it allows us to give an alternative proof of Corollary 3.3.26; we will adapt the same method in Section 4.3, and it will work also for λµ-calculus. The second reason is that the results we will prove in this subsection about the rigids associated with a resource term (Lemma 3.3.32 and Proposition 3.3.33) are needed in the remainder of the chapter (in particular, in the proof of the Stability property -Theorem 3.3.37).

In the following, " . . . " denotes a list (and the empty list). Definition 3.3.28 (Rigids). The set of rigid resource λ-terms is defined by:

t ::= x | λx.t | t t, . . . , t .
The set of rigid k-context is defined as expected adding the clause "ξ 1 | • • • | ξ k " for the holes. Definition 3.3.29. Let c be a resource-k-context. We define a set Rigid(c) of rigid k-contexts, whose elements are called the rigids of c, by induction on c as follows:

1. Rigid(ξ i ) = {ξ i } 2. Rigid(x) = {x} 3. Rigid(λx.c 0 ) = {λx.c • 0 | c • 0 ∈ Rigid(c 0 )} 4. Rigid(c 0 [c 1 , . . . , c k ]) = {c • 0 c • σ(1) , . . . , c • σ(k) | c • i ∈ Rigid(c i ) and σ permutation}.
Our set Rigid(c) is the preimage F -1 (c) of c under the surjection F 14 from rigid contexts to resource context that forgets the order of the elements in the lists. Its graph relation is what in [START_REF] Olimpieri | On the taylor expansion of lambdaterms and the groupoid structure of their rigid approximants[END_REF] is called the "representation relation". In the following definition we precisely operate such a forgetful operation, but in addition we consider terms filling the holes. Definition 3.3.30. Let c • be a rigid of a resource-k-context c and, for i = 1, . . . , k, let v i := v i 1 , . . . , v i deg ξ i (c) be a list 15 of resource terms. We define, by induction on c, a resource term c • v 1 , . . . , v k as follows:

1. If c = ξ i then c • = ξ i ; we set c • , . . . , , v i 1 , , . . . , := v i 1 . 2. If c = x then c • = x; we set c • , . . . , := x. 3. If c = λx.c 0 then c • = λx.c • 0 where c • 0 is a rigid of c 0 ; we set c • v 1 , . . . , v k = λx.c • 0 v 1 , . . . , v k . 4. If c = c 0 [c 1 , . . . , c n ], then c • = c • 0 c • σ(1) , . . . , c • σ(n) where c • i is a rigid of c i . So each list v i factorizes as a concatenation w i0 w i1 • • • w in of
lists where w i0 has exactly deg ξ i (c 0 ) elements and w ij has exactly deg ξ i (c σ(j) ) elements 16 ; we set:

c • v 1 , . . . , v k := c • 0 w 10 , . . . , w k0 [c • σ(1) w 11 , . . . , w k1 , . . . , c • σ(n) w 1n , . . . , w kn ]. Remark 3.3.31. One has that if v r V then: c • • • • , • • • , v, • • • , • • • r w∈V c • • • • , • • • , w, • • • , • • • =: c • • • • , • • • , V, • • • , • • • .
Let us extend the definition of Taylor expansion to resource k-contexts by adding, in its definition, the clause:

T (ξ i ) := {ξ i }.
It is clear that is C is a k-context then all elements of T (C) are resource k-contexts.

In the following, if v is a list, we denote with [ v] the multiset associated with v (same elements but disordered).

Lemma 3.3.32. Let C be a k-context and c 1 , c 2 ∈ T (C). Let c • 1 and c • 2 rigids respectively of c 1 and c 2 . For i = 1 . . . , k, let v i = v i 1 , . . . , v i deg ξ i (c 1 ) and u i = u i 1 , . . . , u i deg ξ i (c 2 ) be lists of resource terms. If c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k then c 1 = c 2 and [ v i ] = [ u i ] for all i.
Proof. Induction on C.

Case C = ξ i . Then c 1 = ξ i = c 2 , and v i = v i 1 , u i = u i 1 and v j = = u j for j = i. So v i 1 = c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k = u i 1 .
Case C = x. Trivial.

Case C = λx.C 0 . Straightforward by inductive hypothesis.

14 In [OA20] F is called . , but here wrote F , for "forgetful". 15 If deg ξ i (c) = 0 we mean the empty list.

16 This is just a concise way of saying that we take

w i1 := v i 1 , . . . , v i deg ξ i (c σ(1) ) , w i2 := v i 1+deg ξ i (c σ(1) ) , . . . , v i deg ξ i (c σ(2) )+deg ξ i (c σ(1)
) etc, and similarly for w i0 .

Case C = C C . Then, for i = 1, 2, one has

c i = c i0 [c i1 , . . . , c in i ] with c i0 ∈ T (C ) and c ij ∈ T (C ) for j ≥ 1. So c • i = c • i0 c • iσ i (1) , . . . , c • iσ i (n i )
where σ i is a permutation on n i elements. So:

c • 1 v 1 , . . . , v k = c • 10 w 110 , . . . , w 1k0 [ c • 1σ 1 (1) w 111 , . . . , w 1k1 , . . . , c • 1σ 1 (n 1 ) w 11n 1 , . . . , w 1kn 1 ] c • 2 v 1 , . . . , v k = c • 20 w 210 , . . . , w 2k0 [ c • 2σ 2 (1) w 211 , . . . , w 2k1 , . . . , c • 2σ 2 (n 2 ) w 21n 2 , . . . , w 2kn 2 ]
where the concatenation w 1j1 • • • w 1jn 1 equals v j and the concatenation

w 2j1 • • • w 2jn 2 equals u j . From c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k we get that n 1 = n 2 =: n, that: c • 10 w 110 , . . . , w 1k0 = c • 20 w 210 , . . . , w 2k0 (3.6)
and that there exist a permutation ρ on n elements which identifies each term of the written bag of c • 1 v 1 , . . . , v k with the respective one of the written bag of c • 2 u 1 , . . . , u k . That is, for all h = 1, . . . , n, one has:

c • 1σ 1 (h) w 1 1 h , . . . , w 1 k h = c • 2σ 2 (ρ(h)) w 2 1 ρ(h) , . . . , w 2 k ρ(h) . (3.7)
Now the inductive hypothesis on (3.6) gives c • 10 = c • 20 as well as [

w 1 i 0 ] = [ w 2 i 0 ]
, and the inductive hypothesis on (3.7) gives, after some reindexing, [c • 11 , . . . , c

• 1n ] = [c • 21 , . . . , c • 2n ] as well as [ w 1j1 • • • w 1jn ] = [ w 2j1 • • • w 2jn ] for j ≥ 1.
Putting these things together, we have the desired result. Lemma 3.3.33.

1. Let C be a k-context. Then:

T (C M 1 , . . . , M k ) = {c • s 1 , . . . , s k | c ∈ T (C), c • rigid of c and s i list of elements of T (M i )}.
:= s 0 1 , . . . , s 0 deg ξ (c 0 )-1 of elements of T (N ), such that c t = c • 0 t, s 0 for all t ∈ Λ r . But u i ∈ T (Q) = T (C 0 N ),
so by the point (1), each u i have shape u i = c • i s i for an appropriate c • i rigid of some c i ∈ T (C 0 ) and some s i list of elements of T (N ). Now, we have: M = C N for C := P C 0 . Moreover, putting c := u[c 0 , c 1 , . . . , c n ] ∈ T (C) and choosing its rigid c

• := u • c • 0 , c • 1 , . . . , c • k (which rigid u • of u one chooses does not matter), we have: c t = u[c t , u 1 . . . , u n ] = u[c • 0 t, s , c • 1 s 1 , . . . , c • k s k ] = c • t, s for all t ∈ Λ r , where the list s is the concatenation s 0 s 1 • • • s n and is made of exactly deg ξ ( c) -1 elements of T (N ).
Let us notice how, as previously mentioned, using resource contexts one can give an alternative proof of Corollary 3.3.26 not using the bigstep argument.

-First prove the following:

Proposition 3.3.34. If T (M ) ⊇ T → r T then there is N ∈ L and a sum T ⊆ T (N ) s.t. M → N and T r T.
Proof. Saying that T → r T means that T has shape

T = i t i + c (λx.s 0 )[ u]
and T has shape

T = i t i + c s 0 [ u]/x ,
t i = c • i v i for some resource terms v i j ∈ T (N ), a context c i ∈ T (C 0 ) and a rigid c • i of c i . But since N → N we can apply Proposition 3.3.17 on v i j and obtain that v i j r V i j for some sum V i j ⊆ T (N ). So t i r c • i V i =: T i .
Using again Lemma 3.3.33(1) one has that T i ⊆ T (N ). Now, let's use again Proposition 3.3.17, this time on each s i ∈ T (N ). Since N → N we obtain sums S i ⊆ T (N ) s.t. s i r S i . So we have: -and then prove Corollary 3.3.26:

c s 0 [ u]/x = c • 0 s 0 [ u]/x , s r c • 0 s 0 [ u]/x , S =: U. But since s 0 [ u]/x ⊆ T (N )
Alternative proof of Corollary 3.3.26. We prove, by induction on ∈ N, that if is the length of a maximal reduction (let's call it φ) from a sum T to its normal form nf r (T), then the statement of Corollary 3.3.26 holds. If = 0 then just take N := M . If ≥ 1, then φ factorizes as T → r T r nf r (T) for some sum T . Since T ∈ T (M ) by hypothesis, by Proposition 3.3.34 there exist N ∈ L and T ⊆ T (N ) such that M → N and T r T . Let k ≥ 0 be the length of this last reduction. By confluence, we have also T r nf r (T). Now take the maximal reduction from T to nf r (T ) = nf r (T) and let be its length. Due to the maximality of φ, it must be + k + 1 ≤ , so < , and now we can apply the inductive hypothesis to (because it is the maximal length of a reduction between a sum T and its normal form). Since we already found that T ⊆ T (N ), we get an N ∈ L such that M → N N and nf r (T) = nf r (T ) ⊆ T (N ).

Stability and Perpendicular Lines Property

Let us now apply the developed tools in order to obtain, first, the Stability property and, then, the Perpendicular Lines Lemma (PLP for short). Both of them are, for now, stated with respect to the λ-theory = τ .

Stability Let us set up some notations used in the statement of the Stability theorem.

Definition 3.3.35. Given a non-empty subset X ⊆ Λ, define its T -infimum X ⊆ Λ r (also written M ∈X M ) as:

X := M ∈X NFT (M ).
We say that X is T -bounded iff there exists an L ∈ Λ such that M ≤ L for all M ∈ X .

We write M = X instead of NFT (M ) = X . 3.

n≥2 λf.f n Ω = {λf.f [f 1, . . . , f 1 k ] | k ∈ N}.
Observe that the M s.t. M = X , in case it exists, need not to be unique; so writing only X does not identify a unique λ-term. The following Stability theorem gives sufficient conditions for when a context commutes with intersection, in the sense that one informally has (with abuse of notation):

C N ∈X 1 N , . . . , N ∈Xn N = N 1 ∈X 1 • • • Nn∈Xn C N 1 , . . . , N n . Theorem 3.3.37 (Stability property). Let C be an n-context and fix non-empty T -bounded X 1 , . . . , X n ⊆ Λ. For all M 1 , . . . , M n ∈ Λ s.t. M i = X i (for i = 1, . . . , n) we have: C M 1 , . . . , M n = N 1 ∈X 1 ... Nn∈Xn C N 1 , . . . , N n . Proof. Since every X i is T -bounded, for i = 1, . . . , n there exists L i ∈ Λ s.t. N ∈X i NFT (N ) ⊆ NFT (L i ). Fix now M 1 , . . . , M n ∈ Λ s.t. NFT (M i ) = N ∈X i NFT (N ).
We have to show that:

NFT (C M 1 , . . . , M n ) = N 1 ∈X 1 • • • Nn∈Xn NFT (C N 1 , . . . , N n ). (⊆). Clearly, for all i = 1, . . . , n and N i ∈ X i , we have NFT (M i ) ⊆ NFT (N i ), therefore we conclude NFT (C M 1 , . . . , M n ) ⊆ NFT (C N 1 , . . . , N n ) by Monotonicity (Proposi- tion 3.3.13). (⊇). Let t ∈ N ∈ X NFT (C N 1 , . . . , N n ) (where N := (N 1 , . . . , N n ) and X := (X 1 , . . . , X n )).
For every N ∈ X , by Lemma 3.3.33 there exist an n-resource-context c N ∈ T (C) and, for every i = 1, . . . , n, a list

v i N = v i1 N , . . . , v id i N ( where
d i := deg ξ i (c N )) of elements of T (N i ) and such that t ∈ nf r (c • N v 1 N , . . . , v n N ), for c • N a rigid of c N . Fix any reduction from c • N v 1 N , . . . , v n N
to its normal form, and confluence allows to factorize it as follows:

c • N nf r (v 11 N ), . . . , nf r (v 1d 1 N ), . . . , nf r (v n1 N ), . . . , nf r (v ndn N ) r nf r (c • N v 1 N , . . . , v n N ) t.
So for all i = 1, . . . , n and j = 1, . . . , d i , there exist

w ij N ∈ nf r (v ij N ) such that: nf r (c • N w 1 N , . . . , w n N ) t (3.8) and being N i ∈ X i which is bounded by L i , we have w ij N ∈ nf r (v ij N ) ⊆ NFT (N i ) ⊆ NFT (L i ). From each inclusion w ij N ∈ NFT (L i ) we obtain a resource term u ij N ∈ T (L i ) such that: w ij N ∈ nf r (u ij N ) (3.9)
By composing thus a reduction from

u ij N to w ij N with a reduction from c • N w 1 N , . . . , w n N to t, we find that t ∈ nf r (c • N u 1 N , . . . , u n N
). This holds for all N ∈ X , i.e.: ] are independent from N ∈ X . The unique element of the previous sigleton has hence shape c • u i , . . . , u n , with c • a rigid of a c ∈ T (C), and u i a list of elements of T (L i ). Recalling now that j u i j ⊆ T (L i ), we can apply Corollary 3.3.26 in order to obtain, for each i = 1, . . . , n, an L i ∈ Λ s.t. L i L i and, using (3.9), j w ij ⊆ T (L i ). Thus Lemma 3.3.33 tells us that, for every N ∈ X , we have:

t ∈ N ∈ X nf r (c N u 1 N , . . . , u n N ). ( 3
c • w 1 N , . . . , w n N ∈ T (C L 1 , . . . , L n ). ( 3
t ∈ nf r (c • w 1 , . . . , w n ). (3.12)
Now for all i = 1, . . . , n, we already know that [

w i ] = [ w i N
] which is a bag of elements of NFT (N ), and this holds for all N ∈ X i . That is, we have:

j w ij ⊆ N ∈X i NFT (N ) = NFT (M i ) (3.13)
where we finally used the hypothesis. From (3.12), (3.13) and Lemma 3.3.33 we finally conclude that t

∈ nf r (c • w 1 , . . . , w n ) ⊆ NFT (C M 1 , . . . , M n ).
We immediately obtain the non implementability of the following parallel-or, where we use the usual encoding of couples as (M, N ) := λz.zM N ∈ Λ.

Corollary 3.3.38. There is no

Por ∈ Λ s.t. for all M, N ∈ Λ, Por (M, N ) = τ True if M = τ Ω or N = τ Ω Por (M, N ) = τ Ω if M = τ N = τ Ω.
Proof. Otherwise, for the context C := Por ξ, the set X := {(True, Ω), (Ω, True)} ⊆ Λ which is bounded by (True, True) ∈ Λ, Stability (Theorem 3.3.37) would give the contradiction:

True = τ C (True, Ω) ∩ C (Ω, True) = τ C (Ω, Ω) = τ Ω.
The Perpendicular Lines Property The perpendicular lines property (PLP, for short) states that if a term λz 1 . . . λz n .F is constant modulo = τ on n perpendicular lines, then it must be constant modulo = τ everywhere. Let us explain what does this terminology mean:

-When we say a "line" we mean a notion miming, in λ-calculus, the one of line parallel to the axes in Cartesian geometry: we fix all the coordinates but one. That is, a "λ-calculus line" l is a subset

l = {(M 1 , . . . , M i-1 , Z, M i+1 , . . . , M n ) ∈ Λ n | Z ∈ Λ} of Λ n (
which corresponds to a line parallel to the i-th axe in geometry). We will denote it is simply by:

l : (M 1 , . . . , M i-1 , Z, M i+1 , . . . , M n ) Z∈Λ .
-Miming again geometry, when we say that two lines l 1 , l 2 are perpendicular, we just mean that the axis they are parallel to are different, i.e. the free coordinate of l 1 is different from the free coordinate of l 2 . For example, the line (I, Z) Z∈Λ is perpendicular to the line (Z, II) Z∈Λ .

-Finally, when we say that λ z.F is constant modulo = τ on a line l as before, we mean that the context function (λ z.F )ξ :

(Λ/ =τ ) n → Λ/ =τ is constant on l ⊆ (Λ/ =τ ) n . That is, there exist N ∈ Λ s.t. (λ z.F ) M 1 • • • M i-1 Z M i+1 • • • M n = τ N for all Z ∈ Λ.
With this terminology in place, the desired property is expressed exactly as in the statement of Theorem 3.3.40. It is important, however, to keep in mind that the geometric intuition mentioned above has a very short life and stops here: in λ-calculus there is no such notion as scalar product, and the best one can do is to reproduce the notion of perpendicularity but only in the trivial case of lines parallel to the axes.

As for Stability, we will use in the proof of PLP all the power of the technique of resource approximation. Indeed, resource terms can never behave too bad, the worst can happen being reducing to 0, and they must respect the strong constraints of linearity, strong normalization and confluence. For instance, let us consider how can a function b ∈ ! Λ r → nf r ((λz.t)b) ∈ P(Λ r ) be constant. The intuition is that there are few reasons:

1. either because t r 0 by itself 2. either because z's did not occur in t at all.

That is, we are left with only the trivial cases. These are the intuitions behind the Lemma 3.3.39 below, which is the crucial ingredient for the proof of PLP.

In the next section we will compare the situation just described with the much more complicated one present when asking the same question in Λ/ = B . Thanks to the commutation formula, the respective PLP are equivalent. The following proof could also be written in a coinductive fashion for Λ/ = B .

Lemma 3.3.39. Let C := (λ z.F )ξ 1 • • • ξ n be an n-context and let t ∈ Λ r . Suppose that: i. nf r (t) = 0 ii. t ∈ T (F )
iii. there are {M ij } 1≤i =j≤n ⊆ Λ s.t. C is constant, mod = τ , on the following perpendicular lines:

l 1 = {(Z, M 12 , . . . . . . , M 1n ) | Z ∈ Λ} l 2 = {(M 21 , Z, . . . . . . , M 2n ) | Z ∈ Λ} . . . l n = {(M n1 , . . . , M n(n-1) , Z) | Z ∈ Λ}.
(3.14)

Then: deg z 1 (t) = • • • = deg zn (t) = 0.
Proof. Induction on the size sz(t) of t ∈ Λ r . Case sz(t) = 1. Then t is a variable. Now if t = z i for some i, then the i-th line of (3.14) gives the contradiction:

N i = τ (λ z.z i )M i1 • • • M i(i-1) ZM i(i+1) • • • M in = τ Z for all Z ∈ Λ. Hence, it must be t = z i for all i, i.e. deg z 1 (t) = • • • = deg zn (t) = 0. Case sz(t) > 1. By (i) there is u ∈ nf r (t). Being u normal, it has shape u = λ x.y[ u 1 ] • • • [ u m ] for some m ≥ 0, some variable y, some normal bags [ u j ]. By (ii) t ∈ T (F ), so that by Corollary 3.3.26 there is Q ∈ Λ s.t. F Q and u ∈ T (Q). So Q must have shape: Q = λ x.yQ 1 • • • Q m for some Q j 's in Λ s.t. [ u j ] ∈ ! T (Q j )
for all j = 1, . . . , m. Now there are two possibilities: either y = z i for some i = 1, . . . , n, either y = z i for all i. Suppose y = z i . Then, for q := q 1 , . . . , q m fresh variables, we can chose Z := λ q.True ∈ Λ (or Z := True if m = 0) in the i-th line l i of (3.14), and since by (iii) λ z.F is constant (mod = τ ) on l i , we can compute its value as:

(λ z.F )M i1 • • • M i(i-1) (λ q.True) M i(i+1) • • • M in = τ Q{M i1 /z 1 , . . . , (λ q.True)/z i , . . . , M in /z n } = τ λ x.(λ q.True) Q i1 • • • Q im = τ λ x.True
where we set:

Q ij := Q j {M i1 /z 1 , . . . , (λ q.True)/z i , . . . , M in /z n }.
The first equality holds because F Q and = τ is finer than = λ , and the second equality holds because y = z i . In the same way, choosing Z := λ q.False ∈ Λ in l i we find that the value (mod = τ ) of λ z.F on l i is λ x.False. But this is impossible because True = τ False.

Therefore, it must be y = z i for all i. Note that wlog m ≥ 1 (indeed if m = 0, from the fact that y = z i for all i we already get deg z i (u) = 0 and, as u ∈ nf r (t) and in Λ r one cannot erase non-empty bags, we are done). Now fix i ∈ {1, . . . , n} and Z , Z ∈ Λ. Similarly as before, choosing Z := Z in l i and using what we found so far, putting

Q ij := Q j {M i1 /z 1 , . . . , Z /z i , . . . , M in /z n } since λ z.F is constant (mod = τ )
on l i , we can compute its value as:

(λ z.F )M i1 • • • M i(i-1) Z M i(i+1) • • • M in = τ Q{M i1 /z 1 , . . . , Z /z i , . . . , M in /z n } = τ λ x.yQ i1 • • • Q im
where the last equality holds since y is not one of the z i 's. Choosing Z instead of Z and putting

Q ij the same as Q ij but with Z instead of Z , one has that the value (mod = τ ) of λ z.F on l i is λ x.yQ i1 • • • Q im . Therefore we have λ x.yQ i1 • • • Q im = λ x.yQ i1 • • • Q im ,
and Lemma 3.3.12 entails:

Q i1 = τ Q i1 . . . Q im = τ Q im
But by construction it is:

Q ij = τ (λ z.Q j )M i1 • • • M i(i-1) Z M i(i+1) • • • M in Q ij = τ (λ z.Q j )M i1 • • • M i(i-1) Z M i(i+1) • • • M in .
So if we remember that Z , Z were generic in Λ, the previous equalities Q ij = Q ij precisely say that λ z.Q j is constant on the line l i . And since this holds for all i = 1, . . . , n, we have just found that λ z.Q j satisfies (iii). And since we have equalities Q ij = Q ij for all j = 1, . . . , m, we have that each λ z.Q 1 , . . . , λ z.Q k satisfies (iii). We can now comfortably apply the induction hypothesis on any s ∈ [ u j ]. In fact, as [ u j ] is normal, nf r (s) = 0, i.e. (i); as [ u j ] ∈ ! T (Q j ), we have s ∈ T (Q j ), i.e. (ii); and we just found that λ z.Q j satisfies (iii); finally, s is a strict subterm of u ∈ nf r (t), thus ms(s) < ms(u) ≤ ms(t). Therefore, the inductive hypothesis gives

deg z 1 (s) = • • • = deg zn (s) = 0. Since this is true for all s in all [ u j ], j = 1, . . . , m, we get deg z 1 (u) = • • • = deg zn (u) = 0. And now u ∈ nf r (t) entails deg z 1 (t) = • • • = deg zn (t) = 0.
Now we can safely prove that the term algebra Λ/ =τ enjoys the PLP.

Theorem 3.3.40 (Perpendicular lines property). Suppose that for some fixed {M ij } 1≤i =j≤n , {N i } 1≤i≤n ⊆ Λ, the system of equations:

         (λz 1 • • • z n .F ) Z M 12 • • • • • • M 1n = τ N 1 (λz 1 • • • z n .F ) M 21 Z • • • • • • M 2n = τ N 2 . . . . . . (λz 1 • • • z n .F ) M n1 • • • M n(n-1) Z = τ N n
holds for all Z ∈ Λ. Then:

(λz 1 • • • z n .F )Z 1 • • • Z n = τ N 1 for all Z 1 , . . . , Z n ∈ Λ.
Proof. Fix i ∈ {1, . . . , n} and Z ∈ Λו • •×Λ, and let us prove that NFT ((λ z.

F ) Z) = NFT (N i ). (⊆). If s ∈ NFT ((λ z.F ) Z) then s ∈ nf r (t ) for some t = (λ z.t)[ u 1 ] • • • [ u n ],
for some t ∈ T (F ) and bags [ u j ] ∈ ! T (Z j ). Since t r 0 then nf r (t) = 0. Moreover, λ z.F is constant (mod = τ ) on n perpendicular lines by hypothesis. Therefore t satisfies all the hypothesis of Lemma 3.3.39, which gives z 1 . . . , z n / ∈ t. But the only possibility for that situation to cohabit with t r 0 is that all [ u j ]'s trivialize to the empty bag:

[ u 1 ] = • • • = [ u n ] = 1. But then, t = (λ z.t)1 • • • 1 ∈ T ((λ z.F )M i1 • • • M i(i-1) Z i M i(i+1) • • • M in ) and thus s ∈ NFT ((λ z.F )M i1 • • • M i(i-1) Z i M i(i+1) • • • M in ) ⊆ NFT (N i
) by the i-th line of the system of equations of the hypothesis.

(⊇). If s ∈ NFT (N i ) ⊆ NFT ((λ z.F )M i1 • • • M i(i-1) Z i M i(i+1) • • • M in ) (the inclusion is by the i-th line of the system of equations of the hypothesis), then s ∈ nf r ((λ z.t)[ u 1 ] • • • [ u n ]) for some t ∈ T (F ), bags [ u j ] ∈ ! T (M ij ) for j = i and [ u i ] ∈ ! T (Z i ).
In the exact same way as before Lemma 3.3.39 gives z 1 . . . , z n / ∈ t, and since (λ

z.t)[ u 1 ] • • • [ u n ] r 0, the only possibility is that [ u 1 ] = • • • = [ u n ] = 1. So t = (λ z.t1 • • • 1) ∈ T ((λ z.F ) Z), from which s ∈ NFT ((λ z.F ) Z).
We immediately obtain the non implementability of the following parallel-or:

Corollary 3.3.41. There is no Por ∈ Λ s.t. for all M, N ∈ Λ, Por M N = τ True if M = τ Ω or N = τ Ω Por M N = τ Ω if M = τ N = τ Ω.

Interlude: Call-by-value λ-calculus

In this "interlude" we consider the call-by-value λ-calculus (cbv-λ-calculus, for short), introduced long time ago in [START_REF] Plotkin | Call-by-name, call-by-value and the lambda-calculus[END_REF]. In this section we will sometimes refer, as usual, to the ordinary λ-calculus as the "cbn" one.

We study the cbv framework via the tool of resource approximation. In fact, it turns out we can adapt the constructions already presented for the (cbn-)λ-calculus in order to prove the Stability Property in the cbv-λ-calculus. We refer [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF] for the basic definitions and the construction of the cbv-resource calculus. Their constructions follow the same schema of the ones we presented in Section 3.3, with some little technical modifications due to the fact that in the cbv setting one linearises terms in a slightly different way.

We first recall the main properties of cbv-resource-λ-calculus. Then, we show how to adapt the constructions of rigid terms associated with resource terms and prove the Stability property (Theorem 3.4.20) in the cbv framework. Definition 3.4.1 (Cbv-λ-calculus). The set Λ cbv of the cbv-λ-terms is the same as the set of (ordinary call-by-name) λ-terms. The set Val of values is the set containing the variables and abstractions. Contexts (with multiple holes, one hole and single-hole) are defined as in cbnλ-calculus. The reduction → v ⊆ Λ cbv × Λ cbv of cbv-λ-calculus is defined in Definition 1.5 of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF]. It is known that → v is confluent.

Resource cbV-λ-calculus in a nutshell Definition 3.4.2 (Resource cbv-λ-calculus). The set Λ r cbv of the resource-cbv-λ-terms is defined in Definition 3.1 of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF]. We report it here:

Λ r cbv := Val r ∪ Simp r
where the set Val r or resource values and the set Simp r of resource simple terms are defined by mutual induction by:

Val r ::= x | λx.s for s ∈ Simp r Simp r ::= s 1 s 2 | [v 1 , . . . , v n ] for s i ∈ Simp r and v i ∈ Val r .
The reduction → r of resource-cbv-calculus is defined in Definitions 3.3 and 3.4 of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF].

We do not report the definition of the reduction because we will not need its actual definition but only the properties it verifies. For instance, it is known that: Proposition 3.4.3. The reduction → r is confluent and strongly normalising. Definition 3.4.4 ((Qualitative) cbv-Taylor expansion). The (qualitative) cbv-Taylor expansion is the map T : Λ cbv → P(Simp r ) defined in Definition 3.9 of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF]. We report it here:

T (x) := { [x, (n) . . ., x] | n ∈ N} T (λx.M ) := { [λx.s 1 , . . . , λx.s n ] | n ∈ N and s i ∈ T (M )} T (M 1 M 2 ) := {s 1 s 2 | s i ∈ T (M i )}.
One defines as usual the set NFT (M ) ⊆ nf r (Simp r ). The inclusion NFT (M ) ⊆ NFT (N ) defines as usual a partial preorder M ≤ N , as well as the equivalence = τ , which is its symmetric closure.

Remark 3.4.5. One has nf v (M N ) = nf v (nf v (M )nf v (N )
) and nf v (λx.M ) = λx.nf v (M ), whenever the written normal forms do exist. Also:

1. NFT (λx.M ) := { [λx.s 1 , . . . , λx.s n ] | n ∈ N and s i ∈ NFT (M )} 2. NFT (M N ) := s i ∈NFT (M ) nf r (s 1 s 2 ).
We can now prove the Monotonicity property for cbv-λ-calculus. It is already proven in [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF] (where it is called "Context Lemma") but we provide below a more concise proof, very similar to the one already given in the case of λ-calculus.

Theorem 3.4.6 (Monotonicity property). Any context C : Λ cbv → Λ cbv is monotone w.r.t. ≤. Proof. Induction on C. If C = ξ then NFT (C M ) = NFT (M ) ⊆ NFT (N ) = NFT (C N ). If C = x then NFT (C M ) = {x} = NFT (C N ). If C = λx.C 1 then: NFT (C M ) = { [λx.s 1 , . . . , λx.s n ] | n ∈ N and s i ∈ NFT (C 1 M )} ⊆ { [λx.s 1 , . . . , λx.s n ] | n ∈ N and s i ∈ NFT (C 1 N )} = NFT (C N ). If C = C 1 C 2 then: NFT (C M ) = s i ∈NFT (C i M ) nf r (s 1 s 2 ) ⊆ s i ∈NFT (C i N ) nf r (s 1 s 2 ) = NFT (C N ).
As always, we can simulate → v via r .

Proposition 3.4.7 (Resource simulation property). If M → v N then:

1. for all s ∈ T (M ) there exist T ⊆ T (N ) s.t. s r T

2. for all s ∈ T (N ) s.t.17 s → 0 0, there exist s ∈ T (M ) s.t. s r s + T for some sum T.

Proof. See Lemma 4.4 of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF].

As in cbn-λ-calculus, we can define a cbv-λ-theory as a congruence which contains the reflexive symmetric and transitive closure = v of → v . Corollary 3.4.8 (Taylor normal form cbv-λ-theory). The equivalence = τ is a cbv-λ-theory.

Proof. It is a congruence thanks to the Monotonicity property, and the Simulation property allows to prove as usual that it contains = v (this last fact is already present as Corollary 4.5 of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF]).

We state now some useful properties for the proof of Theorem 3.4.20 .

Remark 3.4.9. If V ∈ Val then T (V ) ⊆ ! Val r . Remark 3.4.10. Let t ∈ Λ r cbv normal and belonging to T (M ). If M → v N then t ∈ T (N ). Proposition 3.4.11. If t ∈ NFT (M ), there exist N ∈ Λ cbv s.t. M v N and t ∈ T (N ).
Proof. See Lemma 4.9(2) of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF].

Call-by-value λ-calculus enjoys the same "non-interference" property we already encoutered for λ-calculus:

Proposition 3.4.12. For all t, s ∈ T (M ) s.t. t = s, you have nf r (t) ∩ nf r (s) = ∅.
Proof. See Lemma 4.9(3) of [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF].

Rigids

We adapt now the notion of rigid terms associated with a resource term (or, in general, with a multi-hole context) in the current cbv-setting.

::= ξ 1 | • • • | ξ k | x | λx.c s for c s ∈ Simp r k Simp r k ::= c s 1 c s 2 | [c v 1 , . . . , c v n ] for c s i ∈ Simp r k and c v j ∈ Val r k .
We extend the definition of Taylor expansion on each Cbv k by setting:

T (ξ i ) := { [ξ i , (n) . . ., ξ i ] | n ∈ N} ⊆ Simp r k .
Definition 3.4.14 (Rigid cbv-λ-terms).

1. A rigid-k-context is built as a resource-k-context but taking lists of rigid terms instead of bags of resource terms. In particular, a rigid term is a rigid context with no occurrences of the holes. As for cbv-terms, rigid contexts are divided into rigid-value-contexts and rigid-simple-contexts (and of course this distincion coincides with that of terms when a context has no holes).

Rigid(ξ i ) = {ξ i } Rigid(x) = {x} Rigid(λx.c 0 ) = {λx.c • 0 | c • 0 ∈ Rigid(c 0 )} Rigid(c 0 c 1 ) = {c • 0 c • 1 | c • i ∈ Rigid(c i )} Rigid([c 1 , . . . , c k ]) = { c • σ(1) . . . , c • σ(k) | σ permutation and c • i ∈ Rigid(c i )}.
The above definition makes sense since one immediately sees that if c is a resource-k-valuecontext (resp. resource-k-simple-context) then any of its rigids c • is a rigid-k-value-context (resp. rigid-k-simple-context). Definition 3.4.15. Let c • be a rigid of a cbv-resource-k-context c and, for i = 1, . . . , k, let v i := v i 1 , . . . , v i deg ξ i (c) be a list18 of resource values (that is, elements of Val r ). We define, by mutual induction on Val r k and Simp r k , a resource term

c • v 1 , . . . , v k ∈ Λ r cbv s.t. if c ∈ Val r k (resp. ∈ Simp r k ) then c • v 1 , . . . , v k ∈ Val r (resp. ∈ Simp r
). The definition goes as follows:

1. If c = ξ i then c • = ξ i ; we set c • , . . . , , v i 1 , , . . . , := v i 1 2. If c = x then c • = x; we set c • , . . . , := x 3. If c = λx.c 0 then c • = λx.c • 0 where c • 0 is a rigid of c 0 ; we set c • v 1 , . . . , v k = λx.c • 0 v 1 , . . . , v k 4. If c = c 1 c 2 , then c • = c • 1 c • 2 where c • i is a rigid of c i .
So each list v i factorizes as a concatenation w i1 w i2 of lists where w ij has exactly deg ξ i (c j ) elements; we set:

c • v 1 , . . . , v k := c • 1 w 11 , . . . , w k1 c • 2 w 12 , . . . , w k2 . 5. If c = [c 1 , . . . , c n ], then c • = c • σ(1) , . . . , c • σ(n)
where σ is a permutation and c • i is a rigid of c i . So each list v i factorizes as a concatenation w i1 • • • w in of lists where w ij has exactly deg ξ i (c σ (j)) elements; we set:

c • v 1 , . . . , v k := [c • σ(1)
w 11 , . . . , w k1 , . . . , c • σ(n) w 1n , . . . , w kn ].

Remark 3.4.16. One has that if v r V then:

c • • • • , • • • , v, • • • , • • • ∈ Λ r cbv r w∈V c • • • • , • • • , w, • • • , • • • .
The following lemma will be used in the proof of Theorem 3.4.20. As always, if v is a list we denote with [ v] the multiset associated with v (same elements but disordered).

Lemma 3.4.17. Let C be a k-context and c 1 , c 2 ∈ T (C) (hence, in particular, c 1 , c 2 are resource-k-contexts). Let c • 1 and c • 2 rigids respectivly of c 1 and c 2 . For i = 1 . . . , k, let v i = v i 1 , . . . , v i deg ξ i (c 1 ) and u i = u i 1 , . . . , u i deg ξ i (c 2 ) be lists of resource values. If c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k then c 1 = c 2 and [ v i ] = [ u i ] for all i.
Proof. Simple induction on C. (n) . . ., x], c 2 = [x, (m) . . ., x] and

Case C = ξ i . Then c 1 = [ξ i , (n) . . ., ξ i ], c 2 = [ξ i , (m) . . ., ξ i ], v i = v i1 , . . . , v in , u i = u i1 , . . . , u im and v j = = u j for j = i. So [v i1 , . . . , v in ] = c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k = [u i1 , . . . , u im ], thus n = m, i.e. c 1 = c 2 . Case C = x. Then c 1 = [x,
v i = = u i . So [x, (n) . . ., x] = c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k = [x, (m) . . ., x], thus n = m, i.e. c 1 = c 2 . Case C = λx.C 0 . Then, for i = 1, 2, one has c i = [λx.c i1 , . . . , λx.c in i ] with c ij ∈ T (C 0 ) for all i, j. So c • i = [λx.c • iσ i (1) , . . . , λx.c • iσ i (n i )
] where σ i is a permutation on n i elements. By Definition 3.4.15 we have:

c • i v 1 , . . . , v k = [ λx.c • i σ i (1) w i11 , . . . , w ik1 , . . . , λx.c • i σ i (n i ) w i1n i , . . . , w ikn i ]
where σ i is some permutation on n i elements and the concatenation

w ij1 • • • w ijn i gives v j if i = 1 and gives u j if i = 2. From c • 1 v 1 , . . . , v k = c • 2 u 1 , .
. . , u k we get then n 1 = n 2 =: n and that there exist a permutation ρ on n elements which identifies each term of the bag c • 1 v 1 , . . . , v k with the respective one of the bag c • 2 u 1 , . . . , u k . That is, for all j = 1, . . . , n, one has:

c • 1j w 1 1 σ 1 -1 (j) , . . . , w 1 k σ 1 -1 (j) = c • 2ρ(j) w 2 1 σ 2 -1 (ρ(j)) , . . . , w 2 k σ 2 -1 (ρ(j)) .
The inductive hypothesis gives c • 1j = c • 2ρ(j) for all j, and, reeumerating the indeces, w 1 i j = w 2 i σ 2 -1 (ρ( σ 1 (j))) for all i = 1, . . . , k. Now, the former equality gives c

• 1 = c • 2 , while the latter gives [ v j ] = [ w 1j1 • • • w 1jn ] = [ w 2j1 • • • w 2jn ] = [ u j ].
Case C = C C . Analogous and easier than the above case. Lemma 3.4.18. Let C be a k-context and V 1 , . . . , V k ∈ Val. Then:

T (C V 1 , . . . , V k ) = {c • v 1 , . . . , v k | c ∈ T (C), c • rigid of c, [ v i ] ∈ T (V i )}.
Proof. Induction on C. The base case C = x and the step cases of the induction are straightforward. We only show the remaining base case, that is the one for C = ξ i . We have: (n) . . ., ξ i , (i-1) . . . , , v i 1 , . . . , v i n , , (k-i) . . . ,

{c • v 1 , . . . , v k | c ∈ T (C), c • rigid of c, [v i 1 , . . . , v i deg ξ i (c) ] ∈ T (V i )} = { ξ i ,
| n ∈ N, [v i 1 , . . . , v i n ] ∈ T (V i )} = { [v i 1 , . . . , v i n ] | [v i 1 , . . . , v i n ] ∈ T (V i )} = T (V i ) = T (C V 1 , . . . , V k ).

Stability

Definition 3.4.19. Given a non-empty subset X ⊆ Λ cbv , define its T -infimum X ⊆ Λ r as:

X := M ∈X NFT (M ).
We say that X is bounded iff there exists an L ∈ Λ such that M ≤ L for all M ∈ X .

We write M = τ X instead of NFT (M ) = X . In the cbv setting, the arguments passed to the functions are values. Since in the Stability theorem we are intuitively looking at contexts as functions, it makes sense to restrict their application on values only. Remark that this restriction was already present in the previous sections (see Definition 3.4.14, Definition 3.4.15, Lemma 3.4.17 and Lemma 3.4.18), and it is this restriction that makes the previous contructions work.

The proof of the following result is a modification of the proof in the cbn framework. The fact that one can adapt it in a cbv framework can be seen as an extra strenght of the orginal proof.

Theorem 3.4.20 (Stability property). Let C be an n-context and fix non-empty X 1 , . . . , X n ⊆ Val bouded by a value. For all V 1 , . . . , V n ∈ Val such that for i = 1, . . . , n one has:

V i = X i we have: C V 1 , . . . , V n = N 1 ∈X 1 ... Nn∈Xn C N 1 , . . . , N n .
Proof. Since every X i is T -bounded, for i = 1, . . . , n there exists L i ∈ Val s.t.

N ∈X i NFT (N ) ⊆ NFT (L i ). Fix now V 1 , . . . , V n ∈ Val s.t. NFT (V i ) = N ∈X i NFT (N ).
We have to show that:

NFT (C V 1 , . . . , V n ) = N 1 ∈X 1 • • • Nn∈Xn NFT (C N 1 , . . . , N n ).
(⊆). Clearly, for all i = 1, . . . , n and N i ∈ X i , we have NFT (

V i ) ⊆ NFT (N i ), therefore we conclude NFT (C V 1 , . . . , V n ) ⊆ NFT (C N 1 , . . . , N n ) by Monotonicity. (⊇). Let t ∈ N ∈ X NFT (C N 1 , . . . , N n ) (where N := (N 1 , . . . , N n ) and X := (X 1 , . . . , X n )).
For every N ∈ X , by Lemma 3.4.18 there exist a cbv-n-resource-context c N ∈ T (C) and, for every

i = 1, . . . , n, a list v i N = v i1 N , . . . , v id i N (where d i := deg ξ i (c N )) with [ v i N ] ∈ T (N i ) and such that t ∈ nf (c • N v 1 N , . . . , v n N ), for c •
c • N nf (v 11 N ), . . . , nf (v 1d 1 N ), . . . , nf (v n1 N ), . . . , nf (v ndn N ) r nf (c • N v 1 N , . . . , v n N ) t.
So for all i = 1, . . . , n and j = 1, . . . , d i , there exist

w ij N ∈ nf (v ij N ) such that: nf (c • N w 1 N , . . . , w n N ) t (3.15)
and being N i ∈ X i which is bounded by L i , we have [ ). This holds for all N ∈ X , i.e.: ] 's share a commond reduct, call it L i , which as the notation shows is now independent from [ w i N ] (but still depends on i). Of course L i is also a reduct of L i , and it is still a value. Also, since each [

w i N ] ∈ nf ([ v i N ]) ⊆ NFT (N i ) ⊆ NFT (L i ). From the inclusion [ w i N ] ∈ NFT (L i ) we obtain, thanks to Remark 3.4.9 because L i is a value, a simple term [ u i N ] ∈ T (L i ) such that: [ w i N ] ∈ nf ([ u i N ]) ( 3
t ∈ N ∈ X nf (c N u 1 N , . . . , u n N ). ( 3
w i N ] belongs to T (L [ w i N ] ) and is normal, by Remark 3.4.10 it is {[ w i N ] | N ∈ X } ⊆ T (L i ).
Thus we can apply Lemma 3.4.18 and find that, for every N ∈ X , we have:

c • w 1 N , . . . , w n N ∈ T (C L 1 , . . . , L n ). ( 3
t ∈ nf (c • w 1 , . . . , w n ). (3.19)
Now, for all i, remembering what we found already, we have [

w i ] = [ w i N ] ∈ NFT (N ) for all N ∈ X i . That is, [ w i ] ∈ N ∈X i NFT (N ) = NFT (V i ) (3.20)
where we finally used the hypothesis. From (3.20) and Lemma 3.4.18 one can now easily conclude that t ∈ nf (c

• w 1 , . . . , w n ) ⊆ NFT (C V 1 , . . . , V n ).
As usual, one obtains as a Corollary the non-existence of the following parallel-or . We use the usual encoding of pairs: (M, N ) := λz.zM N . Remark that thus a pair is a value.

Corollary 3.4.21 (No parallel-or). There is no

Por ∈ Λ cbv s.t. for all M, N ∈ Λ cbv , Por (M, N ) = τ True if M = τ Ω or N = τ Ω Por (M, N ) = τ Ω if M = τ N = τ Ω.
Proof. Otherwise, applying Theorem 3.4.20 for C := Por ξ, X = {(True, Ω), (Ω, True)} which is bounded by the value (True, True), and the value V := (Ω, Ω) = (True, Ω) ∩ (True, Ω), we would have the contradiction:

True = C (True, Ω) ∩ C (Ω, True) = C (Ω, Ω) = τ Ω.

Taylor subsumes Böhm

In the present section we show how one can apply the resource approximation in order to obtain important results of λ-calculus. Those results constitute the core of Chapter 14 in [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF] and are based on what we have called Böhm's approximation. Not only our techniques can serve as "substitute" of the traditional techniques, but they are also "subsume" them in some way, as better explained in the final comments (see Section 3.6). The present section is organized as follows:

-First, we consider the relation between Böhm's approximation (recall Section 2.2.2) and the resource approximation. As it is well known, the relation between them culminates in the fact that the relations = τ and = B coincide (Corollary 3.5.13). This is obtained via some results on some particular classes of resource terms, which we call linearized and affined (see 3.5.8), and via the commutation formula of [START_REF] Ehrhard | Böhm trees, Krivine's machine and the Taylor expansion of lambda-terms[END_REF]. In that paper, it is proved in the general quantitative case; we will only consider it in the qualitative case, since this is all we need. We give an "easier" proof of this formula, in the sense that the results of Section 3.3 are basically all one needs in order to prove it.

-Then we transfer the PLP from the world of Taylor normal form to the world of Böhm trees (Theorem 3.5.14). This is immediate thanks to the commutation formula. Interestingly, our proof automatically allows to positively answer to the question: does the PLP hold in the term algebra of closed terms? This was an open question. We also present some equivalent ways of stating the PLP.

-We can also transfer the Stability property in the same way (Theorem 3.5.28). This is not immediate due to the presence of intersections; we thus prove the needed properties about the intersection of Taylor normal forms and of approximants of a term (Lemma 3.5.27).

-We then turn to the Genericity property (Theorem 3.5.29), for which we provide a proof based on the property of linearity of resource terms. Compare it to the original proof, which follows a topological argument.

-Finally, we consider the Continuity Lemma (Lemma 3.5.33). One remarks again how our proof is different from the original one, and contains the same crucial argument involving the linearity of the resource terms involved.

The commutation formula Definition 3.5.1. One extends the Taylor expansion to Λ ⊥ (and thus, in particular, to Böhm approximants) setting:

T (⊥) := ∅.

One extends it also on subsets X ⊆ App simply by setting T (X ) := M ∈X T (M ). In particular, the Taylor expansion T (A(M )) ⊆ Λ r of the Böhm approximants of a term is defined. Proof. Straightforward induction on M . Remark 3.5.4. If P ∈ App then all t ∈ T (P ) are r-normal. This is immediate to see, since the elements of the Taylor expansion of a term must follow the structure of the syntax tree of it. Lemma 3.5.5. Let M ∈ Λ and t ∈ T (M ). If t is r-normal, then there exists P ∈ App such that t ∈ T (P ) and P M . In particular, one has therefore T (M ) ⊆ T (BT(M )).

Proof. Being r-normal, t = λ x.y[ u 1 ] • • • [ u k ] ∈ T (M ) for u i j r-normal. So M = λ x.yM 1 • • • M k with [ u i ] ∈ ! T (M i ).
We go now by induction on the r-normal structure19 of t.

If k = 0, then P := λ x.y does the job.

If k ≥ 1, then fix i = {1, . . . , k} and apply the inductive hypothesis on each u i j ∈ [ u i ], obtaining a P i j ∈ App s.t. P i j M i and u i j ∈ T (P i j ). Let P i := j P i j . Being it a sup, it must be P i M i and P i j P i for every i, j. From the former inequality we have λ x.yP 1 • • • P k M , and from the latter (thanks to Lemma 3.5.3) we have u i j ∈ T (P i ). Whence, the thesis for

P := λ x.yP 1 • • • P k .
Everything is already in place to prove the commutation formula: Theorem 3.5.6 (Qualitative commutation formula). Let M ∈ Λ. Then: As previously mentioned, let us introduce a class of resource terms that are interesting as they contain just enough information to easily reconstruct a term in Λ and Λ ⊥ , respectively. Definition 3.5.8 (Linearized and affined resource terms). A resource term t is linearised (resp. affined) if every bag in t has cardinality exactly 1 (resp. at most 1). Let's call Lin, Aff the set of linearised and affined resource terms. Lemma 3.5.9. There is an injection (•) : Aff -→ Λ ⊥ defined as:

NFT (M ) = T (BT(M )). Proof. (⊆). If t ∈ NFT (M ) then t ∈ nf (t )
x = x λx.t = λx.t s[t] = s t s1 = s ⊥.
There is an injection (•) : Λ ⊥ -{⊥} -→ Aff defined as20 :

x = x (λx.M ) = λx.M (M N ) = M [ N ] (M ⊥) = M 1.
The maps above are bijections between:

1. Λ and Lin, and between nf λ (Λ) and nf r (Lin).

2. App -{⊥} and the set nf r (Aff) of r-normal affined resource terms.

Proof. Simple inductions.

The following is an easily checked remark.

Remark 3.5.10. Let M ∈ Λ. Then:

(1) T (M ) ∩ Lin = {M }

(2) For all P ∈ App s.t. ⊥ = P M , one has P ∈ T (M ).

The following lemma contains the main properties of interest of the linearized and affined terms.

Lemma 3.5.11. Let M ∈ Λ and P, Q ∈ App with P = ⊥. Then:

1. P ∈ T (Q) entails P Q. 2. P ∈ NFT (M ) iff P ∈ A(M ). 3. M normalisable iff NFT (M ) ∩ Lin = ∅ iff NFT (M ) ∩ Lin = {nf (M )}.
Proof. [START_REF]An assumption: if PA does not derive ⊥, then arithmetic is coherent[END_REF]. Simple induction on P .

(2). (⇒). If P ∈ NFT (M ) then P ∈ nf r (t), for some t ∈ T (M ). But by Lemma 3.5.5, t ∈ T (Q) for some Q ∈ A(M ), and being thus Q normal, we have T (Q) = NFT (Q) P . We conclude by Point (1) and the fact that A(M ) is downward closed w.r.t. . (⇐). If P ∈ A(M ), then M M for some M such that P M , thus P ∈ T (M ) by Remark 3.5.10. By Proposition 3.3.17(2), there is t ∈ T (M ) such that t r P + T for some sum T. But being it r-normal, one has P ∈ nf (t), whence P ∈ NFT (M ).

(3). If M has a normal form nf λ (M ), then nf λ (M ) ∈ A(M ) -{⊥}, so by ( 2) nf (M ) ∈ NF(T (M )) and by definition it is linearized.

If t ∈ NFT (M ) ∩ Lin then t ∈ nf λ (Λ) ⊆ App -{⊥}. Moreover t = (t), so that by Point (2) there is a reduction M M s.t. t M . Since t is even ⊥-free the only possibility is that t = M , which, being normal, is therefore the normal form nf λ (M ) of M . This proves the first equivalence, as well as the second one.

Remark 3.5.12. From point 2 of the previous Lemma one gets a ways of computing the Böhm approximants from the resource ones:

A(M ) = NFT (M ) ∩ Aff ∪ {⊥}.
The commutation formula and Lemma 3.5.11(2) immediately allow to prove that in fact is nothing more than ≤.

Corollary 3.5.13 (Equivalence between Taylor normal form and Böhm preorders). Let M, N ∈ Λ. Then:

M N iff M ≤ N
Note that this immediately implies that:

M = B N iff M = τ N.
Proof. (⇒). NFT (M ) = T (BT(M )) ⊆ T (BT(N )) = NFT (N ), where we have used the Commutation formula and Remark 3.5.2.

(⇐). If P ∈ A(M ), then by Lemma 3.5.11(2) P ∈ NFT (M ) ⊆ NFT (N ), so P ∈ A(N ) by the same Lemma.

Being = τ contextual (this is the Monotonicity Theorem) -and thus a λ-theory -also B is:

If BT(M ) = BT(N ) then BT(C M ) = BT(C N ).
Of course we know this facts from the 60's, but this is another way to prove it, by passing only via resource approximation.

Perpendicular Lines Property We already encountered the Perpendicular Lines Property (PLP) as Theorem 3.3.40. It is there formulated in Λ/ =τ instead of Λ/ = B as it is in the literature, but because the λ-theories of Böhm and Taylor normal form coincide, we automatically obtain it for the former:

Theorem 3.5.14 (Perpendicular lines property for Böhm trees).

If (λz 1 . . . z n .F )ξ 1 . . . ξ n : Λ/ = B × • • • × Λ/ = B -→ Λ/ = B is constant on n perpendicular lines, then it is constant on all Λ/ = B × • • • × Λ/ = B .
Actually, the number n of abstracted variables and the number of arguments need not be equal. In fact, one can state PLP in a (a priori ) more general form considering directly a term F instead of the abstraction λ z.F , while keeping the same n, and these two variants of PLP are equivalent: using the one for λz 1 . . . z n .F we can prove the one for F (and the vice-versa is obvious), as the following proposition shows. Proposition 3.5.15. Suppose there are {M ij } 1≤i =j≤n , {N i } 1≤i≤n ⊆ Λ s.t. the system of equations:

         F Z M 12 . . . . . . M 1n = B N 1 F M 21 Z . . . . . . M 2n = B N 2 . . . . . . F M n1 . . . M n(n-1) Z = B N n . (3.21)
holds for all Z ∈ Λ. Then for all Z 1 , . . . , Z n ∈ Λ one has:

F Z 1 . . . Z n = B N 1 .
Proof. Wlog F is solvable, otherwise, the result trivially holds: if F = τ Ω then by Monotonicity we have: In fact if m < n then we have two cases: either y = z i for some i ∈ {1, . . . , m} in which case computing the i-th equation of (3.21) we find the following contradiction (for fresh variables q and the appropriate P i ):

F Z = τ Ω Z = τ ∅
N i = B F M i1 . . . M i(i-1) (λq 1 . . . q k+n-m .Z) M i(i+1) • • • M in = B (λz 1 . . . z m . z i P 1 • • • P k )M i1 . . . M i(i-1) (λq 1 . . . q k+n-m .Z) M i(i+1) • • • M in = B (λq 1 . . . q k+n-m .Z) P 1 • • • P k M i(m+1) • • • M in = B Z
for all Z; either y = z i for all i ∈ {1, . . . , m} and then computing the n-th equation of (3.21) we find the following contradiction (for fresh variables q and the appropriate P i ):

N n = B F M n1 • • • M n(n-1) Z = B (λz 1 . . . z m . z i P 1 • • • P k ) M n1 • • • M n(n-1) Z = B y P 1 • • • P k M n(m+1) • • • M n(n-1) Z
for all Z. But now since m ≥ n, for all Z i ∈ Λ we have:

F Z 1 • • • Z n = B (λz 1 . . . z m .F )Z 1 • • • Z n = B λz n+1 . . . z m . F {Z 1 /z 1 , . . . , Z n /z n } = B λz n+1 . . . z m . (λz 1 . . . z n .F )Z 1 • • • Z n .
So instantiating the Z i 's by the i perpendicular lines of (3.21) we obtain that each N i must be s.t. N i = B λz n+1 . . . z m .N i for some N i satisfying:

(λz 1 . . . z n .F )M i1 • • • M i(i-1) Z M i(i+1) • • • M in = B N i .
That is, the term λz 1 . . . z n .F is constant (mod = B ) on n perpendicular lines, and thus thanks to the PLP in the already proved version (Theorem 3.5.14

) it is constant (mod = B ) on all Λ × • • • × Λ (n times). Hence, λz n+1 . . . z m . (λz 1 . . . z n .F )Z 1 • • • Z n also is constant (mod = B ) in Z 1 .
. . Z n , and the same for F Z 1 . . . Z n . This is exactly what we wanted to prove.

The PLP can also be equivalently stated for n-contexts instead of terms. We mean that the statement of PLP using a term F (or, equivalently, a term λz 1 • • • z n .F ) is equivalent to the following statement:

Let C be an n-context and suppose there are (⇐). We suppose that for all F ∈ Λ, if F is constant (mod T ) on n perpendicular lines then

{M ij } 1≤i =j≤n , {N i } 1≤i≤n ⊆ Λ s.t. the system of equations:          C Z, M 12 , . . . . . . , M 1n = B N 1 C M 21 ,
F is constant (mod T ) on all Λ × • • • × Λ (n times).
We fix a generic n-context C which is constant (mod T ) on the following n perpendicular lines:

l i : (M i1 , . . . , M i(i-1) , Z, M i(i+1) , . . . , M in ) Z∈Λ
for i = 1, . . . , n. We want to prove that C is constant (mod T ) everywhere. To that end 21 , for each i = 1, . . . , k, let v i be a list (the order of the elements will not matter) of all the variables bound22 in C that one encounters on all the paths from the root of C to the occurrences of ξ i , that is, the bound variables of C in whose scope there is an occurrence of ξ i . To say it differently, v i are the only variables that, when replacing ξ i for a term, C can capture. Take now the term:

F := λz 1 . . . z n .C z 1 v 1 , . . . , z n v n ∈ Λ
where z 1 , . . . , z n are distinct fresh variables. First of all, let us show that F is constant on the following n perpendicular lines:

l i : (λ v 1 .M i1 , . . . , λ v i-1 .M i(i-1) , Z, λ v i+1 .M i(i+1) , . . . , λ v n .M in ) Z∈Λ for i = 1, . . . , n.
In fact, remembering that in general (λ v.P ) v = λ P , we have:

F (λ v 1 .M i1 ) • • • (λ v i-1 .M i(i-1) ) Z (λ v i+1 .M i(i+1) ) • • • (λ v n .M in ) = λ C (λ v 1 .M i1 ) v 1 , . . . , (λ v i-1 .M i(i-1) ) v i-1 , Z v i , (λ v i+1 .M i(i+1) ) v i+1 , . . . , (λ v n .M in ) v n = λ C M i1 , . . . , M i(i-1) , Z v i , M i(i+1) , . . . , M in
which is constant (mod T ) in Z thanks to the hypothesis on C. So thanks to the hypothesis on PLP for terms, F is constant (mod T ) on all Λ × • • • × Λ (n times). Now, reasoning analogously as before, we have:

C Z 1 , . . . , Z n = λ C (λ v 1 .Z 1 ) v 1 , . . . , (λ v n .Z n ) v n = λ F (λ v 1 .Z 1 ) . . . (λ v n .Z n )
and so being F constant, C is is constant (mod T ) as well.

It is important to understand the great advantage of using Taylor expansion in order to prove the PLP: in fact, if we considered it with respect to = B , a context C ξ can display a constant behaviour for several reasons:

1. C ξ does not contain the hole ξ at all (the trivial case); 2. ξ is "erased" during its reduction as in C ξ = (λxy.y)ξ; 3. ξ is "hidden" behind an unsolvable as in C ξ = Ω ξ; 4. ξ is pushed into infinity as in C ξ = Pξ, where P := Y(λyzx.x(yz)) is s.t. Pz = λ λx.x(Pz).

As we already remarked in Section 3.3.2, in Λ r we are only left with the trivial case. But in the case of = B , all the cases are possible. We recognise here the "coinductive" character of Böhm trees. Speaking of coinduction, our proof could also be written in a "coinductive fashion", thus allowing to prove the PLP, using coinduction, while remaining in Λ/ = B .

We talked about the PLP in the term algebra Λ/ =τ = Λ/ = B . One can ask what happens for other λ-theories, starting with = λ . The fact that Λ/ = λ satisfies PLP was only suggested in [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF], and proved later on by Endrullis and de Vrijer [START_REF] Endrullis | Reduction under substitution[END_REF] that applied van Daalen's Reduction under Substitution property [vD80], which is a strengthening of the famous "Barendregt Lemma". As we are now considering = λ , a constant context C ξ can only display two possible behaviours, namely (1) or (2) in the list above. Moreover, the hypotheses of PLP must hold when taking Z = x and Z = y for x = y. This is a strong assumption because x and y are completely defined different values thus enforcing a "maximal" the distinction among the terms. These are the main ingredients used in [START_REF] Endrullis | Reduction under substitution[END_REF] to derive that Λ/ = λ satisfies PLP. In fact, they are crucial: as shown in [START_REF] Statman | Applications of Plotkin-terms: Partitions and morphisms for closed terms[END_REF], the property fails in the closed term model Λ o / = λ (in which we cannot, thus, take Z = x and Z = y as mentioned above). The last result relies on the existence of so-called Plotkin terms

[Plo74], namely λ-distinct terms M, N ∈ Λ o satisfying M L = λ N L for all L ∈ Λ o .
So one sees that in the closed term algebra things may be different. It is thus interesting to ask whether for our equivalent λ-theories = τ and = B , PLP holds or not when restricting to the closed term algebra. To the best of our knowledge, that is an open question. Actually, we can immediate answer it: Theorem 3.5.17. PLP holds in the closed term algebra

Λ o / = B = Λ o / =τ .
Proof. One can check that the proof of Theorem 3.3.40 work also in the case of closed terms.

Let us resume in Figure 3.5 what we now know about the validity of PLP, the top right case being new, and the top left case being now proved solely via Taylor expansion and resource approximation.

PLL Λ Λ o = B = = τ √ √ = λ √ × Figure 3.

3: The new PLP validity table

As already remarked, one has that the following "parallel or" is undefinable, and since being solvable is a recursively enumerable property, it means that in λ-calculus one cannot implement parallel computations.

Corollary 3.5.18 (No parallel-or).

There is no por ∈ Λ which semi-decides the solvability of any two terms, that is, such that for all M, N ∈ Λ one has:

por M N = λ True if M or N is solvable por M N unsolvable otherwise.
Another consequence of PLP is that there is no λ-term which decides whether its input is = B to a Church numeral or not. That is, if we denote -only in this Corollary (and its proof) -by n ∈ Λ the Church numeral of n ∈ N, we have: Corollary 3.5.19. There is no isNum? ∈ Λ s.t. for all M ∈ Λ one has:

isNum? M = B True, if M = B n for some n ∈ N, isNum? M = B False, otherwise.
Proof. Suppose there is such isNum? ∈ Λ. Now take f : N k -→ N a computable function which is constantly equal to a certain n 0 ∈ N on all the k axes while f ( m 0 ) = n 0 for some m 0 ∈ N k . It is clear that such functions do exist. By Church thesis, there is F ∈ Λ representing f . Now let:

F := λz 1 . . . z k . isNum? z 1 (isNum? z 2 (. . . isNum? z n (F z 1 • • • z k ) n 0 ) n 0 ) n 0 ∈ Λ.
That is:

F M 1 • • • M k = B f (n 1 , . . . , n k ), if M 1 = B n 1 , . . . , M k = B n k for some n ∈ N k , n 0 , otherwise.
Thus, F is constantly equal (mod = B ) to n 0 on the k perpendicular lines (Z, 0, . . . , 0) Z∈Λ , (0, Z, 0, . . . , 0) Z∈Λ , . . . , (0, . . . , 0, Z) Z∈Λ . So by PLP it is constant (mod = B ) everywhere, but this is a contradiction with the fact that F m 0 = B f ( m 0 ) = B n 0 (two different Church numerals are always = B -distinct, as one immediately sees).

Stability The theory of stability was developed by Berry, while studying sequential computations and full abstraction for PCF [START_REF] Berry | Stable models of typed lambda-calculi[END_REF]. We exhibit a new proof of the Stability Theorem as formulated in [Bar84, Thm. 14.4.10]. The original proof exploits a causality relation capturing the fact that suitable subtrees of BT(C M 1 , . . . , M n ) "are caused by" some argument M i .

We first, we will need some results: Recall that P 1 , P 2 ∈ App are said to be comparable iff P 1 Q P 2 for some Q ∈ App. This is the same to say that they have the same structure: either at least one of them is ⊥, either

P 1 = λ x.yP 1 1 • • • P k 1 , P 2 = λ x.yP 1 2 • • • P k 2
, and P j 1 , P j 2 are comparable. Finitely many comparable Böhm approximants always admit a sup in App, and this operation can be lifted to countably infinite many pairwise comparable ones by yielding a sup in B. We show below that the same can be done for the inf, but remaining inside App. Definition 3.5.20. For comparable P 1 , P 2 ∈ App, we inductively define a term P 1 P 2 ∈ Λ ⊥ as follows:

P 1 P 2 = λ x.
T ( N ∈X P N ) ⊆ T ( N ∈X A(N )).
Proof. Fix N ∈ X . Since

N ∈X P N P N ∈ A(N ), one has N ∈X P N ∈ A(N ) because A(M ) is downward closed. We have proved that N ∈X P N ∈ N ∈X
A(N ). And this entails 24 that 23 Recall Remark 3.3.6. 24 We are using the trivial fact that if Q ∈ X for a term Q and a set X of terms, then T (X ) =

T ( N ∈X P N ) ⊆ T ( N ∈X A(N )).
P ∈X T (P ) ⊇ T (Q).
Proof. First remark that if t ∈ P ∈X T (P ) then for all P ∈ X it must be T (P ) = ∅, i.e. P = ⊥, i.e. P = λ x P .y P Q 1 P • • • Q k P P for some variables x P , y P and some Q j P ∈ App. But since t is in the Taylor expansion of all of them, it must be that all x P , all y P and all k P coincide, i.e. for all P ∈ X , P =: λ x.yQ 1 P • • • Q k P . Also, let us remark that since all the P 's are in App, such a t must be r-normal. So let us show by induction on the r-normal structure of t, that if t ∈ P ∈X T (P ) then t ∈ T ( P ∈X P ). If t = λ x.y then all P must coincide with λ x.y and the result is trivial. If

t = λ x.y[ u 1 ] • • • [ u k ] (with k ≥ 1)
then all P must follow the same shape, and thus in particular we have:

P ∈X P = λ x.y( P ∈X Q 1 P ) • • • ( P ∈X Q k P )
. Now if we show that u i j ∈ T (

P ∈X Q i P ), then we are done. But u i j ∈ P ∈X
T (Q i P ) by hypothesis, and thus the inductive hypothesis precisely gives

u i j ∈ T ( P ∈X Q i P ).
Lemma 3.5.24. Let Y a collection of subsets of Λ. One has:

T ( N ∈Y N ) ⊆ N ∈Y T (N ).
Proof. Take t ∈ T (

N ∈Y N ) = F ∈ N ∈Y N T (F ), that is, t ∈ T (F ) for some F s.t. F ∈ N for all N ∈ Y. But then for all fixed N ∈ Y one has t ∈ F ∈N T (F ) = T (N ). So t ∈ N ∈Y T (N ).
The previous inclusion can be strict. For example, take

Y := {N 1 , N 2 } with N 1 := {xy} and N 2 := {xz}. Then T (N 1 ∩ N 2 ) = T (∅) = ∅ but x1 ∈ T (xy) ∩ T (xz) = T (N 1 ) ∩ T (N 1 ).
However, if the elements of Y are sets of Böhm approximants of terms, then the equality holds, as the next lemma shows. This particular case is precisely what we will need. Lemma 3.5.25. Let X ⊆ Λ. One has:

T ( N ∈X A(N )) = N ∈X T (A(N )). Proof. (⊆). It is Lemma 3.5.24 with Y := {A(N ) | N ∈ X }. (⊇). If t ∈ N ∈X T (A(N )) = N ∈X P ∈A(N )
T (P ) then for all N ∈ X there exist a

P N ∈ A(N ) s.t. t ∈ T (P N ). So t ∈ N ∈X
T (P N ) = ∅, and by Remark 3.5.21 this implies that the P N 's (for N ∈ X ) are pairwise compatible. Hence, Lemma 3.5.22 and Lemma 3.5.23 give: t ∈ T (

N ∈X P N ) ⊆ T ( N ∈X A(N )).
We can now finally set up the notations and prove the Stability property for Böhm trees, in the same way we already did in the framework of Taylor expansion. Definition 3.5.26. Given a non-empty subset X ⊆ Λ, define its B-infimum X ⊆ App as:

X := M ∈X A(M ).
We say that X is bounded iff there exists an L ∈ Λ such that M L for all M ∈ X .

By commutation formula we instantly get that

A(M ) ⊆ A(L) iff NFT (M ) ⊆ NFT (L), so X is bounded iff X is T -bounded.
We write M = X instead of A(M ) = X . As in the case of Taylor normal form, the Stability property gives sufficient conditions for when a context is "stable" under intersection of Böhm trees.

In order to translate Theorem 3.3.37 to the framework of Böhm trees, we need a last lemma saying that " X = X ", in the sense of the statement. Lemma 3.5.27. Let M ∈ Λ and X ⊆ Λ. Then:

M = X iff M = X .

Proof. (⇒). Applying T (•) on both sides of the hypothesis A(M ) =

N ∈X

A(N ) one gets:

NFT (M ) = T (A(M )) = T ( N ∈X A(N )) = N ∈X T (A(N )) = N ∈X NFT (N )
where we have used the Commutation Formula as well as Lemma 3.5.25.

(⇐). (⊆). Let P ∈ A(M ). Then:

NFT (P ) = T (P ) ⊆ Q∈A(M ) T (Q) = T (A(M )) = NFT (M ) = N ∈ X NFT (N )
where we have used the Commutation Formula and the hypothesis (and NFT (P ) = T (P ) since P is λ⊥-normal). So, for every N ∈ X , one has P N , and this means that P ∈ A(P ) ⊆ N ∈ X A(N ) (where P ∈ A(P ) holds again because P is λ⊥-normal).

(⊇). Let P ∈ N ∈ X

A(N ). Then, for all fixed N ∈ X , via a similar argument as before one has:

NFT (P ) = T (P ) ⊆ Q∈A(N ) T (Q) = T (A(N )) = NFT (N ).
Thus, NFT (P ) ⊆ N ∈ X NFT (N ) = NFT (M ), and this means that P ∈ A(P ) ⊆ A(M ).

Theorem 3.5.28 (Stability for Böhm trees). Let C be an n-context, M 1 , . . . , M n ∈ Λ and fix non-empty bounded X 1 , . . . , X n ⊆ Λ. If for all i ∈ {1, . . . , n} one has:

M i = X i then one has: C M 1 , . . . , M n = N 1 ∈X 1 ... Nn∈Xn C N 1 , . . . , N n .
Proof. Thanks to the fact that being bounded means being T -bounded, and thanks to the previous Lemma 3.5.27, the hypotheses and the conclusions are exactly those of the Stability for = τ (Theorem 3.3.37), so there is nothing more to prove.

Genericity property of unsolvables

Let us start by remarking that Corollary 3.3.14 can be equivalently formulated saying that if C : Λ -→ Λ is a context, then:

Im(C Unsol ) ⊆ SOL entails Im(C) ⊆ SOL.
Here we mean of course that "Im" is the image of a function, that " " is the restriction of a function on a subset of its domain, and that "Unsol" is the set of unsolvable λ-terms.

The Genericity property reinforces the conclusion of the previous statement, under a stronger hypothesis. Its informal meaning is that if a λ-term M reducing to a completely defined output (a normal form) contains a subterm U which is unsolvable, then U has no influence on the computation of this value, in the sense that it may be replaced by any other λ-term and the computation would yield the exact same result. This is an important result from a conceptual point of view, because it motivates the equivalence between "meaningless" and unsolvable λterms. Moreover it gives the idea that unsolvable terms should be identified all each other: this identification forms indeed the λ-theory H, which plays a crucial role in the study of λ-theories.

In the following statement we call "Normalisables" the set of normalisable λ-terms.

Theorem 3.5.29 (Genericity Property). Let C : Λ -→ Λ be a context. If:

Im(C Unsol ) ∩ Normalisables = ∅ then: C is constant mod = λ on all Λ.
Proof. Take U unsolvable with C U normalisable, and let us show that C U = λ C M for all M ∈ Λ. By Lemma 3.5.11(3), there is

t ∈ NFT (C U ) ∩ Lin s.t. t = nf λ (C U ). As t ∈ NFT (C U ), by Lemma 3.3.33(1), there exist c = c ξ ∈ T (C) and s 1 , . . . , s k ∈ T (U ) s.t. t ∈ nf r (c • s 1 , . . . , s k ), where c • is a rigid of c. Since NFT (U ) = ∅ (U is unsolvable)
we have nf r (s i ) = 0 and, by confluence, any reduction from c • s 1 , . . . , s k to its normal form nf r (c • s 1 , . . . , s k ) = t + T = 0 factorizes as: c • s 1 , . . . , s k r c • 0, . . . , 0 r t + T. Now, if ξ actually occurs in c then c • 0, . . . , 0 = 0, but since the reduction 0 r t + T is impossible, it must be that ξ does not occur in c. But this means that c • s 1 , . . . , s k ∈ T (C M ) for all M ∈ Λ, hence t ∈ NFT (C M ). Since t is linearised, again by Lemma 3.5.11(3) we get that C M is normalisable with nf λ (C M ) = t. Recalling the second line of this proof, we have:

nf λ (C U ) = t = nf λ (C M ).
An interesting fact about this proof is that it does not use Monotonicity (the reader can check that all the properties we used in the proof, and their proofs, do not use this result). However, it is also possible to prove it using Monotonicity, and it actually makes it easier, contracting the second to the penultimate line of the above proof to a trivial invocation of it:

Proof with Monotonicity. By Lemma 3.5.11(3), there is a linearized t ∈ NFT (C U ) such that t = nf λ (C U ). As NFT (U ) = ∅, Monotonicity gives t ∈ NFT (C M ), so that by Lemma 3.5.11(3) C M is normalisable and since t is linearised always Lemma 3.5.11(3) gives nf λ (C M ) = t.

Moreover, using Monotonicity of Böhm trees, one immediately remarks that the hypothesis "Im(C Unsol ) ∩ normalisables = ∅" is equivalent to "Im(C Unsol ) ⊆ normalisables". In fact if there is an U unsolvable with C U normalisable, then by the contextuality of = B , any C U for U unsolvable has the same Böhm tree as C U , and hence it is normalisable.

We can give an even shorter proof by passing through Böhm trees (and always using monotonicity):

Proof with Böhm trees' Monotonicity. Since BT(U ) = ⊥ then U M so monotonicity yields C U C M , and since BT(

C U ) = BT(nf λ (C U )) is ⊥-free it must be C M = λ C U .
However this last proof is just a "wrap" for the previous one, in the sense that behind Monotonicity of Böhm trees there is all the theory of resource approximantion and Taylor expansion (and in particular Lemma 3.5.11), which already contains the crucial result used in the previous proof of Lemma 3.5.11; so one might as well directly use them.

Continuity We conclude this section by demonstrating Scott's syntactic continuity lemma, as formulated in [Bar84, Prop. 14. 3.19]. The meaning of this statement is that for any context C : Λ/ = B -→ Λ/ = B , any "finite portion" of its output can always be already generated by an appropriate "finite portion" of its input. In this setting, a "finite portion" of the input (resp. output)

M (resp. C M ) of C corresponds of course to a Böhm approximant Q ∈ A(M ) (resp. P ∈ A(C M )).
In order to apply our technique based on resource approximation, we are going to associate a resource term t ∈ T (BT(M )) with an approximant P t ∈ A(M ) by mapping the empty bag 1 to ⊥ and taking the supremum w.r.t. . Definition 3.5.30. We define a partial map P (•) : nf r (Λ r ) -→ App -{⊥}, by induction on the r-normal structure 25 of nf r (Λ r ), as follows:

P λ x.y := λ x.y P λ x.y [ u 1 ]•••[ u k ] := λ x.y ( j P u 1 j ) • • • ( j P u k j ) if the sups do exist P t is undefined otherwise.
where we took

P ∈∅ P := ⊥.
It is clear that the definition makes sense.

Lemma 3.5.31. Let M ∈ Λ solvable. For all t ∈ NFT (M ), one has that P t is defined and P t ∈ A(M ).

Proof. By induction on the r-normal structure of t, remembering that NFT (M ) = NFT (nf h (M )) as well as A(M ) = A(nf h (M )). If t = λ x.y then nf h (M ) = λ x.y and the result is immediate. If

t = λ x.y[ u 1 ] • • • [ u k ] (with k ≥ 1) then nf h (M ) = λ x.yM 1 • • • M k , with u i j ∈ NFT (M i ).
Thus M i is solvable (Corollary 3.5.7) and by inductive hypothesis P u i j is defined and P u i j ∈ A(M i ). Since A(M i ) is directed, there exist the sup j P u i j ∈ A(M i ), and thus P t = λ x.y

( j P u 1 j ) • • • ( j P u k j ) is defined. But it is immediately seen that A(λ x.yM 1 , • • • , M k ) = λ x.yA(M 1 ) • • • A(M k ), and so P t ∈ A(nf h (M )) = A(M ).
If t ∈ NFT (M ), by the commutation formula this means that there is some P ∈ A(M ) s.t. t ∈ T (P ). The next Lemma says that P t is precisely one of such approximants. Lemma 3.5.32. Let M ∈ Λ solvable. For all t ∈ NFT (M ) one has t ∈ T (P t ).

Proof. By induction on the r-normal structure of t. If t = λ x.y the result is immediate. If

t = λ x.y[ u 1 ] • • • [ u k ] (with k ≥ 1) then nf h (M ) = λ x.yM 1 • • • M k , with u i j ∈ NFT (M i )
. Now the inductive hypothesis on each u i j says that it belongs to T (P u i j

). But by Lemma 3.5.3, we have

u i j ∈ T (P u i j ) ⊆ T ( j P u i j
), so we conclude t ∈ T (λ x.y (

s 1 ∈b 1 P s 1 ) • • • ( s k ∈b k P s k )).
25 Recall Remark 3.3.6.

Example 1.

1. For all affined t ∈ T (BT(M )) we have P t = t.

P (λx.x[x,

x]) = ∆ and P (λx.x1) = λx.x⊥.

3. P (λf.f [f 1,f [f 1]]) = λf.f (f (f ⊥)).
Everything is now in place to prove Scott's continuity lemma. The scrupulous reader will notice that we apply to terms in Λ ⊥ some definitions and results originally stated for Λ, e.g., A(•), B , Lemma 3.5.11. This should not be troubling, because the constant ⊥ is observationally indistinguishable from the λ-term Ω, i.e., T (⊥) = NFT (Ω) = ∅. Lemma 3.5.33 (Continuity lemma). Let M ∈ Λ and C be a context. For all P ∈ A(C M ), there exists Q ∈ A(M ) such that P C Q .

Proof. Let P ∈ A(C M ). Since P is λ⊥-normal, we have A(P ) = {P ∈ App | P P }, whence it is a finite set A(P ) = {P 1 , . . . , P k }∪{⊥} where k ≥ 0 and P i = ⊥. Since it is clear that A(P ) ⊆ A(C M ), by Lemma 3.5.11 [START_REF]First goal: reduce the coherence of all mathematics to the one of arithmetic[END_REF], for all i = 1, . . . , k we have P i ∈ NFT (C M ) so that there exist t i ∈ T (C M ) s.t. P i ∈ nf (t i ). By Lemma 3.3.33(1), there are c i = c ξ ∈ T (C) and where c • i is a rigid of c i . Hence, any reduction t i r nf r (t i ) factorizes as:

s i 1 , . . . , s i n i ∈ T (M ) s.t. t i = c • i s i ,
t i = c • i s i r c • i nf r (s i 1 ), . . . , nf r (s i n i ) r nf r (t i ) P i
where nf r (s i j ) ⊆ NF(T (M )) for all i = 1, . . . , k and 1 ≤ j ≤ n i . Now, if nf r (s i j ) = 0 for all i, j, then the only possibility is that ξ does not occur in c i , and thus t i = c • i ∈ T (C Ω ), so that P i ∈ NFT (C Ω ) and by Lemma 3.5.11, P i ∈ A(C Ω ) = A(C ⊥ ), which is the thesis. So Wlog let us assume that nf r (s i j ) = 0 for all i, j. As there are at most kn i such s i j 's, and each nf (s i j ) is a finite sum, the following set:

Q := k i=1 n i j=1 nf (s i j ) ⊆ NFT (M )
is finite. Since by Lemma 3.5.31 P u ∈ A(M ) for all u ∈ Q, and since being A(M ) directed it contains the sup of finitely many of its elements, we can take:

Q := u∈Q P u ∈ A(M ). Now, recalling that P i ∈ nf r (t i ) = nf r (c • i nf r (s i 1 ), . . . , nf r (s i n i ) ), we get P i ∈ nf r (c • i u i 1 , . . . , u i n i ) for some u i j ∈ Q (1 ≤ j ≤ n i ).
But since by Lemmas 3.5.32 and 3.5.3 every u i j ∈ T (P u i j ) ⊆ T (Q), using Lemma 3.3.33 we derive that P i ∈ NFT (C Q ). By Lemma 3.5.11(2), we finally conclude that P i ∈ A(C Q ). If we remember that the P i 's are exactly the elements of A(M ) -{⊥}, we just proved that A(P ) ⊆ A(C Q ), i.e. P C Q .

The reason why the above result is called "continuity Lemma" is because it is the main ingredients, together with Monotonicity, of the following theorem, of which we omit the proof since one finds it in [Bar84, Corollary 14.

Conclusive comments

We have seen that approximating the behaviour of a λ-term by calculating its Taylor expansion allows to abandon proof-techniques based on coinduction in favour of the inductive principle. Already in [START_REF] Wadsworth | The relation between computational and denotational properties for Scott's D ∞ -models of the lambda-calculus[END_REF], Wadsworth defined a labelled λ-calculus to calculate an approximant P ∈ A(M ) in an effective way, and this is the historical way the results of Section 3.5 were found. Let us quickly mention the idea and compare the two approaches.

The idea is to annotate every subterm of M with a certain amount of energy, represented by a natural number n, which is then decremented along the reduction:

(λx.M ) n+1 N → β (M {N n /x}) n (λx.M ) 0 N → β ⊥ (M {⊥/x}) 0 (M n ) m → M min{m,n}
The labelled λ-calculus Λ so obtained clearly enjoys strongly normalization, and can be proved to be confluent as well. One retrieves an approximant P ∈ A(M ) starting from a fully annotated version M of M by first computing nf β β ⊥ ⊥ (M ) and then removing the labels. By exploiting the properties above, it is possible to give proofs of Church-Rosser and standardization for λcalculus. Moreover, in [Bar84, Ch. 14] the labelled calculus constitutes the base ground on which are built the results that we, instead, proved in Section 3.5 via resource approximation. From a semantic perspective, the labelled λ-calculus can be interpreted in well-stratified reflexive objects D living in cpo-enriched categories [START_REF] Manzonetto | A general class of models of H *[END_REF]. It was first used by Hyland [START_REF] Hyland | A Syntactic Characterization of the Equality in Some Models for the Lambda Calculus[END_REF] to prove that Scott's D ∞ and Plotkin's P ω induce a λ-theory including B. This means that also labelling is an interesting technique.

Comparing the labelled λ-calculus and the resource calculus we can find a common principle: in both cases the idea of harness infinite reductions by bounding the availability of subprograms. However, this idea is applied in different (somewhat dual) ways: in Λ the bound is on the contraction of redexes, so it is the λ-abstraction that exhibits a restricted behaviour, while in Λ r the restriction is on the amount of resources a program has available. Another difference is that the labels of Λ give an upper bound on the energy that can be consumed by a λ-term M , while a resource term t ∈ T (M ) that does not reduce to 0 must contain the exact number of resources needed by M in order to compute its outcome. Moreover, while both Λ and Λ r are confluent and strongly normalising, only the latter enjoys linearity that prevents a resource term from erasing or duplicating its subterms during its execution -a property that is crucial in our proofs. A last important difference is that, while the "old" techniques are essentially based on non-trivial analysis of reductions in the labelled λ-calculus, as well as on the notion of coinduction, the techniques based on Taylor expansion are completely inductive 26 .

In conclusion, we believe that the labelled λ-calculus is a valid instrument, but the resource calculus is arguably more natural because it arises from Girard's translation (•) • of λ-calculus into Linear Logic proof-nets sending (M N ) • to M • (N • ) ! . In fact, the resource calculus stands on the solid ground provided by Differential Linear Logic [START_REF] Ehrhard | Differential interaction nets[END_REF], and this is the reason why it has been generalized so easily to non-deterministic, probabilistic, algebraic call-by-name and call-by-value calculi. Also from the semantic perspective, Λ r can be naturally interpreted in every (linear) reflexive object living a (Cartesian closed) differential category [START_REF] Blute | Cartesian differential categories[END_REF], and the Taylor expansion can be used to obtain combinatorial proofs of (denotational) Approximation Theorems [START_REF] Manzonetto | Relational graph models, taylor expansion and extensionality[END_REF].

It is interesting to remark that, while following [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF] the results are often dependent one on another, our proofs and our formulation of the matter allows to discover that actually they are all independent: in Figure 3.4, the continuous lines indicated the "old" theory (as one finds it in [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF]), and the dashed ones indicate the situation that we find using the resource approximation/Taylor expansion as we described in the present chapter. Let us end this chapter by what we believe to be a very interesting question for the future research: we now dispose of two theories of the approximation, and we know (thanks to the commutation formula) that in a certain sense they give equivalent notions of approximation. Some questions immediately arise: What does it mean, in general, to approximate a programming language (or at least the λ-calculus)? That is, can we axiomatically define the general notion of approximation? Would Böhm's and Taylor's be the only two possible instances of such a definition, or are there other ways of approximating programs?

Can we find new results about λ-calculus via approximation techniques?

We have no answer to any of these questions at this day, but we believe an investigation of those would be of a primary interest. To the best of our knowledge, the only current tentative of attacking this questions has been recently proposed by Mazza in the unpublished note [START_REF] Mazza | An axiomatic notion of approximation for programming languages and machines[END_REF]. His suggestion is to consider an approximation theory27 as a certain span of functors enjoying some properties which are, basically, the translation in a categorical setting of what we called the Simulation property (Proposition 3.3.17). Of course both the known approximation theories falls in Mazza's "definition", but the framework is still too premature to be any close to satisfaction. However, we believe that it is a promising starting point.

Chapter 4

The resource approximation for λµ-calculus Models of the simply typed λ-calculus, of the untyped λ-calculus and of the simply typed λµ-calculus are well understood, but what about models of the untyped λµ-calculus? As far as we know, this question has been almost ignored.

Olivier Laurent -[Lau04]

Plan of the Chapter

Despite the quote above explicitly mentions the models of λµ-calculus, we will not talk about any denotational semantics for it; the reason of the presence of that quote is because the task which we attack in the present chapter is (a small step towards) the development of a mathematical theory of λµ-calculus; if we can say that the long time studied λ-calculus admits a true mathematical theory, rich and with its own questions, the one of λµ-calculus remains much less known. Now, when we think of a mathematical theory of a language, we basically mean a theory of its denotational semantics (and "λ-theories"), but also a theory of its approximation. Laurent's quote mentions an "ignorance" with respect to the models; we will attack the question of the theory of approximation. From a certain point of view, it is quite natural that the study of λµ-calculus is less developed than the one of λ-calculus: the former is a "canonical" object of study, since it is at the bases of all the other functional languages, therefore all the other ones are less canonical, λµ-calculus included. But from a Curry-Howard perspective, one could say that λµ-calculus does present a sort of canonicity: it is "the simpler" extension of λ-calculus able to include classical logic in the correspondence. Such a statement is of course arguable, because there are many other ways of extending the correspondence to classical logic, such as Krivine's classical realisability [START_REF] Krivine | Realizability in classical logic[END_REF] (which however does not relate to the same kind of Curry-Howard correspondence as the other calculi, as we will briefly mention later), and the reader can find an interesting discussion of other extensions in [START_REF] Herbelin | Séquents qu'on calcule: de l'interprétation du calcul des séquents comme calcul de lambda-termes et comme calcul de stratégies gagnantes[END_REF].

The Taylor expansion has been adapted to many languages ([Cho19, Vau19, LL19b, CT20, KMP20], for example), but to the best of our knowledge not to λµ-calculus. There is a notable exception which has to be mentioned: in [START_REF] Vaux | The differential λµ-calculus[END_REF], Vaux defines a full differential λµ-calculus following the steps of [START_REF] Ehrhard | The differential lambda-calculus[END_REF]. However, he stops right before defining, for instance, the Taylor expansion. Not because there are difficulties in its definition (one could still follow [START_REF] Ehrhard | The differential lambda-calculus[END_REF]), but because it seems that the author did not have in mind to directly define an approximation theory for the calculus, ready to be used. His version takes coefficients into account; our version is actually qualitative (no coefficients), and we show that this (a priori ) simpler case is enough for our goals. Our goals are to follow [START_REF] Barbarossa | Taylor subsumes Scott, Berry, Kahn and Plotkin[END_REF] in order to adapt the qualitative approximation theory of λ-calculus to λµ-calculus, and apply it. The fact that we see the approximation theory as a tool is also a difference with the other mentioned works, which usually aim more at showing that one can in fact define it, and then concentrate on the relations with normalisation.

We start the chapter with a quick introduction on λµ-calculus and its relevance (Section 4.2). Before moving to the resource approximation of it, we provide a useful "syntactic interlude" (Section 4.3). The reader can jump to the beginning of that section for an explanation of it content and its meaning.

In Section 4.4 we finally attack the question of the resource approximation: first of all, we define the resource λµ-calculus (in particular we define its resource-reduction 4.4.6) and prove that it is strongly normalizing and confluent (Corollaries 4.4.15 and 4.4.47). In order to achieve the strong normalisation, we define a multiset measure which is strictly decreasing along reductions, and which is ordered via a well-founded order. For the confluence, we basically show that the diagrams of all the critical pairs can be closed. This is not trivial and will take us many pages.

In Section 4.4.1 we define the qualitative Taylor expansion and prove its main properties. In Section 4.4.2 we prove that the = τ on (the equality = τ of Taylor normal forms) forms a sensible "λµ-theory" (Corollary 4.4.61), just as in λ-calculus.

In Section 4.4.3 we apply these approximation tools in order to prove the Stability property (Theorem 4.4.62) and the Perpendicular lines property (PLP for short, Theorem 4.4.66). We obtain these results by adapting the new proofs we presented in Chapter 3 for λ-calculus, and we consider the fact that this adaptation is possible as an added value of our proofs. As a consequence, we obtain the sequentiality of λµ-calculus (Corollaries 4.4.63 and 4.4.67).

We end the chapter with some comments and some possible future directions of research. In particular, we briefly discuss the role of Saurin's Λµ-calculus, a variant of Parigot's one, which we are going to quickly mention in the following Section 4.2.

Introduction to the λµ-calculus

As we already discussed, the celebrated Curry-Howard correspondence states that a class of programs, written in a suitable programming language, and intuitionistic logic proofs, written in an suitable formal system, are the same mathematical objects. The typical suitable programming language is λ-calculus, and the typical suitable formal system is intuitionistic natural deduction NJ; under this correspondence, simply typed λ-calculus is identified with NJ. A natural question is what happens for classical logic proofs, and whether it is possible to find such a correspondence at all. As we already discussed, in the 90's several ways for generalising such a correspondence to this framework appeared, starting from Griffin's suggestion (in [START_REF] Griffin | A formulae-as-types notion of control[END_REF]) to type control operators with Peirce law. In this chapter we are going to consider the λµ-calculus, introduced by Parigot in [START_REF] Parigot | Lambda-mu-calculus: An algorithmic interpretation of classical natural deduction[END_REF], which has the advantage of allowing the correspondence to take the exact same form as in the intuitionistic case: just like λ-calculus is the Turing-complete programming language in which intuitionistic logic expresses its computational content, λµ-calculus is the one expressing the computational content of classical logic. The previous definition means that one proceeds as in λ-calculus: first, define pre-λµ-terms as the words in the above grammar, then define as expected the sets of free variables and free names in a pre-λµ-term, and finally define a λµ-term as pre-λµ-term up to renaming of bound variables and bound names 1 .

Despite not being λµ-terms, words of shape α |M | are traditionally called named terms, and M is said to be named under α. Historically named terms are written as [α]M (as in [START_REF] Parigot | Lambda-mu-calculus: An algorithmic interpretation of classical natural deduction[END_REF]). But this notation is not possible for us, since the use of square brackets is already imperatively taken by the finite multisets, which we will encounter constantly in the following. Another notation, used in [START_REF] Saurin | Böhm theorem and Böhm trees for the Λµ-calculus[END_REF] for Λµ-calculus, is to write M α just like in an application. However, in our framework, we find this notation not completely clear.

C ::= x | ξ 1 | • • • | ξ k | λx.C | CC | µα. β |C|
1-contexts are simply called contexts. A context C = C{ξ} with exactly one occurrence of the hole is called single-hole, and it can be given the following inductive characterisation:

C ::= ξ | λx.C | CM | M C | µα. β |C| (where M is a λµ-term).
In order to understand where the syntax of the calculus comes from, and what is its relevance, let us quickly consider its programming and logical interpretation.

From the point of view of programming, a λµ-term is meant to represent a process which yields more than one result; more precisely, it is able to produce side-effects by redirecting auxiliary outputs on "channels" different from the standard output, or taking its input from auxiliary channels different from the standard one. One can think of Unix-like Shells' ">" or, better, ">>", and of "<". Under this analogy, a named term α |M | corresponds to Shell's "M >> channel α". The coexistence of multiple outputs is then given by the fact that, in a λµ-term M , the standard output is the term M itself, while an auxiliary output N is a term appearing inside a naming β |N |, for the channel name β free in M . The, in a certain sense, dual constructor of the naming α |•|, is the µ-abstraction constructor, and a term of shape C µα. . . . would intuitively correspond to Shell's "C < channel α". The way one achieves this behaviour is through the operational semantics which we will describe in a moment.

But first, let us see what is the logical counterpart of this calculus. As we mentioned in the introduction, the crucial difference between intuitionistic and classical formalisms for proofs, is in the fact that in classical derivations one has multiple formulas at the right of " ", that is multiple conclusions. This is exactly what the multiple outputs of a λµ-term are about. In addition, as we mentioned in the introduction, in order to have a well-behaving cut-elimination, one has to distinguish between an active output and passive ones, which will correspond to standard and auxiliary outputs in λµ-terms. Let us give the typing rules, in a more convenient variant of Parigot's original Classical Natural Deduction, which can be found, e.g., in [START_REF] Selinger | From continuation passing style to Krivine's abstract machine[END_REF].

Γ M : A | α : A, ∆, β : B Γ µβ. α |M | : B | α : A, ∆ if α = β Γ M : A | α : A, ∆ Γ µα. α |M | : A | ∆
The interesting rules are the last two: if we forget about the terms and about the distinction active/passive formulas, they are both operating a contraction on the right of the " " (together with some exchanges for the rule at the left). Weakenings (on both the sides of " ") are handled through the axiom rule. That is, the underlying logical system is the classical system NK. If now we forget about terms and the distinction active/passive formula, we obtain Parigot's Classical Natural Deduction [START_REF] Parigot | Lambda-mu-calculus: An algorithmic interpretation of classical natural deduction[END_REF] (actually, a different version of it, because of the slightly different syntax we are considering). Furthermore, and most importantly, cut-elimination corresponds to the operational semantics of λµ-calculus which we describe below: Definition 4.2.4. The reduction relation → of λµ-calculus3 is the contextual closure of the union → base of:

(λx.M )N → λ M {N/x} (µα. β |M |)N → µ µα.( β |M |) α N µγ. α |µβ. η |M || → ρ µγ. ( η |M |{α/β})
where M {N/x} is the usual capture-free substitution of N for all free occurrences of x in M , and (M ) α N is the substitution

(M ) α N := M { α |(•)N |/ α|•| }.
The notation (M ) α N comes from the fact that every subterm (indicated with • ) of M which is named under α, receives a copy of N . This operation is defined as a substitution: every named subterm α |•| of M gets substituted with the named term α |(•)N |. Nevertheless, intuitively speaking, it is an application: one applies all subterms of M which are named under α to N . Hence, the notation "(M ) α N " which is reminiscent of the application of M to N , and the term (M ) α N is called the named application of M to N through α. This notation is due to Vaux [START_REF] Vaux | The differential λµ-calculus[END_REF].

Remark 4.2.5. The named application (M ) α N can be inductively characterized as:

(x) α N := x (λx.M ) α N := λx.(M ) α N (M P ) α N := ((M ) α N )((P ) α N ) (µβ. α |M |) α N := µβ. α |((M ) α N )N | (µβ. γ |M |) α N := µβ. γ |(M ) α N | (if γ = α).
The reduction λ is the usual reduction of λ-calculus 4 . Remark that the renaming {α/β} in the ρ-reduction cannot be, in general, "taken out" of the parenthesis, because if α = γ then α is bound. The reduction ρ is just a renaming of names; one could be tempted to consider terms up to that renaming, but this is not possible because µ-reduction is not well defined on the ρ-equivalence classes. For example (for γ = η = α):

(µα. α |µγ. η |x||)y → ρ (µα. η |x|)y ↓ µ ↓ µ µα. α |(µγ. η |x|)y| = ρ µα. η |x|.
This is an important critical pair because it also shows that the ρ-reduction and the µ-reduction do not commute (Definition 2.1.2): in the bottom-left reduct, the ρ-redex is "blocked" by an application; it is only via the µ-reduction µα. α |(µγ. η |x|)y| → µ µα. α |µγ. η |x|| that we can "unblock it" and finally close the diagram by performing the ρ-reduction: µα. α |µγ. η |x|| → ρ µα. η |x|. We will find the analogue of this example when studying the confluence of the associated resource calculus.

Witnessing the fact that λµ-calculus is a well-behaved version of classical logic, one has that the typed-calculus is strongly normalising and confluent. Actually, as it happens for λ-calculus, the untyped version is also confluent (but of course not strongly normalising). As we already said, from a programming viewpoint the characteristic feature of λµ-calculus is to allow the encoding of control operators, and one says for that reason that it is a functional "impure" functional language. The encoding of callcc in λµ-calculus can be found by adding terms to the usual derivation of Peirce's law: Let's verify that it has the expected backtracking behaviour described in the introduction, by applying it to a non-empty stack "M, N 1 , . . . , N k ". One has:

y : (A → B) → A y : (A → B) → A | α : A y : (A → B) → A, x : A x : A | α : A, δ : B y : (A → B) → A, x : A µδ.
callcc M N 1 • • • N k → λ (µα. α |M (λx.µδ. α |x|)|) N 1 . . . N k → µ (µα. α |M (λx.µδ. α |x N 1 |) N 1 |) N 2 . . . N k → µ • • • → µ µα. α |M (λx.µδ. α |x N |) N |.
The term that we just found represents a process sending the output of M (λx.µδ. α |x N |) N on the channel α, but immediately after it is sending the content of channel α on the standard output. That is, it is just sending the output of M (λx.µδ. α |x N |) N on the standard output. Now let us see what this latter term does: it represents the term M which is launched in front of the stack N , but in addition to that, it is also provided with the additional term λx.µδ. α |x N | to potentially make use of. This last term allows to take a term and start its execution in front of the stack N , that is, in the exact same "environment" of the initial call of M . Since the term in last line of the reductions above is a µ-abstraction on α (so the content of the channel α is the standard output), the two bound occurrences of α in that term can be read as follows: the process µα. α |M (λx.µδ. α |x N |) N | can keep the execution of M in front of the original stack N as long as it wants (and this will thus modify the execution stack), by ignoring the additional tool "λx.µδ. α |x N |"; but, at any moment, it can use this tool in order to pop a new term M , restore the original execution stack N , and launch M in front of the restored original stack, forgetting about the modified current one. That is, it can backtrack and modify its behaviour after having, potentially, computed some more information, mimicking a sort of "try/catch" piece of code. This is in fact the same backtracking behaviour of the real callcc command in the Scheme programming language, as well as Java's handling of exceptions. One could consider Felleisen's C operator in a similar way.

The two new typing rules of simply typed λµ-calculus handle the passage of a formula from active to passive and vice-versa, but this aspect is not very clear with the particular rules that we have written. In fact one could perform both those rules via a two step procedure, first producing a named term and then µ-abstracting it. This is done via the following rules:

Γ M : A | α : A, ∆ Γ α |M | : ⊥ | α : A, ∆ Γ β |M | : ⊥ | α : A, ∆ Γ µα. β |M | : A | ∆
where we added the constant ⊥ to the formulas. One observes that the left rule is the introduction rule for ⊥, and performs a contraction, while the right one is the elimination rule for ⊥. As we already mentioned, these rules show clearly how a formula passes from active to passive and vice-versa. In fact, one could embed simply-typed λµ-calculus inside Linear Logic. Laurent showed how to do this by making use of his Polarized proof-nets5 [START_REF] Laurent | Polarized proof-nets and λµ-calculus[END_REF], in which the duality active/passive formula -or standard/auxiliary output -becomes that of positive/negative formulas, an important notion in Linear Logic, particularly in the study of focalization. In the framework of polarized proof-nets the above two new rules become constructions of proof-nets, and show even better how one handles the duality positive/negative.

Let us make a last comment. As we just saw, the more natural rules are the ones which operate on a named term, constructing it or µ-abstracting it. The same could be said for the very syntax or λµ-calculus: it is natural to say that the construction of a term M = µα. β |N | from N is not done in a single step, but via two different constructors: first, one creates β |N | from N , and then M from β |N |. It is natural to consider thus the following syntax:

M ::= x | λx.M | M M | µα.M | β |M |.
Remark that now a named term is really a term and not just a syntactic word. One can ask whether the two calculi are "the same or not". The question has been negatively answered by Saurin in [START_REF] Saurin | Böhm theorem and Böhm trees for the Λµ-calculus[END_REF]: while the first syntax (Parigot λµ-calculus) does not satisfy Böhm's separation theorem -something which was shown by David and Py in [START_REF] David | Lambda-mu-calculus and Böhm's theorem[END_REF] -this new syntax does satisfy it. The new extended syntax in now known as Saurin's Λµ-calculus (with a big "λ"). We do not consider it in this thesis, but we will come back on it and make some comments at the end of this chapter.

Interlude: A syntactic shortcut

In reproducing the same arguments of the previous chapter for the case of λµ-calculus, we will often encounter the same kind of proofs. Moreover, many of the properties do not really depend on the fact that one has a λ-abstraction or a µ-abstraction, but only on the fact that the resource calculus linearises application while treating the other constructors as linear and that the Taylor expansion is defined accordingly. Thus, in this interlude, we will forget that a constructor is called λ-abstraction and takes a variable, and the other is called µ-abstraction and takes two names, and we just consider them instances of a same kind of constructor, called g(v, •), taking any possible kind of "variable" -usual variables in the case of λ and pairs of names for µ. We show what is the skeleton of the constructions we carried on in the last chapter, a skeleton which is, thus, valid as soon as one can instantiate this constructor and considers a resource calculus together with a Taylor expansion defined accordingly. Of course the previous case of λ-calculus falls in this case, and in the next section we will see that λµ-calculus does too. The value of this approach is to clearly distinguish what is proper to each particular language, and what can be carried on independently because relying only on the way one treats linearisation.

But a disclaimer must be made: the content of this section must be seen as a "syntactic shortcut" in order to handle, at the same time for λ and for λµ-calculus, the proofs that do not depend on their particular syntax, and to show what is the shared path which we are following in the cases of λ/λµ-calculus. But it is not a real generalization; in fact, as it will be clear from the first definitions, we are really simply mimicking the syntax and the situation of λ/λµ-calculus. In particular, the "language" we consider here, might not be general enough to include other interesting programming languages other than the two we are interested in. Also, and maybe most importantly, we already know how to linearise λ-calculus and λµ-calculus (the latter will be discussed at the beginning of Section 4.4). So we already know how to define, for this "general language", the crucial notions of resource approximants and Taylor expansion. The way one gets to know this would be by relating the language to linear logic, so a real generalization would first of all need to consider that.

We fix disjoint non-empty countably infinite sets Var 1 , . . . , Var h . Fix h 1 ≤ h and h 2 ∈ N. We consider a programming language L with syntax:

M ::= v | g j (v k j , M 0 ) | @(M 1 , M 2 ) where v ∈ Var 1 ∪ • • • ∪ Var h 1 , j = 1, .
. . , h 2 and v k j ∈ Var k j for some fixed k 1 , . . . , k h 2 ≤ h, and @ : L×L → L and g i : Var k i ×L → L some constructors. We ask this constructors to be injective w.r.t. the equality on L, i.e. g j (v k j , M ) = g j (v k j , M ) iff M = M and @(M 1 , M 2 ) = @(M 1 , M 2 ) iff M 1 = M 1 and M 2 = M 2 . This is the case, for instance, for the equality on λ-calculus or on λµ-calculus, which is syntactic equality modulo renaming of, respectively, bound variables and bound variables and names. In the following we will reason by induction on a such terms; we ask, thus, that the equality allows such reasoning. For example equality being the syntactic equality, or a quotient which only allows to change the name of the variables, thus maintaining the same inductive structure.

Example 2.

1. The set L = Λ of λ-terms falls in the syntax above: take h = h 1 = h 2 = 1 and k 1 = 1; take @(M, N ) := the word M N ; for x ∈ Var 1 , take g 1 (x, M ) := the word λx.M modulo renaming of the variable x.

2. The set L = Λµ of Λµ-terms à la Saurin falls in the syntax above: take h = 2, h 1 = 1, h 2 = 3 and k 1 = 1, k 2 = k 3 = 2; take @(M, N ) := the word M N ; for x ∈ Var 1 , take g 1 (x, M ) := the word λx.M modulo renaming of the variable x; for α ∈ Var 2 take g 2 (α, M ) := the word µα.M modulo renaming of the name α and g 3 (α, M ) the word α |M |.

3. The set L = λµ of λµ-terms à la Parigot falls in the syntax above: take h = 2, h 1 = 1, h 2 = 2 and k 1 = 1, k 2 = 2; take Var 1 := {x 0 , x 1 , . . . } and Var 2 := {(α i 0 , α j 0 ), (α i 1 , α j 1 ), . . . } (with i 0 , j 0 , i 1 , j 1 , • • • ∈ N) where {α 0 , α 1 , . . . } is a countably infinite set; take @(M, N ) := the word M N ; for x ∈ Var 1 , take g 1 (x, M ) as before; for (α, β) ∈ Var 2 take g 2 ((α, β), M ) := the word µα. β |M | modulo renaming of the name α.

Multihole contexts and single-hole contexts are defined as expected, as well as the contextual closure of a binary relation → base on L. Definition 4.3.1. The resource sensitive version L r of L is given by the syntax6 :

M ::= v | g r j (v k j , t) | @ r (t, [ n t, . . . , t ])
where n ∈ N (and as usual v ∈ Var 1 ∪ • • • ∪ Var h 1 , j = 1, . . . , h 2 and v k j ∈ Var k j ). In the exact same way as before one defines resource multihole-contexts c = c ξ 1 , . . . , ξ k and single-hole resource contexts. We also consider the set 2 L r of sums, defined by the free Z 2 -module construction described in Section 2.1. By linearity, 2 L r inherits from L r the same constructors g r j : Var k j × 2 L r → 2 L r and @ r : 2 L r × ! 2 L r → 2 L r by setting as expected:

g r j v, i t i := i g r j (v, t i ) @ r   i∈I 0 t i ,   i∈I 1 t i , . . . , i∈In t i     := (i 0 ,...,in)∈I 0 ו••×In @ r (t i 0 , [t i 1 , . . . , t in ]).
Given → r ⊆ L r × 2 L r , one extends it to all 2 L r × 2 L r as described in Section 2.1.

Remember that if → r is confluent and strongly normalising, all resource terms t have a unique r-normal form nf r (t) ∈ 2 L 2 , which can be 0.

Remark that Lemma 3.3.9, that still holds in this framework.

Definition 4.3.2. The qualitative Taylor expansion is the map T : L → P(L r ) defined by:

1. T (v) := {v} 2. T (g i (v, M )) := {g r i (v, t) | t ∈ T (M )} 3. T (@(M, N )) := {@ r (t, [ u]) | t ∈ T (M ) and [ u] ∈ ! T (N )}.
From now on, we suppose that:

Assumption 1. It is fixed a binary relation → base on L. Moreover, its contextual closure → ⊆ L × L is s.t. every term has at most one normal form nf (M ), and nf (@(M, N )) = nf (@(nf (M ), nf (N ))) and nf (g i (v, M )) = g i (v, nf (M )), whenever the written normal forms do exist.

Assumption 2. We have fixed a reduction → r ⊆ 2 L r × 2 L r which is confluent and strongly normalising. We also ask that → r satisfies the clauses in the last line of Assumption 1.

The previous two assumptions hold in λ-calculus.

By assumption 2, for all M ∈ L there always exist NFT (M ) := Remark 4.3.3.

1. NFT (g i (v, M )) = {g r i (v, t) | t ∈ NFT (M )} 2. NFT (@(M, N )) = t∈NFT (M ) [ u]∈ ! NFT (N ) nf r (@ r (t, [ u])).
We can now prove the monotonicity in the exact same way as already done in λ-calculus: Proof. The proof shows, by induction on C, that for all M, N ∈ L s.t. NFT (M ) ⊆ NFT (N ), one has NFT (C M ) ⊆ NFT (C N ). The proof we gave in λ-calculus (Theorem 3.3.13) can be immediately adapted to the present framework, simply by treating the variables v as the variables x, and the constructor g as a "λ". Let us write this last case for the seek of clarity: If

C = g i (v, C ) then: NFT (C M ) = {g r i (v, t) | t ∈ NFT (C M )} ⊆ {g r i (v, t) | t ∈ NFT (C N )} = NFT (C N ).
As we already remarked in Chapter 3, monotonicity of 1-contexts entails monotonicity of k-contexts, so the previous theorem can be extended to multihole-contexts.

The following "simulation assumption" is the analogous of Proposition 3.3.17.

Assumption 3. If M → base N then:
1. for all s ∈ T (M ) there exist T ⊆ T (N ) s.t. s r T

2. for all s ∈ T (N ) there exist s ∈ T (M ) s.t. s r s + T for some sum T ⊆ T (N ).

We can lift the previous assumption from → base to →: Case C = g Cxt (v, C ).

(1). If s ∈ T (M ) then s = g r (v, s 0 ), with s 0 ∈ T (C M ). So by induction hypothesis there is a sum

T 0 ⊆ T (C N ) s.t. s → r g r (v, T 0 ) ⊆ T (g(v, C N )) = T (N ).
(2). If s ∈ T (N ) then s = g r (v, s 0 ), with s 0 ∈ T (C N ). So by induction hypothesis there is t ∈ T (C M ) and a sum

T 0 ⊆ T (C N ) s.t. t → r s 0 + T 0 . Hence, T (M ) = T (g(v, C M )) g(v, t) → r g(v, s 0 ) + g(v, T 0 ) = s + g(v, T 0 ) ⊆ T (C N ) = T (N ).
Case C = @ Cxt (C , P ). Analogous as above.

Case C = @ Cxt (P, C ).

(1). If s ∈ T (M ) then s = @ r (p, [s 1 , . . . , s k ]), with p ∈ T (P ) and s j ∈ T (C M ). So, for all j = 1, . . . , k, by inductive hypothesis there is

T j ⊆ T (C N ) s.t. s r @ r (p, [T 1 , . . . , T k ]) = t j ∈T j @ r (p, [t 1 , . . . , t k ]) ⊆ T (@ r (p, C N )) = T (N ).
(2). If s ∈ T (N ) then s = @ r (p, [s 1 , . . . , s k ]), with p ∈ T (P ) and s j ∈ T (C N ). So, for all j = 1, . . . , k, by induction hypothesis there is t j ∈ T (C M ) and a sum

T j ⊆ T (C N ) s.t. t j → r s j + T j . Hence, T (M ) = T (@ r (P, C M )) @ r (p, [t 1 , . . . , t k ]) r @ r (p, [s 1 + T 1 , . . . , s k + T k ]) = @ r (p, [s 1 , . . . , s k ]) + T = s + T, for some sum T ⊆ T (C N ) = T (N ).
Mimicking the definitions for λ-calculus one can give the definition of congruence on L, of (L, →)-theory and of term algebra.

It is clear that = τ is an equivalence. But also:

Corollary 4.3.6. The equivalence = τ is an (L, →)-theory.

Proof. The proof is exactly the same of Corollary 3.3.18, using Proposition 4.3.5 instead of Proposition 3.3.17.

We now reproduce the same arguments of Section 3.3.1.

Definition 4.3.7. The set of rigid resource terms is defined by:

t ::= x | g r j (v k j , t) | @ r (t, t . . . , t ).
The set of rigid k-context is defined as expected adding the clause "ξ 1 | • • • | ξ k " for the holes.

Definition 4.3.8. Let c be a resource-k-context. We define a set Rigid(c) of rigid k-contexts, whose elements are called the rigids of c, by induction on c as follows:

1. Rigid(ξ i ) = {ξ i } 2. Rigid(x) = {x} 3. Rigid(g r (v, c 0 )) = {g r (v, c • 0 ) | c • 0 ∈ Rigid(c 0 )} 4. Rigid(@ r (c 0 , [c 1 , . . . , c k ])) = { @ r (c • 0 , c • σ(1) , . . . , c • σ(k) ) | c • i ∈ Rigid(c i ) and σ permutation}.
Definition 4.3.9. Let c • be a rigid of a resource-k-context c and, for i = 1, . . . , k, let v i := v i 1 , . . . , v i deg ξ i (c) be a list7 of resource terms. We define as expected, by induction on c, a resource term c • v 1 , . . . , v k following Definition 3.3.30. It is clear that if C is a k-context then all elements of T (C) are resource k-contexts.

In the following, if v is a list, we denote with [ v] the multiset associated with v (same elements but unordered).

. For i = 1 . . . , k, let v i = v i 1 , . . . , v i deg ξ i (c 1 ) and u i = u i 1 , . . . , u i deg ξ i (c 2 ) be lists of resource terms. If c • 1 v 1 , . . . , v k = c • 2 u 1 , . . . , u k then c 1 = c 2 and [ v i ] = [ u i ] for all i.
The proof of the previous lemma is a trivial adaptation of the one of Lemma 3.3.32, where the case of the constructor g corresponds to the case of the λ-abstraction.

Lemma 4.3.12.

1. Let C be a k-context. Then: From now on, we suppose the analogous of Ehrhard-Regnier's "non-interference" property (Lemma 3.3.20), that is:

T (C M 1 , . . . , M k ) = {c • s 1 , . . . , s k | c ∈ T (C), c • rigid of c and s i list of elements of T (M i )}.
Assumption 4. For all t, s ∈ T (M ) s.t. t = s, you have nf r (t) ∩ nf r (s) = ∅.
Remark that thanks to the previous Assumption 4 and thanks to the strong normalisation one (Assumption 2), the analogue of Lemma 3.3.21 holds. As usual, we will not explicitly mention its use.

From now on, we suppose that:

Assumption 5. For all t ∈ T (M ), if t → base r T then there is N ∈ L s.t. M → N and T ⊆ T (N ).
This assumption holds in λ-calculus (it is a particular case of Proposition 3.3.34).

As in λ-calculus, we can prove the following proposition. The proof is almost the same of the one of Proposition 3.3.34, but we write it for the seek of clarity and because we use here Assumption 5 where in Proposition 3.3.34 we use Lemma 3.3.16. When we will prove that this assumption also holds in λµ-calculus (Proposition 4.4.52), we will use the analogous of Lemma 3.3.16, that is Lemma 4.4.48.

:= C 0 N , so that M = C 0 N → N . Now: every t i ∈ T (M ) = T (C 0 N ), so by Lemma 4.3.12(1) it must have shape t i = c • i v i for some resource terms v i j ∈ T (N ), a context c i ∈ T (C 0 ) and a rigid c • i of c i . But since N → N we can apply Proposition 4.3.5(1) on v i j and obtain that v i j r V i j for some sum V i j ⊆ T (N ). So t i r c • i V i =: T i .
Using again Lemma 4.3.12(1) one has that T i ⊆ T (N ). Now, let's use again Proposition 4.3.5 [START_REF]An assumption: if PA does not derive ⊥, then arithmetic is coherent[END_REF], this time on s ∈ T (N ). Since N → N we obtain sums S i ⊆ T (N ) s.t. s i r S i . So we have:

c H = c • 0 H, s r c • 0 H, S =: U.
But since H ⊆ T (N ) and every S i ⊆ T (N ), again thanks to Lemma 4.3.12(1) one has

U ⊆ T (C 0 N ) = T (N ). Now letting T := i T i + U ⊆ T (N ) one has T
r T and we are done.

As a corollary, we obtain the following analogous of Corollary 3.3.26, whose proof can be immediately adapted from the alternative proof given at page 54.

We use Definition 4.3.1 in order to get a notion of sums of λµ r -terms, and we are going to define now the reduction in λµ r , which is extended to all 2 λµ r following the same Definition. We want it to satisfy Assumption 2. In order to define such a reduction, we need to be able to divide a multiset into a certain number of "blocks". The notion which we want to define for bags is similar to the combinatorial notion of partition of an integer, and more specifically to that of weak composition. The extension of these notions from integers to multisets is well known and studied in the literature of combinatorics (see for example [START_REF] Edward | Partitions of multisets[END_REF]).

Definition 4.4.3 (Weak composition of a multiset). A partition (resp. weak partition) of a multiset

[ u] is a multiset [[ v 1 ], . . . , [ v k ]] of non-empty (resp. possibly empty) multisets, called blocks, s.t. [ u] = [ v 1 ] * • • • * [ v k ]. A composition (resp. weak composition -w.c. for short) of a multiset [ u] is a tuple ([ v 1 ], . . . , [ v k ]) of multisets s.t. [[ v 1 ], . . . , [ v k ]] is a partition (resp. weak partition) of [ u].
Observe that the empty bag 1 admits no partitions but admits infinite weak partitions: they are the multisets of shape [1, . . . , 1] (h ≥ 0 times 1). Let us give some other examples: the set of all the weak partitions of the bag [x] is:

{[[x]], [[x], 1], [[x], 1, 1], . . . }.
The set of all weak partitions of [x, x] is:

{[[x, x]], [[x], [x]], [[x, x], 1], [[x], [x], 1], [[x, x], 1, 1], [[x], [x], 1, 1], . . . }.
The w.c.'s are then simply obtained by choosing an order on the weak partitions. Here x (1) , . . . , x (k) is any fixed enumeration of the occurrences8 of x in t and S k is the set of bijections on k-elements.

2. In order to linearize the µ-reduction we introduce the linear named application t α [ u] ∈ 2 λµ r , defined as:

if deg α (t) = 0 then t α 1 := t and t α [v, u] := 0 if deg α (t) =: d = 0 then: t α [ u] := t α |(•)[ s 1 ]|/ α|•| (1) , . . . , α |(•)[ s d ]|/ α|•| (d)
where the sum is taken over all In Definition 4.4.4 we write that "the same exact definition is given also in the case t is a named term". This is reflected in the inductive definition of Figure 4.2, where in fact we

([ s 1 ], . . . , [ s d ]) w.c. of [ u] of
The linear substitution t [ u]/x is inductively defined as in Figure 3.1 with the additional clause: (for η equal or not to α) of the linear application of a named term to a bag through a name. That is, we are actually defining the operation • α [ u] on Saurin's Λµ-calculus9 (but [ u] is still a bag of λµ-terms, because that is enough for us). This raises no problems, since Parigot's λµ-calculus is an inductive subsystem of it. But it is important to notice that many of our definitions do already make sense in Saurin's calculus and, in order to get things right in our framework (λµ-calculus), we need sometimes to apply definitions on Λµ-calculus. An example of this phenomenon is Lemma 4.4.50. In general, as we will mention in the conclusions, this raises the question of whether it is possible to lift the present work from λµ-calculus to Λµ-calculus.

(µα. β |s|) [ u]/x = µα. β |s [ u]/x | Figure 4.1: Inductive characterisation of linear substitution in λµ-calculus x α [v, u] = 0 x α 1 = x η |t| α [ u] = η | t α [ u]| (if η = α) µγ. η |t| α [ u] = µγ. η |t| α [ u] λy.t α [ u] = λy. t α [ u] α |t| α [ u] = ([ w 1 ], [ w 2 ]) w.c. of [ u] α | t α [ w 1 ] [ w 2 ]| t[v 1 , . . . , v n ] α [ u] = ([ w 0 ],...,[ w n ]) w.c. of [ u] t α [ w 0 ] v 1 α [ w 1 ], . . . , v n α [ w n ] .
Let us now define our reduction for the resource λµ-calculus.

Definition 4.4.6. Define a reduction10 → r ⊆ λµ r × 2 λµ r as the resource-context closure of the union → base r of:

(λx.t)[ u] → λ r t [ u]/x (µα. β |t|)[ u] → µ r µα. β |t| α [ u] µγ. α |µβ. η |t|| → ρ r µγ. ( η |t|{α/β}) .
We extend it to all 2 λµ r × 2 λµ r as explained in the "formal sums" paragraph of Section 2.1.

Observe that, just like λµ-terms, every r-normal λµ r -term t has a head variable, has no ρ-redexes in its head and its bags contain only r-normal λµ r -terms.

The reduction → λ r is the usual linearisation of → λ and → ρ r simply simulates → ρ . For → µ r we believe it is interesting the following consideration: Remark 4.4.7. It is known (for instance this is considered in [START_REF] Saurin | Böhm theorem and Böhm trees for the Λµ-calculus[END_REF]), that one can decompose → µ introducing a new reduction → fst . The decomposition transforms a µ into a λ, and then reduces all the complexity of → µ to an appropriate → λ . The reduction → fst is:

µα. β |M | → fst λz.µα.( β |M |) α z
(for z fresh), and the decomposition of → µ is as follows:

(µα. β |M |)N → fst (λz.µα.( β |M |) α z)N → λ µα.( β |M |) α N.
One may wonder if our resource reduction → µ r is good enough to be compatible with this fine decomposition. For that, we need to linearise Saurin's decomposition, and since we already know what the linearised λ-reduction is, we only need to define a correct linearisation → fst r of fst. Then, we have to verify whether we can still decompose → µ r by first applying → fst r and then → λ r . The natural choice for → fst r is:

µα. β |t| → fst r λz.µα. m≥0 β |t| α [ m z, . . . , z]
(for z fresh). Note that this reduction → fst r gives an infinite sum. Of course to manipulate such an object one should pay attention; but we will not, because we want to keep this computation just as an heuristic. Let us now verify that the decomposition "→ µ r = λ r • → fst r " holds. We have:

(µα. β |t|)[ u] → fst r   λz.µα. m≥0 β |t| α [ m z, . . . , z]   [ u] λ r µα.
k 1 +•••+k d =n β |t|{ α |(•)[ k 1 z, . . . , z]|/ α|•| (1) , . . . , α |(•)[ k d z, . . . , z]|/ α|•| (d) } [ u]/z .
It is now easy from it to reconstruct the term µα. β |t| α [ u] and we are done again.

This remark can be seen as an a posteriori justification of the correctness of our linearisation → µ r of → µ , or as an heuristic to find it.

A resource calculus is useful because, in addition to linearity, resource sensitiveness entails strong properties such as strong normalization and confluence. This is what we are going to prove now. Compared with resource λ-calculus in our setting those properties require some more thinking.

Strong normalization With → λ r we erase exactly one λ, and with → ρ r we erase exactly one µ. With → µ r however, the situation is more subtle: we are not creating nor erasing λ's or µ's (which remain thus in constant number), but we are eventually making the the reduct grow by creating an arbitrarily large number of new applications, possibly even creating new (λ or µ-)redexes. However, these new applications are created "deep inside" the reduct. In fact, in order to pass from the µ-redex (µα.

β |t|)[ u] to a reduct t ∈ µα. β |t| α [ u], we: -first, decompose [ u] in several blocks -then, erase [ u]
-finally, put each block inside a certain named subterm of β |t|.

The idea is thus that we replaced a bag with many new bags which are at a "deeper depth". Our aim is to find a decreasing measure, while this intuition of "depth" is increasing. But as we will see in Remark 4.4.9, it will be immediate to recognize that actually this number is necessary bounded by the number of µ-occurrences in the term, which is invariant under → µ r , so the former subtracted from the latter should decrease. Remark that there is one case in which we do not create new bags and we simply erase one already existing one: it is the case where [ u] = 1 and deg µ ( β |t|) = 0, so we have to make sure our measure decreases in this case as well. Remark 4.4.9. By definition of the grammar of the λµ r -calculus there are as many named subterms of t as µ-abstractions11 in t, which are deg µ (t) by definition. So it must always be:

d t (b) ≤ deg µ (t).
Definition 4.4.10. Recalling the notation of multisets in Section 2.1, we define the multiset measure m(t) ∈ ! N of a λµ r -term t as:

m(t) := deg µ (t) -[ d t (b) | b occurrence of bag in t ].
Remark 4.4.9 assures that m(t) ∈ ! N (and not in ! Z), which is well-founded w.r.t. the multiset order. We order thus multiset measures w.r.t to this order.

In this chapter we will have to talk about many occurrences of bags in terms. This is why we will sometimes use the notation "b" for such occurrences, just like we did in the previous definition, instead of explicitly writing the bag as "[ u]".

The measure m(•) is "almost" the good one for strong normalization: Case deg α ( β |s|) = 0. By definition of → µ r this is possible only if b 0 = 1 (otherwise t → µ r 0) and h = µα. β |s|. So in t there are the exact same occurrences of bags as in t and they are at the same depth, except for b 0 which is in t but not in t . This means that m

(t) = m(t ) * [ k -d t (b 0 ) ] > m(t ). Case deg α ( β |s|) =: n ≥ 1. Then: h = µα. β |s| α |(•)b 1 |/ α|•| (1) , . . . , α |(•)b n |/ α|•| (n) for a w.c. (b 1 , . . . , b n ) of b 0 . So m(t ) = k -A and m(t) = k -A, with A and A the multisets: A = [ d t (b 1 ), . . . , d t (b n ) ] * [ d t (b) | b in c ] * [ d t (b) | b in s ] * [ d t (b) | b in a v ∈ b i for an i ]) A = [ d t (b 0 ) ] * [ d t (b) | b in c ] * [ d t (b) | b in s ] * [ d t (b) | b in a v ∈ b 0 ] ]).
Now for i = 1, . . . , n we have:

d t (b i ) = d t (h) + d h (b i ) > d t (b 0
) since as one sees from the expression of h, we have d t (h) = d t (b 0 ) and d h (b i ) > 0. Also, it is easily understood that for all b occurring in c, or occurring in s, we have:

d t (b) = d t (b). Finally, observe that since (b 1 , . . . , b n ) is a w.c. of b 0 , then: b occurs in some v ∈ b 0 iff b occurs in some v ∈ b i for some i.
And for all such b we have:

d t (b) = d t (v) + d v (b) > d t (v) + d v (b) = d t (b) since d t (v) = d t (b i ) > d t (b 0 ) = d t (v)
. All these considerations precisely mean m(t) > m(t ).

Proposition 4.4.12. If t → λ r t + T then m(t) > m(t ).

Proof. If t → λ r t +T then t = c (λx.s)b 0 and t = c h with h = s{u σ(1) /x (1) , . . . , u σ(n) /x (n) } ∈ s b 0 /x , for c a single-hole resource context, σ a permutation and b

0 = [u 1 , . . . , u n ]. Call k := deg µ (t) = deg µ (t ).
We have:

m(t ) = k -[ d t (b) | b in c ] * [ d t (b) | b in s ] * [ d t (b) | b in some u i in b 0 ] m(t) = k -[ d t (b) | b in c] * [ d t (b) | b in s] * [ d t (b) | b in some u i in b 0 ] * [ d t (b 0 )].
Now, it is easily understood that if b occurs in c, or b occurs in s, then d t (b) = d t (b). Furthermore, for all b occurrence of bag in some u σ(i) belonging to b 0 , one has:

d t (b) = d c (ξ) + d s (x (i) ) + d u σ(i) (b) ≥ d c (ξ) + d u σ(i) (b) = d t (b).
Thus:

m(t) ≥ m(t ) * [ k -d t (b 0 ) ] > m(t ).
However, only m(t) is not enough to prove strong normalization. In fact:

Proposition 4.4.13. If t → ρ r t +T then m(t) ≥ m(t ), and there are cases in which the equality holds.

Proof. If t → ρ r t +T then t = c h and t = c h , with h = µγ. α |µβ. η |s|| and h = µγ. η |s|{α/β} and c a single-hole resource context. Therefore: . Putting these things together we have that, if c contains at least one bag:

m(t ) = [ deg µ (t ) -d t (b) | b in c ] * [ deg µ (t ) -d t (b) | b in s ]. m(t) = [ deg µ (t) -d t (b) | b in c] * [ deg µ (t) -d t (b) | b in s].
[ deg µ (t )-d t (b) | b in c ] = (1+deg µ (s))+m(c) < (2+deg µ (s))+m(c) = [ deg µ (t)-d t (b) | b in c ].
On the other hand, if c does not contain any bag, the previous multisets are both empty, thus equal. Now let's see what happens if b occurs in s. We have:

d t (b) = 1 + d c (ξ) + d s (b) and d t (b) = 2 + d c (ξ) + d s (b). Therefore: [ deg µ (t ) -d t (b) | b in s ] = (deg µ (c) -d c (ξ)) + m(s) = [ deg µ (t) -d t (b) | b in s ].
These facts immediately imply that m(t) ≥ m(t ) and, to give an example, one has (for

β = η) m(µγ. α |µβ. η |x||) = 1 = m(µγ. η |x|) while µγ. α |µβ. η |x|| → ρ r µγ. η |x|.
That is why, in order to get a strongly normalising measure, we add another component: Definition 4.4.14. We define the measure:

m(t) := (m(t), deg µ (t)) ∈ !N × N
where the couple is ordered by the lexicographic order, which is well-founded.

Example 4.4.22. Using the notations and terminologies above, we have:

1. The function W : (x, y) -→ {0, 1} defined by W (1) = 1, W (2) = 0, generates the w.c.

([ w 0 ], [ w 1 ]) of [x, y] (with the enumeration from left to right) given by:

[ w 0 ] = [y], [ w 1 ] = [x].
2. The function D : (y, y) -→ {0, 1} defined by D(1) = 0, D(2) = 1, generates the w.c.

([ d 0 ], [ d 1 ]
) of [y, y] (with the enumeration from left to right) given by: with the sum on all W : ( u) -→ {0, . . . , n}, and by taking the above w.c.'s as the one given by W in the previously explained sense. Analogously, in the case of a µ-abstraction, we replace the sum on all the ([ w 1 ], [ w 2 ]) w.c. of [ u] with the sum on all W : ( u) -→ {0, 1}, and by taking the above w.c.'s as the one given by W in the previously explained sense.

[ d 0 ] = [ d 1 ] = [y].
Example 4.4.24. For instance, one has:

(µα. α |µη. α |x||)[y, y] → + r µα. α |(µη. α |x1|)[y, y]| + 2 µα. α |(µη. α |x[y]|)[y]| + µα. α |(µη. α |x[y, y]|)1|.
The first term of the sum comes from the w.c. given by the two different functions W : (y, y) -→ {0, 1} defined by W (1) = 0, W (2) = 1 and W : (y, y) -→ {0, 1} defined by W (1) = 1, W (2) = 0.

Remark 4.4.25. It is clear by the definitions that if, for t ∈ λµ r , one has t → λµ r T (in 2 λµ r ) and t → + r S (in N λµ r ) by reducing the same redex, then supp(S) = T. That is, the two reductions only differ for the coefficients.

Remark 4.4.26. Since we already know that the reduction → r is strongly normaling in λµ r (Corollary 4.4.15), then the reduction → + r is strongly normaling in N λµ r . Indeed, it sufficies to extend the strongly normalising measure m(•) of λµ r (Definition 4. Remark 4.4.27 (Embedding inside the differential λµ-calculus). One could think of proving the confluence of → + r by using the fact that in [START_REF] Vaux | λ-calcul différentiel et logique classique : interactions calculatoires[END_REF], Vaux proves the confluence of his differential λµ-calculus. Let us call it (λµ ∂ , → ∂ ) in this remark. In fact, our resource λµ-calculus 2 λµ r , as well as the quantitative version N λµ r , translates into λµ ∂ via the translation (•) ∂ : λµ r -→ λµ ∂ defined as14 :

x

∂ := x λx.t ∂ := λx.t ∂ µα. β |t| ∂ := µα. β |t ∂ | (t[u 1 , . . . , u k ]) ∂ := D k t ∂ • (u ∂ 1 , . . . , u ∂ k ) 0.
We can extend it to sums, both in 2 λµ r and in N λµ r , by linearity. In the qualitative case (that is, if we consider (•) ∂ : 2 λµ r -→ λµ ∂ ), it is not a well-behaved embedding, because it does not preserve reductions. On the contrary, it does in the quantitative case (that is, if we consider (•) ∂ : N λµ r -→ λµ ∂ ), as one can prove that: if t → + λµ r T in N λµ r , then t ∂ ∂ T ∂ in λµ ∂ . One can now entail the local confluence of → + λµ r from the confluence of → ∂ . And in turn, as we are going to see (using the reduction in Definition 4.4.44), this entails that → λµ r is locally confluent as well.

However, as the reader has probably noticed, we only talked about → λµ r , and not about the whole → r = → λµ r ∪ → ρ r . This is simply because in [START_REF] Vaux | λ-calcul différentiel et logique classique : interactions calculatoires[END_REF] the ρ-reduction is not considered, thus the reduction → ∂ for which the confluence is there proven only contains the cases for → λ and → µ , not for → ρ .

Remark that, even if it is possible to prove the confluence of → ρ r by itself, we cannot use this result in order to entail the confluence of → r = → λµ r ∪ → ρ r by invoking the well-known Hindley-Rosen lemma15 . This is because → + ρ r and → + λµ r do not commute, as the following example shows16 (where γ = η = α):

(µα. α |µγ. η |x||)1 → ρ r (µα. η |x|)1  µ r  µ r µα. α |(µγ. η |x|)1| → ρ r µα. η |x|.
We can attack the first of the two steps mentioned some pages above: we will prove the local confluence of → + r . We present here a proof which essentially consists in considering all the possible critical pairs and showing that one can always close the respective diagram17 . Remark 4.4.28. We can extend the definition of linear substitution and linear named application to sums by linearity:

µα. T + α [U 1 , . . . , U k ] := t∈T u 1 ∈U 1 • • • u k ∈U k µα. t + α [u 1 , . . . , u k ]
and the same for the linear substitution. Analogously, the renaming of a sum T{α/β} is defined component-wise. With these definitions in place one checks that base-step-reduction lifts to sums, i.e.:

(µα. β |T|) [ U] + µ r µα. T + α [ U], (λx.T) [ U] + λ r T [ U] / x + , µα. β |µγ. η |T|| + ρ r µα. η |T|{β/γ}.
One can check that → + r on N λµ r is contextual.

We need a number of technical lemmas handling the interaction of two successive substitutions. The proofs of these lemmas are tedious and long inductions. Notation 4.4.29. In this section we will sometimes use the following notation: for α, β, η names, we set δ α η (β) to be18 α if β = η, or η otherwise. Remark that with this notation the ρ-reduction takes the form µα. β |µγ. η |t|| → + ρ r µα. δ β η (γ) |t{β/γ}|. Lemma 4.4.30. Let t ∈ λµ r and α, β, γ, η names. If α = η, β = η and β = γ, then t{α/β}{γ/η} = t{γ/η}{α/β}.

The following lemma says how a renaming behaves with respect to the linear substitution and the linear named application.

Lemma 4.4.31. Let t ∈ λµ r and [ u] a bag. Then:

1. t [ u]/x + {α/β} = t{α/β} [ u{α/β}]/x + . 2. If α = γ = β then: ( t + γ [ u] ){α/β} = t{α/β} + γ [ u{α/β}]. 3. If α = γ = β then: ( η |t| + γ [ u] ){α/β} = η |t|{α/β} + γ [ u{α/β}].
The next lemma says how two linear substitutions operate when applied consecutively.

t [ v]/y [ u]/x = W t [ w 0 ]/x [v 1 [ w 1 ]/x , . . . , v n [ w n ]/x ]/y
with W : ( u) -→ {0, . . . , n}.

The condition x = y in the previous lemma cannot be suppressed: for instance for x = y, t = x, [ v] = 1 and [ u] = [z], with z = y, the left hand-side of the equality becomes x 1/x + [z]/x + = 0 while the right hand-side becomes x [z]/x + 1/x + = z.

The next lemma says how a linear substitution operates on linear named application.

( t + α [ v] ) [ u]/x = W t [ w 0 ]/x + α [v 1 [ w 1 ]/x , . . . , v n [ w n ]/x ]
with W : ( u) -→ {0, . . . , n}.

The following two remarks are easy:

Remark 4.4.34. Let α be a name, t ∈ λµ r and

[ u], [ v] bags. If deg α ([ v]) = 0 then one has: t[ v] + α [ u] = ( t + α [ u] ) [ v]. Remark 4.4.35. Let α = β be names, t ∈ λµ r and [ v] =: [v 1 , . . . , v n ], [ u] bags. If deg β (t) = 0 then one has: t + α [ v] + β [ u] = W t + α [ v 1 + β [ w 1 ], . . . , v n + β [ w n ]].
with W : ( u) -→ {1, . . . , n}.

The next lemma says in which sense and when, in some cases, one can swap the order of two linear applications.

t + α [ u] + β [ v] = t + β [ v] + α [ u].
2. If deg α ([ v]) = 0 then, taking δ a fresh name, one has:

t + α [ u] + β [ v] = W t + β [ w 1 ] + α [ u{δ/β}] + δ [ w 2 ] {β/δ} with W : ( v) -→ {1, 2}.
3. If deg β ([ u]) = 0 then, taking δ a fresh name, one has:

t + α [ u] + β [ v] = t + β [ v{δ/α}] + α [ u] {α/δ}.
The next lemma says how a linear named applications on a name operates on a renaming involving the same name.

t{α/β} + α [ u] = W t + α [ w 1 ] + β [ w 2 ] {α/β} with W : ( u) -→ {1, 2}.
The condition α = β in the previous lemma cannot be suppressed: for instance, for t = µγ. α |x| and [ u] = 1, the left hand-side of the equality becomes µγ. α |x1| while the right handside becomes: The following lemma says how a linear named application operates on a linear substitution.

W :()-→{1,2} µγ. α |x [ w 1 ] [ w 2 ]| = µγ.
Lemma 4.4.38. Let t ∈ λµ r , [ v] =: [v 1 , . . . , v n ], [ u] bags, x a variable and α a name s.t. deg x ([ u]) = 0. t [ v]/x + α [ u] = W ( t + α [ w 0 ]) [ v 1 + α [ w 1 ], . . . , v n + α [ w n ]]/x
with W : ( u) -→ {0, . . . , n}. The next lemma says how two linear named application operate consecutively.

Lemma 4.4.39. Let t ∈ λµ r , α = γ names and

[ v] =: [v 1 , . . . , v n ], [ u] bags s.t. deg γ ([ u]) = 0.
We have:

t + γ [ v] + α [ u] = W t + α [ w 0 ] + γ [ v 1 + α [ w 1 ], . . . , v n + α [ w n ]]
with W : ( u) -→ {0, . . . , n}. Furthermore, the same holds also for named terms. That is, under the same hypothesis and for η a name, we have20 :

η |t| + γ [ v] + α [ u] = W η |t| + α [ w 0 ] + γ [ v 1 + α [ w 1 ], . . . , v n + α [ w n ]]
with W : ( u) -→ {0, . . . , n}.

The condition α = γ in the previous lemma cannot be suppressed: for instance, for t = µδ. With these technical lemmas in place, we can now can prove the crucial Lemma 4.4.41 for the confluence of the quantitative resource calculus. To say it in other words, it states that reduction on sums (see Remark 4.4.28) remains contextual also if we include (•) [•, . . . , •]/x and

• + α [•, . . . , •] as (multi-hole-)contexts.
In the proof of Lemma 4.4.41 we also use the following remark.

Remark 4.4.40. Let [p, q] be a bag. Then, every function W : {p, u 1 , . . . , u k } -→ {0, . . . , n} is uniquely determined by the choice of W (p) ∈ {0, . . . , n} plus the choice of a function W : {u 1 , . . . , u k } -→ {0, . . . , n}. This is reflected in the equality (n + 1) k+1 = (n + 1) k • (n + 1). Now, for 0 ≤ i, j ≤ n, let us set [p] j i the singleton multiset [p] if i = j, and the empty mulitset

1 if i = j. Therefore, the w.c. of [p, q] generated by a W : {p, u 1 , . . . , u k } -→ {0, . . . , n} is of shape ([ w 0 ] * [p] W (p) 0 , . . . , [ w n ] * [p] W (p) n
), for ([ w 0 ], . . . , [ w n ]) a w.c. of [ q] generated by a W : {u 1 , . . . , u k } -→ {0, . . . , n}.

Lemma 4.4.41. Let t, s ∈ λµ r , x a variable, α, β names and [ u] a bag. If s → + r S then:

1. s{α/β} + r S{α/β}

2. t [s, u]/x + + r t [S, u]/x + 3. s [ u]/x + + r S [ u]/x + 4. t + α [s, u] + r t + α [S, u] 5. µα. β |t| + α [s, u] + r µα. β |t| + α [S, u] 6. s + α [ u] + r S + α [ u]. 7. µα. β |s| + α [ u] + r µα. β |S| + α [ u].
Proof.

Induction on s:

Case s variable: impossible. Sub-subcase α = γ. By Figure 4.2, we have:

s + α [ u] = W µβ. α | ( µγ . η |s | + α [ w 1 ] ) [ w 2 ]| where W : ( u) -→ {1, 2} + µ r W µβ. α |µγ . η |s | + α [ w 1 ] + γ [ w 2 ]| + ρ r W µβ. η |s | + α [ w 1 ] + γ [ w 2 ] {α/γ } = W µβ. η |s | + α [ w 1 ] + γ [ w 2 ] {α/γ } = µβ. η |s | {α/γ } + α [ u] (by Lemma 4.4.37) = S + α [ u] (since α = γ).
s + α [ u] = W (λx. s + α [ w 0 ]) [. . . , v i + α [ w i ], . . . ] with W : ( u) -→ {0, . . . , n} + λ r W ( s + α [ w 0 ]) [. . . , v i + α [ w i ], . . . ]/x = s [ v]/x + α [ u] (by Lemma 4.4.38) = S + α [ u].
Subcase s = µγ. η |s | (with γ = α) and s → + r S is performed by reducing the µ-redex s. Then S = µγ. η |s | + γ [ v] and using Figure 4.2 we have:

s + α [ u] = W ( µγ. η |s | + α [ w 0 ]) [. . . , v i + α [ w i ], . . . ] with W : ( u) -→ {0, . . . , n} + µ r µγ. W η |s | + α [ w 0 ] + γ [. . . , v i + α [ w i ], . . . ] = µγ. η |s | + γ [ v] + α [ u]
(by Lemma 4.4.39) Proof. We show, by induction on a single-hole resource context c, that if:

= S + α [ u].
t → + base r T and c t → + r T 2 then there is T ∈ N λµ r s.t. c T + r T + r T 2 .
In all the following diagrams we write "→" but of course we mean "→ + r ".

1. Case c = ξ. So c t = t → + base r T and we only have the three base-cases of Definition 4.4.20. In all the diagrams of this case, when not explicitly said differently or not clear by an easy reduction, the bottom-left reduction follows from Lemma 4.4.41 and the bottom-right from Remark 4.4.28. Subcase t = (λx.s)[ u] and T = s [ u]/x + . Then c t = t → + r T 2 (on a different redex than t) can only be performed either by reducing s, or by reducing an element w of [ u]. We have thus the following two diagrams:

(λx.s)[ u] s [ u]/x + (λx.S)[ u] S [ u]/x + (s→S) (λx.s)[w, u ] s [w, u ]/x + (λx.s)[W, u ] s [W, u ]/x + (w→W) Subcase t = (µα. β |s|)[ u] and T = µα. β |s| + α [ u]
. Then c t = t → + r T 2 (on a different redex than t) can only be performed either by reducing s, or by reducing an element w of [ u], or if s = µγ. η |s | and we reduce the ρ-redex ... β |µγ. ...|. In the latter case we split into the case α = β, the case α = β, γ = η, η = α, the case α = β, γ = η, η = α, and the case α = β, η = γ (with necessary γ = α). The above six cases respectively correspond to the following six diagrams:

(µα. β |s|)[ u] µα. β |s| + α [ u] (µα. β |S|)[ u] µα. β |S| + α [ u] (s→S) (µα. β |s|)[w, u ] µα. β |s| + α [w, u ] (µα. β |s|)[W, u ] µα. β |s| + α [W, u ] (w→W)
(µα. β |µγ. η |s ||)[ u] µα. β |µγ. η |s | + α [ u]| (µα. η |s |)[ u]{β/γ} µα. η |s | + α [ u]{β/γ} (α =β) α =β deg γ ([ u])=0 (µα.α|µγ.α|s ||)[ u] µα. α|µγ.α|s || + α [ u] (µα.α|s {α/γ}|)[ u] W D µα.α|(µγ.α|( s + α [ d 0 ])[ d 1 ]|)[ w 1 ]| µα. α|s {α/γ}| + α [ u] W D µα.α|µγ.α| ( s + α [ d 0 ])[ d 1 ] + γ [ w 1 ]|| W µα.α|( s {α/γ} + α [ w 0 ])[ w 1 ]| W D µα.α| ( s + α [ d 0 ])[ d 1 ] + γ [ w 1 ]|{α/γ} W :( u)→{1,2} D:( w 0 )→{1,2} W :( u)→{1,2}
where the bottom right equality holds because, by Lemma 4.4.37, Remark 4.4.34 and since deg γ ([ u]) = 0, each addend of the bottom right sum is:

µα. α |( s {α/γ} + α [ w 0 ])[ w 1 ]| = D:( w 0 )→{1,2} µα. α |( s + α [ d 1 ] + γ [ d 0 ])[ w 1 ]|{α/γ} = D µα. α | ( s + α [ d 1 ])[ w 1 ] + γ [ d 0 ]|{α/γ}
and since we are then summing up on all possible W : ( u) → {1, 2}, the resulting sum is the same as the one at the bottom of the above diagram.

(µα.α|µγ.η|s ||)[ u] µα. α|µγ.η |s || + α [ u] (µα.η|s {α/γ}|)[ u] W µα.α|(µγ.η| s + α [ w 0 ]|)[ w 1 ]| µα. η |s {α/γ}| + α [ u] W µα.α|µγ.η| s + α [ w 0 ] + γ [ w 1 ]|| µα.η| s {α/γ} + α [ u]| W µα.η| s + α [ w 0 ] + γ [ w 1 ]{α/γ}| (γ =η) W :( u)→{1,2} (η =α) W :( u)→{1,2}
where the bottom right equality holds by Lemma 4.4.37 and because deg γ ([ u]) = 0.

(µα.α|µγ.γ|s ||)[ u] µα. α|µγ.γ |s || + α [ u] (µα.α|s {α/γ}|)[ u] W µα.α|(µγ.γ| s + α [ w 0 ]|)[ w 1 ]| µα. α|s {α/γ}| + α [ u] W D µα.α|µγ.γ|( s + α [ w 0 ] + γ [ d 0 ])[ d 1 ]|| W µα.α|( s {α/γ} + α [ w 0 ])[ w 1 ]| W D µα.α|( s + α [ w 0 ] + γ [ d 0 ])[ d 1 ]{α/γ}| W :( u)→{1,2} D:( w 1 )→{1,2} W :( u)→{1,2}
where the bottom right equality holds by Lemma 4.4.37 and because deg γ ([ u]) = 0.

:= δ α η (β), δ 1 := δ α η (β), δ 1 := δ δ 0 δ 1 (γ ), δ 2 := δ η η (γ ) and δ 2 := δ α δ 2 (β).
Let us prove the equality in the last diagram: we first show that s {α/β}{δ 0 /γ } = s {η/γ }{α/β} and then that δ 1 = δ 2 . For the former equality, we have: if β = η, then δ 0 = η and the equality follows from Lemma 4.4.30; if β = η then δ 0 = α and the equality holds because both renamings {α/β}{δ 0 /γ } and {η/γ }{α/β} coincide with the unique renaming {α/(β, γ )}23 .

For the latter equality, we have: if γ = η : then δ 2 = η and thus δ 2 = δ 0 . Remark that it must be β = η , because otherwise β = γ which is impossible. This means that δ 1 = η . But then δ 1 = δ 0 , so we are done.

if γ = η : then δ 2 = η and thus δ 2 = δ 1 . Now if β = η then δ 1 = η and thus δ 1 = η ; if β = η then δ 1 = α and thus δ 1 = δ δ 0 α (γ ) = α, because it cannot be γ = α.
If we read what we just found about δ 1 , it precisely says that δ 1 = δ 1 so we are done.

2. Case c = µα. β |c | with either c t not a µ-abstraction, or c = λx.c . Then the reduction c t → T 2 can only be performed via a reduction c t → T 2 . The diagram for both cases has the same shape; using the notation of Section 4.3, let's call in both cases c =: g(v, c ) (where v is either x if g is a λ-abstraction, or (α, β) if g is a µ-abstraction). Now the result is given by the following diagram:

g(v, c t ) g(v, c T ) g(v, T 2 ) g(v, T) (c t →T 2 )
where a sum T s.t. c T T T 2 is given by inductive hypothesis on c . In the first case, since by hypothesis t → + base r T, it must be t = µγ. η |µγ . η |t || and T = µγ. η |t |{η/γ }. Therefore, the reduction c t → r T 2 (on a different redex than the one of t → + base r T) can only be performed either by reducing t , or by reducing the ρredex ... β |µγ. ...|, or if t = µ γ. η | t| and we reduce the ρ-redex ... η |µ γ. ...|. The first and second situation of the previous list have been already treated in the case c = ξ (with the notation used there, it corresponds to the two diagrams of the subcase t = µγ. α |µβ. η |s|| and T = µγ. η |s|{α/β}.). Also the third situation corresponds to the exact same case just mentioned, because the external µα. β |...| is not modified in neither reductions.

In the second case, then the reduction c t → r T 2 can only be performed either by reducing c t , or by reducing the ρ-redex c t . In the first situation the diagram follows easily by inductive hypothesis as in the previous case, and in the second one the diagram is the The same definition, as usual, also endows λµ with the partial preorder ≤ given by the inclusion of Taylor normal forms.

Remark that the Monotonicity property (Theorem 4.3.4) is then true for λµ-calculus, that is: for C a k-context, the map

C : λµ × • • • × λµ -→ λµ is monotone w.r.t. ≤.
As usual, we need a Lemma saying that Taylor expansion behaves well w.r.t. substitutions. Lemma 4.4.48. One has:

T (M {α/β}) = T (M ){α/β} T (M {N/x}) = t∈T (M ) u∈ ! T (N ) t [ u]/x T ((M ) α N ) = t∈T (M ) u∈ ! T (N ) t α [ u].
Proof. (1). Straightforward induction on M .

(2). Induction on M . Nothing changes w.r.t. the proof one does in λ-calculus, the only new case is M = µβ. α |P | but it is done straightforwardly exactly as the case M = λx.P .

(3). Induction on M .

Case M = x:

T ((M ) α N ) = T ((x) α N ) = {x} = x α 1 = u∈ ! T (N ) x α [ u] = t∈T (M ), u∈ ! T (N ) t α [ u].
Case M = λx.P :

T ((M ) α N ) = T (λx.(P ) α N ) = {λx.s | s ∈ T ((P ) α N )} = p∈T (P ) [ u]∈ ! T (N ) λx.( p α [ u]) (by inductive hypothesis) = p∈T (P ) [ u]∈ ! T (N ) λx.p α [ u] = t∈T (M ) [ u]∈ ! T (N ) t α [ u]. Case M = µβ. γ |P | (with β, γ = α): T ((M ) α N ) = T (µβ. γ |(P ) α N |) = {µβ. γ |s| | s ∈ T ((P ) α N )} = p∈T (P ) [ u]∈ ! T (N ) µβ. γ | p α [ u]| (by inductive hypothesis) = p∈T (P ) [ u]∈ ! T (N ) µβ. γ |p| α [ u] = t∈T (M ) [ u]∈ ! T (N ) t α [ u].
Case ms(t) > (1, 0, 1). By Lemma 4.4.2, M has shape:

M = λ x 1 µα 1 . β 1 |. . . λ x k µα k . β k |RQ 1 . . . Q n ||
for R either a variable, or a λ-redex or a µ-redex. Since the series of λ and µ abstractions (with their respective namings) will play no role in the following, in this proof we shorten λ x 1 µα 1 .

β 1 |. . . λ x k µα k . β k |. . .|| to just λµ|. . .|. So: t = λµ|t [ u 1 ] . . . [ u n ]| and s = λµ|s [ v 1 ] . . . [ v n ]| for t , s ∈ T (R) and [ u i ], [ v i ] ∈ ! T (Q i ).
We have now three subcases depending on the shape of R.

Subcase R variable, say R = x. Then t = s = x. Wlog n ≥ 1, otherwise it is trivial that t = s. Now say

[ u i ] =: [u i 1 , . . . , u i m i ] and [ v i ] =: [v i 1 , . . . , v i m i ] for i = 1, . . . , n. By confluence we have h ∈ nf r ( λµ|x nf r ([ u 1 ]) . . . nf r ([ u n ])|), so h ∈ nf r ( λµ|x[ d 1 ] . . . [ d n ]|) for some d i j ∈ nf r (u i j )
. Similarly, we get:

h ∈ nf r ( λµ|x[ d 1 ] . . . [ d n ]|) for some d i j ∈ nf r (v i j )
. So it must be m i = m i (i = 1, . . . , n) and:

h = λµ |x[d 1 1 , . . . , d 1 m 1 ] • • • [d n 1 , . . . , d n mn ]|
for some head λµ , some

d i j ∈ nf r (u i j ) ∩ nf r (v i σ i (j)
) and permutations σ i on m i elements. But u i j , v i j ∈ T (Q i ) and ms(u i j ) < ms(t) since u i j is a strict subterm of t. So we can apply the inductive hypothesis to each u i j and obtain u i j = v i j . Hence, t = s. Subcase R = (λy.P )N . It is the same argument as the following subcase, so we skip it.

) γ N )Q 1 • • • Q n |).
This and the fact that h ∈ nf r ( h 1 ) ∩ nf r ( h 2 ) mean that h 1 satisfies both the hypotheses of the inductive hypothesis. Moreover, since t → µ r h 1 + T for some sum T, then m(h 1 ) < m(t ). And since the number of µ's is constant under µ-reduction, deg µ (t ) = deg µ (h 1 ). Therefore we can apply Lemma 4.4.18 and obtain:

m( h 1 ) = m( λµ|h 1 [ u 1 ] . . . [ u n ]|) < m( λµ|t [ u 1 ] . . . [ u n ]|) = m(t).
So ms( h 1 ) < ms(t) and we can safely apply the inductive hypothesis obtaining h 1 = h 2 . Looking at the definition of h 1 , h 2 , we get h 1 = h 2 as well as

[ u i ] = [ v i ] (i = 1, . . . ,
] = [ v 1 ], . . . , [ u n ] = [ v n ], precisely means t = s.
The previous result was first proved by Ehrhard and Regnier in [START_REF] Ehrhard | Uniformity and the Taylor expansion of ordinary lambda-terms[END_REF] for the λ-calculus. It is known27 that it fails in MELL. A natural question is what is the threshold, between λ-calculus and MELL, where this property starts failing? This is a non-trivial question to which one does not have an answer yet, and it is important also because somehow linked to the possibility of defining a coherence on resource terms for which Taylor expansion is a maximal clique. We will mention this question in the conclusive Section 4.5. Proof. We have to show that T (H(M )) = t∈T (M ) H(t). By Lemma 4.4.2 we know that:

M = λ x 1 .µα 1 . β 1 |. . . λ x k .µα k . β k |RQ 1 . . . Q n ||
with the condition that either there is a ρ-redex in the head of M , or there is no such ρ-redex and R is not a variable (thus R is either a λ-redex or a µ-redex). We have just said in a different fashion that M is not a hnf. Now let us show the two inclusions.

(⊆). Take s ∈ T (H(M )). We have three cases:

Case in which there is a ρ-redex in the head of M . Therefore there is also a leftmost ρ-redex . . . β i |µα i+1 . . . .| in the head of M . Then:

H(M ) = λ x 1 .µα 1 . β 1 |. . . λ x i .µα i . β i+1 |. . . λ x k µα k . β k |R Q||{β i /α i+1 }|. So s = λ x 1 .µα 1 . β 1 |. . . λ x i .µα i . β i+1 |. . . λ x k µα k . β k |r[ q 1 ] . . . [ q n ]||{β i /α i+1 }| for r ∈ T (R) and [ q i ] ∈ ! T (Q i ). But T (M ) λ x 1 .µα 1 . β 1 |. . . λ x k .µα k . β k |r[ q 1 ] . . . [ q n ]|| =: t,
[ d])[ q 1 ] . . . [ q n ] | for a p ∈ T (P ), [ d] ∈ ! T (D) and [ q i ] ∈ ! T (Q i ). So s ∈ H(t), with t := λ x 1 .µα 1 . β 1 |. . . λ x k .µα k . β k |(µγ. η |p|)[ d][ q 1 ] . . . [ q n ]|| ∈ T (M ), i.e. s ∈ t∈T (M ) H(t).
Case there are no ρ-redexes and R = (λx.P )D. Exactly as above using Lemma 4.4.48.

(⊇). One can follow the exact same kind of argument as before: the fact that Taylor expansion preserves the structure of the term, plus Lemma 4.

Conclusive comments

In [START_REF] Laurent | On the denotational semantics of the untyped lambda-mu calculus[END_REF] Laurent studies the mathematics of (untyped) λµ-calculus via its denotational semantics; in this chapter we did it by developing a theory of program approximation based on Linear Logic resources. In particular, we proved that the approximation theory satisfies the "non-interference property", that it induces a sensible λµ-theory, and that it can be used as a tool in order to obtain the Stability property, the Perpendicular lines property, and thus the impossibility of parallel computations in the language. A first natural question immediately arises:

1. Can Taylor expansion allow to find new interesting properties that are not satisfied by the λ-calculus, but that are enjoyed by the λµ-calculus due to the presence of continuations (such as callcc)? It is usually a difficult task to conjecture new properties (interesting from a mathematical or programming point of view) of a language, and we do not have an answer to such question.

For future investigations, we believe that it would be interesting to integrate this approach with the differential extension of λµ-calculus defined in [START_REF] Vaux | The differential λµ-calculus[END_REF], in order to explore quantitative properties as well.

The following two questions are maybe the most significant:

2. Does it makes sense to introduce Böhm trees for the λµ-calculus? For instance, for the callby-value λ-calculus, the Taylor expansion has provided in [START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF] invaluable guidance for finding a meaningful notion of trees satisfying Ehrhard and Regnier's commutation formula; the same methodology could maybe be applied here. However, in [START_REF] David | Lambda-mu-calculus and Böhm's theorem[END_REF] it is shown that λµ-calculus does not enjoy Böhm's separation property. David and Py's counterexample could hence be an indication that, instead, Böhm trees are not a "good" notion for λµ-calculus. The best way of proceeding would be, in that case, to consider Saurin's Λµ-calculus [START_REF] Saurin | Böhm theorem and Böhm trees for the Λµ-calculus[END_REF] (see the end of Section 4.2). It was introduced precisely to satisfy Böhm's property and, as a matter of fact, in [START_REF] Saurin | Böhm theorem and Böhm trees for the Λµ-calculus[END_REF] Saurin proposes a definition of Böhm trees for his Λµ-calculus. This certainly constitutes an interesting starting point.

3. Does Λµ-calculus admit all the constructions of the present chapter? On one hand, many constructions we did in this chapter seem possible also in Saurin's calculus (for instance, Definition 4.4.6, but remember also the discussion in the line just above that definition), on the other hand we used the fact that the number of µ's in a term is the same as named subterms, for instance, in Remark 4.4.9. In general, one could wonder which one, between λµ and Λµ, should be the "canonical lambda-mu-calculus": from a prooftheoretical perspective λµ-calculus precisely corresponds to Parigot's CD-derivations, but Λµ-calculus satisfies more wishful properties (Böhm separation). Moreover, in [START_REF] Saurin | Standardization and Böhm Trees for Λµ-Calculus[END_REF], Saurin adapts usual techniques of λ-calculus to Λµ-calculus: he studies the notion of solvability, proves a standardization theorem and studies more in detail the notion of Böhm trees. A very interesting future direction of research would be, hence, to develop a theory of resource approximation for Saurin's calculus, and study its relation with his theory of "Böhm approximation".

In any case, we regard the fact that the Taylor expansion works so nicely in λµ-calculus -and this regardless of a notion of Böhm trees -as a a posteriori confirmation of the high power of this form of approximation.

There are at least two other interesting points in relation with strictly related areas:

4. In order to perform a deeper logical analysis, one should consider translations into Linear Logic. It is known from [START_REF] Laurent | Polarized proof-nets and λµ-calculus[END_REF] that λµ-calculus translates into polarized proof nets.

Taylor expansion for proof-nets is possible, but the construction can be complex: in fact one of the interests in directly defining a Taylor expansion for a certain "λ-calculus style" programming language (as we did for λµ-calculus, and as one does for λ-calculus) is precisely to avoid that complexity. In our case we have just shown that, at the end of the day, the theory of resource approximation for λµ-calculus can be developed with essentially the same methodology as in λ-calculus. This leads to asking what makes a Taylor expansion "easy", and should be considered in relation to the already mentioned "non-interference property" (Theorem 4.4.51) and the possibility of the existence of a coherence relation for which T (M ) is a clique. This motivates an investigation of the complexity of the definition of a Taylor expansion of a programming language/proof system, which may be related to the notion of connectedness of proof-nets, whose study starts in [START_REF] Guerrieri | Computing connected proof(-structure)s from their Taylor expansion[END_REF]. Such question should be considered in relation with the so-called problem of the "inversion of Taylor expansion" [START_REF] Guerrieri | Proof-net as graph, Taylor expansion as pullback[END_REF][START_REF] Guerrieri | Glueability of resource proof-structures: Inverting the Taylor expansion[END_REF] and the problem of "injectivity" of denotational models (in particular, the relational one) for Linear Logic.

5. As we have mentioned in Section 4.2, the λµ-calculus is not the only way of extending the Curry-Howard correspondence to classical logic. Another notable one is the already mentioned Krivine's classical realizability, which is a "machine to extract computational content from proofs + axioms" (for almost all mathematics, such as the one formalizable in ZF+AC, see [START_REF] Krivine | A program for the full axiom of choice[END_REF]). There are translations between λµ-calculus and Krivine's calculus, and vice-versa, so developing differential tools on λµ-calculus might be related to developing them in Krivine's setting: can one move the resource approximation and Taylor expansion from λµ-calculus to Krivine's realizability? What do the mathematical properties we found for λµ-calculus (such as Stability and PLP) say for Krivine's realizability? The same questions hold for the other systems extending the correspondence to classical logic. We believe that an investigation of those questions would be of a major interest.

Chapter 5

A miscellany of meditations

Plan of the Chapter

This final chapter is more peculiar than the rest of the manuscript and presents some reflections more than some results. It is organized in two geometrical "meditations" and one philosophical one, for a total of three sections:

1. Section 5.2.1 is a brief methodological discussion on the nature of the mathematics of λ-calculus, in particular with respect to the Scott topology.

2. Section 5.2.2 contains the presentation of a possible direction of future research, which is still incomplete and we only started to explore. The main observation is that the exact same notion of coherent space, very well known in linear logic, exists also in combinatorics/geometry under a different name. In particular, topologists study this kind of structures (the abstract simplicial complexes, in general) by means of (simplicial) homology: whence the idea of doing the same, but from a logically oriented perspective. As we will explain, this raises one main non-trivial question, which we tried (but did not clearly succeed) to resolve.

3. Section 5.3 is not of a mathematical content but of a philosophical one. We will present our viewpoint on the question of the "foundations of mathematics" -the question that in some sense gave birth to mathematical logic. Our reflection is mainly influenced by the crucial insights that computer science has made possible, and by the vision of Girard on logic.

Geometrical meditations

What about topology for λ-calculus ?

We want to discuss, in this section, the particular status of λ-calculus as a mathematical object. Indeed, the kind of mathematics one develops in this discipline is very different from the "standard" one1 . Thus, it is sometimes a misconception that λ-calculus does not enjoy a rich mathematical theory. This manuscript itself, which only considers a very small piece of the great number of works in λ-calculus, together with areas such as combinatorial algebras, λ-theories, denotational models etc, show that this misconception is false. Before further doing, let us give in the following pages some examples showing in which sense the mathematics related to it is particular.

A first example is what Barendregt in [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF] calls a "pathological algebraic structure". He refers to the fact that term-algebras of λ-theories never enjoy some natural properties "standard" algebraic object usually satisfy; namely, associativity of the product, and recursivity.

To that, we would add also another kind of "pathological" situation: one can associate each λ-theory with a group, called its Church group, and always in [Bar84, Chapter 21] it is proved that, for the more standard λ-theories2 these groups all trivialize, and for the more complex λ-theories3 these groups all come from some difficult constructions, which makes it not clear what one could use them for4 . So λ-calculus presents the unusual situation of an object which one is not able to study with the usual techniques (it is not associative nor recursive) and with which one is not even able to associate an interesting algebraic object (usually, a group).

There is another situation in which one is very tempted to consider some groups associated with an object, and this is when one has a topological space (the groups being the homotopy groups). Now, it is well known (see for instance [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF]) that Λ can be endowed with a nontrivial topology, called the Scott topology5 . This is possible since the set B of Böhm-like-trees is a "coherent algebraic cpo" (see [START_REF] Roberto | Domains and lambda-calculi[END_REF] for these known notions), and thus comes with its Scott topology of cpo's. One can immediately transfer it to Λ: the Scott topology on Λ is the smallest one that makes the map:

BT : M ∈ Λ → BT(M ) ∈ B
continuous (where the cpo6 B is endowed with its Scott topology).

The opens of the topology are thus the sets of shape:

BT -1 (O ∩ B Λ ) for O open in B. For instance, the set SOL ⊆ Λ of the solvables is open, since SOL = BT -1 {A ∈ B Λ | A = ⊥} and {A ∈ B | A = ⊥} is open in B.
It is known that Scott-topology on Λ is not T 0 . This is simply because any two terms M = N s.t. BT(M ) = BT(N ) cannot be separated by an open. When one has a non-T 0 space X, one usually wants to consider a T 0 space which is "essentially" the same as X. This is always possible by performing the simple Kolmogorov quotient KQ(X) of X, which is defined as the quotient space of X under the identification of all the points which have exactly the same open neighbours7 . In the Scott-topology on Λ, indistinguishable terms are exactly those who have the same Böhm trees, so KQ(Λ) = Λ/ = B . It is worth adding here that not only Λ/ = B is in bijection with B Λ -the latter has to be seen as the set of the canonical representatives of the equivalence classes of the former -but one can actually see by a simple computation that they are homeomorphic. In particular, thus, B Λ is T 0 and Λ is not homeomorphic to B Λ .

However, the obtained space still fails to be, e.g. Hausdorff. This is another kind of pathological situation, intended as being far from the usual spaces one is used to.

Remark 5.2.1. As a side remark, notice that using the Continuity theorem 3.5.34, together with the two following general properties of Kolmogorov quotients:

1. for topological spaces X, Y and continuous f : X → Y , if x ∈ X and y ∈ X are identified in KQ(X) then also f (x) and f (y) are identified in KQ(Y ).

KQ(X

1 × • • • × X k ) = KQ(X 1 ) × • • • × KQ(X k ).
one finds again the Monotonicity of Böhm trees on multi-hole contexts8 . In fact by Continuity of contexts, one can apply (1) to

C : Λו • •×Λ → Λ and obtain that if (M 1 , . . . , M k ) is identified to (N 1 , . . . , N n ) in KQ(Λ × • • • × Λ) = Λ/ = B × • • • × Λ/ = B , then C M 1 , . . . , M n is identified to C N 1 , . . . , N n in Λ/ = B .
One can give the following notion.

Definition 5.2.2. A point x in a topological space X is a compactification point iff x admits exactly one open neighbourhood in X (which, thus, must be all X).

The following are the typical topological features of Λ.

Proposition 5.2.3.

1. The sets O M,k := {N ∈ Λ s.t. N ≥ M (k) } for M ∈ Λ and k ∈ N, form a basis for the Scott topology. Therefore, Λ is second countable.

2. The set NF ⊆ Λ of all the λ-nf is dense in Λ.

3. M is λ-normalizable iff M is isolated. 4. M is unsolvable iff M is a compactification point.
5. Any term algebra Λ/ T of a λ-theory T (and in general any quotient of Λ) contains a compactification point (with the quotient topology).

Points 1-4 are well known and already appear in [START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF]. Point 5 is not written there, but it is trivial from point 4 since containing a compactification point is preserved by quotients. Indeed, let Ω be a compactification point of a space X, and let ∼ be an equivalence on X. Let q : x ∈ X → [x] ∈ X/∼ be the quotient map, which is surjective and continuous. Now if

O [Ω] is open in X/∼, then q -1 O Ω and it is open in X.
Being Ω a compactification point, q -1 O = X, and thus O ⊇ qX = X/∼. So [Ω] is a compactification point of ∈ X/∼.

As already mentioned, now that we have a topology on Λ, a typical question would be: "what is its fundamental group π 1 (Λ, M 0 )?" As far as we know, this question does not appear in the literature. It may be because the answer is immediate: in fact, consider the following undergraduate exercise. Proposition 5.2.4. If a space X contains a compactification point then X is contractible.

Proof. Let Ω be a compactification point of X and take the constantly equal to Ω map from X to itself. An homotopy between it and id X is by definition a continuous map F : X × [0, 1] → X (w.r.t. product topology) s.t. F (x, 0) = x and F (x, 1) = Ω for all x ∈ X. The following F does the work:

F (x, t) := x if t ∈ [0, 1 2 ) Ω if t ∈ [ 1 2 , 1]
. In fact, we only have to show that it is continuous: let O = X be open in X, and let us show that F -1 O = O × [0, 1 2 ). Being the latter an open in X × [0, 1], this will conclude the proof. The inclusion (⊇) is trivial by definition of F . For (⊆), take (x, t) ∈ F -1 O. If t ∈ [ 1 2 , 1] then O F (x, t) = Ω and, since Ω is a compactification point, O = X, which is not possible. So it must be t ∈ [0, 1 2 ), and this entails (x, t) = (F (x, t), t) ∈ O × [0, 1 2 ).

Therefore, the properties of contractible spaces immediately answer to our question:

Corollary 5.2.5 (Fundamental group of λ-calculus). Λ, as well as any of its quotients, is contractible to a point. Hence, Λ, as well as any of its quotients (in particular any term algebra Λ/ T of a λ-theory T ) is simply connected, i.e. it is path-connected and have trivial fundamental group π 1 (Λ) = π 1 (Λ/ T ) = { * }. More generally, it is n-connected for all n ∈ N, so all its homotopy groups are trivial (and the same for the quotients).

Despite the striking banality, we find that Corollary 5.2.5 deserves to be written somewhere, because when having a topological space it is always good manner to know what its fundamental group is.

We see here another manifestation of the fact that (Scott)-topology on λ-calculus is "badly behaved", at least if one considers it from a geometrical perspective. In fact, the Scott-topology should be better understood from the perspective of order theory. However, the "pathology" of the geometry seems to be caused by the presence of compactification points, which are exactly the unsolvables, so one could ask: is the geometry of the space of solvables still trivial/pathological? Does, in general, Λ contain "interesting" subspaces? Even if our guess, and maybe the one of the most of the researchers, is that one cannot find any interesting "standard" geometry in Λ, this should still be supported by concrete results -of which our Corollary 5.2.5 is an example.

To the list of "pathological" properties of λ-calculus, we can also add the fact that continuity of the contexts functions is componentwise, and that any denotational model must embed the function space into the object space9 . Longo imputes these last "pathologies" to the lack of attention to the notion of space:

The componentwise analysis of continuity, as Cartesian Closure of the intended categories, the weakness of the topology (T0 separation) ... are all symptoms of this "lack of attention" to physical space (and its cartesian dimension) which is typical of this theory. The sequentiality of (classical and intuitionistic) logical deduction is at the core of it. [...] Observe then that all its models force the strong isomorphic embedding that we considered as a paradigm of "being unrelated to physical space" (as dimension is a topological invariant): in any Cartesian Closed Category, a solution D of the equation X = X → X is such that D × D can be isomorphically embedded into D. Giuseppe Longo - [START_REF] Longo | Some topologies for computations[END_REF] Who says "space" says "geometry", and Longo observes that, indeed, while at the beginning of the XX th century physics became "geometrical", mathematical logic -and thus (theoretical) computer science -became instead "arithmetical".

In conclusion, we think that λ-calculus (and its term-algebras, λ-theories, Church groups etc) only reflects the mathematical properties that the notion of computation shows up, when modelled as such a functional programming language. We suggest that one should, instead, approach the peculiarity of λ-calculus10 as a point of interest: its real mathematical content has to be find somewhere else than, say, usual geometry; the fact that the computation, when expressed in this fundamental formalism, organizes in a certain kind of mathematics, different and less known than standard one, is interesting and actually gives motivation to investigate it.

What about the homology of the space of proofs?

This section begins with the observation that a coherent space is a particular case of the well known geometrical notion of abstract simplicial complex (Remark 5.2.13). It contains some incomplete observations and ideas which we had the occasion to quickly discuss together with Ehrhard, Manzonetto and Tortora de Falco.

We start by recalling the notions of abstract simplicial complex and the simplicial homology (a standard reference being [START_REF] Hatcher | Algebraic topology[END_REF]). Then, we explain in which sense we would like to bring this kind of techniques into the study of proofs in relation to denotational semantic; we will show how this raises the non-trivial question of choosing a right notion of morphisms in order to make the homology modules functorial; finally, we give some naive notions of such morphisms, which however fail, and we sketch a possible solution.

Interlude: abstract simplicial complexes and simplicial homology Definition 5.2.6. An abstract simplicial complex ("asc", for short) X is the data of a set |X| and a collection SX of finite non-empty subsets of |X|, such that:

1. {a} ∈ X for all a ∈ |X| 2. X is an initial segment of P * fin (|X|) w.r.t. inclusion.

Of course tha important point in the previous definition is 2), as an asc on a given web can be given either by declaring all its elements, or by declaring only its non-singleton elements.

We will always assume |X| to be at most countable.

Terminology 5.2.7. The set |X| is called the web of X and its elements are the vertices of X.

The elements of SX are the simplices of X. The dimension dim x of a simplex x = {a 0 , . . . , a k } of X is k, and a k-dimensional simplex is called a k-simplex for short. The dimension dim X of X is sup Definition 5.2.8. A sub-asc of an asc X is an asc X with web |X| s.t. SX ⊆ SX. The k-skeleton Sk k (X) of an asc X is the sub-asc of X whose simplices are the h-simplices of X with h ≤ k. The 1-skeleton of X can be seen as a graph and it is called the underlying graph of X.

Remark 5.2.9. Any asc X can be "geometrically realized" as a topological space11 Geo(X) inside R Card (|X|) . It is a standard and well known construction, which justifies Terminology 5.2.7. For example, ∆ 2 becomes the filled triangle on the vertices (1, 0, 0), (0, 1, 0) and (0, 0, 1) in R 3 , S 1 becomes its "border" and so on. Remark that this geometric realization "abuses of space", in the sense that, for instance, Geo(∆ 2 ) is a surface and so it can be already embedded in R 2 . Furthermore, the construction depends on an arbitrary enumeration of the vertices and on an arbitrary choice of the embedding in R n , so it is not canonical 12 . But we will not worry about these facts since we will only sporadically refer to it, and for the same reason we will not detail it.

The following is a standard construction. Definition 5.2.10. The barycentric subdivision bs(X) of an asc X is the asc with web |bs(X)|:= SX and whose k-simplices are the ⊆-totally-ordered {u 0 , . . . , u k } ⊆ SX.

One proves that Geo(bs(X)) ≈ Geo(X) (we mean homeomorphic).

Definition 5.2.11. A map f : |X| → |Y | is said to be simplicial iff it sends simplices of X to simplices of Y . Asc and simplicial maps form a category, denoted ASC. Remark that if f is simplicial, then dim (f x) ≤ dim x for all simplex x of X. If the equality holds for all simplex x of X, then f is said to be rigid. Definition 5.2.12.

1. A qualitative domain (qd for short) is a asc X s.t. for all D ⊆ SX directed13 w.r.t. inclusion, we have d∈D d ∈ SX.

2. A asc X is said to be flag iff any minimal (w.r.t. inclusion) non-simplex has cardinality 2 (we say that it is a "missing edge").

Theoretical computer scientists and logicians know very well the notion of flag complexes, as the following remark explains: Remark 5.2.13 (Coherent spaces).

1. Flag complexes can be equivalently defined by requiring Cl(Sk 1 (X)) ⊆ SX. Note that this means SX = Cl(Sk 1 (X)), since Cl(Sk 1 (X)) ⊇ SX holds for any asc. Equivalently, a flag complex can be defined by requiring that for all family {x i } i of simplices, if x i ∪ x j is a simplex for all i, j, then i x i is a simplex. Flag complexes are known in the realm of logic of programs as coherent spaces (cs for short), and this is the terminology we will employ from now on.

2. It is easily seen that a cs is a qd, but the converse is in general false.

3. If G is a graph 14 with vertices W , then Cl(G) forms a cs (still denoted by Cl(G)) with web W . Thus, G = Sk 1 (Cl(G)) (since they are graphs with the exact same cliques).

Remembering the definition of cs's, graphs and cs's are hence identified via the inverse bijections Cl(•) and Sk 1 (•).

Let us now recall the the notion of (simplicial) homology. It is a a powerful tool to study the geometry of asc's by looking at their "n-dimensional holes" via the means of a chain of modules. Its construction goes as follows.

Definition 5.2.14 (Oriented simplices). Let X be a asc. Let C k X be the free Z-module generated by the set of the (a 0 , . . . , a k ) ∈ |X| k+1 such that {a 0 , . . . , a k } ∈ SX. Define the set C k X of the k-chains of X as the set C k X quotiented under the identifications (a 0 , . . . , a k ) = (σ)(a σ(0) , . . . , a σ(k) ) (a 0 , . . . , a k ) = 0 if a i = a j for some i = j where 0 is the empty sum and σ ∈ S k+1 and (σ) = ±1 is the parity of σ. C k X hereditates a Zmodule structure from C k X. We still denote with (a 0 , . . . , a k ) ∈ C k X the image of (a 0 , . . . , a k ) ∈ C k X under the quotient map. We denote with -→ S k X the set of the k-chains of X with exactly one summand, that is, the elements of C k X with shape (a 0 , . . . , a k ). They are called the oriented k-simplices of X.

Each k-simplex x of X induces exactly two oriented k-simplices (except for k = 0, where it induces only one), and the choice of one of them intuitively corresponds to the choice of an orientation for x. So, concretely, a k-chain of X is a finite linear combination with coefficients in Z of k-simplices of X with a chosen orientation for each of them. That is, C k X is free with basis the set -→ S k X of the oriented k-simplices of X.

Proposition 5.2.15 (Boundary operator). Let X be an asc. There is 15 a unique linear map

∂ k : C k X → C k-1 X
called the k-boundary operator, such that for all oriented k-simplex (a 0 , . . . , a k ) ∈ -→ S k X one has

∂ k (a 0 , . . . , a k ) = k i=0
(-1) i (a 0 , . . . , a i-1 , a i+1 , . . . , a k ).

Proposition 5.2.16. We have

∂ k • ∂ k+1 = 0.
Definition 5.2.17 (Chain complexes). A chain complex on Z is the data of a sequence of Z-modules M k together with linear maps

• • • ∂ k+2 ---→ M k+1 ∂ k+1 ---→ M k ∂ k -→ M k-1 ∂ k-1 ---→ . . . such that 16 ∂ 2 = 0.
We just saw that chain-modules C k X and boundary operators ∂ k on an asc form a chaincomplex 17 on Z.

The following constructions are the starting point of homological algebra.

M k+1 M k M k+1 M k ∂ k+1 ϕ k+1 ϕ k ∂ k+1
Chain complexes on Z with chain maps as morphisms form a category, denoted ChainCpx Z .

15 This is not immediatly obvious due to the quotient operated in C k X. One has to show that the same map when defined on C k X is well-defined on the quotient. 16 Or equivalently, Im(∂ k+1 ) ⊆ Ker(∂ k ). 17 Actually, one can prove that in a certain sense the boundary operator is, modulo the sign ±, the only existing map forming a chain-complex with the sets of chains of an asc.

Remark 5.2.20. Every chain map ϕ = (ϕ k ) k∈N from a chain complexes M = (M k , ∂ k ) k∈N to a chain complex M = (M k , ∂ k ) k∈N induces linear maps:

H k ϕ : H k (M ) → H k (M )
setting for all k-cycles γ in M ,

H k ϕ(γ + Im(∂ k+1 )) := ϕ k (γ) + Im(∂ k+1 ).
That is, we have a functor:

H k : ChainCpx Z → Modules Z .
Remark 5.2.21. Thanks to the previous remark, a functor F from a category A to the category ChainCpx Z induces, by composition, functors 18

H k : A → Modules Z .
In algebraic topology, one often takes A = ASC and considers the k-homology Z-modules H k (X) of X defined by the chain-complex (C k X, ∂ k ) k of an asc X. The construction is the following:

Let f : X → Y a simplicial map. For all k ∈ N there is a unique linear map:

C k f : C k X → C k Y
such that for all (a 0 , . . . , a k ) ∈ -→ S k X one has:

C k f (a 0 , . . . , a k ) = (f (a 0 ), . . . , f (a k )).
One can easily see that one has the following commutative diagrams:

C k X C k-1 X C k Y C k-1 Y ∂ X k C k f C k-1 f ∂ Y k That is, the maps C k f form a chain map Cf from the chain complex (C k X, ∂ X k ) k∈N to the chain complex (C k Y, ∂ Y k ) k∈N .
Furthermore, one can prove that we have actually defined a functor:

C : ASC → ChainCpx Z setting CX := (C k X, ∂ X k ) k∈N and Cf := (C k f ) k∈N for a simplicial f : X → Y .
This entails that, for all k ∈ N, one has a functor:

H k : ASC → Modules Z .
The reason why we gave all these details about this standard constructions is, in addition to recalling them, because we would like to render the homology construction functorial in the same sense as the above functor. However, we are led to change the category ASC, and we have to find the "right" notion of morphism.

Getting denotational semantics involved

Coherent spaces are a particular case of asc's, therefore they can be realized geometrically and can be thought as concrete spaces inside R n . We can interpret LL within the coherent semantics, so a formula becomes a space inside R n and its proofs, which are cliques of the coherent space, become simplices of the space.

Let us see an easy situation. Take the usual encoding of booleans inside LL, that is, via the MALL formula Bool :

= 1 ⊕ 1. Write Bool &n := Bool & • • • & Bool (n times).
Consider Bool &2 . If we call {T 1 , F 1 , T 2 , F 2 } its web, then Bool &2 is given by the graph19 :

T 1 T 2 F 2 F 1
In order to see it as an asc, we have to take the cliques of the graph as simplices. So when realized geometrically, we get the circle S 1 modulo homeomorphism. Now consider Bool &3 . If we call {T 1 , F 1 , T 2 , F 2 , T 3 , F 3 } its web, then Bool &3 is given by the graph:

T 1 T 3 T 2 F 2 F 1 F 3
The maximal cliques of this graph are the 8 "faces of the octaedron", so when realized geometrically we get an empty octaedron, which is homeomorphic to the sphere S 2 . One can see that in general Bool &n is realized as S n-1 modulo homeomorphism.

Observe that in the previous examples, all the simplices of the asc Bool &n are "witnessed" by a proof of Bool &n , in the sense that any simplex is cointained in some proof. This is due to the fact that the 8 maximal cliques are exactly the interpretation of some proof. In fact, take to stay simple the case n = 3, and it is easy to see that in MALL there are exactly 2 3 = 8 cut-free proofs of Bool &3 , which are the following:

π ijk := 1 ax Bool ⊕ i 1 ax Bool ⊕ j Bool &2 & 1 ax Bool ⊕ k Bool &3 &
for i, j, k = 1, 2. Now, it is easy to see that, setting a h 1 = T h and a h 2 = F h for h = 1, 2, 3, one has π ijk = {a 1 i , a 2 j , a 3 k }, that is, the 8 faces of the octaedron. However, the fact that all the cliques are witnesses by a proof (in the previous sense) is due to the simple case we have considered.

In fact, it is not always the case: take for instance "Gustave's formula":

G := (1 ⊕ (1&1)) `(1 ⊕ (1&1)) `(1 ⊕ (1&1))
of MALL. If we call {⊥, T, F } the web of (1 ⊕ (1&1)) , then G has web |G|= {⊥, T, F } 3 . Let's call a 1 := (⊥, T, F ), a 1 := (F, ⊥, T ), a 3 := (T, F, ⊥) ∈ |G|. Now, it is easily seen that there are MALL proofs π 1,2,3 : 1 ⊕ (1&1) s.t. π 1 ⊇ {a 2 , a 3 }, π 2 ⊇ {a 1 , a 3 } and π 3 ⊇ {a 1 , a 2 }. So each of the previous 3 sets is an edge of G , and the definition of coherence space forces thus x := {a 1 , a 2 , a 3 } to be a 2-simplex of G , as one can in fact check. But one can also see that there is no MALL proof whose coherent semantics contains the whole x.

The property of being a cs can be thought as "synchronization" property: cs's are those asc for which, when one can "synchronize" a family of simplices (or of vertices) two by two, one can synchronize the whole family. From this point of view, the prototipical example of an asc which is not a cs, the simplicial cercle S 1 , can be thought as a three agents process synchronising any two of them but failing to synchronize them all three together. The previous example of Gustave's formula shows that, however, if we think to the "synchronization" as given by the proofs of a formula, then the situation is not faithfully reflected by the coherent semantics.

In order to have a faithful representation of the situation, one would be tempted to take as simplices the interpretations of the proofs of a formula A; of course this fails to give an asc 20 . But the problem is easily solved by "down-closing it" and consider the sub-asc [A] of A given by the web |[A]|:= |A| and simplices:

S[A] := {x ⊆ π | π : A}.
In [A], every simplex comes from a proof in the lax sense that it is a face of the interpretation of one (i.e. it is contained in it).

In the previous examples we have thus seen that S[G] S G , and S[Bool &n ] = S Bool &n . In the case of coherent semantics, to have S[A] = S A (that is, [A] = A ) is equivalent to the fact that every ⊆-maximal clique 21 is the interpretation of a proof.

It is important to remark at this point some aspects:

1. In the case of coherent semantics A is already a geometrical object -it is an asc itself -but because it is a cs, it does not show up a faithful geometry w.r.t. proofs. The quite natural definition of [A] "solves" this problem. Furthermore, the construction of [A] makes sense if • is any "webbed semantics" of LL, not just the coherent one. This two points suggest that [A] could be the "canonical" geometrical object associated with webbed semantics.

2. The meaning of the asc [A] is geometric, and we are not trying to construct a new denotational model of MALL. The idea is different: from a denotational interpretation A of a formula A we want to extract a geometrical object to study.

The asc [A]

is, of course, determined by the formula A, but only in the fact that (for a fixed system -here we took MALL) a formula determines its proofs, so [A] is really talking about the proofs of A. More precisely it provides the geometrical organisation of the interpretations of the proofs of A as an asc. Concretely, the information of the simplices of [A] comes from the proofs of A, and A alone would be not enough. In particular, the geometrical property of having or not "n-holes" (the "absence" of n-simplices), is determined by the existence or not of suited proofs. A more precise notation would therefore be something like [Proofs(A)], or if one wants to remember that the construction depends on a fixed denotational semantics for the proofs, we could write [Proofs Of course we will only use the simpler [A] but one has to remember that what we are really considering is the geometry of the space of the proofs of A.

We already said that a powerful tool to precisely study asc's is simplicial homology. A first natural request would be that homology modules be type-isomorphism invariants. Since homology, when induced by a functor, is a functor itself (Remark 5.2.21), if we can have this property, then we automatically obtain that whenever there is a type isomorphism there is an isomorphism of homologies. This is a basic property that we want to require.

However, we face a problem: what should we take as morphisms between asc's? In topology one takes simplicial maps, but in denotational semantics one typically works with relations instead of functions. It is not clear how to make homology a functor w.r.t. to a "relational based" notion of morphism.

In the following we quickly give some quite natural tries, which however all fail. Only the last one succeeds in giving raise to a functor, and thus we have the isomorphic homologies for isomorphic types (Corollary 5.2.26), but the price to pay is that we need to modify the space [A] via a certain monad I (Definition 5.2.23). We will comment on that after Corollary 5.2.26 till the end of the section.

Relational semantics? The easiest way of interpreting LL is the relational semantics, so let us try with it.

Relational semantics interprets a type A as a set A and a proof π : A B as a subset π ⊆ A × B . We can thus send A to the (easily checked) asc [A] := {x ⊆ ρ | ρ : A} with web |A|, and one easily sees that π ⊆|A| × |B| satisfies the following "simplicial property":

π • σ ∈ [B] for all σ ∈ [A] where π • σ is the image of σ through the function π • (.) : |A|→ [B] defined by π • a := {b ∈| B| | (a, b) ∈ t}.
The idea is to take as the new category from which start the constructions, the category RelASC of asc's as objects, and morphisms given by:

RelASC(X, Y ) := {t ⊆|X| × |Y | | t • σ ∈ Y for all σ ∈ X}
where of course t • σ is defined analogously as before. The natural choice for C k t : C k X → C k Y is then to extend by linearity the following association:

C k t(a 0 , . . . , a k ) := ( a, b)∈t ⊗(k+1) (b 0 , . . . , b k ) where t ⊗(k+1) is the relation 22 {( a, b) ∈ |X| k+1 ×|Y | k+1 | (a i , b i ) ∈ t for i = 0, . . . , k}.
This construction has two crucial problems: first, (C k t) k is not a chain map, and second, it is not functorial. Just one of them is enough to invalidate the construction we are looking for, but let us see the reason for both of them:

-Non chain map: it does not commute with borders. In fact, take X = S 1 (with web {a 0 , a 1 , a 2 }) 23 , Y = ∆ 2 (with web {b 0 , b 1 , b 2 }), and the morphism t from X to Y given by the set

{(a 0 , b 0 ), (a 0 , b 1 ), (a 1 , b 1 ), (a 2 , b 2 )}. Now it is easily seen that ∂ 1 (C 1 t(a 0 , a 2 )) = 2(b 2 ) -(b 0 ) -(b 1 ) while C 0 t(∂ 1 (a 0 , a 2 )) = (b 2 ) -(b 0 ) -(b 1
). This would be enough, but just to mention it, let us say that also on (a 0 , a 1 ) we don't have a commutation:

∂ 1 (C 1 t(a 0 , a 1 )) = (b 1 ) -(b 0 ) while C 0 t(∂ 1 (a 0 , a 1 )) = -(b 0 ).
-Non functoriality: take asc's X,Y ,Z with X containinig a vertex a, Y an edge {b, b } and Z a vertex c. Now take s := {(a, b), (a, b )} ∈ RelASC(X, Y ) and t := {(b, c), (b , c)} ∈ 22 Or, equivalently, we can require b0 ∈ t • a0, . . . , b k ∈ t • a k . 23 We could also take X = ∆ 2 .

RelASC(Y, Z). If C is a functor from RelASC to ChainComplexes

Z , then C 0 (t • s)(a) = C 0 t(C 0 s(a)). But one can check that C 0 (t • s)(a) = (c) and C 0 t(C 0 s(a)) = 2(c).
The problems seem to be related to the fact the relational sematics is qualitative and not quantitative. So let us try with a quantitative one.

Matrix semantics? Matrix semantics interprets a type A as the relational semantics, and a proof π : A B as an integer matrix on |A| × |B|. Here by "integer matrix on a cartesian product S × S of sets" we mean a function t : S × S → N. We won't bother say "integer matrix" but just "matrix". Let us set some notations: we write t ab for t(a, b) and t a : S → N for the curried function t a (b) := t ab . So the idea is to take as MatixASC the category of asc's and morphims given by:

MatixASC(X, Y ) := {t matrix on X × Y | a∈σ support(t a ) ∈ Y for all σ ∈ X}.
The identities are the diagonally 1 matrices, and composition is matrix composition. Now the natural choice for C k t : C k X → C k Y is to extend by linearity the following association:

C k t(a 0 , . . . , a k ) := (b 0 ,...,b k ) k i=0 t a i b i (b 0 , . . . , b k ).
But this fails to form a chain map. In fact, consider the following counterexample: take X = Y = S 1 (or also ∆ 1 would work) with vertices {a 0 , a 1 , a 2 }, and take t ∈ MatixASC(X, X) the following matrix:

a 0 a 1 a 2 a 0 1 0 1 a 1 0 0 1 a 2 1 0 0
It is a simple verification that one has:

C 1 t(a 0 , a 1 ) = det(t {a 0 ,a 1 }×{a 0 ,a 1 } )(a 0 , a 1 ) + det(t {a 0 ,a 1 }×{a 0 ,a 2 } )(a 0 , a 2 ) + det(t {a 0 ,a 1 }×{a 1 ,a 2 } )(a 1 , a 2 ) = (a 1 , a 2 ) so ∂ 1 (C 1 t(a 0 , a 1 )) = (a 2 ) -(a 1
). But one also can check that:

C 0 t(∂ 1 (a 0 , a 1 )) = (t a 1 a 0 -t a 0 a 0 )(a 0 ) + (t a 1 a 1 -t a 0 a 1 )(a 1 ) + (t a 1 a 2 -t a 0 a 2 )(a 2 ) = -(a 0 )
and thus the C k t do not commute with borders.

The problem seems to be related to the fact that we don't have any constraint on the morphisms. So let us try to impose them in the following way.

Relational semantics with coherent semantics? A possible attempt could be to "mix" together the relational and the matrix semantc, in the following sense: Composition is usual relational composition24 and the identities are the diagonal relations.

The natural way is to define C as in the relational semantics case. But this fails again to be a chain map, because we can reproduce the same exact couter example of that case, just taking for X the asc X = S 1 and coherence the trivial one (only the singletons are coherent with themselves) 25 , and for Y take Y = ∆ 2 with coherence given by b 0 b 1 (plus the trivial coherences, that is, the one on the singletons). Now the same exact t of the relational semantics' case counterexample is a well defined simplicial clique from X to Y and the computations showing that C does not commute with the borders are exactly the same.

A possible solution: transform relations into maps via monads? Remember that we defined the category RelASC as the category whose objects are the asc's and whose morphisms are the simplicial relations. It is immediate to check that the previous definition makes sense.

Proposition 5.2.24. The endofunctor I forms a monad on ASC with unit ε : id ⇒ I and multiplication µ : I 2 ⇒ I whose components are respectively: ε X : |X|→ SX given by: ε X (a) := {a} µ X : SIX → SX given by: µ X (U ) := u∈U u.

Proof. Firstly, let us see why ε X ∈ ASC(X, IX) and µ X ∈ ASC(I 2 X, IX). For ε X , take a simplex u of X. Then ε X u = {{a} | a ∈ u} ⊆ * fin SX and thus ε X is simplicial because ε X u is a simplex of IX since a∈u {a} = u ∈ SX. For µ X , take a simplex U of I 2 X. Then µ X U = Proof. It is easily checked that (•) + is well-defined. Let's show that it (•) + is functorial. The verification of (id X ) + = ε X is immediate. Remembering that the Kleisli composition t + • I s + of two Kleisli morphisms t + ∈ RelASC(Y, I Z) and s + ∈ RelASC(X, I Y ) is by definition µ Z • It + • s + , the verification of (t • s) + = t + • I s + is the following simple computation:

(t + • I s + )(a) = µ Z (It + (s + (a))) = b∈s + (a) t + (b) = {c ∈ |Z| | ∃b ∈ |Y | s.t. (a, b) ∈ s, (b, c) ∈ t} = (t • s) + (a).
Finally, let us show that (•) + gives an equivalence of categories. It is immediate that it is faithful and essentailly surjective. To show that it is full, it is immediate to see that if g ∈ ASC I (X, Y ) then g = g + where g ∈ RelASC(X, Y ) is the graph relation of g.

We have thus the following situation (where we call Mod Z the category of Z-modules):

RelASC ASC I ASC ChainCpx Z Mod Z (•) + ∼ = R I C H k where R I is part of the Kleisli adjunction L I R I . That is, R I X := IX and R I f := µ Y • If .
Therefore, we immediately have the desired property that we have been looking:

(I [A]) ∼ = H k (I [B]) for all k ∈ N.
A brief discussion is needed here. We declared that our interest is the study of the geometry of [A], which being an asc is quite natural to tackle by regarding its homology. Because of our constraint to take simplicial relations as morphisms instead of simplicial maps, we find ourself able to talk in a satisfactory (functorial) way about the modified asc I [A]. The question is thus what is the relation between IX and X, or at least between the geometry of IX and that of X, for whatever "geometry" could mean.

For instance:

Proposition 5.2.27. If X is non-trivial (trivial being a point), bs(X) is a strict sub-asc of IX.

Proof. The inclusion is clear: if σ is a simplex of bs(X) then (since σ is totally ordered w.r.t. inclusion) u∈σ u coincides with some u ∈ σ, which is a simplex of X by definition of bs(X).

To see that it is a strict sub-asc, take the segment ∆ 1 (call its web {a, b}). Then a := {a} and b := {b} are simplices of ∆ 1 s.t. a ∪ b ∈ S∆ 1 , thus { a, b} is a simplex of I∆ 1 . But it is not a simplex of bs(∆ 1 ) because a b nor the other way around. If now an asc X is not a point, then it contains at least a ∆ 1 as an edge, so IX strictly contains bs(X).

It is instructive to visualize some examples

: ∆ 1 = a b bs(∆ 1 ) = a b {a, b} I∆ 1 = a b {a, b} = ∆ 2
We immediately remark something: IX makes the dimension grow. This means that in general, the geometric realisations are not homeomorphic: Geo(IX) ≈ Geo(X).

One can easily see that in general we have:

I∆ n = ∆ (2 n+1 -1) .
The following is an interesting example too: We remark something about all the previous examples (both the cases X = ∆ n and X = S 1 ): even if bs(X) = IX and even if their geometric realizations are not homeomorphic, we still have that Geo(IX) retracts onto Geo(bs(X)) ≈ Geo(X). Therefore, in this very simple cases, the homology of X and of IX remains the same. However, it is not clear what happens in more complex cases. We think that, if one had H k (IX) = H k (X) in general, this should be possible to show by considering X = S 2 . If the inequality above does hold, then it would require to understand if the study of this geometrical object IX still makes sense (does it have some geometrical interest? Does it carries some interesting computational/logical properties?). On the contrary, if our conjecture is false, then the homology is invariant under I, and so we have achieved our first goal of constructing a space ([A]) whose homology is invariant under type isomorphism.

Philosophical meditations: what about the foundations of mathematics?

We organize our reflection in three steps:

-First, we give a quick presentation of the traditional viewpoint under which mathematical logic is usually considered. In particular, we highlight the points of unsatisfactoriness in it, that can be found in the notion of truth and coherence, when one charges them with a too important foundational relevance.

-Then, we present (our understanding of) Girard's philosophical proposal known as "transcendental syntax", which precisely moves from the mentioned unsatisfactoriness in order to find a deeper point of view, incorporating ideas from computer science.

-Last, we present our proposal organization for some "foundational activity", a central idea being Kant's transcendental method.

The traditional ideology and the questions of logic

Tarski and the problem of truth Mathematical logic is for the most understood from the point of view of analytical philosophy 26 , as that was the one of two of the main father founders of discipline: Frege and Russel. A central role is played by the dichotomy syntax/semantics, which is understood as "language/reality". Logic is supposed to extrapolate the formal aspects of reality, as it can be seen in Russel's famous quote: [...] logic is concerned with the real world just as truly as zoology, though with its more abstract and general features.

-Russel, Introduction to Mathematical Philosophy (1919) The mean which controls the distinction syntax/semantics is identified with the notion of truth, that is, accordance with reality. This vision is accompanied by a clear and unambiguous distinction between "subject/object", which is another way to usually look at the dichotomy syntax/semantics, and this philosophical point of view is close to what is usually called essentialism. This approach is reflected, for instance, in the so-called philosophical logics, and in general in the so-called Tarski's definition of truth -which is just the name for a simple mathematical construction. This approach (which constitutes the main philosophical conception in most of logic departments) has shown to be valid, from a certain point of view: typically, model theory has proved to be a valid branch of mathematics, with its own problems and its own mathematical reason of being; we also find the very idea of "interpreting syntax in some mathematical structure", even if in a slightly different taste, behind the notion of denotational semantics of programs. The arguably most important achievement of the "essentialist" point of view is the notion of Turing machines27 , which constitute the first model of computer.

However, considered as a philosophical position on the question of foundations, we tend to consider this traditional approach quite limited, for basically the following two reasons:

1. The notion of truth playing the role of ultimate justification is of dubious foundational relevance, as expressed by Girard's doubts:

La vérité est de fait une notion rebelle à toute analyse, car elle commute à toutes les opérations logiques (A ∧ B est vrai ssi A et B le sont, ¬A est vrai ssi A n'est pas vrai etc.) et en particulier toute justification des principes mathématiques par leur vérité est grandement suspecte.

-Girard, [START_REF] Girard | Du pourquoi au comment: la théorie de la démonstration de 1950 à nos jours[END_REF] What is achieved in this way is in fact a form of translation from a language to another, so that the relation is more language/language than language/reality. Remark that "translations" are useful: for example, programs are compiled28 in executables, and this exactly means translating a program from a language to another. Another value of the dominant point of view is that of the "justification" of the different formal systems. By "justification" we mean the arguments supporting the fact that some formal system is worth the study, or not, just like one does in applied mathematics when deciding what model to use for a specific situation. Typically, one justifies predicate calculus as "abstract zoology of boolean operations on non-empty sets"29 ; or we can justify modal logics as a way of formally dealing with our concepts of necessity and possibility, and similarly for other philosophical logics; we can apply temporal logics in formal verification; we can also say that linear logic is the logic "of automatic coffee machines"30 .

But we would say that this approach places this disciplines more in the realm of applied mathematics -for it provides a mathematical model of some phenomenon -rather than answering some foundational quest. In general, we tend to agree with Dummett's conception:

If to know the meaning of a mathematical statement is to grasp its use; if we learn the meaning by learning its use, and our knowledge of its meaning is a knowledge which we must be capable of manifesting by the use we make of it: then the notion of truth, considered as a feature which each mathematical statement determinately possesses or determinately lacks, independently of ours means of recognising its truth-value, cannot be the central notion for a theory of the meanings of mathematical statements [...] -Dummett [START_REF] Dummett | The philosophical basis of intuitionistic logic[END_REF] 2. In general, this approach proposes a quite simplistic vision on the "logical activity", on the lines of the -nowadays surpassed -vision of the physics of the absolute space and time, and of the ultimate "objective" reality (in contraposition with the "subjective" reality of the relativistic world and the "non-reality" of the quantic world). One could reasonably expect that, like physics, also logic needs a renewing of its foundational paradigm. As a matter of fact, a "truth-based viewpoint" is not able to satisfactorily take into account the activity one does in some parts of proof-theory/computer science (mainly in relation with linear logic). It is interesting to notice, as Abrusci does 31 , that a purely essentialist vision is also in discrepancy with today's state of computer science, which is much more a matter of nets (typically, internet) and interaction between entities (the hosts of the net) which can play both the role of subject and object, rather than a matter of singlemachine-computation on data as in Turing's conception -dating back to before computers existed. There is also another hint: Kant's analysis of (transcendental) logic shows how relevant it is to carefully consider the subject's "action" on the object. And to consider the action of the subject on the object we are studying exactly means to reconsider the duality syntax/semantics.

In conclusion, the traditional approach (and all its "products") are not "wrong"; they should simply not be considered as providing a satisfactory foundational paradigm, and their interest should be measured only with respect to the concrete results they allow to find in the respective areas, just like one does for other mathematical modelings. We believe that what we need is not a negation of the traditional point of view, just like XX th century physics is not the negation of the physics before it: it is its surpass, in the Hegelian sense of aufhebung.

Hilbert and the problem of coherence In Hilbert's formalistic vision of mathematics, mathematics is divided in two parts: the finitist one and the ideal one. The two are linked via the fascinating idea that the ideal mathematics is to finitist mathematics as points to infinity in projective geometry are to standard geometry, or as imaginary numbers are to the reals: it is there, basically for convention and utility, in order to "complete" the discipline and make it "better functioning". Also, in Hilbert's vision, finitist mathematics is nothing but a meaningless game of symbols. This raises the question of which one, among all possible games of symbols (that is, formal systems), one should use in order to represent mathematics; Hilbert's answer was basically "anyone which is coherent" (and powerful enough).

Let us say we take PA (first order Peano's arithmetic) as formal system. Now Hilbert's program could be resumed as follows:

Each of the previous points 1-6 motivated, in a sense, the very birth of mathematical logic as well as all its most important developments. However, as it is well known, his program fails and his vision is wrong: Gödel's second incompleteness theorem says that, if PA is really coherent, then such a proof as in (3) cannot exist 33 . Gödel's second incompleteness theorem, together with Gentzen's proof of the coherence of PA based on transfinite induction, says that (4) is false. Gödel's first incompleteness theorem says that (5) is false. Turing's and Church's undecidability of the Halting Problem, or the undecidability of first order predicate calculus, say that (6) is false.

We are left with [START_REF]An assumption: if PA does not derive ⊥, then arithmetic is coherent[END_REF], which is generally accepted, and (2) which, at least for some interesting parts of mathematics, is completed. But we have lost the "absolute" certainty of the coherence of mathematics and of arithmetic.

Furthermore, Gödel's results also imply that Hilbert's suggestion that any (sufficiently powerful) coherent system would do to represent mathematics, is false. Coherence loses thus its role of the only "light" of logic: not only it is necessary reduced to relative coherence -and so cannot be established once and for all -, but it is not even reliable for what concerns arithmetic; there are in fact coherent theories which derive false arithmetical statements, such as T + ¬G T (where G T is a Gödel's formula for a coherent theory T under the hypothesis of the theorems), deriving the arithmetically false statement ¬G T . Therefore, we tend to consider the question of the coherence of "all" mathematics as less important than one would expect. On one side, even if we know that there are contradictions in informal mathematics 34 , those never appear in the practice; also, there are interesting formal theories which are proven to be coherent (and/or complete). On the other side, from a mathematical point of view, modern developments of proof theory show that the internal structure of the systems is already a valid object of study, and this even if the system is contradictory. Of course, coherence still remains an important question in some circumstances: for example, one would hope the kernel of a proof assistant to be coherent.

The questions of logic

We have seen how the two main possible sources of foundational certainty -truth and coherence -on which mathematical logic (and thus mathematics) has been linked to in the last century, and which still constitute the main point of view of the most of mathematicians and logicians, actually fail in their foundational role.

What are, then, the questions of logic? Were the foundational questions of mathematical logic only the ones of truth and coherence? The answer is of course, no.

Take for instance Kant's question:

How is mathematics possible?

It certainly is an interesting foundational question, and we would say it belongs to logic. Since it deserves a philosophical investigation rather than a mathematical one, we will omit it in the following pages. Other interesting questions -which sound extremely modern today -were expressed by the neo-Kantian Mouburg school:

How do we know that the logical laws are true? How do we know that the concepts that they isolate are the fundamental concepts of logic, and how do they [Frege and Russel] know that their basic laws are in fact properly basic? -Natorp, 1910 33 We mean a proof of the formula "naturally" expressing, in PA, the coherence of PA. 34 See the ones mentioned in Section 1.3.

In virtue of what do the logical laws have content, as opposed to being just empty symbols? -Cassirer, 1907

As the name "neo-Kantian" suggests, with no surprise they proposed a transcendental approach to those questions.

The two previous questions suggest a point of view surprisingly close to the one of Girard, both in the fact of believing in the relevance of a transcendental approach, and in the fact of questioning the status of the logical "laws" in themselves, a priori from the notion of truth. For instance, today we can nicely answer to some of those questions: we now know that modus ponens is in fact not properly basic, due to linear logic's decomposition A → B = (!A)

B. We also we know that, for say MLL, logical "laws" have content in virtue of graph theoretical properties (such as the Danos-Regnier criterion), and this is what differentiates them from empty symbols.

Remark that, from the traditional point of view, those questions essentially trivialize: everything reduces to saying that logical laws are true because they preserve truth 35 , and that what differentiates them from being empty symbols is precisely the fact that they preserve truth.

Last, let us mention an important notion, not central in the traditional viewpoint: the very notion of proof. Some important questions about this notions are:

In which sense a proof is a finite object? How is it possible that a finite object gives us certainty about the infinite? This certainty cannot be absolute (due to incompleteness). So it is relative: relative to what? -Girard [START_REF] Girard | Transcendental syntax 2.0. Notes du cours donné à[END_REF] Traditionally, proofs do not appear with the same level of "foundational importance" as truth or coherence, because they are only seen bureaucratic artefacts in order to find out (when such bureaucratic artefact can be constructed) if the value of a proposition is "1" or "0". A more exciting way of saying that the logical laws preserve truth, would be saying that a proof is a "way of propagating truth", and this all of a sudden sounds much more modern if we state it as "a proof is like a circuit in which some information propagates". The study of proofs then becomes then the study of the properties of such a circuit36 , or the study of the propagation itself37 , or, thanks to the Curry-Howard correspondence, the study of it as a computational object.

It would not be wise to say that those are the only questions of logic. Nevertheless, we believe they are some mathematically and philosophically important questions of logic andemploying a recurrent slogan of Girard -they really shift the logical interest from the "rules of logic" to the "logic of rules".

Girard's trascendental syntax: between Kant and computer science

Girard has, in the last 20 years, proposed a sort of new conceptual setting for conceptually organising logic (and in particular proof theory). We find it of relevant foundational value. As already mentioned, we assist to a change of the perspective on the whole discipline:

[...] we are led to consider the opposition between syntax and semantics as an obsolete legacy of the XIXth century : in particular the traditional logical issues of logic -completeness and soundness -should be completely revisited.

-Girard [START_REF] Girard | On the meaning of logical rules I: syntax versus semantics[END_REF] How should we handle, then, the questions of logic?

My thesis is that the meaning of logical rules is to be found in the well-hidden geometrical structure of the rules themselves : typically, negation should not be interpreted by NO , but by the exchange between Player and Opponent.

-Girard [START_REF] Girard | On the meaning of logical rules I: syntax versus semantics[END_REF] And with which methodology? [...] l'expression magique conditions de possibilité, si l'on préfère transcendantalisme, est la clef qui ouvre les serrures obstruées par un bon siècle de décervelage scientiste.

-Girard [START_REF] Girard | Titres et travaux[END_REF] Thus, as it was already clear to the neo-Kantians one century ago:

[...] il est nécesssaire de comprendre la part de nous-mêmes dans les objets que nous étudions, d'où l'invocation de Kant. [...] Bien sûr, il ne faut pas compter sur Immanuel pour répondre à notre place : rappelons que ces questions n'avaient aucun sens précis il y a 25 ans.

-Girard [START_REF] Girard | La syntaxe transcendantale, manifeste[END_REF] The program he launched, called "transcendental syntax", is meant to be both philosophical and technical. However, we believe that the core of the matter has to be found first of all in the philosophical aspects, which are those we are going to develop in this section 38 .

Girard's knitting The basic idea is to organise the logical activity in some "cases", reminiscent of the Kantian table of judgements. Let us say that we are dealing with "entities" (in an explicitly vague sense) that can "interact" (in an explicitly vague sense) with each other 39 . There are four ways of describing such a situation: Via an ascertainment 40 : that is, a self-contained description of each of the entities. Via a performance: that is, a self-contained description of how the interaction of each entity goes.

Via an usine: that is, organising the entities w.r.t. to behaviours which are possible to check in an effective manner.

Via an usage: that is, giving all the possible interactions.

For example, in a net of machines, one may say that: an ascertainment is a description of the hardware of each machine; a performance is a description of the software of each machine; an usine is given by the routing tables; an usage is a description of all the possible "states" of the net.

We can group the four previous modes as follows: 38 Girard's texts are often as fascinating as difficult to understand, so what follows is our conception of the matter. 39 The image of a network of computers here is useful. 40 "Constat" in french. "Ascertainment" is the most similarly meaning word in English we could find.

1. An analytic description is one in which we give an internal description of each entity (ascertainment and performance). That is, one considers the system as the mere addition of entities.

De ce point de vue, A et ∼A ne sont que des lieux où pourront, éventuellement, se manifester les partenaires. S'il s'agissait [he is talking about the formula A`∼A] d'une rallonge physique, il faudrait imaginer un fil nu que l'on branche au moyen d'épissures. Rien ne nous empêche donc de mettre l'appareil du côté A et la source du côté ∼ A. Avec, en perspective, de réjouissants incidents: court-circuits, électrocutions et incendies.

-Girard [START_REF] Girard | Schrödinger's cut[END_REF] 2. A synthetic description is one in which we give an external description of each entity (usine and usage). That is, one considers the system as a whole new entity (of a different kind).

C'est le mode d'emploi, le surmoi qui régule le ça analytique. En logique, ce surmoi est représente par des énonces, des textes pédants, des règles qui restreignent, in fine, les branchements licites.

-Girard [START_REF] Girard | Schrödinger's cut[END_REF] One could ask why use Kant's terminology. The answer is that, in a sense, this it is related to Kant's table of judgments41 , with his famous definitions:

-analytic judgements are those for whom all the concepts present in the predicate already appear in the subject; -synthetic judgements are those which are not analytic.

From a different viewpoint, we can also consider the distinction syntax/semantics as an instance of the distinction analytic/synthetic: syntax is just "raw information", while semantics is raw syntax plus some meaning.

The typical ascertainment is the result of a computation, considered together with the program which did it42 (or also a program which is "not meant to be executed"). It cannot be questioned, nor taken to mean something, it is just there and that is it43 .

A program "meant to be executed" can be regarded as a performance, since it describes the way it manipulates (read: "interacts with") its argument.

The types in a typed computation can be regarded as usine. The typical usage is the infinity of all the possible ways one can use a program.

Girard usually resumes this as saying that "analytic is the space of the meaningless", and "synthetic is the meaning".

We would say that a useful everyday-life example is provided by dialogues: take for instance a correspondence between Abelard and Heloise; in answering to Abelard's question, Heloise sends analytic information; in sending the question to Heloise, Abelard also fixes a format for answers he is expecting the answer to respect; in receiving Heloise's answer, Abelard structures it (if possible) inside the fixed format. For instance, if Abelard asks Heloise if she knows the time, he expects the answer to be of the form: "yes, it is ...", or of the form: "no, sorry". If her answer is different, this raises an error (typically caught by Abelard repeating the question).

This example helps understand what Girard means when he says that "analytic corresponds to answers" and "synthetic to questions". Typically, when the notions of typed/untyped make sense, one has: "analytic = untyped", "synthetic = typed". For example, this is the case for the duality proof-structures/proof-nets, or untyped λ-calculus/simply typed λ-calculus.

The synthetic usually comes with an element, the format. It typically corresponds to formal systems, and its nature is particular. In fact consider Berry's paradox44 : the usual solution to the contradiction consists in preventing it to happen by using two different meanings of the verb "to define": when we say that b is "defined" by those 12 words English sentence that is the informal meaning of "to define" we are using; when inside the English sentence we say that b cannot be "defined" in less than 12 English words, that is some fixed formal meaning we are using, which does not include the informal one. Now, we can regard the paradox as saying that if we want to "rigorously ask questions" (which is the heart of what we do in mathematics), then some format is necessary (if we do not want contradictions); but most importantly, the fact that the intuitive meaning of "defined" cannot be included in the format, indicates that a "well-behaving format" cannot answer everything (here we lose the answer to the question "is b defined in the intuitive sense?"). This is not just a pointless remark: this aspect of Berry's paradox can be seen as a primitive manifestation of the phenomenon of incompleteness. In fact, the systematic existence of an undecidable formula inside a certain "well-behaving" formal system, can be understood as the fact that not only outside of the format -as for the intuitive notion of "defined" -but also inside the format, the presence of the format itself prohibits one to answer any question (even if one can ask it). This is why Girard often compares the format to a turtle shell: necessary for surviving, but uncomfortable.

Let us synthesize all we said with the "conceptual" table in Figure 5.1, which has to be thought of as a sort of refinement of Kant's renowned table, with the new ingredient of computer science (which of course Kant did not dispose of). The collocation of the different modes in the explicit/implicit column is obtained thinking of the explicit as something effectively given, while implicit is the rest. This corresponds to Kant's a posteriori/a priori in some sense.

Explicit Implicit Analytic Ascertainment Performance Synthetic Usine Usage

A posteriori A priori Analytic / Analytic a priori Synthetic Synthetic a posteriori Synthetic a priori Remark, however, that Girard's knitting should not be applied to a theory of knowledge, as Kant's table. The prototypical situation of application is linear logic, since all those considerations were first made possible by linear logic. In general, its typical realm of application, and of all the transcendental syntax which rounds around it, is the theory of proofs and programs. We will clarify that in the next Section 5.3.3.

There is a natural question: can the implicit be always effectively reduced to the explicit? This specializes in the following two questions: Can any performance be effectively given by an ascertainment? Does it always exist an usine which guarantees the usage? Remark that, in the second question, we are asking for an adequacy of the usine w.r.t. usage, i.e. that usine guarantees (or justifies) the possibility of usage. If we now remember that usage is the synthetic a priori, we see that from this point of view a major preoccupation of logic is that of the justification of the synthetic a priori, just like in Kant it was the major one for the theory of knowledge. However its justification, that is its conditions of possibility, now is given (when possible) by the usine, corresponding to the synthetic a posteriori, and which gives only sufficient conditions by no means necessary; this a point of departure with respect to Kant 45 .

Looking at some old questions through this new perspective

In some cases, one can explicit a performance. And in some cases there is adequacy between usine and usage: for example, a simply typed λ-term of type Int → Int, when applied to any Int necessary computes a normal form of type Int. Analogously for proof nets (for which the usine is the correctness criterion -which is decidable). However, Turing's 1936 result and Gödel's incompleteness theorems say that, in general, the previously mentioned questions of the analytic and of the synthetic have negative answers.

What does the notation "A

B" mean? This could look like as a naive "beginner student" question, as one immediately answers: "it means that under the hypothesis A, one gets B", that is, it is implication. So one could ask why bother introducing a new symbol in addition to "→", but after a certain time one becomes accustomed with this notation and stops questioning it: it is just a notation for expressing the hypotheses, and it turns out that it is the same thing of implication. Of course this is not false 46 . But we find it not satisfying; a more exciting way of dealing with this question is to say that, conceptually speaking, A B is the implicit version of the implication, while A → B is the explicit version of it. This comes with the fact that the cut-rule, which brings dynamics/computation -so it represents the implicit -applies on A B, while A → B is just a static piece of information (typically used to "eliminate" all the hypothesis after a proof is concluded).

The analytical implicit and explicit are "relative". For instance, one can regard a program both as an analytic piece of information (as a result), or as synthetic (when it is meant to be executed). For example, in the sequent calculus LJ, the relativity of the analytic implicit/explicit manifests as the fact that performances can be stalled. This does not mean that performances can be systematically reduced to ascertainments (we saw that this is impossible), but that we can choose to consider the performance given by A B as 45 There is nothing strange in this departure: Kant is talking about theory of knowledge, we are talking about logic.

46 It supported by: -the so-called "deduction theorem" in Hilbert-style systems, which precisely says that A B iff A → B.

-the introduction rule for implication in natural deduction, which says exactly the same thing of the deduction theorem, but with the considerable intellectual advantage of simply posing it as a definition and not as a result to find.

-soundness and completeness theorems (in first order): B is a logical consequence of A by definition iff all models of A are models of B. Then A B exactly corresponds to logical consequence. the ascertainment given by A → B. So the deduction theorem/arrow-introduction-rule: A B A → B makes one pass from the executable A B (which is waiting for its argument -a proof of A) to the non-executable47 A → B (which is just a factual statement).

A shift of the foundational question

In the last 60 or so years the field of mathematical logic has known a great polarization of its branches: on one side, the tradition related to model theory and set theory; on the other side the one related to proof-theory and the notion of computation/programs. This two traditions became technically, conceptually and even spatially48 distant. We feel the need a conceptual reorganization of the discipline, particularly when related to the "question of foundations". By "the questions of foundations" we do not mean to tell now which is a "foundational theory" in some sense, question on which we tend to agree with Maddy's pluralist spirit:

Once we reject the idea that the choice of a fundamental theory to do these foundational jobs is a matter of determining the 'true mathematical ontology', once we focus instead on the literal mathematical content of our decisions, we come to see that we can and should allow some wiggle room for both pure and applied mathematicians to work in well-motivated variants of the fundamental theory.

-Maddy [START_REF] Maddy | What do we want a foundation to do?[END_REF] The discussions in the previous pages indicate, to us, that we should operate what we would call a true shift of the foundational paradigm, in the sense that the "quest of foundations" should instead be thought of as an organic mathematical study, as well as philosophical organization of the aspects of logic and mathematics. From our point of view, the state of art about the foundational reflections on mathematics should be mentally organized in the following points: By "fundamental mathematical logic" we do not mean "more important than others": we simply mean "who refers to foundational questions" and not just to other mathematical aspects. The contents of the item "fundamental mathematical logic" is mainly mathematical, in opposition with the content of the "Transcendental mathematical logic", which is philosophical.

A very important point is that the above classification is not meant to be a "classification of the disciplines", but instead of the approaches a researcher can have when dealing with foundational questions. That is, one can work in formal mathematics or proof theory without having a foundational point of view at all: this is actually the most common situation. So the classification above must be seen as a conceptual organization of the different topics a typical nowadays foundational reflection could include.

Let us give some details.

Formal mathematics Inside "formal mathematics" we intend all which is related to formalising mathematics -in real computers as well as in formal yet still not computerized languages (such as formal theories). Typically, this includes works in proof assistants (for which we share Buzzard's enthusiastic vision on the "digitalization of mathematics"49 ) and the relative theoretical issues (such as Voevodsky's Univalent Foundations [START_REF]Homotopy Type Theory: Univalent Foundations of Mathematics[END_REF] and similar topics). But we can also include reverse mathematics, set theory or model theory when one mentally considers them as formalizations of (parts of) mathematics. For instance, ZFC set theory has always been the most thought of as concerned with "formalizing mathematics". However it is nowadays mainly accepted that, as a "concrete" formalization of mathematics, set theory is not ideal. This is basically because the encoding is possible only in theory -the system is too "low level" (think of programming everything in assembly) -and it is full of arbitrary implementation choices which have as side effect to make the formal theory able to ask and answer "forbidden" questions, for example "2 ∈ 3", or worse:

What's even worse, is that in theory the set M could genuinely represent more than one mathematical object. Perhaps somebody writing the library on natural numbers decided to define 3 to be the set {0, 1, 2}, and more generally they defined n to be the set {0, 1, 2, . . . , n -1}. Then someone doing topology defined a topology on a set X to be a set of subsets of X satisfying some axioms. It then turns out that 3 is a topology on 2 (check it! It's really true!).

-Buzzard, in: https://xenaproject.wordpress.com/2020/04/30/the-invisible-map/ Its weaknesses of course do not mean that formal set theory is not valuable or that it is not interesting as a mathematical discipline. They just mean that it should be freed from much of its usual philosophical/foundational charge. Furthermore, if one wants to really formalize mathematics, then type theories behave much better. For example, Voevodsky proposes to substitute ZFC with, basically, Homotopy Type Theory plus his Univalence Axiom. Actually, insisting to consider ZFC as a true formal foundation of mathematics is charging set theory (or, better, set theorists) of a responsibility which is not demanded. It is true that, at the beginning (more than one century ago), ZF(C) was thought of as a real foundation of mathematics (but always in a purely theoretical way, computers not even existing), but soon set theorists became more interested in the mathematics of the "actual infinite 50 ": [...] moving rather far from the foundational issues, as much as set theorists have understood the privileged position of the subject as regards to its ability to formulate mathematics, many in general consider that the subject of foundations is not worth pursuing and are much more interested in the mathematics of infinity. [...] Therefore, not only the working set theorists of today do not see themselves as providing the unique ontological foundation of mathematics, but they do not believe in such a unique foundation and do not claim it even for their own subject.

-Mirna Dzamonja [START_REF] Džamonja | Set theory and its place in the foundations of mathematics: A new look at an old question[END_REF] Proof theory By "proof theory" we mean everything mathematical which is related to the mathematical study of "mathematical reasoning". It is here that one studies proofs as mathematical objects. Nowadays the major activity in this item is usually done in relation with computer science. As already mentioned, it is important to keep in mind that subjects in this item are not limited to foundational issues: for example, one can work in the area of the abstract theory of programming languages, and yet not have any foundational interest.

It is therefore quite tempting to consider the transcendental forms of logic as the rules of, for instance, the formal system NK (or LK, etc). But we know that we can modify these systems: typically, a deeper logical analysis is provided via the tool of linear logic and obtaining thus the following table :   Quantity Quality Relation Modality ∀,∃ () ⊥ ⊗,&,`,⊕, !,?

which comes together with the proof rules given by LL sequent calculus, or LL proof nets. This is a novelty w.r.t. Kant's, where the transcendental forms are necessary and cannot be "decomposed".

One can now see why the name "transcendental syntax" is appropriate for denoting the conceptual organization of the study of mathematical reasoning: it can be seen as the (mathematical and philosophical) study of the transcendental forms of the logic.

The study of intuition in mathematics. By that we mean the fact that in mathematics one usually follows two "parallel" paths: we have an intuitive argument in mind and we follow it in order to create a formal one. These two paths are of a different nature, since one is in our mind and basically formulated in an informal language, while the other is on the paper and formulated in such a way that it could be translated in a formal language. The fact of reproducing, in a a formal way, intuitive considerations is not always a trivial act, as it can be for simple mathematical concepts. For instance, consider what Buzzard says:

I also have a picture in my head of an overconvergent modular form defined on a neighbourhood of the ordinary locus on a p-adic modular curve. This picture informed several papers I wrote earlier this century with Richard Taylor, Frank Calegari, and others. I was once privileged to be invited to speak in the number theory seminar at Orsay in Paris, and Jean-Pierre Serre was in the audience. I drew one of these pictures of mine on the board and Serre interrupted! He asked what the picture meant. I had drawn a picture of a compact Riemann surface of genus 3 and was drawing discs and annuli on the Riemann surface. [...] However, my Annals of Mathematics paper with Taylor and my follow-up Journal of the AMS single-author paper (which I was lecturing on at the time) were all evidence that my way of thinking about things, the pictures in my head, really could be translated down into rigorous mathematics, even though they were in some sense meaningless. They were effective guides. [...] In short, I knew 'how far one could push the picture' in some sense -which bits of it to take seriously.

-Buzzard, in https://xenaproject.wordpress.com/2021/01/21/formalising-mathematics-an-introduction/

If the creation of mathematical concepts follows the same process as Kant's theory of knowledge, then it must be explained how mathematics is different from metaphysics. In fact, both mathematical and metaphysical concepts would appear from the application of some transcendental forms to objects which are not necessary directly derived by experience -even if both of them are necessary generated by it. We believe that the solution is to consider again Kant, in particular its idea of schematism: mathematical concepts can be "schematized", while metaphysical ones cannot. Here we mean a sort of revisited notion of (what we understand as) Kantian schematism. In particular, one has to stress the idea of a schema as a "rule"; today, we would be tented to say a program. Better said, what makes mathematics not metaphysics, is the possibility for it to be formalized into a programming language (such as the usual formal systems, PA, ZF, System F, HoTT, ...); whence, the possibility of actually applying the transcendental forms not to the intuitions one has in mind, but on the concrete formal language (which, appearing on the paper, is an object of direct experience).

INDEX

1 . 1

 11 Brief outline of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 The λ-calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Mathematical logic: intuitionistic vs classic . . . . . . . . . . . . . . . . . . . . . 1.4 The Curry-Howard correspondence: intuitionistic vs classic . . . . . . . . . . . . 1.5 Linear logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 The Taylor expansion of a program . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS 5.3.1 The traditional ideology and the questions of logic . . . . . . . . . . . . . 5.3.2 Girard's trascendental syntax: between Kant and computer science . . . . 5.3.3 A shift of the foundational question . . . . . . . . . . . . . . . . . . . . .

Introduction 1 .

 1

1. 4 .

 4 THE CURRY-HOWARD CORRESPONDENCE: INTUITIONISTIC VS CLASSIC 21

Figure 1 . 1 :

 11 Figure 1.1: The typical behaviour of callcc

Definition 2 . 1 . 4 .

 214 If some relation ⊆ L × 2 L is defined, we extend it to all 2 L × 2 L by setting: := {(t + S, T + S) | S, T ∈ 2 L with t / ∈ S and t T}.

  2.1 are surprising. Differential λ-calculus in a nutshell Before quickly presenting the actual syntax of the differential λ-calculus, let us see how, in addition to the previous considerations, d dx M • N can be defined inductively on M . The "directional derivative" d dx M • N of the program M = M {x} along N should represent the linear substitution of N in M for x, that is something which behaves as (λx.M )N where λx.M is forced to use N exactly once. So the linear application D(λx.M ) • N and the linear substitution d dx M

  and a, b ∈ R) under the equations: i. commutativity and associativity of + ii. 0 neutral element for + and annihilating element for all constructors except + iii. linearity (w.r.t. +) of the constructors 3 λx.(.), (.)M and D(.) • (.) iv. usual module equations 4 .

6

  Plus the case d dx (aP + bQ) • N := a d dx P • N + b d dx Q

Figure 3 . 1 :

 31 Figure 3.1: Inductive characterisation of linear substitution

  and since each s [s 1 , . . . , s k ] ∈ T (D C P {Q/x} ) = T (N ), we are done.

2 .

 2 Let c = c ξ be a single-hole resource context, M ∈ Λ and s 0 ∈ Λ r . If c s 0 ∈ T (M ), then there is a context C = C ξ , an N ∈ Λ, a resource context c ∈ T (C), a rigid c • of c and s 1 . . . , s deg ξ c-1 ∈ T (N ), s.t.: (a) M = C N (b) s 0 ∈ T (N ) (c) c t = c • t, s 1 . . . , s deg ξ ( c)-1 for all t ∈ Λ r . Proof. 1. Straightforward induction on C. 2. Induction on the single-hole resource context c. Case c = ξ. Take C := ξ, N := M , c := ξ, c • := ξ (there are no s i 's since deg ξ ( c) -1 = 0). Case c = λx.c 1 . Since c s 0 ∈ T (M ) then M = λx.M 1 with c 1 s 0 ∈ T (M 1 ). We can thus take C := λx.C 1 , c := λx. c 1 , c • := λx. c 1 • , where C 1 , N, c 1 , c • 1 and s 1 , . . . , s deg ξ ( c 1 ) are given by the inductive hypothesis. Case c = c [ u]. Analogous as above. Case c = u[c , u 1 , . . . , u n ]. Since u[c s 0 , u] = c s 0 ∈ T (M ) then M must have shape M = P Q with u ∈ T (P ) and c s 0 , u i ∈ T (Q). By induction hypothesis, we can write Q = C 0 N for an appropriate context C 0 and N ∈ L s.t. s 0 ∈ T (N ), and also there is a resource context c 0 ∈ T (C 0 ) and c • 0 rigid of c 0 , together with a list s 0

  for some single-hole resource context c. So Lemma 3.3.33(2) gives us a context C 0 , a term N ∈ Λ, a resource context c 0 ∈ T (C 0 ), a rigid c • 0 of c 0 and resource terms s ∈ T (N ) s.t. M = C 0 N , (λx.s 0 )[ u] ∈ T (N ) and c u = c • 0 u, s for all u ∈ Λ r . Thus N = (λx.P )Q, with s 0 ∈ T (P ) and [ u] ∈ ! T (Q), and so M → C N =: N , with N := P {Q/x}. Also, s 0 [ u]/x ∈ T (N ) thanks to Lemma 3.3.16. Now: every t i ∈ T (M ) = T (C 0 N ), so by Lemma 3.3.33(1) it must have shape

  and every S i ⊆ T (N ), again thanks to Lemma 3.3.33(1) one has U ⊆ T (C 0 N ) = T (N ). This ends the proof, since letting T := i T i + U ⊆ T (N ) one has T r T.

Example 3 .

 3 3.36. 1. For all M ∈ Λ, we have M = M . 2. I ∩ Ω = ∅ = Ω and λx.xΩ ∩ ∆ = λx.x1.

1 N 1 N

 11 .10) Now, Lemma 3.3.33 gives c • N u , . . . , u n N ∈ T (C L 1 , . . . , L n ). But since the L i 's are independent from N 1 , . . . , N n , and thanks to (3.10), we can apply Lemma 3.3.20, and obtain that the set {c • N u , . . . , u n N | N ∈ X } is actually a singleton. Therefore, Lemma 3.3.32 tells us that also the terms c N and the bags [ u i N

  .11) But now thanks to (3.11) and (3.8) (which holds for all N ∈ X ), we can apply again Lemma 3.3.20 in order to find that the set {c • w 1 N , . . . , w n N | N ∈ X } is a singleton. Again by Lemma 3.3.32, we have that all the bags [ w 1 N ], . . . , [ w n N ] for N ∈ X , coincide respectively to some bags [ w 1 ], . . . , [ w n ] which are independent from N ∈ X . So the only element of the previous singleton has shape c • w 1 , . . . , w n , and (3.8) becomes:

  Proof. Such a Por would be such that (λxy.Por xy) I Z = τ (λxy.Por xy) Z I = τ I for all Z ∈ Λ while (λxy.Por xy) Ω Ω = τ Ω, thus contradicting PLP (Theorem 3.3.40). Actually, the existence of this Por is equivalent to that of the Por of Corollary 3.3.38. Indeed, one can take Por := λc.Por (True c)(False c) and Por := λx y .Por(x , y ). PLP also immediately entails the non implementability of the following other version of the parallel-or: Corollary 3.3.42. There is no Por ∈ Λ s.t. for all Z ∈ Λ one has: Por True Z = τ True Por Z True = τ True Por False False = τ False.

Definition 3 .

 3 4.13 (Cbv-resource-contexts). The set Cbv r k of cbv-resource-k-contexts is defined as follows: Cbv r k := Val r k ∪ Simp r k where Val r k and Simp r k are defined by mutual induction by: Val r k

2 .

 2 Let now c be a resource-k-context. We define a set Rigid(c) of rigid k-contexts associated with c, whose elements are called the rigids of c, by mutual induction on Val r k and Simp r k as follows:

N 1 N

 1 a rigid of c N . Confluence allows to factorize the reduction from c • N v , . . . , v n N to t as follows:

1 N

 1 .16) i.e. they have the same number of elements and nf (u ij N ) w ij N for all i, j, N . By composing thus a reduction from c • N w

1 N 1 N

 11 .17) Now, Lemma 3.4.18 gives c • N u , . . . , u n N ∈ T (C L 1 , . . . , L n ). But since the L i 's are independent from N 1 , . . . , N n , and thanks to (3.17), we can apply Proposition 3.4.12, and obtain that the set {c • N u , . . . , u n N | N ∈ X } is actually a singleton. Therefore, Lemma 3.4.17 tells us that also the terms c • N and the bags [ u i N ] are independent from N ∈ X . The unique element of the previous sigleton has hence shape c • u i , . . . , u n , with c • a rigid of a c ∈ T (C), and [ u i ] ∈ T (L i ). Recalling now that [ w i N ] ∈ NFT (L i ), we can apply Proposition 3.4.11 in order to obtain, for each i = 1, . . . , n, an L [ w i N ] ∈ Λ cbv such that L i v L [ w i N ] and [ w i N ] ∈ T (L [ w i N ] ). Remark that these L [ w i N ] 's must in fact be values, since they are reducts of the values L i . Consider now the set {[ w i N ] | N ∈ X }, which can be a priori infinite. Since for i fixed, the set {[ u i N ] | N ∈ X } is a singleton {[ u i ]}, (3.16) entails that [ w i N ] ∈ nf ([ u i ]), and our set {[ w i N ] | N ∈ X } must thus in fact be finite. Therefore we can invoke confluence in order to say that the finitely many L [ w i N

1 N

 1 .18) But now thanks to (3.15) (which holds for all N ∈ X ) and (3.18), we can apply again Proposition 3.4.12 in order to find that the set {c • w 1 N , . . . , w n N | N ∈ X } is a singleton. Again by Lemma 3.4.17, we have that all the bags [ w ], . . . , [ w n N ] for N ∈ X , coincide respectively to some bags [ w 1 ], . . . , [ w n ] which are independent from N ∈ X . So the only element of the previous singleton has shape c • w 1 , . . . , w n , and by (3.15) we get:

Remark 3 .5. 2 .

 32 Actually, the previous definition lifts to Böhm trees, in the sense that one can define: T (BT(M )) := P ∈A(M ) T (P ). This is well defined as a function B Λ -→ P(Λ r ), because one knows that BT(M ) = BT(N ) entails A(M ) = A(N ), so that T (BT(M )) = T (BT(N )). Remark also that, by definition and since BT(M ) BT(N ) iff A(M ) ⊆ A(N ), the Taylor expansion is monotone on B Λ w.r.t. . The next Lemma says that the Taylor expansion is monotone also on Λ ⊥ w.r.t. . Lemma 3.5.3. For M, N ∈ Λ ⊥ , if M N then T (M ) ⊆ T (N ).

  for some t ∈ T (M ), so by Corollary 3.3.26 there is N ∈ Λ such that M N and t ⊆ T (N ), and Lemma 3.5.5 gives t ∈ T (BT(N )) = T (BT(M )).

(

  ⊇). If t ∈ T (BT(M )), there is P ∈ App and N ∈ Λ such that M N P and t ∈ T (P ). By Lemma 3.5.3 we get t ∈ T (N ), and t is r-normal by Remark 3.5.4. So t ∈ NFT (N ) = NFT (M ).One immediately gets the following consequence: Corollary 3.5.7 (Characterization of solvability). M is solvable iff NFT (M ) = ∅. Proof. M solvable iff BT(M ) = ⊥ iff there exist P ∈ A(M ) -{⊥} iff there exist P ∈ A(M ) such that T (P ) = ∅ iff NFT (M ) = T (BT(M )) = P ∈A(M ) T (P ) = ∅.

  Z, . . . . . . . . . , M 2n = B N 2 . . . . . . . . . C M n1 , . . . , M n(n-1) , Z = B N nholds for all Z ∈ Λ. Then for all Z 1 , . . . , Z n ∈ Λ one has:C Z 1 . . . Z n = B N 1 .We have: Proposition 3.5.16. Both for the open term algebra and the closed term algebra of any λ-theory T , the PLP stated for contexts holds iff PLP stated for terms does. Proof. One can check that the following argument holds both in the open and in the closed term algebra. (⇒). Trivial taking C := F ξ 1 . . . ξ n .

  5.21. Let P i ∈ App for i ∈ I. If i T (P i ) = ∅, then the P i 's are pairwise comparable. Indeed, fix t ∈ i T (P i ). Since the P i 's belong to App, such a t must be r-normal. We go now by induction on its r-normal structure 23 : If t = λ x.y then it is trivial. If t = λ x.y[ u 1 ] • • • [ u k ] (with k ≥ 1) then each P i must has shape P i = λ x.yP i1 • • • P ik , with u m j ∈ i T (P im ) for all m, j. Now one can conclude by the inductive hypothesis. Lemma 3.5.22. Let X ⊆ Λ and take a family {P N ∈ A(N ) | N ∈ X }. If the P N 's are all pairwise compatible, one has:

Lemma 3 .

 3 5.23. Let X ⊆ App. If the elements of X are pairwise compatible, one has:

  3.21]. Theorem 3.5.34. All contexts C : Λ -→ Λ are continuous w.r.t. Scott-topology.

Figure 3

 3 Figure 3.4: The dependencies between the results of [[START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF] Chapter 14]

  Definition 4.2.1 (λµ-calculus). Fix a countable set whose elements are called variables and a (disjoint) countable set whose elements are called names. The set λµ of λµ-terms is defined by the following grammar:M ::= x | λx.M | M M | µα. β |M | (for x a variable and α, β names) in which, as usual, λ binds x in M as well as µ binds α in β |M |.

  Theorem 4.2.6. The λµ-calculus (λµ, →) is confluent. Proof. See proof of Theorem 4.1 of [Py98].

  α |x| : B | α : A y : (A → B) → A λx.µδ. α |x| : A → B | α : A y : (A → B) → A y(λx.µδ. α |x|) : A | α : A y : (A → B) → A µα. α |y(λx.µδ. α |x|)| : A | λy.µα. α |y(λx.µδ. α |x|)| : ((A → B) → A) → A | So one sets: callcc := λy.µα. α |y(λx.µδ. α |x|)|.

  t∈T (M ) nf r (t) ⊆ L r . This allows to endow L with the partial order: M ≤ N iff NFT (M ) ⊆ NFT (N ). It also endows it with the induced equivalence M = τ N iff NFT (M ) = NFT (N ).

Theorem 4. 3

 3 .4 (Monotonicity). Any context C : L → L is monotone w.r.t. ≤.

Proposition 4. 3 . 5 .

 35 If M → N then point (1) and (2) of the previous assumption both hold. Proof. By induction on the single-hole context C s.t. M = C M , N = C N and M → base N . Case C = ξ. Then M = M and N = N , so the result is exactly Assumption 3.

Remark 4. 3 .

 3 10. One has that if v r V then: c • . . . , . . . , v, . . . , . . . r w∈V c • . . . , . . . , w, . . . , . . . =: c • . . . , . . . , V, . . . , . . . . Let us extend the definition of Taylor expansion to resource k-contexts by adding, in its definition, the clause: T (ξ i ) := {ξ i }.

  Lemma 4.3.11. Let C be a k-context and c 1 , c 2 ∈ T (C). Let c • 1 and c • 2 rigids respectively of c 1 and c 2

2 .

 2 Let c = c ξ be a single-hole resource context, M ∈ L ands 0 ∈ L r . If c s 0 ∈ T (M ), then there is a context C = C ξ , an N ∈ L, a resource context c ∈ T (C), a rigid c • of c and s 1 . . . , s deg ξ c-1 ∈ T (N ), s.t.: (a) M = C N (b) s 0 ∈ T (N ) (c) c t = c • t, s 1 . . . , s deg ξ ( c)-1 for all t ∈ λµ r .Proof. The proof is a trivial adaptation of the one of Lemma 3.3.33, where the case of the constructor g corresponds to the case of the λ-abstraction. Let us write it for the seek of clarity: Let c = g r (v, c 1 ). Since c s 0 ∈ T (M ) then M = g(v, M 1 ) with c 1 s 0 ∈ T (M 1 ). We can thus take C := g(v, C 1 ), c := g r (v, c 1 ), c • := g r (v, c 1• ), where C 1 , N, c 1 , c • 1 and s 1 , . . . , s deg ξ ( c 1 ) are given by the inductive hypothesis.

Proposition 4. 3 .

 3 13. If T (M ) ⊇ T → r T then there is N ∈ L and a sum T ⊆ T (N ) s.t. M → N and T r T.Proof. Saying that T → r T means that T has shape T = i t i + c h and T has shapeT = i t i + c H ,for some single-hole resource context c, a resource term h and a sum H s.t. h → base H. But since c h ∈ T ⊆ T (M ), by Lemma 4.3.12(2) we get a context C 0 , a term N ∈ L, a resource context c 0 ∈ T (C 0 ), a rigid c • 0 of c 0 and resource terms s ∈ T (N ) s.t. M = C 0 N , h ∈ T (N ) and c u = c • 0 u, s for all u ∈ L r . Now we can apply Assumption 5 to h ∈ T (N ) obtaining an N ∈ L s.t. N → N and H ⊆ T (N ). Set N

  Definition 4.4.4. Let t ∈ λµ r and [ u] = [u 1 , . . . , u k ] ∈ ! λµ r . 1. We define as usual the linear substitution t [u 1 , . . . , u k ]/x ∈ 2 λµ r as t [u 1 , . . . , u k ]/x := 0 if deg x (t) = k, and t [u 1 , . . . , u k ]/x := σ∈S k t u σ(1) /x (1) , . . . , u σ(k) /x (k) if deg x (t) = k.

  length d (which are necessarily in finite number), and α |•|(1) , . . . , α |•|(d) is any fixed enumeration of the occurrences of α in t. The same exact definition is given also in the case t is a named term.Remark 4.4.5. The linear substitution and the linear named application are well defined since they do not depend on the particular enumeration of the chosen occurrences. Another way of defining them is by induction, as presented in Figure 4.1 and Figure 4.2.

Figure 4 . 2 :

 42 Figure 4.2: Inductive characterisation of linear named application

m≥0(

  β |t| α [ m z, . . . , z]) [ u]/z . If deg α ( β |t|) = 0 then, in the last sum, all the addends with m = 0 are 0; so we are left with: µα.( β |t| α 1) [ u]/z = µα. β |t| α [ u] and we are done. And if deg α ( β |t|) =: d ≥ 1 then by definition of linear substitution one easily sees that, in the previous sum, all the addends with m = n are 0 (n being the length of [ u]); since the w.c.'s of [ n z, . . . , z] of length d are the d-uples ([ k 1 z, . . . , z], . . . , [ k d z, . . . , z]) s.t. k 1 + • • • + k d = n, the last sum becomes: µα.

  Definition 4.4.8. Let t ∈ λµ r and let b be an occurrence of a bag or of a subterm of t. Define the depth d t (b) ∈ N of b in t as the number of named subterms of t containing b.

  Proposition 4.4.11. If t → µ r t + T then m(t) > m(t ). Proof. If t → µ r t + T then t = c (µα. β |s|)b 0 and t = c h with h ∈ µα. β |s| α b 0 and c a single-hole resource context. Call k := deg µ (t) = deg µ (t ) and consider deg α ( β |s|) ∈ N. The are two cases:

First, remark that

  deg µ (t ) = 1 + deg µ (c) + deg µ (s) and deg µ (t) = 2 + deg µ (c) + deg µ (s). Also, notice as usual that if b occurs in c then d t (b) = d c (b) = d t (b)

3 .

 3 The same identical w.c. of [y, y] (with the enumeration from left to right) as the one above (that is, ([y], [y])) is also the one generated by the different function P : {1, 2} -→ {0, 1} defined by P (1) = 1, P (2) = 0. Definition 4.4.23 (Quantitative linear substitution and quantitative linear named application). The quantitative version t [ u]/x + of the linear substitution is defined exactly as in Figure 4.1 but by replacing, in Figure 3.1, the sum on all the ([ w 0 ], . . . , [ w n ]) w.c. of [ u] with the sum on all W : ( u) -→ {0, . . . , n}, and by taking the above w.c.'s as the one given by W in the previously explained sense. The quantitative version t + α [ u] of the linear named application is defined exactly as in Figure 4.2 but by replacing, in the case of an application, the sum on all the ([ w 0 ], . . . , [ w n ]) w.c. of [ u]

( 1 ,

 1 [yy]) of [y, y] given by the function W : (y, y) -→ {0, 1} defined by W (1) = W (2) = 1; the last term of the sum comes from the w.c. ([yy], 1) of [y, y] given by the function W : (y, y) -→ {0, 1} defined by W (1) = W (2) = 0; the second term of the sum, with coefficient 2, comes from the two identical w.c.'s ([y], [y]) of [y, y]

  4.14) to N λµ r by setting m(T) := [ m(t) | t ∈ T] ∈!(!N × N), and use the multiset order.

  Lemma 4.4.32. . Let t ∈ λµ r , [ v] =: [v 1 , . . . , v n ] and [ u] bags and y = x variables with y not occurring in [ u]. Then:

  Lemma 4.4.33. . Let t ∈ λµ r , [ v] =: [v 1 , . . . , v n ] and [ u] bags and α a name with 19 deg α ([ u]) = 0. Then:

  Lemma 4.4.36. Let t ∈ λµ r , [ u], [ v] bags and α = β names. 1. If deg α ([ v]) = 0 and deg β ([ u]) = 0, then:

  Lemma 4.4.37. Let t ∈ λµ r , [ u] a bag and α = β names with deg β ([ u]) = 0. Then:

  α |x 1 1|. Also the condition deg β ([ u]) = 0 cannot be suppressed: for instance, for t = µγ. α |x| and [ u] = [µγ . β |y|], the left hand-side becomes µγ. α |x[µγ . β |y|]| while the right hand-side becomes µγ. α |x[µγ . β |y1|]|.

  The condition deg x ([ u]) = 0 in the previous lemma cannot be suppressed: for instance, for t = µγ. α |y| (with y = x), [ v] = 1 and [ u] = [x], the left hand-side becomes µγ. α |y[x]| while the right hand-side becomes 0.

  α |x|, [ u] = [µδ. δ |x|] and [ v] = [µδ. δ |y|], the left hand-side becomes µδ. α |x[µδ. δ |y|][µδ. δ |x|]| while the right hand-side becomes µδ. α |x[µδ. δ |x|][µδ. δ |y|]|. Also the condition deg γ ([ u]) = 0 in the previous lemma cannot be suppressed: for instance, for t = µδ. α |x|, [ u] = [µδ. γ |x|] and [ v] = [µδ. δ |x|], the left hand-side becomes 0 while the right hand-side becomes µδ. α |x[µδ. γ |x[µδ. δ |x|]|]|.

  Case s = λy.s : straightforward by inductive hypothesis. Case s = µγ. η |s |: we have two subcases 21 : 4. Induction on t, using Figure 4.1. The non-trivial cases are t = v 0 [v 1 , . . . , v n ] and t = µγ. η |t |. Both are done following the same argument as we did in point (2); first, apply Figure 4.2, then Remark 4.4.40, then the inductive hypothesis and thus close the argument by applying Remark 4.4.40 again and finally Figure 4.2 again. 5. It is immediate discriminating the cases α = β and α = β, using Figure 4.2, and concluding by point (4). 6. Induction on s ∈ λµ. Case s = variable. Impossible. Case s = λ-abstraction. Straightforward by Figure 4.2 and inductive hypothesis. Case s = µβ. γ |s |: we have two subcases: Subcase s → + r S is performed by reducing s : then S = µβ. γ |S | with s → r S . By Figure 4.2 we have s + α [ u] = µβ. γ |s | + α [ u]. Remark that we cannot immediately apply the inductive hypothesis on γ |s |, simply because γ |s | / ∈ λµ r (it is a named term). However we can split in the two subcases whether γ = α or γ = α and now in both subcases we can conclude straightforwardly by Figure 4.2 and the inductive hypothesis. Subcase s = µγ . η |s | (with γ = γ ) and s → + r S is performed by reducing its leftmost ρ-redex: then S = µβ. η |s |{γ/γ }. We split in two sub-subcases: Sub-subcase α = γ: s + α [ u] = µβ. γ |µγ . η |s | + α [ u]| (by Figure 4.2) + ρ r µβ. η |s | + α [ u] {γ/γ } = µβ. η |s |{γ/γ } + α [ u] (by Lemma 4.4.31 plus deg γ ([ u]) = 0) = S + α [ u].

Case s = s [v 1

 1 , . . . , v n ]: we have four subcases: Subcase s → + r S is performed by reducing s : straightforward by Figure 4.2 and inductive hypothesis. Subcase s → + r S is performed by reducing the v i in [ v]: straightforward by Figure 4.2 and inductive hypothesis. Subcase s = λx.s and s → + r S is performed by reducing the λ-redex s. Then S = s [ v]/x and using Figure 4.2 we have:

7.

  It is immediate by discriminating the cases α = β and α = β, using Figure 4.2, and then concluding by point (6). Now we can finally state and prove the local confluence of quantitative resource λµ-calculus. Proposition 4.4.42. The reduction → + r is locally confluent in N λµ r .

3 .

 3 Case c = µα. β |c |, with c t a µ-abstraction. Then either c = ξ and t = µγ. η |t 0 |, or c = µγ. η |c |.

  Subcase R = (µγ. η |P |)N . Then t = (µγ. η |p|)[ d] and s = (µγ. η |p |)[ d ] for p, p ∈ T (P ) and [ d], [ d ] ∈ ! T (N ). By confluence on λµ r we have:nf r (t) = nf r ( λµ|(µγ. η |p| γ [ d])[ u 1 ] . . . [ u n ]|). So there is h 1 ∈ µγ. η |p| γ [ d] s.t. h ∈ nf r ( h 1 ) where: h 1 := λµ|h 1 [ u 1 ] . . . [ u n ]|. Analogously we find a h 2 ∈ µγ. η |p | γ [ d ] s.t. h ∈ nf r ( h 2 ), where: h 2 := λµ|h 2 [ v 1 ] . . . [ v n ]|. By Lemma 4.4.48 we have h 1 , h 2 ∈ T (µγ.( η |P |) γ N ) and so h 1 , h 2 ∈ T ( λµ|(µγ.( η |P |

Figure 4 . 5 :

 45 Figure 4.5: Schema of the proof of Lemma 4.4.58

x∈SX

  {dim x} ∈ N ∪ {∞}. The subsets y of a simplex x of X are the faces of x. Vertices can be identifies with 0-simplices. 1-simplices are called the edges of X. 2-simplices are called the triangles of X. 3-simplices are called the thetraedras of X. The elements of P * fin (|X|)-SX are called the non-simplices of X. We will use the usual notions of standard n-simplex ∆ n , and of S n .

Definition 5. 2 .

 2 22. An coherence asc X is the data of an asc X = (|X|, SX) and of a cs cs(X) = (|X|, X ) both on the same web |X|. It is easily checked that coherence asc's form a category CohASC, where the morphisms from X to Y are the simplicial cliques of the cs cs(X) cs(Y ), that is, CohASC(X, Y ) is the set of the t ⊆ |X|×|Y | such that:i) t • σ ∈ SY for all σ ∈ SYii) for all (a, b), (a , b ) ∈ t, if a ¨X a then one has both b ¨Y b and the implication: if b = b then a = a .

t

  + (a) := {b ∈ |Y | | (a, b) ∈ t}. Definition 5.2.23. We define the following endofunctor I on ASC. If X is an asc, then I X is the asc with web |I X| := SX and k-simplices the sets {u 0 , . . . , u k } ⊆ * fin SX s.t. k i=0 u i ∈ SX. If f : |X|→ |Y | is a simplicial map from X to Y , then If : SX → SY is given by the direct image: If (u) := f u.

Figure 5 . 1 :

 51 Figure 5.1: Girard's knitting and Kant's table

  3. Burali-Forti paradox: consider the set O of all ordinals. It is easily seen that O is an ordinal. Therefore so is O + 1, i.e. O + 1 ≤ O. So O < O + 1 ≤ O, contradiction.

  The paradigm shift initiated with the work of Ehrhard and Regnier has originated several different -but interrelated -axes of research, involving for instance an axiomatic description of differentiation in the categorical setting (see

for instance

[START_REF] Blute | Cartesian differential categories[END_REF][START_REF] Ehrhard | An introduction to differential linear logic: proof-nets, models and antiderivatives[END_REF][START_REF] Cockett | Integral categories and calculus categories[END_REF]

) or the production of resource sensitive type systems and cost models for several functional programming languages (see for instance

[START_REF] Accattoli | efficiency and reasonable cost models[END_REF][START_REF] Daniel De | Execution time of λ-terms via denotational semantics and intersection types[END_REF]

), as well as the adaptation of this kind of approximation to other functional languages (see for instance

[START_REF] Bucciarelli | A relational semantics for parallelism and non-determinism in a functional setting[END_REF][START_REF] Dal | Probabilistic operational semantics for the lambda calculus[END_REF][START_REF] Dal | On the Taylor Expansion of Probabilistic lambda-terms[END_REF][START_REF] Vaux | The differential λµ-calculus[END_REF][START_REF] Kerinec | Revisiting call-by-value Böhm trees in light of their Taylor expansion[END_REF]

).

The two notions of approximation -Böhm's and Taylor's -are strictly related by Ehrhard and Regnier's fundamental commutation property 27 : NF

  for some N ∈ Λ}. One says that P 1 , P 2 ∈ App are compatible if they share a common upper bound in Λ ⊥ w.r.t. . It is trivial to check that if P 2 = ⊥, then P 1 , P 2 are compatible iff P 1 = λx 1 . . . x n .yP 11 • • • P 1k and P 2 = λx 1 . . . x n .yP 21 • • • P 2k for (the same) n, k ≥ 0, with P 1j , P 2j compatible for all 1 ≤ j ≤ k, and ⊥ being compatible with any term.2. Given two compatible P 1 , P 2 ∈ App, one can easily see (for example by induction on P 1 )

	Definition 2.2.6.	1.

  y(P 11 P 21 ) • • • (P 1k P 2k ), if P 1 = λ x.yP 11 • • • P 1k and P 2 = λ x.yP 21 • • • P 2k ,

  • • • P k ∈ Λ ⊥ whenever the finitely many P i 's are pairwise compatible, and this is again the sup of the set {P 1 , . . . , P k } in Λ ⊥ .

	Theorem 2.2.9 (Approximation theorem). Let M ∈ Λ. One has:
		BT(M ) =
			P ∈A(M )
	Proposition 2.2.7. For M ∈ Λ, the set A(M ) is an ideal in (B, ), i.e. non-empty, downward
	closed and directed 13 .
						k
	Remark 2.2.8. It is possible to define an operation	i	P i := lim k→∞	i=1	P i ∈ B for countably many
	pairwise compatible P i 's forming a directed set. This operation informally takes the potentially
	k
	infinite tree obtained by extending	P i with the next P k+1 for all k. One has that	P i = sup	P i
	i=1					i	i
	in (B, ), and it does not depend on the chosen enumeration of the P i 's.
	In particular, there always exists sup	P =		P . Actually, this sup is the Böhm tree
		P ∈A(M )	P ∈A(M )
	of M , as the following known fundamental theorem states:

  is normal and we are done by the first rule defining ⇓. If sz(t) ≥ 2 then we start recalling that, as every resource term, t has the shape t = λy 1 • • • y m . u[v 1 , . . . , v n ] with u either a variable or a redex (λx.s 0 )[s 1 , . . . , s

k ]. Now if m = 0 then t must be of shape t = λ y. t for some t ∈ nf r (u[ v]). The inductive hypothesis on u[ v] (of strictly smaller size than t because of the presence of at least "λy 1 ") gives u[ v] ⇓ t, whence t ⇓ t by the second rule defining ⇓. So Wlog m = 0. Analogously one treats the case where u = x. In this case t must have shape t = x[t 1 , . . . , t n ] for some

  for all Z. Now let us remark that if F is solvable and satisfies equations (3.21) then, once called m ∈ N the (necessary unique) integer s.t. F h λz 1 . . . λz m .yP 1 . . . P k , it must be: m ≥ n.

  y(P 11 P 21 ) • • • (P 1k P 2k ) if P 1 = λ x.yP 11 • • • P 1k and P 2 = λ x.yP 21 • • • P 2k , ⊥ if at least one between P 1 and P 2 is ⊥. It is trivial to check by induction that thanks to the compatibility, the definition makes sense and gives the inf of P 1 , P 2 in App. It is straightforward to check by induction (on P 1 , for example) that if countably many P i 's are compatible with each other, then

i∈I P i = inf i∈I P i , where

the inf is taken in App (and not in B as for the sup). In particular, in App there exists inf P ∈A(M )

  Our notation α |M | should, hopefully, clearly show what is "inside a naming" and what is not. Definition 4.2.2. Fix a new countable set {ξ 1 , ξ 2 , . . . } whose elements are called holes. Define a k-context C = C{ξ 1 , . . . , ξ k } by:

  + r T 2 (on a different redex than t) can be only performed either by reducing s, or if s = µγ . η |s | and we reduce the ρ-redex ... η |µγ . ...|. We have thus the following two diagrams:

Subcase t = µγ. α |µβ. η |s|| and T = µγ. η |s|{α/β}. Then c t = t → µγ. α |µβ. η |s|| µγ. η |s|{α/β} µγ. α |µβ. η |S|| µγ. η |S|{α/β} (s→S) µγ. α |µβ. η |µγ . η |s ||| µγ. δ0 |µγ . δ 1 |s {α/β}|| µγ. α |µβ. δ 2 |s {η/γ }|| µγ. δ1 |s {α/β}{δ 0 /γ }| = µγ. δ2 |s {η/γ }{α/β}| where δ 0

  n). But now we have: µγ. η |p| γ [ d] h 1 = h 2 ∈ µγ. η |p| γ [ d ] so Lemma 4.4.50 gives p = p and [ d] = [ d ], i.e. t = s . If we now look at the shape of t, s, this last information together with [ u 1

  Case there are no ρ-redexes and R = (µγ. η |P |)D. Then H(M ) = λµ. | (µγ.( η |P |) γ D) Q |. So by Lemma 4.4.48 s ∈ λµ. | (µγ. η |p| γ

		and thus s =
	H(t), i.e. s ∈	H(t).
	t∈T (M )

  4.48, is what makes us able to transport one step of the head reduction from terms to resource terms. Corollary 4.4.67 (No Parallel-or in λµ-calculus). There is no Por ∈ λµ s.t. for all Z ∈ λµ Por True Z = τ True Por Z True = τ True Por False False = τ False.

	one has:
	
	 
	 

  Definition 5.2.19 (The category of chain complexes). A chain map from a chain complexes (M k , ∂ k ) k∈N to a chain complex (M k , ∂ k ) k∈N is the data of a sequence of linear maps ϕ k : M k → M k commuting with borders, that is, such that one has the commutative diagrams:

Definition 5.2.18 (Simplicial homology modules). Let (M k , ∂ k ) k∈N be a chain complex. Elements of Im(∂ k+1 ) are called k-boundaries and elements of Ker(∂ k ) are called k-cycles. Both are sub-Z-modules of M k . By definition of chain complex, a k-boundary is a k-cycle, so the (abelian) group structure of Im(∂ k+1 ) forms a subgroup (thus, normal) of Ker(∂ k ), and so we can take the abelian quotient group:

H k := Ker(∂ k )/Im(∂ k+1 )

which is called the k-homology group of (M k , ∂ k ) k∈N . Its elements are called k-homology calsses on Z and are the cosets γ + Im(∂ k+1 ) for γ ∈ Ker(∂ k ). The group H k inherits a structure of Z-module via the multiplication in Ker(∂ k ), it is known as the k-homology module of X.

  That is, the elements of RelASC(X, Y ) are the t ⊆ |X|×|Y | s.t. t • σ ∈ SY for all σ ∈ SX, where for a σ ⊆ P

* fin (|X|) we set: t • σ := a∈σ t + (a) and t + : |X|→ P(|Y |) is given by:

  Corollary 5.2.26. If A and B are isomorphic types in MALL, then H k

  for Λ/ =τ , 55 for λµ/ =τ , 123 for Λ cbv / =τ , 65

		Size
		-of a λ-term, 43
		-of a λµ-term, 100
		Substitution
	Reduction	Named application-, 86
	λ-, 30, 86	Sup of λ⊥-terms, 33
	µ-, 86 ρ-, 86 -for λµ-calculus, 86 -for λµ-sums, 103 Big-step--for λ-calculus, 49 -for λµ-calculus, 120 Head-for λµ-resource-term, 121 Head-for λµ-term, 121 Resource λ-, 43 Resource λµ-, 96 Resource -λ-terms, 42 -λµ-terms, 94 -Cbv -λ-calculus, 60 Rigid -λ-terms, 51 -of a resource λ-term, 51	Taylor -normal form, 45 qualitative-expansion -of λ-terms, 45 -of λ⊥-terms, 67 -of λµ-terms, 115 -of a Böhm tree, 67 cbv λ-calculus-, 61 quantitative (or full)-expansion, 41 Term λ⊥-, 33 Head normal-λ-, 31 λµ-, 121 Pre-λ-, 29 Solvable-λ-, 31 λµ-, 123 Trees, 29
	-of a resource cbv-λ-term, 62
	cbv-λ-term, 62	W.c. (Weak composition), 95

Again, it models computation via the functional paradigm.

The quest towards a direct definition of an abstract notion of algorithm which is mathematically satisfying is exciting but not clear.

Apparently Zermelo had found in the same year (1902) the same paradox, but did not publish it.

The first proposal was made by Hilbert but, mathematically speaking, his systems are not rich. Modern proposals, much more interesting for a number of reasons, can be found especially in Girard's proof-nets[START_REF] Girard | Proof-nets: The parallel syntax for proof-theory[END_REF], as well as in "deep inference's systems"[START_REF] Aler | Introduction to Deep Inference[END_REF] and "combinatorial proofs"[START_REF] Dominic | Proofs without syntax[END_REF].

This is the reason why one usually explains that the "intended" meaning of a sequent is as such an implication. However, as Girard points out, a more interesting look on sequents can be found reading them though a distinction "explicit/implicit", on which we will come back in Section 5.3.2.

Most often called a detour in this precise setting.

The term M s.t. x : Γ M : A, where x are the variables of M .

When one is lucky, even to exhibit such a realizer; and when one is extra lucky, to actually describe its programming behaviour -it is what Krivine calls the specification problem.

But of course proofs still give raise to programs, as the crucial "adequacy" theorem states: any simply-typed λ-term realizes its type.

We are not following an historical order here.

We did not write them in the previous section.

Note that in intuitionistic logic the rule of contraction that we wrote is not possible since we cannot have two formulas at the right of the " ", and weakening is only possible when ∆ is empty -that is, it represents a contradiction, and so weakening "at the right of the " " is simply the principle "ex falso quodlibet".

Linear logic is often referred to as a "microscope", or as a "micrologic" -not in the sense of being "small", but in the sense of looking at the internal structure of usual logic.

Also, they correspond to the exponential power series in the differential λ-calculus, as we will mention in Section 3.2.

Also called partial or finite approximants.

We mean that they use n the argument x in order to computex n = x • • • • • x

The word "commutation" here is appropriate because the Böhm tree BT(M ) of M is a generalized normal form.

We mean the just given definition of tree, thus with the added constraint on ⊥.

We mean the booleans with the equation 1 + 1 = 1.

We keep the "sum" notation because it is manageable and reminiscent of the fact that the general case of coefficients in a ring different from Z2 is important in the setting of λ/λµ-calculus, even if we will not need it.

Appartently, Barendregt in turn attributes it to Ottmann -see the Addenda for the sixth imprinting of[START_REF] Pieter | The lambda calculus -its syntax and semantics[END_REF].

An equivalence is said to be contextual when it is the contextual closure of some relation.

Here the word "algebra" is intended in the sense of universal algebra.

Wlog, we can restrict the abstracted variables x1, . . . , xn in C to the free variables of M .

Apparently there is no certain historical evidence of the fact that those cultures knew exactly what we now call the "Babylonian method", but there are reasons to think that they did.

A set is directed w.r.t. a preorder whenever any two of its elements share a common upper bound.

We will sometimes omit this adjective since we will only talk about the qualitative version, and not about the quantitative one.

In the next chapter we will see that actually it adapts also to the case of λµ-calculus, which supports the thesis of a "scalable proof".

With the notation of the first page: d(f • g)(a) = df (g(a)) • dg(a).

Or equivalently, but more simply, just cancel N and obtain the usual chain rule for 1-dimensional argument functions.

The case y not free in the M is trivial because the equality would become 0 = 0 + 0.

In the figure we refer to the notion of "weak composition" ("w.c." in the figure) of a bag; such notion is defined in Definition 4.4.3.

A more rigorous proof would require an induction on the number of elements of S and on the size of a sum, but we preferred to leave the argument "non-inductive".

As usual, Im(C) means here the image of the context function C.

A more formal proof would require to perform an induction, but we preferred to keep the argument noninductive.

The following condition s →0 0 refers to a particular reduction →0, which we did not specify, that one considers in cbv-λ-calculus.

If deg ξ i (c) = 0 we mean the empty list.

Recall Remark3.3.6.

Here we are using the fact that there is a canonical bijection between the set Λ ⊥ -{⊥} and the inductive grammar M ::= x | λx.M | M ⊥ | M M .

Intuitively, one would be tempted to immediately conclude by considering F = λx1 . . . λxn.C x1, . . . , xn . However since substitution in a context is may capture variables, in this way we do not necessary have that F Z =T C Z . So we have to be careful in "simulating" the capturing variables substitution in contexts with the capture free substitution in terms.

Remember that contexts are not considered up to renaming of bound variables, contrary to terms, and so the notion of bound variables occurring in a context is well defined.

A side effect is, from this perspective, the proliferation of indices in the proofs due to the presence of bags.

Or an approximation system, as he calls it.

We will avoid calling this an "α-equivalence", since α is now usually a name, and the two terminologies could enter in conflict.

CHAPTER 4. THE RESOURCE APPROXIMATION FOR λµ-CALCULUS Definition 4.2.3. The simply typed λµ-calculus is given by the following typing rules 2 :Γ, x : A x : A | ∆ Γ, x : A M : B | ∆ Γ λx.M : A → B | ∆ Γ M : A → B | ∆ Γ N : B | ∆ Γ M N : B | ∆

With all the usual conventions: Γ is a variable declaration context, so different variables with possibly equal types, ∆ is a name declaration context, so different names with possibly equal types, and writing a sequent "Γ M : A | ∆" is just a comfortable way of writing the quadruple (Γ, M, A, ∆). Also, remark that when we write "α : A, ∆", or "α : A, ∆, β : B", we mean that respectively α and α, β are not declared in ∆.

So we use for the reduction in λµ-calculus the same symbol for the reduction in λ-calculus. This should not be confusing, since in this chapter we will only talk of λµ-calculus. If we want to specify a base case of a reduction, we will explicitly write the subscript.

This is why we denoted it "λ" and not "β" in all the thesis: we want to avoid confusion with the names in this chapter.

Actually, he also gave polarized proof-nets for Girard's LC, see[START_REF] Laurent | Polarized proof-nets: Proof-nets for LC[END_REF].

We take on L r "the same" equality as in L.

If deg ξ i (c) = 0 we mean the empty list.

We are of course employing in the usual way the informal notion of "occurrence" in a resource term (due to the presence of "unordered" bags). The same for the next part of the definition.

Whose syntax is M ::= x | λx.M | M M | µα.M | α|M |.

Here we use again the same symbol as the resource reduction for λ-calculus. See footnote 3.

Here there is a difference with Saurin's Λµ-calculus, in which one can have as many named subterms as one wants, independently from µ-abstractions.

Analogously, one can see a sum as a finite multiset of resource terms, where the multiplicity of a term is given by its coefficient in the sum.

Attention: in the rest of the thesis, W usually denotes a w.c. of some bag. Since in this confluence section the sums over the w.c.'s are replaced with sums over such functions, then we use the same letter, but we will always precise that it is a function and not a w.c.

Remark that the case (t[u1, . . . , u k ]) ∂ is well-defined since a λµ ∂ -term of shape D k Θ • (Θ1, . . . , Θ k ) does not depend on the enumeration of the Θi's (Corollary 6.17 of[START_REF] Vaux | λ-calcul différentiel et logique classique : interactions calculatoires[END_REF]).

Whose statement is that if →1, →2 are two confluent binary relations on X s.t. 1, 2 commute, then →1 ∪ →2 is confluent.

The same of course holds also in the quantitative case.

Another possibility would be to consider a "parallel reduction", in the style of the well known Tait&Martin-Löf technique. We are currently working on such a proof as well.

Note that we may use the letter "δ" for a name as well: in this notation -which is however used only in some proofs -it is of course not a name, and there should be no ambiguity.

The following is just an equality between sets of words -the named terms.

In the following we do not explicitly say it, but of course we will take bound names different from α and β, as well as from other bound names.

We mean here that both β and γ get renamed with α.

Notice that, even if this set is not a set of λµ-terms, item (3) still makes perfect sense: it is just the intersection of two sets, the sets of named terms built according to Figure4.2.

Private communication by Tortora de Falco, based on some work of Mazza, Pagani and Guerrieri.

Here we write the sum symbol just to stress the fact that those are finite sums, but remember that they are just sets (so the sum is the union).

A situation somehow annoying, for the "working λ-calculist" as well as for the popularization of the discipline.

Namely, for = λ , H and =B.

Namely, the Hilbert-Post completion H * of H, or the ones obtained from = λ and H by considering the η or ω-rules.

To the best of our knowledge, these groups do not constitute nowadays an active topic of research.

Actually, at least two: the Visser topology, and the Scott topology -which Barendregt calls the "tree topology",but we will lighten terminologies and call it "Scott". Here we only consider the Scott one, because it is the most useful one.

Equivalently, one can substitute B with BΛ (equipped with the subspace topology) in the definition.

Obviously KQ(X) is T0 by construction. There is also a bijection between the topology on KQ(X) and that on X, so that the spaces are really "essentially the same".

However, in order to prove the Continuity theorem one needs, in the lemmas that one uses, the Monotonicity for 1-hole contexts. Since we already saw that this easily implies the Monotonicity for multi-hole contexts, this remark does not give an alternative proof of the Monotonicity.

Of course this is, in some sense, the "essence" itself of λ-calculus, and comes from the fact that it is a high order programming language.

And here we could really talk about all the discipline known as "computer science logic".

Usually the geometrical realization is denoted with |X|. Here we used this notation for something completely different: the set of vertices, which we call the "web". We did so in order to stay within the tradition of the notations and terminologies used in the discipline of logic of programs.

In fact, there is a standard modified version of the geometric realization, usually called "topological realization", which is canonical and realizes an asc X inside the free R-vector space over |X|, endowed with a canonical topology (but it still "abuses of dimensions"). Of course this two realizations are homeomorphic.

A poset D is said to be directed iff for all x, y ∈ D there is z ∈ D s.t. x ≤ z ≥ y.

In the sense that this graph is its 1-skeleton. But since we are takling about cs's, it already gives all the information about its simplices (which are its cliques).

Just remark that (s • t) • σ = s • (t • σ) to prove that composition preserves simpliciality.

In particular, thus, we have a0 a1.

Turing's analysis of the (human) computer is based on the distinction object (datas) / subject (the program, or the programmer).

Or interpreted, but this is essentially the same.

This is supported by the soundness and completeness theorems with non-empty Tarski semantics.

We refer here to the resource interpretation of linear logic.

This is still the way things are presented to students in the introductory courses.

Such as in proof-nets, which are indeed circuits in the same way Feynman diagrams are: see[START_REF] Blute | Proof nets as formal Feynman diagrams[END_REF].

Such as in Geometry of Interaction.

Sentences of shape "subject + predicate".

This is what Girard means when he says that "tout est sur la table, y compris la table".

Girard often makes the example of a computation for 27 + 37 = 999, with the program of multiplication loaded inside +.

See Section 1.3.

Think of Linux's "chmod -x". In LJ we can also pass from the non-executable implication to the executable one: the previous rule is reversible; think of Linux's "chmod +x".

The first tradition is mainly done in mathematics departments, while the second one in computer science departments.

See https://xenaproject.wordpress.com/2021/01/21/formalising-mathematics-an-introduction/.

Remerciements

Corollary 4.3.14. For all T ⊆ T (M ), there exist N ∈ L s.t. M N and nf r (T) ⊆ T (N ).

Exactly as in λ-calculus, we can set the same notions needed for the Stability Property.

Definition 4.3.15. Given a non-empty subset X ⊆ Λ, define its T -infimum X ⊆ L r as:

We say that X is bounded iff there exists an L ∈ L such that M ≤ T L for all M ∈ X .

Now we have:

Theorem 4. 3.16 (Stability). Let C be an n-context and fix non-empty bounded X 1 , . . . , X n ⊆ L. For all M 1 , . . . , M n ∈ L s.t. (for i = 1, . . . , n)

Proof. We do not write it again, because it is exactly the same proof as we did for λ-calculus in Theorem 3.3.37. Remark, in particular, that is uses the "non-interference assumption" (Assumption 4) as well as the notion of rigids.

Once all the Assumptions will be proven for λµ-calculus, we will get "for free" the Stability property (Theorem 4.4.62).

The resource λµ-calculus

In Example 2 we already remarked that the syntax of λµ-calculus is of the shape of those considered in the previous Section 4. [START_REF]Second goal: prove, with an argument formalizable in PA 32[END_REF]. Same for contexts and reduction, which clearly satisfies Assumption 1. We turn to consider now the resource approximation of this calculus. It is natural to treat the µ-abstraction constructor as linear, so we only have to linearize applications, just like one does in resource λ-calculus. Definition 4.4.1. The set λµ r of resource λµ-terms is defined by:

where [t, . . . , t] ∈ !λµ r . Resource terms are considered up to renaming of variables and names. Resource contexts are defined as expected. For ν a variable or a name, the degree deg ν (t) ∈ N of ν in t, is defined as the number of (free) occurrences of ν in t.

This definition is of the shape of Definition 4.3.1. Same for resource contexts. The following is easily proven. Lemma 4.4.2. Every λµ r -term t has the following shape:

where p is either a variable, or a λ-redex or a µ-redex. p is called the head redex of t if it is a λµredex, and it is called the head variable of t otherwise. The sequence λ x 1 .µα 1 . β 1 |. . . λ x k .µα k . β k | * || is called the head of t. The same holds for λµ-terms as well.

Corollary 4.4.15 (Strong normalisation). If t → r t + T then m(t) > m(t ). Therefore, the resource reduction → r on sums is strongly normalising.

Proof. The only case in which m(•) may remain constant is along a ρ r -reduction, but in this case deg µ (t) strictly decreases, so t → r t + T entails m(t) > m(t ). Now one concludes as usual: if we associate the multiset [ m(t) | t ∈ T] with any sum T (in particular, a single element sum), it is immediate to see that if T → r S, then the multiset associated with T is strictly smaller, in the multiset order, than the one associated with S (the empty multiset 1 being associated with the empty sum 0). Therefore the well-foundeness of the multiset order (since the order on m(•) is well-founded) gives the non-existence of infinite (non-trivial) reductions.

Let us see some properties of the measure m(•).

However, there are cases in which m(c t ) = m(t) even if c = ξ. For example, taking c = λx.ξ one has m(c t ) = 1 = m(t) for all t ∈ λµ r not containing any bags. This is exactly why, in the following, we will consider a slightly different size, called ms (defined in Corollary 4.4.19).

Lemma 4.4.17. Let c = c ξ be a single-hole resource context and t ∈ λµ. Then:

Proof. Easily checked, thanks to the clear fact that if b is the occurrence of a bag in c, then

An immediate consequence of the previous lemma is the following: Lemma 4.4.18. Let c be a single-hole context and t, s λµ-terms s.t.

In the following, we will need a strong normalising measure which, in addition, satisfies the properties of the following Corollary 4.4.19. However, the previous Lemma 4. 4.16 shows that m(•) is not adapted for that. This is why we operate a last slight modification.

First, let us consider the size sz(t) ∈ N ≥1 of resource λµ-terms. We mean the analogous of the size of λ-terms, that is, the same of Remark 3.3.3 with the additional clause: sz(µα. β |s|) := 1 + sz(s). Of course sz(t) = 1 iff t is a variable, and for all c single-hole context, sz(c t ) ≥ sz(t) where the equality holds iff c = ξ. Now we have: Corollary 4.4.19. Define a measure ms(•) of λµ-terms as:

ordered lexicographically (and thus well-founded). Then:

1. t is a variable iff ms(t) takes its minimal value (which is (1, 0, 1)).

2. For all single-hole context c = c ξ , we have ms(c t ) ≥ ms(t), and the equality holds iff c = ξ. This measure satisfies thus the wanted properties, and we will use it when needed.

Confluence Due to the presence of three different reductions, the confluence or our resource λ-calculus is not easy. Another difficulty is raised from the fact that we placed ourselves in a qualitative setting, that is, with idempotent sums, so that we cannot always reduce a sum component-wise. This is why we split the problem of the confluence in two steps: first, we show that the quantitative resource λµ-calculus (that is, where sum is not idempotent, and thus coefficients matter) is confluent; second, we show that its confluence implies the confluence of the calculus with no coefficients. Actually, since our calculus is strongly normalising, we will be able to just consider the local confluence. Before attacking the first step, let us give the necessary definitions and make some remarks.

Definition 4.4.20. The quantitative resource λµ-calculus is (with the notations of Definition 3.2.2) N λµ r . That is, the only difference with usual sums (2 λµ r ) is that now "+" is non-idempotent 12 . We define the three base-case reductions

is defined exactly as in Definition 4.4.6, while → + λ r and → + µ r are defined as in Definition 4.4.6, except for the fact that the linear substitution and linear named application are replaced with a modified version of them, which we denote respectively t [ u]/x + and t + α [ u]. They are defined in the next Definition 4.4.23.

The contextual union of the base-reductions → + λ r , → + µ r , → + ρ r forms a reduction → + r on λµ r × N λµ r which is extended to all N λµ r × N λµ r simply by setting t + S → + r T + S whenever t → + r T (that is, we dropped the condition t / ∈ S since now coefficients matter).

For the following Definition 4.4.23, we need the following terminology: Remember that the writing [u 1 , . . . , u k ] means that we have fixed an enumeration u 1 , . . . , u k of the k elements (counted with their multiplicity) of the bag. Now, with respect to this enumeration, we say that the w.c.

In order to lighten the notations we will often employ the following notation: when we use W : {1, . . . , k} -→ {0, . . . , n} in order to generate a w.c. of [u 1 , . . . , u k ] (w.r.t. the written enumeration), then we denote W by W : (u 1 , . . . , u k ) -→ {0, . . . , n}, by W : ( u) -→ {0, . . . , n}. when we do not precise the elements of [ u]. In this case, the above defined w.c. of [u 1 , . . . , u k ] generated by W , is denoted by

We will also write, as usual, [ w i ] =: [w i 1 , . . . , w i h i ] (for some h i ∈ N). In the case [ u] = 1, we write W : () -→ {0, . . . , n} and we say that there is exactly one w.c. generated by W , which is (1, . . . , 1).

where W : ( u) -→ {1, . . . , n}. Fix now a W : ( u) -→ {1, . . . , n} (together with its generated w.c.) and consider each of the n + 1 elements of the sum on j. We write the case for j = 0, but the other cases are exactly the same. Since j = 0, the element is

. . ] and by inductive hypothesis we have:

Now summing up all the elements for j = 0, . . . , n and W : ( u) -→ {1, . . . , n} we obtain the following sum:

Using again Remark 4.4.40 plus Figure 4.1, the above sum becomes:

which is the desired result.

Induction on s.

Case s variable: impossible.

Case s = λ-abstraction: straightforward by Now that we have the confluence (in particular, the fact that every term has at most one → + r -normal form) of the qualitative resource calculus (that is, of (N λµ r , → + r )), we can prove the local confluence of the qualitative one, that is, of (2 λµ r , → r ). In order to do so, we introduce a reduction ⇒⊆ N λµ r × N λµ r which → + r -reduces in one step all the occurrences of a term t of a quantitative sum in the same way.

In the following, supp(T) ∈ 2 λµ r is the support of a sum T ∈ N λµ r , that is, the set of all its addends (with no coefficients) 25 . Definition 4.4.44. The reduction ⇒⊆ N λµ r × N λµ r is defined as the contextual closure of the reduction in Figure 4.3 (where m ∈ N, t ∈ λµ r and T, S ∈ N λµ r ). 1. ⇒ ⊆ + r .

2. If T → r S in 2 λµ r , then for all m t ∈ N (with t ∈ T), we have

with supp(S ) = S.

Proof. Both properties simply follow from the definition of ⇒.

Corollary 4.4.46. The reduction → r in 2 λµ r is locally confluent.

Proof. Let T 1 r ← t → r T 2 in 2 λµ r . Since we know that → r is strongly normalising (Corollary 4.4.15), there are (in 2 λµ r ) reductions T 1 r S 1 and T 2 r S 2 , with S 1 , S 2 r-normal.

Therefore by Lemma 4.4.45(2), we have (in

for some S 1 , S 2 ∈ N λµ r s.t. supp(S i ) = S i . But then, since S i is r-normal, S i must be → + rnormal. Now because of Corollary 4.4.43, it must be S 1 = S 2 , and therefore S 1 = supp(S 1 ) = supp(S 2 ) = S 2 . Hence, we found a common reduct of T 1 , T 2 .

We can now finally infer the confluence of the reduction → r .

Qualitative Taylor expansion

We define the qualitative Taylor expansion of λµ-calculus following Definition 4.3.2. That is, we define the map T : λµ → P(λµ r ) as:

25 That is, supp(T) is T when considered with an idempotent sum.

Case M = µβ. α |P | (with β = α):

µβ.

Case M = P Q:

(by inductive hypothesis)

We prove that Assumption 3 holds.

Proposition 4.4.49. Assumption 3 holds in λµ-calculus. That is, if M → base N , then:

1. for all s ∈ T (M ) there exist T ⊆ T (N ) s.t. s r T

2. for all s ∈ T (N ) there is s ∈ T (M ) s.t. s r s + T for some sum T ⊆ T (N ).

Therefore, Proposition 4.3.5 lifts the statement to all →.

Proof. We have three subcases, corresponding to the three cases of the base-reduction.

(

s , and µα.

Proof.

1. Induction on P , similar to as it is done in [START_REF] Ehrhard | Uniformity and the Taylor expansion of ordinary lambda-terms[END_REF]. The previous statement may seem strange at first sight, because one would expect (3) (which is the item used in the proof of Theorem 4.4.51, together with (1)) to be an indutive step of (2). However, (3) is not an inductive step of (2), simply because η |p| / ∈ λµ r . This is due to the fact that we are in λµ-calculus and not in Saurin's Λµ-calculus. One could be then tempted to state it in Λµ-calculus, so only with item (2). In this case, since p would be in Λµ and not just in λµ, (3) would in fact be an inductive step of ( 2), but still this is not what we need: in fact when we use [START_REF]Second goal: prove, with an argument formalizable in PA 32[END_REF] Proof. We have the three base-case reductions: Case t = (µα. β |p|)[ q] and T = µα. β |p| α [ q]. So it must be M = (µα. β |P |)Q with p ∈ T (P ) and [ q] ∈ ! T (Q). Now thanks to Lemma 4.4.48 we can take N := µα.( β |P |) α Q.

Case t = (λx.p)[ q] and T = p [ q]/x , or case t = µγ. α |µβ. η |p|| and T = µγ. η |p|{α/β}. Exactly as above, thanks to Lemma 4.4.48.

In particular thus, from Section 4.3 we have that: (since the ρ-reduction is confluent, there is only one such head λµ .)

2-We add the following rule: In λ-calculus, = τ is the λ-theory equating Böhm trees. In particular, it is sensible (i.e. it equates all unsolvables). We will see (Corollary 4.4.61) that in our case it is still sensible. Definition 4.4.55. A λµ-term M is a head normal form ( hnf for short) iff there are no ρredexes in its head (remember Lemma 4.4.2) and it has a head variable. We define the exact same notion for λµ r . Definition 4.4.56. The head reduction is the partial function H : λµ → λµ obtained defining H(M ) via the following algorithm:

1. ρ-reduce the leftmost ρ-redex in the head of M , if there is one 2. otherwise, λµ-reduce the head redex of M , if there is one 3. otherwise, H(M ) is not defined.

H(M ) is not defined iff M is a hnf. We say that head reduction starting on M terminates iff there is a (necessarily unique) n ≥ 0 s.t. H n (M ) is a hnf. Here we mean as usual that H 0 (M ) := M .

We extend these definitions to resource terms by setting H(t) := ∅ whenever t is a hnf. Moreover, we set H 0 (t) := t ∈ 2 Λ r and, for n ≥ 0 28 :

It is clear that we have H 1 (t) = H(t), and that

H n (t ).

Remark 4.4.57. Observe that if t is a hnf (in particular, if it is normal), then t → r H(t), because by definition H(t) = 0. On the contrary, if t is not a hnf, then by definition of H (it reduces the leftmost redex), we have t → r H(t). In conclusion, we have:

Observe that of course it is possible that t → r H(t) = 0, for instance take t = (λx.

x[x])[y].

Lemma 4.4.58. If s only contains empty bags (if any) and s ∈ nf r (t), then s ∈ H n (t) for some n ≥ 0.

Proof. If t is a hnf, we can easily conclude: since any eventual bag of s is empty, and since reductions cannot erase non-empty bags (because linear ), the fact that s ∈ nf r (t) entails that already t contains only empty bags. But in a hnf the reduction can only take place inside some bag, so it actually must be s = t. Therefore, s ∈ s = t = H 0 (t) and we are done taking n := 0.

So we are left with the case in which t is not hnf. In this case we know that t → r H(t). By confluence, H(t) r nf r (t). But since s ∈ nf r (t), there is some t 1 ∈ H(t) s.t. s ∈ nf r (t 1 ). Now we can reason as in the beginning, splitting in two cases: either t 1 is a hnf, in which case we reason exactly as in the first four lines of the proof: by linearity we get s = t 1 ∈ H(t), and we are done taking n := 1. Or t 1 is not a hnf. In this case we can reason again as before, obtaining a t 1 → r H(t 1 ), H(t 1 ) r nf r (t 1 ) and a t 2 ∈ H(t 1 ) s.t. s ∈ nf r (t 2 ). The reader can look at Figure 4.5. We can keep going with the same splits: if t 2 is hnf, we are done taking n := 2; if t 2 is not hnf, we obtain a new t 3 as before. Now, the generation of such a new t i+1 from the previously generated t i cannot continue forever: we claim that there must be some m ∈ N for which t m is hnf. If this is the case, the proof is concluded because we can take n := m as already mentioned. To see that such an m does exist, one simply remarks that at each time we have t i → r H(t i ) and t i+1 ∈ H(t i ). But the well-founded measure m(•) is strictly decreasing along reductions, which precisely means that we obtain the strictly decreasing sequence:

Therefore, it must terminate (because the order is well-founded) on some m(t m ), for some m ∈ N (in Figure 4.5 we have the case m = 3), and we are done as already explained.

123

The following proposition shows that in λµ-calculus one can define a notion of solvability which is analogous to the one in λ-calculus.

Proposition 4.4.60. For M ∈ λµ, the following are equivalent:

1. M = λµρ H with H hnf 2. Head reduction starting on M terminates 3. NFT (M ) = ∅.

Proof.

(1⇒2). By confluence M and H have a common λµρ-redex M 0 . Since H is a hnf, M 0 is too. Let s 0 be the unique resource λµ-term in T (M 0 ) s.t. all its bags (if any) are empty. This term clearly exists. Note that, by construction, s 0 is λµρ-normal. By repeatedly applying Proposition 4.4.49 one can check that we obtain an s ∈ T (M ) s.t. s 0 ∈ nf r (s). Now, by Lemma 4.4.58, s 0 ∈ H n (s) for some n ≥ 0. By repeatedly applying Lemma 4.4.59, we find that s 0 ∈ H n (T (M )) = T (H n (M )). And being s 0 a hnf, so it must be H n (M ).

(2⇒3). We know that = τ is a λµ-theory, so if M H with H hnf (this is the hypothesis that head-reduction starting from M terminates), we have M = τ H, and it is immediate that NFT (H) = 0 because H is hnf.

(3⇒1). If NFT (M ) = 0 there is t ∈ T (M ) s.t. nf r (t) = 0. By Corollary 4.4.53, M N for some N ∈ λµ s.t. nf r (t) ⊆ T (N ). So T (N ) contains at least a hnf, and thus N must be a hnf too.

We call M ∈ λµ solvable iff it satisfies any of the previous equivalent conditions of Lemma 4.4.60. Otherwise, M is called unsolvable.

Corollary 4.4.61. The λµ-theory = τ is sensible (that is, it equates all unsolvable terms).

Proof. Immediate by Lemma 4.4.60.

Stability and Perpendicular Lines Property

Stability We have all the necessary assumptions in order to immediately have that the Stability property holds in λµ-calculus.

Remembering the notation of Definition 4.3.15, Theorem 4.3.16 takes the form:

Theorem 4.4.62 (Stability). Let C be an n-ary λµ-context and fix non-empty bounded X 1 , . . . ,

We immediately obtain the non implementability of the following parallel-or, for which we use the usual encoding of couples as (M, N ) := λz.zM N .

Corollary 4.4.63 (No parallel-or in λµ-calculus). There is no Por ∈ λµ s.t. for all M, N ∈ λµ,

Proof. Exactly the same already shown for λ-calculus.

CHAPTER 4. THE RESOURCE APPROXIMATION FOR λµ-CALCULUS

The perpendicular Lines Property We already discussed the PLP in the setting of λcalculus. We are going to prove that the exact same statement holds in λµ-calculus, that is, if a term λz 1 . . . z n .F ∈ λµ, seen as the function M ∈ λµ n / =τ -→ (λ z.F ) M ∈ λµ/ =τ , is constant on n "perpendicular lines", then it is constant everywhere. Another way to see it is as a weak form of sequentiality. The proof is a simple readaptation of the one already given for λ-calculus.

The following lemma (and its proof) is the analogue of Lemma 3.3.12.

Lemma 4.4.64.

The following is the version of Lemma 3.3.12 for the current framework, whose proof follows the same lines.

Lemma 4.4.65. Fix z := z 1 , . . . z n distinct variables and let t ∈ λµ r . Suppose that:

iii. there are {M ij } 1≤i =j≤n ⊆ λµ s.t. the function mapping M ∈ λµ n / =τ to (λ z.F ) M ∈ λµ/ =τ is constant on the following "perpendicular lines" of λµ n / =τ :

Then

Proof. Induction on the size ms(t) of t ∈ λµ r .

Case ms(t) = (1, 0, 1). Then t is a variable (Corollary 4.4.19). If t = z i for some i then the i-th line of (4.1) gives the contradiction:

for all Z ∈ λµ. Hence, it must be deg

Case ms(t) > (1, 0, 1). By (i) there is u ∈ nf r (t

) for all j = 1, . . . , m. Now there are two possibilities: either y = z i for some i = 1, . . . , n, either y = z i for all i.

Suppose y = z i . Then, for q := q 1 , . . . , q m fresh variables, we can chose Z := λ q.True ∈ λµ (or Z := True if m = 0) in the i-th line l i of (4.1), and since by (iii) λ z.F is constant (mod = τ ) on l i , we can compute its value as:

where we set Q ij := Q j {M i1 /z 1 , . . . , (λ q.True)/z i , . . . , M in /z n }. The first equality holds because F λµρ Q and = τ is finer than = λµρ (Corollary 4.3.6), and the second equality holds because y = z i . In the same way, choosing Z := λ q.False ∈ λµ in l i we find that the value (mod = τ ) of λ z.F on l i is λµ|False|. But this is impossible because True = τ False.

Therefore, it must be y = z i for all i. Note that wlog m ≥ 1 (indeed if m = 0, from the fact that y = z i for all i we already get deg z i (u) = 0 and, as u ∈ nf r (t) and in λµ r one cannot erase non-empty bags, we are done). Now fix i ∈ {1, . . . , n} and Z , Z ∈ λµ.

Similarly as before, choosing Z := Z in l i and using what we found so far, putting

But by construction it is:

So if we remember that Z , Z were generic in λµ, the previous equalities Q ij = Q ij precisely say that λ z.Q j is constant on the line l i . And since this holds for all i = 1, . . . , n, we have just found that λ z.Q j satisfies (iii). And since we have equalities Q ij = Q ij for all j = 1, . . . , m, we have that each λ z.Q 1 , . . . , λ z.Q k satisfies (iii). We can now comfortably apply the induction hypothesis on any s ∈ [ u j ]. In fact, as [ u j ] is normal, nf r (s) = 0, i.e. (i); as [ u j ] ∈ ! T (Q j ), we have s ∈ T (Q j ), i.e. (ii); and we just found that λ z.Q j satisfies (iii); finally, s is a strict subterm of u ∈ nf r (t), thus (Corollary 4.4.19) ms(s) < ms(u) ≤ ms(t). Therefore, the inductive hypothesis gives deg z

Theorem 4.4.66 (Perpendicular Lines Property). Suppose that for some fixed {M ij } 1≤i =j≤n , {N i } 1≤i≤n ⊆ λµ, the system of equations:

holds for all Z ∈ λµ. Then:

Proof. It follows from Lemma 4.4.65 as done in [START_REF] Barbarossa | Taylor subsumes Scott, Berry, Kahn and Plotkin[END_REF].

PLP immediately entails the non implementability of the following parallel-or, a result which is known as folklore via arguments involving stable models: here we proved it solely via Taylor expansion. Secondly, fix f ∈ ASC(X, Y ). Then ε X is natural in X because of the equality If (ε X (a)) = {f (a)} = ε Y (f (a)) for a ∈ |X|, and µ X is natural in X because of the equality

Finally, let us check the three monad diagrams. For u ∈ SX, the first diagram for the unit ε is given by the immediate equality µ X (ε IX (u)) = u, and the second diagram for ε is given by the immediate equality µ X (Iε X (u)) = u. The third diagram is the equality µ

where U ∈ SI 2 X. Proposition 5.2.25. There is an equivalece of categories between RelASC and the Kleisli category ASC I of I , which is given by the functor: Let us make a last consideration. Observe that, once mathematics is formalized, it looks like an "explicitation" of the theorems from the axioms through purely formal manipulations; let us call this the analytical moment. In the creation of these explicitations one is guided by intuition, in what one could call the intuitionistic moment. A crucial situation, in this "dialogue" between intuition and formalities, is when one stumbles upon an undecidable question, and one has thus to decide if to take it as a new axiom, or not; let us call this the synthetic moment. In the analytic moment one can only obtain theorems which are either provable or disprovable inside the formal system one has decided to stay in. That is, only decidable formulas (w.r.t. the fixed system). Here the use of the terms "analytic" and "synthetic" should not be seen in the Girardian sense, but in the Kantian one: in a sense, the information given by a decidable formula is already "contained" in the axioms of the formal system, while the one of an undecidable formula is not.

From this point of view, the undecidability of interesting formal systems (that is, incompleteness) is the heart of the "mathematical progress" 55 , and the mathematics activity has the following alternating shape 56 : Synthetic moment; Analytic moment; Synthetic moment; Analytic moment; ... We recently found out that this point of view is quite close to the one expressed by the physician Müller in [START_REF] Müller | Undecidability and unpredictability: Not limitations, but triumphs of science[END_REF].

A natural question appears: how should one decide if to take or not an undecidable formula? Evidence from the mathematical practice indicates that the solution is usually made according to: either utility (in the sense of considering the results one can obtain with it); or experiments (typically, this occurs when one does applied mathematics). Remark that this is quite far from a Platonist view of mathematics, in which, being mathematical objects "really there" together with their true or false value, one cannot "choose" about an undecidable formula, but only "discover" if it is true or false 57 . On the contrary, this vision is much more on the lines of, for instance, Poincaré's conventionalism.

We can thus make another 58 "Kantian-like table":

A posteriori A priori Analytic moment / Proofs Synthetic moment Experiments Utility Here the distinction a priori/a posteriori is with respect to experience. It is interesting to note that, as Kant's epistemological problem was how to justify his synthetic a priori, and as Girard's logical problem is how to justify his synthetic a priori (the usage), here the problem is again how to justify the a synthetic a priori moment (and it is handled considering the utility).

List of Figures