Basic results on multisets #
Produces a list of the elements in the multiset using choice.
Equations
- s.toList = Quotient.out s
Instances For
Induction principles #
The strong induction principle for multisets.
Equations
- s.strongInductionOn ih = ih s fun (t : Multiset α) (_h : t < s) => t.strongInductionOn ih
Instances For
Suppose that, given that p t
can be defined on all supersets of s
of cardinality less than
n
, one knows how to define p s
. Then one can inductively define p s
for all multisets s
of
cardinality less than n
, starting from multisets of card n
and iterating. This
can be used either to define data, or to prove properties.
Equations
- Multiset.strongDownwardInduction H s = H s fun {t : Multiset α} (ht : t.card ≤ n) (_h : s < t) => Multiset.strongDownwardInduction H t ht
Instances For
Analogue of strongDownwardInduction
with order of arguments swapped.
Equations
Instances For
Given a proof hp
that there exists a unique a ∈ l
such that p a
, chooseX p l hp
returns
that a
together with proofs of a ∈ l
and p a
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a proof hp
that there exists a unique a ∈ l
such that p a
, choose p l hp
returns
that a
.
Equations
- Multiset.choose p l hp = ↑(Multiset.chooseX p l hp)
Instances For
The equivalence between lists and multisets of a subsingleton type.
Equations
- Multiset.subsingletonEquiv α = { toFun := Multiset.ofList, invFun := Quot.lift id ⋯, left_inv := ⋯, right_inv := ⋯ }