1 Introduction

In 1999, Xing, Niederreiter, and Lam [23] presented a construction of linear codes based on algebraic curves over finite fields that generalizes the algebraic geometry codes (AG codes) introduced two decades before by Goppa [9]. These codes are called generalized algebraic geometry codes (GAG codes), and the main feature of this construction is that it is possible to use places of arbitrary degree. The parameters of a GAG code, namely the length n, the dimension k, and the minimum distance d depend on the number of places, the genus g of the function field, and the dimension of certain Riemann–Roch spaces. In 2002, Heydtmman [13] studied how to define and represent the dual code of a GAG code, and she gave a decoding algorithm for this kind of codes. Later, Dorfer and Maharaj [1] gave a short proof of the duality result presented by Heydtmman, and they also showed that to calculate generator and parity check matrices for a GAG is required a basis of Riemann–Roch space associated, as well as in Goppa’s construction.

In general, computing a basis for a Riemann–Roch space is a challenging task. This problem has been investigated in specific function fields, first considering one-point divisors with support at the infinity place. Stichtenoth [22] gave a basis for the Riemann–Roch space for function fields of Artin–Schreier type and used it in [21] to explicitly describe generator and parity check matrices for one-point Hermitian codes. Hansen and Stichtenoth [12] studied the Suzuki function field, calculated a basis for the Riemann–Roch space and estimated bounds for the parameters of one-point AG codes obtained from that function field. Pedersen [19] constructed an algebraic function field over a finite field of characteristic 3, which has the Ree group as automorphism group and Giulietti and Korchmáros [8] constructed the so called GK maximal curve, in both cases a basis for the Riemann–Roch space was determined.

Bases of Riemann–Roch spaces associated to multi-point divisors have been calculated and used to study the corresponding multi-point AG codes by Maharaj, Matthews and Pirsic [18] for the Hermitian function field, by Hu and Zhao [15] for generalized Hermitian function field, by Eid et al. [2] for the Suzuki function field, by Hu and Yang [14] for the GGS function field and by Garzón and Navarro [5] for functions fields of Kummer type. In [18], the authors also applied their results to the construction of low-discrepancy sequences.

The aim of this paper is to calculate explicit bases of Riemann–Roch spaces associated with linearized function fields defined by an equation of the form

$$\begin{aligned} L(y)=h(x), \end{aligned}$$

where \(L(y)=\sum _{i=0}^{r}a_iy^{q^i}\in {\mathbb {F}}_{q^n}[y]\) is a separable linearized polynomial with \(q^r\) roots in \({\mathbb {F}}_{q^n}\) and \(h(x)\in {\mathbb {F}}_{q^n}(x)\). This class of function fields contains many important families, including function fields of Artin–Schreier type, the Hermitian function field, the norm-trace function field, among others, which have been central object of several works, for instance, see [3, 4, 6, 7, 10, 16, 17] and the references therein. The paper is organized as follows. In Sect. 2, we recall the definition of GAG codes, their properties, and present a generalization of the lower bound for the minimum distance given by Picone in [20], see Theorem 2.4. In Sect. 3, we show the main properties of linearized function fields and calculate the dimension and explicit bases of the Riemann–Roch spaces, see Proposition 3.1, Theorem 3.4 and Corollary 3.5, respectively. In Sect. 4, we show examples of GAG codes with good parameters, using the results obtained in the previous sections.

2 Generalized algebraic geometry codes

The following notation will be used throughout this correspondence. Let \(F/{\mathbb {F}}_q\) be an algebraic function field with genus g. The symbol \({\mathbb {P}}_F\) stands for the set of all places of F. A divisor G of \(F/{\mathbb {F}}_q\) is a formal sum \(G=\sum _{Q\in {\mathbb {P}}_F} \nu _Q(G) Q,\) where the coefficients \(\nu _Q(G)\) are integers all of which are zero except for a finite number. The Riemann–Roch space corresponding to the divisor G is defined as

$$\begin{aligned} {\mathcal {L}}(G)=\{x\in F: (x)\ge -G\}\cup \{0\}, \end{aligned}$$

where (x) is the principal divisor of x. \({\mathcal {L}}(G)\) is a finite-dimensional vector space over \({\mathbb {F}}_q\), and its dimension is denoted by \(\ell (G)\).

The differentials space of the divisor G is defined as

$$\begin{aligned} \Omega (G)=\{\eta \in \Omega : (\eta )\ge G\}\cup \{0\}, \end{aligned}$$

where \(\Omega \) denotes the differentials space of F. \(\Omega (G)\) is also a finite-dimensional vector space over \({\mathbb {F}}_q\), and its dimension, called the index of specialty of G, is

$$\begin{aligned} i(G)=\ell (G)-\deg G+g-1. \end{aligned}$$

For a canonical divisor W of F, i(G) is also equal to \(\ell (W-G)\). Let \(P_1,\ldots ,P_s\) be distinct places of F of degrees \(k_1,\ldots ,k_s\), respectively, and G be a divisor with support disjoint from the support of the divisor \(D:=\sum _{i=1}^sP_i\). Let \(C_i\) be an \([n_i,k_i, d_i]\) linear code over \({\mathbb {F}}_q\), and let \(\pi _i:{\mathbb {F}}_{q^{k_i}}\rightarrow C_i \subseteq {\mathbb {F}}_q^{n_i}\) be a fixed \({\mathbb {F}}_q\)-linear isomorphim mapping \({\mathbb {F}}_{q^{k_i}}\) onto \(C_i\) for any \(i=1,2,\ldots ,s\). Let \(n=\sum _{i=1}^sn_i\). The generalized algebraic geometry codes (GAG codes) \(C_{\mathcal {L}}(P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\) and \(C_\Omega (P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\) are defined as the images of the \({\mathbb {F}}_q\)-linear maps

$$\begin{aligned}{} & {} \alpha _{{\mathcal {L}}}: {\mathcal {L}}(G) \longrightarrow {\mathbb {F}}_q^n, \quad x \mapsto (\pi _1(x(P_1)),\pi _2(x(P_2)), \ldots , \pi _s(x(P_s)))\\{} & {} \alpha _{\Omega }: \Omega (G-D) \longrightarrow {\mathbb {F}}_q^n, \quad \omega \mapsto (\pi _1({\text {res}}_{P_1}(\omega )), \pi _2({\text {res}}_{P_2}(\omega )),\ldots , \pi _s({\text {res}}_{P_s}(\omega ))).\end{aligned}$$

If we take rational places and for each \(1\le i\le s\) we choose \(C_i=[1,1,1]\) the trivial linear code over \({\mathbb {F}}_q\) and \(\pi _i\) the identity map on \({\mathbb {F}}_q\), then the GAG codes reduce to AG codes.

Now, we recall some results concerning to the parameters of GAG codes.

Theorem 2.1

\(C_{\mathcal {L}}(P_1,\ldots ,P_n;G;C_1,\ldots ,C_s)\) is an [nkd] code with parameters

$$\begin{aligned} k=\ell (G)-\ell (G-D)\quad \text { and } \quad d\ge \sum _{i=1}^s d_i-\max \left\{ \sum _{i \in S}d_i:S \in X \right\} , \end{aligned}$$

where

$$\begin{aligned} X=\left\{ S\subseteq \{1,\ldots , s \}:\sum _{i\in S}k_i\le \deg G \right\} . \end{aligned}$$

Furthermore, if \(\deg G < \deg D\), then \(k=\ell (G)\ge \deg G +1-g\), and the equality holds if \(2g-2<\deg G < \deg D\).

Theorem 2.2

\(C_{\Omega }(P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\) is an [nkd] code with parameters

$$\begin{aligned} k=i(G-D)-i(G)=\ell (G-D)-\ell (G)+\deg D \quad \text{ and } \\ d \ge \sum _{i=1}^s d_i-\max \left\{ \sum _{i \in S}d_i:S \in X \right\} , \end{aligned}$$

where

$$\begin{aligned} X=\left\{ S\subseteq \{1,\ldots , s \}:\sum _{i \in S} k_i\le \deg D -\deg G +2g-2 \right\} . \end{aligned}$$

Furthermore, if \(\deg G > 2g-2\) then

$$\begin{aligned} k=\ell (G-D)-\deg G-1+g+\deg D\ge \deg D+g -\deg G-1 \end{aligned}$$

and the equality holds if \(2g-2<\deg G < \deg D\).

We state the lower bound for the minimum distance of a GAG code given by Picone.

Theorem 2.3

([20, Proposition 2.9]) Let \(F/{\mathbb {F}}_q\) be an algebraic function field of genus g and \(P_1,\ldots ,P_s\) distinct places of F of degrees \(k_1,\ldots ,k_s\) respectively, and \(C_i\) be an \([n_i,k_i, d_i]\) linear code over \({\mathbb {F}}_q\) for any \(i=1,2,\ldots ,s\). Let A, B, C, and Z be divisors of F with support disjoint from the support of \(D=\sum _{i=1}^sP_i\). Suppose \({\mathcal {L}}(A) = {\mathcal {L}}(A-Z)\) and \({\mathcal {L}}(B) = {\mathcal {L}}(B + Z)= {\mathcal {L}}(C)\). If \(G = A + B\) and \(d_i\ge k_i\) for \(1\le i \le s\), then the minimum distance d of the code \(C_{\Omega }(P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\) satisfies

$$\begin{aligned} d \ge \deg G-(2g-2)+\deg Z -i(A)+i(G-C). \end{aligned}$$

We remove some hypotheses from the result above to obtain a more general lower bound.

Here, it is necessary to introduce the notion of the greatest common divisor of two divisors. Given \(D_1\) and \(D_2\), two divisors of a function field \(F/{\mathbb {F}}_q\), the greatest common divisor of \(D_1\) and \(D_2\) is defined as

$$\begin{aligned} \gcd (D_1,D_2):=\sum _{Q\in {\mathbb {P}}_F} \min \{\nu _Q(D_1), \nu _Q(D_2)\}Q. \end{aligned}$$

Theorem 2.4

Let \(F/{\mathbb {F}}_q\) be an algebraic function field of genus g and \(P_1,\ldots ,P_s\) distinct places of F of degrees \(k_1,\ldots ,k_s\) respectively, and \(C_i\) be an \([n_i,k_i, d_i]\) linear code over \({\mathbb {F}}_q\) for any \(i=1,2,\ldots ,s\). Let A, B, C, and Z be divisors of F with support disjoint from the support of \(D=\sum _{i=1}^sP_i\). Suppose \({\mathcal {L}}(A) = {\mathcal {L}}(A-Z)\), \({\mathcal {L}}(B) = {\mathcal {L}}(B + Z)\subseteq {\mathcal {L}}(C)\). If \(G = A + B\), then the minimum distance d of the code \(C_{\Omega }(P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\) satisfies

$$\begin{aligned} d \ge \sum _{i=1}^s d_i-\max \left\{ \sum _{i \in S}d_i:S \in X\right\} , \end{aligned}$$

where

$$\begin{aligned} X=\left\{ S\subseteq \{1,\ldots , s \}:\sum _{i \in S} k_i\le \deg D -\deg G -\deg Z +2g-2-i(A)+i(G-C) \right\} . \end{aligned}$$

Proof

Let \(\omega \in \Omega (G-D)\) such that \(\alpha _{\Omega }(\omega ) \) is a non-zero codeword of minimum weight. Let S be the set of all i such that \({\text {res}}_{P_i}(\omega )=0\) and let T be the complement of S in \(\{1,2,\ldots ,s\}\). Then

$$\begin{aligned} d\ge \sum _{i \in T} d_i=\sum _{i=1}^s d_i-\sum _{i \in S} d_i. \end{aligned}$$
(1)

Consider the divisor \(D':=\sum _{i \in T} P_i\). Since \(\alpha _{\Omega }(\omega ) \) is zero for \(i\in S\), then \(\omega \in \Omega (G-D')\), that is, \(W:=(\omega )\ge G-D'\). Thus, \(E:=W-G+D'\) is an effective divisor such that \({\text {Supp}}(E)\cap {\text {Supp}}(D')=\emptyset \) and we have \(W=G-D'+E\). Taking degrees of both sides, we get that

$$\begin{aligned} 2g-2=\deg G-\deg D' +\deg E =\deg G -\sum _{i \in T} \deg P_i +\deg E, \end{aligned}$$

then

$$\begin{aligned} \sum _{i \in T} \deg P_i -\deg G +2g-2-\deg E\ge 0, \end{aligned}$$

Summing \(\sum _{i \in S} \deg P_i =\sum _{i \in S} k_i\) in both sides of the inequality above, we have

$$\begin{aligned} \deg D-\deg G + 2g-2 -\deg E \ge \sum _{i \in S} k_i, \end{aligned}$$

hence

$$\begin{aligned} \deg D-\deg G + 2g-2 -\deg Z -i(A)+i(G-C) \ge \sum _{i \in S} k_i, \end{aligned}$$
(2)

if we assume \(\deg E \ge \deg Z +i(A)-i(G-C) \). Finally, from (1) and (2) the desired result follows. It remains to prove that \(\deg (E)\ge \deg (Z)+i(A)-i(G-C)\). Notice that

$$\begin{aligned} \deg E&=\ell (A+E)-\ell (A)+i(A)-i(A+E) \nonumber \\&=\ell (A+E)-\ell (A-Z) +i(A)-i(A+E) \nonumber \\&\ge \ell (A+E)-\ell (A+E-Z)+i(A)-i(A+E). \end{aligned}$$
(3)

By the Riemann–Roch Theorem, we get

$$\begin{aligned} \ell (A+E)=\deg (A+E)+1-g+\ell (W-(A+E)) \end{aligned}$$

and

$$\begin{aligned} \ell (A+E-Z)=\deg (A+E-Z)+1-g+\ell (W-(A+E-Z)), \end{aligned}$$

hence,

$$\begin{aligned} \ell (A+E)-\ell (A+E-Z)&=\deg Z+\ell (W-(A+E))-\ell (W-(A+E-Z)) \nonumber \\&=\deg Z+\ell (B-D')-\ell (B+Z-D') \end{aligned}$$
(4)

Since \(D'\) is effective and BC and Z have support disjoint from the support of \(D'\), we get

$$\begin{aligned} \gcd (B+Z-D',B)\le B-D' \text { and } \gcd (B-D',C)\le C-D'. \end{aligned}$$

As

$$\begin{aligned} {\mathcal {L}}(B+Z-D')\subseteq {\mathcal {L}}(B+Z)={\mathcal {L}}(B), \end{aligned}$$

then

$$\begin{aligned} {\mathcal {L}}(B+Z-D')= {\mathcal {L}}(B+Z-D')\cap {\mathcal {L}}(B)={\mathcal {L}}(\gcd (B+Z-D',B))\subseteq {\mathcal {L}}(B-D') \end{aligned}$$

and thus

$$\begin{aligned} \ell (B+Z-D')\le \ell (B-D'). \end{aligned}$$
(5)

In a similar way, note that

$$\begin{aligned} {\mathcal {L}}(B-D')\subseteq {\mathcal {L}}(B)\subseteq {\mathcal {L}}(C), \end{aligned}$$

implies

$$\begin{aligned} {\mathcal {L}}(B-D')= {\mathcal {L}}(B-D')\cap {\mathcal {L}}(C)={\mathcal {L}}(\gcd (B-D',C))\subseteq {\mathcal {L}}(C-D')\end{aligned}$$

and hence

$$\begin{aligned} \ell (B-D')\le \ell (C-D'). \end{aligned}$$
(6)

Finally, we have

$$\begin{aligned} i(A+E)&=\ell (W-(A+E))=\ell (B-D')\le \ell (C-D')\,\, (\text {by (6)} ) \nonumber \\&\le \ell (C-D'+E)= i(W-C+D'-E)=i(G-C). \end{aligned}$$
(7)

Combining this with (3)–(5) yields the desired result. \(\square \)

Corollary 2.5

Let \(F/{\mathbb {F}}_q\) be an algebraic function field of genus g and \(P_1,\ldots ,P_s\) distinct places of F of degrees \(k_1,\ldots ,k_s\) respectively, and \(C_i\) be an \([n_i,k_i, d_i]\) linear code over \({\mathbb {F}}_q\) for any \(i=1,2,\ldots ,s\). Let A, B, and Z be divisors of F with support disjoint from the support of \(D=\sum _{i=1}^sP_i\). Suppose \({\mathcal {L}}(A) = {\mathcal {L}}(A-Z)\) and \({\mathcal {L}}(B) = {\mathcal {L}}(B + Z)\). If \(G = A + B\), then the minimum distance d of the code \(C_{\Omega }(P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\) satisfies

$$\begin{aligned} d \ge \sum _{i=1}^s d_i-\max \left\{ \sum _{i \in S}d_i:S \in X\right\} , \end{aligned}$$

where

$$\begin{aligned}X=\left\{ S\subseteq \{1,\ldots , s \}:\sum _{i \in S} k_i\le \deg D -\deg G -\deg Z +2g-2 \right\} . \end{aligned}$$

Proof

This follows immediately from Theorem  2.4, taking \(C=B\). \(\square \)

We use this result in Sect. 4 to construct examples of GAG codes with good parameters.

3 Bases for Riemann–Roch spaces of linearized function fields

In this section we investigate the Riemann–Roch spaces of linearized function fields defined by the equation

$$\begin{aligned} L(y)=h(x):=\frac{f(x)}{g(x)}, \end{aligned}$$
(8)

with \(L(y)=\sum _{i=0}^{r}a_iy^{q^i}\in {\mathbb {F}}_{q^n}[y]\) a linearized polynomial, \(a_r, a_0\ne 0\), and \(q^r\) roots in \({\mathbb {F}}_{q^n}\). We assume throughout that the factorization into irreducibles of f and g is \(f=\prod _{j=1}^mq_j^{m_j},\) and \( g=\prod _{i=1}^sp_i^{n_i}\) respectively, and the positive integers \(n_i\), \(\delta :=\deg f -\deg g>0\) are coprime to \({\text {char}}{\mathbb {F}}_q\).

Proposition 3.1

With the notations above, we have the following:

  1. 1.

    For \(1\le i\le s\), let \(P_i\) (resp. \(P_\infty \)) be the zero of \(p_i\) (resp. the pole of x) in \({\mathbb {F}}_{q^n}(x)\). The places \(P_1,\ldots , P_s,\) and \( P_\infty \) are totally ramified places in \(F/{\mathbb {F}}_{q^n}(x)\).

  2. 2.

    The functions \(1,y,\ldots , y^{q^r-1}\) form an integral basis at any place P of \({\mathbb {F}}_{q^n}(x)\) different from \(P_1,\ldots , P_s,\) and \(P_\infty \). Moreover, \(P_1,\ldots , P_s,\) and \(P_\infty \) are the only ramified places in \(F/{\mathbb {F}}_{q^n}(x)\).

  3. 3.

    For \(1\le i\le s\), let \(Q_i\) (resp. \(Q_\infty \)) be the only zero of \(p_i\) (resp. the only pole of x) in F. Then the principal divisor of \(p_i\) in F is

    $$\begin{aligned} (p_i)=q^rQ_i-q^r\deg p_i Q_{\infty }. \end{aligned}$$
  4. 4.

    For \(1\le j\le m\), let \(S_j\) be the only zero of \(q_j\) in \({\mathbb {F}}_{q^n}(x)\). Then \(S_j\) splits completely in F. Moreover, the principal divisor of y in F is

    $$\begin{aligned} (y)=\sum _{j=1}^m m_jR_j-\sum _{i=1}^s n_iQ_i-(\deg f-\deg g)Q_{\infty }, \end{aligned}$$

    where \(R_j\) is the only zero of y in F lying over \(S_j\), for each \(1\le j \le m\).

Proof

  1. 1.

    Let Q be a place lying over \(P_\infty \) and let e be the index of ramification of \(Q|P_\infty \). Since \(\nu _{P_\infty }(h(x))=-(\deg f-\deg g)=-\delta <0\) we have \(\nu _{Q}(L(y))=q^r\nu _{Q}(y)\) and

    $$\begin{aligned} q^r\nu _{Q}(y)=\nu _{Q}(L(y))=e\nu _{P_\infty }(h(x))=-e\cdot \delta . \end{aligned}$$
    (9)

    By the equation (9) and as \(\gcd (\delta ,q)=1\), then \(P_\infty \) is totally ramified and \(\nu _{Q_{\infty }}(y)=-\delta \), where \(Q_{\infty }\) denote the only place lying over \(P_{\infty }\). In the same way as before, we have that \(P_i\) is totally ramified and \(\nu _{Q_i}(y)=-n_i,\) where \(Q_i\) denote the only place lying over \(P_i\), for \(1\le i \le s\).

  2. 2.

    Let P be any place of \({\mathbb {F}}_{q^n}(x)\) different from \(P_1,\ldots , P_s\), and \(P_\infty \), and let Q be a place of F lying over P. It is clear that the minimum polynomial of y over \({\mathbb {F}}_{q^n}(x)\) satisfies

    $$\begin{aligned} \varphi (t)=L(t)-h(x)=t^{q^r}+a_{r-1}t^{q^{r-1}} +\cdots +a_1t^{q}+a_0t-h(x)\in {\mathcal {O}}_P[t], \end{aligned}$$

    and \(\nu _Q(\varphi '(y))=\nu _Q(a_0)=0\), then by [22], Corollary 3.5.11] \(\{1,y,\ldots , y^{q^r-1}\}\) is an integral basis of F at P and P is not ramified in \(F/{\mathbb {F}}_{q^n}(x)\).

  3. 3.

    Since the principal divisor of \(p_i\) in \({\mathbb {F}}_{q^n}(x) \) is \((p_i)=P_i-\deg p_i P_\infty \) and the places \(P_i\) and \(P_{\infty }\) are totally ramified, then

    $$\begin{aligned} (p_i)=\sum _{Q\in {\mathbb {P}}_F}\nu _Q(p_i)Q=\nu _{Q_{i}}(p_i)Q_{i}+\nu _{Q_{\infty }}(p_i)Q_{\infty }=q^rQ_i-q^r\deg p_i Q_{\infty }. \end{aligned}$$
  4. 4.

    The place \(S_j\) is a zero of h(x) because it is the zero of \(q_j\) in \({\mathbb {F}}_q(x)\), then \(\varphi (t) \in {\mathcal {O}}_{S_j}[t]\). The reduction modulus \(S_j\) of \(\varphi (t)\) is the polynomial

    $$\begin{aligned} {\overline{\varphi }}(t)=t^{q^r}+a_{r-1}t^{q^{r-1}} +\cdots +a_1t^q+a_0t, \end{aligned}$$

    which has all its roots in \({\mathbb {F}}_{q^n}\), hence there exist \(q^r\) places lying over \(S_j\) by [ [22], Theorem 3.3.7]. One of them is a zero of y lying over \(S_j\), and we will call it \(R_j\). It is clear that \(\nu _{R_j}(y)=m_j\). All of the above allows us to conclude that

    $$\begin{aligned} (y)=\sum _{Q\in {\mathbb {P}}_F}\nu _Q(y)Q=\sum _{j=1}^m m_jR_j-\sum _{i=1}^s n_iQ_i-(\deg f-\deg g)Q_{\infty }. \end{aligned}$$

\(\square \)

We can now formulate our main results.

Theorem 3.2

Consider the divisor \(G:=\sum _{i=1}^s a_iQ_i + b_{\infty }Q_{\infty }\) on the function field defined by the equation (8) where \(a_i, b_{\infty } \in {\mathbb {Z}}\) for \(1\le i \le s\). Then

$$\begin{aligned} S:=\left\{ y^kx^{e_{\infty ,k}}\prod _{i=1}^sp_i^{e_{i,k}}: \begin{array}{c} 0\le e_{\infty ,k}, \, e_{i,k}\in {\mathbb {Z}}, -a_i\le -kn_i+q^re_{i,k}, \\ \\ k(\deg f-\deg g)+q^r( e_{\infty ,k}+\sum _{i=1}^s e_{i,k}\deg p_i)\le b_\infty , \\ \\ \text { for all } k, \, 0\le k \le q^r-1. \end{array} \right\} \end{aligned}$$

is a generator set of \({\mathcal {L}}(G).\)

Proof

We first show that \(S\subseteq {\mathcal {L}}(G)\). By Proposition 3.1.3,  4 and since the principal divisor of x is \((x)=(x)_0-q^rQ_{\infty }\), we have that the divisor of the function \(y^kx^{e_{\infty ,k}}\prod _{i=1}^s p_i^{e_{i,k}} \in S\) satisfies the inequality

$$\begin{aligned} \left( y^kx^{e_{\infty ,k}}\prod _{i=1}^s p_i^{e_{i,k}}\right) \ge \sum _{i=1}^s(q^re_{i,k}-kn_i)Q_i-\left( k\delta +q^r( e_{\infty ,k}+\sum _{i=1}^s e_{i,k}\deg p_i)\right) Q_\infty , \end{aligned}$$

with \(\delta =\deg f-\deg g\) and for any \(0\le k\le q^r-1\). Since \(k\delta +q^r( e_{\infty ,k}+\sum _{i=1}^s e_{i,k}\deg p_i)\le b_\infty \) and \(q^re_{i,k}-kn_i\ge -a_i\), then we conclude that \(S\subseteq {\mathcal {L}}(G)\) and the \({\mathbb {F}}_{q^n}\)-linear span of S is a subset of \({\mathcal {L}}(G)\).

Next, we prove that every element of \({\mathcal {L}}(G)\) can be expressed as a linear combination of elements from S with coefficients from \({\mathbb {F}}_{q^n}\). Let \(z\in {\mathcal {L}}(G)\) be a non-zero element. Then the places \(Q_i\) and \(Q_{\infty }\) are the only possible poles of z. Since \(\{1,y,\ldots ,y^{q^r-1}\}\) is a basis of \(F/{\mathbb {F}}_{q^n}(x)\), there exist \(z_i\in {\mathbb {F}}_{q^n}(x) \) such that

$$\begin{aligned} z=z_0+z_1y+\cdots +z_{q^r-1}y^{q^r-1}, \end{aligned}$$

and the only possible poles in \({\mathbb {F}}_{q^n}(x)\) of the \(z_k\) are the places \(P_1,\ldots ,P_s\) and \(P_{\infty }\). Indeed, suppose that \(P\not \in \{P_1,\ldots ,P_s,P_{\infty }\}\) is a pole of \(z_k\) for some \(0\le k\le q^r-1\). Note that for any place Q lying over P, we have \(Q \not \in {\text {Supp}}(G)\), which gives \(\nu _Q(z)\ge 0\) and \(z\in \bigcap _{Q|P}{\mathcal {O}}_Q\). By [ [22], Corollary 3.3.5] and Proposition 3.1.2 the integral closure \({\mathcal {O}}'_P\) of \({\mathcal {O}}_P\) in F is

$$\begin{aligned} {\mathcal {O}}'_P=\bigcap _{Q|P}{\mathcal {O}}_Q=\sum _{k=0}^{q^r-1}{\mathcal {O}}_Py^k. \end{aligned}$$

Hence, \(z\in {\mathcal {O}}'_P\), so each \(z_k\) must belong to \({\mathcal {O}}_P\). This contradiction implies that the \(z_k\) are of the form

$$\begin{aligned} z_k=f_k\prod _{i=1}^{s}p_i^{e_{i,k}} \end{aligned}$$

where \(e_{i,k}\) are integers, \(f_k\) is a polynomial in \({\mathbb {F}}_{q^n}[x]\), and \(p_i\) does not divide \(f_k\) for any \(1\le i \le s\). Thus, \(z_k\) is a \({\mathbb {F}}_{q^n}\)-linear combination of functions

$$\begin{aligned} A_{k,m}=x^m\prod _{i=1}^{s}p_i^{e_{i,k}} \end{aligned}$$

for \(m=0,1,\ldots , \deg f_k\). In order to prove the theorem, it is sufficient to show that for \(0\le k\le q^r-1\) and \(m=0,1,\ldots , \deg f_k\), the functions \(y^kA_{k,m}\) belong to S. Let \(0\le j \le s\), \(Q:=Q_j\), and \(P:=P_j\). Since P is the place defined by the irreducible polynomial \(p_j\in {\mathbb {F}}_{q^n}[x]\), we have

$$\begin{aligned} \nu _P(z_k)=\nu _P(f_k)+\nu _P\left( \prod _{i=1}^s p_i^{e_{i,k}}\right) =e_{j,k}. \end{aligned}$$

On the other hand, by Proposition 3.1.1, 4 we have \(e(Q|P)=q^r\) and \(\nu _Q(y)=-n_j\), respectively. Then

$$\begin{aligned} \nu _Q(z_ky^k)=e(Q|P)\nu _P(z_k)+\nu _Q(y^k)=q^r\nu _P(z_k)+k\nu _Q(y)=q^r\nu _P(z_k)-kn_j=q^re_{j,k}-kn_j. \end{aligned}$$

Now, for \(0\le k\le q^r-1\), we see that \(\nu _Q(z_ky^k)\) are distinct because they are distinct module \(q^r\). Thus,

$$\begin{aligned} q^re_{j,k}-kn_j\ge \min _{0\le k\le q^r-1}\{\nu _Q(z_ky^k)\}=\nu _Q(z)\ge -a_j, \end{aligned}$$

since \(z\in {\mathcal {L}}(G)\). Finally, for \(0\le k\le q^r-1\) and \(m=0,1,\ldots , \deg f_k\), we obtain

$$\begin{aligned} \nu _Q(y^kA_{k,m})= & {} \nu _Q\left( y^kx^m\prod \limits _{i=1}^s p_i^{e_{i,k}}\right) = k\nu _{Q}(y)+m\nu _{Q}(x)+\sum \limits _{i=1}^s{e_{i,k}}\nu _{Q}(p_i) \\\ge & {} k\nu _{Q}(y)+e_{j,k}\nu _{Q}(p_j) = q^re_{j,k} -kn_j \ge -a_j. \end{aligned}$$

It remains to establish \(\nu _{Q_\infty }(y^kA_{k,m})\ge -b_\infty .\) We proceed in a similar way as before. Recalling \(z_k=f_k\prod _{i=1}^sp_i^{e_{i,k}}\), we get

$$\begin{aligned} \nu _{P_\infty }(z_k)=\nu _{P_\infty }(f_k)+\sum _{i=1}^s{e_{i,k}}\nu _{P_\infty }(p_i) =-\deg f_k-\sum _{i=1}^s e_{i,k}\deg p_i. \end{aligned}$$
(10)

Now, for \(0\le k\le q^r-1\), the integers \(q^r\nu _{P_\infty }(z_k)-k\delta \) are distinct because they are distinct module \(q^r\). Then,

$$\begin{aligned} q^r\nu _{P_\infty }(z_k)-k\delta \ge \min _{0\le k \le q^r-1}\{\nu _{Q_\infty }(z_ky^k)\}=\nu _{Q_\infty }(z)\ge -b_\infty , \end{aligned}$$
(11)

because \(z\in {\mathcal {L}}(G)\). On the other hand, for \(m=0,1,\ldots , \deg f_k\) we have

$$\begin{aligned} \nu _{Q_\infty }(y^kA_{k,m})= & {} k\nu _{Q_\infty }(y)+m\nu _{Q_\infty }(x)+\sum _{i=1}^s{e_{i,k}}\nu _{Q_\infty }(p_i)\nonumber \\= & {} -k\delta -q^r\left( m+\sum _{i=1}^s e_{i,k}\deg p_i\right) . \end{aligned}$$
(12)

Then, combining (10)–(12), we obtain

$$\begin{aligned} -\nu _{Q_\infty }(y^kA_{k,m})= & {} k\delta +q^r\left( m+\sum _{i=1}^s e_{i,k}\deg p_i\right) \\\le & {} k\delta +q^r\left( \deg f_k+\sum _{i=1}^s e_{i,k}\deg p_i\right) \\\le & {} b_\infty . \end{aligned}$$

\(\square \)

Lemma 3.3

([18], Lemma 3.5) Let F/K be a function field. Let G be a divisor of F, and let P be a rational place of F. Let \(V=\{\nu _P(z): z\in {\mathcal {L}}(G){\setminus }\{0\}\}\). For each \(i \in V\), choose \(u_i\in {\mathcal {L}}(G)\) such that \(\nu _P(u_i)=i.\) Then the set \(B=\{u_i:i \in V\}\) is a basis for \({\mathcal {L}}(G)\).

Theorem 3.4

Consider the divisor \(G:=\sum _{i=1}^s a_iQ_i + b_\infty Q_\infty \) on the function field defined by the equation (8) where \(a_i, b_\infty \in {\mathbb {Z}}\) for \(1\le i \le s\). Then the dimension of \({\mathcal {L}}(G)\) over \({\mathbb {F}}_{q^n}\) is

$$\begin{aligned} \ell (G)=\sum _{k=0}^{q^r-1}\max \left\{ \sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }+1,0\right\} , \end{aligned}$$

with \(\delta =\deg f-\deg g\).

Proof

For \(0\le k\le q^r-1\) set

$$\begin{aligned} V_k:=\left\{ -k\delta -q^r\left( e+\sum _{i=1}^s e_i\deg p_i\right) : \begin{array}{c} e_i\in {\mathbb {Z}},\, -a_i\le -kn_i+q^re_i \text { for all } 1 \le i \le s,\\ 0 \le e,\, k\delta +q^r(e+\sum _{i=1}^s e_i\deg p_i)\le b_\infty . \end{array} \right\} \end{aligned}$$

and let \(V:= \bigcup _{k=0}^{q^r-1}V_k\). The proof will be divided into several steps.

Step 1. \(V=\{\nu _{Q_\infty }(z):z\in {\mathcal {L}}(G){\setminus } \{0\}\}\).

Proof of step 1. Let a non-zero element \(z\in {\mathcal {L}}(G)\). By Theorem 3.2, we have

$$\begin{aligned} z=\sum _{k=0}^{q^r-1}\alpha _k\left( y^k x^{e_{\infty , k}}\prod _{i=1}^sp_i^{e_{i,k}} \right) =\sum _{k=0}^{q^r-1}\left( \alpha _k x^{e_{\infty , k}}\prod _{i=1}^sp_i^{e_{i,k}} \right) y^k:=\sum _{k=0}^{q^r-1}z_k y^k \end{aligned}$$

where \(\alpha _k \in {\mathbb {F}}_{q^r}\), \(e_{\infty ,k}\) is a nonnegative integer, each \( e_{i,k}\) is an integer, for all \(1 \le i \le s\), \(-a_i\le -kn_i+q^re_{i,k}\) and \(k\delta +q^r(e_{\infty ,k}+\sum _{i=1}^s e_{i,k}\deg p_i)\le b_\infty \). Thus, for any \(0 \le k \le q^r-1\), we obtain

$$\begin{aligned} \nu _{Q_\infty }(z)=\nu _{Q_\infty }(z_ky^k)=q^r \nu _{P_\infty }(z_k)+ k\nu _{Q_\infty }(y)= -q^r\left( e_{\infty ,k}+\sum _{i=1}^s e_{i,k}\deg p_i\right) -k\delta \in V_k. \end{aligned}$$

Conversely, let \(m\in V\). Then \(m\in V_k\) for some \(0\le k \le q^r-1\). Hence,

$$\begin{aligned} m=-k\delta -q^r\left( e+\sum _{i=1}^s e_i\deg p_i\right) \end{aligned}$$

where \(0\le e\), \(e_i\in {\mathbb {Z}}\), \(-a_i\le -kn_i+q^re_i\), and \(k\delta +q^r\left( e+\sum _{i=1}^s e_i\deg p_i\right) \le b_\infty \). Finally, if we choose

$$\begin{aligned} z=y^kx^e\prod _{i=1}^sp_i^{e_i} \end{aligned}$$

we have \( \nu _{Q_\infty }(z)=m\).

According to Lemma 3.3, it follows that \(\ell (G)=|V|\). Therefore, we proceed to count the number of elements in V. This will be the second step of the proof.

Step 2. Fix k, \(0\le k \le q^r-1.\) Then \(-k\delta -cq^r\in V\) if and only if

$$\begin{aligned} -\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i\le c \le \frac{b_\infty -k\delta }{q^r}\cdot \end{aligned}$$

Proof of step 2. Firstly, we will prove that the sets \(V_k\) are mutually disjoint. Let \(N\in V_k\cap V_j\), then \(-k\delta -q^ra=N=-j\delta -q^rb\), where \(a,b \in {\mathbb {Z}}\), so

$$\begin{aligned} k\delta \equiv j\delta \mod q^r. \end{aligned}$$

Since \((\delta , q)=1\), then \(k \equiv j \mod q^r \), thus \(k=j\). This implies that

$$\begin{aligned} \ell (G)=|V|=\sum _{k=0}^{q^r-1}|V_k|. \end{aligned}$$

It remains to determine \(|V_k|\). Now fix k, \(0\le k \le q^r-1\), and set \(m:=-k\delta -q^rc\) where \(c\in {\mathbb {Z}}.\) Then \(m\in V\) if and only if \(m=-k\delta -q^rc\in V_k\). This holds if and only if

$$\begin{aligned} -k\delta -q^rc=-k\delta -q^r\left( e+\sum _{i=1}^s e_i\deg p_i\right) , \end{aligned}$$

for some integers \(e_i\) and \(e\ge 0\) with

$$\begin{aligned} k\delta +q^r\left( e+\sum _{i=1}^s e_i\deg p_i\right) \le b_\infty \end{aligned}$$

and

$$\begin{aligned} -a_i\le -kn_i+q^re_i\quad \text { for any }\quad 1\le i \le s.\end{aligned}$$

These inequalities are equivalent to

$$\begin{aligned} c=e+\sum _{i=1}^s e_i\deg p_i \end{aligned}$$

and

$$\begin{aligned} e+\sum _{i=1}^s e_i\deg p_i\le \frac{b_\infty -k\delta }{q^r} \end{aligned}$$

and

for any \(1\le i \le s\). Therefore, the integers \(e_i\) and \(e\ge 0\) exist if and only if

$$\begin{aligned} -\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i \le c\le \frac{b_\infty -k\delta }{q^r}. \end{aligned}$$

Now it follows that \(|V_k|\) is the number of integers in the interval

$$\begin{aligned} \left[ -\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{p^r} \right\rfloor }\deg p_i, {\left\lfloor \frac{b_\infty -k\delta }{p^r} \right\rfloor }\right] , \end{aligned}$$

i.e.,

$$\begin{aligned} |V_k|:=\max \left\{ \sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }+1,0\right\} . \end{aligned}$$

This implies that

$$\begin{aligned} \ell (G)=\sum _{k=0}^{q^r-1}\max \left\{ \sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }+1,0\right\} \end{aligned}$$

\(\square \)

Corollary 3.5

Consider the divisor \(G:=\sum _{i=1}^s a_iQ_i + b_\infty Q_\infty \) on the function field defined by the equation (8) where \(a_i, b_\infty \in {\mathbb {Z}}\) for \(1\le i \le s\). Then

$$\begin{aligned} \bigcup _{0\le k \le q^r-1}{\mathcal {B}}_k \end{aligned}$$

where each \({\mathcal {B}}_k\) is defined as

$$\begin{aligned} \left\{ y^kx^{e_{\infty , k}}\prod _{i=1}^sp_i^{e_{i,k}}: 0\le e_{_{\infty ,k}}, -\sum _{i=1}^s {\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i \le e_{_{\infty , k}}+ \sum _{i=1}^s e_{_{i,k}}\deg p_i\le {\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor } \right\} \end{aligned}$$

is a basis for \({\mathcal {L}}(G)\) as a vector space over \({\mathbb {F}}_{q^n}\).

Proof

This follows immediately from Theorem 3.2 and the proof of Theorem 3.4. \(\square \)

Corollary 3.6

([22], Proposition 4.1) Consider a function field \(F={\mathbb {F}}_{q^n}(x,y)\) with

$$\begin{aligned} y^q+\mu y=g(x)\in {\mathbb {F}}_{q^n}[x], \end{aligned}$$

\(0\ne \mu \in {\mathbb {F}}_{q^n}\). Assume that \(\deg g:=m\) is relatively prime to q and \(\{\beta : \beta ^q+\mu \beta =0\}\subseteq {\mathbb {F}}_{q^n}\). Then a basis for the Riemann-Roch space \({\mathcal {L}}(rQ_{\infty })\) is

Now, we recall the notion of the floor of a divisor. The floor of a divisor G with \(\ell (G)>0\), denoted \({\left\lfloor G \right\rfloor }\), is the minimum degree divisor such that \({\mathcal {L}}(G) = {\mathcal {L}}({\left\lfloor G \right\rfloor })\). The next result states that from a generator set of a Riemann–Roch space \({\mathcal {L}}(G)\), we can calculate \({\left\lfloor G \right\rfloor }\).

Lemma 3.7

([18], Theorem 2.6) Let G be a divisor of \(F/ {\mathbb {F}}_q\), and let \(b_1, \ldots , b_t \in {\mathcal {L}}(G)\) be a spanning set for \({\mathcal {L}}(G)\). Then, \({\left\lfloor G \right\rfloor }=-\gcd ((b_i ):i = 1, \ldots , t).\)

In order to conclude this section, we compute the floor of certain divisors of linearized function fields.

Theorem 3.8

Let \(G:=\sum _{i=1}^s a_iQ_i + b_\infty Q_\infty \) be a divisor of the function field defined by the equation (8) where \(a_i, b_\infty \in {\mathbb {Z}}\) for \(1\le i \le s\). The floor of G is given by

$$\begin{aligned} {\left\lfloor G \right\rfloor }:=\sum _{i=1}^s \alpha _iQ_i + \beta _\infty Q_\infty , \end{aligned}$$

with

and

and \(\delta =\deg f-\deg g\).

Proof

By Corollary 3.5, \({\mathcal {B}}=\bigcup _{k=0}^{q^r-1}{\mathcal {B}}_k\) is a basis for \({\mathcal {L}}(G)\), where each \({\mathcal {B}}_k\) is the set

Suppose \({\mathcal {B}}_k\) is non-empty and consider \(z=y^kx^e\prod _{i=1}^sp_i^{e_i} \in {\mathcal {B}}_k\). By Proposition 3.1.3,  4, and since the principal divisor of x is \((x)=(x)_0-q^rQ_{\infty }\) and \(k\sum _{j=1}^m m_jR_j +(x)_0\) is an effective divisor, we have

$$\begin{aligned} (z)=&{} k\sum \limits _{j=1}^m m_jR_j+e(x)_0+ \sum \limits _{i=1}^s(-kn_i+e_iq^r)Q_i-\left( k\delta + q^r\left( e +\sum \limits _{i=1}^se_i \deg p_i\right) \right) Q_{\infty }\\ {}&\ge {} \sum _{i=1}^s\left( -kn_i -q^r{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\right) Q_i-\left( k\delta + q^r{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }\right) Q_{\infty }.\\ \end{aligned}$$

Now, take \(z=y^k\prod _{i=1}^sp_i^{e_i}\) with \(e_i=-{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\). Then

$$\begin{aligned} \nu _{Q_i}(z)=-kn_i+e_iq^r=-kn_i-q^r{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }. \end{aligned}$$

Observe that \({\mathcal {B}}_k\) is non-empty if and only if \(\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }\ge 0\). Therefore,

$$\begin{aligned} \alpha _i= & {} -\min _{0\le k \le q^r-1}\left\{ \nu _{Q_i}(z):\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }\ge 0\right\} \\= & {} \max _{0\le k \le q^r-1}\left\{ kn_i+q^r{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }: \sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }\ge 0 \right\} . \end{aligned}$$

It remains to calculate \(\beta _{\infty }\). Similarly, choosing \(z=y^kx^{e}\prod _{i=1}^sp_i^{e_i}\) with \(e_i=-{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\) and

$$\begin{aligned} e={\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }+\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i={\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }-\sum _{i=1}^{s}e_i\deg p_i, \end{aligned}$$

we can see that

$$\begin{aligned} \nu _{Q_\infty }(z)=-k\delta - q^r\left( e +\sum _{i=1}^se_i \deg p_i\right) =-k\delta -q^r{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }. \end{aligned}$$

Thus,

$$\begin{aligned} \beta _\infty= & {} -\min _{0\le k \le q^r-1}\left\{ \nu _{Q_\infty }(z):\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }\ge 0 \right\} \\ \\= & {} \max _{0\le k \le q^r-1}\left\{ k\delta +q^r{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }:\sum _{i=1}^{s}{\left\lfloor \frac{a_i-kn_i}{q^r} \right\rfloor }\deg p_i+{\left\lfloor \frac{b_\infty -k\delta }{q^r} \right\rfloor }\ge 0 \right\} , \end{aligned}$$

and by Lemma 3.7, we obtain \({\left\lfloor G \right\rfloor }=\sum _{i=1}^s \alpha _iQ_i + \beta _\infty Q_\infty .\) \(\square \)

4 Examples

In this section, we show examples of GAG codes with good parameters. For this purpose, we choose divisors A, B, and R such that \(Z=A-{\left\lfloor A \right\rfloor }\), \(Z=R-{\left\lfloor R \right\rfloor }\), and \(B={\left\lfloor R \right\rfloor }\). Then

$$\begin{aligned} \ell (A-Z)=\ell (A)\quad \text { and } \quad \ell (B+Z)=\ell (B) \end{aligned}$$

In this way, ABZ and \(G=A+B\) satisfy the hypotheses of the Corollary 2.5, so we obtain lower bounds for minimum distance. We use Theorem 2.2 to calculate the dimension of the codes, Theorem 3.4 for the dimension of the Riemann–Roch spaces involved, and Theorem 3.8 for the floor of the divisors considered. In the examples, we consider the function field \(F={\mathbb {F}}_{49}(x,y)\) defined by the equation

$$\begin{aligned} y^7+y=\frac{(x^2+1)^2}{x^2}. \end{aligned}$$

In [11], it was proven that \(F/{\mathbb {F}}_{49}\) has genus 12 and 170 rational places. Also, it can be shown that it has many places of degree two and three. The only pole of x and y and the only pole of y over the zero of x in \({\mathbb {F}}_{49}(x)\) will be denoted by \(P_{\infty }\) and \(P_0\), respectively.

Example 4.1

In this example, we illustrate the use of the results mentioned above to calculate the parameters of a GAG code \(C_\Omega :=C_\Omega (P_1,\ldots ,P_s;G;C_1,\ldots ,C_s)\). Let \(A=5P_\infty +18P_0\), \(B=4P_\infty +18P_0\) and \(G=A+B=9P_\infty +36P_0\). First, we calculate \({\left\lfloor A \right\rfloor }\), Z and \(\ell (G)\). By Theorem 3.8 the floor of A is \({\left\lfloor A \right\rfloor }=\alpha _1P_0+\beta _\infty P_\infty \) with

$$\begin{aligned} \alpha _1= & {} \max _{0\le k\le 6} \left\{ 18k+7{\left\lfloor \frac{5-2k}{7} \right\rfloor }: {\left\lfloor \frac{18-2k}{7} \right\rfloor }+{\left\lfloor \frac{5-2k}{7} \right\rfloor }\ge 0 \right\} \\{} & {} =\max \{14, 16, 18, 13, 15, 17\}=18 \end{aligned}$$

and

$$\begin{aligned} \beta _{\infty }= & {} \max _{0\le k\le 6}\left\{ 2k + 7{\left\lfloor \frac{8-2k}{7} \right\rfloor }:{\left\lfloor \frac{18-2k}{7} \right\rfloor }+{\left\lfloor \frac{5-2k}{7} \right\rfloor }\ge 0 \right\} \\= & {} \max \{0, 2, 4, -1, 1, 3\}=4. \end{aligned}$$

Observe that \(Z=A-{\left\lfloor A \right\rfloor }=P_{\infty }\), \(B={\left\lfloor A \right\rfloor }=4P_\infty +18P_0\) and \(B+Z=A\), thus

$$\begin{aligned} \ell (A)=\ell (A-Z)=\ell (B)=\ell (B+Z). \end{aligned}$$

Now, by Theorem 3.4 the dimension of divisor \(G=A+B=9P_\infty +36P_0\) is

$$\begin{aligned} \ell (G)=\sum _{k=0}^{6}\max \left\{ {\left\lfloor \frac{36-2k}{7} \right\rfloor }+{\left\lfloor \frac{9-2k}{7} \right\rfloor }+1,0\right\} =34. \end{aligned}$$

Consider \(109\le s \le 168\) and each \(C_i\) an \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\). Note that this is equivalent to taking the divisor \(D=\sum _{j=1}^sP_j\) with each \(P_j\) a rational place. Hence \(\deg (G-D)=34-s<0\), \(\ell (G-D)=0\) and, by Theorem 2.2, the dimension of \(C_\Omega \) is

$$\begin{aligned} k=\ell (G-D)-\ell (G)+\deg D = s-34. \end{aligned}$$

Finally, we calculate a lower bound for the minimum distance of the \(C_\Omega \). By Corollary 2.5

$$\begin{aligned} d \ge \sum _{i=1}^s d_i-\max \left\{ \sum _{i \in S}d_i:S \in X\right\} \end{aligned}$$

where

$$\begin{aligned} X=\left\{ S\subseteq \{1,\ldots , s \}:\sum _{i \in S} k_i\le \deg D -\deg G -\deg Z +2g-2 \right\} . \end{aligned}$$

Since \(\deg D -\deg G -\deg Z +2g-2=s-24\), we have

$$\begin{aligned} d \ge \sum _{i=1}^s d_i-\max \left\{ \sum _{i \in S}d_i:S \in X\right\} =s-(s-24)=24. \end{aligned}$$

Thus we have shown that \(C_\Omega \) is a linear code with parameters \([s, s-34, 24]\).

In the following examples we consider A, B and G as before.

  1. 1.

    Taking \(116\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[2,2,1]\) for \(i=s+1\), we obtain linear codes with parameters \([s+2, s-32, 23]\).

  2. 2.

    Taking \(139\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[2,2,1]\) for \(i=s+1, s+2\), we obtain linear codes with parameters \([s+4, s-30, 22]\).

  3. 3.

    Taking \(112\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[3,2,2]\) for \(i=s+1\), we obtain linear codes with parameters \([s+3, s-32, 24]\).

  4. 4.

    Taking \(123\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[3,2,2]\) for \(i=s+1,s+2\), we obtain linear codes with parameters \([s+6, s-30, 24]\).

  5. 5.

    Taking \(163\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[5,4,2]\) for \(i=s+1\), we obtain linear codes with parameters \([s+5, s-30, 22]\).

Example 4.2

Let \(A=19P_\infty +4P_0\), \(B=18P_\infty +3P_0\), \(G=A+B=37P_\infty +7P_0\), and \(Z=P_\infty \). Then \(\ell (G)=33\).

  1. 1.

    Taking \(107\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\), we obtain linear codes with parameters \([s,s-33,23]\).

  2. 2.

    Taking \(127\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[2,2,1]\) for \(i=s+1\), we obtain linear codes with parameters \([s+2, s-31, 22]\).

  3. 3.

    Taking \(150\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[2,2,1]\) for \(i=s+1, s+2\), we obtain linear codes with parameters \([s+4, s-29, 21]\).

  4. 4.

    Taking \(127\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[3,2,2]\) for \(i=s+1,s+2\), we obtain linear codes with parameters \([s+6, s-29, 23]\).

Example 4.3

Let \(A=19P_\infty \), \(B=18P_\infty +4P_0\), \(G=A+B=37P_\infty +4P_0\) and \(Z=P_\infty \). Then \(\ell (G)=30\).

  1. 1.

    Taking \(129\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\), we obtain linear codes with parameters \([s,s-30,20]\).

  2. 2.

    Taking \(152\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[2,2,1]\) for \(i=s+1\), we obtain linear codes with parameters \([s+2, s-28, 19]\).

  3. 3.

    Taking \(148\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[3,2,2]\) for \(i=s+1\), we obtain linear codes with parameters \([s+3, s-28, 20]\).

  4. 4.

    Taking \(164\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[3,2,2]\) for \(i=s+1,s+2\), we obtain linear codes with parameters \([s+6, s-26, 20]\).

  5. 5.

    Taking \(166\le s \le 168\) and \([n_i,k_i,d_i]=[1,1,1]\) for \(1\le i\le s\) and \([n_i,k_i,d_i]=[4,2,3]\) for \(i=s+1\), we obtain linear codes with parameters \([s+4, s-28, 20]\).