-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorbits.py
728 lines (619 loc) · 23.4 KB
/
orbits.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
from types import IntType, LongType
from monoids import *
Illegal = "Illegal Operation"
def gcd(x, y):
if x == 0:
if y == 0:
raise ValueError, "gcd(0,0) is undefined."
else:
return abs(y)
x = abs(x)
y = abs(y)
while y != 0:
r = x%y
x = y
y = r
return x
class Interval:
"""
A finite subinterval of the integers.
"""
def __init__(self, a, b):
self.start = min(a,b)
self.end = max(a,b)
self.width = self.end - self.start + 1
def __repr__(self):
return '[%d, %d]'%(self.start, self.end)
def __cmp__(self, other):
"""
Intervals are ordered by (start, end) in lex order.
"""
if self.start != other.start:
return cmp(self.start, other.start)
return cmp(self.end, other.end)
def __contains__(self, x):
"""
True if the Interval contains the integer or Interval argument.
"""
if type(x) == IntType or type(x) == LongType :
return self.start <= x <= self.end
else:
return self.start <= x.start and x.end <= self.end
def __xor__(self, other):
"""
Intersection of two intervals
"""
start = max(self.start, other.start)
end = min(self.end, other.end)
if end < start:
return None
else:
return Interval(start, end)
def set_end(self, end):
self.end = end
self.width = self.end - self.start + 1
def set_start(self, start):
self.start = start
self.width = self.end - self.start + 1
def ToInterval(x):
"""
Converts an integer or a 2-tuple to an Interval.
"""
if x.__class__ == Interval:
return x
if type(x) == IntType or type(x) == LongType :
return Interval(x,x)
else:
return Interval(x[0],x[1])
class Isometry:
"""
An element of the infinite dihedral group acting on the integers.
"""
def __init__(self, shift, flip=0):
self.shift, self.flip = shift, flip
def __repr__(self):
if self.flip:
return 'x -> -x + %d'%self.shift
else:
return 'x -> x + %d'%self.shift
def __mul__(self, other):
"""
Composition operator for Isometries.
"""
flip = self.flip ^ other.flip
if self.flip:
shift = self.shift - other.shift
else:
shift = other.shift + self.shift
return Isometry(shift, flip)
def __pow__(self, n):
"""
Power operator for Isometries.
"""
if self.flip:
if n%2 != 0:
return Isometry(self.shift, self.flip)
else:
return Isometry(0,0)
else:
return Isometry(n*self.shift, self.flip)
def __invert__(self):
"""
Inversion operator for Isometries.
"""
if self.flip:
return Isometry(self.shift, self.flip)
else:
return Isometry(-self.shift, self.flip)
def __call__(self, x):
"""
An Isometry as a mapping (of an integer or an interval).
"""
if type(x) == IntType or type(x) == LongType:
if self.flip:
return -x + self.shift
else:
return x + self.shift
if x.__class__ == Interval:
return Interval(self(x.start), self(x.end))
class Pairing:
"""
The restriction of an isometry to a finite interval.
"""
def __init__(self, domain, isometry, label = None):
self.domain, self.isometry = domain, isometry
self.range = self(self.domain)
if label:
self.label = label
else:
self.label = MonoidElement(1, IntMonoid)
def __repr__(self):
if self.isometry.flip:
op = ' ~> '
else:
op = ' -> '
return str(self.domain) + op + str(self.range) +', ' + str(self.label)
def __call__(self, x):
"""
A Pairing as a mapping.
"""
if not x in self.domain:
raise Illegal, "Operand is not contained in domain."
else:
return self.isometry(x)
def __cmp__(self, other):
"""
Linear ordering of Pairings.
"""
if self.range.end != other.range.end:
return cmp(other.range.end, self.range.end)
if self.domain.width != other.domain.width:
return cmp(other.domain.width, self.domain.width)
if self.domain.start != other.domain.start:
return cmp(self.domain.start, other.domain.start)
return cmp(self.isometry.flip, other.isometry.flip)
def __contains__(self,x):
"""
True if the argument is contained in either the domain or range.
"""
return x in self.domain or x in self.range
def is_preserving(self):
"""
True if the Pairing is orientation preserving.
"""
return self.isometry.flip == 0 or self.domain.width == 1
def is_periodic(self):
"""
True if the Pairing is orientation preserving, and
its domain and range meet.
"""
return self.is_preserving() and self.domain ^ self.range
def is_trivial(self):
"""
True if the Pairing is restriction of the identity map.
"""
return (self.is_preserving and self.isometry.shift == 0 or
self.domain.width == 1 and self.domain == self.range)
def contract(self,I):
"""
Adjust the Pairing to account for removal of a static interval.
"""
I = ToInterval(I)
if I ^ self.domain or I ^ self.range:
raise Illegal, "Contraction interval is not static."
shift = Isometry( -I.width )
if I.end < self.domain.start:
return Pairing(shift(self.domain), shift * self.isometry * ~shift, label = self.label)
elif I.end < self.range.start:
return Pairing(self.domain, shift * self.isometry, label = self.label)
else:
return self
def trim(self):
"""
Trim an orientation reversing pairing so that its domain and
range become disjoint.
"""
if self.is_preserving():
return self
else:
intersection = self.domain ^ self.range
if intersection:
middle = (self.domain.start + self.range.end - 1)/2
domain = Interval(self.domain.start, middle)
return Pairing(domain, self.isometry, label = self.label)
else:
return self
def merge(self, other):
"""
Merge a periodic Pairing with an overlapping orientation
preserving Pairing.
"""
if self.is_periodic() and other.is_preserving():
R = Interval(self.domain.start, self.range.end)
I = R ^ other.domain
shift = gcd(self.isometry.shift, other.isometry.shift)
if (other(I) ^ R).width >= self.isometry.shift :
domain = Interval(R.start, R.end - shift)
isometry = Isometry(shift)
return Pairing(domain, isometry)
else:
return None
else:
raise Illegal, "Pairing cannot be merged."
def transmit(self, other):
"""
Left shift the domain and range of another Pairing as far as possible.
"""
trim = self.trim()
post = None
pre = None
if other.range not in trim.range:
return other
domain = other.domain
if not trim.is_preserving():
# print('reversing')
isometry = (trim.isometry**(-1)) * other.isometry
new_label = other.label * (self.label**(-1))
if domain in trim.range:
isometry = isometry * trim.isometry
new_label = self.label * new_label
domain = trim.isometry(domain)
else:
shift = trim.isometry.shift
post = -(1 + (other.range.start - trim.range.start)/shift)
isometry = (trim.isometry**post) * other.isometry
new_label = other.label * (self.label**post)
if domain in trim.range:
pre = 1 + (other.domain.start - trim.range.start)/shift
isometry = isometry * (trim.isometry**pre)
new_label = (self.label**pre) * new_label
domain = (trim.isometry**(-pre))(domain)
range = isometry(domain)
if range.start < domain.start:
# print('flipping')
isometry = isometry**(-1)
new_label = new_label**(-1)
domain = range
return Pairing(domain, isometry, label = new_label)
def Shift(domain, range, label = None):
"""
Constructor for an orientation preserving pairing, given the domain
and range.
"""
if domain.__class__ != Interval:
domain = Interval(domain[0], domain[1])
if range.__class__ != Interval:
range = Interval(range[0], range[1])
if domain.width != range.width:
raise Illegal, "The domain and range must have the same width."
if range.start < domain.start:
domain, range = range, domain
isometry = Isometry(range.start - domain.start)
return Pairing(domain, isometry, label = label)
def Flip(domain, range, label=None):
"""
Constructor for an orientation reversing pairing, given the domain
and range.
"""
if domain.__class__ != Interval:
domain = Interval(domain[0], domain[1])
if range.__class__ != Interval:
range = Interval(range[0], range[1])
if domain.width != range.width:
raise Illegal, "The domain and range must have the same width."
if range.start < domain.start:
domain, range = range, domain
isometry = Isometry(range.end + domain.start, 1)
return Pairing(domain, isometry, label = label)
class Pseudogroup:
"""
Pseudogroup(P,U) is the pseudogroup of maps of the interval U which
is generated by the Pairings in the list P.
"""
def __init__(self, pairings, label_monoid, universe=None):
self.pairings = pairings
start = min([p.domain.start for p in self.pairings])
end = max([p.range.end for p in self.pairings])
if universe:
universe = ToInterval(universe)
if start < universe.start or end > universe.end:
raise ValueError, 'Universe must contain all domains and ranges.'
self.universe = universe
else:
self.universe = Interval(start, end)
self.label_monoid = label_monoid
def __repr__(self):
result = 'Pseudogroup on %s:\n'%str(self.universe)
if self.pairings:
self.pairings.sort()
for pairing in self.pairings:
result += str(pairing) + '\n'
return result
def clean(self):
"""
Get rid of trivial Pairings.
"""
self.pairings = [p for p in self.pairings if not p.is_trivial()]
def trim(self):
"""
Trim all orientation reversing pairings.
"""
self.pairings = [p.trim() for p in self.pairings]
def static(self):
"""
Find a static interval.
"""
if len(self.pairings) == 0:
return self.universe
intervals = [p.domain for p in self.pairings]
intervals += [p.range for p in self.pairings]
intervals.sort()
I = intervals.pop(0)
start, end = I.start, I.end
if start > 1:
return Interval(1, start - 1)
for interval in intervals:
if end < interval.start - 1:
return Interval(end+1, interval.start-1)
end = max(end,interval.end)
if end < self.universe.end:
return Interval(end + 1, self.universe.end)
return None
def contract(self):
"""
Remove all static intervals. Return the total size.
"""
result = 0
I = self.static()
while I:
result += I.width
if I.end != self.universe.end:
self.pairings = [p.contract(I) for p in self.pairings ]
self.universe.set_end(self.universe.end - I.width)
I = self.static()
return result
def merge(self):
"""
Merge periodic pairing whenever possible.
"""
if len(self.pairings) < 2:
return
done=0
while not done:
periodics = [p for p in self.pairings if p.is_periodic()]
done=1
for p in periodics[:-1]:
for q in periodics[1+periodics.index(p):]:
g = None
try:
g = p.merge(q)
except: pass
if g:
self.pairings.remove(p)
self.pairings.remove(q)
self.pairings.append(g)
done=0
break
def transmit(self):
"""
Use the largest Pairing to transmit others.
"""
self.pairings.sort()
g = self.pairings[0]
self.pairings = [g] + [ g.transmit(p) for p in self.pairings[1:] ]
def truncate(self):
"""
Truncate the largest pairing.
"""
self.pairings.sort()
g = self.pairings.pop(0)
if len(self.pairings) > 0:
support_end = self.pairings[0].range.end
else:
support_end = g.range.start - 1
if support_end < g.range.start:
self.universe.set_end(support_end)
return
if not g.is_preserving():
g.trim()
self.universe.set_end(support_end)
range = Interval(g.range.start, support_end)
domain = (~g.isometry)(range)
self.pairings = [Pairing(domain, g.isometry, label = g.label)] + self.pairings
def simplify(self):
"""
Do one cycle of the orbit counting reduction algorithm due
to Agol, Hass and Thurston.
"""
# print(len(self.pairings))
# print('cleaning')
self.clean()
# print(len(self.pairings))
if len(self.pairings) == 0:
self.pairings = None
return self.universe.width
# print "cleaned\n", self
count = self.contract()
# print "contracted\n", self
self.trim()
# print "trimmed\n", self
self.merge()
# print "merged\n", self
self.transmit()
# print "transmitted\n", self
self.truncate()
# print "truncated\n", self
# print 'count = ', count
return count
def copy(self):
return Pseudogroup([Pairing(P.domain, P.isometry, P.label) for P in self.pairings], self.label_monoid)
def reduce(self):
"""
Reduce the pseudogroup to nothing. Return the number of orbits.
"""
count = 0
while self.pairings != None:
count += self.simplify()
return count
def ordered_labels(self):
self.pairings.sort()
return [pairing.label.data for pairing in self.pairings]
def ordered_top_markings(self):
self.pairings.sort()
return [int(pairing.label.top_marked()) for pairing in self.pairings]
def ordered_bottom_markings(self):
self.pairings.sort()
return [int(pairing.label.bottom_marked()) for pairing in self.pairings]
def reduce_to_single_pairing(self, show_labels=False):
labels = []
top_markings = []
bottom_markings = []
while len(self.pairings)>1:
if show_labels:
labels.append(self.ordered_labels())
top_markings.append(self.ordered_top_markings())
bottom_markings.append(self.ordered_bottom_markings())
self.transmit()
self.truncate()
if show_labels:
return self.pairings[0].label, labels, top_markings, bottom_markings
else:
return self.pairings[0].label
def reducible_to_marked_labels(self):
while len(self.pairings)>1:
# print('pairings')
# print(self.pairings)
self.transmit()
self.truncate()
all_tops_marked = True
all_bottoms_marked = True
for pairing in self.pairings:
# print(pairing)
# print('top marked: '+str(pairing.label.top_marked()))
# print('bottom marked: '+str(pairing.label.bottom_marked()))
if not pairing.label.top_marked():
all_tops_marked = False
if not pairing.label.bottom_marked():
all_bottoms_marked = False
if not all_tops_marked and not all_bottoms_marked:
break
if all_tops_marked or all_bottoms_marked:
return True
final_pairing = self.pairings[0]
return final_pairing.label.top_marked() or final_pairing.label.bottom_marked()
class Triangle(object):
def __init__(self, left, bottom, right):
if not self._is_consistent(left,bottom, right):
raise Exception("Intersection numbers inconsistent")
self.left = left
self.bottom = bottom
self.right = right
self.intersection_numbers = [left, bottom, right]
self._find_transition_numbers()
def _is_consistent(self, left, bottom, right):
if left > right+bottom or bottom > left+right or right > left+bottom:
return False
if (left+bottom+right)%2 == 1:
return False
return True
def _find_transition_numbers(self):
x = (self.left+self.right-self.bottom)/2
y = (self.left+self.bottom-self.right)/2
z = (self.bottom+self.right-self.left)/2
assert x >= 0 and y >= 0 and z >= 0
self.transition_numbers = [x, y, z]
def _cross_triangle(self,side, position):
if position < self.transition_numbers[side]:
return (side-1)%3, self.intersection_numbers[side-1] - position - 1
else:
return (side+1)%3, self.intersection_numbers[side] - position - 1
def genus_2_curve_pairings(wl, wm, wr, twl, twm, twr, e, a, b):
t1, t2, t3 = Triangle(wl, wl, wm).transition_numbers
t4, t5, t6 = Triangle(wm, wr, wr).transition_numbers
# print('t1, t2, t2: {}, {}, {}'.format(t1,t2,t3))
# print('t4, t5, t6: {}, {}, {}'.format(t4,t5,t6))
#start of each interval
s1 = 1
e1 = wl
s2 = s1+wl
e2 = e1+wl
s3 = s2+wl
e3 = e2+wm
s4 = s3+wm
e4 = e3+wm
s5 = s4+wm
e5 = e4+wr
s6 = s5+wr
e6 = e5+wr
# print('s1, s2, s3, s4, s5, s6: {}, {}, {}, {}, {}, {}'.format(s1,s2,s3, s4,s5,s6))
# print('e1, e2, e3, e4, e5, e6: {}, {}, {}, {}, {}, {}'.format(e1,e2,e3, e4,e5,e6))
pairings = []
pairings.append(Flip([s1,s1+t1-1],[s3+t3,e3],e))
pairings.append(Flip([s2+t2,e2],[s3,s3+t3-1],e))
if t2>0:
pairings.append(Flip([s1+t1,e1],[s2,s2+t2-1],e))
pairings.append(Flip([s4,s4+t4-1],[s6+t6,e6],e))
if t6>0:
pairings.append(Flip([s5+t5,e5],[s6,s6+t6-1],e))
pairings.append(Flip([s4+t4,e4],[s5,s5+t5-1],e))
pairings.append(Flip([s1, e1-twl],[s2,e2-twl],a))
if twl>0:
pairings.append(Flip([e1-twl+1, e1],[e2-twl+1,e2],a))
pairings.append(Flip([s3, e3-twm],[s4,e4-twm],e))
if twm>0:
pairings.append(Flip([e3-twm+1, e3],[e4-twm+1,e4],e))
pairings.append(Flip([s5, e5-twr],[s6,e6-twr],b))
if twr>0:
pairings.append(Flip([e5-twr+1, e5],[e6-twr+1,e6],b))
return pairings
def genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, e, a, b, Monoid):
return Pseudogroup(genus_2_curve_pairings(wl, wm, wr, twl, twm, twr, e, a, b), Monoid)
def relator(wl, wm, wr, twl, twm, twr):
return genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, e, a, b, WordMonoid).reduce_to_single_pairing().data
def homology(wl, wm, wr, twl, twm, twr):
return genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, eh, ah, bh, Z2Monoid).reduce_to_single_pairing().data
def starting_fibering_boxes(phi_a, phi_b):
if phi_a == 0 or phi_b == 0:
if phi_a == 0 and phi_b == 0:
raise Exception("phi is zero")
if phi_a == 0:
box_a = MarkedMonoidElement((0,0,0,2,2),BoxMonoid)
box_b = MarkedMonoidElement((1,1,0,0,0),BoxMonoid)
if phi_b == 0:
box_a = MarkedMonoidElement((1,1,0,0,0),BoxMonoid)
box_b = MarkedMonoidElement((0,0,0,2,2),BoxMonoid)
else:
if phi_a > 0:
box_a = MarkedMonoidElement((phi_a,phi_a,0,1,1),BoxMonoid)
if phi_a < 0:
box_a = MarkedMonoidElement((phi_a,0,phi_a,1,1),BoxMonoid)
if phi_b > 0:
box_b = MarkedMonoidElement((phi_b,phi_b,0,1,1),BoxMonoid)
if phi_b < 0:
box_b = MarkedMonoidElement((phi_b,0,phi_b,1,1),BoxMonoid)
return box_a, box_b
def fibers(wl, wm, wr, twl, twm, twr):
x, y = homology(wl, wm, wr, twl, twm, twr)
phi_a, phi_b = -y, x
box_a, box_b = starting_fibering_boxes(phi_a, phi_b)
box_id = BoxMonoid.identity
return not genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, box_id, box_a, box_b, BoxMonoid).reducible_to_marked_labels()
def fibering_box(wl, wm, wr, twl, twm, twr, show_labels=False):
x, y = homology(wl, wm, wr, twl, twm, twr)
phi_a, phi_b = -y, x
box_a, box_b = starting_fibering_boxes(phi_a, phi_b)
box_id = BoxMonoid.identity
return genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, box_id, box_a, box_b, BoxMonoid).reduce_to_single_pairing(show_labels=show_labels)
def starting_signed_fibering_boxes(phi_a, phi_b):
if phi_a == 0 or phi_b == 0:
if phi_a == 0 and phi_b == 0:
raise Exception("phi is zero")
if phi_a == 0:
box_a = MarkedMonoidElement((0,0,0,2,0,2,0),SignedBoxMonoid)
box_b = MarkedMonoidElement((1,1,0,0,0,0,0),SignedBoxMonoid)
if phi_b == 0:
box_a = MarkedMonoidElement((1,1,0,0,0,0,0),SignedBoxMonoid)
box_b = MarkedMonoidElement((0,0,0,0,2,0,2),SignedBoxMonoid)
else:
if phi_a > 0:
box_a = MarkedMonoidElement((phi_a,phi_a,0,1,0,0,1),SignedBoxMonoid)
if phi_a < 0:
box_a = MarkedMonoidElement((phi_a,0,phi_a,0,1,1,0),SignedBoxMonoid)
if phi_b > 0:
box_b = MarkedMonoidElement((phi_b,phi_b,0,0,1,1,0),SignedBoxMonoid)
if phi_b < 0:
box_b = MarkedMonoidElement((phi_b,0,phi_b,1,0,0,1),SignedBoxMonoid)
return box_a, box_b
def alexander_poly_top_coeff_cancels(wl, wm, wr, twl, twm, twr):
x, y = homology(wl, wm, wr, twl, twm, twr)
phi_a, phi_b = -y, x
box_a, box_b = starting_signed_fibering_boxes(phi_a, phi_b)
box_id = SignedBoxMonoid.identity
return genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, box_id, box_a, box_b, SignedBoxMonoid).reducible_to_marked_labels()
def signed_fibering_box(wl, wm, wr, twl, twm, twr, show_labels=False):
x, y = homology(wl, wm, wr, twl, twm, twr)
phi_a, phi_b = -y, x
box_a, box_b = starting_signed_fibering_boxes(phi_a, phi_b)
box_id = SignedBoxMonoid.identity
return genus_2_pseudogroup(wl, wm, wr, twl, twm, twr, box_id, box_a, box_b, SignedBoxMonoid).reduce_to_single_pairing(show_labels=show_labels)
#H = Pseudogroup([ Flip([11,16],[13,18], a), Shift([1,4],[3,6], b), Shift([10,14],[14,18], c), Shift([8,10],[14,16], d), Flip([6,7],[8,9], e) ], StringMonoid, Interval(1,18))