\documentclass[11pt]{article}
\usepackage{fullpage}
\usepackage{amssymb,amsfonts,amsmath,amsthm} 
\usepackage[margin= 1in]{geometry}
\usepackage{url}

\usepackage{enumerate}
\usepackage{color}
\usepackage[pdftex]{graphicx}
\usepackage{lastpage}
\usepackage{mathptmx}

\newtheorem{thm}{THEOREM}[]
\newtheorem{lem}[thm]{LEMMA}
\newtheorem{cor}[thm]{COROLLARY}
\newtheorem{prop}[thm]{PROPOSITION}
\newtheorem{as}[thm]{ASSUMPTION}
\newtheorem{conjecture}[thm]{Conjecture}
\newtheorem{claim}[thm]{CLAIM}
\theoremstyle{definition}
\newtheorem{defi}[]{DEFINITION}
\theoremstyle{definition}
\newtheorem{remark}[thm]{REMARK}
\newtheorem{fact}[thm]{Fact}
\newtheorem{ex}[thm]{Example}

\setlength{\parindent}{0cm}

\newcommand{\tab}{\hspace{3ex}}
\newcommand{\R}{\mathbb{R}}

\usepackage{titlesec}
\usepackage{sectsty}
\hyphenchar\font=-1

\sectionfont{  \normalsize	\sectionrule{0pt}{0pt}{-5pt}{0.05pt}
	}

\titleformat*{\section}{ \Large  \center}
\titleformat{\subsection}[runin]
               {\normalfont\bfseries }
               {}{0em}{}[.]
               
\titlespacing{\section}
               {\parindent}{0pt}{5pt}
\titlespacing{\subsection}
               {0pt}{2ex plus .1ex minus .2ex}{5pt} 
               
               
               \makeatletter
 \renewcommand{\@evenfoot}{%
   Page \thepage{} of \pageref{VeryLastPage} \hfil
    
 }
 \renewcommand{\@oddfoot}{\@evenfoot}
 \makeatother

               
\begin{document}

\begin{center}
{\huge  \sc   Homework 6} \\
\smallskip
{ Due Date: 05/10/2022}\\
\smallskip
{Name:  }\\
{\large  }
\end{center}
\vspace{1cm}



\begin{enumerate}

\item[18.1] Which of the following relations are equivalence relations on the given set $S$?
\begin{enumerate}
\item $S=\mathbb{R}$ and $a\sim b \Leftrightarrow a=b$ or $a=-b$.

\item $S=\mathbb{Z}$ and $a\sim b \Leftrightarrow ab=0$.


\item $S=\mathbb{R}$ and $a\sim b \Leftrightarrow a^2+a=b^2+b$.

\item $S$ is the set of all people in the world, and $a\sim b$ means $a$ lives within 100 miles of $b$. 

\item $S$ is the set of all points in the plan, and $a\sim b$ means $a$ and $b$ are the same distance from the origin. 

\item $S=\mathbb{N}$ and $a\sim b \Leftrightarrow ab$ is a square.

\item $S=\{1,2,3 \}$, and $a\sim b \Leftrightarrow a=1$ or $b=1$.

\item $S=\mathbb{R}\times\mathbb{R}$, and $(x,y)\sim (a,b) \Leftrightarrow x^2+y^2=a^2+b^2$.

\newpage


\end{enumerate}
\newpage
\item[18.2] For those relations in Exercise 1 that are equivalence relations, describe the equivalence classes. 

\newpage 


    \item[18.3] By producing suitable examples of relations, show that it is not possible to deduce any one of the properties of being reflexive, symmetric or transitive from the other two. 
    
   
\newpage

\item[18.4] Prove that if $S$ is a set and $S_1,\ldots S_k$ is a partition of $S$, then there is a unique equivalence relation $\sim$ on $S$ that has the $S_i$ as its equivalence classes. 

\newpage
\item [18.6] Let $S=\{1,2,3,4 \}$, and suppose that $\sim$ is an equivalence relation on $S$. You are given the information that $1\sim2$ and $2\sim3$. 

\newpage 

\item[18.7] Let $\sim$ be an equivalence relation on $\mathbb{Z}$ with the property that for all $m\in\mathbb{Z}$ we have $m\sim m+5$ and also $m\sim m+8$. Prove that $m\sim n$ for all $m,n\in \mathbb{Z}$. 

\newpage 

\item[19.1]For each of the following functions $f$, say whether $f$ is 1-1 and whether $f$ is onto:
\begin{enumerate}
    \item $f:\mathbb{R}\rightarrow \mathbb{R}$ defined by $f(x)=x^2+2x$ for all $x\in\mathbb{R}$.
    
    \item $f:\mathbb{R}\rightarrow \mathbb{R}$ defined by 
    \[
    f(x)=\left\{\begin{array}{l}
        x-2,\text { if } x>1 \\
        -x , \text { if }-1 \leq x \leq 1 \\
        x+2, \text { if } x<-1
\end{array}\right.
    \]
    
    \item $f:\mathbb{Q}\rightarrow \mathbb{R}$ defined by $f(x)=(x+\sqrt{2})^2$.
    
    \item $f: \mathbb{N}\times  \mathbb{N}\times  \mathbb{N} $ defined b $f(m,n,r)=2^m3^n5^r$ for all $m,n,r \mathbb{N}$.
    
    \item $f: \mathbb{N}\times  \mathbb{N}\times  \mathbb{N} $ defined b $f(m,n,r)=2^m3^n6^r$ for all $m,n,r \mathbb{N}$.
    
    \item Let $\sim$ be the equivalence relation on $\mathbb{Z}$ defined by $a\sim b \Leftrightarrow a\equiv b \pmod(7)$ and let $S$ be the set of equivalence classes of $\sim$. Define $f:S\rightarrow S$ by $f(cl(s))=cl(s+1)$ for all $s\in \mathbb{Z}$.
\end{enumerate}
\newpage 

\item[19.3] Two functions $f,g:\mathbb{R}\rightarrow \mathbb{R}$,
\[
g(x)=x^2+x+3, \qquad  \text{ and} \qquad (g\circ f)(x)=x^2-3x+5.
\]

Find the possibilities of $f$.

\newpage 

\item[19.6] 

\begin{enumerate}

    \item Find an onto function from $\mathbb{N}$
    
    \item Find a $1-1$ function from $\mathbb{Z}$ to $\mathbb{N}$. 
    
    
\end{enumerate}


\end{enumerate}




\label{VeryLastPage}
\end{document}