Manuscript Offprint
arXiv:2610.30615The Ternary and Quaternary Cases of the $\{2,4\}$-Distance Code Conjecture
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
For an integer , let be the largest cardinality of an unrestricted q-ary code of length in which any two distinct words have Hamming distance 2 or 4. We prove that
thereby settling the two remaining alphabet sizes in the conjecture of Boyvalenkov, Delchev, Zinoviev, and Zinoviev; the binary case was settled previously. The quaternary result implies the ternary result by alphabet inclusion. For , the quaternary upper bound is proved combinatorially. After normalizing one word to zero, the weight-four supports form a 2-intersecting family; exact support intersections force symbol synchronization and restrict support multiplicities. We combine the nontrivial intersection theorem with matching arguments and a three-coordinate projection lemma. The finite lengths are handled by a complete Hamming-isometry reduction to exact clique decisions, and by a smaller exact weighted-clique relaxation. All finite decisions are reproduced by two standalone integer-only C++17 verifiers provided as supplementary source files.
Keywords: few-distance code, Hamming space, ternary code, quaternary code, intersecting family, exact clique verification
2020 MSC: 94B65, 05D05, 05C35
Corresponding author.
Email addresses: 115281004@cc.ncu.edu.tw (Valjakas Djaljapayan), whyu@math.ncu.edu.tw (Wei-Hsuan Yu), yclin@math.ntnu.edu.tw (Yen-Chi Roger Lin)
1. Introduction
For an alphabet with , Hamming distance on counts the coordinates on which two words differ. If , write for the largest size of a subset for which whenever . In particular, codes need not be linear, and the alphabet need not be a field.
The classical coding-theory background is developed in [21, 26, 30, 23]. The study of prescribed-distance codes is related to Delsarte's association-scheme inequalities [12, 4, 8], to semidefinite refinements [28, 19, 6], and to intersection theorems for uniform set systems [15, 22, 16, 17, 31, 1, 2, 18, 20]. Earlier work on codes with few distances includes [13, 9, 7, 24]. The analogous Euclidean and spherical problems provide related techniques and bounds [11, 25, 3, 27, 32].
The construction
where has a distinguished nonzero symbol in positions i, j and zero elsewhere, has pairwise distances in . Thus
Boyvalenkov, Delchev, Zinoviev, and Zinoviev [7, Conjecture 1(i)] conjectured that equality holds for and every . The binary case follows from the work of Barg, Glazyrin, Kao, Lai, Tseng, and Yu [5]. We establish the two remaining cases.
Theorem 1.1. For each integer and each ,
It suffices to prove the assertion for . Indeed, if , every -ary code embeds isometrically in an -ary Hamming space, so
The construction (1) then gives the same lower bound for q = 3. This observation avoids repeating the quaternary argument in the ternary setting.
Our proof uses a support–symbol interaction specific to the forbidden odd distances. Once a word is normalized to zero, every other word has weight two or four. The family of weight-four supports is 2-intersecting; if two of those supports meet in precisely two coordinates, the symbols on their intersection must agree. Consequently, the usual unweighted intersection bounds can be strengthened by local multiplicity constraints. If all weight-four supports contain a common two-set, the remaining coordinate pairs form a graph whose matching number governs the argument. The only additional ingredient required for the four-symbol alphabet is a bound on projections to three coordinates.
These structural arguments prove the claim for . For the ten remaining lengths we use exact, reproducible finite decisions, described mathematically in Section 8. Such computer-assisted methods are standard in extremal clique calculations [10, 29]; the present verification uses neither floating-point optimization nor an unverified heuristic. The finite computations and their supporting code are logically separate from the infinite-range proof.
where consists of the words of weight . For a word , its support is , and . For a support occurring in a weight layer, its multiplicity is the number of words in that layer with support .
Lemma 2.1 (One-coordinate synchronization). Let and . If , then .
Proof. Let if , and otherwise. Since is the only common support coordinate,
This is if has weight two, and if has weight four. The distances 3 and 5 are forbidden, so .
For a code consisting of weight-two words with mutual distances in , let be its family of distinct supports. A support is isolated if it is disjoint from every other member of . Distinct words on the same support must differ in both coordinates, so each support has multiplicity at most three. If a support meets another member of , Lemma 2.1 fixes the symbol at their common coordinate; its multiplicity is therefore one. If supports are isolated, they occupy coordinates, and every other support avoids these coordinates. Consequently,
(5)
where the last inequality follows from and .
Lemma 2.2 (Two useful bounds for ). Assume . Then
If contains two distinct supports whose intersection has size two, then
Proof. Fix a word and put . Every weight-two support meets , for otherwise its distance from would be six. There are
such two-supports. Their isolated members are pairwise disjoint, so there are at most four of them. By the multiplicity observation above, each isolated support contributes at most two words beyond a baseline of one word per support. This proves (6).
For the second bound, let the two four-supports be and , where are disjoint two-sets. Every weight-two support meets both and ; inclusion-exclusion gives at most
possible supports. An isolated one meeting P uses at least one of its two coordinates, so at most two such supports exist. An isolated support avoiding P is a pair with one endpoint in A and one in B; pairwise disjoint pairs of this type form a matching in , and there are at most two. Thus there are at most four isolated supports. Adding at most eight extra words proves (7).
3. Local multiplicities on four-supports
Let denote the set of distinct supports of words in . For , write
Only these two notations, and , will be needed for the weighted support family.
Lemma 3.1 (A single four-support). Every satisfies .
Proof. Restrict the words on to their four nonzero coordinates, regarding the three nonzero symbols as an alphabet of size three. Let and put
Thus , , and . For define the ternary Krawtchouk coefficient
The standard positivity inequality gives . For completeness, choose a real orthonormal basis of functions on under the uniform inner product. Completeness yields
For each three-subset of the four coordinates, form all products with . Expanding the sum of the squares of their totals over the restricted code, and dividing by , gives exactly . This proves the required positivity without a linearity assumption.
Direct evaluation gives and . Hence , so .
Lemma 3.2 (Exact two-overlaps). Let be distinct and satisfy . Then . Moreover, if another support satisfies and , then .
Proof. Put . If is supported on and on , their four coordinates in the symmetric difference already contribute distance four. Thus must agree on . In particular, all words on have the same two symbols on . Two distinct such words can differ only on , and they must differ in both remaining coordinates. Projection to either one is injective into the three nonzero symbols, giving . Interchanging gives the other bound.
If gives a distinct exact-overlap pair, then comparisons with words on and fix the symbols of every word on on the union of two distinct two-subsets of . This union has size at least three. Two different words on would then be at distance at most one, an impossibility. Hence .
Lemma 3.3 (The support family is 2-intersecting). For all distinct one has .
Proof. Choose words on and put . With the number of unequal nonzero symbols on the common support,
Since , we obtain .
4. Three-coordinate projections
The following two elementary lemmas isolate the only genuinely quaternary local calculation.
Lemma 4.1 (Distance-two sets in three coordinates). If , where , has for every pair of distinct words, then .
Proof. If there is nothing to prove. Otherwise normalize two words to 000 and 110 by coordinatewise symbol permutations. A third word at distance two from both has one of the forms
At most one word of each of the last two forms can occur. The word 220 cannot occur together with either form, because its distance from either is three. Consequently .
Lemma 4.2 (Three-coordinate projection). Suppose , , has all mutual distances in . Project onto any three coordinates. If no two projected words have distance three, then .
Proof. The projection is injective: otherwise two distinct original words would differ only in the omitted coordinate. Denote the projected set by , and for let be the omitted symbol. For distinct the projected distance is one or two, and
Make a graph on Y by joining words at projected distance two. The value of f is constant on each connected component. Consequently, all distinct vertices within a component have projected distance two, and Lemma 4.1 bounds each component by four.
If there is just one component, this proves the result. Otherwise words from different components have projected distance one. If every component is a singleton, all words in Y have pairwise distance one; fixing two shows that all words differ only in the same coordinate, so .
Finally, suppose one component contains two words; normalize them to 000, 110. A word outside this component must have distance one from both, and hence is 100 or 010. If exactly one of these occurs, say 100, any additional word in the component must be of the form with ; at most one such word can occur because two of them would be at distance one. If both 100 and 010 occur, there is no additional word in the component. Thus in all cases.
Lemma 4.3 (The antipodal shell). Let have distance three, where . Set
Join two elements of when their distance is two. The resulting graph is triangle-free.
Proof. Normalize and . The six elements of are the permutations of 012. Each such element has exactly three neighbors at distance two, and those three neighbors are pairwise at distance three. For example, the neighbors of 012 are 021, 102, 210. Thus no vertex belongs to a triangle.
Lemma 4.4 (Cross-families in a triangle-free graph). Let be triangle-free, and let nonempty satisfy the following conditions: for , every , are equal or adjacent; ; and each independent has size at most three. Then
Proof. If some contains an edge , every vertex of any other must be or ; a different vertex adjacent to both would create a triangle. Hence the total is at most .
Otherwise every is independent. If at most one of these sets has size three, the sum is at most . If two have size three, call them . Their intersection has size at most one, since two distinct common vertices would be nonadjacent within but required to be adjacent by cross-compatibility. Choose distinct and , which are adjacent. Every vertex in a third set belongs to by triangle-freeness, and that third set, being independent, contains at most one of them. Thus the total is at most (the case is immediate).
Lemma 4.5 (Common three-core bound). Suppose consists of s distinct supports all containing the same three-set. Then
Proof. Let the common three-set be Q. Every support in T has the form . Projection of the words on any one support to Q is injective, because two distinct words with the same projection would have distance one.
If every support has multiplicity at most four, the sum is at most 4s. Otherwise choose a support with . For , Lemma 3.1 gives , as needed. Assume . By Lemma 4.2, the projected words on contain a pair at distance three.
For a different support , let be the set of three-coordinate projections of its words. The two distinct leaf coordinates of and contribute distance two. Thus every has ; neither can be zero since . Hence
Label each vertex by the nonzero symbol in the leaf coordinate of the corresponding word on . If two projected vertices are adjacent in the distance-two shell graph, their leaf symbols agree, since otherwise the original distance would be three. Hence the leaf symbol is constant on each connected component of the induced shell graph. Any two vertices in one component must have projected distance two, since they have the same leaf symbol and the full distance is either two or four; the projected distance is at most three. Therefore each component is a clique and has size at most two by Lemma 4.3. Different components have different leaf symbols: two vertices of different components with equal leaf symbols would have projected distance two and would be adjacent. There are three nonzero leaf symbols, so ; moreover, if is independent in the shell graph, then .
For distinct supports , their two leaf coordinates contribute distance two. Their projected sets therefore satisfy the cross-condition of Lemma 4.4: each pair of projected words is equal or is at distance two. Applying that lemma to the sets gives
As , the full sum is at most .
Corollary 4.6. If at most three distinct four-supports occur and every pair intersects in three coordinates, then their total multiplicity is at most 21. If all four-supports lie within a fixed five-set, then .
Proof. If every multiplicity is at most four, the bounds are 12 and 20, respectively. Otherwise fix a support of multiplicity at least five. For each other support , the same projection and antipodal shell argument in the proof of Lemma 4.5, using as the three-coordinate projection, gives . Thus the totals are at most and , respectively. Distinct four-subsets of a five-set always intersect in three coordinates.
5. Intersection and matching structure
We use the following specialization of the complete nontrivial intersection theorem of Ahlswede and Khachatrian [1]:
if and is 2-intersecting with no common two-set, .
(11)
The cited theorem, with intersection parameter and block size , yields . For clarity, a common two-set means a fixed two-element set contained in every member of .
We also need two familiar elementary structural facts.
Lemma 5.1 (Two intersection and matching facts). (i) If a family of distinct four-sets has pairwise intersections of size at least three, then either every set contains a common three-set, or all sets are four-subsets of a fixed five-set.
(ii) If a simple graph has no two disjoint edges, then its edges have a common vertex or the graph is contained in a triangle.
Proof. For (i), choose distinct and with . If some third set does not contain , its intersections with force it to be for some . Any further member, compared with these three sets, must lie in . Otherwise is common to all members. For (ii), take incident edges . An edge avoiding must be in order to meet both; any other edge meeting all three of is also one of those three edges. Cases with at most one edge are immediate.
The Erdős–Gallai matching theorem [14] will be used in the form: a simple graph on vertices with no matching of size three has at most edges.
Lemma 5.2 (No common two-set). Assume . If H is 2-intersecting, has no common two-set, and contains two supports meeting in exactly two coordinates, then
Proof. Choose with of size two and write , , where are pairwise disjoint two-sets. Since is not common, choose not containing . Split the supports into
For any subfamily , denote its excess over one word per support by .
First, the excess on is at most eight. If has multiplicity greater than one, then by the two-intersection property and the fact that is distinct from . Moreover,
The two intersection sizes cannot both be two: in that case the corresponding exact-overlap pairs are different, and Lemma 3.2 would force . Consequently their sizes are two and three in some order. The supports of type are precisely
and the supports of type are with . Within either group of four supports, at most two can have multiplicity greater than one. Indeed, any three pairs chosen from a grid include two with different first and second indices. Their supports intersect in exactly B, respectively A, and this gives a second exact-overlap pair, forcing multiplicity one. Each of the at most four remaining supports has multiplicity at most three by Lemma 3.2. Hence
Next, bound the excess on . Put . If , every equals with a two-set . There are at most six such supports, and each meets in exactly two positions. Thus each has multiplicity at most three and the excess on is at most 12.
Suppose . Write and ; then . Represent by a graph on the coordinates outside , with an edge for each support . Every edge of meets . Call an edge exceptional if it is contained in ; there are at most three. Every other edge is ordinary and its support meets in exactly two coordinates. An ordinary edge therefore has multiplicity at most three.
If has two disjoint edges, an ordinary edge with multiplicity greater than one must meet every edge of . Otherwise it would have two different exact-overlap pairs, one from and one from its disjoint external edge, contradicting Lemma 3.2. Relative to two fixed disjoint edges, any edge meeting both is a cross-edge in a . At most two of those cross-edges can meet every edge, because the universal cross-edges are themselves pairwise intersecting. Their total excess is therefore at most . If exceptional edges occur, the corresponding supports intersect pairwise in three positions. Their total multiplicity is at most 9 for , at most 15 for by Lemma 4.5, and at most 21 for by Corollary 4.6. Their excess is therefore at most 18 in every case. Thus the excess on is at most .
If has no two disjoint edges, Lemma 5.1(ii) says that is contained in a triangle or is a star. For a triangle, at most three supports occur in ; they pairwise intersect in three positions, so their total multiplicity is at most 21. Therefore their excess is at most 21. If is a star centered outside , all its edges must lead into , so it has at most three ordinary edges; their excess is at most .
Finally, suppose is a star centered at . At most two star edges are exceptional. By Lemma 4.5, their total multiplicity is at most 15. For every ordinary edge with , comparison with a word on fixes the two symbols on the same pair . If two different ordinary leaves exist, comparison of their words forces the symbol at the other coordinate of P to agree: otherwise the two leaf coordinates contribute two and that additional disagreement gives the forbidden distance three. Thus all three common-core symbols agree across ordinary leaves, and each ordinary support has multiplicity one; two words on it could otherwise differ only at the leaf coordinate. If at most one ordinary leaf exists, its multiplicity is at most three. Hence if t ordinary edges occur, their total multiplicity is at most . Adding at most 15 words on exceptional edges shows that the excess on is at most 17.
In every case, the excess on is at most 22. Together with (13), the complete nontrivial intersection bound (11) now yields
6. When a common two-set exists
Assume all supports in contain a fixed two-set . Associate a graph on by putting exactly when . The matching number of is the largest number of pairwise disjoint edges in .
Lemma 6.1 (Three disjoint external edges). If has three pairwise disjoint edges and , then
Proof. Let be disjoint edges of and choose words on . Any two of these supports intersect only in , so their external coordinates already contribute distance four. Consequently the three words agree on . An arbitrary word in has an external pair disjoint from at least one of the three edges, hence comparison with that word forces the same symbols on . Deleting is thus an isometry from to a pure weight-two code of length . Equation (5) gives the first bound.
Every weight-two support must meet each of , since a disjoint two-support would produce distance six. A two-set avoiding cannot meet all three disjoint , so every weight-two support meets . Label . The possibilities are , and for . For , compare with a four-word whose external pair avoids : Lemma 2.1 fixes the symbol at . Thus this support has multiplicity at most one, and similarly for .
If any such noncore support occurs, comparing with it fixes one coordinate of every weight-two word on , so that also has multiplicity at most one. This gives words. If no noncore support occurs, the multiplicity on is at most three, also at most . This proves the second bound.
Lemma 6.2 (A matching of size two). Suppose G contains two disjoint edges but no matching of size three. For ,
Proof. Choose disjoint edges . Let be the set of edges of meeting both and . It is contained in the between the endpoint sets of and , so . All codewords corresponding to edges outside have the same two symbols on : the words on and agree on , and each other edge outside is disjoint from or . Delete from this part of . We obtain a pure weight-two code whose distinct supports are the edges of . Its support graph has at most two isolated edges, since three isolated edges would form a matching of size three in . The first inequality in (5) bounds this part by words.
The supports corresponding to X contribute at most 15 words. Indeed, with zero or one edge this follows from Lemma 3.1. Two opposite edges have disjoint external parts, so each has multiplicity at most three; two adjacent edges have a common three-set, so Lemma 4.5 bounds their combined multiplicity by 15. If three cross-edges occur, the two opposite edges have multiplicity at most three and the third at most nine, giving 15. If all four cross-edges occur, each has a disjoint opposite edge and hence multiplicity at most three, giving at most 12.
The Erdős–Gallai theorem gives . Consequently
Lemma 6.3 (No two disjoint external edges). Suppose has no two disjoint edges. If lies in a triangle, then . If is a star with at most two edges, then . If is a star with at least three edges and , then
Proof. The first two assertions follow from Lemma 3.1: there are at most three or two supports, respectively. In the remaining case every external edge contains a common vertex , so all four-supports contain the same three-set . If there are distinct supports, then . By Lemma 4.5,
for .
There are at least three distinct leaf coordinates. A two-set avoiding Q meets at most two of the four-supports and would therefore be disjoint from a third, which is impossible for a weight-two support. Thus every weight-two support meets Q. There are supports meeting Q in exactly one coordinate. On any such support , comparison with a four-word on a leaf other than v fixes the symbol at i and hence forces multiplicity one. The three two-supports lying inside Q have multiplicity at most three each. Therefore .
7. The combinatorial range
Theorem 7.1. For every , a quaternary -code has size at most .
Proof. Normalize as in (4). If is empty, use (5). Otherwise (6) holds, and the support family is 2-intersecting by Lemma 3.3.
Suppose first that H has no common two-set. If every two supports intersect in at least three coordinates, Lemma 5.1(i) and the absence of a common three-set show that all supports lie in a five-set. Corollary 4.6 and (6) give
Otherwise two supports intersect in precisely two coordinates. Lemmas 2.2 and 5.2 give
For , both (17) and (18) are at most . Indeed, for the second and closer estimate,
the first estimate is already strictly smaller at n = 16 and has smaller linear growth.
Now suppose every member of H contains a common two-set, and form its external graph G. If G has a matching of size three, Lemma 6.1 gives
If G has a matching of size two but none of size three, then two four-supports meet in exactly two coordinates, and Lemmas 2.2 and 6.2 give
Finally, if has no two disjoint edges, use Lemma 6.3. In the triangle case, ; for a star with at most two edges, ; and for a star with at least three edges, . All of these are at most at , and their linear increments are strictly smaller than the successive increments of for . Every structural possibility has been covered.
8. Finite verification for
The following is an exact finite proof, not a numerical optimization estimate. Two supplementary C++17 programs implement the mathematical procedures below using integer representations and exhaustive coloring branch-and-bound. All reported runs were executed for this version of the manuscript.
8.1. The normalized candidate graph
Suppose C were a counterexample. By (5), its weight-four layer is nonempty. Fix one four-word and apply a Hamming isometry fixing zero to normalize it to
Let consist of all with and . Make a graph on by joining distinct words whose Hamming distance is two or four. The code minus is then a clique in . Thus a counterexample to would give a clique of size at least in .
The candidate count can be computed exactly. For weight two, the support meets the first four coordinates in one or two places, yielding respectively and 30 choices. For weight four, the intersection size is two, three, or four, yielding respectively , , and 40 choices. Hence
To see the intermediate factors: for support overlap two, both common symbols must be 1; the two other coordinates each have three nonzero choices. For overlap three, there are allowed common-symbol patterns, three choices for the outside nonzero symbol, and four choices of common support. For overlap four, exactly two or four of the four symbols differ from 1, giving . The weight-two count follows by the same distance formula.
8.2. The range
The group fixing both 0 and z permutes the first four coordinates, permutes the remaining ones, fixes 0 and 1 on the first four coordinates while possibly exchanging 2, 3, and permutes the three nonzero symbols independently in the other coordinates. Its orbits on are classified by the triple
There are exactly eight orbits, with triples
Fix one representative from each orbit. If contains a clique of size , then for at least one representative the induced graph on its neighbors contains a clique of size . This is an equivalence, since the stabilizer maps any selected clique vertex to the representative of its orbit.
Our exact verifier constructs from its definition, verifies (19), enumerates the eight triples (20), and tests all eight forbidden clique sizes. It returns NO in every case. The total recursion counts in Table 1 are reproducibility data, not assumptions needed for the correctness proof.
8.3. The range n = 14, 15
The structural estimates already cover every case except when has no common two-set and two supports meet in exactly two coordinates. Indeed, if every two supports meet in three coordinates, (17) applies; a common-two-set family is covered by Lemmas 6.1–6.3. Substituting into those estimates gives the desired upper bound in all such cases.
Table 1: Independent exact clique decisions for the eight orbit representatives. In every row the forbidden clique size in is .
| n | forbidden size | total recursive nodes | |
|---|---|---|---|
| 6 | 460 | 15 | 2141 |
| 7 | 736 | 21 | 3416 |
| 8 | 1066 | 28 | 1446 |
| 9 | 1450 | 36 | 2055 |
| 10 | 1888 | 45 | 2888 |
| 11 | 2380 | 55 | 6752 |
| 12 | 2926 | 66 | 29437 |
| 13 | 3526 | 78 | 130166 |
For the remaining case, relabel coordinates so that two four-supports are
(Here coordinates are labeled only for this finite calculation.) Every occurring four-support meets both and in at least two positions. The number of possible four-supports satisfying these two conditions is
namely 139 for and 159 for . To obtain this count, a candidate containing is determined by any two of the remaining coordinates. If it contains exactly one point of , there are possibilities; if it avoids , it must be , which gives the last one.
For each candidate four-support , introduce eight abstract states:
(a) a light state of weight 1;
(b) six heavy states, one for each two-subset , each of weight 3;
(c) a free state of weight 9.
States belonging to the same support are not adjacent. States on distinct supports are adjacent precisely when and, if , neither state is free and any heavy state must be indexed by the pair . This defines a finite weighted graph.
Lemma 8.1 (Soundness of the support-state relaxation). For every actual code with the fixed supports , the supports of its weight-four layer admit states forming a clique in the weighted graph, with total state weight at least . The state of and the state of can each be restricted to the light state or the heavy state indexed by .
Proof. Consider any occurring support . If it has no exact two-overlap with another occurring support, assign its free state; Lemma 3.1 bounds its multiplicity by nine. If all exact-overlap pairs are the same two-set , assign the heavy state indexed by ; Lemma 3.2 bounds its multiplicity by three. If two different exact-overlap pairs occur, assign its light state; the second assertion of Lemma 3.2 forces multiplicity one. All pairs of assigned states are adjacent by construction, because exact intersections exclude a free state and force any heavy index to equal the intersection. The assigned state weights dominate the corresponding multiplicities, proving the first claim. Since and have the exact-overlap pair , neither can be free, and any heavy state on either support must use .
Since is not common, some third support avoids containing . Up to permutations fixing the ordered pair , the possible intersection types of have representatives
Indeed, write
The conditions , , and give exactly , , and . After the two allowed choices for each of the states of , and compatibility of the third state, there are respectively 1, 1, 4, 4 forced-state choices in these four types: ten cases in total.
A complete weighted-clique decision procedure on these ten cases excludes a total state weight of at least 55 for and at least 67 for . These are exactly the thresholds required for the theorem: Lemma 2.2 gives at and at . A counterexample of cardinality at least 93, respectively 107, would therefore require , respectively 67. The reproduced integer-only search statistics are
| n | supports | abstract states | forced cases | recursive nodes |
|---|---|---|---|---|
| 14 | 139 | 1112 | 10 | 58 |
| 15 | 159 | 1272 | 10 | 27 |
The entries report a NO decision for every forced case.
8.4. Why the exact searches are exhaustive
For an ordinary or weighted graph, let a recursive node contain a clique already selected and a set of vertices compatible with all selected vertices. Properly color the induced candidate graph by a deterministic greedy procedure, obtaining independent classes . For ordinary cliques, a clique extension uses at most k vertices. For weighted cliques, an extension has weight at most
The algorithm branches on a chosen vertex v by including v and intersecting the remaining candidates with its neighborhood, or by excluding v. These two alternatives partition all possible extensions. A branch is discarded only when the weight already selected plus the proper-coloring upper bound is strictly below the forbidden threshold. Induction on the number of remaining candidates proves that this returns NO if and only if the forbidden clique cannot occur.
Both supplied implementations strengthen this bound by ordering vertices in successive color classes and using the valid bound for every prefix of that order. This is a standard exact branch-and-bound optimization, not a change in the decision problem. All vertex generation, distance comparisons, colorings, weights, and branch decisions use integers. In particular, the state graph is only a relaxation: its negative decision proves the required bound for real codeword configurations without presupposing that every state clique is realizable.
Theorem 8.2 (Finite range). For , every quaternary -code has size at most .
Proof. The pure weight-two case follows from (5). For , the normalized candidate graph and all eight orbits are covered by the exact decisions of Table 1. For , the structural bounds cover all but the no-common-core exact-overlap case, and Lemma 8.1 reduces that case to the ten weighted decisions just described. Their negative answers exclude any counterexample. In all cases the decisions are exhaustive by the preceding correctness argument.
9. Completion and reproducibility
Proof of Theorem 1.1. The standard construction (1) gives the lower bound. Theorems 7.1 and 8.2 give the quaternary upper bound for every .
Finally, (3) gives the ternary upper bound, and the same construction attains equality for .
Data and code availability. The two supplementary programs are
q34_small_exact.cpp q34_weighted_exact.cpp
They implement the independent finite decision reductions using standard C++17 and no external libraries. Exact console outputs for the eight small dimensions and two weighted dimensions are included as supplementary logs. A reproducible compiler command is
g++ -03 -std=c++17 SOURCE.cpp -o verifier
Run the first executable with each integer argument 6, ..., 13 and the second with 14 or 15. The source files regenerate all graph vertices and adjacencies from their mathematical definitions; there are no hard-coded clique certificates or external data files.
Declaration of AI-assisted preparation. OpenAI ChatGPT was used to assist with manuscript organization, editing, mathematical cross-checking, and construction of independent verification software. The authors are responsible for all mathematical claims, program outputs, citations, and final submission. The exact verifiers do not invoke an AI system.
References
[1] R. Ahlswede and L. H. Khachatrian, The complete nontrivial-intersection theorem for systems of finite sets, J. Combin. Theory Ser. A 76 (1996), 121–138.
[2] R. Ahlswede and L. H. Khachatrian, The complete intersection theorem for systems of finite sets, European J. Combin. 18 (1997), 125–136.
[3] E. Bannai, E. Bannai, and D. Stanton, An upper bound for the cardinality of an s-distance subset in real Euclidean space, II, Combinatorica 3 (1983), 147–152.
[4] E. Bannai and T. Ito, Algebraic Combinatorics I: Association Schemes, Benjamin/Cummings, 1984.
[5] A. Barg, A. Glazyrin, W.-J. Kao, C.-Y. Lai, P.-C. Tseng, and W.-H. Yu, On the size of maximal binary codes with 2, 3, and 4 distances, Combinatorial Theory 4 (2024), no. 1, Paper 7. https://doi.org/10.5070/C64163844.
[6] C. Bachoc, D. C. Gijswijk, A. Schrijver, and F. Vallentin, Invariant semidefinite programs, in Handbook on Semidefinite, Conic and Polynomial Optimization, Springer, 2012, pp. 219–269.
[7] P. Boyvalenkov, K. Delchev, D. V. Zinoviev, and V. A. Zinoviev, On two-weight codes, Discrete Math. 344 (2021), 112318. https://doi.org/10.1016/j.disc.2021.112318.
[8] A. E. Brouwer, A. M. Cohen, and A. Neumaier, Distance-Regular Graphs, Springer, 1989.
[9] R. Calderbank and W. M. Kantor, The geometry of two-weight codes, Bull. London Math. Soc. 18 (1986), 97–122.
[10] R. Carraghan and P. M. Pardalos, An exact algorithm for the maximum clique problem, Oper. Res. Lett. 9 (1990), 375–382.
[11] P. Delsarte, J.-M. Goethals, and J. J. Seidel, Spherical codes and designs, Geom. Dedicata 6 (1977), 363–388.
[12] P. Delsarte, An Algebraic Approach to the Association Schemes of Coding Theory, Philips Res. Rep. Suppl. 10 (1973), 1–97.
[13] H. Enomoto, P. Frankl, N. Ito, and K. Nomura, Codes with given distances, Graphs Combin. 3 (1987), 25–38.
[14] P. Erdős and T. Gallai, On maximal paths and circuits of graphs, Acta Math. Acad. Sci. Hungar. 10 (1959), 337–356.
[15] P. Erdős, C. Ko, and R. Rado, Intersection theorems for systems of finite sets, Quart. J. Math. Oxford Ser. (2) 12 (1961), 313–320.
[16] P. Frankl, On intersecting families of finite sets, J. Combin. Theory Ser. A 24 (1978), 146–161.
[17] P. Frankl and R. M. Wilson, Intersection theorems with geometric consequences, Combinatorica 1 (1981), 357–368.
[18] P. Frankl and N. Tokushige, Extremal Problems for Finite Sets, American Mathematical Society, 2018.
[19] D. C. Gijswijk, A. Schrijver, and H. Tanaka, New upper bounds for nonbinary codes based on the Terwilliger algebra and semidefinite programming, J. Combin. Theory Ser. A 113 (2006), 1719–1731.
[20] C. Godsil and K. Meagher, Erdős–Ko–Rado Theorems: Algebraic Approaches, Cambridge University Press, 2016.
[21] R. W. Hamming, Error detecting and error correcting codes, Bell System Tech. J. 29 (1950), 147–160.
[22] A. J. W. Hilton and E. C. Milner, Some intersection theorems for systems of finite sets, Quart. J. Math. Oxford Ser. (2) 18 (1967), 369–384.
[23] W. C. Huffman and V. Pless, Fundamentals of Error-Correcting Codes, Cambridge University Press, 2003.
[24] I. Landjev, A. Rousseva, and K. Vorobev, Constructions of binary codes with two distances, Discrete Math. 346 (2023), 113337.
[25] D. G. Larman, C. A. Rogers, and J. J. Seidel, On two-distance sets in Euclidean space, Bull. London Math. Soc. 9 (1977), 261–267.
[26] F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, North-Holland, 1977.
[27] O. R. Musin, Spherical two-distance sets, J. Combin. Theory Ser. A 116 (2009), 988–995.
[28] A. Schrijver, New code upper bounds from the Terwilliger algebra and semidefinite programming, IEEE Trans. Inform. Theory 51 (2005), 2859–2866.
[29] E. Tomita and T. Kameda, An efficient branch-and-bound algorithm for finding a maximum clique with computational experiments, J. Global Optim. 37 (2007), 95–111.
[30] J. H. van Lint, Introduction to Coding Theory, 3rd ed., Springer, 1999.
[31] R. M. Wilson, The exact bound in the Erdős–Ko–Rado theorem, Combinatorica 4 (1984), 247–257.
[32] A. Glazyrin and W.-H. Yu, Upper bounds for s-distance sets and equiangular lines, Adv. Math. 330 (2018), 810–833.