arXiv:1706.09178v2 [math.NT] 10 Sep 2019 rmnn ueyadtv bet r the are integers positive objects additive purely prominent oeatninhsprasbe adt h utpiaies multiplicative the to paid been O perhaps has attention more field eie ntrso otne rcin(semi-)convergents fraction continued of terms in terized K5 K8 a1b Y8 Yat19]). KY18, Kal16b, BK18, BK15, oal oiieintegers positive totally ftergltr u tews hi tutr ean qui O remains structure their th otherwise on but bound regulator, upper the an of proved [Bru83] Brunotte decomposables: eti plctos(uha h eetpors ntestu the over in lattices progress and recent forms the as (such applications certain h ae“xrmleeet” opoeta if that prove to elements”) “extremal name the ssmo n ubro qae [Sie45]. squares of number any of sum as rs n calu[S2 rvda pe on ntenr of norm the on bound upper an proved posable [DS82] Scharlau and Dress n h eodato J1,Kl6,T1] hssad nco in stands This field real TV18]. totally Kal16a, general [JK16, a of author situation second the and Q n ata upr yCalsUiest eerhCnr p Centre Research University Charles by support partial and integer. indecomposable additively fraction, continued K K + and h diiesmgopo oal oiieintegers positive totally of additive The 2010 h olo hsatcei osuytesrcueo h whole the of structure the study to is article this of goal The ntera udai case quadratic real the In e od n phrases. and words Key eakoldespotb zc cec onain(AR g (GAČR) Foundation Science Czech by support acknowledge We o xml,t t nt n nqefcoiainit pri into factorization unique and units its to example, for , +.Ti sa neetn rbe nisl,bti em al seems it but itself, in problem interesting an is This (+). K Q ahmtc ujc Classification. Subject a ogpae udmna oei leri ubrtheor number algebraic in role fundamental a played long has udai field quadratic nqeydcmoal neesin integers decomposable uniquely iesemigroup tive Abstract. ntrso h eidccniudfato for fraction continued periodic the of can terms they in relations; and integers) (indecomposable erators eut,w rv httesemigroup the that prove we results, N ( DIIESRCUEO OAL POSITIVE TOTALLY OF STRUCTURE ADDITIVE √ ( α ) hnteei oal oiieitgrin integer positive totally a is there then 5), ) ≤ D α Let hc a eetyrfie yJn,Km ikv,Voutier, Tinková, Kim, Jang, by refined recently was which , O ∈ O K OÁ ED N ÍĚSA KALA VÍTĚZSLAV AND HEJDA TOMÁŠ K K K + . ,γ β, K + + fttlypstv neesin integers positive totally of (+) elqartcnme ed eiru fttlypstv i positive totally of semigroup field, number quadratic real = UDAI INTEGERS QUADRATIC yKm lmr asn,adtescn uhr[Kim00, author second the and Yatsyna, Blomer, Kim, by Q htcno edcmoe noasum a into decomposed be cannot that ( O ∈ √ K D 1. = eara udai ed ecnie h addi- the consider We field. quadratic real a be ) K + o xml,i 95 iglue hm(under them used Siegel 1945, in example, For . Q Introduction ( √ K 11,1A5 00,20M14. 20M05, 11A55, 11R11, D K O n siaeternrs sn these Using norms. their estimate and ,idcmoalscnb ieycharac- nicely be can indecomposables ), hr ti uhhre odsrb in- describe to harder much is it where , K + + opeeydtrie h real the determines completely (+) neopsbeelements indecomposable K √ D sanme eddffrn from different field number a is eas hrceieall characterize also We . ormUC/C/2 (VK). UNCE/SCI/022 rogram K O n eemn t gen- its determine and K + K yo nvra quadratic universal of dy encl described nicely be nattlyra number real totally a in to emysterious. te htcno ewritten be cannot that at1-40Y(TH,VK) 17-04703Y rant √ rcueo h ring the of tructure diiesemigroup additive D i omi terms in norm eir e.Temost The mes. oncsayfor necessary so seScin2); Section (see ,ee though even y, ahindecom- each α tatt the to ntrast .. totally i.e., , = β ntegers, + γ of 2 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA

+ In particular, as indecomposable elements are precisely the generators of K (+), we need to determine the relations between them. While the descriptionO of inde- composables in terms of the continued fraction is fairly straightforward, it is a priori not clear at all if the same will be the case for relations, as there could be some “random” or “accidental” ones. Perhaps surprisingly, it turns out that this is not the case and that all the relations (given in Theorem 2) can be described quite elegantly. A key tool in the proof is the fact that each totally positive integer can be uniquely written as a Z+-linear combination of two consecutive indecomposables. We also show in Corollary 3 that this corresponds to a cancellative presentation + of the semigroup K (+). One of courseO cannot hope to have an analogue of unique factorization in the additive setting, but nevertheless, some elements can be uniquely decom- posed as a sum of indecomposables. In Theorem 4 we characterize all such uniquely decomposable elements and obtain again a very explicit result depend- ing only on the continued fraction. As another application, this then yields + a direct proof of Theorem 6 that K (+) (viewed as an abstract semigroup) completely determines D and the numberO field K. Let us briefly remark that this result can be viewed alongside a number of beautiful results concerning the (im)possibility of reconstructing a number field from some of its invariants, such as the absolute Galois , Dedekind zeta-function, or Dirichlet L-series, see, e.g., [Gaß26, Kub57, Neu69, Uch76, CdSL+19]. A natural question to ask is of course whether an analogue of our Theorem 6 holds also for totally real num- ber fields of higher degree, although this may be quite hard, as we lack a good understanding of indecomposable elements. Finally, we use our results to estimate the norms of totally positive integers, and in particular, analogously to the results that norms of convergents and inde- composables are at most 2D1/2 and D, respectively, we show that the norm of a uniquely decomposable elements is at most of the order D3/2 (Theorem 10). Note that structure theory of is a well-developed subject, e.g., see [CP67, Gri95], and the references therein. Among the fundamental topics in the area are classification problem (characterize a given class of semigroups, e.g., by finding their presentations) and isomorphism problem (decide when two presen- tations give isomorphic semigroups): our Corollary 3 and Theorem 6 solve these + problems for the semigroups K (+) (which are not finitely generated). Semigroups also have important applicationsO to theoretical computer science, for example in + relation to the study of formal languages. Quite similar to our semigroups K (+), that can be viewed as subsets of Z2, are the important linear and semilinearO subsets of Zn [Gin66, Ch. 5]). Also in number theory, numerical semigroups, i.e., subsemi- groups of Z+(+), are commonly studied, e.g., [GSR99] study their presentations. As a final example, let us mention that additive subsemigroups of Zn, that have + similar geometric properties as K , were recently used to classify a certain class of semifields [KK18]. O

Acknowledgments We are grateful to the anonymous referee for pointing out that we were using the incorrect notion of semigroup presentation and for several other very useful comments that helped us improve the article. ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 3

2. Preliminaries Throughout the work, we will use the following notation. We fix a squarefree integer D 2 and consider the real quadratic field K = Q(√D) and its ring of integers ≥; we know that 1,ω forms an integral basis of , where OK { D} OK √D if D 2, 3 (mod 4), ωD := ≡ 1+√D if D 1 (mod 4). ( 2 ≡ By ∆ we denote the discriminant of K, i.e., ∆ = 4D if D 2, 3 (mod 4) and ∆ = D otherwise. The norm and trace from K to Q are denoted≡ by N and Tr, respectively. An algebraic integer α is totally positive iff α> 0 and α′ > 0, where α′ is ∈ OK the Galois conjugate of α, we write this fact as α 0; for α, β K we denote by + ≻ ∈ O α β the fact that α β 0, and by K the set of all totally positive integers. ≻ + − ≻ O We say that α K is indecomposable iff it can not be written as a sum of two ∈ O + totally positive integers or equivalently iff there is no algebraic integer β K + ∈ O such that α β. We say that α K is uniquely decomposable iff there is a unique way how≻ to express it as a sum∈ O of indecomposable elements. It will be slightly more convenient for us to work with a purely periodic contin- ued fraction, and so let σD = [u0,u1,...,us 1] be the periodic continued fraction expansion of − √D + √D if D 2, 3 (mod 4), : σD = ωD + ωD′ = 1+√D ⌊ 1+⌋ √D ≡ ⌊− ⌋ + − if D 1 (mod 4) ( 2 2 ≡ (with positive integers u ). We then have that ω = u /2 , u ,...,u . It is well i D ⌈ 0 ⌉ 1 s known that u1,u2,...,us 1 is a palindrome and that u0 = us is even if and only if D 2, 3 mod 4, hence −u /2 = (u + Tr(ω ))/2 [Per13, § 24.II].  ≡ ⌈ 0 ⌉ s D Denote the convergents to ωD by pi/qi := u0/2 ,u1,...,ui and recall that the sequences (p ), (q ) satisfy the recurrence ⌈ ⌉ i i   (1) X = u X + X for i 1 i+2 i+2 i+1 i ≥− with the initial condition q 1 = 0, p 1 = q0 = 1, and p0 = u0/2 [Per13, § 1]. − − ⌈ ⌉ Denote αi := pi qiωD′ and αi,r = αi +rαi+1. Then we have the following classical facts (see, e.g., [DS82]):− The sequence (α ) satisfies the recurrence (1). • i We have that αi 0 if and only if i 1 is odd. • The indecomposable≻ elements in +≥−are α with odd i 1 and 0 • OK i,r ≥ − ≤ r ui+2 1, together with their conjugates. We≤ have− that α = α . • i,ui+2 i+2,0 The indecomposables αi,r are increasing with increasing (i, r) (in the lex- • icographic sense). The indecomposables α′ are decreasing with increasing (i, r). • i,r We also denote ε > 1 the fundamental unit of K ; we have that ε = αs 1. Furthermore, we denote ε+ > 1 the smallest totallyO positive unit > 1; we have− + + 2 that ε = ε if s is even and ε = ε = α2s 1 if s is odd. Furthermore, we denote − 1 γ0 = ωD and γi = [ui,ui+1,ui+2,... ] for i 1; we have that ui <γi = ui + < ≥ γi+1 u +1 for i 1. i ≥ 4 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA

In the final Section 5 we will estimate norms of totally positive integers and particularly uniquely decomposable integers. To this end, we will use the following additional notation: For a convergent αi, we set p2 Dq2 if D 2, 3 (mod 4), : i+1 i i Ni = N(αi) = ( 1) N(αi)= | 2 − | 2 D 1 ≡ | | − p p q q − if D 1 (mod 4). (| i − i i − i 4 | ≡ i Recall that we have pi+1qi piqi+1 = ( 1) and let us define Ti so that αiαi′+1 = i − − D 1 Ti+1 + ( 1) ωD. This means that we have Ti = pi(pi 1 qi 1) qiqi 1 − or − − − − − − 4 Ti = pipi 1 Dqiqi 1 when D 1 (mod 4) or 2, 3 (mod 4), respectively. − − − ≡ 3. Relations in the semigroup + (+) OK In this section we will consider all the (additive) relations that hold in the + semigroup K (+). We will show in Theorem 2 that they all follow from certain O + basic relations, and that this amounts to giving a presentation of K (+) as a commutative, cancellative semigroup (Corollary 3). O Let := α : i 1 odd and 0 r u 1 1 A { i,r ≥− ≤ ≤ i+2 − }\{ } denote the set of indecomposable elements > 1 and ′ := y′ : y the set of their conjugates, that is, of indecomposables < 1. NoteA that{ each∈A} totally positive integer is a finite sum of indecomposables (for, by considering the trace Tr: K Q + → it is easy to see that there are no infinite descending chains in with respect OK to ); in other words, the indecomposables ′ 1 generate the semigroup +≻ A ∪ A ∪{ } (+). OK Let us now consider the following relations (in K ) between the indecompos- ables: O

(2a) αi,r 1 2αi,r + αi,r+1 = 0 for odd i 1 and 1 r ui+2 1, − − ≥− ≤ ≤ − (2b) αi 2,ui 1 (ui+1 + 2)αi,0 + αi,1 = 0 for odd i 1, − − − ≥ (2c) same relations as in (2a) and (2b) after applying the automorphism (′),

(2d) α′ 1,1 (u0 + 2) 1+ α 1,1 =0. − − · − We will shortly see that these relations hold (in fact, it is a straightforward verification from the definitions), but let us first introduce an alternative notation of the indecomposables for convenience. We define β , j Z, by the condition j ∈ that < β 3 < β 2 < β 1 < β0 = 1 < β1 < β2 < β3 < is the increasing · · · − − − · · · sequence of the indecomposables. Note that we have βj′ = β j for all j Z. − ∈ Lemma 1. For each j Z we have that ∈ vj βj = βj 1 + βj+1, − where

2 if β j = αi,r with odd i 1 and 1 r ui+2 1, vj := | | ≥− ≤ ≤ − (ui+1 +2 if β j = αi,0 with odd i 1. | | ≥−

Proof. As β j = βj′ , we can assume j 0. We have βj = αi,r for some odd i 1 and 0 r −u 1. ≥ ≥− ≤ ≤ i+2 − ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 5

If 1 r ui+2 1, then βj 1 = αi,r 1 = αi + (r 1)αi+1, βj = αi,r = ≤ ≤ − − − − αi + rαi+1 and βj+1 = αi,r+1 = αi + (r + 1)αi+1 form an arithmetic sequence, whence βj βj 1 = βj+1 βj , which is the statement. If r = 0− and−i 1, we− have a multiple of α = α as the left-hand side and ≥ i,0 i αi 2,ui 1 + αi,1 as the right-hand side. We use the definition of αi,r and the − − recurrence (1) for αj to see that

αi 2,ui 1 + αi,1 = αi 2 + (ui 1)αi 1 + αi + αi+1 − − − − − = αi αi 1 + αi + ui+1αi + αi 1 = (ui+1 + 2)αi = (ui+1 + 2)αi,0. − − − Finally, consider r = 0 and i = 1, i.e., the case j = 0. We have β1 = α 1,1 = − − α +1= u /2 ω′ + 1, whence 1 ⌈ 0 ⌉−  β1 + β 1 = Tr(β1) = Tr( u0/2 ωD′ +1)=2 u0/2 Tr(ωD)+2= u0 +2. − ⌈ ⌉− ⌈ ⌉− Note that with the notation from Lemma 1, we can rewrite the relations (2a)– (2d) in a unified way in terms of βj and vj as follows:

(3) βj 1 vj βj + βj+1 =0 for j Z. − − ∈ As our first main theorem, we can now show that each totally positive integer is a linear combination of two consecutive indecomposables with non-negative integral coefficients. A variant of this statement concerning sums of powers of units was used by Kim, Blomer, and the second author [Kim00, BK18] in the construction of universal quadratic forms. Theorem 2. Let x + be given as a finite sum x = k β with k Z. Then ∈ OK j j j ∈ there exist unique j0,e,f Z with e 1 and f 0 such that x = eβj + fβj +1. ∈ ≥ ≥ P 0 0 Every relation of the form hj βj = 0 (with hj Z and only finitely many non-zeros) is a Z-linear combination of the relations (3)∈ ; in particular, this is true for eβ + fβ k β =0P. j0 j0+1 − j j Proof. As the sequenceP (βj )j Z is strictly increasing from 0 to + and the se- ∈ ∞ quence (βj′ )j Z is strictly decreasing from + to 0, we know that the sequence ∈ ∞ (βj /βj′ )j Z is strictly increasing from 0 to + . As x 0, we have that x/x′ > 0. ∈ ∞ ≻ Hence we can fix the unique index j0 such that β x β (4) j0 < j0+1 . βj′0 ≤ x′ βj′0+1

jmax We will first show that x = j=jmin kj βj can be rewritten to

(5) x = eβjP0 + fβj0+1 with e,f Z ∈ using only relations (3). We assume that jmin j0 and jmax j0 + 1 (if not, we pad the sum by zeros to achieve this). We use induction≤ on the≥ length of the sum L = j j +1 2: max − min ≥ Suppose L = 2. Then j = j and j = j + 1. Putting e = k and • min 0 max 0 j0 f = kj0+1 gives the statement. Suppose L 3 and j j 1. Then • ≥ min ≤ 0 − jmax x = (k + v k )β + (k k )β + k β jmin+1 jmin+1 jmin jmin+1 jmin+2 − jmin jmin+2 j j j=j +3 Xmin 6 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA

(here we used (3) for j = jmin + 1) is a sum of the same form with length L 1. Suppose− L 3 and j = j . Then j = j + L 1 j + 2 and • ≥ min 0 max 0 − ≥ 0 jmax 3 − x = kj βj + (kjmax 2 kjmax )βjmax 2 + (kjmax 1 + vjmax 1kjmax )βjmax 1 − − − − − − j=j Xmin (here we used (3) for j = jmax 1) is a sum of the same form with length L 1. − − This finishes the proof of (5) (note that so far we have not used the property of j0). We now plug (5) into (4) to derive that

0 f(β β′ β β′ ) and 0

As βj′0 > βj′0+1 > 0 and βj0+1 > βj0 > 0, we have that βj0+1βj′0 βj0 βj′0+1 > 0, hence e> 0 and f 0. − ≥ To prove the uniqueness of j0 from the statement of the proposition, suppose

to the contrary that j1 = j0 and x = e1βj1 + f1βj1+1 with e1 > 0 and f1 0. We first consider the case when6 j j 1, i.e., ≥ 1 ≤ 0 − β β x e β + f β j1 < j1+1 = 1 j1 1 j1+1 . βj′1 βj′1+1 ≤ x′ e1βj′1 + f1βj′1+1

Easy manipulation leads to e1(βj1+1βj′1 βj1 βj′1+1) 0, hence e1 0. Likewise, in the case j j +1 we get f < 0. − ≤ ≤ 1 ≥ 0 1 Once j0 is fixed, the uniqueness of e,f follows from the linear independence of

βj0 ,βj0+1 over Q.

For the second part of the theorem, note that we have already proved this for eβ + fβ k β = 0 (as we deduced (5) only using (3)). j0 j0+1 − j j Consider now any relation between indecomposables hjβj = 0 (where of P course only finitely many hj’s are non-zero). Let us write this as two sums, P (6) h β ( h )β =0, i.e., x := h β = ( h )β . j j − − j j j j − j j hXj >0 hXj <0 hXj >0 hXj <0 + Clearly x K . By the first part of the theorem, x is uniquely written as x = eβ + fβ ∈ Ofor some j Z, e 1, f 0; and we know that both eβ + fβ = j j+1 ∈ ≥ ≥ j j+1 hj βj and eβj + fβj+1 = ( hj )βj follow from (3). Thus also the hj >0 hj <0 − identity between the two right-hand sides follows from (3).  P P In order to show that Theorem 2 amounts to a certain presentation of the + semigroup K (+), let us first recall some relevant definitions (see [Gri95] for more backgroundO and for any undefined notions). Note that we will use the additive + notation, as we are interested in the additive semigroup K (+), although in the literature it is perhaps more common to view semigroupsO multiplicatively. Let S(+) be a commutative semigroup, i.e., a set S together with a + that is commutative and associative. S is cancellative iff x+z = y +z implies x = y (for all x,y,z S). In this case, let G(S)= S S be the universal (or Grothendieck) group of S, i.e.,∈ the group of (formal) differences− a b for a,b S, − ∈ ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 7

where a b = c d in G(S) iff a + d = b + c in S (see [Gri95, Ch. II, §§ 1, 2]). As S is cancellative,− − we can view it as a subset of G(S), i.e., S G(S). Let us now introduce presentations (following, e.g., [Gri9⊂5, Ch. I]). Let X be a set and let be a set of relations between the elements of X, i.e., formal R expressions x1 + + xu = y1 + + yv for xi,yj X. Let FX (+) be the free commutative semigroup· · · over the set· · · of generators X∈and let be the congruence C on FX generated by the relations (see [Gri95, Ch. 1, Proposition 2.9]). Then X is a presentation of a commutativeR semigroup S(+) iff S is isomorphic hto the| Ri quotient F / of F by the congruence . Note that F / in general X C X C X C need not be cancellative (although FX is), and so, when considering cancellative semigroups, it is sometimes more convenient to consider cancellative presentations. We say that X c is a cancellative presentation of a cancellative, commu- tative semigrouph S(+)| Ri iff S is isomorphic to the quotient F / , where is the X D D smallest cancellative congruence on FX that contains the relations R. The uni- versal property of presentations implies that it is also isomorphic to the factor of X by the smallest cancellative congruence (cf. [Gri95, Ch. II, Proposi- tionh 2.3]).| Ri A little less formally, X c is a cancellative presentation a cancellative, commutative semigroup Sh(+)| if RiS is generated by X and all (additive) relations between elements of X are generated by consecutively applying the relations in and by using the cancellative law ‘x + z = y + z implies x = y’. R Corollary 3. Let X = B : j Z and { j ∈ } (7) : Bj 1 + Bj+1 = vj Bj for j Z T − ∈ (where v are as in Lemma 1). Then X is a cancellative presentation of the j h | T ic cancellative, commutative semigroup + (+). OK Proof. Let us consider the (semigroup) homomorphism ϕ: F + defined by X → OK ϕ(Bj )= βj. The indecomposables β are generators of + , and so ϕ is surjective. Let j OK E be the corresponding congruence on FX , i.e., a b iff ϕ(a)= ϕ(b). Hence we have +E an isomorphism of cancellative semigroups K FX / and is a cancellative congruence. O ≃ E E Let further be the smallest cancellative congruence on FX that contains the relations . SinceD the relations (corresponding to) hold for β by Lemma 1, we T T j have . Furthermore, as + is a cancellative commutative semigroup, we T ⊂E OK have . In order to show that X c is indeed cancellative presentation of + D⊂E h | T i K (+), it remains to show that = . This is essentially clear from Theorem 2, butO we can also proceed formallyD as follows.E As in [Gri95, Ch. II, Proposition 5.1], let R( ) be the Rédei group of , i.e., R( ) is the subgroup of G(F ) (which is clearlyD the free commutativeD group D X generated by X) such that R( )= a b : a,b FX ,a b . Similarly let let R( ) be the Rédei group of . TheD Rédei{ group− uniquely∈ determinesD } the correspondingE cancellative congruence,E and so it suffices to show that R( )= R( ). By the minimality of , we see that R( ) is the smallestD subgroupE of G(F ) D D X that contains Bj 1 vj Bj + Bj+1 for all j. By definition, R( ) consists precisely of sums h B −(with− h Z) such that h β = 0 holds (inE ). But by the j j j ∈ j j OK P P 8 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA second part of Theorem 2, each such relation hjβj = 0 follows from the relations (3). We have thus proved that R( )= R( ).  D E P Note that it is easy to see that the given set of relations (7) is minimal in the sense that none of them can be removed. Let us also note that we indeed need to work with cancellative presentations. For example, B0 + B3 = (v1 1)B1 + (v2 1)B2 holds in X c, but does not hold in X , as we cannot− apply any− of the relationsh (7)| to T ithis identity (without usingh cancellation).| T i

4. Uniquely decomposable elements + We now characterize all the uniquely decomposable elements in K using the results of the previous section. O Theorem 4. All uniquely decomposable elements x + are the following: ∈ OK (a) αi,r with odd i 1 and 0 r ui+2 1; (b) eα with odd i≥− 1 and with≤ ≤2 e −u +1 i,0 ≥− ≤ ≤ i+1 (c) αi,ui+2 1 + fαi+2,0 with odd i 1 odd such that ui+2 2 and with 1 f − u ; ≥ − ≥ ≤ ≤ i+3 (d) eαi,0 + αi,1 with odd i 1 such that ui+2 2 and with 1 e ui+1; (e) eα + fα with odd≥−i 1 such that≥u = 1 and≤ with≤1 e i,0 i+2,0 ≥ − i+2 ≤ ≤ ui+1 +1, 1 f ui+3 +1, (e,f) = (ui+1 +1,ui+3 + 1); (f) Galois conjugates≤ ≤ of all of the above.6 Note that the first item lists all the indecomposables (which are clearly uniquely decomposable) and the second one comprises small multiples of all convergents α 0, including positive integers 1, 2,...,u + 1. i ≻ 0 Proof. The statement of the theorem, when rewritten using βj and vj (defined in Lemma 1), says that x is uniquely decomposable if and only if x = eβj + fβj+1 with (8) 1 e v 1, 0 f v 1 and (e,f) = (v 1, v 1). ≤ ≤ j − ≤ ≤ j+1 − 6 j − j+1 − Let x be uniquely decomposable. By Theorem 2, it can be written as x = eβj + fβj+1 for some e,f,j Z with e 1,f 0. Suppose now that e,f do not satisfy (8). This can happen∈ only in one≥ of the≥ following ways:

e vj . Then x = eβj + fβj+1 = βj 1 + (e vj )βj + (f + 1)βj+1 are two • decompositions≥ of x (see Lemma 1).− − f vj+1. Then x = eβj + fβj+1 = (e + 1)βj + (f vj+1)βj+1 + βj+2 are • two≥ decompositions of x. − (e,f) = (vj 1, vj+1 1). Then x = (vj 1)βj+(vj+1 1)βj+1 = βj 1+βj+2 • are two decompositions− − of x. − − − Conversely, let us now show that the condition (8) is sufficient. First note that (8) implies (9) x + β v β + v β or x + β v β + v β . j  j j j+1 j+1 j+1  j j j+1 j+1 Suppose now that x = eβj + fβj+1 with e,f satisfying (8) is not uniquely decom- posable. This can happen only in one of the following ways: ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 9

x has a decomposition that contains some β with i j + 2, i.e., x β • i ≥  i ≥ βj+2. Simultaneously, we have from (9) that x+βj 1 vj βj +vj+1βj+1 = − ≤ βj 1 + βj+2, whence x<βj+2. This is a contradiction. x −has a decomposition that contains some β with i j 1, i.e., x β . • i ≤ −  i Then x′ βi′ βj′ 1. We also have from (9) that x′ + βj′+2 vj βj′ + ≥ ≥ − ≤ vj+1βj′+1 = βj′ 1 + βj′+2, and so x′ <βj′ 1, a contradiction. x = eβ + fβ − = e β + f β for (e,f− ) = (e ,f ). This is impossible • j j+1 1 j 1 j+1 6 1 1 as βj ,βj+1 are linearly independent over Q. 

Note that similarly to the classical formula for the number of indecomposables as a sum of some coefficients ui (e.g., [BK15]), we can now express the number of uniquely decomposable elements.

+ Corollary 5. The number of uniquely decomposable elements of K modulo totally positive units (i.e., powers of ε+) is equal to O

s s s 1 − ui +2 ui + ui 1ui+1 in case s even, − i=1 i=2 i=1 X iXeven i oddX, ui=1 s s 4 ui + ui 1ui+1 in case s odd. − i=1 i=1 X uXi=1 Proof. Denote s+ = s for s even and s+ =2s for s odd. Then by direct computa- tion from Theorem 4, we obtain that the number is, for each item in the theorem statement:

(a) ui+2; (b) ui+1; (c) ui+3; (d) ui+1;

ui+2 2 ui+2 2 X X X≥ X≥ (e) (u + 1)(u + 1) 1 = (u + u )+ u u , i+1 i+3 − i+1 i+3 i+1 i+3 ui+2=1 ui+2=1 ui+2=1 X  X X + + where all the sums are over odd i between 1 and s , because αi+s+ = ε αi for all odd i 1 so this restriction on i picks one representative from the uniquely decomposable≥ − integers for each class modulo powers of ε+. Rearranging the sums s+ s+ s+ 1 and using that ui+s = ui we get the result ui +2 i=1 ui + − ui 1ui+1; i=1 i=1 − i even i odd, ui=1 this finishes the proof for s even. P P P For s odd, note that all the summands are perodic with period s, hence a sum over all 1 i s+ is twice the sum over all 1 i s and a sum over odd 1 i s+ ≤is equal≤ to the sum over all 1 i s. ≤ ≤  ≤ ≤ ≤ ≤ As another application, we use Theorem 4 to prove that the additive semigroups of totally positive integers of different real quadratic fields are non-isomorphic. This is in stark contrast to the situation of the groups K (+), which are all isomorphic to Z2(+). O 10 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA

+ Theorem 6. The additive semigroups K , for real quadratic fields K, are pairwise not isomorphic. O

Proof. Assume that we are given + (+) as an abstract semigroup S(+). To prove OK the uniqueness of K = Q(√D), we shall reconstruct the continued fraction for σD using the additive structure of S. Note that the indecomposable and uniquely decomposable elements are well-defined in S as they are defined intrinsically just from the semigroup structure. Since S is a cancellative semigroup, we can consider the universal (or Grothendieck) group of differences G(S) = S S and have S G(S). − ⊂Consider all the indecomposables such that their double is uniquely decompos- able: A := α S : α indecomposable and 2α uniquely decomposable . { ∈ } From Theorem 4 we know that A is exactly the set of convergents and their conjugates, A = α , α′ : i odd . For α A, denote k the maximum integer { i i } ∈ α such that kαα is uniquely decomposable. From Theorem 4cd we know that for each α A there are exactly two β S such that ∈ ∈ (10) kαα + β is uniquely decomposable,

namely if α = αi then β = αi,1 = α + αi+1 or β = αi 2,ui 1 = αi 2,ui αi 1 = − − − − − α αi 1. −Consider− now an infinite (bipartite) graph G with vertices A B, where ∪ B := α β,β α : α A, α, β satisfy (10) , { − − } ∈ where α β G(S). Note that B actually contains pairs α , α and − ∈ { i+1 − i+1} α′ , α′ with odd i (but we have no intrinsic way of distinguishing α { i+1 − i+1} i+1 from αi+1). The edges in G are defined as follows: There is an edge between α A−and γ, γ B iff β = α γ or β = α + γ satisfy (10). Then G is actually an∈ infinite chain{ − corresponding} ∈ to−

...,α3′ , α2′ , α2′ , α1′ , α0′ , α0′ , α 1 = α′ 1 =1, α0, α0 , α1, α2, α2 , α3,... { − } { − } − − { − } { − } We add labels on each vertex of G in the following way: We label α A by k 1. For γ, γ B and its neighbors α, α˜, we have that α α˜ = l γ for∈ some α − { − } ∈ − γ lγ Z and we label γ, γ by lγ . To see the motivation behind this, assume that∈ γ = α for some{ odd− i}; then| α| α˜ = (α α )= (α +u α α )= i+1 − ± i+2 − i ± i i+2 i+1 − i ui+2αi+1. ± Whence we know that for i odd, α is labelled by u and α α is i i+1 { i+1, − i+1} labelled by ui+2 (with the same being true for αi′ ). This means that the infinite chain of the labels is equal to

...,us 1,us = u0,u1,u2,...,us 2,us 1,us = u0,u1,... − − − (where it does not matter in which direction we read the chain as it is a palin- drome). We know that u0 is the maximal value in the chain and that s is the (shortest) period of the chain. This means that we have reconstructed σD = [u0; u1,...,us 1] just from the intrinsic properties of S(+).  − ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 11

5. Estimating norms We have seen in Theorem 2 that (up to conjugation) every element of + can be OK uniquely written in the form eαi,r +fαi,r+1, where i 1 is odd, 0 r ui+2 1, e 1, and f 0. We will now estimate the norm of≥− such an element,≤ generaliz≤ −ing the≥ results concerning≥ indecomposables by Dress, Scharlau, Jang, Kim, the second author (and others) [DS82, JK16, Kal16a]; here we will use the notation introduced at the end of Section 2. Let us start by recalling the following classical fact (for the proof see, e.g., [Kal16a, Proposition 5] and [BK18, Lemma 3]). Lemma 7. For all i 1, we have ≥− √∆ N N N = i ,T = ( 1)i+1 ω i . i+1 γ − γ2 i+1 − D − γ i+2 i+2  i+2  We are interested in

eαi,r + fαi,r+1 = (e + f)αi + re + (r +1)f αi+1, and so let us first prove a general formula for the norm of the element on the right-hand side. Lemma 8. Let m,n Z and i 1 odd. Then ∈ ≥− n N N(mα + nα )= m n√∆+ mN n i . i i+1 − γ i − γ  i+2  i+2  Proof. Let’s prove the result only when D 2, 3 (mod 4), as the other case is very similar. Using the definitions and the previous≡ lemma, we compute 2 2 N(mαi + nαi+1)= m N(αi)+ n N(αi+1)+ mn(αiαi′+1 + αi′ αi+1) 2√D N N = m2N n2N +2mnT = m2N n2 i +2mn √D i i − i+1 i+1 i − γ −γ2 −γ  i+2 i+2   i+2  n Ni = m 2n√D + mNi n . − γi+2 − γi+2   

Now we return to the original situation when m = e + f and n = re + (r +1)f and estimate the norm of totally positive integers. + Proposition 9. Consider α = eαi,r + fαi,r+1 K with i 1 odd, 0 r < u , e 1, and f 0. Then we have the following∈ O upper bounds≥ − on N(α):≤ i+2 ≥ ≥ ∆ N(α) < √∆ (r +1)e + (r +2)f (e + f) and N(α) < (e + f)2 . 4Ni+1 For a lower bound we distinguish four cases: (1) If f > 0 and r =0, then N(α) > ef√∆. (2) Let c (0, 1). If f > 0 and 1 r cu 1, then N(α) > (1 c)(e + ∈ ≤ ≤ i+2 − − f)2√∆. (3) If f > 0 and ui+2+1 < r u 1, then N(α) > √∆ e(e + f). 2 ≤ i+2 − 2 (4) If f =0 and r> 0, then N(α) >e2 1 1 √∆. − ui+2  12 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA

Note that when f = r = 0, then α = eαi is a multiple of a convergent and we have a good control on the size of its norm by Lemma 7. Hence we have not included the lower bound for this case in the proposition.

Proof. Let m = e + f and n = re + (r +1)f. By the previous proposition, we want to estimate n N (11) N(mα + nα )= m n√∆+ mN n i . i i+1 − γ i − γ  i+2  i+2  =:A =:B

r r+1 We have A = e 1 + f 1 | {z and} B| = n√∆+{zANi. } − γi+2 − γi+2 We start with the upper bounds. We have A

(mαi + nαi+1)α′ N(mαiα′ + nN(αi+1)) N(α)= N i+1 = i+1 α N(α )  i′+1  i+1 N(mT nN m√D) (mT nN )2 m2D = i+1 − i+1 − = i+1 − i+1 − N N − i+1 − i+1 m2D (mT nN )2 m2D = − i+1 − i+1 < . Ni+1 Ni+1 We finish with the lower bounds. Let us assume first that f > 0 and distinguish three cases according to the size of r. Case r = 0. Then A>e and B > √∆f. • r Case 1 r cui+2 1. Then r +1 cui+2 < cγi+1, and so 1 > • ≤ ≤ − ≤ − γi+2 1 r+1 > 1 c. Thus A = e 1 r + f 1 r+1 > (1 c)(e + f). − γi+2 − − γi+2 − γi+2 − Moreover, B > √∆(e + f)r.   Case ui+2+1 < r u 1. Again, B > √∆(e + f)r. Note that the • 2 ≤ i+2 − function r 1 r r is increasing for r > ui+2+1 . If we apply this 7→ − γi+2 2 r ui+2 1 observation, we obtain Ar > e 1 r>e 1 − (ui+2 1) =  − γi+2 − γi+2 − 1+(γi+2 ui+2) ui+2 1 e e − (ui+2 1) > e − > , where we use the fact that ui+2+(γi+2 ui+2) − ui+2 2 u r +1− 2. i+2 ≥ ≥ 2 Finally, if f = 0, then N(α)= e N(αi,r), so proving the case e = 1 is sufficient. If r = 0, then estimates on the norm of the convergent αi are well-known, see, e.g., [BK18, Lemma 5]. Assume hence 1 r u 1. We have ≤ ≤ i+2 − r N r N(α )= 1 r√∆+ N r i > 1 r√∆. i,r − γ i − γ − γ  i+2  i+2   i+2  Since the minimum of the function r 1 r r is at one of the endpoints 7→ − γi+2 of the considered interval 1 r u 1, we conclude that N(α ) > 1 ≤ ≤ i+2 −  i,r − 1 √∆.  ui+2  ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 13

Let us conclude the paper with some applications of the previous proposition. From the theory of continued fractions it quite easily follows that all elements with absolute value of norm less than √∆/4 are convergents [BK18, Proposition 7]. However, often it is useful to know all elements of norm less than √∆ (or other small multiples of √D): the characterization of all such totally positive integers follows easily from our proposition. Finally, we prove an upper bound on the norm of uniquely decomposable ele- ments, similar to the bounds on norms of convergents N = N(α ) < √∆ and i+1 i ui+1 ∆ | | indecomposables N(αi,r) (for odd i). ≤ 4Ni+1 Theorem 10. If α + is uniquely decomposable, then ∈ OK N(α) < √∆ 2√∆+1 3√∆+2 .

Proof. All uniquely decomposable α are described in Theorem 4, and so we just need to check the estimate on the norm in each of these cases. This is very easy when α is an indecomposable or a multiple of a convergent. In the rest of the proof we will often use the easy observation that uj us < √∆ for all j. Case α = eα + fα with odd i 1 such≤ that u = 1 and with 1 i i+2 ≥ − i+2 ≤ e ui+1 +1, 1 f ui+3 +1, (e,f) = (ui+1 +1,ui+3 + 1). In the notation of≤ Proposition 9≤ we have≤ r = 0, and so6 the first upper bound gives N(α) < √∆(e+2f)(e+f). Thus the estimate follows from the range of e,f using uj < √∆. Case eαi,0 + αi,1 with odd i 1 such that ui+2 2 and with 1 e ui+1. We have f = 1 and r = 0, and so≥ we − similarly as in the≥ previous case≤ get N≤(α) < √∆(√∆ + 1)(√∆ + 2).

Case αi,ui+2 1 + fαi+2,0 for i 1 odd and 1 f ui+3. Now e = 1 − ≥ − ≤ ≤ ui+2 1 and r = ui+2 1. In the notation (11) we have A = 1 − + f 1 − − γi+2 − ui+2 < 2 + f = f+2 < √∆+2 . Because n < (f + 1)(r +1), we also have γi+2 ui+2 ui+2 ui+2 ui+2  B < (f + 1)u √∆+ AN < (√∆+1)u √∆+ √∆+2 √∆. Finally,  i+2 i i+2 ui+2

√∆+2 2 N(α)= AB < √∆+1 ui+2√∆+ √∆+2 √∆ < √∆+2 √∆ 2√∆+3 . ui+2    

The bound is essentially sharp in the first case discussed in the proof: For example, consider the situation when i is odd, u := ui+1 = ui+3 > √∆/(1 + ε) (for a constant ε> 0), ui+2 = 1, and α = uαi + uαi+2 = u(2αi + αi+1). As γi+2 > 1, using Lemma 8 we get that ∆3/2 N(α)= u2N(2α + α ) >u2√∆ > . i i+1 (1 + ε)2 There are infinitely many such examples for any ε> 0, because there are infinitely 2 many squarefree D = n 1, which then have u2j =2 √D and u2j+1 = 1 for all j. Examples with ε 4,− say, seem to be fairly common.⌊ ⌋ Note that one could≥ also further refine the estimates in terms of sizes of the coefficients uj , similarly as was done in [JK16] for the norms of indecomposables. 14 TOMÁŠ HEJDA AND VÍTĚZSLAV KALA

References

[BK15] Valentin Blomer and Vítězslav Kala, Number fields without n-ary universal quadratic forms, Math. Proc. Cambridge Philos. Soc. 159 (2015), no. 2, 239–252. [BK18] Valentin Blomer and Vítězslav Kala, On the rank of universal quadratic forms over real quadratic fields, Doc. Math. 23 (2018), 15–34. [Bru83] Horst Brunotte, Zur Zerlegung totalpositiver Zahlen in Ordnungen totalreeller alge- braischer Zahlkörper [On the decomposition of totally positive numbers in orders of totally real algebraic number fields], Arch. Math. (Basel) 41 (1983), no. 6, 502–503, (in German). [CdSL+19] Gunther Cornelissen, Bart de Smit, Xin Li, Matilde Marcolli, and Harry Smit, Char- acterization of global fields by Dirichlet L-series, Res. Number Theory 5 (2019), no. 1, 5:7. [CP67] Alfred H. Clifford and Gordon B. Preston, The algebraic theory of semigroups. Vol. II, Mathematical Surveys, No. 7, American Mathematical Society, Providence, R.I., 1967. [DS82] Andreas Dress and Rudolf Scharlau, Indecomposable totally positive numbers in real quadratic orders, J. Number Theory 14 (1982), no. 3, 292–306. [Gaß26] Fritz Gaßmann, Bemerkungen zur vorstehenden arbeit von Hurwitz: Über beziehun- gen zwischen den primidealen eines algebraischen körpers und den substitutionen seiner gruppen [Note on the hereinabove work of Hurwitz: Relations between the primitives of an algebraic body and the substitutions of its groups], Math. Z. 25 (1926), 665–675, (in German). [Gin66] Seymour Ginsburg, The mathematical theory of context-free languages, McGraw-Hill Book Co., New York-London-Sydney, 1966. [Gri95] Pierre-Antoine Grillet, Semigroups, Monographs and Textbooks in Pure and Applied Mathematics, vol. 193, Marcel Dekker, Inc., New York, 1995, An introduction to the structure theory. [GSR99] Pedro A. García-Sánchez and José C. Rosales, Numerical semigroups generated by intervals, Pacific J. Math. 191 (1999), no. 1, 75–83. [JK16] Se Wook Jang and Byeong Moon Kim, A refinement of the Dress-Scharlau theorem, J. Number Theory 158 (2016), 234–243. [Kal16a] Vítězslav Kala, Norms of indecomposable integers in real quadratic fields, J. Number Theory 166 (2016), 193–207. [Kal16b] , Universal quadratic forms and elements of small norm in real quadratic fields, Bull. Aust. Math. Soc. 94 (2016), no. 1, 7–14. [Kim00] Byeong Moon Kim, Universal octonary diagonal forms over some real quadratic fields, Comment. Math. Helv. 75 (2000), no. 3, 410–414. [KK18] Vítězslav Kala and Miroslav Korbelář, Idempotence of finitely generated commutative semifields, Forum Math. 30 (2018), no. 6, 1461–1474. [Kub57] Tomio Kubota, Galois group of the maximal abelian extension over an algebraic number field, Nagoya Math. J. 12 (1957), 177–189. [KY18] Vítězslav Kala and Pavlo Yatsyna, Lifting problem for universal quadratic forms, 2018, submitted, arXiv:1808.02262. [Neu69] Jürgen Neukirch, Kennzeichnung der p-adischen und der endlichen algebraischen Zahlkörper [Characteristic of p-adic and finite algebraic number field extensions], Invent. Math. 6 (1969), 296–314. [Per13] Oskar Perron, Die Lehre von den Kettenbrüchen [The theory of continued fractions], First ed., B. G. Teubner Verlag, 1913, (in German). [Sie45] Carl Ludwig Siegel, Sums of mth powers of algebraic integers, Ann. of Math. (2) 46 (1945), 313–339. [TV18] Magdaléna Tinková and Paul Voutier, Indecomposable integers in real quadratic fields, 2018, submitted, arXiv:1808.02262. [Uch76] Kôji Uchida, Isomorphisms of Galois groups, J. Math. Soc. Japan 28 (1976), no. 4, 617–620. ADDITIVE STRUCTURE OF TOTALLY POSITIVE QUADRATIC INTEGERS 15

[Yat19] Pavlo Yatsyna, A lower bound for the rank of a universal quadratic form with integer coefficients in a totally real number field, Comment. Math. Helv. 94 (2019), no. 2, 221–239.

Charles University, Faculty of Mathematics and Physics, Department of Algebra, Sokolovská 83, 18600 Praha 8, Czechia University of Chemistry and Technology, Prague, Department of Mathematics, Studentská 6, 16000 Praha 6, Czechia E-mail address: [email protected]

Charles University, Faculty of Mathematics and Physics, Department of Algebra, Sokolovská 83, 18600 Praha 8, Czechia E-mail address: [email protected] URL: https://sites.google.com/site/vitakala/