From e85efa276dec29a333044d1cef97f9461c69a00b Mon Sep 17 00:00:00 2001 From: gheber Date: Mon, 4 Apr 2016 18:50:52 -0500 Subject: [PATCH] Added Francis' changes. --- examples/05_Coalgebras_and_cobars.ipynb | 101 +++++++++++------------- 1 file changed, 45 insertions(+), 56 deletions(-) diff --git a/examples/05_Coalgebras_and_cobars.ipynb b/examples/05_Coalgebras_and_cobars.ipynb index e16c09f..8a7211f 100644 --- a/examples/05_Coalgebras_and_cobars.ipynb +++ b/examples/05_Coalgebras_and_cobars.ipynb @@ -8,9 +8,7 @@ "\n", "## Introduction\n", "\n", - "The implementation of coalgebras and cobars follows closely the section 6 of the paper\n", - "*Effective Homology: a survey* (Available\n", - "at the web site at the web site at the web site at the web site [**https://www-fourier.ujf-grenoble.fr/~sergerar/**](https://www-fourier.ujf-grenoble.fr/~sergerar/)).\n", + "The implementation of coalgebras and cobars follows closely the section 9 of the paper *Constructive Homological Algebra and Applications* (available at [**http://arxiv.org/pdf/1208.3816**](http://arxiv.org/pdf/1208.3816)).\n", "\n", "## Coalgebras\n", "\n", @@ -34,12 +32,11 @@ "\n", "### The function `build-clgb`\n", "\n", - "To facilitate the construction of instances of the `COALGEBRA` class, the software provides the function `build-clgb`,\n", - "\n", + "To facilitate the construction of instances of the `COALGEBRA` class, the program provides the function `build-clgb`,\n", "```commonlisp\n", - "(build-clgb :cmpr cmpr :basis basis :bsgn bsgn :intr-dffr intr-dffr :dffr-strt dffr-strt :intr-cprd intr-cprd :cprd-strt cprd-strt :orgn orgn)\n", + "(build-clgb :cmpr cmpr :basis basis :bsgn bsgn :intr-dffr intr-dffr :dffr-strt dffr-strt \n", + " :intr-cprd intr-cprd :cprd-strt cprd-strt :orgn orgn)\n", "```\n", - "\n", "defined with keyword parameters. The returned value is an instance of type `COALGEBRA`. The keyword arguments are:\n", "\n", "- *cmpr*, a comparison function for generators.\n", @@ -52,27 +49,25 @@ "- *orgn*, an adequate comment list.\n", "\n", "The function `build-clgb` calls the function `build-chcm` and with the help of the function\n", - "`build-mrph` builds the coproduct morphism of degree 0, to settle the slot `crpd` of the instance. According to the definition, the source slot of the coproduct morphism is the underlying chain complex and the target slot is the tensor product of this chain complex with itself. As to the other objects,\n", - "an identification number $n$ (slot `idnm`) is assigned to this Kenzo object and the `COALGEBRA` instance is pushed onto the list `*clgb-list*`. The associated printing method prints a string like `[K`*n* `Coalgebra]`.\n", + "`build-mrph` builds the coproduct morphism of degree 0, to settle the slot `crpd` of the instance. According to the definition, the source slot of the coproduct morphism `cprd` is the underlying chain complex and the target slot is the tensor product of this chain complex with itself. As to the other objects, an identification number $n$ (slot `idnm`) is assigned to this Kenzo object and the `COALGEBRA` instance is pushed onto the list `*clgb-list*`. The associated printing method prints a string like `[K`*n* `Coalgebra]`.\n", "\n", "\n", "\n", "### Miscellaneous functions and macros for coalgebras\n", "\n", - "`(cat-init)` *[Function]*\n", + "`cat-init` *[Function]*\n", "> Clear among others, the list `*clgb-list*`, list of user created coalgebras and reset the global counter to 1.\n", "\n", - "`(clgb n)` *[Function]*\n", + "`clgb` *n* *[Function]*\n", "> Retrieve in the list `*clgb-list*` the coalgebra instance whose identification is $n$. If it does not exist, return `NIL`.\n", "\n", - "`(cprd clgb &rest)` *[Macro]*\n", + "`cprd` *clgb* `&rest` *[Macro]*\n", "> Versatile macro relative to the coproduct of a coalgebra. The first argument is a `COALGEBRA` instance. With only one argument, this macro returns the coproduct morphism of the coalgebra.\n", "With more arguments, it applies the coproduct morphism on a combination (`(cprd` *clgb cmbn*`)`)\n", - "or on a pair *degree, generator* (`(cprd `*clgb degr gnrt*`)`).\n", + "or on a pair *degree, generator* (`(cprd` *clgb degr gnrt*`)`).\n", "\n", - "`(change-chcm-to-clgb chcm :intr-cprd intr-cprd :cprd-strt cprd-strt :orgn orgn)`\n", - "> Build a coalgebra instance from the already created chain complex *chcm*. The user must give via key\n", - "parameters a lisp function for the coproduct, the strategy and a comment list.\n", + "`change-chcm-to-clgb` *chcm* `:intr-cprd` *intr-cprd* `:cprd-strt` *cprd-strt* `:orgn` *orgn* *[Function]*\n", + "> Build a coalgebra instance from the already created chain complex *chcm*. The user must give via key parameters a lisp function for the coproduct, the strategy and a comment list.\n", "\n", "## Cobar of a coalgebra\n", "\n", @@ -90,43 +85,41 @@ "\n", "So, let ${\\cal A}$ be a coalgebra , assumed 1-connected, i.e. ${\\cal A}_1 = 0$ and ${\\cal A}_0 \\simeq \\mathbb{Z}$, we consider the chain complex, $Cobar^{{\\cal A}}(\\mathbb{Z}, \\mathbb{Z})$, noted more simply $Cobar({\\cal A})$, whose $n$-th component is:\n", "\n", - "$$ [Cobar({\\cal A})]_n = \\bigoplus ({\\bar{\\cal A}}_{i1} \\otimes \\cdots \\otimes {\\bar{\\cal A}}_{ik}),\\quad i_j >0, \\quad\n", - "i1 + \\cdots + ik= n+k.$$\n", + "$$ [Cobar({\\cal A})]_n = \\bigoplus ({\\bar{\\cal A}}_{i_1} \\otimes \\cdots \\otimes {\\bar{\\cal A}}_{i_k}),\\quad i_j >0, \\quad\n", + "i_1 + \\cdots + i_k= n+k.$$\n", "\n", - "A tensor product $g_1 \\otimes \\cdots \\otimes g_k$, where $g_i$ is a generator of ${\\bar{\\cal A}}_{i}$ is called, in the software `Kenzo`, an **algebraic loop**. The reason is the following: if $X$ is a 1-connected simplicial set, we shall see in a next chapter that the program `Kenzo` constructs a homotopy equivalence between the chain complex of the loop space ${\\cal C}_*(GX)$ and $Cobar({\\cal C}_*(X)) = Cobar^{{\\cal C}_*(X)}(\\mathbb{Z}, \\mathbb{Z})$, so that a generator of the last chain complex is a kind of \"algebraic\" version of a generator of a loop space. The definition of differential of the Cobar is recalled hereafter.\n", + "A tensor product $g_1 \\otimes \\cdots \\otimes g_k$, where $g_i$ is a generator of ${\\bar{\\cal A}}_{i}$ is called, in the program `Kenzo`, an **algebraic loop**. The reason is the following: if $X$ is a 1-connected simplicial set, we shall see in a next chapter that the program `Kenzo` constructs a homotopy equivalence between the chain complex of the loop space ${\\cal C}_*(GX)$ and $Cobar({\\cal C}_*(X)) = Cobar^{{\\cal C}_*(X)}(\\mathbb{Z}, \\mathbb{Z})$, so that a generator of the last chain complex is a kind of \"algebraic\" version of a generator of a loop space. The definition of differential of the Cobar is recalled hereafter.\n", "\n", "\n", "### Representation of an algebraic loop\n", "\n", "An algebraic loop is represented by a lisp object of the form:\n", "\n", - "> `(:ALLP` ($i_1\\,.\\, g_1$) ... ($i_k\\,.\\, g_k$)`)`\n", + "> `#S(:ALLP :LIST` (($i_1\\,.\\, g_1$) ... ($i_k\\,.\\, g_k$))`)`\n", "\n", "where the $i_j$ are the degrees *in the cobar chain complex* of the generators $g_j$. In the original coalgebra $\\cal A$, the generators $g_j$ had the degree $i_j+1$. The corresponding type is `ALLP`.\n", "The function to build such an object is also called `allp`\n", "\n", - "`(allp degr1 gnr1 degr2 gnr2 ... degrk gnrk)` *[Function]*\n", - "> Construct an algebraic loop, i.e. a tensorial product of degree $\\sum degr_i$. The sequence of pairs\n", - "$\\lbrace degr_i,\\, gnr_i \\rbrace$ has an undefinite length and may be void. In this case, the algebraic loop is the null algebraic loop, identified in the system by the constant `+null-allp+`. \n", - "The function `allp` accepts also as unique argument a list of the form `(` *degr1 gnr1 degr2 gnr2 ... degrk gnrk*`)`\n", + "`allp` *degr1 gnr1 degr2 gnr2 ... degrk gnrk* *[Function]*\n", + "> Construct an algebraic loop, i.e. a tensorial product of degree $\\sum degr_i$. The sequence of pairs $\\lbrace degr_i,\\, gnr_i \\rbrace$ has an undefinite length and may be void. In this case, the algebraic loop is the null algebraic loop, also defined in the system as the constant `+null-allp+`. \n", + "The function `allp` accepts also as unique argument a list of the form `(`*degr1 gnr1 degr2 gnr2 ... degrk gnrk*`)`\n", "\n", - "`(allp-p object)` *[Function]*\n", + "`allp-p` *object* *[Function]*\n", "> Test if *object* is an algebraic loop.\n", "\n", "The associated printing method prints the object under the form:\n", "> `<>`\n", "\n", - "The user will have noted that in the Cobar, each generator $g_i$ appears with its own degree in the\n", - "underlying chain complex, **lowered by 1**.\n", + "The user will have noted that in the Cobar, each generator $g_i$ appears with its own degree in the underlying chain complex, **lowered by 1**.\n", "\n", "\n", "### Definition of the chain complex Cobar\n", "\n", - "The definition of the differential in the Cobar, will be done in three steps. This is better understood, if we consider the following diagram. We recall that the elements of $({\\bar{\\cal A}}_*^{\\otimes_p})_q$ are by convention of degree $q-p$ in the Cobar.\n", + "The definition of the differential in the Cobar, will be done in three steps. This is better understood, if we consider the following diagram. We recall that the elements of $({\\bar{\\cal A}}_*^{\\otimes_p})_q$ are by convention of degree $q-p$ in the Cobar, if $q$ is the ordinary total degree in the tensor product $\\overline{\\mathcal{A}}_\\ast^{\\otimes p}$, that is, the sum of the degrees of the factors.\n", "\n", - "- A chain complex called `vertical-cobar` is defined with the *vertical differential* $d_v$. In this case, only the underlying chain complex structure is used.\n", + "- A chain complex called `vertical-cobar` is defined with the *vertical differential* $d_v$. In this case, only the underlying chain complex structure is used.\n", "- A horizontal differential $d_h$ is defined. This uses the coproduct structure.\n", - "- The final chain complex `cobar` is created with differential $d_v+d_h$.\n", + "- The final chain complex `cobar` is created with the differential $d_v+d_h$.\n", "\n", "$$\n", "\\begin{aligned}\n", @@ -144,21 +137,21 @@ "\n", "To define the vertical cobar chain complex from a chain complex ${\\cal C}$, the following functions are provided:\n", "\n", - "`(cobar-cmpr cmpr)` *[Function]*\n", + "`cobar-cmpr` *cmpr* *[Function]*\n", "> From the comparison function *cmpr*, build a comparison function for objects of algebraic loop type. \n", "\n", - "`(cobar-basis basis)` *[Function]*\n", - "> From the function *basis}* of a chain complex ${\\cal C}$, build a basis function for the vertical cobar chain complex defined on ${\\cal C}$. In dimension 0, there is only one basis element, namely the null algebraic loop. If ${\\cal C}$ is locally effective, this function returns the symbol `:locally-effective`.\n", + "`cobar-basis` *basis* *[Function]*\n", + "> From the function *basis* of a chain complex ${\\cal C}$, build a basis function for the vertical cobar chain complex defined on ${\\cal C}$. In dimension 0, there is only one basis element, namely the null algebraic loop. If ${\\cal C}$ is locally effective, this function returns the symbol `:locally-effective`.\n", "\n", - "`(cobar-intr-vrtc-dffr dffr)` *[Function]*\n", + "`cobar-intr-vrtc-dffr` *dffr* *[Function]*\n", "> From the `lisp` function *dffr* of a chain complex ${\\cal C}$, build a lisp function for the differential of the vertical cobar chain complex, according to the formula\n", "$$d_v(g_1 \\otimes \\cdots \\otimes g_n)=\n", "\\sum_{i=1}^n{(-1)^{n-i+1+{\\sum_{j=1}^{i-1}{\\mid g_j \\mid}}}\n", " g_1 \\otimes \\cdots \\otimes g_{i-1} \\otimes {\\bf dg_i} \\otimes g_{i+1} \\otimes \\cdots \\otimes g_n},$$\n", - " where $dg_i$ is the differential of the generator $g_i$ in the original chain complex (function *dffr*) and $\\mid g_i \\mid$ is the degree of the generator $g_i$ *in the cobar chain complex*.\n", + "where $dg_i$ is the differential of the generator $g_i$ in the original chain complex (function *dffr*) and $\\mid g_i \\mid$ is the degree of the generator $g_i$ *in the cobar chain complex*.\n", "In general, the differential $dg_i$ is a sum of tensor products. So, applying the distribution law, the right member is a sum of tensor products, represented by a combination.\n", "\n", - "`(vrtc-cobar chcm)` *[Method]*\n", + "`vrtc-cobar` *chcm* *[Method]*\n", "> Build the vertical cobar chain complex with underlying chain complex *chcm*. This is simply done by the following call to `build-chcm`:\n", "```commonlisp\n", "(build-chcm\n", @@ -175,7 +168,7 @@ "\n", "We are going to build a coalgebra which will be reconsidered in a next chapter (Simplicial sets). It is the coalgebra canonicaly associated to the simplicial set $\\Delta_2^\\mathbb{N}$. This simplicial set is the quotient of $\\Delta^\\mathbb{N}$ - the standard simplex spanned by the non-negative integers - by the relation identifying, firstly all the vertices with a unique one and then any 1-simplex of $\\Delta^\\mathbb{N}$ with the unique degeneracy of this unique vertex. In other words, $\\Delta_2^\\mathbb{N}$ is 1-reduced: 1 vertex, no edges.\n", "\n", - "Our implementation represents any non--degenerate $n$--simplex as an integer increasing list of length $n+1$. In dimension 0, for every non-negative $m$ and $n$, the vertices `(m)` and `(n)` are identified; in dimension 1, the list $(m\\, n)$ is always an *illegal* 1-simplex. This coalgebra will be located through the symbol `smp-deltab2`. The lisp definition uses the function `build-smst` that will be described in the simplicial set chapter. For the moment, it is sufficient to know, that the function `build-smst` allows us to create a coalgebra suitable for the tests. The definition of $\\Delta_2^\\mathbb{N}$ given here, is only for pedagogical purpose, an efficient definition using another representation for the simplices is provided in the software `Kenzo`." + "Our implementation represents any non--degenerate $n$--simplex as an integer increasing list of length $n+1$. In dimension 0, for every non-negative $m$ and $n$, the vertices `(m)` and `(n)` are identified; in dimension 1, the list $(m\\, n)$ is always an *illegal* 1-simplex. This coalgebra will be located through the symbol `smp-deltab2`. The lisp definition uses the function `build-smst` that will be described in the simplicial set chapter. For the moment, it is sufficient to know, that the function `build-smst` allows us to create a coalgebra suitable for the tests. The definition of $\\Delta_2^\\mathbb{N}$ given here, is only for pedagogical purpose, an efficient definition using another representation for the simplices is provided in the program `Kenzo`." ] }, { @@ -190,7 +183,7 @@ "output_type": "stream", "text": [ "SIMPLE-STYLE-WARNING: \n", - " #\n" + " #\n" ] }, { @@ -638,8 +631,7 @@ "source": [ "#### Definition of the horizontal differential\n", "\n", - "So far, the coalgebra structure has not been used but now it will be the main ingredient. If we make the convention that the elements of $({\\bar{\\cal A}}_*^{\\otimes_p})_q$ are of degree $q-p$, \n", - "we know that exists a canonical \"horizontal\" differential $d_h$,\n", + "So far, the coalgebra structure has not been used but now it will be the main ingredient. The so-called \"horizontal\" differential is an operator $d_h$ defined on the tensor algebra $\\bigoplus_p \\widehat{\\mathcal{A}}_ast^{\\otimes p}$ as follows:\n", "\n", "$$d_h:({\\bar{\\cal A}}_*^{\\otimes p})_q \\longrightarrow ({\\bar{\\cal A}}_*^{\\otimes {p+1}})_q,$$\n", "\n", @@ -652,14 +644,13 @@ "\\end{aligned}\n", "$$\n", "\n", - "where $\\Delta$ is the coproduct of the coalgebra. Two functions are designed for that:\n", + "where $\\Delta$ is the coproduct of the coalgebra. The fact that every component of $\\Delta g_i$ is split in a tensor product decreases the degree by 1. Two functions are designed for that:\n", "\n", - "`(cobar-intr-hrzn-dffr cprd)` *[Function]*\n", + "`cobar-intr-hrzn-dffr` *cprd* *[Function]*\n", "> From the coproduct morphism *cprd*, build the lisp function with 2 arguments: a degree and an algebraic loop (i.e. a generator) implementing the algorithm for $d_h$.\n", "\n", - "`(cobar-hrzn-dffr clbg)` *[Function]*\n", - "> Build the horizontal differential morphism, using the slot coproduct *cprd* of\n", - "the coalgebra *clbg* and the previous function. Note that when called, this function creates, if not already created, the vertical cobar chain complex on *clbg*:\n", + "`cobar-hrzn-dffr` *clbg* *[Function]*\n", + "> Build the horizontal differential morphism of the cobar construction, using the slot coproduct *cprd* of the coalgebra *clbg* and the previous function. Note that when called, this function creates, if not already created, the vertical cobar chain complex on *clbg*:\n", "```commonlisp\n", "(build-mrph\n", " :sorc (vrtc-cobar clgb) \n", @@ -672,7 +663,7 @@ "\n", "### Example\n", "\n", - "We still use our simple coalgebra `smp-deltab2`. The horizontal differential uses the coproduct of the coalgebra. The following examples show the application of the coproduct (note that there are no 1-simplices in the tensor products). We verify also the property of the horizontal differential." + "We still use our simple coalgebra `smp-deltab2`. The horizontal differential uses the coproduct of the coalgebra. The following examples show the application of the coproduct (note that there are no 1-simplices in the tensor products). We check also the property $d_h^2 = 0$ of the horizontal differential for some generators. " ] }, { @@ -977,12 +968,11 @@ "\n", "To define completely the cobar chain complex, we have to provide the lisp function for the differential $d_v + d_h$ and, once created the vertical cobar chain complex, to call the building function `build-chcm` with adequate arguments.\n", "\n", - "`(cobar-intr-dffr vrtc-dffr hrzn-dffr)` *[Function]*\n", + "`cobar-intr-dffr` *vrtc-dffr hrzn-dffr* *[Function]*\n", "> Define the lisp function for the differential $d_v+d_h$ from the two morphisms *vrtc-dffr* and *hrzn-dffr*. For efficiency reasons, the implementor has chosen to define this new function rather than to use simply the addition of two morphisms.\n", "\n", - "`(cobar coalgebra)` *[Method]*\n", - "> Build first the vertical cobar chain complex on the coalgebra. Then return a chain complex with the same slots as the vertical cobar chain complex but with new `:intr-dffr`\n", - "and `:orgn` slots, as shown in the following definition:\n", + "`cobar` *coalgebra* *[Method]*\n", + "> Build first the vertical cobar chain complex on the coalgebra. Then return a chain complex with the same slots as the vertical cobar chain complex but with new `:intr-dffr` and `:orgn` slots, as shown in the following definition:\n", "```commonlisp\n", "(defmethod COBAR ((coalgebra coalgebra))\n", " (let ((vrtc-cobar (vrtc-cobar coalgebra))\n", @@ -1196,18 +1186,17 @@ "\n", "The vertical cobar construction is *natural* and therefore defines a functor. Consequently, the `Kenzo` program contains the following methods.\n", "\n", - "`(vrtc-cobar mrph)` *[Method]*\n", + "`vrtc-cobar` *mrph* *[Method]*\n", "> From the morphism *mrph*, build a new morphism between the vertical-cobar of the source of *mrph* and the vertical cobar of the target of *mrph*, the morphism itself being induced in a natural way by the underlying morphism.\n", "\n", - "`(vrtc-cobar rdct)` *[Method]*\n", + "`vrtc-cobar` *rdct* *[Method]*\n", "> From the reduction *rdct*, build a new reduction, by applying the vertical cobar method to the functions $f$ and $g$. The new homotopy cannot be obtained so simply, being a function of the $f$, $g$ and $h$ of *rdct*. Nevertheless, the source and target of the new homotopy are the vertical cobar of the underlying homotopy.\n", "\n", - "`(vrtc-cobar hmeq)` *[Method]*\n", + "`vrtc-cobar` *hmeq* *[Method]*\n", "> Build a homotopy equivalence by applying the vertical cobar construction to the left and right reductions of the homotopy equivalence *hmeq*.\n", "\n", - "`(cobar hmeq)` *[Method]*\n", - "> Build a homotopy equivalence where the cobar construction is applied to the underlying homotopy equivalence in the following way. First this construction is limited to the case where the left bottom chain complex of *hmeq* is a **coalgebra**. Then the vertical cobar construction is applied to *hmeq* and the horizontal differential of the left bottom chain complex is propagated upon the new homotopy equivalence with the help of the method `add`. In other words, starting from the left bottom chain complex, firstly the easy pertubation lemma is applied to obtain a new differential on the top chain complex; then the basic perturbation lemma is applied to the right reduction. If *hmeq* is a\n", - "trivial homotopy equivalence, this function returns a trivial one, built on the cobar of the left bottom chain complex of *hmeq*.\n", + "`cobar` *hmeq* *[Method]*\n", + "> Build a homotopy equivalence where the cobar construction is applied to the underlying homotopy equivalence in the following way. First this construction is limited to the case where the left bottom chain complex of *hmeq* is a **coalgebra**. Then the vertical cobar construction is applied to *hmeq* and the horizontal differential of the left bottom chain complex is propagated upon the new homotopy equivalence with the help of the method `add`. In other words, starting from the left bottom chain complex, firstly the easy pertubation lemma is applied to obtain a new differential on the top chain complex; then the basic perturbation lemma is applied to the right reduction. If *hmeq* is a trivial homotopy equivalence, this function returns a trivial one, built on the cobar of the left bottom chain complex of *hmeq*.\n", "\n", "### Lisp files concerned in this chapter\n", "\n",