Quelle chap10.html
Sprache: HTML
|
|
| products/sources/formale Sprachen/GAP/pkg/qpa/doc/chap10.html |
 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (QPA) - Chapter 10: Chain complexes</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap10" onload="jscontent()">
<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chap7.html">7</a> <a href="chap8.html">8</a> <a href="chap9.html">9</a> <a href="chap10.html">10</a> <a href="chap11.html">11</a> <a href="chap12.html">12</a> <a href="chap13.html">13</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap9.html">[Previous Chapter]</a> <a href="chap11.html">[Next Chapter]</a> </div>
<p id="mathjaxlink" class="pcenter"><a href="chap10_mj.html">[MathJax on]</a></p>
<p><a id="X7A06103979B92808" name="X7A06103979B92808"></a></p>
<div class="ChapSects"><a href="chap10.html#X7A06103979B92808">10 <span class="Heading">Chain complexes</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X7DFB63A97E67C0A1">10.1 <span class="Heading">Introduction</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X7AC5660E80079755">10.2 <span class="Heading">Infinite lists</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8466C7117CEC99D2">10.2-1 IsInfiniteNumber</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F12EE4479A03527">10.2-2 PositiveInfinity</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8759931784478A4D">10.2-3 NegativeInfinity</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X84731DA279E797A5">10.2-4 IsInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X87524BBB7C2F9FCB">10.2-5 IsHalfInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7D21FB1A7D21FB1A"><code>10.2-6 \^</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7E01944C83F87EED">10.2-7 MakeHalfInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8458C2698505C12B">10.2-8 StartPosition</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X812437C47A208D4A">10.2-9 Direction</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7C3728BF7ED7149A">10.2-10 InfListType</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X82AA0979868A6967">10.2-11 RepeatingList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7AF21D62848B270B">10.2-12 ElementFunction</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8728A2107F27D68F">10.2-13 IsStoringValues</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X86888FBD8559B29B">10.2-14 NewValueCallback</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X856E1541834688C6">10.2-15 IsRepeating</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8208162D7F3CC139">10.2-16 InitialValue</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F12274E794510CA">10.2-17 LowestKnownPosition</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7B5E57F0859BEE17">10.2-18 HighestKnownValue</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X81F7B0AB84D6319B">10.2-19 Shift</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7D8067A7842BC4A4">10.2-20 Cut</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X79A67E377B71C540">10.2-21 HalfInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7CE66EBA844DBB57">10.2-22 MakeInfListFromHalfInfLists</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X801DE2517D08C19E">10.2-23 MakeInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7EEB276380E1584F">10.2-24 FunctionInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X78C7FBAE83914790">10.2-25 ConstantInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7D68E0627F556E14">10.2-26 FiniteInfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8134072B7C7309CD">10.2-27 MiddleStart</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7EB933657AF3D723">10.2-28 MiddleEnd</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7AC3ECBB7BC93594">10.2-29 MiddlePart</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7896D6DD788046E7">10.2-30 PositivePart</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X81B768838567F98D">10.2-31 NegativePart</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8511A0B88003B989">10.2-32 HighestKnownPosition</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F12274E794510CA">10.2-33 LowestKnownPosition</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7A5CB74485184FEE">10.2-34 UpperBound</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X807CC5AD7FDFA4E3">10.2-35 LowerBound</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7A311EBE79F31AEA">10.2-36 FinitePartAsList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8028ED6883CFA39C">10.2-37 PositivePartFrom</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7863903B7E281CF6">10.2-38 NegativePartFrom</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X81F7B0AB84D6319B">10.2-39 Shift</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X80153272857B2EDE">10.2-40 Splice</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X84FC63C183F0A977">10.2-41 InfConcatenation</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F4CF360858E80A6">10.2-42 InfList</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X791D879483C59410">10.2-43 IntegersList</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X7CAF603281B94AC8">10.3 <span class="Heading">Representation of categories</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F0E546178977963">10.3-1 IsCat</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7BB9B02E7E76FF9C">10.3-2 CatOfRightAlgebraModules</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X7EC3D95F7C791F7E">10.4 <span class="Heading">Making a complex</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X838C9EBD87B8CB9D">10.4-1 IsQPAComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7E0CE8AC87533991">10.4-2 IsZeroComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7E51958C86D73D17">10.4-3 Complex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X80F8DD20789BBBC0">10.4-4 ZeroComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7C75868E82A831C8">10.4-5 FiniteComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X80B47D78785F6859">10.4-6 StalkComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7A685484784087FE">10.4-7 ShortExactSequence</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X7F7E0C197FA31B29">10.5 <span class="Heading">Information about a complex</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7BBF131485F3C792">10.5-1 CatOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8239596E87830A51">10.5-2 ObjectOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7B597AC77A3D71F9">10.5-3 DifferentialOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X858D2D1A8674D2EC">10.5-4 DifferentialsOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X85FBFD9C8382C93B">10.5-5 CyclesOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8168D8CC7805FE30">10.5-6 BoundariesOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F8D61447AB57EF3">10.5-7 HomologyOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7DCBCF7682DC87FC">10.5-8 IsFiniteComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7A5CB74485184FEE">10.5-9 UpperBound</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X807CC5AD7FDFA4E3">10.5-10 LowerBound</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7C1F81277A5AC8B4">10.5-11 LengthOfComplex</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X82D615CD796C9C0A">10.5-12 HighestKnownDegree</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X868105FF86FA1B6E">10.5-13 LowestKnownDegree</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X793465497B435197">10.5-14 IsExactSequence</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7A6AE1C378E2EEE2">10.5-15 IsExactInDegree</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X87ADD4F685457000">10.5-16 IsShortExactSequence</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X849C525A7F6EBF6D">10.5-17 ForEveryDegree</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X8764E5C88284301B">10.6 <span class="Heading">Transforming and combining complexes</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X81F7B0AB84D6319B">10.6-1 Shift</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X86B56AC87A433E5B">10.6-2 ShiftUnsigned</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7897A65085171913">10.6-3 YonedaProduct</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X87E1CA507EB6B86E">10.6-4 BrutalTruncationBelow</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7CE9481684DD304E">10.6-5 BrutalTruncationAbove</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8547C51781BBB48F">10.6-6 BrutalTruncation</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7E3E34167B79248A">10.6-7 SyzygyTruncation</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7C729A2587E5DA8D">10.6-8 CosyzygyTruncation</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X797FC6037F6605E7">10.6-9 SyzygyCosyzygyTruncation</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap10.html#X85F418EB859E7597">10.7 <span class="Heading">Chain maps</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F76E62D837F0E66">10.7-1 IsChainMap</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7BCD94877DF261C4">10.7-2 ChainMap</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7C9597F6810F195E">10.7-3 ZeroChainMap</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X8699B48A783E1900">10.7-4 FiniteChainMap</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X805BA1698394DE4C">10.7-5 ComplexAndChainMaps</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7F20B8807ECE404E">10.7-6 MorphismOfChainMap</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X792B5B8684A75F72">10.7-7 MorphismsOfChainMap</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X78EC487B79B20DDE">10.7-8 ComparisonLifting</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7A95C5E78298E0C6">10.7-9 ComparisonLiftingToProjectiveResolution</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap10.html#X7EF42CF48165D831">10.7-10 MappingCone</a></span>
</div></div>
</div>
<h3>10 <span class="Heading">Chain complexes</span></h3>
<p><a id="X7DFB63A97E67C0A1" name="X7DFB63A97E67C0A1"></a></p>
<h4>10.1 <span class="Heading">Introduction</span></h4>
<p>If <span class="SimpleMath">mathcalA</span> is an abelian category, then a chain complex of objects of <span class="SimpleMath">mathcal A</span> is a sequence</p>
<p class="pcenter">
\cdots \longrightarrow C_{i+1} \stackrel{d_{i+1}}{\longrightarrow}
C_i \stackrel{d_i}{\longrightarrow} C_{i-1}
\stackrel{d_{i-1}}{\longrightarrow} \cdots
</p>
<p>where <span class="SimpleMath">C_i</span> is an object of <span class="SimpleMath">mathcal A</span> for all <span class="SimpleMath">i</span>, and <span class="SimpleMath">d_i</span> is a morphism of <span class="SimpleMath">mathcal A</span> for all <span class="SimpleMath">i</span> such that the composition of two consecutive maps of the complex is zero. The maps are called the differentials of the complex. A complex is called <em>bounded above</em> (resp. below) if there is a bound <span class="SimpleMath">b</span> such that <span class="SimpleMath">C_i = 0</span> for all <span class="SimpleMath">i>b</span> (resp. <span class="SimpleMath">i<b</span>). A complex is <em>bounded</em> if it is both bounded below and bounded above.</p>
<p>The challenge when representing chain complexes in software is to handle their infinite nature. If a complex is not bounded, or not known to be bounded, how can we represent it in an immutable way? Our solution is to use a category called <code class="code">InfList</code> (for ``infinite list'') to store the differentials of the complex. The properties of the <code class="code">IsInfList</code> category is described in <a href="chap10.html#X7AC5660E80079755"><span class="RefLink">10.2</span></a>. An <code class="code">IsQPAComplex</code> object consists of one <code class="code">IsInfList</code> for the differentials, and it also has an <code class="code">IsCat</code> object as an attribute. The <code class="code">IsCat</code> category is a representation of an abelian category, see <a href="chap10.html#X7CAF603281B94AC8"><span class="RefLink">10.3</span></a>.</p>
<p>To work with bounded complexes one does not need to know much about the <code class="code">IsInfList</code> category. A bounded complex can be created by simply giving a list of the differentials and the degree of the first differential as input (see <code class="func">FiniteComplex</code> (<a href="chap10.html#X7C75868E82A831C8"><span class="RefLink">10.4-5</span></a>)), and to create a stalk complex the stalk object and its degree suffice as input (see <code class="func">StalkComplex</code> (<a href="chap10.html#X80B47D78785F6859"><span class="RefLink">10.4-6</span></a>)). In both cases an <code class="code">IsCat</code> object is also needed.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">C := FiniteComplex(cat, 1, [g,f]);</span>
0 -> 2:(1,0) -> 1:(2,2) -> 0:(1,1) -> 0
<span class="GAPprompt">gap></span> <span class="GAPinput">Ms := StalkComplex(cat, M, 3);</span>
0 -> 3:(2,2) -> 0
</pre></div>
<p><a id="X7AC5660E80079755" name="X7AC5660E80079755"></a></p>
<h4>10.2 <span class="Heading">Infinite lists</span></h4>
<p>In this section we give documentation for the <code class="code">IsInfList</code> category. We start by giving a representation of <span class="SimpleMath">± ∞</span>. Then we quickly describe the <code class="code">IsInfList</code> category, before we turn to the underlying structure of the infinite lists -- the half infinite lists (<code class="code">IsHalfInfList</code>). Most of the functionality of the infinite lists come from this category. Finally, we give the constructors for infinite lists, and some methods for manipulating such objects.</p>
<p><a id="X8466C7117CEC99D2" name="X8466C7117CEC99D2"></a></p>
<h5>10.2-1 IsInfiniteNumber</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsInfiniteNumber</code></td><td class="tdright">( category )</td></tr></table></div>
<p>A category for infinite numbers.</p>
<p><a id="X7F12EE4479A03527" name="X7F12EE4479A03527"></a></p>
<h5>10.2-2 PositiveInfinity</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PositiveInfinity</code></td><td class="tdright">( var )</td></tr></table></div>
<p>A global variable representing the number <span class="SimpleMath">∞</span>. It is greater than any integer, but it can not be compared to numbers which are not integers. It belongs to the <code class="code">IsInfiniteNumber</code> category.</p>
<p><a id="X8759931784478A4D" name="X8759931784478A4D"></a></p>
<h5>10.2-3 NegativeInfinity</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NegativeInfinity</code></td><td class="tdright">( var )</td></tr></table></div>
<p>A global variable representing the number <span class="SimpleMath">-∞</span>. It is smaller than any integer, but it can not be compared to numbers which are not integers. It belongs to the <code class="code">IsInfiniteNumber</code> category.</p>
<p><a id="X84731DA279E797A5" name="X84731DA279E797A5"></a></p>
<h5>10.2-4 IsInfList</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsInfList</code></td><td class="tdright">( category )</td></tr></table></div>
<p>An infinite list is an immutable representation of a list with possibly infinite range of indices. It consists of three parts: The ``middle part'' is finite and covers some range <span class="SimpleMath">[a,b]</span> of indices, the ``positive part'' covers the range <span class="SimpleMath">[b+1,∞)</span> of indices, and the ``negative part'' covers the range <span class="SimpleMath">(-∞,a-1]</span> of indices. Note that none of the three parts are mandatory: The middle part may be an empty list, and the positive part may be set to <code class="code">fail</code> to achieve index range ending at <span class="SimpleMath">b < ∞</span>. Similarly, if the index range has lower bound <span class="SimpleMath">a < ∞</span>, put the negative part to be <code class="code">fail</code>.</p>
<p>Each of the two infinite parts are described in one of the following ways: (1) A finite list which is repeated indefinitely; (2) A function which takes an index in the list as argument and returns the corresponding list item; (3) A function which takes an item from the list as argument and returns the next item.</p>
<p>The two infinite parts are represented as ``half infinite lists'', see <a href="chap10.html#X87524BBB7C2F9FCB"><span class="RefLink">10.2-5</span></a>. An infinite list can be constructed in the following ways:</p>
<ul>
<li><p>From two half infinite lists and a middle part, <code class="func">MakeInfListFromHalfInfLists</code> (<a href="chap10.html#X7CE66EBA844DBB57"><span class="RefLink">10.2-22</span></a>).</p>
</li>
<li><p>Directly, by giving the same input as when constructing the above, <code class="func">MakeInfList</code> (<a href="chap10.html#X801DE2517D08C19E"><span class="RefLink">10.2-23</span></a>).</p>
</li>
<li><p>If all values of the infinite list are the image of the index under a function <span class="SimpleMath">f</span>, one can use <code class="func">FunctionInfList</code> (<a href="chap10.html#X7EEB276380E1584F"><span class="RefLink">10.2-24</span></a>).</p>
</li>
<li><p>If all values of the infinite list are the same, one can use <code class="func">ConstantInfList</code> (<a href="chap10.html#X78C7FBAE83914790"><span class="RefLink">10.2-25</span></a>).</p>
</li>
<li><p>If the infinite list has a finite range, one can use <code class="func">FiniteInfList</code> (<a href="chap10.html#X7D68E0627F556E14"><span class="RefLink">10.2-26</span></a>).</p>
</li>
</ul>
<p>In addition, new infinite lists can be constructed from others by shift, splice, concatenation, extracting parts or applying a function to the elements.</p>
<p><a id="X87524BBB7C2F9FCB" name="X87524BBB7C2F9FCB"></a></p>
<h5>10.2-5 IsHalfInfList</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsHalfInfList</code></td><td class="tdright">( category )</td></tr></table></div>
<p>A half infinite list is a representation of a list with indices in the range <span class="SimpleMath">[a,∞)</span> or <span class="SimpleMath">(-∞,b]</span>. An infinite list is typically made from two half infinite lists, and half infinite lists can be extracted from an infinite list. Hence, the half infinite list stores much of the information about an infinite list. One main difference between an infinite list and a half infinite list is that the half infinite list does not have any finite part, as the ``middle'' part of an infinite list.</p>
<p><a id="X7D21FB1A7D21FB1A" name="X7D21FB1A7D21FB1A"></a></p>
<h5><code>10.2-6 \^</code></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ \^</code>( <var class="Arg">list</var>, <var class="Arg">pos</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Arguments: <var class="Arg">list</var> -- either an infinite list or a half infinite list, <var class="Arg">pos</var> -- a valid index for <var class="Arg">list</var>.</p>
<p>Returns: The value at position <var class="Arg">pos</var> of <var class="Arg">list</var>.</p>
<p><a id="X7E01944C83F87EED" name="X7E01944C83F87EED"></a></p>
<h5>10.2-7 MakeHalfInfList</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MakeHalfInfList</code>( <var class="Arg">start</var>, <var class="Arg">direction</var>, <var class="Arg">typeWithArgs</var>, <var class="Arg">callback</var>, <var class="Arg">repeatifyCallback</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Arguments: <var class="Arg">start</var> -- an integer, <var class="Arg">direction</var> -- either <span class="SimpleMath">1</span> or <span class="SimpleMath">-1</span>, <var class="Arg">typeWithArgs</var> -- a list which may have different formats, <var class="Arg">callback</var> -- a function, <var class="Arg">repeatifyCallback</var> -- a function. <br /></p>
<p>Returns: A newly created half infinite list with index range from <var class="Arg">start</var> to <span class="SimpleMath">∞</span>, or from <span class="SimpleMath">-∞</span> to <var class="Arg">start</var>.</p>
<p>If the range should be <span class="SimpleMath">[mathttstart,∞)</span> then the value of <var class="Arg">direction</var> is <span class="SimpleMath">1</span>. if the range should be <span class="SimpleMath">(-∞,mathttstart]</span>, then the value of <var class="Arg">direction</var> is <span class="SimpleMath">-1</span>.</p>
<p>The argument <var class="Arg">typeWithArgs</var> can take one of the following forms:</p>
<ul>
<li><p><code class="code">[ "repeat", repeatList ]</code></p>
</li>
<li><p><code class="code">[ "next", nextFunction, initialValue ]</code></p>
</li>
<li><p><code class="code">[ "next/repeat", nextFunction, initialValue ]</code></p>
</li>
<li><p><code class="code">[ "pos", posFunction ]</code></p>
</li>
<li><p><code class="code">[ "pos", posFunction, storeValues ]</code></p>
</li>
</ul>
<p><code class="code">repeatList</code> is a list of values that should be repeated in the half infinite list. <code class="code">nextFunction</code> returns the value at position <span class="SimpleMath">i</span>, given the value at the previous position as argument. Here <code class="code">initialValue</code> is the value at position <code class="code">start</code>. Similarly, <code class="code">posFunction</code> returns the value at any position <span class="SimpleMath">i</span>, and it may or may not store the values between the previous computed indices and the newly computed index. The default value of <code class="code">storeValues</code> is <code class="code">true</code> for <code class="code">"next"</code> and <code class="code">"pos"</code>, and <code class="code">false</code> for <code class="code">"repeat"</code>. The type <code class="code">"next/repeat"</code> works exactly like the type <code class="code">"next"</code>, except that when values in the list are computed, the list will try to discover if the values are repeating. If this happens, the function <var class="Arg">repeatifyCallback</var> is called with two arguments: the non-repeating part at the beginning as a normal list (this might be empty) and a new HalfInfList of type <code class="code">"repeat"</code> for the repeating part.</p>
<p>The argument <code class="code">callback</code> is a function that is called whenever a new value of the list is computed. It takes three arguments: The current position, the direction and the type (that is, <code class="code">typeWithArgs[1]</code>). If no callback function is needed, use <code class="code">false</code>.</p>
<p>All the information given to create the list is stored, and can be retrieved later by the operations listed in <a href="chap10.html#X8458C2698505C12B"><span class="RefLink">10.2-8</span></a>--<a href="chap10.html#X7B5E57F0859BEE17"><span class="RefLink">10.2-18</span></a>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput"># make a HalfInfList from 0 to inf which repeats the list [ 2, 4, 6 ]</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">list1 := MakeHalfInfList( 0, 1, [ "repeat", [ 2, 4, 6 ] ], false );</span>
<object>
<span class="GAPprompt">gap></span> <span class="GAPinput">list1^0;</span>
2
<span class="GAPprompt">gap></span> <span class="GAPinput">list1^5;</span>
6
<span class="GAPprompt">gap></span> <span class="GAPinput"># make a HalfInfList from 0 to inf with x^2 in position x</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">f := function(x) return x^2; end;;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">list2 := MakeHalfInfList( 0, 1, [ "pos", f, false ], false );</span>
<object>
<span class="GAPprompt">gap></span> <span class="GAPinput">list2^0;</span>
0
<span class="GAPprompt">gap></span> <span class="GAPinput">list2^10;</span>
100
<span class="GAPprompt">gap></span> <span class="GAPinput"># make a HalfInfList from 0 to -inf where each new value adds 3</span>
<span class="GAPprompt">gap></span> <span class="GAPinput"># to the previous and the value in position 0 is 10</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">g := function(x) return x+3; end;;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">list3 := MakeHalfInfList( 0, -1, [ "next", g, 7 ], false );</span>
<object>
<span class="GAPprompt">gap></span> <span class="GAPinput">list3^0;</span>
10
<span class="GAPprompt">gap></span> <span class="GAPinput">list3^-10;</span>
40
</pre></div>
<p><a id="X8458C2698505C12B" name="X8458C2698505C12B"></a></p>
<h5>10.2-8 StartPosition</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ StartPosition</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The start position of <var class="Arg">list</var>.</p>
<p><a id="X812437C47A208D4A" name="X812437C47A208D4A"></a></p>
<h5>10.2-9 Direction</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Direction</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The direction of <var class="Arg">list</var> (either <span class="SimpleMath">1</span> or <span class="SimpleMath">-1</span>).</p>
<p><a id="X7C3728BF7ED7149A" name="X7C3728BF7ED7149A"></a></p>
<h5>10.2-10 InfListType</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InfListType</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The type of <var class="Arg">list</var> (either <code class="code">"pos"</code>, <code class="code">"repeat"</code> or <code class="code">"next"</code>).</p>
<p><a id="X82AA0979868A6967" name="X82AA0979868A6967"></a></p>
<h5>10.2-11 RepeatingList</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RepeatingList</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The repeating list of <var class="Arg">list</var> if <var class="Arg">list</var> is of type <code class="code">"repeat"</code>, and <code class="code">fail</code> otherwise.</p>
<p><a id="X7AF21D62848B270B" name="X7AF21D62848B270B"></a></p>
<h5>10.2-12 ElementFunction</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ElementFunction</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The element function of <var class="Arg">list</var> if <var class="Arg">list</var> is of type <code class="code">"next"</code> or <code class="code">"pos"</code>, and <code class="code">fail</code> otherwise.</p>
<p><a id="X8728A2107F27D68F" name="X8728A2107F27D68F"></a></p>
<h5>10.2-13 IsStoringValues</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsStoringValues</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: <code class="code">true</code> if all elements of the list are stored, <code class="code">false</code> otherwise.</p>
<p><a id="X86888FBD8559B29B" name="X86888FBD8559B29B"></a></p>
<h5>10.2-14 NewValueCallback</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NewValueCallback</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The callback function of the list.</p>
<p><a id="X856E1541834688C6" name="X856E1541834688C6"></a></p>
<h5>10.2-15 IsRepeating</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsRepeating</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: <code class="code">true</code> if the type of the list is <code class="code">"repeat"</code>.</p>
<p><a id="X8208162D7F3CC139" name="X8208162D7F3CC139"></a></p>
<h5>10.2-16 InitialValue</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InitialValue</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: If the list is of type <code class="code">"next"</code> then the initial value is returned, otherwise it fails.</p>
<p><a id="X7F12274E794510CA" name="X7F12274E794510CA"></a></p>
<h5>10.2-17 LowestKnownPosition</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LowestKnownPosition</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The lowest index <span class="SimpleMath">i</span> such that the value at position <span class="SimpleMath">i</span> is known without computation (that is, it is either stored, or the list has type <code class="code">"repeat"</code>).</p>
<p><a id="X7B5E57F0859BEE17" name="X7B5E57F0859BEE17"></a></p>
<h5>10.2-18 HighestKnownValue</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ HighestKnownValue</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><var class="Arg">list</var> -- a half infinite list.<br /></p>
<p>Returns: The highest index <span class="SimpleMath">i</span> such that the value at position <span class="SimpleMath">i</span> is known without computation (that is, it is either stored, or the list has type <code class="code">"repeat"</code>).</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput"># we reuse the IsHalfInfLists from the previous example</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">HighestKnownPosition(list1);</span>
+inf
<span class="GAPprompt">gap></span> <span class="GAPinput">HighestKnownPosition(list2);</span>
"none"
<span class="GAPprompt">gap></span> <span class="GAPinput">HighestKnownPosition(list3);</span>
0
</pre></div>
<p><a id="X81F7B0AB84D6319B" name="X81F7B0AB84D6319B"></a></p>
<h5>10.2-19 Shift</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Shift</code>( <var class="Arg">list</var>, <var class="Arg">shift</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Arguments: <var class="Arg">list</var> -- a half infinite list, <var class="Arg">shift</var> -- an integer.<br /></p>
<p>Returns: A new half infinite list which is <var class="Arg">list</var> with all values shifted <var class="Arg">shift</var> positions to the right if <var class="Arg">shift</var> is positive, and to the left if <var class="Arg">shift</var> is negative.</p>
<p><a id="X7D8067A7842BC4A4" name="X7D8067A7842BC4A4"></a></p>
<h5>10.2-20 Cut</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Cut</code>( <var class="Arg">list</var>, <var class="Arg">pos</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Arguments: <var class="Arg">list</var> -- a half infinite list, <var class="Arg">pos</var> -- an integer within the range of <var class="Arg">list</var>.<br /></p>
<p>Returns: A new half infinite list which is <var class="Arg">list</var> with some part cut off.</p>
<p>If the direction of <var class="Arg">list</var> is positive, then the new list has range from <code class="code">cut</code> to <span class="SimpleMath">∞</span>. If the direction of <var class="Arg">list</var> is negative, then the new list has range from <span class="SimpleMath">-∞</span> to <code class="code">cut</code>. The values at position <span class="SimpleMath">i</span> of the new half infinite list is the same as the value at position <span class="SimpleMath">i</span> of <var class="Arg">list</var>.</p>
<p><a id="X79A67E377B71C540" name="X79A67E377B71C540"></a></p>
<h5>10.2-21 HalfInfList</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ HalfInfList</code>( <var class="Arg">list</var>, <var class="Arg">func</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Arguments: <var class="Arg">list</var> -- a half infinite list, <var class="Arg">func</var> -- a function which takes an element of the list as argument. <br /></p>
<p>Returns: A half infinite list with the same range as <var class="Arg">list</var>, where the value at position <span class="SimpleMath">i</span> is the image of the value at position <span class="SimpleMath">i</span> of <var class="Arg">list</var> under <var class="Arg">func</var>.</p>
<p><a id="X7CE66EBA844DBB57" name="X7CE66EBA844DBB57"></a></p>
<h5>10.2-22 MakeInfListFromHalfInfLists</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MakeInfListFromHalfInfLists</code>( <var class="Arg">basePosition</var>, <var class="Arg">middle</var>, <var class="Arg">positive</var>, <var class="Arg">negative</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Arguments: <var class="Arg">basePosition</var> -- an integer, <var class="Arg">middle</var> -- a list, <var class="Arg">positive</var> -- a half infinite list, <var class="Arg">negative</var> -- a half infinite list. <br /></p>
<p>Returns: An infinite list with <var class="Arg">middle</var> as is middle part, <var class="Arg">positive</var> as its positive part and <var class="Arg">negative</var> as its negative part.</p>
<p>The starting position of <var class="Arg">positive</var> must be <code class="code">basePosition + Length( middle )</code>, and the starting position of <var class="Arg">negative</var> must be <code class="code">basePosition - 1</code>. The returned list has <code class="code">middle[1]</code> in position <var class="Arg">basePosition</var>, <code class="code">middle[2]</code> in position <var class="Arg">basePosition + 1</var> and so on. Note that one probably wants the <var class="Arg">positive</var> half infinite list to have direction <span class="SimpleMath">1</span>, and the <var class="Arg">negative</var> half infinite list to have direction <span class="SimpleMath">-1</span>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput"># we want to construct an infinite list with 0 in position</span> | |