Definition of 0 and ::ₘ #
This file defines constructors for multisets:
Zero (Multiset α)instance: the empty multisetMultiset.cons: add one element to a multisetSingleton α (Multiset α)instance: multiset with one element
It also defines the following predicates on multisets:
Multiset.Rel:Rel r s tlifts the relationrbetween two elements to a relation betweensandt, s.t. there is a one-to-one mapping between elements insandtfollowingr.
Notation #
0: The empty multiset.{a}: The multiset containing a single occurrence ofa.a ::ₘ s: The multiset containing one more occurrence ofathansdoes.
Main results #
Multiset.rec: recursion on adding one element to a multiset at a time.
Empty multiset #
def
Multiset.rec
{α : Type u_1}
{C : Multiset α → Sort u_3}
(C_0 : C 0)
(C_cons : (a : α) → (m : Multiset α) → C m → C (a ::ₘ m))
(C_cons_heq :
∀ (a a' : α) (m : Multiset α) (b : C m), C_cons a (a' ::ₘ m) (C_cons a' m b) ≍ C_cons a' (a ::ₘ m) (C_cons a m b))
(m : Multiset α)
:
C m
Dependent recursor on multisets.
TODO: should be @[recursor 6], but then the definition of Multiset.pi fails with a stack
overflow in whnf.
Equations
Instances For
def
Multiset.recOn
{α : Type u_1}
{C : Multiset α → Sort u_3}
(m : Multiset α)
(C_0 : C 0)
(C_cons : (a : α) → (m : Multiset α) → C m → C (a ::ₘ m))
(C_cons_heq :
∀ (a a' : α) (m : Multiset α) (b : C m), C_cons a (a' ::ₘ m) (C_cons a' m b) ≍ C_cons a' (a ::ₘ m) (C_cons a m b))
:
C m
Companion to Multiset.rec with more convenient argument order.
Equations
Instances For
@[simp]
@[deprecated Multiset.notMem_zero (since := "2025-05-23")]
Alias of Multiset.notMem_zero.
@[deprecated Multiset.eq_zero_of_forall_notMem (since := "2025-05-23")]
Alias of Multiset.eq_zero_of_forall_notMem.
@[deprecated Multiset.eq_zero_iff_forall_notMem (since := "2025-05-23")]
Alias of Multiset.eq_zero_iff_forall_notMem.
Singleton #
@[simp]
This is a rfl and simp version of bot_eq_zero.
Cardinality #
Map for partial functions #
Rel r s t -- lift the relation r between two elements to a relation between s and t,
s.t. there is a one-to-one mapping between elements in s and t following r.
- zero {α : Type u_1} {β : Type v} {r : α → β → Prop} : Rel r 0 0
- cons {α : Type u_1} {β : Type v} {r : α → β → Prop} {a : α} {b : β} {as : Multiset α} {bs : Multiset β} : r a b → Rel r as bs → Rel r (a ::ₘ as) (b ::ₘ bs)
Instances For
@[deprecated Multiset.Nodup.notMem (since := "2025-05-23")]
Alias of Multiset.Nodup.notMem.