AFTD Auto-Formalizing Theoretical Domains

permutation_robust_evaluation_set_card_bound

theoremverifiedformalization

Let 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) ≤ Fintype.card F - 2, and in particular if Fintype.card F = r ^ 3 for some natural number r, then s.card ≤ r + 1.

Statement

theorem permutation_robust_evaluation_set_card_bound {F : Type*} [Field F] [Fintype F] [DecidableEq F] (s : Finset F) (hs : is_permutation_robust s) (hcard : 3 ≤ s.card) : s.card * (s.card - 1) * (s.card - 2) ≤ Fintype.card F - 2 ∧ ∀ (r : ℕ), Fintype.card F = r ^ 3 → s.card ≤ r + 1
Formalizes
arXiv:2611.21275, Proposition 18
Verified
19 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 7
  • 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…
  • 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) *…
  • three_point_ratio_ne_zeroIn a field F, if a ≠ b and a ≠ c, then three_point_ratio a b c ≠ 0.
  • three_point_ratio_ne_oneIn a field F, if a ≠ b and b ≠ c, then three_point_ratio a b c ≠ 1.
  • nat_cube_bound_of_triples_leFor natural numbers n and r with 3 ≤ n, if n * (n - 1) * (n - 2) ≤ r ^ 3 - 2, then n ≤ r + 1.
  • distinct_triplesFor a finite set s, distinct_triples s is the set of ordered triples (a, b, c) of pairwise distinct elements of s.
  • three_point_ratioFor elements a, b, c in a field F, three_point_ratio a b c is defined as (c - a) / (b - a).

Read back from the Lean

Let $F$ be a finite field with decidable equality, and let $s$ be a finite subset of $F$. Assume that: 1. $s$ is permutation-robust (is_permutation_robust s), and 2. the cardinality of $s$ is at least 3 ($3 \le |s|$). Then: 1. $|s|(|s| - 1)(|s| - 2) \le |F| - 2$ (in $\mathbb{N}$), and 2. for every natural number $r$, if $|F| = r^3$, then $|s| \le r + 1$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof uses a counting argument on the three-point ratio map f(a, b, c) = (c - a) / (b - a). Because s is permutation-robust, f is injective on the set of distinct triples from s, which has cardinality |s|(|s| - 1)(|s| - 2). Since distinct triples have pairwise distinct coordinates, f avoids 0 and 1, mapping into F \ {0, 1} of cardinality |F| - 2, which gives |s|(|s| - 1)(|s| - 2) ≤ |F| - 2. When |F| = r^3, an arithmetic lemma for cubic polynomials converts this upper bound into |s| ≤ r + 1.

  1. The three-point ratio map f(a, b, c) = (c - a) / (b - a) sends the set of distinct triples from s into F \ {0, 1}.

    We define f(a, b, c) = (c - a) / (b - a). Let y be any element in the image of distinct triples from s under f, meaning y = f(a, b, c) for some triple with a, b, c ∈ s pairwise distinct (a ≠ b, a ≠ c, and b ≠ c). Since a ≠ c, the numerator is nonzero, so y ≠ 0 by three_point_ratio_ne_zero. Since b ≠ c, the numerator differs from the denominator, so y ≠ 1 by three_point_ratio_ne_one. Thus y ∉ {0, 1}, showing that the image is a subset of {0, 1}ᶜ.

    lines 3–12

    uses Finset.mem_compl, Finset.mem_insert, Finset.mem_singleton, not_or, Finset.mem_image, Finset.mem_filter, three_point_ratio_ne_zero, three_point_ratio_ne_one

      let f : F × F × F → F := fun x => match x with | (a, b, c) => three_point_ratio a b c
      have h_sub : Finset.image f (distinct_triples s) ⊆ ({0, 1} : Finset F)ᶜ := by
        intro y hy
        rw [Finset.mem_compl, Finset.mem_insert, Finset.mem_singleton, not_or]
        rw [Finset.mem_image] at hy
        rcases hy with ⟨⟨a, b, c⟩, ht, rfl⟩
        dsimp [distinct_triples] at ht
        rw [Finset.mem_filter] at ht
        rcases ht with ⟨-, hab, hac, hbc⟩
        exact ⟨three_point_ratio_ne_zero hab hac, three_point_ratio_ne_one hab hbc⟩
  2. |s| * (|s| - 1) * (|s| - 2) ≤ |F| - 2.

    By subset monotonicity of cardinality (Finset.card_le_card), the cardinality of the image is at most |{0, 1}ᶜ|. Since 0 ≠ 1 (zero_ne_one), the set {0, 1} has cardinality 2 (Finset.card_pair), so its complement in F has cardinality |F| - 2 (Finset.card_compl). Because s is permutation-robust (hs), f is injective on the distinct triples of s, meaning the image has the same cardinality as the set of distinct triples (Finset.card_image_of_injOn). That set has size |s| * (|s| - 1) * (|s| - 2) by distinct_triples_card, establishing the inequality.

    lines 13–15

    uses Finset.card_le_card, Finset.card_image_of_injOn, distinct_triples_card, Finset.card_compl, Finset.card_pair, zero_ne_one

      have h_card_le : (Finset.image f (distinct_triples s)).card ≤ (({0, 1} : Finset F)ᶜ).card :=
        Finset.card_le_card h_sub
      rw [Finset.card_image_of_injOn hs, distinct_triples_card, Finset.card_compl, Finset.card_pair zero_ne_one] at h_card_le
  3. The inequality |s| * (|s| - 1) * (|s| - 2) ≤ |F| - 2 holds, and if |F| = r^3, then |s| ≤ r + 1.

    The first conjunct is the inequality just proved. For the second conjunct, assuming |F| = r^3, substituting this into the inequality gives |s| * (|s| - 1) * (|s| - 2) ≤ r^3 - 2. Since |s| ≥ 3, the arithmetic lemma nat_cube_bound_of_triples_le immediately implies |s| ≤ r + 1.

    lines 16–18

    uses nat_cube_bound_of_triples_le

      refine ⟨h_card_le, fun r hr => ?_⟩
      rw [hr] at h_card_le
      exact nat_cube_bound_of_triples_le hcard h_card_le
Finset.mem_compl
An element belongs to the complement of a finset if and only if it does not belong to the finset.
Finset.mem_insert
An element belongs to the insertion of b into a finset s if and only if it equals b or belongs to s.
Finset.mem_singleton
An element b belongs to the singleton {a} if and only if b = a.
not_or
The negation of a disjunction ¬(p ∨ q) is equivalent to ¬p ∧ ¬q.
Finset.mem_image
An element b belongs to the image of a finset under f if and only if there exists some element a in the finset such that f(a) = b.
Finset.mem_filter
An element belongs to the filtered finset if and only if it belongs to the original finset and satisfies the predicate.
three_point_ratio_ne_zero
For pairwise distinct elements a, b, c in a field, the three-point ratio (c - a) / (b - a) is nonzero whenever a ≠ c and a ≠ b.
three_point_ratio_ne_one
For pairwise distinct elements a, b, c in a field, the three-point ratio (c - a) / (b - a) is not equal to 1 whenever b ≠ c and a ≠ b.
Finset.card_le_card
If s is a subset of t, then the cardinality of s is at most the cardinality of t.
Finset.card_image_of_injOn
If f is injective on a finset s, the image of s under f has the same cardinality as s.
distinct_triples_card
The number of distinct ordered triples (a, b, c) from a finset s is |s| * (|s| - 1) * (|s| - 2).
Finset.card_compl
The cardinality of the complement of a finset s in a finite type F is the cardinality of F minus the cardinality of s.
Finset.card_pair
A pair of distinct elements {a, b} has cardinality 2.
zero_ne_one
The element 0 is not equal to 1.
nat_cube_bound_of_triples_le
For natural numbers n ≥ 3 and r, if n * (n - 1) * (n - 2) ≤ r^3 - 2, then n ≤ r + 1.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- Proposition 18: Counting upper bound on permutation-robust evaluation sets. -/theorem permutation_robust_evaluation_set_card_bound {F : Type*} [Field F] [Fintype F] [DecidableEq F] (s : Finset F) (hs : is_permutation_robust s) (hcard : 3 ≤ s.card) : s.card * (s.card - 1) * (s.card - 2) ≤ Fintype.card F - 2 ∧ ∀ (r : ℕ), Fintype.card F = r ^ 3 → s.card ≤ r + 1 := by  let f : F × F × F → F := fun x => match x with | (a, b, c) => three_point_ratio a b c  have h_sub : Finset.image f (distinct_triples s) ⊆ ({0, 1} : Finset F)ᶜ := by    intro y hy    rw [Finset.mem_compl, Finset.mem_insert, Finset.mem_singleton, not_or]    rw [Finset.mem_image] at hy    rcases hy with ⟨⟨a, b, c⟩, ht, rfl⟩    dsimp [distinct_triples] at ht    rw [Finset.mem_filter] at ht    rcases ht with ⟨-, hab, hac, hbc⟩    exact ⟨three_point_ratio_ne_zero hab hac, three_point_ratio_ne_one hab hbc⟩  have h_card_le : (Finset.image f (distinct_triples s)).card ≤ (({0, 1} : Finset F)ᶜ).card :=    Finset.card_le_card h_sub  rw [Finset.card_image_of_injOn hs, distinct_triples_card, Finset.card_compl, Finset.card_pair zero_ne_one] at h_card_le  refine ⟨h_card_le, fun r hr => ?_⟩  rw [hr] at h_card_le  exact nat_cube_bound_of_triples_le hcard h_card_le
See it in the graphDiscuss this resultChallenge it