The powerset of a finset #
powerset #
When s
is a finset, s.powerset
is the finset of all subsets of s
(seen as finsets).
Equations
- Finset.powerset s = { val := Multiset.pmap Finset.mk (Multiset.powerset s.val) ⋯, nodup := ⋯ }
Instances For
Number of Subsets of a Set
For predicate p
decidable on subsets, it is decidable whether p
holds for any subset.
Equations
- Finset.decidableExistsOfDecidableSubsets = decidable_of_iff (∃ (t : Finset α) (hs : t ∈ Finset.powerset s), p t ⋯) ⋯
For predicate p
decidable on subsets, it is decidable whether p
holds for every subset.
Equations
- Finset.decidableForallOfDecidableSubsets = decidable_of_iff (∀ (t : Finset α) (h : t ∈ Finset.powerset s), p t ⋯) ⋯
A version of Finset.decidableExistsOfDecidableSubsets
with a non-dependent p
.
Typeclass inference cannot find hu
here, so this is not an instance.
Equations
- Finset.decidableExistsOfDecidableSubsets' hu = Finset.decidableExistsOfDecidableSubsets
Instances For
A version of Finset.decidableForallOfDecidableSubsets
with a non-dependent p
.
Typeclass inference cannot find hu
here, so this is not an instance.
Equations
- Finset.decidableForallOfDecidableSubsets' hu = Finset.decidableForallOfDecidableSubsets
Instances For
For s
a finset, s.ssubsets
is the finset comprising strict subsets of s
.
Equations
- Finset.ssubsets s = Finset.erase (Finset.powerset s) s
Instances For
For predicate p
decidable on ssubsets, it is decidable whether p
holds for any ssubset.
Equations
- Finset.decidableExistsOfDecidableSSubsets = decidable_of_iff (∃ (t : Finset α) (hs : t ∈ Finset.ssubsets s), p t ⋯) ⋯
For predicate p
decidable on ssubsets, it is decidable whether p
holds for every ssubset.
Equations
- Finset.decidableForallOfDecidableSSubsets = decidable_of_iff (∀ (t : Finset α) (h : t ∈ Finset.ssubsets s), p t ⋯) ⋯
A version of Finset.decidableExistsOfDecidableSSubsets
with a non-dependent p
.
Typeclass inference cannot find hu
here, so this is not an instance.
Equations
- Finset.decidableExistsOfDecidableSSubsets' hu = Finset.decidableExistsOfDecidableSSubsets
Instances For
A version of Finset.decidableForallOfDecidableSSubsets
with a non-dependent p
.
Typeclass inference cannot find hu
here, so this is not an instance.
Equations
- Finset.decidableForallOfDecidableSSubsets' hu = Finset.decidableForallOfDecidableSSubsets
Instances For
Given an integer n
and a finset s
, then powersetCard n s
is the finset of subsets of s
of cardinality n
.
Equations
- Finset.powersetCard n s = { val := Multiset.pmap Finset.mk (Multiset.powersetCard n s.val) ⋯, nodup := ⋯ }
Instances For
Formula for the Number of Combinations