Set cover: bundled instances, integral and fractional covers, dual packings, and the two certificate predicates
DefinitionPrimalDualOnline_SetCoverThe set-cover problem of Section 2.2. An instance has a finite type of elements (the source's ), a finite type indexing the available sets (the source's ), an assignment , and a cost . The coverage relation is membership: the set indexed by covers exactly when . It is carried as a Finset-valued function rather than a separate S → E → Prop relation because every statement below sums over the elements of one set, which needs the Finset, and because Finset membership is decidable without a further hypothesis.
SetCoverInstance is the carrier of the problem's standing assumptions. An inhabitant bundles sets, cost, a proof that every cost is nonnegative (the source's "non negative cost ", p. 10), and a proof that every element lies in some available set. Every source-facing theorem in the mission takes such an instance and reads those two facts off its fields; none of them takes either as a loose hypothesis. The two indicator lemmas are the only exceptions and are marked as generalized assisting results, since one has no cost function in scope at all and the other's hypothesis that a given covers is strictly stronger than coverability of the family.
Nonnegativity is retained even where it is logically redundant. In any statement that also assumes a dual packing, together with already gives ; the field is kept because the source's model is of nonnegative costs and should not have to be reconstructed from an accident of which certificate a theorem happens to assume.
A cover is a finite meeting every element, with cost . A fractional cover is a nonnegative with for every element, with cost ; there is no upper bound on . A dual packing is a nonnegative with for every set, of value . The frequency of an element counts the sets containing it and maxFrequency is the source's .
The empty ground type is retained on purpose: no Nonempty E hypothesis appears anywhere. With empty, is a supremum over an empty index set and so is ; the consequence for the certificate bounds is benign rather than false, because every is then empty and the tightness clause forces for every chosen set, making both sides of the bound . Nonemptiness and cardinality hypotheses belong later, and only where an actual algorithm divides by a cost or takes a logarithm of .
The two certificate predicates carry the invariants the source's proofs actually use. IsGreedyCertificate at ratio asserts that covers, , the cover cost equals the dual value exactly, and every packing constraint holds after scaling by . IsPrimalDualCertificate asserts that covers, is dual feasible without scaling, and every set in has a tight dual constraint. They take sets and cost directly rather than an instance, because they are properties of a candidate solution rather than carriers of the problem's standing assumptions; the theorems apply them to the instance's fields.
import Mathlib.Tactic
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.NumberTheory.Harmonic.Bounds
namespace PrimalDualOnline.SetCover
/-!
The set-cover problem of Section 2.2.
An instance consists of a finite type `E` of elements (the source's `X = {e_1,…,e_n}`), a
finite type `S` indexing the available sets (the source's `S = {s_1,…,s_m}`), an assignment
`sets : S → Finset E` giving the elements of each available set, and a nonnegative cost
`cost : S → ℝ`.
The coverage relation of the problem is membership: the set indexed by `s` covers the element
`e` exactly when `e ∈ sets s`. It is carried as a `Finset`-valued function rather than as a
separate `S → E → Prop` relation because every statement below sums over the elements of a
single set, which needs the `Finset`, and because membership in a `Finset` is decidable
without a further hypothesis.
`Coverable` records the standing assumption that every element lies in at least one available
set. The source leaves this implicit; without it the instance has no cover at all and the
approximation statements are vacuous or false.
**Both standing assumptions live in `SetCoverInstance` and reach the theorems only through its
fields.** No source-facing theorem in this development takes nonnegativity of cost or
coverability as a loose hypothesis; each takes `I : SetCoverInstance E S` and reads
`I.cost_nonneg` and `I.coverable` off it. The two `indicator` lemmas are the only exceptions and
are explicitly marked as generalized assisting results rather than source-facing ones.
-/
variable {E S : Type*} [Fintype E] [Fintype S] [DecidableEq E]
/-- The sets containing a given element. -/
def containing [DecidableEq S] (sets : S → Finset E) (e : E) : Finset S :=
Finset.univ.filter fun s => e ∈ sets s
/-- Every element belongs to at least one available set. Required for any cover to exist. -/
def Coverable (sets : S → Finset E) : Prop := ∀ e : E, ∃ s : S, e ∈ sets s
/-- Every available set has nonnegative cost. The source assumes this throughout ("Each set
`s` is associated with a non negative cost `c_s`", p. 10). It is stated as an explicit
predicate rather than left to be forced by packing feasibility, because the negative-cost
instances that feasibility would silently render vacuous are not instances of the problem the
source is discussing. Zero cost is permitted.
Note on logical redundancy: in any statement that also assumes a *dual packing*
(`IsDualPacking`), this predicate is implied, since `0 ≤ y` and `∑ e ∈ sets s, y e ≤ cost s`
together give `0 ≤ cost s`. It is nevertheless retained as part of the instance, because the
source's model is of nonnegative costs and that model should not be reconstructed from an
accident of which certificate a particular theorem happens to assume. -/
def NonnegCost (cost : S → ℝ) : Prop := ∀ s : S, 0 ≤ cost s
/-- A set-cover instance as the source poses it: a finite family of available sets over a
finite ground type, with nonnegative costs, in which every element is covered by at least one
available set.
This structure is the carrier of the problem's standing assumptions, and the source-facing
theorems consume it rather than re-assuming its fields. -/
structure SetCoverInstance (E S : Type*) [Fintype E] [Fintype S] where
/-- The elements of each available set; `e ∈ sets s` is the coverage relation. -/
sets : S → Finset E
/-- The cost of each available set. -/
cost : S → ℝ
/-- Costs are nonnegative (source, p. 10). -/
cost_nonneg : NonnegCost cost
/-- Every element lies in some available set, so a cover exists. -/
coverable : Coverable sets
/-- `C` is an integral cover: every element lies in some chosen set. -/
def IsCover (sets : S → Finset E) (C : Finset S) : Prop :=
∀ e : E, ∃ s ∈ C, e ∈ sets s
/-- The cost of an integral cover. -/
def coverCost (cost : S → ℝ) (C : Finset S) : ℝ := ∑ s ∈ C, cost s
/-- `x` is a fractional cover: nonnegative weights whose total on the sets containing each
element is at least one. This is the LP relaxation `(P)` of p. 10. -/
def IsFractionalCover [DecidableEq S] (sets : S → Finset E) (x : S → ℝ) : Prop :=
(∀ s : S, 0 ≤ x s) ∧ ∀ e : E, 1 ≤ ∑ s ∈ containing sets e, x s
/-- The cost of a fractional cover. -/
def fractionalCost (cost : S → ℝ) (x : S → ℝ) : ℝ := ∑ s : S, cost s * x s
/-- `y` is feasible for the dual packing program `(D)` of p. 11: nonnegative element weights
whose total inside each available set does not exceed that set's cost. -/
def IsDualPacking (sets : S → Finset E) (cost : S → ℝ) (y : E → ℝ) : Prop :=
(∀ e : E, 0 ≤ y e) ∧ ∀ s : S, ∑ e ∈ sets s, y e ≤ cost s
/-- The dual objective: the total element weight. -/
def packingValue (y : E → ℝ) : ℝ := ∑ e : E, y e
/-- The frequency of an element: how many available sets contain it. -/
def frequency [DecidableEq S] (sets : S → Finset E) (e : E) : ℕ :=
(containing sets e).card
/-- The maximum frequency `f` of the instance (p. 14).
**The empty ground type is retained on purpose.** With `E` empty this is a supremum over an
empty index set, hence `0`; no `Nonempty E` hypothesis is imposed anywhere in this development.
The consequence for the certificate bounds is benign rather than false: when `E` is empty every
`sets s` is empty, so the tightness clause of `IsPrimalDualCertificate` forces `cost s = 0` for
every `s ∈ C` and hence `coverCost cost C = 0`, which is exactly what the bound
`coverCost cost C ≤ (maxFrequency sets : ℝ) * fractionalCost cost x` demands when its
coefficient is `0`. Nonemptiness or cardinality hypotheses belong later, and only where an
actual algorithm divides by a cost or takes a logarithm of `|E|`. -/
def maxFrequency [DecidableEq S] (sets : S → Finset E) : ℕ :=
Finset.univ.sup (frequency sets)
/-- The least cost of an integral cover, as an attained value. -/
def IsOptIntegral (sets : S → Finset E) (cost : S → ℝ) (v : ℝ) : Prop :=
IsLeast {w : ℝ | ∃ C : Finset S, IsCover sets C ∧ coverCost cost C = w} v
/-- The least cost of a fractional cover, as an attained value. -/
def IsOptFractional [DecidableEq S] (sets : S → Finset E) (cost : S → ℝ) (v : ℝ) : Prop :=
IsLeast {w : ℝ | ∃ x : S → ℝ, IsFractionalCover sets x ∧ fractionalCost cost x = w} v
/-- The indicator fractional solution of an integral cover: weight one on chosen sets. Used to
witness that every integral cover is also a fractional cover. -/
def indicator [DecidableEq S] (C : Finset S) : S → ℝ := fun s => if s ∈ C then 1 else 0
/-!
## Certificates
The two deterministic analyses of Section 2.2 are stated about *certificates* rather than
about an executable algorithm. A certificate is a pair consisting of a cover and a dual
vector, together with the invariants the source's analysis actually uses. This separates the
algorithm-independent analysis — which is the mathematical content — from the separate
question of whether a particular algorithm produces such a pair.
The certificate predicates take `sets` and `cost` directly rather than a `SetCoverInstance`,
because they are properties of a candidate solution, not carriers of the problem's standing
assumptions; the theorems apply them to `I.sets` and `I.cost`.
-/
/-- A greedy (dual-fitting) certificate, packaging the three claims in the proof of
Theorem 2.4: the output covers, the primal cost equals the constructed dual value, and each
packing constraint is violated by at most a factor `ρ`. -/
def IsGreedyCertificate (sets : S → Finset E) (cost : S → ℝ)
(C : Finset S) (y : E → ℝ) (ρ : ℝ) : Prop :=
IsCover sets C ∧
(∀ e : E, 0 ≤ y e) ∧
coverCost cost C = packingValue y ∧
∀ s : S, ∑ e ∈ sets s, y e ≤ ρ * cost s
/-- A primal-dual certificate, packaging the invariants in the proof of Theorem 2.6: the
output covers, the dual is feasible, and every chosen set has a tight dual constraint. -/
def IsPrimalDualCertificate (sets : S → Finset E) (cost : S → ℝ)
(C : Finset S) (y : E → ℝ) : Prop :=
IsCover sets C ∧
IsDualPacking sets cost y ∧
∀ s ∈ C, ∑ e ∈ sets s, y e = cost s
end PrimalDualOnline.SetCover
Read-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back — set-cover declaration bundle (PrimalDualOnline.SetCover)
Ambient context shared by every declaration
Every declaration in this bundle is stated over two ambient types and , each in an arbitrary universe, introduced by section-level binders together with three instance assumptions: is a finite type, is a finite type, and equality on is decidable. These are implicit arguments of each declaration that mentions the corresponding type. Six declarations additionally require decidable equality on as a further instance argument: containing, IsFractionalCover, frequency, maxFrequency, IsOptFractional, and indicator; the other declarations do not require it.
Throughout I write for the value at of the family named sets — a total function assigning to each index a finite subset — and for the value at of cost, a total function . Nothing in the ambient context constrains either function: may be empty for some or all , the sets may coincide or overlap arbitrarily, and may be zero, positive, or negative unless a particular declaration says otherwise. always denotes a finite subset of , a weight on indices, a weight on elements, and a real number. Both and may be empty types; no declaration assumes either is nonempty, and no declaration relates their sizes.
All seventeen items in the file are definitions or one structure. There is no theorem and no lemma anywhere in the bundle: the file proves nothing and asserts nothing about any of the notions it introduces; it only introduces vocabulary. The file imports general tactic support, ordered-semiring big-operator lemmas over finite sets, and bounds on harmonic numbers, but no declaration mentions harmonic numbers, logarithms, set cardinalities , or any numeric approximation factor; the only approximation-like quantity in the bundle is the free real parameter of IsGreedyCertificate, which that definition leaves entirely unconstrained.
containing
Given decidable equality on in addition to the ambient instances, a family of finite subsets of , and an element , this defines the finite subset of
obtained by filtering the universal finite set of all indices (available because is assumed finite) by the predicate " belongs to "; decidability of that predicate comes from decidable equality on . The filtering ranges over the whole of , not over any candidate subcollection, so this is the collection of all indices whose set contains . It may be empty — exactly when lies in no , which includes the case empty and the case where every is empty. No cost function appears, so no constraint on the sign of any cost is imposed, and the definition does not require that every element lie in some set: it merely records which indices, possibly none, contain .
Coverable
Given a family , this is the proposition
that every element of the ambient element type belongs to at least one member of the family; the existential ranges over all of . This is the one predicate whose entire content is "every element lies in some set". It is purely propositional, built from finite-set membership, and uses no decidability beyond the ambient instances; no cost function appears, so nothing about the sign of any cost is constrained. Degenerate cases: if is empty the statement holds vacuously for any family, including the family sending every index to the empty set and including empty; if is nonempty and is empty, or more generally if some element belongs to no , it is false. The existential is unweighted and says nothing about how many sets contain a given element.
NonnegCost
Given a cost function into the reals, this is the proposition
that every index has nonnegative cost. The inequality is non-strict, so zero-cost indices are permitted, including a cost identically zero; the statement is vacuously true when is empty. It concerns costs only: it says nothing about the family, nothing about coverage, and in particular does not require that every element lie in some set.
SetCoverInstance
This structure takes four parameters written out in its own signature: two explicit type arguments and , and two instance arguments, finiteness of and finiteness of . (It does not take decidable equality on or on .) An inhabitant of bundles exactly four components and nothing else:
sets— a total function from to finite subsets of , i.e. the family ;cost— a total function , i.e. ;cost_nonneg— a proof of , unfolded: for every ;coverable— a proof of , unfolded: every belongs to for at least one .
So an inhabitant is a finite element type, a finite index type, a set family over them, a real cost per index, a nonnegativity guarantee for all costs, and a coverability guarantee for all elements. There is no requirement that the sets be nonempty or pairwise distinct, no cardinality or frequency bound, no strict positivity of costs (only nonnegativity), and no stored optimum. If is empty the coverability field is vacuous, so inhabitants exist for any family with any nonnegative cost; if is empty the cost field's condition is vacuous and an inhabitant exists precisely when is also empty, the coverability field being otherwise unsatisfiable; a cost identically zero yields legitimate inhabitants.
Whether the structure is consumed in this file. Checking every other declaration one by one: containing takes a bare family and an element; Coverable a bare family; NonnegCost a bare cost; IsCover a bare family and ; coverCost a bare cost and ; IsFractionalCover a bare family and ; fractionalCost a bare cost and ; IsDualPacking a bare family, a bare cost and ; packingValue only ; frequency a bare family and an element; maxFrequency a bare family; IsOptIntegral a bare family, a bare cost and a real ; IsOptFractional a bare family, a bare cost and a real ; indicator only ; IsGreedyCertificate a bare family, a bare cost, , and ; IsPrimalDualCertificate a bare family, a bare cost, and . No declaration in this file takes a SetCoverInstance as an argument, and none projects any of its four fields. The dependency runs only inward: the structure's field types mention NonnegCost and Coverable, and those two predicates are themselves used nowhere else in the file. Within this file the structure is therefore inert — defined and never consumed. In particular the cost nonnegativity and the coverability it packages are not transported into any other definition here; every other definition either requires such a hypothesis separately or does not require it at all.
IsCover
Given a family and a finite subset , this is the proposition
that every element of belongs to at least one set indexed by a member of . The existential is restricted to , unlike Coverable, where it ranges over all of . This is the "every element lies in some set" condition localised to . No cost function occurs, so no sign constraint on costs is imposed or implied. Degenerate cases: if is empty the statement holds for every , including and including empty; if is nonempty then makes it false, the inner existential over an empty collection being false, and likewise if is empty. Multiplicity is irrelevant — an element covered by many members of satisfies the condition exactly as one covered by a single member — and there is no minimality, irredundancy, or distinctness requirement on .
coverCost
Given a cost function and a finite subset , this is the real number
a plain finite sum over the members of , counting each member once regardless of how many elements it covers. It is defined for every finite subset , whether or not covers anything: no coverage condition appears, so it does not require that every element lie in some set. It imposes no sign condition on cost — with negative the value may be negative, and enlarging may decrease the total. If is empty (in particular if is empty, forcing empty) the value is the empty sum ; if the cost is identically zero the value is for every ; zero-cost indices contribute nothing and may be added to or removed from without changing the value.
IsFractionalCover
Given decidable equality on , a family , and a weight vector , this is the conjunction of two conditions:
where the inner sum ranges over — that is, over all indices of the whole type whose set contains , with containing unfolded. So the weights are nonnegative and, for each element, the total weight of the sets containing it is at least . The sign constraint here is on , not on cost: no cost function is an argument, so the definition neither assumes nor implies anything about the sign of any cost. The second clause is the fractional analogue of "every element lies in some set" and does entail it: if some belonged to no , its sum would be the empty sum and would fail. There is no upper bound of on the weights — may exceed , may be arbitrarily large, the per-element covering sums may far exceed , and is unbounded. Degenerate cases: if is empty the second clause is vacuous and the condition reduces to nonnegativity of alone, so qualifies; if is empty, or more generally if some element lies in no set, the second clause is unsatisfiable whenever is nonempty, so no qualifies; the zero vector qualifies only when is empty.
fractionalCost
Given a cost function and a weight vector , this is the real number
a sum over the entire index type (legitimate because is finite), not over a subcollection and not over the support of . No hypothesis restricts or : the definition applies to arbitrary real vectors, so it does not assume nonnegative cost, does not assume nonnegative weights, imposes no coverage requirement, and its value may be negative. If is empty the value is ; if the cost is identically zero the value is for every ; an index of zero cost contributes nothing however large its weight, and an index of zero weight contributes nothing however large its cost.
IsDualPacking
Given a family , a cost function , and an element weighting , this is the conjunction
the element weights are nonnegative, and for every index — all of , not merely some subcollection — the total weight of the elements of does not exceed that index's cost. The definition does not assume nonnegative cost but it implies it: for each , the sum is a finite sum of nonnegative terms by the first clause, so and hence for every ; any satisfying this condition therefore witnesses , and the condition is unsatisfiable whenever some cost is negative. It does not require that every element lie in some set: an element belonging to no is constrained only by and may carry arbitrarily large weight. Degenerate cases: if is empty every is empty, each sum is , and the condition reduces to for all ; if is empty the second clause is vacuous and the condition reduces to nonnegativity of ; if for a particular that index's constraint reduces to ; if for some — in particular if the cost is identically zero — then with the constraint forces for every .
packingValue
Given an element weighting , this is the real number
the sum of the weights over the entire element type, using finiteness of . It takes no family and no cost, so it constrains neither the sign of cost nor coverage, and it does not require to be nonnegative — on an arbitrary real vector its value may be negative. If is empty the value is the empty sum . Every element of is counted, including elements belonging to no set of the family.
frequency
Given decidable equality on , a family , and an element , this is the natural number
the cardinality of — the number of indices of the whole type whose set contains . Being a natural number it is automatically nonnegative, and it equals exactly when belongs to no set of the family, in particular when is empty or when every is empty. No cost appears, so there is no constraint on the sign of any cost, and the definition does not require that every element lie in some set — the value is precisely the record of an element that lies in none.
maxFrequency
Given decidable equality on and a family , this is the natural number
the supremum, taken over the universal finite set of all elements of , of the frequencies above. Because it is a finite supremum in the naturals, whose least element is , an empty supremum takes the value rather than being undefined. It is a natural number, hence nonnegative by type; no cost function appears, so there is no constraint on the sign of any cost; and it does not require that every element lie in some set.
When it is . Exactly when every element has frequency , i.e. when no element of lies in any . Concretely: (i) empty — the supremum is over an empty range and takes its default value , for any family whatsoever, including empty; (ii) empty with arbitrary, since then no index exists to contain anything; (iii) nonempty but for every . Cases (ii) and (iii) with nonempty are exactly the failure of Coverable, so a coverable family over a nonempty has — though the file states no such connection.
What the declarations mentioning it reduce to. No other declaration in the file mentions maxFrequency: no definition's body refers to it, and the free parameter of IsGreedyCertificate is never tied to it or to any frequency. Within this file maxFrequency is defined and unused, so the cases affect nothing else in the bundle. Correspondingly frequency is used only inside maxFrequency, and containing is used only inside frequency and in the covering clause of IsFractionalCover.
IsOptIntegral
Given a family , a cost function , and a real number , this asserts that is the least element of the set of achievable cover costs:
with the cover condition and the cost sum unfolded. "Least element" is a two-part condition: is itself achieved by some covering collection (membership in the set) and for every achievable cover cost (lower bound); both halves matter, so the optimum must be attained rather than merely approached. The definition does not assume nonnegative cost and does not imply it: with negative costs a least element still exists whenever any cover exists, since is finite and so only finitely many values are achievable; the optimum may then be negative and may be attained by a redundant whose extra negative-cost members lower the total. It does require, for satisfiability, that every element lie in some set: if no covers the defining set is empty and no real satisfies the condition, so the predicate is then unsatisfiable. Degenerate cases: if is empty every is a cover, so is the minimum of over all finite subsets of — which is when all costs are nonnegative and otherwise the sum of the negative costs; if is empty the only candidate is , so the predicate holds exactly at when is empty and for no when is nonempty; if the cost is identically zero the predicate holds exactly at provided some cover exists, and for no otherwise; zero-cost indices may be added freely to an optimal without changing .
IsOptFractional
Given decidable equality on , a family , a cost function , and a real number , this asserts that is the least element of the set of achievable fractional-cover costs:
with the fractional-cover condition and the cost functional unfolded. Again "least element" means both that is attained by some feasible and that for every feasible value, so this asserts that the infimum is achieved, not merely that it is a lower bound. Weights are required nonnegative but are not bounded above by ; arbitrarily large weights are feasible. The definition does not assume nonnegative cost but implies it whenever it holds: suppose for some ; the predicate requires the value set to be nonempty, so some feasible exists, and for every the vector is still feasible — nonnegativity is preserved and each element's covering sum only increases — with cost as ; the value set is then unbounded below and has no least element, a contradiction. Hence holding for some forces for all . It likewise requires, for satisfiability, that every element lie in some set, since otherwise no feasible exists (an uncovered element's covering sum is the empty sum ) and the value set is empty. Degenerate cases: if is empty, feasibility reduces to , so with nonnegative costs is feasible and the predicate holds exactly at , while with some negative cost it holds for no by the unboundedness argument; if is empty it holds exactly at when is empty and for no when is nonempty; if the cost is identically zero it holds exactly at provided some feasible exists; a single zero-cost index may carry unbounded weight at no cost.
indicator
Given decidable equality on and a finite subset , this is the function
a real-valued vector on the index type; the decidable-equality-on- instance is what makes the membership test decidable. It takes no family and no cost, so it constrains neither the sign of cost nor coverage. If is empty — in particular if is empty — the function is identically . No declaration in this file applies indicator to anything: it appears neither in IsFractionalCover nor in IsOptFractional nor anywhere else, and the file contains no statement relating to fractional covers or relating coverCost to fractionalCost. Within this file it is inert.
IsGreedyCertificate
Given a family , a cost function , a finite subset , an element weighting , and a real number — five explicit arguments, together with the ambient implicit type and instance arguments — this is the conjunction of four conditions:
- is a cover: every lies in for some ;
- is nonnegative: for every ;
- exact cost matching: , the cost of equalling (not merely bounding) the total element weight, the right-hand sum being over all of ;
- -relaxed dual feasibility: for every .
The parameter is an arbitrary real: the definition places no constraint on it — it need not be positive, need not be at least , and is not related to or to any other quantity in the file. The definition does not assume nonnegative cost; what it implies depends on , since clauses 2 and 4 give and hence for every . Thus if it implies for all ; if it implies for all , so only families with all costs nonpositive admit a certificate with negative ; and if , clause 4 becomes for every , which with clause 2 forces for every element lying in any , whereupon clause 1 — which places every element of in some with — forces on all of , so the right-hand side of clause 3 is and the predicate collapses to: covers , is identically zero, and (individual member costs may be nonzero and cancel). Clause 1 is the "every element lies in some set" requirement, localised to . Further degenerate cases: if is empty, clause 1 holds for every , clause 3 reduces to (its right side an empty sum), and clause 4 to for all ; if is empty and nonempty, clause 1 fails; if both are empty, clause 3 reads ; if is empty, clause 4 is vacuous and clauses 1 and 3 force empty with nothing required of beyond nonnegativity; if for a particular , clause 4 forces for every whatever is; if the cost is identically zero then, given clause 1, the predicate holds precisely when , for every covering and every . No clause asserts any relation between and any optimum: the definition mentions neither IsOptIntegral nor IsOptFractional, and nothing in the file connects them.
IsPrimalDualCertificate
Given a family , a cost function , a finite subset , and an element weighting — four explicit arguments plus the ambient implicit and instance arguments — this is the conjunction of three conditions:
- is a cover: every lies in for some ;
- is a dual packing for the family and the cost, i.e.
IsDualPackingunfolded: for every , and for every — the bound holding at all indices, with coefficient exactly ; - tightness on the chosen collection: for every , each selected index's constraint being met with equality.
There is no clause equating with : unlike IsGreedyCertificate, this definition mentions neither packingValue nor coverCost, and it asserts no inequality against any optimum. It does not assume nonnegative cost but implies it, exactly as in IsDualPacking: each is a sum of nonnegative terms, so for every (not only for ), and the predicate is unsatisfiable when any cost is negative. Clause 1 is the "every element lies in some set" requirement, localised to . Degenerate cases: if is empty, clause 1 is vacuous and every is empty, so clause 2 reduces to for all while clause 3 forces for every — with empty only zero-cost indices may appear in ; if is empty, clause 3 is vacuous and clause 1 requires empty; if is empty, clauses 2 and 3 are vacuous and clause 1 requires empty; if for some , clause 3 forces ; if for some , clause 2 with nonnegativity forces throughout , and when such an lies in clause 3 is then automatic; if the cost is identically zero, the predicate holds precisely when covers and vanishes on , which by clause 1 is all of , so .
Cross-cutting summary
Sign of cost, declaration by declaration. Assumed outright: NonnegCost (its whole content) and the cost_nonneg field of SetCoverInstance. Implied without being assumed: IsDualPacking and IsPrimalDualCertificate, where a nonnegative bounded above by gives for every ; IsOptFractional, where a negative cost makes the feasible value set unbounded below so that no least element can exist; and IsGreedyCertificate conditionally on — gives everywhere, gives everywhere, and gives no sign information but forces and . Neither assumed nor implied: containing, Coverable, IsCover, coverCost, IsFractionalCover (which constrains the sign of instead), fractionalCost, packingValue, frequency, maxFrequency, IsOptIntegral, indicator.
"Every element lies in some set", declaration by declaration. Asserted over all of : Coverable. Asserted over the given collection : IsCover, and clause 1 of both IsGreedyCertificate and IsPrimalDualCertificate. Asserted in a fractional form that entails it: IsFractionalCover, and hence the feasibility condition inside IsOptFractional. Required only for satisfiability, via the existential over covers: IsOptIntegral and IsOptFractional are false for every when no cover, respectively no fractional cover, exists. Not required at all: containing, NonnegCost, coverCost, fractionalCost, IsDualPacking (elements in no set are constrained only by ), packingValue, frequency, maxFrequency, indicator. Packaged as a field: SetCoverInstance, through coverable.
Nature of the coverage relation. Coverage is not a separately declared -valued relation on ; it is finite-set membership , where is the finite subset of produced by the total function sets. Membership in a finite subset is a proposition, and the quantified statements built from it — Coverable, IsCover, and the clauses of both certificate predicates — are ordinary propositions requiring no decidability. Decidability is needed only where membership must be computed into data: forming by filtering the universal finite set of needs the membership predicate to be decidable, which follows from decidable equality on , and needs finite; indicator needs decidability of for a finite subset of , which follows from decidable equality on . Decidable equality on is demanded as an extra instance argument by containing, frequency, maxFrequency, IsFractionalCover, and IsOptFractional. Every sum or supremum over a whole type — in fractionalCost, in packingValue, the supremum over in maxFrequency, the filter over in containing — relies on the ambient finiteness instances.
Degenerate cases across the bundle. empty: Coverable and IsCover hold for every family and every ; IsFractionalCover reduces to ; packingValue and every sum over is ; maxFrequency is ; IsDualPacking reduces to for all ; IsPrimalDualCertificate forces for every ; IsGreedyCertificate reduces to together with ; IsOptIntegral becomes the minimum of over all subsets of ; IsOptFractional holds exactly at when costs are nonnegative. empty: is empty, all frequencies and maxFrequency are , coverCost and fractionalCost are , Coverable, IsCover and IsFractionalCover are unsatisfiable unless is empty, and both optimality predicates hold only at with empty. empty: coverCost is ; IsCover holds only if is empty; the tightness clause of IsPrimalDualCertificate is vacuous; IsGreedyCertificate requires . Cost identically zero: permitted by NonnegCost and by SetCoverInstance; makes every coverCost and fractionalCost zero; forces to vanish on all covered elements in IsDualPacking, IsGreedyCertificate and IsPrimalDualCertificate; both optima equal when feasible. Individual zero-cost indices: forced by IsDualPacking to have throughout ; addable to or removable from without changing coverCost; able to carry unbounded fractional weight at no cost in IsFractionalCover and IsOptFractional; automatically satisfying the tightness clause of IsPrimalDualCertificate once vanishes on . zero or negative: both permitted by IsGreedyCertificate, with the consequences above — collapsing the certificate to a zero dual and a zero-total-cost cover, requiring all costs nonpositive. Weights above in a fractional cover: permitted without restriction, IsFractionalCover imposing only and a lower bound of on each element's covering sum, with no upper bound on any , on any covering sum, or on .
Confirmed by the mission captain (proposal self-audit).