-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbapolar.texw
More file actions
2132 lines (1934 loc) · 95 KB
/
bapolar.texw
File metadata and controls
2132 lines (1934 loc) · 95 KB
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
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{amsart}
\usepackage{amsmath,amssymb,amsthm,mathrsfs,microtype}
\usepackage{minted}
\usepackage[margin=1in]{geometry}
\newtheorem{theorem}{Theorem}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{lemma}[theorem]{Lemma}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\ot}{\otimes}
\newcommand{\abs}[1]{\lvert #1 \rvert}
\newcommand{\Abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\norm}[1]{\lVert #1 \rVert}
\newcommand{\code}[1]{\mintinline{python}{#1}}
\DeclareMathOperator{\LT}{LT}
\DeclareMathOperator{\LM}{LM}
\DeclareMathOperator{\Lm}{\textsc{Lm}}
\DeclareMathOperator{\ltcoeff}{\textsc{LtCoeff}}
\DeclareMathOperator{\wt}{wt}
\title{Border apolarity implementation}
\author{Austin Conner}
\begin{document}
\maketitle
\section{Introduction}\label{sec:intro}
Given a tensor $T \in A \ot B\ot C$, a natural number $r$, and a solvable
connected Lie group $B \subset \operatorname{GL}(A) \times \operatorname{GL}(B)
\times \operatorname{GL}(C)$ stabilizing $T$, the routines of this file seek to
practically implement complete enumeration of multigraded ideals $I\subset
\operatorname{Sym}(A^* \oplus B^* \oplus C^*)$ satisfying
\begin{enumerate}
\item \label{Bfixed} I is $B$-fixed
\item \label{inTperp} $I \subset T^\perp$
\item \label{codim} The $(ijk)$-graded component of $I$, $I_{ijk} \subset S^i(A^*)\ot S^j(B^*)
\ot S^k(C^*)$, has codimension $\min (r, \dim S^i(A^*)\ot S^j(B^*) \ot
S^k(C^*))$.
\end{enumerate}
Such ideals may occur in positive dimensional families, so more precisely we
wish to enumerate computational descriptions of families of ideals which
together exhaust all ideals satisfying the conditions. The kinds of families of
ideals manipulated by the program are described in \S\ref{sec:representation}
and called \emph{representable}. A representable family of ideals $I_t$ always
satisfies conditions (\ref{Bfixed}) and (\ref{inTperp}) above, and $t$ ranges
over an affine variety. Hence, the work of the program is to enumerate an
exhaustive list of representable families satisfying condition (\ref{codim}).
The program proceeds by exhaustively enlarging ideals so that condition (\ref{codim}) is
satisfied one multidegree at a time.
\subsection{Overview of algorithm}
The fundamental unit of computation is the routine \code{enumerate_tm} which
does this enlargement in a given multigraded component. More precisely, it takes
as input a representable family $I_t$ and a multidegree $(ijk)$ and produces a list of
representable families which together exhaust the set of ideals which (i)
are of the form $I_t + (p_1,\ldots,p_l)$ for some $t$ and $p_1,\ldots,p_l \in
S^i(A^*)\ot S^j(B^*) \ot S^k(C^*)$ and (ii) satisfy condition (\ref{codim}) in
multidegree $(ijk)$. Moreover, the families output by \code{enumerate_tm} are
parameterized combinatorially by the set of leading monomials of polynomials in
this multidegree. In principle, this routine already is sufficient to perform
full ideal enumeration, as one could fix a list of all the multidegrees and for
each $k$ compute all representable families satisfying (\ref{codim}) in the
first $k$ multidegrees with generators only in these multidegrees. Eventually,
by the Hilbert basis theorem,
% is there more here, some theorem about hilbert functions?
condition (\ref{codim}) will be satisfied in all codimensions. This stopping
condition can be checked computationally by computing the Hilbert series of the
common leading term ideal of the family.
% this is a little imprecise, maybe I really have to pass to irreducible
% parameter spaces and generic leading term ideals to fully justify the stopping
% condition
In practice, we make the enumeration
more tractable via the use of two other routines \code{enumerate_tm_bounded} and
\code{ideal_sum}.
The routine \code{enumerate_tm_bounded} takes as input a multidegree $(ijk)$ and
a representable family $I_t$, say where $t$ ranges over $X$. It computes the
family restricted to the subvariety $Y\subset X$ on which $\operatorname{codim}
(I_t)_{ijk} \le r$. In other words, $t$ is restricted to the subvariety on which
a necessary condition holds for $I_t$ in the family to be contained in one
satisfying (\ref{codim}). We speak of \code{enumerate_tm_bounded} as applying
the $(ijk)$ test.
The routine \code{ideal_sum} takes a pair of families $I_t$ and $J_s$, say where
$t\in X$ and $s\in Y$, and computes the family $I_t + J_s$, where $(t,s) \in X
\times Y$.
A typical approach for border rank lower bounds is to enumerate representable
families satisfying (\ref{codim}) in multidegree (110) and to apply the (210)
and (120) tests to each family. Call the results of this the (110)
\emph{candidates}. For showing $2\times 2$ matrix multiplication has border rank
at least 7, this is already enough, as there are no candidates already at this
stage when $r=6$. If we need to continue, we similarly compute the (101) and
(011) candidates. For each triple of candidates in these multidegrees, we add
them together and apply the (111) test. This approach shows that $3\times 3$
matrix multiplication and the $3\times 3$ determinant polynomial each have
border rank at least 17.
\subsection{Input description}\label{sec:input}
Choose bases of $A$, $B$ and $C$ consisting of weight vectors under the
torus of $B$. The data of the action of $B$ then consists of the weights of
these distinguished basis vectors along with a faithful representation $\mathfrak{n} \to
\mathfrak{gl}(A) \oplus \mathfrak{gl}(B)\oplus \mathfrak{gl}(C)\subset
\mathfrak{gl}(A\oplus B\oplus C)$ of the nilradical $\mathfrak{n}$ of the lie
algebra of $B$. Concretely, $\mathfrak{n}$ and its representation is described
by distinguishing lie algebra generators $x_1,\ldots,x_k \in \mathfrak{n}$ and
providing the matrices of the corresponding actions on the distinguished basis
of $A\oplus B\oplus C$. This data describing the action of $B$ along with $T$
expressed in the distinguished bases is the input to the routines in this file.
% TODO make code correspond to this paragraph. Namely, xs act on primal not on dual
\subsection{Representable families of ideals}\label{sec:representation}
\newcommand{\ba}{\textbf{a}}
\newcommand{\bb}{\textbf{b}}
\newcommand{\bc}{\textbf{c}}
We wish to describe a computationally efficient
representation of Borel fixed multigraded ideals which may depend on parameters.
At core, ideals will be
represented by Gr\"obner bases with homogeneous generators taken from
$T^\perp$. Thus, condition (\ref{inTperp}) will be satisfied by construction.
The issues which must be addressed then are how to efficiently require ideals
are Borel fixed and how to represent parameter
dependence.
\subsubsection{Borel fixed condition}
\label{sec:borelfixed}
Immediately we can ensure ideals considered are torus invariant by
insisting generators are weight vectors. In other words the ideals under
consideration are homogeneous with respect to a finer grading determined by the
torus weights and can be taken to be generated homogeneously.
Now to enforce condition (\ref{Bfixed}), it is necessary and sufficient to
insist that the ideal is closed under the Lie algebra action of the generators
$x_1,\ldots,x_k \in \mathfrak{n}$. One could address this issue in a simple way:
Whenever a new ideal is constructed, recursively consider all pairs of current
ideal generators with Lie algebra generators $x_1,\ldots,x_k$ and adjoin as a
generator the corresponding raising. However, this approach is both slow and
error prone if one tries to make it efficient. We would like to arrange that
Gr\"obner basis computations in the underlying CAS automatically adjoin new
raisings of generators which may be needed. This would remove this burden from
us and also affords us the benefit of the significant engineering effort already
expended to do this kind of task quickly.
Conveniently, this is possible after making some observations. Let $\ba = \dim
A$, $\bb = \dim B$, $\bc = \dim C$, and write $a_1,\ldots, a_\ba \in A^*$,
$b_1,\ldots, b_\bb \in B^*$, $c_1,\ldots, c_\bc \in C^*$ for dual bases to the
distinguished bases of \S\ref{sec:input}. For notational convenience, also let
$n = \ba+\bb+\bc$ and for $1\le i\le n$, let $y_i$ range over the $n$ elements $
a_1,\ldots,a_\ba,b_1,\ldots,b_\bb,c_1,\ldots,c_\bc$. Let $x\in \mathfrak{n}$,
and suppose $x . y_j = \sum_{i=1}^\ba x_{ij} y_i$. The matrix $[x_{ij}]$ is
block diagonal with three diagonal blocks corresponding to the variables of
$A^*$, $B^*$, and $C^*$. Define the associated element $\bar x = \sum_{i,j=1}^n
x_{ij} y_i \partial_{y_j} $ in the Weyl algebra
$W=\CC[y_1,\ldots,y_n,\partial_{y_1},\ldots,\partial_{y_n}]$.
\begin{observation}\label{lieaction}
Suppose $x\in \mathfrak{n}$ and $p \in \CC[y_1,\ldots,y_n] \subset W$.
Then, in $W$, $\bar x p - p \bar x = x . p$.
\end{observation}
\begin{observation}\label{envelopingalgebra}
If $x_1,\ldots,x_k$ generate $\mathfrak{n}$, then the subring of $W$ generated
by $\bar x_1,\ldots, \bar x_k$ is the universal enveloping algebra
$U(\mathfrak{n})$
\end{observation}
Let $S$ denote the subalgebra of $W$ generated by the $y_i$ and $\bar x_i$,
where $x_i$ generate $\mathfrak{n}$, and let $R = \CC[y_1,\ldots,y_n] \subset S$
denote the commutative polynomial ring. Then from Observation \ref{lieaction} it follows
\begin{observation}
If $J \subset S$ is a two sided ideal, then $J\cap R$ is closed under the
action of $\mathfrak{n}$. Moreover, if $I\subset R$ is an ideal then $SIS \cap R$ is the
smallest $\mathfrak{n}$-fixed ideal containing $I$.
\end{observation}
In particular, to compute with only with Borel fixed multigraded ideals, it
suffices to work with two sided ideals of $S$ homogeneously generated by
elements of $R$. How do we work with such objects computationally? If now we
distinguish a vector space basis $x_1,\ldots, x_k$ of $\mathfrak{n}$, then $S$
is the noncommutative polynomial ring with indeterminants
$y_1,\ldots,y_n,x_1\ldots,x_k$ subject to the commutator relations $x_iy_j =
y_jx_i + x_i. y_j$, $x_ix_j = x_jx_i + [x_i,x_j]$, and the $y_i$ commute with
each other. This data makes $S$ into what is called a $G$-algebra
\cite{levandovsky}, and,
in particular, efficient implementations exist for computing Gr\"obner bases of
two sided ideals of $S$.
% There is an element in the Weyl algebra in the indeterminants
% $ a_1,\ldots,a_\ba,b_1,\ldots,b_\bb,c_1,\ldots,c_\bc$ corresponding to any
% element of $\mathfrak{n}$. Namely,
% $\mathbb{C}[a_1,\ldots,a_\ba,b_1,\ldots,b_\bb,c_1,\ldots,c_\bc,
% \partial_{a_1}, \ldots, \partial_{a_\ba},
% \partial_{b_1}, \ldots, \partial_{b_\bb},
% \partial_{c_1}, \ldots, \partial_{c_\bc} ]$
\subsubsection{Representation of parameterized families}
\label{sec:parameterized}
Generators of a parameterized family $I_t \subset \CC[y_1,\ldots,y_n]$ are
essentially represnted as having coefficients in some other polynomial ring, and
we imagine the family to be parameterized by the different choices of values for
the new variables. In other words, a parameterized family $I_t$ is represented
by an ideal $J \subset \CC[y_1,\ldots,y_n,t_1,\ldots,t_k]$. We take the new
indeterminants $t_1,\ldots,t_k$ to have degree zero, so that a homogeneous
family $I_t$ is represented by a homogeneous ideal $J$.
For an family $I_t$ represented by $J$, if $t$ takes a value outside the variety
$X$ cut out by $J\cap \CC[t_1,\ldots,t_k]$, then by the Nullstellensatz $I_t =
(1)$. We therefore adopt the convention that the family $I_t$ corresponding to
$J$ takes parameter values $t$ only inside $X$.
In view of this convention, we say that a family $J'$ is a \emph{restriction} of
$J$ if, for $I' = J'\cap \CC[t_1,\ldots,t_k]$, we have $J' =
J+\CC[y_1,\ldots,y_n,t_1,\ldots,t_k]I'$. Hence, $J$ and $J'$ represent the same
family, but $J'$ is restricted to $X' = V(I') \subset X$.
For $t\in X$,
write $J(t)$ for the ideal in $\CC[y_1,\ldots,y_n]$ resulting from substituting
$t$ into each element of $J$, that is, $J(t)$ is the ideal $I_t$ of the
corresponding family.
% TODO note semicontinuity of codim in t?
Fix a monomial ordering on $\CC[y_1,\ldots,y_n]$.
Condition (\ref{codim})
requires us to reason about Hilbert series of homogeneous ideals, and we will do
so by reducing to Hilbert series of the leading term ideal with respect to this
monomial ordering.
We wish to choose a monomial
order on $\CC[y_1,\ldots,y_n,t_1,\ldots,t_k]$ so that the leading term ideal of
$J$ gives us information about the leading term ideals of each $J(t)$ in the
corresponding family.
It will be sufficient for our purposes to require that the monomial order is a block order
with the variable block $y_1,\ldots,y_n$ greater than the variable block
$t_1,\ldots,t_k$. In other words, we require that $y^{\alpha_1} t^{\beta_1} >
y^{\alpha_2} t^{\beta_2}$ if and only if $y^{\alpha_1} > y^{\alpha_2} $ or
$y^{\alpha_1} = y^{\alpha_2}$ and $t^{\beta_1} > t^{\beta_2}$ for some
fixed monomial order on just the $t$ monomials.
This monomial order has the effect of grouping together monomials
with the same exponent in the variables $y_1,\ldots,y_n$, so it is possible to
read off the coefficient of a leading monomial in the variables $y_1,\ldots,y_n$
as a polynomial in $\CC[t_1,\ldots,t_k]$. More precisely, for $p\in
\CC[y_1,\ldots,y_n,t_1,\ldots,t_k]$, if $\LM(p) = y^\alpha t^\beta$, write
$\Lm(p) = y^\alpha$, and denote by $\ltcoeff(p) \in
\CC[t_1,\ldots,t_k]$ the coefficient of $y^\alpha$ in $p$.
We need to understand how $\LT(J(t))$ can depend on $t$. Say that a
monomial $y^\alpha$ is \emph{trivially missing} if $y^\alpha t^\beta \in \LT(J)$
only if $t^\beta \in \LT(J)$.
If $J\cap \CC[t_1,\ldots,t_k]$ is prime (maximal), for
instance, then $y^\alpha$ is trivially missing if and only if $y^\alpha \notin
\LT(J(t))$ for generic $t$ (for the unique $t$).
% two concerns here (1) how to restrict t to that subvariety so that y^alpha not
% in LT(J(t)) (2) what happens under restriction
% need restriction to not break test already done. actually not a soundness issue though
% (completeness)
% can always just apply necessary tests
% prove all ideals occur at some point in this process also need
We need the following:
\begin{observation}\label{missing}
Let $J'$ be a restriction of $J$. % other conditions?
If $s$ of the largest $m$ monomials in multidegree $(ijk)$ are trivially
missing from $J$, then at least $s$ of the largest $m$ monomials are trivially
missing from $J'$.
In particular, if $s$ of the largest $m$ monomials are trivially missing in
$J$, then at least $s$ of the largest $m$ monomials are not contained in
$\LM(J(t))$ for any $t$.
\end{observation}
\begin{proof}
Let $l = m-s$, $I = J\cap \CC[t_1,\ldots,t_k]$, and $I' = J'\cap
\CC[t_1,\ldots,t_k]$.
Suppose $p_1,\ldots,p_l\in J'$ have $\Lm(p_i)$ pairwise disjoint among the
largest $m$ monomials of multidegree $(ijk)$ and $\ltcoeff(p_i) \notin I'$.
It will be sufficient to show
there exist $l$ polynomials satisfying the same conditions with $J'$ and $I'$
replaced by $J$ and $I$, respectively. For each $i\le l$, there is $q_i$
in the extension of $I'$ so that $p_i' = p_i+q_i \in J$.
We may assume $\ltcoeff(p_i') \notin I$.
If $\Lm(p_i')$ are not pairwise distinct, suppose $\Lm(p_i') = \Lm(p_j')$ with
$\Lm(p_i) > \Lm(p_j)$.
Replace $p_i'$ with $p_i' \ltcoeff(p_j') - p_j' \ltcoeff(p_i')$.
TODO maybe assume $I'$ maximal and argue we never get zero during this
procedure
% procedure assuming I' is maximal and considering smallest (I')^m
% coefficients in
% There are no $\CC[t_1,\ldots,t_k]$ syzygies between the $p_i'$. Indeed,
% suppose $c_1p_1' + \cdots c_l p_l' = 0$, $c_i \in \CC[t_1,\ldots,t_k]$.
% The coefficient of $\Lm(p_1)$ in each of $c_ip_i'$, $i > 1$ is contained in
% $I'$, hence also $c_1p_1' \in I'$. Since $I'$ is prime, we have $c_1\in I'$.
% We may argue similarly by induction that all $c_i \in I'$.
\end{proof}
Let $M$ be a set of monomials of multidegree $(ijk)$.
If a family $J$ contains a polynomial $p$ with $\LT(p) = y^\alpha$ for each
$y^\alpha\in M$ and all monomials of multidegree $(ijk)$ not in $M$
are trivially missing, then in view of observation \ref{missing}, all
ideals $J(t)$ have precisely the monomials of $M$ in the leading
term ideal in multidegree $(ijk)$.
This fact is the basis of how \code{enumerate_tm}
will enumerate all ideals of required codimension in a prescribed multidegree.
Central to this is the ability to restrict a given family to one where a
certain monomial is trivially missing.
If $y^\alpha$ is not trivially missing from $J$, then there is
$p\in J$ so that $\Lm(p) = y^\alpha$ and $\ltcoeff(p) \notin J\cap
\CC[t_1,\ldots,t_k]$.
In particular, in order that a restriction $J'$ of $J$ have $y^\alpha$ trivially
missing, it is necessary for $\ltcoeff(p) \in J'$. Hence, the minimal
restriction $J'$ of $J$ where $y^\alpha$ is trivially missing can be computed by
recursively adjoining such leading terms to $J$. This is carried out in \code{minimal_relations_killing_leading_term}.
% Given a parameterized family $J(t)$ and a monomial $y^\alpha$, let $J_\alpha^0 =
% (\ltcoeff(p) \mid \Lm(p) \le \alpha \text{ and $p$ appears in the reduced
% Gr\"obner basis of $J$}) \subset \CC[t_1,\ldots,t_k]$. For instance, $J_0^0 =
% \CC[y_1,\ldots,y_n] \cap J$ is the set of defining equations of the domain of
% $t$.
% It is clear that $t \in V(J_\alpha^0)$ is a necessary condition that $y^\alpha
% \notin \LT(J(t))$. It need not be sufficient, as under some parameter values,
% $\ltcoeff$'s of polynomials in the ideal may vanish, promoting other monomials
% dividing $y^\alpha$ to be leading. % this might be misleading
% Write $J_\alpha = J+J_\alpha^0$, which corresponds to restricting the family $J(t)$
% to $t\in V(J_\alpha^0)$. We can iterate this restriction process until
% stabilization to obtain $J_\alpha^* = J_{\alpha\cdots\alpha}$.
% However, we have the following, which will be sufficient for our purposes.
% \begin{observation}
% Suppose $y^\alpha$ is a monomial satisfying the property that $y^\alpha
% t^\beta \in \LT(J) \implies t^\beta \in \LT(J)$ for every $\beta$. Then
% $y^\alpha \notin \LT(J(t))$ for generic $t$.
% \end{observation}
% \begin{observation}
% Let $y^\alpha$ be a monomial. If, for each monomial $y^\beta$
% of multidegree strictly smaller than that of $y^\alpha$, $\ltcoeff(y^\beta)$
% is either $J_0$ or $(1)$, then
% \end{observation}
% The hypotheses of the observation can be interpreted as saying $\LT(J)$ is
% independent of parameters inside multigraded components
% With this choice of monomial ordering, some facts will be useful.
% Let $\Sigma$ be an order ideal of multidegrees, that is a set
% closed under taking smaller multidegrees, and let $R_\Sigma$ be the sum of the
% multigraded components corresponding to $\Sigma$.
% We say a family $J(t)$ has
% \emph{leading term ideal independent of parameters on $\Sigma$} if $\LT(J(t))
% \cap R_\Sigma$ is independent of the choice of $t$.
% \begin{observation}
% $J(t)$ has leading term ideal independent of parameters on $\Sigma$
% if and only if $\LT(J)$ has a set of generators $y^{\alpha_i} t^{\beta_i}$
% where $\beta_i = 0$ when $\alpha_i \in \Sigma$.
% % In this case, $\LT(J(t)) \cap R_\Sigma = \LT(J)\cap R_\Sigma$.
% \end{observation}
% \begin{observation}
% Let $J\cap \CC[t_1,\ldots,t_k]$ be prime. Then $\LT(J(t))$ for a generic $t$
% depends only on $\LT(J)$.
% \end{observation}
% \begin{observation}
% Let $y^\alpha$ be a monomial and let $\Sigma$ be the set of multidegrees
% stictly smaller than the multidegree of $y^\alpha$.
% If $J$ has leading term ideal independent of parameters on $\Sigma$,
% Let $p$ be an element of the reduced Gr\"obner basis of $J$, and $\Sigma$ the
% set of multidegrees strictly smaller than the degree of $p$.
% \end{observation}
% % For homogeneous ideals, this property of $I_t$ only depends on the elements of
% % $I_t$ contained in those components
% % Over the course of the ideal enumeration algorithm, it will be required to
% % compute the parameter values $t$ for which a given monomial does not occur in
% % the leading term ideal $I_t$ .
% % \begin{observation}
% % If
% % Suppose $X$ is irreducible. Then
% % $m t^\alpha \in \LT(J)$ for some $\alpha$ if and only if
% % $m \in \LT(J(t))$ for generic $t\in X$.
% % \end{observation}
% % \begin{observation}
% % Suppose $X$ is irreducible. Then
% % $m t^\alpha \in \operatorname{LT}(J)$ for some $\alpha$ if and only if
% % $m \in \operatorname{LT}(J(t))$ for generic $t\in X$.
% % \end{observation}
% % TODO Are there natural conditions on J such that if $X$ is irreducible then
% % the family has constant hilbert function on all of X or just an open subset?
% This observation suggests an algorithm for the task.
% (see, e.g.,
% \code{minimal_relations_killing_leading_term})
\subsubsection{Putting it together}\label{sec:representationlast}
To combine the ideas of \S \ref{sec:borelfixed} and \S \ref{sec:parameterized}
we take as our working ring
$S=\CC[y_1,\ldots,y_n,x_1,\ldots,x_k,t_1,\ldots,t_{k'}]$, where $y_i$ denote the
variables of $A^*$, $B^*$, and $C^*$, $x_i$ are identified with a vector space
basis of $\mathfrak{n}$, and $t_i$ are extra parameters of degree and weight 0.
Here the $y_i$ and $x_i$ satisfy the noncommutative relations described in \S
\ref{sec:borelfixed}, and both sets commute with the $t_i$. The block condition
on the monomial order of \S\ref{sec:borelfixed} here requires that the variable
block $y_1,\ldots,y_n,x_1,\ldots,x_k$ is greater than the variable block
$t_1,\ldots,t_{k'}$.
A family of ideals $I_t$ is representable (see
\S\ref{sec:intro}) when it corresponds to a two-sided ideal $J\subset S$
homogeneously generated (including weight homogeneously) by elements of the
subring $\CC[y_1,\ldots,y_n,t_1,\ldots,t_{k'}]$.
% TODO technically to agree with intro I should require $J \subset Tperp
The notions of restriction of
families, evaluation at $t$, and trivially missing monomials are carried over
unmodified from \S\ref{sec:parameterized}.
In multidegree $(ijk)$ pick an ordering $(m_i)_i$ of the monomials $m_i =
y^{\alpha_i}$ so that if $\wt(y^{\alpha_i}) \le \wt(y^{\alpha_j})$ in the
partial order, then $i \ge j$ (note the order reversal), and if
$\wt(y^{\alpha_i}) = \wt(y^{\alpha_j})$ and $y^{\alpha_i} < y^{\alpha_j}$,
then $i \le j$. Hence, the last monomial on this list is the biggest monomial of
the smallest weight.
Note, there is no harm in choosing the monomial order on $y_1,\ldots,y_n$ so
that it already satisfies these properties. However, this is not strictly
necessary and could impact the performance of the implementation, so we do not
make this requirement.
This order has the property that
adjoining a homogeneous polynomial $p$ to an
ideal $J$ doesn't change the sets of leading coefficients corresponding to
larger monomials than $\Lm(p)$ in $(m_i)_i$.
That is, for $p$ with $\Lm(p) = m_i$ and $j>i$, the sets
$\{\ltcoeff(q) : \Lm(q) = m_j\}$ corresponding to $J$ and $J+(p)$ are
identical.
For such an ordering, and under our new conditions on $J$ we have the following
analogue of observation \ref{missing}:
\begin{observation}\label{missing2}
Let $J'$ be a restriction of a representable family $J$. % other conditions?
If $s$ of the largest $m$ monomials of $(m_i)_i$ in multidegree $(ijk)$ are trivially
missing from $J$, then at least $s$ are trivially missing from $J'$.
% In particular, if $s$ of the largest $m$ monomials are trivially missing in
% $J$, then at least $s$ of the largest $m$ monomials are not contained in
% $\LM(J(t))$ for any $t$.
\end{observation}
The routine \code{get_vorder} chooses a weight basis of $(T^\perp)_{ijk}$ with
pairwise distinct leading monomials and orders them according to the
requirements for the $m_i$ (thus implicitly fixing such a list $(m_i)_i$).
These orderings are used to organize the calculations in \code{enumerate_tm} and
\code{enumerate_tm_bounded}.
\subsection{Software used}
The code is written in Python 3, using the libraries provided by SageMath.
The implementation of $G$-algebras and their arithmetic and ideal computations
is done under the hood by Plural, a kernel extension of the Singular computer
algebra system.
\section{Program Listing}
"
<<complete=False>>=
from itertools import *
from operator import sub
from functools import cache
@
<<complete=False>>=
def lp_look_strict_by_deg(ba,deg_bound=2,Jxi=None):
from operator import concat
from sage.numerical.mip import MIPSolverException
def dfs(Jxi,d):
if d > deg_bound:
yield Jxi
return
J,S,xi = Jxi
core = ba.ideal_constant_generators(J)
mod = ba.zero if core.is_zero() else JDat(ba,core)
tms = tuple(sorted(map(tuple,IntegerVectors(d, len(ba.dims)))))
tmcs = tuple(sorted(map(tuple,IntegerVectors(d+1, len(ba.dims)))))
for Jxiup in ba.get_ideals_for_tm(tms, tmcs, J, S, xi,
lp_interval_length_bound=max(3, 7-d), precise_lp=True, mod=mod):
for res in dfs(Jxiup,d+1):
yield res
return dfs((ba.R0.ideal(side='twosided'),[ba.R0.one()], 0) if Jxi is None else Jxi,1)
def lp_look_strict(ba,deg_bound=2,tm_max_bound=oo,Jxi=None):
from operator import concat
from sage.numerical.mip import MIPSolverException
@cache
def get_tms(d,tmma):
tms = sorted(map(tuple,IntegerVectors(d, len(ba.dims))))
return tuple([tm for tm in tms if max(tm) == tmma])
def dfs(Jxi,d,tmma):
if d > deg_bound:
yield Jxi
return
J,S,xi = Jxi
core = ba.ideal_constant_generators(J)
mod = ba.zero if core.is_zero() else JDat(ba,core)
tms = get_tms(d,tmma)
tmcs = tuple((tm for tma in range(1,tmma+2) for tm in get_tms(d+1,tma)))
for Jxiup in ba.get_ideals_for_tm(tms, tmcs, J, S, xi,
lp_interval_length_bound=max(3, 7-d), precise_lp=False, mod=mod):
for res in dfs(Jxiup,d+1 if tmma == min(d,tm_max_bound) else d,
1 if tmma == min(d,tm_max_bound) else tmma+1):
yield res
return dfs((ba.R0.ideal(side='twosided'),[ba.R0.one()], 0) if Jxi is None else Jxi,1,1)
def three_place_ideals_up_to(ba,d=1,Jxi=None):
def dfs(Jxi,tms,mod=ba.zero):
if len(tms) == 0:
yield Jxi
return
tm = tms[0]
print (tm)
J,S,xi = Jxi
for Jxiup in ba.get_ideals_for_tm([tm], [tm[:s]+(tm[s]+1,)+tm[s+1:] for s in range(3)]
+([(2,2,2)] if sum(tm) == 4 and all(e <= 2 for e in tm) else []),
J,S,xi,search_above = sum(tm) == 2, lp_interval_length_bound = 6
if sum(tm) <= 3 else 2, mod = mod):
if len(tms) == 1 and sum(tm) < d:
ltIlb, ltIub = ba.leading_term_ideal(*Jxiup[:2])
R = ltIlb.ring()
degseries = ltIlb.hilbert_series() == ba.target_hilbert_series_td() and \
ltIub.hilbert_series() == ba.target_hilbert_series_td()
for dnext in range(sum(tm)+1,d+1):
print (dnext)
tmsnext = []
if dnext > 3 and degseries:
# if dnext > sum(tm)+1 and dnext > 3 and degseries:
break
for tmc in IntegerVectors(dnext,3):
tmc = tuple(tmc)
codim_upper_bound = len([m for m in mod.get_vs(tmc) if liftR(m.lm(),R) not in ltIlb]) + ba.tm_codim_tperp(tmc)
codim_noadd_lower_bound = len([m for m in mod.get_vs(tmc) if liftR(m.lm(),R) not in ltIub]) + ba.tm_codim_tperp(tmc)
if codim_upper_bound != ba.r or codim_noadd_lower_bound != ba.r:
tmsnext.append((tmc,codim_upper_bound))
if len(tmsnext) > 0:
break
tmsnext.sort(key = lambda p: (p[1], max(p[0]), p[0]))
print(tmsnext)
tmsnext = [tmc for tmc,_ in tmsnext]
modnext = JDat(ba,ba.ideal_constant_generators(Jxiup[0]))
else:
tmsnext = tms[1:]
modnext = mod
for Jxifull in dfs(Jxiup,tmsnext,modnext):
yield Jxifull
if Jxi is not None:
mod = JDat(ba,ba.ideal_constant_generators(Jxi[0]))
for Jxifull in dfs(Jxi, [(1,0,0),(0,1,0),(0,0,1)], mod):
yield Jxifull
return
cd2 = [ ba.get_ideals_for_tm([(1,1,0)],tmcs=[(2,1,0),(1,2,0)]) ]
cd2.append(ba.get_ideals_for_tm([(1,0,1)],tmcs=[(2,0,1),(1,0,2)]))
cd2.append(ba.get_ideals_for_tm([(0,1,1)],tmcs=[(0,2,1),(0,1,2)]))
for Jxis in lproduct(*map(enumerate,cd2)):
print ('triple',[i for i,Iyi in Jxis])
Jxi = ba.sum_ideals_S([Iyi for i,Iyi in Jxis])
try:
next(ba.get_ideals_for_tm([],[(1,1,1)],*Jxi))
for Jxifull in dfs(Jxi,[(2,0,0),(0,2,0),(0,0,2)] if d >= 2 else []):
yield Jxifull
except StopIteration:
pass
def lp_only_look_nonstrict(ba):
from operator import concat
from sage.numerical.mip import MIPSolverException
tms = [(1,1,0),(1,0,1),(0,1,1)]
tmcss = [((2,1,0),(1,2,0)),
((2,0,1),(1,0,2)),
((0,2,1),(0,1,2))]
ips = [ IntegerProgram(ba.zero.get_linear_program((tm,),tmcs,interval_length_bound=8),
[p.lm() for p in ba.zero.get_vs(tm)])
for lpi,(tm,tmcs) in enumerate(zip(tms,tmcss)) ]
def prunef(psol):
psols = [[] for _ in tms]
for x,v in psol.items():
psols[tms.index(ba.polynomial_tm(x))].append((x,v))
for psol, ip in zip(psols,ips):
if not ip.can_extend_psol(psol):
return False
return True
lp = ba.zero.get_linear_program(((1,1,0),(1,0,1),(0,1,1)),((1,1,1),),
interval_length_bound=4)
xs = [x.lm() for tm in tms for vs in ba.zero.get_vss(tm).values() for x in vs]
@cache
def getJxis(lpi,sol):
tm = tms[lpi]
tmcs = tmcss[lpi]
return list(ba.get_ideals_for_tm((tm,),tmcs,preset_choices=dict(sol)))
for fsol in lp_integer_points(lp,xs,fullsol=False,prunef=prunef):
sols = [{} for _ in tms]
for x,v in fsol.items():
sols[tms.index(ba.polynomial_tm(x))][x] = v
Jxiss = []
for Jxis in product(*[getJxis(lpi,tuple(sorted(sol.items())))
for lpi, sol in enumerate(sols)]):
Jxi = ba.sum_ideals_S(Jxis)
try:
next(ba.get_ideals_for_tm([],[(1,1,1)],*Jxi))
yield Jxi
except StopIteration:
pass
def lp_only_look_strict(ba):
from operator import concat
from sage.numerical.mip import MIPSolverException
tms = [(1,1,0),(1,0,1),(0,1,1)]
tmcss = [((2,1,0),(1,2,0)),
((2,0,1),(1,0,2)),
((0,2,1),(0,1,2))]
lp = deepcopy(ba.zero.get_linear_program(
((1,1,0),(1,0,1),(0,1,1)),((1,1,1),),interval_length_bound=4))
sols_ss = []
for tm,tmcs in zip(tms,tmcss):
lpcur = ba.zero.get_linear_program((tm,),tmcs,interval_length_bound=6)
xs = [x.lm() for vs in ba.zero.get_vss(tm).values() for x in vs]
ss = SetSystem()
sols_ss.append(ss)
R = PolynomialRing(QQ,'x',len(xs))
bad_condition = R.ideal(1)
for si,sol in enumerate(lp_integer_points(lpcur,xs,fullsol=False)):
print(tm,si)
sol = [m for m,v in sol.items() if v==0]
ss.add_set(sol)
bad_condition = bad_condition.intersection(R.ideal([
R.gen(xs.index(m)) for m in sol]))
print(bad_condition)
for bad in bad_condition.gens():
assert len(bad.exponents()) == 1
assert all(k==1 for i,k in bad.exponents()[0].sparse_iter())
lp.add_constraint(lp.sum(lp[xs[i].lm()] for i,_ in bad.exponents()[0].sparse_iter()) <= bad.degree()-1)
@cache
def getJxis(lpi,sol):
tm = tms[lpi]
tmcs = tmcss[lpi]
preset_choices = {v.lm() : True for v in ba.zero.get_vs(tm)}
preset_choices.update({m.lm() : False for m in sol})
res = list(ba.get_ideals_for_tm((tm,),tmcs,preset_choices=preset_choices))
if len(res) == 0:
sols_ss[lpi].remove_set(sol)
return res
def prunef(psol):
Slohis = [([],set([v.lm() for vs in ba.zero.get_vss(tm).values()
for v in vs])) for tm in tms]
for m,v in psol.items():
lpj = tms.index(ba.polynomial_tm(m))
if v == 0:
Slohis[lpj][0].append(m)
else:
Slohis[lpj][1].remove(m)
return all( any(True for _,si in ss.iter_sets(Slo,Shi) )
for ss,(Slo,Shi)
in zip(sols_ss,Slohis) )
xs = [x.lm() for tm in tms for vs in ba.zero.get_vss(tm).values() for x in vs]
for fsol in lp_integer_points(lp,xs,fullsol=False,prunef=prunef):
sols = [[] for _ in tms]
for x,k in fsol.items():
if k == 0:
sols[tms.index(ba.polynomial_tm(x))].append(x)
sols = [tuple(sorted(sol)) for sol in sols]
Jxiss = [getJxis(lpj,sol) for lpj,sol in enumerate(sols)]
for Jxis in product(*Jxiss):
Jxi = ba.sum_ideals_S(Jxis)
try:
next(ba.get_ideals_for_tm([],[(1,1,1)],*Jxi))
yield Jxi
except StopIteration:
pass
def lp_only_look(ba):
from operator import concat
from sage.numerical.mip import MIPSolverException
tms = [(1,1,0),(1,0,1),(0,1,1)]
tmcss = [((2,1,0),(1,2,0)),
((2,0,1),(1,0,2)),
((0,2,1),(0,1,2))]
lps = []
xss = []
for tm,tmcs in zip(tms,tmcss):
lp = ba.zero.get_linear_program((tm,),tmcs,interval_length_bound=7)
# lp = ba.zero.get_linear_program(tuple(tms),tmcs+((1,1,1),))
# lp = ba.zero.get_linear_program((tm,),tmcs+((1,1,1),))
xs = [x.lm() for vs in ba.zero.get_vss(tm).values() for x in vs]
lps.append(lp_integer_points(lp,xs,fullsol=False))
xss.append(xs)
lp = ba.zero.get_linear_program(((1,1,0),(1,0,1),(0,1,1)),((1,1,1),),interval_length_bound=4)
xs = [x.lm() for tm in tms for vs in ba.zero.get_vss(tm).values() for x in vs]
yss = [[] for _ in range(3)]
sols = [[] for _ in range(3)]
sols_ss = [SetSystem() for _ in range(3)]
remove = set()
@cache
def getJxis(lpi,si):
tm = tms[lpi]
tmcs = tmcss[lpi]
res = list(ba.get_ideals_for_tm((tm,),tmcs,preset_choices=sols[lpi][si]))
if len(res) == 0:
remove.add((lpi,si))
print("REMOVE",remove)
return res
si = 0
while True:
fails = 0
for lpi,(lpx,xsx) in enumerate(zip(lps,xss)):
try:
sol = next(lpx)
print(lpi,si)
yss[lpi].append((lpi,si))
sols[lpi].append(sol)
def getSlohis(psol):
Slohis = [([],set([v.lm() for vs in ba.zero.get_vss(tm).values()
for v in vs])) for tm in tms]
for m,v in psol.items():
lpj = tms.index(ba.polynomial_tm(m))
if v == 0:
Slohis[lpj][0].append(m)
else:
Slohis[lpj][1].remove(m)
return Slohis
def prunef(psol):
return all( any(True for _,si in ss.iter_sets(Slo,Shi)
if (lpj,si) not in remove)
for lpj,(ss,(Slo,Shi))
in enumerate(zip(sols_ss,getSlohis(psol))) if lpi != lpj)
for m,v in sol.items():
if v == 0:
lp.set_max(lp[m],0)
else:
lp.set_min(lp[m],1)
try:
lp.solve()
sols_ss[lpi].add_set([m for m,v in sol.items() if v==0],si)
for fsol in lp_integer_points(lp,xs,fullsol=False,prunef=prunef):
Slohis = getSlohis(fsol)
# assert all(sorted(Slo) == sorted(Shi) for Slo,Shi in Slohis)
sis = [next(ss.iter_sets(Slo,Shi))[1]
for ss,(Slo,Shi) in zip(sols_ss,Slohis)]
Jxiss = [getJxis(lpj,si) for lpj,si in enumerate(sis)]
assert len(Jxiss) == 3
for Jxis in product(*Jxiss):
Jxi = ba.sum_ideals_S(Jxis)
try:
next(ba.get_ideals_for_tm([],[(1,1,1)],*Jxi))
yield Jxi
except StopIteration:
pass
except MIPSolverException:
print("SKIPPING")
pass
for m in sol.keys():
lp.set_max(lp[m],1)
lp.set_min(lp[m],0)
except StopIteration:
fails += 1
if fails == 3:
break
si += 1
@
The Python class \code{BorderApolarity} provides a convenient interface to the
routines of this file which depend on the input data (see \S\ref{sec:input}).
<<complete=False>>=
class BorderApolarity:
def __init__(self, Tinfo, r, basis=True):
self.T, self.dims, self.vwts, self.xs = Tinfo
self.xs = [-x.T for x in self.xs]
self.vwts = -self.vwts
if basis:
self.Bxs = self.xs
else:
self.Bxs = basis_of_lie_algebra(self.xs)
self.r = r
self.F = self.T.base_ring()
self.nvars = sum(self.dims)
self.nvarsx = self.nvars + len(self.Bxs)
self.R0 = self.get_ring()
self.vixs = [0]
for s in self.dims:
self.vixs.append(self.vixs[-1] + s)
self.Tdeg = [0 for i in range(len(self.dims))]
e = self.T.exponents()[0]
for i,k in e.sparse_iter():
self.Tdeg[ next(j for j in range(len(self.dims))
if i < sum(self.dims[:j+1])) ] += k
self.Tdeg = tuple(self.Tdeg)
self.zero = JDat(self,self.R0.ideal())
self.get_ring_exact = cache(self.get_ring_exact)
self.tm_dim = cache(self.tm_dim)
self.tm_dim_tperp = cache(self.tm_dim_tperp)
self.tm_codim_tperp = cache(self.tm_codim_tperp)
self.tm_target_out = cache(self.tm_target_out)
self.target_hilbert_series = cache(self.target_hilbert_series)
self.target_hilbert_series_td = cache(self.target_hilbert_series_td)
self.Tperp = cache(self.Tperp)
@
The function \code{get_ring} implements the logic described in
\S\ref{sec:representation}, namely, it forms the $G$-algebra generated by the
variables $a_1,\ldots,a_\ba$, $b_1,\ldots,b_\bb$,
$c_1,\ldots,c_\bc$, $x_1,\ldots,x_k$, $t_1,\ldots,t_{\text{params}}$ subject to the
appropriate commutator relations and with
degree reverse lexicographic monomial order on the variables
$a_1,\ldots,a_\ba$, $b_1,\ldots,b_\bb$,
$c_1,\ldots,c_\bc$, $x_1,\ldots,x_k$ and $t_1,\ldots,t_{\text{params}}$ seperately,
with products of monomials between these groups ordered lexicographically.
The computation of this algebra is expensive, so
for performance reasons, calling this function actually chooses the
next power of two number of parameters larger than the requested number and
caches the results for the future.
<<complete=False>>=
def get_ring(self,params=0):
if params > 0:
params = next(1<<k for k in range(32) if 1<<k >= params )
return self.get_ring_exact(params)
def get_ring_exact(self, params=0):
print("get_ring_exact",params)
if params > 0:
params = next(1<<k for k in range(32) if 1<<k >= params )
# should give cached rings of power of two size
lets = 'abcdefghijklmnopqrsuvwyz'
B = matrix([x.list() for x in self.Bxs]).T
A = FreeAlgebra(self.F,['%s%d' % (lets[i],j) for i in range(len(self.dims))
for j in range(self.dims[i])] +
['x%d'%i for i in range(len(self.Bxs))] + ['t%d' % j for j in range(params)])
yvs = A.gens()[:sum(self.dims)]
xvs = A.gens()[sum(self.dims):sum(self.dims)+len(self.Bxs)]
rels = {}
for (xv1,x1),(xv2,x2) in combinations(zip(xvs,self.Bxs),2):
x3 = x2*x1 - x1*x2
if not x3.is_zero():
xv3 = sum(e*yv for e,yv in zip(B.solve_right(vector(x3.list())).list(),xvs))
rels[xv2*xv1] = xv1*xv2 + xv3
for (xv,x),(yi,yv) in product(zip(xvs,self.Bxs),enumerate(yvs)):
xy = x*vector(self.F,self.Bxs[0].nrows(),{yi:1})
if not xy.is_zero():
xyv = sum(e*yv for e,yv in zip(xy.list(),yvs))
rels[xv*yv] = yv*xv + xyv
order = TermOrder('degrevlex',sum(self.dims)+len(self.Bxs))
if params > 0:
order = order + TermOrder('degrevlex',params)
return A.g_algebra(rels,order=order)
@
\code{get_vorder} takes a multidegree $ijk$ as argument and
computes a basis of
$(T^\perp)_{ijk}$ as described at the end of \S\ref{sec:representationlast}.
<<complete=False>>=
def x_weight(self, x):
i,j = x.nonzero_positions()[0]
wt = tuple(self.vwts.column(i)-self.vwts.column(j))
for i,j in x.nonzero_positions()[1:]:
assert wt == tuple(self.vwts.column(i)-self.vwts.column(j))
return wt
def weight_le(self, wta, wtb):
dwt = vector(self.F,map(sub,wtb,wta))
u = dwt * self.Xi
return all(e >= 0 for e in u) and u*self.X == dwt
def lm(self, p, toR0 = False):
R = self.R0 if toR0 else p.parent()
if p.is_zero():
return R.zero()
return R.prod(R.gen(x)**k for x,k in
p.lm().exponents()[0][:self.nvars].sparse_iter())
@
<<complete=False>>=
# adjoining these to the ideal will not necessarily zero out the
# corresponding coefficient unless larger monomial
# coefficients of the same weight and degree are not
# affected
# J assumed to be twostd()
def leading_term_coefficients(self,J,p):
ts = []
for q in J.gens():
if not self.lm(q).is_constant() and \
self.R0.monomial_divides(self.lm(q,True),self.lm(p,True)):
ts.append(q.coefficient(self.lm(q)))
return ts
def get_param_ideal(self,J,xi=None):
if xi is None:
xi = J.ring().ngens() - self.nvarsx
if J.ring().ngens() == self.nvarsx:
assert xi == 0
return None,None
R = PolynomialRing(ba.F,J.ring().gens()[self.nvarsx:self.nvarsx+xi],implementation='singular')
I = R.ideal([R(p) for p in J.gens() if self.lm(p).is_constant()])
def coerce(t):
return R(t)
return I,coerce
def family_dimension(self,J,xi):
I,_ = self.get_param_ideal(J,xi)
if I is None:
return 0
return I.dimension()
def lift_param(self,R,t):
tg = t.parent().ngens()
Rg = R.ngens()-self.nvarsx
assert Rg >= tg or all(next(tt.exponents()[0].sparse_iter())[0] < Rg for tt in t.variables())
return R(t(R.gens()[self.nvarsx:self.nvarsx+tg]+(R.zero(),)*(tg-Rg)))
def get_ideals_for_tm(self, tms=[], tmcs=[], J=None, S=None, xi=0,
search_above=True, lp_interval_length_bound=6, precise_lp=False,
preset_choices = {}, mod=None, sound=False):
if mod is None:
mod = self.zero
tms = tuple(tms)
tmcs = tuple(tmcs)
tmmax = reduce(lambda a,b: tuple(map(max,a,b)),tms+tmcs)
gbbound = max([sum(tm) for tm in tms+tmcs])
precise_gb_bound = False
sound_gb = sound or precise_gb_bound
cur_search_above = search_above and sound_gb
# searching above only sound if sound_gb, otherwise, might fail to
# search possibility of including a leading monomial which is possibly
# present but not seen in our generating set
def gb(J):
if not sound_gb or J.ring() is self.R0:
return self.bounded_gb(J,gbbound)
else:
return J.twostd()
if J is None:
J = self.get_ring().ideal(side='twosided')
S = [J.ring().one()]
Jorig = J
xiorig = xi
if precise_gb_bound:
J += [p for i,e in enumerate(tmmax) for p in
self.all_monomials((0,)*i+(e+1,)+(0,)*(len(tmmax)-i-1),J.ring())]
from copy import deepcopy
if sound:
vkstart,vkbelowcnt,wkabove = mod.get_poset_info_for_search(
(), tms+tmcs if cur_search_above else tms)
else:
vkstart,vkbelowcnt,wkabove = mod.get_poset_info_for_search(
tms, tmcs if cur_search_above else ())
vkstart = deepcopy(vkstart)
vkbelowcnt = deepcopy(vkbelowcnt)
tmsvks = set((tm,wt,i) for tm in tms for wt,vs in mod.get_vss(tm).items()
for i in range(len(vs)))