{'fraction_non_alphanumeric': 0.05296471741261026, 'fraction_numerical': 0.016620385494936295, 'mean_word_length': 3.296315789473684, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 57, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Tschirnhaus-Weierstrass curves

We define the concept of Tschirnhaus-Weierstrass curve, named after the Weierstrass form of an elliptic curve and Tschirnhaus transformations. Every pointed curve has a Tschirnhaus-Weierstrass form, and this representation is unique up to a scaling of variables. This is useful for computing isomorphisms between curves.


Introduction
A elliptic curve over a characteristic zero field is given by a polynomial equation of degree 3 in two variables i+j≤3 a i,j x i y j that can be reduced, by invertible transformations, to the classical Weierstrass normal form of an elliptic curve: which characterizes the curve.
Another definition of an elliptic curve is that of a genus 1 curve. Then, the Riemann-Roch theorem [2] determines the dimensions of the Riemann-Roch spaces, from which a certain equation of degree 3 is obtained which can be simplified again. It is interesting that the generators of these spaces are then fixed up to products by constants.
Our goal in this paper is to generalize the concept of Weierstrass nomal form for curves of higher genus, in such as a way as to also fix the generators of the Riemann-Roch spaces up to product by constants. The interest of such property lies in the fact that it allows to improve an algorithm by F. Hess [4] for computing the set of birational isomorphisms between two given algebraic curves. (If the two curves are equal, then the result is the automorphism group; if not, then the algorithm decides whether the two curves are birationally equivalent.) Here is a summary of the main idea of Hess's algorithm. First, pick a Weierstrass point P on the first curve (see Definition 3.4). An isomorphism has to take P to a Weierstrass point on the second curve with the same gap sequence. There are only finitely many such points, and we compute for each of them the set of isomorphisms mapping P to it. These isomorphisms induce isomorphisms on corresponding Riemann-Roch spaces, and this fact allows one to compute the isomorphisms efficiently. It is surprising that the algorithm does not use the canonical embedding; the reason is that the embedding based on Weierstrass points leads to better complexity.
Hess's algorithm has been implemented in Magma [5], and the algorithm is quite useful for practical computations when the coefficient field is finite. Our improvement applies in the characteristic zero case. We show that the birational isomorphisms of two Tschirnhaus-Weierstrass curves mapping the unique point at infinity to the unique point at infinity can always be expressed as scalings of coordinates. The computation of these scalings is almost trivial.
As a side result, we get an easy proof for the fact that the group of birational automorphisms of a curve of positive genus fixing a point is always abelian. (This is not a new result, as it can also be obtained as a consequence of the uniformization theorem [6]).
In Section 2 we detail the elliptic curve construction and motivate our interest in fixing generators. In Section 3 we define Tschirnhaus-Weierstrass curves and show the property mentioned above in relation to maps between them.

Motivation and example
We describe in detail the construction of the equation of an elliptic curve that arises from considering the dimensions of its Riemann-Roch spaces.
Definition 2.1. Let C be an algebraic curve and P ∈ C. For any non-negative integer i we define L(iP ) as the vector space of all rational functions defined on C that have a pole of order ≤ i at P and no other poles. This is called a Riemann-Roch space of C (note that the usual concept of Riemann-Roch space is defined for divisors not only of the form iP ).
Example 2.2. Let C be elliptic. Then L(0) = C and, by the Riemann-Roch theorem, for all i ≥ 1 and all P ∈ C, dim L(iP ) = i. We will now write bases of these vector spaces.
First L(0) = 1 . Let f be a rational function with a pole of order exactly two, then L(2P ) = 1, f . Similarly, let g have a pole of order exactly three, then L(3P ) = 1, f, g . Notice that, as C(C) has transcendence degree one over C, f and g are algebraically dependent.
We can write further bases without introducing more functions: L(4P ) = 1, f, g, f 2 , L(5P ) = 1, f, g, f 2 , f g , L(6P ) = 1, f, g, f 2 , f g, g 2 , f 3 . But here we have seven elements and dimension six, so there is a non-trivial linear combination that is equal to zero: The map p → (f (P ), g(P )) is birational from C to its image in C 2 (see Theorem 3.9). Thus, we have an equation of C in the (f, g)-plane. By performing some substitutions we can eliminate certain coefficients: 3a7 we can assume that a 4 = 0. • By g ← g − a 3 /(2a 6 ) we can assume that a 3 = 0.
Note that the order is relevant since these operations change several coefficients at a time. The equation has been reduced to the classical a 1 + a 2 f + a 6 g 2 + a 7 f 3 = 0, a 6 , a 7 = 0.
(2) Remark 2. 3. If we substitute f or g in Equation (2) by scalar multiples of them, no new terms appear. But if we substitute f (resp. g) by any combination αf + β, β = 0 (resp. αg + βf + γ, β = 0 or γ = 0) then some of the terms that we eliminated appear again. In this sense, Equation (2) fixes f, g up to product by scalars.
Our interest in normal forms arises from the fact that curve isomorphisms have a particularly simple form. We illustrate this idea with the elliptic case.
For general curves, we will have a similar result: any isomorphism from a Tschirnhaus-Weierstrass curve (defined in the next section) to another TW curve has to be an scaling in all the variables (that is, given by a diagonal linear map). This is Theorem 4.19. The interest of such a result is in the following problem: given two curves, compute all the isomorphisms from one to the other. One solution is: 1. Compute all the Weierstrass places of both curves. There are finitely many, see Definition 3.4 and the remark preceding it.
2. Fix one Weierstrass place p in the first curve.
3. For each Weierstrass place q in the second curve, compute all the isomorphisms that send p to q.
The last step can be done efficiently thanks to the aforementioned theorem.

Weierstrass curves
In the following, C is a plane algebraic curve and P is a place of C (for example a smooth point on the curve).
Definition 3.1. Let C have genus g ≥ 1 and P be a place of C. An integer i ≥ 1 is called a pole number iff there exists a rational function over C such that its only pole is P and the order of P as a pole of f is i. Otherwise, i is called a gap number.
i is a pole number and 0 iff i is a gap number. (i) 1 is always a gap number: L(0) = C always, and L(P ) = C for any P except when g = 0.
(ii) By Riemann-Roch, dim L(nP ) = n + 1 − g for n ≥ 2g − 1, so there are exactly g gap numbers at every place by Remark 3.2.
(iii) By the previous two items, all the places of an elliptic curve have the same gap number sequence, namely 1.
(iv) The set of pole numbers is a semigroup with respect to addition, for the product of functions with poles at P of order i 1 and i 2 is a function with a pole of order i 1 + i 2 . It is finitely generated (this is true in general for semigroups of natural numbers, in our case it is particularly easy to prove since its complement is finite).
Definition 3.4. A place in a curve of genus g is called a Weierstrass place of the curve iff its gap number sequence is not 1, . . . , g (i.e. there is some gap number greater than g). Note that, according to the previous remark, there are no Weierstrass places if g = 1, and places in any algebraic curve are generically non-Weierstrass.
In view of this, we introduce our main definitions.
Definition 3.5. Let C have only one place at infinity, and let f ∈ C[C] * . We define deg f = −ord ∞ f . This is the definition of degree that we will use in the rest of the paper. We also define S ∞ as the minimal set of generators of the Definition 3.6. A Weierstrass curve is a curve C ∈ C r such that (i) it has only one place at infinity, Remark 3.7. Given a Weierstrass curve, a positive integer p is a pole number at ∞ iff there exists a monomial in x 1 , . . . , x r of degree p.
Example 3.8. Equations (1) and (2) are Weierstrass curves, and they are birational images of the original elliptic curve, as per Theorem 3.9.
Our goal is to find Weierstrass curves of the simplest possible form that are birational to the given curve C. To this end, we will take certain Weierstrass curves that be constructed easily, and apply transformations that will cancel out some of their coefficients.
Let p 1 , . . . , p r be the minimal generators of the semigroup of pole numbers of P . If g > 1, these numbers depend on P . Let f i ∈ L(p i P ) \ L((p i − 1)P ), i = 1, . . . , r. Note that one can choose each f i not only up to a constant factor, but up to a linear combination of lower order functions (for methods of computing these spaces, see [3,4]). In the next section we describe a canonical form, that we call Tschirnhaus-Weierstrass curve, with the property that the elements f 1 , . . . , f r are uniquely determined up to multiplication by constants.
From the f i one can obtain equations in the fashion of Example 2.2. In relation to this, we prove now that every curve has a birational Weierstrass curve.
Proof. We need to show that every rational function on C can be expressed as a rational function in f 1 , . . . , f r .
Let g be a nonzero rational function on C with no poles except p. Assume that n is the pole order of g at P . Then there exists a product of f 1 , . . . , f r with exactly the same pole order. By subtracting a multiple of this product, we can reduce the pole order. This process can be repeated until the remainder is zero; this shows that g can be expressed as a polynomial in f 1 , . . . , f r . Now, let h be an arbitrary nonzero rational function. Let D be its divisor of poles. Let m be the degree of D. Let l be a number such that L(lP ) has dimension bigger than m. We claim that there exists a function q ∈ L(lP ) which vanishes along D. The claim follows from the observation that vanishing along D imposes m linear conditions, and dim(L(lP )) > m. But now, p := hq has no poles other than P . Both p and q can be expressed as polynomials in f 1 , . . . , f r , hence h can be expressed as rational function in f 1 , . . . , f r .

Tschirnhaus-Weierstrass curves
We start by constructing a Weierstrass curve in two variables and applying transformations to cancel out some of its coefficients.
Let p 1 , p 2 be the smallest pole generators at P ∈ C. We identify the functions f 1 , f 2 with coordinates x 1 , x 2 . Let l = lcm(p 1 , p 2 ) and We have that #A = dim V + 1 since there are two monomials of degree l, namely x q2 1 and x q1 2 . Now, let B be a set composed of one monomial x i 1 x j 2 of degree p for each p ∈ A and the two monomials of degree l. This set must then be linearly dependent as functions on C, so we have an equation Furthermore, since the monomials x q2 1 , x q1 2 have the highest degree in this expression, no combination of the other monomials can be equal to only one of them (this is clear if we consider the pole orders at ∞). Thus, a 1 , a 2 = 0.
We have, then, that the Newton polygon of F 2 is contained in the following triangle (note that the only points on the oblique edge are the two endpoints): sends F 2 to another Weierstrass curve since they respect the condition on the degrees of the variables, as can be seen from the pole orders. The classically called Tschirnhaus transformation We will prove that it is an automorphism as in (4). We show that a i,q1−1 = 0 ⇒ i ≤ s, or equivalenty a i,q1−1 = 0 ⇒ i < q 2 /q 1 . Suppose, on the contrary, that a i,q1−1 = 0 for some i ≥ q 2 /q 1 . If α := i − q 2 /q 1 ≥ 0, which is a contradiction. Now, as q 1 < q 2 , the only term x q2−1 1 x j 2 that may appear is the one with j = 0 (see figure below), and it can be cancelled by x 1 → x 1 − a q2−1,0 /a 1 q 2 . This does not affect the coefficients made zero previously.
1 for some γ, γ 0 , . . . , γ s ∈ C and α 1 , α 2 = 0. Suppose that not all the γ i are zero and let k be the largest index of a nonzero γ i . Substituting in G and expanding one sees that the coefficient of is nonzero, contradiction. Therefore, γ 0 = · · · = γ s = 0. In the same way we get β = 0 and the result is proved. The next step is to generalize this to Weierstrass curves with j ≥ 3 variables. The procedure is as follows. We construct a Weierstrass curve in j variables by finding a linear dependence among monomials in x 1 , . . . , x j which correspond to products of f 1 , . . . , f j . We choose certain monomials in it, which we can cancel out by the succesive application of automorphisms x j → x j + R(x 1 , . . . , x j−1 ) with deg R < deg x j as in Theorem 4.1, using inductively that the functions f 1 , . . . , f j−1 have been fixed up to scalars. The induction is based on the following result. Theorem 4.3. Let C ⊂ C r be a Weierstrass curve and let π : C → C ′ : (x 1 , . . . , x r ) → (x 1 , . . . , x r−1 ). Then C ′ is again a Weierstrass curve.
Proof. Let p 1 , . . . , p r be the respective degrees of the x i . We want to show that Let N := {n i } i∈ p1,...,pr−1 Z ≥0 be the lexicographical normal forms in x 1 , . . . , x r , deg n i = i. Then f can be written as q i=0 b i n i , b q = 0. But that expression is the reduced form of f with respect to the lexicographical Gröbner basis of I(C). By the general properties of these bases, since f ∈ C[x 1 , . . . , x r−1 ] ∩ I(C), its reduced form does not contain x r . In particular n q does not involve the variable x r , thus its degree is a combination of p 1 , . . . , p r−1 , contradiction.
Remark 4.4. One caveat in our approach is that, in general, multivariate polynomials do not allow general cancellation via Tschirnhaus transformations, the reason being that for certain exponents e 1 , . . . , e j−1 a substitution x j ← x j + αx e1 1 · · · x ej−1 j−1 with variable α may not allow us to cancel any term for any value of α. But in our case, we can always obtain relations among f 1 , . . . , f j that are safe in this sense. We prove this below, first we need to introduce new concepts. (ii) The monomials in N are a basis in the quotient algebra.
(iii) The set N contains exactly one monomial of degree d for each pole number d. Proof.
(i)⇔(ii): Obvious.   Example 4.7. Any monomial term order based on degree, like deglex, determines a set of normal forms, by taking the smallest monomial of each degree.
By Theorem 4.5 and considering the relation between degrees and pole orders, it is clear that every monomial of degree less than p j can be expressed as a linear combination of the normal forms that are smaller than x j . Thus, we have: Lemma 4.8. Let N be a set of normal forms. Every polynomial automorphism x j → x j + R(x 1 , . . . , x j−1 ) with deg R < deg x j can be written as a composition of substitutions x j → x j + b n n, n ∈ N, deg n < deg x j .
Our goal is to show that these substitutions can be used to cancel a coefficient of our polynomial at a time. Remark 4.9. Let F j be a polynomial in I ∩ C[x 1 , . . . , x j ] with the following property: if the highest degree of a monomial involving x j is d, then only on of its monomials of degree d involves x j (we later show how to find one such polynomial). Denote this monomial as m = m ′ x k j for some k > 0 and m ′ ∈ K[x 1 , . . . , x j−1 ]. If we substitute x j ← x j + b n n for any monomial with deg n < deg x j we obtain n + lower degree terms = m + kb n · mn/x j + lower degree terms. Now, for any other monomial m ′′ x k ′ j , k ′ > 0 of lower degree than m, by comparing degrees we can see that the same substitution cannot produce the monomial mn/x j . Therefore, the image of F j under this transformation differs from F j in the coefficient of mn/x j , which is changed linearly with respect to b n , and in lower degree terms; thus there always exists a (unique) value of b n that cancels the term mn/x j and affects no higher degree monomials.
In order to construct F j , let m be a monomial not in N involving x j . In the quotient algebra, this monomial is equal to a nonzero linear combination of normal forms m = n∈N a n n.
One of these normal forms will have the same degree as m (in order to account for the pole order of the monomial) and the others will have smaller degree. We only need to impose that the normal form of the same degree as m does not have the variable x j . An additional property is desirable: since such a polynomial consists only of the monomial m and normal forms, any monomial mn/x j , n ∈ N, deg n < deg x j that is cancelled should also be a normal form (if not, we are just trying to kill terms that are not there in the first place).
The next algorithm describes the construction of a set of normal forms and a good monomial with respect to it.

Algorithm 1: Construct a set of normal forms and a good monomial with respect to it
Input: the degrees p 1 , . . . , p j of x 1 , . . . , x j Output: a set of normal forms N and a good monomial m with respect to N . Only the normal forms of degree less than that of the good monomial are generated. Next, a good monomial is chosen; the while loop always ends, since in particular there always exists an integer q ≥ 2 such that p j q ∈ p 1 , . . . , p j−1 Z ≥0 , and then we can choose x q j as the good monomial (note that we can use this as a simpler way of finding a good monomial).
Then, any monomial m of sufficiently high degree will satisfy deg nm/x j > p j for all n with deg n < p j , avoiding collisions with the already chosen normal forms. Indeed, if deg m ≥ 2p j then deg m/x j ≥ p j , and for all n with deg n < p j we have that 0 ≤ deg n < p j ⇒ p j ≤ deg nm/x j < 2p j ≤ deg m. In particular, none of these imposed normal forms is equal to m and we can freely choose a normal form of degree deg m other than m, fulfilling all the conditions in Definition 4.10.
Remark 4.12. Now we can solve the problem posed in Remark 4.4: how to construct from f 1 , . . . , f j a polynomial that is amenable to cancellation. Once we have computed a good monomial and normal forms with Algorithm 1, we can substitute the variables by the functions f 1 , . . . , f j in power series form, and compute explicitly a linear dependence among all the monomials. By the discussion in Remark 4.9, this is a polynomial in which we can cancel terms.
Remark 4.13. The definitions of good monomials, normal forms, etc. allow for very arbitrary choices. It is possible that careful choices provide better computational times, simpler equations, or other advantages. We have not investigated this; our initial approach was using the monomial orderings commonly used with Gröbner bases, but good monomials may not exist in general, due to Definition 4.10 (ii).
The result of the previous steps, that is, the construction of the F j from a good monomial and the transformations that cancel certain terms, is what we call a Tschirnhaus-Weierstrass curve, or TW curve. Definition 4.14. A Tschirnhaus-Weierstrass curve (abbreviated TW curve) is a Weierstrass curve C ⊂ C r together with pairs {(N j , m j )} j=2,...,r such that, for every j: • N j is a set of normal forms in x 1 , . . . , x j for the projection of C onto those variables; • m j is a good monomial with respect to N j ; • the polynomial F j (x 1 , . . . , x j ) := m j − n∈Nj a j,n n defined uniquely by the condition F j ∈ I(C) has the property that all the monomials of the form n · m j /x j , n ∈ N j , deg n < deg x j , have coefficient zero.
Informally, a TW curve is a collection of polynomials P j (x 1 , . . . , x j ), j = 2, . . . , r satisfying the conditions of cancellation described previously. The algorithm that we describe now uses the ideas above to compute a TW curve birational to a given one.
Algorithm 2: Compute a TW curve birational to a given curve Input: a plane curve C and a place P of C Output: an integer r, a birational morphism C ֒→ C r to a TW curve and a list of equations of the image Compute the pole generators p 1 , . . . , p r at P Compute functions f 1 , . . . , f r with pole orders the p i for j from 2 to r do m j , N j := good monomial and normal forms for x 1 , . . . , x j (Alg 1) Compute a linear dependence among them: P j (f 1 , . . . , f j ) = 0 for k ∈ p 1 , . . . , p j−1 Z ≥0 , k < p j in decreasing order do Find α such that f j ← f j + αn k cancels the term n k f qj −1 j in P j Substitute f j ← f j + αn k and apply this to P j end end return r, (f 1 , . . . , f r ), [P 2 , . . . , P r ] Correctness proof. In each run of the main loop an equation in the first j variables (or functions) is computed. This is done by choosing normal forms and good monomials in a similar way to Algorithm 1. In this way it is ensured that for each substitution a coefficient α exists that will kill a corresponding monomial in the equation, since the resulting equation for α is linear (see Remark 4.9). Therefore the output matches the conditions in Definition 4.14.
Example 4.16. The curve C : x − y 2 + x 2 y 2 + y 4 = 0 is hyperelliptic of genus 2, its Weierstrass places being the six points (−2γ 4 +2γ 2 , γ) with 4γ 6 −4γ 4 −1 = 0. By Remark 3.3 the gap numbers at these six points are 1, 3 and the gap numbers at any other point are 1, 2. In the first case the pole generators are 2, 5 so the computation of a TW form is entirely similar to Example 2.2. The other case has pole generators 3, 4, 5, we compute a TW form for the point P = (0, 0).
First we compute an equation in x 1 , x 2 . Following the construction at the beginning of Section 4 we have q 1 = 3, q 2 = 4 and we will get a degree 12 polynomial. Let us show in any case a table of relevant monomials, excluding the constant. deg monomials deg monomials 3 In any case there is a polynomial equation We compute its coefficients by means of the associated functions f 1 = (y 2 −1)/xy and f 2 = (x − 1 + y 2 )/x 2 and the Puiseux expansion at P x = T 2 , y = T + 1 2 The substitution x 2 → x 2 − 2/3 kills the term 2x 2 2 and the new polynomial satisfies the TW condition. Now we have f 1 as before and f 2 = (x− 1 + y 2 )/x 2 + 2/3. The next step is to compute an equation involving x 1 , x 2 , x 3 . Here are the first monomials. deg monomials deg monomials 3 The monomial x 1 x 3 is a good monomial if we take all the other monomials in the table as normal forms. Indeed, the condition in this case is that 1, x 1 , x 2 ∈ N ⇒ x 1 , x 2 1 , x 1 x 2 ∈ N which is trivially true since there are no other candidates.
Remark 4.17. It is possible to choose the normal forms incrementally, that is, a normal form chosen in a certain step is also a normal form in subsequent steps. This certainly simplifies the output, since the set of normal forms for x 1 , . . . , x j is just the intersection of the biggest set of normal forms with C[x 1 , . . . , x j ].
Remark 4.18. There is another method of computing a TW curve, besides direct manipulation of the f j and the resulting equations among them as in Algorithm 2. It consists of implicitizing the image curve given by the initial f 1 , . . . , f r and then compute polynomials in less variables in the ideal of that curve that satisfy the condition in Remark 4.9. This approach requires computation of Gröbner bases, so we have preferred to describe the more direct procedure in the main section.
As we said previously, our motivation is the computation of isomorphisms of curves. This is the main result.
We will prove the result by induction on j. The base case j = 2 is Theorem 4.2. So assume without loss of generality that ϕ * (y i ) = λ i x i for i = 1, . . . , j − 1.
ϕ induces an isomorphism ϕ * : L(p j P 2 ) → L(p j P 1 ), thus ϕ * (y j ) ∈ L(p j P 1 ), so ϕ * (y j ) = λ j x j + n∈Nj n<xj α n · n and we can assume without loss of generality that λ j = 1. Our goal is to prove that all the α n are zero. Suppose the contrary and let n ∈ N j , n < x j be the largest monomial with α n = 0. Let m 1 , m 2 be the good monomials for x j , y j respectively. For any monomial t in the x's (resp. y's) we call r(t) the only linear combination of normal forms in the x's (resp. y's) that is equal to t in the quotient algebra of C 1 (resp. C 2 ).
By the computation in Remark 4.9, the leading term of G 3 is kα n · m 1 n/x j , where k > 0 is the exponent of x j in the good monomial m 1 . But, by definition of TW curve, this term has coefficient zero in G 1 , therefore α n = 0, which contradicts our previous assumption.