Erdős #588 in Lean (sharp f₃, part c1): at least n² − 3n good ordered pairs modulo n.
What changed (on main b885d9c):
- NEW ErdosSwarm/Erdos588Count.lean, namespace ErdosSwarm.Erdos588 (imports Mathlib.Tactic only; no geometry, no reals):
theorem sq_sub_le_card_goodPairs (n : ℕ) : n ^ 2 - 3 * n ≤ ((Finset.range n ×ˢ Finset.range n).filter fun p : ℕ × ℕ => p.1 ≠ p.2 ∧ ∃ l ∈ Finset.range n, l ≠ p.1 ∧ l ≠ p.2 ∧ n ∣ p.1 + p.2 + l + 1).card— the task's displayed statement verbatim, every n including 0.sq_le_card_goodPairs_add (n) : n ^ 2 ≤ #(goodPairs n) + 3 * n(same without natural subtraction;goodPairs nis that filter, as a def).- For part c2:
sylvesterThird n i j := n - 1 - (i + j) % n,sylvesterThird_lt,sylvesterThird_comm,dvd_add_iff_eq_sylvesterThird(for l < n: n ∣ i + j + l + 1 ↔ l = sylvesterThird n i j, i.e. the third index exists and is unique), andmem_goodPairs(p ∈ goodPairs n ↔ p.1 < n ∧ p.2 < n ∧ p.1 ≠ p.2 ∧ third ≠ p.1 ∧ third ≠ p.2).
- ErdosSwarm.lean:
import ErdosSwarm.Erdos588Count. Results.lean unchanged.
Proof as in the task: the n² pairs are covered by the good ones, the diagonal, {third = i} and {third = j}; each of the last three has at most n elements (first/second coordinate is injective on it, by cancelling mod n).
Status: Lean-checked supporting lemma; no result about f₃ yet.
Checks I ran on b885d9c + this change:
- scripts/check.sh rc=0. Last lines: Build completed successfully (9255 jobs). 6296 theorems use only propext, Classical.choice and Quot.sound; none of the 10633 constants under ErdosSwarm uses sorry
- Scratch file after
import ErdosSwarm(rc=0): the displayed statement for general n and for n = 0; the form without subtraction; the uniqueness lemma written withn - 1 - (i + j) % n; and bydecide:(goodPairs 6).card = 6 ^ 2 - 3 * 6,(goodPairs 7).card = 7 ^ 2 - 3 * 7 + 2(consistent with the founder's brute force: equality iff 3 ∣ n). #print axiomson sq_sub_le_card_goodPairs, sq_le_card_goodPairs_add, mem_goodPairs, dvd_add_iff_eq_sylvesterThird: [propext, Classical.choice, Quot.sound].
Note: this and my part-b submission (t-e72a526b65) each add one import line to ErdosSwarm.lean, on different sides of import ErdosSwarm.Erdos588Monotone.