The lines of the Lean statement that state the theorem, then the definitions in the file that it uses.
Local definitions the statement names, followed through the definitions they name in turn. The match is by name in the source text, so a name reached only through notation can be missed; the full file is below.
structure OAI.MetricKMedianRecovery.RationalMetricInput line 7
structure RationalMetricInput where
Show the remaining 12 lines
pointCount : ℕ distance : Fin pointCount → Fin pointCount → ℚ clients : Finset (Fin pointCount) facilities : Finset (Fin pointCount) budget : ℕ facilities_nonempty : facilities.Nonempty budget_pos : 0 < budget covered : clients ∪ facilities = Finset.univ distance_nonneg : ∀ x y, 0 ≤ distance x y distance_self : ∀ x, distance x x = 0 distance_symm : ∀ x y, distance x y = distance y x distance_triangle : ∀ x y z, distance x z ≤ distance x y + distance y z
definition OAI.MetricKMedianRecovery.RationalMetricInput.size line 23
def size (I : RationalMetricInput) : ℕ := I.clients.card + I.facilities.card
definition OAI.MetricKMedianRecovery.RationalMetricInput.Feasible line 25
def Feasible (I : RationalMetricInput) (S : Finset (Fin I.pointCount)) : Prop := S ⊆ I.facilities ∧ S.card ≤ I.budget ∧ (I.clients.Nonempty → S.Nonempty)
definition OAI.MetricKMedianRecovery.RationalMetricInput.cost line 28
def cost (I : RationalMetricInput) (S : Finset (Fin I.pointCount)) : ℚ := if hS : S.Nonempty then ∑ p ∈ I.clients, S.inf' hS (I.distance p) else 0
definition OAI.MetricKMedianRecovery.RationalMetricInput.natBits line 31
def natBits (n : ℕ) : List Bool := List.replicate (Nat.bits n).length true ++ [false] ++ Nat.bits n
definition OAI.MetricKMedianRecovery.RationalMetricInput.rationalBits line 34
def rationalBits (r : ℚ) : List Bool := [decide (r < 0)] ++ natBits r.num.natAbs ++ natBits r.den
definition OAI.MetricKMedianRecovery.RationalMetricInput.bits line 37
def bits (I : RationalMetricInput) : List Bool := natBits I.pointCount ++ natBits I.budget ++ List.ofFn (fun i : Fin I.pointCount => decide (i ∈ I.clients)) ++ List.ofFn (fun i : Fin I.pointCount => decide (i ∈ I.facilities)) ++ (List.ofFn (fun i : Fin I.pointCount => (List.ofFn (fun j : Fin I.pointCount => rationalBits (I.distance i j))).flatten)).flatten
definition OAI.MetricKMedianRecovery.RationalMetricInput.decodeOutput line 44
def decodeOutput (I : RationalMetricInput) (out : List Bool) : Finset (Fin I.pointCount) := I.facilities.filter (fun i => out[i.val]?.getD false = true)
definition OAI.MetricKMedianRecovery.pairBits line 49
def pairBits (p : List Bool × List Bool) : List Bool := p.1.flatMap (fun b => [true, b]) ++ [false] ++ p.2
structure OAI.MetricKMedianRecovery.BinaryRandomizedAlgorithm line 52
structure BinaryRandomizedAlgorithm where randomBits : Polynomial ℕ run : List Bool × List Bool → List Bool computation : Turing.TM2ComputableInPolyTime pairBits id run finiteWorkAlphabet : ∀ k : computation.tm.K, Finite (computation.tm.Γ k)
structure OAI.MetricKMedianRecovery.RefinedRecovery.Input line 65
structure Input where metric : RationalMetricInput disjoint : Disjoint metric.clients metric.facilities integral : ∀ x y, ∃ z : ℕ, metric.distance x y = (z : ℚ) positive : ∀ x y, x ≠ y → 0 < metric.distance x y anchor : Finset (Fin metric.pointCount) anchor_subset : anchor ⊆ metric.facilities anchor_card : anchor.card = metric.budget
abbreviation OAI.MetricKMedianRecovery.RefinedRecovery.Input.Point line 75
abbrev Point (I : Input) := Fin I.metric.pointCount
definition OAI.MetricKMedianRecovery.RefinedRecovery.Input.Bounded line 79
def Bounded (I : Input) (bound : Polynomial ℕ) : Prop := ∀ x y, I.metric.distance x y ≤ ((bound.eval I.size : ℕ) : ℚ)
definition OAI.MetricKMedianRecovery.RefinedRecovery.Input.assign line 82
noncomputable def assign (I : Input) (O : Finset I.Point) (p : I.Point) : I.Point := if h : O.Nonempty then Classical.choose (Finset.exists_min_image O (fun i => toLex (I.metric.distance p i, i)) h) else p
definition OAI.MetricKMedianRecovery.RefinedRecovery.Input.cluster line 88
noncomputable def cluster (I : Input) (O : Finset I.Point) (i : I.Point) : Finset I.Point := I.metric.clients.filter (fun p => I.assign O p = i)
definition OAI.MetricKMedianRecovery.RefinedRecovery.Input.clusterCost line 91
noncomputable def clusterCost (I : Input) (O : Finset I.Point) (i : I.Point) : ℝ := ∑ p ∈ I.cluster O i, (I.metric.distance p i : ℝ)
definition OAI.MetricKMedianRecovery.RefinedRecovery.Input.anchorBits line 94
def anchorBits (I : Input) : List Bool := List.ofFn (fun i : I.Point => decide (i ∈ I.anchor))
structure OAI.MetricKMedianRecovery.RefinedRecovery.Certificate line 99
structure Certificate (I : Input) (μ : ℚ) (L₀ : ℝ) where
Show the remaining 13 lines
centers : Finset I.Point centers_subset : centers ⊆ I.metric.facilities same_card : centers.card = I.anchor.card positive_cost : 0 < (I.metric.cost centers : ℝ) good : Finset I.Point good_subset : good ⊆ centers proxy : I.Point → I.Point proxy_mem : ∀ i ∈ good, proxy i ∈ I.anchor proxy_inj : Set.InjOn proxy (↑good) proxy_cost : (∑ i ∈ good, ∑ p ∈ I.cluster centers i, (I.metric.distance p (proxy i) : ℝ)) ≤ (∑ i ∈ good, I.clusterCost centers i) + (μ : ℝ) * (I.metric.cost centers : ℝ) few_bad : (((centers \ good).card : ℕ) : ℝ) ≤ L₀ * Real.log (I.size : ℝ)
definition OAI.MetricKMedianRecovery.RefinedRecovery.precision line 114
noncomputable def precision (ζ : ℝ) : ℕ := ⌈Real.log (1 / ζ) / Real.log 2⌉₊
definition OAI.MetricKMedianRecovery.RefinedRecovery.queryBits line 117
noncomputable def queryBits (I : Input) (ζ : ℝ) : List Bool := pairBits (I.metric.bits, I.anchorBits ++ List.replicate (precision ζ) true)
definition OAI.MetricKMedianRecovery.RefinedRecovery.seedLength line 120
noncomputable def seedLength (A : BinaryRandomizedAlgorithm) (I : Input) (ζ : ℝ) : ℕ := A.randomBits.eval (queryBits I ζ).length
abbreviation OAI.MetricKMedianRecovery.RefinedRecovery.Seed line 123
abbrev Seed (A : BinaryRandomizedAlgorithm) (I : Input) (ζ : ℝ) := Fin (seedLength A I ζ) → Bool
definition OAI.MetricKMedianRecovery.RefinedRecovery.output line 126
noncomputable def output (A : BinaryRandomizedAlgorithm) (I : Input) (ζ : ℝ) (s : Seed A I ζ) : Finset I.Point := I.metric.decodeOutput (A.run (queryBits I ζ, List.ofFn s))
definition OAI.MetricKMedianRecovery.RefinedRecovery.successProbability line 130
noncomputable def successProbability (A : BinaryRandomizedAlgorithm) (I : Input) (ζ target : ℝ) : ℝ := by classical exact ((Finset.univ.filter (fun s : Seed A I ζ => (I.metric.cost (output A I ζ s) : ℝ) ≤ target)).card : ℝ) / 2 ^ seedLength A I ζ
2 more definitions are reached the same way; the full file lists them.