{'fraction_non_alphanumeric': 0.0788714620515594, 'fraction_numerical': 0.019469983775013522, 'mean_word_length': 3.1961043872919817, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 39, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Algorithms And Programming On The Minimal Combinations Of Weights Of Projective Hypersurfaces

This paper designs an alogrithm to compute the minimal combinations of finite sets in Euclidean spaces, and applys the algorithm of study the moment maps and geometric invariant stability of hypersurfaces. The classical example of cubic curves is repeated by the algorithm. Furhtermore the alogrithm works for cubic surfaces. For given affinely indepdent subsets of monomials, the algorithm can output the unique unstable points of the Morse strata if it exists. Also there is a discussion on the affinely dependent sets of monomials.


Introduction
Geometric invariant theory (GIT for short) was founded by Mumford [17] to construct the quotients in algebraic geometry. One of the key ideas is the GIT stability, and [16] gives some elementary methods and examples of analyzing GIT stability. A pragmatic tool to study GIT stability is the Hilbert-Mumford numerical criterion of stability (see [17], Chapter 2, Section 1). There are many works on this topic. Nowadays there are results of GIT stability on much more complicated objects, like [8] and [15].
In the complex analytic setting, the GIT quotients correspond to the symplectic quotients of the preimage of the origin of the moment maps, and this is the theory of symplectic reduction (see [12] and [14]). Furthermore, [18], [12] and [11] showed that the Hesselink's stratification on the unstable set [9] which is given by the positive values of the numerical criterion function coincides with the Morse stratification of the normsquare function of the moment map. This construction and Atiyah's convexity theorem (see [1]) give rise the idea of the variation of GIT (see [6]).
In this work we come back to [12] and [18]. The GIT stability of hypersurfaces is studied by the moment map in Section 10 of [18], especially for cubic curves. The concept of minimal combinations is introduced by [12], to give all the possible positive values of the numerical criterion function, and the index of the Morse stratification of the normsquare of the moment map at the same time. Recently there is a refinement of the Morse stratification (see [13]).
Let V be a complex vector space of dimension n + 1, and P(V ) ≃ P n (C) be the projective space whose affine cone is V . Choose a basis of V , we can consider the action of the complex linear reductive group GL(V ) ≃ GL(n + 1, C) on the projective space P(V ) induced by the right matrix multiplication of GL(V ) on V . For any complex reductive group G, we say G acts linearly on P(V ) if the action of G on P(V ) is given by a linear representation ρ : G → GL(V ). In general, the quotient space P(V )/G does not exist in any reasonable sense as an algebraic variety. There are various notions of quotients in the category of algebraic varieties. One of the main theorems of geometric invariant theory (see [17]) asserts that there exists a Zariski open subset P(V ) ss of P(V ), so called the set of semi-stable points, such that there is a good categorical quotient, denoted P(V ) ss //G.
According to the Hilbert-Mumford numerical criterion of stability (see [17], Chapter 2, Section 1), there exists a real-valued function M : P(V ) → R, such that P(V ) ss = {x ∈ P(V ) | M (x) ≤ 0}. The complementary set to the semi-stable points, namely P(V ) us = {x ∈ P(V ) | M (x) > 0} is called the set of unstable points.
Given a complex reductive group G acting linearly on P(V ) in the category of algebraic varieties, we can view this as an analytic action of a complex Lie group on a complex manifold. Then the maximal compact subgroup K of the corresponding complex Lie group G acts symplectically on P(V ). This means the image of K under ρ is contained in the unitary group U(V ). That is, we may chose a suitable basis of V such that the action of K is via unitary matrices.
If k is the Lie algebra of K, then its complexification k ⊗ R C is isomorphic to g, the Lie algebra of G. Let g ∨ = Hom C (g, C). There exists a moment map m : P(V ) → g ∨ with respect to the linear action of K on P(V ). The theory of symplectic reduction shows that there is an isomorphism (see [11]) For x ∈ P(V ), let K.x be the K-orbit of x and let K.x be its Zariski closure in P(V ). Let 0 be the zero element of g ∨ , and − → d be the signed distance defined as in (16). For the numerical criterion function M (x), we have (see [18],Lemma 3.1 and Lemma 3.2 or [6], Theorem 2.1.9) According to [12] and [18], it is very important to study the critical points of the function m 2 and the function m T which is the restriction of the moment map on a given maximal torus T of K. For example, an unstable point in P(V ) must be a critical point of m 2 . Let M be the set of T -fixed points, then M is a finite set.
The concept of minimal combinations (see Definition 2.2) was introduced by [12]. For the set A = m(M ) in the Euclidean space t ∨ we define the set of minimal combinations, denoted A B , by the following condition: β ∈ t ∨ belongs to A B if and only if there exists a subset S ⊂ A such that β is the nearest point from 0 to the convex polytope generated by S.
Choose a Weyl chamber t + ⊂ t, and let A B It is shown in [12] that the critical set of m T 2 is the disjoint union of the C β for all β ∈ A B + . The concept of the minimal combinations of a finite set in a Euclidean space is independent to the geometric background from which it originates. In this work we construct the general algorithms to compute the minimal combinations. We make an improvement of the description of the set A B , which is summarized as the following theorem. Theorem 1.1. Let A be a finite set in a Euclidean space. Let A B be the set of minimal combinations of A. If β ∈ A B and β / ∈ A, then there exists an affinely independent subset S ⊂ A, such that ♯(S) ≥ 2, the point β is the nearest point from 0 to the convex polytope C(S) generated by S, and β is contained in the relative interior of C(S).
Based on this theorem, we construct an algorithm for computing A B , and realize it in SAGE. Then we apply it to the GIT stability and moment map problem for projective hypersurfaces. This time G = SL(n, C) and V = Sym d ((C ∨ ) n ) is the n+d−1 d -dimensional C-vector space of n variables homogeneous polynomials of degree d. The moment map is explicit for this situation (see [18], Lemma 10.1). This paper is orgainzed by the following. In Section 2 we introduce the concept of minimal combinations, independent with the geometric background which it comes from. We prove our main result Theorem 2.1, and design Algorithm 1 to compute the minimal combinations. In Section 3 we illustrate the geometric backgrounds of the symplectic reduction theory of hypersurfaces. In order to compute some concrete results, we prove Corollary 3.1. In Section 4 and Section 5, we program Algorithm 1 and Corollary 3.1 for the problem of GIT stability and the moment maps of cubic curves and cubic surfaces by SAGE. In Section 6 we discuss an example for what may happen if the the set of monomials is affinely dependent. We affiliate the SAGE notebook in the end of the paper.

Algorithms on Minimal Combinations
Let S be a finite set in the n-dimensional Euclidean space R n . Later on we will only consider the case when all the points of S have integer coordinates, in this section we do not have this assumption. Let C(S) be the convex polytope generated by S. Let O = (0, . . . , 0) be the origin of R n . By [7], Lemma 3.1, there exists a unique point w S , such that x . (1) by (1), we can define the map of the shortest point as where w S is defined as (1).
Definition 2.1 is well defined because of the existence and uniqueness of w S . The point τ (S) is the shortest point of C(S). Obviously, the function τ : S → R, S → τ (S) is a decreasing function with respect to the partial order "⊂" on S . That is, if S 1 ⊂ S 2 , then Definition 2.2 (see [12]). Let A ∈ S and let P(A) = 2 A \{∅} be the set of non-empty subsets of A.

The set
is called the minimal combination of A, elements of A B are called the minimal combinations of A.
Remark 2.1. The Definition 2.2 is well defined. In fact, since A is a finite set, any non-empty subset S ∈ P(A) is also finite. Furthermore, we have C(S) ⊂ C(A) because S ⊂ A, thus O / ∈ C(A) implies that O / ∈ C(S), so S ∈ S . The set A B is the set of the nearest points from the origin O to the convex sets which are generated by the non-empty subsets of A.
We will give an algorithm to compute A B , but before that, let us give a better description of A B .
be the affine cone of S, we have Aff(S ′ ) = Aff(S).
On the other hand, we have C(S ′ ) ⊂ C(S) because S ′ ⊂ S. Then y ≤ τ (S ′ ) for all y ∈ C(S ′ ), in particular, we have x ≤ τ (S ′ ) . But τ (S ′ ) is the unique shortest point in C(S ′ ), so we have Let ♯(S) be the cardinality of S. In Lemma 2.1, we have because any n + 2 points in R n are affinely dependent. Thus Let S = {x 1 , . . . , x s } ∈ S . For i = 1, . . . , s, regard the points x 1 , . . . , x s of S as column vectors in R n . Let B i be the matrix (x j − x i | j = 1, 2, . . . , s, j = i) whose columns are x j − x i for i = 1, . . . s. Let [10]). Notations as above. For any x ∈ Aff(S), let I be the n × n identity matrix, the point is independent to the choice of x and the index i, and x * is the unique nearest point from the origin O to the affine subspace Aff(S).
Proof. Let y = 0 in the proof of the lemma in [10].
where x * is defined as in (6) is called the minimal square map. The point σ(S) is called the minimal square of S.
be the relative interior of the convex polytope C(S). By assumption we have τ (S) ∈ C(S) • and σ(S) / ∈ C(S). The set S is affinely independent, so dim Aff(S) = dim C(S) = s − 1.
The polytope C(S) is homeomorphic to the s − 1 dimensional unit ball B s−1 . Topologically, the affine space Aff(S) is homeomorphic to the s − 1 dimensional Euclidean space R s−1 . The polytope C(S) is embedded in Aff(S) in the unit ball. By point set topology, any path connecting τ (S) and σ(S) will have a non-empty intersection with the boundary In particular, there exists a point P on the boundary ∂C(S) that lies on the segment σ(S) τ (S) connecting σ(S) and τ (S). Since σ(S) τ (S) ⊂ Aff(S) and σ(S) ⊥ Aff(S), we have σ(S) ⊥ σ(S) τ (S). The point P is on the boundary ∂C(S), and τ (S) ∈ C(S) • , σ(S) / ∈ C(S), so P = σ(S) and P = τ (S) (See Fig. 1 Obviously OP < τ (S) , but this contradicts with the definition of τ (S) that it will be the shortest point in C(S). Finally, there exists i ∈ {1, . . . , s}, such that λ i = 0.
Let k be any positive integer. Define

From (5) we have
Theorem 2.1. Let A ∈ S and let S = {x 1 , . . . , x s } be a non-empty affinely independent subset of A.
and this is the unique convex combination of τ (S) with respect to S, so ν i = 0 for some i ∈ {1, 2, . . . , s}.
Otherwise ν i < 0 for some i ∈ {1, 2, . . . , s}. This time σ(S) / ∈ C(S). By the contradiction of As a subset of an affinely independent set S, the set S ′ is also affinely independent. But τ (S) = 0 implies that (1) Let S = {x 1 , . . . , x n+1 } ∈ S be an affinely independent set such that ♯(S) = n + 1. Then C(S) is homeomorphic to the unit ball in R n . By the same argument of the proof of Lemma 2.3, we have In sum, we design an algorithm to compute A B k for k = 1, . . . n according to (10).
Define a total order "≺" on D k , and write D k as We will give examples of this algorithm for the geometric invariant theory stability of projective hypersurfaces later in this work.

Moment Maps and Minimal Combinations of Weights of Hypersurfaces
This section is according to [17], [12] and [18]. First we introduce some notations. Let R n = C[ x 1 , . . . , x n ] be the ring of complex polynomials of n variables x 1 , . . . , x n . Let Z n . . x i n n be the monomial of x = (x 1 , . . . , x n ). Then any element in R n could be written as where c i1,...,in = c α ∈ C for α ∈ Z n + and c α = 0 for all but finitely many α ∈ Z n + . Let |α| = i 0 + · · · + i n for α = (i 1 , . . . , i n ). Let R d n be the set of homogeneous polynomials of degree d in R n . Let W d = {α ∈ Z n + | |α| = d}, then an element in R d n is of the form , we also denote the image of f ∈ P d n by f , and say f ∈ P d n . Let M n (C) be the ring of n × n complex square matrices. Denote A = (a ij ) n×n ∈ M n (C) as the matrix whose (i, j)-th entry is a ij ∈ C for i, j = 1, . . . , n. Consider the right action of the general linear group GL(n, That is, if we substitute the linear transformation x → x A, or equivalently x i a ij for i = 1, . . . , n into (11), and let then the parenthesizes on the right hand side of (12) are linear transformations. If we expand them, the total degree will not change. Thus we have A.f ∈ P d n , and f → A.f, ∀A ∈ GL(n, C) defines a GL(n, C)-action on P d n , we call it the right action. With this action, we can define the right action of any subgroup of GL(n, C) on P d n . In particular, we consider right actions of the special linear group SL(n, C) = {A ∈ GL(n, C) | det A = 1} and the special unitary group SU(n) = {A ∈ SL(n, C) | A † A = I} on P d n . Here I is the n × n identity matrix, and if A = (a ij ) n×n ∈ M n (C), then A † := (a ji ) n×n ∈ C is the conjugate transpose matrix of A, so SU(n) is the group of unitary matrices of determinant 1. For these linear groups, the corresponding Lie algebras are gl(n, C) = M n×n (C), sl(n, C) = {A ∈ gl(n, C) | tr(A) = 0} where tr(A) is the trace of the matrix A, and su(n) = {A ∈ sl(n, C) | A † + A = 0} , the set of skew-hermitian matrices of trace 0. Lemma 3.1 (See [18]). Define an inner product " , " on R d n as: 1. The set of monomials M d forms an orthogonal basis of R d n , so x α , x β = 0 if α = β, α, β ∈ W d .
2. Let α = (i 1 , . . . i n ) ∈ W d , then Then this inner product is SL(n, C)(also SU(n))-invariant. It induces an SL(n, C)(also SU(n, C))invariant inner product on P d n . Theorem 3.1 (See [18]). Let f = α∈W d c α x α ∈ P d n , define the Hessian H(f ) of f as the hermitian matrix whose (i, j)-th entry is Then the map m : is a moment map of P d n under the SU(n, C)-action. Remark 3.1. The norm and the inner product on the right hand side of (13) are defined as in Lemma 3.1. We will not introduce the general theory of symplectic reduction and its relation to geometric invariant theory, so Theorem 3.1 should be regard as the definition of the moment map here. For more details on symplectic geometry, see [19]. But we should notice that the original definition of the moment map is a map m : P d n → su(n) ∨ where su(n) ∨ = Hom C (su(n), C) is the dual vector space of su(n). Since sl(n, C) is semi-simple, the Killing form B(α, β) = Re(tr(αβ)) ∀α, β ∈ sl(n, C) is non-degenerate and gives an identification sl(n, C) → sl(n, C) ∨ , α → B(α, ·)/B(α, α). Under this isomorphism, a skew-hermitian matrix will be identified to a hermitian matrix, so su(n) ∨ ≃ √ −1su(n) where √ −1su(n) is the set of hermitian matrices of trace 0.

Thus, let
Proof. Let δ lk be the Kronecker notation of l and k.
In general, let (V, · ) be a metric vector space. For any x, y ∈ V , let d(x, y) = x − y be the distance from x to y. Let U be a subset of V , then for any x ∈ V , the distance from x to U is defined as d(x, U ) = inf y∈U d(x, y). Now, define the signed distance where U c = V \U . For our case, the space su(n, C) is equipped with a metric by the Killing form, and let d be the distance according to this metric, and − → d be the signed distance of d. For f ∈ P d n , let O(f ) be the SL(n, C)-orbit of f in P d n , and let O(f ) be the closure of O(f ) in P d n .
Theorem 3.2 (See [6]). Let O be the 0 element of su(n). Define the real-valued function Then M equals to the Hilbert-Mumford numerical criterion of geometric invariant theory stability function of the SL(n, C)-action on P d n .
Remark 3.2. According to geometric invariant theory [17], the projective variety P d n will be decomposed as a disjoint union P d n = P d n ss ⊔ P d n us with respect to the right action 1 by SL(n, C), where P d n ss is the set of so-called semi-stable points, and P d n us is the set of so-called unstable points.
The function M is the Hilbert-Mumford numerical criterion of geometric invariant theory stability function means that Let T be the maximal subtorus of SU(n) defined by the diagonal matrices, and let t be the Lie algebra of T . Then the inclusion map of Lie algebras t ⊂ su(n) induces the restriction map on the dual spaces Res : su(n) ∨ → t ∨ . We have shown that su(n) ∨ ≃ √ −1 su(n), thus t ∨ ≃ √ −1 t, and these identifications give a restriction map Res : Since √ −1 t consists diagonal hermitian matrices, all the matrices in √ −1 t will have real entries on their diagonals. If we regard diag(λ 1 , . . . , λ n ) ∈ √ −1 t as the vector (λ 1 , . . . , λ n ) ∈ R n , then √ −1 t is isomorphic to the hyperplane in R n defined by λ 1 + · · · + λ n = 0. The restriction of the metric on su(n) induced by the Killing form on √ −1 t is just the Euclidean norm (λ 1 , . . . , λ n ) 2 = λ 2 1 + · · · λ 2 n . We say α ⊥ β in √ −1 t if α, β = 0 under this norm.  [12] and Chapter 8 of [17]). Choose a Weyl chamber

the set of minimal combinations of A as Definition 2.2 and let
and let summarizing the Chapter 3 in [12], we have Lemma 3.2 (See [12]). The set of critical points of m T 2 equals to the disjoint union β∈A B For any β ∈ A B + and for any f ∈ C β , we have m T (f ) 2 = β 2 and M (f ) = β .
We need the following formula.
Lemma 3.3 (see [18], Corollary 10.1.1). Let If m(f ) is diagonal, then Note that α∈W d |c α | 2 = f 2 , so we have m(f ) ∈ C(A). We prove the following corollary to find Corollary 3.1. Let U be a non-empty subset of W d which satisfies the following conditions: Let β = α∈U q α m(x α ), α∈U q α = 1, then Let f = α∈U c ′ α x α , according to Lemma 3.3, we solve the equation m(f ) = β, that is, The "β" in Corollary 3.1 satisfies that β ∈ A B k , where A B k is defined as (9) and k = ♯(S). Let A B +,k = A B + ∩ A B k , our goal for studying on P d n is the following:

Stability of Cubic Curves
The situation n = d = 3 has been studied by [18], in this section we repeat this example by our algorithm. The computation is complicated, but still could be finished by hand. In this case, let R 3 = C[x, y, z] be the polynomial ring of three variables x, y, z, let x = (x, y, z). Let R 3 3 be the homogeneous degree 3 part of R 3 . It is a 10 dimensional vector space spanned by the set of monomials M 3 = { x 3 , y 3 , z 3 , x 2 y, xy 2 , y 2 z, yz 2 , x 2 z, xz 2 , xyz }.
A general element in R 3 3 or P 3 3 is of the form  Fig. 2).
The result for A B +,1 is summarized as Table 1. The first column lists the elements β ∈ A B +,1 . For each β, the second column lists the affinely independent sets S such that τ (S) = β and β ∈ C(S) • . It is possible that there exist more than one such S corresponding to the same β. The polynomial f ∈ P 3 3 in the third column are computed according to Corollary 3.1, and M (f ) is the length of β which also equals to the value of the numerical criterion function M . For k = 2, there are five elements 1 2 , For each β ∈ A B +,2 as circles in the picture, the dashed lines is the hyperplane which contains β and perpendicular to β.
By (18), we get that up to ±1 and ± √ −1 multiplication on the coefficients and multiply the maximal common demonstrators, Warning! This formula only works under the assumption that m(f β ) is diagonal, so we have to double check that m(f β ) = β. If not, then there is no solution in this convex polytope. But we can check that this is true for f β = 3 √ 3x 2 z + √ 5y 3 After running the same process for β = 1, − 1 2 , − 1 2 , we have Coming to β = 1 2 , 1 2 , −1 . This situation is different from the previous two. First, the corresponding elements are x 3 , x 2 y, xy 2 , y 3 . Thus linear combinations of them do not contain the variable y. According to [18], these points come from the moment map of lower dimension. Here they come from SL(2, C)-representations. They are binary forms of degree 3. Second, there are four points on the hyperplane which is perpendicular to β (see Figure6), so  we have f β = x 2 z + xy 2 whose moment matrix is β.

Stability of Cubic Surfaces
This time we consider the situation n = 4 and d = 3. Let R 4 = C[x, y, z, w] be the polynomial ring of four variables x, y, z, w, let x = (x, y, z, w). The homogeneous degree 3 part R 3 4 is a vector space generated by the set of monomials M 4 ={w 3 , w 2 x, wx 2 , x 3 , w 2 y, wxy, x 2 y, wy 2 , xy 2 , y 3 , w 2 z, wxz, x 2 z, wyz, xyz, y 2 z, wz 2 , xz 2 , yz 2 , z 3 }. We consider the SL(4, C)(and SU(4))-action on the projective space P 3 4 . The elements in the set W 4 = {(i 1 , i 2 , i 3 , i 4 ) ∈ Z 4 + | i 1 + i 2 + i 3 + i 4 = 3} have four coordinates. How ever they all lie in a hyperplane defined by i 1 + i 2 + i 3 + i 4 = 3, so we can draw them in three space. As before, we write β as a convex combination of the points in S. That is, where a, b, c, d ∈ R and a + b + c + p = 1.
Since a+b+c+p = 1, we have a+b+c = 1−p. Thus is right hand side of (21) is a convex combination. But {s 1 , s 2 , s 3 } is an affinely independent set, so the solution of (21) is unique. Obviously we have Let q = 1 − p, then (20) becomes β = q(s 1 + s 2 + s 3 ) + pO where p, q ∈ R and p + q = 1. Even though S does not satisfy the condition in Corollary 3.1, we can still assume that f β is of the form λ 1 x 3 + λ 2 y 3 + λ 3 z 3 + µ 1 xyz.
If f β = β = diag(0, 0, 0), then at least f β is diagonal, so Lemma 3.2 still works. If we force us to use Corollary 3.1, then (22) implies that Thus, let then we can check that the moment matrix m(f β ) of (24) is diag(0, 0, 0). For the situation of Corollary 3.1 which is discussed for most part of this paper, the solution is unique for each S if it exists. However, the family (24) tell us what may happen for affinely dependent S, there may exists a family, not necessarilly one dimensional, of critical points of the function m 2 .
In fact (24) is a generic family of plane cubics called the Hesse's canonical equations of cubic curves (see [4]), and is dicussed in [18].