Debian Codegraph @

doc/ref/chap66.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
7 <head>
8 <title>GAP (ref) - Chapter 66: Polynomials and Rational Functions</title>
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
10 <meta name="generator" content="GAPDoc2HTML" />
11 <link rel="stylesheet" type="text/css" href="manual.css" />
12 <script src="manual.js" type="text/javascript"></script>
13 <script type="text/javascript">overwriteStyle();</script>
14 </head>
15 <body class="chap66" onload="jscontent()">
16
17
18 <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="chap14.html">14</a> <a href="chap15.html">15</a> <a href="chap16.html">16</a> <a href="chap17.html">17</a> <a href="chap18.html">18</a> <a href="chap19.html">19</a> <a href="chap20.html">20</a> <a href="chap21.html">21</a> <a href="chap22.html">22</a> <a href="chap23.html">23</a> <a href="chap24.html">24</a> <a href="chap25.html">25</a> <a href="chap26.html">26</a> <a href="chap27.html">27</a> <a href="chap28.html">28</a> <a href="chap29.html">29</a> <a href="chap30.html">30</a> <a href="chap31.html">31</a> <a href="chap32.html">32</a> <a href="chap33.html">33</a> <a href="chap34.html">34</a> <a href="chap35.html">35</a> <a href="chap36.html">36</a> <a href="chap37.html">37</a> <a href="chap38.html">38</a> <a href="chap39.html">39</a> <a href="chap40.html">40</a> <a href="chap41.html">41</a> <a href="chap42.html">42</a> <a href="chap43.html">43</a> <a href="chap44.html">44</a> <a href="chap45.html">45</a> <a href="chap46.html">46</a> <a href="chap47.html">47</a> <a href="chap48.html">48</a> <a href="chap49.html">49</a> <a href="chap50.html">50</a> <a href="chap51.html">51</a> <a href="chap52.html">52</a> <a href="chap53.html">53</a> <a href="chap54.html">54</a> <a href="chap55.html">55</a> <a href="chap56.html">56</a> <a href="chap57.html">57</a> <a href="chap58.html">58</a> <a href="chap59.html">59</a> <a href="chap60.html">60</a> <a href="chap61.html">61</a> <a href="chap62.html">62</a> <a href="chap63.html">63</a> <a href="chap64.html">64</a> <a href="chap65.html">65</a> <a href="chap66.html">66</a> <a href="chap67.html">67</a> <a href="chap68.html">68</a> <a href="chap69.html">69</a> <a href="chap70.html">70</a> <a href="chap71.html">71</a> <a href="chap72.html">72</a> <a href="chap73.html">73</a> <a href="chap74.html">74</a> <a href="chap75.html">75</a> <a href="chap76.html">76</a> <a href="chap77.html">77</a> <a href="chap78.html">78</a> <a href="chap79.html">79</a> <a href="chap80.html">80</a> <a href="chap81.html">81</a> <a href="chap82.html">82</a> <a href="chap83.html">83</a> <a href="chap84.html">84</a> <a href="chap85.html">85</a> <a href="chap86.html">86</a> <a href="chap87.html">87</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
19
20 <div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap65.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap67.html">[Next Chapter]</a>&nbsp; </div>
21
22 <p id="mathjaxlink" class="pcenter"><a href="chap66_mj.html">[MathJax on]</a></p>
23 <p><a id="X7A14A6588268810A" name="X7A14A6588268810A"></a></p>
24 <div class="ChapSects"><a href="chap66.html#X7A14A6588268810A">66 <span class="Heading">Polynomials and Rational Functions</span></a>
25 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7A8FADCD875826DA">66.1 <span class="Heading">Indeterminates</span></a>
26 </span>
27 <div class="ContSSBlock">
28 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X79D0380D7FA39F7D">66.1-1 <span class="Heading">Indeterminate</span></a>
29 </span>
30 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X816C8D797C804380">66.1-2 IndeterminateNumberOfUnivariateRationalFunction</a></span>
31 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A2FA46885EF403D">66.1-3 IndeterminateOfUnivariateRationalFunction</a></span>
32 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7FD4AC807A1C8E27">66.1-4 IndeterminateName</a></span>
33 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X791A06E67F784328">66.1-5 CIUnivPols</a></span>
34 </div></div>
35 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X86A68FD582F4F757">66.2 <span class="Heading">Operations for Rational Functions</span></a>
36 </span>
37 </div>
38 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X824B6D328643CE04">66.3 <span class="Heading">Comparison of Rational Functions</span></a>
39 </span>
40 </div>
41 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7D871EA180E9486C">66.4 <span class="Heading">Properties and Attributes of Rational Functions</span></a>
42 </span>
43 <div class="ContSSBlock">
44 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X86C92F677DA9347F">66.4-1 IsPolynomialFunction</a></span>
45 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7D7D2667803D8D8A">66.4-2 NumeratorOfRationalFunction</a></span>
46 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X78DC1B5B866ADB6C">66.4-3 DenominatorOfRationalFunction</a></span>
47 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7974B0707C8DAB6C">66.4-4 IsPolynomial</a></span>
48 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7914771F7C6013EF">66.4-5 AsPolynomial</a></span>
49 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8738F73583273FCA">66.4-6 IsUnivariateRationalFunction</a></span>
50 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7F1F67527A35A9CE">66.4-7 CoefficientsOfUnivariateRationalFunction</a></span>
51 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X86A2546685D0016B">66.4-8 IsUnivariatePolynomial</a></span>
52 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X78C9524D7F2708C2">66.4-9 CoefficientsOfUnivariatePolynomial</a></span>
53 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X79138FF28213B6EC">66.4-10 IsLaurentPolynomial</a></span>
54 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7F2A49208341C2A8">66.4-11 IsConstantRationalFunction</a></span>
55 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X834B54947FAADEA4">66.4-12 IsPrimitivePolynomial</a></span>
56 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X87531E03849391C1">66.4-13 SplittingField</a></span>
57 </div></div>
58 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X82E2F1707FC2E553">66.5 <span class="Heading">Univariate Polynomials</span></a>
59 </span>
60 <div class="ContSSBlock">
61 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8379F8CB7D0076BA">66.5-1 UnivariatePolynomial</a></span>
62 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X85178A3E7B4F11E0">66.5-2 UnivariatePolynomialByCoefficients</a></span>
63 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X78AF77C383245254">66.5-3 DegreeOfLaurentPolynomial</a></span>
64 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7CBB760C87B04F75">66.5-4 RootsOfPolynomial</a></span>
65 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X80CEB10D7879767F">66.5-5 RootsOfUPol</a></span>
66 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7887FBC78149BB0C">66.5-6 QuotRemLaurpols</a></span>
67 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7DDADF157879EFBF">66.5-7 UnivariatenessTestRationalFunction</a></span>
68 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A3BC96B7A50DE98">66.5-8 InfoPoly</a></span>
69 </div></div>
70 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X81499B5A823E6EA3">66.6 <span class="Heading">Polynomials as Univariate Polynomials in one Indeterminate</span></a>
71 </span>
72 <div class="ContSSBlock">
73 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X826B99B17ABD11BE">66.6-1 DegreeIndeterminate</a></span>
74 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X85646FD07F9C60F5">66.6-2 PolynomialCoefficientsOfPolynomial</a></span>
75 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X80710E9B7D8340BD">66.6-3 LeadingCoefficient</a></span>
76 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7B3EAE41795598A5">66.6-4 LeadingMonomial</a></span>
77 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7B57CEE2780D0E0B">66.6-5 Derivative</a></span>
78 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7C7D790A7D6E11AD">66.6-6 Discriminant</a></span>
79 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X857AD5587EF49029">66.6-7 Resultant</a></span>
80 </div></div>
81 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X85ABC4687DF05777">66.7 <span class="Heading">Multivariate Polynomials</span></a>
82 </span>
83 <div class="ContSSBlock">
84 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A70769C7F52CD2D">66.7-1 <span class="Heading">Value</span></a>
85 </span>
86 </div></div>
87 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7ED3E7D17C7AC732">66.8 <span class="Heading">Minimal Polynomials</span></a>
88 </span>
89 <div class="ContSSBlock">
90 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8643915A8424DAF8">66.8-1 MinimalPolynomial</a></span>
91 </div></div>
92 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X837B8E55832CDFEB">66.9 <span class="Heading">Cyclotomic Polynomials</span></a>
93 </span>
94 <div class="ContSSBlock">
95 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X827FC7FE81EE4C02">66.9-1 CyclotomicPolynomial</a></span>
96 </div></div>
97 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X8551EF5187509D69">66.10 <span class="Heading">Polynomial Factorization</span></a>
98 </span>
99 <div class="ContSSBlock">
100 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X83511D517B544F36">66.10-1 Factors</a></span>
101 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7F5A4ACB7AF9E329">66.10-2 FactorsSquarefree</a></span>
102 </div></div>
103 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7F45E9E47EA2C18B">66.11 <span class="Heading">Polynomials over the Rationals</span></a>
104 </span>
105 <div class="ContSSBlock">
106 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7E66494B7B05A055">66.11-1 PrimitivePolynomial</a></span>
107 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A73A3877EB73566">66.11-2 PolynomialModP</a></span>
108 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7AB9A6257ED694EC">66.11-3 GaloisType</a></span>
109 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7EB610D37D156DC6">66.11-4 ProbabilityShapes</a></span>
110 </div></div>
111 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7C178AB9866FDDE5">66.12 <span class="Heading">Factorization of Polynomials over the Rationals</span></a>
112 </span>
113 <div class="ContSSBlock">
114 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8723075C81D2CCA6">66.12-1 BombieriNorm</a></span>
115 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X856D769D878AF7AE">66.12-2 MinimizedBombieriNorm</a></span>
116 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8139BB0F87399F2C">66.12-3 HenselBound</a></span>
117 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X79CC9C8D7C9F6B6A">66.12-4 OneFactorBound</a></span>
118 </div></div>
119 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X844B3C6C87A0E7E0">66.13 <span class="Heading">Laurent Polynomials</span></a>
120 </span>
121 <div class="ContSSBlock">
122 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8467263B7EFA013E">66.13-1 LaurentPolynomialByCoefficients</a></span>
123 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X86D58AB67F86469F">66.13-2 CoefficientsOfLaurentPolynomial</a></span>
124 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8381E1B582F38C85">66.13-3 IndeterminateNumberOfLaurentPolynomial</a></span>
125 </div></div>
126 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7C1708D27F97B05F">66.14 <span class="Heading">Univariate Rational Functions</span></a>
127 </span>
128 <div class="ContSSBlock">
129 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X83DD411179888783">66.14-1 UnivariateRationalFunctionByCoefficients</a></span>
130 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7B1EE4E07A9631C6">66.14-2 TaylorSeriesRationalFunction</a></span>
131 </div></div>
132 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7C59471783C3FEDC">66.15 <span class="Heading">Polynomial Rings and Function Fields</span></a>
133 </span>
134 <div class="ContSSBlock">
135 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7D2F16E480060330">66.15-1 <span class="Heading">PolynomialRing</span></a>
136 </span>
137 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X80D585E1793D4552">66.15-2 IndeterminatesOfPolynomialRing</a></span>
138 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8235D10781BE8003">66.15-3 CoefficientsRing</a></span>
139 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7D631ACC86C584B7">66.15-4 IsPolynomialRing</a></span>
140 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X86F391237A76D804">66.15-5 IsFiniteFieldPolynomialRing</a></span>
141 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X782D07F77BCF67C1">66.15-6 IsAbelianNumberFieldPolynomialRing</a></span>
142 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7D45213A8642033B">66.15-7 IsRationalsPolynomialRing</a></span>
143 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X812E801484E3624E">66.15-8 <span class="Heading">FunctionField</span></a>
144 </span>
145 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8090C9EC85201AAC">66.15-9 IsFunctionField</a></span>
146 </div></div>
147 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X85CA757B844F12AE">66.16 <span class="Heading">Univariate Polynomial Rings</span></a>
148 </span>
149 <div class="ContSSBlock">
150 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X84DC2A59797A26DE">66.16-1 <span class="Heading">UnivariatePolynomialRing</span></a>
151 </span>
152 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A43D74B812401CA">66.16-2 IsUnivariatePolynomialRing</a></span>
153 </div></div>
154 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X86E2ADEA784AD163">66.17 <span class="Heading">Monomial Orderings</span></a>
155 </span>
156 <div class="ContSSBlock">
157 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X79D4CBBF820EA204">66.17-1 IsMonomialOrdering</a></span>
158 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7D052A017A73E91E">66.17-2 LeadingMonomialOfPolynomial</a></span>
159 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7B6231137BA8B95F">66.17-3 LeadingTermOfPolynomial</a></span>
160 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X798E707D86141087">66.17-4 LeadingCoefficientOfPolynomial</a></span>
161 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7EDE941781BA7F8B">66.17-5 MonomialComparisonFunction</a></span>
162 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7EDC3A457E7B591E">66.17-6 MonomialExtrepComparisonFun</a></span>
163 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X852D7BB37ECE98E1">66.17-7 MonomialLexOrdering</a></span>
164 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X786C866C824D2688">66.17-8 MonomialGrlexOrdering</a></span>
165 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8094C733808D1799">66.17-9 MonomialGrevlexOrdering</a></span>
166 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X84AC871283A74EC0">66.17-10 EliminationOrdering</a></span>
167 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7C99593584D478D7">66.17-11 PolynomialReduction</a></span>
168 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7DE7D4467EBAD916">66.17-12 PolynomialReducedRemainder</a></span>
169 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7C8239057FD4EC03">66.17-13 PolynomialDivisionAlgorithm</a></span>
170 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A30E10B820311D1">66.17-14 MonomialExtGrlexLess</a></span>
171 </div></div>
172 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X79BAB2937E6085D6">66.18 <span class="Heading">Groebner Bases</span></a>
173 </span>
174 <div class="ContSSBlock">
175 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7A43611E876B7560">66.18-1 <span class="Heading">GroebnerBasis</span></a>
176 </span>
177 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7DEF286384967C9E">66.18-2 <span class="Heading">ReducedGroebnerBasis</span></a>
178 </span>
179 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7FC1EFE78498C17C">66.18-3 StoredGroebnerBasis</a></span>
180 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7C55702786D284A7">66.18-4 InfoGroebner</a></span>
181 </div></div>
182 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X8113DD9B781CA6C1">66.19 <span class="Heading">Rational Function Families</span></a>
183 </span>
184 <div class="ContSSBlock">
185 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X855DD73C78A90BC3">66.19-1 RationalFunctionsFamily</a></span>
186 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X86E097307D188D3B">66.19-2 IsPolynomialFunctionsFamily</a></span>
187 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7AADCA45826866FB">66.19-3 CoefficientsFamily</a></span>
188 </div></div>
189 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7E360788785DE530">66.20 <span class="Heading">The Representations of Rational Functions</span></a>
190 </span>
191 </div>
192 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X7F44CF87801DB965">66.21 <span class="Heading">The Defining Attributes of Rational Functions</span></a>
193 </span>
194 <div class="ContSSBlock">
195 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X791E16C67A352263">66.21-1 IsRationalFunctionDefaultRep</a></span>
196 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7DF955C87CBFC12B">66.21-2 ExtRepNumeratorRatFun</a></span>
197 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8059E74D7DCABDBC">66.21-3 ExtRepDenominatorRatFun</a></span>
198 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X84F546F87B5ECFE0">66.21-4 ZeroCoefficientRatFun</a></span>
199 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X833CE16579AB26E0">66.21-5 IsPolynomialDefaultRep</a></span>
200 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8406EE2E8775FBAB">66.21-6 ExtRepPolynomialRatFun</a></span>
201 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7E1B98CC7BADAF56">66.21-7 IsLaurentPolynomialDefaultRep</a></span>
202 </div></div>
203 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X791FADD278A2F32F">66.22 <span class="Heading">Creation of Rational Functions</span></a>
204 </span>
205 <div class="ContSSBlock">
206 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X81297E4587A9F2A6">66.22-1 RationalFunctionByExtRep</a></span>
207 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X79E445AF7849F48A">66.22-2 PolynomialByExtRep</a></span>
208 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7E2A46D68472F492">66.22-3 LaurentPolynomialByExtRep</a></span>
209 </div></div>
210 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X809028CD7C0EA7CE">66.23 <span class="Heading">Arithmetic for External Representations of Polynomials</span></a>
211 </span>
212 <div class="ContSSBlock">
213 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X855094857A78ABF9">66.23-1 ZippedSum</a></span>
214 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7B911136782F0F6D">66.23-2 ZippedProduct</a></span>
215 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X87E5EB8985AF04CD">66.23-3 QuotientPolynomialsExtRep</a></span>
216 </div></div>
217 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap66.html#X811B7D8E79E4BD46">66.24 <span class="Heading">Cancellation Tests for Rational Functions</span></a>
218 </span>
219 <div class="ContSSBlock">
220 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X878A1AC87B492E3D">66.24-1 RationalFunctionByExtRepWithCancellation</a></span>
221 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X7BFB55887A153003">66.24-2 TryGcdCancelExtRepPolynomials</a></span>
222 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap66.html#X8477D7337C4A98AB">66.24-3 HeuristicCancelPolynomialsExtRep</a></span>
223 </div></div>
224 </div>
225
226 <h3>66 <span class="Heading">Polynomials and Rational Functions</span></h3>
227
228 <p>Let <span class="SimpleMath">R</span> be a commutative ring-with-one. We call a free associative algebra <span class="SimpleMath">A</span> over <span class="SimpleMath">R</span> a <em>polynomial ring</em> over <span class="SimpleMath">R</span>. The free generators of <span class="SimpleMath">A</span> are called <em>indeterminates</em> (to avoid naming conflicts with the word <em>variables</em> which will be used to denote <strong class="pkg">GAP</strong> variables only) , they are usually denoted by <span class="SimpleMath">x_1, x_2, ...</span>. The number of indeterminates is called the <em>rank</em> of <span class="SimpleMath">A</span>. The elements of <span class="SimpleMath">A</span> are called <em>polynomials</em>. Products of indeterminates are called <em>monomials</em>, every polynomial can be expressed as a finite sum of products of monomials with ring elements in a form like <span class="SimpleMath">r_{1,0} x_1 + r_{1,1} x_1 x_2 + r_{0,1} x_2 + ⋯</span> with <span class="SimpleMath">r_{i,j} ∈ R</span>.</p>
229
230 <p>A polynomial ring of rank 1 is called an <em>univariate</em> polynomial ring, its elements are <em>univariate polynomials</em>.</p>
231
232 <p>Polynomial rings of smaller rank naturally embed in rings of higher rank; if <span class="SimpleMath">S</span> is a subring of <span class="SimpleMath">R</span> then a polynomial ring over <span class="SimpleMath">S</span> naturally embeds in a polynomial ring over <span class="SimpleMath">R</span> of the same rank. Note however that <strong class="pkg">GAP</strong> does not consider <span class="SimpleMath">R</span> as a subset of a polynomial ring over <span class="SimpleMath">R</span>; for example the zero of <span class="SimpleMath">R</span> (<span class="SimpleMath">0</span>) and the zero of the polynomial ring (<span class="SimpleMath">0x^0</span>) are different objects.</p>
233
234 <p>Internally, indeterminates are represented by positive integers, but it is possible to give names to them to have them printed in a nicer way. Beware, however that there is not necessarily any relation between the way an indeterminate is called and the way it is printed. See section <a href="chap66.html#X7A8FADCD875826DA"><span class="RefLink">66.1</span></a> for details.</p>
235
236 <p>If <span class="SimpleMath">R</span> is an integral domain, the polynomial ring <span class="SimpleMath">A</span> over <span class="SimpleMath">R</span> is an integral domain as well and one can therefore form its quotient field <span class="SimpleMath">Q</span>. This field is called a <em>field of rational functions</em>. Again <span class="SimpleMath">A</span> embeds naturally into <span class="SimpleMath">Q</span> and <strong class="pkg">GAP</strong> will perform this embedding implicitly. (In fact it implements the ring of rational functions over <span class="SimpleMath">R</span>.) To avoid problems with leading coefficients, however, <span class="SimpleMath">R</span> must be a unique factorization domain.</p>
237
238 <p><a id="X7A8FADCD875826DA" name="X7A8FADCD875826DA"></a></p>
239
240 <h4>66.1 <span class="Heading">Indeterminates</span></h4>
241
242 <p>Internally, indeterminates are created for a <em>family</em> of objects (for example all elements of finite fields in characteristic <span class="SimpleMath">3</span> are in one family). Thus a variable <q>x</q> over the rationals is also an <q>x</q> over the integers, while an <q>x</q> over <code class="code">GF(3)</code> is different.</p>
243
244 <p>Within one family, every indeterminate has a number <var class="Arg">nr</var> and as long as no other names have been assigned, this indeterminate will be displayed as <q><code class="code">x_<var class="Arg">nr</var></code></q>. Indeterminate numbers can be arbitrary nonnegative integers.</p>
245
246 <p>It is possible to assign names to indeterminates; these names are strings and only provide a means for printing the indeterminates in a nice way. Indeterminates that have not been assigned a name will be printed as <q><code class="code">x_<var class="Arg">nr</var></code></q>.</p>
247
248 <p>(Because of this printing convention, the name <code class="code">x_<var class="Arg">nr</var></code> is interpreted specially to always denote the variable with internal number <var class="Arg">nr</var>.)</p>
249
250 <p>The indeterminate names have not necessarily any relations to variable names: this means that an indeterminate whose name is <q><code class="code">x</code></q> cannot be accessed using the variable <code class="code">x</code>, unless <code class="code">x</code> was defined to be that indeterminate.</p>
251
252 <p>When asking for indeterminates with certain names, <strong class="pkg">GAP</strong> usually will take the first (with respect to the internal numbering) indeterminates that are not yet named, name these accordingly and return them. Thus when asking for named indeterminates, no relation between names and indeterminate numbers can be guaranteed. The attribute <code class="code">IndeterminateNumberOfLaurentPolynomial(<var class="Arg">indet</var>)</code> will return the number of the indeterminate <var class="Arg">indet</var>.</p>
253
254 <p>When asked to create an indeterminate with a name that exists already for the family, <strong class="pkg">GAP</strong> will by default return this existing indeterminate. If you explicitly want a <em>new</em> indeterminate, distinct from the already existing one with the <em>same</em> name, you can add the <code class="code">new</code> option to the function call. (This is in most cases not a good idea.)</p>
255
256
257 <div class="example"><pre>
258 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:=PolynomialRing(GF(3),["x","y","z"]);</span>
259 GF(3)[x,y,z]
260 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List(IndeterminatesOfPolynomialRing(R),</span>
261 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> IndeterminateNumberOfLaurentPolynomial);</span>
262 [ 1, 2, 3 ]
263 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:=PolynomialRing(GF(3),["z"]);</span>
264 GF(3)[z]
265 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List(IndeterminatesOfPolynomialRing(R),</span>
266 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> IndeterminateNumberOfLaurentPolynomial);</span>
267 [ 3 ]
268 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:=PolynomialRing(GF(3),["x","y","z"]:new);</span>
269 GF(3)[x,y,z]
270 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List(IndeterminatesOfPolynomialRing(R),</span>
271 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> IndeterminateNumberOfLaurentPolynomial);</span>
272 [ 4, 5, 6 ]
273 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">R:=PolynomialRing(GF(3),["z"]);</span>
274 GF(3)[z]
275 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List(IndeterminatesOfPolynomialRing(R),</span>
276 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> IndeterminateNumberOfLaurentPolynomial);</span>
277 [ 3 ]
278 </pre></div>
279
280 <p><a id="X79D0380D7FA39F7D" name="X79D0380D7FA39F7D"></a></p>
281
282 <h5>66.1-1 <span class="Heading">Indeterminate</span></h5>
283
284 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Indeterminate</code>( <var class="Arg">R</var>[, <var class="Arg">nr</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
285 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Indeterminate</code>( <var class="Arg">R</var>[, <var class="Arg">name</var>][, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
286 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Indeterminate</code>( <var class="Arg">fam</var>, <var class="Arg">nr</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
287 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; X</code>( <var class="Arg">R</var>[, <var class="Arg">nr</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
288 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; X</code>( <var class="Arg">R</var>[, <var class="Arg">name</var>][, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
289 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; X</code>( <var class="Arg">fam</var>, <var class="Arg">nr</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
290 <p>returns the indeterminate number <var class="Arg">nr</var> over the ring <var class="Arg">R</var>. If <var class="Arg">nr</var> is not given it defaults to 1. If the number is not specified a list <var class="Arg">avoid</var> of indeterminates may be given. The function will return an indeterminate that is guaranteed to be different from all the indeterminates in the list <var class="Arg">avoid</var>. The third usage returns an indeterminate called <var class="Arg">name</var> (also avoiding the indeterminates in <var class="Arg">avoid</var> if given).</p>
291
292 <p><code class="func">X</code> is simply a synonym for <code class="func">Indeterminate</code>.</p>
293
294
295 <div class="example"><pre>
296 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Indeterminate(GF(3),"x");</span>
297 x
298 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">y:=X(GF(3),"y");z:=X(GF(3),"X");</span>
299 y
300 X
301 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">X(GF(3),2);</span>
302 y
303 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">X(GF(3),"x_3");</span>
304 X
305 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">X(GF(3),[y,z]);</span>
306 x
307 </pre></div>
308
309 <p><a id="X816C8D797C804380" name="X816C8D797C804380"></a></p>
310
311 <h5>66.1-2 IndeterminateNumberOfUnivariateRationalFunction</h5>
312
313 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndeterminateNumberOfUnivariateRationalFunction</code>( <var class="Arg">rfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
314 <p>returns the number of the indeterminate in which the univariate rational function <var class="Arg">rfun</var> is expressed. (This also provides a way to obtain the number of a given indeterminate.)</p>
315
316 <p>A constant rational function might not possess an indeterminate number. In this case <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> will default to a value of 1. Therefore two univariate polynomials may be considered to be in the same univariate polynomial ring if their indeterminates have the same number or one if of them is constant. (see also <code class="func">CIUnivPols</code> (<a href="chap66.html#X791A06E67F784328"><span class="RefLink">66.1-5</span></a>) and <code class="func">IsLaurentPolynomialDefaultRep</code> (<a href="chap66.html#X7E1B98CC7BADAF56"><span class="RefLink">66.21-7</span></a>)).</p>
317
318 <p><a id="X7A2FA46885EF403D" name="X7A2FA46885EF403D"></a></p>
319
320 <h5>66.1-3 IndeterminateOfUnivariateRationalFunction</h5>
321
322 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndeterminateOfUnivariateRationalFunction</code>( <var class="Arg">rfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
323 <p>returns the indeterminate in which the univariate rational function <var class="Arg">rfun</var> is expressed. (cf. <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> (<a href="chap66.html#X816C8D797C804380"><span class="RefLink">66.1-2</span></a>).)</p>
324
325
326 <div class="example"><pre>
327 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminateNumberOfUnivariateRationalFunction(z);</span>
328 3
329 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminateOfUnivariateRationalFunction(z^5+z);</span>
330 X
331 </pre></div>
332
333 <p><a id="X7FD4AC807A1C8E27" name="X7FD4AC807A1C8E27"></a></p>
334
335 <h5>66.1-4 IndeterminateName</h5>
336
337 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndeterminateName</code>( <var class="Arg">fam</var>, <var class="Arg">nr</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
338 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; HasIndeterminateName</code>( <var class="Arg">fam</var>, <var class="Arg">nr</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
339 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SetIndeterminateName</code>( <var class="Arg">fam</var>, <var class="Arg">nr</var>, <var class="Arg">name</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
340 <p><code class="func">SetIndeterminateName</code> assigns the name <var class="Arg">name</var> to indeterminate <var class="Arg">nr</var> in the rational functions family <var class="Arg">fam</var>. It issues an error if the indeterminate was already named.</p>
341
342 <p><code class="func">IndeterminateName</code> returns the name of the <var class="Arg">nr</var>-th indeterminate (and returns <code class="keyw">fail</code> if no name has been assigned).</p>
343
344 <p><code class="func">HasIndeterminateName</code> tests whether indeterminate <var class="Arg">nr</var> has already been assigned a name.</p>
345
346
347 <div class="example"><pre>
348 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminateName(FamilyObj(x),2);</span>
349 "y"
350 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">HasIndeterminateName(FamilyObj(x),4);</span>
351 false
352 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetIndeterminateName(FamilyObj(x),10,"bla");</span>
353 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Indeterminate(GF(3),10);</span>
354 bla
355 </pre></div>
356
357 <p>As a convenience there is a special method installed for <code class="code">SetName</code> that will assign a name to an indeterminate.</p>
358
359
360 <div class="example"><pre>
361 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:=Indeterminate(GF(3),5);</span>
362 x_5
363 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetName(a,"ah");</span>
364 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a^5+a;</span>
365 ah^5+ah
366 </pre></div>
367
368 <p><a id="X791A06E67F784328" name="X791A06E67F784328"></a></p>
369
370 <h5>66.1-5 CIUnivPols</h5>
371
372 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CIUnivPols</code>( <var class="Arg">upol1</var>, <var class="Arg">upol2</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
373 <p>This function (whose name stands for <q>common indeterminate of univariate polynomials</q>) takes two univariate polynomials as arguments. If both polynomials are given in the same indeterminate number <var class="Arg">indnum</var> (in this case they are <q>compatible</q> as univariate polynomials) it returns <var class="Arg">indnum</var>. In all other cases it returns <code class="keyw">fail</code>. <code class="func">CIUnivPols</code> also accepts if either polynomial is constant but formally expressed in another indeterminate, in this situation the indeterminate of the other polynomial is selected.</p>
374
375 <p><a id="X86A68FD582F4F757" name="X86A68FD582F4F757"></a></p>
376
377 <h4>66.2 <span class="Heading">Operations for Rational Functions</span></h4>
378
379 <p>The rational functions form a field, therefore all arithmetic operations are applicable to rational functions.</p>
380
381 <p><code class="code"><var class="Arg">f</var> + <var class="Arg">g</var></code></p>
382
383 <p><code class="code"><var class="Arg">f</var> - <var class="Arg">g</var></code></p>
384
385 <p><code class="code"><var class="Arg">f</var> * <var class="Arg">g</var></code></p>
386
387 <p><code class="code"><var class="Arg">f</var> / <var class="Arg">g</var></code></p>
388
389
390 <div class="example"><pre>
391 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Indeterminate(Rationals,1);;y:=Indeterminate(Rationals,2);;</span>
392 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=3+x*y+x^5;;g:=5+x^2*y+x*y^2;;</span>
393 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:=g/f;</span>
394 (x_1^2*x_2+x_1*x_2^2+5)/(x_1^5+x_1*x_2+3)
395 </pre></div>
396
397 <p>Note that the quotient <code class="code"><var class="Arg">f</var>/<var class="Arg">g</var></code> of two polynomials might be represented as a rational function again. If <var class="Arg">g</var> is known to divide <var class="Arg">f</var> the call <code class="code">Quotient(<var class="Arg">f</var>,<var class="Arg">g</var>)</code> (see <code class="func">Quotient</code> (<a href="chap56.html#X8350500B8576F833"><span class="RefLink">56.1-9</span></a>)) should be used instead.</p>
398
399 <p><code class="code"><var class="Arg">f</var> mod <var class="Arg">g</var></code></p>
400
401 <p>For two Laurent polynomials <var class="Arg">f</var> and <var class="Arg">g</var>, <code class="code"><var class="Arg">f</var> mod <var class="Arg">g</var></code> is the Euclidean remainder (see <code class="func">EuclideanRemainder</code> (<a href="chap56.html#X7B5E9639865E91BA"><span class="RefLink">56.6-4</span></a>)) of <var class="Arg">f</var> modulo <var class="Arg">g</var>.</p>
402
403 <p>As calculating a multivariate Gcd can be expensive, it is not guaranteed that rational functions will always be represented as a quotient of coprime polynomials. In certain unfortunate situations this might lead to a degree explosion. To ensure cancellation you can use <code class="func">Gcd</code> (<a href="chap56.html#X7DE207718456F98F"><span class="RefLink">56.7-1</span></a>) on the <code class="func">NumeratorOfRationalFunction</code> (<a href="chap66.html#X7D7D2667803D8D8A"><span class="RefLink">66.4-2</span></a>) and <code class="func">DenominatorOfRationalFunction</code> (<a href="chap66.html#X78DC1B5B866ADB6C"><span class="RefLink">66.4-3</span></a>) values of a given rational function.</p>
404
405 <p>All polynomials as well as all the univariate polynomials in the same indeterminate form subrings of this field. If two rational functions are known to be in the same subring, the result will be expressed as element in this subring.</p>
406
407 <p><a id="X824B6D328643CE04" name="X824B6D328643CE04"></a></p>
408
409 <h4>66.3 <span class="Heading">Comparison of Rational Functions</span></h4>
410
411 <p><code class="code"><var class="Arg">f</var> = <var class="Arg">g</var></code></p>
412
413 <p>Two rational functions <var class="Arg">f</var> and <var class="Arg">g</var> are equal if the product <code class="code">Numerator(<var class="Arg">f</var>) * Denominator(<var class="Arg">g</var>)</code> equals <code class="code">Numerator(<var class="Arg">g</var>) * Denominator(<var class="Arg">f</var>)</code>.</p>
414
415
416 <div class="example"><pre>
417 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Indeterminate(Rationals,"x");;y:=Indeterminate(Rationals,"y");;</span>
418 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=3+x*y+x^5;;g:=5+x^2*y+x*y^2;;</span>
419 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:=g/f;</span>
420 (x^2*y+x*y^2+5)/(x^5+x*y+3)
421 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b:=(g*f)/(f^2);</span>
422 (x^7*y+x^6*y^2+5*x^5+x^3*y^2+x^2*y^3+3*x^2*y+3*x*y^2+5*x*y+15)/(x^10+2\
423 *x^6*y+6*x^5+x^2*y^2+6*x*y+9)
424 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a=b;</span>
425 true
426 </pre></div>
427
428 <p><code class="code"><var class="Arg">f</var> &lt; <var class="Arg">g</var></code></p>
429
430 <p>The ordering of rational functions is defined in several steps. Monomials (products of indeterminates) are sorted first by degree, then lexicographically (with <span class="SimpleMath">x_1&gt;x_2</span>) (see <code class="func">MonomialGrlexOrdering</code> (<a href="chap66.html#X786C866C824D2688"><span class="RefLink">66.17-8</span></a>)). Products of monomials with ring elements (<q>terms</q>) are compared first by their monomials and then by their coefficients.</p>
431
432
433 <div class="example"><pre>
434 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x&gt;y;</span>
435 true
436 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x^2*y&lt;x*y^2;</span>
437 false
438 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x*y&lt;x^2*y;</span>
439 true
440 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x^2*y &lt; 5* y*x^2;</span>
441 true
442 </pre></div>
443
444 <p>Polynomials are compared by comparing the largest terms in turn until they differ.</p>
445
446
447 <div class="example"><pre>
448 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x+y&lt;y;</span>
449 false
450 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x&lt;x+1;</span>
451 true
452 </pre></div>
453
454 <p>Rational functions are compared by comparing the polynomial <code class="code">Numerator(<var class="Arg">f</var>) * Denominator(<var class="Arg">g</var>)</code> with the polynomial <code class="code">Numerator(<var class="Arg">g</var>) * Denominator(<var class="Arg">f</var>)</code>. (As the ordering of monomials used by <strong class="pkg">GAP</strong> is invariant under multiplication this is independent of common factors in numerator and denominator.)</p>
455
456
457 <div class="example"><pre>
458 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f/g&lt;g/f;</span>
459 false
460 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f/g&lt;(g*g)/(f*g);</span>
461 false
462 </pre></div>
463
464 <p>For univariate polynomials this reduces to an ordering first by total degree and then lexicographically on the coefficients.</p>
465
466 <p><a id="X7D871EA180E9486C" name="X7D871EA180E9486C"></a></p>
467
468 <h4>66.4 <span class="Heading">Properties and Attributes of Rational Functions</span></h4>
469
470 <p>All these tests are applicable to <em>every</em> rational function. Depending on the internal representation of the rational function, however some of these tests (in particular, univariateness) might be expensive in some cases.</p>
471
472 <p>For reasons of performance within algorithms it can be useful to use other attributes, which give a slightly more technical representation. See section <a href="chap66.html#X7E360788785DE530"><span class="RefLink">66.20</span></a> for details.</p>
473
474 <p><a id="X86C92F677DA9347F" name="X86C92F677DA9347F"></a></p>
475
476 <h5>66.4-1 IsPolynomialFunction</h5>
477
478 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPolynomialFunction</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
479 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRationalFunction</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
480 <p>A rational function is an element of the quotient field of a polynomial ring over an UFD. It is represented as a quotient of two polynomials, its numerator (see <code class="func">NumeratorOfRationalFunction</code> (<a href="chap66.html#X7D7D2667803D8D8A"><span class="RefLink">66.4-2</span></a>)) and its denominator (see <code class="func">DenominatorOfRationalFunction</code> (<a href="chap66.html#X78DC1B5B866ADB6C"><span class="RefLink">66.4-3</span></a>))</p>
481
482 <p>A polynomial function is an element of a polynomial ring (not necessarily an UFD), or a rational function.</p>
483
484 <p><strong class="pkg">GAP</strong> considers <code class="func">IsRationalFunction</code> as a subcategory of <code class="func">IsPolynomialFunction</code>.</p>
485
486 <p><a id="X7D7D2667803D8D8A" name="X7D7D2667803D8D8A"></a></p>
487
488 <h5>66.4-2 NumeratorOfRationalFunction</h5>
489
490 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NumeratorOfRationalFunction</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
491 <p>returns the numerator of the rational function <var class="Arg">ratfun</var>.</p>
492
493 <p>As no proper multivariate gcd has been implemented yet, numerators and denominators are not guaranteed to be reduced!</p>
494
495 <p><a id="X78DC1B5B866ADB6C" name="X78DC1B5B866ADB6C"></a></p>
496
497 <h5>66.4-3 DenominatorOfRationalFunction</h5>
498
499 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DenominatorOfRationalFunction</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
500 <p>returns the denominator of the rational function <var class="Arg">ratfun</var>.</p>
501
502 <p>As no proper multivariate gcd has been implemented yet, numerators and denominators are not guaranteed to be reduced!</p>
503
504
505 <div class="example"><pre>
506 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Indeterminate(Rationals,1);;y:=Indeterminate(Rationals,2);;</span>
507 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DenominatorOfRationalFunction((x*y+x^2)/y);</span>
508 y
509 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumeratorOfRationalFunction((x*y+x^2)/y);</span>
510 x^2+x*y
511 </pre></div>
512
513 <p><a id="X7974B0707C8DAB6C" name="X7974B0707C8DAB6C"></a></p>
514
515 <h5>66.4-4 IsPolynomial</h5>
516
517 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPolynomial</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
518 <p>A polynomial is a rational function whose denominator is one. (If the coefficients family forms a field this is equivalent to the denominator being constant.)</p>
519
520 <p>If the base family is not a field, it may be impossible to represent the quotient of a polynomial by a ring element as a polynomial again, but it will have to be represented as a rational function.</p>
521
522
523 <div class="example"><pre>
524 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPolynomial((x*y+x^2*y^3)/y);</span>
525 true
526 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPolynomial((x*y+x^2)/y);</span>
527 false
528 </pre></div>
529
530 <p><a id="X7914771F7C6013EF" name="X7914771F7C6013EF"></a></p>
531
532 <h5>66.4-5 AsPolynomial</h5>
533
534 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsPolynomial</code>( <var class="Arg">poly</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
535 <p>If <var class="Arg">poly</var> is a rational function that is a polynomial this attribute returns an equal rational function <span class="SimpleMath">p</span> such that <span class="SimpleMath">p</span> is equal to its numerator and the denominator of <span class="SimpleMath">p</span> is one.</p>
536
537
538 <div class="example"><pre>
539 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsPolynomial((x*y+x^2*y^3)/y);</span>
540 x^2*y^2+x
541 </pre></div>
542
543 <p><a id="X8738F73583273FCA" name="X8738F73583273FCA"></a></p>
544
545 <h5>66.4-6 IsUnivariateRationalFunction</h5>
546
547 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsUnivariateRationalFunction</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
548 <p>A rational function is univariate if its numerator and its denominator are both polynomials in the same one indeterminate. The attribute <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> (<a href="chap66.html#X816C8D797C804380"><span class="RefLink">66.1-2</span></a>) can be used to obtain the number of this common indeterminate.</p>
549
550 <p><a id="X7F1F67527A35A9CE" name="X7F1F67527A35A9CE"></a></p>
551
552 <h5>66.4-7 CoefficientsOfUnivariateRationalFunction</h5>
553
554 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CoefficientsOfUnivariateRationalFunction</code>( <var class="Arg">rfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
555 <p>if <var class="Arg">rfun</var> is a univariate rational function, this attribute returns a list <code class="code">[ <var class="Arg">ncof</var>, <var class="Arg">dcof</var>, <var class="Arg">val</var> ]</code> where <var class="Arg">ncof</var> and <var class="Arg">dcof</var> are coefficient lists of univariate polynomials <var class="Arg">n</var> and <var class="Arg">d</var> and a valuation <var class="Arg">val</var> such that <span class="SimpleMath"><var class="Arg">rfun</var> = x^<var class="Arg">val</var> ⋅ <var class="Arg">n</var> / <var class="Arg">d</var></span> where <span class="SimpleMath">x</span> is the variable with the number given by <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> (<a href="chap66.html#X816C8D797C804380"><span class="RefLink">66.1-2</span></a>). Numerator and denominator are guaranteed to be cancelled.</p>
556
557 <p><a id="X86A2546685D0016B" name="X86A2546685D0016B"></a></p>
558
559 <h5>66.4-8 IsUnivariatePolynomial</h5>
560
561 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsUnivariatePolynomial</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
562 <p>A univariate polynomial is a polynomial in only one indeterminate.</p>
563
564 <p><a id="X78C9524D7F2708C2" name="X78C9524D7F2708C2"></a></p>
565
566 <h5>66.4-9 CoefficientsOfUnivariatePolynomial</h5>
567
568 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CoefficientsOfUnivariatePolynomial</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
569 <p><code class="func">CoefficientsOfUnivariatePolynomial</code> returns the coefficient list of the polynomial <var class="Arg">pol</var>, sorted in ascending order. (It returns the empty list if <var class="Arg">pol</var> is 0.)</p>
570
571 <p><a id="X79138FF28213B6EC" name="X79138FF28213B6EC"></a></p>
572
573 <h5>66.4-10 IsLaurentPolynomial</h5>
574
575 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLaurentPolynomial</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
576 <p>A Laurent polynomial is a univariate rational function whose denominator is a monomial. Therefore every univariate polynomial is a Laurent polynomial.</p>
577
578 <p>The attribute <code class="func">CoefficientsOfLaurentPolynomial</code> (<a href="chap66.html#X86D58AB67F86469F"><span class="RefLink">66.13-2</span></a>) gives a compact representation as Laurent polynomial.</p>
579
580 <p><a id="X7F2A49208341C2A8" name="X7F2A49208341C2A8"></a></p>
581
582 <h5>66.4-11 IsConstantRationalFunction</h5>
583
584 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsConstantRationalFunction</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
585 <p>A constant rational function is a function whose numerator and denominator are polynomials of degree 0.</p>
586
587 <p><a id="X834B54947FAADEA4" name="X834B54947FAADEA4"></a></p>
588
589 <h5>66.4-12 IsPrimitivePolynomial</h5>
590
591 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPrimitivePolynomial</code>( <var class="Arg">F</var>, <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
592 <p>For a univariate polynomial <var class="Arg">pol</var> of degree <span class="SimpleMath">d</span> in the indeterminate <span class="SimpleMath">X</span>, with coefficients in a finite field <var class="Arg">F</var> with <span class="SimpleMath">q</span> elements, <code class="func">IsPrimitivePolynomial</code> returns <code class="keyw">true</code> if</p>
593
594 <ol>
595 <li><p><var class="Arg">pol</var> divides <span class="SimpleMath">X^{q^d-1} - 1</span>, and</p>
596
597 </li>
598 <li><p>for each prime divisor <span class="SimpleMath">p</span> of <span class="SimpleMath">q^d - 1</span>, <var class="Arg">pol</var> does not divide <span class="SimpleMath">X^{(q^d-1)/p} - 1</span>,</p>
599
600 </li>
601 </ol>
602 <p>and <code class="keyw">false</code> otherwise.</p>
603
604 <p><a id="X87531E03849391C1" name="X87531E03849391C1"></a></p>
605
606 <h5>66.4-13 SplittingField</h5>
607
608 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SplittingField</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
609 <p>returns the smallest field which contains the coefficients of <var class="Arg">f</var> and the roots of <var class="Arg">f</var>.</p>
610
611 <p><a id="X82E2F1707FC2E553" name="X82E2F1707FC2E553"></a></p>
612
613 <h4>66.5 <span class="Heading">Univariate Polynomials</span></h4>
614
615 <p>Some of the operations are actually defined on the larger domain of Laurent polynomials (see <a href="chap66.html#X844B3C6C87A0E7E0"><span class="RefLink">66.13</span></a>). For this section you can simply ignore the word <q>Laurent</q> if it occurs in a description.</p>
616
617 <p><a id="X8379F8CB7D0076BA" name="X8379F8CB7D0076BA"></a></p>
618
619 <h5>66.5-1 UnivariatePolynomial</h5>
620
621 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnivariatePolynomial</code>( <var class="Arg">ring</var>, <var class="Arg">cofs</var>[, <var class="Arg">ind</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
622 <p>constructs an univariate polynomial over the ring <var class="Arg">ring</var> in the indeterminate <var class="Arg">ind</var> with the coefficients given by <var class="Arg">cofs</var>.</p>
623
624 <p><a id="X85178A3E7B4F11E0" name="X85178A3E7B4F11E0"></a></p>
625
626 <h5>66.5-2 UnivariatePolynomialByCoefficients</h5>
627
628 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnivariatePolynomialByCoefficients</code>( <var class="Arg">fam</var>, <var class="Arg">cofs</var>, <var class="Arg">ind</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
629 <p>constructs an univariate polynomial over the coefficients family <var class="Arg">fam</var> and in the indeterminate <var class="Arg">ind</var> with the coefficients given by <var class="Arg">cofs</var>. This function should be used in algorithms to create polynomials as it avoids overhead associated with <code class="func">UnivariatePolynomial</code> (<a href="chap66.html#X8379F8CB7D0076BA"><span class="RefLink">66.5-1</span></a>).</p>
630
631 <p><a id="X78AF77C383245254" name="X78AF77C383245254"></a></p>
632
633 <h5>66.5-3 DegreeOfLaurentPolynomial</h5>
634
635 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DegreeOfLaurentPolynomial</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
636 <p>The degree of a univariate (Laurent) polynomial <var class="Arg">pol</var> is the largest exponent <span class="SimpleMath">n</span> of a monomial <span class="SimpleMath">x^n</span> of <var class="Arg">pol</var>. The degree of a zero polynomial is defined to be <code class="code">-infinity</code>.</p>
637
638
639 <div class="example"><pre>
640 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">p:=UnivariatePolynomial(Rationals,[1,2,3,4],1);</span>
641 4*x^3+3*x^2+2*x+1
642 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnivariatePolynomialByCoefficients(FamilyObj(1),[9,2,3,4],73);</span>
643 4*x_73^3+3*x_73^2+2*x_73+9
644 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CoefficientsOfUnivariatePolynomial(p);</span>
645 [ 1, 2, 3, 4 ]
646 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DegreeOfLaurentPolynomial(p);</span>
647 3
648 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DegreeOfLaurentPolynomial(Zero(p));</span>
649 -infinity
650 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminateNumberOfLaurentPolynomial(p);</span>
651 1
652 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminateOfLaurentPolynomial(p);</span>
653 x
654 </pre></div>
655
656 <p><a id="X7CBB760C87B04F75" name="X7CBB760C87B04F75"></a></p>
657
658 <h5>66.5-4 RootsOfPolynomial</h5>
659
660 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RootsOfPolynomial</code>( [<var class="Arg">R</var>, ]<var class="Arg">p</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
661 <p>For a univariate polynomial <var class="Arg">p</var>, this function returns all roots of <var class="Arg">p</var> over the ring <var class="Arg">R</var>. If the ring is not specified, it defaults to the ring specified by the coefficients of <var class="Arg">p</var> via <code class="func">DefaultRing</code> (<a href="chap56.html#X83AFFCC77DE6ABDA"><span class="RefLink">56.1-3</span></a>)).</p>
662
663
664 <div class="example"><pre>
665 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=X(Rationals,"x");;p:=x^4-1;</span>
666 x^4-1
667 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RootsOfPolynomial(p);</span>
668 [ 1, -1 ]
669 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RootsOfPolynomial(CF(4),p);</span>
670 [ 1, -1, E(4), -E(4) ]
671 </pre></div>
672
673 <p><a id="X80CEB10D7879767F" name="X80CEB10D7879767F"></a></p>
674
675 <h5>66.5-5 RootsOfUPol</h5>
676
677 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RootsOfUPol</code>( [<var class="Arg">field</var>, ]<var class="Arg">upol</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
678 <p>This function returns a list of all roots of the univariate polynomial <var class="Arg">upol</var> in its default domain. If the optional argument <var class="Arg">field</var> is a field then the roots in this field are computed. If <var class="Arg">field</var> is the string <code class="code">"split"</code> then the splitting field of the polynomial is taken.</p>
679
680
681 <div class="example"><pre>
682 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RootsOfUPol(50-45*x-6*x^2+x^3);</span>
683 [ 10, 1, -5 ]
684 </pre></div>
685
686 <p><a id="X7887FBC78149BB0C" name="X7887FBC78149BB0C"></a></p>
687
688 <h5>66.5-6 QuotRemLaurpols</h5>
689
690 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; QuotRemLaurpols</code>( <var class="Arg">left</var>, <var class="Arg">right</var>, <var class="Arg">mode</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
691 <p>This internal function for euclidean division of polynomials takes two polynomials <var class="Arg">left</var> and <var class="Arg">right</var> and computes their quotient. No test is performed whether the arguments indeed are polynomials. Depending on the integer variable <var class="Arg">mode</var>, which may take values in a range from 1 to 4, it returns respectively:</p>
692
693 <ol>
694 <li><p>the quotient (there might be some remainder),</p>
695
696 </li>
697 <li><p>the remainder,</p>
698
699 </li>
700 <li><p>a list <code class="code">[<var class="Arg">q</var>,<var class="Arg">r</var>]</code> of quotient and remainder,</p>
701
702 </li>
703 <li><p>the quotient if there is no remainder and <code class="keyw">fail</code> otherwise.</p>
704
705 </li>
706 </ol>
707 <p><a id="X7DDADF157879EFBF" name="X7DDADF157879EFBF"></a></p>
708
709 <h5>66.5-7 UnivariatenessTestRationalFunction</h5>
710
711 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnivariatenessTestRationalFunction</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
712 <p>takes a rational function <var class="Arg">f</var> and tests whether it is univariate rational function (or even a Laurent polynomial). It returns a list <code class="code">[isunivariate, indet, islaurent, cofs]</code>.</p>
713
714 <p>If <var class="Arg">f</var> is a univariate rational function then <code class="code">isunivariate</code> is <code class="keyw">true</code> and <code class="code">indet</code> is the number of the appropriate indeterminate.</p>
715
716 <p>Furthermore, if <var class="Arg">f</var> is a Laurent polynomial, then <code class="code">islaurent</code> is also <code class="keyw">true</code>. In this case the fourth entry, <code class="code">cofs</code>, is the value of the attribute <code class="func">CoefficientsOfLaurentPolynomial</code> (<a href="chap66.html#X86D58AB67F86469F"><span class="RefLink">66.13-2</span></a>) for <var class="Arg">f</var>.</p>
717
718 <p>If <code class="code">isunivariate</code> is <code class="keyw">true</code> but <code class="code">islaurent</code> is <code class="keyw">false</code>, then <code class="code">cofs</code> is the value of the attribute <code class="func">CoefficientsOfUnivariateRationalFunction</code> (<a href="chap66.html#X7F1F67527A35A9CE"><span class="RefLink">66.4-7</span></a>) for <var class="Arg">f</var>.</p>
719
720 <p>Otherwise, each entry of the returned list is equal to <code class="keyw">fail</code>. As there is no proper multivariate gcd, this may also happen for the rational function which may be reduced to univariate (see example).</p>
721
722
723 <div class="example"><pre>
724 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnivariatenessTestRationalFunction( 50-45*x-6*x^2+x^3 );</span>
725 [ true, 1, true, [ [ 50, -45, -6, 1 ], 0 ] ]
726 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnivariatenessTestRationalFunction( (-6*y^2+y^3) / (y+1) );</span>
727 [ true, 2, false, [ [ -6, 1 ], [ 1, 1 ], 2 ] ]
728 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnivariatenessTestRationalFunction( (-6*y^2+y^3) / (x+1));</span>
729 [ false, fail, false, fail ]
730 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnivariatenessTestRationalFunction( ((y+2)*(x+1)) / ((y-1)*(x+1)) );</span>
731 [ fail, fail, fail, fail ]
732 </pre></div>
733
734 <p><a id="X7A3BC96B7A50DE98" name="X7A3BC96B7A50DE98"></a></p>
735
736 <h5>66.5-8 InfoPoly</h5>
737
738 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; InfoPoly</code></td><td class="tdright">(&nbsp;info class&nbsp;)</td></tr></table></div>
739 <p>is the info class for univariate polynomials.</p>
740
741 <p>We remark that some functions for multivariate polynomials (which will be defined in the following sections) permit a different syntax for univariate polynomials which drops the requirement to specify the indeterminate. Examples are <code class="func">Value</code> (<a href="chap66.html#X7A70769C7F52CD2D"><span class="RefLink">66.7-1</span></a>), <code class="func">Discriminant</code> (<a href="chap66.html#X7C7D790A7D6E11AD"><span class="RefLink">66.6-6</span></a>), <code class="func">Derivative</code> (<a href="chap66.html#X7B57CEE2780D0E0B"><span class="RefLink">66.6-5</span></a>), <code class="func">LeadingCoefficient</code> (<a href="chap66.html#X80710E9B7D8340BD"><span class="RefLink">66.6-3</span></a>) and <code class="func">LeadingMonomial</code> (<a href="chap66.html#X7B3EAE41795598A5"><span class="RefLink">66.6-4</span></a>):</p>
742
743
744 <div class="example"><pre>
745 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">p:=UnivariatePolynomial(Rationals,[1,2,3,4],1);</span>
746 4*x^3+3*x^2+2*x+1
747 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Value(p,Z(5));</span>
748 Z(5)^2
749 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingCoefficient(p);</span>
750 4
751 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Derivative(p);</span>
752 12*x^2+6*x+2
753 </pre></div>
754
755 <p><a id="X81499B5A823E6EA3" name="X81499B5A823E6EA3"></a></p>
756
757 <h4>66.6 <span class="Heading">Polynomials as Univariate Polynomials in one Indeterminate</span></h4>
758
759 <p><a id="X826B99B17ABD11BE" name="X826B99B17ABD11BE"></a></p>
760
761 <h5>66.6-1 DegreeIndeterminate</h5>
762
763 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DegreeIndeterminate</code>( <var class="Arg">pol</var>, <var class="Arg">ind</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
764 <p>returns the degree of the polynomial <var class="Arg">pol</var> in the indeterminate (or indeterminate number) <var class="Arg">ind</var>.</p>
765
766
767 <div class="example"><pre>
768 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=x^5+3*x*y+9*y^7+4*y^5*x+3*y+2;</span>
769 9*y^7+4*x*y^5+x^5+3*x*y+3*y+2
770 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DegreeIndeterminate(f,1);</span>
771 5
772 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DegreeIndeterminate(f,y);</span>
773 7
774 </pre></div>
775
776 <p><a id="X85646FD07F9C60F5" name="X85646FD07F9C60F5"></a></p>
777
778 <h5>66.6-2 PolynomialCoefficientsOfPolynomial</h5>
779
780 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialCoefficientsOfPolynomial</code>( <var class="Arg">pol</var>, <var class="Arg">ind</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
781 <p><code class="func">PolynomialCoefficientsOfPolynomial</code> returns the coefficient list (whose entries are polynomials not involving the indeterminate <var class="Arg">ind</var>) describing the polynomial <var class="Arg">pol</var> viewed as a polynomial in <var class="Arg">ind</var>. Instead of the indeterminate, <var class="Arg">ind</var> can also be an indeterminate number.</p>
782
783
784 <div class="example"><pre>
785 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PolynomialCoefficientsOfPolynomial(f,2);</span>
786 [ x^5+2, 3*x+3, 0, 0, 0, 4*x, 0, 9 ]
787 </pre></div>
788
789 <p><a id="X80710E9B7D8340BD" name="X80710E9B7D8340BD"></a></p>
790
791 <h5>66.6-3 LeadingCoefficient</h5>
792
793 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeadingCoefficient</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
794 <p>returns the leading coefficient (that is the coefficient of the leading monomial, see <code class="func">LeadingMonomial</code> (<a href="chap66.html#X7B3EAE41795598A5"><span class="RefLink">66.6-4</span></a>)) of the polynomial <var class="Arg">pol</var>.</p>
795
796 <p><a id="X7B3EAE41795598A5" name="X7B3EAE41795598A5"></a></p>
797
798 <h5>66.6-4 LeadingMonomial</h5>
799
800 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeadingMonomial</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
801 <p>returns the leading monomial (with respect to the ordering given by <code class="func">MonomialExtGrlexLess</code> (<a href="chap66.html#X7A30E10B820311D1"><span class="RefLink">66.17-14</span></a>)) of the polynomial <var class="Arg">pol</var> as a list containing indeterminate numbers and exponents.</p>
802
803
804 <div class="example"><pre>
805 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingCoefficient(f,1);</span>
806 1
807 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingCoefficient(f,2);</span>
808 9
809 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingMonomial(f);</span>
810 [ 2, 7 ]
811 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingCoefficient(f);</span>
812 9
813 </pre></div>
814
815 <p><a id="X7B57CEE2780D0E0B" name="X7B57CEE2780D0E0B"></a></p>
816
817 <h5>66.6-5 Derivative</h5>
818
819 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Derivative</code>( <var class="Arg">ratfun</var>[, <var class="Arg">ind</var>] )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
820 <p>If <var class="Arg">ratfun</var> is a univariate rational function then <code class="func">Derivative</code> returns the <em>derivative</em> of <var class="Arg">ufun</var> by its indeterminate. For a rational function <var class="Arg">ratfun</var>, the derivative by the indeterminate <var class="Arg">ind</var> is returned, regarding <var class="Arg">ratfun</var> as univariate in <var class="Arg">ind</var>. Instead of the desired indeterminate, also the number of this indeterminate can be given as <var class="Arg">ind</var>.</p>
821
822
823 <div class="example"><pre>
824 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Derivative(f,2);</span>
825 63*y^6+20*x*y^4+3*x+3
826 </pre></div>
827
828 <p><a id="X7C7D790A7D6E11AD" name="X7C7D790A7D6E11AD"></a></p>
829
830 <h5>66.6-6 Discriminant</h5>
831
832 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Discriminant</code>( <var class="Arg">pol</var>[, <var class="Arg">ind</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
833 <p>If <var class="Arg">pol</var> is a univariate polynomial then <code class="func">Discriminant</code> returns the <em>discriminant</em> of <var class="Arg">pol</var> by its indeterminate. The two-argument form returns the discriminant of a polynomial <var class="Arg">pol</var> by the indeterminate number <var class="Arg">ind</var>, regarding <var class="Arg">pol</var> as univariate in this indeterminate. Instead of the indeterminate number, the indeterminate itself can also be given as <var class="Arg">ind</var>.</p>
834
835
836 <div class="example"><pre>
837 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Discriminant(f,1);</span>
838 20503125*y^28+262144*y^25+27337500*y^22+19208040*y^21+1474560*y^17+136\
839 68750*y^16+18225000*y^15+6075000*y^14+1105920*y^13+3037500*y^10+648972\
840 0*y^9+4050000*y^8+900000*y^7+62208*y^5+253125*y^4+675000*y^3+675000*y^\
841 2+300000*y+50000
842 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Discriminant(f,1) = Discriminant(f,x);</span>
843 true
844 </pre></div>
845
846 <p><a id="X857AD5587EF49029" name="X857AD5587EF49029"></a></p>
847
848 <h5>66.6-7 Resultant</h5>
849
850 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Resultant</code>( <var class="Arg">pol1</var>, <var class="Arg">pol2</var>, <var class="Arg">ind</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
851 <p>computes the resultant of the polynomials <var class="Arg">pol1</var> and <var class="Arg">pol2</var> with respect to the indeterminate <var class="Arg">ind</var>, or indeterminate number <var class="Arg">ind</var>. The resultant considers <var class="Arg">pol1</var> and <var class="Arg">pol2</var> as univariate in <var class="Arg">ind</var> and returns an element of the corresponding base ring (which might be a polynomial ring).</p>
852
853
854 <div class="example"><pre>
855 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Resultant(x^4+y,y^4+x,1);</span>
856 y^16+y
857 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Resultant(x^4+y,y^4+x,2);</span>
858 x^16+x
859 </pre></div>
860
861 <p><a id="X85ABC4687DF05777" name="X85ABC4687DF05777"></a></p>
862
863 <h4>66.7 <span class="Heading">Multivariate Polynomials</span></h4>
864
865 <p><a id="X7A70769C7F52CD2D" name="X7A70769C7F52CD2D"></a></p>
866
867 <h5>66.7-1 <span class="Heading">Value</span></h5>
868
869 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Value</code>( <var class="Arg">ratfun</var>, <var class="Arg">indets</var>, <var class="Arg">vals</var>[, <var class="Arg">one</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
870 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Value</code>( <var class="Arg">upol</var>, <var class="Arg">value</var>[, <var class="Arg">one</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
871 <p>The first variant takes a rational function <var class="Arg">ratfun</var> and specializes the indeterminates given in <var class="Arg">indets</var> to the values given in <var class="Arg">vals</var>, replacing the <span class="SimpleMath">i</span>-th entry in <var class="Arg">indets</var> by the <span class="SimpleMath">i</span>-th entry in <var class="Arg">vals</var>. If this specialization results in a constant polynomial, an element of the coefficient ring is returned. If the specialization would specialize the denominator of <var class="Arg">ratfun</var> to zero, an error is raised.</p>
872
873 <p>A variation is the evaluation at elements of another ring <span class="SimpleMath">R</span>, for which a multiplication with elements of the coefficient ring of <var class="Arg">ratfun</var> are defined. In this situation the identity element of <span class="SimpleMath">R</span> may be given by a further argument <var class="Arg">one</var> which will be used for <span class="SimpleMath">x^0</span> for any specialized indeterminate <span class="SimpleMath">x</span>.</p>
874
875 <p>The second version takes an univariate rational function and specializes the value of its indeterminate to <var class="Arg">val</var>. Again, an optional argument <var class="Arg">one</var> may be given. <code class="code">Value( <var class="Arg">upol</var>, <var class="Arg">val</var> )</code> can also be expressed as <code class="code">upol( <var class="Arg">val</var> )</code>.</p>
876
877
878 <div class="example"><pre>
879 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Value(x*y+y+x^7,[x,y],[5,7]);</span>
880 78167
881 </pre></div>
882
883 <p>Note that the default values for <var class="Arg">one</var> can lead to different results than one would expect: For example for a matrix <span class="SimpleMath">M</span>, the values <span class="SimpleMath">M+M^0</span> and <span class="SimpleMath">M+1</span> are <em>different</em>. As <code class="func">Value</code> defaults to the one of the coefficient ring, when evaluating matrices in polynomials always the correct <var class="Arg">one</var> should be given!</p>
884
885 <p><a id="X7ED3E7D17C7AC732" name="X7ED3E7D17C7AC732"></a></p>
886
887 <h4>66.8 <span class="Heading">Minimal Polynomials</span></h4>
888
889 <p><a id="X8643915A8424DAF8" name="X8643915A8424DAF8"></a></p>
890
891 <h5>66.8-1 MinimalPolynomial</h5>
892
893 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MinimalPolynomial</code>( <var class="Arg">R</var>, <var class="Arg">elm</var>[, <var class="Arg">ind</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
894 <p>returns the <em>minimal polynomial</em> of <var class="Arg">elm</var> over the ring <var class="Arg">R</var>, expressed in the indeterminate number <var class="Arg">ind</var>. If <var class="Arg">ind</var> is not given, it defaults to 1.</p>
895
896 <p>The minimal polynomial is the monic polynomial of smallest degree with coefficients in <var class="Arg">R</var> that has value zero at <var class="Arg">elm</var>.</p>
897
898
899 <div class="example"><pre>
900 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MinimalPolynomial(Rationals,[[2,0],[0,2]]);</span>
901 x-2
902 </pre></div>
903
904 <p><a id="X837B8E55832CDFEB" name="X837B8E55832CDFEB"></a></p>
905
906 <h4>66.9 <span class="Heading">Cyclotomic Polynomials</span></h4>
907
908 <p><a id="X827FC7FE81EE4C02" name="X827FC7FE81EE4C02"></a></p>
909
910 <h5>66.9-1 CyclotomicPolynomial</h5>
911
912 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CyclotomicPolynomial</code>( <var class="Arg">F</var>, <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
913 <p>is the <var class="Arg">n</var>-th cyclotomic polynomial over the ring <var class="Arg">F</var>.</p>
914
915
916 <div class="example"><pre>
917 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CyclotomicPolynomial(Rationals,5);</span>
918 x^4+x^3+x^2+x+1
919 </pre></div>
920
921 <p><a id="X8551EF5187509D69" name="X8551EF5187509D69"></a></p>
922
923 <h4>66.10 <span class="Heading">Polynomial Factorization</span></h4>
924
925 <p>At the moment <strong class="pkg">GAP</strong> provides only methods to factorize polynomials over finite fields (see Chapter <a href="chap59.html#X7893ABF67A028802"><span class="RefLink">59</span></a>), over subfields of cyclotomic fields (see Chapter <a href="chap60.html#X80510B5880521FDC"><span class="RefLink">60</span></a>), and over algebraic extensions of these (see Chapter <a href="chap67.html#X85732CEF7ECFCA68"><span class="RefLink">67</span></a>).</p>
926
927 <p><a id="X83511D517B544F36" name="X83511D517B544F36"></a></p>
928
929 <h5>66.10-1 Factors</h5>
930
931 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Factors</code>( [<var class="Arg">R</var>, ]<var class="Arg">poly</var>[, <var class="Arg">opt</var>] )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
932 <p>returns a list of the irreducible factors of the polynomial <var class="Arg">poly</var> in the polynomial ring <var class="Arg">R</var>. (That is factors over the <code class="func">CoefficientsRing</code> (<a href="chap66.html#X8235D10781BE8003"><span class="RefLink">66.15-3</span></a>) value of <var class="Arg">R</var>.)</p>
933
934 <p>For univariate factorizations, it is possible to pass a record <var class="Arg">opt</var> as a third argument. This record can contain the following components:</p>
935
936
937 <dl>
938 <dt><strong class="Mark"><code class="code">onlydegs</code></strong></dt>
939 <dd><p>is a set of positive integers. The factorization assumes that all irreducible factors have a degree in this set.</p>
940
941 </dd>
942 <dt><strong class="Mark"><code class="code">stopdegs</code></strong></dt>
943 <dd><p>is a set of positive integers. The factorization will stop once a factor of degree in <code class="code">stopdegs</code> has been found and will return the factorization found so far.</p>
944
945 </dd>
946 </dl>
947
948 <div class="example"><pre>
949 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= CyclotomicPolynomial( GF(2), 7 );</span>
950 x_1^6+x_1^5+x_1^4+x_1^3+x_1^2+x_1+Z(2)^0
951 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Factors( f );</span>
952 [ x_1^3+x_1+Z(2)^0, x_1^3+x_1^2+Z(2)^0 ]
953 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Factors( PolynomialRing( GF(8) ), f );</span>
954 [ x_1+Z(2^3), x_1+Z(2^3)^2, x_1+Z(2^3)^3, x_1+Z(2^3)^4, x_1+Z(2^3)^5,
955 x_1+Z(2^3)^6 ]
956 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= MinimalPolynomial( Rationals, E(4) );</span>
957 x^2+1
958 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Factors( f );</span>
959 [ x^2+1 ]
960 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Factors( PolynomialRing( Rationals ), f );</span>
961 [ x^2+1 ]
962 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Factors( PolynomialRing( CF(4) ), f );</span>
963 [ x+(-E(4)), x+E(4) ]
964 </pre></div>
965
966 <p><a id="X7F5A4ACB7AF9E329" name="X7F5A4ACB7AF9E329"></a></p>
967
968 <h5>66.10-2 FactorsSquarefree</h5>
969
970 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FactorsSquarefree</code>( <var class="Arg">pring</var>, <var class="Arg">upol</var>, <var class="Arg">opt</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
971 <p>returns a factorization of the squarefree, monic, univariate polynomial <var class="Arg">upol</var> in the polynomial ring <var class="Arg">pring</var>; <var class="Arg">opt</var> must be a (possibly empty) record of options. <var class="Arg">upol</var> must not have zero as a root. This function is used by the factoring algorithms.</p>
972
973 <p>The current method for multivariate factorization reduces to univariate factorization by use of a reduction homomorphism of the form <span class="SimpleMath">f(x_1,x_2,x_3) ↦ f(x,x^p,x^{p^2})</span>. It can be very time intensive for larger degrees.</p>
974
975
976 <div class="example"><pre>
977 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Factors(x^10-y^10);</span>
978 [ x-y, x+y, x^4-x^3*y+x^2*y^2-x*y^3+y^4, x^4+x^3*y+x^2*y^2+x*y^3+y^4 ]
979 </pre></div>
980
981 <p><a id="X7F45E9E47EA2C18B" name="X7F45E9E47EA2C18B"></a></p>
982
983 <h4>66.11 <span class="Heading">Polynomials over the Rationals</span></h4>
984
985 <p>The following functions are only available to polynomials with rational coefficients:</p>
986
987 <p><a id="X7E66494B7B05A055" name="X7E66494B7B05A055"></a></p>
988
989 <h5>66.11-1 PrimitivePolynomial</h5>
990
991 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PrimitivePolynomial</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
992 <p>takes a polynomial <var class="Arg">f</var> with rational coefficients and computes a new polynomial with integral coefficients, obtained by multiplying with the Lcm of the denominators of the coefficients and casting out the content (the Gcd of the coefficients). The operation returns a list [<var class="Arg">newpol</var>,<var class="Arg">coeff</var>] with rational <var class="Arg">coeff</var> such that <code class="code"><var class="Arg">coeff</var>*<var class="Arg">newpol</var>=<var class="Arg">f</var></code>.</p>
993
994 <p><a id="X7A73A3877EB73566" name="X7A73A3877EB73566"></a></p>
995
996 <h5>66.11-2 PolynomialModP</h5>
997
998 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialModP</code>( <var class="Arg">pol</var>, <var class="Arg">p</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
999 <p>for a rational polynomial <var class="Arg">pol</var> this function returns a polynomial over the field with <var class="Arg">p</var> elements, obtained by reducing the coefficients modulo <var class="Arg">p</var>.</p>
1000
1001 <p><a id="X7AB9A6257ED694EC" name="X7AB9A6257ED694EC"></a></p>
1002
1003 <h5>66.11-3 GaloisType</h5>
1004
1005 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GaloisType</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1006 <p>Let <var class="Arg">f</var> be an irreducible polynomial with rational coefficients. This function returns the type of Gal(<var class="Arg">f</var>) (considered as a transitive permutation group of the roots of <var class="Arg">f</var>). It returns a number <var class="Arg">i</var> if Gal(<var class="Arg">f</var>) is permutation isomorphic to <code class="code">TransitiveGroup(<var class="Arg">n</var>,<var class="Arg">i</var>)</code> where <var class="Arg">n</var> is the degree of <var class="Arg">f</var>.</p>
1007
1008 <p>Identification is performed by factoring appropriate Galois resolvents as proposed in <a href="chapBib.html#biBMS85">[SM85]</a>. This function is provided for rational polynomials of degree up to 15. However, in some cases the required calculations become unfeasibly large.</p>
1009
1010 <p>For a few polynomials of degree 14, a complete discrimination is not yet possible, as it would require computations, that are not feasible with current factoring methods.</p>
1011
1012 <p>This function requires the transitive groups library to be installed (see <a href="../../pkg/transgrp/htm/CHAP001.htm#SECT001"><span class="RefLink">transgrp: Transitive Permutation Groups</span></a>).</p>
1013
1014 <p><a id="X7EB610D37D156DC6" name="X7EB610D37D156DC6"></a></p>
1015
1016 <h5>66.11-4 ProbabilityShapes</h5>
1017
1018 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ProbabilityShapes</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1019 <p>Let <var class="Arg">f</var> be an irreducible polynomial with rational coefficients. This function returns a list of the most likely type(s) of Gal(<var class="Arg">f</var>) (see <code class="func">GaloisType</code> (<a href="chap66.html#X7AB9A6257ED694EC"><span class="RefLink">66.11-3</span></a>)), based on factorization modulo a set of primes. It is very fast, but the result is only probabilistic.</p>
1020
1021 <p>This function requires the transitive groups library to be installed (see <a href="../../pkg/transgrp/htm/CHAP001.htm#SECT001"><span class="RefLink">transgrp: Transitive Permutation Groups</span></a>).</p>
1022
1023
1024 <div class="example"><pre>
1025 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=x^9-9*x^7+27*x^5-39*x^3+36*x-8;;</span>
1026 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GaloisType(f);</span>
1027 25
1028 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">TransitiveGroup(9,25);</span>
1029 [1/2.S(3)^3]3
1030 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ProbabilityShapes(f);</span>
1031 [ 25 ]
1032 </pre></div>
1033
1034 <p><a id="X7C178AB9866FDDE5" name="X7C178AB9866FDDE5"></a></p>
1035
1036 <h4>66.12 <span class="Heading">Factorization of Polynomials over the Rationals</span></h4>
1037
1038 <p>The following operations are used by <strong class="pkg">GAP</strong> inside the factorization algorithm but might be of interest also in other contexts.</p>
1039
1040 <p><a id="X8723075C81D2CCA6" name="X8723075C81D2CCA6"></a></p>
1041
1042 <h5>66.12-1 BombieriNorm</h5>
1043
1044 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; BombieriNorm</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1045 <p>computes weighted Norm [<var class="Arg">pol</var>]<span class="SimpleMath">_2</span> of <var class="Arg">pol</var> which is a good measure for factor coefficients (see <a href="chapBib.html#biBBTW93">[BTW93]</a>).</p>
1046
1047 <p><a id="X856D769D878AF7AE" name="X856D769D878AF7AE"></a></p>
1048
1049 <h5>66.12-2 MinimizedBombieriNorm</h5>
1050
1051 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MinimizedBombieriNorm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1052 <p>This function applies linear Tschirnhaus transformations (<span class="SimpleMath">x ↦ x + i</span>) to the polynomial <var class="Arg">f</var>, trying to get the Bombieri norm of <var class="Arg">f</var> small. It returns a list <code class="code">[<var class="Arg">new_polynomial</var>, <var class="Arg">i_of_transformation</var>]</code>.</p>
1053
1054 <p><a id="X8139BB0F87399F2C" name="X8139BB0F87399F2C"></a></p>
1055
1056 <h5>66.12-3 HenselBound</h5>
1057
1058 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; HenselBound</code>( <var class="Arg">pol</var>[, <var class="Arg">minpol</var>, <var class="Arg">den</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1059 <p>returns the Hensel bound of the polynomial <var class="Arg">pol</var>. If the computation takes place over an algebraic extension, then the minimal polynomial <var class="Arg">minpol</var> and denominator <var class="Arg">den</var> must be given.</p>
1060
1061 <p><a id="X79CC9C8D7C9F6B6A" name="X79CC9C8D7C9F6B6A"></a></p>
1062
1063 <h5>66.12-4 OneFactorBound</h5>
1064
1065 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; OneFactorBound</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1066 <p>returns the coefficient bound for a single factor of the rational polynomial <var class="Arg">pol</var>.</p>
1067
1068 <p><a id="X844B3C6C87A0E7E0" name="X844B3C6C87A0E7E0"></a></p>
1069
1070 <h4>66.13 <span class="Heading">Laurent Polynomials</span></h4>
1071
1072 <p>A univariate polynomial can be written in the form <span class="SimpleMath">r_0 + r_1 x + ⋯ + r_n x^n</span>, with <span class="SimpleMath">r_i ∈ R</span>. Formally, there is no reason to start with 0, if <span class="SimpleMath">m</span> is an integer, we can consider objects of the form <span class="SimpleMath">r_m x^m + r_{m+1} x^{m+1} + ⋯ + r_n x^n</span>. We call these <em>Laurent polynomials</em>. Laurent polynomials also can be considered as quotients of a univariate polynomial by a power of the indeterminate. The addition and multiplication of univariate polynomials extends to Laurent polynomials (though it might be impossible to interpret a Laurent polynomial as a function) and many functions for univariate polynomials extend to Laurent polynomials (or extended versions for Laurent polynomials exist).</p>
1073
1074 <p><a id="X8467263B7EFA013E" name="X8467263B7EFA013E"></a></p>
1075
1076 <h5>66.13-1 LaurentPolynomialByCoefficients</h5>
1077
1078 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LaurentPolynomialByCoefficients</code>( <var class="Arg">fam</var>, <var class="Arg">cofs</var>, <var class="Arg">val</var>[, <var class="Arg">ind</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1079 <p>constructs a Laurent polynomial over the coefficients family <var class="Arg">fam</var> and in the indeterminate <var class="Arg">ind</var> (defaulting to 1) with the coefficients given by <var class="Arg">cofs</var> and valuation <var class="Arg">val</var>.</p>
1080
1081 <p><a id="X86D58AB67F86469F" name="X86D58AB67F86469F"></a></p>
1082
1083 <h5>66.13-2 CoefficientsOfLaurentPolynomial</h5>
1084
1085 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CoefficientsOfLaurentPolynomial</code>( <var class="Arg">laurent</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1086 <p>For a Laurent polynomial <var class="Arg">laurent</var>, this function returns a pair <code class="code">[<var class="Arg">cof</var>, <var class="Arg">val</var>]</code>, consisting of the coefficient list (in ascending order) <var class="Arg">cof</var> and the valuation <var class="Arg">val</var> of <var class="Arg">laurent</var>.</p>
1087
1088
1089 <div class="example"><pre>
1090 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">p:=LaurentPolynomialByCoefficients(FamilyObj(1),</span>
1091 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[1,2,3,4,5],-2);</span>
1092 5*x^2+4*x+3+2*x^-1+x^-2
1093 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumeratorOfRationalFunction(p);DenominatorOfRationalFunction(p);</span>
1094 5*x^4+4*x^3+3*x^2+2*x+1
1095 x^2
1096 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CoefficientsOfLaurentPolynomial(p*p);</span>
1097 [ [ 1, 4, 10, 20, 35, 44, 46, 40, 25 ], -4 ]
1098 </pre></div>
1099
1100 <p><a id="X8381E1B582F38C85" name="X8381E1B582F38C85"></a></p>
1101
1102 <h5>66.13-3 IndeterminateNumberOfLaurentPolynomial</h5>
1103
1104 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndeterminateNumberOfLaurentPolynomial</code>( <var class="Arg">pol</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1105 <p>Is a synonym for <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> (<a href="chap66.html#X816C8D797C804380"><span class="RefLink">66.1-2</span></a>).</p>
1106
1107 <p><a id="X7C1708D27F97B05F" name="X7C1708D27F97B05F"></a></p>
1108
1109 <h4>66.14 <span class="Heading">Univariate Rational Functions</span></h4>
1110
1111 <p><a id="X83DD411179888783" name="X83DD411179888783"></a></p>
1112
1113 <h5>66.14-1 UnivariateRationalFunctionByCoefficients</h5>
1114
1115 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnivariateRationalFunctionByCoefficients</code>( <var class="Arg">fam</var>, <var class="Arg">ncof</var>, <var class="Arg">dcof</var>, <var class="Arg">val</var>[, <var class="Arg">ind</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1116 <p>constructs a univariate rational function over the coefficients family <var class="Arg">fam</var> and in the indeterminate <var class="Arg">ind</var> (defaulting to 1) with numerator and denominator coefficients given by <var class="Arg">ncof</var> and <var class="Arg">dcof</var> and valuation <var class="Arg">val</var>.</p>
1117
1118 <p><a id="X7B1EE4E07A9631C6" name="X7B1EE4E07A9631C6"></a></p>
1119
1120 <h5>66.14-2 TaylorSeriesRationalFunction</h5>
1121
1122 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TaylorSeriesRationalFunction</code>( <var class="Arg">ratfun</var>, <var class="Arg">at</var>, <var class="Arg">deg</var>] )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1123 <p>Computes the taylor series up to degree <var class="Arg">deg</var> of <var class="Arg">ratfun</var> at <var class="Arg">at</var>.</p>
1124
1125
1126 <div class="example"><pre>
1127 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">TaylorSeriesRationalFunction((x^5+3*x+7)/(x^5+x+1),0,11);</span>
1128 -50*x^11+36*x^10-26*x^9+22*x^8-18*x^7+14*x^6-10*x^5+4*x^4-4*x^3+4*x^2-4*x+7
1129 </pre></div>
1130
1131 <p><a id="X7C59471783C3FEDC" name="X7C59471783C3FEDC"></a></p>
1132
1133 <h4>66.15 <span class="Heading">Polynomial Rings and Function Fields</span></h4>
1134
1135 <p>While polynomials depend only on the family of the coefficients, polynomial rings <span class="SimpleMath">A</span> are defined over a base ring <span class="SimpleMath">R</span>. A polynomial is an element of <span class="SimpleMath">A</span> if and only if all its coefficients are contained in <span class="SimpleMath">R</span>. Besides providing domains and an easy way to create polynomials, polynomial rings can affect the behavior of operations like factorization into irreducibles.</p>
1136
1137 <p>If you need to work with a polynomial ring and its indeterminates the following two approaches will produce a ring that contains given variables (see section <a href="chap66.html#X7A8FADCD875826DA"><span class="RefLink">66.1</span></a> for details about the internal numbering): Either, first create the ring and then get the indeterminates with <code class="func">IndeterminatesOfPolynomialRing</code> (<a href="chap66.html#X80D585E1793D4552"><span class="RefLink">66.15-2</span></a>).</p>
1138
1139
1140 <div class="example"><pre>
1141 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r := PolynomialRing(Rationals,["a","b"]);;</span>
1142 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">indets := IndeterminatesOfPolynomialRing(r);;</span>
1143 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a := indets[1]; a := indets[2];</span>
1144 a
1145 b
1146 </pre></div>
1147
1148 <p>Alternatively, first create the indeterminates and then create the ring including these indeterminates.</p>
1149
1150
1151 <div class="example"><pre>
1152 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:=Indeterminate(Rationals,"a":old);;</span>
1153 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b:=Indeterminate(Rationals,"b":old);;</span>
1154 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PolynomialRing(Rationals,[a,b]);;</span>
1155 </pre></div>
1156
1157 <p>As a convenient shortcut, intended mainly for interactive working, the <span class="SimpleMath">i</span>-th indeterminate of a polynomial ring <span class="SimpleMath">R</span> can be accessed as <span class="SimpleMath">R.i</span>, which corresponds exactly to <code class="code">IndeterminatesOfPolynomialRing</code><span class="SimpleMath">( R )[i]</span> or, if it has the name <code class="code">nam</code>, as <span class="SimpleMath">R</span><code class="code">.nam</code>. <em>Note</em> that the number <span class="SimpleMath">i</span> is in general <em>not</em> the indeterminate number, but simply an index into the indeterminates list of <span class="SimpleMath">R</span>.</p>
1158
1159
1160 <div class="example"><pre>
1161 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r := PolynomialRing(Rationals, ["a", "b"]:old );;</span>
1162 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r.1; r.2; r.a; r.b;</span>
1163 a
1164 b
1165 a
1166 b
1167 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminateNumberOfLaurentPolynomial(r.1);</span>
1168 3
1169 </pre></div>
1170
1171 <p>Polynomials as <strong class="pkg">GAP</strong> objects can exist without a polynomial ring being defined and polynomials cannot be associated to a particular polynomial ring. (For example dividing a polynomial which is in a polynomial ring over the integers by another integer will result in a polynomial over the rationals, not in a rational function over the integers.)</p>
1172
1173 <p><a id="X7D2F16E480060330" name="X7D2F16E480060330"></a></p>
1174
1175 <h5>66.15-1 <span class="Heading">PolynomialRing</span></h5>
1176
1177 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialRing</code>( <var class="Arg">R</var>, <var class="Arg">rank</var>[, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1178 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialRing</code>( <var class="Arg">R</var>, <var class="Arg">names</var>[, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1179 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialRing</code>( <var class="Arg">R</var>, <var class="Arg">indets</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1180 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialRing</code>( <var class="Arg">R</var>, <var class="Arg">indetnums</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1181 <p>creates a polynomial ring over the ring <var class="Arg">R</var>. If a positive integer <var class="Arg">rank</var> is given, this creates the polynomial ring in <var class="Arg">rank</var> indeterminates. These indeterminates will have the internal index numbers 1 to <var class="Arg">rank</var>. The second usage takes a list <var class="Arg">names</var> of strings and returns a polynomial ring in indeterminates labelled by <var class="Arg">names</var>. These indeterminates have <q>new</q> internal index numbers as if they had been created by calls to <code class="func">Indeterminate</code> (<a href="chap66.html#X79D0380D7FA39F7D"><span class="RefLink">66.1-1</span></a>). (If the argument <var class="Arg">avoid</var> is given it contains indeterminates that should be avoided, in this case internal index numbers are incremented to skip these variables.) In the third version, a list of indeterminates <var class="Arg">indets</var> is given. This creates the polynomial ring in the indeterminates <var class="Arg">indets</var>. Finally, the fourth version specifies indeterminates by their index numbers.</p>
1182
1183 <p>To get the indeterminates of a polynomial ring use <code class="func">IndeterminatesOfPolynomialRing</code> (<a href="chap66.html#X80D585E1793D4552"><span class="RefLink">66.15-2</span></a>). (Indeterminates created independently with <code class="func">Indeterminate</code> (<a href="chap66.html#X79D0380D7FA39F7D"><span class="RefLink">66.1-1</span></a>) will usually differ, though they might be given the same name and display identically, see Section <a href="chap66.html#X7A8FADCD875826DA"><span class="RefLink">66.1</span></a>.)</p>
1184
1185 <p><a id="X80D585E1793D4552" name="X80D585E1793D4552"></a></p>
1186
1187 <h5>66.15-2 IndeterminatesOfPolynomialRing</h5>
1188
1189 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndeterminatesOfPolynomialRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1190 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndeterminatesOfFunctionField</code>( <var class="Arg">ffield</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1191 <p>returns a list of the indeterminates of the polynomial ring <var class="Arg">pring</var>, respectively the function field <var class="Arg">ffield</var>.</p>
1192
1193 <p><a id="X8235D10781BE8003" name="X8235D10781BE8003"></a></p>
1194
1195 <h5>66.15-3 CoefficientsRing</h5>
1196
1197 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CoefficientsRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1198 <p>returns the ring of coefficients of the polynomial ring <var class="Arg">pring</var>, that is the ring over which <var class="Arg">pring</var> was defined.</p>
1199
1200
1201 <div class="example"><pre>
1202 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r:=PolynomialRing(GF(7));</span>
1203 GF(7)[x_1]
1204 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r:=PolynomialRing(GF(7),3);</span>
1205 GF(7)[x_1,x_2,x_3]
1206 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndeterminatesOfPolynomialRing(r);</span>
1207 [ x_1, x_2, x_3 ]
1208 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r2:=PolynomialRing(GF(7),[5,7,12]);</span>
1209 GF(7)[x_5,x_7,x_12]
1210 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CoefficientsRing(r);</span>
1211 GF(7)
1212 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r:=PolynomialRing(GF(7),3);</span>
1213 GF(7)[x_1,x_2,x_3]
1214 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r2:=PolynomialRing(GF(7),3,IndeterminatesOfPolynomialRing(r));</span>
1215 GF(7)[x_4,x_5,x_6]
1216 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r:=PolynomialRing(GF(7),["x","y","z","z2"]);</span>
1217 GF(7)[x,y,z,z2]
1218 </pre></div>
1219
1220 <p><a id="X7D631ACC86C584B7" name="X7D631ACC86C584B7"></a></p>
1221
1222 <h5>66.15-4 IsPolynomialRing</h5>
1223
1224 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPolynomialRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1225 <p>is the category of polynomial rings</p>
1226
1227 <p><a id="X86F391237A76D804" name="X86F391237A76D804"></a></p>
1228
1229 <h5>66.15-5 IsFiniteFieldPolynomialRing</h5>
1230
1231 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFiniteFieldPolynomialRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1232 <p>is the category of polynomial rings over a finite field (see Chapter <a href="chap59.html#X7893ABF67A028802"><span class="RefLink">59</span></a>).</p>
1233
1234 <p><a id="X782D07F77BCF67C1" name="X782D07F77BCF67C1"></a></p>
1235
1236 <h5>66.15-6 IsAbelianNumberFieldPolynomialRing</h5>
1237
1238 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAbelianNumberFieldPolynomialRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1239 <p>is the category of polynomial rings over a field of cyclotomics (see the chapters <a href="chap18.html#X7DFC03C187DE4841"><span class="RefLink">18</span></a> and <a href="chap60.html#X80510B5880521FDC"><span class="RefLink">60</span></a>).</p>
1240
1241 <p><a id="X7D45213A8642033B" name="X7D45213A8642033B"></a></p>
1242
1243 <h5>66.15-7 IsRationalsPolynomialRing</h5>
1244
1245 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRationalsPolynomialRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1246 <p>is the category of polynomial rings over the rationals (see Chapter <a href="chap17.html#X87003045878E74DF"><span class="RefLink">17</span></a>).</p>
1247
1248
1249 <div class="example"><pre>
1250 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r := PolynomialRing(Rationals, ["a", "b"] );;</span>
1251 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPolynomialRing(r);</span>
1252 true
1253 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFiniteFieldPolynomialRing(r);</span>
1254 false
1255 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsRationalsPolynomialRing(r);</span>
1256 true
1257 </pre></div>
1258
1259 <p><a id="X812E801484E3624E" name="X812E801484E3624E"></a></p>
1260
1261 <h5>66.15-8 <span class="Heading">FunctionField</span></h5>
1262
1263 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FunctionField</code>( <var class="Arg">R</var>, <var class="Arg">rank</var>[, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1264 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FunctionField</code>( <var class="Arg">R</var>, <var class="Arg">names</var>[, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1265 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FunctionField</code>( <var class="Arg">R</var>, <var class="Arg">indets</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1266 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FunctionField</code>( <var class="Arg">R</var>, <var class="Arg">indetnums</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1267 <p>creates a function field over the integral ring <var class="Arg">R</var>. If a positive integer <var class="Arg">rank</var> is given, this creates the function field in <var class="Arg">rank</var> indeterminates. These indeterminates will have the internal index numbers 1 to <var class="Arg">rank</var>. The second usage takes a list <var class="Arg">names</var> of strings and returns a function field in indeterminates labelled by <var class="Arg">names</var>. These indeterminates have <q>new</q> internal index numbers as if they had been created by calls to <code class="func">Indeterminate</code> (<a href="chap66.html#X79D0380D7FA39F7D"><span class="RefLink">66.1-1</span></a>). (If the argument <var class="Arg">avoid</var> is given it contains indeterminates that should be avoided, in this case internal index numbers are incremented to skip these variables.) In the third version, a list of indeterminates <var class="Arg">indets</var> is given. This creates the function field in the indeterminates <var class="Arg">indets</var>. Finally, the fourth version specifies indeterminates by their index number.</p>
1268
1269 <p>To get the indeterminates of a function field use <code class="func">IndeterminatesOfFunctionField</code> (<a href="chap66.html#X80D585E1793D4552"><span class="RefLink">66.15-2</span></a>). (Indeterminates created independently with <code class="func">Indeterminate</code> (<a href="chap66.html#X79D0380D7FA39F7D"><span class="RefLink">66.1-1</span></a>) will usually differ, though they might be given the same name and display identically, see Section <a href="chap66.html#X7A8FADCD875826DA"><span class="RefLink">66.1</span></a>.)</p>
1270
1271 <p><a id="X8090C9EC85201AAC" name="X8090C9EC85201AAC"></a></p>
1272
1273 <h5>66.15-9 IsFunctionField</h5>
1274
1275 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFunctionField</code>( <var class="Arg">ffield</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1276 <p>is the category of function fields</p>
1277
1278 <p><a id="X85CA757B844F12AE" name="X85CA757B844F12AE"></a></p>
1279
1280 <h4>66.16 <span class="Heading">Univariate Polynomial Rings</span></h4>
1281
1282 <p><a id="X84DC2A59797A26DE" name="X84DC2A59797A26DE"></a></p>
1283
1284 <h5>66.16-1 <span class="Heading">UnivariatePolynomialRing</span></h5>
1285
1286 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnivariatePolynomialRing</code>( <var class="Arg">R</var>[, <var class="Arg">nr</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1287 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnivariatePolynomialRing</code>( <var class="Arg">R</var>[, <var class="Arg">name</var>][, <var class="Arg">avoid</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1288 <p>returns a univariate polynomial ring in the indeterminate <var class="Arg">nr</var> over the base ring <var class="Arg">R</var>. If <var class="Arg">nr</var> is not given it defaults to 1.</p>
1289
1290 <p>If the number is not specified a list <var class="Arg">avoid</var> of indeterminates may be given. Then the function will return a ring in an indeterminate that is guaranteed to be different from all the indeterminates in <var class="Arg">avoid</var>.</p>
1291
1292 <p>Also a string <var class="Arg">name</var> can be prescribed as the name of the indeterminate chosen (also avoiding the indeterminates in the list <var class="Arg">avoid</var> if given).</p>
1293
1294 <p><a id="X7A43D74B812401CA" name="X7A43D74B812401CA"></a></p>
1295
1296 <h5>66.16-2 IsUnivariatePolynomialRing</h5>
1297
1298 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsUnivariatePolynomialRing</code>( <var class="Arg">pring</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1299 <p>is the category of polynomial rings with one indeterminate.</p>
1300
1301
1302 <div class="example"><pre>
1303 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r:=UnivariatePolynomialRing(Rationals,"p");</span>
1304 Rationals[p]
1305 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">r2:=PolynomialRing(Rationals,["q"]);</span>
1306 Rationals[q]
1307 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsUnivariatePolynomialRing(r);</span>
1308 true
1309 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsUnivariatePolynomialRing(r2);</span>
1310 true
1311 </pre></div>
1312
1313 <p><a id="X86E2ADEA784AD163" name="X86E2ADEA784AD163"></a></p>
1314
1315 <h4>66.17 <span class="Heading">Monomial Orderings</span></h4>
1316
1317 <p>It is often desirable to consider the monomials within a polynomial to be arranged with respect to a certain ordering. Such an ordering is called a <em>monomial ordering</em> if it is total, invariant under multiplication with other monomials and admits no infinite descending chains. For details on monomial orderings see <a href="chapBib.html#biBcoxlittleoshea">[CLO97]</a>.</p>
1318
1319 <p>In <strong class="pkg">GAP</strong>, monomial orderings are represented by objects that provide a way to compare monomials (as polynomials as well as –for efficiency purposes within algorithms– in the internal representation as lists).</p>
1320
1321 <p>Normally the ordering chosen should be <em>admissible</em>, i.e. it must be compatible with products: If <span class="SimpleMath">a &lt; b</span> then <span class="SimpleMath">ca &lt; cb</span> for all monomials <span class="SimpleMath">a, b</span> and <span class="SimpleMath">c</span>.</p>
1322
1323 <p>Each monomial ordering provides the two functions <code class="func">MonomialComparisonFunction</code> (<a href="chap66.html#X7EDE941781BA7F8B"><span class="RefLink">66.17-5</span></a>) and <code class="func">MonomialExtrepComparisonFun</code> (<a href="chap66.html#X7EDC3A457E7B591E"><span class="RefLink">66.17-6</span></a>) to compare monomials. These functions work as <q>is less than</q>, i.e. they return <code class="keyw">true</code> if and only if the left argument is smaller.</p>
1324
1325 <p><a id="X79D4CBBF820EA204" name="X79D4CBBF820EA204"></a></p>
1326
1327 <h5>66.17-1 IsMonomialOrdering</h5>
1328
1329 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMonomialOrdering</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1330 <p>A monomial ordering is an object representing a monomial ordering. Its attributes <code class="func">MonomialComparisonFunction</code> (<a href="chap66.html#X7EDE941781BA7F8B"><span class="RefLink">66.17-5</span></a>) and <code class="func">MonomialExtrepComparisonFun</code> (<a href="chap66.html#X7EDC3A457E7B591E"><span class="RefLink">66.17-6</span></a>) are actual comparison functions.</p>
1331
1332 <p><a id="X7D052A017A73E91E" name="X7D052A017A73E91E"></a></p>
1333
1334 <h5>66.17-2 LeadingMonomialOfPolynomial</h5>
1335
1336 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeadingMonomialOfPolynomial</code>( <var class="Arg">pol</var>, <var class="Arg">ord</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1337 <p>returns the leading monomial (with respect to the ordering <var class="Arg">ord</var>) of the polynomial <var class="Arg">pol</var>.</p>
1338
1339
1340 <div class="example"><pre>
1341 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Indeterminate(Rationals,"x");;</span>
1342 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">y:=Indeterminate(Rationals,"y");;</span>
1343 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">z:=Indeterminate(Rationals,"z");;</span>
1344 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">lexord:=MonomialLexOrdering();grlexord:=MonomialGrlexOrdering();</span>
1345 MonomialLexOrdering()
1346 MonomialGrlexOrdering()
1347 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=2*x+3*y+4*z+5*x^2-6*z^2+7*y^3;</span>
1348 7*y^3+5*x^2-6*z^2+2*x+3*y+4*z
1349 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingMonomialOfPolynomial(f,lexord);</span>
1350 x^2
1351 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingMonomialOfPolynomial(f,grlexord);</span>
1352 y^3
1353 </pre></div>
1354
1355 <p><a id="X7B6231137BA8B95F" name="X7B6231137BA8B95F"></a></p>
1356
1357 <h5>66.17-3 LeadingTermOfPolynomial</h5>
1358
1359 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeadingTermOfPolynomial</code>( <var class="Arg">pol</var>, <var class="Arg">ord</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1360 <p>returns the leading term (with respect to the ordering <var class="Arg">ord</var>) of the polynomial <var class="Arg">pol</var>, i.e. the product of leading coefficient and leading monomial.</p>
1361
1362 <p><a id="X798E707D86141087" name="X798E707D86141087"></a></p>
1363
1364 <h5>66.17-4 LeadingCoefficientOfPolynomial</h5>
1365
1366 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeadingCoefficientOfPolynomial</code>( <var class="Arg">pol</var>, <var class="Arg">ord</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1367 <p>returns the leading coefficient (that is the coefficient of the leading monomial, see <code class="func">LeadingMonomialOfPolynomial</code> (<a href="chap66.html#X7D052A017A73E91E"><span class="RefLink">66.17-2</span></a>)) of the polynomial <var class="Arg">pol</var>.</p>
1368
1369
1370 <div class="example"><pre>
1371 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingTermOfPolynomial(f,lexord);</span>
1372 5*x^2
1373 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingTermOfPolynomial(f,grlexord);</span>
1374 7*y^3
1375 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeadingCoefficientOfPolynomial(f,lexord);</span>
1376 5
1377 </pre></div>
1378
1379 <p><a id="X7EDE941781BA7F8B" name="X7EDE941781BA7F8B"></a></p>
1380
1381 <h5>66.17-5 MonomialComparisonFunction</h5>
1382
1383 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MonomialComparisonFunction</code>( <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1384 <p>If <var class="Arg">O</var> is an object representing a monomial ordering, this attribute returns a <em>function</em> that can be used to compare or sort monomials (and polynomials which will be compared by their monomials in decreasing order) in this order.</p>
1385
1386
1387 <div class="example"><pre>
1388 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MonomialComparisonFunction(lexord);</span>
1389 function( a, b ) ... end
1390 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">l:=[f,Derivative(f,x),Derivative(f,y),Derivative(f,z)];;</span>
1391 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(lexord));l;</span>
1392 [ -12*z+4, 21*y^2+3, 10*x+2, 7*y^3+5*x^2-6*z^2+2*x+3*y+4*z ]
1393 </pre></div>
1394
1395 <p><a id="X7EDC3A457E7B591E" name="X7EDC3A457E7B591E"></a></p>
1396
1397 <h5>66.17-6 MonomialExtrepComparisonFun</h5>
1398
1399 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MonomialExtrepComparisonFun</code>( <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1400 <p>If <var class="Arg">O</var> is an object representing a monomial ordering, this attribute returns a <em>function</em> that can be used to compare or sort monomials <em>in their external representation</em> (as lists). This comparison variant is used inside algorithms that manipulate the external representation.</p>
1401
1402 <p><a id="X852D7BB37ECE98E1" name="X852D7BB37ECE98E1"></a></p>
1403
1404 <h5>66.17-7 MonomialLexOrdering</h5>
1405
1406 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MonomialLexOrdering</code>( [<var class="Arg">vari</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1407 <p>This function creates a lexicographic ordering for monomials. Monomials are compared first by the exponents of the largest variable, then the exponents of the second largest variable and so on.</p>
1408
1409 <p>The variables are ordered according to their (internal) index, i.e., <span class="SimpleMath">x_1</span> is larger than <span class="SimpleMath">x_2</span> and so on. If <var class="Arg">vari</var> is given, and is a list of variables or variable indices, instead this arrangement of variables (in descending order; i.e. the first variable is larger than the second) is used as the underlying order of variables.</p>
1410
1411
1412 <div class="example"><pre>
1413 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">l:=List(Tuples([1..3],3),i-&gt;x^(i[1]-1)*y^(i[2]-1)*z^(i[3]-1));</span>
1414 [ 1, z, z^2, y, y*z, y*z^2, y^2, y^2*z, y^2*z^2, x, x*z, x*z^2, x*y,
1415 x*y*z, x*y*z^2, x*y^2, x*y^2*z, x*y^2*z^2, x^2, x^2*z, x^2*z^2,
1416 x^2*y, x^2*y*z, x^2*y*z^2, x^2*y^2, x^2*y^2*z, x^2*y^2*z^2 ]
1417 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(MonomialLexOrdering()));l;</span>
1418 [ 1, z, z^2, y, y*z, y*z^2, y^2, y^2*z, y^2*z^2, x, x*z, x*z^2, x*y,
1419 x*y*z, x*y*z^2, x*y^2, x*y^2*z, x*y^2*z^2, x^2, x^2*z, x^2*z^2,
1420 x^2*y, x^2*y*z, x^2*y*z^2, x^2*y^2, x^2*y^2*z, x^2*y^2*z^2 ]
1421 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(MonomialLexOrdering([y,z,x])));l;</span>
1422 [ 1, x, x^2, z, x*z, x^2*z, z^2, x*z^2, x^2*z^2, y, x*y, x^2*y, y*z,
1423 x*y*z, x^2*y*z, y*z^2, x*y*z^2, x^2*y*z^2, y^2, x*y^2, x^2*y^2,
1424 y^2*z, x*y^2*z, x^2*y^2*z, y^2*z^2, x*y^2*z^2, x^2*y^2*z^2 ]
1425 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(MonomialLexOrdering([z,x,y])));l;</span>
1426 [ 1, y, y^2, x, x*y, x*y^2, x^2, x^2*y, x^2*y^2, z, y*z, y^2*z, x*z,
1427 x*y*z, x*y^2*z, x^2*z, x^2*y*z, x^2*y^2*z, z^2, y*z^2, y^2*z^2,
1428 x*z^2, x*y*z^2, x*y^2*z^2, x^2*z^2, x^2*y*z^2, x^2*y^2*z^2 ]
1429 </pre></div>
1430
1431 <p><a id="X786C866C824D2688" name="X786C866C824D2688"></a></p>
1432
1433 <h5>66.17-8 MonomialGrlexOrdering</h5>
1434
1435 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MonomialGrlexOrdering</code>( [<var class="Arg">vari</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1436 <p>This function creates a degree/lexicographic ordering. In this ordering monomials are compared first by their total degree, then lexicographically (see <code class="func">MonomialLexOrdering</code> (<a href="chap66.html#X852D7BB37ECE98E1"><span class="RefLink">66.17-7</span></a>)).</p>
1437
1438 <p>The variables are ordered according to their (internal) index, i.e., <span class="SimpleMath">x_1</span> is larger than <span class="SimpleMath">x_2</span> and so on. If <var class="Arg">vari</var> is given, and is a list of variables or variable indices, instead this arrangement of variables (in descending order; i.e. the first variable is larger than the second) is used as the underlying order of variables.</p>
1439
1440 <p><a id="X8094C733808D1799" name="X8094C733808D1799"></a></p>
1441
1442 <h5>66.17-9 MonomialGrevlexOrdering</h5>
1443
1444 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MonomialGrevlexOrdering</code>( [<var class="Arg">vari</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1445 <p>This function creates a <q>grevlex</q> ordering. In this ordering monomials are compared first by total degree and then backwards lexicographically. (This is different than <q>grlex</q> ordering with variables reversed.)</p>
1446
1447 <p>The variables are ordered according to their (internal) index, i.e., <span class="SimpleMath">x_1</span> is larger than <span class="SimpleMath">x_2</span> and so on. If <var class="Arg">vari</var> is given, and is a list of variables or variable indices, instead this arrangement of variables (in descending order; i.e. the first variable is larger than the second) is used as the underlying order of variables.</p>
1448
1449
1450 <div class="example"><pre>
1451 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(MonomialGrlexOrdering()));l;</span>
1452 [ 1, z, y, x, z^2, y*z, y^2, x*z, x*y, x^2, y*z^2, y^2*z, x*z^2,
1453 x*y*z, x*y^2, x^2*z, x^2*y, y^2*z^2, x*y*z^2, x*y^2*z, x^2*z^2,
1454 x^2*y*z, x^2*y^2, x*y^2*z^2, x^2*y*z^2, x^2*y^2*z, x^2*y^2*z^2 ]
1455 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(MonomialGrevlexOrdering()));l;</span>
1456 [ 1, z, y, x, z^2, y*z, x*z, y^2, x*y, x^2, y*z^2, x*z^2, y^2*z,
1457 x*y*z, x^2*z, x*y^2, x^2*y, y^2*z^2, x*y*z^2, x^2*z^2, x*y^2*z,
1458 x^2*y*z, x^2*y^2, x*y^2*z^2, x^2*y*z^2, x^2*y^2*z, x^2*y^2*z^2 ]
1459 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Sort(l,MonomialComparisonFunction(MonomialGrlexOrdering([z,y,x])));l;</span>
1460 [ 1, x, y, z, x^2, x*y, y^2, x*z, y*z, z^2, x^2*y, x*y^2, x^2*z,
1461 x*y*z, y^2*z, x*z^2, y*z^2, x^2*y^2, x^2*y*z, x*y^2*z, x^2*z^2,
1462 x*y*z^2, y^2*z^2, x^2*y^2*z, x^2*y*z^2, x*y^2*z^2, x^2*y^2*z^2 ]
1463 </pre></div>
1464
1465 <p><a id="X84AC871283A74EC0" name="X84AC871283A74EC0"></a></p>
1466
1467 <h5>66.17-10 EliminationOrdering</h5>
1468
1469 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; EliminationOrdering</code>( <var class="Arg">elim</var>[, <var class="Arg">rest</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1470 <p>This function creates an elimination ordering for eliminating the variables in <var class="Arg">elim</var>. Two monomials are compared first by the exponent vectors for the variables listed in <var class="Arg">elim</var> (a lexicographic comparison with respect to the ordering indicated in <var class="Arg">elim</var>). If these submonomial are equal, the submonomials given by the other variables are compared by a graded lexicographic ordering (with respect to the variable order given in <var class="Arg">rest</var>, if called with two parameters).</p>
1471
1472 <p>Both <var class="Arg">elim</var> and <var class="Arg">rest</var> may be a list of variables or a list of variable indices.</p>
1473
1474 <p><a id="X7C99593584D478D7" name="X7C99593584D478D7"></a></p>
1475
1476 <h5>66.17-11 PolynomialReduction</h5>
1477
1478 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialReduction</code>( <var class="Arg">poly</var>, <var class="Arg">gens</var>, <var class="Arg">order</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1479 <p>reduces the polynomial <var class="Arg">poly</var> by the ideal generated by the polynomials in <var class="Arg">gens</var>, using the order <var class="Arg">order</var> of monomials. Unless <var class="Arg">gens</var> is a Gröbner basis the result is not guaranteed to be unique.</p>
1480
1481 <p>The operation returns a list of length two, the first entry is the remainder after the reduction. The second entry is a list of quotients corresponding to <var class="Arg">gens</var>.</p>
1482
1483 <p>Note that the strategy used by <code class="func">PolynomialReduction</code> differs from the standard textbook reduction algorithm, which is provided by <code class="func">PolynomialDivisionAlgorithm</code> (<a href="chap66.html#X7C8239057FD4EC03"><span class="RefLink">66.17-13</span></a>).</p>
1484
1485 <p><a id="X7DE7D4467EBAD916" name="X7DE7D4467EBAD916"></a></p>
1486
1487 <h5>66.17-12 PolynomialReducedRemainder</h5>
1488
1489 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialReducedRemainder</code>( <var class="Arg">poly</var>, <var class="Arg">gens</var>, <var class="Arg">order</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1490 <p>this operation does the same way as <code class="func">PolynomialReduction</code> (<a href="chap66.html#X7C99593584D478D7"><span class="RefLink">66.17-11</span></a>) but does not keep track of the actual quotients and returns only the remainder (it is therefore slightly faster).</p>
1491
1492 <p><a id="X7C8239057FD4EC03" name="X7C8239057FD4EC03"></a></p>
1493
1494 <h5>66.17-13 PolynomialDivisionAlgorithm</h5>
1495
1496 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialDivisionAlgorithm</code>( <var class="Arg">poly</var>, <var class="Arg">gens</var>, <var class="Arg">order</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1497 <p>This function implements the division algorithm for multivariate polynomials as given in <a href="chapBib.html#biBcoxlittleoshea">[CLO97, Theorem 3 in Chapter 2]</a>. (It might be slower than <code class="func">PolynomialReduction</code> (<a href="chap66.html#X7C99593584D478D7"><span class="RefLink">66.17-11</span></a>) but the remainders are guaranteed to agree with the textbook.)</p>
1498
1499 <p>The operation returns a list of length two, the first entry is the remainder after the reduction. The second entry is a list of quotients corresponding to <var class="Arg">gens</var>.</p>
1500
1501
1502 <div class="example"><pre>
1503 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bas:=[x^3*y*z,x*y^2*z,z*y*z^3+x];;</span>
1504 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">pol:=x^7*z*bas[1]+y^5*bas[3]+x*z;;</span>
1505 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PolynomialReduction(pol,bas,MonomialLexOrdering());</span>
1506 [ -y*z^5, [ x^7*z, 0, y^5+z ] ]
1507 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PolynomialReducedRemainder(pol,bas,MonomialLexOrdering());</span>
1508 -y*z^5
1509 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PolynomialDivisionAlgorithm(pol,bas,MonomialLexOrdering());</span>
1510 [ -y*z^5, [ x^7*z, 0, y^5+z ] ]
1511 </pre></div>
1512
1513 <p><a id="X7A30E10B820311D1" name="X7A30E10B820311D1"></a></p>
1514
1515 <h5>66.17-14 MonomialExtGrlexLess</h5>
1516
1517 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MonomialExtGrlexLess</code>( <var class="Arg">a</var>, <var class="Arg">b</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1518 <p>implements comparison of monomial in their external representation by a <q>grlex</q> order with <span class="SimpleMath">x_1&gt;x_2</span> (This is exactly the same as the ordering by <code class="func">MonomialGrlexOrdering</code> (<a href="chap66.html#X786C866C824D2688"><span class="RefLink">66.17-8</span></a>), see  <a href="chap66.html#X86E2ADEA784AD163"><span class="RefLink">66.17</span></a>). The function takes two monomials <var class="Arg">a</var> and <var class="Arg">b</var> in expanded form and returns whether the first is smaller than the second. (This ordering is also used by <strong class="pkg">GAP</strong> internally for representing polynomials as a linear combination of monomials.)</p>
1519
1520 <p>See section <a href="chap66.html#X7F44CF87801DB965"><span class="RefLink">66.21</span></a> for details on the expanded form of monomials.</p>
1521
1522 <p><a id="X79BAB2937E6085D6" name="X79BAB2937E6085D6"></a></p>
1523
1524 <h4>66.18 <span class="Heading">Groebner Bases</span></h4>
1525
1526 <p>A <em>Groebner Basis</em> of an ideal <span class="SimpleMath">I</span>i, in a polynomial ring <span class="SimpleMath">R</span>, with respect to a monomial ordering, is a set of ideal generators <var class="Arg">G</var> such that the ideal generated by the leading monomials of all polynomials in <var class="Arg">G</var> is equal to the ideal generated by the leading monomials of all polynomials in <var class="Arg">I</var>.</p>
1527
1528 <p>For more details on Groebner bases see <a href="chapBib.html#biBcoxlittleoshea">[CLO97]</a>.</p>
1529
1530 <p><a id="X7A43611E876B7560" name="X7A43611E876B7560"></a></p>
1531
1532 <h5>66.18-1 <span class="Heading">GroebnerBasis</span></h5>
1533
1534 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GroebnerBasis</code>( <var class="Arg">L</var>, <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1535 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GroebnerBasis</code>( <var class="Arg">I</var>, <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1536 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GroebnerBasisNC</code>( <var class="Arg">L</var>, <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1537 <p>Let <var class="Arg">O</var> be a monomial ordering and <var class="Arg">L</var> be a list of polynomials that generate an ideal <var class="Arg">I</var>. This operation returns a Groebner basis of <var class="Arg">I</var> with respect to the ordering <var class="Arg">O</var>.</p>
1538
1539 <p><code class="func">GroebnerBasisNC</code> works like <code class="func">GroebnerBasis</code> with the only distinction that the first argument has to be a list of polynomials and that no test is performed to check whether the ordering is defined for all occurring variables.</p>
1540
1541 <p>Note that <strong class="pkg">GAP</strong> at the moment only includes a naïve implementation of Buchberger's algorithm (which is mainly intended as a teaching tool). It might not be sufficient for serious problems.</p>
1542
1543
1544 <div class="example"><pre>
1545 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">l:=[x^2+y^2+z^2-1,x^2+z^2-y,x-y];;</span>
1546 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GroebnerBasis(l,MonomialLexOrdering());</span>
1547 [ x^2+y^2+z^2-1, x^2+z^2-y, x-y, -y^2-y+1, -z^2+2*y-1,
1548 1/2*z^4+2*z^2-1/2 ]
1549 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GroebnerBasis(l,MonomialLexOrdering([z,x,y]));</span>
1550 [ x^2+y^2+z^2-1, x^2+z^2-y, x-y, -y^2-y+1 ]
1551 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GroebnerBasis(l,MonomialGrlexOrdering());</span>
1552 [ x^2+y^2+z^2-1, x^2+z^2-y, x-y, -y^2-y+1, -z^2+2*y-1 ]
1553 </pre></div>
1554
1555 <p><a id="X7DEF286384967C9E" name="X7DEF286384967C9E"></a></p>
1556
1557 <h5>66.18-2 <span class="Heading">ReducedGroebnerBasis</span></h5>
1558
1559 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReducedGroebnerBasis</code>( <var class="Arg">L</var>, <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1560 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReducedGroebnerBasis</code>( <var class="Arg">I</var>, <var class="Arg">O</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1561 <p>a Groebner basis <span class="SimpleMath">B</span> (see <code class="func">GroebnerBasis</code> (<a href="chap66.html#X7A43611E876B7560"><span class="RefLink">66.18-1</span></a>)) is <em>reduced</em> if no monomial in a polynomial in <var class="Arg">B</var> is divisible by the leading monomial of another polynomial in <span class="SimpleMath">B</span>. This operation computes a Groebner basis with respect to the monomial ordering <var class="Arg">O</var> and then reduces it.</p>
1562
1563
1564 <div class="example"><pre>
1565 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ReducedGroebnerBasis(l,MonomialGrlexOrdering());</span>
1566 [ x-y, z^2-2*y+1, y^2+y-1 ]
1567 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ReducedGroebnerBasis(l,MonomialLexOrdering());</span>
1568 [ z^4+4*z^2-1, -1/2*z^2+y-1/2, -1/2*z^2+x-1/2 ]
1569 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ReducedGroebnerBasis(l,MonomialLexOrdering([y,z,x]));</span>
1570 [ x^2+x-1, z^2-2*x+1, -x+y ]
1571 </pre></div>
1572
1573 <p>For performance reasons it can be advantageous to define monomial orderings once and then to reuse them:</p>
1574
1575
1576 <div class="example"><pre>
1577 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ord:=MonomialGrlexOrdering();;</span>
1578 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GroebnerBasis(l,ord);</span>
1579 [ x^2+y^2+z^2-1, x^2+z^2-y, x-y, -y^2-y+1, -z^2+2*y-1 ]
1580 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ReducedGroebnerBasis(l,ord);</span>
1581 [ x-y, z^2-2*y+1, y^2+y-1 ]
1582 </pre></div>
1583
1584 <p><a id="X7FC1EFE78498C17C" name="X7FC1EFE78498C17C"></a></p>
1585
1586 <h5>66.18-3 StoredGroebnerBasis</h5>
1587
1588 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; StoredGroebnerBasis</code>( <var class="Arg">I</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1589 <p>For an ideal <var class="Arg">I</var> in a polynomial ring, this attribute holds a list <span class="SimpleMath">[ B, O ]</span> where <span class="SimpleMath">B</span> is a Groebner basis for the monomial ordering <span class="SimpleMath">O</span>. this can be used to test membership or canonical coset representatives.</p>
1590
1591 <p><a id="X7C55702786D284A7" name="X7C55702786D284A7"></a></p>
1592
1593 <h5>66.18-4 InfoGroebner</h5>
1594
1595 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; InfoGroebner</code></td><td class="tdright">(&nbsp;info class&nbsp;)</td></tr></table></div>
1596 <p>This info class gives information about Groebner basis calculations.</p>
1597
1598 <p><a id="X8113DD9B781CA6C1" name="X8113DD9B781CA6C1"></a></p>
1599
1600 <h4>66.19 <span class="Heading">Rational Function Families</span></h4>
1601
1602 <p>All rational functions defined over a ring lie in the same family, the rational functions family over this ring.</p>
1603
1604 <p>In <strong class="pkg">GAP</strong> therefore the family of a polynomial depends only on the family of the coefficients, all polynomials whose coefficients lie in the same family are <q>compatible</q>.</p>
1605
1606 <p><a id="X855DD73C78A90BC3" name="X855DD73C78A90BC3"></a></p>
1607
1608 <h5>66.19-1 RationalFunctionsFamily</h5>
1609
1610 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RationalFunctionsFamily</code>( <var class="Arg">fam</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1611 <p>creates a family containing rational functions with coefficients in <var class="Arg">fam</var>. All elements of the <code class="func">RationalFunctionsFamily</code> are rational functions (see <code class="func">IsRationalFunction</code> (<a href="chap66.html#X86C92F677DA9347F"><span class="RefLink">66.4-1</span></a>)).</p>
1612
1613 <p><a id="X86E097307D188D3B" name="X86E097307D188D3B"></a></p>
1614
1615 <h5>66.19-2 IsPolynomialFunctionsFamily</h5>
1616
1617 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPolynomialFunctionsFamily</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1618 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRationalFunctionsFamily</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
1619 <p><code class="func">IsPolynomialFunctionsFamily</code> is the category of a family of polynomials. For families over an UFD, the category becomes <code class="func">IsRationalFunctionsFamily</code> (as rational functions and quotients are only provided for families over an UFD.)</p>
1620
1621
1622 <div class="example"><pre>
1623 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">fam:=RationalFunctionsFamily(FamilyObj(1));</span>
1624 NewFamily( "RationalFunctionsFamily(...)", [ 618, 620 ],
1625 [ 82, 85, 89, 93, 97, 100, 103, 107, 111, 618, 620 ] )
1626 </pre></div>
1627
1628 <p><a id="X7AADCA45826866FB" name="X7AADCA45826866FB"></a></p>
1629
1630 <h5>66.19-3 CoefficientsFamily</h5>
1631
1632 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CoefficientsFamily</code>( <var class="Arg">rffam</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1633 <p>If <var class="Arg">rffam</var> has been created as <code class="code">RationalFunctionsFamily(<var class="Arg">cfam</var>)</code> this attribute holds the coefficients family <var class="Arg">cfam</var>.</p>
1634
1635 <p><strong class="pkg">GAP</strong> does <em>not</em> embed the base ring in the polynomial ring. While multiplication and addition of base ring elements to rational functions return the expected results, polynomials and rational functions are not equal.</p>
1636
1637
1638 <div class="example"><pre>
1639 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">1=Indeterminate(Rationals)^0;</span>
1640 false
1641 </pre></div>
1642
1643 <p><a id="X7E360788785DE530" name="X7E360788785DE530"></a></p>
1644
1645 <h4>66.20 <span class="Heading">The Representations of Rational Functions</span></h4>
1646
1647 <p><strong class="pkg">GAP</strong> uses four representations of rational functions: Rational functions given by numerator and denominator, polynomials, univariate rational functions (given by coefficient lists for numerator and denominator and valuation) and Laurent polynomials (given by coefficient list and valuation).</p>
1648
1649 <p>These representations do not necessarily reflect mathematical properties: While an object in the Laurent polynomials representation must be a Laurent polynomial it might turn out that a rational function given by numerator and denominator is actually a Laurent polynomial and the property tests in section <a href="chap66.html#X7D871EA180E9486C"><span class="RefLink">66.4</span></a> will find this out.</p>
1650
1651 <p>Each representation is associated one or several <q>defining attributes</q> that give an <q>external</q> representation (see <a href="chap66.html#X7F44CF87801DB965"><span class="RefLink">66.21</span></a>) of the representation in the form of lists and are the defining information that tells a rational function what it is.</p>
1652
1653 <p><strong class="pkg">GAP</strong> also implements methods to compute these attributes for rational functions in <em>other</em> representations, provided it would be possible to express an <em>mathematically equal</em> rational function in the representation associated with the attribute. (That is one can always get a numerator/denominator representation of a polynomial while an arbitrary function of course can compute a polynomial representation only if it is a polynomial.)</p>
1654
1655 <p>Therefore these attributes can be thought of as <q>conceptual</q> representations that allow us –as far as possible– to consider an object as a rational function, a polynomial or a Laurent polynomial, regardless of the way it is represented in the computer.</p>
1656
1657 <p>Functions thus usually do not need to care about the representation of a rational function. Depending on its (known in the context or determined) properties, they can access the attribute representing the rational function in the desired way.</p>
1658
1659 <p>Consequently, methods for rational functions are installed for properties and not for representations.</p>
1660
1661 <p>When <em>creating</em> new rational functions however they must be created in one of the three representations. In most cases this will be the representation for which the <q>conceptual</q> representation in which the calculation was done is the defining attribute.</p>
1662
1663 <p>Iterated operations (like forming the product over a list) therefore will tend to stay in the most suitable representation and the calculation of another conceptual representation (which may be comparatively expensive in certain circumstances) is not necessary.</p>
1664
1665 <p><a id="X7F44CF87801DB965" name="X7F44CF87801DB965"></a></p>
1666
1667 <h4>66.21 <span class="Heading">The Defining Attributes of Rational Functions</span></h4>
1668
1669 <p>In general, rational functions are given in terms of monomials. They are represented by lists, using numbers (see <a href="chap66.html#X7A8FADCD875826DA"><span class="RefLink">66.1</span></a>) for the indeterminates.</p>
1670
1671 <p>A monomial is a product of powers of indeterminates. A monomial is stored as a list (we call this the <em>expanded form</em> of the monomial) of the form <code class="code">[<var class="Arg">inum</var>,<var class="Arg">exp</var>,<var class="Arg">inum</var>,<var class="Arg">exp</var>,...]</code> where each <var class="Arg">inum</var> is the number of an indeterminate and <var class="Arg">exp</var> the corresponding exponent. The list must be sorted according to the numbers of the indeterminates. Thus for example, if <span class="SimpleMath">x</span>, <span class="SimpleMath">y</span> and <span class="SimpleMath">z</span> are the first three indeterminates, the expanded form of the monomial <span class="SimpleMath">x^5 z^8 = z^8 x^5</span> is <code class="code">[ 1, 5, 3, 8 ]</code>. The representation of a polynomials is a list of the form <code class="code">[<var class="Arg">mon</var>,<var class="Arg">coeff</var>,<var class="Arg">mon</var>,<var class="Arg">coeff</var>,...]</code> where <var class="Arg">mon</var> is a monomial in expanded form (that is given as list) and <var class="Arg">coeff</var> its coefficient. The monomials must be sorted according to the total degree/lexicographic order (This is the same as given by the <q>grlex</q> monomial ordering, see <code class="func">MonomialGrlexOrdering</code> (<a href="chap66.html#X786C866C824D2688"><span class="RefLink">66.17-8</span></a>)). We call this the <em>external representation</em> of a polynomial. (The reason for ordering is that addition of polynomials becomes linear in the number of monomials instead of quadratic; the reason for the particular ordering chose is that it is compatible with multiplication and thus gives acceptable performance for quotient calculations.)</p>
1672
1673 <p>The attributes that give a representation of a rational function as a Laurent polynomial are <code class="func">CoefficientsOfLaurentPolynomial</code> (<a href="chap66.html#X86D58AB67F86469F"><span class="RefLink">66.13-2</span></a>) and <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> (<a href="chap66.html#X816C8D797C804380"><span class="RefLink">66.1-2</span></a>).</p>
1674
1675 <p>Algorithms should use only the attributes <code class="func">ExtRepNumeratorRatFun</code> (<a href="chap66.html#X7DF955C87CBFC12B"><span class="RefLink">66.21-2</span></a>), <code class="func">ExtRepDenominatorRatFun</code> (<a href="chap66.html#X8059E74D7DCABDBC"><span class="RefLink">66.21-3</span></a>), <code class="func">ExtRepPolynomialRatFun</code> (<a href="chap66.html#X8406EE2E8775FBAB"><span class="RefLink">66.21-6</span></a>), <code class="func">CoefficientsOfLaurentPolynomial</code> (<a href="chap66.html#X86D58AB67F86469F"><span class="RefLink">66.13-2</span></a>) and –if the univariate function is not constant– <code class="func">IndeterminateNumberOfUnivariateRationalFunction</code> (<a href="chap66.html#X816C8D797C804380"><span class="RefLink">66.1-2</span></a>) as the low-level interface to work with a polynomial. They should not refer to the actual representation used.</p>
1676
1677 <p><a id="X791E16C67A352263" name="X791E16C67A352263"></a></p>
1678
1679 <h5>66.21-1 IsRationalFunctionDefaultRep</h5>
1680
1681 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRationalFunctionDefaultRep</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;representation&nbsp;)</td></tr></table></div>
1682 <p>is the default representation of rational functions. A rational function in this representation is defined by the attributes <code class="func">ExtRepNumeratorRatFun</code> (<a href="chap66.html#X7DF955C87CBFC12B"><span class="RefLink">66.21-2</span></a>) and <code class="func">ExtRepDenominatorRatFun</code> (<a href="chap66.html#X8059E74D7DCABDBC"><span class="RefLink">66.21-3</span></a>), the values of which are external representations of polynomials.</p>
1683
1684 <p><a id="X7DF955C87CBFC12B" name="X7DF955C87CBFC12B"></a></p>
1685
1686 <h5>66.21-2 ExtRepNumeratorRatFun</h5>
1687
1688 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ExtRepNumeratorRatFun</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1689 <p>returns the external representation of the numerator polynomial of the rational function <var class="Arg">ratfun</var>. Numerator and denominator are not guaranteed to be cancelled against each other.</p>
1690
1691 <p><a id="X8059E74D7DCABDBC" name="X8059E74D7DCABDBC"></a></p>
1692
1693 <h5>66.21-3 ExtRepDenominatorRatFun</h5>
1694
1695 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ExtRepDenominatorRatFun</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1696 <p>returns the external representation of the denominator polynomial of the rational function <var class="Arg">ratfun</var>. Numerator and denominator are not guaranteed to be cancelled against each other.</p>
1697
1698 <p><a id="X84F546F87B5ECFE0" name="X84F546F87B5ECFE0"></a></p>
1699
1700 <h5>66.21-4 ZeroCoefficientRatFun</h5>
1701
1702 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ZeroCoefficientRatFun</code>( <var class="Arg">ratfun</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1703 <p>returns the zero of the coefficient ring. This might be needed to represent the zero polynomial for which the external representation of the numerator is the empty list.</p>
1704
1705 <p><a id="X833CE16579AB26E0" name="X833CE16579AB26E0"></a></p>
1706
1707 <h5>66.21-5 IsPolynomialDefaultRep</h5>
1708
1709 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPolynomialDefaultRep</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;representation&nbsp;)</td></tr></table></div>
1710 <p>is the default representation of polynomials. A polynomial in this representation is defined by the components and <code class="func">ExtRepNumeratorRatFun</code> (<a href="chap66.html#X7DF955C87CBFC12B"><span class="RefLink">66.21-2</span></a>) where <code class="func">ExtRepNumeratorRatFun</code> (<a href="chap66.html#X7DF955C87CBFC12B"><span class="RefLink">66.21-2</span></a>) is the external representation of the polynomial.</p>
1711
1712 <p><a id="X8406EE2E8775FBAB" name="X8406EE2E8775FBAB"></a></p>
1713
1714 <h5>66.21-6 ExtRepPolynomialRatFun</h5>
1715
1716 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ExtRepPolynomialRatFun</code>( <var class="Arg">polynomial</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1717 <p>returns the external representation of a polynomial. The difference to <code class="func">ExtRepNumeratorRatFun</code> (<a href="chap66.html#X7DF955C87CBFC12B"><span class="RefLink">66.21-2</span></a>) is that rational functions might know to be a polynomial but can still have a non-vanishing denominator. In this case <code class="func">ExtRepPolynomialRatFun</code> has to call a quotient routine.</p>
1718
1719 <p><a id="X7E1B98CC7BADAF56" name="X7E1B98CC7BADAF56"></a></p>
1720
1721 <h5>66.21-7 IsLaurentPolynomialDefaultRep</h5>
1722
1723 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLaurentPolynomialDefaultRep</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;representation&nbsp;)</td></tr></table></div>
1724 <p>This representation is used for Laurent polynomials and univariate polynomials. It represents a Laurent polynomial via the attributes <code class="func">CoefficientsOfLaurentPolynomial</code> (<a href="chap66.html#X86D58AB67F86469F"><span class="RefLink">66.13-2</span></a>) and <code class="func">IndeterminateNumberOfLaurentPolynomial</code> (<a href="chap66.html#X8381E1B582F38C85"><span class="RefLink">66.13-3</span></a>).</p>
1725
1726 <p><a id="X791FADD278A2F32F" name="X791FADD278A2F32F"></a></p>
1727
1728 <h4>66.22 <span class="Heading">Creation of Rational Functions</span></h4>
1729
1730 <p>The operations <code class="func">LaurentPolynomialByCoefficients</code> (<a href="chap66.html#X8467263B7EFA013E"><span class="RefLink">66.13-1</span></a>), <code class="func">PolynomialByExtRep</code> (<a href="chap66.html#X79E445AF7849F48A"><span class="RefLink">66.22-2</span></a>) and <code class="func">RationalFunctionByExtRep</code> (<a href="chap66.html#X81297E4587A9F2A6"><span class="RefLink">66.22-1</span></a>) are used to construct objects in the three basic representations for rational functions.</p>
1731
1732 <p><a id="X81297E4587A9F2A6" name="X81297E4587A9F2A6"></a></p>
1733
1734 <h5>66.22-1 RationalFunctionByExtRep</h5>
1735
1736 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RationalFunctionByExtRep</code>( <var class="Arg">rfam</var>, <var class="Arg">num</var>, <var class="Arg">den</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1737 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RationalFunctionByExtRepNC</code>( <var class="Arg">rfam</var>, <var class="Arg">num</var>, <var class="Arg">den</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1738 <p>constructs a rational function (in the representation <code class="func">IsRationalFunctionDefaultRep</code> (<a href="chap66.html#X791E16C67A352263"><span class="RefLink">66.21-1</span></a>)) in the rational function family <var class="Arg">rfam</var>, the rational function itself is given by the external representations <var class="Arg">num</var> and <var class="Arg">den</var> for numerator and denominator. No cancellation takes place.</p>
1739
1740 <p>The variant <code class="func">RationalFunctionByExtRepNC</code> does not perform any test of the arguments and thus potentially can create illegal objects. It only should be used if speed is required and the arguments are known to be in correct form.</p>
1741
1742 <p><a id="X79E445AF7849F48A" name="X79E445AF7849F48A"></a></p>
1743
1744 <h5>66.22-2 PolynomialByExtRep</h5>
1745
1746 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialByExtRep</code>( <var class="Arg">rfam</var>, <var class="Arg">extrep</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1747 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PolynomialByExtRepNC</code>( <var class="Arg">rfam</var>, <var class="Arg">extrep</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1748 <p>constructs a polynomial (in the representation <code class="func">IsPolynomialDefaultRep</code> (<a href="chap66.html#X833CE16579AB26E0"><span class="RefLink">66.21-5</span></a>)) in the rational function family <var class="Arg">rfam</var>, the polynomial itself is given by the external representation <var class="Arg">extrep</var>.</p>
1749
1750 <p>The variant <code class="func">PolynomialByExtRepNC</code> does not perform any test of the arguments and thus potentially can create invalid objects. It only should be used if speed is required and the arguments are known to be in correct form.</p>
1751
1752
1753 <div class="example"><pre>
1754 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">fam:=RationalFunctionsFamily(FamilyObj(1));;</span>
1755 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">p:=PolynomialByExtRep(fam,[[1,2],1,[2,1,15,7],3]);</span>
1756 3*y*x_15^7+x^2
1757 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">q:=p/(p+1);</span>
1758 (3*y*x_15^7+x^2)/(3*y*x_15^7+x^2+1)
1759 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ExtRepNumeratorRatFun(q);</span>
1760 [ [ 1, 2 ], 1, [ 2, 1, 15, 7 ], 3 ]
1761 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ExtRepDenominatorRatFun(q);</span>
1762 [ [ ], 1, [ 1, 2 ], 1, [ 2, 1, 15, 7 ], 3 ]
1763 </pre></div>
1764
1765 <p><a id="X7E2A46D68472F492" name="X7E2A46D68472F492"></a></p>
1766
1767 <h5>66.22-3 LaurentPolynomialByExtRep</h5>
1768
1769 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LaurentPolynomialByExtRep</code>( <var class="Arg">fam</var>, <var class="Arg">cofs</var>, <var class="Arg">val</var>, <var class="Arg">ind</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1770 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LaurentPolynomialByExtRepNC</code>( <var class="Arg">fam</var>, <var class="Arg">cofs</var>, <var class="Arg">val</var>, <var class="Arg">ind</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1771 <p>creates a Laurent polynomial in the family <var class="Arg">fam</var> with [<var class="Arg">cofs</var>,<var class="Arg">val</var>] as value of <code class="func">CoefficientsOfLaurentPolynomial</code> (<a href="chap66.html#X86D58AB67F86469F"><span class="RefLink">66.13-2</span></a>). No coefficient shifting is performed. This is the lowest level function to create a Laurent polynomial but will rely on the coefficients being shifted properly and will not perform any tests. Unless this is guaranteed for the parameters, <code class="func">LaurentPolynomialByCoefficients</code> (<a href="chap66.html#X8467263B7EFA013E"><span class="RefLink">66.13-1</span></a>) should be used.</p>
1772
1773 <p><a id="X809028CD7C0EA7CE" name="X809028CD7C0EA7CE"></a></p>
1774
1775 <h4>66.23 <span class="Heading">Arithmetic for External Representations of Polynomials</span></h4>
1776
1777 <p>The following operations are used internally to perform the arithmetic for polynomials in their <q>external</q> representation (see <a href="chap66.html#X7F44CF87801DB965"><span class="RefLink">66.21</span></a>) as lists.</p>
1778
1779 <p>Functions to perform arithmetic with the coefficient lists of Laurent polynomials are described in Section <a href="chap23.html#X85C68AED805E4B9C"><span class="RefLink">23.4</span></a>.</p>
1780
1781 <p><a id="X855094857A78ABF9" name="X855094857A78ABF9"></a></p>
1782
1783 <h5>66.23-1 ZippedSum</h5>
1784
1785 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ZippedSum</code>( <var class="Arg">z1</var>, <var class="Arg">z2</var>, <var class="Arg">czero</var>, <var class="Arg">funcs</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1786 <p>computes the sum of two external representations of polynomials <var class="Arg">z1</var> and <var class="Arg">z2</var>. <var class="Arg">czero</var> is the appropriate coefficient zero and <var class="Arg">funcs</var> a list [ <var class="Arg">monomial_less</var>, <var class="Arg">coefficient_sum</var> ] containing a monomial comparison and a coefficient addition function. This list can be found in the component <var class="Arg">fam</var><code class="code">!.zippedSum</code> of the rational functions family.</p>
1787
1788 <p>Note that <var class="Arg">coefficient_sum</var> must be a proper <q>summation</q> function, not a function computing differences.</p>
1789
1790 <p><a id="X7B911136782F0F6D" name="X7B911136782F0F6D"></a></p>
1791
1792 <h5>66.23-2 ZippedProduct</h5>
1793
1794 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ZippedProduct</code>( <var class="Arg">z1</var>, <var class="Arg">z2</var>, <var class="Arg">czero</var>, <var class="Arg">funcs</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1795 <p>computes the product of two external representations of polynomials <var class="Arg">z1</var> and <var class="Arg">z2</var>. <var class="Arg">czero</var> is the appropriate coefficient zero and <var class="Arg">funcs</var> a list [ <var class="Arg">monomial_prod</var>, <var class="Arg">monomial_less</var>, <var class="Arg">coefficient_sum</var>, <var class="Arg">coefficient_prod</var>] containing functions to multiply and compare monomials, to add and to multiply coefficients. This list can be found in the component <code class="code"><var class="Arg">fam</var>!.zippedProduct</code> of the rational functions family.</p>
1796
1797 <p><a id="X87E5EB8985AF04CD" name="X87E5EB8985AF04CD"></a></p>
1798
1799 <h5>66.23-3 QuotientPolynomialsExtRep</h5>
1800
1801 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; QuotientPolynomialsExtRep</code>( <var class="Arg">fam</var>, <var class="Arg">a</var>, <var class="Arg">b</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1802 <p>Let <var class="Arg">a</var> and <var class="Arg">b</var> the external representations of two polynomials in the rational functions family <var class="Arg">fam</var>. This function computes the external representation of the quotient of both polynomials, it returns <code class="keyw">fail</code> if the polynomial described by <var class="Arg">b</var> does not divide the polynomial described by <var class="Arg">a</var>.</p>
1803
1804 <p><a id="X811B7D8E79E4BD46" name="X811B7D8E79E4BD46"></a></p>
1805
1806 <h4>66.24 <span class="Heading">Cancellation Tests for Rational Functions</span></h4>
1807
1808 <p>The operation <code class="func">Gcd</code> (<a href="chap56.html#X7DE207718456F98F"><span class="RefLink">56.7-1</span></a>) can be used to test for common factors of two polynomials. This however would be too expensive to be done in the arithmetic, thus uses the following operations internally to try to keep the denominators as small as possible</p>
1809
1810 <p><a id="X878A1AC87B492E3D" name="X878A1AC87B492E3D"></a></p>
1811
1812 <h5>66.24-1 RationalFunctionByExtRepWithCancellation</h5>
1813
1814 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RationalFunctionByExtRepWithCancellation</code>( <var class="Arg">rfam</var>, <var class="Arg">num</var>, <var class="Arg">den</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1815 <p>constructs a rational function as <code class="func">RationalFunctionByExtRep</code> (<a href="chap66.html#X81297E4587A9F2A6"><span class="RefLink">66.22-1</span></a>) does but tries to cancel out common factors of numerator and denominator, calling <code class="func">TryGcdCancelExtRepPolynomials</code> (<a href="chap66.html#X7BFB55887A153003"><span class="RefLink">66.24-2</span></a>).</p>
1816
1817 <p><a id="X7BFB55887A153003" name="X7BFB55887A153003"></a></p>
1818
1819 <h5>66.24-2 TryGcdCancelExtRepPolynomials</h5>
1820
1821 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TryGcdCancelExtRepPolynomials</code>( <var class="Arg">fam</var>, <var class="Arg">a</var>, <var class="Arg">b</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1822 <p>Let <var class="Arg">a</var> and <var class="Arg">b</var> be the external representations of two polynomials. This function tries to cancel common factors between the corresponding polynomials and returns a list <span class="SimpleMath">[ a', b' ]</span> of external representations of cancelled polynomials. As there is no proper multivariate GCD cancellation is not guaranteed to be optimal.</p>
1823
1824 <p><a id="X8477D7337C4A98AB" name="X8477D7337C4A98AB"></a></p>
1825
1826 <h5>66.24-3 HeuristicCancelPolynomialsExtRep</h5>
1827
1828 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; HeuristicCancelPolynomialsExtRep</code>( <var class="Arg">fam</var>, <var class="Arg">ext1</var>, <var class="Arg">ext2</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1829 <p>is called by <code class="func">TryGcdCancelExtRepPolynomials</code> (<a href="chap66.html#X7BFB55887A153003"><span class="RefLink">66.24-2</span></a>) to perform the actual work. It will return either <code class="keyw">fail</code> or a new list of external representations of cancelled polynomials. The cancellation performed is not necessarily optimal.</p>
1830
1831
1832 <div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap65.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap67.html">[Next Chapter]</a>&nbsp; </div>
1833
1834
1835 <div class="chlinkbot"><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="chap14.html">14</a> <a href="chap15.html">15</a> <a href="chap16.html">16</a> <a href="chap17.html">17</a> <a href="chap18.html">18</a> <a href="chap19.html">19</a> <a href="chap20.html">20</a> <a href="chap21.html">21</a> <a href="chap22.html">22</a> <a href="chap23.html">23</a> <a href="chap24.html">24</a> <a href="chap25.html">25</a> <a href="chap26.html">26</a> <a href="chap27.html">27</a> <a href="chap28.html">28</a> <a href="chap29.html">29</a> <a href="chap30.html">30</a> <a href="chap31.html">31</a> <a href="chap32.html">32</a> <a href="chap33.html">33</a> <a href="chap34.html">34</a> <a href="chap35.html">35</a> <a href="chap36.html">36</a> <a href="chap37.html">37</a> <a href="chap38.html">38</a> <a href="chap39.html">39</a> <a href="chap40.html">40</a> <a href="chap41.html">41</a> <a href="chap42.html">42</a> <a href="chap43.html">43</a> <a href="chap44.html">44</a> <a href="chap45.html">45</a> <a href="chap46.html">46</a> <a href="chap47.html">47</a> <a href="chap48.html">48</a> <a href="chap49.html">49</a> <a href="chap50.html">50</a> <a href="chap51.html">51</a> <a href="chap52.html">52</a> <a href="chap53.html">53</a> <a href="chap54.html">54</a> <a href="chap55.html">55</a> <a href="chap56.html">56</a> <a href="chap57.html">57</a> <a href="chap58.html">58</a> <a href="chap59.html">59</a> <a href="chap60.html">60</a> <a href="chap61.html">61</a> <a href="chap62.html">62</a> <a href="chap63.html">63</a> <a href="chap64.html">64</a> <a href="chap65.html">65</a> <a href="chap66.html">66</a> <a href="chap67.html">67</a> <a href="chap68.html">68</a> <a href="chap69.html">69</a> <a href="chap70.html">70</a> <a href="chap71.html">71</a> <a href="chap72.html">72</a> <a href="chap73.html">73</a> <a href="chap74.html">74</a> <a href="chap75.html">75</a> <a href="chap76.html">76</a> <a href="chap77.html">77</a> <a href="chap78.html">78</a> <a href="chap79.html">79</a> <a href="chap80.html">80</a> <a href="chap81.html">81</a> <a href="chap82.html">82</a> <a href="chap83.html">83</a> <a href="chap84.html">84</a> <a href="chap85.html">85</a> <a href="chap86.html">86</a> <a href="chap87.html">87</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
1836
1837 <hr />
1838 <p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
1839 </body>
1840 </html>