mathematics
Definition and illustration First example: the integers
The most familiar example of a ring is the set of all integers, Z, consisting of the numbers
 ..., −4, −3, −2, −1, 0, 1, 2, 3, 4, ...^{[3]}
together with the usual operations of addition and multiplication. These operations satisfy the following properties:

The integers form an abelian group under addition; that is:
 Closure axiom for addition: Given two integers a and b, their sum, a + b is also an integer.
 Associativity of addition: For any integers, a, b and c, (a + b) + c = a + (b + c). So, adding b to a, and then adding c to this result, is the same as adding c to b, and then adding this result to a.
 Existence of additive identity: For any integer a, a + 0 = 0 + a = a. Zero is called the identity element of the integers because adding 0 to any integer (in any order) returns the same integer.
 Existence of additive inverse: For any integer a, there exists an integer denoted by −a such that a + (−a) = (−a) + a = 0. The element, −a, is called the additive inverse of a because adding a to −a (in any order) returns the identity.
 Commutativity of addition: For any two integers a and b, a + b = b + a. So the order in which two integers are added is irrelevant.

The integers form a multiplicative monoid (a monoid under multiplication); that is:
 Closure axiom for multiplication: Given two integers a and b, their product, a · b is also an integer.
 Associativity of multiplication: Given any integers, a, b and c, (a · b) · c = a · (b · c). So multiplying b with a, and then multiplying c to this result, is the same as multiplying c with b, and then multiplying a to this result.
 Existence of multiplicative identity: For any integer a, a · 1 = 1 · a = a. So multiplying any integer with 1 (in any order) gives back that integer. One is therefore called the multiplicative identity.

Multiplication is distributive over addition : These two structures on the integers (addition and multiplication) are compatible in the sense that
 a · (b + c) = (a · b) + (a · c), and
 (a + b) · c = (a · c) + (b · c)
 for any three integers a, b and c.
Formal definition
There are some differences in exactly what axioms are used to define a ring. Here one set of axioms is given, and comments on variations follow.
A ring is a set R equipped with two binary operations + : R × R → R and · : R × R → R (where × denotes the Cartesian product), called addition and multiplication. To qualify as a ring, the set and two operations, (R, +, · ), must satisfy the following requirements known as the ring axioms.^{[4]}
 (R, +) is required to be an abelian group under addition:

1. Closure under addition. For all a, b in R, the result of the operation a + b is also in R.^{c[›]} 2. Associativity of addition. For all a, b, c in R, the equation (a + b) + c = a + (b + c) holds. 3. Existence of additive identity. There exists an element 0 in R, such that for all elements a in R, the equation 0 + a = a + 0 = a holds. 4. Existence of additive inverse. For each a in R, there exists an element b in R such that a + b = b + a = 0 5. Commutativity of addition. For all a, b in R, the equation a + b = b + a holds.
 (R, ·) is required to be a monoid under multiplication:

1. Closure under multiplication. For all a, b in R, the result of the operation a · b is also in R.^{c[›]} 2. Associativity of multiplication. For all a, b, c in R, the equation (a · b) · c = a · (b · c) holds. 3. Existence of multiplicative identity.^{a[›]} There exists an element 1 in R, such that for all elements a in R, the equation 1 · a = a · 1 = a holds.
 The distributive laws:

1. For all a, b and c in R, the equation a · (b + c) = (a · b) + (a · c) holds. 2. For all a, b and c in R, the equation (a + b) · c = (a · c) + (b · c) holds.
This definition assumes that a binary operation on R is a function defined on R×R with values in R. Therefore, for any a and b in R, the addition a + b and the product a · b are elements of R.
The most familiar example of a ring is the set of all integers, Z = {..., −4, −3, −2, −1, 0, 1, 2, 3, 4, ... }, together with the usual operations of addition and multiplication.^{[3]}
Another familiar example is the set of real numbers R, equipped with the usual addition and multiplication.
Another example of a ring is the set of all square matrices of a fixed size, with real elements, using the matrix addition and multiplication of linear algebra. In this case, the ring elements 0 and 1 are the zero matrix (with all entries equal to 0) and the identity matrix, respectively.
Notes on the definition
In axiomatic theories, different authors sometimes use different axioms. In the case of ring theory, some authors include the axiom 1 ≠ 0 (that is, that the multiplicative identity of the ring must be different from the additive identity). In particular they do not consider the trivial ring to be a ring (see below).
A more significant disagreement is that some authors omit the requirement of a multiplicative identity in a ring.^{[5]}^{[6]}^{[7]} This allows the even integers, for example, to be considered a ring, with the natural operations of addition and multiplication, because they satisfy all of the ring axioms except for the existence of a multiplicative identity. Rings that satisfy the ring axioms as given above except the axiom of multiplicative identity are sometimes called pseudorings. The term rng (jocular; ring without the multiplicative identity i) is also used for such rings. Rings which do have multiplicative identities, (and thus satisfy all of the axioms above) are sometimes for emphasis referred to as unital rings, unitary rings, rings with unity, rings with identity or rings with 1.^{[8]} Note that one can always embed a nonunitary ring inside a unitary ring (see this for one particular construction of this embedding).
There are still other more significant differences in the way some authors define a ring. For instance, some authors omit associativity of multiplication in the set of ring axioms; rings that are nonassociative are called nonassociative rings. In this article, all rings are assumed to satisfy the axioms as given above unless stated otherwise. Second example: the ring Z_{4}
Consider the set Z_{4} consisting of the numbers 0, 1, 2, 3 where addition and multiplication are defined as follows (note that for any integer x, x mod 4 is defined to be the remainder when x is divided by 4):
 For any x, y in Z_{4}, x + y is defined to be their sum in Z (the set of all integers) mod 4. So we can represent the additive structure of Z_{4} by the leftmost table as shown.
 For any x, y in Z_{4}, x ⋅ y is defined to be their product in Z (the set of all integers) mod 4. So we can represent the multiplicative structure of Z_{4} by the rightmost table as shown.
·  0  1  2  3 

0  0  0  0  0 
1  0  1  2  3 
2  0  2  0  2 
3  0  3  2  1 
+  0  1  2  3 

0  0  1  2  3 
1  1  2  3  0 
2  2  3  0  1 
3  3  0  1  2 
It is simple (but tedious) to verify that Z_{4} is a ring under these operations. First of all, one can use the leftmost table to show that Z_{4} is closed under addition (any result is either 0, 1, 2 or 3). Associativity of addition in Z_{4} follows from associativity of addition in the set of all integers. The additive identity is 0 as can be verified by looking at the leftmost table. Given an integer x, there is always an inverse of x; this inverse is given by 4  x as one can verify from the additive table. Therefore, Z_{4} is an abelian group under addition.
Similarly, Z_{4} is closed under multiplication as the rightmost table shows (any result above is either 0, 1, 2 or 3). Associativity of multiplication in Z_{4} follows from associativity of multiplication in the set of all integers. The multiplicative identity is 1 as can be verified by looking at the rightmost table. Therefore, Z_{4} is a monoid under multiplication.
Distributivity of the two operations over each other follow from distributivity of addition over multiplication (and viceversa) in Z (the set of all integers).
Therefore, this set does indeed form a ring under the given operations of addition and multiplication.
Properties of this ring
 In general, given any two integers, x and y, if x ⋅ y = 0, then either x is 0 or y is 0. It is interesting to note that this does not hold for the ring (Z_{4}, +, ⋅):

 2 ⋅ 2 = 0
 although neither factor is 0. In general, a nonzero element a of a ring, (R, +, ⋅) is said to be a zero divisor in (R, +, ⋅), if there exists a nonzero element b of R such that a ⋅ b = 0. So in this ring, the only zero divisor is 2 (note that 0 ⋅ a = 0 for any a in a ring (R, +, ⋅) so 0 is not considered to be a zero divisor).
 A commutative ring which has no zero divisors is called an integral domain (see below). So Z, the ring of all integers (see above), is an integral domain (and therefore a ring), although Z_{4} (the above example) does not form an integral domain (but is still a ring). So in general, every integral domain is a ring but not every ring is an integral domain.
Third example: the trivial ring
If we define on the singleton set {0}:
0 + 0 = 0
0 × 0 = 0
then one can verify that ({0}, +, ×) forms a ring known as the trivial ring. Since there can be only one result for any product or sum (0), this ring is both closed and associative for addition and multiplication, and furthermore satisfies the distributive law. The additive and multiplicative identities are both equal to 0. Similarly, the additive inverse of 0 is 0. The trivial ring is also a (rather trivial) example of a zero ring (see below).Basic concepts
Subring
Informally, a subring of a ring is another ring that uses the "same" operations and is contained in it. More formally, suppose (R, +, ·) is a ring, and S is a subset of R such that
 for every a, b in S, a + b is in S;
 for every a, b in S, a · b is in S;
 for every a in S, the additive inverse −a of a is in S; and
 the multiplicative identity '1' of R is in S.
Let '+_{S}' and '·_{S}' denote the operations '+' and '·', restricted to S×S. Then (S, +_{S}, ·_{S}) is a subring of (R, +, ·).^{[9]} Since the restricted operations are completely determined by S and the original ones, the subring is often written simply as (S, +, ·).
For example, a subring of the complex number ring C is any subset of C that includes 1 and is closed under addition, multiplication, and negation, such as:
 The rational numbers Q
 The algebraic numbers A
 The real numbers R
If A is a subring of R, and B is a subset of A such that B is also a subring of R, then B is a subring of A.
Homomorphism
A homomorphism from a ring (R, +, ·) to a ring (S, ‡, *) is a function f from R to S that commutes with the ring operations; namely, such that, for all a, b in R the following identities hold:
 f(a + b) = f(a) ‡ f(b)
 f(a · b) = f(a) * f(b)
Moreover, the function f must take the identity element 1_{R} of '·' to the identity element 1_{S} of '*'.
For example, the function that maps each integer x to its remainder modulo 4 (a number in {0, 1, 2, 3}) is a homomorphism from the ring Z to the ring Z_{4}.
A ring homomorphism is said to be an isomorphism if there exists an inverse homomorphism to f (i.e., a ring homomorphism which is an inverse function). Equivalently, any bijective ring homomorphism is a ring isomorphism.