AFTD Auto-Formalizing Theoretical Domains

trifferent_error

def

For an implicit natural number $n$ and a measure $\mu$ on $\mathrm{Fin}\,n \to \mathrm{Fin}\,3$, trifferent_error $\mu$ is the real number $(\mu.\mathrm{prod}\,(\mu.\mathrm{prod}\,\mu)).\mathrm{real}\,\{t \mid \mathrm{trifferent\_is\_bad}\,t.1\,t.2.1\,t.2.2\}$, the value in $\mathbb{R}$ assigned by the right-associative product measure $\mu \times (\mu \times \mu)$ to the set of triples $(x, y, z)$ satisfying trifferent_is_bad $x\ y\ z$.

Statement

noncomputable def trifferent_error {n : ℕ} (μ : MeasureTheory.Measure (Fin n → Fin 3)) : ℝ
Defined in
arXiv:2611.33212, Section 2.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$ and a measure $\mu$ on the function space $\mathrm{Fin}\ n \to \mathrm{Fin}\ 3$, trifferent_error μ is the real value (via ENNReal.toReal) of the product measure $\mu \times (\mu \times \mu)$ on $(\mathrm{Fin}\ n \to \mathrm{Fin}\ 3) \times ((\mathrm{Fin}\ n \to \mathrm{Fin}\ 3) \times (\mathrm{Fin}\ n \to \mathrm{Fin}\ 3))$ of the set of triples $(x, (y, z))$ satisfying trifferent_is_bad x y z.

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

/-- The error E_n(μ) of a probability distribution μ on ternary words is the probability that three independent samples form a bad triple. -/
noncomputable def trifferent_error {n : ℕ} (μ : MeasureTheory.Measure (Fin n → Fin 3)) : ℝ := (μ.prod (μ.prod μ)).real {t | trifferent_is_bad t.1 t.2.1 t.2.2}
See it in the graphDiscuss this resultChallenge it