Syntactic Confectionery Delight  
PerlMonks 
Re^3: Illegal Modulus zeroby ambrus (Abbot) 
on May 21, 2005 at 07:39 UTC ( #459206=note: print w/replies, xml )  Need Help?? 
The restriction in other rings is indeed that
z = x % y such that
( The point is that, if you can define modulus and a norm in such a way, then the ring is a principial ideal ring, and thus, a UFD. (The proof goes this way: norm and remainder => gcd => all ideals are principial => every irreducible elements are prime => unique factorisation.) This is one of the most common proofs you can prove the Fundamental Theorem of arithmetic, that is, the fact that every integer can be decomposed to the product of primes.
The rings where you can define remainder in such a way are called Euclidean rings. Some other restrictions are necessary too, I'm not sure in the exact conditions, but I think it suffices that the ring must be Noetherian, commutative integral domain; and the norm must be positive integer valued (on all nonzero elements of the ring), multiplicative, and only the units can have norm 1; and for every a and 0 != b, there exists a p and q such that a = p * b + q, and norm(q) < norm(b). Note however that not all principial domains are Euclidean, and not all UFDs are principial domains. Here are some simple examples (but I am likely to make errors here, so correct me if you think I'm wrong, and this is true for the above part too). Z, Z[i], Z[(1+sqrt(3)i)/2], Z[sqrt(2)], and Q[x] are Euclidean rings so UFDs too. Z[x] is not a Euclidean ring, but it is nevertheless an UFD, which can be proved from the Gausslemma (or one of the theorems called Gausslemma at least:). Z[sqrt(3)] is not a Euclidean ring, and is not UFD either: 4 = 2 * 2 = (1 + sqrt(3)i)(1  sqrt(3)i). There's some interesting issue with multivariate polynomials, but I don't quite know what it is. I list two very good books on the topic below. As this material is available in Hungarian, I cannot give you any English titles. (You can try to look in Mathworld though.)
In Section
Seekers of Perl Wisdom

