\documentclass[10pt]{amsart}
\usepackage{amsmath,amsthm,amsfonts,latexsym,amssymb,amscd,xcolor}
\usepackage[edges]{forest}
\pagestyle{headings}
\setlength{\textwidth}{468true pt}
\setlength{\headheight}{0true pt} % needed for 12pt documents
\setlength{\oddsidemargin}{0 truept}
\setlength{\evensidemargin}{0 truept}
\setlength{\textheight}{580true pt}

\begin{document}


\noindent
{\bf Solutions to HW 7.}

\bigskip
  
\begin{enumerate}
\item[1.] This problem concerns the formal sentence
    $$(\forall x)(\forall y)((((\exists z)(x=z^2))\wedge
    ((\exists z)(y=z^2)))\to 
    ((\exists z)(x+y=z^2))).$$
\begin{enumerate}
\item[(a)] Draw the formula tree for this sentence.

  \color{blue} [Two Latex versions! The first uses ``tikz''
  and the second uses the ``forest'' package.]

\setlength{\unitlength}{1truemm}
\begin{picture}(100,65)
\put(10,0)
{
\begin{tikzpicture}[scale=1]
\draw [fill] (0,0) circle [radius=0.1];
\draw [fill] (0,1) circle [radius=0.1];
\draw [fill] (1,2) circle [radius=0.1];
\draw [fill] (2,0) circle [radius=0.1];
\draw [fill] (2,1) circle [radius=0.1];
\draw [fill] (2,3) circle [radius=0.1];
\draw [fill] (2,4) circle [radius=0.1];
\draw [fill] (2,5) circle [radius=0.1];
\draw [fill] (3,1) circle [radius=0.1];
\draw [fill] (3,2) circle [radius=0.1];

\draw[line width=1.2pt] (0,0) -- (0,1) -- (1,2) -- (2,3) -- (2,4) -- (2,5);
\draw[line width=1.2pt] (2,0) -- (2,1) -- (1,2);
\draw[line width=1.2pt] (3,1) -- (3,2) -- (2,3);

\node at (2.5,5){$\forall x$};
\node at (2.5,4){$\forall y$};
\node at (2.5,3){$\to$};
\node at (.6,2.1){$\wedge$};

\node at (-.5,1){$\exists z$};
\node at (1.5,1){$\exists z$};
\node at (3.5,2){$\exists z$};

\node at (0,-.5){$x=z^2$};
\node at (2,-.5){$y=z^2$};
\node at (3.3,.6){$x+y=z^2$};
\end{tikzpicture}
}
\put(80,10)
{\small
\begin{forest}
  [$\forall x$
    [$\forall y$
      [$\to$
        [$\land$
          [$\exists z$
            [{$x = z^2$}]][$\exists z$
            [{$y = z^2$}]]][$\exists z$[{$x + y = z^2$}]]]]]]
\end{forest}
}
\end{picture}
\color{black}

\bigskip

\item[(b)] Standardize the variables apart.

\color{blue}
\begin{center}
{\scriptsize
\begin{forest}
  [$\forall x$
    [$\forall y$
      [$\to$
        [$\land$
          [$\exists \color{red}u\color{blue}$[{$x = \color{red}u\color{blue}^2$}]]
          [$\exists \color{red}v\color{blue}$[{$y = \color{red}v\color{blue}^2$}]]]
        [$\exists z$[{$x + y = z^2$}]]]]]]
\end{forest}
}
\end{center}
\color{black}
\bigskip


\item[(c)] Write the sentence in prenex form.

\color{blue}
\begin{center}
{\scriptsize
\begin{forest}
  [$\forall x$
    [$\forall y$
      [$\forall u$
        [$\forall v$
          [$\exists z$
            [$\to$
              [$\land$
          [{$x = u^2$}]
          [{$y = v^2$}]]
        [{$x + y = z^2$}]]]]]]]]
\end{forest}
}
\bigskip

$(\forall x)(\forall y)(\forall u)(\forall v)(\exists z)(((x=u^2)\wedge(y=v^2))\to(x+y=z^2))$

\end{center}

\color{black}

\end{enumerate}
\end{enumerate}

\bigskip

\begin{enumerate}
\item[2.]
This problem also concerns the formal sentence
from Problem 1.
\begin{enumerate}
\item[(a)] Is the sentence true in the natural numbers, $\mathbb N$?
  \color{blue}No! \color{black}

Give a winning strategy for the appropriate quantifier.
    \color{blue}(Appropriate quantifier is $\forall$.) \color{black}
\end{enumerate}
\medskip

\color{blue}
\begin{itemize}
\item $\forall$ chooses $x=1$.
\item $\forall$ chooses $y=1$.
\item $\forall$ chooses $u=1$.
\item $\forall$ chooses $v=1$.
\item   To win, $\exists$ would have to choose $z$ so that
  $z^2=2$. There is no such $z\in \mathbb N$, so $\exists$ loses.
\end{itemize}
\color{black}

\medskip

\begin{enumerate}
\item[(b)] Is the sentence true in the real numbers, $\mathbb R$?
  \color{blue}Yes! \color{black}  

  Give a winning strategy for the appropriate quantifier.
    \color{blue}(Appropriate quantifier is $\exists$.) \color{black}  
\end{enumerate}
\medskip

\color{blue}
\begin{itemize}
\item $\forall$ chooses any $x$.
\item $\forall$ chooses any $y$.
\item $\forall$ chooses any $u$.
\item $\forall$ chooses any $v$.
  \medskip

  $\forall$ has already lost, unless the choices made
  satisfy $x=u^2$ and $y=v^2$, so assume that these equalities hold.

  \medskip
  
\item   To win, $\exists$ would have to choose $z$ so that
  $z^2=x+y = u^2+v^2$. So $\exists$ can win by choosing
  $z=\sqrt{u^2+v^2}$. This choice is possible, since
  in $\mathbb R$ squares are nonnegative,
  so $u^2, v^2\geq 0$. Also, in $\mathbb R$, a sum of nonnegative
  numbers is nonnegative, from which we get $u^2+v^2\geq 0$.
  Finally, any nonnegative real number has a real square root,
  so it is possible to choose a real number $z$
  satisfying $z = \sqrt{u^2+v^2}$.
\end{itemize}
\end{enumerate}
\color{black}
\medskip

\begin{enumerate}
\item[3.] Negate the sentence from Problem 1 and then rewrite the negation so that it is in prenex form.
%\end{enumerate}
\medskip

\[
\color{purple} \neg
\color{teal}(\forall x)\;(\forall y)\;(\forall u)\;(\forall v)\;(\exists z)\;
\color{blue}(((x=u^2)\wedge(y=v^2))\to(x+y=z^2)).
 \]

\[
\color{teal}(\exists x)\;(\exists y)\;(\exists u)\;(\exists v)\;(\forall z)\;
\color{purple} 
\neg\color{blue}(((x=u^2)\wedge(y=v^2))\to(x+y=z^2)).
\]

\noindent
You can take this further, if you choose:

\[
\color{teal}(\exists x)\;(\exists y)\;(\exists u)\;(\exists v)\;(\forall z)\;
\color{blue}(((x=u^2)\wedge(y=v^2))\wedge \color{purple} 
\neg \color{blue}
(x+y=z^2)).
\]
\end{enumerate}  
\color{black}

\vfill
\vfill
\end{document}
