AFTD Auto-Formalizing Theoretical Domains

rat_segments_length

def

For a list S of pairs of rational points of the plane, the real number that is the sum over the pairs (a, b) in S (with multiplicity) of the Euclidean distance between the points a and b.

Statement

noncomputable def rat_segments_length (S : List ((ℚ × ℚ) × (ℚ × ℚ))) : ℝ
Source
Objective, helper for the polynomial-time statement of OP-2019 (arXiv:2611.24611 (Inapproximability of Euclidean Steiner Tree), Section 6.1, after Corollary 20 (open question: is planar Euclidean Cable Steiner Tree APX-hard or does it admit a PTAS?)).
Verified
23 Nov 2026
Axioms
none listed
Built on 1
  • rat_plane_pointThe point of the Euclidean plane EuclideanSpace ℝ (Fin 2) with coordinates (x, y), for a pair (x, y) of rationals.

Lean source view module on GitHub

/-- The total Euclidean length of the segments listed in `S`. -/
noncomputable def rat_segments_length (S : List ((ℚ × ℚ) × (ℚ × ℚ))) : ℝ :=
  (S.map fun s => dist (rat_plane_point s.1) (rat_plane_point s.2)).sum
See it in the graphDiscuss this resultChallenge it