Set Cover, Hitting Set, Set Packing, Exact Cover and Set Splitting
Lax799700.SetFamily · concepts/Lax799700/SetFamily.lean · lax-799700
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
Five problems on set systems: a universe carrying two unary marks that separate the ground elements from the sets of a family, a binary incidence relation between them, and a third unary mark whose cardinality is the threshold , in unary representation. SetCover asks for at most sets covering every element, HittingSet for at most elements meeting every set, SetPacking for at least pairwise disjoint sets, ExactCover for a subfamily covering every element exactly once, and SetSplitting for a two-coloring of the elements leaving no set monochromatic. Nothing forces an element of the universe to be an element or a set, and disjointness in a packing is required of the ground elements only; both conventions are what let a first-order interpretation build a set system inside a tagged power of its input.
All five are in NP by existential second-order definitions except Hitting Set, which reduces to Set Cover by reading incidence backwards, the same interpretation reducing Set Cover to Hitting Set. Hardness comes by first-order reductions: Set Cover from Vertex Cover, Set Packing from Independent Set, Exact Cover from 1-in-SAT, Set Splitting from NAE-SAT.
Concept map
Evidence
This concept declares 15 statements. Each proof establishes one of them relative to its assumptions.
1 exactCover_iff proven
2 exactCover_NP_complete proven
3 hasExactCover_iso proven
4 hasLargeSetPacking_iso proven
5 hasSetSplitting_iso proven
6 hasSmallHittingSet_iso proven
7 hasSmallSetCover_iso proven
8 hittingSet_iff proven
9 hittingSet_NP_complete proven
10 setCover_iff proven
11 setCover_NP_complete proven
12 setPacking_iff proven
13 setPacking_NP_complete proven
14 setSplitting_iff proven
15 setSplitting_NP_complete proven
In the paper
- page 16 of the paper of lax-117614, Graph crawling is NP-complete
Lean source view on GitHub
| 1 | import Mathlib.Data.Fintype.EquivFin |
| 2 | import Mathlib.Data.Set.Card |
| 3 | import Mathlib.SetTheory.Cardinal.Finite |
| 4 | import Mathlib.Logic.Equiv.Prod |
| 5 | import Mathlib.ModelTheory.Semantics |
| 6 | import Mathlib.ModelTheory.Complexity |
| 7 | import Mathlib.Tactic.FinCases |
| 8 | import Mathlib.ModelTheory.Syntax |
| 9 | import Lax904597.Classes |
| 10 | import Lax799700.Problems |
| 11 | |
| 12 | /-! |
| 13 | --- |
| 14 | title: Set Cover, Hitting Set, Set Packing, Exact Cover and Set Splitting |
| 15 | type: theorem |
| 16 | --- |
| 17 | Five problems on set systems: a universe carrying two unary marks that |
| 18 | separate the ground elements from the sets of a family, a binary |
| 19 | incidence relation between them, and a third unary mark whose |
| 20 | cardinality is the threshold , in unary representation. SetCover asks |
| 21 | for at most sets covering every element, HittingSet for at most |
| 22 | elements meeting every set, SetPacking for at least pairwise disjoint |
| 23 | sets, ExactCover for a subfamily covering every element exactly once, and |
| 24 | SetSplitting for a two-coloring of the elements leaving no set |
| 25 | monochromatic. Nothing forces an element of the universe to be an element |
| 26 | or a set, and disjointness in a packing is required of the ground |
| 27 | elements only; both conventions are what let a first-order interpretation |
| 28 | build a set system inside a tagged power of its input. |
| 29 | |
| 30 | All five are in NP by existential second-order definitions except Hitting |
| 31 | Set, which reduces to Set Cover by reading incidence backwards, the same |
| 32 | interpretation reducing Set Cover to Hitting Set. Hardness comes by |
| 33 | first-order reductions: Set Cover from Vertex Cover, Set Packing from |
| 34 | Independent Set, Exact Cover from 1-in-SAT, Set Splitting from NAE-SAT. |
| 35 | |
| 36 | -/ |
| 37 | |
| 38 | namespace Lax799700.SetFamily |
| 39 | |
| 40 | open FirstOrder |
| 41 | |
| 42 | open FirstOrder.Language |
| 43 | |
| 44 | /-- The relation symbols of the language. -/ |
| 45 | inductive setSystemRel : ℕ → Type where |
| 46 | /-- `elem a`: the element `a` belongs to the ground set. -/ |
| 47 | | elem : setSystemRel 1 |
| 48 | /-- `fam a`: the element `a` is one of the sets of the family. -/ |
| 49 | | fam : setSystemRel 1 |
| 50 | /-- `mem a b`: the ground element `a` belongs to the set `b`. -/ |
| 51 | | mem : setSystemRel 2 |
| 52 | /-- `marked a`: the element `a` belongs to the marked set. -/ |
| 53 | | marked : setSystemRel 1 |
| 54 | deriving DecidableEq |
| 55 | |
| 56 | /-- The relational language of set systems: a bipartite incidence structure |
| 57 | between ground elements and sets of a family, together with a marked subset of |
| 58 | the universe whose cardinality serves as threshold. -/ |
| 59 | def setSystem : FirstOrder.Language := |
| 60 | ⟨fun _ => Empty, setSystemRel⟩ |
| 61 | |
| 62 | instance instIsRelationalSetSystem : FirstOrder.Language.IsRelational setSystem := fun _ => |
| 63 | (inferInstance : IsEmpty Empty) |
| 64 | |
| 65 | /-- `elem a`: the element `a` belongs to the ground set. -/ |
| 66 | abbrev ssElem : setSystem.Relations 1 := |
| 67 | .elem |
| 68 | |
| 69 | /-- `fam a`: the element `a` is one of the sets of the family. -/ |
| 70 | abbrev ssFam : setSystem.Relations 1 := |
| 71 | .fam |
| 72 | |
| 73 | /-- `mem a b`: the ground element `a` belongs to the set `b`. -/ |
| 74 | abbrev ssMem : setSystem.Relations 2 := |
| 75 | .mem |
| 76 | |
| 77 | /-- `marked a`: the element `a` belongs to the marked set. -/ |
| 78 | abbrev ssMarked : setSystem.Relations 1 := |
| 79 | .marked |
| 80 | |
| 81 | open FirstOrder |
| 82 | |
| 83 | open Language Structure |
| 84 | |
| 85 | section Generic |
| 86 | |
| 87 | variable {A : Type} |
| 88 | |
| 89 | /-- Some subfamily of the `Fp`-sets covers every `Ep`-element and is at most |
| 90 | as large as the number encoded by the `Kp`-marked elements: “some cover is at |
| 91 | most as large as the marked set”. -/ |
| 92 | def CoversOn (Ep Fp : A → Prop) (Mp : A → A → Prop) (Kp : A → Prop) : Prop := |
| 93 | ∃ G : A → Prop, (∀ s, G s → Fp s) ∧ (∀ x, Ep x → ∃ s, G s ∧ Mp x s) ∧ |
| 94 | {s | G s}.ncard ≤ {x | Kp x}.ncard |
| 95 | |
| 96 | /-- Some set of `Ep`-elements meets every `Fp`-set and is at most as large as |
| 97 | the number encoded by the `Kp`-marked elements: “some hitting set is at most |
| 98 | as large as the marked set”. This is `DescriptiveComplexity.CoversOn` with the roles |
| 99 | of elements and sets exchanged and the incidence relation transposed. -/ |
| 100 | def HitsOn (Ep Fp : A → Prop) (Mp : A → A → Prop) (Kp : A → Prop) : Prop := |
| 101 | CoversOn Fp Ep (fun s x => Mp x s) Kp |
| 102 | |
| 103 | /-- Some subfamily of the `Fp`-sets is pairwise disjoint – no `Ep`-element |
| 104 | belongs to two distinct members – and is at least as large as the number |
| 105 | encoded by the `Kp`-marked elements: “some packing is at least as large as the |
| 106 | marked set”. -/ |
| 107 | def PacksOn (Ep Fp : A → Prop) (Mp : A → A → Prop) (Kp : A → Prop) : Prop := |
| 108 | ∃ G : A → Prop, (∀ s, G s → Fp s) ∧ |
| 109 | (∀ s s', G s → G s' → s ≠ s' → ∀ x, Ep x → ¬(Mp x s ∧ Mp x s')) ∧ |
| 110 | {x | Kp x}.ncard ≤ {s | G s}.ncard |
| 111 | |
| 112 | /-- Some subfamily of the `Fp`-sets covers every `Ep`-element *exactly once*: |
| 113 | it covers, and no element belongs to two distinct members. Unlike the three |
| 114 | properties above this one carries no threshold – exactness is the whole |
| 115 | constraint. -/ |
| 116 | def ExactlyCoversOn (Ep Fp : A → Prop) (Mp : A → A → Prop) : Prop := |
| 117 | ∃ G : A → Prop, (∀ s, G s → Fp s) ∧ (∀ x, Ep x → ∃ s, G s ∧ Mp x s) ∧ |
| 118 | ∀ s s', G s → G s' → s ≠ s' → ∀ x, Ep x → ¬(Mp x s ∧ Mp x s') |
| 119 | |
| 120 | /-- Some two-coloring of the ground elements *splits* every set of the |
| 121 | family: no set is monochromatic. Like `DescriptiveComplexity.ExactlyCoversOn` this |
| 122 | property carries no threshold. -/ |
| 123 | def SplitsOn (Ep Fp : A → Prop) (Mp : A → A → Prop) : Prop := |
| 124 | ∃ S : A → Prop, ∀ f, Fp f → |
| 125 | (∃ x, Ep x ∧ Mp x f ∧ S x) ∧ ∃ x, Ep x ∧ Mp x f ∧ ¬S x |
| 126 | |
| 127 | end Generic |
| 128 | |
| 129 | section Problems |
| 130 | |
| 131 | section Shorthands |
| 132 | |
| 133 | variable {A : Type} [setSystem.Structure A] |
| 134 | |
| 135 | /-- `elem a`: the element `a` belongs to the ground set. -/ |
| 136 | def SSElem {A : Type} [setSystem.Structure A] (a0 : A) : Prop := |
| 137 | FirstOrder.Language.Structure.RelMap ssElem ![a0] |
| 138 | |
| 139 | /-- `fam a`: the element `a` is one of the sets of the family. -/ |
| 140 | def SSFam {A : Type} [setSystem.Structure A] (a0 : A) : Prop := |
| 141 | FirstOrder.Language.Structure.RelMap ssFam ![a0] |
| 142 | |
| 143 | /-- `mem a b`: the ground element `a` belongs to the set `b`. -/ |
| 144 | def SSMem {A : Type} [setSystem.Structure A] (a0 : A) (a1 : A) : Prop := |
| 145 | FirstOrder.Language.Structure.RelMap ssMem ![a0, a1] |
| 146 | |
| 147 | /-- `marked a`: the element `a` belongs to the marked set. -/ |
| 148 | def SSMarked {A : Type} [setSystem.Structure A] (a0 : A) : Prop := |
| 149 | FirstOrder.Language.Structure.RelMap ssMarked ![a0] |
| 150 | |
| 151 | end Shorthands |
| 152 | |
| 153 | variable (A : Type) [setSystem.Structure A] |
| 154 | |
| 155 | /-- A set system admits a cover at most as large as its marked set. |
| 156 | (Finiteness of the universe is part of the property: cardinality thresholds |
| 157 | are only meaningful on finite structures.) -/ |
| 158 | def HasSmallSetCover : Prop := |
| 159 | Finite A ∧ CoversOn (SSElem (A := A)) SSFam SSMem SSMarked |
| 160 | |
| 161 | /-- A set system admits a hitting set at most as large as its marked set. -/ |
| 162 | def HasSmallHittingSet : Prop := |
| 163 | Finite A ∧ HitsOn (SSElem (A := A)) SSFam SSMem SSMarked |
| 164 | |
| 165 | /-- A set system admits a packing at least as large as its marked set. -/ |
| 166 | def HasLargeSetPacking : Prop := |
| 167 | Finite A ∧ PacksOn (SSElem (A := A)) SSFam SSMem SSMarked |
| 168 | |
| 169 | /-- A set system admits an exact cover: a subfamily covering every ground |
| 170 | element exactly once. There is no threshold here, so no finiteness |
| 171 | assumption either. -/ |
| 172 | def HasExactCover : Prop := |
| 173 | ExactlyCoversOn (SSElem (A := A)) SSFam SSMem |
| 174 | |
| 175 | /-- A set system admits a splitting two-coloring: no set of the family is |
| 176 | monochromatic. -/ |
| 177 | def HasSetSplitting : Prop := |
| 178 | SplitsOn (SSElem (A := A)) SSFam SSMem |
| 179 | |
| 180 | end Problems |
| 181 | |
| 182 | open Lax904597.Problems Lax904597.Classes Lax799700.Problems |
| 183 | |
| 184 | /-- The property `HasSmallSetCover` is isomorphism-invariant. -/ |
| 185 | axiom hasSmallSetCover_iso : ∀ {A B : Type} [Lax799700.SetFamily.setSystem.Structure A] [Lax799700.SetFamily.setSystem.Structure B], |
| 186 | (A ≃[Lax799700.SetFamily.setSystem] B) → (HasSmallSetCover A ↔ HasSmallSetCover B) |
| 187 | |
| 188 | /-- The problem SetCover: does the structure satisfy `HasSmallSetCover`? -/ |
| 189 | def SetCover : DecisionProblem Lax799700.SetFamily.setSystem := |
| 190 | DecisionProblem.ofPred HasSmallSetCover |
| 191 | |
| 192 | /-- The yes-instances of SetCover are exactly the structures satisfying |
| 193 | `HasSmallSetCover`. -/ |
| 194 | axiom setCover_iff : ∀ (A : Type) [Lax799700.SetFamily.setSystem.Structure A], SetCover A ↔ HasSmallSetCover A |
| 195 | |
| 196 | /-- SetCover is NP-complete. -/ |
| 197 | axiom setCover_NP_complete : NP.Complete SetCover |
| 198 | |
| 199 | /-- The property `HasExactCover` is isomorphism-invariant. -/ |
| 200 | axiom hasExactCover_iso : ∀ {A B : Type} [Lax799700.SetFamily.setSystem.Structure A] [Lax799700.SetFamily.setSystem.Structure B], |
| 201 | (A ≃[Lax799700.SetFamily.setSystem] B) → (HasExactCover A ↔ HasExactCover B) |
| 202 | |
| 203 | /-- The problem ExactCover: does the structure satisfy `HasExactCover`? -/ |
| 204 | def ExactCover : DecisionProblem Lax799700.SetFamily.setSystem := |
| 205 | DecisionProblem.ofPred HasExactCover |
| 206 | |
| 207 | /-- The yes-instances of ExactCover are exactly the structures satisfying |
| 208 | `HasExactCover`. -/ |
| 209 | axiom exactCover_iff : ∀ (A : Type) [Lax799700.SetFamily.setSystem.Structure A], ExactCover A ↔ HasExactCover A |
| 210 | |
| 211 | /-- ExactCover is NP-complete. -/ |
| 212 | axiom exactCover_NP_complete : NP.Complete ExactCover |
| 213 | |
| 214 | /-- The property `HasSmallHittingSet` is isomorphism-invariant. -/ |
| 215 | axiom hasSmallHittingSet_iso : ∀ {A B : Type} [Lax799700.SetFamily.setSystem.Structure A] [Lax799700.SetFamily.setSystem.Structure B], |
| 216 | (A ≃[Lax799700.SetFamily.setSystem] B) → (HasSmallHittingSet A ↔ HasSmallHittingSet B) |
| 217 | |
| 218 | /-- The problem HittingSet: does the structure satisfy `HasSmallHittingSet`? -/ |
| 219 | def HittingSet : DecisionProblem Lax799700.SetFamily.setSystem := |
| 220 | DecisionProblem.ofPred HasSmallHittingSet |
| 221 | |
| 222 | /-- The yes-instances of HittingSet are exactly the structures satisfying |
| 223 | `HasSmallHittingSet`. -/ |
| 224 | axiom hittingSet_iff : ∀ (A : Type) [Lax799700.SetFamily.setSystem.Structure A], HittingSet A ↔ HasSmallHittingSet A |
| 225 | |
| 226 | /-- HittingSet is NP-complete. -/ |
| 227 | axiom hittingSet_NP_complete : NP.Complete HittingSet |
| 228 | |
| 229 | /-- The property `HasLargeSetPacking` is isomorphism-invariant. -/ |
| 230 | axiom hasLargeSetPacking_iso : ∀ {A B : Type} [Lax799700.SetFamily.setSystem.Structure A] [Lax799700.SetFamily.setSystem.Structure B], |
| 231 | (A ≃[Lax799700.SetFamily.setSystem] B) → (HasLargeSetPacking A ↔ HasLargeSetPacking B) |
| 232 | |
| 233 | /-- The problem SetPacking: does the structure satisfy `HasLargeSetPacking`? -/ |
| 234 | def SetPacking : DecisionProblem Lax799700.SetFamily.setSystem := |
| 235 | DecisionProblem.ofPred HasLargeSetPacking |
| 236 | |
| 237 | /-- The yes-instances of SetPacking are exactly the structures satisfying |
| 238 | `HasLargeSetPacking`. -/ |
| 239 | axiom setPacking_iff : ∀ (A : Type) [Lax799700.SetFamily.setSystem.Structure A], SetPacking A ↔ HasLargeSetPacking A |
| 240 | |
| 241 | /-- SetPacking is NP-complete. -/ |
| 242 | axiom setPacking_NP_complete : NP.Complete SetPacking |
| 243 | |
| 244 | /-- The property `HasSetSplitting` is isomorphism-invariant. -/ |
| 245 | axiom hasSetSplitting_iso : ∀ {A B : Type} [Lax799700.SetFamily.setSystem.Structure A] [Lax799700.SetFamily.setSystem.Structure B], |
| 246 | (A ≃[Lax799700.SetFamily.setSystem] B) → (HasSetSplitting A ↔ HasSetSplitting B) |
| 247 | |
| 248 | /-- The problem SetSplitting: does the structure satisfy `HasSetSplitting`? -/ |
| 249 | def SetSplitting : DecisionProblem Lax799700.SetFamily.setSystem := |
| 250 | DecisionProblem.ofPred HasSetSplitting |
| 251 | |
| 252 | /-- The yes-instances of SetSplitting are exactly the structures satisfying |
| 253 | `HasSetSplitting`. -/ |
| 254 | axiom setSplitting_iff : ∀ (A : Type) [Lax799700.SetFamily.setSystem.Structure A], SetSplitting A ↔ HasSetSplitting A |
| 255 | |
| 256 | /-- SetSplitting is NP-complete. -/ |
| 257 | axiom setSplitting_NP_complete : NP.Complete SetSplitting |
| 258 | |
| 259 | end Lax799700.SetFamily |
| 260 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments