AFTD Auto-Formalizing Theoretical Domains

cable_steiner_opt_two_points

theoremverified

For two one-point cables p and q (degenerate segments), the cable Steiner optimum is the Euclidean distance between p and q.

Statement

theorem cable_steiner_opt_two_points (p q : ℚ × ℚ) :
    cable_steiner_opt [[(p, p)], [(q, q)]] = dist (rat_plane_point p) (rat_plane_point q)
Source
Sanity check of cable_steiner_opt: two point cables are joined at cost their distance.
Verified
23 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
  • cable_steiner_optFor a list I of cables in the plane, each cable given as a list of segments, a segment being a pair of endpoints each given as a pair (x,…
  • rat_segments_unionFor a list S of pairs of rational points of the plane, the subset of EuclideanSpace ℝ (Fin 2) that is the union, over the pairs (a, b) in…
  • two_point_network_length_geIf finitely many segments together with two points P, Q form a connected set, their total length is at least dist(P, Q).
  • rat_plane_pointThe point of the Euclidean plane EuclideanSpace ℝ (Fin 2) with coordinates (x, y), for a pair (x, y) of rationals.

The proof, explained

The proof establishes that the cable Steiner optimum for two single-point cables p and q equals the Euclidean distance dist(p, q) by showing both inequalities ≤ and ≥. First, it simplifies the cable terminals to the two-point set {p, q}. The upper bound holds because the single segment [p, q] connects p and q with length dist(p, q), so this value belongs to the candidate set and the set is bounded below by 0. The lower bound follows from the theorem `two_point_network_length_ge`, which states that any connected segment network linking p and q has total length at least dist(p, q).

  1. The cable Steiner optimization problem for the two degenerate cables reduces to finding the infimum length of a network connecting the two points p and q.

    Each of the two cables is given as a single degenerate segment, [(p, p)] and [(q, q)]. By set extensionality and simplification, the union of segments across both cables is the two-point set {p, q}. Unfolding the definition of `cable_steiner_opt` and rewriting with this identity casts the problem as the infimum of total lengths ∑_{t ∈ T} dist(t₁, t₂) over finite segment networks T such that {p, q} ∪ ⋃_{t ∈ T} [t₁, t₂] is connected.

    lines 3–8

    uses or_comm

      have hU : (⋃ c ∈ [[(p, p)], [(q, q)]], rat_segments_union c) =
          ({rat_plane_point p, rat_plane_point q} : Set (EuclideanSpace ℝ (Fin 2))) := by
        ext x
        simp [rat_segments_union, or_comm]
      unfold cable_steiner_opt
      simp only [hU]
  2. The Euclidean distance dist(p, q) is an attainable network length: the single segment connecting p and q connects {p, q} and has length dist(p, q).

    We choose the candidate network T = {(p, q)}, whose total length is dist(p, q). The union of {p, q} with the segment [p, q] is equal to [p, q] itself, because both endpoints p and q belong to the segment (`left_mem_segment`, `right_mem_segment`). Since any line segment in Euclidean space is convex (`convex_segment`) and nonempty, it is connected, confirming that {(p, q)} is a valid connecting network.

    lines 9–21

    uses Finset.mem_singleton, Set.iUnion_iUnion_eq_left, Set.union_eq_right.mpr, Set.insert_subset_iff.mpr, left_mem_segment, Set.singleton_subset_iff.mpr, right_mem_segment, convex_segment

      have hmem : dist (rat_plane_point p) (rat_plane_point q) ∈
          {L : ℝ | ∃ T : Finset (EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2)),
            IsConnected (({rat_plane_point p, rat_plane_point q} : Set (EuclideanSpace ℝ (Fin 2))) ∪
              ⋃ t ∈ T, segment ℝ t.1 t.2) ∧ L = ∑ t ∈ T, dist t.1 t.2} := by
        refine ⟨{(rat_plane_point p, rat_plane_point q)}, ?_, by simp⟩
        have he : ({rat_plane_point p, rat_plane_point q} : Set (EuclideanSpace ℝ (Fin 2))) ∪
            ⋃ t ∈ ({(rat_plane_point p, rat_plane_point q)} : Finset _), segment ℝ t.1 t.2 =
            segment ℝ (rat_plane_point p) (rat_plane_point q) := by
          simp only [Finset.mem_singleton, Set.iUnion_iUnion_eq_left]
          exact Set.union_eq_right.mpr (Set.insert_subset_iff.mpr
            ⟨left_mem_segment ℝ _ _, Set.singleton_subset_iff.mpr (right_mem_segment ℝ _ _)⟩)
        rw [he]
        exact (convex_segment _ _).isConnected ⟨_, left_mem_segment ℝ _ _⟩
  3. By antisymmetry, the problem splits into two inequalities, and the Steiner optimum is at most dist(p, q).

    We apply antisymmetry of ≤ (`le_antisymm`). For the upper bound, the infimum of a set bounded below is at most any of its elements (`csInf_le`). The distance dist(p, q) belongs to the set by the previous step, and the set is bounded below by 0 because the length of any network is a finite sum of non-negative distances (`Finset.sum_nonneg`, `dist_nonneg`).

    lines 22–26

    uses le_antisymm, csInf_le, Finset.sum_nonneg, dist_nonneg

      apply le_antisymm
      · apply csInf_le _ hmem
        refine ⟨0, ?_⟩
        rintro L ⟨T, -, rfl⟩
        exact Finset.sum_nonneg fun t _ => dist_nonneg
  4. The Steiner optimum is at least dist(p, q).

    Since the set of valid network lengths is nonempty (containing dist(p, q)), its infimum is at least dist(p, q) provided dist(p, q) is a lower bound for all candidate lengths (`le_csInf`). For any network T connecting p and q, the helper theorem `two_point_network_length_ge` guarantees that its total length is at least the straight-line distance dist(p, q).

    lines 27–29

    uses le_csInf, two_point_network_length_ge

      · apply le_csInf ⟨_, hmem⟩
        rintro L ⟨T, hT, rfl⟩
        exact two_point_network_length_ge _ _ T hT
or_comm
Disjunction is commutative: a ∨ b ↔ b ∨ a.
Finset.mem_singleton
An element belongs to a singleton set if and only if it equals the element in the singleton.
Set.iUnion_iUnion_eq_left
An indexed union over an equality condition collapses to the single term satisfying the equality.
Set.union_eq_right.mpr
If s ⊆ t, then s ∪ t = t.
Set.insert_subset_iff.mpr
If x ∈ s and t ⊆ s, then insert x t ⊆ s.
Set.singleton_subset_iff.mpr
A singleton {x} is a subset of s if and only if x ∈ s.
left_mem_segment
The left endpoint x belongs to the line segment between x and y.
right_mem_segment
The right endpoint y belongs to the line segment between x and y.
convex_segment
The line segment between two points in a module over an ordered ring is convex.
le_antisymm
In a partial order, if a ≤ b and b ≤ a, then a = b.
csInf_le
The infimum of a set bounded below is at most any element of the set.
Finset.sum_nonneg
A finite sum of non-negative elements is non-negative.
dist_nonneg
The distance between any two points in a metric space is non-negative.
le_csInf
If a nonempty set is bounded below by a, then a is at most the infimum of the set.
two_point_network_length_ge
Any finite network of line segments that connects two points P and Q in the Euclidean plane has total length at least dist P Q.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem cable_steiner_opt_two_points (p q : ℚ × ℚ) :    cable_steiner_opt [[(p, p)], [(q, q)]] = dist (rat_plane_point p) (rat_plane_point q) := by  have hU : (⋃ c ∈ [[(p, p)], [(q, q)]], rat_segments_union c) =      ({rat_plane_point p, rat_plane_point q} : Set (EuclideanSpace ℝ (Fin 2))) := by    ext x    simp [rat_segments_union, or_comm]  unfold cable_steiner_opt  simp only [hU]  have hmem : dist (rat_plane_point p) (rat_plane_point q) ∈      {L : ℝ | ∃ T : Finset (EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2)),        IsConnected (({rat_plane_point p, rat_plane_point q} : Set (EuclideanSpace ℝ (Fin 2))) ∪          ⋃ t ∈ T, segment ℝ t.1 t.2) ∧ L = ∑ t ∈ T, dist t.1 t.2} := by    refine ⟨{(rat_plane_point p, rat_plane_point q)}, ?_, by simp⟩    have he : ({rat_plane_point p, rat_plane_point q} : Set (EuclideanSpace ℝ (Fin 2))) ∪        ⋃ t ∈ ({(rat_plane_point p, rat_plane_point q)} : Finset _), segment ℝ t.1 t.2 =        segment ℝ (rat_plane_point p) (rat_plane_point q) := by      simp only [Finset.mem_singleton, Set.iUnion_iUnion_eq_left]      exact Set.union_eq_right.mpr (Set.insert_subset_iff.mpr        ⟨left_mem_segment ℝ _ _, Set.singleton_subset_iff.mpr (right_mem_segment ℝ _ _)⟩)    rw [he]    exact (convex_segment _ _).isConnected ⟨_, left_mem_segment ℝ _ _⟩  apply le_antisymm  · apply csInf_le _ hmem    refine ⟨0, ?_⟩    rintro L ⟨T, -, rfl⟩    exact Finset.sum_nonneg fun t _ => dist_nonneg  · apply le_csInf ⟨_, hmem⟩    rintro L ⟨T, hT, rfl⟩    exact two_point_network_length_ge _ _ T hT
See it in the graphDiscuss this resultChallenge it