Documentation

LeanPool.DistinctDistances.PalettePairCounting

Close pairs on the circles about each point #

Formalizes Lemma P of docs/results/explicit-constant-gain-1-85-2026-10-20.md (§5.2), with the row bounds (B1) that it uses. Thresholds are squared distances throughout. For a squared threshold t ≥ 0, N_j(t) counts the points q with |p_j p_q|² ≤ t, including j itself; R(u) counts the palette values r with r² ≤ u; and Q = 3D - n + 1 is the degree deficit at every vertex.

For each apex i, count the ordered pairs of distinct points within squared distance t on the circles about i over the palette. Under no three collinear points an ordered pair has at most two apexes, so the total over all apexes is at most twice the number of ordered close pairs, that is 2 Σ_j (N_j(t) - 1).

Let S be a set of palette values such that every saturated circle with radius in S carries two distinct points within squared distance t, and let K be the size of S ∪ {r : r² ≤ t/4}. A circle of squared radius at most t/4 has all its pairs close; a saturated circle with radius in S has a close pair; and the deficits at one apex sum to Q. Counting per apex gives

The row bounds 3 R(t) - Q ≤ N_j(t) - 1 ≤ 3 R(t) then give the same two lower bounds for 3 R(t).

theorem Esgk.closedBall_sq_card_eq_closePairRow_card_add_one {n : ℕ} (p : Config n) {t : ℝ} (ht : 0 ≤ t) (j : Fin n) :
{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card = (ClosePairRow p j t).card + 1

The closed ball of squared radius t ≥ 0 about a point is that point together with its close-pair row.

theorem Esgk.closedBall_sq_card_sub_one_le_three_mul_palette {n : ℕ} {p : Config n} (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {t : ℝ} (ht : 0 ≤ t) (j : Fin n) :
↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1 ≤ 3 * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ t}.card

Row bound (B1), upper side. With the degree cap three, the closed ball of squared radius t ≥ 0 about a point holds at most 3 R(t) points other than the point, where R(t) counts the palette values r with r² ≤ t.

theorem Esgk.three_mul_palette_sub_le_closedBall_sq_card_sub_one {n : ℕ} {p : Config n} (hn : 0 < n) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {t : ℝ} (ht : 0 ≤ t) (j : Fin n) :
3 * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ t}.card - (3 * ↑(NumDistancesOrdered p) - ↑n + 1) ≤ ↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1

Row bound (B1), lower side. With the degree cap three, the closed ball of squared radius t ≥ 0 about a point holds at least 3 R(t) - Q points other than the point, where R(t) counts the palette values r with r² ≤ t and Q = 3D - n + 1.

theorem Esgk.orderedClosePairs_card_eq_sum_closedBall_sq {n : ℕ} (p : Config n) {t : ℝ} (ht : 0 ≤ t) :
↑(OrderedClosePairs p t).card = ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

For t ≥ 0, the ordered close pairs are counted by the closed balls about the points, each without its center.

theorem Esgk.sum_circle_closePairs_le_apex {n : ℕ} (p : Config n) (t : ℝ) (i : Fin n) :
∑ r ∈ OrderedDistanceValues p, {ab ∈ (DistanceOutNeighborsAtValue p i r).offDiag | dist (p ab.1) (p ab.2) ^ 2 ≤ t}.card ≤ {ab ∈ OrderedClosePairs p t | dist (p i) (p ab.1) = dist (p i) (p ab.2)}.card

At one apex i, the ordered close pairs on the circles about i over the palette are ordered close pairs with i as an equidistant witness; the circles for distinct radii are disjoint.

theorem Esgk.sum_sum_circle_closePairs_le {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (t : ℝ) :
∑ i : Fin n, ∑ r ∈ OrderedDistanceValues p, ↑{ab ∈ (DistanceOutNeighborsAtValue p i r).offDiag | dist (p ab.1) (p ab.2) ^ 2 ≤ t}.card ≤ 2 * ↑(OrderedClosePairs p t).card

Upper bound for the circle pair count. Under no three collinear points, every ordered close pair has at most two equidistant witnesses, so the ordered close pairs on the circles about all apexes number at most twice the ordered close pairs.

theorem Esgk.circle_offDiag_filter_eq_of_sq_le {n : ℕ} {p : Config n} {t r : ℝ} (hr : r ^ 2 ≤ t / 4) (i : Fin n) :
{ab ∈ (DistanceOutNeighborsAtValue p i r).offDiag | dist (p ab.1) (p ab.2) ^ 2 ≤ t} = (DistanceOutNeighborsAtValue p i r).offDiag

On a circle of squared radius at most t/4 about a point, every two points are within squared distance t.

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_saturated {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) (hn : 0 < n) {t : ℝ} (ht : 0 ≤ t) {S : Finset ℝ} (hSsub : S ⊆ OrderedDistanceValues p) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, ir.2 ∈ S → ∃ (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 * (↑(S ∪ {r ∈ OrderedDistanceValues p | r ^ 2 ≤ t / 4}).card - (3 * ↑(NumDistancesOrdered p) - ↑n + 1)) ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P, saturated circles. Let S be a set of palette values such that every saturated circle about a point with radius in S carries two distinct points within squared distance t ≥ 0, and let K be the size of S ∪ {r : r² ≤ t/4} in the palette. Under no three collinear points and the degree cap three, Σ_j (N_j(t) - 1) ≥ n (K - Q), where N_j(t) counts the points within squared distance t of p_j (including j) and Q = 3D - n + 1.

theorem Esgk.sum_closedBall_sq_card_sub_one_lower_bound_short_radii {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) (hn : 0 < n) {t : ℝ} (ht : 0 ≤ t) {S : Finset ℝ} (hSsub : S ⊆ OrderedDistanceValues p) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, ir.2 ∈ S → ∃ (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 * (↑(S ∪ {r ∈ OrderedDistanceValues p | r ^ 2 ≤ t / 4}).card + 2 * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ t / 4}.card - 2 * (3 * ↑(NumDistancesOrdered p) - ↑n + 1)) ≤ ∑ j : Fin n, (↑{q : Fin n | dist (p j) (p q) ^ 2 ≤ t}.card - 1)

Lemma P, short radii. Let S be a set of palette values such that every saturated circle about a point with radius in S carries two distinct points within squared distance t ≥ 0, and let K be the size of S ∪ {r : r² ≤ t/4} in the palette. Under no three collinear points and the degree cap three, Σ_j (N_j(t) - 1) ≥ n (K + 2 R(t/4) - 2 Q), where N_j(t) counts the points within squared distance t of p_j (including j), R(t/4) counts the palette values r with r² ≤ t/4, and Q = 3D - n + 1.

theorem Esgk.three_mul_palette_lower_bound_saturated {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) (hn : 0 < n) {t : ℝ} (ht : 0 ≤ t) {S : Finset ℝ} (hSsub : S ⊆ OrderedDistanceValues p) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, ir.2 ∈ S → ∃ (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) :
↑(S ∪ {r ∈ OrderedDistanceValues p | r ^ 2 ≤ t / 4}).card - (3 * ↑(NumDistancesOrdered p) - ↑n + 1) ≤ 3 * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ t}.card

Lemma P for the palette, saturated circles: under the hypotheses of sum_closedBall_sq_card_sub_one_lower_bound_saturated, 3 R(t) ≥ K - Q.

theorem Esgk.three_mul_palette_lower_bound_short_radii {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) (hn : 0 < n) {t : ℝ} (ht : 0 ≤ t) {S : Finset ℝ} (hSsub : S ⊆ OrderedDistanceValues p) (hS : ∀ ir ∈ SaturatedDistanceIncidences p, ir.2 ∈ S → ∃ (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) :
↑(S ∪ {r ∈ OrderedDistanceValues p | r ^ 2 ≤ t / 4}).card + 2 * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ t / 4}.card - 2 * (3 * ↑(NumDistancesOrdered p) - ↑n + 1) ≤ 3 * ↑{r ∈ OrderedDistanceValues p | r ^ 2 ≤ t}.card

Lemma P for the palette, short radii: under the hypotheses of sum_closedBall_sq_card_sub_one_lower_bound_short_radii, 3 R(t) ≥ K + 2 R(t/4) - 2 Q.