multiset_positive_subset_sums
def
The finite set (of type Finset ℕ) of all sums of nonempty submultisets of a multiset s of natural numbers.
Statement
def multiset_positive_subset_sums (s : Multiset ℕ) : Finset ℕ- Defined in
- scout/2611-15780-multiple-choice-knapsack-with-small-items.md:207
- Verified
- 14 Nov 2026
- Axioms
- none listed
Read back from the Lean
Given a multiset s of natural numbers, multiset_positive_subset_sums s is defined as the finite set (Finset ℕ) of all sums of elements of non-empty submultisets of s.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The finite set S*(s) of sums of nonempty submultisets of a multiset s. -/ def multiset_positive_subset_sums (s : Multiset ℕ) : Finset ℕ := ((s.powerset.filter (· ≠ 0)).map Multiset.sum).toFinset