Erdős #530 in Lean: inequality (2) of Theorem 2 (lower-middle-energy §2) with the exact gcd count, its real and full-row forms, and the passage (2) ⇒ (3).
New file ErdosSwarm/Erdos530RowGcd.lean (namespace ErdosSwarm.Erdos530RowGcd), imported from ErdosSwarm.lean:
exists_sidon_subset_of_int_rows_gcd B x j L hL hj hinj hsum— (2) cleared of denominators, statement exactly as displayed in the task (nohx).card_filter_mul_eq_le d c({m : ℕ} [NeZero m],d c : ℤ):#{t : ZMod m | t * (d : ZMod m) = (c : ZMod m)} ≤ if (Int.gcd d m : ℤ) ∣ c then Int.gcd d m else 0.exists_sidon_subset_real_of_int_rows_gcd, same hypotheses:((N : ℝ) − (Σ₂ : ℝ) / ((p : ℝ) * ((p : ℝ) − 1))) / p ≤ S.card.two_mul_sum_rows_le B x j L hj hx hinj(nohsum):2 * Σ₂ ≤ B.card * ((B.image x).card - 1) * (L + p - 2); proved from the acceptedholes_summand_leandtwo_mul_sum_min_le, with g ∣ p − 1.exists_sidon_subset_of_full_int_rows B x j L hL hj hfull hinj hsum,hfull : ∀ a ∈ B, ∀ i < L, ∃ b ∈ B, x b = x a ∧ j b = i: the displayed conclusion with summandL ^ 2 + L % g * (g - L % g)(from the acceptedfull_row_residue_sq_sum). Helpers also exported:sum_residue_card_mul_card,sum_pairs_eq_sum_rows,card_filter_row_residue,exists_sidon_subset_of_int_rows_gcd_aux. What differs from the task's renderings: nothing in content; argument orders as above.
Proof of (2) as in the note: all m = p(p−1) dilations t of (x, j) ↦ t·x + j in ZMod m, no collision inside a row (offsets < L ≤ m), card_filter_mul_eq_le for two rows, then the accepted Ruzsa set (Erdos530.exists_ruzsa_sidon), translate averaging and the pullback Erdos530PrimeField.exists_sidon_of_image_sidon. No private copies, no sorry, native_decide or set_option.
Documentation (no statement touched): the "not in this file" sentences of the module docstrings of RowProjection, RowPrime, RowResidues, RowPairs now point to RowGcd; NOTES.md §2 "Lean status of Theorem 2" names the new file and a new paragraph "Lean status of (2)" lists the theorems. Still stated as NOT Lean-checked: the number of primes in [Q₁, (1+η)Q₁] (prime number theorem) and hence the asymptotic (4), and the integer model for real labels. Nothing in Results.lean.
Checks on head 256aa76 + this change (two commits in my clone, 785f5e5 + 04a4684):
scripts/check.sh: exit 0, 9506 jobs, "9924 theorems use only propext, Classical.choice and Quot.sound; none of the 15476 constants under ErdosSwarm uses sorry".- A file with only
import ErdosSwarm(exit 0): (2) pasted verbatim; the other four written out and closed by the exported theorems; (2) +two_mul_sum_rows_lereproducing the accepted statement of (3);card_filter_mul_eq_leattained at m = 6, d = 4: c = 2 has exactly 2 solutions, c = 1 none (decide); labels equal modulo p: B = {0,1,30,31} ⊂ ℤ, x = a/10, j = a%10, p = 3, L = 2 (rows 0 and 3), Σ₂ = 6 bydecide, 24 ≤ 18|S| + 6, so |S| ≥ 1; (2) beating (3) (founder's instance): B = {0,…,4} ×ˢ range 3 in ℤ × ℕ, p = 5, L = 3, full-row form with Σ₂ = 96 bydecidegives 300 ≤ 100|S| + 96, so |S| ≥ 3, while the inequality of (3), 600 ≤ 200|S| + 360, holds at |S| = 2 (both bydecide).#print axiomson the five theorems and three helpers: propext, Classical.choice, Quot.sound.