From 13f9eec1c77bf588cde765558a743a4b4cbc1999 Mon Sep 17 00:00:00 2001 From: gheber Date: Tue, 23 Feb 2016 17:27:24 -0600 Subject: [PATCH] First draft of Chapter 4. --- examples/Chapter4.ipynb | 530 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 530 insertions(+) create mode 100644 examples/Chapter4.ipynb diff --git a/examples/Chapter4.ipynb b/examples/Chapter4.ipynb new file mode 100644 index 0000000..ab59f3e --- /dev/null +++ b/examples/Chapter4.ipynb @@ -0,0 +1,530 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(ql:quickload :kenzo)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(in-package \"CAT\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(cat-init)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Tensor product of chain complexes\n", + "\n", + "## Introduction\n", + "\n", + "One knows that the homology groups of a cartesian product of two spaces $K$ and $L$ may be obtained by considering a chain complex derived from respective chain complexes of $K$ and $L$ by taking their *tensor product*.\n", + "But this is only one of the numerous uses of tensor products of chain complexes in algebraic topology, so the ``Kenzo`` software provides the handling of such an important tool.\n", + "\n", + "Let us recall that chain complexes are free $\\mathbb{Z}$-modules with distinguished basis. A tensor product of chain complexes \n", + "is itself a free $\\mathbb{Z}$-module with a natural basis formed by the tensor product of the generators of the chain complex factors. The program conforms to that rule.\n", + "\n", + "## Tensor product of generators and combinations\n", + "\n", + "An elementary tensor product of two generators is represented, in the software, by a structured list in which we may find 4 items for the description of the two generators together with their respective degree. The internal representation of $gnrt1 \\otimes gnrt2$ has the form:\n", + "```lisp\n", + "(:tnpr (degr1 . gnrt1) . (degr2 . gnrt2))\n", + "```\n", + "where,\n", + "1. *degr1* is an integer, the degree of the generator *gnrt1*.\n", + "2. *gnrt1* is the first generator of the pair.\n", + "3. *degr2* is an integer, the degree of the generator *gnrt2*.\n", + "4. *gnrt2* is the second generator of the pair.\n", + "To construct such an object, one may use the macro ``tnpr``. The corresponding type is ``TNPR``. The printing method prints the tensor product under the form:\n", + ">```` or ````\n", + "\n", + "according to the boolean value, ``NIL`` (default) or ``T`` of the system variable ``*tnpr-with-degrees*`` (see the examples).\n", + "\n", + "### Simple functions for the tensor product\n", + "\n", + "\n", + "``(tnpr degr1 gnrt1 degr2 gnrt2)`` *[Macro]*\n", + "> Build a tensor product $gnrt1 \\otimes gnrt2$.\n", + "\n", + "``(tnpr-p object)`` *[Predicate]*\n", + "> Test if *object* is of type ``TNPR``.\n", + "\n", + "``(degr1 tnpr)`` *[Macro]*\n", + "> Select the degree of the first generator in the tensor product *tnpr*.\n", + "\n", + "``(gnrt1 tnpr)`` *[Macro]*\n", + "> Select the first generator from the object *tnpr*.\n", + "\n", + "``(degr2 tnpr)`` *[Macro]*\n", + "> Select the degree of the second generator in the tensor product *tnpr*.\n", + "\n", + "``(gnrt2 tnpr)`` *[Macro]*\n", + "> Select the second generator from the object *tnpr*.\n", + "\n", + "``(2cmbn-tnpr cmbn1 cmbn2)`` *[Function]*\n", + "> Create, from two combinations *cmbn1* and *cmbn2* with respective degree *degr1* and *degr2*, a combination of degree $dgr1 + dgr2$ by applying the tensorial distributive law on the two sums of terms of the combinations.\n", + "\n", + "#### Example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(tnpr 1 'a 2 'b)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(tnpr-p *)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(tnpr-p (cmbn 0 1 'a 2 'b))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(setf *tnpr-with-degrees* t)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(2cmbn-tnpr (cmbn 2 3 'a 4 'b -5 'c) (cmbn 3 4 'x -3 'y 2 'z))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(setf *tnpr-with-degrees* nil)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Tensor product of chain complexes\n", + "\n", + "The software implements the tensor product of chain complexes according to the classical following definition. Let $C$ and $C'$ two chain complexes. The tensor product $C\\otimes C'$ is the chain complex $D$ such that:\n", + "\n", + "$$D_p=\\bigoplus_{m+n=p}C_m\\otimes C_n',$$\n", + "\n", + "$C_m\\otimes C_n'$ being the tensor product of the two modules $C_m$ and $C_n'$. A basis for $D_p$ is the union of the basis of $C_m\\otimes C_n'$, with $m+n=p$.\n", + "\n", + "The boundary operator $d^{\\otimes}$ is defined, according to the Koszul rule, by:\n", + "\n", + "$$d^{\\otimes}(c_m\\otimes c_n')=d(c_m)\\otimes c_n' +(-1)^m c_m\\otimes d'(c_n'),$$\n", + "\n", + "with $c_m\\in C_m,\\ c_n'\\in C_n'$ and $d$, $d'$ being the respective boundary operators\n", + "of $C$ and $C'$.\n", + "\n", + "In the software, this is realized by the function ``tnsr-prdc``. \n", + "\n", + "``(tnsr-prdc chcm1 chcm2)`` *[Method]*\n", + "> Build a chain complex, tensor product of the two chain complexes *chcm1* and *chcm2*. The elements\n", + "of this new chain complex are integer combinations of generators of *TNPR* type. The creation of this\n", + "new chain complex is done by a call to the function *build-chcm* with actual parameters defined from the constituting elements of *chcm1* and *chcm2*, according to the mathematical definitions above. If both arguments are *effective*, the function constructs an *effective* chain complex. On the other hand, if at least one of the chain complex is *locally effective*, the tensor product is also *locally effective*. In fact, the construction is correct only if both chain complexes are null in negative degrees, otherwise the result is undefined.\n", + "\n", + "#### Examples\n", + "\n", + "Let us take the standard 2-simplex, $\\Delta^2$ and let us build $C_*(\\Delta^2) \\otimes C_*(\\Delta^2)$. To build the corresponding chain complex, we use the function ``cdelta``, defined in a previous chapter." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(cat-init)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(defun cdelta (dmns)\n", + " (build-chcm\n", + " :cmpr #'l-cmpr\n", + " :basis #'(lambda (n)\n", + " (mapcar #'dlop-int-ext (funcall (delta-n-basis dmns) n)))\n", + " :bsgn '(0)\n", + " :intr-dffr\n", + " #'(lambda (degr gmsm)\n", + " (make-cmbn\n", + " :degr (1- degr)\n", + " :list (do ((rslt +empty-list+\n", + " (cons (cons sign\n", + " (append\n", + " (subseq gmsm 0 nark)\n", + " (subseq gmsm (1+ nark))))\n", + " rslt))\n", + " (sign 1 (- sign))\n", + " (nark 0 (1+ nark)))\n", + " ((> nark degr) rslt))))\n", + " :strt :gnrt\n", + " :orgn `(Effective version of C_* delta ,dmns)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(def triangle (cdelta 2))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(basis triangle 1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(def tpr-triangles (tnsr-prdc triangle triangle))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us inspect some basis of this newly created chain complex." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(basis tpr-triangles 0)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(basis tpr-triangles 1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(basis tpr-triangles 2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(basis tpr-triangles 3)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "(basis tpr-triangles 4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us consider now the chain complex, $ccn$, that we used in the chain complex chapter. The basis in any degree are decades produced by the function `` Return the morphism, tensor product of the two morphisms *mrph1* and *mrph2*. The source\n", + "and target of this new morphism are respectively the tensor product of the chain complexes source\n", + "and target of *mrph1* and *mrph2*. The degree is the sum of the degrees of the parameters\n", + "and the lisp function (the ``:pure`` keyword argument of the function ``build-mrph``) conforms to the mathematical definition above. The strategy is by generator, i.e. the morphism is designed to work with 2 arguments: a degree and a generator which must be an object of type ``TNPR``.\n", + "\n", + "``(tnsr-prdc rdct1 rdct2)`` *[Method]*\n", + "> Return the reduction, tensor product of the two reductions *rdct1* and *rdct2*. The algorithm consists essentially in defining\n", + "$$f=f1 \\otimes f2,\\, g=g1 \\otimes g2,\\, h= h1 \\otimes (g2 \\circ g2) + Id_{tcc1} \\otimes h2,$$\n", + "where $Id_{tcc1}$ is the identity morphism in the top chain complex of the reduction *rdct1*.\n", + "The returned reduction is then built by a call to the method ``build-rdct``. This defines completely the chain complexes involved in the reduction.\n", + "\n", + "``(tnsr-prdc hmeq1 hmeq2)`` *[Method]*\n", + "> Return the homotopy equivalence, tensor product of the two homotopy equivalence *heqm1* and *heqm2*. \n", + "This is a homotopy equivalence where the new reductions are the tensor products of the arguments reductions (See the lisp definition just below).\n", + "\n", + "### Searching homology for tensor products\n", + "\n", + "The comment list of a tensor product of two chain complexes has the form \n", + "``(TNSR-PRDC`` *chcm1 chcm2*``)``. The ``search-efhm`` method applied to a tensor product, looks for the value of the respective ``efhm`` slots of the chain complexes *chcm1* and *chcm2*, (i.e. two homotopy equivalences) or tries to settle these slots if they are still unbound. Then it builds the tensor product of both homotopy equivalences, as shown in the following lisp listing. At its turn,\n", + "the resulting homotopy equivalence will become the value of the {\\tt efhm} slot of the initial tensor product chain complex.\n", + "\n", + "```lisp\n", + "(defmethod SEARCH-EFHM (chcm (orgn (eql 'tnsr-prdc)))\n", + " (declare (type chain-complex chcm))\n", + " (the homotopy-equivalence\n", + " (tnsr-prdc (efhm (second (orgn chcm)))\n", + " (efhm (third (orgn chcm))))))\n", + "\n", + "(defmethod TNSR-PRDC ((hmeq1 homotopy-equivalence)\n", + "\t\t (hmeq2 homotopy-equivalence))\n", + " (the homotopy-equivalence\n", + " (build-hmeq\n", + " :lrdct (tnsr-prdc (lrdct hmeq1) (lrdct hmeq2))\n", + " :rrdct (tnsr-prdc (rrdct hmeq1) (rrdct hmeq2))\n", + " :orgn `(tnsr-prdc ,hmeq1 ,hmeq2))))\n", + "```\n", + "\n", + "#### Lisp file concerned in this chapter\n", + "\n", + "``tensor-products.lisp``, ``searching-homology.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 +}