Localization Preserves Euclidean Domains I'm wanting to prove that given a ring $A$ (by "ring" I mean a commutative ring with identity) and a multiplicative subset $S \subset A$: 

if $A$ is an Euclidean Domain, and $0 \notin S$ then $S^{-1}A$ (localization of A at S) is also an Euclidean Domain.

I'm trying to produce an Euclidean Function in $S^{-1}A$ using the Euclidean Function $N:A \rightarrow \mathbb{N}$, that I already have from $A$ but I'm having trouble trying to define it in a way that works and verifies the properties an Euclidean Function must verify.
Does any one mind giving me hints? I don't really want a solution.. I would like to work it myself.
Thanks in advance. :) 
 A: In wikipedia's language, we may assume that $N$ satisfies $N(a)\le N(ab)$ for $a,b\in A$. Let us denote the candidate function for the localization by $N_S\colon (S^{-1}A)\setminus\{0\}\to\mathbb N$.
We will also replace $S$ by its saturation, i.e. by $S_{\mathrm{sat}}:=\{ a\in A \mid \exists b\in A: ab\in S\}$. Notice that $S_{\mathrm{sat}}^{-1}A=S^{-1}A$ because for any $a\in S_{\mathrm{sat}}$, we have $a^{-1}=\frac{b}{s}\in S^{-1}A$ where $b\in A$ and $s\in S$ are such that $s= ab$. Hence, assume henceforth that $S$ is saturated in the sense that for any $a\in A$, if there exists some $b\in A$ with $ab\in S$, then we have $a\in S$.
Hint:

First, note that you may assume $N_S(s)=1$ for all $s\in S$. Indeed, for any $a\in S^{-1}A$, you have $N_S(s)\le N_S(\frac as\cdot s)=N_S(a)$. Hence, $N_S(s)$ must be minimal. Argue similarly that $N_S(\frac 1s)=1$ for $s\in S$. Now use the fact that $A$ is a unique factorization domain. 

Full spoiler, hover for reveal:

 We first note that an Element $s\in S$ can not have any prime factor in $A\setminus S$. Indeed, let $s=s_1\cdots s_n$ be the prime factors of $s$. Then, $s_1\in S$ and $s_2\cdots s_n\in S$ because $S$ is saturated. Proceed by induction.
 
 For $\frac{ta}{s}\in S^{-1}A$, with $t,s\in S$ and $a$ not divisible by any element of $S$, let $N_S\left(\frac{ta}{s}\right):=N(a)$. This is well-defined because if $\frac{t_1a_1}{s_1}=\frac{t_2a_2}{s_2}$, then $s_1t_2a_2=s_2t_1a_1$. Since $a_1$ is not divisible by any element of $S$, it contains no prime factor in $S$. Since $s_2t_1\in S$, it contains no prime factor in $A\setminus S$. This argument symmetrically works for $s_1t_2\cdot a_1$ and it follows that $s_1t_2=s_2t_1$ and (more importantly) $a_1=a_2$.
 
 Now we prove that $N_S$ yields a degree function turning $S^{-1}A$ into a Euclidean ring. Given $\frac{t_1a_1}{s_1},\frac{t_2a_2}{s_2}\in S^{-1}A$, we perform division with remainder $s_2t_1a_1 = qa_2 + r$ such that either $r=0$ or $N(r)<N(a_2)$. Hence, $$\frac{t_1a_1}{s_1} = \frac{q}{s_1t_2}\cdot \frac{t_2a_2}{s_2} + \frac{r}{s_1s_2}$$ and we have $N_{S}\left(\frac r{s_1s_2}\right)=N(r)<N(a_2)=N\left(\frac{t_2a_2}{s_2}\right)$.

