Documentation

Algorithm.Data.Classes.ToMultiset

class Membership.IsEmpty (C : Type u_3) {α : outParam (Type u_4)} [Membership α C] :
Type u_3
Instances
    theorem isEmpty_eq_false_iff_exists_mem {C : Type u_1} {α : Type u_2} [Membership α C] [Membership.IsEmpty C] {c : C} :
    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] :
      LawfulEmptyCollection C α ∀ (x : α), ¬x
      class ToMultiset (C : Type u_3) (α : outParam (Type u_4)) extends Membership α C, Membership.IsEmpty C :
      Type (max u_3 u_4)
      Instances
        def sizeTM {C : Type u_1} {α : Type u_2} [ToMultiset C α] (c : C) :

        The size function derived from ToMultiset.

        Use size for computation whenever possible, as it is usually faster.

        Equations
        Instances For
          theorem card_toMultiset {C : Type u_1} {α : Type u_2} [ToMultiset C α] (c : C) :
          theorem sizeTM_eq_card_toMultiset {C : Type u_1} {α : Type u_2} [ToMultiset C α] (c : C) :
          class Size (C : Type u_3) {α : outParam (Type u_4)} [ToMultiset C α] :
          Type u_3
          Instances
            class ToMultiset.LawfulInsert (C : Type u_3) (α : outParam (Type u_4)) [ToMultiset C α] [Insert α C] :
            Instances
              class LawfulErase (C : Type u_3) (α : outParam (Type u_4)) [ToMultiset C α] [Erase C α] :
              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
                instance instIsEmptyList {α : Type u_2} :
                Equations
                instance instToMultisetList {α : Type u_2} :
                Equations
                instance instSizeList {α : Type u_2} :
                Size (List α)
                Equations
                instance instIsEmptyArray {α : Type u_2} :
                Equations
                instance instToMultisetArray {α : Type u_2} :
                Equations
                instance instSizeArray {α : Type u_2} :
                Size (Array α)
                Equations
                @[simp]
                theorem toMultiset_empty {C : Type u_1} {α : Type u_2} [ToMultiset C α] [EmptyCollection C] [LawfulEmptyCollection C α] :
                @[simp]
                theorem toMultiset_list {α : Type u_2} (l : List α) :
                toMultiset l = l
                theorem isEmpty_iff_sizeTM_eq_zero {C : Type u_1} {α : Type u_2} [ToMultiset C α] {c : C} :
                theorem isEmpty_iff_size_eq_zero {C : Type u_1} {α : Type u_2} [ToMultiset C α] [Size C] {c : C} :
                theorem isEmpty_eq_decide_sizeTM {C : Type u_1} {α : Type u_2} [ToMultiset C α] (c : C) :
                theorem isEmpty_eq_sizeTM_beq_zero {C : Type u_1} {α : Type u_2} [ToMultiset C α] (c : C) :
                isEmpty c = (sizeTM c == 0)
                theorem toMultiset_iff_isEmpty {C : Type u_1} {α : Type u_2} [ToMultiset C α] {c : C} :
                @[simp]
                theorem toMultiset_of_isEmpty {C : Type u_1} {α : Type u_2} [ToMultiset C α] {c : C} :

                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} :
                class Mergeable (C : Type u_3) (α : outParam (Type u_4)) [ToMultiset C α] :
                Type u_3
                Instances