TITLE: Joint Distribution Not Obvious Algebraically for Graphical Models
QUESTION [1 upvotes]: I am having some trouble discerning joint distributions. The joint distribution below is given for $p(x_1,x_2,x_3,x_4)$ however by following the algebra, applying Bayes rule etc., I cannot reach the joint distribution.

Or the Markov chain here

In such cases (or all) do we always need to know what the graph looks like, otherwise how can we construct the joint distribution? Or can we build the graph from individual probabilities, and looking at that, we can apply the algebra (factoring in the conditional independence), allowing us to reach the joint distribution this way?
Thanks,

REPLY [1 votes]: If you use the Bayes rule, you marginalize your joint density to some conditional densities. This is the most general picture that you can have. In case you have additional information, about the dependence/independence structure of random variables you can make further simplifications.
At this point a graphical model dictates such dependencies and makes the problem specific.


TITLE: Equivalence of a Vector Norm
QUESTION [0 upvotes]: I have this for my homework and i need help with this question:
For a 2D vector, is norm2 > norm1 possible?
Characterize all 2D vectors for which the norm2 is equal to the norm1. Explain
graphically.

REPLY [0 votes]: For $(x,y) \in \mathbb R^2$ we have
$$||(x,y)||_1 =|x|+|y| \ge \sqrt{x^2+y^2}=||(x,y)||_2,$$
since
$(|x|+|y|)^2=x^2+2|x||y|+y^2 \ge x^2+y^2$.
We have the equality
$$||(x,y)||_1 =|x|+|y| = \sqrt{x^2+y^2}=||(x,y)||_2$$
$ \iff$
$(|x|+|y|)^2=x^2+2|x||y|+y^2 = x^2+y^2  \iff xy=0$.


TITLE: If $f$ is a concave function and $f(0) \geq 0$ then $f(a+b) \leq f(a) + f(b)$ for all $a,b >0$
QUESTION [1 upvotes]: Well If I've got a nice understanding, this proof involves the use of Rolle's and/or Mean Value Theorems. But I don't even an idea of how to start. We already know that
$$f\text{ concave}\Rightarrow f''<0$$
but, then...

REPLY [7 votes]: $$  \frac{b}{a+b}f(0) + \frac{a}{a+b}f(a+b) \leq f(a)  $$
since $f(0) \ge 0$ we have
$$   \frac{a}{a+b}f(a+b) \leq f(a)  $$
similarly by interchanging the role $a$ with $b$ we have
$$   \frac{b}{a+b}f(a+b) \leq f(b)  $$
Now by adding last two inequality we arrive to the result.


TITLE: Quantum Eigenvalues, measurements, chances not matching up
QUESTION [0 upvotes]: I've got an assignment with a given quantum state, denoted $\phi=\frac{1}{\sqrt{2}} \begin{bmatrix}0 \\ 1 \\ -1\end{bmatrix}$ and an operator for the observable B, given by
$B=b\begin{bmatrix}0 & 2 & 0 \\ 2 & 0 & 0 \\ 0 & 0 & 2\end{bmatrix}$
And I'm asked to find the possible measurements of B, for the quantum state $\phi$.
Now; I've tried two different methods (given by two different instructors), and I'm unsure which is correct.
Method 1
The possible measurements of B should be given by the product $B|\phi\rangle$, which yields the vector
$B|\phi\rangle=\begin{bmatrix}b\sqrt{2} \\ 0 \\ -b\sqrt{2}\end{bmatrix}$
Which then indicates that the possible values of a measurement of B are $b$ and $-b$ and their respective chances are $(\sqrt{2})^2=\frac{1}{2}=50$% each.
Method 2 - and here there's a problem...
The possible measurements of B are its eigenvalues; I find the eigenvalues of B, given by the characteristic polynomial, and get $\lambda = -2b,2b,2b$ (note the degeneracy), with respective eigenvectors
$v_1 = \begin{bmatrix}-1 \\ 1 \\ 0\end{bmatrix}, v_2 = \begin{bmatrix}0 \\ 0 \\ 1\end{bmatrix}, v_3 = \begin{bmatrix}1 \\ 1 \\ 0\end{bmatrix}$
I express the state $\phi$ as a linearcombination of these. It's
$\phi=\frac{1}{\sqrt{2}}\bigg(\frac{1}{2} v_1+\frac{1}{2} v_3 - 1v_2\bigg)$
The chances for each individual eigenvalue $B=\lambda_n$ are the norm-squares of the coefficients for the corresponding eigenvector, in the linearcombination for $\phi$. I.e. The chance to get $B=\lambda_1=-b$ should be
$|\frac{1}{\sqrt{2}}\frac{1}{2}|^2=\frac{1}{8}$
And now you can probably already see my problem, because the chances don't seem to add up. $\frac{1}{8}+\frac{1}{8}+\frac{1}{2}\neq 1.0$
And the strangest thing is, for another, similar assignment, with the observable $L_z$ and a different quantum states, I used both methods and they yielded exact same results.
However; my idea is that the problem arises from the degeneracy of B's eigenvalues? The other problem (where both methods worked) did not have degeneracies in the eigenvalues for the matrix $[L_z]$

REPLY [0 votes]: You failed to make Method 1 make any sense at al;, and, of course, the answer you provide is wrong. What you can ascertain from it is $\langle B\rangle=b$, which distinctly contradicts your unsound conclusion.
Method 2 is the standard one, if only you normalized your eigenvectors properly, as
suggested by @ZeroTheHero:
The eigenvalues of B are $\lambda = -2b,2b,2b$, with respective normalized eigenvectors
$$v_1 = \frac{1}{\sqrt{2}}\begin{bmatrix}-1 \\ 1 \\ 0\end{bmatrix}, \qquad v_2 = \begin{bmatrix}0 \\ 0 \\ 1\end{bmatrix},\qquad  v_3 = \frac{1}{\sqrt{2}}\begin{bmatrix}1 \\ 1 \\ 0\end{bmatrix}, $$
so that  $\phi=\bigg(\frac{1}{2} v_1+\frac{1}{2} v_3 - \frac{1}{\sqrt{2}}v_2\bigg)$.
As a result, $| \frac{1}{2}|^2=\frac{1}{4}$ of the time you measure $-2b$, while $| \frac{1}{2}|^2 +| \frac{1}{\sqrt{2}}|^2=\frac{3}{4} $ of the time you measure 2b, so on the average b, as found above.
Degeneracy is innocent here.


TITLE: Solve functional equation $f(a)f(b)=\frac{1}{2}f(a+b)+\frac{1}{2} f(max(|b-a|,a))$
QUESTION [3 upvotes]: Solve functional equation
$$f(a)f(b)=\frac{1}{2}f(a+b)+\frac{1}{2} f(max(|b-a|,a)),(*)$$
where the following conditions are satisfied:
1)$f:\mathbb{R}_{+}\cup \{0\}\rightarrow [0,1] ,$
2)$f(0)=1,$
3)$\lim\limits_{x\rightarrow +\infty} f(x)=0,$
4)$f$ is continuous and nonincreasing.
$f$ can be interpreted as probability, that nonnegative random absolute continuous variable $X$ satisfy:
$$f(a)=P(X>a).$$

EDIT:
What is the solution of (*), when we don't have conditions 1)-4), but we know that:
1)' $f:\mathbb{R}\rightarrow \mathbb{R} ,$
2)' $f(x)=f(-x)$ for all $x \in \mathbb{R} ,$
3)' $f$ is continuous.

REPLY [2 votes]: 1) Let $x\geq 0$, and put $a=b=x$. You get
$$(*)\,\,\,f(2x)=f(x)(2f(x)-1)$$
2) Suppose that $f(x)>0$ for all $x$. From (*), we get that $2f(x)>1$ for all $x$. This contradict $f(x)\to 0$ as $x\to +\infty$.
3) Hence there exists $u$ such that $f(u)=0$. By the fact that $f$ is non increasing and continuous, we get (as $f(0)=1$) that there exists a $m>0$ such that $f(x)=0$ for $x\geq m$, and $f(x)>0$ if $x<m$.
4) Let $x$ such that $\displaystyle m>x>\frac{m}{2}$. We have $2x>m$, hence $f(2x)=0=f(x)(2f(x)-1)$. But $f(x)>0$, hence $\displaystyle f(x)=\frac{1}{2}$. So $f(x)\to 1/2$, as $x\to m$, $x<m$. As $f(m)=0$, we have again a contradiction with the continuity of $f$ at $m$.
Perhaps the hypothesis are not correct ?
EDIT: I use the new hypothesis.
a) Let $a=x\geq 0$, and $0\leq b\leq 2x$. We have $|b-x|\leq x$, hence we get
$$(1)\,\, 2f(x)f(b)=f(x+b)+f(x)$$
b) Put $x=y$, $b=y$ in (1)($y\geq 0$)
$$f(2y)=f(y)(2f(y)-1)$$
c) Put $x=2y$, $b=y$ in (1) :
$$f(3y)=f(2y)(2f(y)-1)=(2f(y)-1)^2 f(y)$$
d) Put $x=y$, $b=2y$ in (1):
$$f(3y)=f(y)(2f(2y)-1)=(2(2f(y)-1)f(y)-1)f(y)$$
e) Suppose now that $f(z)$ ($z\geq 0$) is not zero. By c) and d), we get $1=(2f(z)-1)$. Hence $f(z)=1$. So the function $f$ can take only the values $0$ and $1$ on $]0,+\infty[$, thus by continuity $f$ is constant, and it is easy to finish.


text:
\begin{document}

\keywords{Pythagoras number, k-regulous function, sums of even powers.}
\subjclass[2020]{Primary: 26C15, 14P99}
\maketitle

\begin{abstract}

We prove that the 2-Pythagoras number of the ring of $0$-regulous functions $\RR^0(X)$ on an irreducible $0$-regulous affine variety $X$ of pure dimension is finite and bounded from above by $2^{\dim X}$. We also provide an example of a nonnegative $k$-regulous function on $\R^n$ for $k\geq 1$ and $n \geq 2$ which cannot be written as a sum of squares of $k$-regulous functions. We then obtain lower bounds for higher Pythagoras numbers  $p_{2d}(\RR^k(\R^n))$ of $k$-regulous functions on $\R^n$ for $k\geq 1$ and $n\geq 2$.

\end{abstract}
\section{Introduction}

Let $f$ be a real valued nonnegative function on a topological space $X$. It is then natural to ask two questions. Can $f$ be written as a sum of squares of functions on $X$ with same regularity as $f$? And if so, how many squares are needed? In this paper we deal with two instances of this problem. In the first one, $X$ is an irreducible $0$-regulous affine variety and $f$ is a $0$-regulous function. The second case deals with $k$-regulous functions on $\R^n$ for $k>0$.

It was known since Hilbert that not every nonnegative polynomial can be written as a sum of squares of polynomials, however first explicit example was discovered almost 80 years later by Motzkin (see \cite{Motzkin}). By a famous result of Artin \cite{Artin}, every nonnegative polynomial can be written as a sum of squares of rational functions. It is known, that for some polynomials in every such representation, all denominators have to have specified zeros, so-called bad points. It is natural to ask what regularity conditions can be imposed on these rational functions. We answer this question for positive definite homogeneous polynomials.

Apart from sums of squares, we are interested in sums of even of powers and higher Pythagoras numbers for the rings of $k$-regulous functions.
Those were studied before, in case of a field of rational functions in one variable \cite{CLPR, Schmid}, and real holomorphy rings \cite{Becker}. We refer to \cite{4xfr, KN} for exposition on the theory of $k$-regulous functions.

Let $A$ be a ring. In general, computing 2-Pythagoras number of $A$ is a very difficult task. It is hard to even determine whether this number is finite or not. One of the problems in this manner is to determine the precise value of $p_2(\R(x_1,\dots, x_n))$. Pfister \cite{Pfister}  was first to show that this number is finite and bounded from above by $2^n$. Lower bound is known to be $n+2$ (see \cite{Cassels}), which in particular gives $p_2(\R(x_1,x_2))=4.$ Situation is different when we consider polynomials, it was proven in \cite{CLDR} that  $p_2(\R[x_1, \dots, x_n])=\infty$, for $n\geq 2$. There are also some results concerning excellent rings (see \cite{FRS}).

In Section 2 we discuss the $2$-Pythagoras  number $p_2(\RR^0(X))$ of the ring of $0$-regulous functions on an irreducible $0$-regulous affine variety, and provide some upper bounds. In Section 3 we consider $k$-regulous functions on $\R^n$ for $k>0$. An example of a nonnegative $k$-regulous function which cannot be written as a sum of squares is given. Also, some lower bounds for the higher Pythagoras numbers $p_{2d}(\RR^k(\R^n))$ are established. The last Section deals with the problem of representing a quotient of two positive definite forms as a sum of even powers of $k$-regulous functions, for some $k$.

We start with some preliminary definitions.

\begin{df}
Let $n$ be a positive integer and $k$ be a nonnegative integer. We say that a continuous function $f: \R^n \rightarrow \R$ is $k$-regulous on $\R^n$ if $f$ is of class $\mathcal{C}^k$ and $f$ is a rational function, i.e. there exists a non-empty Zariski open subset $U\subset \R^n$ such that $f|_U$ is regular.
\end{df}

$k$-regulous functions determine a $k$-regulous topology on $\R^n$ such that the zero sets of $k$-regulous functions are precisely the closed sets. Surprisingly, this topology does not depend on $k$ \cite[Corollaire 6.5]{4xfr}. In particular, $k$-regulous closed subsets of $\R^n$ coincide with the algebraically constructible Euclidean closed subsets of $\R^n$.

\begin{df}\label{defin k-reg}
For a $k$-regulous closed subset $X\subset \R^n$ we define the ring of $k$-regulous functions on $X$ as the
quotient
$$\RR^k(X):=\RR^k(\R^n)/\mathcal{I}(X)$$
where $\mathcal{I}(X)$ is the ideal of $k$-regulous functions vanishing on $X$.
\end{df}
Throughout the paper, the term affine $k$-regulous variety  will mean $k$-regulous closed irreducible subset of $\R^n$ for some $n$ (see \cite{4xfr} for more details on $k$-regulous topology).

We start with a simple results that will be used frequently through the paper.

\begin{prop}
Let $X \subset \R^n$ be a $k$-regulous affine variety, and $f \in \RR^k(X)$ be a $k$-regulous function on $X$. Then the set $U:= X\setminus\Z(f) $ is isomorphic with a $k$-regulous affine variety.

\begin{proof}
By Definition \ref{defin k-reg} we can find a $k$-regulous function $F \in \RR^k(\R^n)$ such that $F|_X=f$. By Noetherianity of the $k$-regulous topology (cf. \cite[Theorem 4.3]{4xfr}), there is a $k$-regulous function $G \in \RR^k(\R^n)$ such that $\Z(G)=X$. Define a $k$-regulous set $V:=\{(x,y) \in \R^n \times \R \ | \ (F(x)y-1)^2+G(x)^2 =0 \}$. Clearly, sets $U$ and $V$ are isomorphic in the category of $k$-regulous affine varieties.

\end{proof}

\end{prop}

\begin{prop}\label{localization}
Let $X\subset \R^n$ be an affine $k$-regulous variety and $f \in \RR^k(X)$ be a $k$-regulous function on $X$. Then the restriction morphism induces an isomorphism between the localization $\RR^k(X)_f$ and $\RR^k(U)$ where $U:=X\setminus \{f=0 \}$ is the complement of the zero set of $f$.

\begin{proof}

Let $\phi:\RR^k(X)\rightarrow \RR^k(U)$ be the restriction homomorphism. As $f$ does not vanish on $U$, there is an induced homomorphism $\phi_f:\RR^k(X)_f\rightarrow \RR^k(U).$ We will prove that $\phi_f$ is an isomorphism. Denote by $\pi:\RR^k(\R^n)\rightarrow \RR^k(X)$ the natural projection.

If $X=\R^n$, then this is precisely \cite[Proposition 5.6]{4xfr}.

Injectivity of $\phi_f$ follows from the irreducibility of $X$.

To show surjectivity, take any $g\in \RR^k(U)$. From the definition of induced topology,
there exists a $k$-regulous open subset $V\subset \R^n$ such that $V\cap X=U$. By \cite[Proposition 5.37]{4xfr} we may find a $k$-regulous function $G \in \R^k(V)$ such that $G|_U=g$. Similarly, there exists a $k$-regulous function $F\in \RR^k(\R^n)$ such that $F|_X=f$. Next step is to modify the functions $G$ and $F$ in order to apply Łojasiewicz inequality (\cite[Lemme 5.1]{4xfr}). Since the $k$-regulous topology is Noetherian, there exists a $k$-regulous function $H \in \RR^k(\R^n)$ such that $\Z(H)=X$. Define modification of $F$ and $G$ as follows:
$\widetilde{F}=F+H^2$ and $\widetilde{G}=G+H^2|_U$. Clearly, $\widetilde{F}|_X=f$ and $\widetilde{G}|_U=g$. These new functions, satisfy the assumptions of Łojasiewicz inequality, hence, there exists a positive integer $N$ such that $\widetilde{F}^N\widetilde{\G}\in \RR^k(\R^n)$. Let now $\pi(\widetilde{F}^N\widetilde{\G})=h \in \RR^k(X)$ be a $k$-regulous function on $X$. $h$ restricted to $U$ is equal to $f^Ng$, hence $g$ can be written as a fraction $\frac{h}{f^N}$, as $f$ is a unit on $U$. Since $g$ was arbitrary, this finishes the proof.

\end{proof}
\end{prop}

Consequently, the ring $\RR^k(U)$ is a ring of $k$-regulous functions on an affine $k$-regulous variety.
Let us introduce one more topological notion.

\begin{df}
Let $X \subset \R^n$ be a subset of $\R^n$. We say that $X$ is of pure dimension $l$ if for every open $U\subset \R^n$ in the Euclidean topology, the intersection $U\cap X$ is either empty or contains a subset homeomorphic to $\R^l$.

\end{df}
The notion of pure dimensional $k$-regulous affine varieties is analogous to the notion of central real algebraic varieties. Recall that a real algebraic set $V$ is central if it is equal to the closure in the Euclidean topology of the set of regular points. In particular, the class of $k$-regulous pure dimensional affine varieties strictly contains the class of irreducible central algebraic sets, as well as irreducible nonsingular real algebraic sets. Below, we give some examples of $k$-regulous affine varieties.
\begin{ex}
Consider the real algebraic set $X$  given by $\{y^2-x^{3+k}+x^2 \} \subset \R^2$. Then there is a decomposition $X=Y\cup W$ where $Y$ is the origin and $W$ is the 1 dimensional component. In this case $X$ is reducible as a $k$-regulous set and the 1-dimensional part $W$ is an irreducible $k$-regulous set (cf. \cite[Theor\'{e}me 6.13]{4xfr}). Hence, $W$ is a $k$-regulous affine variety of pure dimension 1. Additionally, $W$ is the zero set of a $k$-regulous function $f= 1 - \frac{x^{3+k}}{x^2+y^2}$.
\end{ex}

\begin{ex}
Take the real algebraic set $X $ given by the equation $zx^2=y^2$, the Whitney umbrella. $X$ is in irreducible real algebraic set as well as an irreducible $k$-regulous set (cf. \cite[Exemples 6.12]{4xfr}). However, $X$ is not of pure dimension 2, since it has a 1-dimensional "handle" sticking out of its 2-dimensional part.

\end{ex}
We finish this Section with one more definition.
Let $A$ be a ring.
\begin{df}
Define $p_{2d}(A)$ to be the least positive integer $g$ such that any sum of $2d$th powers of elements of $A$ can be expressed as a sum of $g$ $2d$th powers elements of $A$. If such number does not exist, we put $p_{2d}(A)=\infty$.

\end{df}

\section{Sums of squares of $0$-regulous functions}

In this section we are mainly interested in $0$-regulous functions on $0$-regulous affine varieties. Some results however, do hold in the case $k>0$. Let $X$ be an affine $k$-regulous variety of dimension $n$.

\begin{df}We say that a ring $A$ is a ring of regular functions, if for any element $s$ which is a sum of squares in $A$, the element $1+s$ is invertible (cf. \cite[Chapter 7]{Mahe}).
\end{df}
\begin{remark}
By the weak Nullstellensatz \cite[Proposition 5.9]{3xfr}, the ring $\RR^k(\R^n)$ is a ring of regular functions, for any integers $k \geq 0$ and $n\geq 1$. In particular, any homomorphic image of a ring of regular functions is a ring of regular functions. Thus  the ring $\RR^k(X)$ is a ring of regular functions  for any $k$-regulous affine variety.

\end{remark}

For a ring $A$, we denote by $\mathrm{Spec}_r(A)$ the real spectrum of $A$ (cf. \cite[Chapter 7]{Bochnak}).

\begin{df}
We say that an element $f \in A$ is totally positive if for every element $\alpha \in \mathrm{Spec}_r(A)$, we have $f(\alpha)>0$.
\end{df}

In order to apply results from \cite{Mahe}, we need to prove the following:

\begin{prop}\label{totally positive}
Any strictly positive $k$-regulous function $f$ on $X$ is totally positive in the ring $\RR^k(X)$.
\end{prop}
Let us recall a slight reformulation of the Artin Lang property which will be crucial in the proof.
\begin{prop}\cite[Proposition 5.6]{3xfr}
Let $(k,n)\in \N \times \N^*$. Let $g,f_1,\dots, f_r \in \RR^k(\R^n)$ and set
$$S= \{x \in \R^n \ | \ g(x)=0, f_1(x)>0,\dots, f_r(x)>0 \},$$
and
$$\widetilde{S}= \{ \alpha \in \mathrm{Spec}_r \RR^k(\R^n) \ | \ g(\alpha)=0, f_1(\alpha)>0, \dots, f_r(\alpha) >0\}.$$
Then, $S=\emptyset$ if and only if $\widetilde{S}=\emptyset$.
\end{prop}

 The above fact needs a comment. In its original statement, the above Proposition is stated for open sets given by inequalities,  however its proof works equally well for Boolean combinations of those. Even more, in this more general case, Artin Lang property was used several times in \cite{3xfr}.

\begin{lemma}\label{correspondence}
Let $\varphi : A \rightarrow B$ be an epimorphism of rings with nonempty real spectra. Then the prime cones in $B$ are in bijective correspondence with prime cones in $A$ whose support contains $\ker \varphi.$ Let $\beta \in \mathrm{Spec}_rB$ be a prime cone, then the corresponding prime cone in $A$ is defined as $\varphi^{-1}(\beta)$. Here, it is convenient to consider prime cone of a ring as its subset.

\begin{proof}
Exercise in real algebra.
\end{proof}
\end{lemma}

\emph{Proof of Proposition \ref{totally positive}}
Let $f$ be a strictly positive $k$-regulous function on $X$. Denote by $\mathcal{I}(X) \subset \RR^k(\R^n)$ the ideal of $k$-regulous functions vanishing on $X$. Since $k$-regulous topology is Noetherian (cf. \cite[Theorem 4.3]{4xfr}), we may find a $k$-regulous function $g \in \RR^k(\R^n)$ such that $\Z(g)=\Z(\mathcal{I}(X))=X$.

Assume that there exists an element $ \alpha \in \mathrm{Spec}_r \RR^k(X)$ such that $f(\alpha)\leq 0.$ By Lemma \ref{correspondence}, the following set is nonempty
$$\widetilde{S}= \{ \alpha \in \mathrm{Spec}_r \RR^k(\R^n) \ | \ g(\alpha)=0, F(\alpha) \leq 0\}\neq \emptyset $$
where $F \in \RR^k(\R^n)$ is a $k$-regulous function which satisfies $F|_X=f$.
Consequently, the Artin Lang property implies
$$ S= \{x \in \R^n \ | \ g(x)=0, F(x)\leq 0\}\neq \emptyset.$$
However, for any $x \in X\subset \R^n$ we have $g(x)=0$ and $F(x)=f(x)>0$. Hence the set $S$ is empty, a contradiction. This shows that any strictly positive $k$-regulous function is totally positive in the ring $\RR^k(X)$.
\qed

As a consequence, we can use the following reformulation of \cite[Theorem 7.3]{Mahe}

\begin{thm}\label{Mahe}
Any strictly positive $k$-regulous function on $X$ can be written as a sum of at most $2^n$ squares of $k$-regulous functions.
\end{thm}

We may now state the main result of this Section.
\begin{thm}\label{0=regulous squares}
Let $X$ be an affine $0$-regulous variety of pure dimension $n$.
The $2$-Pythagoras number $p_2(\RR^0(X))$ of $0$-regulous functions on $X$ satisfy
$$p_2(\RR^0(X))\leq 2^n.$$

\end{thm}

\begin{proof}
Let $f \in \RR^0(X)$ be a sum of squares. Denote by $Z=Z(f)$ the zero set of $f$ and let $U=X\setminus Z$ be its complement. Consider now the restriction of $f$ to the set $U$. Clearly, $f$ is a totally positive element in $\RR^0(U)$. Hence, by Theorem \ref{Mahe} we get $f = \sum_{i=1}^{2^n}f_i^2$, for some $f_i \in \RR^0(U)$. By Remark \ref{localization}, we have an isomorphism $\RR^0(U)\cong \RR^0(X)_f$, and thus we can write $f_i=\frac{g_i}{f^{n_i}}$ for some $g_i \in \RR^0(X)$ and $i=1,2,\dots, 2^n$. Without loss of generality we may assume that $n_i=N$ for some positive integer $N$ and every $i=1,2,\dots, 2^n$.

Then, there is an equality on $U$
$$f=\sum_{i=1}^{2^n}(\frac{g_i}{f^N})^2.$$
Function $f$ on the left-hand side is continuous and nonnegative on $X$ and the zero set of $f$ is nowhere dense subset of $X$ in the Euclidean topology. Also, we know that this equality holds outside of the set of zeros of $f$. Every function on the right-hand side can be continuously extended to the whole $X$, as a consequence of pure dimensionality. Hence, for any $i=1,2,\dots, 2^n$ the function $\frac{g_i}{f^N}$ is a $0$-regulous function on $X$. This finishes the proof.

\end{proof}

\begin{remark}
It is not clear whether the assumption of pure dimensionality in the Theorem \ref{0=regulous squares} is necessary. So far, the authors have not found more general proof nor counterexample.
\end{remark}

\begin{remark}
\cite[Theorem 6.1]{3xfr} says that any nonnegative $0$-regulous function on $\R^n$ is a sum of squares. The above proof implies the more general statement:
any nonnegative $0$-regulous function on a pure dimensional $0$-regulous affine variety is a sum of squares of $0$-regulous functions.
\end{remark}

\begin{remark}
The above reasoning cannot be applied to $k$-regulous functions on $\R^n$ for $k\geq 1$ and $n\geq 2$, as there is no guarantee that the extensions of the functions $f_i$ will be of class $\mathcal{C}^k$ .
\end{remark}
\begin{cor}
Since the field $\R(x_1,\dots, x_n)$ is a field of fractions of $\RR^0(\R^n)$ we obtain

$$n+2 \leq p_2(\RR^0(\R^n))\leq 2^n.$$
In particular $p_2(\RR^0(\R^2))=4$.
\end{cor}
For $n=2$, Theorem \ref{0=regulous squares} and \cite[Theorem 6.1]{3xfr} immediately imply

\begin{cor}
Let $f \in \RR^0(\R^2)$. Then $f$ is nonnegative on $\R^2$ if and only if there exist functions $f_1, f_2, f_3, f_4 \in \RR^0(\R^2))$ such that $f=f_1^2+f_2^2+f_3^2+f_4^2$.
\end{cor}

\section{Sums of even powers of $k$-regulous functions}

In this Section, we study nonnegative elements and sums of even powers in the rings of $k$-regulous functions on $\R^n$ for $k\geq 1$ $n\geq 2$. We provide an example of a nonnegative $k$-regulous function which is not a sum of squares, contrary to the case $k=0$. Also, a lower bounds for $2d$th Pythagoras numbers are given. At the end, we present some modified Pythagoras numbers.
\subsection{Nonnegative functions and the set of bad points.}

Let $A$ be a ring. We say that an element $a \in A$ is positive semidefinite (psd) if for every $\alpha \in \mathrm{Spec}_r A$ we have $a(\alpha)\geq 0$. By the Artin Lang property, any nonnegative $k$-regulous function on $\R^n$ is psd in the ring $\RR^k(\R^n)$. In real algebraic geometry one can consider the problem, whether any psd element is a sums of squares (sos) (see \cite{FRS} for results on excellent rings) in a given ring. Below, we prove the existence of the so called bad points for $k$-regulous functions of $\R^n$. This in particular proves that for $\RR^k(\R^n)$  we have psd $\neq$ sos, provided $k\geq1$ and $n\geq 2$.

\indent
Recall the following

\begin{df}
Let $f$ be a real valued continuous function on $\R^n$. We say that $f$ is homogeneous of degree $k$ if $f(\alpha x)=\alpha^k f(x)$ for all nonzero real numbers $\alpha$ and any $x \in \R^n$.
\end{df}
We may now state a very useful observation
\begin{prop}\label{homogen}
Let $f$ be a $k$-regulous function on $\R^n$ which is homogeneous of degree $k$. Then $f$ is a polynomial.

\begin{proof}
Let $P$ be the $k$th Taylor polynomial of $f$ at the origin. The homogeneity of $f$ implies that both $P$ and $f-P$ are homogeneous of degree $k$. However, the order of $f-P$ at the origin is at least $k+1$, hence by homogeneity $f=P$.

\end{proof}
\end{prop}
For the related result see \cite[Lemma 2]{czarnecki}. In particular,  any $k$-regulous function on $\R^n$ which is homogenous of degree $l $ is a polynomial, provided that $l\leq k$.

Main Theorem of this section, useful in providing some counterexamples, goes as follows:
\begin{thm}\label{Sos l}
Let $f$ be a $k$-regulous function on $\R^n$ which is homogeneous of degree $2kd$. If $f$ is a sum of $l$ $2d$th powers of $k$-regulous functions, then $f$ is a sum of $ l$ $2d$th powers of polynomials. In particular, $f$ is a polynomial.

\begin{proof}
By the assumption, $f$ can be written as $f=\sum_{i=1}^l f_i^{2d}$, for some $k$-regulous functions $f_i$, which are necessarily $k$-homogeneous. By Proposition \ref{homogen} every $f_i$ is a polynomial, so is $f$.
\end{proof}
\end{thm}

It was asked in \cite{3xfr} whether any nonnegative $k$-regulous function on $\R^n$ is a sum of squares of $k$-regulous functions. We may now say that this is not the case.

\begin{thm}

Let $n = 2$ and $k\geq 1$. Take the $k$-regulous function $$f_k=\frac{x^{2+2k}}{x^2+y^2}\in \mathcal{R}^k(\R^2).$$ Consider the set
$$\mathrm{Bad}(f_k):= \{ h\in \mathcal{R}^k(\R^2):h^2f_k=\sum_{i=1}^l g_i^2 , \,    g_i \in \mathcal{R}^k(\R^2)  \}.$$
Let $I_k$ be the ideal generated by $\mathrm{Bad}(f_k)$.
Then the set of bad points, i.e. the zero set $\Z(I_k)$ of $I_k$, is nonempty.
\begin{proof}

Obviously, $x^2 +y^2 \in \mathrm{Bad}(f_k)$, hence $\Z(I_k)\subset \Z(x^2+y^2)$.
Suppose that the set $\Z(I_k)$ is empty. Then, there exists $h\in\mathrm{Bad}(f_k)$ with a nonzero value at the origin. A simple calculation shows that $x^2+y^2+h^2\in\mathrm{Bad}(f_k)$. Since $\mathrm{Bad}(f_k)$ is closed under multiplication by elements of $\mathcal{R}^k(\R^n)$ and the given element is a unit, we get that $1 \in \mathrm{Bad}(f_k)$.
This is an immediate contradiction with Theorem \ref{Sos l}, as the function $f_k$ is homogeneous of degree $2k$ and it is not a polynomial.

\end{proof}

\end{thm}

The function $f_k$ might as well be considered as a function of $n$ variables for any $n \geq 2$. Using the above argument we see that $\Z(I_k)=\{x^2+y^2=0\}$. As a consequence, we get
\begin{thm}
The function $f_k$ is not a sum of squares in $\mathcal{R}^k(\R^n)$ for any $n \geq 2$.
\end{thm}

Note that the function $f_k$ is actually $(2k-1)$-regulous.
\begin{remark}
In Dellzells PhD Thesis \cite{Delzell} he  showed that the set of bad points of a nonnegative polynomial on $\R^n$ has codimension at least 3. The above result shows that the set of bad points of a nonnegative $k$-regulous function on $\R^n$ for $k\geq 1 $ and $n\geq 2$ can have codimension equal to  2.
\end{remark}

 \subsection{Higher Pythagoras numbers for the rings $\RR^k(\R^n)$}
 Consider the vector space $ \R[x_1,x_2,\dots,x_n]_{2kd}$ of homogeneous polynomials of degree $2kd$ in $n$ variables. Elements of this vector space are also called $n$-ary $2kd$-ics. Even though the Pythagoras numbers are usually defined for rings, it makes perfect sense to define them for the above vector space.

 \begin{df}
 Define $p_{2d}(n,2kd)$ to be the least positive integer $g$ such that any sum of $2d$th powers of $n$-ary $k$-ics can be presented as a sum of at most $g$ $2d$th powers of $n$-ary $k$-ics. If such number does not exist we put $p_{2d}(n,2kd)=\infty$.
 \end{df}

It follows from the Caratheodory Theorem \cite[Proposition 2.3]{Reznick} that the following formula holds
$$   p_{2d}(n,2kd)\leq {{n+2kd-1}\choose{n-1}}$$
(see \cite{Reznick} for the $p_{2d}(n,2d)$ which is $T(n,m)$ in Reznick's notation).

\begin{thm}
Let $k,d\geq 1$ and $n\geq 2$ be positive integers. Then the $2d$th Pythagoras number of $\RR^k(\R^n)$ satisfies
$$p_{2d}(n,2kd)\leq p_{2d}(\RR^k(\R^n)).$$
\begin{proof}
Follows from Theorem \ref{Sos l}
\end{proof}
\end{thm}
Properties of numbers $p_{2d}(n,2kd)$ are yet to be developed.
\begin{remark}\label{remark d=1}
Let $d=1$ and $n>2$. It is known that $p_2(n, 2k)$ tends to infinity as $k$ tends to infinity. This is because $p_2(\R[x_1,x_2,\dots, x_n])=\infty$ for $n\geq 2$. In particular for a fixed $n\geq 3$ the numbers $p_2(\RR^k(\R^n))$ tend to infinity as $k$ tends to infinity. Hence if these numbers are finite, they can be arbitrarily large. Also, since $\R(x_1, x_2, \dots, x_n)$ is the field of fractions of $\RR^k(\R^n)$ we have the following inequality
$$\max (n+2, p_2(n,2k))\leq  p_2(\RR^k(\R^n)).$$

Another important case occurs for $k=1$. By (cf. \cite[Section 4]{Reznick 2}) we have a lower bound given by
$${n+d-1\choose{n-1}} \leq p_{2d}(\RR^1(\R^n)).$$

\end{remark}

\begin{remark}

It is worth noting that for $n=2$ and $d=1$ the above Theorem gives us nothing since $p_2(2,2k)=2$, for any $k>0$.

However, as a consequence of \cite{Cassels}, the Motzkin polynomial $$M(x,y)=1+x^2y^2(x^2+y^2-3)$$ can be written as a sum of precisely 4 regular functions, hence $$4 \leq p_2( \RR^k(\R^2))$$
for $k\geq 0$.
\end{remark}

 \begin{remark}
 Apart from asking whether the numbers $p_{2d}(\RR^k(\R^n)))$ are finite for $n\geq 2$, $k\geq 1$ and $d>1$  it is interesting to ask different question. Does the following formula
 $$ \limsup_{k\rightarrow \infty}p_{2d}(\RR^k(\R^n)))=\infty$$
holds?

 This would easily follow from the following
 $$ \limsup_{k\rightarrow \infty}p_{2d}(n, 2kd)=\infty.$$
 The last limit is equivalent to $p_{2d}(\R[x_1,\dots, x_n])=\infty$. Problem of computing $p_{2d}(\R[x_1,\dots, x_n])$ is stated as a Problem 8 in \cite{CLDR}. To the authors best knowledge, this problem still remains open.
 For $d=1$ the above holds.

 \end{remark}

\subsection{Modified Pythagoras numbers.}
In the literature, one can find some modifications of the Pythagoras number. Let $A$ be a ring and $a$ be an element of $A$.  Consider the following length
$$\overset{\smile}{l}(a)= \inf \{ n \ | \ a^{2r+1} \  \text{is a sum of n squares, for some positive integer r} \}$$
and the modified Pythagoras number (as suggested by Pfister in \cite{Mahe})
$$\overset{\smile}{P}(A)=\sup \{\overset{\smile}{l}(a) \ | \ \text{a is a sum of squares} \}.$$

We will prove the following
\begin{thm}\label{pyth modified}   Let $k \geq 0$ and $n\geq 2$ be integers. Then the modified Pythagoras number of the ring of $k$-regulous functions on an  affine $k$-regulous variety $X$ of dimension $n$ satisfies
$$\overset{\smile}{P}(\RR^k(X))\leq 2^n.$$
Furthermore, for every nonnegative $k$-reguluos function $f$ we have
$$\overset{\smile}{l}(f)\leq 2^n.$$
\end{thm}
Before we prove the Theorem, recall the Łojasiewicz property (see. \cite[Lemme 5.1]{4xfr} for the case $X=\R^n$).

\begin{prop}
Let $f$ be a $k$-regulous function on $X$ and $g$ be a $k$-regulous function on $U$, where $U$ is the complement of the zero set of $f$. Then there exists a positive integer $N$ such that the function $f^Ng$ is a $k$-regulous function on $X$.

\begin{proof}
Follows from Proposition \ref{localization}.
\end{proof}
\end{prop}
\emph{Proof of Theorem \ref{pyth modified} }
Let $f$ be a nonnegative $k$-regulous function on $X$ and let $Z$ be the zero set of $f$. Then $f$ is a totally positive unit on $U=X\setminus Z$. Hence by Theorem \ref{Mahe} we get an equality $f|_U=\sum_{i=1}^{2^n} f_i^2$, where each $f_i$ is a $k$-regulous function on $U$. By the Łojasiewicz property, there exists a positive integer $N$ large enough, such that $f_if^N$ is a $k$-regulous function on $X$, for each $i$. This implies the equality
$$f^{2N+1}=\sum_{i=1}^{2^n}(f^Nf_i)^2$$
on $X$, which finishes the proof.

\section{Case of positive definite forms.}
In the last section, we will be dealing with the problem of representing a quotient of two positive definite forms as a sum of $2d$th powers of $k$-regulous functions.
Let us recall that a homogeneous form of degree $2d$ is positive definite if it vanishes only at the origin.
We start with an easy exercise

\begin{lemma}
Let $q$ be a positive definite form of degree $2d$. Let $x^\alpha$ be a monomial in $x_1,x_2, \dots, x_n$ of degree k, such that $k-2d-1 \geq 0$. Then the following function $f$ is $(k-2d-1)$-regulous
$$f=\frac{x^\alpha}{q}.$$
\begin{proof}
Follows from the application of the spherical coordinates.
\end{proof}
\end{lemma}

\begin{thm}\cite[Third Theorem]{Reznick}\label{Reznick}
Let $p$ and $q$ be positive definite forms on $\R^n$. Assume that the rational function $\frac{p}{q}$ is homogeneous of degree $2kd$. Then, it can be written as a sum of $2d$th powers of rational functions whose denominator is a product of powers of $q$ and $(x_1^2+x_2^2+\dots + x_n^2)$.
\end{thm}

The two above results above immediately imply
\begin{thm}
With the assumptions of Theorem \ref{Reznick}, the rational function $\frac{p}{q}$ can be written as a sum of $2d$th powers of $(k-1)$-regulous functions on $\R^n$. In particular, $\frac{p}{q}$ is a sum of squares of functions of class at least $\mathcal{C}^{kd-1}$.
\end{thm}

\begin{remark}
In the paper \cite{Kucharz 2} Kucharz introduced the notion of $k$-regulous Nash function. It is a straightforward calculation, that the results of this paper holds also for $k$-regulous Nash functions on $\R^n$.
\end{remark}

In the paper \cite{Laraki}, Laraki and Lasserre considered a problem of finding a minimum of finitely many rational functions on basic semialgebraic set $K$. However the denominators of the rational functions were assumed to be strictly positive on $K$. Also, applications to various finite games, such as, standard static games, Loomis games, finite absorbing games were given. The authors believe that studying sums of squares of $k$-regulous functions can lead to further development in optimization and game theory.

config: arxiv


TITLE: Eigenvalue of a special random matrix?
QUESTION [3 upvotes]: Given a $n \times n$ symmetric random matrix whose diagonal elements are $1$, and the elements of $k\times k, k<n$ leading principal sub-matrix are $1$. All other values are i.i.d. uniformly randomly drawn from $[0,1]$.
For example, it could look like $\left( {\begin{array}{*{20}{c}}
  1&1&*&* \\
  1&1&*&* \\
  *&*&1&* \\
  *&*&*&1
\end{array}} \right)$, where "$*$" is a decimal uniformly drawn from [0,1].
Anyone knows what this type of random matrix this, and its eigenvalue distribution, and the probability that its largest eigenvalue are bigger than $\frac{n}{2}$? Anyone can provide any reference to solve this problem? Thanks!

PS: I have been looking into random matrix materials, and they seem to assume Gaussian random matrix rather than this drawn from uniform. In Gaussian case the eigenvalue distribution is semi-circle.
PS2: I find this simulation. If every element is uniform from [0,1], a simulation shows the eigenvalue is possibly still semi-circle. https://blogs.sas.com/content/iml/2012/05/16/the-curious-case-of-random-eigenvalues.html. I am still searching proof for this simpler case. Our case is more complicated with the top-left principal sub-matrix has all its elements being 1.

REPLY [1 votes]: Let $A$ be your matrix.
If $e$ is the vector of all $1$'s, the greatest eigenvalue of $A$ is at least
$\dfrac{e^T A e}{e^T e} =\dfrac{e^T A e}{n}$.  Now $e^TAe$  is the sum of the entries of $A$, which  $\ge n^2/2$ with probability $> 1/2$ (since the sum of the entries that are not fixed at $1$ has a symmetric distribution about its mean).


TITLE: Let $E_1=\mathbb{Q}(\alpha)$ and $E_2=\mathbb{Q}(\beta)$ show that $[E_1E_2:E_1]=2$ where $\alpha,\beta$ be the real and complexroot of 2 respectively
QUESTION [0 upvotes]: I am studying  lang undergraduate algebra,  field theory where this example is given.
Now I understand how $E_1 \cap E_2=\mathbb{Q}$. As we have $ \mathbb{Q} \subset E_1 \cap E_2 \subset E_1$. And we have $[E=\mathbb{Q(\alpha)}: \mathbb{Q}]=3$ since the basis of vector space $E_1$ over $\mathbb{Q}$ is ${1,\alpha, \alpha^2}$. So now $[E_1:\mathbb{Q}]=[E_1 : E_1 \cap E_2][E_1 \cap E_2 :\mathbb{Q}] \implies 3= [E_1 : E_1 \cap E_2][E_1 \cap E_2 :\mathbb{Q}]$. So that's why $[E_1 : E_1 \cap E_2] \ \vert \ 3$, since $E_1 \neq E_2$ $[E_1 : E_1 \cap E_2] \neq 1$ so $[E_1 \cap E_2 :\mathbb{Q}] =1$ and $E_1 \cap E_2 =\mathbb{Q}$.
Now $\mathbb{Q} \subset E_1 \subset E_1E_2$ so $[E_1E_2 : \mathbb{Q}]=[E_1E_2:E_1][E_1:\mathbb{Q}]$. So $[E_1E_2:E_1] =\frac{[E_1E_2 : \mathbb{Q}]}{3}$.But at the end I don't understand how they come to conclusion that $[E_1E_2:E_1]=2$. How they have calculate $[E_1E_2=\mathbb{Q}(\alpha,\beta)=\mathbb{Q}(\alpha,\sqrt(-3) : \mathbb{Q}]=6$. Any help is appreciated thanks.

REPLY [1 votes]: Since $\alpha$ has minimal polynomial $x^3-2$ and $\sqrt{-3}$ has the minimal polynomial $x^2+3$, the combined degree of the extension is $2\times 3=6$.
This calculation implicitly uses $\Bbb Q(\alpha,\sqrt{-3})\cong\Bbb Q(\alpha)(\sqrt{-3})$ and we compute the degrees one at a time:
$$6=\underset{2}{\underbrace{[\Bbb Q(\alpha,\sqrt{-3}):\Bbb Q(\alpha)]}}\cdot\underset{3}{\underbrace{[\Bbb Q(\alpha):\Bbb Q]}}$$


TITLE: How to tell whether the ranges of two matrices intersect
QUESTION [3 upvotes]: Assume that we have two matrices over the complex field i.e. $A\in\mathbb{C}^{m\times n_1}$ and $B\in\mathbb{C}^{m\times n_2}$.
Let their range spaces be the sets
$$R(A)=\{A\mathbf{x}|\mathbf{x}\in\mathbb{C}^{n_1}\}$$
and
$$R(B)=\{B\mathbf{x}|\mathbf{x}\in\mathbb{C}^{n_2}\}$$
respectively.
I want to know if there is a systematic way to tell whether the range spaces have common elements. I am trying to check this in Matlab thus I am trying to find an algorithm.
In other words if the columns are s.t. $A=\begin{bmatrix}\mathbf{a}_1&\dots&\mathbf{a}_{n_1}\end{bmatrix}$ and $B=\begin{bmatrix}\mathbf{b}_1&\dots&\mathbf{b}_{n_2}\end{bmatrix}$ how to tell if the following is true
$$\sum_{i=1}^{n_1}x_i\mathbf{a}_i=\sum_{i=1}^{n_2}y_i\mathbf{b}_i\Leftrightarrow x_i=y_i=0 \text{ for all }i$$
The matrices are fixed, so I am not looking for a way to construct them.

REPLY [2 votes]: Take the matrix $C\colon=[A|B] \in \mathbb{C}^{m\times (n_1+n_2)}$. Then the dimension of the intersection of the ranges of $A$ and $B$ equals
$$\operatorname{rank}(A)+\operatorname{rank}(B)-\operatorname{rank}(C)$$
You can determine the rank of a matrix in MATLAB.


TITLE: Clarification regarding length of confidence intervall
QUESTION [0 upvotes]: I'm having trouble with a problem, where I can't understand how my textbook's answer makes sense:
An architect is measuring the distance between two points. Each value can be seen as an observation of a normal-distributed variable, with $\mu$ as expectation value and std $\sigma = 2.04$ meters. The architect performs $n=16$ measurements and finds the average $\bar{x} = 2316$ meter.
Create a 95% confidence-interval for the real distance $\mu$
Vi create a $Z$-interval.
$Z_{\alpha/2} = Z_{0.05/2} = 1.960$
$[\bar{X}-Z_{\alpha/2}*\frac{\sigma}{\sqrt{n}}, \bar{X}+Z_{\alpha/2}*\frac{\sigma}{\sqrt{n}} ]$
$\bar{X}\pm Z_{\alpha/2}*\frac{\sigma}{\sqrt{n}} = 2316 \pm 1.960 * \frac{2.04}{\sqrt{16}} = [2315,2317]$
How many measurements must the architect do so that the length of the confidence-interval is 0.2 meters?
Using Length rule for Z-intervals:
$n \ge (\frac{2*Z_{\alpha/2} * \sigma}{L})^2 (\frac{2*1.1960*2.04}{0.2})^{2} = 595$
I also tried:
$L = 2* Z_{\alpha/2} * \frac{\sigma}{\sqrt{n}} = 2\cdot1.196\cdot\frac{2.04}{\sqrt{16}} = 1.21$
$n \ge (\frac{2*Z_{\alpha/2} * \sigma}{L})^2 = n \ge (\frac{2*1.1960 * 2.04}{1.21})^2 = 16.263$
However, my textbooks answer is: Requires $L<0.2M$ Therefore: $n \ge 1599$.
Thus my question is what am I doing wrong?
I would highly appreciate any answer.

REPLY [0 votes]: Solved:
There was a misplaced number in $1.196$ which really should be $1.96$
Thanks to @Caran-d'Ache


TITLE: On derivatives...
QUESTION [0 upvotes]: I have a quick question here. I hope someone can help. I haven't done calculus for a long time so I seem to missed out on details.
If $x=g^{-1}(y)$ and $g$ is monotonic and is differentiable for all $x$, how did it happen that $$\frac{d}{dy}g^{-1}(y)=\frac{1}{dg(x)/dx}|_{x=g^{-1}(y)}$$
I tried to reason out that $$\frac{d}{dy}g^{-1}(y)=\frac{d}{dx}\frac{dx}{dy}x=\frac{dx}{dy}$$ But I do not know where to proceed. I hope someone helps. Thanks.

REPLY [3 votes]: Highlights:
$$y=g(x)\implies x=g^{-1}(y)$$
so let us denote $\;g(x_0):=y_0\;$ , and assuming what must be assumed (what? For example, $\;g'(x_0)\neq 0\;$ ...!) , we get:
$$\frac{d}{dy}g^{-1}(y_0):=\lim_{y\to y_0}\frac{g^{-1}(y)-g^{-1}(y_0)}{y-y_0}=\lim_{g(x)\to g(x_0)}\frac{x-x_0}{g(x)-g(x_0)}=\frac1{g'(x_0)}$$
since, by continuity of $\;g^{-1}\;$ , we have that $\;g(x)=y\to y_0=g(x_0)\implies x\to x_0\;$


TITLE: Finding a distinguished open set in the intersection of two $\operatorname{Spec}$s
QUESTION [1 upvotes]: I am trying to follow the answers to this question about an intersection of affine open sets being covered by affine open sets.  However, I can't seem to figure out why given $\operatorname{Spec} A \cap \operatorname{Spec} B$, it is possible to find a distinguished open set $D_{A}(f) \subseteq \operatorname{Spec} A \cap \operatorname{Spec} B$.  How would one show this?

REPLY [2 votes]: Note that $\operatorname{Spec} A$ is open, as is $\operatorname{Spec} B$, so their intersection $\operatorname{Spec} A \cap \operatorname{Spec} B$ is again open. This means that the complement of $\operatorname{Spec} A \cap \operatorname{Spec} B$ inside either $\operatorname{Spec} A$ or $\operatorname{Spec} B$ is closed in that particular affine patch, and therefore one may pick a function $f$ which is zero on it and take $D_A(f)$.