Subrings and ideals

A subset S of a ring R is called a subring of R if S is itself a ring with the operations of R. Specifically, a nonempty subset S of a ring R is a subring if S is closed under subtraction and multiplication, meaning that a-b and ab are in S whenever a and b are in S.
It’s worth noting that {0} and R are subrings of any ring R, with {0} being referred to as a trivial subring of R. For instance, {0,2,4} is a subring of ℤ_6, 2ℤ is a subring of ℤ, and ℤ[i]={a+bi:a,b∈ℤ} is a subring of ℂ.
A subring A of a ring R is called a (two-sided) ideal of R if, for every r∈R and every a∈A, both ra and ar are in A. This is known as the ideal test, which states that a nonempty subset A of a ring R is an ideal of R if (1.) a-b∈A whenever a,b∈A and (2.) ra and ar are in A whenever a∈A and r∈R.
As an example, for any ring R, {0} and R are ideals of R, with {0} being referred to as the trivial ideal. Additionally, 2ℤ is an ideal of ℤ, as for any k,j∈ℤ, 2k-2j=2(k-j)ℤ and k(2j)=2(kj)ℤ.

Another example of an ideal is the principal ideal generated by a. Given a commutative ring R with unity and an element a∈R, the set ={ra | r∈R} is an ideal of R. Additionally, if ℝ[x] is the set of all polynomials with real coefficients and A is the subset of all polynomials with constant term 0, then A is an ideal of ℝ[x], in fact, A=.
Lastly, given a ring R, the set of cosets {r+A:r∈R} is a ring under the operations (s+A)+(t+A)=s+t+A and (s+A)(t+A)=st+A if and only if A is an ideal of R. The set of cosets forms a group under addition, and it can be shown that multiplication is well-defined if and only if A is an ideal of R.