AFTD Auto-Formalizing Theoretical Domains

turan_hypergraph

def

The balanced 3-partite Turán 3-uniform hypergraph T_n on vertex set Fin n: its edges are all 3-element subsets e of Fin n such that either e meets each residue class modulo 3 in exactly one vertex, or there exists some residue class i modulo 3 such that e has two vertices congruent to i modulo 3 and one vertex congruent to i + 1 modulo 3.

Statement

def turan_hypergraph (n : ℕ) : Finset (Finset (Fin n))
Defined in
arXiv:2611.16654:378
Verified
13 Nov 2026
Axioms
none listed
Used by 2

Read back from the Lean

For a natural number n, turan_hypergraph n is defined as the collection (as a Finset) of 3-element subsets e of Fin n (the set {0, 1, …, n - 1}) such that either: 1. The elements of e have pairwise distinct residues modulo 3 (that is, the image of e under reduction modulo 3 has cardinality 3); or 2. There exists a residue class i ∈ ZMod 3 such that exactly two elements of e have residue i modulo 3 and exactly one element of e has residue i + 1 modulo 3.

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 balanced 3-partite Turán 3-graph T_n on Fin n with residue classes modulo 3. -/
def turan_hypergraph (n : ℕ) : Finset (Finset (Fin n)) := Finset.univ.filter fun (e : Finset (Fin n)) =>
    e.card = 3 ∧
    ((e.image (fun v => (v.val : ZMod 3))).card = 3 ∨
     ∃ i : ZMod 3,
       (e.filter (fun v => (v.val : ZMod 3) = i)).card = 2 ∧
       (e.filter (fun v => (v.val : ZMod 3) = i + 1)).card = 1)
See it in the graphDiscuss this resultChallenge it