Skip to Content
CSE5313CSE5313 Coding and information theory for data science (Lecture 3)

CSE5313 Coding and information theory for data science (Lecture 3)

Finite Fields

Why finite fields?

Most information systems are discrete.

  • Use bits, byte etc.

Use bits/bytes to represent real numbers.

  • Problems of overflow, accuracy, etc.

We wish to build “good” codes CFn\mathcal{C} \subset \mathbb{F}^n:

  • Large kn\frac{k}{n}
  • Lage dH(C)    d_H(\mathcal{C})\implies error detection/correction, erasure correction.

Idea: Use linear algebraic operations to encode/decode.

  • F=FqF=\mathbb{F}_q, a finite field with qq elements.

Finite fields

Fields and field axioms

A field is a set F\mathbb{F} with two operations ++ and \cdot that satisfy the following axioms:

  • Associativity: (a+b)+c=a+(b+c)(a+b)+c = a+(b+c) and (ab)c=a(bc)(a\cdot b)\cdot c = a\cdot (b\cdot c)
  • Commutativity: a+b=b+aa+b = b+a and ab=baa\cdot b = b\cdot a
  • Distributivity: a(b+c)=ab+aca\cdot (b+c) = a\cdot b + a\cdot c
  • Existence of Identity elements: a+0=aa+0 = a and a1=aa\cdot 1 = a
  • Existence of Inverse elements: a+(a)=0a+(-a) = 0 and aa1=1a\cdot a^{-1} = 1

Every set of elements which satisfies these axioms is a field.

We can “do algebra” over it (matrices, vector spaces, etc.).

Are there finite sets which satisfy the field axioms?

What are the possible sizes of such sets?

Background – Basic number theory

  • For a,bNa, b \in \mathbb{N},
    • Greatest Common Denominator: gcd(a,b)=\gcd(a, b) = the largest integer mm such that mam|a and mbm|b.
    • Lowest Common Multiplier: lcm(a,b)=\operatorname{lcm}(a, b) = the smallest integer mm such that ama|m and bmb|m.
  • a,ba, b are coprime if gcd(a,b)=1\gcd(a, b) = 1.
  • Fact: (Euclid’s lemma) Say aba \geq b,
    • There exists a quotient q0q \geq 0 and a remainder 0r<b0 \leq r < b such that a=bq+ra = bq + r.
  • Theorem (Euclid): If gcd(a,b)=1\gcd(a, b) = 1 then there exist m,nZm, n \in \mathbb{Z} such that am+bn=1am + bn = 1.
    • Proof by repeated application of Euclid’s lemma.
    • Example:
      • If a=3,b=8a = 3, b = 8,
      • then m=5,n=2m = -5, n = 2,
      • satisfy 35+82=13 \cdot -5 + 8 \cdot 2 = 1.

Modular arithmetic

Defined a set with addition \oplus and multiplication \odot that satisfy the field axioms.

Zp\mathbb{Z}_p is a field if pp is a prime number.

  • Addition and multiplication are defined modulo pp.

  • ab=(a+b)modpa \oplus b = (a+b) \mod p

  • ab=(ab)modpa \odot b = (a\cdot b) \mod p

  • 00 is the additive identity.

  • 11 is the multiplicative identity.

  • aa has an additive inverse pap-a.

  • aa has a multiplicative inverse a1a^{-1} such that aa1=1a \odot a^{-1} = 1.

Proof for existence of multiplicative inverse for aZp{0}a\in \mathbb{Z}_p\setminus \{0\}:

Proof

Since pp is prime, gcd(a,p)=1\gcd(a, p) = 1.

By euclid’s theorem, there exist m,nZm, n \in \mathbb{Z} such that am+pn=1am + pn = 1.

Take mod pp on both sides:

amodpmmodp1modpa_{\mod p}\odot m_{\mod p} \equiv 1_{\mod p}

Thus, mmodpm_{\mod p} is the multiplicative inverse of amodpa_{\mod p}.

Polynomials over prime fields is also a field.

(Z2,XOR,AND)(\mathbb{Z}_2,\operatorname{XOR},\operatorname{AND}) is a field.

Polynomials over finite fields

A polynomial over a field Zp\mathbb{Z}_p is a expression of the form:

a(x)=i=0naixia(x)=\sum_{i=0}^n a_i x^i
  • Polynomial degree: largest index of a non-zero coefficient.
  • Polynomial addition: a(x)b(x)=i=0n(aibi)xia(x) \oplus b(x) = \sum_{i=0}^n (a_i \oplus b_i) x^i
  • Polynomial multiplication: a(x)b(x)=i=0nj=0naibjxi+ja(x)\odot b(x) = \sum_{i=0}^n \sum_{j=0}^n a_i \odot b_j x^{i+j}
  • Polynomial equality: a(x)=b(x)a(x) = b(x) if and only if ai=bia_i = b_i for all ii.
  • Polynomial division: suppose deg(a(x))deg(b(x))\deg(a(x)) \geq \deg(b(x)), then there exist unique polynomials q(x)q(x) and r(x)r(x) such that a(x)=b(x)q(x)r(x)a(x) = b(x)q(x) \oplus r(x) and deg(r(x))<deg(b(x))\deg(r(x)) < \deg(b(x)). (do long division for polynomials)

denoted as Zp[x]\mathbb{Z}_p[x].

Example

p(x)=x2+6x+3Z7[x]p(x) = x^2 + 6x+3\in \mathbb{Z}_7[x]

p(1)=12+61+3=103mod7p(1) = 1^2 + 6\cdot 1 + 3 = 10 \equiv 3 \mod 7

p(2)=22+62+3=4+5+3=125mod7p(2) = 2^2 + 6\cdot 2 + 3 = 4+5+3 = 12 \equiv 5 \mod 7

Irreducible polynomials

A polynomial p(x)p(x) is irreducible if it cannot be factored into two non-constant polynomials.

If gcd(a(x),b(x))=1\gcd(a(x),b(x))=1, then there exist m(x),n(x)Zp[x]m(x),n(x)\in \mathbb{Z}_p[x] such that a(x)m(x)b(x)n(x)=1a(x)m(x)\oplus b(x)n(x)=1.

Proved similar to euclid’s theorem.

Tip

If a polynomial p(x)p(x) has a root, say rr, then p(x)=(xr)q(x)p(x) = (x-r)q(x) for some q(x)Zp[x]q(x)\in \mathbb{Z}_p[x].

Example in Z2[x]\mathbb{Z}_2[x]:

p(x)=x21p(x) = x^2 \oplus 1

is reducible because p(x)=(x1)(x1)p(x) = (x\oplus 1)(x\oplus 1).

p(x)=x3x1p(x) = x^3 \oplus x \oplus 1

is irreducible.

Proof

We prove by contradiction.

Suppose p(x)p(x) is reducible, then p(x)=a(x)b(x)p(x) = a(x)b(x) for some a(x),b(x)Z2[x]a(x),b(x)\in \mathbb{Z}_2[x].

Then deg(p(x))=deg(a(x))+deg(b(x))\deg(p(x)) = \deg(a(x)) + \deg(b(x)).

Let degb(x)=1\deg b(x)=1, then b(x){x,x1}b(x) \in \{x, x\oplus 1\}.

If b(x)=xb(x) = x, then p(0)=0p(0)=0 but p(x)p(x) is 11.

If b(x)=x1b(x) = x\oplus 1, then p(1)=0p(1)=0 but p(x)p(x) is 11.

It is not the case in Z2[x]\mathbb{Z}_2[x], that every polynomial with no root is irreducible. (e.g consider (x3x1)2(x^3\oplus x\oplus 1)^2 has no root but is reducible.)

Polynomial modular arithmetic

There exist quotient q(x)q(x) and remainder r(x)r(x), deg(r(x))<deg(b(x))\deg(r(x)) < \deg(b(x)) such that

a(x)=b(x)q(x)+r(x)a(x) = b(x)q(x) + r(x)     a(x)modb(x)=r(x)\implies a(x) \mod b(x) = r(x)

"modb(x)\mod b(x)" is an operation on polynomials in Zp[x]\mathbb{Z}_p[x] that:

  • Preserves polynomial addition:
    • a(x)c(x)modb(x)=a(x)modb(x)c(x)modb(x)a(x) \oplus c(x) \mod b(x) = a(x) \mod b(x) \oplus c(x) \mod b(x)
  • Preserves polynomial multiplication:
    • a(x)c(x)modb(x)=a(x)modb(x)c(x)modb(x)a(x) \odot c(x) \mod b(x) = a(x) \mod b(x) \odot c(x) \mod b(x)

Extension fields

Let pp be a prime number. then (Zp[x],,)(\mathbb{Z}_p[x], \oplus, \odot) is a field.

Fix a polynomial f(x)Zp[x]f(x)\in \mathbb{Z}_p[x] of degree tt.

Define a set

Elements: polynomials of degree at most t1t-1 in Zp[x]\mathbb{Z}_p[x]. (finite set, size is ptp^t.)

Define addition:

a(x)fb(x)=(a(x)b(x))modf(x)a(x) \oplus_f b(x) = (a(x) \oplus b(x)) \mod f(x)

Define multiplication:

a(x)fb(x)=(a(x)b(x))modf(x)a(x) \odot_f b(x) = (a(x) \odot b(x)) \mod f(x)

Denote this set as Zp[x]modf(x)\mathbb{Z}_p[x] \mod f(x).

This is not a field because it does not have a multiplicative inverse for every element.

Proof

We prove by contradiction.

Suppose there exists a polynomial g(x)Zp[x]modf(x)g(x)\in \mathbb{Z}_p[x] \mod f(x) such that a(x)fg(x)=1a(x) \odot_f g(x) = 1.

Let p=2,f(x)=x21p=2,f(x)=x^2\oplus 1.

The polynomials in Z2[x]modf(x)\mathbb{Z}_2[x] \mod f(x) are {0,1,x,x1}\{0, 1, x, x\oplus 1\}.

Consider the modular inverse of (x1)(x\oplus 1).

  • 0f(x1)=00\odot_f (x\oplus 1) = 0
  • 1f(x1)=x11\odot_f (x\oplus 1) = x\oplus 1
  • xf(x1)=(x2x)mod(x21)=x1x\odot_f (x\oplus 1) = (x^2\oplus x)\mod (x^2\oplus 1) = x\oplus 1
  • (x1)f(x1)=(x21)mod(x21)=0(x\oplus 1)\odot_f (x\oplus 1) = (x^2\oplus 1)\mod (x^2\oplus 1) = 0

To make our field extension works, we need to find a polynomial f(x)f(x) that is irreducible.

Theorem: If f(x)f(x) is irreducible over Zp\mathbb{Z}_p, then Zp[x]modf(x)\mathbb{Z}_p[x] \mod f(x) is a field.

Proof

Let a(x)Zp[x]modf(x)a(x)\in \mathbb{Z}_p[x] \mod f(x), a(x)0a(x)\neq 0.

Existence of a(x)1a(x)^{-1} in Zp[x]modf(x)\mathbb{Z}_p[x] \mod f(x) can be done by Euclid’s Theorem.

Since gcd(a(x),f(x))=1\gcd(a(x),f(x))=1, there exist m(x),n(x)Zp[x]m(x),n(x)\in \mathbb{Z}_p[x] such that a(x)m(x)f(x)n(x)=1a(x)m(x)\oplus f(x)n(x)=1.

Take mod f(x)f(x) on both sides:

a(x)m(x)modf(x)=1modf(x)a(x)m(x) \mod f(x) = 1 \mod f(x)

Thus, m(x)modf(x)m(x) \mod f(x) is the multiplicative inverse of a(x)modf(x)a(x) \mod f(x).

So a(x)1=m(x)modf(x)a(x)^{-1} = m(x) \mod f(x).

Corollary:

We can extend a prime field Zp\mathbb{Z}_p with irreducible polynomial

Intuitively, we add to Zp\mathbb{Z}_p a new element xx that satisfies f(x)=0f(x)=0.

Observation: – We only used the general field properties of Zp\mathbb{Z}_p. – ⇒ any “base field” can be used instead of Zp\mathbb{Z}_p. – ⇒ Any field can be “extended”.

Say we wish to build a field FF with 282^8 elements.

  • Option 1:

    • Take Z2\mathbb{Z}_2 and f(x)f(x) irreducible of degree 8.
    • F=Z2[x]modf(x)F = \mathbb{Z}_2[x] \mod f(x).
  • Option 2:

    • Take Z2\mathbb{Z}_2, and g1(x)Z2[x]g_1(x) \in \mathbb{Z}_2[x] irreducible of degree 4,
    • F1=Z2[x]modg1(x)F_1 = \mathbb{Z}_2[x] \mod g_1(x). Note F1=24=16|F_1| = 2^4 = 16.
    • Take g2(x)F1[x]g_2(x) \in F_1[x] irreducible of degree 2.
    • F2=F1[x]modg2(x)F_2 = F_1[x] \mod g_2(x).

Uniqueness of the finite field

Theorems:

  • As long as it is irreducible, the choice of f(x)f(x) does not matter.
    • If f1(x),f2(x)f_1(x), f_2(x) are irreducible of the same degree, then Zp[x]modf1(x)Zp[x]modf2(x)\mathbb{Z}_p[x] \mod f_1(x) \cong \mathbb{Z}_p[x] \mod f_2(x).
  • Over every Zp\mathbb{Z}_p (𝑝 prime), there exists an irreducible polynomial of every degree.
  • All finite fields of the same size are isomorphic.
  • All finite fields are of size pdp^d for prime pp and integer dd.

Corollary: This is effectively the only way to construct finite fields!

Extension of fields

R[x]mod(x2+1)\mathbb{R}[x]\mod (x^2+1) is a field, C\cong \mathbb{C}.

TermsFinite field extension F1F2F_1\to F_2RC\mathbb{R}\to \mathbb{C}
Base fieldany field F1\mathbb{F}_1R\mathbb{R}
Irreducible polynomialf(x)f(x)x2+1x^2+1
New elements addedxxii
Add/mulmodf(x)\mod f(x)mod(x2+1)\mod (x^2+1)

You cannot do algebraic extension of Q\mathbb{Q} to R\mathbb{R}.

Transcendental extension:

Last updated on