Reed-Muller Codes : Generator and Parity Check Matrices and the Minimum Distance
Generator Matrix Construction for RM Codes
While the polynomial evaluation method provides a powerful algebraic definition for Reed-Muller codes, an alternative and equally fundamental approach is to construct their generator matrix directly using linear algebra, specifically the Kronecker product. This method reveals the code's recursive structure and provides a direct path to its implementation.
1. The Kronecker Product
The Kronecker product, denoted by the symbol ⊗, is an operation on two matrices of arbitrary size, resulting in a larger block matrix.
If A is an m×n matrix and B is a p×q matrix, their Kronecker product A⊗B is the mp×nq block matrix:
Essentially, each element aij of matrix A is replaced by the scaled matrix aijB.
The Kronecker product is associative, meaning we can extend it to multiple matrices in a straightforward sequence:
A⊗B⊗C=(A⊗B)⊗C=A⊗(B⊗C)(2)
This allows us to define the m-fold Kronecker product of a matrix with itself, denoted G⊗m.
2. The RM Generator Kernel
The entire family of Reed-Muller codes can be constructed from the m-fold Kronecker product of a simple 2×2 kernel matrix, operating in the binary field F2:
G2=(1011)(3)
The matrix for an RM(m,m) code, which is the space of all possible Boolean functions in m variables, is given by G2⊗m. This is a 2m×2m matrix.
For m=3, the matrix is G2⊗3:
G2⊗3=G2⊗2⊗G2=1000000011000000101000001111000010001000110011001010101011111111(5)
3. Selecting Rows for the Generator Matrix
The generator matrix for a specific RM(r,m) code is a submatrix of G2⊗m, formed by selecting a specific subset of its rows.
An observation on the matrix G2⊗m is that the Hamming weight of its rows takes values 2k for k∈{0,1,...,m}. The selection rule is based on these weights:
The generator matrix for the RM(r,m) code, denoted GRM(r,m), is formed by taking all rows of G2⊗m whose Hamming weight is greater than or equal to 2m−r.
Number of Rows: The number of rows selected by this rule is precisely k=∑i=0r(im), which is the dimension of the RM(r,m) code.
Linear Independence: Since G2 is an invertible matrix, its m-fold Kronecker product G2⊗m is also invertible. This means all of its 2m rows are linearly independent. Therefore, any subset of these rows—including the set we select for our generator matrix—is also linearly independent.
3.1 Examples of Generator Matrix Construction
Example 1: The RM(1,2) Code
Parameters:m=2,r=1.
Selection Rule: Select rows from G2⊗2 with weight ≥22−1=2.
The matrix G2⊗2 has rows with weights (4, 2, 2, 1). We select the first three rows.
G_RM(1,2)=100110101111(6)
Example 2: The RM(1,3) Code
Parameters:m=3,r=1.
Selection Rule: Select rows from G2⊗3 with weight ≥23−1=4.
The rows of G2⊗3 have weights (8, 4, 4, 2, 4, 2, 2, 1). We select the rows with weights 8 and 4. These are the rows with indices 0, 1, 2, and 4.
Selection Rule: Select rows from G2⊗m with weight ≥2m−0=2m.
Only the first row (the all-ones vector) of G2⊗m has this weight.
G_RM(0,m)=(11⋯1)(9)
Example 5: The RM(m,m) Code (The full space F22m)
Parameters:r=m.
Selection Rule: Select rows from G2⊗m with weight ≥2m−m=20=1.
All non-zero rows of G2⊗m have a weight of at least 1. Since the matrix is invertible, all rows are non-zero. Thus, we select all rows.
G_RM(m,m)=G2⊗m(10)
4. Connection to the Polynomial Definition
This constructive method is perfectly equivalent to the polynomial evaluation definition. The rows of G2⊗m are, in fact, the evaluation vectors of all possible monomials of m variables.
The correspondence is as follows: Let the binary representation of the row index j be (b1b2…bm), where b1 is the most significant bit (MSB). The j-th row of G2⊗m corresponds to the evaluation vector of the monomial Mj=∏i=1mXibi. For instance, if m=3 and j=5, its binary representation is (101)2, so the monomial is X11X20X31=X1X3.
The Hamming weight of the evaluation vector for a monomial of degree d is exactly 2m−d.
Therefore, our row selection rule, weight≥2m−r, can be translated into the polynomial degree:
weight(Eval(Mj))≥2m−r⟹2m−d≥2m−r⟹m−d≥m−r⟹d≤r(11)
This shows that selecting rows with weight at least 2m−r is identical to selecting the basis functions (monomials) of degree at most r.
Example: Constructing GRM(1,3)
Parameters:m=3,r=1.
Selection Rule: Select rows from G2⊗3 with Hamming weight ≥23−1=4.
Let's examine the rows of G2⊗3 and their corresponding monomials, with X1 as the MSB.
Row Index (j)
Binary Rep. (b1b2b3)
Monomial
Hamming Weight
Select? (Weight ≥4)
0
000
1
8=23−0
Yes
1
001
X3
4=23−1
Yes
2
010
X2
4=23−1
Yes
3
011
X2X3
2=23−2
No
4
100
X1
4=23−1
Yes
5
101
X1X3
2=23−2
No
6
110
X1X2
2=23−2
No
7
111
X1X2X3
1=23−3
No
The selected monomials are {1,X1,X2,X3}. The generator matrix is formed by taking the rows from G2⊗3 with indices 0, 1, 2, and 4, in that specific order.
A remarkable property of RM codes is that they are duals of each other. The dual of a linear code C, denoted C⊥, is the set of all vectors that are orthogonal to every codeword in C. A generator matrix for one code can serve as a parity-check matrix for its dual.
Theorem: The dual of the RM(r,m) code is the RM(m−r−1,m) code.
[RM(r,m)]⊥=RM(m−r−1,m)(12)
This implies that a generator matrix for RM(m−r−1,m) is a valid parity-check matrix for RM(r,m). Let Gr be the generator matrix for RM(r,m) and let H=Gm−r−1 be the generator matrix for RM(m−r−1,m). To prove the duality, we must show that GrHT=0.
Proof:
This condition is satisfied if the dot product of any row from Gr with any row from H is zero. Let's analyze this using the polynomial representation.
A row in Gr is the evaluation vector Eval(f) of a basis monomial f(X) where deg(f)≤r.
A row in H is the evaluation vector Eval(g) of a basis monomial g(X) where deg(g)≤m−r−1.
The dot product of these two vectors is the sum of their component-wise product:
The degree of the product polynomial p(X)=f(X)g(X) is:
deg(p)=deg(f)+deg(g)≤r+(m−r−1)=m−1(14)
We use a fundamental property of Boolean functions: for any non-zero Boolean polynomial p(X) with degree less than m, the sum of its evaluations over all 2m points is zero.
v∈F2m∑p(v)=0(15)
Since deg(p)<m, the dot product is zero. This holds for any pair of basis vectors (rows), proving the duality.
5.1 Duality Example: The Self-Dual RM(1,3) Code
Let's verify the property GHT=0 with an example.
Consider the code C=RM(1,3). Here m=3,r=1.
Its dual is C⊥=RM(m−r−1,m)=RM(3−1−1,3)=RM(1,3).
This is a self-dual code, meaning the code and its dual are identical. Therefore, its generator matrix G can also serve as its parity-check matrix H. We must verify that GGT=0.
From the previous section, the generator matrix is:
Now, we compute the product GGT. Each entry (i,j) of the resulting matrix is the dot product of row i of G with row j of G. All calculations are in F2.
The result is the 4×4 zero matrix, confirming that the generator matrix for RM(1,3) is a valid parity-check matrix for itself, as expected for a self-dual code.
6. Minimum Distance from the Generator Matrix Construction
The recursive construction of the generator matrix provides an elegant way to prove the minimum distance of an RM(r,m) code. We can prove by induction that the minimum Hamming distance is exactly dmin=2m−r.
Theorem: The minimum distance of the RM(r,m) code is 2m−r.
Proof:
We will use induction on m.
Base Cases:
For r=0, the RM(0,m) code is the repetition code with codewords 0=(0,…,0) and 1=(1,…,1). The minimum distance is the weight of the all-ones vector, which is 2m. The formula gives dmin=2m−0=2m. This holds.
For r=m, the RM(m,m) code is the entire space F22m. The minimum distance is 1 (e.g., the codeword (0,…,0,1)). The formula gives dmin=2m−m=20=1. This also holds.
Inductive Hypothesis:
Assume that for all r′≤m′, where m′<m, the minimum distance of the RM(r′,m′) code is 2m′−r′.
Inductive Step:
To construct the generator matrix for RM(r,m), we select rows from G2⊗m. Recall the recursive structure:
G2⊗m=(G2⊗(m−1)0G2⊗(m−1)G2⊗(m−1))(19)
The rows of GRM(r,m) can be partitioned into two sets based on this structure:
Rows from the top block: These correspond to basis monomials of degree at most r using only the first m−1 variables (X1,…,Xm−1). These are precisely the basis vectors for the RM(r,m−1) code. In the m-variable space, these rows have the form (v∣v), where v is a basis vector of RM(r,m−1). The generator matrix for this part is thus (GRM(r,m−1)∣GRM(r,m−1)).
Rows from the bottom block: These correspond to basis monomials that include the variable Xm. They have the form Xm⋅M(X1,…,Xm−1), where the degree of M is at most r−1. The vectors generated by these monomials are the basis vectors for the RM(r−1,m−1) code, but shifted into the second half of the codeword. These rows have the form (0∣u), where u is a basis vector of RM(r−1,m−1). The generator matrix for this part is (0∣GRM(r−1,m−1)).
Combining these, the generator matrix for RM(r,m) has the following block structure:
Now consider an arbitrary non-zero codeword c∈RM(r,m). It is generated by a message vector, which we can partition as (a∣b), where a is the part for the top block and b is for the bottom.
Let u=a⋅GRM(r,m−1), which is a codeword in RM(r,m−1), and let v=b⋅GRM(r−1,m−1), a codeword in RM(r−1,m−1). The codeword c can be written as:
c=(u∣u+v)(22)
This is the famous Plotkin construction, or (u∣u+v) construction. The Hamming weight of c is wt(c)=wt(u)+wt(u+v). We need to find the minimum possible weight for a non-zero c.
We analyze two cases for the message (a∣b):
Case 1: b=0 and a=0
In this case, v=0 and u is a non-zero codeword in RM(r,m−1). The codeword is c=(u∣u). The weight is wt(c)=2⋅wt(u). The minimum weight in this case is twice the minimum distance of RM(r,m−1). By our inductive hypothesis, this is:
wtmin,1=2⋅dmin(RM(r,m−1))=2⋅(2(m−1)−r)=2m−r(23)
Case 2: b=0
In this case, v is a non-zero codeword in RM(r−1,m−1). Since v and u+v are vectors in a linear code, their sum v+(u+v)=u is also in a linear space. The weight of the codeword is wt(c)=wt(u)+wt(u+v). It is known from the properties of the (u∣u+v) construction that the weight of any such codeword is at least the minimum distance of the code that produces the v part.
More directly, the minimum weight of v is the minimum distance of RM(r−1,m−1). By our inductive hypothesis:
wt(v)≥dmin(RM(r−1,m−1))=2(m−1)−(r−1)=2m−r(24)
Since the second half of the codeword c is u+v, its weight is wt(u+v). The total weight is wt(c)=wt(u)+wt(u+v). The codewords form a linear code, so the minimum distance is the minimum weight of any non-zero codeword. For any codeword where v=0, its weight is at least dmin(RM(r−1,m−1))=2m−r.
Combining both cases, the minimum weight of any non-zero codeword is the minimum of the minimums from each case: