We improve the bound of the g-invariant of the ring of integers of a totally real number field, where the g-invariant g(r) is the smallest num - ber of squares of linear forms in r variables that is required to represent all the quadratic forms of rank r that are representable by the sum of squares. Specifically, we prove that the gOK (r) of the ring of integers OK of a totally real number field K is at most gZ([K : Q]r).
Moreover, it can also be bounded by gOF ([K : F]r + 1) for any subfield F of K. This yields a subexponential upper bound for g(r) of each ring of integers (even if the class number is not 1).
Further, we obtain a more general inequality for the lattice version G(r) of the invariant and apply it to determine the value of G(2) for all but one real quadratic field.