The integer ring Zm consists of:
e.g. Z_{9} ={0,1,2,3,4,5,6,7,8}.
Note:
Properties of rings：
In summary, we can say that the ring Zm is the set of integers {0,1,2, . . . ,m−1} in which we can add, subtract, multiply, and sometimes divide.
We can add and multiply any two numbers and the result is always in the ring. A ring is said to be closed.
Addition and multiplication are associative, e.g., a+(b+c) = (a+b)+c, and a · (b · c) = (a · b) · c for all a,b,c ∈ Zm.
There is the neutral element 0 with respect to addition, i.e., for every element a ∈ Zm it holds that a+0 ≡ a mod m.
For any element a in the ring, there is always the negative element −a such that a+(−a) ≡0 mod m, i.e., the additive inverse always exists.
唯一性，反证利用结合律：
对于x ∈ Zm 如果存在两个不同的加法逆元a,b ∈ Zm，st. x+a=a+x=x+b=b+x=0，
根据结合律 a+x+b = (a+x)+b = 0+b=b , a+x+b=a+(x+b)=a+0=a，跟a和b不同矛盾
负数的模： mod(a, n) = a - n * floor(a / n)
for all a,b ∈ Zm, a+b=b+a
Distributive law holds that a×(b+c) = (a×b)+(a×c) for all a,b,c ∈ Zm,
Expand 扩展：
(x1+x2+….xm)×(y1+y2+…yn) = ..
可以将 (x1+x2+….xm)先看做a，然后b=y1, c=y2+…yn，然后展开即可
There is the neutral element 1 with respect to multiplication, i.e., for every element a ∈ Zm it holds that a×1 ≡ a mod m.
The multiplicative inverse exists only for some, but not for all, elements. Let a ∈ Z, the inverse a^{−1} is defined such that a · a^{−1} ≡1 mod m If an inverse exists for a, we can divide by this element since b/a ≡ b · a^{−1} mod m.
It takes some effort to find the inverse (usually employing the Euclidean algorithm). However, there is an easy way of telling whether an inverse for a given element a exists or not: An element a ∈ Z has a multiplicative inverse a^{−1} if and only if gcd(a,m) = 1, where gcd is the greatest common divisor , i.e., the largest integer that divides both numbers a and m. The fact that two numbers have a gcd of 1 is of great importance in number theory, and there is a special name for it: if gcd(a,m) = 1, then a and m are said to be relatively prime or coprime 互质.
唯一性
跟前面additive inverse一样反证利用结合律：
对于x ∈ Zm 如果存在两个不同的加法逆元a,b ∈ Zm，st. xa=ax=xb=bx=1，
根据结合律 axb = (ax)b = 1b=b , axb=a(xb)=a1=a，跟a和b不同矛盾
x对n模运算的乘法逆存在的前提是公约数gcd(x,n)=1
证明Proving that modular inverse only exists when gcd(n,x)=1https://math.stackexchange.com/questions/2101189/proving-that-modular-inverse-only-exists-when-gcdn-x-1
If there is an inverse of x mod n, that gives us a number y so that xy≡1mod n . That means that xy=kn+1, or (rearranging) that xy−kn=1.
Now for any common divisor, c, of x and n we will have that c∣(xy−kn) which gives c∣1, that is, c=1. So that is an outcome - and therefore a requirement - of finding the inverse of x mod n
x ∈ R ,x is unit if ∃ 1/x = x^{-1} ∈ R
s.t. x(1/x)=1 , (1/x)x=1
based on the definition of Rings, just add one more axioms, that it must obey :
∀ x,y ∈ R , xy=yx
example:
Rational numbers,
Real numbers,
Complex numbers,
all the prime fields on vector space,
Integer Rings,
Zero Ring:
{0} the additive identity&multiplicative identity is the same 0
Two trivial example:
R[x] = Ring of polynomials in the indeterminant x over the ring R
x^{0}, x^{1}, x^{2}, x^{3}, ………..
\[\sum_{i=0}^∞ ai \quad\]