One of the fundamental theorems in coding theory is the MacWilliams identity. Let E be the coordinate set, let n=∣E∣, and let C≤FqE be a linear code over the finite field Fq, and consider its dual code
C⊥:={u∈FqE:u⋅c=0 for all c∈C}
where
u⋅c=e∈E∑uece
is the standard inner product. In this note, for a word c∈FqE, write the support of c and its Hamming weight as
supp(c)={e∈E:ce=0},wt(c)=∣supp(c)∣
respectively. Define the weight enumerator of the linear code C by
WC(X,Y):=c∈C∑Xn−wt(c)Ywt(c)
The MacWilliams identity is the formula saying that the weight enumerator of the dual code can be computed from the weight enumerator of C as follows:
WC⊥(X,Y)=∣C∣1WC(X+(q−1)Y,X−Y).
This is the MacWilliams identity.
In this series, I use proofs of the MacWilliams identity as a guide to an introduction to neighbouring areas and concepts. Accordingly, this series is aimed at readers who already know the following basic material in coding theory:
We assume familiarity, at least at a basic level, with
what a (finite) field is,
what a linear code over a finite field is,
what the Hamming weight is,
what the dual code is.
(There is no problem if you do not know a proof of the MacWilliams identity.)
This note does not assume Parts 1–6. However, to keep the perspective of the series clear, let us again begin by checking which proof family we are looking at. In this series, I look at proof methods for the MacWilliams identity under the following five broad families:
Fourier, character, and Poisson methods.
Möbius inversion, lattice-theoretic, and shortening/puncturing methods.
Orthogonal-polynomial and association-scheme methods.
Matroid and Tutte-polynomial methods.
Moment and double-counting methods.
In this note, I focus on the fourth of these: the matroid and Tutte-polynomial approach. Thus the aim of Part 7 is to use a proof of the MacWilliams identity as a guide to an introduction to the matroid associated with a code, the Tutte polynomial, and Greene's theorem connecting them.
One point to keep in mind is that this note does not develop matroid theory systematically. Matroids have many basic notions, such as independent sets, bases, circuits, closure, flats, minors, and representability. However, to reach the MacWilliams identity, what we need is the rank function obtained from a code C≤FqE, and the Tutte polynomial defined from that rank function. I am considering writing a separate article introducing matroid theory from the viewpoint of coding theory, so I leave a systematic treatment of matroid theory for that occasion. Thus, in this note, we pass through the entrance to matroids by the shortest route and put the emphasis on the relation between weight enumerators and Tutte polynomials.
From the viewpoint of coding theory, the reason matroids appear naturally is as follows. If we look only at a subset A⊆E of the coordinate set E, then the code C gives the restricted code C∣A={c∣A∈FqA∣c∈C}≤FqA. Its dimension
rC(A):=dimFq(C∣A)
measures how much of the information in the code C can be distinguished by the coordinates left in A. This function rC becomes the rank function of a matroid. On the other hand, the weight enumerator counts codewords according to the size of their supports. Thus, roughly speaking, Greene's theorem says:
From the Tutte polynomial collecting the dimensions of the restrictions to coordinate subsets, one can recover the distribution of supports of codewords.
This sentence is at the centre of the proof in this note.
The flow of the note is as follows. First, we define matroids by rank functions and construct a matroid M(C) from a code C≤FqE by rC(A)=dimFq(C∣A). Next, we check that dual codes, puncturing, and shortening correspond to duality, deletion, and contraction for matroids. After that, we introduce the Tutte polynomial
TM(x,y)=A⊆E∑(x−1)rM(E)−rM(A)(y−1)∣A∣−rM(A)
and look at special values, duality, and the deletion-contraction formula. Finally, we prove Greene's theorem
WC(X,Y)=Yn−dimC(X−Y)dimCTM(C)(X−YX+(q−1)Y,YX)
and derive the MacWilliams identity from the duality of the Tutte polynomial.
Matroids were introduced by Whitney [Whi35]. A basic reference for the matroid version of the Tutte polynomial is Crapo [Cra69], and the relation between weight enumerators of codes and Tutte polynomials is due to Greene [Gre76]. For a survey of how properties of linear codes can be read from the Tutte polynomial starting from this theorem, see Britz–Cameron [BC22]. For a standard textbook on matroid theory, see Oxley [Oxl11].
§2Matroids, from Rank Functions
In this note, we define matroids by rank functions. As the phrase "by rank functions" suggests, matroids have many equivalent definitions, connected by what is called cryptomorphism. Roughly speaking, this is similar to the way a topology can be described by open sets, closed sets, interior operators, or closure operators, with axioms for each description, and once one of them is fixed the others are determined. For matroids, there are many axiom systems, including those using independent sets, dependent sets, bases, circuits, flats, and hyperplanes. In this note, we adopt the axioms for a rank function. This is the most natural formulation for a note starting from coding theory. From a code C≤FqE, we directly obtain, for each coordinate subset A⊆E, the dimension of the restricted code C∣A. The rank function here is an abstraction of this "dimension for each subset".
In this sense, one may interpret a matroid as an abstraction of the notion of dimension appearing in linear algebra. The word "matroid", introduced by Whitney [Whi35], comes from "matrix" plus the suffix "-oid", meaning something like a matrix. Indeed, if we consider a generator matrix of a linear code, then the dimension of C∣A corresponds to the rank of the submatrix consisting of the columns labelled by A. In fact, if G is a generator matrix of C, then C∣A is the row space of the submatrix G∣A obtained by retaining only the columns of G belonging to A. That is,
rC(A)=dim(C∣A)=rank(G∣A)
Thus M(C) may also be viewed as recording the linear dependence relations among the column vectors of a generator matrix. In this sense, a matroid really can be regarded as something "matrix-like".
Definition 2.1 (Matroid).
Let E be a finite set and let r:2E→Z be an integer-valued function. The pair M=(E,r) is called a matroid if the following conditions hold for all A,B⊆E:
0≤r(A)≤∣A∣.
If A⊆B, then r(A)≤r(B).
r(A∪B)+r(A∩B)≤r(A)+r(B).
The set E is called the ground set of M, and r is called the rank function of M. When we want to emphasise M, we write rM. Also, r(A) is called the rank of A, and r(M):=r(E) is called the rank of M.
The third condition (R3)r(A∪B)+r(A∩B)≤r(A)+r(B).(R3) is called submodularity. It is obtained by replacing the equality in the dimension formula dim(V+W)+dim(V∩W)=dimV+dimW (for vector spaces V and W over a common field) by an inequality. Intuitively, it says that the sum of the amounts of information seen from two subsets separately is at least the sum of the amounts of information seen from their union and intersection. Since the Tutte polynomial can be defined using only the rank function, this definition is sufficient for this note.
Let us extract the terminology we need from the rank function. A subset I⊆E is called independent if rM(I)=∣I∣. Also, a subset B⊆E is called a basis of M (plural: bases) if rM(B)=∣B∣=rM(E). In this note, we use this terminology especially when interpreting the special value TM(2,1) of the Tutte polynomial.
An element e∈E is called a loop if rM({e})=0. Also, an element e∈E is called a coloop or an isthmus (plural: isthmi) if rM(E)−rM(E∖{e})=1.
Although we will not explain this in detail here because it is not the main topic, as already appears in Whitney's original paper [Whi35], matroids also abstract the rank of graphs. The terms "loop" and "isthmus" above come from loops and isthmi (bridges) in graphs.
Example 2.2 (Uniform matroid).
Let E be a finite set, and let 0≤k≤∣E∣=:n. Define r:2E→Z by
so it remains to check submodularity (R3)r(A∪B)+r(A∩B)≤r(A)+r(B).(R3). If ∣A∩B∣≥k, then ∣A∣,∣B∣,∣A∪B∣≥k, hence r(A)=r(B)=r(A∪B)=r(A∩B)=k, and equality holds. Thus consider the case ∣A∩B∣<k. If ∣A∪B∣≤k, then ∣A∣,∣B∣≤k, so all ranks are equal to the cardinalities of the corresponding sets, and equality again holds. Therefore it suffices to prove the case ∣A∩B∣<k<∣A∪B∣. In this case r(A∪B)=k and r(A∩B)=∣A∩B∣. If ∣A∣≥k, then by monotonicity r(B)≥r(A∩B), and hence
r(A)+r(B)≥k+r(A∩B)=r(A∪B)+r(A∩B)
The case ∣B∣≥k is the same. Finally, if ∣A∣<k and ∣B∣<k, then
This matroid is called the uniform matroid, and is denoted by Uk,n.
Uniform matroids are the basic examples supporting most of the concrete examples used in this note. In particular, the single loop, the single coloop, and the small matroids arising from the repetition code and the even-weight code can all be written as uniform matroids.
As a special case of a uniform matroid, Un,n is called the free matroid. In this case, r(A)=∣A∣ for every A⊆E. Also, in U0,n we have r(A)=0 for every A⊆E. In particular, U0,0 in the case E=∅ is called the empty matroid.
§3The Matroid Associated with a Code
We now translate the objects on the coding-theory side into the language of matroids. There is only one thing to do in this section. We restrict the code C to each coordinate subset and record the dimension. This "record of the dimensions of all restricted codes" becomes a matroid.
Let C≤FqE be a linear code and let S⊆E. If we change our viewpoint on a word c∈FqE from an E-indexed vector c=(ci)i∈E to a map from E to Fq, namely c:E→Fq,i↦ci, then the restriction map c∣S:S→Fq corresponds to the vector c∣S=(ci)i∈S obtained by taking the part indexed by S. Thus define the restricted code to S by
C∣S:={c∣S∈FqS∣c∈C}
In other words, C∣S is the punctured code CE∖S obtained from the codewords of C by deleting the coordinates in E∖S.
Proposition 3.1 (Matroid associated with a code).
For a linear code C≤FqE with finite coordinate set E, define the map
Let A,B⊆E. Using the restriction maps C∣A→C∣A∩B and C∣B→C∣A∩B, consider the vector space
P:={(u,v)∈C∣A⊕C∣B:u∣A∩B=v∣A∩B}
This P is the kernel of the map
C∣A⊕C∣B→C∣A∩B,(u,v)↦u∣A∩B−v∣A∩B
and this map is surjective. Indeed, for any w∈C∣A∩B, choose c∈C such that w=c∣A∩B. Then (c∣A,0) is sent to w by this map. Therefore, by the rank-nullity theorem,
On the other hand, restricting an element of C∣A∪B to A and to B gives an element of P, and this correspondence is injective. Thus dimC∣A∪B≤dimFqP, and so
rC(A∪B)≤rC(A)+rC(B)−rC(A∩B)
Submodularity follows.
End of proof□
The matroid M(C) on E determined by this rank function is called the matroid associated with C, or the matroid of C. Let us first look at small examples to see what this definition is observing.
Example 3.2 (Binary repetition code).
Let E={1,2,3} and consider the binary repetition code of length 3
C={000,111}≤F2E
If A=∅, then rC(A)=0. If A=∅, then C∣A is the 1-dimensional repetition code of length ∣A∣, and hence rC(A)=1. Therefore the matroid associated with C is the uniform matroid of size 3 and rank 1, namely M(C)=U1,3.
Example 3.3 (Even-weight code of length 3).
Let E={1,2,3} and consider the binary even-weight code
C={000,110,101,011}≤F2E
The rank of every singleton is 1, the rank of every two-element subset is 2, and rC(E)=2. Therefore the matroid associated with C is the uniform matroid of size 3 and rank 2, namely M(C)=U2,3.
Both examples gave uniform matroids. Of course, the matroid obtained from a code is not always a uniform matroid. (For instance, try considering the matroid associated with C={000,100,011,111}≤F2{1,2,3}.) However, the repetition code and the even-weight code are just the right size for following the later calculations of Tutte polynomials by hand.
To move towards the MacWilliams identity, we next need to handle duality and the removal of coordinates. On the coding-theory side, dual codes, punctured codes, and shortened codes appear. On the matroid side, the corresponding operations are duality, deletion, and contraction.
§4Duality, Deletion, and Contraction
To connect the Tutte polynomial with the MacWilliams identity, we need to be able to handle duality, deletion, and contraction in terms of rank functions. First, just as codes have dual codes, matroids have duals.
Definition 4.1 (Dual matroid).
Let M=(E,rM) be a matroid. Define a function r∗:2E→Z by
r∗(A):=∣A∣−rM(E)+rM(E∖A)
for each A⊆E. The pair (E,r∗) is called the dual of M, and is denoted by M∗.
The dual of a matroid is indeed a matroid, and is called the dual matroid.
Proposition 4.2.
For every matroid M, the dual M∗ is a matroid.
Proof
It suffices to check that rM∗=r∗ satisfies the axioms for the rank function of a matroid.
Also, the formula immediately gives (M∗)∗=M. As we show below, M∗ corresponds to the dual code C⊥. These facts abstract dimC⊥=∣E∣−dimC and (C⊥)⊥=C.
Proposition 4.3 (Dual codes and dual matroids).
For every linear code C≤FqE,
M(C⊥)=M(C)∗
holds.
Proof
Put k:=dimC, and let A⊆E. The kernel of the projection C⊥→C⊥∣A consists of the codewords of C⊥ that are 0 on A. If this kernel is restricted to E∖A, it can be identified with the orthogonal complement of C∣E∖A≤FqE∖A. Indeed, an element u∈C⊥ that is zero on A can be identified with a vector w on E∖A. Then, for every c∈C, we have 0=u⋅c=w⋅c∣E∖A, so w belongs to the orthogonal complement of C∣E∖A. Conversely, given such a w, extend it by zero on A. Therefore the dimension of the kernel is
Next come deletion and contraction. On the matroid side, these are defined by rank functions. On the coding-theory side, deletion corresponds to puncturing, and the operation corresponding to contraction is shortening.
Definition 4.4 (Deletion and contraction of matroids).
Let M=(E,rM) be a matroid, and let S⊆E. Define two matroids M\S and M/S on E∖S as follows: for every A⊆E∖S,
rM\S(A)rM/S(A):=rM(A),:=rM(A∪S)−rM(S)
We call M\S the deletion of S, and M/S the contraction of S. If S={e}, then instead of writing M\{e} or M/{e}, we simply write M\e or M/e.
Definition 4.5 (Puncturing and shortening of codes).
Let C≤FqE be a linear code, and let S⊆E. The code
CS:=C∣E∖S≤FqE∖S
is called the punctured code by S. Also,
C(S):={c∈C:supp(c)⊆S}≤C
is called the subcode induced by S (the subcode supported in S), and
CS:={c∣E∖S:c∈C,cs=0 for all s∈S}=C(E∖S)S≤FqE∖S
is called the shortened code by S.
To avoid confusion, let us summarise the notation in a table.
Notation
Operation
Coordinate set of the resulting code
C∣S
restrict to S
S
CS
puncture, deleting S
E∖S
CS
take codewords with 0 on S, then delete S
E∖S
C(S)
subcode of codewords whose supports are contained in S
subcode on E
The following proposition shows that deletion and contraction of matroids correspond to puncturing and shortening of codes:
Proposition 4.6 (Puncturing, shortening, deletion, and contraction).
For every linear code C≤FqE and every S⊆E,
M(CS)=M(C)\S,M(CS)=M(C)/S
holds.
Proof
Let A⊆E∖S. For puncturing,
rCS(A)=dim((C∣E∖S)∣A)=dim(C∣A)=rC(A)
so indeed M(CS)=M(C)\S.
For shortening, consider the restriction map C∣A∪S→C∣S. This map is surjective, and its kernel consists of the codewords of C that are 0 on S, restricted to A∪S. If we then remove the coordinates in S, this kernel can be identified with CS∣A. Therefore
This is the full two-dimensional space, so the associated matroid is U2,2. On the other hand, M(C)=U2,3 and U2,3\3=U2,2. Thus indeed M(C{3})=M(C)\3.
Next shorten at coordinate 3. The codewords whose coordinate 3 is 0 are 000 and 110, so
C{3}={00,11}≤F2{1,2}
This is the binary repetition code of length 2, and the associated matroid is U1,2. Also, U2,3/3=U1,2, so indeed M(C{3})=M(C)/3.
Deletion and contraction, and likewise puncturing and shortening, are dual operations. Indeed, direct calculation from the rank functions shows that for every S⊆E,
(M\S)∗=M∗/S,(M/S)∗=M∗\S
This corresponds, on the coding-theory side, to the fact that puncturing and shortening are interchanged by taking dual codes:
(CS)⊥=(C⊥)S,(CS)⊥=(C⊥)S
§5The Tutte Polynomial
We now turn to the Tutte polynomial. All the matroid information prepared so far is contained in the rank function rM. The Tutte polynomial is a two-variable polynomial that uses the rank function to count all subsets according to their rank defect and their degree of dependence. However, it is worth noting that in general one cannot recover the matroid from its Tutte polynomial.
Definition 5.1 (Tutte polynomial).
Let M=(E,rM) be a matroid. The Tutte polynomial of M is defined by
If one looks only at the defining formula, it may seem a little sudden. However, for each A⊆E, the two exponents in the summand,
rM(E)−rM(A),∣A∣−rM(A)
each have meaning. The first measures how far A falls short of the rank of the whole matroid. For the second, recall that A is independent when ∣A∣=rM(A). Thus the second measures how much dependence is contained in A, or how much room there is with respect to being dependent. The Tutte polynomial collects these two quantities over all A⊆E. The former is sometimes called the rank defect of A, and the latter the nullity of A.
The empty matroid U0,0, the single loop U0,1, and the single coloop U1,1 play an important role in the Tutte polynomial, even though they are simple examples. Let us first compute these three Tutte polynomials.
Example 5.2 (The empty matroid and one-point matroids).
For the empty matroid U0,0, the only subset in the sum is ∅, so
TU0,0(x,y)=(x−1)0−0(y−1)0−0=1
For U0,1 on the singleton E={e}, the element e is a loop, and
The empty matroid, the single loop, and the single coloop are important because they also appear as initial values for the deletion-contraction formula. In particular, the fact that a single loop gives y and a single coloop gives x appears directly in the later formula.
Example 5.3 (The Tutte polynomial of the binary repetition code).
Suppose that e is neither a loop nor a coloop. Then rM({e})=1 and rM(E)=rM(E′). The contribution from subsets not containing e is, by definition, exactly TM\e(x,y). Write a subset containing e as A∪{e}, where A⊆E′. By the rank formula for contraction,
rM/e(A)=rM(A∪{e})−1,rM/e(E′)=rM(E)−1
Therefore the contribution from subsets containing e is TM/e(x,y). Hence
TM(x,y)=TM\e(x,y)+TM/e(x,y)
End of proof□
Example 6.3 (Computing TU2,3(x,y) using the deletion-contraction formula).
Invariants of this deletion-contraction type are often treated as Tutte–Grothendieck invariants, or simply T–G invariants. For a classical survey of the basic properties, universality, and applications of the Tutte polynomial, Brylawski–Oxley [BO92] is a standard reference.
If we generalise the above formula slightly, the relation with weight enumerators becomes easier to see. Consider a matroid invariant TM(s,t,a,b) satisfying the following recursions:
TU0,0(s,t,a,b)=1,
if e is a loop, then TM(s,t,a,b)=sTM\e(s,t,a,b),
if e is a coloop, then TM(s,t,a,b)=tTM/e(s,t,a,b),
if e is neither a loop nor a coloop, then
TM(s,t,a,b)=aTM\e(s,t,a,b)+bTM/e(s,t,a,b).
The uniqueness is clear by induction on the size of the ground set. The value is determined on the empty matroid, and in the non-empty case, once an element e is chosen, the right-hand side is written in terms of matroids whose ground sets have one fewer element. By a simple renormalisation of the ordinary Tutte polynomial, the solution is obtained as follows. Here a and b are treated as invertible formal parameters. More strictly, one should work in a suitable coefficient ring, or read the formula after clearing denominators.
Proposition 6.2 that the right-hand side satisfies the four recursions above. Thus the proposition says the powerful fact that every polynomial satisfying these four recursions for deletion and contraction is obtained from the Tutte polynomial. In this sense, the Tutte polynomial can be viewed as one of the most universal matroid invariants involving deletion and contraction. This viewpoint is a shortcut to reading Greene's theorem as saying that the weight enumerator is a specialisation of the Tutte polynomial.
§7Greene's Theorem
We now connect the weight enumerator of a code with the Tutte polynomial. Let us first organise what we want to prove. The Tutte polynomial satisfies very clean recursions with respect to deletion and contraction of matroids. On the other hand, the weight enumerator of a code can also be decomposed recursively by puncturing or shortening one coordinate. Greene's theorem writes the fact that these two recursions have the same form as an explicit change of variables.
First, let us check the recursion on the side of weight enumerators. Here we fix an element e∈E and split into cases according to whether e is a loop, a coloop, or neither, in the matroid M(C). In the matroid M(C) associated with a code, e being a loop is equivalent to every codeword having 0 in coordinate e. Indeed, for rC({e})=dimC∣{e}=0 to hold, it is necessary and sufficient that C∣{e}={0}, and this is equivalent to every codeword having 0 in coordinate e.
On the other hand, e being a coloop is equivalent to the existence in C of a codeword which is non-zero only in coordinate e. This may be easier to understand by looking at duality rather than directly at ranks. A coloop is a loop in the dual matroid, and the dual matroid corresponds exactly to the dual code. Thus e being a coloop means that every codeword of the dual code C⊥ has 0 in coordinate e. A word that is non-zero only in coordinate e and zero everywhere else is orthogonal to all such vectors, hence is a codeword of C. Conversely, if C contains a codeword which is non-zero only in coordinate e and zero everywhere else, then every codeword of C⊥ has 0 in coordinate e. More algebraically, e being a coloop means that rC(E)−rC(E∖{e})=1. This is equivalent to saying that the kernel of the projection C→C∣E∖{e} is 1-dimensional. This kernel consists of all codewords whose coordinates other than e are all 0.
Proposition 7.1 (Puncturing-shortening recursion for weight enumerators).
Assume that e is a loop. Then rC({e})=0, so every codeword has 0 in coordinate e. Therefore each codeword of C is obtained by extending a codeword of C{e} by adding one zero coordinate. The weight does not change, while the length increases by 1, so the weight enumerator is multiplied by X. Hence WC(X,Y)=XWC{e}(X,Y). Formally,
Assume that e is a coloop. Then rC(E)−rC(E′)=1, so the kernel of the projection C→C∣E′=C{e} is one-dimensional. This kernel is a one-dimensional subspace supported only on coordinate e. In particular, there exists a codeword which is non-zero only in coordinate e. By subtracting a suitable scalar multiple of such a codeword from any c∈C, we can make coordinate e equal to 0 without changing the values on E′. Therefore C{e}=C{e}, and each codeword of C{e} lifts to C in q ways. Among these lifts, one has coordinate e equal to 0, while the remaining q−1 have coordinate e non-zero. The former contributes a factor X to the weight enumerator, and the latter contribute a factor Y. Thus, writing the argument formally,
Assume that e is neither a loop nor a coloop. Since it is not a coloop, we have rC(E)=rC(E′), so the projection C→C{e} is injective. Therefore each codeword of C{e} corresponds to a unique codeword of C. Since it is not a loop, the projection C→Fq to coordinate e is non-zero. Its image is the one-dimensional space Fq, so this map is surjective, and its kernel is a codimension-one subspace of C. Restricting this kernel to E′ gives C{e}. Thus the codewords of C{e} whose lift to C has 0 in coordinate e are exactly the codewords of C{e}.
We therefore split the codewords of C{e} into two parts. Those belonging to C{e} acquire one zero coordinate in C, giving a factor X. Those not belonging to C{e} acquire one non-zero coordinate, giving a factor Y.
At first glance, rC(A)=dimC∣A seems to record only "the dimension of the image visible from the coordinate set A", and does not seem to count individual codeword weights directly. However, the number of codewords whose support is contained in A is determined by ∣C(A)∣=qk−rC(E∖A). This fact is the key reason why a weight enumerator emerges from a Tutte polynomial.
Theorem 7.2 (Greene's theorem).
Let C≤FqE be a linear code, and let n=∣E∣ and k=dimC. Then
so the desired result follows immediately from the recursion. Below, however, keeping this recursive viewpoint in the background, we give a direct proof by counting supports subset by subset. The advantage is that it makes it easier to see where the factors in the change of variables come from. Also, although the right-hand side looks at first like a rational expression, the proof below shows that the denominators cancel term by term. Thus Greene's identity is an identity of polynomials.
Proof
First, since the kernel of the projection C→C∣E∖A is C(A), we have
Since ∣C∣=qk, dividing both sides by ∣C∣ gives exactly the expression for WC⊥(X,Y) obtained above.
End of proof□
§9What Matroids and Tutte Polynomials Did in This Proof
The structures used in the proof above can be summarised in three points. First, from a code C we obtain a matroid M(C) by the dimensions of coordinate restrictions, rC(A)=dim(C∣A). This rank function measures how well the coordinate subset A can distinguish the information in the code C.
Second, the dual code corresponds to the dual matroid: M(C⊥)=M(C)∗. This means that duality on the coding-theory side and duality on the matroid side are seeing the same structure.
Third, the weight enumerator is a specialisation of the Tutte polynomial:
This formula shows that the weight enumerator is not merely a direct count of codewords, but can also be recovered from rank information over all coordinate subsets.
Combining these three points, the duality of the Tutte polynomial,
TM∗(x,y)=TM(y,x)
becomes the MacWilliams identity directly. Thus, in this proof, the change of variables in the MacWilliams identity does not appear out of nowhere. It appears as the result of combining the interchange of variables in the Tutte plane with the specialisation appearing in Greene's theorem.
§10Concepts Seen in This Part
Let us organise the concepts used in this part according to their roles.
Matroids as rank functions
We defined a matroid on a finite set E as a map r:2E→Z satisfying boundedness, monotonicity, and submodularity.
Matroid associated with a code
For a linear code C≤FqE, we defined M(C) by rC(A)=dim(C∣A).
Dual matroid
We defined it by the rank function rM∗(A)=∣A∣−rM(E)+rM(E∖A). For codes, M(C⊥)=M(C)∗ holds.
Deletion and contraction
For matroids, these were defined by rM\S(A)=rM(A) and rM/S(A)=rM(A∪S)−rM(S). For codes, deletion corresponds to puncturing, and contraction corresponds to shortening.
Tutte polynomial
We defined it as a two-variable polynomial which records, for all A⊆E, the two quantities rM(E)−rM(A) and ∣A∣−rM(A) at the same time.
Greene's theorem
This theorem expresses the weight enumerator of a code as a specialisation of the Tutte polynomial of the associated matroid.
Among these, what was directly needed for the proof of the MacWilliams identity was the rank function, duality, deletion and contraction, the Tutte polynomial, and Greene's theorem. Matroid theory has many other important concepts, but this note proceeded without using them. This is not so much an omission as a choice fitted to the purpose of this part.
§11Review of This Proof Family
The proof family in this part was the "matroid and Tutte-polynomial approach". By collecting the dimensions of restricted codes over coordinate subsets, the structure of the matroid M(C) enters, and its Tutte polynomial recovers the weight enumerator. From this viewpoint, the MacWilliams identity is organised as the statement:
The operation corresponding to the dual code is, for the Tutte polynomial, the operation of interchanging the variables x and y.
This organisation explains why the MacWilliams identity emerges naturally from Greene's theorem.
The proof in this note uses the interface between coding theory and matroid theory quite directly. I hope to return on another occasion to a more systematic treatment of matroid theory from the viewpoint of coding theory, including circuits, closure, flats, simplification, minors, representability, and related notions.
For the broader reach of the Tutte polynomial itself, the handbook edited by Ellis-Monaghan–Moffatt [EM22] gives a broad view of applications to graphs, matroids, statistical physics, coding theory, knot theory, and more.
§12Next Time
Next time, we shall look at the MacWilliams identity from the side of group actions and cycle indices.
In the proof in this note, we extracted a matroid structure from the dimensions of restricted codes over coordinate subsets, and derived the MacWilliams identity from the duality of the Tutte polynomial. Next time, we shall use group actions on codewords and coordinates, and revisit the same identity in the language of orbits, Burnside's lemma, Pólya counting, and cycle indices.
Thus the protagonist next time will be
group actions -> orbits -> Burnside's lemma -> cycle indices -> MacWilliams identity
Even though it is the same MacWilliams identity, instead of looking at the "dimensions of restricted codes over coordinate subsets" as in this note, next time we will look at "averages over group actions" and "counting orbits".
Articles on this site are based on the operator's personal understanding, investigation, and research notes. I try to keep the content accurate, but it may contain errors or incomplete explanations. I do not guarantee its accuracy, completeness, usefulness, or currentness.
Please use the information on this site at your own judgment and responsibility. To the extent permitted by law, the operator is not liable for damages, losses, or disadvantages arising from using, or being unable to use, information on this site.
If you notice an error, unclear explanation, broken link, or insufficient citation, please contact the operator. I will review the content and, when appropriate, correct, update, or remove it.