AFTD Auto-Formalizing Theoretical Domains

IsTrifferentCode

def

For an implicit natural number $n$, a finite set of ternary words $C : \mathrm{Finset}\,(\mathrm{Fin}\,n \to \mathrm{Fin}\,3)$ satisfies IsTrifferentCode if for all $x, y, z \in C$, if $x \ne y$, $y \ne z$, and $x \ne z$, then $\neg\,\mathrm{trifferent\_is\_bad}\,x\,y\,z$.

Statement

def IsTrifferentCode {n : ℕ} (C : Finset (Fin n → Fin 3)) : Prop
Defined in
arXiv:2611.33212, Section 1
Verified
28 Nov 2026
Axioms
none listed
Built on 1
  • trifferent_is_badA triple of ternary words $x, y, z \in (\mathrm{Fin}\,3)^n$ of blocklength $n$ is bad if it has no rainbow coordinate, that is, for every…
Used by 1
  • trifferent_code_alteration_lemmaLet $n$ be an implicit natural number, $\mu$ a probability measure on $\mathrm{Fin}\,n \to \mathrm{Fin}\,3$, and $M$ a natural number with…

Read back from the Lean

Given a natural number n, a finite set C of functions from Fin n to Fin 3 satisfies IsTrifferentCode if and only if for all x, y, z ∈ C, if x ≠ y, y ≠ z, and x ≠ z (i.e., x, y, and z are pairwise distinct), then ¬ trifferent_is_bad x y z. In other words, it is not the case that for every coordinate i : Fin n, the set {x i, y i, z i} has cardinality at most 2 (equivalently, there exists a coordinate i where x i, y i, and z i are all distinct).

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 ternary code is trifferent if every three distinct codewords have a rainbow coordinate. -/
def IsTrifferentCode {n : ℕ} (C : Finset (Fin n → Fin 3)) : Prop := ∀ x ∈ C, ∀ y ∈ C, ∀ z ∈ C, x ≠ y → y ≠ z → x ≠ z → ¬ trifferent_is_bad x y z
See it in the graphDiscuss this resultChallenge it