Documentation

Mathlib.Data.Finset.Empty

Empty and nonempty finite sets #

This file defines the empty finite set ∅ and a predicate for nonempty Finsets.

Main declarations #

Tags #

finite sets, finset

Nonempty #

def Finset.Nonempty {α : Type u_1} (s : Finset α) :

The property s.Nonempty expresses the fact that the finset s is not empty. It should be used in theorem assumptions instead of ∃ x, x ∈ s or s ≠ ∅ as it gives access to a nice API thanks to the dot notation.

Equations
    Instances For
      instance Finset.decidableNonempty {α : Type u_1} {s : Finset α} :
      Equations
        @[simp]
        theorem Finset.coe_nonempty {α : Type u_1} {s : Finset α} :
        theorem Finset.nonempty_coe_sort {α : Type u_1} {s : Finset α} :
        Nonempty { x : α // x s } s.Nonempty
        theorem Finset.Nonempty.to_set {α : Type u_1} {s : Finset α} :
        s.Nonempty(↑s).Nonempty

        Alias of the reverse direction of Finset.coe_nonempty.

        theorem Finset.Nonempty.coe_sort {α : Type u_1} {s : Finset α} :
        s.NonemptyNonempty { x : α // x s }

        Alias of the reverse direction of Finset.nonempty_coe_sort.

        theorem Finset.Nonempty.exists_mem {α : Type u_1} {s : Finset α} (h : s.Nonempty) :
        ∃ (x : α), x s
        theorem Finset.Nonempty.mono {α : Type u_1} {s t : Finset α} (hst : s t) (hs : s.Nonempty) :
        theorem Finset.Nonempty.forall_const {α : Type u_1} {s : Finset α} (h : s.Nonempty) {p : Prop} :
        (∀ xs, p) p
        theorem Finset.Nonempty.to_subtype {α : Type u_1} {s : Finset α} :
        s.NonemptyNonempty { x : α // x s }
        theorem Finset.Nonempty.to_type {α : Type u_1} {s : Finset α} :

        empty #

        def Finset.empty {α : Type u_1} :

        The empty finset

        Equations
          Instances For
            Equations
              instance Finset.inhabitedFinset {α : Type u_1} :
              Equations
                @[simp]
                theorem Finset.empty_val {α : Type u_1} :
                @[simp]
                theorem Finset.notMem_empty {α : Type u_1} (a : α) :
                a
                @[deprecated Finset.notMem_empty (since := "2025-05-23")]
                theorem Finset.not_mem_empty {α : Type u_1} (a : α) :
                a

                Alias of Finset.notMem_empty.

                @[simp]
                theorem Finset.mk_zero {α : Type u_1} :
                { val := 0, nodup := } =
                theorem Finset.ne_empty_of_mem {α : Type u_1} {a : α} {s : Finset α} (h : a s) :
                theorem Finset.Nonempty.ne_empty {α : Type u_1} {s : Finset α} (h : s.Nonempty) :
                @[simp]
                theorem Finset.empty_subset {α : Type u_1} (s : Finset α) :
                theorem Finset.eq_empty_of_forall_notMem {α : Type u_1} {s : Finset α} (H : ∀ (x : α), xs) :
                s =
                @[deprecated Finset.eq_empty_of_forall_notMem (since := "2025-05-23")]
                theorem Finset.eq_empty_of_forall_not_mem {α : Type u_1} {s : Finset α} (H : ∀ (x : α), xs) :
                s =

                Alias of Finset.eq_empty_of_forall_notMem.

                theorem Finset.eq_empty_iff_forall_notMem {α : Type u_1} {s : Finset α} :
                s = ∀ (x : α), xs
                @[deprecated Finset.eq_empty_iff_forall_notMem (since := "2025-05-23")]
                theorem Finset.eq_empty_iff_forall_not_mem {α : Type u_1} {s : Finset α} :
                s = ∀ (x : α), xs

                Alias of Finset.eq_empty_iff_forall_notMem.

                @[simp]
                theorem Finset.val_eq_zero {α : Type u_1} {s : Finset α} :
                s.val = 0 s =
                @[simp]
                theorem Finset.subset_empty {α : Type u_1} {s : Finset α} :
                @[simp]
                theorem Finset.not_ssubset_empty {α : Type u_1} (s : Finset α) :
                theorem Finset.nonempty_of_ne_empty {α : Type u_1} {s : Finset α} (h : s ) :
                @[simp]
                theorem Finset.eq_empty_or_nonempty {α : Type u_1} (s : Finset α) :
                @[simp]
                theorem Finset.coe_empty {α : Type u_1} :
                =
                @[simp]
                theorem Finset.coe_eq_empty {α : Type u_1} {s : Finset α} :
                s = s =
                @[simp]
                theorem Finset.isEmpty_coe_sort {α : Type u_1} {s : Finset α} :
                IsEmpty { x : α // x s } s =
                instance Finset.instIsEmpty {α : Type u_1} :
                IsEmpty { x : α // x }
                theorem Finset.eq_empty_of_isEmpty {α : Type u_1} [IsEmpty α] (s : Finset α) :
                s =

                A Finset for an empty type is empty.

                instance Finset.instOrderBot {α : Type u_1} :
                Equations
                  @[simp]
                  theorem Finset.bot_eq_empty {α : Type u_1} :
                  @[simp]
                  theorem Finset.empty_ssubset {α : Type u_1} {s : Finset α} :
                  theorem Finset.Nonempty.empty_ssubset {α : Type u_1} {s : Finset α} :
                  s.Nonempty s

                  Alias of the reverse direction of Finset.empty_ssubset.

                  theorem Finset.exists_mem_empty_iff {α : Type u_1} (p : αProp) :
                  (∃ x, p x) False
                  theorem Finset.forall_mem_empty_iff {α : Type u_1} (p : αProp) :
                  (∀ x, p x) True
                  def Mathlib.Meta.proveFinsetNonempty {u : Lean.Level} {α : Q(Type u)} (s : Q(Finset «$α»)) :

                  Attempt to prove that a finset is nonempty using the finsetNonempty aesop rule-set.

                  You can add lemmas to the rule-set by tagging them with either:

                  • aesop safe apply (rule_sets := [finsetNonempty]) if they are always a good idea to follow or
                  • aesop unsafe apply (rule_sets := [finsetNonempty]) if they risk directing the search to a blind alley.

                  TODO: should some of the lemmas be aesop safe simp instead?

                  Equations
                    Instances For