Description: Define the class of unique factorization domains. A unique factorization domain (UFD for short), is an integral domain such that every nonzero prime ideal contains a prime element (this is a characterization due to Irving Kaplansky). A UFD is sometimes also called a "factorial ring" following the terminology of Bourbaki. (Contributed by Mario Carneiro, 17-Feb-2015) Exclude the 0 prime ideal. (Revised by Thierry Arnoux, 9-May-2025) Exclude the 0 ring. (Revised by Thierry Arnoux, 14-Jun-2025)