File: InvariantsDoc.m2

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (980 lines) | stat: -rw-r--r-- 28,633 bytes parent folder | download | duplicates (4)
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
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
-*
   Copyright 2020, Luigi Ferraro, Federico Galetto,
   Francesca Gandini, Hang Huang, Matthew Mastroeni, Xianglong Ni.

   You may redistribute this file under the terms of the GNU General Public
   License as published by the Free Software Foundation, either version 2 of
   the License, or any later version.
*-

    
document {
	Key => {action, (action, RingOfInvariants)},
	
	Headline => "the group action that produced a ring of invariants",
	
	Usage => "action S",
	
	Inputs => {
	    	"S" => RingOfInvariants => {"of the group action being returned"},
		},
	
	Outputs => {
		GroupAction => {"the action that produced the ring of invariants in the input"}
		},
	"This function is provided by the package ", TO InvariantRing,".",
	
	PARA {
	    "This example shows how to recover the action of a
	    torus that produced a certain ring of invariants.
	    Note other action types are possible and may produce
	    a different looking output."
	    },
    	
	EXAMPLE {
		"R = QQ[x_1..x_4]",
		"T = diagonalAction(matrix {{0,1,-1,1},{1,0,-1,-1}}, R)",
		"S = R^T",
		"action S"
		},
	    }

document {
	Key => (generators, RingOfInvariants),
	
	Headline => "the generators for a ring of invariants",
	
	Usage => "generators S, gens S",
	
	Inputs => {
	    	"S" => RingOfInvariants,
		},
	    
	Outputs => {
		List => {"of algebra generators for the ring of invariants"}
		},
	    
	"This function is provided by the package ", TO InvariantRing,". ",
	
	PARA {
	    "This method gets the algebra generators for a ring of invariants."
	    },
    	
	EXAMPLE {
		"R = QQ[x_1..x_4]",
		"W = matrix{{0,1,-1,1},{1,0,-1,-1}}",
		"T = diagonalAction(W, R)",
		"S = R^T",
		"gens S",
		},
	    }

document {
	Key => {invariantRing, 
	    (invariantRing, GroupAction),
	    (symbol ^, PolynomialRing, GroupAction),
	    (symbol ^, QuotientRing, LinearlyReductiveAction)},
	
	Headline => "the ring of invariants of a group action",
	
	Usage => "invariantRing G, R^G",
	Inputs => {
	    	"G" => GroupAction,
	    	"R" => PolynomialRing => {"on which the group acts"},
		Strategy => {"the strategy used to compute the invariant ring"}
		},
	Outputs => {
		RingOfInvariants => {"the ring of invariants of the given group action"}
		},    
	Caveat => {
	    "By default, the invariants of a diagonal group action are computed over an infinite 
	    extension of the ground field specified by the user over which the action is defined.  
	    Provided the action is defined, it is possible to compute invariants literally over 
	    the specified ground field in prime characteristic using the option ", 
	    TO UseCoefficientRing, "."
	    },  
	    
	"This function is provided by the package ", TO InvariantRing,". ",
	
	PARA {
	    "The following example defines an action of a 
	    two-dimensional torus on a four-dimensional vector space
	    with a basis of weight vectors whose weights are
	    the columns of the input matrix."
	},
    	
	EXAMPLE {
		"R = QQ[x_1..x_4]",
		"W = matrix{{0,1,-1,1},{1,0,-1,-1}}",
		"T = diagonalAction(W, R)",
		"S = invariantRing T",
		},
	    
	PARA {
	    "The algebra generators for the ring of invariants are computed upon
	    initialization by the method ",
	    TO invariants,"."
	    },

	PARA {
	    "Alternatively, we can use the following shortcut to construct
	    a ring of invariants."
	    },
    	
	EXAMPLE {
		"S = R^T",
		},
	    }

document {
	Key => {
	    invariants
	    },
	
	Headline => "computes the generating invariants of a group action",
	
	Usage => "invariants G",
	
	Inputs => {  
	    	"G" => GroupAction => {"a specific type of group action on a polynomial ring"},
		Strategy => {"the strategy used to compute diagonal invariants, options are UsePolyhedra or UseNormaliz."}
		},
	Outputs => {
		"L" => List => {"a minimal set of generating invariants for the group action"}
		},

	PARA {
	    "This function is provided by the package ", TO InvariantRing, 
	    ". This function can be used to compute the generating invariants of a diagonal group action, finite group action or linearly reductive group action.
	    It can also be used to compute a basis of a graded component of the invariant ring. 
	    Below is a list of the many ways to use this function:"
	    },
	UL{
	    {TO (invariants, FiniteGroupAction), ": computes the generating invariants of a finite group action"},
	    {TO (invariants, DiagonalAction), ": computes the generating invariants of a diagonal group action"},
	    {TO (invariants, LinearlyReductiveAction), ": computes the generating invariants of a linearly reductive action"},
	    {TO (invariants, FiniteGroupAction, ZZ)," or ", TO (invariants, FiniteGroupAction, List), ": computes a basis for graded component of the invariant ring of a finite group action"},
	    {TO (invariants, LinearlyReductiveAction, ZZ)," or ", TO (invariants, LinearlyReductiveAction, List), ": computes a basis for graded component of the invariant ring of a linearly reductive group action"},
	    },
    
    	SeeAlso => {
	    invariantRing, 
	    isInvariant
	    },
	
	Caveat => {"Some optional inputs are only relevant to
	    certain use cases of this method.
	    Please consult the documentation pages for the
	    different cases to learn which optional inputs
	    are used."}
	}

document {
	Key => { 
	    (invariants, DiagonalAction)
	    },
	
	Headline => "computes the generating invariants of a group action",
	
	Usage => "invariants D",
	
	Inputs => {  
	    	"D" => DiagonalAction => {"a diagonal action on a polynomial ring"},
		Strategy => {"the strategy used to compute diagonal invariants, options are UsePolyhedra or UseNormaliz."}
		},
	Outputs => {
		"L" => List => {"a minimal set of generating invariants for the group action"}
		},
	Caveat => {
	    "By default, the invariants are computed over an infinite extension of the ground field
	    specified by the user over which the action is defined.  Provided the action is defined,
	    it is possible to compute invariants literally over the specified ground field in prime
	    characteristic using the option ", TO UseCoefficientRing, "."
	    }, 

	PARA {
	    "This function is provided by the package ", TO InvariantRing, 
	    ". It implements an algorithm to compute a minimal set of generating 
	    monomial invariants for a diagonal action of an abelian group",
	    TEX /// $(k^*)^r \times \mathbb{Z}/d_1 \times \cdots \times \mathbb{Z}/d_g$ ///,
	    " on a polynomial ring ",
	    TEX /// $R = k[x_1, \dots, x_n]$.///,
	    " Saying the action is diagonal means that ",
	    TEX /// $(t_1,\ldots,t_r) \in (k^*)^r$ ///,
	    " acts by",
	    TEX /// $$(t_1,\ldots,t_r) \cdot x_j = t_1^{w_{1,j}}\cdots t_r^{w_{r,j}} x_j$$ ///,
	    "for some integers ",
	    TEX /// $w_{i,j}$ ///, 
	    " and the generators ",
	    TEX /// $u_1, \dots, u_g$ ///,
	    " of the cyclic abelian factors act by",
	    TEX /// $$u_i \cdot x_j = \zeta_i^{w_{r+i,j}} x_j$$ ///,
	    "for ",
	    TEX /// $\zeta_i$ ///,
	    " a primitive ",
	    TEX /// $d_i$///,
	    "-th root of unity. The integers",
	    TEX /// $w_{i,j}$ ///,
	    "comprise the weight matrix ", TT "W",
	    ". In other words, the ",
	    TEX /// $j$ ///,
	    "-th column of ", TT "W", 
	    " is the weight vector of",
	    TEX /// $x_j$. ///
	    },
	 
	PARA {    
	    "The algorithm combines a modified version of an algorithm for tori 
	    due to Derksen and Kemper which can be found in: "
	    },
       
       UL { 
	    {"Derksen, H. & Kemper, G. (2015).", EM "Computational Invariant Theory", 
	   ". Heidelberg: Springer. pp 159-164"}
        },
    
       PARA {
	    "together with an algorithm for finite abelian groups due to Gandini 
	    which can be found in: "
	     },
	 
        UL { 
	    {"Gandini, F. ", EM "Ideals of Subspace Arrangements", 
	   ". Thesis (Ph.D.)-University of Michigan. 2019. ISBN: 978-1392-76291-2. pp 29-34."}
        },   
    
    	PARA {
	    "Here is an example of a one-dimensional torus acting on a 
	    two-dimensional vector space:"
	},
    
    	EXAMPLE {
	    	"R = QQ[x_1,x_2]",
		"W = matrix{{1,-1}}",
		"T = diagonalAction(W, R)",
		"invariants T"
		},
    
    	PARA {
	    "Here is an example of a product of two cyclic groups of 
	    order 3 acting on a three-dimensional vector space:"
	},
	
	EXAMPLE {
	    "R = QQ[x_1..x_3]",
	    "d = {3,3}",
	    "W = matrix{{1,0,1},{0,1,1}}",
	    "A = diagonalAction(W, d, R)",
	    "invariants A"
		},

    	PARA {
	    "Here is an example of a diagonal action by the product of
	     a two-dimensional torus with a cyclic group of order 3 
	    acting on a two-dimensional vector space:"
	},
    
	EXAMPLE {
	    "R = QQ[x_1, x_2]",
	    "d = {3}",
	    "W1 = matrix{{1,-1}, {-1,1}}",
	    "W2 = matrix {{1,0}}",
	    "D = diagonalAction(W1, W2, d, R)",
	    "invariants D"
		},
    
    	SeeAlso => {
	    diagonalAction,
	    invariantRing, 
	    isInvariant
	    }	
	}

document {
	Key => {
	    (invariants, FiniteGroupAction),
	    },
	Headline => "computes the generating invariants of a group action",
	Usage => "invariants G",
	Inputs => {
	    "G" => FiniteGroupAction,
	    Strategy => {"the strategy used to compute diagonal invariants, options are UsePolyhedra or UseNormaliz."}
	    },
	Outputs => {
		"L" => List => {"a minimal set of generating invariants for the group action"}
		},
	PARA {
	    "This function is provided by the package ", TO InvariantRing, "."
	    },
	PARA {
	    "It implements King's algorithm to compute a minimal
	    set of generating invariants for the action of a
	    finite group on a polynomial ring following Algorithm
	    3.8.2 in:"
	    },
       	UL { 
	    {"Derksen, H. & Kemper, G. (2015).",
		EM "Computational Invariant Theory", 
	   ". Heidelberg: Springer."}
        },
	PARA {
	    "The following example computes the invariants of the
	    alternating group on 4 elements."
	    },
    EXAMPLE {
	"R = QQ[x_1..x_4]",
	"L = apply({\"2314\",\"2143\"},permutationMatrix);",
	"A4 = finiteAction(L,R)",
	"netList invariants A4"
	},
    
    	SeeAlso => {
	    finiteAction,
	    invariantRing, 
	    isInvariant
	    }	
	}

document {
	Key => {
	    [invariants, DegreeBound], [invariantRing, DegreeBound], DegreeBound
	    },
	Headline => "degree bound for invariants of finite groups",
	Usage => "invariants G",
	Inputs => {"G" => FiniteGroupAction},
	Outputs => {
		"L" => List => {"a minimal set of generating invariants for the group action"}
		},
	PARA {
	    "This function is provided by the package ", TO InvariantRing, "."
	    },
	PARA {
	    "This optional argument allows the user to provide
	    an upper bound for the degree of the generating
	    invariants of a finite group action.
	    If no upper bound is provided, the order of the group
	    is used as an upper bound. Providing a smaller
	    upper bound may speed up the computation of invariants.
	    However, if the value provided is too small the
	    resulting list may not generate the ring of invariants."
	    },
	PARA {
	    "The following example computes the invariants of the
	    symmetric group on 4 elements."
	    },
    EXAMPLE {
	"R = QQ[x_1..x_4]",
	"L = apply({\"2134\",\"2341\"},permutationMatrix);",
	"S4 = finiteAction(L,R)",
	"elapsedTime invariants S4",
	"elapsedTime invariants(S4,DegreeBound=>4)"
	},
    	Caveat => {
	    "If the value provided for this option is too small,
	    then the output list does not generate
	    the entire ring of invariants. A warning message
	    is produced to notify the user of the issue."
	    },
    	SeeAlso => {
	    finiteAction,
	    invariantRing, 
	    isInvariant
	    }	
	}

document {
	Key => {
	    [invariants, UseCoefficientRing], [invariantRing, UseCoefficientRing], UseCoefficientRing
	    },
	Headline => "option to compute invariants over the given coefficient ring",
	Usage => "invariants G",
	Inputs => {"D" => DiagonalAction},
	Outputs => {
		"L" => List => {"a minimal set of generating invariants for the group action"}
		},
	
	PARA {
	    "This function is provided by the package ", TO InvariantRing, "."
	    },
	
	PARA {
	    "By default, the invariants of a diagonal action are
	    computed over an infinite extension of the coefficient
	    field specified by the user over which the action is defined.
	    Setting this optional argument to ", TO true, " will compute
	    the invariants of the action literally over the finite field
	    specified by the user in prime characteristic, provided the 
	    action is defined."
	    },
	
	PARA {
	    "The following example computes the invariants of a
	    1-dimensional torus action literally over the specified finite 
	    field."
	    },
	
	EXAMPLE {
	    "R = (GF 9)[x, y]",
	    "W = matrix {{7, -5}}",
	    "T = diagonalAction(W, R)",
	    "invariantRing(T,UseCoefficientRing => true)"
	    },
	
	PARA {
	    "Over an infinite extension of the given ground field, there
	    are fewer invariants."
	    },
	
	EXAMPLE {
	    "invariantRing T"
	    },
    
    	SeeAlso => {
	    diagonalAction,
	    invariants,
	    invariantRing
	    }	
	}

document {
	Key => {
	    [invariants, UseLinearAlgebra], [invariantRing, UseLinearAlgebra], UseLinearAlgebra
	    },
	Headline => "strategy for computing invariants of finite groups",
	Usage => "invariants G",
	Inputs => {"G" => FiniteGroupAction},
	Outputs => {
		"L" => List => {"a minimal set of generating invariants for the group action"}
		},
	
	PARA {
	    "This function is provided by the package ", TO InvariantRing, "."
	    },
	
	PARA {
	    "This optional argument determines the strategy used to
	    compute generating invariants of a finite group action.
	    The default strategy uses the Reynolds operator, however
	    this may be slow for large groups. Setting this argument
	    to ", TO true, " uses the linear algebra method for
	    computing invariants of a given degree by calling ",
	    TO (invariants, FiniteGroupAction, ZZ), ". This may
	    provide a speedup at lower degrees, especially if the
	    user-provided generating set for the group is small."
	    },
	
	PARA {
	    "The following example computes the invariants of the
	    symmetric group on 4 elements. Note that using
	    different strategies may lead to different sets of 
	    generating invariants."
	    },
	
	EXAMPLE {
	    "R = QQ[x_1..x_4]",
	    "L = apply({\"2134\",\"2341\"},permutationMatrix);",
	    "S4 = finiteAction(L,R)",
	    "elapsedTime invariants S4",
	    "elapsedTime invariants(S4,UseLinearAlgebra=>true)"
	},
    
    	SeeAlso => {
	    finiteAction,
	    invariantRing, 
	    isInvariant
	    }	
	}

document {
	Key => {
	    (invariants, FiniteGroupAction, ZZ),
	    (invariants, FiniteGroupAction, List),
	    },
	
	Headline => "basis for graded component of invariant ring",
	
	Usage => "invariants(G,d)",
	
	Inputs => {  
	    	"G" => FiniteGroupAction,
		"d" => ZZ => {"a degree or multidegree"},
	    	Strategy => {"the strategy used to compute diagonal invariants, options are UsePolyhedra or UseNormaliz."}
		},
	Outputs => {
		"L" => List => {"an additive basis for a graded component of the ring of invariants"}
		},

	PARA {
	    "This function is provided by the package ", TO InvariantRing,
	    },
	
	PARA {
	    "When called on a finite group action and
	    a (multi)degree, it computes an additive basis for the
	    invariants of the action in the given degree."},
	PARA {
	    "This function
	    uses an implementation of the Linear Algebra Method
	    described in §3.1.1 of"
	    },
       	UL { 
	    {"Derksen, H. & Kemper, G. (2015).", EM "Computational Invariant Theory", 
	   ". Heidelberg: Springer."}
        },
	PARA { "For example, consider the following
	    action of a dihedral group."
	    },
    	EXAMPLE {
	    	"K=toField(QQ[a]/(a^2+a+1));",
	    	"R = K[x,y]",
		"A=matrix{{a,0},{0,a^2}};",
		"B=sub(matrix{{0,1},{1,0}},K);",
		"D6=finiteAction({A,B},R)",
		"invariants(D6,20)",
		},
	PARA { "It is important to note that this implementation
	    uses the group generators provided by the user,
	    which can be recovered using ", TO (gens,FiniteGroupAction),
	    ". To improve efficiency the user should provide
	    a generating set for the group that is as small as
	    possible."
	    },
	   
    	SeeAlso => {
	    invariantRing, 
	    isInvariant,
	    finiteAction
	    }
	}

document {
	Key => {
	    (invariants, LinearlyReductiveAction, ZZ),
	    (invariants, LinearlyReductiveAction, List)
	    },
	
	Headline => "basis for graded component of invariant ring",
	
	Usage => "invariants(V,d)",
	
	Inputs => {  
	    	"V" => LinearlyReductiveAction,
		"d" => ZZ => {"a degree or multidegree"},
	    	Strategy => {"the strategy used to compute diagonal invariants, options are UsePolyhedra or UseNormaliz."}
		},
	Outputs => {
		"L" => List => {"an additive basis for a graded component of the ring of invariants"}
		},

	PARA {
	    "This function is provided by the package ", TO InvariantRing,
	    },
	
	PARA {
	    "When called on a linearly reductive group action and
	    a (multi)degree, it computes an additive basis for the
	    invariants of the action in the given degree."},
	PARA {
	    "This function uses an implementation of Algorithm
	    4.5.1 in:"
	    },
       	UL { 
	    {"Derksen, H. & Kemper, G. (2015).", EM "Computational Invariant Theory", 
	   ". Heidelberg: Springer."}
        },
    	PARA {
	    "The following example examines the action of the
	    special linear group of degree 2 on the space of
	    binary quadrics. There is a single invariant of degree
	    2 but no invariant of degree 3."
	    },
    	EXAMPLE {
	    	"S = QQ[a,b,c,d]",
		"I = ideal(a*d - b*c - 1)",
		"A = S[u,v]",
		"M = transpose (map(S,A)) last coefficients sub(basis(2,A),{u=>a*u+b*v,v=>c*u+d*v})",
		"R = QQ[x_1..x_3]",
		"V = linearlyReductiveAction(I,M,R)",
		"invariants(V,2)",
		"invariants(V,3)",
		},
	   
    	SeeAlso => {
	    invariantRing, 
	    isInvariant,
	    linearlyReductiveAction
	    }
	}

document {
	Key => {
	    (invariants, LinearlyReductiveAction)
	    },
	
	Headline => "invariant generators of Hilbert ideal",
	
	Usage => "invariants V",
	
	Inputs => {  
	    	"V" => LinearlyReductiveAction,
	    	Strategy => {"the strategy used to compute diagonal invariants, options are UsePolyhedra or UseNormaliz."}
		},
	Outputs => {
		"L" => List => {"of invariants generating the Hilbert ideal"}
		},

	PARA {
	    "This function is provided by the package ", TO InvariantRing,
	    },
	
	PARA {
	    "When called on a linearly reductive group action and
	    a degree, this function returns a list of generators for the
	    Hilbert ideal that are also invariant under the action.
	    This function computes the Hilbert ideal first using ",
	    TO "hilbertIdeal", " then finds invariant generators
	    degree by degree using ",
	    TO "invariants(LinearlyReductiveAction,ZZ)", ".",
	    },
	
    	PARA {
	    "The next example constructs a cyclic group of order 2
	    as a set of two affine points. Then it introduces an
	    action of this group on a polynomial ring in two variables
	    and computes the Hilbert ideal. The action permutes the
	    variables of the polynomial ring."
	    },
	
    	EXAMPLE {
		"S = QQ[z]",
		"I = ideal(z^2 - 1)",
		"M = matrix{{(z+1)/2, (1-z)/2},{(1-z)/2, (z+1)/2}}",
		"sub(M,z=>1),sub(M,z=>-1)",
		"R = QQ[x,y]",
		"V = linearlyReductiveAction(I, M, R)",
		"H = hilbertIdeal V",
		"invariants V",
		},
	PARA {
	    "The algorithm for the Hilbert ideal performs an
	    elimination using Groebner
	    bases. The options ", TO DegreeLimit, " and ",
	    TO SubringLimit, " are standard ", TO gb, " options
	    that can be used to interrupt the computation
	    before it is complete, yielding a partial list of
	    invariant generators for the Hilbert ideal."
	    },
	    
	Caveat => {
	    "Both ", TO "hilbertIdeal", " and ",
	    TO "invariants(LinearlyReductiveAction,ZZ)",
	    " require Groebner bases computations, which could
	    lead to long running times. It might be helpful to
	    run these functions separately.",
	    },
	
    	SeeAlso => {
	    hilbertIdeal, 
	    invariants
	    },
	}

document {
	Key => {
	    [invariants, DegreeLimit],
	    [hilbertIdeal, DegreeLimit]
	    },
	Headline => "GB option for invariants",
	PARA {
	    "The computation of invariants of linearly reductive
	    group actions requires the use of Gröbner bases.
	    These options allow partial control over the computation
	    performed by ", TO (invariants,LinearlyReductiveAction),
	    " and ", TO (hilbertIdeal,LinearlyReductiveAction),
	    ", allowing to terminate the computation after
	    reaching a certain degree. For more information,
	    see ", TO gb, "."
	    },
    	SeeAlso => {
	    (invariants,LinearlyReductiveAction),
	    (hilbertIdeal,LinearlyReductiveAction)
	    }	
	}

document {
	Key => {
	    [invariants, SubringLimit],
	    [hilbertIdeal, SubringLimit]
	    },
	Headline => "GB option for invariants",
	PARA {
	    "The computation of invariants of linearly reductive
	    group actions requires the use of Gröbner bases.
	    These options allow partial control over the computation
	    performed by ", TO (invariants,LinearlyReductiveAction),
	    " and ", TO (hilbertIdeal,LinearlyReductiveAction),
	    ", allowing to terminate the computation after a
	    certain number of invariants are obtained.
	    For more information,
	    see ", TO gb, "."
	    },
    	SeeAlso => {
	    (invariants,LinearlyReductiveAction),
	    (hilbertIdeal,LinearlyReductiveAction)
	    }	
	}

document {
	Key => {isInvariant, 
	    (isInvariant, RingElement, FiniteGroupAction),
	    (isInvariant, RingElement, DiagonalAction),
	    (isInvariant, RingElement, LinearlyReductiveAction)
	    },
	
	Headline => "check whether a polynomial is invariant under a group action",
	Usage => "isInvariant(f, G), isInvariant(f, D), isInvariant(f, L)",
	Inputs => {
	    	"f" => RingElement => {"a polynomial in the polynomial ring on which the group acts"},
	    	"G" => FiniteGroupAction,
		"D" => DiagonalAction,
		"L" => LinearlyReductiveAction
		},
	    
	Outputs => {
		Boolean => "whether the given polynomial is invariant under 
		the given group action"
		},
	    
	"This function is provided by the package ", TO InvariantRing,". ",
    	
	PARA {
	    "This function checks if a polynomial is invariant
	    under a certain group action."
	    },
	
	PARA {
	    "The following example defines the permutation action
	    of a symmetric group on a polynomial ring with three
	    variables."
	    },
	
	EXAMPLE {
	    "R = QQ[x_1..x_3]",
	    "L = apply(2, i -> permutationMatrix(3, [i + 1, i + 2] ) )",
	    "S3 = finiteAction(L, R)",
	    "isInvariant(1 + x_1^2 + x_2^2 + x_3^2, S3)",
	    "isInvariant(x_1*x_2*x_3^2, S3)"
		},
    
    	PARA {
	    "Here is an example with a two-dimensional torus
	    acting on polynomial ring in four variables:"
	    },
	
	EXAMPLE {
	    "R = QQ[x_1..x_4]",
	    "W = matrix{{0,1,-1,1}, {1,0,-1,-1}}",
	    "T = diagonalAction(W, R)",
	    "isInvariant(x_1*x_2*x_3, T)",
	    "isInvariant(x_1*x_2*x_4, T)"
		},
	    
         PARA {
	    "Here is another example of a product of two cyclic groups
	    of order 3 acting on a three-dimensional vector space:"
	    },
	
	EXAMPLE {
	    "R = QQ[x_1..x_3]",
	    "W = matrix{{1,0,1}, {0,1,1}}",
	    "A = diagonalAction(W, {3,3}, R)",
	    "isInvariant(x_1*x_2*x_3, A)",
	    "isInvariant((x_1*x_2*x_3)^3, A)"
		},

         PARA {
	    "Here is an example with a general linear group
	    acting by conjugation on a space of matrices
	    (determinant and trace are invariants)."
	    },
	
	EXAMPLE {
	    "S = QQ[a,b,c,d,t]",
	    "I = ideal((det genericMatrix(S,2,2))*t-1)",
	    "R = QQ[x_(1,1)..x_(2,2)]",
	    "Q = (S/I)(monoid R);",
	    "G = transpose genericMatrix(S/I,2,2)",
	    "X = transpose genericMatrix(Q,x_(1,1),2,2)",
	    "N = reshape(Q^1,Q^4,transpose(inverse(G)*X*G));",
	    "phi = map(S,Q);",
	    "M = phi last coefficients N;",
	    "L = linearlyReductiveAction(I, M, R)",
	    "isInvariant(det genericMatrix(R,2,2),L)",
	    "isInvariant(trace genericMatrix(R,2,2),L)"
		}

	    }	

document {
	Key => {reynoldsOperator, (reynoldsOperator, RingElement, FiniteGroupAction),(reynoldsOperator, RingElement, DiagonalAction)},
	
	Headline => "the image of a polynomial under the Reynolds operator",
	
	Usage => "reynoldsOperator(f, G), reynoldsOperator(f, D)",
	
	Inputs => {
	    	"f" => RingElement => {"a polynomial in the polynomial ring of the given group action"},
	    	"G" => FiniteGroupAction,
		"D" => DiagonalAction
		},
	    
	Outputs => {
		RingElement => {"the invariant polynomial which is the image of the given 
		    polynomial under the Reynolds operator of the given finite group action or the given torus action"}
		},
	    
	"This function is provided by the package ", TO InvariantRing,". ",
	
	PARA {
	    "The following example computes the image of a polynomial under the
	    Reynolds operator for a cyclic permutation of the variables."
	    },
    	
	EXAMPLE {
	    "R = ZZ/3[x_0..x_6]",
	    "P = permutationMatrix toString 2345671",
	    "C7 = finiteAction(P, R)",
	    "reynoldsOperator(x_0*x_1*x_2^2, C7)",
		},
       PARA {
	    "Here is an example computing the image of a polynomial under the Reynolds operator for a two-dimensional torus
	    acting on polynomial ring in four variables:"
	    },
	
	EXAMPLE {
	    "R = QQ[x_1..x_4]",
	    "W = matrix{{0,1,-1,1}, {1,0,-1,-1}}",
	    "T = diagonalAction(W, R)",
	    "reynoldsOperator(x_1*x_2*x_3 + x_1*x_2*x_4, T)",
		},
	        
	
	    }

document {
	Key => {definingIdeal,
	     (definingIdeal, RingOfInvariants)},
	
	Headline => "presentation of a ring of invariants as polynomial ring modulo the defining ideal",
	
	Usage => "definingIdeal S",
	
	Inputs => {
	    	"S" => RingOfInvariants,
		Variable => "name of the variables in the polynomial ring."
		},
	    
	Outputs => {
		Ideal => {"which defines the ring of invariants as a polynomial ring modulo the ideal."}
		},
	    
	"This function is provided by the package ", TO InvariantRing,". ",
	
	PARA {
	    "This method presents the ring of invariants as a polynomial ring modulo the defining ideal. The default variable name in the polynomial ring is ",TT "u_i",". You can pass the variable name you want as optional input."
	    },
    	
	EXAMPLE {
		"R = QQ[x_1..x_4]",
		"W = matrix{{0,1,-1,1},{1,0,-1,-1}}",
		"T = diagonalAction(W, R)",
		"S = R^T",
		"definingIdeal S",
		},
	    }
	
	
document {
	Key => {RingOfInvariants},
	
	Headline => "the class of the rings of invariants under the action of a finite group, an Abelian group or a linearly reductive group",
	
	"This class is provided by the package ", TO InvariantRing,".",
	
	PARA {
	    	TT "RingOfInvariants", " is the class of rings of invariants when a finite group, an Abelian group or a linearly reductive group acts on a polynomial ring."
	    },
	}
    
    
document {
	Key => {(ambient, RingOfInvariants)},
	
	Headline => "the ambient polynomial ring where the group acted upon",
	
	Usage => "ambient S",
	
	Inputs => {
	    	"S" => RingOfInvariants => {"of the group action being returned"},
		},
	
	Outputs => {
		PolynomialRing => {"where the group acted upon"}
		},
	"This function is provided by the package ", TO InvariantRing,".",
	
	PARA {
	    "This example shows how to recover the polynomial ring when a torus acted upon."
	    },
    	
	EXAMPLE {
		"R = QQ[x_1..x_4]",
		"T = diagonalAction(matrix {{0,1,-1,1},{1,0,-1,-1}}, R)",
		"S = R^T",
		"ambient S"
		},
	    }
	
document {
	Key => {(hilbertSeries, RingOfInvariants)},
	
	Headline => "Hilbert series of the invariant ring",
	
	Usage => "hilbertSeries S",
	
	Inputs => {
	    	"S" => RingOfInvariants,
		},
	    
	Outputs => {
		Divide => {"the Hilbert series of the invariant ring as a module over the ambient polynomial ring."}
		},
	    
	"This function is provided by the package ", TO InvariantRing,". ",
	
	PARA {
	    "This method computes the Hilbert series of the ring of invariants."
	    },
    	
	EXAMPLE {
		"R = QQ[x_1..x_4]",
		"W = matrix{{0,1,-1,1},{1,0,-1,-1}}",
		"T = diagonalAction(W, R)",
		"S = R^T",
		"hilbertSeries S",
		},
	    }

document {
	Key => {UseNormaliz, UsePolyhedra},
	Headline => "option for diagonal invariants",
	"This option is provided by the package ", TO InvariantRing,". ",
	PARA {
	    "The computation of diagonal invariants relies on
	    finding integral points in a convex hull constructed
	    from a weight matrix. This option selects the package
	    used for finding integral points. See ",
	    TO (invariants,DiagonalAction),
	    " for usage."
	    },
	}