Modules over Monads and Initial Semantics

Save this PDF as:

Size: px
Start display at page:

Transcription

1 Modules over Monads and Initial Semantics André Hirschowitz 1 and Marco Maggesi 2 1 UMR 6621, CNRS, Université de Nice Sophia Antipolis 2 Università degli Studi di Firenze Abstract. Inspired by the classical theory of modules over a monoid, we introduce the natural notion of module over a monad. The associated notion of morphism of left modules ( linear natural transformations) captures an important property of compatibility with substitution, not only in the so-called homogeneous case but also in the heterogeneous case where terms and variables therein could be of different types. In this paper, we present basic constructions of modules and we give a first account on how modules allow a (slightly?) new point of view concerning higher-order syntax and semantics. 1 Introduction Substitution is a major operation. Its relevance to computer sciences has been stressed constantly (see e.g. [7]). Mathematicians of the last century have coined two strongly related notions which capture the formal properties of this operation. The first one is the notion of monad, while the second one is the notion of operad. We focus on the notion of monad. A monad in the category C is a monoid in the category of endofunctors of C (see section 2 below) and as such, has right and left modules. A priori these are endofunctors (in the same category) equipped with an action of the monad. In fact, we introduce a slightly more general notion of modules over a monad, based on the elementary observation that we can readily extend the notion of a right action of a monad in C to the case of a functor from any category B to C, and symmetrically the notion of a left action of a monad in C to the case of a functor from C to any category D. We are mostly interested in left modules. As usual, the interest of the notion of left module is that it generates a companion notion of morphism. We take as morphisms those natural transformations among (left) modules which are compatible with the structure, namely which commute with substitution (we also call these morphisms linear natural transformations). We propose here a first reference for basic properties of categories of left modules, together with basic examples of morphisms of left modules, taken in the area of (possibly higher-order) syntax and semantics. Indeed, there is currently a search for a convincing discipline suited to the programming of theorem-provers in this area [2], and we hope to show, through examples in Haskell and in Coq, the adequacy of the language of left modules for the encoding of higher-order syntax and semantics. In section 2, we briefly review the theory of monads and their algebras. In section 3, we develop the basic theory of modules. In section 4, we present the treatment of first-order typed syntax based on modules. In section 5, we present our treatment of higher-order untyped syntax based on modules. In section 6, we show, on the example of the λ-calculus, how semantics can be approached via modules. In section 7, we give a very preliminary account, again on the example of the λ- calculus, of the approach via modules to higher-order typed syntax. Finally in section 8, we discuss related and future works. In the appendix, we describe the formal proof in the Coq proof assistant of one of our examples. 2 Monads and algebras We briefly recall some standard material about monads and algebras. Experienced readers may want to skip this section or just use it as reference for our notations. Mac Lane s book [15] can be used as reference on this material. We fix a category C which admits sums and a final object. The main examples of such a category are the category of sets, the category of endofunctors Set Set and the relative categories Set/D considered in section 4.

2 2.1 The category of monads A monad over C is a monoid in the category C C of endofunctors of C. In more concrete terms: Definition 1 (Monad). A monad R = R, µ, η over C is given by a functor R: C C, and two natural transformations µ: R 2 R and η : I R such that the following diagrams commute: µr R 3 Rµ R 2 R 2 µ R µ ηr I R 1 R R 2 R Rη µ 1 R R I The natural transformations µ and η are often referred to as product (or composition) and unit of the monad R. In the programming language Haskell, their names are join and return respectively. Given a monad R and an arrow f : X RY, we define the morphism bind f : RX RY given by bind f := µ Rf. The equations Rf = bind(η f), µ X = bind 1 RX (1) express the functor and monad structure of R in terms of the bind and η operators. Moreover, we have the following associativity and unity equations for bind bind g bind f = bind(bind g f), bind η X = 1 RX, bind f η = f (2) for any pair of arrows f : X RY and g : Y RZ. In fact, it is easy to verify that equations (2) actually imply the functor and monad axioms on R: Proposition 1. Let R: obj(c) obj(c) be a mapping (where obj(c) denotes the set of objects of C), and bind, η two operators bind: X, Y : obj(c), (X RY ) (RX RY ), η : X : obj(c), X RX satisfying (2). Then the operators defined by equations (1) turn R into a monad. Proof. Let us give the explicit calculation showing that the operators defined by equations (1) satisfy the axioms of monad. First, we check that R verifies the functor axioms: let X, Y, Z be object of C and f : X Y, g : Y Z two arrows. Then R 1 X = bind(η X 1 X ) = bind η X = 1 X, Rg Rf = bind(η Z g) bind(η Y f) = bind(bind(η Z g) η Y f) = bind(η Z g f) = R(g f). For each object X, we have µ X η RX = bind 1 RX η X = 1 RX, µ R η X = bind 1 RX bind(η RX η X ) = bind(bind 1 RX η RX η X ) = bind(1 RX η X ) = 1 RX which proves that η is a left and right identity for µ. Finally, the associativity of µ follows from the following calculation µ X µ RX = bind 1 RX bind 1 RRX = bind(bind 1 RX 1 RRX ) = bind(bind 1 RX ), µ X R µ X = bind 1 RX bind(η RX µ X ) = bind(bind 1 RX η RX bind 1 RX ) = bind(1 RX bind 1 RX ) = bind(bind 1 RX ). Definition 2 (Morphisms of monads). A morphism from the monad P to the monad R (both over C) is a natural transformation φ: P R which respects composition and unit, i.e., such that the following diagrams commute: P 2 µ P P φφ φ R 2 R µ R φ P R η P ηr I It can be easily checked that these morphisms yield a category, the category of monads over C.

3 2.2 Examples of monads Now we focus on some examples and constructions of monads which are especially relevant for the rest of the paper. Example 1. The identity functor I : C C is perhaps the most trivial example of monad (with µ and η given by the identity natural transformation). Definition 3. For any object X in a category D, we define the constant functor X : C D to be the functor which assigns X to every object of C and 1 X to every arrow of C. If D has a final object, then is the final functor (in the functor category C D). Example 2. In particular, if C = D the endofunctor has a natural structure of monad (with µ and η given by the universal property of ) and it is the final monad over C. Example 3 (Maybe monad). The endofunctor X X +, which takes an object in C and adds one point has a natural structure of monad over C. Borrowing from the terminology of the library of the programming language Haskell, we call it the Maybe monad. The monomorphisms X X + and X+, for each object X in C, give the natural transformations I Maybe and Maybe. Both are morphisms of monads. Example 4 (Lists). To construct the monad of lists L (over Set), first take the functor L: Set Set satisfying, for each set X L(X) = Σ n N X n = + X + X X + X X X +... So L(X) is the set of all finite lists with elements in X. Then consider as composition the natural transformation µ: L L L given by the join (or flattening) of lists of lists: µ[[a 1,... ], [b 1,... ],..., [z 1,... ]] = [a 1,..., b 1,...,..., z 1,... ]. The unit η : I L is the collection of singleton maps η X : x X [x] L(X). Example 5 (Lambda Calculus). This example will be worked out with the necessary details in section 5.3, but let us give early some basic ideas (already present e.g. in [1]). We denote by F V (M) the set of free variables of a λ-term M. For a fixed set X, consider the collection of λ-terms (modulo α-conversion) with free variables in X: SLC(X) := {M F V (M) X} Given a set X we take as unit morphism η X : X SLC(X) the application assigning to an element x X the corresponding variable in SLC(X). Every map f : X Y induces a morphism SLC(f): SLC(X) SLC(Y ) ( renaming ) which makes SLC an endofunctor. The tautological substitution of free variables gives us a natural transformation µ X : SLC(SLC(X)) SLC(X). With this structure SLC is a monad and we call it monad of the syntactic λ-calculus. Moreover, the monad composition is compatible with the β and η conversions. Then, taking the quotient by the β, or the η, or the βη equivalence relation we get three new monads, and the four associated projections are monad morphisms. In particular, we denote by LC the quotient by βη-equivalence and we call it monad of the semantic λ-calculus (cfr. section 6). The formal development illustrated in the appendix contains the proofs of these facts (see sections 9.3 and 9.4). Definition 4 (Derivative). We define the derivative F of an endofunctor F : C C to be the functor F = F Maybe. We can iterate the construction, and denote by F (n) the n-th derivative.

4 Example 6 (The derivative of a monad). The derivative of a monad R has an induced structure of monad defined as follows 3. The unit of R η is simply the composition I R R. Next consider the natural transformation γ : Maybe R R Maybe. Then the action R R R is given by R Maybe R Maybe RγMaybe The necessary verifications are not difficult. R R Maybe Maybe µ Rµ Maybe R Maybe. For our purpose it is relevant to observe that very simple natural transformations among some of our main examples may fail to be morphisms of monads. We take the following as paradigmatic example. Example 7 (Abstraction is not a morphism of monads). Abstraction on λ-terms gives a natural transformation abs: SLC SLC which takes a λ-term M SLC(X + ) and binds the variable. This fails to be a morphism of monads because it does not respect substitution in the sense of monads: a careful inspection reveals that the transformation SLC(SLC(X + ) + ) binds all stars under a single abstraction while SLC(SLC(X + ) + ) µ SLC(X + ) abs SLC(X) abs abs µ SLC(SLC(X)) SLC(X) not. In fact, we will see later that SLC is a left module over SLC and abs is a SLC-linear morphism. 2.3 The category of algebras Here we fix a monad R over C. Definition 5 (Algebra). An algebra over R is given by an object A and a morphism ρ: R(A) A in C such that the following diagrams commute: R 2 (A) Rρ R(A) A η A R(A) µ A R(A) ρ A ρ ρ 1 A A Definition 6. Let A, B be two algebras over a monad R. An arrow f : A B in C is said to be a morphism of algebras if it is compatible with the associated actions, i.e., if the following diagram commutes: R(A) R(f) R(B) ρ A A f B ρ B As we will see later (example 17), algebras can be regarded as a special kind of right modules. Example 8 (Monoids). In the category of sets, algebras over the monad L of lists are sets equipped with a structure of monoid; given a monoid A, the corresponding action L(A) A is the product (sending a list to the corresponding product). 3 Modules over monads In this section, we fix a monad R over a category C as above, and we introduce and study R- modules. 3 This corresponds to the MaybeT monad transformer in Haskell.

5 3.1 Left modules We start first by concentrating ourselves on left modules over R. Definition 7 (Left modules). A left R-module in D is given by a functor M : C D equipped with a natural transformation ρ: M R M, called the action, which is compatible with the monad composition, more precisely, we require that the following diagrams commute M R 2 Mµ M R M R Mη M I ρr M R ρ M We will refer to the category D as the range of M. ρ M ρ 1 M Remark 1. The companion definition of modules over an operad (c.f. e.g. [17, 9]) follows easily from the observation [19] that operads are monoids in a suitable monoidal category. By the way, this monoidal structure is central in [6]. Given a left R-module M, we can introduce the mbind operator which, to each arrow f : X RY, associates the arrow mbind f := MX MY defined by mbind f := ρ Y Mf. We have the following relation which expresses the module action in terms of the mbind operator: The axioms of left module imply the following equations over mbind ρ X = mbind 1 RX. (3) mbind g mbind f = mbind(bind g f), mbind η X = 1 MX (4) Conversely, verifications similar to those of proposition 1 lead to: Proposition 2. Let M : obj(c) obj(d) be a mapping (obj( ) denotes the set of objects) and mbind be an operator mbind: X Y : obj(c), (X RY ) (MX MY ) satisfying (4). Then the operator defined by equation (3) turns M into an R-module. Example 9. We can see our monad R as a left module over itself (with range C), which we call the tautological module. Example 10. Any constant functor W : C D, W D is a left R-module (in an obvious way). Example 11. For any functor F : D E and any left R-module M : C D, the composition F M is a left R-module (in the evident way). Example 12 (Derived module). As for functors and monads, derivation is well-behaved also on left modules: for any left R-module M, the derivative M = M Maybe has a natural structure of left R-module where the action M R M is the composition M Maybe R Mγ M R Maybe ρmaybe M Maybe and γ is the natural morphism from Maybe R to R Maybe. Definition 8 (Morphisms of left modules). We say that a natural transformation of left R- modules τ : M N is linear if it is compatible with substitution, in the sense that the following diagram commutes: M R τr N R We take linear natural transformations as left module morphisms. ρ M M τ N ρ N

6 Remark 2. Here the term linear refers to linear algebra: linear applications between modules over a ring are group morphisms compatible with the action of the ring. This is compatible with the usual flavor of the word linear (no duplication, no junk) as the following example shows. Example 13. Here we choose for R the monad on Set generated by two binary constructions + and and we build (by recursion) a natural transformation n: R R as follows: for a variable x, n(x) is x+x, while for the other two cases we have n(a+b) = n(a) n(b) and n(a b) = n(a)+n(b). It is easily verified that n is a non-linear natural transformation (check the diagram against n(var(x x))). Example 14. We easily check that the natural transformation of a left module into its derivative is linear. Note that there are two natural inclusions of the derivative M into the second derivative M. Both are linear. Definition 9 (Category of left modules). We check easily that linear morphisms between left R-modules with the same range yield a subcategory of the functor category. We denote by Mod D (R) the category of left R-modules with range D. Definition 10 (Product of left modules). We check easily that the cartesian product of two left R-modules as functors (having as range a cartesian category D) is naturally a left R-module again and is the cartesian product also in the category Mod D (R). We also have finite products as usual. The final left module is the product of the empty family. Example 15. Consider again the monad of lists L. The concatenation of two lists is a L-linear morphism L L L. Definition 11 (Evaluaton). Given an R-module M with range in Set, we have a natural evaluation morphism eval: M R M, where M is the derivative of M. We omit the proof of the following result. However the details can be found in the source of the formalization described in the appendix. Proposition 3. Derivation yields a cartesian endofunctor on the category of left R-modules with range in a fixed cartesian category D. 3.2 Right modules Let R be a monad over a category C. The definition of right module is similar to that of left module. Definition 12 (Right modules). A right R-module with corange D is given by a functor M : D C equipped with a natural transformation ρ: R M M which makes the following diagrams commutative: R 2 M µm R M I M ηm R M Rρ R M ρ M ρ 1 M We remark that for any right R-module M and any object X D the image M(X) is an R- algebra. Then a right R-module is simply a functor from the corange category D to the category of R-algebras. Example 16. Our monad R is a right module over itself. Example 17. If A is an R-algebra, then for any category D the constant functor A from D to C with value A has a natural structure of right R-module. In particular, we can identify our algebra with the corresponding functor A: C, where is the category with one object and one arrow. Example 18. Let φ: R P be a morphism of monads. Then P is a right and left R-module with actions given respectively by P R φr R R µ R R and R P P φ R R µ R R. ρ M

7 Definition 13 (Morphisms of right modules). A morphism of right R-modules is a natural transformation τ : M N which is compatible with substitution, i.e., such that the following diagram commutes: Rτ R M R N ρ M M τ We check easily that module morphisms among right R-modules with the same corange yield a subcategory of the functor category. In fact, this category of right modules with corange D is isomorphic with the category of functors from D to the category of R-algebras. N ρ N 3.3 Limits and colimits of left modules Limits and colimits in the category of left modules can be constructed pointwise: Proposition 4 (Limits and colimits of left modules). If D is complete (resp. cocomplete), then Mod D (R) is complete (resp. cocomplete). Proof. Let D be a complete category and G: I Mod D (R) be a diagram of left modules over the index category I. For any object X C we have a diagram G(X): I D and for any arrow f : X Y in C we have a morphism of diagrams G(X) G(Y ). So define U(X) := lim G(X) Next, given an arrow f : X R(Y ), we have an induced morphism of diagrams G(X) G(Y ) by the module structure on each object of the diagram. This induces a morphism mbind f : U(X) U(Y ). It is not hard to prove that mbind satisfies the module axioms and that U is the limit of G. The colimit construction is carried out analogously. A similar statement holds for right modules (under the relevant assumption on C) but we don t need it. 3.4 Base change Proposition 5 (Base change). Given a morphism f : A B of monads and a left B-module M, we have an A-action on M given by M A Mf M B ρ M M. We denote by f M the resulting A-module and we refer to f as the base change operator. Proof. Our thesis is the commutativity of the diagram M B A ρa MfA M A A Mff M B B Mµ M A Mf Mµ M B M A Mf ρb M B which follows from the commutativity of the three pieces: M is a left B-module, the map from M(B( )) M( ) is functorial, and f is a morphism. Definition 14 (Base change (functoriality)). We upgrade the base change operator into a functor f : Mod D (B) Mod D (A) by checking that if g : M N is a morphism of left B-modules, then so is the natural transformation f g : f M f N. The following results are easy consequences of the definitions. Proposition 6. The base change functor commutes with products and with derivation. Proposition 7. Any morphism of monads f : A B yields a morphism of left A-modules, still denoted f, from A to f B. ρ M ρ

8 4 First-order typed syntax In this section we check the point of view of modules against first-order typed syntax. We fix a set D of types. From now on, we will say modules instead of left modules. Definition 15 (D-sets). We call D-set any family of sets indexed by D. Alternatively a D-set is a set over D, namely a set A equipped with a map from A to D. This map assigns to each element of A its type (or degree). We have a category Set/D of D-sets, where morphisms are applications preserving the type. For each D-set X and d D, we denote by X d the component of X in degree d. We denote by τ d the corresponding functor from Set/D to Set. Definition 16 (D-arities and D-signatures). A D-arity is a finite non-empty list of elements in D. We use a colon to single out the first element of the list, which stands for the type of the result, while the other elements of the list stand for the types of the arguments. A signature is a family of arities, i.e., a pair Σ = (O, α) where α(o) = (b(o) : a(o)) is an arity for every o O. Definition 17 (Elementary D-modules). We say that a monad over Set/D is a D-monad. Given a D-monad R, and a type d D we denote by R d the R-module with range in Set obtained by applying τ d to R: R d := τ d R. More generally, for a list a := (a 1,..., a n ) of elements in D, we write R a for the product R a1 R an. These modules are our elementary modules over R. Definition 18 (Representation of a D-arity). Given a D-monad R, we define a representation of the D-arity α = (b : a 1,..., a n ) = (b : a) in R to be a morphism of modules: r : n R ai i=1 R b or, in other words: r : R a R b. We also say that r is a construction of arity α in R. Definition 19 (Representation of a D-signature). A representation of the D-signature Σ = (O, α) in the D-monad R, consists of, for each o in O, a representation of the D-arity α(o) in R. Definition 20 (The category of representations). Given a signature Σ = (O, α), we build the category Rep Σ D of representations of Σ in D-sets as follows. Its objects are D-monads equipped with a representation of Σ. A morphism from (R, r) to (S, s) is a morphism f from R to S compatible with the representations in the sense that, for each o in O, with α(o) = (b : a 1,..., a n ), the following diagram of R-modules commutes: n i=1 R a i R b f n i=1 S a i f S b where the horizontal arrows come from the representations and the vertical arrows come from f. Proposition 8. These morphisms, together with the obvious composition, turn Rep Σ D into a category. Theorem 1. The category Rep Σ D has an initial object which we call the inductive D-monad generated by Σ, and denote by ˆΣ. As usual, our syntactic object Rep Σ D comes with corresponding recursion and induction principles which we omit to state explicitly. Example 19. For typed lists, we take for set of types the inductive set generated by the grammar τ = list τ. We have to describe the arities of the constructors nil and cons: for each t τ, we want a constructor nil t of arity (list t :) and a constructor cons t of arity (list t : t, list t). (5)

9 5 Higher-order untyped syntax In the previous section we have considered typed constructions without bindings. Here we consider untyped constructions with bindings. We first explain in general our approach to the syntax associated to a (binding) signature. Then we discuss, on the example of the λ-calculus, how it can be implemented in Haskell. 5.1 The general construction Definition 21 (HO-arities). We define an arity (or HO-arity) to be a N-arity, namely a nonempty list of integers. We say the arity is raw when the first element of the list is zero. Given an arity (b : a 1,..., a n ), we denote by raw(a) the (raw) arity (0 : a 1,..., a n, 0 b ), where 0 b stands for a list of b zeros. The intended meaning of the integers (except for the first one) is the number of extra variables in each argument which are bound by the construction. The difference with the definition in [6] is that our arity provides one more integer whose intended meaning is the number of extra formal arguments of the output of the operation. Example 20. This point of view allows for instance to consider, in the λ-calculus, the app 1 construction, namely the avatar of the usual app which has only one argument, and to assign to it the arity (1 : 0), meaning that it expects a single argument where no extra variable is bound, and that its output expects one extra formal argument. Definition 22 (Binding signatures). We define a (binding) signature Σ = (O, α) to be a family of arities α: O N N. Here N stands for the set of lists of integers. A signature is said to be raw if it consists of raw arities. For a signature Σ = (O, α), we denote by raw(σ) the raw signature (O, o raw(α(o))). Next, we describe what are the elementary modules in the present context. Definition 23 (Elementary modules). Given a monad R over Set, and a possibly empty list a := (a 1,..., a n ) of integers, we denote by R (a) the R-module with range in Set obtained as product of derivatives: R (a) := R (a1) R (an). Definition 24 (Representation of an arity). Given a monad R over Set, we define a representation of the arity α = (b : a) in R to be a module morphism r : R (a) R (b). We also say that r is a construction of arity α in R. In case b = 0 we say that r is a raw construction in R. Definition 25 (The category of representations). Given a signature Σ = (O, α), we build the category Mon Σ of representations of Σ as follows. Its objects are monads equipped with a representation of Σ. A morphism from (R, r) to (S, s) is a morphism from R to S compatible with the representations in the sense that, for each o in O with α(o) = (b : a), the following diagram commutes: R (a) R (b) (6) f S (a) f S (b) where the horizontal arrows come from the representations and the vertical arrows come from f (it is used here that f commutes with derivation and products). Proposition 9. These morphisms, together with the obvious composition, turn Mon Σ into a category which comes equipped with a forgetful functor to the category of monads.

10 Theorem 2. Let Σ be a (binding) signature. Then the category Mon Σ of representations of Σ has an initial object ˆΣ. The proof starts by reduction to the case of a raw signature. This reduction is discussed in the next subsection. In the case of a raw signature, the initial object is constructed by means of trees in the usual way, and the required properties are derived by induction or recursion on the height of the tree. At first glance, this result looks like a particular case of the previous theorem concerning typed signatures, namely the case where the set of types is the set of sets. The first difference is in the fact that the set of sets is definitely not a small set of types. Even if it were, there would remain a second difference: we do not consider monads on the same category. With respect to the first difference, we just have to be cautious when proposing our initial object, in order to build a functor with values in the category of small sets. With respect to the second difference, we have to be cautious with non-raw arities. This is why we start by reducing to the case of a raw signature. 5.2 Flattening Definition 26 (Flattening a representation of an arity). Given a monad R and a representation r of the arity α = (b : a 1,..., a n ) = (b : a) in R, we define the natural transformation raw(r): R (a) R b R as the composition R (a) R b r R b R (b) R b eval R It is easily checked that raw(r) is a representation of raw(α). Example 21. A representation of (2 :) in SLC is given by the app 0 : SLC (2) construction. The associated representation of raw(2 :) = (0 : 0, 0) is the usual app. Proposition 10 (Flattening is bijective for arities). Given a monad R and an arity α = (b : a 1,..., a n ) the raw map defined above defines a bijection from the set of representations of α in R to the set of representations of raw(α) in R. Definition 27 (Flattening a representation of a signature). Given a monad R and a representation r of the signature Σ = (O, α) we define raw(r) to be the family o raw(r(o)) which is a representation of raw(σ). Proposition 11 (Flattening is bijective for signatures). Given a monad R and a signature Σ = (O, α) the raw map defined above defines a bijection from the set of representations of Σ in R to the set of representations of raw(σ) in R. Proposition 12. Given a signature Σ, the raw construction extends as a functor Mon Σ Mon raw Σ from the category or representations of Σ to the category of representations of raw(σ). Furthermore, this functor is an isomorphism of categories. From the previous proposition, it follows that theorem 2 can be proved by reduction to the special case of a raw signature. 5.3 Implementation in Haskell In this section we concentrate on the special case of the signature Σ = ((0 : 0, 0), (0 : 1)) and explain how it can be implemented in Haskell [13]. The associated initial monad ˆΣ given by theorem 2 will be denoted by SLC (SLC standing for syntactic λ-calculus, cfr. the example in section 2). We consider SLC(X) as the set of λ-terms with free variables taken from X where

11 the Σ-representation morphism SLC SLC + SLC SLC gives the familiar constructors of the λ-calculus in the nameless encoding [3], namely, the SLC-linear natural transformations app: SLC SLC SLC, abs: SLC SLC. We denote by var the unit of the monad which is the constructor of variables. The bind operator of SLC gives us the substitution (or instantiation) of free variables and the monad axioms together with the SLC-linearity of the app and abs constructors give us an elegant and concise description of the basic properties of substitution, namely: bind f (var v) = f v bind (app x y) = app (bind f x) (bind f y) bind var x = x bind f (abs x) = abs (mbind f x) bind g (bind f x) = bind (bind g f) x Notice the mbind appearing in the substitution rule for abs which is where the SLC-module structure of the derivative SLC comes into play. All this can be condensed in the following ten lines of Haskell code implementing altogether the (nested) datatype for λ-terms and the substitution algorithm. module SLC where import Monad (liftm) data SLC a = Var a App (SLC a) (SLC a) Abs (SLC (Maybe a)) instance Monad SLC where return = Var Var x >>= f = f x App x y >>= f = App (x >>= f) (y >>= f) Abs x >>= f = Abs (x mbind f) mbind :: SLC (Maybe a) -> (a -> SLC b) -> SLC (Maybe b) mbind x f = x >>= maybe (Var Nothing) (liftm Just. f) The last line of this code defines the structure of SLC-module over the derivative SLC. We recall from [13] that Maybe is the inductive datatype defined by data Maybe a = Nothing Just a and maybe is the associated catamorphism maybe :: b -> (a -> b) -> Maybe a -> b The operator liftm :: (Monad m) => (a -> b) -> m a -> m b is the functor action on maps, so the de Bruijn bump of free variables is given by the term liftm Just :: (Monad m) => m a -> m (Maybe a) 6 Exponential monads In the present section, we illustrate, through the example of the λ-calculus, how modules and morphisms among them interplay with semantics. We also show how this point of view may be implemented in Coq [5]. For any set X, consider the equivalence relation βη on SLC(X) given by the reflexive symmetric transitive closure of β and η conversions and define LC(X) := SLC(X)/ βη. It can be shown that βη is compatible with the structure of SLC so LC has a structure of monad, and that the projection SLC LC is a morphism of monads. Application and abstraction of SLC induces two LC-linear morphims which we still denote by app and abs.

12 Now the key fact is that the abstraction abs: LC LC is a linear isomorphism. In fact, it is easy to construct its inverse app 1 : LC LC : app 1 x = app(ˆx, ) where x ˆx denotes the natural inclusion LC LC. The equation abs app 1 = 1 LC clearly corresponds to the η-rule while the other equation app 1 abs = 1 LC can be considered the ultimate formulation of the β-rule. In fact, there is a more classical formulation of the β-rule which can be stated as the commutativity of the diagram LC LC abs LC LC LC app eval LC We can present this situation from a more syntactical point of view. For this, consider the category of exponential monads: an exponential monad is a monad R endowed with an R-linear isomorphism with its derivative exp R : R R. A morphism of exponential monads is a monad morphism f such that R f f P exp R R f f P exp P is a commutative diagram of R-modules (we are implicitly using the compatibility of base change with derivation). Theorem 3. The monad LC is initial in the category of exponential monads. We have developed a formal proof of the above theorem in the Coq proof assistant [5], which is discussed in the appendix. Here we just single out the code for the definition of exponential monad, which shows how our abstract point of view may be readily implemented: Record ExpMonad : Type := { exp_monad :> Monad; exp_abs : Mod_Hom (Derived_Mod exp_monad) exp_monad; exp_app : Mod_Hom exp_monad (Derived_Mod exp_monad); exp_eta : forall X (x : exp_monad X), exp_abs _ (exp_app _ x) = x; exp_beta : forall X (x : Derived_Mod exp_monad X), exp_app _ (exp_abs _ x) = x }. 7 Typed higher-order syntax and semantics So far we have discussed first-order typed syntax and higher-order untyped syntax. Here we will give a glance at higher-order typed syntax. We first consider the case where the constructions of types are considered out of the syntax, then we say a few words concerning the more general case with constructors of types and of terms.

13 7.1 Simply typed lambda calculus We denote by θ the set of simple types θ := θ θ. Following [22], we consider the syntactic typed λ-calculus as an assignment V SLC θ (V ), where V = t θ (V ) t is a θ-set (of typed variables) while SLC θ (V ) = θ (V )) t t θ(slc is the set of typed λ-terms (modulo α-conversion) built on free (typed) variables taken in V. With the usual substitution, SLC θ becomes a monad on the category Set/θ. Now, given a type t we have SLC t (X) := (SLC θ (X)) t which gives a functor over θ-sets, which is an elementary module over SLC θ. And given two types s, t, we have the transformation app s,t : SLC s t SLC s SLC t which is linear. For the abs construction, we need a notion of partial derivative for a module. For a module M over θ-sets, and a type t θ, we set δ t M(V ) := M(V + t ) where V + t is obtained from V by adding one element with type t. It is easily checked how δ t M is again a module. Now, given two types s and t, it turns out that abs s,t : δ s SLC t SLC s t is linear. We omit the description of the category where this representation is initial. As in the untyped case, we can consider the functor LC θ obtained by quotienting modulo βη conversion. This is again a monad over the category of θ-sets and the natural quotient transformation SLC θ LC θ is a morphism of monads. For this semantic monad, the above module morphisms induce semantic counterparts: app s,t : LC s t LC s LC t and abs s,t : δ s LC t LC s t. In this framework it is possible to give a typed counterpart of our theorem 3, see [22]. 7.2 Typed lambda calculus revisited Our final example of typed monad is just a glance to more general typed λ-calculi. The point here is that the set of types is no more fixed. Thus our monads take place in the category Fam of set families: an object in Fam is an application p: I Set while a morphism m: p p is a pair (m 0, m 1 ) with m 0 : I I, and m 1 : (i : I)p(i) p (m 0 (i)). We say that I is the set of types of p: I Set. From Fam there are two forgetful functors T, T ot: Fam Set where T (p: I Set) := I and T ot(p) := i T (p) p(i), and a natural transformation proj : T ot T, defined by proj(p) = p in the obvious sense. Given a monad R on Fam, we thus have a morphism of R-modules proj R : T ot R T R. We need also two may-be monads on Fam: the first one F F adds one (empty) type (tnew) to F, while the second one, F F / adds one type (tnew) with one element (new). Given a monad R on Fam, we thus have two derived R-modules: R := F R(F ) and R / := F R(F / ) Now when should we say that R is a λ-calculus in this context? At least we should have a module morphism arrow : (T R) 2 T R. and a module morphism for abstraction, abs : R / R (the arity for application is not so simple). We hope this example shows the need for new notions of arity and signature, as well as the new room opened by modules for such concepts. 8 Related and future works We have introduced the notion of module over a monad, and more importantly the notion of linearity for transformations among such modules and we have tried to show that this notion is ubiquitous as soon as syntax and semantics are concerned. Our thesis is that the point of view

14 of modules opens some new room for initial semantics, as we sketched for the λ-calculus (see also [12]). Despite the natural ideas involved, the notion of module over a monad has been essentially ignored till now: the only mention of modules over monads we have been able to find is on a blog by Urs Schreiber. 4 On the other hand, modules over operads have been introduced more than ten years ago by M. Markl ([16, 17]) and are commonly used by topologists (see e.g. [9, 14, 4]). In [8], such modules over operads have been considered, under the name of actions, in the context of semantics. The idea that the notion of monad is suited for modelling substitution concerning syntax (and semantics) is deeply rooted in the folklore and appears at least in [1, 3]. It has been retained by many other recent contributions concerned with syntax, although some other settings have been considered. Notably in [6] the authors work within a setting roughly based on operads (although they do not write this word down; the definition of operad is on Wikipedia; operads and monads are not too far from each other). As they mention, their approach is, to some extent, equivalent to an approach through monads. It has been applied e.g. in [21] and generalized e.g. in [20]. Another approach to syntax with bindings, initiated by Gabbay and Pitts [10], relies on a systematic consideration of freshness, an issue which is definitely ignored in the monadic or operadic approach. Let us also mention the contributions [11, 18] where a much more general notion of signature than ours is treated in a (higher-order) algebra-oriented approach. Future work should integrate such general signatures in a module-oriented approach. As far as applications to semantics are concerned, the typed case is of major interest. In this respect, the approach of [6] has been successfully applied to the semantics of process calculi, see e.g. [8]. Future work should definitely check our module-oriented approach against this and other related applications. Finally let us mention one more track which we envision: it can be checked that the β relation on the syntactic λ-calculus may be upgraded into a monad on the category of preordered sets. It seems clear that this construction is pertinent for the study of the operational semantics of the λ-calculus. 9 Appendix: Formal proof of theorem 3 In this section we present our formal proof of theorem 3 in the Coq proof assistant [5]. We recall the statement of the theorem The monad LC of semantic untyped λ-calculus is an initial object in the category of exponential monads. We include here only a small fraction of the code without proofs. The full sources can be found at Structure of the formalisation The structure of our proof can be outlined in the following four major parts: 1. axioms and support library; 2. formalisation of monads, modules and exponential monads; 3. formalisation of syntactic and semantic λ-calculus; 4. the main theorem. The second and third part are independent of each other. As for what this paper is concerned, the first part (files Misc.v, Congr.v) can be considered as an extension of the Coq system for practical purposes. This part contains some meta-logical material (tactics and notations) and declares the following axioms: functional choice, proof irrelevance, dependent extensionality. We include here their declarations: 4

16 9.3 Formalisation of the λ-calculus This part contains the definition of the syntactic and the semantic untyped λ-calculus (files Slc.v and Lc.v respectively). We use nested datatypes to encode λ-terms in the Calculus of (Co)Inductive Constructions as already shown in the Haskell fragment of section 5.3 for which we report below the equivalent Coq code. Notice that this encoding can be considered a typeful variant of the well-known de Bruijn encoding [3]. As does the de Bruijn encoding, it represents λ-terms modulo α-conversion. Inductive term (X : Set) : Set := var : X -> term X app : term X -> term X -> term X abs : term (option X) -> term X. Fixpoint fct (X Y : Set) (f : X -> Y) (x : term X) { struct x } : term Y := match x with var a => var (f a) app x y => app (x //- f) (y //- f) abs x => abs (x //- (optmap f)) end where "x //- f" := f x). Definition shift X (x : term X) : term (option X) := x X. Definition comm (X Y : Set) (f : X -> term Y) (x : option X) : term (option Y) := match x with Some a => shift (f a) None => var None end. Fixpoint subst (X Y : Set) (f : X -> term Y) (x : term X) { struct x } : term Y := match x with var x => f x app x y => app (x //= f) (y //= f) abs x => abs (x //= comm f) end where "x //= f" := f x). Once the basic definitions are settled, we prove a series of basic lemmas which includes the associativity of substitution, which is the most important ingredient in proving that the λ-calculus is a monad. Lemma subst_subst : forall (X Y Z : Set) (f : X -> term Y) (g : Y -> term Z) (x : term X), x //= f //= g = x //= fun u => f u //= g. Finally, we introduce the beta-eta equivalence relation on lambda-terms Inductive lcr (X : Set) : term X -> term X -> Prop := lcr_var : forall a : X, var a == var a lcr_app : forall x1 x2 y1 y2 : term X, x1 == x2 -> y1 == y2 -> app x1 y1 == app x2 y2 lcr_abs : forall x y : term (option X), x == y -> abs x == abs y lcr_beta : forall x y : term X, Beta x y -> x == y lcr_eta : forall x : term X, abs (app1 x) == x lcr_sym : forall x y : term X, y == x -> x == y lcr_trs : forall x y z : term X, lcr x y -> lcr y z -> lcr x z where "x == y" := _ x y). Let r X : Eqv (term X) := Build_Eqv X) X) X) X). and prove some compatibility lemmas with constructors and other operations. The compatibility with substitution is stated as follows: Lemma lcr_subst : forall (X Y : Set) (f g : X -> term Y) (x y : term X), (forall u, f u == g u) -> x == y -> x //= f == y //= g. 9.4 Proof of the main theorem The fourth and last part summarises the results proved in the other parts and proves the main theorem. It starts by proving that our definitions of syntactic and semantic lambda calculus provide indeed two monads, denoted SLC and LC respectively, and by showing that the two transformations abs and app 1 are indeed morphisms of modules:

18 7. Marcelo P. Fiore. On the structure of substitution. Invited address for the 22nd Mathematical Foundations of Programming Semantics Conf. (MFPS XXII), DISI, University of Genova (Italy). 8. Marcelo P. Fiore and Daniele Turi. Semantics of name and value passing. In Logic in Computer Science, pages , Benoit Fresse. Koszul duality of operads and homology of partition posets. In Homotopy theory: relations with algebraic geometry, group cohomology, and algebraic K-theory, volume 346 of Contemp. Math., pages Amer. Math. Soc., Providence, RI, Murdoch Gabbay and Andrew Pitts. A new approach to abstract syntax involving binders. In 14th Symposium on Logic in Computer Science (Trento, 1999), pages IEEE Computer Soc., Los Alamitos, CA, Neil Ghani and Tarmo Uustalu. Explicit substitutions and higher-order syntax. In MERLIN 03: Proceedings of the 2003 ACM SIGPLAN workshop on Mechanized reasoning about languages with variable binding, pages 1 7, New York, NY, USA, ACM Press. 12. André Hirschowitz and Marco Maggesi. The algebraicity of the lambda-calculus. arxiv:math/ v1, S. Peyton Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, Muriel Livernet. From left modules to algebras over an operad: application to combinatorial Hopf algebras. arxiv:math/ v1, Saunders Mac Lane. Categories for the working mathematician, volume 5 of Graduate Texts in Mathematics. Springer-Verlag, New York, second edition, Martin Markl. Models for operads. arxiv:hep-th/ v1, Martin Markl. A compactification of the real configuration space as an operadic completion. arxiv:hepth/ v1, Ralph Matthes and Tarmo Uustalu. Substitution in non-wellfounded syntax with variable binding. Theor. Comput. Sci., 327(1-2): , V. A. Smirnov. Homotopy theory of coalgebras. Math. USSR Izv,, 27: , Miki Tanaka and John Power. A unified category-theoretic formulation of typed binding signatures. In MERLIN 05: Proceedings of the 3rd ACM SIGPLAN workshop on Mechanized reasoning about languages with variable binding, pages 13 24, New York, NY, USA, ACM Press. 21. Miki Tanaka and John Power. Pseudo-distributive laws and axiomatics for variable binding. Higher Order Symbol. Comput., 19(2-3): , Julianna Zsidó. Le lambda calcul vu comme monade initiale. Master s thesis, Université de Nice Laboratoire J. A. Dieudonné, 2005/06. Mémoire de Recherche master 2.

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic Lars Birkedal Rasmus Ejlers Møgelberg Rasmus Lerchedahl Petersen IT University Technical Report Series TR-00-7 ISSN 600 600 February 00

NOTES ON CATEGORIES AND FUNCTORS

NOTES ON CATEGORIES AND FUNCTORS These notes collect basic definitions and facts about categories and functors that have been mentioned in the Homological Algebra course. For further reading about category

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z DANIEL BIRMAJER, JUAN B GIL, AND MICHAEL WEINER Abstract We consider polynomials with integer coefficients and discuss their factorization

CHAPTER 5: MODULAR ARITHMETIC

CHAPTER 5: MODULAR ARITHMETIC LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN 1. Introduction In this chapter we will consider congruence modulo m, and explore the associated arithmetic called

Quotient Rings and Field Extensions

Chapter 5 Quotient Rings and Field Extensions In this chapter we describe a method for producing field extension of a given field. If F is a field, then a field extension is a field K that contains F.

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm. We begin by defining the ring of polynomials with coefficients in a ring R. After some preliminary results, we specialize

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

Andrew Pitts chapter for D. Sangorgi and J. Rutten (eds), Advanced Topics in Bisimulation and Coinduction, Cambridge Tracts in Theoretical Computer

Andrew Pitts chapter for D. Sangorgi and J. Rutten (eds), Advanced Topics in Bisimulation and Coinduction, Cambridge Tracts in Theoretical Computer Science No. 52, chapter 5, pages 197 232 ( c 2011 CUP)

Revision of ring theory

CHAPTER 1 Revision of ring theory 1.1. Basic definitions and examples In this chapter we will revise and extend some of the results on rings that you have studied on previous courses. A ring is an algebraic

o-minimality and Uniformity in n 1 Graphs

o-minimality and Uniformity in n 1 Graphs Reid Dale July 10, 2013 Contents 1 Introduction 2 2 Languages and Structures 2 3 Definability and Tame Geometry 4 4 Applications to n 1 Graphs 6 5 Further Directions

FIBER PRODUCTS AND ZARISKI SHEAVES

FIBER PRODUCTS AND ZARISKI SHEAVES BRIAN OSSERMAN 1. Fiber products and Zariski sheaves We recall the definition of a fiber product: Definition 1.1. Let C be a category, and X, Y, Z objects of C. Fix also

Row Ideals and Fibers of Morphisms

Michigan Math. J. 57 (2008) Row Ideals and Fibers of Morphisms David Eisenbud & Bernd Ulrich Affectionately dedicated to Mel Hochster, who has been an inspiration to us for many years, on the occasion

Linear Algebra I. Ronald van Luijk, 2012

Linear Algebra I Ronald van Luijk, 2012 With many parts from Linear Algebra I by Michael Stoll, 2007 Contents 1. Vector spaces 3 1.1. Examples 3 1.2. Fields 4 1.3. The field of complex numbers. 6 1.4.

The countdown problem

JFP 12 (6): 609 616, November 2002. c 2002 Cambridge University Press DOI: 10.1017/S0956796801004300 Printed in the United Kingdom 609 F U N C T I O N A L P E A R L The countdown problem GRAHAM HUTTON

Extraction of certified programs with effects from proofs with monadic types in Coq

Extraction of certified programs with effects from proofs with monadic types in Coq Marino Miculan 1 and Marco Paviotti 2 1 Dept. of Mathematics and Computer Science, University of Udine, Italy 2 IT University

Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

You know from calculus that functions play a fundamental role in mathematics.

CHPTER 12 Functions You know from calculus that functions play a fundamental role in mathematics. You likely view a function as a kind of formula that describes a relationship between two (or more) quantities.

Subsets of Euclidean domains possessing a unique division algorithm

Subsets of Euclidean domains possessing a unique division algorithm Andrew D. Lewis 2009/03/16 Abstract Subsets of a Euclidean domain are characterised with the following objectives: (1) ensuring uniqueness

Degree Hypergroupoids Associated with Hypergraphs

Filomat 8:1 (014), 119 19 DOI 10.98/FIL1401119F Published by Faculty of Sciences and Mathematics, University of Niš, Serbia Available at: http://www.pmf.ni.ac.rs/filomat Degree Hypergroupoids Associated

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

(LMCS, p. 317) V.1 First Order Logic This is the most powerful, most expressive logic that we will examine. Our version of first-order logic will use the following symbols: variables connectives (,,,,

11 Ideals. 11.1 Revisiting Z

11 Ideals The presentation here is somewhat different than the text. In particular, the sections do not match up. We have seen issues with the failure of unique factorization already, e.g., Z[ 5] = O Q(

FIBRATION SEQUENCES AND PULLBACK SQUARES. Contents. 2. Connectivity and fiber sequences. 3

FIRTION SEQUENES ND PULLK SQURES RY MLKIEWIH bstract. We lay out some foundational facts about fibration sequences and pullback squares of topological spaces. We pay careful attention to connectivity ranges

Defining Functions on Equivalence Classes. Lawrence C. Paulson, Computer Laboratory, University of Cambridge

Defining Functions on Equivalence Classes Lawrence C. Paulson, Computer Laboratory, University of Cambridge Outline of Talk 1. Review of equivalence relations and quotients 2. General lemmas for defining

Nominal Sets. c 2011 Andrew M. Pitts

Nominal Sets c 2011 Andrew M. Pitts Contents Preface page v 1 Permutations 1 1.1 The category of G-sets 1 1.2 Products and coproducts 3 1.3 Natural numbers 5 1.4 Functions 5 1.5 Power sets 6 1.6 Partial

University of Oslo MAT2 Project The Banach-Tarski Paradox Author: Fredrik Meyer Supervisor: Nadia S. Larsen Abstract In its weak form, the Banach-Tarski paradox states that for any ball in R, it is possible

ENRICHED CATEGORIES AND THE FLOYD-WARSHALL CONNECTION Vaughan Pratt Computer Science Dept. Stanford University April, 1989

ENRICHED CATEGORIES AND THE FLOYD-WARSHALL CONNECTION Vaughan Pratt Computer Science Dept. Stanford University April, 1989 Abstract We give a correspondence between enriched categories and the Gauss-Kleene-Floyd-Warshall

Introduction to Finite Fields (cont.)

Chapter 6 Introduction to Finite Fields (cont.) 6.1 Recall Theorem. Z m is a field m is a prime number. Theorem (Subfield Isomorphic to Z p ). Every finite field has the order of a power of a prime number

CONTENTS 1. Peter Kahn. Spring 2007

CONTENTS 1 MATH 304: CONSTRUCTING THE REAL NUMBERS Peter Kahn Spring 2007 Contents 2 The Integers 1 2.1 The basic construction.......................... 1 2.2 Adding integers..............................

Fair testing vs. must testing in a fair setting

Fair testing vs. must testing in a fair setting Tom Hirschowitz and Damien Pous Amsterdam, Novembre 2010 Laboratoire de Mathématiques Université de Savoie UMR 5127 Tom Hirschowitz and Damien Pous Fair

ON GALOIS REALIZATIONS OF THE 2-COVERABLE SYMMETRIC AND ALTERNATING GROUPS

ON GALOIS REALIZATIONS OF THE 2-COVERABLE SYMMETRIC AND ALTERNATING GROUPS DANIEL RABAYEV AND JACK SONN Abstract. Let f(x) be a monic polynomial in Z[x] with no rational roots but with roots in Q p for

Local periods and binary partial words: An algorithm

Local periods and binary partial words: An algorithm F. Blanchet-Sadri and Ajay Chriscoe Department of Mathematical Sciences University of North Carolina P.O. Box 26170 Greensboro, NC 27402 6170, USA E-mail:

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 1996-7 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are

The van Hoeij Algorithm for Factoring Polynomials

The van Hoeij Algorithm for Factoring Polynomials Jürgen Klüners Abstract In this survey we report about a new algorithm for factoring polynomials due to Mark van Hoeij. The main idea is that the combinatorial

Chapter 1. Logic and Proof

Chapter 1. Logic and Proof 1.1 Remark: A little over 100 years ago, it was found that some mathematical proofs contained paradoxes, and these paradoxes could be used to prove statements that were known

3. Prime and maximal ideals. 3.1. Definitions and Examples.

COMMUTATIVE ALGEBRA 5 3.1. Definitions and Examples. 3. Prime and maximal ideals Definition. An ideal P in a ring A is called prime if P A and if for every pair x, y of elements in A\P we have xy P. Equivalently,

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011 A. Miller 1. Introduction. The definitions of metric space and topological space were developed in the early 1900 s, largely

A NOTE ON TRIVIAL FIBRATIONS

A NOTE ON TRIVIAL FIBRATIONS Petar Pavešić Fakulteta za Matematiko in Fiziko, Univerza v Ljubljani, Jadranska 19, 1111 Ljubljana, Slovenija petar.pavesic@fmf.uni-lj.si Abstract We study the conditions

CROSS-EFFECTS OF HOMOTOPY FUNCTORS AND SPACES OF TREES. WARNING: This paper is a draft and has not been fully checked for errors.

CROSS-EFFECTS OF HOMOTOPY FUNCTORS AND SPACES OF TREES MICHAEL CHING WARNING: This paper is a draft and has not been full checked for errors. 1. Total homotop fibres of cubes of based spaces Definition

7. Some irreducible polynomials

7. Some irreducible polynomials 7.1 Irreducibles over a finite field 7.2 Worked examples Linear factors x α of a polynomial P (x) with coefficients in a field k correspond precisely to roots α k [1] of

Cellular objects and Shelah s singular compactness theorem

Cellular objects and Shelah s singular compactness theorem Logic Colloquium 2015 Helsinki Tibor Beke 1 Jiří Rosický 2 1 University of Massachusetts tibor beke@uml.edu 2 Masaryk University Brno rosicky@math.muni.cz

A CONSTRUCTION OF THE UNIVERSAL COVER AS A FIBER BUNDLE

A CONSTRUCTION OF THE UNIVERSAL COVER AS A FIBER BUNDLE DANIEL A. RAMRAS In these notes we present a construction of the universal cover of a path connected, locally path connected, and semi-locally simply

Prime Numbers. Chapter Primes and Composites

Chapter 2 Prime Numbers The term factoring or factorization refers to the process of expressing an integer as the product of two or more integers in a nontrivial way, e.g., 42 = 6 7. Prime numbers are

So let us begin our quest to find the holy grail of real analysis.

1 Section 5.2 The Complete Ordered Field: Purpose of Section We present an axiomatic description of the real numbers as a complete ordered field. The axioms which describe the arithmetic of the real numbers

Program equivalence in functional metaprogramming via nominal Scott domains

Program equivalence in functional metaprogramming via nominal Scott domains Steffen Gerhard Lösch Trinity College This dissertation is submitted for the degree of Doctor of Philosophy May 2014 To Niklas,

Introduction to Algebraic Geometry. Bézout s Theorem and Inflection Points

Introduction to Algebraic Geometry Bézout s Theorem and Inflection Points 1. The resultant. Let K be a field. Then the polynomial ring K[x] is a unique factorisation domain (UFD). Another example of a

3. Equivalence Relations. Discussion

3. EQUIVALENCE RELATIONS 33 3. Equivalence Relations 3.1. Definition of an Equivalence Relations. Definition 3.1.1. A relation R on a set A is an equivalence relation if and only if R is reflexive, symmetric,

Non-deterministic Semantics and the Undecidability of Boolean BI

1 Non-deterministic Semantics and the Undecidability of Boolean BI DOMINIQUE LARCHEY-WENDLING, LORIA CNRS, Nancy, France DIDIER GALMICHE, LORIA Université Henri Poincaré, Nancy, France We solve the open

Notes on Factoring. MA 206 Kurt Bryan

The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

Tree-representation of set families and applications to combinatorial decompositions

Tree-representation of set families and applications to combinatorial decompositions Binh-Minh Bui-Xuan a, Michel Habib b Michaël Rao c a Department of Informatics, University of Bergen, Norway. buixuan@ii.uib.no

ANAGRAMS: Dimension of triangulated categories

ANAGRAMS: Dimension of triangulated categories Julia Ramos González February 7, 2014 Abstract These notes were prepared for the first session of "Dimension functions" of ANAGRAMS seminar. The goal is to

Online publication date: 11 March 2010 PLEASE SCROLL DOWN FOR ARTICLE

This article was downloaded by: [Modoi, George Ciprian] On: 12 March 2010 Access details: Access Details: [subscription number 919828804] Publisher Taylor & Francis Informa Ltd Registered in England and

EMBEDDING COUNTABLE PARTIAL ORDERINGS IN THE DEGREES

EMBEDDING COUNTABLE PARTIAL ORDERINGS IN THE ENUMERATION DEGREES AND THE ω-enumeration DEGREES MARIYA I. SOSKOVA AND IVAN N. SOSKOV 1. Introduction One of the most basic measures of the complexity of a

Math 3000 Running Glossary

Math 3000 Running Glossary Last Updated on: July 15, 2014 The definition of items marked with a must be known precisely. Chapter 1: 1. A set: A collection of objects called elements. 2. The empty set (

The fundamental group of the Hawaiian earring is not free (International Journal of Algebra and Computation Vol. 2, No. 1 (1992), 33 37) Bart de Smit

The fundamental group of the Hawaiian earring is not free Bart de Smit The fundamental group of the Hawaiian earring is not free (International Journal of Algebra and Computation Vol. 2, No. 1 (1992),

SOME PROPERTIES OF FIBER PRODUCT PRESERVING BUNDLE FUNCTORS

SOME PROPERTIES OF FIBER PRODUCT PRESERVING BUNDLE FUNCTORS Ivan Kolář Abstract. Let F be a fiber product preserving bundle functor on the category FM m of the proper base order r. We deduce that the r-th

Equality and dependent type theory. Oberwolfach, March 2 (with some later corrections)

Oberwolfach, March 2 (with some later corrections) The Axiom of Univalence, a type-theoretic view point In type theory, we reduce proof-checking to type-checking Hence we want type-checking to be decidable

Definition: Group A group is a set G together with a binary operation on G, satisfying the following axioms: a (b c) = (a b) c.

Algebraic Structures Abstract algebra is the study of algebraic structures. Such a structure consists of a set together with one or more binary operations, which are required to satisfy certain axioms.

Finite Projective demorgan Algebras. honoring Jorge Martínez

Finite Projective demorgan Algebras Simone Bova Vanderbilt University (Nashville TN, USA) joint work with Leonardo Cabrer March 11-13, 2011 Vanderbilt University (Nashville TN, USA) honoring Jorge Martínez

ORDERS OF ELEMENTS IN A GROUP

ORDERS OF ELEMENTS IN A GROUP KEITH CONRAD 1. Introduction Let G be a group and g G. We say g has finite order if g n = e for some positive integer n. For example, 1 and i have finite order in C, since

Notes on Determinant

ENGG2012B Advanced Engineering Mathematics Notes on Determinant Lecturer: Kenneth Shum Lecture 9-18/02/2013 The determinant of a system of linear equations determines whether the solution is unique, without

it is easy to see that α = a

21. Polynomial rings Let us now turn out attention to determining the prime elements of a polynomial ring, where the coefficient ring is a field. We already know that such a polynomial ring is a UF. Therefore

INTRODUCTORY SET THEORY

M.Sc. program in mathematics INTRODUCTORY SET THEORY Katalin Károlyi Department of Applied Analysis, Eötvös Loránd University H-1088 Budapest, Múzeum krt. 6-8. CONTENTS 1. SETS Set, equal sets, subset,

Sets of Fibre Homotopy Classes and Twisted Order Parameter Spaces

Communications in Mathematical Physics Manuscript-Nr. (will be inserted by hand later) Sets of Fibre Homotopy Classes and Twisted Order Parameter Spaces Stefan Bechtluft-Sachs, Marco Hien Naturwissenschaftliche

3. Recurrence Recursive Definitions. To construct a recursively defined function:

3. RECURRENCE 10 3. Recurrence 3.1. Recursive Definitions. To construct a recursively defined function: 1. Initial Condition(s) (or basis): Prescribe initial value(s) of the function.. Recursion: Use a

EXERCISES FOR THE COURSE MATH 570, FALL 2010

EXERCISES FOR THE COURSE MATH 570, FALL 2010 EYAL Z. GOREN (1) Let G be a group and H Z(G) a subgroup such that G/H is cyclic. Prove that G is abelian. Conclude that every group of order p 2 (p a prime

ON THE EMBEDDING OF BIRKHOFF-WITT RINGS IN QUOTIENT FIELDS

ON THE EMBEDDING OF BIRKHOFF-WITT RINGS IN QUOTIENT FIELDS DOV TAMARI 1. Introduction and general idea. In this note a natural problem arising in connection with so-called Birkhoff-Witt algebras of Lie

The Mathematics of Origami

The Mathematics of Origami Sheri Yin June 3, 2009 1 Contents 1 Introduction 3 2 Some Basics in Abstract Algebra 4 2.1 Groups................................. 4 2.2 Ring..................................

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Summary Summary Last Lecture sequent calculus Automated Reasoning Georg Moser Institute of Computer Science @ UIBK Winter 013 (Normalisation and Strong Normalisation) let Π be a proof in minimal logic

MATHEMATICAL INDUCTION AND DIFFERENCE EQUATIONS

1 CHAPTER 6. MATHEMATICAL INDUCTION AND DIFFERENCE EQUATIONS 1 INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATHEMATICAL INDUCTION AND DIFFERENCE EQUATIONS 1 Introduction Recurrence

Chapter 6 Finite sets and infinite sets. Copyright 2013, 2005, 2001 Pearson Education, Inc. Section 3.1, Slide 1

Chapter 6 Finite sets and infinite sets Copyright 013, 005, 001 Pearson Education, Inc. Section 3.1, Slide 1 Section 6. PROPERTIES OF THE NATURE NUMBERS 013 Pearson Education, Inc.1 Slide Recall that denotes

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

Sets and Cardinality Notes for C. F. Miller

Sets and Cardinality Notes for 620-111 C. F. Miller Semester 1, 2000 Abstract These lecture notes were compiled in the Department of Mathematics and Statistics in the University of Melbourne for the use

Mathematical Induction

Chapter 2 Mathematical Induction 2.1 First Examples Suppose we want to find a simple formula for the sum of the first n odd numbers: 1 + 3 + 5 +... + (2n 1) = n (2k 1). How might we proceed? The most natural

System Description: Delphin A Functional Programming Language for Deductive Systems

System Description: Delphin A Functional Programming Language for Deductive Systems Adam Poswolsky 1 and Carsten Schürmann 2 1 Yale University poswolsky@cs.yale.edu 2 IT University of Copenhagen carsten@itu.dk

Relations Graphical View

Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Introduction Recall that a relation between elements of two sets is a subset of their Cartesian product (of ordered pairs). A binary

FUNCTIONAL ANALYSIS LECTURE NOTES: QUOTIENT SPACES

FUNCTIONAL ANALYSIS LECTURE NOTES: QUOTIENT SPACES CHRISTOPHER HEIL 1. Cosets and the Quotient Space Any vector space is an abelian group under the operation of vector addition. So, if you are have studied

It is not immediately obvious that this should even give an integer. Since 1 < 1 5

Math 163 - Introductory Seminar Lehigh University Spring 8 Notes on Fibonacci numbers, binomial coefficients and mathematical induction These are mostly notes from a previous class and thus include some

It is time to prove some theorems. There are various strategies for doing

CHAPTER 4 Direct Proof It is time to prove some theorems. There are various strategies for doing this; we now examine the most straightforward approach, a technique called direct proof. As we begin, it

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy Kim S. Larsen Odense University Abstract For many years, regular expressions with back referencing have been used in a variety

In mathematics you don t understand things. You just get used to them. (Attributed to John von Neumann)

Chapter 1 Sets and Functions We understand a set to be any collection M of certain distinct objects of our thought or intuition (called the elements of M) into a whole. (Georg Cantor, 1895) In mathematics

4.1 Modules, Homomorphisms, and Exact Sequences

Chapter 4 Modules We always assume that R is a ring with unity 1 R. 4.1 Modules, Homomorphisms, and Exact Sequences A fundamental example of groups is the symmetric group S Ω on a set Ω. By Cayley s Theorem,

Cartesian Products and Relations

Cartesian Products and Relations Definition (Cartesian product) If A and B are sets, the Cartesian product of A and B is the set A B = {(a, b) :(a A) and (b B)}. The following points are worth special

A Note on Context Logic

A Note on Context Logic Philippa Gardner Imperial College London This note describes joint work with Cristiano Calcagno and Uri Zarfaty. It introduces the general theory of Context Logic, and has been

Computing divisors and common multiples of quasi-linear ordinary differential equations

Computing divisors and common multiples of quasi-linear ordinary differential equations Dima Grigoriev CNRS, Mathématiques, Université de Lille Villeneuve d Ascq, 59655, France Dmitry.Grigoryev@math.univ-lille1.fr

Factoring Polynomials

Factoring Polynomials Sue Geller June 19, 2006 Factoring polynomials over the rational numbers, real numbers, and complex numbers has long been a standard topic of high school algebra. With the advent

THE FUNDAMENTAL THEOREM OF ALGEBRA VIA PROPER MAPS

THE FUNDAMENTAL THEOREM OF ALGEBRA VIA PROPER MAPS KEITH CONRAD 1. Introduction The Fundamental Theorem of Algebra says every nonconstant polynomial with complex coefficients can be factored into linear

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS John A. Beachy Northern Illinois University 2014 ii J.A.Beachy This is a supplement to Abstract Algebra, Third Edition by John A. Beachy and William D. Blair

Algebraic K-Theory of Ring Spectra (Lecture 19)

Algebraic K-Theory of ing Spectra (Lecture 19) October 17, 2014 Let be an associative ring spectrum (here by associative we mean A or associative up to coherent homotopy; homotopy associativity is not

ACTA UNIVERSITATIS APULENSIS No 15/2008 PRODUCTS OF MULTIALGEBRAS AND THEIR FUNDAMENTAL ALGEBRAS. Cosmin Pelea

ACTA UNIVERSITATIS APULENSIS No 15/2008 PRODUCTS OF MULTIALGEBRAS AND THEIR FUNDAMENTAL ALGEBRAS Cosmin Pelea Abstract. An important tool in the hyperstructure theory is the fundamental relation. The factorization

Math 231b Lecture 35. G. Quick

Math 231b Lecture 35 G. Quick 35. Lecture 35: Sphere bundles and the Adams conjecture 35.1. Sphere bundles. Let X be a connected finite cell complex. We saw that the J-homomorphism could be defined by

MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction.

MODULAR ARITHMETIC 1 Working With Integers The usual arithmetic operations of addition, subtraction and multiplication can be performed on integers, and the result is always another integer Division, on

Chapter 13: Basic ring theory

Chapter 3: Basic ring theory Matthew Macauley Department of Mathematical Sciences Clemson University http://www.math.clemson.edu/~macaule/ Math 42, Spring 24 M. Macauley (Clemson) Chapter 3: Basic ring

Regular Languages and Finite Automata

Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

London Mathematical Society Impact150 Stories 1 (2015) 9 14 C 2015 Author(s) doi:10.1112/i150lms/t.0002 Categorical Monads and Computer Programming Nick Benton Abstract The categorical notion of monad

Domain Theory: An Introduction

Domain Theory: An Introduction Robert Cartwright Rebecca Parsons Rice University This monograph is an unauthorized revision of Lectures On A Mathematical Theory of Computation by Dana Scott [3]. Scott

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

CHAPTER 3 Methods of Proofs 1. Logical Arguments and Formal Proofs 1.1. Basic Terminology. An axiom is a statement that is given to be true. A rule of inference is a logical rule that is used to deduce

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement