class
LawfulEmptyCollection
(C : Type u_3)
(α : outParam (Type u_4))
[Membership α C]
[EmptyCollection C]
:
Instances
theorem
lawfulEmptyCollection_iff
(C : Type u_3)
(α : outParam (Type u_4))
[Membership α C]
[EmptyCollection C]
:
class
ToMultiset
(C : Type u_3)
(α : outParam (Type u_4))
extends Membership α C, Membership.IsEmpty C :
Type (max u_3 u_4)
- toMultiset : C → Multiset α
Instances
The size function derived from ToMultiset
.
Use size
for computation whenever possible, as it is usually faster.
Equations
- sizeTM c = (toMultiset c).card
Instances For
class
ToMultiset.LawfulInsert
(C : Type u_3)
(α : outParam (Type u_4))
[ToMultiset C α]
[Insert α C]
:
Instances
Instances
theorem
lawfulErase_iff_toMultiset
(C : Type u_3)
(α : outParam (Type u_4))
[ToMultiset C α]
[Erase C α]
:
LawfulErase C α ↔ ∀ [inst : DecidableEq α] (c : C) (a : α), toMultiset (erase c a) = (toMultiset c).erase a
Equations
- instIsEmptyList = { isEmpty := List.isEmpty, isEmpty_iff_forall_not_mem := ⋯ }
Equations
- instToMultisetList = { toMembership := List.instMembership, toIsEmpty := instIsEmptyList, toMultiset := Multiset.ofList, mem_toMultiset := ⋯ }
Equations
- instSizeList = { size := List.length, size_eq_sizeTM := ⋯ }
Equations
- instIsEmptyArray = { isEmpty := Array.isEmpty, isEmpty_iff_forall_not_mem := ⋯ }
Equations
- instToMultisetArray = { toMembership := Array.instMembership, toIsEmpty := instIsEmptyArray, toMultiset := fun (c : Array α) => ↑c.toList, mem_toMultiset := ⋯ }
Equations
- instSizeArray = { size := Array.size, size_eq_sizeTM := ⋯ }
theorem
lawfulEmptyCollection_iff_toMultiset
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
[EmptyCollection C]
:
theorem
LawfulEmptyCollection.of_toMultiset
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
[EmptyCollection C]
:
toMultiset ∅ = 0 → LawfulEmptyCollection C α
Alias of the reverse direction of lawfulEmptyCollection_iff_toMultiset
.
@[simp]
theorem
toMultiset_empty
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
[EmptyCollection C]
[LawfulEmptyCollection C α]
:
@[simp]
theorem
toMultiset_of_isEmpty
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
{c : C}
:
isEmpty c = true → toMultiset c = 0
Alias of the forward direction of toMultiset_iff_isEmpty
.
theorem
ToMultiset.not_isEmpty_of_mem
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
{c : C}
{x : α}
(hx : x ∈ c)
:
theorem
count_toMultiset_eq_zero
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
[DecidableEq α]
{a : α}
{c : C}
:
theorem
count_toMultiset_ne_zero
{C : Type u_1}
{α : Type u_2}
[ToMultiset C α]
[DecidableEq α]
{a : α}
{c : C}
:
- merge : C → C → C