Week 11 Reed-Muller codes

Version 2023-12-03. To PDF of this week only Open the whole set of notes in PDF

Synopsis. The minimum distance of a perfect code cannot exceed 7 unless the code is a repetition code. This is disappointingly low. In this final part of the course, we construct Reed-Muller codes, a family of codes with large minimum distance. Unfortunately, they are not perfect. The construction is based on Boolean functions, which arise in elementary logic as columns of truth tables and are used in cicruit design.

Boolean functions

Fix m1. Denote by Vm the set of all binary words of length m. (It is the same as F2m but viewed without any vector space structure).

For example, V3 is the set {000,001,010,011,100,101,110,111}.

Definition: Boolean functions

A Boolean function is a (set-theoretical) function f:VmF2.

Remark: the number of Boolean functions

The total number of all Boolean functions on Vm is |F2||Vm|=22m.

Remark: Boolean functions as rows of a truth table. One has certainly met Boolean functions when constructing truth tables for statements in basic logic. To give an illustration, let m=3. Consider statements which involve variables x1,x2,x3, each of which can take values 0 (false) or 1 (true).

We will represent a logical statement by a row (not column) in a truth table. (We use rows because it is common in Coding Theory to think of codevectors as of row vectors; and in Reed-Muller codes, codevectors arise from functions.) In our example (m=3), the table will have 8 columns:

x101010101x200110011x300001111(x1 and x2)x311101111000000000111111111v2v300000011

In this table, (x1 and x2)x3 is a statement whose truth value depends on the values of x1, x2 and x3. Therefore, it can be viewed as a Boolean function: its value at the binary word 000 is 1, at the word 100 the value is 1, and so on. The only binary word where this function takes the value 0 is the word 110: indeed, if x1 and x2 are true, then x1 and x2 is true, but x3 is false, and the value of the implication “true false” is false.

(The other rows in the table will be explained below.)

The Boolean algebra

Because Boolean functions take values in F2={0,1} which is a field, Boolean functions can be added and multiplied pointwise: if f,g:VmF2, one has the functions

f+g,fg:VmF2;(f+g)(x)=f(x)+g(x),(fg)(x)=f(x)g(x),xVm.

Also, there are constant functions 0 and 1. (They are shown in the 2nd, respectively 3rd, row of the truth table above.) The Boolean function 1 is often called the tautological truth.

Definition: Boolean algebra

The vector space of Boolean functions f:VmF2, together with the operation of multiplication of functions, is the Boolean algebra on Vm.

The traditional logical operations can be written in terms of the Boolean algebra operations + and ×. Clearly, multiplication is the same as AND:

fg=f and g.

The addition obeys the rule 0+0=0, 0+1=1+0=1, 1+1=0. The logical operation which corresponds to addition is called the exclusive OR:

f+g=f xor g=((f or g) and not(f and g)).

How to write elements of the Boolean algebra as row vectors?

To write elements of the Boolean algebra on Vm as binary vectors, so that we can define the weight, the Hamming distance etc, we need to order all binary words of length m as b0,,b2m1.

The standard ordering is obtained by interpreting the word x1x2xm as a number written in base 2, i.e., the number 2m1x1++2xm1+xm. Thus, the binary words of length 3 appear in the following order: 000, 001, 010, 011, 100, 101, 110, 111. However, the exact choice of the order is not important, as we will see.

Definition: value vector of a Boolean function

Let f:VmF2 be a Boolean function. The value vector of f is the binary vector f=(f(b0),,f(b2m1)) of length 2m, where b0,,b2m1 is the chosen ordering of Vm.

The next notion does not at all depend on the chosen ordering of words in Vm:

Definition: weight of a Boolean function

The weight of the Boolean function f is defined as the weight of the value vector f. The weight does not depend on the ordering of the binary words, because

w(f)=#{bVm:f(b)=1}.

The monomial basis of the Boolean algebra

We will now introduce two special kinds of elements of the Boolean algebra: coordinate functions and, more generally, monomial functions.

Definition: coordinate function

The Boolean function vi:VmF2 defined by vi(x1,x2,,xm)=xi is called the ith coordinate function.

Definition: monomial, polynomial, degree

To each subset {i1,,ir}{1,,m} there corresponds the monomial function (or monomial) vi1vir, of degree r.

Also, 1 is the monomial function corresponding to the set , of degree 0.

A linear combination of monomials is a polynomial. The degree of a polynomial f is the highest degree of a monomial which appears in f.

Remark: properties of monomials.

  • • Observation: because the values of any Boolean function are 0 and 1, one has vi=vi2=vi3=. This is the reason why there are no higher powers of the vi in the definition of a monomial.

  • • The above also implies that the product of monomials is again a monomial, and the product of polynomials is a polynomial.

  • • There are 2m monomials in the Boolean algebra on Vm (because there are 2m subsets of {1,,m}).

  • • The weight of a monomial is calculated in the following result.

Lemma 11.1: weight of a monomial

A monomial vi1vi2vir in the Boolean algebra on Vm has weight 2mr. That is,

w(v)=2mdegvif v is a monomial.

  • Proof. If b=x1x2xm is a binary word, vi1vi2vir(b)=1 if and only if xi1=xi2==xir=1. Hence the number of binary words in Vm where this monomial has value 1 is equal to the number of ways to choose the bits xj where j{i1,,ir}. There are 2 choices (0 or 1) for each one of those mr bits, hence the total number of such binary words is 2mr, and w(vi1vir)=#{bVm:vi1vir(b)=1}=2mr.

Theorem 11.2: monomial basis

Monomials form a basis of the Boolean algebra.

  • Proof. First, we prove by contradiction that monomials are linearly independent.

    Assume for contradiction that a non-empty linear combination (i.e., a sum, as we are working over F2) of monomials equals the zero Boolean function:

    vS1+vS2++vSk=0,k1,

    where S1,Sk are some subsets of the index set {1,,m}. Without the loss of generality, assume that vSk has the highest degree:

    degvSidegvSk,i.e.,#Si#Skfor all i=1,,k1.

    Note that if S,T{1,,m} then vSvT=vST. Let now T={1,,m}Sk, the complement of the set Sk. Multiplying both sides by vT, we obtain

    ()vS1T+vS2T++vSkT=0.

    We have SkT={1,,m}. If i<k then the set Si cannot contain Sk, and so SiT{1,,m} and degvSiT<m. Rewrite () as

    vS1T+vS2T++vSk1T=v1v2vm.

    The left-hand side is a sum of monomials of degree less than m. By Lemma 11.1, these monomials have value vectors of even weight. A sum of vectors of even weight is a vector of even weight: we know that the binary even weight code is linear. But the right-hand side is the monomial v1vm which by Lemma 11.1 has weight 1, which is odd. This contradiction proves that monomials are linearly independent.

    It remains to show that the monomials are a spanning set in the Boolean algebra. There are 2m monomials, so we can form 2(2m) linear combinations of monomials by putting a coefficient of 0 or 1 in front of each monomial. All these linear combinations are distinct, by linear independence. On the other hand, there are 2(2m) Boolean functions on Vm. Hence every Boolean function is a linear combination of monomials.

    A basis is a set which is linearly independent and spanning, so the Theorem is proved.

Corollary 11.3: Boolean functions are polynomials

Each Boolean function on Vm is uniquely written as a Boolean polynomial in the coordinate functions v1,,vm.

Remark: algebraic normal form. A representation of a Boolean function f:VmF2 as a Boolean polynomial is sometimes referred to as the algebraic normal form of f. This can be compared to disjunctive and conjunctive normal forms of a Boolean function used for other purposes. Interested readers may find the details in the literature.

The Reed-Muller code

We now know that every element of the Boolean algebra on Vm is a polynomial, i.e., a sum of several monomials (squarefree products of coordinate functions). Recall also that the degree of a polynomial is the top degree of a monomial in that polynomial, which does not exceed m.

Definition: Reed-Muller code

Let 0rm. The rth order Reed-Muller code on Vm, denoted R(r,m), is the space of value vectors of polynomials of degree at most r in the Boolean algebra on Vm.

Observe that R(r,m) is spanned by the value vectors of all monomials of degree at most r.

Example: work out R(0,m)

Find the parameters and write down all codevectors of the Reed-Muller code R(0,m).

Solution. The code R(0,m) consists of value vectors of Boolean polynomials on Vm of degree 0. There are only two such polynomials, 0 and 1, hence

R(0,m)={000,111}=Rep(2m,F2)

is the repetition code. The length is 2m=#Vm. The dimension is 1. The minimum distance equals the length. A [2m,1,2m]2-code.

Example: R(m,m)

Show that R(m,m)=F22m, the trivial binary code of length 2m.

Solution. R(m,m) consists of value vectors of polynomials on Vm of degree m. All Boolean polynomials have degree at most m, and, by Corollary 11.3, every possible binary vector of length 2m is a value vector of some polynomial. Hence R(m,m) consists of all possible binary vectors of length 2m, i.e., is the trivial code.

The key result on Reed-Muller codes is the following theorem, which gives the parameters of these codes.

Theorem 11.4: parameters of a Reed-Muller code

R(r,m) has length 2m, dimension (m0)+(m1)++(mr) and minimum distance 2mr.

  • Proof. Length =2m by construction: a value vector is made up of 2m bits obtained by evaluating the given function on the 2m binary words in Vm.

    Value vectors of monomials of degree 0,1,,r span R(r,m) by definition of R(r,m), and are linearly independent by Theorem 11.2, hence form a basis of R(r,m). The number of monomials of degree d is the same as the number of d-element subsets of {1,,m}, which is (md), so the total number of monomials in the basis of R(r,m) — i.e., the dimension of R(r,m) — is as stated.

    Minimum distance: the code R(r,m) contains monomials of degree r, for example, v1v2vr. By Lemma 11.1, these have weight 2mr. Hence d(R(r,m))=w(R(r,m)) is at most 2mr.

    It remains to show that w(R(r,m))2mr. We do this by induction in m.

    Base case m=1. According to the Examples above, the two possible codes are R(0,1)=Rep(2,F2) of weight 2=210 and R(1,1)=F22m of weight 1=211. So the inequality w(R(r,m))2mr is satisfied when m=1.

    Inductive step. Assume w(R(r,m1))2m1r for all r=0,,m1. This means that the weight of any non-zero polynomial of degree r in v1,,vm1 is at least 2m1r:

    ()h0, deghr#{yVm1:h(y)=1}2m1r.

    The set Vm of binary words of length m splits into two subsets,

    Vm10={x1xm:xm=0}andVm11={x1xm:xm=1}

    of words that end in 0 and words that end in 1, respectively. We need to take a polynomial 0f:VmF2 of degree r and prove that w(f)2mr. We have

    ()w(f)=#{bVm10:f(b)=1}+#{bVm11:f(b)=1}.

    Each monomial in f contains a copy of vm or none, so we can write

    f=g+hvm,

    where g, h are polynomials in v1,,vm1.

    The case h=0. Here g is a non-zero polynomial of degree r in v1,,vm1, and so rm1. By (), there are at least 2m1r words yVm1 where g(y)=1. For each such word y we have y0Vm10, y1Vm11 and f(y0)=f(y1)=1, and so y contributes twice when counting the weight of f in (). Hence w(f)=2w(g) and so w(f)2×2m1r=2mr.

    The case h0. We note that the values of f on Vm10 are the same as the values of g on Vm1, because hvm|Vm10=0. Furthermore, the values of f on Vm11 are the same as the values of g+h on Vm1, because on Vm11 we have vm=1. Hence () gives w(f)=w(g)+w(g+h).

    By the triangle inequality, w(a+b)w(a)+w(b) for any vectors a,b. Hence w(g)+w(g+h)w(g+(g+h))=w(h). Here deghr1 because deghvmr, so the inductive hypothesis () applies and gives w(h)2m1(r1)=2mr. We proved that w(f)2mr, as required.

    To conclude, by induction w(R(r,m))2mr for all m and all rm.

The key duality between Reed-Muller codes

We finish the chapter by identifying the dual code of R(r,m), which happens to be another Reed-Muller code.

Theorem 11.5: duality between Reed-Muller codes

For all m1 and for all r such that 0rm1,

R(m1r,m)=R(r,m).

  • Proof. If f,g:VmF2 are Boolean functions, the definition of inner product means that

    fg=bVmf(b)g(b)=bVm(fg)(b).

    If f is a monomial of degree r and g is a monomial of degree m1r, then fg is a monomial of degree m1. By Lemma 11.1, there are exactly 2mdegfg words bVm such that (fg)(b)=1. Since mdegfg1, 2mdegfg is an even number, and so the sum bVm(fg)(b) is zero in F2. This shows that f is orthogonal to g.

    Since monomials f of degree r span R(r,m), this shows that gR(r,m). Thus, R(m1r,m) is spanned by elements of R(r,m), so R(m1r,m)R(r,m).

    We will now compare the dimensions. We have dimR(m1r,m)=(m0)++(mm1r). Using the relation (mi)=(mmi), we rewrite this as (mm)+(mm1)++(mr+1). Finally, dimR(m1r,m)+dimR(r,m)=i=0m(mi)=2m, the length of the Reed-Muller codes. Hence dimR(m1r,m)=2mdimR(r,m)=dimR(r,m).

    Thus, R(r,m) contains subspace R(m1r,m) of the same dimension as R(r,m), hence a subset R(m1r,m) of the same cardinality as R(r,m). We conclude that R(r,m)=R(m1r,m).

  • Exercise. The code R(m,m) is excluded from Theorem 11.5. How would you define “R(1,m)” which should be the dual of R(m,m)?

Theorem 11.5 can be used to identify particular Reed-Muller codes and to deduce their further properties. Examples of this are in the exercises to this chapter.