On multi-index filtrations associated to Weierstrass semigroups

The aim of this paper is to review the main techniques in the computation of Weierstra\ss semigroup at several points of curves defined over perfect fields, with special emphasis on the case of two points. Some hints about the usage of some packages of the computer algebra software \textsc{Singular} are also given.


INTRODUCTION
There are several classical problems in the theory of algebraic curves which are interesting from a computational point of view. One of them is the computation of the Weierstraß semigroup of a smooth projective algebraic curve χ at a certain rational point P, together with a rational function f m ∈ F( χ) regular outside P and achieving a pole at P of order m, for each m in this semigroup. This problem is solved with the aid of the adjunction theory for plane curves, profusely developed by A. von Brill and M. Noether in the 19th century (see [3], [20]) so that we assume the knowledge of a singular plane birational model χ for the smooth curve χ.
Given a smooth projective algebraic curve χ (over a perfect field F) and a set P 1 , . . ., P r of (rational) points of χ, we consider the family of finitely dimensional vector subspaces of F(χ) given by L (mP) = L (m 1 P 1 + m 2 P 2 + . . . + m r P r ), where m = (m 1 , . . ., m r ) ∈ Z r . This family gives rise to a Z r -multi-index filtration on the F-algebra A of the affine curve χ \ {P 1 , . . . , P r }, since one has A = m∈Z r L (mP). This multifiltration is related to Weierstraß semigroups (with respect to several points in general, see Delgado [10]) and, in case of finite fields, to the methodology for trying to improve the Goppa estimation of the minimal distance of algebraic-geometrical codes, see for instance Carvalho and Torres [9]. A connection of that filtration with global geometrical-topological aspects in a particular case was shown by Campillo, Delgado and Gusein-Zade [6]. Poincaré series associated to this filtrations in particular cases were studied by the author in [19] Thus, a natural question is to provide a computational method in order to estimate the values of dim F L (mP) = ℓ(mP) for m ∈ Z r . More precisely, it would be convenient to estimate and compute values of type ℓ((m + ε)P) − ℓ(mP) where ε ∈ Z r is a vector whose components are 0 or 1. This can be done by extending the method developed by Campillo and Farrán [7] in the case r = 1, based on the knowledge of a plane model χ for χ (with singularities) and representing the global regular differentials in terms of adjoint curves to χ.
The paper is organised as follows: Sections 2 and 3 are devoted to fix the algebraicgeometrical prerequisites. Section 4 deals with the study of more specific questions concerning to our purpose, namely the adjunction theory of curves, with the remarkable Brill-Noether Theorem. In Section 5 we define the Weierstraß semigroup at several points and describe two methods to compute values of the form ℓ((m + ε)P) − ℓ(mP). The last section is devoted to show and explain some procedures implemented in SINGULAR based on Section 5.
Notice the practical relevance of these ideas in view of the algebraic-geometric coding theory: the Weierstraß semigroup plays an important role in the decoding procedure of Feng and Rao, see e.g. Campillo and Farrán [8], or Høholdt, van Lint and Pellikaan [15].

TERMINOLOGY AND NOTATIONS
Let F be a perfect field, and let F a fixed algebraic closure of F. Let χ be an absolutely irreducible projective algebraic curve defined over F. We distinguish three types of points on χ, namely the geometric points, i.e. those with coordinates on F; the rational points, i.e. those with coordinates on F; and the closed points, which are residue classes of geometric points under the action of the Galois group of the field extension F/F, namely P := {σ (p) : σ ∈ Gal(F/F)}, where p is a geometric point. Notice that closed points correspond one to one to points on the curve χ viewed as an F-scheme which are closed for the Zariski topology. Every closed point has an associated residue field F ′ which is a finite extension of F. The degree of a closed point P is defined as the cardinal of its conjugation class, which equals the degree of the extension F ′ /F. In particular, P is rational if and only if deg P = 1.
Let us assume χ to be non-singular (or, equivalently, smooth, since F is perfect). Let F(χ) be the field of rational functions of χ. Let P be a closed point on χ. The local ring O χ,P of χ at P with maximal ideal m χ,P is therefore a discrete valuation ring with associated discrete valuation v P . An element f ∈ O χ,P is said to vanish at P (or to have a zero at P) if f ∈ m χ,P . A rational function f such that f / ∈ O χ,P is said to have a pole at P. The order of the pole of f at P is given by |v P ( f )|.
A rational divisor D over F is a finite linear combination of closed points P ∈ χ with integer coefficients n P , that is, D = ∑ P n P P. If n P ≥ 0 for all P, then D is called effective. We define the degree of D as deg D := ∑ P n P deg P, and the support of D as the set supp(D) = P ∈ χ closed | n P = 0 . The set of rational divisors on F form an abelian group D(F). Rational functions define principal divisors, namely divisors of the form A rational divisor D = ∑ n P P defines a F-vector space that is, the set of rational functions f with poles only at the points P with n P ≥ 0 (and, furthermore, with the pole order of f at P must be less or equal than n P ), and if n P < 0 such functions must have a zero at P of order greater or equal than n P . The dimension if and only if f = λ g for a constant λ ∈ F. Therefore the set |D| of effective divisors equivalent to D can be identified with the projective space P L (D) of dimension ℓ(D) − 1. The set |D| is called a complete linear system of D.
Let Ω F (F(χ)) be the module of differentials on F(χ). A differential form ω ∈ Ω F (F(χ)) defines a divisor (ω) := ∑ P ord P (ω)P, called a canonical divisor. A rational divisor D defines again a F-vector space of finite dimension, denoted by i(D). It is a central result in the theory of algebraic curves the interplay of the dimensions ℓ(D) and i(D). The dimension ℓ(D) is bounded in the following sense: There exists a nonnegative integer g such that for any rational divisor D on χ.
Definition 2.2. The smallest integer g satisfying the Riemann's inequality is called the genus of χ.
Riemann's inequality tells us that if D is a large divisor, L (D) is also large. But we can be a bit more precise by using i(D): (Riemann-Roch). Let D be a rational divisor. Then:

RATIONAL PARAMETRIZATIONS
Let F be a perfect field, and let χ be an absolutely irreducible algebraic plane curve defined over F. Let P be a closed point on χ. Let us consider the local ring O := O χ,P with maximal ideal m, and write O for the semilocal ring of the normalisation of χ at P. Finally, letÔ be the completion of O with respect to the m-adic topology. Each maximal ideal of O (or, equivalently, every minimal prime ideal p ofôo) is said to be a branch of χ at P.
Let us now choose an affine chart containing P so that the curve χ has an equation f (X ,Y ) = 0, and set A := F[X ,Y ]/( f (X ,Y )) as the affine coordinate ring. Notice that Since F is perfect, we can apply Hensel's lemma to find a finite field extension K/F such that K ⊆Â P =Ô is a coefficient field forÔ. Moreover, K is the integral closure of F in O.
SinceÔ ⊆Ô ∼ =Ô, one has and we can apply Hensel's lemma again to obtain a finite extension K ′ /K which is a coefficient field for the local ringÔ m . Without loss of generality we can consider P as Y)). This implies the existence of natural morphisms for any local uniformizing parameter t ∈ m \ m 2 . Notice that K can be considered isomorphic to the residue field at P. Preserving these notations, a parametrization of the curve χ at the point P related to the coordinates X ,Y is a K-algebra morphism ρ : being continuous for the (X ,Y )-adic and t-adic topologies and satisfying Im(ρ) ⊆ K ′ and ρ( f ) = 0. This is equivalent to give formal power series ] of the same rational branch. The parametrization σ is said to be derivated from ρ if there is a formal power series τ(u) ∈ K ′′ [[u]] with positive order and a continuous K-algebra morphism The relation ≻ is a partial preorder. Two parametrizations σ and ρ are called equivalent if σ ≻ ρ and ρ ≻ σ . Those parametrizations being minimal with respect to ≻ up to equivalence are called primitive. Equivalent primitive parametrizations are called rational. They always exist and are invariant under the action of the Galois group of the extension K/K. Rational parametrizations are in one to one correspondence with rational branches of the curve (cf. Campillo and Castellanos [5]).

BRILL-NOETHER THEORY FOR CURVES
This section contains a summary of the classic adjunction theory of curves, started by Riemann [21] and developed by M. Noether and A. von Brill in the 19th century.
Let P be a closed point. Let C P be the annihilator of the O-module O/O, i.e.
This set is the largest ideal in O which is also an ideal in O, and it is called the conductor ideal of the extension O/O. Since O is a semilocal Dedekind domain with maximal ideals m Q 1 , . . ., m Q d (where Q i denote the rational branches of χ at P), the conductor ideal has a unique factorisation as ideal in O. The exponents d Q i can be easily computed by means of the Dedekind formula (see Zariski [23]): if (x i (t i ), y i (t i )) is a rational parametrisation of Q i one has Let n : χ → χ ne the normalisation morphism of χ. Notice that χ is nonsingular with We define the effective divisor which is called the adjunction divisor of χ. Notice that A is a well-defined divisor on χ (in fact, if P is nonsingular, there is only one Q ∈ n −1 ({P}) and in this case d Q = 0). This implies in particular that the support of A consists of all rational branches of χ at singular points. Moreover, by setting n P := dim F O/C P we have Let F := F(X 0 , X 1 , X 2 ) be a homogeneous (absolutely irreducible) polynomial of degree d over F which defines the projective plane curve χ. Let F d be the set of all homogeneous polynomials in three variables of degree d. Let i : χ → P 2 F be the embedding of χ into the projective plane and N : χ → P 2 F be the natural morphism given by N = i • n. A rational divisor D on P 2 F such that χ is not contained in supp(D) is called an adjoint divisor of χ if the pull-back divisor N * D satisfies supp(A ) ⊆ supp(N * D) for A the adjunction divisor of χ. We can consider the analogous notion at the level of homogeneous polynomials. For H ∈ F d with F ∤ H one can consider the pull-back N * H, which is actually the intersection divisor on χ cut out by the plane curve defined by H on P 2 F , namely with r Q = ord Q (h) for h ∈ O χ,n(Q) being a local equation of the curve defined by H at the point n(Q). If H satisfies additionally N * D ≥ A , then it will be called an adjoint form on χ, and the curve defined by H will be called an adjoint curve to χ. Notice that adjoint curves there always exists (take for instance the polars of the curve, cf. Brieskorn and Knörrer [2], p. 599).
Let d := deg χ. The differentials gob ally defined at χ are in one to one correspondence with adjoint curves on χ of degree d − 3: The key idea is to realise that the map is injective since n = d − 3 < d; see Gorenstein [11, p. 433]  In practice, we know a priori the equation of the plane curve χ (defined over a perfect field F) given by the form F ∈ F d and the data of a certain divisor R = ∑ Q ′ r Q ′ · Q ′ (for finitely many points Q ′ on χ) which is effective and rational over F, involving a finite number of rational branches Q of χ and their corresponding coefficients. Moreover, we are able to compute the adjunction divisor of χ, A = ∑ Q d Q · Q. Our aim is to interprete the condition of being an adjoint form-called adjoint condition-given by (4.2) in terms of equations. More generally, we are interesting in finding some adjoint form This process is known as computing adjoint forms with base conditions (see [7], §4).
First of all, we choose a positive integer n ∈ N in such a way that there exists an adjoint of degree n not being a multiple of F and satisfying (4.3). A bound for n can be found in Haché [13]. Take then also a form H ∈ F n in a general way, what is nothing else but taking a homogeneous polynomial in three variables of degree n with its coefficients as indeterminates (that is, . Second we compute a rational primitive parametrization X (t),Y(t) of χ at every branch involved in the support of the adjunction divisor A and the divisor R. Next we get the support of the adjunction divisor A from the conductor ideal via the Dedekind formula (4.1). Last we consider the coefficient r Q of the divisor R at Q, and thus the local condition at Q imposed on H by (4.3) is given by with h the local affine equation of H at Q. The inequality (4.4) expresses a linear condition (given by a linear inequation) on the coefficients λ i, j,k of h.
The required linear equations are a consequence of the vanishing of those terms, and when Q takes all the possible values, i.e., all the possible branches of the singular points on χ and of the support of R, we get the linear equations globally imposed by the condition (4.3). An easy reasoning reveals that the number of such adjoint conditions is equal to Take a form H ∈ F 4−3=1 , H(X ,Y, Z) = aX +bY +cZ. First we want to express the adjoint conditions in terms of the coefficients To this end we consider first a local equation for H at P 1 , namely

Consider the local equation for H at P
Hence the adjoint conditions imposed by , Z 2 (t 2 ))) = ord t 2 (ct 3 2 + at 2 + b) ≥ 1. This inequality holds whenever b = 0. Hence b = 0 is another linear equation taking part in the set of adjoint conditions contained in N * H ≥ A + R. We have obtained two adjoint conditions, as we had hoped by (4.5), since 1 2 deg A + deg R = 1 2 · 2 + 1 = 2. We conclude this section with two remarkable results. Let χ be an absolutely irreducible projective plane curve defined over a perfect field F and given by an equation One application of the adjoint forms is the following result, due to Max Noether (he stated it of course not in this way; our version may be found in Haché and Le Brigand [14], Theorem 4.2, and Le Brigand and Risler [18], §3.1): Noether). Let χ, χ ′ be curves as above given by homogeneous equations F(X 0 , X 1 , X 2 ) = 0 and G(X 0 , X 1 , X 2 ) = 0 respectively and such that χ ′ does not contain χ as a component. Then, if we consider another such a curve given by H( This theorem has great importance, and, for instance, allows us to prove the Brill-Noether theorem, which gives a basis for the vector spaces L (D). Readers are referred to [14], Theorem 4.4, for further details. A short remark about notation is needed. For any non effective divisor D we will write D = D + − D − with D + and D − effective divisors of disjoint support. Theorem 4.4 (Brill-Noether). Let χ be an adjoint curve as above with normalization χ. Let A be its adjunction divisor and let D be a divisor on χ rational over F. Moreover, consider a form H 0 ∈ F n defined over F, not divisible by F and satisfying N * H 0 ≥ A + D + . Then where h, h 0 ∈ F(χ) denote respectively the rational functions H, H 0 restricted on χ. Haché and Le Brigand [14] for details).

THE WEIERSTRASS SEMIGROUP AT SEVERAL POINTS
Let χ be an absolutely irreducible projective algebraic plane curve defined over a perfect field F. Let P denote a set of r different points P 1 , . . ., P r on χ. Furthermore, the perfect field F must have cardinality greater or equal to r: ♯F ≥ r. Let χ be the normalization of χ.
Our purpose is to compute the dimensions of the so-called Riemann-Roch quotients: , that is, achieving at the P i poles of order m i . We are going to restrict to the case m i ∈ N, for all i = 1, . . . , r. Such dimensions will be determined by the previous calculus of the Riemann-Roch quotients with respect to P i : where ε i denotes the vector in N r with 1 in the i-th position and 0 in the other ones.
Summarizing, this section deals with the following topics: and an associated function belonging to this quotient vector space when such a dimension is 1.
(c) How to compute the Weierstrasß semigroup at two points. All the statements and proofs of this section can be found in [9], §2.
Obviously Γ P is a subsemigroup of (N, +). Notice that, for mP = m 1 P 1 + m 2 P 2 , the fact that f ∈ L (mP) is equivalent to the inequalities This means: the set of possible orders (⋆) which can be taken by the function f is represented by the shadowed area in the figure (each axis represents one of the two branches): A very important characterization for the non-gaps is given by the following (see [10], p. 629): A basic tool on Weierstraß semigroups is the following Theorem 5.4 (Weierstraß gap theorem). Let χ be a curve of genus g ≥ 1. Let P be a rational branch on χ. Then there are g gaps γ 1 , . . . , γ g such that = 1 and so there exists a regular differential form ω on χ with (ω) ≥ m − ε i and ord P i (ω) = m i − 1 for some i ∈ {1, . . . , r}.
Proposition 5.6. Let χ be a plane curve of genus g, let P be a set of r closed points on χ and set m = (m 1 , . . ., m r ) ∈ N r . If m is a gap, then m 1 + . . . + m r < 2g.
Notice that, for divisors of the form mP = m 1 P 1 + m 2 P 2 , the plane N × N is divided in three parts by the line m 1 + m 2 = 2g as in the figure, namely All the points lying on A and B correspond to values in Γ P , but nothing can be a priory said about the points on C.
5.1. Dimension of the Riemann-Roch quotients with respect to P i and associated functions. We start by computing the dimension of the Riemann-roch quotients associated to the points P i .
\ Ω(mP)] = 1, then this is equivalent to m / ∈ Γ P and also to the existence of an index i with ℓ(mP) = ℓ((m − ε i )P), or, in other words, to the existence of an index i with i((m − ε i )P) = i(mP) + 1; that is, there exists a homogeneous polynomial Assume that m ′ − ε i are the orders of the zeros of ω at P.
\ Ω(mP). The following corollary yields a way to relate the adjunction theory and the computation of the Weierstraß semigroup at several points: A local parametrization of F at P 1 is given by 4 2 + ct 7 2 + ct 10 2 + . . . .

In order to compute dim F L (mP)
L ((m−ε 1 )P) we impose the systems of equations with the adjunction conditions at P 1 :

or, in other words
So the second system does not add any independent condition to the first one; this means, by Corollary 5.8 In order to compute dim F L (mP) L ((m−ε 2 )P) the systems of equations with the adjunction conditions at P 2 are Notice that, in this case, the adjunction divisor does not appear in the inequalities since P 2 does not belong to its support. The second system adds one independent condition to the first one and this means that dim F L (mP) L ((m−ε 2 )P) = 0 again by Corollary 5.8. Example 5.11. Consider the previous example but with m = (4, 6). As m 1 + m 2 = 4 + 6 = 10 > 2g, we know without calculations m ∈ Γ P , i.e., that dim F L (mP) L ((m−ε i )P) = 1 for i = 1, 2. So we will look for the corresponding functions f i,m with poles at P i of order m i for i = 1, 2.
Then we look for a form H 0 of degree n = 5 such that N * H 0 ≥ A + mP. In this case Thus

Dimension of the Riemann-Roch quotients. Computing the dimension of
is an easy task by Corollary 5.8: Proof. It is just to define the map ( f 1 , . . ., f r ) → f 1 + . . . + f r . Then any vector n = (n 1 , . . . , n r ) ∈ N r belongs to N r \ Γ P whenever n i = m, and n j = m j = 0 or n j < m j for j = i. In particular, m is a gap at P i .
Define the usual partial order over N r , that is, for m, n ∈ N r : For r = 2 this is in fact a bijection between the set of gaps at P 1 and the set of gaps at P 2 : Furthermore, m 1 = min n ∈ N * | (n, β m 1 ) ∈ Γ P . More details can be found in Homma and Kim [16] and Kim [17].
We summarize some remarkable facts for the case of two points (r = 2), which will be useful from the computational point of view: (i) All the gaps at P 1 and at P 2 are also gaps at P 1 , P 2 .
(ii) By the Corollary 5.17, for any gap m 1 at P 1 , one has that (m 1 , β m 1 ) are gaps at P 1 , P 2 for β m 1 = 0, 1, . . ., l m 1 , until certain 0 ≤ l m 1 ≤ 2g − 1, with g the genus of the curve and where l m 1 satisfy that l m 1 + 1 is a gap at P 2 . The point (m 1 , l m 1 + 1) is an element of Γ P , which we will call the minimal (non-gap) at m 1 . We will refer to the set of the minimal non-gaps at every gap at P 1 (they will be g, since the number of gaps at P 1 is precisely g) as the set of minimal non-gaps at P 1 . (iii) The gaps obtained of that form, this is, the set (m 1 , β m 1 ) ∈ N 2 \ Γ P | m 1 ∈ N \ Γ P 1 and β m 1 = 0, 1, . . ., l m 1 with l m 1 + 1 ∈ N \ Γ P 2 will be called the set of gaps respect to P 1 . (iv) Similarly, for any gap m 2 at P 2 , one has that (α m 2 , m 2 ) are gaps at P 1 , P 2 for α m 2 = 0, 1, . . ., l m 2 , until some 0 ≤ l m 2 ≤ 2g − 1, with g being the genus of the curve and where l m 2 satisfy that l m 2 + 1 is a gap at P 1 . The point (l m 2 + 1, m 2 ) is an element of Γ P , which we will call the minimal (non-gap) at m 2 . The set of the minimal non-gaps for every gap at P 2 will be called the set of minimal non-gaps at P 2 . The cardinality of such a set is g, since g is the number of gaps at P 2 . (v) The set of gaps (α m 2 , m 2 ) ∈ N 2 \ Γ P | m 2 ∈ N \ Γ P 2 and α m 2 = 0, 1, . . ., l m 2 with l m 2 + 1 ∈ N \ Γ P 1 is called the set of gaps respect to P 2 . (vi) The intersection between the set of gaps respect to P 1 and respect to P 2 is not necessarily empty. In fact, the gaps in the intersection are just the pure gaps at P 1 , P 2 . The minimal non-gaps at P 1 and P 2 provide enough information in order to deduce the Weiestraß semigroup at P 1 , P 2 . Recall that we have already described algorithms to compute the dimension (and associated functions, when is possible) of the Riemann-Roch quotients L (mP) L ((m−ε i )P) for given m, i ∈ {1, 2} and two rational points P 1 , P 2 on an absolutely irreducible projective algebraic plane curve χ (see Algorithm 5.9 and Algorithm 5.12). An algorithm computing the set of minimal non-gaps at P i , for i = 1, 2 is the following: INPUT: points P 1 , P 2 , an integer i ∈ {1, 2} and a curve χ.
OUTPUT: the set of minimal non-gaps at P i .
• let L be a empty list and g be the genus of χ; • let W 1 and W 2 be the lists of gaps of χ at P 1 and P 2 , respectively;  As an illustration of the Corollary 5.17, for instance let i = 1, m = (m 1 , m 2 ) = (2, 2) ∈ Γ P and the set (n 1 , n 2 ) ∈ Γ P | n 1 = m 1 = (2, n) for n ≥ 2 . A minimal element for this set is (2,2), and is a gap at P 1 , P 2 . We compute min n ∈ N * | (n, 2) ∈ Γ P = 2 = m 1 , and m 1 = 2 is actually a gap at P 1 .

Computational aspects using Singular
We are interested in explaining the most important procedures implemented in SINGU-LAR and to give examples to show how to work with them.
More precisely, in subsection 6.1) we give some hints of use of the library brnoeth.lib, since our procedures are based on most of the algorithms contained in it. Then, in Subsection 6.2 we present the procedures which pretend generalize the computation of the Weierstraß semigroup to the case of several points, i.e., a set of procedures which try to: Curves are usually defined by means of polynomials in two variables, that is, by its local equation. It is possible to compute most of the concepts concerning to the curve with the procedure Adj_div. We defined the procedure (previously we must have defined the ring, the polynomial f and have charged the library brnoeth.lib): > list C=Adj_div(f); The output consist of a list of lists as follows: • The first list contains the affine and the local ring.
• The second list has the degree and the genus of the curve.
• Each entry of the third list corresponds to one closed place,that is, a place and all its conjugates, which is represented by two integer, the first one the degree of the point and the second one indexing the conjugate point. • The fourth one has the conductor of the curve.
• The fifth list consists of a list of lists, the first one, namely C [5][d] [1] being a (local) ring over an extension of degree d and the second one (C [5][d] [2]) containing the degrees of base points of places of degree d.
Furthermore, inside the local ring C [5][d] [1] we can find the following lists: • list POINTS: base points of the places of degree d.
• list LOC_EQS: local equations of the curve at the base points.
• list BRANCHES: Hamburger-Noether expressions of the places.
• list PARAMETRIZATIONS: local parametrizations of the places. Now we explain how the different kinds of common objects must be treated in Singular.
Affine points P are represented by a standard basis of a prime ideal, and a vector of integers containing the position of the places above P in the list supplied by C [3]; if the point lies at the infinity, the ideal is replaced by an homogeneous irreducible polynomial in two variables.  Rational functions are represented by ideals with two homogeneous generators, the first one being the numerator of the rational function, and the second one being the denominator.
Furthermore, we can compute a complete list containing all the non-singular affine (closed) places with fixed degree d just by using the procedure NSplaces in this way: Closer to our aim is the procedure Weierstrass, which computes the non-gaps of the Weierstraß semigroup at one point and the associated functions with poles. It contains three inputs: • an integer indicating the rational place in which we compute the semigroup; • an integer indicating how many non-gaps we want to calculate; • the curve given in form of a list C=Adj_div(f) for some polynomial f representing the local equation of the curve at the point given in the first entry.
This procedure needs to be called from the ring C[1] [2]. Moreover, the places must be necessarily rational.

Procedures generalizing to several points.
We present now a main procedure to compute the dimension of the so-called Riemann-Roch vector spaces of the form L (mP)\ L ((m − ε i )P). If this dimension is equal to 1, the procedure is also able to compute a rational function belonging to the space.
The technique developed here is not by using the adjunction theory directly, as we have developed theoretically in the Chapter 3 (Algorithm 5.9), because of its high cost, but we use the Algorithm 5.12, or, more properly speaking, a slight variant of it: we order the poles in a vector from the biggest one to the smallest one (in absolute value) and we take the first in such a vector.
proc RRquot (intvec m, list P, list CURVE, int chart) "USAGE:RRquot( m, P, CURVE, ch ); m,P intvecs, CURVE a list and ch an integer. RETURN: an integer 0 (dimension of L(m)\L(m-e_i)), or a list with three entries: @format RRquot [1] ideal (the associated rational function) RRquot [2] integer (the order of the rational function) RRquot [3] integer (dimension of L(m)\L(m-e_i)) @end format NOTE: The procedure must be called from the ring CURVE [ [3] if (posinP==0) { ERROR("The given place is not a rational place on the curve"); } setring BS; //define the divisor containing m in the right way intvec D=zeroes(m,posinP,nPOINTS); list Places=CURVE [3] This procedure needs also the following auxiliar procedures: As RRquot reads off the point through its homogeneous coordinates we need to localize that point in the list POINTS and make the correspondence between such a point and its position in the list of points contained in the third output of the procedure Adj_div. This is done by mean of the routine isPinlist. Its inputs are the point P in homogeneous coordinates, that is, a vector of integers, and the list L of points from Adj_div. The output is an integer being zero if the point is not in the list or a positive integer indicating the position of P in L. Look at the example: > example isPinlist; // proc isPinlist from lib brnoeth.lib EXAMPLE: ring r=0,(x,y),ls; intvec P=1,0,1; list POINTS=list(list(1,0,1),list(1,0,0)); isPinlist( P,POINTS); -->1 We need also a procedure for ordering a list of integers. This is partially solved by the procedure sort from general.lib. But sort is not able to order lists of negative numbers, so we have extended this algorithm to extsort. The extsort procedure needs to permute a vector of integers by the instructions given by another similar vector. This is actually done for lists of integers (permute_L in brnoeth.lib), but not for vectors of integers. This lack is covered by the procedure perm_L, whose entries are a pair of vectors, the second vector fixing the permutation of the first one. The output consists of the permutated vector, as the following example shows: Finally, it was interesting to fix the system for reading off the data of the divisor needed in the BrillNoether procedure. Our routine zeroes takes two vectors of integers m and pos, and an integer siz and it builds up a vector of size siz, with the values contained in m set in the places given by pos and zeroes in the other places. This algorithm is called zeroes: > example zeroes; // proc zeroes from lib brnoeth.lib EXAMPLE: ring r=0,(x,y),ls; intvec m=4,6; intvec pos=4,2; zeroes(m,pos,5); -->0,6,0,4,0