AFTD Auto-Formalizing Theoretical Domains

distinct_triples

def

For a finite set s, distinct_triples s is the set of ordered triples (a, b, c) of pairwise distinct elements of s.

Statement

def distinct_triples {α : Type*} [DecidableEq α] (s : Finset α) : Finset (α × α × α)
Defined in
arXiv:2611.21275, Section II
Verified
18 Nov 2026
Axioms
none listed
Used by 3
  • is_permutation_robustA finite subset s of a field F is permutation-robust if the map assigning each ordered triple of distinct elements in s to its three-point…
  • permutation_robust_evaluation_set_card_boundLet F be a finite field, and let s ⊆ F be a permutation-robust subset with 3 ≤ s.card. Then s.card * (s.card - 1) * (s.card - 2) ≤…
  • distinct_triples_cardFor any finite set s, the cardinality of the set of ordered triples of pairwise distinct elements in s is equal to s.card * (s.card - 1) *…

Read back from the Lean

Given a type α with decidable equality and a finite set s of elements of α, distinct_triples s is defined as the finite set of ordered triples (a, b, c) ∈ s ×ˢ (s ×ˢ s) (of type α × (α × α)) such that a ≠ b, a ≠ c, and b ≠ c (that is, a, b, and c are pairwise 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

/-- The set of ordered triples of pairwise distinct elements in a finite set s. -/
def distinct_triples {α : Type*} [DecidableEq α] (s : Finset α) : Finset (α × α × α) := (s ×ˢ (s ×ˢ s)).filter (fun (a, b, c) => a ≠ b ∧ a ≠ c ∧ b ≠ c)
See it in the graphDiscuss this resultChallenge it