Documentation

LeanPool.DistinctDistances.ApexPairCount

Apex count of ordered pairs with a radius predicate #

Formalizes the counting part of Steps Ant and Apex in docs/results/refined-constant-gain-2026-10-19.md. Under no three collinear points, the ordered witness deficiency Σ_Φ (2 - α) of any set Φ of ordered distinct pairs is at most 2 n Q, where Q = 3D - n + 1. Let R be a symmetric irreflexive relation on indices and G a radius predicate with ¬G 0, such that every apex of an R-pair sees it at a radius in G, and no circle of such a radius about an apex carries an R-triangle. With the degree cap three, each apex z then sees at most 4/3 ordered R-pairs per point q with G |zq|. Combining both bounds gives 6 |Φ_R| ≤ 6 n Q + 4 Σ_z #{q : G |zq|}. The far-pair case R a b := s < |ab|, G := (s < ·) gives |Φ| ≤ 3 n Q from the apex and circle hypotheses alone.

theorem Esgk.sum_two_sub_witnesses_le {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) {Φ : Finset (Fin n × Fin n)} (hΦ : Φ ⊆ Finset.univ.offDiag) :
∑ ab ∈ Φ, (2 - ↑(IndexedEquidistantWitnesses p ab.1 ab.2).card) ≤ 2 * ↑n * (3 * ↑(NumDistancesOrdered p) - ↑n + 1)

Ordered witness deficiency for any set of ordered distinct pairs. Under no three collinear points every ordered base pair has at most two equidistant witnesses, so the deficiency over Φ is at most the full off-diagonal deficiency, and the palette bound on the witness total gives 2 n Q.

theorem Esgk.six_mul_card_pairs_le_of_apex {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) (R : Fin n → Fin n → Prop) [DecidableRel R] (hirr : ∀ (a : Fin n), ¬R a a) (hsymm : ∀ (a b : Fin n), R a b → R b a) (G : ℝ → Prop) [DecidablePred G] (hG0 : ¬G 0) (hrad : ∀ (z a b : Fin n), R a b → dist (p z) (p a) = dist (p z) (p b) → G (dist (p z) (p a))) (htri : ∀ (z a b c : Fin n), dist (p z) (p a) = dist (p z) (p b) → dist (p z) (p a) = dist (p z) (p c) → G (dist (p z) (p a)) → R a b → R b c → R a c → False) :
6 * ↑{ab ∈ Finset.univ.offDiag | R ab.1 ab.2}.card ≤ 6 * ↑n * (3 * ↑(NumDistancesOrdered p) - ↑n + 1) + 4 * ∑ z : Fin n, ↑{q : Fin n | G (dist (p z) (p q))}.card

Total apex count with a radius predicate. Under the hypotheses of three_mul_apexPairs_card_le, no three collinear points, and the degree cap three, the ordered R-pairs satisfy 6 |Φ_R| ≤ 6 n Q + 4 Σ_z #{q : G |zq|}, where Q = 3D - n + 1.

theorem Esgk.farOrderedPairs_card_le_of_apex {n : ℕ} {p : Config n} (hp : Function.Injective p) (hgp3 : EuclideanGeometry.NonTrilinear ↑p.toFinset) (hcap : ∀ (i : Fin n) (r : ℝ), (DistanceOutNeighborsAtValue p i r).card ≤ 3) {s : ℝ} (hs : 0 ≤ s) (hapex : ∀ (z a b : Fin n), s < dist (p a) (p b) → dist (p z) (p a) = dist (p z) (p b) → s < dist (p z) (p a)) (hcirc : ∀ (z a b c : Fin n), dist (p z) (p a) = dist (p z) (p b) → dist (p z) (p a) = dist (p z) (p c) → s < dist (p z) (p a) → s < dist (p a) (p b) → s < dist (p b) (p c) → s < dist (p a) (p c) → False) :
↑(FarOrderedPairs p s).card ≤ 3 * ↑n * (3 * ↑(NumDistancesOrdered p) - ↑n + 1)

Far-pair apex count from apex and circle hypotheses. If every apex of a pair farther than s is farther than s from its ends, and no circle of radius greater than s about an index carries three points pairwise farther than s, then under no three collinear points and the degree cap three the number of ordered pairs farther than s is at most 3 n Q, where Q = 3D - n + 1.

theorem Esgk.card_offDiag_filter_eq_sum_rows {n : ℕ} (R : Fin n → Fin n → Prop) [DecidableRel R] (hirr : ∀ (a : Fin n), ¬R a a) :
{ab ∈ Finset.univ.offDiag | R ab.1 ab.2}.card = ∑ a : Fin n, {q : Fin n | R a q}.card

Count an irreflexive relation on ordered distinct pairs row by row.