The sharp same-side chord bound on an (apex distance, radius) box #
Formalizes Lemma C and Lemma C′ of docs/results/explicit-constant-gain-5-239-2026-10-20.md
(§2), the chord evaluator chord_sq_box / Chords._adapt of
scripts/verify_constant_gain_5_239.py, which scripts/verify_constant_gain_1_40.py uses for
the chord side conditions C(I, t). All lengths carry the scale ρ; thresholds are squared.
Setting. Let c be a centre, ρ > 0, and let three points q i lie in the annulus
σ²ρ² ≤ |x - c|² ≤ ρ², all at the same distance r = Rρ from an apex p with
|p - c| = Aρ. In the frame with p - c on the positive first axis, a point of the circle is
q = p + (X, Y) with X² + Y² = r² and |q - c|² = (A² + R²)ρ² + 2AρX, so the annulus
condition reads X / r ∈ [L, L + w] with
L = (σ² - A² - R²) / (2AR), w = (1 - σ²) / (2AR).
Two of the three points lie on the same side of the axis (three_has_same_transverse_side).
- Cosine window (
same_side_inner_ge_of_mem_cosine_window,same_side_chord_sq_le_of_mem_cosine_window): two points of a circle of radiusron the same side of a diameter, with first coordinates in[r u, r v], have inner product at leastr² (u v + √(1 - u²) √(1 - v²)); the proof compares the anglesarccos (X / r)and uses thatcosdecreases on[0, π]. - Arc window. With
clthe clamp to[-1, 1](unitClamp), the arcf(L, w) = arccos (cl L) - arccos (cl (L + w))is nondecreasing inw; for fixedw ≥ 0it is nondecreasing on(-∞, -1], nonincreasing on[-1, -w/2], nondecreasing on[-w/2, 1 - w]and nonincreasing on[1 - w, ∞). The middle pieces come from the derivative1/√(1 - (m + w/2)²) - 1/√(1 - (m - w/2)²) ≥ 0ofm ↦ arccos (m - w/2) - arccos (m + w/2)on[0, 1 - w/2]and the symmetryarccos (-x) = π - arccos x. Hence on[Llo, Lhi]the maximum off(·, w)is atLlo,Lhi,-1(if inside) or1 - w(if inside). - Box lemma (
exists_dist_sq_le_of_mem_chord_box, Lemma C′): on the boxA ∈ [a0, a1],R ∈ [r0, r1], a lower boundβofcos fat the candidates, stated without square roots (WindowCosineBound), gives a pair at squared distance at most2 r1² (1 - β) ρ². The trivial cell gives4 r1² ρ²(exists_dist_sq_le_four_mul_sq). - Box tree (
ChordBoxTree): rational boxes refined at midpoints, asChords._adapt, with a structurally recursiveBoolcheck overℚ(ChordBoxTree.check) and its soundness (ChordBoxTree.exists_dist_sq_le_of_check);chordApexCellsCheckcombines the apex cells of[σ, 1]for one radius cell andchordRadiusCellsCheckcombines radius cells for one target.chordTableCheckchecks a table of radius cells with one bound per cell (proved once), andchordTableBoundCheckreads off a range from it without re-checking the trees. The checks are meant to be discharged bydecide +kernel.
The cosine window #
Cosine window (Lemma C, inner-product form). Two points (X, Y), (X', Y') of the
circle of radius r > 0 about the origin on the same side of the first axis (0 ≤ Y Y'),
whose first coordinates lie in the window [r u, r v] with -1 ≤ u and v ≤ 1, have inner
product at least r² (u v + √(1 - u²) √(1 - v²)), the value at the two ends of the window.
Cosine window (Lemma C, chord form). Two points of the circle of radius r > 0 about
the origin on the same side of the first axis, with first coordinates in [r u, r v]
(-1 ≤ u, v ≤ 1), are at squared distance at most
2 r² (1 - (u v + √(1 - u²) √(1 - v²))).
The arc window #
The clamp of a real number to [-1, 1], max (-1) (min 1 x) (cl of Lemma C).
Equations
- Esgk.unitClamp x = max (-1) (min 1 x)
Instances For
The square-root-free form of β ≤ u v + √((1 - u²)(1 - v²)) at the clamped window
u = cl L, v = cl (L + w) of Lemma C′: either β ≤ u v, or (β - u v)² ≤ (1 - u²)(1 - v²).
It says that β is at most the cosine of the arc arccos (cl L) - arccos (cl (L + w)).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The box lemma #
Lemma C′ (box lemma). Let three points q i lie in the annulus
σ²ρ² ≤ |q i - c|² ≤ ρ², all at the same distance r from an apex p, with
a0 ρ ≤ |p - c| ≤ a1 ρ and r0 ρ ≤ r ≤ r1 ρ, 0 < a0, 0 < r0 and σ² ≤ a0² + r0²
(for instance σ ≤ a0). Let Llo, Lhi, w bound the window of the box,
Llo ≤ (σ² - a1² - r1²)/(2 a0 r0), (σ² - a0² - r0²)/(2 a1 r1) ≤ Lhi,
(1 - σ²)/(2 a0 r0) ≤ w (stated multiplied out), and let β satisfy the square-root-free
candidate condition WindowCosineBound β L w at L = Llo, L = Lhi, L = -1 when
-1 ∈ [Llo, Lhi] and L = 1 - w when 1 - w ∈ [Llo, Lhi]. Then two of the three points are
at squared distance at most 2 r1² (1 - β) ρ². This is chord_sq_box of
scripts/verify_constant_gain_5_239.py with β its worst_cos, in units of ρ.
The trivial cell of Lemma C′. Three points at the same distance r ≤ r1 ρ from an
apex contain a pair at squared distance at most 4 r1² ρ² (the chord is at most 2r). This is
the r0 = 0 cell 4 r1² of scripts/verify_constant_gain_5_239.py.
The box tree over the rationals #
The clamp to [-1, 1] on rationals; its cast to ℝ is unitClamp.
Equations
- Esgk.unitClampRat x = max (-1) (min 1 x)
Instances For
The rational check of WindowCosineBound β L w, with products in place of squares.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The rational check of one box [a0, a1] × [r0, r1] of Lemma C′ with cosine bound β
against the squared target T: 0 < a0, 0 < r0, σ² ≤ a0² + r0², the candidate conditions
at the exact window ends Llo = (σ² - a1² - r1²)/(2 a0 r0), Lhi = (σ² - a0² - r0²)/(2 a1 r1)
and width w = (1 - σ²)/(2 a0 r0), and 2 r1² (1 - β) ≤ T. This is chord_sq_box ≤ target
of scripts/verify_constant_gain_5_239.py.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A refinement tree of a rational (apex distance, radius) box [a0, a1] × [r0, r1], as the
adaptive refinement Chords._adapt of scripts/verify_constant_gain_5_239.py: leaves carry
the bound of Lemma C′ or the trivial bound, inner nodes halve the box at midpoints.
- cert
(β : ℚ)
: ChordBoxTree
A leaf certified by Lemma C′ with the rational cosine bound
β(chordBoxCheck). - disk : ChordBoxTree
A leaf certified by the trivial bound
4 r1²(any box, in particularr0 = 0). - split
(t₁ t₂ t₃ t₄ : ChordBoxTree)
: ChordBoxTree
Quartering at the midpoints
am,rm: the children are the boxes[a0, am] × [r0, rm],[a0, am] × [rm, r1],[am, a1] × [r0, rm]and[am, a1] × [rm, r1]. - splitApex
(t₁ t₂ : ChordBoxTree)
: ChordBoxTree
Halving the apex interval:
[a0, am] × [r0, r1]and[am, a1] × [r0, r1]. - splitRadius
(t₁ t₂ : ChordBoxTree)
: ChordBoxTree
Halving the radius interval:
[a0, a1] × [r0, rm]and[a0, a1] × [rm, r1].
Instances For
The structurally recursive check of a box tree on the box [a0, a1] × [r0, r1] for the
annulus parameter σ and the squared target T: every cert leaf passes chordBoxCheck
and every disk leaf has 4 r1² ≤ T. Rational arithmetic only, for decide +kernel.
Equations
- One or more equations did not get rendered due to their size.
- Esgk.ChordBoxTree.check σ T (Esgk.ChordBoxTree.cert β) x✝³ x✝² x✝¹ x✝ = Esgk.chordBoxCheck σ T x✝³ x✝² x✝¹ x✝ β
- Esgk.ChordBoxTree.check σ T Esgk.ChordBoxTree.disk x✝³ x✝² x✝¹ x✝ = decide (4 * (x✝ * x✝) ≤ T)
- Esgk.ChordBoxTree.check σ T (t₁.splitApex t₂) x✝³ x✝² x✝¹ x✝ = (Esgk.ChordBoxTree.check σ T t₁ x✝³ ((x✝³ + x✝²) / 2) x✝¹ x✝ && Esgk.ChordBoxTree.check σ T t₂ ((x✝³ + x✝²) / 2) x✝² x✝¹ x✝)
- Esgk.ChordBoxTree.check σ T (t₁.splitRadius t₂) x✝³ x✝² x✝¹ x✝ = (Esgk.ChordBoxTree.check σ T t₁ x✝³ x✝² x✝¹ ((x✝¹ + x✝) / 2) && Esgk.ChordBoxTree.check σ T t₂ x✝³ x✝² ((x✝¹ + x✝) / 2) x✝)
Instances For
Soundness of the box tree. If t.check σ T a0 a1 r0 r1 = true, then for every
configuration of three points q i of the annulus σ²ρ² ≤ |q i - c|² ≤ ρ² at a common
distance r from an apex p with a0 ρ ≤ |p - c| ≤ a1 ρ and r0 ρ ≤ r ≤ r1 ρ, two of the
points are at squared distance at most T ρ². This is Chords._adapt of
scripts/verify_constant_gain_5_239.py returning True on the box, in units of ρ.
The check of the apex cells [a, a₁], [a₁, a₂], …, [a_{k-1}, a_k] with a_k ≥ 1 (the list
holds the pairs (a_m, tree_m)), all for the radius cell [r0, r1]: every tree passes
ChordBoxTree.check on its cell. Started at a = σ it is the 32 apex cells of
Chords.holds_on of scripts/verify_constant_gain_5_239.py for one radius cell.
Equations
- Esgk.chordApexCellsCheck σ T r0 r1 x✝ [] = false
- Esgk.chordApexCellsCheck σ T r0 r1 x✝ ((a', t) :: rest) = (Esgk.ChordBoxTree.check σ T t x✝ a' r0 r1 && (decide (1 ≤ a') || Esgk.chordApexCellsCheck σ T r0 r1 a' rest))
Instances For
Soundness of the apex cells. If chordApexCellsCheck σ T r0 r1 a cells = true, then for
every configuration of three points q i of the annulus σ²ρ² ≤ |q i - c|² ≤ ρ² at a common
distance r from an apex p with a ρ ≤ |p - c| ≤ ρ and r0 ρ ≤ r ≤ r1 ρ, two of the
points are at squared distance at most T ρ².
The check of the radius cells [lo, r₁], [r₁, r₂], …, [r_{k-1}, r_k] with r_k ≥ hi (the
list holds the pairs (r_m, apex cells_m)): the apex cells of each radius cell, started at
σ, pass chordApexCellsCheck. This is Chords.holds_on lo hi T of
scripts/verify_constant_gain_5_239.py with the cells clipped to [lo, hi].
Equations
- Esgk.chordRadiusCellsCheck σ T hi x✝ [] = false
- Esgk.chordRadiusCellsCheck σ T hi x✝ ((r', cells) :: rest) = (Esgk.chordApexCellsCheck σ T x✝ r' σ cells && (decide (hi ≤ r') || Esgk.chordRadiusCellsCheck σ T hi r' rest))
Instances For
The chord condition from radius cells. If chordRadiusCellsCheck σ T hi lo cells = true
and 0 ≤ hi, then for every apex p of the annulus σ²ρ² ≤ |p - c|² ≤ ρ² and three points
q i of the annulus at a common distance r from p with lo² ρ² ≤ r² ≤ hi² ρ², two of the
points are at squared distance at most T ρ². This is the chord side condition C([lo, hi], √T)
of scripts/verify_constant_gain_1_40.py (which uses (lo, hi]) in units of ρ; all
hypotheses on the configuration are on squared distances.
The check of a chord table: radius cells [lo, r₁], [r₁, r₂], …, [r_{k-1}, r_k] with
r_k ≥ hi, the entry (r_m, T_m, apex cells_m) carrying its own squared bound T_m, as the
table Chords.tab of scripts/verify_constant_gain_5_239.py. Proved once by decide +kernel,
it serves every range through the cheap chordTableBoundCheck.
Equations
- Esgk.chordTableCheck σ hi x✝ [] = false
- Esgk.chordTableCheck σ hi x✝ ((r', T', cells) :: rest) = (Esgk.chordApexCellsCheck σ T' x✝ r' σ cells && (decide (hi ≤ r') || Esgk.chordTableCheck σ hi r' rest))
Instances For
The chord condition from a chord table. If chordTableCheck σ hi lo table = true and
chordTableBoundCheck τ x y lo table = true, with 0 ≤ hi and 0 ≤ y, then for every apex p
of the annulus σ²ρ² ≤ |p - c|² ≤ ρ² and three points q i of the annulus at a common distance
r from p with lo² ρ² ≤ r² ≤ hi² ρ² and x² ρ² < r² ≤ y² ρ², two of the points are at
squared distance at most τ ρ². This is the chord side condition C((x, y], √τ) of
scripts/verify_constant_gain_1_40.py from the table, in units of ρ.