diff --git a/examples/Chapter8.ipynb b/examples/Chapter8.ipynb new file mode 100644 index 0000000..ed94bc3 --- /dev/null +++ b/examples/Chapter8.ipynb @@ -0,0 +1,281 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Simplicial morphisms\n", + "\n", + "The software ``Kenzo`` implements simplicial morphisms in a way analogous to chain complex morphisms.\n", + "\n", + "## Representation of a simplicial morphism\n", + "\n", + "A simplicial morphism is an instance of the class ``SIMPLICIAL-MRPH``, subclass of the class ``MORPHISM``.\n", + "\n", + "```lisp\n", + "(DEFCLASS SIMPLICIAL-MRPH (morphism)\n", + " ((sintr :type sintr :initarg :sintr :reader sintr)))\n", + "```\n", + "\n", + "It has one slot of its own:\n", + "> ``sintr``, an object of type ``SINTR``, in fact a lisp function defining the morphism between the source and target simplicial sets. It must have 2 parameters: a dimension (an integer) and a geometric simplex of this dimension (a generator of any type) . It must return an abstract simplex, image in the target simplicial set of this geometric simplex.\n", + "\n", + "A printing method has been associated to the class ``SIMPLICIAL-MRPH``. A string like ``[K``*n* ``Simplicial-Morphism]`` is the external representation of an instance of such a class, where *n* is the number plate of the ``Kenzo`` object.\n", + "\n", + "## The function ``build-smmr``\n", + "\n", + "To facilitate the construction of instances of the class ``SIMPLICIAL-MRPH`` and to free the user to call the standard constructor ``make-instance``, the software provides the function\n", + "\n", + "> ``build-smmr :sorc`` *sorc* ``:trgt`` *trgt* ``:degr`` *degr* ``:sintr`` *sintr* ``:intr`` *intr* ``:strt`` *strt* ``:orgn`` *orgn*\n", + "\n", + "defined with keyword parameters and returning an instance of the class ``SIMPLICIAL-MRPH``. The keyword arguments of ``build-smmr`` are:\n", + "\n", + "- *sorc*, the source object, an object of type ``SIMPLICIAL-SET``.\n", + "- *trgt*, the target object, an object of type ``SIMPLICIAL-SET``.\n", + "- *degr*, the degree of the morphism, an integer. In this chapter, we consider only the 0 degree case (the usual one). The case -1 is particularly important: it allows to implement the notion of twisting operator defining a fibration (See the chapter Fibration).\n", + "- *sintr*, the internal lisp function defining the effective mapping between simplicial sets. If the integer *degr* is 0 and if the following keyword argument *intr* is omitted, then the function ``build-smmr`` builds a lisp function implementing the induced mapping between the underlying source and target chain complexes. This function is installed in the slot ``intr``. The strategy is then set to ``:gnrt``.\n", + "- ``intr``, a user defined morphism for the underlying chain complexes. This argument is optional and taken in account only if the degree is 0 and in this case, supersedes the previous derived mapping. The strategy is then mandatory. If the degree is not null, the implementor has decided to set the corresponding slot to ``NIL``.\n", + "- *strt*, the strategy, i.e. ``:gnrt`` or ``:cmbn`` attached to the previous function.\n", + "- *orgn*, a relevant comment list.\n", + "\n", + "After a call to ``build-smmr``, the simplicial morphism instance is added to a list of previously constructed ones (``*smmr-list*``). As the other similar lists, the list ``*smmr-list*`` may be cleared by the function ``cat-init``.\n", + "\n", + "The effective application of a simplicial morphism upon arguments, is realized with the macro ``?`` which calls the adequate method defined for this kind of objects.\n", + "\n", + "After a call to ``build-smmr``, the simplicial morphism instance is added to a list of previously constructed ones (``*smmr-list*``). As the other similar lists, the list ``*smmr-list*`` may be cleared by the function ``cat-init``.\n", + "\n", + "The effective application of a simplicial morphism upon arguments, is realized with the macro ``?`` which calls the adequate method defined for this kind of objects.\n", + "\n", + "``? &rest`` *args* *[Macro]*\n", + "> Versatile macro for applying a simplicial morphism indifferently as ``(?`` *smmr dmns absm-or-gmsm*``)`` or ``(?`` *smmr cmbn*``)``. In the first case, the third argument is either an abstract simplex or a geometric one. In the second case, if the second argument is a combination, *smmr* is then considered as a chain complex morphism and it is the function in the slot ``intr`` which is applied, so that it makes sense only if the degree of the mapping is 0.\n", + "\n", + "### Examples\n", + "\n", + "In the following examples, we work with $\\Delta_3$. We define three simplicial morphisms, ``sm1``, ``sm2`` and ``sm3``. In ``sm1``, the mapping is the identity mapping and we can see that this identity mapping has been propagated on the underlying chain complex." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(def d3 (delta 3))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(def sm1 (build-smmr\n", + " :sorc d3 :trgt d3 :degr 0\n", + " :sintr #'(lambda (dmns gmsm)\n", + " (declare (ignore dmns))\n", + " (absm 0 gmsm))\n", + " :orgn '(identity delta-3)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm1 2 7)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm1 1 (absm 1 1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm1 (cmbn 2 1 7))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the simplicial morphism ``sm2``, the mapping is the \"null\" mapping. In fact, it consists in applying any abstract simplex in dimension $n$ upon the $n$-degenerate base point. Of course, in terms of chain complex, the corresponding mapping applies any chain complex element upon the null combination of same degree." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(def sm2 (build-smmr\n", + " :sorc d3 :trgt d3 :degr 0\n", + " :sintr #'(lambda (dmns gmsm)\n", + " (declare (ignore gmsm))\n", + " (absm (mask dmns) 1)) ;;; mask(n)=2^n - 1 \n", + " :orgn '(null delta-3)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm2 0 4)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm2 2 7)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm2 1 (absm 1 1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm2 3 15)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm2 (cmbn 3 2 15))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the simplicial morphism ``sm3``, we keep the same \"null\" mapping as in ``sm2`` but we choose as mapping for the underlying chain complex the opposite of any chain complex element." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(def sm3 (build-smmr\n", + " :sorc d3 :trgt d3 :degr 0\n", + " :sintr #'(lambda (dmns gmsm)\n", + " (declare (ignore gmsm))\n", + " (absm (mask dmns) 1))\n", + " :intr #'cmbn-opps\n", + " :strt :cmbn\n", + " :orgn '(null and opposite delta-3)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm3 3 15)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm3 (cmbn 3 7 15))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(? sm3 (cmbn 3 11 (dlop-ext-int '(0 1 2 3))))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Lisp files concerned in this chapter\n", + "\n", + "``simplicial-mrphs.lisp``.\n", + "\n", + "[``classes.lisp``, ``macros.lisp``, ``various.lisp``]." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "SBCL Lisp", + "language": "lisp", + "name": "lisp" + }, + "language_info": { + "codemirror_mode": "text/x-common-lisp", + "mimetype": "text/x-common-lisp", + "name": "common-lisp", + "pygments_lexer": "common-lisp", + "version": "X3J13" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}