\documentclass[12pt,a4paper,leqno]{article}
\usepackage{amssymb,amsthm,amscd,amsmath}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\im}[1]{{\it Im}(#1)}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}
\newcommand{\ff}{\mathbb F}
\newcommand{\qq}{\mathbb Q}
\newcommand{\bb}{\mathbb B}
\newcommand{\cc}{\mathbb C}
\newcommand{\nat}{\mathbb{N}}
\newcommand{\zz}{\mathbb Z}
\newcommand{\rr}{\mathbb R}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\oo}{\mathcal{O}}
\newcommand{\dset}[2]{D_{#1} (#2)}
\newcommand{\dbin}[2]{\dset{#1}{\la 1, #2\ra}}
\newcommand{\mg}[1]{#1^{\times}}
\newcommand{\sq}[1]{#1^{\times 2}}
\newcommand{\scg}[1]{\mg{#1}/\sq{#1}}
\newcommand{\sums}[1]{\sum\!{#1}^2}
\newcommand{\lla}{\la\!\la}
\newcommand{\rra}{\ra\!\ra}
\newcommand{\brd}[1]{{\rm Br}_2(#1)}
\newcommand{\brp}[1]{{\rm Br}_p(#1)}
\newcommand{\br}[1]{{\rm Br}(#1)}
\newcommand{\ovl}{\overline}
\newcommand{\unl}{\underline}
\newcommand{\vb}[1]{\bar{#1}}
\newcommand{\follows}[2]{$(#1\Rightarrow #2)$\,\,}
\newcommand{\rad}[1]{{\rm R}(#1)}
\newcommand{\Symm}[1]{{\rm Sym}({#1})}
\newcommand{\Skew}[1]{{\rm Skew}({#1})}
\newcommand{\di}{\diamond}
\newcommand{\wh}[1]{\widehat{#1}}
\newcommand{\rk}{{\it rk}}
\newcommand{\sign}{{\rm sign}}
\newcommand{\mfp}{\mathfrak{p}}
\newcommand{\wt}[1]{\widetilde{{#1}}}
\newcommand{\ind}{\rm ind}
\newcommand{\pind}{\rm pind}
\newcommand{\ub}{\hat{u}}
\newcommand{\uh}{\wt{u}}
\newcommand{\lra}{\longrightarrow}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\swapnumbers
\numberwithin{equation}{section}
\newtheorem{thm}[equation]{Theorem}
\newtheorem{prop}[equation]{Proposition}
\newtheorem{cor}[equation]{Corollary}
\newtheorem{conj}[equation]{Conjecture}
\newtheorem{hypo}[equation]{Hypothesis}
\newtheorem{lem}[equation]{Lemma}
\newtheorem{qu}[equation]{Question}
\theoremstyle{definition}
\newtheorem{de}[equation]{Definition}
\newtheorem{nota}[equation]{Notation}
\newtheorem{ex}[equation]{Example}
\newtheorem{exs}[equation]{Examples}
\newtheorem{rem}[equation]{Remark}
\renewenvironment{proof}{\par\noindent {\em Proof: }}{\hfill$\Box$\medskip}
\theoremstyle{plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{Sums of squares in function fields\\ of hyperelliptic curves} 
\author{Karim Johannes Becher, Jan Van Geel}
\date{}
\begin{document}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{abstract}\noindent
We study sums of squares, quadratic forms, and related field invariants in a quadratic extension of the rational function field
in one variable over a hereditarily pythagorean base field.
\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction} %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%

Let be given a field $k$ such that the arithmetic properties of $k$ and of its finite extensions are well understood.
It is natural to consider arbitrary finitely generated extensions $F/k$ 
of transcendence degree $n$ and to study the arithmetic properties of $F$.
Satisfactory answers for this general problem are given by the Tsen-Lang Theory in those cases where $k$ is finite or algebraically closed.
The kind of arithmetic properties of fields which our work is addressing are those related to sums of squares and quadratic forms.
Important field invariants in this context are the pythagoras number and the $u$-invariant.
In the case where $k$ is a real closed field there are important results on the values of these invariants for function fields $F/k$, due to Pfister and to Elman and Lam (see \cite[Chap.~7 and 8]{Pfister}).
These results, however, have also highlighted some outstanding open problems.

The pythagoras number is the least upper bound on the number of squares necessary to express an arbitrary element of a field which is positive at all field orderings as a sum of squares.
Assume that there is a common finite upper bound for the pythagoras number of all finite extensions of the field $k$.
Then for any function field in one variable $F/k$, the pythagoras number of $F$ has to be finite (see (\ref{R:p-fufi-finite}) below).
A special case where this applies, is the situation where the ground field $k$ is hereditarily pythagorean.
However, even in this case, it is an open problem whether there is 
 a common  upper bound on the pythagoras numbers of all function fields in one variable $F/k$.

In characteristic different from $2$,   Milnor's Exact Sequence (cf. \cite[Chap. IX, Sect.~3]{Lam05}) relates the quadratic form theory of the rational function field $k(X)$ to
the quadratic form theory of all the finite extensions of $k$.
For instance, this leads to Becker's result (see (\ref{T:Becker}) below) that $k$ is hereditarily pythagorean
if and only if the pythagoras number of $k(X)$ is $2$.

%%%%%

The results contained in this article are mostly concerned with function fields of hyperelliptic curves, that is, with quadratic extensions of a rational function field.
The techniques we use are based on the relation between quadratic forms in the two fields of a quadratic field extension.

In \cite{TVGY} it is shown that, if $k=\rr(\!(t)\!)$ and if $F$ is the function field of a hyperelliptic curve $C$ with good reduction, then $p(F)=2$.
The proof is based on the calculation of the Brauer group of the curve $C$.
This work inspired us to look at the problem from a purely quadratic form theoretic point of view.
Appart from giving a different proof for the main result in \cite{TVGY}, we obtain several results for function fields
of hyperelliptic curves over a hereditarily pythagorean field in general.
As a consequence of these results, given a function field $F$ of a hyperelliptic curve over a field $k$ `like $\rr(\!(t)\!)$' --namely carrying a henselian valuation $k\lra \zz\cup\{\infty\}$ with hereditarily euclidean residue field--
we are able to decide now in many cases whether $p(F)$ is either $2$ or larger than $2$.
Moreover, in most of those cases we are also able to prove that the $u$-invariant of such a field $F$ is $4$, 
by extending a method which before was applicable only in the cases with $p(F)=2$, as sketched in \cite[p.~307]{TVGY}. 

\medskip
All fields considered in this article are assumed to be of characteristic different from $2$.
In fact, most results on function fields $F/k$ obtained here are interesting only in the case where at least the ground field $k$ is real, in which case all fields involved are of characteristic zero.
All quadratic forms occurring in this article are tacitly understood to be regular.

\smallskip
We shall assume that the reader is familiar with the basic theory of quadratic forms over fields.
References for this theory are \cite{Lam05} and \cite{Scharlau}.
All information needed on function fields in one variable is largely covered by \cite{Stichtenoth}, for example.



%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Preliminaries} %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%

Let $K$ be a field of characteristic different from $2$.
The set of nonzero sums of squares in $K$ is denoted by $\sums{K}$.
Given a field $K$, we denote by $WK$ the Witt ring of $K$, by $IK$ its fundamental ideal, and 
further put $I^n K=(IK)^n$ for $n\in\nat$.
The torsion ideal in $WK$ is denoted by $W_tK$.
Recall that a quadratic form $\varphi$ over $K$ is \emph{torsion}, if it represents a torsion element in the Witt ring $WK$, which by Pfister's Local-Global Principle (cf. \cite[Chap. VIII, Sect. 3]{Lam05}) is the case if and only if $\varphi$ has trivial signature
with respect to every ordering of $K$. 
If $K$ is nonreal then every quadratic form over $K$ is torsion.
Given a (regular) quadratic form $\varphi$ over $K$, we denote by $\dset{K}{\varphi}$ the set of nonzero elements of $K$ represented by $\varphi$. We say that a quadratic form $\varphi$ over $K$ is \emph{universal} if $\dset{K}{\varphi}=\mg{K}$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection*{Field invariants in quadratic form theory} %%%

For $x\in K$, we denote by $\ell_K(x)$ the least number $r\in\nat$ such that $x$ can be written as a sum of $r$
nonzero squares in $K$ if such $r$ exists, otherwise we put $\ell_K(x)=\infty$.
With $r\in\nat$ we write $\dset{K}{r}=\{x\in \mg{K}\mid\ell_K(x)\leq r\}$.
Hence $\sums{K}=\bigcup_{r\in\nat}\dset{K}{r}=\{x\in\mg{K}\mid\ell_K(x)<\infty\}$.
The number
$$p(K)\,=\, \sup\,\{\ell_K(x)\mid x\in\mbox{$\sums{K}$}\}\,\in\ \nat\cup\{\infty\}$$
is called the \emph{pythagoras number of $K$}.
If $p(K)=1$, then $K$ is said to be \emph{pythagorean}.
The value
$$s(K)=\ell_K(-1)$$
is called the \emph{level of $K$}.
Note that $\ell_K(0)=s(K)+1\geq p(K)$, with the usual conventions for calculating with $\infty$.
By the Artin-Schreier Criterion \cite[Chap. VIII, (1.11)]{Lam05}, $s(K)=\infty$ holds if and only if $K$ admits a field ordering; 
if this is the case, the field $K$ is said to be \emph{real}, otherwise \emph{nonreal}.
A famous result due to Pfister says that the level of a nonreal field is always a power of $2$ and that any $2$-power is the level of some field (cf. \cite[Chap.~XI, (2.2) and (2.6)]{Lam05}).
If $K$ is a nonreal field, then $s(K)\leq p(K) \leq s(K)+1$, by \cite[Chap. XI, (5.6)]{Lam05}, so in particular $p(K)\in\{2^n, 2^n+1\mid n\in\nat\}$.
In contrast to this, for the real case, Hoffmann showed in \cite{Hoffmann99b} that any positive integer is the pythagoras number of some uniquely ordered field.

\smallskip
The \emph{$u$-invariant} of $K$ is defined as
$$u(K)\,\,=\,\,\sup\,\{\dim(\varphi)\mid \mbox{$\varphi$ anisotropic torsion form over $K$}\}\,\,\in\ \nat\cup\{\infty\}.$$
This definition of the $u$-invariant was introduced by Elman and Lam in \cite{EL73}.
Whenever $u(K)$ is finite, it equals the least integer $n$ such that every
torsion form over $K$ of dimension strictly larger than $n$ is isotropic.
Furthermore, by   \cite[Chap. XIII, (6.28)]{Lam05} $p(K)\leq u(K)$ holds for any field $K$ except if $K$ is real pythagorean, in which case $p(K)=1$ and $u(K)=0$.

Both, the pythagoras number and the $u$-invariant of a given field are in general difficult to determine. For many interesting fields it is not even known whether these invariants are finite.
For an account on known results about these field invariants we refer to the corresponding chapters of \cite{Pfister}.

\medskip
The following is a variation of \cite[(3.5)]{Becher06}. 
It will turn out to be useful especially for showing that certain fields have $u$-invariant equal to $4$.


\begin{thm}\label{T:u-inv}
Assume that $I^3K$ is torsion free. Let $d\in\sums{K}$ be such that $|\sums{K}/\dbin{K}{d}|\leq 2$. Then $u(K)\leq u(K(\sqrt{-d}))$.
\end{thm}
\begin{proof}
Let $L=K(\sqrt{-d})$.
For arbitrary $a,b\in\sums{K}$, we claim that the quadratic form $\varphi=\la 1,d,-a,-b\ra$ over $K$ is universal.
If $\varphi$ is isotropic, this is trivial. Suppose that $\varphi$ is anisotropic.
Then $$\emptyset=\dbin{K}{d}\cap\dset{K}{\la a,b\ra}=\dbin{K}{d}\cap a\dbin{K}{ab}\,.$$
Since $\dbin{K}{ab}\subseteq \sums{K}$ and $|\sums{K}/\dbin{K}{d}|\leq 2$, it follows that 
$a\notin\dbin{K}{d}$ and $\dbin{K}{ab}\subseteq \dbin{K}{d}$.
This yields the inclusion $\dset{K}{\la 1,ab,-a,-b\ra}\subseteq \dset{K}{\varphi}$.
But $\la 1,ab,-a,-b\ra$ is a torsion $2$-fold \hbox{Pfister} form over $K$, thus universal by the assumption that $I^3K$ is torsion free.
Then $\varphi$ is universal, too.

Let now $\alpha$ be an arbitrary anisotropic torsion form over $K$ of dimension $\dim(\alpha)>4$.
We claim that $\alpha$ remains anisotropic over $L$.
Suppose on the contrary that $\alpha_L$ is isotropic.
Then by \cite[Chap.~VII, (3.1)]{Lam05}, $\alpha$ contains up to scaling  the norm form $\la 1,d\ra$ of the quadratic extension $L/K$.
Without loss of generality, we may thus assume that $\alpha=\la 1,d\ra\perp \alpha'$.
If $K$ is nonreal, then the above claim yields that $\alpha$ is isotropic over $K$, in contradiction to the choice of $\alpha$.
Assume now that $K$ is real.
Since $I^3K$ is torsion free, using \cite[(3.5) and (4.2)]{Becher-mwif} we can write $\alpha'=\beta\perp\gamma$ over $K$ where $\gamma$ is a torsion form and
$\beta$ is a form such that $m\times\beta$ is anisotropic for any $m\in \nat$.
Since $\alpha= \la 1,d\ra\perp \beta\perp\gamma$ and $\gamma$ are torsion forms over $K$, 
the same holds for $\la 1,d\ra\perp\beta$.
Since $d\in\sums{K}$ and by the property of $\beta$, 
it follows that $\dim(\beta)=2$ and $\beta=\la -a,-b\ra$ for certain $a,b\in\sums{K}$.
Then $\alpha=\la 1,d,-a,-b\ra\perp\gamma$, so the above claim  yields a contradiction to the assumptions that
$\alpha$ anisotropic and $\dim(\alpha)>4$.

This argument shows that $u(L)\geq u(K)$ whenever $u(K)> 4$.
It remains to consider the cases where $u(L)<4$.
Recall that $u(L)\neq 3$.
Assume now that $u(L)\leq 2$. Then $I^2 L=0$, which by \cite[Chap.~XI, (4.1) and (4.7)]{Lam05} implies that $I^2K$ is torsion free and thus $u(K)\leq 2$.
Finally, if $u(L)=1$, then $K$ is pythagorean, whence $u(K)\leq 1$.
\end{proof}

We shall use the notation $K(i)=K(\sqrt{-1})$.

\begin{cor}\label{C:uinv}
If\ $|\sums{K}/\dset{K}{2}|\leq 2$ and $u(K(i))\!<\!8$, then $u(K)\!\leq u(K(i))$.
\end{cor}

\begin{proof}
If $u(K(i))<8$, then $I^3 K(i)=0$ and thus
$I^3 K$ is torsion free, by \cite[Chap.~XI, (4.4) and (4.7)]{Lam05}.
Therefore the statement follows from (\ref{T:u-inv}).
\end{proof}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection*{Values of Pfister forms over quadratic extensions} %%%

Given elements $a_1,\dots, a_n\in\mg{K}$ we denote by $\lla a_1,\dots,a_n\rra$ the $n$-fold Pfister form $\la 1,-a_1\ra\otimes\dots\otimes\la 1,-a_n\ra$ over $K$.
Given an $n$-fold Pfister form $\pi$ over $K$, we write $\pi'$ for its pure part and $\pi^{(a)}=\la a\ra\perp\pi'$.
We refer to the $0$-fold Pfister form $\la 1\ra$ as the \emph{trivial Pfister form}.

\begin{thm}\label{T:Pfister-quadrext}
Let $a\in K$ and $L=K(\sqrt{a})$ and let $\pi$ be a nontrivial Pfister form defined over $K$.
Then $$\mg{K}\cap \dset{L}{\pi}=\dset{K}{\pi}\cdot\dset{K}{\pi^{(a)}}\,.$$
\end{thm}
\begin{proof}
Obvously, $\mg{K}\cap \dset{L}{\pi}\supseteq\dset{K}{\pi}\cdot\dset{K}{\pi^{(a)}}$. To show the converse inclusion, let  $b\in\mg{K}\cap \dset{L}{\pi}$.
Then the Pfister form $\rho=\pi\otimes \la 1,-b\ra$ is hyperbolic over $L$.
Therefore, the form $\rho$ considered over $K$ contains a binary subform $\la c,-ac\ra$ with $c\in\mg{K}$. 
(In fact, if $\rho$ is isotropic over $K$, then it is hyperbolic
and thus contains $\la 1,-a,-1,a\ra$.)
Then $c\in\dset{K}{\rho}$, whence
$c\rho\cong \rho$ and thus $\la 1,-a\ra\subseteq c\rho =\rho$.
Witt Cancellation now shows that $\rho'$ represents $-a$, i.e. $\rho^{(a)}$ is
isotropic over $K$.
Since $\rho^{(a)}=\pi^{(a)}\perp -b\pi$, the fact that this form is isotropic
 just means that $b\in \dset{K}{\pi}\cdot\dset{K}{\pi^{(a)}}$.
\end{proof}

At least for $1$-fold Pfister forms (\ref{T:Pfister-quadrext}) is common knowledge.

\begin{cor}\label{C:bin-quadrext}
Let $a,b\in K$ and $L=K(\sqrt{a})$.
Then $$\mg{K}\cap \dbin{L}{b}\,=\,\dbin{K}{b}\cdot \dbin{K}{ab}\,.$$
\end{cor}
\begin{proof}
By (\ref{T:Pfister-quadrext}), we have $\mg{K}\cap \dbin{L}{b}=\dbin{K}{b}\cdot \dset{K}{\la a,b\ra}$.
As $\dset{K}{\la a,b\ra}=b\dbin{K}{ab}$ and $b\in \dbin{K}{b}$, the statement follows.
\end{proof}

For later use, we explicitly state the following special case.

\begin{cor}\label{C:so2s-quadext}
Let $a\in K$ and $L=K(\sqrt{a})$. Then 
$$\mg{K}\cap \dset{L}{2}\,=\,\dset{K}{2}\cdot \dbin{K}{a}\,.$$
\end{cor}
\begin{proof}
This is what (\ref{C:bin-quadrext}) yields for $b=1$.
\end{proof}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection*{Ramification of torsion forms} %%%

Given a discrete rank-one valuation $w:K\lra \zz\cup\{\infty\}$ with residue field $\kappa$ of characteristic different from $2$
and an element  $u\in K$ of valuation $w(u)=1$,
one defines the first and second residue homomorphisms \hbox{$\partial_1,\partial_2:WK\lra W\kappa$} with respect to $w$ and $u$ (see \cite[p.~147]{Lam05}).
The quadratic forms over $\kappa$, determined up to Witt equivalence, which represent the images under $\partial_1$ and $\partial_2$
of a given form over $K$, are called its \emph{first} and \emph{second residue forms}, respectively. 
A quadratic form over $K$ is then said to be \emph{unramified in $w$} if its Witt equivalence class lies in the kernel of $\partial_2$, otherwise \emph{ramified in $w$}.
Actually, the kernel of $\partial_2$ and therefore the notion of being ramified in $w$ depend on the valuation $w$, but not on the choice of the uniformiser $u$. 

We are essentially concerned with the $k$-valuations of the rational function field $E=k(X)$ over a real field $k$.
Apart from the degree valuation, any such valuation is associated to a (unique) monic irreducible polynomial $f\in k[X]$, which 
then also is our canonical choice for the uniformising element for this valuation.
We say that a quadratic form over $k(X)$ is \emph{unramified over $k$}, if it is unramified in any $k$-valuation of $k(X)$.


\begin{lem}\label{L:real-unr}
Let $k$ be a real field and $\varphi$ a torsion form over $k(X)$.
Let $w$ be a $k$-valuation on $k(X)$ with real residue field $\kappa_w$.
If $n\in\nat$ is such that $p(\kappa_w)\leq 2^n$, then $2^n\times \varphi$ is unramified at $w$.
\end{lem}

\begin{proof}
Since $p(\kappa_w)\leq 2^n$, the torsion part of $W \kappa_w$ is annihilated by $2^n$ (cf. \cite[Chap.~XI, (5.6)]{Lam05}).
Therefore the second residue homomorphism 
$\partial_2\,: Wk(X)\longrightarrow W\kappa_w$ with respect to $w$
and an arbitrary uniformising element $u$ is trivial on $2^n\cdot W_t\, k(X)$.
\end{proof}

\begin{lem}\label{L:torsion}
Let $k$ be a real field.
Assume that $n\in\nat$ is such that
\hbox{$p(K)\leq 2^n$} holds for any finite real extension $K/k$.
Let $\varphi$ be a torsion form over $k(X)$.
Then the form $2^n\times\varphi$ over $k(X)$ is either hyperbolic, or it is ramified at some $k$-valuation associated to a nonreal monic irreducible polynomial in $k[X]$.
\end{lem}

\begin{proof}
Assume that $2^n\times\varphi$ is unramified at every $k$-valuation of $E=k(X)$ which is associated to a nonreal monic irreducible polynomial.
Observe that the residue field of the degree valuation is the real field $k$.
Using the previous lemma, it then follows that $2^n\times \varphi$ is unramified over $k$.
So, by Milnor's Exact Sequence (cf. \cite[p.~306]{Lam05}), there exists a form $\rho$ over $k$ such that
$2^n\times\varphi=\rho_E$.

We claim that $\rho$ is of the shape $\rho=2^n\times\psi$ for some form $\psi$ over $k$.
As for $n=0$ there is nothing to show, we may assume $n\geq 1$.
Let $\pi=2^n\times\la 1\ra$.
Since $\rho_E=2^n\times\varphi$, the form $\rho$ becomes hyperbolic over $E(\pi)$, the function field of $\pi$ over $E$.
On the other hand, $E(\pi)$ is a rational function field in one variable over $k(\pi)$,
and thus the scalar extension $W k(\pi)\longrightarrow W E(\pi)$ is injective.
Therefore $\rho$ becomes hyperbolic already over $k(\pi)$.
As the kernel of the scalar extension map $Wk\longrightarrow Wk(\pi)$ is the ideal generated by $\pi$
(cf. \cite[Chap.~4, (5.4)]{Scharlau}), it follows that, over $k$, we have $\rho=\pi\otimes\psi=2^n\times\psi$ for some form $\psi$, as we claimed.

Now, since $\rho_E=2^n\times \varphi$ is a torsion form over $E$,
it follows that $\rho$ and $\psi$ are torsion forms over $k$.
However, the hypothesis in particular contains that $p(k)\leq 2^n$,
so that $W_t k$ is $2^n$-torsion.
Therefore $\rho=2^n\times\psi$ is hyperbolic over $k$.
Thus $2^n\times\varphi=\rho_E$ is also hyperbolic.
\end{proof}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Pythagoras numbers of function fields} %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

By a \emph{function field in one variable over $k$} we mean a finitely generated field extension $F/k$ of transcendence degree one where $k$ is relatively algebraically closed in $F$.


\begin{lem}\label{L:fufi-pgeq2}
If $F/k$ is a finitely generated, non-algebraic extension, then $p(F)\geq 2$.
\end{lem}
\begin{proof}
Let $n$ be the transcendence degree of $F/k$. Then $n\geq 1$ and $F$ is $k$-isomorphic to a finite extension of $E=k(X_1,\dots,X_n)$.
Now, $E$ is not pythagorean, because $1+X_1^2$ is not a square in $E$.
The Diller-Dress Theorem \cite[Chap. VIII, (5.7)]{Lam05} then asserts that $F$ is not pythagorean either.
\end{proof}

\begin{prop}\label{P:p-fufi-bounds}
Let $f\in k[X,Y]$ be an irreducible polynomial which is not constant in $Y$ and let $n=\deg_Y(f)$.
Let $F$ be the quotient field of $k[X,Y]/(f)$.
Then $2\leq p(F)\leq n\cdot p(k(X))$.
\end{prop}
\begin{proof}
The first inequality is valid by (\ref{L:fufi-pgeq2}), and the second follows from the fact that $p(L)\leq [L:K]\cdot p(K)$ holds for any finite field extension $L/K$ (see \cite[p. 103]{Pfister}).
\end{proof}

For certain function fields in one variable $F/k$ one can bound $p(F)$ from below by $p(k(X))$.

\begin{prop}\label{P:fufi-odd-div}
Let $F/k$ be a function field in one variable.
If $F$ has a divisor of odd degree, then $p(F)\geq p(k(X))$ and $u(F)\geq u(k(X))$.
\end{prop}
\begin{proof}
If there exists a divisor of odd degree over $F$, then there is a $k$-valuation $v$ on $F$ such that, with $F_v$ denoting the residue field, the residue degree $[F_v:k]$ is odd.
Let $g$ denote the genus of $F$.
We choose an odd number $m$ with $(m-1)\cdot [F_v:k]\geq 2g$.
We compare the divisors $D=m\cdot v$ and $D'=(m-1)\cdot v$.
For $f\in F$ let $(f)$ denote the principal divisor over $F$ defined by $f$.
For any divisor $C$ on $F$ let $\mc{L}(C)=\{f\in F\mid (f)\geq -(D)\}\cup\{0\}$.
Since both divisors $D$ and $D'$ are of degree larger than $2g-2$,
the Riemann-Roch theorem yields that $\dim(\mc{L}(D))=\deg(D)-g+1$ and 
$\dim(\mc{L}(D'))=\deg(D')-g+1$, showing that $\mc{L}(D')\subsetneq \mc{L}(D)$.
We choose an element $z\in \mc{L}(D)\setminus\mc{L}(D')$.
Then $(z)\geq -m\cdot v$ while $(z)\not\geq -(m-1)\cdot v$, which implies that $v$ is the only pole of $z$, and that this pole is of order $-v(z)=m$.
By \cite[Chap. I, (4.11)]{Stichtenoth}, we have $[F:k(z)]=[F_v:k]\cdot m$ which is an odd number.
Therefore, Springer's Theorem \cite[Chap.~VII, (2.7)]{Lam05} implies that $p(F)\geq p(k(z))$ as well as $u(F)\geq u(k(z))$.
Obviously, $k(z)$ is $k$-isomorphic to $k(X)$.
\end{proof}

\begin{rem}
In quadratic form theory, there are several invariants $i$ of fields $K$ which are of the type
$$i(K)\,=\, \sup\{\dim(\varphi)\mid \varphi \mbox{ anisotropic form over $K$ satisfying $\mc{P}$}\} \,\in\, \nat\cup\{\infty\}$$
where $\mc{P}$ is a certain property of quadratic forms which is conserved under extending the fields of scalars  (cf. \cite[Sect. 3]{Hoffmann99}).
The $u$-invariant and the pythagoras number are examples of such invariants, corresponding to the property of being a torsion form and the property of having a diagonalisation $\la 1,\dots,1,-s\ra$ with $s$ a sum of squares, respectively.
Since the argument in the proof of (\ref{P:fufi-odd-div}) is based on Springer's Theorem for quadratic forms and odd degree extensions, in this situation the analogous inequality can be obtained in the same way for any field invariant of this type.
\end{rem}

The last two statements relate the pythagoras number of a general function field in one variable $F/k$ to that of the rational function field $k(X)$.
The next theorem relates the pythagoras number of $k(X)$ to sums of squares in finite extensions of $k$.
It extends Pfister's result \cite[Satz~2]{Pfister67}.

\medskip
By a \emph{$2$-extension} we mean an arbitrary separable algebraic field extension $F/E$ such that the Galois group of the Galois closure of this extension is a $2$-group. A finite $2$-extension $F/E$ is characterised by the existence of a tower of fields $E=F_0\subseteq F_1\subseteq \dots\subseteq F_r=F$ in which $F_i/F_{i-1}$ is a quadratic extension for $i=1,\dots,r$.


\begin{thm}\label{T:Pfister-prf}
Let $k$ be a real field and $n\in\nat$.
The following are equivalent:
\begin{enumerate}\renewcommand{\labelenumi}{$(\roman{enumi})$\,}
\item $p(K)<2^{n+1}$ for any finite real extension $K/k$.
\item $s(K)\leq 2^n$ for any finite nonreal extension $K/k$.
\item $p(k(X))\leq 2^{n+1}$.
\end{enumerate}
\end{thm}

\begin{proof}
See  \cite[Satz 2]{Pfister67} and \cite[p.~397]{Lam05} for the equivalence $(ii\Leftrightarrow iii)$. 

\smallskip
\follows{ii}{i} Assume $K/k$ is a finite real extension with $p(K)\geq 2^{n+1}$. 
So there is some element $a\in\sums{K}$ with $\ell_K(a)=2^{n+1}$.
Then $K(\sqrt{-a})$ is a finite nonreal extension of $k$ with $s(K(\sqrt{-a}))=2^{n+1}$.

\smallskip
\follows{i}{ii}
Assume that $K/k$ is a finite nonreal extension with $s(K)>2^{n}$.
Since the level of a nonreal field is a power of $2$, this means that $s(K)\geq 2^{n+1}$.
Let $M$ be the normal closure of $K/k$. 
Let $S$ be a $2$-Sylow subgroup of ${\rm Gal}(M/k)$ which contains a $2$-Sylow subgroup $S'$ of ${\rm Gal}(M/K)$.
Let $L=M^S$, the fixed field of $S$ in $M$. 
Then $L/k$ is of odd degree and therefore $L$ is a real field, too.
Since $KL$ is fixed by $S'$, the extension $KL/K$ has odd degree, and therefore $s(KL)=s(K)\geq 2^{n+1}$.
Moreover, $M/L$ is a $2$-extension.
As $KL\subseteq M$, it follows that $KL/L$ is a finite $2$-extension, so
there is a finite tower of fields $L=K_0\subseteq K_1\subseteq \dots\subseteq K_r=KL$ where $K_i/K_{i-1}$ is a quadratic extension for $i=1,\dots,r$.
Since $L$ is real while $KL$ is nonreal, we can choose $m\in\{1,\dots,r\}$ such that $K_{m-1}$ is real and $K_{m}$ nonreal.
We write $K_{m}=K_{m-1}(\sqrt{-a})$ with $a\in\sums{K_{m-1}}$.
Since $s(K_{m})\geq s(KL)\geq 2^{n+1}$, we conclude that $\ell_{K_{m-1}}(a)\geq 2^{n+1}$.
Therefore $K_{m-1}$ is a finite real extension of $k$ with $p(K_{m-1})\geq 2^{n+1}$.
\end{proof}

\begin{rem}\label{R:p-fufi-finite}
If $k$ is a field such that
there is a common finite upper bound on the pythagoras numbers of all finite extensions of $k$, then $p(F)$ is finite for every function field in one variable $F/k$. In fact, if $k$ is nonreal this is trivial, and in the real case this follows from (\ref{T:Pfister-prf}) and (\ref{P:p-fufi-bounds}).
This fact is probably known, but we could not find a reference for it.
\end{rem}

Given $f\in k[X]$ over a field $k$, we say that a root $\alpha$ of $f$ 
is \emph{real} or \emph{nonreal}, if the field $k(\alpha)$ has the corresponding property.
If $f$ is irreducible, then we  may also  say that $f$ is \emph{real} or \emph{nonreal}, respectively, meaning that the root field $k[X]/f(X)$ is real or nonreal.
It follows from \cite[Chap.~X, (2.13)]{Lam05} that a monic irreducible polynomial $f\in k[X]$ is nonreal if and only $f$
is a sum of squares in $k(X)$.

\begin{prop}\label{P:tt-pos-hec-p}
Let $k$ be a field and $n\in\nat$ such that $s(K)\leq 2^n$ holds for any finite nonreal extension of $K/k$.
Let $F$ be the function field of $Y^2=f(X)$ over $k$ where $f\in k[X]$ is a monic polynomial with only nonreal roots.
Then $p(F)\leq 2^{n+1}$. 
\end{prop}
\begin{proof}
We may assume that $k$ is real.
By (\ref{T:Pfister-prf}) we have $p(k(X))\leq 2^{n+1}$.
It follows from the assumptions on the polynomial $f$ that it is a sum of squares in $k(X)$.
Therefore $F=k(X)(\sqrt{f})$ is a totally positive quadratic extension of $k(X)$.
Then $p(k(X))\leq 2^{n+1}$ implies that $p(F)\leq 2^{n+1}$ (cf. \cite[(2.18)]{EL76}).
\end{proof}



Using (\ref{T:Pfister-prf}) we obtain the following technical lemma, which will turn out to be useful in the study of quadratic extensions of a rational function field.

\begin{lem}\label{L:real-pol-rep}
Let $k$ be a real field and let $n\in\nat$ be such that $p(K)< 2^{n+1}$ for any finite real extension $K/k$.
Let $F=k(X)(\sqrt{f})$ with $f\in k[X]$.
Then $\sums{F}=\dset{F}{2^{n+1}}\cdot(\mg{k(X)}\cap\sums{F})$.
Moreover, any class in $\sums{F}/\dset{F}{2^{n+1}}$ is represented by
a polynomial $g\in k[X]$ with only real roots.
\end{lem}
\begin{proof}
Let $E=k(X)$. 
By the hypothesis and (\ref{T:Pfister-prf}), we have $p(E)\leq 2^{n+1}$.
Let $\xi\in \sums{F}$. 
Then $N_{F/E}(\xi)\in\sums{E}=\dset{E}{2^{n+1}}$.
By the Norm Principle (\cite[(2.13)]{EL76}), we have 
$\xi \in\mg{E}\cdot\dset{F}{2^{n+1}}$, so there is some $h\in\mg{E}$
 such that $\xi\cdot\dset{F}{2^{n+1}}=h\cdot\dset{F}{2^{n+1}}$.
Obviously, we can choose such  $h$ in $k[X]$, and we additionally obtain
that $h\in \sums{F}$.
We now factorise $h=g\cdot h'$ where $g,h'\in k[X]$ are such that $g$ has only real roots while $h'$ is monic and has only nonreal roots.
Then $h'\in\sums{E}=\dset{E}{2^{n+1}}$ and therefore
$\xi\cdot\dset{F}{2^{n+1}} = h\cdot\dset{F}{2^{n+1}}=g\cdot\dset{F}{2^{n+1}}$.\end{proof}

%%%%

\begin{prop}\label{P:tors}
Let $k$ be a real field.
Assume that $n\in\nat$ is such that $p(K)\leq 2^n$ for any finite real extension $K/k$. 
Let $F=k(X)(\sqrt{f})$ where $f\in k[X]$ is a nonzero square-free polynomial.
Let $g\in k[X]$ be a nonzero polynomial with only real roots,
Then $g\in\dset{k(X)}{2^n\times\la 1,f\ra}$ if and only if $g\in\sums{F}$ and $g(\alpha)\in \dset{k(\alpha)}{2^n}$ for every nonreal root $\alpha$ of $f$.
\end{prop}

\begin{proof}
Note that $\dset{k(X)}{2^n\times\la 1,f\ra}\subseteq \sums{F}$.
Hence, for both directions we may assume that $g\in\sums{F}$.
Consider the form $\varphi=\la 1,f,-g,-fg\ra$ over $E=k(X)$.
This is a torsion form, because $g\in\mg{E}\cap\sums{F}=\sum E^2+f\sum E^2$.
Now, $g\in\dset{E}{2^n\times\la 1,f\ra}$ if and only if $2^n\times\varphi$ is hyperbolic over $E$, and by (\ref{L:torsion}) this is equivalent to having that
$2^n\times \varphi$ is unramified at every $k$-valuation 
associated to a nonreal monic irreducible polynomial in $k[X]$.
Moreover, since $g$ has only real roots, 
the only nonreal monic irreducible polynomials in which
$2^{n}\times\varphi$ might possibly be ramified are the factors of~$f$.
So,  $g\in\dset{E}{2^n\times\la 1,f\ra}$ if and only if
$2^{n}\times\varphi$ is unramified at $p$ for every minimial polynomial $p$
of a nonreal root $\alpha$ of $f$.
Now given such $\alpha$ and $p$, by  definition the second residue homomorphism $\partial_2$ with respect to the
valuation given by $p$ maps the class of $2^{n}\times\varphi$ in $WE$ to the class of a form similar to $2^{n}\times \la 1, -g(\alpha)\ra$ in $W k(\alpha)$; this class is trivial if and only if 
 $g(\alpha)\in \dset{k(\alpha)}{2^n}$.
\end{proof}


\begin{thm}\label{T:2-quot-bound}
Let $k$ be a real field and $n\in\nat$ such that $p(K)\leq 2^n$ holds for any finite real extension $K/k$.
Let $F=k(X)(\sqrt{f})$ where $f\in k[X]$ is a nonzero square-free polynomial.
Let $K_1,\dots,K_r$ denote the root fields of the distinct nonreal irreducible factors of $f$.
Then $p(F)\leq 2^{n+2}$ and $$|\mbox{$\sums{F}$}/\dset{F}{2^{n+1}}|\quad \leq \quad \prod_{i=1}^r\, |\mg{K_i}/\dset{K_i}{2^n}|\,\,.$$
In particular, if $f$ has only real roots, then $p(F)\leq 2^{n+1}$.
\end{thm}
\begin{proof}
Let $f_1,\dots,f_r$ be the distinct nonreal monic irreducible factors of $f$ and $\alpha_1,\dots,\alpha_r$ corresponding roots,  so  that $K_i=k(\alpha_i)$ for $1\leq i\leq r$.
By (\ref{L:real-pol-rep}), any class of $\mbox{$\sums{F}$}/\dset{F}{2^{n+1}}$ is represented by a polynomial $g\in k[X]$ with only real roots.
By (\ref{P:tors}), for such $g$ we have $g\in\dset{k(X)}{2^n\times\la 1,f\ra}\subseteq \dset{F}{2^{n+1}}$ provided that $g(\alpha_i)\in \dset{K_i}{2^n}$ for $1\leq i\leq r$.
We thus can define an injective homomorphism $\sums{F}/\dset{F}{2^{n+1}}\lra \prod_{i=1}^{r} \mg{K_i}/\dset{K_i}{2^n}$ by sending the class of a polynomial $g$ as above to $(g(\alpha_1)\dset{K_1}{2^n},\dots,g(\alpha_r)\dset{K_r}{2^n})$.
This yields the bound on $|\mbox{$\sums{F}$}/\dset{F}{2^{n+1}}|$.
Moreover, if $f$ has only real roots, then we obtain that $\sums{F}=\dset{F}{2^{n+1}}$, i.e. $p(F)\leq 2^{n+1}$.
\end{proof}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Hereditarily pythagorean fields} %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A field $k$ is said to be hereditarily pythagorean, if $k$ is real and if any finite real extension of $k$ is pythagorean.
Such fields have been characterised by Becker in \cite{Becker} in various ways.
In \cite[Chap.~III, Theorem~1]{Becker} Becker showed that a real field $k$ is hereditarily pythagorean if and only if the absolute Galois group of $k(i)$ is abelian.
The following characterisations of hereditarily pythagorean fields are contained in \cite[Chap.~III, Theorems~1 and 4]{Becker}, and they can be retrieved from (\ref{T:Pfister-prf}).

\begin{thm}[Becker]\label{T:Becker}
For a real field $k$ the following are equivalent:
\begin{enumerate}\renewcommand{\labelenumi}{$(\roman{enumi})$\,}
\item $k$ is hereditarily pythagorean.
\item Every finite nonreal extension of $k$ contains $k(i)$.
\item $p(k(X))=2$.
\end{enumerate}
\end{thm}
\begin{proof}
This follows immediately from (\ref{T:Pfister-prf}). 
\end{proof}

\begin{cor}\label{C:p-fufi-hpyth}
Let $F$ be the function field of a hyperelliptic curve over a hereditarily pythagorean field.
Then $2\leq p(F)\leq 4$.
\end{cor}
\begin{proof}
By assumption, $F$ is $k$-isomorphic to a quadratic extension of $k(X)$, so the
statement follows from (\ref{P:p-fufi-bounds}) and (\ref{T:Becker}).
\end{proof}


\begin{cor}\label{C:p2-fufi-ex}
There exists a function field in one variable  $F/k$ with
a divisor of odd degree and with $p(F)=2$ if and only if either $k$ is hereditarily pythagorean or if $-1\in\sq{k}$.
\end{cor}
\begin{proof}
Suppose $F$ is a function field in one variable over $k$ with $p(F)=2$ and having a divisor of odd degree.
By (\ref{P:fufi-odd-div}) we have $2\leq p(k(X))\leq p(F)=2$, whence $p(k(X))=2$.
In the case where $k$ is real, the statement thus follows from (\ref{T:Becker}).
On the other hand, if $k$ is nonreal, then  $p(k(X))=2$ is equivalent with $-1\in\sq{k}$.
In fact, given any $a\in\mg{k}$, the element $a+X^2$ is not a sum of $2$ squares in $k(X)$ unless $-1\in\sq{k}$ or $a\in\sq{k}$, by the Second Representation Theorem \cite[Chap.~IX, (2.1)]{Lam05}.
\end{proof}

\begin{qu}
Assume that $-1\notin\sq{k}$ and that there exists a function field in one variable $F/k$ such that $p(F)=2$.
Does this imply that $k$ is hereditarily pythagorean?
\end{qu}
%%%


A field $K$ is called \emph{euclidean} if it is pythagorean and uniquely ordered, which is actually equivalent to saying that $\sq{K}\cup\{0\}$ is a field ordering of $K$.
If $K$ is real and every finite real extension of $K$ is euclidean, then $K$ is
said to be \emph{hereditarily euclidean}.

\begin{thm}[Elman-Wadsworth]\label{T:EW}
Let $F/k$ be any function field in one variable.
Then $u(F)=2$ if and only if $k$ is hereditarily euclidean or hereditarily quadratically closed. 
Otherwise $u(F)\geq 4$.
\end{thm}
\begin{proof}
Using (\ref{L:fufi-pgeq2}), we have $2\leq p(F)\leq u(F)$. 
Note that, on the one hand, $u(F)\leq 2$ is equivalent with $I^2F$ being torsion free, on the other hand,
$k$ is (hereditarily) euclidean or (hereditarily) quadratically closed if and only if $k(\sqrt{-1})$ is (hereditarily) quadratically closed. Hence, the claim follows from \cite[Theorem, p. 479]{EW87} and the fact that $u(F)\neq 3$ \cite[Chap. XI, (6.8)]{Lam05}.
\end{proof}

\begin{cor}\label{C:EW}
Let $k$ be hereditarily euclidean. Then $p(F)=u(F)=2$ for any function field in one variable $F/k$.
\end{cor}
\begin{proof}
This follows from the proof of (\ref{T:EW}).
\end{proof}

%%%
We now obtain a characterisation of hereditarily euclidean fields.
Note that the statement could also be obtained using Theorems~1~and~2 in \cite{TY}.

\begin{thm}\label{T:he-crit}
Let $F$ be the function field of the conic $X^2+Y^2+1=0$ over $k$.
Then $p(F)=2$ if and only if either $-1\in\sq{k}$ or if $k$ is hereditarily euclidean.
In any other case $p(F)=3$.
\end{thm}
\begin{proof}
By (\ref{L:fufi-pgeq2}) and since $s(F)\leq 2$, we have $2\leq p(F)\leq s(F)+1\leq 3$.
If $k$ is hereditarily euclidean, then (\ref{C:EW}) implies that $p(F)=2$.
If $s(k)\leq 2$, then $F$ is actually a rational function field in one variable over $k$, and therefore $p(F)=s(k)+1$,
and this corresponds to the claim.

Suppose now that $-1\notin\sq{k}$ and $k$ is not pythagorean.
Then we may choose an element $c\in k$ such that $1+c^2\notin \sq{k}$. 
Let $\zeta=c+\sqrt{-(1+X^2)}\in F$.
From the Second Representation Theorem \cite[Chap.~IX, (2.1)]{Lam05}, using that $\la 1,1\ra$ is anisotropic over $k$, we obtain that $N_{F/k(X)}(\zeta)=1+c^2+X^2$ is not a sum of $2$ squares in $k(X)$.
On the other hand, the norm of a sum of $2$ squares is also a sum of $2$ squares, by \cite[Chap. VII, (5.1)]{Lam05}.
Hence, $\zeta$ is not a sum of $2$ squares in $F$.

So far, we have established the statement in particular for all cases where $k$ is either nonreal or hereditarily euclidean.
Assume from now on that $k$ is real and not hereditarily euclidean.
By \cite[Chap.~III, Lemma~5]{Becker}, then either $k$ is itself not euclidean, or it is not hereditarily pythagorean. 

Suppose $k$ is not hereditarily pythagorean.
Then there exists an algebraic element $\alpha$ over ${k}$ such that $k(\alpha)$ is real and $1+\alpha^2$ is not a square in $k(\alpha)$.
Let $g\in k[X]$ be the minimal polynomial of $\alpha$ over $k$.
We claim that $g$ is not a sum of $2$ squares in $F$.
Suppose on the contrary, that $g\in\dset{F}{2}$. 
By (\ref{C:so2s-quadext}), then $g\in\dset{k(X)}{2}\cdot \dbin{k(X)}{-(1+X^2)}$.
This means that there exists a polynomial $h\in k[X]$ with only nonreal roots such that 
the $2$-fold Pfister form $\lla (1+X^2),gh\rra$ over $k(X)$ is hyperbolic.
In particular, $\lla (1+X^2),gh\rra$ is unramified with respect to the valuation associated to $g$.
Since $g$ has a real root $\alpha$, it is clear that $h$ is not divisible by $g$.
However, the second residue form of $\lla (1+X^2),gh\rra$ with respect to $g$ is the form $\la 1,-(1+\alpha^2)\ra$ over $k(\alpha)$, and this form is anisotropic because $1+\alpha^2\notin \sq{k(\alpha)}$.
This is a contradiction.

Suppose finally that $k$ is hereditarily pythagorean but not euclidean.
Then there exists $t\in\mg{k}$ such that $\pm t\notin\sq{k}=\sums{k}$.
So the $2$-fold Pfister form $\lla -1,t\rra$ is anisotropic and not isometric to $\lla -1,-1\rra$.
Now, since $\lla -1,-1\rra$ is the only anisotropic $2$-fold Pfister form over $k$ splitting over $F$,
it follows that $\lla -1,t\rra$ is anisotropic over $F$, whence $t\notin\dset{F}{2}$.
\end{proof}

The remainder of this section is focused on conditions on function fields of hyperelliptic curves $F/k$ which allow to conclude that $p(F)=2$.

\begin{prop}\label{P:real-pol-bin-rep}
Let $k$ be a hereditarily pythagorean field.
Let $f\in k[X]$ be a nonzero square-free polynomial and $F=k(X)(\sqrt{f})$.
Let $g\in k[X]$ be a nonzero polynomial with only real roots.
Then $g\in\dset{k(X)}{\la 1,f\ra}$ if and only if $g\in\sums{F}$ and $g(\alpha)\in \sq{k(\alpha)}$ for any nonreal root $\alpha$ of $f$.
\end{prop}
\begin{proof}
This is what (\ref{P:tors}) yields for $n=0$.
\end{proof}


\begin{cor}\label{C:p2-crit}
Let $k$ be a hereditarily pythagorean field.
Let $f\in k[X]$ be a nonzero square-free polynomial and $F=k(X)(\sqrt{f})$.
If $g(\alpha)\in\sq{k(\alpha)}$ holds for any nonreal root $\alpha$ of $f$ and any polynomial $g\in k[X]\cap\sums{F}$ with only real roots, then $p(F)=2$.
\end{cor}
\begin{proof}
Given any  polynomial $g\in k[X]\cap\sums{F}$ with only real roots, using (\ref{P:real-pol-bin-rep}) we obtain that $g\in\dset{k(X)}{\la 1,f\ra}\subseteq \dset{F}{2}$.
Therefore (\ref{L:real-pol-rep}) applied with $n=0$ yields that $\sums{F}=\dset{F}{2}$.
\end{proof}

The following is a generalisation of \cite[Theorem 3]{TY}, the case where $F$ is real and the function field of a conic over $k$.

\begin{cor}\label{C:her-pyth-p2}
Let $k$ be a hereditarily pythagorean field.
Let $F$ be the function field of the curve $Y^2=f(X)$ over $k$ where $f\in k[X]$. If $f$ has only real roots, or if $f$ is monic and has only nonreal roots, then $p(F)=2$.
\end{cor}
\begin{proof}
In the first case, this follows from (\ref{C:p2-crit}), in the second from (\ref{P:tt-pos-hec-p}).
\end{proof}

A field $K$ is said to be \emph{$\infty$-pythagorean} if ${K}^{2^n}+{K}^{2^n}={{K}}^{2^n}$ holds for any $n\in\nat$.
We say that $K$ is \emph{hereditarily $\infty$-pythagorean}, if $K$ is real and if any finite real extension of $K$ is $\infty$-pythagorean.
By \cite[Chap. III, Theorem 9]{Becker}, a field $K$ is hereditarily $\infty$-pythagorean as soon as ${{L}}^4+{{L}}^4={{L}}^4$ holds for any finite real extension $L/K$.
A herditarily pythagorean field does not need to be
$\infty$-pythagorean, as a simple example in \cite[p. 109]{Becker} shows.

\begin{lem}\label{L:her-inf-pyth}
Let $k$ be a hereditarily $\infty$-pythagorean field.
Let $g\in k[X]$ be a polynomial with only real roots
and such that $g\in \sums{k(X)}+X\sums{k(X)}$.
Let $a,b\in k$. Then $g(a^2\pm b^2i)\in k(i)^2$.
\end{lem}

\begin{proof}
Since $g$ is represented over $k(X)$ by a multiple of the form $\la 1,X\ra$, it follows from \cite[Chap.~1, (2.3)]{Pfister} that $g=h_1+Xh_2$ for certain polynomials $h_1,h_2\in k[X]$ which are sums of squares in $k[X]$.
We may assume that $g$ is square-free, so that $h_1$ and $h_2$ are
relatively prime.
If we show that $g(a^2+b^2i)$ is a square in $k(i)$, then the
same follows for its conjugate $g(a^2-b^2i)$.
The leading coefficient of $g$ is a sum of squares in $k$, hence a square.
It is therefore sufficient to show
 that $\wt{g}(a^2+b^2i)\in k(i)^2$ holds for any monic irreducible factor $\wt{g}$ of $g$.

Given such $\wt{g}$, we fix a root $\vartheta$ of $\wt{g}$ and observe that
the field $K=k(\vartheta)$ is real and thus $\infty$-pythagorean.
Note that
$\wt{g}(c)=N_{K(i)/k(i)}(c-\vartheta)$ for any $c\in k(i)$.
Since $0=g(\vartheta)=h_1(\vartheta)+\vartheta h_2(\vartheta)$ and both $h_1(\vartheta)$ and $h_2(\vartheta)$ are squares in $K$,
we have $-\vartheta\in {K}^2$.
Since $K$ is $\infty$-pythagorean, 
there exist $\gamma_0,\gamma_1\in K$ such that
$2\gamma_0^2=a^2-\vartheta$ and $\gamma_1^4=\gamma_0^4+\frac{1}{4}b^4$, and further $\beta_0\in K$
with $\beta_0^2=\gamma_0^2+\gamma_1^2$.
If $\beta_0=0$, then $K$ being real implies that $a=b=\vartheta=0$, whence $\wt{g}=X$ and $\wt{g}(a^2+b^2i)=0\in k(i)^2$.
Suppose now that $\beta_0\neq 0$ and put $\beta_1=(2\beta_0)^{-1}b^2\in K$. 
Then $\beta_0^4-\frac{1}{4}b^4=2\gamma_0^2\beta_0^2$ and thus
$$(\beta_0+i\beta_1)^2\,=\, (\beta_0^2-\beta_1^2)+2\beta_0\beta_1 i\,=\,2\gamma_0^2+b^2i=a^2+b^2i-\vartheta\,,$$
whence
$\wt{g}(a^2+b^2i)=N_{K(i)/k(i)}(a^2+b^2i-\vartheta)\in k(i)^2$.
\end{proof}

\begin{thm}\label{T:p2-her-inf-pyth}
Let $k$ be a hereditarily $\infty$-pythagorean field.
Let $f\in k[X]$ be a monic polynomial such that every root of $f$ different from zero lies in $k(i)\setminus k$ and
is of the form $\alpha_0^2\pm\alpha_1^2i$ with $\alpha_0\in k$ and $\alpha_1\in \mg{k}$.
Then the function field $F$ of the curve $Y^2=f(X)$ has pythagoras number $p(F)=2$.
\end{thm}
\begin{proof}
Let $E=k(X)$, so that $F=E(\sqrt{f})$.
Note that $f\in\sums{E}\cup X\sums{E}$.
Let $g\in k[X]\cap\sums{F}$ be a polynomial with only real roots.
Then we have $g\in\mg{E}\cap\sums{F}=\sums{E}+f\sums{E}\subseteq \sums{E}+X\sums{E}$.
For any nonzero root $\alpha$ of $f$, we have $k(\alpha)=k(i)$ and thus $g(\alpha)\in \sq{k(\alpha)}$, by (\ref{L:her-inf-pyth}).
In view of (\ref{C:p2-crit}), this shows that $p(F)=2$.
\end{proof}

\begin{ex}
Let $k$ be a hereditarily $\infty$-pythagorean field.
Then the function field of the curve $Y^2=X(X^2+1)$ over $k$ has pythagoras number $2$, by (\ref{T:p2-her-inf-pyth}).
\end{ex}

\begin{qu}
Let $k$ be a field with $-1\notin\sq{k}$ and such that the function field of $Y^2=X(X^2+1)$ has pythagoras number $2$. Then $k$ is hereditarily pythagorean, by $(\ref{C:p2-fufi-ex})$.
Is $k$ necessarily hereditarily $\infty$-pythagorean?
\end{qu}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Henselian valued fields} %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Let $\wt{k}$ denote the separable closure of $k$.
If $k$ is of characteristic zero, in particular if $k$ is real, then $\wt{k}$ is just the algebraic closure of $k$.
Given a valuation $v$ on $k$, we denote by $k_v$ the residue field, by $\oo_v$ or $\oo_{v,k}$ the corresponding valuation ring in $k$, and by $\Gamma_v$ or $\Gamma_{v,k}$ the value group of $v$ on $k$.

\medskip
The next three statements are inspired by a simple argument we learned from S.~Tikhonov, showing that  $tX$  is a sum of $3$ but not a sum of $2$ squares in the function field of the curve $Y^2=(tX-1)(X^2+1)$ over $\rr(\!(t)\!)$ (see also \cite[(3.11)]{TVGY}). 
D. Leep gave us the idea how to generalise this example.

\begin{prop}\label{P:even-val-sos}
Let $v$ be a valuation on $k$.
Let $E=k(X)$ and $F=E(\sqrt{f})$ with $f\in k[X]$ such that $v(f)=0$.
If $n\in\nat$ is such that $s(k_v)\geq 2^n$ and $\ell_{k_v(X)}(-\ovl{f})\geq 2^n$, then \hbox{$v(\mg{E}\cap \dset{F}{2^n})\subseteq 2\Gamma_v$}.
Moreover, if $k_v$ is real and $-\ovl{f}\notin \sums{k_v(X)}$, then $v(\mg{E}\cap \sums{F})\subseteq 2\Gamma_v$.
\end{prop}
\begin{proof}
Let $n\in\nat$ be such that $s(k_v)\geq 2^n$ and $\ell_{k_v(X)}(-\ovl{f})\geq 2^n$. 
So, the forms $2^n\times\la 1\ra$ and $(2^n-1)\times \la 1\ra\perp\la \ovl{f}\ra$ are anisotropic over $k_v$.
Therefore we have $v(\dset{E}{2^n})\subseteq 2\Gamma_v$ as well as $v(\dset{E}{\varphi})\subseteq 2\Gamma_v$ for the quadratic form
$\varphi=\la f\ra\perp (2^{n}-1)\times\la 1\ra$ over $k$.
Since $\mg{E}\cap\dset{F}{2^n}=\dset{E}{2^n}\cdot \dset{E}{\varphi}$ by (\ref{T:Pfister-quadrext}), it follows that
$v(\mg{E}\cap\dset{F}{2^n})\subseteq 2\Gamma_v$.
This proves the first part of the statement.
The second claim follows immediately from the first.
\end{proof}

\begin{cor}\label{C:p>2}
Let $v$ be a valuation on $k$.
Let $F=k(X)(\sqrt{f})$ where $f\in k[X]$ is such that $v(f)\in 2\Gamma_v$.
Let $c\in \mg{k}$ and $h\in k[X]$ be such that $f=c^2h$ and $v(h)=0$.
Let $n\in\nat$ be such that $s(k_v)\geq 2^n$ and $\ell_{k_v(X)}(-\ovl{h})\geq 2^n$.
Then either $v(\mg{k(X)}\cap\sums{F})\subseteq 2\Gamma_v$ or $p(F)>2^n$.
\end{cor}
\begin{proof}
By  the hypotheses and (\ref{P:even-val-sos}), we have $v(\mg{k(X)}\cap \dset{F}{2^n})\subseteq 2\Gamma_v$.
Thus, if $p(F)\leq 2^n$, i.e. $\sums{F}=\dset{F}{2^n}$, then $v(\mg{k(X)}\cap\sums{F})\subseteq 2\Gamma_v$.
\end{proof}


\begin{thm}\label{T:p>2}
Let $v$ be a valuation on $k$ with real residue field $k_v$.
Let $t,c\in \mg{k}$ with $0<v(t)\leq v(c)$ and $v(t)\notin 2\Gamma_v$.
Let $h(X)\in \mc{O}_v[X]$ be a monic polynomial with only nonreal roots and let $n\in\nat$ be such that $\ell_{k_v}(\ovl{h}(X))\geq 2^n$. 
Let $F$ be the function field of the curve $Y^2=(cX-1)h(X)$ over $k$.
Then $F$ is real and $p(F)>2^n$.
\end{thm}
\begin{proof}
Note that $h$ is a sum of squares in $k[X]$.
It is clear that $F$ is real.
Let $b=2t+t^2+cX$. Then $v(b)=v(t)\notin 2\Gamma_v$, whence
$b\notin\dset{F}{2^n}$ by (\ref{P:even-val-sos}).
However, $b=(1+t)^2+Y^2h^{-1}$ is a sum of squares in $F$.
Therefore $p(F)\geq \ell_F(b) > 2^n$.
\end{proof}


Assume now that the valuation $v$ on $k$ is henselian.
Then $v$ has a unique extension to $\wt{k}$, which we also denote by $v$;
the value group $\Gamma_{v,k}$ then is a subgroup of $\Gamma_{v,\wt{k}}$.
Note that, if $k_v$ is hereditarily pythagorean, then so is $k$.

Often we will assume $k_v$ real closed, or at least hereditarily euclidean.
The standard example for this situation is $k=\rr(\!(t)\!)$, the field of Laurent series with real coefficients, where the valuation $v: k\longrightarrow \zz\cup\{\infty\}$ is trivial on $\rr$ and takes $t$ to $1$;
in this case, we have $k_v=\rr$ and $\Gamma_{v,k}=\zz$.

Any valuation $v$ on $k$ can be extended to $k(X)$ in such way that one has $v(a_0+a_1X+\dots +a_nX^n) = \min\{a_0,\dots,a_n\}$
for arbitrary $a_0,\dots,a_n\in k$, $n\in\nat$.
This extension to $k(X)$, uniquely determined by this formula, is called the
\emph{Gauss extension}, and is again denoted by $v$.
It has value group $\Gamma_{v,k(X)}=\Gamma_{v,k}$ and residue field $k_v(X)$.
Obviously, this extension to $k(X)$ depends on the choice of the variable $X$, i.e. it is not stable under  $k$-automorphisms of $k(X)$.
In the case where $k=\rr(\!(t)\!)$, the valuation may even be extended to a valuation on the field $\rr(X)(\!(t)\!)$, which contains the field $k(X)=\rr(\!(t)\!)(X)$, and such that the valuation is trivial on the subfield $\rr(X)$, which  is also the residue field of $v$ on $\rr(X)(\!(t)\!)$.


\begin{lem}\label{L:gent-lemma}
Let $v$ be a henselian valuation on $k$.
Let $g\in k[X]$ and  $\alpha\in \tilde{k}$ with $v(\alpha)=0$.
If for every root $\vartheta\in \tilde{k}$ of $g$ with $v(\vartheta)=0$ one has $\ovl{\vartheta}\neq\ovl{\alpha}$ in $\wt{k}_v$, then $v(g(\alpha))=v(g(X))$.
\end{lem}
\begin{proof}
Let $\vartheta\in \tilde{k}$ be a root of $g$.
We claim that $v(X-\vartheta)=v(\alpha-\vartheta)$.
This claim obviously implies the statement.
Note that $v(X)=v(\alpha)=0$.
Therefore the claim is obvious if $v(\vartheta)\neq 0$.
Suppose now that $v(\vartheta)=0$. 
Then it is clear that $v(X-\vartheta)=0$ and $v(\alpha-\vartheta)\geq 0$.
Now $\ovl{\vartheta}\neq\ovl{\alpha}$ yields the equality 
$v(\alpha-\vartheta)=0=v(X-\vartheta)$.
\end{proof}


Let $v$ be a henselian valuation on $k$.
We say that $a\in\wt{k}$ \emph{has good reduction} (with respect to $v$ and $k$) if $v(a)=0$  and $[k_v(\ovl{a}):k_v]=[k(a):k]$.


\begin{thm}\label{T:nr-roots-p2}
Let $v$ be a henselian valuation on $k$ with hereditarily euclidean residue field $k_v$.
Let $E=k(X)$ and $F=E(\sqrt{f})$ where $f\in k[X]$ is a nonzero polynomial such that all nonreal roots of $f$ have good reduction with respect to~$v$.
Then $\mg{E}\cap \mbox{$\sums{F}$}\cap v^{-1}(2\Gamma_v)\,\,\subseteq\,\, \dset{F}{2}$ and
 $|\sums{F}/\dset{F}{2}|\,\leq\, |\Gamma_{v} / (2\Gamma_{v}\cup ({v(f)}+2\Gamma_v)) |$.
\end{thm}
\begin{proof}
Let $g\in\mg{E}\cap \mbox{$\sums{F}$}$ with $v(g)\in 2\Gamma_v$ be given.
Since $E$ is the quotient field of $k[X]$, in order to show that $g\in\dset{F}{2}$, we may assume that $g$ is a polynomial in $X$ with no multiple roots.
Since for the nonreal part $g_\ast$ of $g$ we have $g_\ast\in\dset{E}{2}\cap v^{-1}(2\Gamma_v)$, we may assume $g_\ast=1$, that is, $g$ has only real factors.
Let $\alpha$ be a nonreal root of $f$.
Since, by the hypothesis, $\alpha$ has good reduction with respect to $v$, we have $v(\alpha)=0$, $k(\alpha)\supseteq k(i)$, and $k_v(\ovl{\alpha})\supseteq k_v(i)$.
On the other hand, for any root $\vartheta$ of $g$ with $v(\vartheta)=0$, the residue class $\ovl{\vartheta}$ generates a real extension of $k_v$, so that in particular $\ovl{\vartheta}\neq\ovl{\alpha}$.
Therefore (\ref{L:gent-lemma}) yields $v(g(\alpha))=v(g)$.
Note that $k_v(\alpha)$ is quadratically closed, because $k_v$ is hereditarily euclidean.
Therefore $\sq{k(\alpha)}=k(\alpha)\cap v^{-1}(2\Gamma_{v,k(\alpha)})$.
Since $v(g)\in 2\Gamma_v$, it follows that $g(\alpha)$ is a square in $k(\alpha)$.
Since this holds for any nonreal root $\alpha$ of $f$, 
using (\ref{P:real-pol-bin-rep}) we conclude that $g\in \dbin{E}{f}\subseteq\dset{F}{2}$. 
This shows the inclusion which is claimed in the statement.
Since $f\in\sq{F}$ we even obtain that $\mg{E}\cap \mbox{$\sums{F}$}\cap v^{-1}(2\Gamma_v\cup (v(f)+2\Gamma_v))\,\subseteq\, \dset{F}{2}$.
Observe that the quotient $\sums{F}\cap\mg{E}/\sums{F}\cap\mg{E}\cap v^{-1}(2\Gamma_v\cup (v(f)+2\Gamma_v))$
injects into $\Gamma_v/(2\Gamma_v\cup (v(f)+2\Gamma_v))$.
By the last inclusion, the same quotient surjects onto $\sums{F}\cap\mg{E}/\dset{F}{2}\cap\mg{E}$.
Moreover, $\dset{F}{2}\cap\mg{E}=\dset{F}{2}\cap \sums{F}\cap \mg{E}$, thus $(\sums{F}\cap\mg{E})/(\dset{F}{2}\cap\mg{E})$
is isomorphic to $(\sums{F}\cap\mg{E})\dset{F}{2}/\dset{F}{2}$.
Now recall that $\sums{F}=\dset{F}{2}(\mg{E}\cap\sums{F})$, by (\ref{L:real-pol-rep}) applied with $n=0$.
This yields the claimed estimate.
\end{proof}

\begin{cor}\label{C:p2-even-val-pol}
Assume that $k$ carries a henselian valuation $v$ with hereditarily euclidean residue field $k_v$.
Let $F=k(X)(\sqrt{f})$ where $f\in k[X]$ is a polynomial with $v(f)\in 2\Gamma_v$ and such that all nonreal roots of $f$ are of good reduction with respect to~$v$.
We may write $f=c^2 h$ with $c\in \mg{k}$ and $h\in k[X]$ such that $v(h)=0$.
If $-\ovl{h}$ is not a sum of squares in $k_v[X]$, then $p(F)=2$.
\end{cor}
\begin{proof}
Replacing $f$ by $h$, which does not change the function field $F$, we may assume that $v(f)=0$ and that $-\ovl{f}$ is not a square in $k_v[X]$, thus also not in $E=k(X)$. Then $v(\mg{E}\cap \sums{F})\subseteq 2\Gamma_v$ by (\ref{P:even-val-sos}) and therefore (\ref{T:nr-roots-p2}) yields the inclusion $\mg{E}\cap \sums{F}\subseteq \dset{F}{2}$.
Since $p(E)=2$, it follows that $\sums{F}=\dset{F}{2}(\mg{E}\cap \sums{F})=\dset{F}{2}$.
Therefore $p(F)=2$.
\end{proof}

We now focus on function fields over fields $k$ carrying a henselian valuation with value group $\zz$ and with hereditarily euclidean residue field. The typical example for such $k$ is still the field $\rr(\!(t)\!)$.
The aim is to determine the values of $u(F)$, $p(F)$, and $|\sums{F}/\sq{F}|$ for function fields of hyperelliptic curves $F/k$, if possible.
To deal with the $u$-invariant, we need some preparation.

\begin{prop}\label{P:u4}
Let $k$ be a field carrying a henselian valuation $v$ with value group $\zz$ and such that the residue field $k_v$ is hereditarily quadratically closed of characteristic zero.
Let $F$ be a function field in one variable over $k$.
Then $u(F)=4$.
\end{prop}
\begin{proof}
Observe that $k$ satisfies the assumption of (\ref{T:EW}), whence $u(F)\geq 4$.
To prove the converse inequality, we first assume that $k_v$ is algebraically closed of characteristic zero.
Then $k$ is a $\mc{C}_1$-field by \cite{Lang52}, and therefore $F$ is a $\mc{C}_2$-field by Tsen-Lang Theory, which implies that $u(F)\leq 4$.

Suppose now that $k_v$ is hereditarily quadratically closed of characteristic zero.
Then $k_v$ has no finite extensions of even degree.
Let $k'$ be the maximal unramified extension of $k$ with respect to $v$, and let $k'_v$ be the corresponding extension of the residue field.
Then every element of $k'$ has odd degree over $k$ and $k'_v$ is the algebraic closure of $k$.
Let $F'=Fk'$. Then it follows from \cite[Chap. III, (6.2)]{Stichtenoth} that also every element of $F'$ has odd degree over $F$.
Using Springer's Theorem  \cite[Chap.~VII, (2.7)]{Lam05}, and the previous case, we obtain that $u(F)\leq u(F')\leq 4$.
\end{proof}
\begin{cor}\label{C:u4}
Let $k$ be a field carrying a henselian valuation $v$ with value group $\zz$ and such that the residue field $k_v$ is hereditarily euclidean.
Let $F$ be a function field in one variable over $k$.
If $|\sums{F}/\sq{F}|\leq 2$, then $u(F)=4$.
\end{cor}
\begin{proof}
Since $k_v(i)$ is hereditarily quadratically closed of characteristic zero, we have $u(F(i))= 4$ by (\ref{P:u4}).
With $|\sums{F}/\sq{F}|\leq 2$ we thus obtain from (\ref{C:uinv}) that $u(F)\leq u(F(i))= 4$.
 On the other hand,  $u(F)\geq 4$ by (\ref{T:EW}).
\end{proof}

\begin{thm}\label{T:hel-u4}
Let $k$ be a field carrying a henselian valuation $v$ with value group $\zz$ and such that the residue field $k_v$ is hereditarily euclidean.
Let $F$ be the function field of a hyperelliptic curve $Y^2=f(X)$ over $k$ where $f\in k[X]$ has at most one nonreal irreducible factor.
Then $u(F)=4$.
\end{thm}
\begin{proof}
Since $k_v(i)$ is hereditarily quadratically closed of characteristic zero, we have $u(F(i))= 4$ by (\ref{P:u4}).
By the assumptions on $k$ and $v$, we have $\scg{K}\cong \zz/2\zz$ for any finite nonreal extension $K/k$.
Therefore, with the assumption on $f$, applying (\ref{T:nr-roots-p2}) we obtain that $|\sums{F}/\dset{F}{2}|\leq 2$.
Hence, $u(F)\leq u(F(i))= 4$ by (\ref{C:uinv}).
 On the other hand,  $u(F)\geq 4$ by (\ref{T:EW}).
\end{proof}

\begin{cor}
Let $k$ be a field carrying a henselian valuation $v$ with value group $\zz$ and such that the residue field $k_v$ is hereditarily euclidean.
Let $F$ be the function field of a conic or an elliptic curve over $k$.
Then $u(F)=4$.
\end{cor}
\begin{proof}
This is a special case of (\ref{T:hel-u4}).
\end{proof}


The following result generalises and extends \cite[Theorem 1.4]{TVGY}.

\begin{thm}\label{T:neg-sos-exeption}
Let $v$ be a henselian valuation on $k$ with value group $\zz$ and with hereditarily euclidean residue field $k_v$.
Let $f\in k[X]$ be a nonzero polynomial such that all nonreal roots of $f$ have good reduction with respect to~$v$.
Let $F$ be the function field of the curve $Y^2=f(X)$ over $k$.
Then $$\left|\sums{F}/\dset{F}{2}\right|\,\leq\, 2\quad\hbox{ and }\quad u(F)=4\,.$$
Moreover, 
$p(F)=2$ except possibly in the case where $v(f)\in 2\zz$ and, writing $f=c^2h$ with $c\in\mg{k}$ and
$h\in k[X]$ of valuation $v(h)=0$, the residue polynomial $-\ovl{h}$ is a sum of squares in $k_v[X]$.
\end{thm}
\begin{proof}
In the case where $v(f)\in 2\zz$, except for the $u$-invariant this is a reformulation of (\ref{C:p2-even-val-pol}). 
Otherwise, we have $v(f)\notin 2\zz$ and then the inequality in (\ref{T:nr-roots-p2}) actually yields that $\sums{F}=\dset{F}{2}$, thus $p(F)=2$. In any case, using (\ref{C:u4}) we obtain that $u(F)=4$.
\end{proof}




We now give an example of a function field of a hyperelliptic curve over $k(\!(t)\!)$, where
neither (\ref{T:hel-u4}) nor (\ref{T:neg-sos-exeption}) applies and where we have not been able to decide whether the $u$-invariant is $4$.

\begin{ex}
Let $F$ be the function field of  $Y^2=-(X^2+1)(X^2+t^2)$ over $k=\rr(\!(t)\!)$.
Then $F$ is nonreal with $-1\notin\sq{F}$.
We claim that $|\sums{F}/\dset{F}{2}|=4$, in particular $p(F)=s(F)+1=3$. 
In view of (\ref{T:2-quot-bound}), it is sufficient to show that none of $t$, $X$, and $tX$ lies in $\dset{F}{2}$.

We write $f=-(X^2+1)(X^2+t^2)$ and consider the canonical extension to $E=k(X)$ of the valuation $v:k\lra \zz\cup\{\infty\}$ associated to $t$. 
It follows from (\ref{P:even-val-sos}) that $v(\mg{E}\cap \dset{F}{2})\subseteq 2\zz$.
Therefore $t,tX\notin\dset{F}{2}$.

Assume now that $X\in\dset{F}{2}$.
Then the quadratic form $\la 1,f,-X,-X\ra$ is isotropic over $k(X)$.
By \cite[Chap.~1, (2.3)]{Pfister}, this implies that 
$$X^4+(1+t^2)X^2 +t^2=-f=g^2-X(h_1^2+h_2^2)$$ with $g,h_1,h_2\in k[X]$.
Comparing the degrees of both sides shows that $g$ is a quadratic polynomial with leading coefficient $\pm 1$ and constant coefficient $\pm t$, while $h_1$ and $h_2$ are linear or constant.
We write $g(X)=\pm X^2+bX\pm t$ with $b\in k$.
Comparing the linear coefficients, we obtain $\pm 2bt=h_1(0)^2+h_2(0)^2$ and thus $v(b)\notin 2\zz$, while comparing coefficients in degree $3$ yields on the contrary that $v(b)\in 2\zz$.
Therefore, we have $X\notin \dset{F}{2}$, as claimed.
\end{ex}

The following example shows that $p(F)=2$ may occur in the case which is left open in (\ref{T:neg-sos-exeption}). 
Moreover, it shows that $p(F)=s(F)$ is possible for a nonreal function field of a hyperelliptic curve
over $\rr(\!(t)\!)$.

\begin{ex}
Let $F$  be the function field of  $Y^2=-(X^2+1)(X^2+1+t)$ over $\rr(\!(t)\!)$.
Then $F$ is nonreal with $-1\notin\sq{F}$.
By (\ref{T:nr-roots-p2}) we have the inclusion $\mg{E}\cap v^{-1}(2\zz)\subseteq\dset{F}{2}$. It follows that $\mg{F}=\dset{F}{2}\cup -t\dset{F}{2}$.
But $-t(X^2+1)=Y^2+(X^2+1)^2$ in $F$, showing that $-t$ is also a sum of two squares in $F$.
Therefore we have $p(F)=2=s(F)$.
\end{ex}


Consider now the function field $F$ of an elliptic curve over $k=\rr(\!(t)\!)$.
Thus $F$ is given by a curve $Y^2=f(X)$ where $f\in k[X]$ is of degree $3$. 
If $f$ has only real factors then $p(F)=2$ by (\ref{C:her-pyth-p2}). 
In the remaining case, $f$ is a product of a linear polynomial with an irreducible quadratic polynomial with root field $k(i)$. 
After a linear substitution we are then in the situtation where the following theorem allows to decide
whether $p(F)=2$ or $p(F)>2$.


\begin{thm}
Let $k$ be a real field carrying a henselian valuation $v$ with value group $\zz$ and with hereditarily euclidean residue field $k_v$.
Let $f\in k[X]$ be a polynomial of degree $3$ with $f(0)=0$ and let $F$ be the function field of the elliptic curve $Y^2=f(X)$.
If $v(f)\in 2\zz$ and if $f$ has a root $\alpha_0+i\alpha_1$ in $k(i)$ with $\alpha_0,\alpha_1\in \mg{k}$ such that $v(\alpha_0)<v(\alpha_1)$ and $-\alpha_0\in\sq{k}$, then $p(F)$ is either $3$ or $4$.
In any other case $p(F)=2$.
\end{thm}
\begin{proof}
Recall that $2\leq p(F)\leq 4$ by (\ref{C:p-fufi-hpyth}).
If $v(f)\notin 2\zz$ or if $f$ has no root in $k(i)\setminus k$, then $p(F)=2$, by (\ref{T:neg-sos-exeption}) and  (\ref{C:her-pyth-p2}).
In the remaining case we may assume that $f$ is monic and write $f=X((X-\alpha_0)^2+\alpha_1^2)$ with $\alpha_0,\alpha_1\in k$ and $\alpha_1\neq 0$.
Substituting $X=\alpha_1 X'+\alpha_0$ and $Y=\alpha_1Y'$ shows that $F$ is also the function field of the curve $Y^2 = g(X)$ for $g=(\alpha_1X+\alpha_0)({X}^{2}+1)$.
Now, again by (\ref{T:neg-sos-exeption}), we readily obtain $p(F)=2$ for the cases where $v(\alpha_0)\geq v(\alpha_1)$ or $-\alpha\notin\sums{k}=\sq{k}$.
On the other hand, if $v(\alpha_0)<v(\alpha_1)$ and $-\alpha_0\in\sq{k}$, then $p(F)>2$ follows from (\ref{T:p>2}).
\end{proof}

\begin{qu}\label{Q:p>2}
Let $h\in \rr[X]$ be a non-constant square-free polynomial with no roots in $\rr$.
Let $F$ be the function field of the curve $Y^2=(tX-1)h(X)$ over $\rr(\!(t)\!)$.
Then  $3\leq p(F)\leq 4$ by $(\ref{T:p>2})$ and $(\ref{C:p-fufi-hpyth})$.
What is the exact value of $p(F)$?
\end{qu}


\subsection*{Acknowledgements}
The results in this article grew out of discussions the authors had during the past three years. 
We would like to thank David Leep, Sergey Tikhonov, and  Vyacheslav Yanchevski\u{\i} for stimulating discussions around the topic of this article.
Furthermore, the project turned out to be a very good reason for one author
to visit Ghent regularly and for the other to visit Lausanne  and Konstanz.
We are grateful to the institutes, including the \emph{\'Ecole Polytechnique F\'ed\'erale de Lausanne}, for their hospitality.
We further acknowledge support from the 
 European RTN Network \emph{`Algebraic $K$-Theory, Linear Algebraic Groups, and Related Structures'} (HPRN-CT-2000-00287) and the \emph{Swiss National Science Foundation} (Grant No. 200020-100229/1).


\bibliographystyle{plain}
\begin{thebibliography}{99}

\bibitem{Becher06}
K.~J. Becher.
\newblock On fields of $u$-invariant $4$.
\newblock {\em Arch. Math.} {\bf 86} (2006): 31--35.

\bibitem{Becher-mwif}
K.~J. Becher.
\newblock Minimal weakly isotropic forms.
\newblock {\em Math. Z.} {\bf 252} (2006): 91--102.

\bibitem{Becker}
E. Becker.
\newblock {\em Hereditarily-pythagorean fields and orderings of higher level}
\newblock Monografias de Matem\'atica {\bf 29},
Instituto de matematica pura e aplicada, Rio de Janeiro, 1978.

\bibitem{EL73}
R. Elman, T.~Y. Lam.
\newblock {Quadratic Forms and the $u$-invariant, $I$}.
\newblock {\em Math. Z.} {\bf 131} (1973): 283--304.

\bibitem{EL76}
R. Elman, T.~Y. Lam.
\newblock {Quadratic Forms under Algebraic Extensions}.
\newblock {\em Math. Ann.} {\bf 219} (1976): 21--42.

\bibitem{EW87}
R.~Elman, A.~R. Wadsworth.
\newblock Hereditarily Quadratically Closed Fields.
\newblock {\em J.~Algebra} {\bf 23} (1972): 181--213.

\bibitem{Hoffmann99b}
D.~W. Hoffmann.
\newblock Pythagoras numbers of fields. 
\newblock {\em  J. Am. Math. Soc.} {\bf 12} (1999): 839--848.

\bibitem{Hoffmann99}
D.~W. Hoffmann.
\newblock Isotropy of quadratic forms and field invariants.
\newblock In: E.~Bayer-Fluckiger (ed.) et al.
\newblock {\em Quadratic forms and their applications. Proceedings of the conference, University College Dublin, Ireland, July 5-9, 1999.} 
\newblock Providence, RI: American Mathematical Society (AMS). {\em Contemp. Math.} {\bf 272} (2000): 73--102.


\bibitem{Lam05}
T.Y. Lam.
\newblock {\em Introduction to quadratic forms over fields}. 
\newblock Graduate Studies in Mathematics, {\bf 67}, American Mathematical Society, Providence, RI, 2005.

\bibitem{Lang52}
S. Lang.
\newblock On Quasi-Algebraic Closure.
\newblock {\em Annals of Math.} {\bf 55} (1952): 373--390. 

\bibitem{Pfister67}
A.~Pfister.
\newblock Zur Darstellung definiter Funktionen als Summe von Quadraten.
\newblock {\em Invent. Math.} {\bf 4} (1967): 229--237.

\bibitem{Pfister}
A.~Pfister.
\newblock {\em Quadratic Forms with Applications to Algebraic Geometry and Topology}.
\newblock LMS Lect. Notes Series {\bf 217}, Cambridge University Press, Cambridge, UK, 1995.

\bibitem{PS}
R. Parimala and V. Suresh.
\newblock Isotropy of quadratic forms over function fields of $p$-adic curves.
\newblock {\em Inst. Hautes \'Etudes Sci. Publ. Math.} {\bf 88} (1998): 129--150.

\bibitem{Scharlau}
W. Scharlau.
\newblock {\em Quadratic and Hermitian forms}. 
\newblock Grundlehren der Mathe\-matischen Wissenschaften, {\bf 270}. Springer-Verlag, Berlin, 1985. 
\bibitem{Stichtenoth}
H.~Stichtenoth.
\newblock {\em Algebraic Function Fields and Codes}.
\newblock Universitext, Springer-Verlag, Berlin, 1993.

\bibitem{TVGY}
S.~V. Tikhonov, J. Van~Geel, V.~I. Yanchevski\u{\i}.
\newblock Pythagoras numbers of function fields of hyperelliptic curves with good reduction.
\newblock {\em Manuscripta Math.} {\bf 119} (2006): 305--322.

\bibitem{TY}
S.~V. Tikhonov, V.~I. Yanchevski\u{\i}.
\newblock Pythagoras numbers of function fields of conics over hereditarily pythagorean fields.
\newblock {\em Dokl. Nats. Akad. Nauk Belarusi} {\bf 47}, $n^\circ 2$ (2003): 5--8.

\end{thebibliography}

\bigskip\noindent
Karim Johannes Becher\\ 
Universit\"at Konstanz, FB Mathematik und Statistik, D203\\
78457 Konstanz, Germany\\
Email: {\tt becher@maths.ucd.ie}

\bigskip\noindent
Jan Van Geel\\
Universiteit Gent, Vakgroep Zuivere Wiskunde en Computeralgebra\\
Galglaan 2, 9000 Gent, Belgium\\
 Email: {\tt jvg@cage.ugent.be}



\bigskip\noindent
\emph{March 14, 2007}
\end{document}


