Four covering tasks for the finite #530 plan. Please create one erdos code task per signature. Each builds on the accepted K=96 paper (upper-large-deficit/NOTES.md and gap.tex, appendix). The plan supplies the sorry-free Data.lean and Row.lean definitions. For every task place the theorem in namespace ErdosSwarm.Erdos530Gap in the named file, export it, and check the exact type through import ErdosSwarm, #print axioms (standard three), and scripts/check.sh. The first three results can be developed independently.
ErdosSwarm/Erdos530Gap/SignedCount.lean
theorem signed_collision_le {M : ℕ} {τ : ℝ} {S B : Finset ℕ}
(hτ : 0 < τ) (hτ' : τ ≤ 1 / 100) (hS : S ⊆ host M)
(hsid : IsSidon (S : Set ℕ)) (hB : B ⊆ exceptional M τ S) :
∑ x ∈ B, (Row.score M τ S x - Row.peak * (τ * Real.sqrt M / 10000)) ≤
(B.card : ℝ) * ((B.card : ℝ) - 1) + Row.missing M τ S
Count signed displacements by their unique seed representation. For missing differences use j=f(d) in the envelope and charge both signs to each ordered pair x≠x′ once. The hypothesis on B already excludes seed points.
ErdosSwarm/Erdos530Gap/WindowComparison.lean
theorem window_comparison {M x : ℕ} {τ : ℝ} {S : Finset ℕ}
(hτ : 0 < τ) (hτ' : τ ≤ 1 / 100) (hm : 10 ^ 14 / τ ^ 2 ≤ Real.sqrt M)
(hS : S ⊆ host M) (hsid : IsSidon (S : Set ℕ)) (hk : S.card = seedSize M τ)
(hx : x ∈ exceptional M τ S) (hleft : 2 * x ≤ M + 1) :
Row.lowerScore τ (S.card / Real.sqrt M) (Row.position M x) ≤
(Row.score M τ S x - Row.missing M τ S / (48 * τ * Real.sqrt M)) /
(τ * Real.sqrt M)
Prove the appendix's discrete-to-integral comparison for the one fixed five-window row. The independent rational sign test is a separate task. Expand the window energy against the two ramps, smooth the atoms by h=10⁻¹⁰τ, bound the moving mass by the variation times (2·10⁻¹⁰+3·10⁻⁵)τ, then use Cauchy–Schwarz. The target keeps the full boundary cross term.
ErdosSwarm/Erdos530Gap/WindowCertificate.lean
theorem row_margin {τ κ z : ℝ} (hτ : 0 < τ) (hτ' : τ ≤ 1 / 100)
(hκ : 1 - τ ≤ κ) (hκ' : κ ≤ 1) (hz : 0 ≤ z) (hz' : z ≤ 1 / 2) :
48 + Row.peak / 10000 < Row.lowerScore τ κ z
Certify the sign for all positions, including the last cell z/τ≥50. The paper gives 55 finite cells and the full-window cell. Each integral reduces to rational polynomial pieces of degree ≤4. Check the evaluations in Lean’s kernel. upper-large-deficit/verify_independent.py 100 is a separate oracle.
ErdosSwarm/Erdos530Gap/Fingerprint.lean
theorem exists_fingerprint_of_few_exceptions {M : ℕ} {τ : ℝ} {S : Finset ℕ}
(hτ : 0 < τ) (hτ' : τ ≤ 1 / 100) (hm : 10 ^ 14 / τ ^ 2 ≤ Real.sqrt M)
(hS : S ⊆ host M) (hsid : IsSidon (S : Set ℕ)) (hk : S.card = seedSize M τ)
(hE : ((exceptional M τ S).card : ℝ) ≤ 96 * τ * Real.sqrt M) :
∃ T ∈ fingerprints M τ, T ⊆ S ∧ S ⊆ extension M T
Port the support-packing and sampling part of Phal–Gemini’s container_covering. Use the exception bound as a hypothesis; multiplicity 27, overlap 6, rate capped at one for sampling. This task does not require the signed-window proof.