Optimization problems and embeddings
Lax434175.Problems · concepts/Lax434175/Problems.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
An optimization problem consists of a type of instances, for every instance a type of candidate solutions, a feasibility predicate, and a rational cost to be minimized.
An embedding of a problem into a problem maps every instance of to an instance of and translates solutions in both directions. It is sound if both translations preserve feasibility and neither increases the cost. A sound embedding shows that is a special case of : the two instances and its image have the same optimal cost.
Restricting a problem to the instances satisfying a predicate yields again a problem, and the inclusion of the restricted instances is an embedding.
Embeddings compose: the instance maps are composed, and so are the translations of solutions.
Theorem. The composition of two sound embeddings is sound.
The decision version of a problem asks, for an instance and a threshold, whether some feasible solution has cost at most the threshold. A reduction of the decision version of to that of maps every instance of and integral threshold to an instance of and an integral threshold with the same answer. Problem is reducible to if such a reduction exists.
Theorem. A special case of a problem is reducible to it, and reducibility is transitive.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Mathlib.Algebra.Order.Field.Rat |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Optimization problems and embeddings |
| 6 | type: theorem |
| 7 | --- |
| 8 | An optimization problem consists of a type of instances, for every instance a |
| 9 | type of candidate solutions, a feasibility predicate, and a rational cost to |
| 10 | be minimized. |
| 11 | |
| 12 | An embedding of a problem into a problem maps every instance of |
| 13 | to an instance of and translates solutions in both directions. It is |
| 14 | sound if both translations preserve feasibility and neither increases the |
| 15 | cost. A sound embedding shows that is a special case of : the two |
| 16 | instances and its image have the same optimal cost. |
| 17 | |
| 18 | Restricting a problem to the instances satisfying a predicate yields again a |
| 19 | problem, and the inclusion of the restricted instances is an embedding. |
| 20 | |
| 21 | Embeddings compose: the instance maps are composed, and so are the |
| 22 | translations of solutions. |
| 23 | |
| 24 | **Theorem.** The composition of two sound embeddings is sound. |
| 25 | |
| 26 | The decision version of a problem asks, for an instance and a threshold, |
| 27 | whether some feasible solution has cost at most the threshold. A reduction |
| 28 | of the decision version of to that of maps every instance of and |
| 29 | integral threshold to an instance of and an integral threshold with the |
| 30 | same answer. Problem is reducible to if such a reduction exists. |
| 31 | |
| 32 | **Theorem.** A special case of a problem is reducible to it, and |
| 33 | reducibility is transitive. |
| 34 | -/ |
| 35 | |
| 36 | namespace Lax434175.Problems |
| 37 | |
| 38 | /-- A minimization problem. -/ |
| 39 | structure Problem where |
| 40 | /-- The instances. -/ |
| 41 | Inst : Type |
| 42 | /-- The candidate solutions of an instance. -/ |
| 43 | Sched : Inst → Type |
| 44 | /-- Which candidate solutions are feasible. -/ |
| 45 | feasible : (x : Inst) → Sched x → Prop |
| 46 | /-- The cost of a candidate solution. -/ |
| 47 | cost : (x : Inst) → Sched x → ℚ |
| 48 | |
| 49 | /-- The data of an embedding of `A` into `B`: a map on instances and |
| 50 | translations of solutions in both directions. -/ |
| 51 | structure Embedding (A B : Problem) where |
| 52 | map : A.Inst → B.Inst |
| 53 | forth : (x : A.Inst) → A.Sched x → B.Sched (map x) |
| 54 | back : (x : A.Inst) → B.Sched (map x) → A.Sched x |
| 55 | |
| 56 | /-- An embedding is sound if both translations preserve feasibility and do |
| 57 | not increase the cost. -/ |
| 58 | structure Embedding.Sound {A B : Problem} (e : Embedding A B) : Prop where |
| 59 | forth_feasible : ∀ x σ, A.feasible x σ → B.feasible (e.map x) (e.forth x σ) |
| 60 | forth_cost : ∀ x σ, A.feasible x σ → B.cost (e.map x) (e.forth x σ) ≤ A.cost x σ |
| 61 | back_feasible : ∀ x τ, B.feasible (e.map x) τ → A.feasible x (e.back x τ) |
| 62 | back_cost : ∀ x τ, B.feasible (e.map x) τ → A.cost x (e.back x τ) ≤ B.cost (e.map x) τ |
| 63 | |
| 64 | /-- `A` is a special case of `B`. -/ |
| 65 | def SpecialCase (A B : Problem) : Prop := ∃ e : Embedding A B, e.Sound |
| 66 | |
| 67 | /-- The restriction of a problem to the instances satisfying `φ`. -/ |
| 68 | def Problem.restrict (P : Problem) (φ : P.Inst → Prop) : Problem where |
| 69 | Inst := { x : P.Inst // φ x } |
| 70 | Sched x := P.Sched x.1 |
| 71 | feasible x σ := P.feasible x.1 σ |
| 72 | cost x σ := P.cost x.1 σ |
| 73 | |
| 74 | /-- The inclusion of a restricted problem into the unrestricted one. -/ |
| 75 | def Problem.inclusion (P : Problem) (φ : P.Inst → Prop) : Embedding (P.restrict φ) P where |
| 76 | map x := x.1 |
| 77 | forth _ σ := σ |
| 78 | back _ σ := σ |
| 79 | |
| 80 | /-- The composition of two embeddings. -/ |
| 81 | def Embedding.comp {A B C : Problem} (e : Embedding A B) (f : Embedding B C) : Embedding A C where |
| 82 | map x := f.map (e.map x) |
| 83 | forth x σ := f.forth (e.map x) (e.forth x σ) |
| 84 | back x τ := e.back x (f.back (e.map x) τ) |
| 85 | |
| 86 | axiom comp_sound {A B C : Problem} (e : Embedding A B) (f : Embedding B C) : |
| 87 | e.Sound → f.Sound → (e.comp f).Sound |
| 88 | |
| 89 | /-- Some feasible solution of the instance has cost at most the threshold. -/ |
| 90 | def Problem.Decides (P : Problem) (x : P.Inst) (D : ℚ) : Prop := |
| 91 | ∃ σ, P.feasible x σ ∧ P.cost x σ ≤ D |
| 92 | |
| 93 | /-- The data of a reduction between decision versions: an instance and a |
| 94 | threshold of `A` are mapped to an instance and a threshold of `B`. -/ |
| 95 | structure DecisionReduction (A B : Problem) where |
| 96 | map : A.Inst → ℤ → B.Inst |
| 97 | threshold : A.Inst → ℤ → ℤ |
| 98 | |
| 99 | /-- A reduction is sound if it preserves the answer. -/ |
| 100 | def DecisionReduction.Sound {A B : Problem} (r : DecisionReduction A B) : Prop := |
| 101 | ∀ x (D : ℤ), A.Decides x D ↔ B.Decides (r.map x D) (r.threshold x D) |
| 102 | |
| 103 | /-- The decision version of `A` reduces to that of `B`. -/ |
| 104 | def Reducible (A B : Problem) : Prop := ∃ r : DecisionReduction A B, r.Sound |
| 105 | |
| 106 | axiom reducible_of_specialCase {A B : Problem} : SpecialCase A B → Reducible A B |
| 107 | |
| 108 | axiom reducible_trans {A B C : Problem} : Reducible A B → Reducible B C → Reducible A C |
| 109 | |
| 110 | end Lax434175.Problems |
| 111 |
Builds on
none
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments