TCSLib

11 Johnson Bound

11.1 Overview

This chapter proves the binary Johnson bound: for a binary code \(C\) of length \(n\) with minimum distance \(d\), if every codeword has weight at most \(w \le J_2(n,d)\) where

\[ J_2(n,d) = \frac{n}{2} - \sqrt{\frac{n(n-d)}{4}}, \]

then \(|C| \le 2n\).

The proof reduces to a Rankin bound from geometry: a set of unit vectors in \(\mathbb {R}^n\) with pairwise non-positive inner products has size at most \(2n\). Codewords are embedded via a shifted \(\{ \pm 1\} \) map so that the distance and weight constraints force the inner-product condition.

11.2 Johnson bound

Definition 11.1 Maximum admissible code size
✓
#

\(A_0(n,d,w)\) is the maximum size of an \((n,d,w)\)-admissible code.

Theorem 11.2 Johnson bound in radius form
✓

Fix integers \(n, d, w\) with \(n \ge 1\), \(1 \le d\), and \(2d \le n\), and suppose that \(w \le J_2(n,d) = \tfrac {1}{2}\bigl(n - \sqrt{n\, (n-2d)}\bigr)\). Then the maximum size \(A_0(n,d,w)\) of an \((n,d,w)\)-admissible binary code — a set of binary words of length \(n\) in which any two distinct words are at Hamming distance at least \(d\) and every word has weight at most \(w\) — satisfies

\[ A_0(n,d,w) \; \le \; 2n. \]

11.3 Additional declarations

Definition 11.3 Binary vector type
✓
#

The type of binary words of length \(n\), namely functions \(\mathrm{Fin}\, n \to \mathrm{Bool}\).

Definition 11.4 Euclidean coordinate space
✓
#

Abbreviation for the \(n\)-dimensional real Euclidean space \(\mathbb {R}^n\) with the \(\ell ^2\) inner product, i.e. EuclideanSpace \(\mathbb {R}\) \((\mathrm{Fin}\, n)\).

Definition 11.5 Hamming weight
✓
#

For a binary word \(x\) of length \(n\), its weight is the number of coordinates where \(x\) takes the value true: \(\mathrm{wt}(x) = \left\lvert \{ \, i : x_i = \texttt{true} \, \} \right\rvert \).

Definition 11.6 Hamming distance
✓
#

For binary words \(x,y\) of length \(n\), the Hamming distance is the number of coordinates on which they differ: \(\mathrm{hdist}(x,y) = \left\lvert \{ \, i : x_i \neq y_i \, \} \right\rvert \).

Definition 11.7 \(\pm 1\) embedding
✓

The map sending a binary word \(x\) to the real vector in \(\mathbb {R}^n\) whose \(i\)-th coordinate is \(-1\) if \(x_i = \texttt{true}\) and \(+1\) otherwise.

Definition 11.8 All-ones vector
✓
#

The vector in \(\mathbb {R}^n\) all of whose coordinates equal \(1\).

Definition 11.9 Shifted \(\pm 1\) vector
✓

For a real parameter \(\alpha \) and a binary word \(x\), the vector \(\hat{x}^\alpha = \mathrm{pmOne}(x) - \alpha \cdot \mathbf{1} \in \mathbb {R}^n\).

Definition 11.10 Normalization
✓
#

The rescaling \(u \mapsto \lVert u\rVert ^{-1} \cdot u\) of a vector of \(\mathbb {R}^n\).

Lemma 11.11 Coordinates of the all-ones vector
✓
#

Let \(\mathbf{1} \in \mathbb {R}^n\) be the all-ones vector. Then for every index \(i \in \{ 1, \dots , n\} \), the \(i\)-th coordinate satisfies \(\mathbf{1}_i = 1\).

Lemma 11.12 Value of the \(\pm 1\) embedding at a false coordinate
✓

Let \(x\) be a binary word of length \(n\), and let the \(\pm 1\) embedding send \(x\) to the vector in \(\mathbb {R}^n\) whose \(i\)-th coordinate is \(-1\) when \(x_i\) is true and \(+1\) when \(x_i\) is false. If the \(i\)-th entry of \(x\) is false, then the \(i\)-th coordinate of the embedded vector equals \(1\).

Lemma 11.13 Value of the ±1 embedding at a true coordinate
✓

Let \(x\) be a binary word of length \(n\), and let \(s(x) \in \mathbb {R}^n\) denote its \(\pm 1\) embedding, whose \(i\)-th coordinate is \(-1\) when \(x_i\) is true and \(+1\) when \(x_i\) is false. Then for every index \(i\) with \(x_i\) true, the \(i\)-th coordinate of \(s(x)\) equals \(-1\).

Definition 11.14 Binary Johnson radius
✓
#

The real quantity

\[ J_2(n,d) \; =\; \frac{n - \sqrt{n\, (n - 2d)}}{2}. \]
Definition 11.15 Shift parameter \(\alpha \)
✓
#

The real quantity

\[ \alpha (n,d) \; =\; \sqrt{\frac{n - 2d}{n}}. \]
Definition 11.16 Admissible code
✓

A finite set \(C\) of binary words of length \(n\) is \((n,d,w)\)-admissible when any two distinct elements of \(C\) are at Hamming distance at least \(d\) and every element of \(C\) has weight at most \(w\).

Lemma 11.17 Coordinatewise product of \(\pm 1\) embeddings
✓

Let \(x, y\) be binary words of length \(n\), and encode each as a \(\pm 1\) vector in \(\mathbb {R}^n\) by sending its \(i\)-th bit to \(-1\) when that bit is true and to \(+1\) when it is false. Then for every coordinate \(i\), the product of the \(i\)-th entries of these two embeddings equals \(1\) if \(x_i = y_i\) and \(-1\) if \(x_i \ne y_i\).

Lemma 11.18 Inner product of two ±1 embeddings
✓

For any two binary words \(x, y\) of length \(n\), let \(\phi (x), \phi (y) \in \mathbb {R}^n\) be their \(\pm 1\) embeddings, whose \(i\)-th coordinates are \(-1\) when the corresponding bit is true and \(+1\) otherwise. Then their Euclidean inner product is

\[ \langle \phi (x),\, \phi (y)\rangle \; =\; n - 2\, d(x,y), \]

where \(d(x,y)\) is the Hamming distance, the number of coordinates on which \(x\) and \(y\) differ.

Lemma 11.19 Inner product of the ±1 embedding with the all-ones vector
✓

Let \(x\) be a binary word of length \(n\), and let \(s(x) \in \mathbb {R}^n\) denote its \(\pm 1\) embedding, the vector whose \(i\)-th coordinate is \(-1\) at each position where \(x_i\) is set and \(+1\) elsewhere. Writing \(\mathbf{1}\) for the all-ones vector and \(\mathrm{wt}(x)\) for the Hamming weight of \(x\) (the number of positions at which \(x\) is set), the \(\ell ^2\) inner product satisfies

\[ \langle s(x), \mathbf{1} \rangle = n - 2\, \mathrm{wt}(x). \]
Lemma 11.20 Squared norm of the all-ones vector
✓
#

Let \(\mathbf{1} \in \mathbb {R}^n\) denote the vector all of whose coordinates equal \(1\). Then, with respect to the standard \(\ell ^2\) inner product, \(\langle \mathbf{1}, \mathbf{1} \rangle = n\).

Lemma 11.21 Bilinear expansion of the shifted inner product
✓

Let \(\alpha \in \mathbb {R}\), let \(x, y\) be binary words of length \(n\), and write \(\mathbf{1}\) for the all-ones vector in \(\mathbb {R}^n\) and \(s(x), s(y) \in \mathbb {R}^n\) for the \(\pm 1\) embeddings of \(x\) and \(y\) (with \(i\)-th coordinate \(-1\) where the corresponding bit is true and \(+1\) otherwise). Form the shifted vectors \(\hat{x}^\alpha = s(x) - \alpha \mathbf{1}\) and \(\hat{y}^\alpha = s(y) - \alpha \mathbf{1}\). Then their Euclidean inner product expands as

\[ \langle \hat{x}^\alpha ,\, \hat{y}^\alpha \rangle = \langle s(x),\, s(y) \rangle - \alpha \, \langle s(x),\, \mathbf{1} \rangle - \alpha \, \langle s(y),\, \mathbf{1} \rangle + \alpha ^2\, \langle \mathbf{1},\, \mathbf{1} \rangle . \]
Lemma 11.22 Upper bound on the shifted inner product
✓

Let \(x\) and \(y\) be binary words of length \(n\), and let \(\alpha \ge 0\). Suppose \(d\) and \(w\) are natural numbers for which the Hamming distance between \(x\) and \(y\) is at least \(d\) and the Hamming weights of \(x\) and \(y\) are each at most \(w\). Writing \(\hat{x}^\alpha \) and \(\hat{y}^\alpha \) for the corresponding shifted vectors in \(\mathbb {R}^n\) — the \(\pm 1\) embedding of the word minus \(\alpha \) times the all-ones vector — their Euclidean inner product satisfies

\[ \langle \hat{x}^\alpha , \hat{y}^\alpha \rangle \; \le \; (n - 2d) + \alpha ^2 n + 2\alpha \, (2w - n). \]
Lemma 11.23 Nonnegativity of the shift parameter
✓
#

For all natural numbers \(n\) and \(d\), the shift parameter \(\alpha (n,d) = \sqrt{(n - 2d)/n}\) satisfies \(0 \le \alpha (n,d)\).

Lemma 11.24 Square of the shift parameter
✓
#

Let \(n\) and \(d\) be natural numbers with \(n \gt 0\) and \(2d \le n\). Then the shift parameter \(\alpha (n,d)\) satisfies

\[ \alpha (n,d)^2 = \frac{n - 2d}{n}. \]
Lemma 11.25 The shift parameter is less than one
✓

Let \(n\) and \(d\) be natural numbers with \(n \ge 1\), \(d \ge 1\), and \(2d \le n\). Then the shift parameter satisfies

\[ \alpha (n,d) \; =\; \sqrt{\frac{n - 2d}{n}} \; \lt \; 1. \]
Lemma 11.26 Johnson arithmetic inequality
✓

Let \(n\), \(d\), and \(w\) be natural numbers with \(n \gt 0\) and \(2d \le n\), and write \(\alpha = \alpha (n,d)\) for the shift parameter and \(J_2(n,d)\) for the binary Johnson radius. If \(w \le J_2(n,d)\), then

\[ (n - 2d) + \alpha ^2\, n + 2\alpha \, (2w - n) \; \le \; 0. \]
Lemma 11.27 Nonpositivity of inner products under projection off a unit vector
✓
#

Let \(V\) be a real inner product space, let \(u \in V\) be a unit vector, and let \(x, y \in V\) satisfy \(\langle x, u\rangle \le 0\), \(\langle y, u\rangle \le 0\), and \(\langle x, y\rangle \le 0\). Then the components of \(x\) and \(y\) orthogonal to \(u\) again have nonpositive inner product:

\[ \langle \, x - \langle x, u\rangle \, u,\ y - \langle y, u\rangle \, u \, \rangle \le 0. \]
Lemma 11.28 Squared norm of the orthogonal component along a unit vector
✓
#

Let \(V\) be a real inner product space, let \(u \in V\) be a unit vector, so \(\lVert u\rVert = 1\), and let \(x \in V\) be arbitrary. Then

\[ \lVert x - \langle x, u\rangle \, u\rVert ^2 = \lVert x\rVert ^2 - \langle x, u\rangle ^2 . \]
Lemma 11.29 Nonvanishing of the orthogonal component
✓
#

Let \(V\) be a real inner product space, and let \(u, x \in V\) be unit vectors, \(\lVert u\rVert = 1\) and \(\lVert x\rVert = 1\), with \(\langle x, u\rangle \le 0\) and \(x \neq u\), \(x \neq -u\). Then the component of \(x\) orthogonal to \(u\) is nonzero, that is, \(x - \langle x, u\rangle \, u \neq 0\).

Lemma 11.30 Injectivity of the orthogonal projection off a unit vector
✓
#

Let \(V\) be a real inner product space, and let \(u \in V\) be a unit vector. Let \(S \subseteq V\) be a set of unit vectors each of which makes a non-positive inner product with \(u\); that is, \(\lVert x\rVert = 1\) and \(\langle x, u\rangle \le 0\) for every \(x \in S\). Then the map \(x \mapsto x - \langle x, u\rangle \, u\), which subtracts from each vector its component along \(u\), is injective on \(S\).

Definition 11.31 Orthogonal projection off a unit vector
✓
#

For \(u,v\) in a real inner product space, \(\mathrm{orthProj}(u,v) = v - \langle u,v\rangle u\), the projection of \(v\) onto the orthogonal complement of \(\mathrm{span}\{ u\} \).

Lemma 11.32 Projection off a unit vector lands in the orthogonal complement
✓

Let \(V\) be a real inner product space, and let \(u,v \in V\) with \(\lVert u\rVert = 1\). Then the vector \(v - \langle u,v\rangle \, u\) lies in the orthogonal complement \((\mathrm{span}_{\mathbb {R}}\{ u\} )^{\perp }\) of the line spanned by \(u\).

Lemma 11.33 Nonvanishing of the projection off a unit vector
✓
#

Let \(u\) and \(v\) be unit vectors in a real inner product space, and suppose that \(v \neq u\) and \(v \neq -u\). Then the projection of \(v\) onto the orthogonal complement of \(\mathrm{span}\{ u\} \), namely \(v - \langle u,v\rangle \, u\), is nonzero.

Lemma 11.34 Projection off a unit vector preserves nonpositive inner products
✓

Let \(V\) be a real inner product space, and let \(u,v,w \in V\) with \(\lVert u\rVert = 1\). Suppose the three pairwise inner products \(\langle v,w\rangle \), \(\langle v,u\rangle \), and \(\langle w,u\rangle \) are all nonpositive. For a vector \(x \in V\), write \(x - \langle u,x\rangle \, u\) for the projection of \(x\) onto the orthogonal complement of \(\mathrm{span}\{ u\} \). Then the projections of \(v\) and \(w\) again have nonpositive inner product:

\[ \bigl\langle \, v - \langle u,v\rangle \, u,\ \ w - \langle u,w\rangle \, u \, \bigr\rangle \le 0. \]
Lemma 11.35 Distinct normalized projections off a unit vector
✓

Let \(u,v,w\) be unit vectors in a real inner product space satisfying \(\langle v,u\rangle \le 0\), \(\langle w,u\rangle \le 0\), and \(\langle v,w\rangle \le 0\), and suppose that neither \(v\) nor \(w\) equals \(u\) or \(-u\) and that \(v \neq w\). For \(x\) in the space write \(\pi (x) = x - \langle u,x\rangle \, u\) for the projection of \(x\) onto the orthogonal complement of \(\mathrm{span}\{ u\} \). Then the two normalized projections \(\lVert \pi (v)\rVert ^{-1}\, \pi (v)\) and \(\lVert \pi (w)\rVert ^{-1}\, \pi (w)\) cannot be equal.

Lemma 11.36 Normalizing the projection off a unit vector yields a unit vector
✓

Let \(u,v\) be unit vectors in a real inner product space, with \(v \neq u\) and \(v \neq -u\), and set \(w = v - \langle u,v\rangle \, u\), the projection of \(v\) onto the orthogonal complement of \(\mathrm{span}\{ u\} \). Then the rescaled vector \(\lVert w\rVert ^{-1}\, w\) has norm \(1\).

Lemma 11.37 Non-positive inner product of normalized projections off a unit vector
✓

Let \(u,v,w\) be vectors in a real inner product space with \(\lVert u\rVert =1\), and suppose the three inner products \(\langle v,w\rangle \), \(\langle v,u\rangle \), and \(\langle w,u\rangle \) are all nonpositive. For a vector \(x\), write \(x^{\perp }=x-\langle u,x\rangle \, u\) for its component orthogonal to \(u\), and assume that both \(v^{\perp }\) and \(w^{\perp }\) are nonzero. Then their normalizations still have nonpositive inner product:

\[ \left\langle \frac{v^{\perp }}{\lVert v^{\perp }\rVert }, \frac{w^{\perp }}{\lVert w^{\perp }\rVert }\right\rangle \le 0. \]
Lemma 11.38 Rank of the orthogonal complement of a line
✓

Let \(V\) be a finite-dimensional real inner product space, and let \(u \in V\) be a unit vector, so that \(\lVert u\rVert = 1\). Then the orthogonal complement of the line \(\mathrm{span}_{\mathbb {R}}\{ u\} \) has dimension one less than that of \(V\):

\[ \dim _{\mathbb {R}}\bigl(\mathrm{span}_{\mathbb {R}}\{ u\} \bigr)^{\perp } = \dim _{\mathbb {R}} V - 1. \]
Lemma 11.39 Removing an element and its negation costs at most two
✓
#

Let \(S\) be a finite subset of an additive group \(V\), and let \(u \in S\). Then

\[ \left\lvert S\right\rvert \le \left\lvert \{ \, v \in S : v \neq u \text{ and } v \neq -u \, \} \right\rvert + 2. \]
Definition 11.40 Normalized projection as an element of the complement
✓
#

Given a unit vector \(u\), this packages the normalized projection \(\lVert \mathrm{orthProj}(u,v)\rVert ^{-1}\mathrm{orthProj}(u,v)\) together with its membership proof as an element of the subspace \((\mathrm{span}_{\mathbb {R}}\{ u\} )^{\perp }\).

Lemma 11.41 Underlying vector of the normalized projection
✓

Let \(V\) be a real inner product space, let \(u \in V\) be a unit vector, and let \(v \in V\). Write \(w = v - \langle u, v\rangle \, u\) for the component of \(v\) orthogonal to \(u\). The normalized vector \(\lVert w\rVert ^{-1} w\), regarded as an element of the orthogonal complement \((\mathrm{span}_{\mathbb {R}}\{ u\} )^{\perp }\) of the line spanned by \(u\), has underlying vector in \(V\) equal to \(\lVert w\rVert ^{-1} w\).

Theorem 11.42 Rankin bound in a finite-dimensional space
✓

Let \(V\) be a finite-dimensional real inner product space, and let \(S\) be a finite set of vectors in \(V\), each of norm \(1\), such that any two distinct vectors of \(S\) have non-positive inner product. Then \(\left\lvert S\right\rvert \le 2 \dim _{\mathbb {R}} V\).

Theorem 11.43 Rankin bound for pairwise obtuse unit vectors
✓

Let \(S\) be a finite set of vectors in the Euclidean space \(\mathbb {R}^n\), each of norm \(1\), such that any two distinct vectors \(u, v \in S\) satisfy \(\langle u, v\rangle \le 0\). Then \(\left\lvert S\right\rvert \le 2n\).

Lemma 11.44 Shifted \(\pm 1\) vectors are nonzero for \(\alpha \lt 1\)
✓

Let \(n \ge 1\) and let \(\alpha \) be a real number with \(0 \le \alpha \lt 1\). Then for every binary word \(x\) of length \(n\), the shifted vector \(\hat{x}^\alpha \in \mathbb {R}^n\) — obtained from the \(\pm 1\) embedding of \(x\) by subtracting \(\alpha \) times the all-ones vector — is nonzero.

Let \(n \ge 1\), let \(d, w\) be natural numbers, and let \(C\) be a finite set of binary words of length \(n\) such that any two distinct words of \(C\) are at Hamming distance at least \(d\), and every word of \(C\) has weight at most \(w\). Suppose \(\alpha \ge 0\) is a real parameter for which the shifted \(\pm 1\) vector \(\hat{x}^\alpha \) is nonzero for every \(x \in C\), and for which

\[ (n - 2d) + \alpha ^2 n + 2\alpha (2w - n) \le 0 . \]

Then \(\left\lvert C\right\rvert \le 2n\).

Let \(n \ge 1\) and let \(d\) be an integer with \(1 \le d\) and \(2d \le n\). Suppose \(C\) is a finite set of binary words of length \(n\) such that any two distinct words of \(C\) are at Hamming distance at least \(d\), and every word of \(C\) has Hamming weight at most \(w\). If \(w \le J_2(n,d)\), where \(J_2(n,d) = \tfrac {1}{2}\bigl(n - \sqrt{n(n-2d)}\bigr)\) is the binary Johnson radius, then \(\left\lvert C\right\rvert \le 2n\).

Theorem 11.47 Johnson cardinality bound for admissible constant-weight codes
✓

Let \(n \ge 1\), \(d \ge 1\), and suppose \(2d \le n\). If \(C\) is an \((n,d,w)\)-admissible code — a finite set of binary words of length \(n\) in which any two distinct words are at Hamming distance at least \(d\) and every word has weight at most \(w\) — and the weight bound satisfies \(w \le J_2(n,d)\), where \(J_2(n,d) = \tfrac {1}{2}\bigl(n - \sqrt{n(n-2d)}\bigr)\), then \(\left\lvert C\right\rvert \le 2n\).

Lemma 11.48 Uniform bound transfers to the maximum admissible code size
✓

Fix natural numbers \(n\), \(d\), \(w\) and \(K\). If every \((n,d,w)\)-admissible code \(C\) satisfies \(\left\lvert C\right\rvert \le K\), then the maximum size of an \((n,d,w)\)-admissible code satisfies \(A_0(n,d,w) \le K\).