Rounding the Weights, and What an Approximation Scheme Delivers

Lax496464.Fptas · concepts/Lax496464/Fptas.lean · lax-496464

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    The rounding behind the fifth theorem, and the shape of the guarantee it gives.

    Rounding every weight up to a multiple of kk and dividing by kk leaves an instance with the same jobs whose weights are smaller by a factor of about kk. A set that is optimal for the rounded weights loses, against the true optimum, at most kk per job selected, hence at most knkn in total; and since the optimum is at least the largest single weight, choosing kk so that knkn is a small fraction of the largest weight makes the loss a small fraction of the optimum. That is the chain of inequalities (8), and what it delivers is stated with the theorem that uses it.

    An approximation scheme is a program that is handed an instance together with a positive integer ee and returns a number WW that a feasible set reaches, and that is within a factor 1−1/e1 - 1/e of the optimum.

    Concept map
    7 concepts; 1 descendant hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    In the paper

    • page 7 of this submission's paper

    Lean source view on GitHub

    1import Lax496464.Problems
    2
    3/-!
    4---
    5title: Rounding the Weights, and What an Approximation Scheme Delivers
    6type: definition
    7---
    8The rounding behind the fifth theorem, and the shape of the guarantee it gives.
    9
    10Rounding every weight up to a multiple of kk and dividing by kk leaves an instance with
    11the same jobs whose weights are smaller by a factor of about kk. A set that is optimal
    12for the rounded weights loses, against the true optimum, at most kk per job selected,
    13hence at most knkn in total; and since the optimum is at least the largest single weight,
    14choosing kk so that knkn is a small fraction of the largest weight makes the loss a small
    15fraction of the optimum. That is the chain of inequalities (8), and what it delivers is
    16stated with the theorem that uses it.
    17
    18An *approximation scheme* is a program that is handed an instance together with a
    19positive integer ee and returns a number WW that a feasible set reaches, and that is within
    20a factor 1−1/e1 - 1/e of the optimum.
    21
    22# Formalization Notes
    23
    24The accuracy is a positive integer ee rather than a rational ε\varepsilon, and the
    25guarantee is written as (e−1) opt≤e W(e-1)\,\mathrm{opt} \le e\,W. This is the same statement as
    26(1−ε) opt≤W(1-\varepsilon)\,\mathrm{opt} \le W with ε=1/e\varepsilon = 1/e, in whole numbers, which
    27is what the input of a machine and the arithmetic of the bound both want. A scheme for
    28every 1/e1/e is a scheme for every ε\varepsilon, since every positive rational exceeds
    29some 1/e1/e.
    30
    31The program returns a *number* rather than the set: a value WW such that some feasible set
    32has weight at least WW, and such that (e−1) opt≤e W(e-1)\,\mathrm{opt} \le e\,W. Since WW never exceeds
    33the optimum either, this is the usual value form of an approximation guarantee, and there is
    34a feasible set whose weight is at least W≥(1−1/e) optW \ge (1-1/e)\,\mathrm{opt}. The output is a single
    35number, as the decision programs' is. The program is not asked to name that set, nor to
    36return its exact weight: which is not something the exact algorithms it is built from
    37retain, and which the paper's guarantee does not constrain.
    38
    39What a scheme delivers is not a function of its input — many sets meet the guarantee — so
    40it cannot be stated through the notion of computing a function within a time bound. It is
    41stated directly: on every admissible input the machine halts within the bound, having
    42written some output that meets the guarantee.
    43
    44The instance is presented without a threshold, with the accuracy in the position the
    45threshold would occupy. An approximation instance is therefore a decision instance read
    46differently, which costs nothing and keeps one format.
    47-/
    48
    49namespace Lax496464.Fptas
    50
    51open Lax496464.FlowShop Lax496464.FlowShop.Instance
    52open Lax496464.WordEncoding Lax496464.Problems
    53open Lax808846.Ram
    54
    55variable (I : Instance)
    56
    57/-- The largest weight of a single job. -/
    58def wmax : ℕ := ((List.finRange I.jobs).map I.w).foldr max 0
    59
    60/-- The instance with every weight rounded up to a multiple of `k` and divided by it. -/
    61def rescale (k : ℕ) : Instance where
    62 jobs := I.jobs
    63 machines := I.machines
    64 p := I.p
    65 q := I.q
    66 d := I.d
    67 w j := (I.w j + (k - 1)) / k
    68
    69variable {I}
    70
    71variable (I)
    72
    73/-- The word `x` presents the instance `I` together with the accuracy `e`. -/
    74def EncodesApprox (x : List ℕ) (e : ℕ) : Prop :=
    75 ∃ y, x = y ++ [e] ∧ 1 ≤ e ∧ EncodesInstance y I
    76
    77variable {I}
    78
    79/-- The words that present an instance together with an accuracy. -/
    80def ApproxInstances : Set (List ℕ) := {x | ∃ I e, EncodesApprox I x e}
    81
    82/-- The output `y` is an acceptable answer on the input `x`: a number that some feasible set
    83reaches, within a factor `1 − 1/e` of the optimum. -/
    84def Delivers (x y : List ℕ) : Prop :=
    85 ∃ (I : Instance) (e W : ℕ), EncodesApprox I x e ∧ y = [W] ∧
    86 HasWeight I W ∧ (e - 1) * optimum I ≤ e * W
    87
    88/-- At word length `w`, on every admissible input, the program halts within `T x`
    89instructions having written an acceptable answer. -/
    90def ApproximatesInTime (w : ℕ) (prog : Program) (D : Set (List ℕ))
    91 (T : List ℕ → ℕ) : Prop :=
    92 ∀ x ∈ D, ∃ (y : List ℕ) (t : ℕ), t ≤ T x ∧ RunsTo w prog x y t ∧ Delivers x y
    93
    94end Lax496464.Fptas
    95
    Formalization Notes

    The accuracy is a positive integer ee rather than a rational ε\varepsilon, and the guarantee is written as (e−1) opt≤e W(e-1)\,\mathrm{opt} \le e\,W. This is the same statement as (1−ε) opt≤W(1-\varepsilon)\,\mathrm{opt} \le W with ε=1/e\varepsilon = 1/e, in whole numbers, which is what the input of a machine and the arithmetic of the bound both want. A scheme for every 1/e1/e is a scheme for every ε\varepsilon, since every positive rational exceeds some 1/e1/e.

    The program returns a number rather than the set: a value WW such that some feasible set has weight at least WW, and such that (e−1) opt≤e W(e-1)\,\mathrm{opt} \le e\,W. Since WW never exceeds the optimum either, this is the usual value form of an approximation guarantee, and there is a feasible set whose weight is at least W≥(1−1/e) optW \ge (1-1/e)\,\mathrm{opt}. The output is a single number, as the decision programs' is. The program is not asked to name that set, nor to return its exact weight: which is not something the exact algorithms it is built from retain, and which the paper's guarantee does not constrain.

    What a scheme delivers is not a function of its input — many sets meet the guarantee — so it cannot be stated through the notion of computing a function within a time bound. It is stated directly: on every admissible input the machine halts within the bound, having written some output that meets the guarantee.

    The instance is presented without a threshold, with the accuracy in the position the threshold would occupy. An approximation instance is therefore a decision instance read differently, which costs nothing and keeps one format.

    Builds on
    Used by
    From Mathlib

    none

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…