Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

610986 views
1
<!-- #################################################################### -->
2
<!-- ## ## -->
3
<!-- ## rcwamap.xml RCWA documentation Stefan Kohl ## -->
4
<!-- ## ## -->
5
<!-- #################################################################### -->
6
7
<Chapter Label="ch:RcwaMappings">
8
<Heading>Residue-Class-Wise Affine Mappings</Heading>
9
10
<Ignore Remark="settings for the example tester">
11
<Example>
12
<![CDATA[
13
gap> SizeScreen([75,24]);;
14
gap> SetAssertionLevel(0);
15
]]>
16
</Example>
17
</Ignore>
18
19
This chapter contains the basic definitions, and it describes how to
20
enter residue-class-wise affine mappings and how to compute with them. <P/>
21
22
How to compute with residue-class-wise affine groups is described in detail
23
in the next chapter. The reader is encouraged to look there already after
24
having read the first few pages of this chapter, and to look up definitions
25
as he needs to.
26
27
<!-- #################################################################### -->
28
29
<Section Label="sec:basicdefinitions">
30
<Heading>Basic definitions</Heading>
31
32
<Index Key="rcwa mapping" Subkey="definition">rcwa mapping</Index>
33
<Index Key="rcwa group" Subkey="definition">rcwa group</Index>
34
35
Residue-class-wise affine groups, or <E>rcwa</E> groups for short, are
36
permutation groups whose elements are bijective residue-class-wise affine
37
mappings. <P/>
38
39
A mapping <M>f: &ZZ; \rightarrow &ZZ;</M> is called
40
<E>residue-class-wise affine</E>, or for short an <E>rcwa</E> mapping,
41
if there is a positive integer&nbsp;<M>m</M> such that the restrictions
42
of&nbsp;<M>f</M> to the residue classes
43
<M>r(m) \in &ZZ;/m&ZZ;</M> are all affine,
44
i.e. given&nbsp;by
45
<Alt Only="LaTeX">
46
<Display>
47
f|_{r(m)}: \ r(m) \rightarrow \mathbb{Z}, \ \ \
48
n \ \mapsto \ \frac{a_{r(m)} \cdot n + b_{r(m)}}{c_{r(m)}}
49
</Display>
50
</Alt>
51
<Alt Only="HTML"><![CDATA[<center>
52
<img src = "rcwamap.png" width = "366" height = "49"
53
alt = "f|_r(m): n |-> (a_r(m) * n + b_r(m)) / c_r(m)" />
54
</center>]]></Alt>
55
<Alt Only="Text"><Verb>
56
a_r(m) * n + b_r(m)
57
f|_r(m): r(m) -> Z, n |-> -------------------
58
c_r(m)
59
</Verb></Alt>
60
for certain coefficients <M>a_{r(m)}, b_{r(m)}, c_{r(m)} \in &ZZ;</M>
61
depending on&nbsp;<M>r(m)</M>.
62
63
<Index Key="modulus" Subkey="definition">modulus</Index>
64
<Index Key="rcwa mapping" Subkey="modulus">rcwa mapping</Index>
65
<Index Key="multiplier" Subkey="definition">multiplier</Index>
66
<Index Key="rcwa mapping" Subkey="multiplier">rcwa mapping</Index>
67
<Index Key="divisor" Subkey="definition">divisor</Index>
68
<Index Key="rcwa mapping" Subkey="divisor">rcwa mapping</Index>
69
70
The smallest possible <M>m</M> is called the <E>modulus</E>
71
of&nbsp;<M>f</M>. It is understood that all fractions are reduced,
72
i.e. that <M>\gcd( a_{r(m)}, b_{r(m)}, c_{r(m)} ) = 1</M>, and that
73
<M>c_{r(m)} &gt; 0</M>. The lcm of the coefficients <M>a_{r(m)}</M>
74
is called the <E>multiplier</E> of&nbsp;<M>f</M>, and the lcm of the
75
coefficients <M>c_{r(m)}</M> is called the <E>divisor</E>
76
of&nbsp;<M>f</M>. <P/>
77
78
It is easy to see that the residue-class-wise affine mappings of&nbsp;&ZZ;
79
form a monoid under composition, and that the residue-class-wise affine
80
permutations of&nbsp;&ZZ; form a countable subgroup of Sym(&ZZ;).
81
We denote the former by Rcwa(&ZZ;), and the latter by RCWA(&ZZ;). <P/>
82
83
<Index Key="tame" Subkey="rcwa mapping">tame</Index>
84
<Index Key="tame" Subkey="rcwa group">tame</Index>
85
<Index Key="wild" Subkey="rcwa mapping">wild</Index>
86
<Index Key="wild" Subkey="rcwa group">wild</Index>
87
<Index Key="rcwa mapping" Subkey="tame">rcwa mapping</Index>
88
<Index Key="rcwa group" Subkey="tame">rcwa group</Index>
89
<Index Key="rcwa mapping" Subkey="wild">rcwa mapping</Index>
90
<Index Key="rcwa group" Subkey="wild">rcwa group</Index>
91
92
An rcwa mapping is called <E>tame</E> if the set of moduli of its powers
93
is bounded, or equivalently if it permutes a partition
94
of&nbsp;&ZZ; into finitely many residue classes on all of which
95
it is affine. An rcwa group is called <E>tame</E> if there is a common such
96
partition for all of its elements, or equivalently if the set of moduli of
97
its elements is bounded. Rcwa mappings and -groups which are not tame
98
are called <E>wild</E>. Tame rcwa mappings and -groups are something which
99
one could call the <Q>trivial cases</Q> or <Q>basic building blocks</Q>,
100
while wild rcwa groups are the objects of primary interest. <P/>
101
102
The definitions of residue-class-wise affine mappings and -groups
103
can be generalized in the obvious way to suitable rings other than&nbsp;&ZZ;.
104
In fact, this package provides also some support for residue-class-wise
105
affine groups over <M>&ZZ;^2</M>, over semilocalizations of&nbsp;&ZZ;
106
and over univariate polynomial rings over finite fields.
107
The ring <M>&ZZ;^2</M> has been chosen as an example of a suitable ring
108
which is not a principal ideal domain, the semilocalizations of&nbsp;&ZZ;
109
have been chosen as examples of rings with only finitely many prime elements,
110
and the univariate polynomial rings over finite fields have been chosen
111
as examples of rings with nonzero characteristic.
112
113
</Section>
114
115
<!-- #################################################################### -->
116
117
<Section Label="sec:EnteringRcwaMappings">
118
<Heading>Entering residue-class-wise affine mappings</Heading>
119
120
Entering an rcwa mapping of&nbsp;&ZZ; requires giving the
121
modulus&nbsp;<M>m</M> and the coefficients <M>a_{r(m)}</M>,
122
<M>b_{r(m)}</M> and&nbsp;<M>c_{r(m)}</M> for <M>r(m)</M> running over the
123
residue classes (mod&nbsp;<M>m</M>). <P/>
124
125
This can be done easiest by <C>RcwaMapping( <A>coeffs</A> )</C>, where
126
<A>coeffs</A> is a list of <M>m</M> coefficient triples
127
<C>coeffs[</C><M>r+1</M><C>]&nbsp;= [</C><M>a_{r(m)}</M>, <M>b_{r(m)}</M>,
128
<M>c_{r(m)}</M><C>]</C>, with <M>r</M> running from 0 to&nbsp;<M>m-1</M>.
129
<P/>
130
131
If some coefficient <M>c_{r(m)}</M> is zero or if images of some integers
132
under the mapping to be defined would not be integers, an error message is
133
printed and a break loop is entered. For example, the coefficient triple
134
<C>[1,4,3]</C> is not allowed at the first position.
135
The reason for this is that not all integers congruent to
136
<M>1 \cdot 0 + 4 = 4</M>&nbsp;mod&nbsp;<M>m</M>
137
are divisible by&nbsp;3. <P/>
138
139
For the general constructor for rcwa mappings, see
140
<Ref Meth="RcwaMapping" Label="by ring, modulus and list of coefficients"/>.
141
142
<Example>
143
<![CDATA[
144
gap> T := RcwaMapping([[1,0,2],[3,1,2]]); # The Collatz mapping.
145
<rcwa mapping of Z with modulus 2>
146
gap> [ IsSurjective(T), IsInjective(T) ];
147
[ true, false ]
148
gap> Display(T);
149
150
Surjective rcwa mapping of Z with modulus 2
151
152
/
153
| n/2 if n in 0(2)
154
n |-> < (3n+1)/2 if n in 1(2)
155
|
156
\
157
158
gap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);
159
<rcwa mapping of Z with modulus 3>
160
gap> IsBijective(a);
161
true
162
gap> Display(a); # This is Collatz' permutation:
163
164
Rcwa permutation of Z with modulus 3
165
166
/
167
| 2n/3 if n in 0(3)
168
n |-> < (4n-1)/3 if n in 1(3)
169
| (4n+1)/3 if n in 2(3)
170
\
171
172
gap> Support(a);
173
Z \ [ -1, 0, 1 ]
174
gap> Cycle(a,44);
175
[ 44, 59, 79, 105, 70, 93, 62, 83, 111, 74, 99, 66 ]
176
]]>
177
</Example>
178
179
<Alt Only="LaTeX">\noindent</Alt>
180
There is computational evidence for the conjecture that any
181
residue-class-wise affine permutation of&nbsp;&ZZ; can be
182
factored into members of the following three series of permutations of
183
particularly simple structure
184
(cf. <Ref Attr="FactorizationIntoCSCRCT"
185
Label="for an rcwa permutation of Z"/>):
186
187
<ManSection>
188
<Func Name="ClassShift" Arg="r, m" Label="r, m"/>
189
<Func Name="ClassShift" Arg="cl" Label="cl"/>
190
<Returns> the class shift <M>\nu_{r(m)}</M>. </Returns>
191
<Description>
192
The <E>class shift</E> <M>\nu_{r(m)}</M> is the rcwa mapping
193
of&nbsp;&ZZ; which maps <M>n \in r(m)</M> to <M>n + m</M>
194
and which fixes <M>&ZZ; \setminus r(m)</M> pointwise. <P/>
195
196
In the one-argument form, the argument&nbsp;<A>cl</A> stands for the
197
residue class&nbsp;<M>r(m)</M>. Enclosing the argument list in list
198
brackets is permitted.
199
<Example>
200
<![CDATA[
201
gap> Display(ClassShift(5,12));
202
203
Tame rcwa permutation of Z with modulus 12, of order infinity
204
205
/
206
| n+12 if n in 5(12)
207
n |-> < n if n in Z \ 5(12)
208
|
209
\
210
]]>
211
</Example>
212
</Description>
213
</ManSection>
214
215
<ManSection>
216
<Func Name="ClassReflection" Arg="r, m" Label="r, m"/>
217
<Func Name="ClassReflection" Arg="cl" Label="cl"/>
218
<Returns> the class reflection <M>\varsigma_{r(m)}</M>. </Returns>
219
<Description>
220
The <E>class reflection</E> <M>\varsigma_{r(m)}</M> is the rcwa mapping
221
of&nbsp;&ZZ; which maps <M>n \in r(m)</M> to <M>-n + 2r</M> and which
222
fixes <M>&ZZ; \setminus r(m)</M> pointwise, where it is understood that
223
<M>0 \leq r &lt; m</M>. <P/>
224
225
In the one-argument form, the argument&nbsp;<A>cl</A> stands for the
226
residue class&nbsp;<M>r(m)</M>. Enclosing the argument list in list
227
brackets is permitted.
228
<Example>
229
<![CDATA[
230
gap> Display(ClassReflection(5,9));
231
232
Rcwa permutation of Z with modulus 9, of order 2
233
234
/
235
| -n+10 if n in 5(9)
236
n |-> < n if n in Z \ 5(9)
237
|
238
\
239
]]>
240
</Example>
241
</Description>
242
</ManSection>
243
244
<Alt Only="LaTeX">\pagebreak[4]</Alt>
245
246
<ManSection>
247
<Func Name="ClassTransposition" Arg="r1, m1, r2, m2"
248
Label="r1, m1, r2, m2"/>
249
<Func Name="ClassTransposition" Arg="cl1, cl2"
250
Label="cl1, cl2"/>
251
<Returns>
252
the class transposition <M>\tau_{r_1(m_1),r_2(m_2)}</M>.
253
</Returns>
254
<Description>
255
Given two disjoint residue classes <M>r_1(m_1)</M> and <M>r_2(m_2)</M>
256
of the integers, the <E>class transposition</E>
257
<M>\tau_{r_1(m_1),r_2(m_2)}</M> <M>\in</M> RCWA(&ZZ;) is defined as the
258
involution which interchanges <M>r_1+km_1</M> and <M>r_2+km_2</M> for
259
any integer&nbsp;<M>k</M> and which fixes all other points.
260
It is understood that <M>m_1</M> and&nbsp;<M>m_2</M> are positive,
261
that <M>0 \leq r_1 &lt; m_1</M> and that <M>0 \leq r_2 &lt; m_2</M>.
262
For a <E>generalized class transposition</E>, the latter assumptions
263
are not made. <P/>
264
265
The class transposition <M>\tau_{r_1(m_1),r_2(m_2)}</M> interchanges
266
the residue classes <M>r_1(m_1)</M> and <M>r_2(m_2)</M> and fixes the
267
complement of their union pointwise. <P/>
268
269
<Index Key="TransposedClasses" Subkey="of a class transposition">
270
<C>TransposedClasses</C>
271
</Index>
272
273
In the four-argument form, the arguments <A>r1</A>, <A>m1</A>, <A>r2</A>
274
and&nbsp;<A>m2</A> stand for <M>r_1</M>, <M>m_1</M>, <M>r_2</M>
275
and&nbsp;<M>m_2</M>, respectively.
276
In the two-argument form, the arguments <A>cl1</A> and&nbsp;<A>cl2</A>
277
stand for the residue classes <M>r_1(m_1)</M> and&nbsp;<M>r_2(m_2)</M>,
278
respectively. Enclosing the argument list in list brackets is permitted.
279
The residue classes <M>r_1(m_1)</M> and <M>r_2(m_2)</M> are stored
280
as an attribute <C>TransposedClasses</C>. <P/>
281
282
<Index Key="ClassPairs" Subkey="m"><C>ClassPairs</C></Index>
283
284
A list of all class transpositions interchanging residue classes with
285
moduli less than or equal to a given bound <A>m</A> can be obtained
286
by <C>List(ClassPairs([<A>P</A>],<A>m</A>),ClassTransposition)</C>,
287
where the function <C>ClassPairs</C> returns a list of all 4-tuples
288
<M>(r_1,m_1,r_2,m_2)</M> of integers corresponding to the unordered
289
pairs of disjoint residue classes <M>r_1(m_1)</M> and <M>r_2(m_2)</M>
290
with <M>m_1</M> and <M>m_2</M> less than or equal to the specified
291
bound. If a list of primes is given as optional argument <A>P</A>,
292
then the returned list contains only those 4-tuples where all prime
293
factors of <M>m_1</M> and <M>m_2</M> lie in <A>P</A>.
294
If the option <C>divisors</C> is set, the returned list contains
295
only the 4-tuples where <M>m_1</M> and <M>m_2</M> divide <A>m</A>. <P/>
296
297
<Index Key="NrClassPairs" Subkey="m"><C>NrClassPairs</C></Index>
298
<Index Key="ExtRepOfObj" Subkey="for a class transposition">
299
<C>ExtRepOfObj</C>
300
</Index>
301
302
The function <C>NrClassPairs(<A>m</A>)</C> returns the length of the
303
list <C>ClassPairs(<A>m</A>)</C>, where the result is computed much
304
faster and without actually generating the list of tuples.
305
Given a class transposition <A>ct</A>, the corresponding 4-tuple
306
can be obtained by <C>ExtRepOfObj(<A>ct</A>)</C> <P/>
307
308
<Index Key="SplittedClassTransposition"
309
Subkey="for a class transposition and a number of factors">
310
<C>SplittedClassTransposition</C>
311
</Index>
312
313
A class transposition can be written as a product of any given number
314
<M>k</M> of class transpositions. Such a decomposition can be obtained
315
by <C>SplittedClassTransposition(<A>ct</A>,<A>k</A>)</C>. <P/>
316
<Example>
317
<![CDATA[
318
gap> Display(ClassTransposition(1,2,8,10):CycleNotation:=false);
319
320
Rcwa permutation of Z with modulus 10, of order 2
321
322
/
323
| 5n+3 if n in 1(2)
324
n |-> < (n-3)/5 if n in 8(10)
325
| n if n in 0(2) \ 8(10)
326
\
327
328
gap> List(ClassPairs(4),ClassTransposition);
329
[ ( 0(2), 1(2) ), ( 0(2), 1(4) ), ( 0(2), 3(4) ), ( 0(3), 1(3) ),
330
( 0(3), 2(3) ), ( 0(4), 1(4) ), ( 0(4), 2(4) ), ( 0(4), 3(4) ),
331
( 1(2), 0(4) ), ( 1(2), 2(4) ), ( 1(3), 2(3) ), ( 1(4), 2(4) ),
332
( 1(4), 3(4) ), ( 2(4), 3(4) ) ]
333
gap> NrClassPairs(100);
334
3528138
335
gap> SplittedClassTransposition(ClassTransposition(0,2,1,4),3);
336
[ ( 0(6), 1(12) ), ( 2(6), 5(12) ), ( 4(6), 9(12) ) ]]]>
337
</Example>
338
</Description>
339
</ManSection>
340
341
<Alt Only="LaTeX">\noindent</Alt>
342
The set of all class transpositions of the ring of integers generates the
343
simple group CT(&ZZ;) mentioned in Chapter&nbsp;<Ref Label="ch:AboutRCWA"/>.
344
This group has a representation as a &GAP; object -- see&nbsp;<Ref Func="CT"
345
Label="the group generated by all class transpositions of a ring"/>.
346
The set of all generalized class transpositions of&nbsp;&ZZ;
347
generates a simple group as well, cf.&nbsp;<Cite Key="Kohl09"/>. <P/>
348
349
Class shifts, class reflections and class transpositions of rings
350
<M>R</M> other than&nbsp;&ZZ; are defined in an entirely analogous
351
way -- all one needs to do is to replace &ZZ; by&nbsp;<M>R</M>
352
and to read <M>&lt;</M> and <M>\leq</M> in the sense of the ordering used
353
by&nbsp;&GAP;.
354
They can also be entered basically as described above -- just prepend
355
the desired ring&nbsp;<M>R</M> to the argument list. Often also a sensible
356
<Q>default ring</Q> (<M>\rightarrow</M> <C>DefaultRing</C> in the &GAP;
357
Reference Manual) is chosen if that optional first argument is omitted. <P/>
358
359
On rings which have more than two units, there is another basic series
360
of rcwa permutations which generalizes class reflections:
361
362
<ManSection>
363
<Func Name="ClassRotation" Arg="r, m, u" Label="r, m, u"/>
364
<Func Name="ClassRotation" Arg="cl, u" Label="cl, u"/>
365
<Returns> the class rotation <M>\rho_{r(m),u}</M>. </Returns>
366
<Description>
367
Given a residue class <M>r(m)</M> and a unit&nbsp;<M>u</M> of a suitable
368
ring&nbsp;<M>R</M>, the <E>class rotation</E> <M>\rho_{r(m),u}</M>
369
is the rcwa mapping which maps <M>n \in r(m)</M> to <M>un + (1-u)r</M>
370
and which fixes <M>R \setminus r(m)</M> pointwise.
371
Class rotations generalize class reflections, as we have
372
<M>\rho_{r(m),-1} = \varsigma_{r(m)}</M>. <P/>
373
374
<Index Key="RotationFactor" Subkey="of a class rotation">
375
<C>RotationFactor</C>
376
</Index>
377
378
In the two-argument form, the argument&nbsp;<A>cl</A> stands for the
379
residue class&nbsp;<M>r(m)</M>. Enclosing the argument list in list
380
brackets is permitted. The argument <A>u</A> is stored as an attribute
381
<C>RotationFactor</C>.
382
<Example>
383
<![CDATA[
384
gap> Display(ClassRotation(ResidueClass(Z_pi(2),2,1),1/3));
385
386
Tame rcwa permutation of Z_( 2 ) with modulus 2, of order infinity
387
388
/
389
| 1/3 n + 2/3 if n in 1(2)
390
n |-> < n if n in 0(2)
391
|
392
\
393
394
gap> x := Indeterminate(GF(8),1);; SetName(x,"x");
395
gap> R := PolynomialRing(GF(8),1);;
396
gap> cr := ClassRotation(1,x,Z(8)*One(R)); Support(cr);
397
ClassRotation( 1(x), Z(2^3) )
398
1(x) \ [ 1 ]
399
gap> Display(cr);
400
401
Rcwa permutation of GF(2^3)[x] with modulus x, of order 7
402
403
/
404
| Z(2^3)*P + Z(2^3)^3 if P in 1(x)
405
P |-> < P otherwise
406
|
407
\
408
]]>
409
</Example>
410
</Description>
411
</ManSection>
412
413
<Index Key="IsClassShift" Subkey="for an rcwa mapping">
414
<C>IsClassShift</C>
415
</Index>
416
<Index Key="IsClassReflection" Subkey="for an rcwa mapping">
417
<C>IsClassReflection</C>
418
</Index>
419
<Index Key="IsClassRotation" Subkey="for an rcwa mapping">
420
<C>IsClassRotation</C>
421
</Index>
422
<Index Key="IsClassTransposition" Subkey="for an rcwa mapping">
423
<C>IsClassTransposition</C>
424
</Index>
425
<Index Key="IsGeneralizedClassTransposition" Subkey="for an rcwa mapping">
426
<C>IsGeneralizedClassTransposition</C>
427
</Index>
428
429
<C>IsClassShift</C>, <C>IsClassReflection</C>,
430
<C>IsClassRotation</C>, <C>IsClassTransposition</C> and
431
<C>IsGeneralizedClassTransposition</C> are properties which indicate
432
whether a given rcwa mapping belongs to the corresponding series. <P/>
433
434
In the sequel we describe the general-purpose constructor for rcwa
435
mappings. The constructor may look a bit technical on a first glance,
436
but knowing all possible ways of entering an rcwa mapping is by no means
437
necessary for understanding this manual or for using this package.
438
439
<ManSection>
440
<Heading> RcwaMapping (the general constructor) </Heading>
441
<Meth Name="RcwaMapping" Arg="R, m, coeffs"
442
Label="by ring, modulus and list of coefficients"/>
443
<Meth Name="RcwaMapping" Arg="R, coeffs"
444
Label="by ring and list of coefficients"/>
445
<Meth Name="RcwaMapping" Arg="coeffs"
446
Label="by list of coefficients"/>
447
<Meth Name="RcwaMapping" Arg="perm, range"
448
Label="by permutation and range"/>
449
<Meth Name="RcwaMapping" Arg="m, values"
450
Label="by modulus and list of values"/>
451
<Meth Name="RcwaMapping" Arg="pi, coeffs"
452
Label="by set of non-invertible primes and list of coefficients"/>
453
<Meth Name="RcwaMapping" Arg="q, m, coeffs"
454
Label="by finite field size, modulus and list of coefficients"/>
455
<Meth Name="RcwaMapping" Arg="P1, P2"
456
Label="by two partitions of a ring into residue classes"/>
457
<Meth Name="RcwaMapping" Arg="cycles"
458
Label="by residue class cycles"/>
459
<Meth Name="RcwaMapping" Arg="expression"
460
Label="by arithmetical expression"/>
461
<Returns> an rcwa mapping. </Returns>
462
<Description>
463
In all cases the argument&nbsp;<A>R</A> is the underlying ring,
464
<A>m</A> is the modulus and <A>coeffs</A> is the coefficient list.
465
A <E>coefficient list</E> for an rcwa mapping with modulus <M>m</M>
466
consists of <M>|R/mR|</M> coefficient triples
467
<C>[</C><M>a_{r(m)}</M>, <M>b_{r(m)}</M>, <M>c_{r(m)}</M><C>]</C>.
468
Their ordering is determined by the ordering of the representatives of
469
the residue classes (mod&nbsp;<M>m</M>) in the sorted list returned by
470
<C>AllResidues(<A>R</A>, <A>m</A>)</C>. In case <M>R = &ZZ;</M>
471
this means that the coefficient triple for the residue class <M>0(m)</M>
472
comes first and is followed by the one for <M>1(m)</M>, the one for
473
<M>2(m)</M> and so on. <P/>
474
475
If one or several of the arguments <A>R</A>, <A>m</A> and
476
<A>coeffs</A> are omitted or replaced by other arguments, the former
477
are either derived from the latter or default values are chosen.
478
The meaning of the other arguments is defined in the detailed
479
description of the particular methods given in the sequel.
480
481
The above methods return the rcwa mapping
482
<List>
483
<Mark>(a)</Mark>
484
<Item>
485
of <A>R</A> with modulus <A>m</A> and coefficients <A>coeffs</A>,
486
</Item>
487
<Mark>(b)</Mark>
488
<Item>
489
of <A>R</A> = &ZZ; or <A>R</A> = <M>&ZZ;_{(\pi)}</M> with modulus
490
<C>Length(<A>coeffs</A>)</C> and coefficients <A>coeffs</A>,
491
</Item>
492
<Mark>(c)</Mark>
493
<Item>
494
of <A>R</A> = &ZZ; with modulus <C>Length(<A>coeffs</A>)</C> and
495
coefficients <A>coeffs</A>,
496
</Item>
497
<Mark>(d)</Mark>
498
<Item>
499
of <A>R</A> = &ZZ;, permuting any set
500
<C><A>range</A>+k*Length(<A>range</A>)</C> like <A>perm</A>
501
permutes <A>range</A>,
502
</Item>
503
<Mark>(e)</Mark>
504
<Item>
505
of <A>R</A> = &ZZ; with modulus <A>m</A> and values given by a list
506
<A>val</A> of 2 pairs <C>[</C>preimage<C>, </C>image<C>]</C> per
507
residue class (mod <A>m</A>),
508
</Item>
509
<Mark>(f)</Mark>
510
<Item>
511
of <A>R</A> = <M>&ZZ;_{(\pi)}</M> with modulus
512
<C>Length(<A>coeffs</A>)</C> and coefficients <A>coeffs</A>
513
(the set of primes <M>\pi</M> which denotes the underlying ring
514
is passed as argument&nbsp;<A>pi</A>),
515
</Item>
516
<Mark>(g)</Mark>
517
<Item>
518
of <A>R</A> = GF(<A>q</A>)[<A>x</A>] with modulus&nbsp;<A>m</A> and
519
coefficients <A>coeffs</A>,
520
</Item>
521
<Mark>(h)</Mark>
522
<Item>
523
an rcwa permutation which induces a bijection between
524
the partitions <A>P1</A> and <A>P2</A> of&nbsp;<A>R</A> into residue
525
classes and which is affine on the elements of <A>P1</A>,
526
</Item>
527
<Mark>(i)</Mark>
528
<Item>
529
an rcwa permutation with <Q>residue class cycles</Q> given
530
by a list <A>cycles</A> of lists of pairwise disjoint residue classes,
531
each of which it permutes cyclically, or
532
</Item>
533
<Mark>(j)</Mark>
534
<Item>
535
the rcwa permutation of&nbsp;&ZZ; given by the
536
arithmetical expression <A>expression</A> -- a string consisting of
537
class transpositions (e.g. <C>"(0(2),1(4))"</C>) or cycles permuting
538
residue classes (e.g. <C>"(0(2),1(8),3(4),5(8))"</C>), class shifts
539
(e.g. <C>"cs(4(6))"</C>, class reflections (e.g. <C>"cr(3(4))"</C>),
540
arithmetical operators (<C>"*"</C>, <C>"/"</C> and <C>"&circum;"</C>)
541
and brackets (<C>"("</C>, <C>")"</C>),
542
</Item>
543
</List>
544
respectively.
545
The methods for the operation <C>RcwaMapping</C> perform a number of
546
argument checks, which can be skipped by using <C>RcwaMappingNC</C>
547
instead.
548
<Example>
549
<![CDATA[
550
gap> R := PolynomialRing(GF(2),1);; x := X(GF(2),1);; SetName(x,"x");
551
gap> RcwaMapping(R,x+1,[[1,0,x+One(R)],[x+One(R),0,1]]*One(R)); # (a)
552
<rcwa mapping of GF(2)[x] with modulus x+1>
553
gap> RcwaMapping(Z_pi(2),[[1/3,0,1]]); # (b)
554
Rcwa mapping of Z_( 2 ): n -> 1/3 n
555
gap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]); # (c)
556
<rcwa mapping of Z with modulus 3>
557
gap> RcwaMapping((1,2,3),[1..4]); # (d)
558
( 1(4), 2(4), 3(4) )
559
gap> T = RcwaMapping(2,[[1,2],[2,1],[3,5],[4,2]]); # (e)
560
true
561
gap> RcwaMapping([2],[[1/3,0,1]]); # (f)
562
Rcwa mapping of Z_( 2 ): n -> 1/3 n
563
gap> RcwaMapping(2,x+1,[[1,0,x+One(R)],[x+One(R),0,1]]*One(R)); # (g)
564
<rcwa mapping of GF(2)[x] with modulus x+1>
565
gap> a = RcwaMapping(List([[0,3],[1,3],[2,3]],ResidueClass),
566
> List([[0,2],[1,4],[3,4]],ResidueClass)); # (h)
567
true
568
gap> RcwaMapping([List([[0,2],[1,4],[3,8],[7,16]],ResidueClass)]); # (i)
569
( 0(2), 1(4), 3(8), 7(16) )
570
gap> Cycle(last,ResidueClass(0,2));
571
[ 0(2), 1(4), 3(8), 7(16) ]
572
gap> g := RcwaMapping("((0(4),1(6))*cr(0(6)))^2/cs(2(8))"); # (j)
573
<rcwa permutation of Z with modulus 72>
574
gap> g = (ClassTransposition(0,4,1,6) * ClassReflection(0,6))^2/
575
> ClassShift(2,8);
576
true
577
]]>
578
</Example>
579
</Description>
580
</ManSection>
581
582
Rcwa mappings of &ZZ; can be <Q>translated</Q> to rcwa mappings
583
of some semilocalization <M>&ZZ;_{(\pi)}</M> of&nbsp;&ZZ;:
584
585
<ManSection>
586
<Func Name="LocalizedRcwaMapping"
587
Arg="f, p" Label="for an rcwa mapping of Z and a prime"/>
588
<Func Name="SemilocalizedRcwaMapping"
589
Arg="f, pi" Label="for an rcwa mapping of Z and a set of primes"/>
590
<Returns>
591
the rcwa mapping of <M>&ZZ;_{(p)}</M> respectively
592
<M>&ZZ;_{(\pi)}</M> with the same coefficients as the rcwa mapping
593
<A>f</A> of&nbsp;&ZZ;.
594
</Returns>
595
<Description>
596
The argument <A>p</A> or <A>pi</A> must be a prime or a set of primes,
597
respectively. The argument&nbsp;<A>f</A> must be an rcwa mapping
598
of&nbsp;&ZZ; whose modulus is a power of&nbsp;<A>p</A>,
599
or whose modulus has only prime divisors which lie in&nbsp;<A>pi</A>,
600
respectively.
601
<Example>
602
<![CDATA[
603
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
604
gap> Cycle(LocalizedRcwaMapping(T,2),131/13);
605
[ 131/13, 203/13, 311/13, 473/13, 716/13, 358/13, 179/13, 275/13,
606
419/13, 635/13, 959/13, 1445/13, 2174/13, 1087/13, 1637/13, 2462/13,
607
1231/13, 1853/13, 2786/13, 1393/13, 2096/13, 1048/13, 524/13, 262/13 ]
608
]]>
609
</Example>
610
</Description>
611
</ManSection>
612
613
<Index Key="View" Subkey="for an rcwa mapping"><C>View</C></Index>
614
<Index Key="Display" Subkey="for an rcwa mapping"><C>Display</C></Index>
615
<Index Key="Print" Subkey="for an rcwa mapping"><C>Print</C></Index>
616
<Index Key="String" Subkey="for an rcwa mapping"><C>String</C></Index>
617
618
<Alt Only="LaTeX">\noindent</Alt>
619
Rcwa mappings can be <C>View</C>ed, <C>Display</C>ed, <C>Print</C>ed and
620
written to a <C>String</C>. The output of the <C>View</C> method is kept
621
reasonably short. In most cases it does not describe an rcwa mapping
622
completely. In these cases the output is enclosed in brackets.
623
There are options <C>CycleNotation</C>, <C>AsClassMapping</C>,
624
<C>PrintNotation</C> and <C>AbridgedNotation</C> to take influence on
625
how certain rcwa mappings are shown. These options can either be not set,
626
set to <C>true</C> or set to <C>false</C>.
627
If the option <C>CycleNotation</C> is set, it is tried harder to write
628
down an rcwa permutation of &ZZ; of finite order as a product of disjoint
629
residue class cycles, if this is possible.
630
If the option <C>AsClassMapping</C> is set, <C>Display</C> shows
631
which residue classes are mapped to which by the affine partial mappings,
632
and marks any loops.
633
The option <C>PrintNotation</C> influences the output in favour of
634
&GAP; - readability, and the option <C>AbridgedNotation</C> can be used to
635
abridge longer names like <C>ClassShift</C>, <C>ClassReflection</C> etc..
636
By default, the output of the methods for <C>Display</C> and <C>Print</C>
637
describes an rcwa mapping in full. The <C>Print</C>ed representation of
638
an rcwa mapping is &GAP; - readable if and only if the <C>Print</C>ed
639
representation of the elements of the underlying ring is so. <P/>
640
641
<Index Key="LaTeXStringRcwaMapping" Subkey="for an rcwa mapping">
642
<C>LaTeXStringRcwaMapping</C>
643
</Index>
644
645
There is also an operation <C>LaTeXStringRcwaMapping</C>, which takes
646
as argument an rcwa mapping and returns a corresponding
647
&LaTeX; string. The output makes use of the &LaTeX; macro package
648
<Package>amsmath</Package>. If the option <A>Factorization</A> is set
649
and the argument is bijective, a factorization into class shifts,
650
class reflections, class transpositions and prime switches is printed
651
(cf. <Ref Attr="FactorizationIntoCSCRCT"
652
Label="for an rcwa permutation of Z"/>).
653
For rcwa mappings with modulus greater than&nbsp;1, an indentation by
654
<A>Indentation</A> characters can be obtained by setting this option
655
value accordingly.
656
657
<Example>
658
<![CDATA[
659
gap> Print(LaTeXStringRcwaMapping(T));
660
n \ \mapsto \
661
\begin{cases}
662
n/2 & \text{if} \ n \in 0(2), \\
663
(3n+1)/2 & \text{if} \ n \in 1(2).
664
\end{cases}
665
]]>
666
</Example>
667
668
<Index Key="LaTeXAndXDVI" Subkey="for an rcwa mapping">
669
<C>LaTeXAndXDVI</C>
670
</Index>
671
672
There is an operation <C>LaTeXAndXDVI</C> which displays an rcwa mapping
673
in an <Package>xdvi</Package> window.
674
This works as follows: The string returned by <C>LaTeXStringRcwaMapping</C>
675
is inserted into a &LaTeX; template file. This file is &LaTeX;'ed, and the
676
result is shown with <Package>xdvi</Package>.
677
Calling <C>Display</C> with option <A>xdvi</A> has the same effect.
678
The operation <C>LaTeXAndXDVI</C> is only available on UNIX systems,
679
and requires suitable installations of &LaTeX; and <Package>xdvi</Package>.
680
681
</Section>
682
683
<!-- #################################################################### -->
684
685
<Section Label="sec:BasicArithmeticForRcwaMappings">
686
<Heading>Basic arithmetic for residue-class-wise affine mappings</Heading>
687
688
<Index Key="rcwa mapping" Subkey="arithmetic operations">rcwa mapping</Index>
689
<Index Key="Order" Subkey="of an rcwa permutation"><C>Order</C></Index>
690
<Index Key="IsTame" Subkey="for an rcwa mapping"><C>IsTame</C></Index> <P/>
691
692
Testing rcwa mappings for equality requires only comparing their
693
coefficient lists, hence is cheap.
694
Rcwa mappings can be multiplied, thus there is a method for <C>*</C>.
695
Rcwa permutations can also be inverted, thus there is a method for
696
<C>Inverse</C>. The latter method is usually accessed by raising a mapping
697
to a power with negative exponent. Multiplying, inverting and computing
698
powers of tame rcwa mappings is cheap. Computing powers of wild mappings
699
is usually expensive -- run time and memory requirements normally grow
700
approximately exponentially with the exponent. How expensive multiplying
701
a couple of wild mappings is, varies very much. In any case, the amount of
702
memory required for storing an rcwa mapping is proportional to its modulus.
703
Whether a given mapping is tame or wild can be determined by the operation
704
<C>IsTame</C>. There is a method for <C>Order</C>, which can not only
705
compute a finite order, but which can also detect infinite order.
706
707
<Example>
708
<![CDATA[
709
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
710
gap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; # Collatz' permutation.
711
gap> List([-4..4],k->Modulus(a^k));
712
[ 256, 64, 16, 4, 1, 3, 9, 27, 81 ]
713
gap> IsTame(T) or IsTame(a);
714
false
715
gap> IsTame(ClassShift(0,1)) and IsTame(ClassTransposition(0,2,1,2));
716
true
717
gap> T^2*a*T*a^-3;
718
<rcwa mapping of Z with modulus 768>
719
gap> (ClassShift(1,3)*ClassReflection(2,7))^1000000;
720
<rcwa permutation of Z with modulus 21>
721
]]>
722
</Example>
723
724
<Index Key="IsInjective" Subkey="for an rcwa mapping">
725
<C>IsInjective</C>
726
</Index>
727
<Index Key="IsSurjective" Subkey="for an rcwa mapping">
728
<C>IsSurjective</C>
729
</Index>
730
<Index Key="IsBijective" Subkey="for an rcwa mapping">
731
<C>IsBijective</C>
732
</Index>
733
<Index Key="Image" Subkey="of an rcwa mapping">
734
<C>Image</C>
735
</Index>
736
737
There are methods installed for <C>IsInjective</C>, <C>IsSurjective</C>,
738
<C>IsBijective</C> and <C>Image</C>.
739
740
<Example>
741
<![CDATA[
742
gap> [ IsInjective(T), IsSurjective(T), IsBijective(a) ];
743
[ false, true, true ]
744
gap> Image(RcwaMapping([[2,0,1]]));
745
0(2)
746
]]>
747
</Example>
748
749
<Index Key="rcwa mapping" Subkey="images under">rcwa mapping</Index>
750
751
Images of elements, of finite sets of elements and of unions of finitely
752
many residue classes of the source of an rcwa mapping can be computed with
753
<C>&circum;</C>, the same symbol as used for exponentiation and conjugation.
754
The same works for partitions of the source into a finite number of
755
residue classes.
756
757
<Example>
758
<![CDATA[
759
gap> 15^T;
760
23
761
gap> ResidueClass(1,2)^T;
762
2(3)
763
gap> List([[0,3],[1,3],[2,3]],ResidueClass)^a;
764
[ 0(2), 1(4), 3(4) ]
765
]]>
766
</Example>
767
768
<Index Key="PreImageElm" Subkey="of a ring element under an rcwa mapping">
769
<C>PreImageElm</C>
770
</Index>
771
<Index Key="PreImagesElm" Subkey="of a ring element under an rcwa mapping">
772
<C>PreImagesElm</C>
773
</Index>
774
<Index Key="PreImage"
775
Subkey="of a set of ring elements under an rcwa mapping">
776
<C>PreImage</C>
777
</Index>
778
<Index Key="PreImage"
779
Subkey="of a residue class union under an rcwa mapping">
780
<C>PreImage</C>
781
</Index>
782
783
For computing preimages of elements under rcwa mappings,
784
there are methods for <C>PreImageElm</C> and <C>PreImagesElm</C>.
785
The preimage of a finite set of ring elements or of a union of finitely
786
many residue classes under an rcwa mapping can be computed by
787
<C>PreImage</C>.
788
789
<Example>
790
<![CDATA[
791
gap> PreImagesElm(T,8);
792
[ 5, 16 ]
793
gap> PreImage(T,ResidueClass(Integers,3,2));
794
Z \ 0(6) U 2(6)
795
gap> M := [1];; l := [1];;
796
gap> while Length(M) < 5000 do M := PreImage(T,M); Add(l,Length(M)); od; l;
797
[ 1, 1, 2, 2, 4, 5, 8, 10, 14, 18, 26, 36, 50, 67, 89, 117, 157, 208,
798
277, 367, 488, 649, 869, 1154, 1534, 2039, 2721, 3629, 4843, 6458 ]
799
]]>
800
</Example>
801
802
<Index Key="Support" Subkey="of an rcwa mapping">
803
<C>Support</C>
804
</Index>
805
<Index Key="MovedPoints" Subkey="of an rcwa mapping">
806
<C>MovedPoints</C>
807
</Index>
808
<Index Key="RestrictedPerm"
809
Subkey="for an rcwa permutation and a residue class union">
810
<C>RestrictedPerm</C>
811
</Index>
812
<Index Key="DensityOfSupport"
813
Subkey="of an rcwa mapping">
814
<C>DensityOfSupport</C>
815
</Index>
816
<Index Key="DensityOfSetOfFixedPoints"
817
Subkey="of an rcwa mapping">
818
<C>DensityOfSetOfFixedPoints</C>
819
</Index>
820
821
There is a method for the operation <C>Support</C> for computing the
822
support of an rcwa mapping. A synonym for <C>Support</C> is
823
<C>MovedPoints</C>. The natural density of the support of an rcwa mapping
824
of &ZZ; can be computed efficiently with the operation <C>DensityOfSupport</C>.
825
Likewise, the natural density of the set of fixed points of an rcwa mapping
826
of &ZZ; can be computed efficiently with the operation
827
<C>DensityOfSetOfFixedPoints</C>.
828
There is also a method for <C>RestrictedPerm</C>
829
for computing the restriction of an rcwa permutation to a union
830
of residue classes which it fixes setwise.
831
832
<Example>
833
<![CDATA[
834
gap> List([a,a^2],Support);
835
[ Z \ [ -1, 0, 1 ], Z \ [ -3, -2, -1, 0, 1, 2, 3 ] ]
836
gap> RestrictedPerm(ClassShift(0,2)*ClassReflection(1,2),
837
> ResidueClass(0,2));
838
<rcwa mapping of Z with modulus 2>
839
gap> last = ClassShift(0,2);
840
true
841
]]>
842
</Example>
843
844
Rcwa mappings can be added and subtracted pointwise. However, please note
845
that the set of rcwa mappings of a ring does not form a ring under
846
<C>+</C> and <C>*</C>. <P/>
847
848
<Example>
849
<![CDATA[
850
gap> b := ClassShift(0,3) * a;;
851
gap> [ Image((a + b)), Image((a - b)) ];
852
[ 2(4), [ -2, 0 ] ]
853
]]>
854
</Example>
855
856
<Index Key="Modulus" Subkey="of an rcwa mapping"><C>Modulus</C></Index>
857
<Index Key="Mod" Subkey="for an rcwa mapping"><C>Mod</C></Index>
858
<Index Key="Coefficients" Subkey="of an rcwa mapping">
859
<C>Coefficients</C>
860
</Index>
861
<Index Key="rcwa mapping" Subkey="coercion">rcwa mapping</Index>
862
<Index Key="rcwa group" Subkey="coercion">rcwa group</Index>
863
864
There are operations <C>Modulus</C> (abbreviated <C>Mod</C>) and
865
<C>Coefficients</C> for retrieving the modulus and the coefficient list
866
of an rcwa mapping. The meaning of the return values is as described
867
in Section&nbsp;<Ref Label="sec:EnteringRcwaMappings"/>. <P/>
868
869
General documentation for most operations mentioned in this section can
870
be found in the &GAP; reference manual. For rcwa mappings of rings other
871
than&nbsp;&ZZ;, not for all operations applicable methods are
872
available. <P/>
873
874
As in general a subring relation <M>R_1&lt;R_2</M> does <E>not</E> give
875
rise to a natural embedding of RCWA(<M>R_1</M>) into RCWA(<M>R_2</M>),
876
there is no coercion between rcwa mappings or rcwa groups over different
877
rings.
878
879
</Section>
880
881
<!-- #################################################################### -->
882
883
<Section Label="sec:AttributesAndPropertiesOfRcwaMappings">
884
<Heading>
885
Attributes and properties of residue-class-wise affine mappings
886
</Heading>
887
888
<Index Key="class-wise translating" Subkey="definition">
889
class-wise translating
890
</Index>
891
<Index Key="integral" Subkey="definition">integral</Index>
892
<Index Key="balanced" Subkey="definition">balanced</Index>
893
<Index Key="sign-preserving" Subkey="definition">sign-preserving</Index>
894
<Index Key="maximal shift" Subkey="definition">maximal shift</Index>
895
896
<Index Key="rcwa mapping" Subkey="prime set">rcwa mapping</Index>
897
<Index Key="rcwa mapping" Subkey="maximal shift">rcwa mapping</Index>
898
<Index Key="rcwa mapping" Subkey="class-wise translating">
899
rcwa mapping
900
</Index>
901
<Index Key="rcwa mapping" Subkey="integral">rcwa mapping</Index>
902
<Index Key="rcwa mapping" Subkey="balanced">rcwa mapping</Index>
903
<Index Key="rcwa mapping"
904
Subkey="class-wise order-preserving">
905
rcwa mapping
906
</Index>
907
<Index Key="rcwa mapping" Subkey="sign-preserving">rcwa mapping</Index>
908
909
<Index Key="Multiplier" Subkey="of an rcwa mapping"><C>Multiplier</C></Index>
910
<Index Key="Mult" Subkey="for an rcwa mapping"><C>Mult</C></Index>
911
<Index Key="Divisor" Subkey="of an rcwa mapping"><C>Divisor</C></Index>
912
<Index Key="Div" Subkey="for an rcwa mapping"><C>Div</C></Index>
913
<Index Key="PrimeSet" Subkey="of an rcwa mapping"><C>PrimeSet</C></Index>
914
<Index Key="MaximalShift" Subkey="of an rcwa mapping of Z">
915
<C>MaximalShift</C>
916
</Index>
917
918
<Index Key="IsClassWiseTranslating" Subkey="for an rcwa mapping">
919
<C>IsClassWiseTranslating</C>
920
</Index>
921
<Index Key="IsIntegral" Subkey="for an rcwa mapping">
922
<C>IsIntegral</C>
923
</Index>
924
<Index Key="IsBalanced" Subkey="for an rcwa mapping">
925
<C>IsBalanced</C>
926
</Index>
927
<Index Key="IsClassWiseOrderPreserving" Subkey="for an rcwa mapping">
928
<C>IsClassWiseOrderPreserving</C>
929
</Index>
930
<Index Key="IsSignPreserving" Subkey="for an rcwa mapping">
931
<C>IsSignPreserving</C>
932
</Index>
933
934
A number of basic attributes and properties of an rcwa mapping are derived
935
immediately from the coefficients of its affine partial mappings. This holds
936
for example for the multiplier and the divisor. These two values are stored
937
as attributes <C>Multiplier</C> and <C>Divisor</C>, or for short <C>Mult</C>
938
and <C>Div</C>. The <E>prime set</E> of an rcwa mapping is the set of
939
prime divisors of the product of its modulus and its multiplier.
940
It is stored as an attribute <C>PrimeSet</C>.
941
The <E>maximal shift</E> of an rcwa mapping of &ZZ; is the maximum of
942
the absolute values of its coefficients <M>b_{r(m)}</M> in the notation
943
introduced in Section&nbsp;<Ref Label="sec:basicdefinitions"/>.
944
It is stored as an attribute <C>MaximalShift</C>.
945
An rcwa mapping is called <E>class-wise translating</E> if all of its affine
946
partial mappings are translations, it is called <E>integral</E> if its
947
divisor equals&nbsp;1, and it is called <E>balanced</E> if its multiplier
948
and its divisor have the same prime divisors. A class-wise translating
949
mapping has the property <C>IsClassWiseTranslating</C>, an integral mapping
950
has the property <C>IsIntegral</C> and a balanced mapping has the property
951
<C>IsBalanced</C>.
952
An rcwa mapping of the ring of integers or of one of its semilocalizations
953
is called <E>class-wise order-preserving</E> if and only if all coefficients
954
<M>a_{r(m)}</M> (cf.&nbsp;Section&nbsp;<Ref Label="sec:basicdefinitions"/>)
955
in the numerators of the affine partial mappings are positive.
956
The corresponding property is <C>IsClassWiseOrderPreserving</C>.
957
An rcwa mapping of&nbsp;&ZZ; is called <E>sign-preserving</E> if
958
it does not map nonnegative integers to negative integers or vice versa.
959
The corresponding property is <C>IsSignPreserving</C>. All elements of the
960
simple group CT(&ZZ;) generated by the set of all class transpositions are
961
sign-preserving.
962
963
<Example>
964
<![CDATA[
965
gap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;
966
gap> IsBijective(u);; Display(u);
967
968
Rcwa permutation of Z with modulus 5
969
970
/
971
| 3n/5 if n in 0(5)
972
| (9n+1)/5 if n in 1(5)
973
n |-> < (3n-1)/5 if n in 2(5)
974
| (9n-2)/5 if n in 3(5)
975
| (9n+4)/5 if n in 4(5)
976
\
977
978
gap> Multiplier(u);
979
9
980
gap> Divisor(u);
981
5
982
gap> PrimeSet(u);
983
[ 3, 5 ]
984
gap> IsIntegral(u) or IsBalanced(u);
985
false
986
gap> IsClassWiseOrderPreserving(u) and IsSignPreserving(u);
987
true
988
]]>
989
</Example>
990
991
There are a couple of further attributes and operations related to the
992
affine partial mappings of an rcwa mapping:
993
994
<ManSection>
995
<Attr Name="LargestSourcesOfAffineMappings"
996
Arg="f" Label="for an rcwa mapping"/>
997
<Returns>
998
the coarsest partition of <C>Source(<A>f</A>)</C> on whose
999
elements the rcwa mapping&nbsp;<A>f</A> is affine.
1000
</Returns>
1001
<Description>
1002
<Example>
1003
<![CDATA[
1004
gap> LargestSourcesOfAffineMappings(ClassShift(3,7));
1005
[ Z \ 3(7), 3(7) ]
1006
gap> LargestSourcesOfAffineMappings(ClassReflection(0,1));
1007
[ Integers ]
1008
gap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;
1009
gap> List( [ u, u^-1 ], LargestSourcesOfAffineMappings );
1010
[ [ 0(5), 1(5), 2(5), 3(5), 4(5) ], [ 0(3), 1(3), 2(9), 5(9), 8(9) ] ]
1011
gap> kappa := ClassTransposition(2,4,3,4) * ClassTransposition(4,6,8,12)
1012
> * ClassTransposition(3,4,4,6);
1013
<rcwa permutation of Z with modulus 12>
1014
gap> LargestSourcesOfAffineMappings(kappa);
1015
[ 2(4), 1(4) U 0(12), 3(12) U 7(12), 4(12), 8(12), 11(12) ]
1016
]]>
1017
</Example>
1018
</Description>
1019
</ManSection>
1020
1021
<ManSection>
1022
<Attr Name="FixedPointsOfAffinePartialMappings"
1023
Arg="f" Label="for an rcwa mapping"/>
1024
<Returns>
1025
a list of the sets of fixed points of the affine partial mappings of
1026
the rcwa mapping&nbsp;<A>f</A> in the quotient field of its source.
1027
</Returns>
1028
<Description>
1029
The returned list contains entries for the restrictions
1030
of&nbsp;<A>f</A> to all residue classes modulo <C>Mod(<A>f</A>)</C>.
1031
A list entry can either be an empty set, the source of&nbsp;<A>f</A>
1032
or a set of cardinality&nbsp;1. The ordering of the entries corresponds
1033
to the ordering of the residues in
1034
<C>AllResidues(Source(<A>f</A>),<A>m</A>)</C>.
1035
<Example>
1036
<![CDATA[
1037
gap> FixedPointsOfAffinePartialMappings(ClassShift(0,2));
1038
[ [ ], Rationals ]
1039
gap> List([1..3],k->FixedPointsOfAffinePartialMappings(T^k));
1040
[ [ [ 0 ], [ -1 ] ], [ [ 0 ], [ 1 ], [ 2 ], [ -1 ] ],
1041
[ [ 0 ], [ -7 ], [ 2/5 ], [ -5 ], [ 4/5 ], [ 1/5 ], [ -10 ], [ -1 ] ] ]
1042
]]>
1043
</Example>
1044
</Description>
1045
</ManSection>
1046
1047
<ManSection>
1048
<Oper Name="Multpk" Arg="f, p, k"
1049
Label="for an rcwa mapping, a prime and an exponent"/>
1050
<Returns>
1051
the union of the residue classes <M>r(m)</M> such that
1052
<M>p^k||a_{r(m)}</M> if <M>k \geq 0</M>, and the union of the residue
1053
classes <M>r(m)</M> such that <M>p^k||c_{r(m)}</M> if <M>k \leq 0</M>.
1054
In this context, <M>m</M> denotes the modulus of&nbsp;<A>f</A>, and
1055
<M>a_{r(m)}</M> and <M>c_{r(m)}</M> denote the coefficients
1056
of&nbsp;<A>f</A> as introduced in
1057
Section&nbsp;<Ref Label="sec:basicdefinitions"/>.
1058
</Returns>
1059
<Description>
1060
<Example>
1061
<![CDATA[
1062
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
1063
gap> [ Multpk(T,2,-1), Multpk(T,3,1) ];
1064
[ Integers, 1(2) ]
1065
gap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;
1066
gap> [ Multpk(u,3,0), Multpk(u,3,1), Multpk(u,3,2), Multpk(u,5,-1) ];
1067
[ [ ], 0(5) U 2(5), Z \ 0(5) U 2(5), Integers ]
1068
]]>
1069
</Example>
1070
</Description>
1071
</ManSection>
1072
1073
<Index Key="ClassWiseOrderPreservingOn">
1074
<C>ClassWiseOrderPreservingOn</C>
1075
</Index>
1076
<Index Key="ClassWiseConstantOn">
1077
<C>ClassWiseConstantOn</C>
1078
</Index>
1079
<Index Key="ClassWiseOrderReversingOn">
1080
<C>ClassWiseOrderReversingOn</C>
1081
</Index>
1082
1083
There are attributes <C>ClassWiseOrderPreservingOn</C>,
1084
<C>ClassWiseConstantOn</C> and <C>ClassWiseOrderReversingOn</C> which
1085
store the union of the residue classes (mod&nbsp;<C>Mod(<A>f</A>)</C>) on
1086
which an rcwa mapping&nbsp;<A>f</A> of&nbsp;&ZZ; or of a semilocalization
1087
thereof is class-wise order-preserving, class-wise constant or class-wise
1088
order-reversing, respectively.
1089
1090
<Example>
1091
<![CDATA[
1092
gap> List([ClassTransposition(1,2,0,4),ClassShift(2,3),
1093
> ClassReflection(2,5)],ClassWiseOrderPreservingOn);
1094
[ Integers, Integers, Z \ 2(5) ]
1095
]]>
1096
</Example>
1097
1098
<Index Key="ShiftsUpOn"><C>ShiftsUpOn</C></Index>
1099
<Index Key="ShiftsDownOn"><C>ShiftsDownOn</C></Index>
1100
1101
Also there are attributes <C>ShiftsUpOn</C> and <C>ShiftsDownOn</C>
1102
which store the union of the residue classes
1103
(mod&nbsp;<C>Mod(<A>f</A>)</C>) on which an rcwa mapping&nbsp;<A>f</A>
1104
of&nbsp;&ZZ; induces affine mappings <M>n \mapsto n + c</M> for
1105
<M>c &gt; 0</M>, respectively, <M>c &lt; 0</M>. <P/>
1106
1107
Finally, there are epimorphisms from the subgroup of RCWA(&ZZ;)
1108
formed by all class-wise order-preserving elements to (&ZZ;,+)
1109
and from RCWA(&ZZ;) itself to the cyclic group of order&nbsp;2,
1110
respectively:
1111
1112
<ManSection>
1113
<Meth Name="Determinant" Arg="f" Label="of an rcwa mapping of Z"/>
1114
<Returns>
1115
the determinant of the rcwa mapping&nbsp;<A>f</A> of&nbsp;&ZZ;.
1116
</Returns>
1117
<Description>
1118
The <E>determinant</E> of an affine mapping <M>n \mapsto (an+b)/c</M>
1119
whose source is a residue class <M>r(m)</M> is defined by <M>b/|a|m</M>.
1120
This definition is extended additively to determinants of rcwa mappings.
1121
<P/>
1122
1123
Let <M>f</M> be an rcwa mapping of the integers, and let
1124
<M>m</M> denote its modulus. Using the notation
1125
<M>f|_{r(m)}: n \mapsto (a_{r(m)} \cdot n + b_{r(m)})/c_{r(m)}</M>
1126
for the affine partial mappings, the <E>determinant</E> det(<M>f</M>)
1127
of&nbsp;<M>f</M> is given by
1128
<Alt Only="LaTeX">
1129
<Display>
1130
\sum_{r(m) \in \mathbb{Z}/m\mathbb{Z}} b_{r(m)}/(|a_{r(m)}| \cdot m).
1131
</Display>
1132
</Alt>
1133
<Alt Only="HTML"><![CDATA[<center>
1134
<img src = "det.png" width = "177" height = "58"
1135
alt = "sum_{r(m) in Z/mZ}
1136
b_{r(m)}/(|a_{r(m)}| \cdot m)."/>
1137
</center>]]></Alt>
1138
<Alt Only="Text"><Verb>
1139
-----
1140
\ b_r(m)
1141
> --------------
1142
/ |a_{r(m)}| * m
1143
-----
1144
r(m) in Z/mZ .
1145
</Verb></Alt>
1146
The determinant mapping is an epimorphism from the group of all
1147
class-wise order-preserving rcwa permutations of&nbsp;&ZZ;
1148
to (&ZZ;,+), see&nbsp;<Cite Key="Kohl05"/>, Theorem&nbsp;2.11.9.
1149
<Example>
1150
<![CDATA[
1151
gap> List([ClassTransposition(0,4,5,12),ClassShift(3,7)],Determinant);
1152
[ 0, 1 ]
1153
gap> Determinant(ClassTransposition(0,4,5,12)*ClassShift(3,7)^100);
1154
100
1155
]]>
1156
</Example>
1157
</Description>
1158
</ManSection>
1159
1160
<ManSection>
1161
<Attr Name="Sign" Arg="g" Label="of an rcwa permutation of Z"/>
1162
<Returns>
1163
the sign of the rcwa permutation&nbsp;<A>g</A> of&nbsp;&ZZ;.
1164
</Returns>
1165
<Description>
1166
Let <M>\sigma</M> be an rcwa permutation of the integers, and let
1167
<M>m</M> denote its modulus. Using the notation
1168
<M>\sigma|_{r(m)}: n \mapsto (a_{r(m)} \cdot n + b_{r(m)})/c_{r(m)}</M>
1169
for the affine partial mappings, the <E>sign</E> of&nbsp;<M>\sigma</M>
1170
is defined by
1171
<Alt Only="LaTeX">
1172
<Display>
1173
(-1)^{\displaystyle{{\rm det}(\sigma)
1174
+ \sum_{r(m): \ a_{r(m)} &lt; 0} \frac{m - 2r}{m}}}.
1175
</Display>
1176
</Alt>
1177
<Alt Only="HTML"><![CDATA[<center>
1178
<img src = "sgn.png" width = "284" height = "63"
1179
alt = "(-1)^(det(sigma)
1180
+ sum_{r(m): \ a_{r(m)} &lt; 0} (m - 2r)/m)."/>
1181
</center>]]></Alt>
1182
<Alt Only="Text"><Verb>
1183
-----
1184
\ m - 2r
1185
det(sigma) + > -------
1186
/ m
1187
-----
1188
a_r(m) &lt; 0
1189
(-1) .
1190
</Verb></Alt>
1191
The sign mapping is an epimorphism from RCWA(&ZZ;) to the group
1192
<M>&ZZ;^\times</M> of units of&nbsp;&ZZ;, see&nbsp;<Cite Key="Kohl05"/>,
1193
Theorem&nbsp;2.12.8. Therefore the kernel of the sign mapping is a normal
1194
subgroup of RCWA(&ZZ;) of index&nbsp;2. The simple group CT(&ZZ;) is
1195
a subgroup of this kernel.
1196
<Example>
1197
<![CDATA[
1198
gap> List([ClassTransposition(3,4,2,6),
1199
> ClassShift(0,3),ClassReflection(2,5)],Sign);
1200
[ 1, -1, -1 ]
1201
]]>
1202
</Example>
1203
</Description>
1204
</ManSection>
1205
1206
</Section>
1207
1208
<!-- #################################################################### -->
1209
1210
<Section Label="sec:FactoringRcwaMappings">
1211
<Heading>Factoring residue-class-wise affine permutations</Heading>
1212
1213
Factoring group elements into the members of some <Q>nice</Q> set of
1214
generators is often helpful. In this section we describe an operation which
1215
attempts to solve this problem for the group RCWA(&ZZ;).
1216
Elements of finitely generated rcwa groups can be factored into generators
1217
<Q>as usual</Q>, see&nbsp;<Ref Meth="PreImagesRepresentative"
1218
Label="for an epi. from a free group to an rcwa group"/>.
1219
1220
<ManSection>
1221
<Attr Name="FactorizationIntoCSCRCT"
1222
Arg="g" Label="for an rcwa permutation of Z"/>
1223
<Meth Name="Factorization" Arg="g" Label="for an rcwa permutation of Z"/>
1224
<Returns>
1225
a factorization of the rcwa permutation&nbsp;<A>g</A> of&nbsp;&ZZ;
1226
into class shifts, class reflections and class transpositions, provided
1227
that such a factorization exists and the method finds it.
1228
</Returns>
1229
<Description>
1230
The method may return <C>fail</C>, stop with an error message or run
1231
into an infinite loop. If it returns a result, this result is always
1232
correct. <P/>
1233
1234
The problem of obtaining a factorization as described is algorithmically
1235
difficult, and this factorization routine is currently perhaps the most
1236
sophisticated part of the &RCWA; package. Information about the
1237
progress of the factorization process can be obtained by setting the
1238
info level of the Info class <Ref InfoClass="InfoRCWA"/> to&nbsp;2. <P/>
1239
1240
By default, prime switches (<M>\rightarrow</M>
1241
<Ref Func="PrimeSwitch" Label="p"/>) are taken as one factor.
1242
If the option <A>ExpandPrimeSwitches</A> is set, they are each
1243
decomposed into the 6 class transpositions given in the definition. <P/>
1244
1245
By default, the factoring process begins with splitting off factors
1246
from the right. This can be changed by setting the option
1247
<A>Direction</A> to <C>"from the left"</C>. <P/>
1248
1249
By default, a reasonably coarse respected partition of the integral
1250
mapping occurring in the final stage of the algorithm is computed.
1251
This can be suppressed by setting the option <A>ShortenPartition</A>
1252
equal to <C>false</C>. <P/>
1253
1254
By default, at the end it is checked whether the product of the
1255
determined factors indeed equals <A>g</A>. This check can be
1256
suppressed by setting the option <A>NC</A>.
1257
<Example>
1258
<![CDATA[
1259
gap> Factorization(Comm(ClassShift(0,3)*ClassReflection(1,2),
1260
> ClassShift(0,2)));
1261
[ ClassReflection( 2(3) ), ClassShift( 2(6) )^-1, ( 0(6), 2(6) ),
1262
( 0(6), 5(6) ) ]
1263
]]>
1264
</Example>
1265
</Description>
1266
</ManSection>
1267
1268
For purposes of demonstrating the capabilities of the factorization routine,
1269
in Section&nbsp;<Ref Label="sec:FactoringTheCollatzPermutation"/>
1270
Collatz' permutation is factored. Lothar Collatz has investigated this
1271
permutation in&nbsp;1932. Its cycle structure is unknown so far. <P/>
1272
1273
The permutations of the following kind play an important role in
1274
factoring rcwa permutations of&nbsp;&ZZ; into class shifts,
1275
class reflections and class transpositions:
1276
1277
<ManSection>
1278
<Meth Name="PrimeSwitch" Arg="p" Label="p"/>
1279
<Meth Name="PrimeSwitch" Arg="p, k" Label="p, k"/>
1280
<Meth Name="PrimeSwitch" Arg="p, r, m" Label="p, r, m"/>
1281
<Meth Name="PrimeSwitch" Arg="p, cl" Label="p, cl"/>
1282
<Returns>
1283
in the first form the <E>prime switch</E>
1284
<M>\sigma_p := \tau_{0(8),1(2p)} \cdot \tau_{4(8),-1(2p)} \cdot
1285
\tau_{0(4),1(2p)} \cdot \tau_{2(4),-1(2p)} \cdot \tau_{2(2p),1(4p)}
1286
\cdot \tau_{4(2p),2p+1(4p)}</M>, in the second form
1287
the restriction of <M>\sigma_p</M> by <M>n \mapsto kn</M>,
1288
and in the third and fourth form the <E>prime switch</E>
1289
<M>\sigma_{p,r(m)} := \tau_{r_1(m/2),r_2(m)} \cdot
1290
\tau_{r_2(m),r_1(pm/2)} \cdot \tau_{r(m/2),r_1(pm/2)}</M>.
1291
In the latter case, <A>cl</A> is the residue class
1292
<M>r(m)</M>, the residue <M>r_1</M> is <M>1-(r \mod 2)</M>, and
1293
<M>r_2</M> is defined by the equality <M>r(m) \cup r_2(m) = r(m/2)</M>.
1294
</Returns>
1295
<Description>
1296
For an odd prime <M>p</M>, the prime switch <M>\sigma_p</M> is
1297
an rcwa permutation of&nbsp;&ZZ; with modulus&nbsp;<M>4p</M>,
1298
multiplier&nbsp;<M>p</M> and divisor&nbsp;2.
1299
The prime switch <M>\sigma_{p,r(m)}</M> has
1300
multiplier&nbsp;<M>p</M> and divisor&nbsp;2, and the class where
1301
the multiplication by <M>p</M> occurs is just <M>r(m)</M>.
1302
The key mathematical property of a prime switch is that it is
1303
a product of class transpositions whose multiplier and divisor
1304
are coprime. <P/>
1305
1306
Prime switches can be distinguished from other
1307
rcwa mappings by their &GAP; property <C>IsPrimeSwitch</C>.
1308
<Index Key="IsPrimeSwitch" Subkey="for an rcwa mapping">
1309
<C>IsPrimeSwitch</C>
1310
</Index>
1311
<Example>
1312
<![CDATA[
1313
gap> Display(PrimeSwitch(3));
1314
1315
Wild rcwa permutation of Z with modulus 12
1316
1317
/
1318
| (3n+4)/2 if n in 2(4)
1319
| n-1 if n in 5(6) U 8(12)
1320
| n+1 if n in 1(6)
1321
n |-> < n/2 if n in 0(12)
1322
| n-3 if n in 4(12)
1323
| n if n in 3(6)
1324
|
1325
\
1326
1327
gap> Display(PrimeSwitch(3):AsClassMapping);
1328
1329
Wild rcwa permutation of Z with modulus 12
1330
1331
0(12) -> 0(6) loop
1332
1(6) -> 2(6)
1333
2(4) -> 5(6)
1334
3(6) -> 3(6) id
1335
4(12) -> 1(12)
1336
5(6) -> 4(6)
1337
8(12) -> 7(12)
1338
1339
gap> Factorization(PrimeSwitch(3));
1340
[ ( 1(6), 0(8) ), ( 5(6), 4(8) ), ( 0(4), 1(6) ), ( 2(4), 5(6) ),
1341
( 2(6), 1(12) ), ( 4(6), 7(12) ) ]
1342
gap> Display(PrimeSwitch(5,3,4));
1343
1344
Wild rcwa permutation of Z with modulus 20
1345
1346
/
1347
| n+1 if n in 0(2)
1348
| 5n-5 if n in 3(4)
1349
n |-> < (n-1)/2 if n in 1(4) \ 1(20)
1350
| n-1 if n in 1(20)
1351
|
1352
\
1353
1354
gap> Multpk(PrimeSwitch(5,3,4),5,1);
1355
3(4)
1356
gap> PrimeSwitch(5,3,4) = PrimeSwitch(5,ResidueClass(3,4));
1357
true
1358
gap> Factorization(PrimeSwitch(5,3,4));
1359
[ ( 0(2), 1(4) ), ( 1(4), 0(10) ), ( 1(2), 0(10) ) ]
1360
]]>
1361
</Example>
1362
</Description>
1363
</ManSection>
1364
1365
Obtaining a factorization of an rcwa permutation into class shifts,
1366
class reflections and class transpositions is particularly difficult if
1367
multiplier and divisor are coprime. A prototype of permutations which have
1368
this property has been introduced in a different context
1369
in&nbsp;<Cite Key="Keller99"/>:
1370
1371
<ManSection>
1372
<Func Name="mKnot" Arg="m" Label="for an odd integer"/>
1373
<Returns>
1374
the permutation <M>g_m</M> as defined in&nbsp;<Cite Key="Keller99"/>.
1375
</Returns>
1376
<Description>
1377
The argument <A>m</A> must be an odd integer greater than&nbsp;1.
1378
<Example>
1379
<![CDATA[
1380
gap> Display(mKnot(5));
1381
1382
Wild rcwa permutation of Z with modulus 5
1383
1384
/
1385
| 6n/5 if n in 0(5)
1386
| (4n+1)/5 if n in 1(5)
1387
n |-> < (6n-2)/5 if n in 2(5)
1388
| (4n+3)/5 if n in 3(5)
1389
| (6n-4)/5 if n in 4(5)
1390
\
1391
]]>
1392
</Example>
1393
</Description>
1394
</ManSection>
1395
1396
<Alt Only="LaTeX">\noindent</Alt>
1397
In his article, Timothy P. Keller shows that a permutation of this type
1398
cannot have infinitely many cycles of any given finite length.
1399
1400
</Section>
1401
1402
<!-- #################################################################### -->
1403
1404
<Section Label="sec:ExtractingRoots">
1405
<Heading>
1406
Extracting roots of residue-class-wise affine mappings
1407
</Heading>
1408
1409
<ManSection>
1410
<Meth Name="Root"
1411
Arg="f, k" Label="k-th root of an rcwa mapping"/>
1412
<Returns>
1413
an rcwa mapping <C>g</C> such that <C>g&circum;<A>k</A>=<A>f</A></C>,
1414
provided that such a mapping exists and that there is a method available
1415
which can determine it.
1416
</Returns>
1417
<Description>
1418
Currently, extracting roots is implemented for rcwa permutations
1419
of finite order.
1420
<Example>
1421
<![CDATA[
1422
gap> Root(ClassTransposition(0,2,1,2),100);
1423
( 0(8), 2(8), 4(8), 6(8), 1(8), 3(8), 5(8), 7(8) )
1424
gap> Display(last:CycleNotation:=false);
1425
1426
Tame rcwa permutation of Z with modulus 8
1427
1428
/
1429
| n+2 if n in Z \ 6(8) U 7(8)
1430
n |-> < n-5 if n in 6(8)
1431
| n-7 if n in 7(8)
1432
\
1433
1434
gap> last^100 = ClassTransposition(0,2,1,2);
1435
true
1436
]]>
1437
</Example>
1438
</Description>
1439
</ManSection>
1440
1441
</Section>
1442
1443
<!-- #################################################################### -->
1444
1445
<Section Label="sec:NonBijectiveMappings">
1446
<Heading>
1447
Special functions for non-bijective mappings
1448
</Heading>
1449
1450
<ManSection>
1451
<Attr Name="RightInverse" Arg="f" Label="of an injective rcwa mapping"/>
1452
<Returns>
1453
a right inverse of the injective rcwa mapping&nbsp;<A>f</A>,
1454
i.e. a mapping <M>g</M> such that <A>f</A><M>g</M>&nbsp;=&nbsp;1.
1455
</Returns>
1456
<Description>
1457
<Example>
1458
<![CDATA[
1459
gap> twice := 2*IdentityRcwaMappingOfZ;
1460
Rcwa mapping of Z: n -> 2n
1461
gap> twice * RightInverse(twice);
1462
IdentityMapping( Integers )
1463
]]>
1464
</Example>
1465
</Description>
1466
</ManSection>
1467
1468
<ManSection>
1469
<Oper Name="CommonRightInverse" Arg="l, r"
1470
Label="of two injective rcwa mappings"/>
1471
<Returns>
1472
a mapping <M>d</M> such that <A>l</A><M>d</M> = <A>r</A><M>d</M> = 1.
1473
</Returns>
1474
<Description>
1475
The mappings <A>l</A> and <A>r</A> must be injective, and their images
1476
must form a partition of their source.
1477
<Example>
1478
<![CDATA[
1479
gap> twice := 2*IdentityRcwaMappingOfZ; twiceplus1 := twice+1;
1480
Rcwa mapping of Z: n -> 2n
1481
Rcwa mapping of Z: n -> 2n + 1
1482
gap> Display(CommonRightInverse(twice,twiceplus1));
1483
1484
Rcwa mapping of Z with modulus 2
1485
1486
/
1487
| n/2 if n in 0(2)
1488
n |-> < (n-1)/2 if n in 1(2)
1489
|
1490
\
1491
]]>
1492
</Example>
1493
</Description>
1494
</ManSection>
1495
1496
<ManSection>
1497
<Attr Name="ImageDensity" Arg="f" Label="of an rcwa mapping"/>
1498
<Returns>
1499
the <E>image density</E> of the rcwa mapping&nbsp;<A>f</A>.
1500
</Returns>
1501
<Description>
1502
In the notation introduced in the definition of an rcwa mapping,
1503
the <E>image density</E> of an rcwa mapping&nbsp;<M>f</M> is defined by
1504
<Alt Not="LaTeX">1/m</Alt><Alt Only="LaTeX"><M>\frac{1}{m}</M></Alt>
1505
<M>\sum_{r(m) \in R/mR} |R/c_{r(m)}R|/|R/a_{r(m)}R|</M>.
1506
The image density of an injective rcwa mapping is <M>\leq 1</M>, and
1507
the image density of a surjective rcwa mapping is <M>\geq 1</M>
1508
(this can be seen easily). Thus in particular the image density of
1509
a bijective rcwa mapping is&nbsp;1.
1510
<Example>
1511
<![CDATA[
1512
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
1513
gap> List( [ T, ClassShift(0,1), RcwaMapping([[2,0,1]]) ], ImageDensity );
1514
[ 4/3, 1, 1/2 ]
1515
]]>
1516
</Example>
1517
</Description>
1518
</ManSection>
1519
1520
<Index Key="InjectiveAsMappingFrom" Subkey="for an rcwa mapping">
1521
<C>InjectiveAsMappingFrom</C>
1522
</Index>
1523
1524
Given an rcwa mapping <C>f</C>, the function <C>InjectiveAsMappingFrom</C>
1525
returns a set <C>S</C> such that the restriction of <C>f</C> to&nbsp;<C>S</C>
1526
is injective, and such that the image of <C>S</C> under&nbsp;<C>f</C> is the
1527
entire image of&nbsp;<C>f</C>.
1528
1529
<Example>
1530
<![CDATA[
1531
gap> InjectiveAsMappingFrom(T);
1532
0(2)
1533
]]>
1534
</Example>
1535
1536
</Section>
1537
1538
<!-- #################################################################### -->
1539
1540
<Section Label="sec:Trajectories">
1541
<Heading>
1542
On trajectories and cycles of residue-class-wise affine mappings
1543
</Heading>
1544
1545
&RCWA; provides various methods to compute trajectories of rcwa mappings:
1546
1547
<ManSection>
1548
<Heading> Trajectory (methods for rcwa mappings) </Heading>
1549
<Meth Name="Trajectory" Arg="f, n, length"
1550
Label="for rcwa mapping, starting point, length"/>
1551
<Meth Name="Trajectory" Arg="f, n, length, m"
1552
Label="for rcwa mapping, starting point, length, modulus"/>
1553
<Meth Name="Trajectory" Arg="f, n, terminal"
1554
Label="for rcwa mapping, starting point, set of end points"/>
1555
<Meth Name="Trajectory" Arg="f, n, terminal, m"
1556
Label="for rcwa mapping, starting point, set of end points, modulus"/>
1557
<Returns>
1558
the first <A>length</A> iterates in the trajectory of the
1559
rcwa mapping&nbsp;<A>f</A> starting at&nbsp;<A>n</A>, respectively the
1560
initial part of the trajectory of the rcwa mapping&nbsp;<A>f</A>
1561
starting at&nbsp;<A>n</A> which ends at the first occurrence of an
1562
iterate in the set <A>terminal</A>. If the argument <A>m</A> is given,
1563
the iterates are reduced (mod&nbsp;<A>m</A>).
1564
</Returns>
1565
<Description>
1566
To save memory when computing long trajectories containing huge
1567
iterates, the reduction (mod&nbsp;<A>m</A>) is done each time before
1568
storing an iterate.
1569
In place of the ring element&nbsp;<A>n</A>, the methods also accept
1570
a finite set of ring elements or a union of residue classes.
1571
<Example>
1572
<![CDATA[
1573
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
1574
gap> Trajectory(T,27,15); Trajectory(T,27,20,5);
1575
[ 27, 41, 62, 31, 47, 71, 107, 161, 242, 121, 182, 91, 137, 206, 103 ]
1576
[ 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 0, 3, 0, 0, 3 ]
1577
gap> Trajectory(T,15,[1]); Trajectory(T,15,[1],2);
1578
[ 15, 23, 35, 53, 80, 40, 20, 10, 5, 8, 4, 2, 1 ]
1579
[ 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 ]
1580
gap> Trajectory(T,ResidueClass(Integers,3,0),Integers);
1581
[ 0(3), 0(3) U 5(9), 0(3) U 5(9) U 7(9) U 8(27),
1582
<union of 20 residue classes (mod 27) (6 classes)>,
1583
<union of 73 residue classes (mod 81)>, Z \ 10(81) U 37(81), Integers ]
1584
]]>
1585
</Example>
1586
</Description>
1587
</ManSection>
1588
1589
<ManSection>
1590
<Heading>
1591
Trajectory (methods for rcwa mappings -- <Q>accumulated coefficients</Q>)
1592
</Heading>
1593
<Meth Name="Trajectory" Arg="f, n, length, whichcoeffs"
1594
Label="for rcwa mapping, starting point, length, coeff.-spec."/>
1595
<Meth Name="Trajectory" Arg="f, n, terminal, whichcoeffs"
1596
Label="for rcwa mapping, starting point, set of end points, coeff.-spec."/>
1597
<Returns>
1598
either the list <C>c</C> of triples of coprime coefficients such that
1599
for any&nbsp;<C>k</C> it holds that
1600
<C><A>n</A>&circum;(<A>f</A>&circum;(k-1)) =
1601
(c[k][1]*<A>n</A> + c[k][2])/c[k][3]</C> or the last entry of that list,
1602
depending on whether <A>whichcoeffs</A> is <C>"AllCoeffs"</C> or
1603
<C>"LastCoeffs"</C>.
1604
</Returns>
1605
<Description>
1606
The meanings of the arguments <A>length</A> and <A>terminal</A> are
1607
the same as in the methods for the operation <C>Trajectory</C>
1608
described above. In general, computing only the last coefficient triple
1609
(<A>whichcoeffs</A> = <C>"LastCoeffs"</C>) needs considerably less
1610
memory than computing the entire list.
1611
<Example>
1612
<![CDATA[
1613
gap> Trajectory(T,27,[1],"LastCoeffs");
1614
[ 36472996377170786403, 195820718533800070543, 1180591620717411303424 ]
1615
gap> (last[1]*27+last[2])/last[3];
1616
1
1617
]]>
1618
</Example>
1619
</Description>
1620
</ManSection>
1621
1622
When dealing with problems like the <M>3n+1</M>-Conjecture or when
1623
determining the degree of transitivity of the natural action of an rcwa group
1624
on its underlying ring, an important task is to determine the residue classes
1625
whose elements get larger or smaller when applying a given rcwa mapping:
1626
1627
<ManSection>
1628
<Heading> IncreasingOn &amp; DecreasingOn (for an rcwa mapping) </Heading>
1629
<Attr Name="IncreasingOn" Arg="f" Label="for an rcwa mapping"/>
1630
<Attr Name="DecreasingOn" Arg="f" Label="for an rcwa mapping"/>
1631
<Returns>
1632
the union of all residue classes <M>r(m)</M> such that
1633
<M>|R/a_{r(m)}R| &gt; |R/c_{r(m)}R|</M> or
1634
<M>|R/a_{r(m)}R| &lt; |R/c_{r(m)}R|</M>, respectively, where <M>R</M>
1635
denotes the source, <M>m</M> denotes the modulus and <M>a_{r(m)}</M>,
1636
<M>b_{r(m)}</M> and <M>c_{r(m)}</M> denote the coefficients
1637
of&nbsp;<A>f</A> as introduced in
1638
Section&nbsp;<Ref Label="sec:basicdefinitions"/>.
1639
</Returns>
1640
<Description>
1641
If the argument is an rcwa mapping of &ZZ; in sparse representation,
1642
an option <C>classes</C> is interpreted; if set, the step of forming
1643
the union of the residue classes in question is omitted, and the
1644
list of residue classes is returned instead of their union.
1645
This may save time and memory if the modulus is large.
1646
<Example>
1647
<![CDATA[
1648
gap> List([1..3],k->IncreasingOn(T^k));
1649
[ 1(2), 3(4), 3(4) U 1(8) U 6(8) ]
1650
gap> List([1..3],k->DecreasingOn(T^k));
1651
[ 0(2), Z \ 3(4), 0(4) U 2(8) U 5(8) ]
1652
gap> a := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);; # Collatz' permutation
1653
gap> List([-2..2],k->IncreasingOn(a^k));
1654
[ Z \ 1(8) U 7(8), 0(2), [ ], Z \ 0(3), 1(9) U 4(9) U 5(9) U 8(9) ]
1655
]]>
1656
</Example>
1657
</Description>
1658
</ManSection>
1659
1660
We assign certain directed graphs to rcwa mappings, which encode the order
1661
in which trajectories may traverse the residue classes modulo some modulus:
1662
1663
<ManSection>
1664
<Oper Name="TransitionGraph"
1665
Arg="f, m" Label="for an rcwa mapping and a modulus"/>
1666
<Returns>
1667
the transition graph of the rcwa mapping&nbsp;<A>f</A>
1668
for modulus&nbsp;<A>m</A>.
1669
</Returns>
1670
<Description>
1671
<Index Key="rcwa mapping" Subkey="transition graph">rcwa mapping</Index>
1672
<Alt Only="LaTeX">\noindent</Alt>
1673
The <E>transition graph</E> <M>\Gamma_{f,m}</M> of&nbsp;<M>f</M> for
1674
modulus&nbsp;<M>m</M> is defined as follows:
1675
<Enum>
1676
<Item>
1677
The vertices are the residue classes (mod&nbsp;<M>m</M>).
1678
</Item>
1679
<Item>
1680
There is an edge from <M>r_1(m)</M> to <M>r_2(m)</M> if and only if
1681
there is some <M>n \in r_1(m)</M> such that
1682
<M>n^f \in r_2(m)</M>.
1683
</Item>
1684
</Enum>
1685
The assignment of the residue classes (mod&nbsp;<M>m</M>) to the
1686
vertices of the graph corresponds to the ordering of the residues in
1687
<C>AllResidues(Source(<A>f</A>),<A>m</A>)</C>.
1688
The result is returned in the format used by the package
1689
<Package>GRAPE</Package>&nbsp;<Cite Key="GRAPE"/>.
1690
</Description>
1691
</ManSection>
1692
1693
There are a couple of operations and attributes which are based
1694
on these graphs:
1695
1696
<ManSection>
1697
<Oper Name="OrbitsModulo"
1698
Arg="f, m" Label="for an rcwa mapping and a modulus"/>
1699
<Returns>
1700
the partition of <C>AllResidues(Source(<A>f</A>),<A>m</A>)</C>
1701
corresponding to the weakly connected components of the transition
1702
graph of the rcwa mapping&nbsp;<A>f</A> for modulus&nbsp;<A>m</A>.
1703
</Returns>
1704
<Description>
1705
<Example>
1706
<![CDATA[
1707
gap> OrbitsModulo(ClassTransposition(0,2,1,4),8);
1708
[ [ 0, 1, 4 ], [ 2, 5, 6 ], [ 3 ], [ 7 ] ]
1709
]]>
1710
</Example>
1711
</Description>
1712
</ManSection>
1713
1714
<ManSection>
1715
<Oper Name ="FactorizationOnConnectedComponents"
1716
Arg = "f, m" Label="for an rcwa mapping and a modulus"/>
1717
<Returns>
1718
the set of restrictions of the rcwa mapping&nbsp;<A>f</A> to the
1719
weakly connected components of its transition graph <M>\Gamma_{f,m}</M>.
1720
</Returns>
1721
<Description>
1722
The product of the returned mappings is&nbsp;<A>f</A>.
1723
They have pairwise disjoint supports, hence any two of them commute.
1724
<Example>
1725
<![CDATA[
1726
gap> sigma := ClassTransposition(1,4,2,4) * ClassTransposition(1,4,3,4)
1727
> * ClassTransposition(3,9,6,18) * ClassTransposition(1,6,3,9);;
1728
gap> List(FactorizationOnConnectedComponents(sigma,36),Support);
1729
[ 33(36) U 34(36) U 35(36), 9(36) U 10(36) U 11(36),
1730
<union of 23 residue classes (mod 36)> \ [ -6, 3 ] ]
1731
]]>
1732
</Example>
1733
</Description>
1734
</ManSection>
1735
1736
<ManSection>
1737
<Oper Name="TransitionMatrix"
1738
Arg="f, m" Label="for an rcwa mapping and a modulus"/>
1739
<Returns>
1740
the transition matrix of the rcwa mapping&nbsp;<A>f</A> for
1741
modulus&nbsp;<A>m</A>.
1742
</Returns>
1743
<Description>
1744
Let <M>M</M> be this matrix. Then for any two residue classes <M>r_1(m),
1745
r_2(m) \in R/mR</M>, the entry <M>M_{r_1(m),r_2(m)}</M> is defined by
1746
<Alt Only="LaTeX">
1747
<Display>
1748
<![CDATA[M_{r_1(m),r_2(m)} \ := \
1749
\displaystyle{\frac{|R/mR|}{|R/\hat{m}R|}} \cdot
1750
\left|\left\{r(\hat{m}) \in R/\hat{m}R | \ r \in r_1(m)
1751
\wedge r^f \in r_2(m)\right\}\right|,]]>
1752
</Display>
1753
</Alt>
1754
<Alt Only="HTML"><![CDATA[<center>
1755
<img src = "transmat.png" width = "599" height = "47"
1756
alt = "(see the PDF version of the manual),"/>
1757
</center>]]></Alt>
1758
<Alt Only="Text">
1759
(see the PDF- or HTML version of the manual),
1760
</Alt>
1761
where <M>\hat{m}</M> is the product of <A>m</A> and the square of the
1762
modulus of&nbsp;<A>f</A>.
1763
The assignment of the residue classes (mod&nbsp;<A>m</A>) to the rows and
1764
columns of the matrix corresponds to the ordering of the residues in
1765
<C>AllResidues(Source(<A>f</A>),<A>m</A>)</C>. <P/>
1766
1767
The transition matrix is a weighted adjacency matrix of the corresponding
1768
transition graph <C>TransitionGraph(<A>f</A>,<A>m</A>)</C>.
1769
The sums of the rows of a transition matrix are always equal to&nbsp;1.
1770
<Example>
1771
<![CDATA[
1772
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
1773
gap> Display(TransitionMatrix(T^3,3));
1774
[ [ 1/8, 1/4, 5/8 ],
1775
[ 0, 1/4, 3/4 ],
1776
[ 0, 3/8, 5/8 ] ]
1777
]]>
1778
</Example>
1779
</Description>
1780
</ManSection>
1781
1782
<ManSection>
1783
<Heading> Sources &amp; Sinks (of an rcwa mapping) </Heading>
1784
<Attr Name="Sources" Arg="f" Label="of an rcwa mapping"/>
1785
<Attr Name="Sinks" Arg="f" Label="of an rcwa mapping"/>
1786
<Returns>
1787
a list of unions of residue classes modulo the modulus&nbsp;<M>m</M>
1788
of the rcwa mapping&nbsp;<A>f</A>, as described below.
1789
</Returns>
1790
<Description>
1791
The returned list contains an entry for any strongly
1792
connected component of the transition graph of&nbsp;<A>f</A> for
1793
modulus&nbsp;<C>Mod(<A>f</A>)</C> which has only outgoing edges
1794
(<Q>source</Q>) or which has only ingoing edges (<Q>sink</Q>),
1795
respectively. The list entry corresponding to such a component
1796
is the union of the vertices belonging to it.
1797
<Example>
1798
<![CDATA[
1799
gap> g := ClassTransposition(0,2,1,2)*ClassTransposition(0,2,1,4);;
1800
gap> Sources(g); Sinks(g);
1801
[ 0(4) ]
1802
[ 1(4) ]
1803
]]>
1804
</Example>
1805
</Description>
1806
</ManSection>
1807
1808
<ManSection>
1809
<Attr Name="Loops" Arg="f" Label="of an rcwa mapping"/>
1810
<Returns>
1811
if <A>f</A> is bijective, the list of non-isolated vertices of the
1812
transition graph of&nbsp;<A>f</A> for modulus <C>Mod(<A>f</A>)</C>
1813
which carry a loop. In general, the list of vertices of that transition
1814
graph which carry a loop, but which <A>f</A> does not fix setwise.
1815
</Returns>
1816
<Description>
1817
The returned list may also include supersets of the named
1818
residue classes instead if <A>f</A> is affine even on these.
1819
<Example>
1820
<![CDATA[
1821
gap> Loops(ClassTransposition(0,2,1,2)*ClassTransposition(0,2,1,4));
1822
[ 0(4), 1(4) ]
1823
]]>
1824
</Example>
1825
</Description>
1826
</ManSection>
1827
1828
There is a nice invariant of trajectories of the Collatz mapping:
1829
1830
<ManSection>
1831
<Func Name="GluckTaylorInvariant" Arg="a" Label="of a trajectory"/>
1832
<Returns>
1833
the invariant defined in&nbsp;<Cite Key="GluckTaylor02"/>. This is
1834
<M>(\sum_{i=1}^l a_i \cdot a_{i \mod l + 1})/(\sum_{i=1}^l a_i^2)</M>,
1835
where <M>l</M> denotes the length of&nbsp;<A>a</A>.
1836
</Returns>
1837
<Description>
1838
The argument <A>a</A> must be a list of integers.
1839
In&nbsp;<Cite Key="GluckTaylor02"/> it is shown that if <A>a</A>
1840
is a trajectory of the `original' Collatz mapping <M>n</M>
1841
<M>\mapsto</M> (<M>n/2</M> if <M>n</M> even, <M>3n+1</M> if
1842
<M>n</M> odd) starting at an odd integer <M>\geq 3</M> and ending
1843
at&nbsp;1, then the invariant lies in the interval <M>]9/13,5/7[</M>.
1844
<Example>
1845
<![CDATA[
1846
gap> C := RcwaMapping([[1,0,2],[3,1,1]]);;
1847
gap> List([3,5..49],n->Float(GluckTaylorInvariant(Trajectory(C,n,[1]))));
1848
[ 0.701053, 0.696721, 0.708528, 0.707684, 0.706635, 0.695636, 0.711769,
1849
0.699714, 0.707409, 0.693833, 0.710432, 0.706294, 0.714242, 0.699935,
1850
0.714242, 0.705383, 0.706591, 0.698198, 0.712222, 0.714242, 0.709048,
1851
0.69612, 0.714241, 0.701076 ]
1852
]]>
1853
</Example>
1854
</Description>
1855
</ManSection>
1856
1857
Quite often one can make certain <Q>educated guesses</Q> on the overall
1858
behaviour of the trajectories of a given rcwa mapping. For example it is
1859
reasonably straightforward to make the conjecture that all trajectories of
1860
the Collatz mapping eventually enter the finite set <M>\{-136, -91, -82, -68,
1861
-61, -55, -41, -37, -34, -25, -17, -10, -7, -5, -1, 0, 1, 2 \}</M>, or that
1862
<Q>on average</Q> the next number in a trajectory of the Collatz mapping is
1863
smaller than the preceding one by a factor of <M>\sqrt{3}/2</M>. However it
1864
is clear that such guesses can be wrong, and that they therefore cannot be
1865
used to prove anything. Nevertheless they can sometimes be useful:
1866
1867
<ManSection>
1868
<Oper Name="LikelyContractionCentre"
1869
Arg="f, maxn, bound" Label="of an rcwa mapping"/>
1870
<Returns> a list of ring elements (see below). </Returns>
1871
<Description>
1872
This operation tries to compute the <E>contraction centre</E> of the
1873
rcwa mapping <A>f</A>. Assuming its existence this is the unique finite
1874
subset <M>S_0</M> of the source of&nbsp;<A>f</A> on which <A>f</A>
1875
induces a permutation and which intersects non-trivially with any
1876
trajectory of&nbsp;<A>f</A>. The mapping&nbsp;<A>f</A> is assumed
1877
to be <E>contracting</E>, i.e. to have such a contraction centre.
1878
As in general contraction centres are likely not computable, the methods
1879
for this operation are probabilistic and may return wrong results.
1880
The argument <A>maxn</A> is a bound on the starting
1881
value and <A>bound</A> is a bound on the elements of the trajectories
1882
to be searched.
1883
If the limit <A>bound</A> is exceeded, an Info message on Info
1884
level&nbsp;3 of <C>InfoRCWA</C> is given.
1885
<Example>
1886
<![CDATA[
1887
gap> T := RcwaMapping([[1,0,2],[3,1,2]]);; # The Collatz mapping.
1888
gap> S0 := LikelyContractionCentre(T,100,1000);
1889
#I Warning: `LikelyContractionCentre' is highly probabilistic.
1890
The returned result can only be regarded as a rough guess.
1891
See ?LikelyContractionCentre for more information.
1892
[ -136, -91, -82, -68, -61, -55, -41, -37, -34, -25, -17, -10, -7, -5,
1893
-1, 0, 1, 2 ]
1894
]]>
1895
</Example>
1896
</Description>
1897
</ManSection>
1898
1899
<ManSection>
1900
<Oper Name="GuessedDivergence" Arg="f" Label="of an rcwa mapping"/>
1901
<Returns>
1902
a floating point value which is intended to be a rough guess on how fast
1903
the trajectories of the rcwa mapping&nbsp;<A>f</A> diverge (return value
1904
greater than&nbsp;1) or converge (return value smaller than&nbsp;1).
1905
</Returns>
1906
<Description>
1907
Nothing particular is guaranteed.
1908
<Example>
1909
<![CDATA[
1910
gap> GuessedDivergence(T);
1911
#I Warning: GuessedDivergence: no particular return value is guaranteed.
1912
0.866025
1913
]]>
1914
</Example>
1915
</Description>
1916
</ManSection>
1917
1918
</Section>
1919
1920
<!-- #################################################################### -->
1921
1922
<Section Label="sec:SparseRepresentationOfRcwaMappings">
1923
<Heading>
1924
Saving memory -- the sparse representation of rcwa mappings
1925
</Heading>
1926
1927
<Index Key="rcwa mapping" Subkey="sparse representation">
1928
rcwa mapping
1929
</Index>
1930
<Index Key="RcwaMapping"
1931
Subkey="by list of coefficients, sparse representation">
1932
<C>RcwaMapping</C>
1933
</Index>
1934
1935
It is quite common that an rcwa mapping with large modulus
1936
has only few distinct affine partial mappings. In this case the
1937
<Q>standard</Q> representation which stores a coefficient triple for each
1938
residue class modulo the modulus is unsuitable. For this reason there is
1939
a second representation of rcwa mappings, the <Q>sparse</Q> representation.
1940
Depending on the rcwa mappings involved, using this representation may
1941
speed up computations and reduce memory requirements by orders of
1942
magnitude. For rcwa mappings with almost as many distinct affine partial
1943
mappings as there are residue classes modulo the modulus, using sparse
1944
representation makes computations slower and more memory-consuming.
1945
Presently, the sparse representation is only available for rcwa mappings
1946
of &ZZ;. <P/>
1947
1948
The sparse representation of an rcwa mapping consists of the modulus and
1949
a list of 5-tuples <M>(r,m,a_{r(m)},b_{r(m)},c_{r(m)})</M> of integers.
1950
Any such 5-tuple specifies the coefficients of the restriction
1951
<M>n \mapsto (a_{r(m)} \cdot n + b_{r(m)})/c_{r(m)}</M> of the mapping
1952
to a residue class <M>r(m)</M>. The <M>r(m)</M> are chosen to form the
1953
coarsest possible partition of &ZZ; into residue classes such that the
1954
restriction of the mapping to any of them is affine. Also the list of
1955
coefficient tuples is sorted, all <M>c_{r(m)}</M> are positive and
1956
<M>\gcd(c_{r(m)},\gcd(a_{r(m)},b_{r(m)})) = 1</M>. This way the coefficient
1957
list of an rcwa mapping of &ZZ; is unique. <P/>
1958
1959
Changing the representation of rcwa mappings does not change their
1960
behaviour with respect to <Q><C>=</C></Q> and <Q><C>&lt;</C></Q>
1961
The product of two rcwa mappings in sparse representation is in sparse
1962
representation again, just like the product of two rcwa mappings in
1963
standard representation is in standard representation. Also, inverses
1964
are in the same representation. The product of two rcwa mappings in
1965
different representation may be in any of the representations of the
1966
factors.
1967
1968
<ManSection>
1969
<Oper Name="SparseRepresentation" Arg="f" Label="of an rcwa mapping"/>
1970
<Oper Name="SparseRep" Arg="f" Label="of an rcwa mapping"/>
1971
<Oper Name="StandardRepresentation" Arg="f" Label="of an rcwa mapping"/>
1972
<Oper Name="StandardRep" Arg="f" Label="of an rcwa mapping"/>
1973
<Returns>
1974
the rcwa mapping <A>f</A> in sparse, respectively, standard
1975
representation.
1976
</Returns>
1977
<Description>
1978
Appropriate attribute values and properties are copied over
1979
to the rcwa mapping in the <Q>new</Q> representation.
1980
<Example>
1981
<![CDATA[
1982
gap> a := ClassTransposition(1,2,4,6);
1983
( 1(2), 4(6) )
1984
gap> b := ClassTransposition(1,3,2,6);
1985
( 1(3), 2(6) )
1986
gap> c := ClassTransposition(2,3,4,6);
1987
( 2(3), 4(6) )
1988
gap> g := (b*a*c)^2*a;
1989
<rcwa permutation of Z with modulus 288>
1990
gap> h := SparseRep(g);
1991
<rcwa permutation of Z with modulus 288 and 21 affine parts>
1992
gap> g = h;
1993
true
1994
gap> Coefficients(h);
1995
[ [ 0, 6, 1, 0, 1 ], [ 1, 3, 16, -1, 3 ], [ 2, 96, 9, 14, 16 ],
1996
[ 3, 24, 9, 5, 4 ], [ 5, 24, 3, 1, 4 ], [ 8, 36, 2, -7, 9 ],
1997
[ 9, 48, 27, 29, 8 ], [ 11, 24, 9, 5, 4 ], [ 14, 48, 27, 38, 8 ],
1998
[ 15, 24, 27, 19, 4 ], [ 17, 48, 9, 7, 8 ], [ 20, 72, 3, 4, 4 ],
1999
[ 21, 24, 1, -3, 6 ], [ 23, 24, 27, 19, 4 ], [ 26, 48, 3, 2, 8 ],
2000
[ 32, 36, 4, -11, 9 ], [ 33, 48, 9, 7, 8 ], [ 38, 48, 9, 10, 8 ],
2001
[ 41, 48, 27, 29, 8 ], [ 50, 96, 27, 58, 16 ], [ 56, 72, 1, 0, 4 ] ]
2002
gap> h^2;
2003
<rcwa permutation of Z with modulus 13824 and 71 affine parts>
2004
gap> h^3;
2005
<rcwa permutation of Z with modulus 663552 and 201 affine parts>
2006
]]>
2007
</Example>
2008
Memory consumption may differ a lot between sparse- and standard
2009
representation:
2010
<Log>
2011
gap> MemoryUsage(h^3); # on a 64-bit machine
2012
18254
2013
gap> MemoryUsage(StandardRep(h^3)); # on a 64-bit machine
2014
42467894
2015
</Log>
2016
</Description>
2017
</ManSection>
2018
2019
</Section>
2020
2021
<!-- #################################################################### -->
2022
2023
<Section Label="sec:CategoriesOfRcwaMappings">
2024
<Heading>The categories and families of rcwa mappings</Heading>
2025
2026
<ManSection>
2027
<Filt Name="IsRcwaMapping" Arg="f"/>
2028
<Filt Name="IsRcwaMappingOfZ" Arg="f"/>
2029
<Filt Name="IsRcwaMappingOfZ_pi" Arg="f"/>
2030
<Filt Name="IsRcwaMappingOfGFqx" Arg="f"/>
2031
<Returns>
2032
<C>true</C> if <A>f</A> is an rcwa mapping,
2033
an rcwa mapping of the ring of integers,
2034
an rcwa mapping of a semilocalization of the ring of integers or
2035
an rcwa mapping of a polynomial ring in one variable over a finite field,
2036
respectively, and <C>false</C> otherwise.
2037
</Returns>
2038
<Description>
2039
Often the same methods can be used for rcwa mappings of the ring of
2040
integers and of its semilocalizations. For this reason there is
2041
a category <C>IsRcwaMappingOfZOrZ&uscore;pi</C> which is the union of
2042
<C>IsRcwaMappingOfZ</C> and <C>IsRcwaMappingOfZ&uscore;pi</C>.
2043
<Index Key="IsRcwaMappingOfZOrZ_pi">
2044
<C>IsRcwaMappingOfZOrZ&uscore;pi</C>
2045
</Index>
2046
The internal representation of rcwa mappings is called
2047
<C>IsRcwaMappingStandardRep</C>.
2048
<Index Key="IsRcwaMappingStandardRep">
2049
<C>IsRcwaMappingStandardRep</C>
2050
</Index>
2051
There are methods available for <C>ExtRepOfObj</C> and
2052
<C>ObjByExtRep</C>.
2053
<Index Key="ExtRepOfObj"><C>ExtRepOfObj</C></Index>
2054
<Index Key="ObjByExtRep"><C>ObjByExtRep</C></Index>
2055
</Description>
2056
</ManSection>
2057
2058
<ManSection>
2059
<Func Name="RcwaMappingsFamily" Arg="R" Label="of a ring"/>
2060
<Returns>
2061
the family of rcwa mappings of the ring&nbsp;<A>R</A>.
2062
</Returns>
2063
</ManSection>
2064
2065
</Section>
2066
2067
<!-- #################################################################### -->
2068
2069
</Chapter>
2070
2071
<!-- #################################################################### -->
2072
2073