AFTD Auto-Formalizing Theoretical Domains

two_facility_max_cost

def

Given a finite and nonempty set of agents ι, a metric space X, agent positions x, approval preferences p, and facility locations c, the max cost of c is the finite maximum over all agents i ∈ ι of two_facility_cost x p i c.

Statement

noncomputable def two_facility_max_cost {ι X : Type*} [Fintype ι] [Nonempty ι] [MetricSpace X]
    (x : ι → X) (p : ι → Fin 2 → Bool) (c : Fin 2 → X) : ℝ
Defined in
scout/2610-18006-truthful-two-facility-location-with-candidate-locations-in.md:188
Verified
23 Oct 2026
Axioms
none listed
Built on 1
Used by 9

Read back from the Lean

A definition of the maximum two-facility cost: given types ι and X with [Fintype ι], [Nonempty ι], and [MetricSpace X], a configuration of points x : ι → X, an assignment indicator p : ι → Fin 2 → Bool, and facility locations c : Fin 2 → X, two_facility_max_cost x p c is the maximum (via Finset.sup') over all i : ι of two_facility_cost x p i c.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The maximum individual cost among all agents for a two-facility solution c. -/
noncomputable def two_facility_max_cost {ι X : Type*} [Fintype ι] [Nonempty ι] [MetricSpace X]
    (x : ι → X) (p : ι → Fin 2 → Bool) (c : Fin 2 → X) : ℝ :=
  Finset.univ.sup' Finset.univ_nonempty (fun i => two_facility_cost x p i c)
See it in the graphDiscuss this resultChallenge it