Documentation

LeanPool.DistinctDistances.PalettePairCountCut

Close pairs on the circles with a radius cut #

Formalizes Lemma P'' (a), (b), (c) of docs/results/explicit-constant-gain-5-239-2026-10-20.md (§2) in count form, for the rows Pa, Pb, Pc of docs/results/explicit-constant-gain-1-40-2026-10-21.md (as built by scripts/verify_constant_gain_1_40.py). Thresholds are squared distances. Write P(s) = Σ_j (N_j(s) - 1) for the ordered pairs of distinct indices at squared distance at most s, R(s) for the number of palette values r with r² ≤ s, and D for the palette size.

Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t, and assume that every saturated circle (three points of the configuration on a circle about a point, with radius in the palette) of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

With the scale ρ_s and a tag (ρ, r′) of the source, the thresholds are u = (ρ/2)² ρ_s², v = r′² ρ_s², t = ρ² ρ_s², and the three bounds are the rows 𝒜(ρ) ≥ 𝒜(r′) - 2ℛ(r′), 𝒜(ρ) ≥ 𝒜(ρ/2) + 𝒜(r′) - ℛ(ρ/2) - 2ℛ(r′) and 𝒜(ρ) ≥ 𝒜(r′) - 𝒜(ρ/2) - 2ℛ(r′) + 2ℛ(ρ/2) times n². When every palette value has r² ≤ v (the case r′ = 2), P(v) = n(n - 1) and R(v) = D; the three bounds then read

Proof. At one apex i, count the ordered close pairs on the circle of each palette radius r about i, with d = d_r(i) ≤ 3 points on it. If r² ≤ u, then r² ≤ t/4, every pair on the circle is close, and the count is d(d - 1). If u < r² ≤ v and d = 3, the saturated circle carries a close pair in both orders, so the count is at least 2. Otherwise the count is at least 0. Hence the count is at least 2[r² ≤ v](d - 2) for (a), at least 2[r² ≤ u](d - 1) + 2[r² ≤ v](d - 2) for (b), and at least 2[r² ≤ v](d - 2) - 2[r² ≤ u](d - 2) for (c) (this one uses u ≤ v). Summing over the palette with Σ_{r² ≤ s} d_r(i) = N_i(s) - 1 gives the bound per apex. Under no three collinear points an ordered pair has at most two equidistant witnesses, so the total over all apexes is at most 2 P(t).

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_radius_cut {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {u v t : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) (hut : 4 * u ≤ t) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, u < ir.2 ^ 2 → ir.2 ^ 2 ≤ v → ∃ (a : Fin n) (b : Fin n), a ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ b ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ a < b ∧ dist (p a) (p b) ^ 2 ≤ t) :
∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ v}.card - 1) - 2 * ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ v}.card ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P''(a) with a radius cut, the row Pa (ρ, r′) with r′ < 2 of scripts/verify_constant_gain_1_40.py times n² (𝒜(r′) - 2ℛ(r′) - 𝒜(ρ) ≤ 0, with u = (ρ/2)² ρ_s², v = r′² ρ_s², t = ρ² ρ_s²). Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t, and suppose that every saturated circle of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

P(v) - 2 n R(v) ≤ P(t),

where P(s) = Σ_j (N_j(s) - 1) counts the ordered pairs of distinct indices at squared distance at most s and R(s) counts the palette values r with r² ≤ s.

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_radius_cut_add_short {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {u v t : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) (hut : 4 * u ≤ t) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, u < ir.2 ^ 2 → ir.2 ^ 2 ≤ v → ∃ (a : Fin n) (b : Fin n), a ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ b ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ a < b ∧ dist (p a) (p b) ^ 2 ≤ t) :
∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ u}.card - 1) + ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ v}.card - 1) - ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ u}.card - 2 * ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ v}.card ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P''(b) with a radius cut, the row Pb (ρ, r′) with r′ < 2 of scripts/verify_constant_gain_1_40.py times n² (𝒜(r′) - 2ℛ(r′) - 𝒜(ρ) + 𝒜(ρ/2) - ℛ(ρ/2) ≤ 0, with u = (ρ/2)² ρ_s², v = r′² ρ_s², t = ρ² ρ_s²). Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t, and suppose that every saturated circle of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

P(u) + P(v) - n R(u) - 2 n R(v) ≤ P(t),

where P(s) = Σ_j (N_j(s) - 1) counts the ordered pairs of distinct indices at squared distance at most s and R(s) counts the palette values r with r² ≤ s.

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_radius_cut_sub_short {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {u v t : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) (hut : 4 * u ≤ t) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, u < ir.2 ^ 2 → ir.2 ^ 2 ≤ v → ∃ (a : Fin n) (b : Fin n), a ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ b ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ a < b ∧ dist (p a) (p b) ^ 2 ≤ t) :
∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ v}.card - 1) - ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ u}.card - 1) - 2 * ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ v}.card + 2 * ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ u}.card ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P''(c) with a radius cut, the row Pc (ρ, r′) with r′ < 2 of scripts/verify_constant_gain_1_40.py times n² (𝒜(r′) - 2ℛ(r′) - 𝒜(ρ) - 𝒜(ρ/2) + 2ℛ(ρ/2) ≤ 0, with u = (ρ/2)² ρ_s², v = r′² ρ_s², t = ρ² ρ_s²). Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t, and suppose that every saturated circle of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

P(v) - P(u) - 2 n R(v) + 2 n R(u) ≤ P(t),

where P(s) = Σ_j (N_j(s) - 1) counts the ordered pairs of distinct indices at squared distance at most s and R(s) counts the palette values r with r² ≤ s.

theorem Esgk.sum_closedBall_sq_card_sub_one_eq_of_palette_sq_le {n : ℕ} {p : Config n} {v : ℝ} (hv : 0 ≤ v) (hpal : ∀ r ∈ OrderedDistanceValues p, r ^ 2 ≤ v) :
∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ v}.card - 1) = ↑n * (↑n - 1)

If every palette value has r² ≤ v and v ≥ 0, then P(v) = n(n - 1): every ordered pair of distinct indices is within squared distance v.

theorem Esgk.palette_filter_card_eq_numDistancesOrdered_of_sq_le {n : ℕ} {p : Config n} {v : ℝ} (hpal : ∀ r ∈ OrderedDistanceValues p, r ^ 2 ≤ v) :
↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ v}.card = ↑(NumDistancesOrdered p)

If every palette value has r² ≤ v, then R(v) = D.

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_bounded_palette {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {u v t : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) (hut : 4 * u ≤ t) (hpal : ∀ r ∈ OrderedDistanceValues p, r ^ 2 ≤ v) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, u < ir.2 ^ 2 → ir.2 ^ 2 ≤ v → ∃ (a : Fin n) (b : Fin n), a ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ b ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ a < b ∧ dist (p a) (p b) ^ 2 ≤ t) :
↑n * (↑n - 1) - 2 * ↑n * ↑(NumDistancesOrdered p) ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P''(a) with r′ = 2, the row Pa (ρ, 2) of scripts/verify_constant_gain_1_40.py times n² (-ε - 2𝔡 - 𝒜(ρ) ≤ -1, with u = (ρ/2)² ρ_s², v = 4 ρ_s², t = ρ² ρ_s²). Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t with every palette value r² ≤ v, and suppose that every saturated circle of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

n(n - 1) - 2 n D ≤ P(t).

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_bounded_palette_add_short {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {u v t : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) (hut : 4 * u ≤ t) (hpal : ∀ r ∈ OrderedDistanceValues p, r ^ 2 ≤ v) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, u < ir.2 ^ 2 → ir.2 ^ 2 ≤ v → ∃ (a : Fin n) (b : Fin n), a ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ b ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ a < b ∧ dist (p a) (p b) ^ 2 ≤ t) :
∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ u}.card - 1) + ↑n * (↑n - 1) - ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ u}.card - 2 * ↑n * ↑(NumDistancesOrdered p) ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P''(b) with r′ = 2, the row Pb (ρ, 2) of scripts/verify_constant_gain_1_40.py times n² (-ε - 2𝔡 - 𝒜(ρ) + 𝒜(ρ/2) - ℛ(ρ/2) ≤ -1, with u = (ρ/2)² ρ_s², v = 4 ρ_s², t = ρ² ρ_s²). Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t with every palette value r² ≤ v, and suppose that every saturated circle of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

P(u) + n(n - 1) - n R(u) - 2 n D ≤ P(t).

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_bounded_palette_sub_short {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {u v t : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) (hut : 4 * u ≤ t) (hpal : ∀ r ∈ OrderedDistanceValues p, r ^ 2 ≤ v) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, u < ir.2 ^ 2 → ir.2 ^ 2 ≤ v → ∃ (a : Fin n) (b : Fin n), a ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ b ∈ DistanceOutNeighborsAtValue p ir.1 ir.2 ∧ a < b ∧ dist (p a) (p b) ^ 2 ≤ t) :
↑n * (↑n - 1) - ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ u}.card - 1) - 2 * ↑n * ↑(NumDistancesOrdered p) + 2 * ↑n * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ u}.card ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P''(c) with r′ = 2, the row Pc (ρ, 2) of scripts/verify_constant_gain_1_40.py times n² (-ε - 2𝔡 - 𝒜(ρ) - 𝒜(ρ/2) + 2ℛ(ρ/2) ≤ -1, with u = (ρ/2)² ρ_s², v = 4 ρ_s², t = ρ² ρ_s²). Take squared thresholds 0 ≤ u ≤ v and 4u ≤ t with every palette value r² ≤ v, and suppose that every saturated circle of squared radius in (u, v] carries two distinct points within squared distance t. Under no three collinear points and the degree cap three,

n(n - 1) - P(u) - 2 n D + 2 n R(u) ≤ P(t).