two_four_code_max_card
def
For integers $q$ and $n$, $A_q(n, \{2,4\})$ is the supremum of cardinalities of finite subsets of $\mathrm{Fin}\, n \to \mathrm{Fin}\, q$ that are $\{2, 4\}$-codes.
Statement
noncomputable def two_four_code_max_card (q n : ℕ) : ℕ
- Defined in
- arXiv:2610.30613, Section 1, eq. (1)
- Verified
- 23 Oct 2026
- Axioms
- none listed
- Built on 1
- is_two_four_codeA set of codewords $C \subseteq (\mathrm{Fin}\, n \to \mathrm{Fin}\, q)$ is a $\{2, 4\}$-code if any two distinct codewords $x, y \in C$…
- Used by 7
- op_491_threshold_ge_two_q_plus_one_of_neAssuming the stabilization threshold set is nonempty, if $A_q(2q, \\{2,4\\}) \\ne 1 + \\binom{2q}{2}$, then the eventual length threshold…
- op_491_eventual_threshold_le_of_stabilizesIf a natural number $N$ has the property that $A_q(n, \\{2,4\\}) = 1 + \\binom{n}{2}$ for all integers $n \\ge N$, then the eventual…
- op_491_threshold_ge_two_q_of_neAssuming the stabilization threshold set is nonempty, if $A_q(2q - 1, \\{2,4\\}) \\ne 1 + \\binom{2q - 1}{2}$, then the eventual length…
- two_four_code_max_card_geFor every $q \ge 2$ and every $n$, $1 + \binom{n}{2} \le A_q(n,\{2,4\})$, i.e. the extremal code of the previous lemma is counted by the…
- op_491_threshold_le_two_q_minus_one_of_stabilizesIf $A_q(n, \\{2,4\\}) = 1 + \\binom{n}{2}$ holds at $n = 2q - 1$, at $n = 2q$, and for all $n \\ge 2q + 1$, then the eventual length…
- op_491_threshold_gt_of_neAssuming the stabilization threshold set is nonempty, if $A_q(n, \\{2,4\\}) \\ne 1 + \\binom{n}{2}$ for some length $n$, then $n$ is…
- two_four_eventual_thresholdFor an integer $q$, the eventual length threshold $N_*(q)$ is the infimum of all integers $N$ such that…
Read back from the Lean
Given natural numbers q (alphabet size) and n (codeword length), two_four_code_max_card q n is defined as the supremum (in ℕ) of the set of all natural numbers k such that there exists a finite set s of codewords (functions from Fin n to Fin q) of cardinality k where every pair of distinct codewords x, y ∈ s has Hamming distance 2 or 4.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- A_q(n, {2,4}): the maximum cardinality of a {2,4}-distance code of length n over an alphabet of size q. -/ noncomputable def two_four_code_max_card (q n : ℕ) : ℕ := sSup { k : ℕ | ∃ s : Finset (Fin n → Fin q), s.card = k ∧ is_two_four_code (↑s : Set (Fin n → Fin q)) }