Given is $R$ an integral domain. With $P$ we will denote the subset of the irreducible elements of $R$, such that for every irreducible $x\in R$ exactly one element of $\left \{ ux\mid u\in R^{\times } \right \}$ lies in $P$. Show that $R$ is a UFD if and only if for every nonzero $c\in R$ there exists a unique unit $u\in R^{\times }$ and function $f:P\rightarrow \mathbb{N}$ with $\left \{ p\in P\mid f(p)\neq 0 \right \}$ finite, such that $c=u\prod_{p\in P;f(p)\neq 0}p^{f(p)}$.
I am trying to prove this statement, but i don't really know how to do start in this case. All this looks like the Fundamental theorem of arithmetic, but it says that every integer is a product of prime numbers. In my case i have an arbitraty integral domain $R$ and i am not sure if it makes sense to try to prove the statement in case of $\mathbb{Z}$...
May i ask you for some help with this proof? Thank you in advance!
Every prime element of a commutative ring is irreducible. Therefore the implication $\Rightarrow$ is just the definition of a UFD.
To prove the implication $\Leftarrow$ ist suffices to show that every element of $P$ is prime. So assume $p\in P$ divides a product $ab$ of ring elements, and consider the factorizations of $a$ and $b$.