Documentation

Mathlib.Data.Set.Finite

Finite sets #

This file defines predicates for finite and infinite sets and provides Fintype instances for many set constructions. It also proves basic facts about finite sets and gives ways to manipulate Set.Finite expressions.

Main definitions #

Implementation #

A finite set is defined to be a set whose coercion to a type has a Fintype instance. Since Set.Finite is Prop-valued, this is the mere fact that the Fintype instance exists.

There are two components to finiteness constructions. The first is Fintype instances for each construction. This gives a way to actually compute a Finset that represents the set, and these may be accessed using set.toFinset. This gets the Finset in the correct form, since otherwise Finset.univ : Finset s is a Finset for the subtype for s. The second component is "constructors" for Set.Finite that give proofs that Fintype instances exist classically given other Set.Finite proofs. Unlike the Fintype instances, these do not use any decidability instances since they do not compute anything.

Tags #

finite sets

inductive Set.Finite {α : Type u} (s : Set α) :

A set is finite if there is a Finset with the same elements. This is represented as there being a Fintype instance for the set coerced to a type.

Note: this is a custom inductive type rather than Nonempty (Fintype s) so that it won't be frozen as a local instance.

Instances For
    theorem Set.finite_def {α : Type u} {s : Set α} :
    theorem Set.Finite.nonempty_fintype {α : Type u} {s : Set α} :

    Alias of the forward direction of Set.finite_def.

    theorem Set.finite_coe_iff {α : Type u} {s : Set α} :
    theorem Set.toFinite {α : Type u} (s : Set α) [Finite s] :

    Constructor for Set.Finite using a Finite instance.

    theorem Set.Finite.ofFinset {α : Type u} {p : Set α} (s : Finset α) (H : ∀ (x : α), x s x p) :

    Construct a Finite instance for a Set from a Finset with the same elements.

    theorem Set.Finite.to_subtype {α : Type u} {s : Set α} (h : Set.Finite s) :
    Finite s

    Projection of Set.Finite to its Finite instance. This is intended to be used with dot notation. See also Set.Finite.Fintype and Set.Finite.nonempty_fintype.

    noncomputable def Set.Finite.fintype {α : Type u} {s : Set α} (h : Set.Finite s) :
    Fintype s

    A finite set coerced to a type is a Fintype. This is the Fintype projection for a Set.Finite.

    Note that because Finite isn't a typeclass, this definition will not fire if it is made into an instance

    Equations
    Instances For
      noncomputable def Set.Finite.toFinset {α : Type u} {s : Set α} (h : Set.Finite s) :

      Using choice, get the Finset that represents this Set.

      Equations
      Instances For
        @[simp]
        theorem Set.Finite.exists_finset {α : Type u} {s : Set α} (h : Set.Finite s) :
        s', ∀ (a : α), a s' a s
        theorem Set.Finite.exists_finset_coe {α : Type u} {s : Set α} (h : Set.Finite s) :
        s', s' = s
        instance Set.instCanLiftSetFinsetToSetFinite {α : Type u} :
        CanLift (Set α) (Finset α) Finset.toSet Set.Finite

        Finite sets can be lifted to finsets.

        Equations
        def Set.Infinite {α : Type u} (s : Set α) :

        A set is infinite if it is not finite.

        This is protected so that it does not conflict with global Infinite.

        Equations
        Instances For
          @[simp]
          theorem Set.not_infinite {α : Type u} {s : Set α} :
          @[simp]
          theorem Set.Finite.not_infinite {α : Type u} {s : Set α} :

          Alias of the reverse direction of Set.not_infinite.

          Basic properties of Set.Finite.toFinset #

          @[simp]
          theorem Set.Finite.mem_toFinset {α : Type u} {s : Set α} {a : α} (h : Set.Finite s) :
          @[simp]
          theorem Set.Finite.coe_toFinset {α : Type u} {s : Set α} (h : Set.Finite s) :
          theorem Set.Finite.coeSort_toFinset {α : Type u} {s : Set α} (h : Set.Finite s) :
          { x // x Set.Finite.toFinset h } = s

          Note that this is an equality of types not holding definitionally. Use wisely.

          @[simp]
          theorem Set.Finite.toFinset_inj {α : Type u} {s : Set α} {t : Set α} {hs : Set.Finite s} {ht : Set.Finite t} :
          @[simp]
          theorem Set.Finite.toFinset_subset {α : Type u} {s : Set α} {hs : Set.Finite s} {t : Finset α} :
          @[simp]
          theorem Set.Finite.toFinset_ssubset {α : Type u} {s : Set α} {hs : Set.Finite s} {t : Finset α} :
          @[simp]
          theorem Set.Finite.subset_toFinset {α : Type u} {t : Set α} {ht : Set.Finite t} {s : Finset α} :
          @[simp]
          theorem Set.Finite.ssubset_toFinset {α : Type u} {t : Set α} {ht : Set.Finite t} {s : Finset α} :
          theorem Set.Finite.toFinset_mono {α : Type u} {s : Set α} {t : Set α} {hs : Set.Finite s} {ht : Set.Finite t} :

          Alias of the reverse direction of Set.Finite.toFinset_subset_toFinset.

          theorem Set.Finite.toFinset_strictMono {α : Type u} {s : Set α} {t : Set α} {hs : Set.Finite s} {ht : Set.Finite t} :

          Alias of the reverse direction of Set.Finite.toFinset_ssubset_toFinset.

          @[simp]
          theorem Set.Finite.toFinset_setOf {α : Type u} [Fintype α] (p : αProp) [DecidablePred p] (h : Set.Finite {x | p x}) :
          @[simp]
          theorem Set.Finite.disjoint_toFinset {α : Type u} {s : Set α} {t : Set α} {hs : Set.Finite s} {ht : Set.Finite t} :
          theorem Set.Finite.toFinset_univ {α : Type u} [Fintype α] (h : Set.Finite Set.univ) :
          Set.Finite.toFinset h = Finset.univ
          @[simp]
          @[simp]
          theorem Set.Finite.toFinset_eq_univ {α : Type u} {s : Set α} [Fintype α] {h : Set.Finite s} :
          Set.Finite.toFinset h = Finset.univ s = Set.univ
          theorem Set.Finite.toFinset_image {α : Type u} {β : Type v} {s : Set α} [DecidableEq β] (f : αβ) (hs : Set.Finite s) (h : Set.Finite (f '' s)) :
          theorem Set.Finite.toFinset_range {α : Type u} {β : Type v} [DecidableEq α] [Fintype β] (f : βα) (h : Set.Finite (Set.range f)) :

          Fintype instances #

          Every instance here should have a corresponding Set.Finite constructor in the next section.

          instance Set.fintypeUniv {α : Type u} [Fintype α] :
          Fintype Set.univ
          Equations
          noncomputable def Set.fintypeOfFiniteUniv {α : Type u} (H : Set.Finite Set.univ) :

          If (Set.univ : Set α) is finite then α is a finite type.

          Equations
          Instances For
            instance Set.fintypeUnion {α : Type u} [DecidableEq α] (s : Set α) (t : Set α) [Fintype s] [Fintype t] :
            Fintype ↑(s t)
            Equations
            instance Set.fintypeSep {α : Type u} (s : Set α) (p : αProp) [Fintype s] [DecidablePred p] :
            Fintype {a | a s p a}
            Equations
            instance Set.fintypeInter {α : Type u} (s : Set α) (t : Set α) [DecidableEq α] [Fintype s] [Fintype t] :
            Fintype ↑(s t)
            Equations
            instance Set.fintypeInterOfLeft {α : Type u} (s : Set α) (t : Set α) [Fintype s] [DecidablePred fun x => x t] :
            Fintype ↑(s t)

            A Fintype instance for set intersection where the left set has a Fintype instance.

            Equations
            instance Set.fintypeInterOfRight {α : Type u} (s : Set α) (t : Set α) [Fintype t] [DecidablePred fun x => x s] :
            Fintype ↑(s t)

            A Fintype instance for set intersection where the right set has a Fintype instance.

            Equations
            def Set.fintypeSubset {α : Type u} (s : Set α) {t : Set α} [Fintype s] [DecidablePred fun x => x t] (h : t s) :
            Fintype t

            A Fintype structure on a set defines a Fintype structure on its subset.

            Equations
            Instances For
              instance Set.fintypeDiff {α : Type u} [DecidableEq α] (s : Set α) (t : Set α) [Fintype s] [Fintype t] :
              Fintype ↑(s \ t)
              Equations
              instance Set.fintypeDiffLeft {α : Type u} (s : Set α) (t : Set α) [Fintype s] [DecidablePred fun x => x t] :
              Fintype ↑(s \ t)
              Equations
              instance Set.fintypeiUnion {α : Type u} {ι : Sort w} [DecidableEq α] [Fintype (PLift ι)] (f : ιSet α) [(i : ι) → Fintype ↑(f i)] :
              Fintype ↑(⋃ (i : ι), f i)
              Equations
              • One or more equations did not get rendered due to their size.
              instance Set.fintypesUnion {α : Type u} [DecidableEq α] {s : Set (Set α)} [Fintype s] [H : (t : s) → Fintype t] :
              Equations
              def Set.fintypeBiUnion {α : Type u} [DecidableEq α] {ι : Type u_1} (s : Set ι) [Fintype s] (t : ιSet α) (H : (i : ι) → i sFintype ↑(t i)) :
              Fintype ↑(⋃ (x : ι) (_ : x s), t x)

              A union of sets with Fintype structure over a set with Fintype structure has a Fintype structure.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                instance Set.fintypeBiUnion' {α : Type u} [DecidableEq α] {ι : Type u_1} (s : Set ι) [Fintype s] (t : ιSet α) [(i : ι) → Fintype ↑(t i)] :
                Fintype ↑(⋃ (x : ι) (_ : x s), t x)
                Equations
                • One or more equations did not get rendered due to their size.
                def Set.fintypeBind {α : Type u_1} {β : Type u_1} [DecidableEq β] (s : Set α) [Fintype s] (f : αSet β) (H : (a : α) → a sFintype ↑(f a)) :
                Fintype ↑(s >>= f)

                If s : Set α is a set with Fintype instance and f : α → Set β is a function such that each f a, a ∈ s, has a Fintype structure, then s >>= f has a Fintype structure.

                Equations
                Instances For
                  instance Set.fintypeBind' {α : Type u_1} {β : Type u_1} [DecidableEq β] (s : Set α) [Fintype s] (f : αSet β) [(a : α) → Fintype ↑(f a)] :
                  Fintype ↑(s >>= f)
                  Equations
                  instance Set.fintypeEmpty {α : Type u} :
                  Equations
                  instance Set.fintypeSingleton {α : Type u} (a : α) :
                  Fintype {a}
                  Equations
                  instance Set.fintypePure {α : Type u} (a : α) :
                  Fintype ↑(pure a)
                  Equations
                  • Set.fintypePure = Set.fintypeSingleton
                  instance Set.fintypeInsert {α : Type u} (a : α) (s : Set α) [DecidableEq α] [Fintype s] :
                  Fintype ↑(insert a s)

                  A Fintype instance for inserting an element into a Set using the corresponding insert function on Finset. This requires DecidableEq α. There is also Set.fintypeInsert' when a ∈ s is decidable.

                  Equations
                  def Set.fintypeInsertOfNotMem {α : Type u} {a : α} (s : Set α) [Fintype s] (h : ¬a s) :
                  Fintype ↑(insert a s)

                  A Fintype structure on insert a s when inserting a new element.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Set.fintypeInsertOfMem {α : Type u} {a : α} (s : Set α) [Fintype s] (h : a s) :
                    Fintype ↑(insert a s)

                    A Fintype structure on insert a s when inserting a pre-existing element.

                    Equations
                    Instances For
                      instance Set.fintypeInsert' {α : Type u} (a : α) (s : Set α) [Decidable (a s)] [Fintype s] :
                      Fintype ↑(insert a s)

                      The Set.fintypeInsert instance requires decidable equality, but when a ∈ s is decidable for this particular a we can still get a Fintype instance by using Set.fintypeInsertOfNotMem or Set.fintypeInsertOfMem.

                      This instance pre-dates Set.fintypeInsert, and it is less efficient. When Set.decidableMemOfFintype is made a local instance, then this instance would override Set.fintypeInsert if not for the fact that its priority has been adjusted. See Note [lower instance priority].

                      Equations
                      instance Set.fintypeImage {α : Type u} {β : Type v} [DecidableEq β] (s : Set α) (f : αβ) [Fintype s] :
                      Fintype ↑(f '' s)
                      Equations
                      def Set.fintypeOfFintypeImage {α : Type u} {β : Type v} (s : Set α) {f : αβ} {g : βOption α} (I : Function.IsPartialInv f g) [Fintype ↑(f '' s)] :
                      Fintype s

                      If a function f has a partial inverse and sends a set s to a set with [Fintype] instance, then s has a Fintype structure as well.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        instance Set.fintypeRange {α : Type u} {ι : Sort w} [DecidableEq α] (f : ια) [Fintype (PLift ι)] :
                        Equations
                        instance Set.fintypeMap {α : Type u_1} {β : Type u_1} [DecidableEq β] (s : Set α) (f : αβ) [Fintype s] :
                        Fintype ↑(f <$> s)
                        Equations
                        • Set.fintypeMap = Set.fintypeImage
                        instance Set.fintypeLTNat (n : ) :
                        Fintype {i | i < n}
                        Equations
                        instance Set.fintypeLENat (n : ) :
                        Fintype {i | i n}
                        Equations

                        This is not an instance so that it does not conflict with the one in Mathlib/Order/LocallyFinite.lean.

                        Equations
                        Instances For
                          instance Set.fintypeProd {α : Type u} {β : Type v} (s : Set α) (t : Set β) [Fintype s] [Fintype t] :
                          Fintype ↑(s ×ˢ t)
                          Equations
                          instance Set.fintypeImage2 {α : Type u} {β : Type v} {γ : Type x} [DecidableEq γ] (f : αβγ) (s : Set α) (t : Set β) [hs : Fintype s] [ht : Fintype t] :
                          Fintype ↑(Set.image2 f s t)

                          image2 f s t is Fintype if s and t are.

                          Equations
                          instance Set.fintypeSeq {α : Type u} {β : Type v} [DecidableEq β] (f : Set (αβ)) (s : Set α) [Fintype f] [Fintype s] :
                          Fintype ↑(Set.seq f s)
                          Equations
                          instance Set.fintypeSeq' {α : Type u} {β : Type u} [DecidableEq β] (f : Set (αβ)) (s : Set α) [Fintype f] [Fintype s] :
                          Fintype ↑(Seq.seq f fun x => s)
                          Equations
                          instance Set.fintypeMemFinset {α : Type u} (s : Finset α) :
                          Fintype {a | a s}
                          Equations
                          theorem Equiv.set_finite_iff {α : Type u} {β : Type v} {s : Set α} {t : Set β} (hst : s t) :

                          Finset #

                          @[simp]
                          theorem Finset.finite_toSet {α : Type u} (s : Finset α) :

                          Gives a Set.Finite for the Finset coerced to a Set. This is a wrapper around Set.toFinite.

                          @[simp]
                          theorem Multiset.finite_toSet {α : Type u} (s : Multiset α) :
                          Set.Finite {x | x s}
                          @[simp]
                          theorem List.finite_toSet {α : Type u} (l : List α) :
                          Set.Finite {x | x l}

                          Finite instances #

                          There is seemingly some overlap between the following instances and the Fintype instances in Data.Set.Finite. While every Fintype instance gives a Finite instance, those instances that depend on Fintype or Decidable instances need an additional Finite instance to be able to generally apply.

                          Some set instances do not appear here since they are consequences of others, for example Subtype.Finite for subsets of a finite type.

                          instance Finite.Set.finite_union {α : Type u} (s : Set α) (t : Set α) [Finite s] [Finite t] :
                          Finite ↑(s t)
                          Equations
                          instance Finite.Set.finite_sep {α : Type u} (s : Set α) (p : αProp) [Finite s] :
                          Finite {a | a s p a}
                          Equations
                          theorem Finite.Set.subset {α : Type u} (s : Set α) {t : Set α} [Finite s] (h : t s) :
                          Finite t
                          instance Finite.Set.finite_iUnion {α : Type u} {ι : Sort w} [Finite ι] (f : ιSet α) [∀ (i : ι), Finite ↑(f i)] :
                          Finite ↑(⋃ (i : ι), f i)
                          Equations
                          instance Finite.Set.finite_sUnion {α : Type u} {s : Set (Set α)} [Finite s] [H : ∀ (t : s), Finite t] :
                          Finite ↑(⋃₀ s)
                          Equations
                          theorem Finite.Set.finite_biUnion {α : Type u} {ι : Type u_1} (s : Set ι) [Finite s] (t : ιSet α) (H : ∀ (i : ι), i sFinite ↑(t i)) :
                          Finite ↑(⋃ (x : ι) (_ : x s), t x)
                          instance Finite.Set.finite_biUnion' {α : Type u} {ι : Type u_1} (s : Set ι) [Finite s] (t : ιSet α) [∀ (i : ι), Finite ↑(t i)] :
                          Finite ↑(⋃ (x : ι) (_ : x s), t x)
                          Equations
                          instance Finite.Set.finite_biUnion'' {α : Type u} {ι : Type u_1} (p : ιProp) [h : Finite {x | p x}] (t : ιSet α) [∀ (i : ι), Finite ↑(t i)] :
                          Finite ↑(⋃ (x : ι) (x_1 : p x), t x)

                          Example: Finite (⋃ (i < n), f i) where f : ℕ → Set α and [∀ i, Finite (f i)] (when given instances from Data.Nat.Interval).

                          Equations
                          instance Finite.Set.finite_iInter {α : Type u} {ι : Sort u_1} [Nonempty ι] (t : ιSet α) [∀ (i : ι), Finite ↑(t i)] :
                          Finite ↑(⋂ (i : ι), t i)
                          Equations
                          instance Finite.Set.finite_image {α : Type u} {β : Type v} (s : Set α) (f : αβ) [Finite s] :
                          Finite ↑(f '' s)
                          Equations
                          instance Finite.Set.finite_replacement {α : Type u} {β : Type v} [Finite α] (f : αβ) :
                          Finite {x | x_1, f x_1 = x}
                          Equations
                          instance Finite.Set.finite_prod {α : Type u} {β : Type v} (s : Set α) (t : Set β) [Finite s] [Finite t] :
                          Finite ↑(s ×ˢ t)
                          Equations
                          instance Finite.Set.finite_image2 {α : Type u} {β : Type v} {γ : Type x} (f : αβγ) (s : Set α) (t : Set β) [Finite s] [Finite t] :
                          Finite ↑(Set.image2 f s t)
                          Equations
                          instance Finite.Set.finite_seq {α : Type u} {β : Type v} (f : Set (αβ)) (s : Set α) [Finite f] [Finite s] :
                          Finite ↑(Set.seq f s)
                          Equations

                          Constructors for Set.Finite #

                          Every constructor here should have a corresponding Fintype instance in the previous section (or in the Fintype module).

                          The implementation of these constructors ideally should be no more than Set.toFinite, after possibly setting up some Fintype and classical Decidable instances.

                          theorem Set.finite_univ {α : Type u} [Finite α] :
                          Set.Finite Set.univ
                          theorem Set.finite_univ_iff {α : Type u} :
                          Set.Finite Set.univ Finite α
                          theorem Finite.of_finite_univ {α : Type u} :
                          Set.Finite Set.univFinite α

                          Alias of the forward direction of Set.finite_univ_iff.

                          theorem Set.Finite.union {α : Type u} {s : Set α} {t : Set α} (hs : Set.Finite s) (ht : Set.Finite t) :
                          theorem Set.Finite.finite_of_compl {α : Type u} {s : Set α} (hs : Set.Finite s) (hsc : Set.Finite s) :
                          theorem Set.Finite.sup {α : Type u} {s : Set α} {t : Set α} :
                          theorem Set.Finite.sep {α : Type u} {s : Set α} (hs : Set.Finite s) (p : αProp) :
                          Set.Finite {a | a s p a}
                          theorem Set.Finite.inter_of_left {α : Type u} {s : Set α} (hs : Set.Finite s) (t : Set α) :
                          theorem Set.Finite.inter_of_right {α : Type u} {s : Set α} (hs : Set.Finite s) (t : Set α) :
                          theorem Set.Finite.inf_of_left {α : Type u} {s : Set α} (h : Set.Finite s) (t : Set α) :
                          theorem Set.Finite.inf_of_right {α : Type u} {s : Set α} (h : Set.Finite s) (t : Set α) :
                          theorem Set.Finite.subset {α : Type u} {s : Set α} (hs : Set.Finite s) {t : Set α} (ht : t s) :
                          theorem Set.Finite.diff {α : Type u} {s : Set α} (hs : Set.Finite s) (t : Set α) :
                          theorem Set.Finite.of_diff {α : Type u} {s : Set α} {t : Set α} (hd : Set.Finite (s \ t)) (ht : Set.Finite t) :
                          theorem Set.finite_iUnion {α : Type u} {ι : Sort w} [Finite ι] {f : ιSet α} (H : ∀ (i : ι), Set.Finite (f i)) :
                          Set.Finite (⋃ (i : ι), f i)
                          theorem Set.Finite.sUnion {α : Type u} {s : Set (Set α)} (hs : Set.Finite s) (H : ∀ (t : Set α), t sSet.Finite t) :
                          theorem Set.Finite.biUnion {α : Type u} {ι : Type u_1} {s : Set ι} (hs : Set.Finite s) {t : ιSet α} (ht : ∀ (i : ι), i sSet.Finite (t i)) :
                          Set.Finite (⋃ (i : ι) (_ : i s), t i)
                          theorem Set.Finite.biUnion' {α : Type u} {ι : Type u_1} {s : Set ι} (hs : Set.Finite s) {t : (i : ι) → i sSet α} (ht : ∀ (i : ι) (hi : i s), Set.Finite (t i hi)) :
                          Set.Finite (⋃ (i : ι) (h : i s), t i h)

                          Dependent version of Finite.biUnion.

                          theorem Set.Finite.sInter {α : Type u_1} {s : Set (Set α)} {t : Set α} (ht : t s) (hf : Set.Finite t) :
                          theorem Set.Finite.iUnion {α : Type u} {ι : Type u_1} {s : ιSet α} {t : Set ι} (ht : Set.Finite t) (hs : ∀ (i : ι), i tSet.Finite (s i)) (he : ∀ (i : ι), ¬i ts i = ) :
                          Set.Finite (⋃ (i : ι), s i)

                          If sets s i are finite for all i from a finite set t and are empty for i ∉ t, then the union ⋃ i, s i is a finite set.

                          theorem Set.Finite.bind {α : Type u_1} {β : Type u_1} {s : Set α} {f : αSet β} (h : Set.Finite s) (hf : ∀ (a : α), a sSet.Finite (f a)) :
                          @[simp]
                          theorem Set.Infinite.nonempty {α : Type u} {s : Set α} (h : Set.Infinite s) :
                          @[simp]
                          theorem Set.finite_singleton {α : Type u} (a : α) :
                          theorem Set.finite_pure {α : Type u} (a : α) :
                          @[simp]
                          theorem Set.Finite.insert {α : Type u} (a : α) {s : Set α} (hs : Set.Finite s) :
                          theorem Set.Finite.image {α : Type u} {β : Type v} {s : Set α} (f : αβ) (hs : Set.Finite s) :
                          theorem Set.finite_range {α : Type u} {ι : Sort w} (f : ια) [Finite ι] :
                          theorem Set.Finite.dependent_image {α : Type u} {β : Type v} {s : Set α} (hs : Set.Finite s) (F : (i : α) → i sβ) :
                          Set.Finite {y | x hx, y = F x hx}
                          theorem Set.Finite.map {α : Type u_1} {β : Type u_1} {s : Set α} (f : αβ) :
                          theorem Set.Finite.of_finite_image {α : Type u} {β : Type v} {s : Set α} {f : αβ} (h : Set.Finite (f '' s)) (hi : Set.InjOn f s) :
                          theorem Set.finite_of_finite_preimage {α : Type u} {β : Type v} {f : αβ} {s : Set β} (h : Set.Finite (f ⁻¹' s)) (hs : s Set.range f) :
                          theorem Set.Finite.of_preimage {α : Type u} {β : Type v} {f : αβ} {s : Set β} (h : Set.Finite (f ⁻¹' s)) (hf : Function.Surjective f) :
                          theorem Set.Finite.preimage {α : Type u} {β : Type v} {s : Set β} {f : αβ} (I : Set.InjOn f (f ⁻¹' s)) (h : Set.Finite s) :
                          theorem Set.Finite.preimage_embedding {α : Type u} {β : Type v} {s : Set β} (f : α β) (h : Set.Finite s) :
                          theorem Set.finite_lt_nat (n : ) :
                          Set.Finite {i | i < n}
                          theorem Set.finite_le_nat (n : ) :
                          Set.Finite {i | i n}
                          theorem Set.Finite.prod {α : Type u} {β : Type v} {s : Set α} {t : Set β} (hs : Set.Finite s) (ht : Set.Finite t) :
                          theorem Set.Finite.of_prod_left {α : Type u} {β : Type v} {s : Set α} {t : Set β} (h : Set.Finite (s ×ˢ t)) :
                          theorem Set.Finite.of_prod_right {α : Type u} {β : Type v} {s : Set α} {t : Set β} (h : Set.Finite (s ×ˢ t)) :
                          theorem Set.Infinite.prod_left {α : Type u} {β : Type v} {s : Set α} {t : Set β} (hs : Set.Infinite s) (ht : Set.Nonempty t) :
                          theorem Set.Infinite.prod_right {α : Type u} {β : Type v} {s : Set α} {t : Set β} (ht : Set.Infinite t) (hs : Set.Nonempty s) :
                          theorem Set.finite_prod {α : Type u} {β : Type v} {s : Set α} {t : Set β} :
                          theorem Set.Finite.offDiag {α : Type u} {s : Set α} (hs : Set.Finite s) :
                          theorem Set.Finite.image2 {α : Type u} {β : Type v} {γ : Type x} {s : Set α} {t : Set β} (f : αβγ) (hs : Set.Finite s) (ht : Set.Finite t) :
                          theorem Set.Finite.seq {α : Type u} {β : Type v} {f : Set (αβ)} {s : Set α} (hf : Set.Finite f) (hs : Set.Finite s) :
                          theorem Set.Finite.seq' {α : Type u} {β : Type u} {f : Set (αβ)} {s : Set α} (hf : Set.Finite f) (hs : Set.Finite s) :
                          Set.Finite (Seq.seq f fun x => s)
                          theorem Set.finite_mem_finset {α : Type u} (s : Finset α) :
                          Set.Finite {a | a s}
                          theorem Set.finite_preimage_inl_and_inr {α : Type u} {β : Type v} {s : Set (α β)} :
                          Set.Finite (Sum.inl ⁻¹' s) Set.Finite (Sum.inr ⁻¹' s) Set.Finite s
                          theorem Set.exists_finite_iff_finset {α : Type u} {p : Set αProp} :
                          (s, Set.Finite s p s) s, p s
                          theorem Set.Finite.finite_subsets {α : Type u} {a : Set α} (h : Set.Finite a) :
                          Set.Finite {b | b a}

                          There are finitely many subsets of a given finite set

                          theorem Set.Finite.pi {δ : Type u_1} [Finite δ] {κ : δType u_2} {t : (d : δ) → Set (κ d)} (ht : ∀ (d : δ), Set.Finite (t d)) :
                          Set.Finite (Set.pi Set.univ t)

                          Finite product of finite sets is finite

                          theorem Set.union_finset_finite_of_range_finite {α : Type u} {β : Type v} (f : αFinset β) (h : Set.Finite (Set.range f)) :
                          Set.Finite (⋃ (a : α), ↑(f a))

                          A finite union of finsets is finite.

                          theorem Set.finite_range_ite {α : Type u} {β : Type v} {p : αProp} [DecidablePred p] {f : αβ} {g : αβ} (hf : Set.Finite (Set.range f)) (hg : Set.Finite (Set.range g)) :
                          Set.Finite (Set.range fun x => if p x then f x else g x)
                          theorem Set.finite_range_const {α : Type u} {β : Type v} {c : β} :
                          Set.Finite (Set.range fun x => c)

                          Properties #

                          instance Set.Finite.inhabited {α : Type u} :
                          Equations
                          • Set.Finite.inhabited = { default := { val := , property := (_ : Set.Finite ) } }
                          @[simp]
                          theorem Set.finite_union {α : Type u} {s : Set α} {t : Set α} :
                          theorem Set.finite_image_iff {α : Type u} {β : Type v} {s : Set α} {f : αβ} (hi : Set.InjOn f s) :
                          theorem Set.Finite.toFinset_singleton {α : Type u} {a : α} (ha : optParam (Set.Finite {a}) (_ : Set.Finite {a})) :
                          @[simp]
                          theorem Set.Finite.toFinset_insert {α : Type u} [DecidableEq α] {s : Set α} {a : α} (hs : Set.Finite (insert a s)) :
                          theorem Set.Finite.toFinset_prod {α : Type u} {β : Type v} {s : Set α} {t : Set β} (hs : Set.Finite s) (ht : Set.Finite t) :
                          theorem Set.Finite.fin_embedding {α : Type u} {s : Set α} (h : Set.Finite s) :
                          n f, Set.range f = s
                          theorem Set.Finite.fin_param {α : Type u} {s : Set α} (h : Set.Finite s) :
                          theorem Set.finite_option {α : Type u} {s : Set (Option α)} :
                          theorem Set.finite_image_fst_and_snd_iff {α : Type u} {β : Type v} {s : Set (α × β)} :
                          Set.Finite (Prod.fst '' s) Set.Finite (Prod.snd '' s) Set.Finite s
                          theorem Set.forall_finite_image_eval_iff {δ : Type u_1} [Finite δ] {κ : δType u_2} {s : Set ((d : δ) → κ d)} :
                          (∀ (d : δ), Set.Finite (Function.eval d '' s)) Set.Finite s
                          theorem Set.finite_subset_iUnion {α : Type u} {s : Set α} (hs : Set.Finite s) {ι : Type u_1} {t : ιSet α} (h : s ⋃ (i : ι), t i) :
                          I, Set.Finite I s ⋃ (i : ι) (_ : i I), t i
                          theorem Set.eq_finite_iUnion_of_finite_subset_iUnion {α : Type u} {ι : Type u_1} {s : ιSet α} {t : Set α} (tfin : Set.Finite t) (h : t ⋃ (i : ι), s i) :
                          I, Set.Finite I σ, (∀ (i : {i | i I}), Set.Finite (σ i)) (∀ (i : {i | i I}), σ i s i) t = ⋃ (i : {i | i I}), σ i
                          theorem Set.Finite.induction_on {α : Type u} {C : Set αProp} {s : Set α} (h : Set.Finite s) (H0 : C ) (H1 : {a : α} → {s : Set α} → ¬a sSet.Finite sC sC (insert a s)) :
                          C s
                          theorem Set.Finite.induction_on' {α : Type u} {C : Set αProp} {S : Set α} (h : Set.Finite S) (H0 : C ) (H1 : {a : α} → {s : Set α} → a Ss S¬a sC sC (insert a s)) :
                          C S

                          Analogous to Finset.induction_on'.

                          theorem Set.Finite.dinduction_on {α : Type u} {C : (s : Set α) → Set.Finite sProp} (s : Set α) (h : Set.Finite s) (H0 : C (_ : Set.Finite )) (H1 : {a : α} → {s : Set α} → ¬a s(h : Set.Finite s) → C s hC (insert a s) (_ : Set.Finite (insert a s))) :
                          C s h
                          theorem Set.seq_of_forall_finite_exists {γ : Type u_1} {P : γSet γProp} (h : ∀ (t : Set γ), Set.Finite tc, P c t) :
                          u, (n : ) → P (u n) (u '' Set.Iio n)

                          If P is some relation between terms of γ and sets in γ, such that every finite set t : Set γ has some c : γ related to it, then there is a recursively defined sequence u in γ so u n is related to the image of {0, 1, ..., n-1} under u.

                          (We use this later to show sequentially compact sets are totally bounded.)

                          Cardinality #

                          theorem Set.empty_card {α : Type u} :
                          @[simp]
                          theorem Set.empty_card' {α : Type u} {h : Fintype } :
                          theorem Set.card_fintypeInsertOfNotMem {α : Type u} {a : α} (s : Set α) [Fintype s] (h : ¬a s) :
                          @[simp]
                          theorem Set.card_insert {α : Type u} {a : α} (s : Set α) [Fintype s] (h : ¬a s) {d : Fintype ↑(insert a s)} :
                          theorem Set.card_image_of_inj_on {α : Type u} {β : Type v} {s : Set α} [Fintype s] {f : αβ} [Fintype ↑(f '' s)] (H : ∀ (x : α), x s∀ (y : α), y sf x = f yx = y) :
                          theorem Set.card_image_of_injective {α : Type u} {β : Type v} (s : Set α) [Fintype s] {f : αβ} [Fintype ↑(f '' s)] (H : Function.Injective f) :
                          @[simp]
                          theorem Set.card_singleton {α : Type u} (a : α) :
                          Fintype.card {a} = 1
                          theorem Set.card_lt_card {α : Type u} {s : Set α} {t : Set α} [Fintype s] [Fintype t] (h : s t) :
                          theorem Set.card_le_of_subset {α : Type u} {s : Set α} {t : Set α} [Fintype s] [Fintype t] (hsub : s t) :
                          theorem Set.eq_of_subset_of_card_le {α : Type u} {s : Set α} {t : Set α} [Fintype s] [Fintype t] (hsub : s t) (hcard : Fintype.card t Fintype.card s) :
                          s = t
                          theorem Set.card_range_of_injective {α : Type u} {β : Type v} [Fintype α] {f : αβ} (hf : Function.Injective f) [Fintype ↑(Set.range f)] :
                          theorem Set.card_ne_eq {α : Type u} [Fintype α] (a : α) [Fintype {x | x a}] :
                          Fintype.card {x | x a} = Fintype.card α - 1

                          Infinite sets #

                          theorem Set.infinite_univ {α : Type u} [h : Infinite α] :
                          Set.Infinite Set.univ
                          theorem Set.infinite_coe_iff {α : Type u} {s : Set α} :
                          theorem Set.Infinite.to_subtype {α : Type u} {s : Set α} :

                          Alias of the reverse direction of Set.infinite_coe_iff.

                          noncomputable def Set.Infinite.natEmbedding {α : Type u} (s : Set α) (h : Set.Infinite s) :
                          s

                          Embedding of into an infinite set.

                          Equations
                          Instances For
                            theorem Set.Infinite.exists_subset_card_eq {α : Type u} {s : Set α} (hs : Set.Infinite s) (n : ) :
                            t, t s Finset.card t = n
                            theorem Set.Finite.infinite_compl {α : Type u} [Infinite α] {s : Set α} (hs : Set.Finite s) :
                            theorem Set.Infinite.mono {α : Type u} {s : Set α} {t : Set α} (h : s t) :
                            theorem Set.Infinite.diff {α : Type u} {s : Set α} {t : Set α} (hs : Set.Infinite s) (ht : Set.Finite t) :
                            @[simp]
                            theorem Set.infinite_union {α : Type u} {s : Set α} {t : Set α} :
                            theorem Set.Infinite.of_image {α : Type u} {β : Type v} (f : αβ) {s : Set α} (hs : Set.Infinite (f '' s)) :
                            theorem Set.infinite_image_iff {α : Type u} {β : Type v} {s : Set α} {f : αβ} (hi : Set.InjOn f s) :
                            theorem Set.Infinite.image {α : Type u} {β : Type v} {s : Set α} {f : αβ} (hi : Set.InjOn f s) :

                            Alias of the reverse direction of Set.infinite_image_iff.

                            theorem Set.Infinite.image2_left {α : Type u} {β : Type v} {γ : Type x} {f : αβγ} {s : Set α} {t : Set β} {b : β} (hs : Set.Infinite s) (hb : b t) (hf : Set.InjOn (fun a => f a b) s) :
                            theorem Set.Infinite.image2_right {α : Type u} {β : Type v} {γ : Type x} {f : αβγ} {s : Set α} {t : Set β} {a : α} (ht : Set.Infinite t) (ha : a s) (hf : Set.InjOn (f a) t) :
                            theorem Set.infinite_image2 {α : Type u} {β : Type v} {γ : Type x} {f : αβγ} {s : Set α} {t : Set β} (hfs : ∀ (b : β), b tSet.InjOn (fun a => f a b) s) (hft : ∀ (a : α), a sSet.InjOn (f a) t) :
                            theorem Set.infinite_of_injOn_mapsTo {α : Type u} {β : Type v} {s : Set α} {t : Set β} {f : αβ} (hi : Set.InjOn f s) (hm : Set.MapsTo f s t) (hs : Set.Infinite s) :
                            theorem Set.Infinite.exists_ne_map_eq_of_mapsTo {α : Type u} {β : Type v} {s : Set α} {t : Set β} {f : αβ} (hs : Set.Infinite s) (hf : Set.MapsTo f s t) (ht : Set.Finite t) :
                            x, x s y, y s x y f x = f y
                            theorem Set.infinite_range_of_injective {α : Type u} {β : Type v} [Infinite α] {f : αβ} (hi : Function.Injective f) :
                            theorem Set.infinite_of_injective_forall_mem {α : Type u} {β : Type v} [Infinite α] {s : Set β} {f : αβ} (hi : Function.Injective f) (hf : ∀ (x : α), f x s) :
                            theorem Set.Infinite.exists_not_mem_finset {α : Type u} {s : Set α} (hs : Set.Infinite s) (f : Finset α) :
                            a, a s ¬a f
                            theorem Set.not_injOn_infinite_finite_image {α : Type u} {β : Type v} {f : αβ} {s : Set α} (h_inf : Set.Infinite s) (h_fin : Set.Finite (f '' s)) :

                            Order properties #

                            theorem Set.infinite_of_forall_exists_gt {α : Type u} [Preorder α] [Nonempty α] {s : Set α} (h : ∀ (a : α), b, b s a < b) :
                            theorem Set.infinite_of_forall_exists_lt {α : Type u} [Preorder α] [Nonempty α] {s : Set α} (h : ∀ (a : α), b, b s b < a) :
                            theorem Set.finite_isTop (α : Type u_1) [PartialOrder α] :
                            theorem Set.finite_isBot (α : Type u_1) [PartialOrder α] :
                            theorem Set.Infinite.exists_lt_map_eq_of_mapsTo {α : Type u} {β : Type v} [LinearOrder α] {s : Set α} {t : Set β} {f : αβ} (hs : Set.Infinite s) (hf : Set.MapsTo f s t) (ht : Set.Finite t) :
                            x, x s y, y s x < y f x = f y
                            theorem Set.Finite.exists_lt_map_eq_of_forall_mem {α : Type u} {β : Type v} [LinearOrder α] [Infinite α] {t : Set β} {f : αβ} (hf : ∀ (a : α), f a t) (ht : Set.Finite t) :
                            a b, a < b f a = f b
                            theorem Set.exists_min_image {α : Type u} {β : Type v} [LinearOrder β] (s : Set α) (f : αβ) (h1 : Set.Finite s) :
                            Set.Nonempty sa, a s ∀ (b : α), b sf a f b
                            theorem Set.exists_max_image {α : Type u} {β : Type v} [LinearOrder β] (s : Set α) (f : αβ) (h1 : Set.Finite s) :
                            Set.Nonempty sa, a s ∀ (b : α), b sf b f a
                            theorem Set.exists_lower_bound_image {α : Type u} {β : Type v} [Nonempty α] [LinearOrder β] (s : Set α) (f : αβ) (h : Set.Finite s) :
                            a, ∀ (b : α), b sf a f b
                            theorem Set.exists_upper_bound_image {α : Type u} {β : Type v} [Nonempty α] [LinearOrder β] (s : Set α) (f : αβ) (h : Set.Finite s) :
                            a, ∀ (b : α), b sf b f a
                            theorem Set.Finite.iSup_biInf_of_monotone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Preorder ι'] [Nonempty ι'] [IsDirected ι' fun x x_1 => x x_1] [Order.Frame α] {s : Set ι} (hs : Set.Finite s) {f : ιι'α} (hf : ∀ (i : ι), i sMonotone (f i)) :
                            ⨆ (j : ι'), ⨅ (i : ι) (_ : i s), f i j = ⨅ (i : ι) (_ : i s), ⨆ (j : ι'), f i j
                            theorem Set.Finite.iSup_biInf_of_antitone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Preorder ι'] [Nonempty ι'] [IsDirected ι' (Function.swap fun x x_1 => x x_1)] [Order.Frame α] {s : Set ι} (hs : Set.Finite s) {f : ιι'α} (hf : ∀ (i : ι), i sAntitone (f i)) :
                            ⨆ (j : ι'), ⨅ (i : ι) (_ : i s), f i j = ⨅ (i : ι) (_ : i s), ⨆ (j : ι'), f i j
                            theorem Set.Finite.iInf_biSup_of_monotone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Preorder ι'] [Nonempty ι'] [IsDirected ι' (Function.swap fun x x_1 => x x_1)] [Order.Coframe α] {s : Set ι} (hs : Set.Finite s) {f : ιι'α} (hf : ∀ (i : ι), i sMonotone (f i)) :
                            ⨅ (j : ι'), ⨆ (i : ι) (_ : i s), f i j = ⨆ (i : ι) (_ : i s), ⨅ (j : ι'), f i j
                            theorem Set.Finite.iInf_biSup_of_antitone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Preorder ι'] [Nonempty ι'] [IsDirected ι' fun x x_1 => x x_1] [Order.Coframe α] {s : Set ι} (hs : Set.Finite s) {f : ιι'α} (hf : ∀ (i : ι), i sAntitone (f i)) :
                            ⨅ (j : ι'), ⨆ (i : ι) (_ : i s), f i j = ⨆ (i : ι) (_ : i s), ⨅ (j : ι'), f i j
                            theorem Set.iSup_iInf_of_monotone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsDirected ι' fun x x_1 => x x_1] [Order.Frame α] {f : ιι'α} (hf : ∀ (i : ι), Monotone (f i)) :
                            ⨆ (j : ι'), ⨅ (i : ι), f i j = ⨅ (i : ι), ⨆ (j : ι'), f i j
                            theorem Set.iSup_iInf_of_antitone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsDirected ι' (Function.swap fun x x_1 => x x_1)] [Order.Frame α] {f : ιι'α} (hf : ∀ (i : ι), Antitone (f i)) :
                            ⨆ (j : ι'), ⨅ (i : ι), f i j = ⨅ (i : ι), ⨆ (j : ι'), f i j
                            theorem Set.iInf_iSup_of_monotone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsDirected ι' (Function.swap fun x x_1 => x x_1)] [Order.Coframe α] {f : ιι'α} (hf : ∀ (i : ι), Monotone (f i)) :
                            ⨅ (j : ι'), ⨆ (i : ι), f i j = ⨆ (i : ι), ⨅ (j : ι'), f i j
                            theorem Set.iInf_iSup_of_antitone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsDirected ι' fun x x_1 => x x_1] [Order.Coframe α] {f : ιι'α} (hf : ∀ (i : ι), Antitone (f i)) :
                            ⨅ (j : ι'), ⨆ (i : ι), f i j = ⨆ (i : ι), ⨅ (j : ι'), f i j
                            theorem Set.iUnion_iInter_of_monotone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [IsDirected ι' fun x x_1 => x x_1] [Nonempty ι'] {s : ιι'Set α} (hs : ∀ (i : ι), Monotone (s i)) :
                            ⋃ (j : ι'), ⋂ (i : ι), s i j = ⋂ (i : ι), ⋃ (j : ι'), s i j

                            An increasing union distributes over finite intersection.

                            theorem Set.iUnion_iInter_of_antitone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [IsDirected ι' (Function.swap fun x x_1 => x x_1)] [Nonempty ι'] {s : ιι'Set α} (hs : ∀ (i : ι), Antitone (s i)) :
                            ⋃ (j : ι'), ⋂ (i : ι), s i j = ⋂ (i : ι), ⋃ (j : ι'), s i j

                            A decreasing union distributes over finite intersection.

                            theorem Set.iInter_iUnion_of_monotone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [IsDirected ι' (Function.swap fun x x_1 => x x_1)] [Nonempty ι'] {s : ιι'Set α} (hs : ∀ (i : ι), Monotone (s i)) :
                            ⋂ (j : ι'), ⋃ (i : ι), s i j = ⋃ (i : ι), ⋂ (j : ι'), s i j

                            An increasing intersection distributes over finite union.

                            theorem Set.iInter_iUnion_of_antitone {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [Preorder ι'] [IsDirected ι' fun x x_1 => x x_1] [Nonempty ι'] {s : ιι'Set α} (hs : ∀ (i : ι), Antitone (s i)) :
                            ⋂ (j : ι'), ⋃ (i : ι), s i j = ⋃ (i : ι), ⋂ (j : ι'), s i j

                            A decreasing intersection distributes over finite union.

                            theorem Set.iUnion_pi_of_monotone {ι : Type u_1} {ι' : Type u_2} [LinearOrder ι'] [Nonempty ι'] {α : ιType u_3} {I : Set ι} {s : (i : ι) → ι'Set (α i)} (hI : Set.Finite I) (hs : ∀ (i : ι), i IMonotone (s i)) :
                            (⋃ (j : ι'), Set.pi I fun i => s i j) = Set.pi I fun i => ⋃ (j : ι'), s i j
                            theorem Set.iUnion_univ_pi_of_monotone {ι : Type u_1} {ι' : Type u_2} [LinearOrder ι'] [Nonempty ι'] [Finite ι] {α : ιType u_3} {s : (i : ι) → ι'Set (α i)} (hs : ∀ (i : ι), Monotone (s i)) :
                            (⋃ (j : ι'), Set.pi Set.univ fun i => s i j) = Set.pi Set.univ fun i => ⋃ (j : ι'), s i j
                            theorem Set.finite_range_findGreatest {α : Type u} {P : αProp} [(x : α) → DecidablePred (P x)] {b : } :
                            theorem Set.Finite.exists_maximal_wrt {α : Type u} {β : Type v} [PartialOrder β] (f : αβ) (s : Set α) (h : Set.Finite s) (hs : Set.Nonempty s) :
                            a, a s ∀ (a' : α), a' sf a f a'f a = f a'
                            theorem Set.Finite.exists_maximal_wrt' {α : Type u} {β : Type v} [PartialOrder β] (f : αβ) (s : Set α) (h : Set.Finite (f '' s)) (hs : Set.Nonempty s) :
                            a, a s ∀ (a' : α), a' sf a f a'f a = f a'

                            A version of Finite.exists_maximal_wrt with the (weaker) hypothesis that the image of s is finite rather than s itself.

                            theorem Set.Finite.exists_minimal_wrt {α : Type u} {β : Type v} [PartialOrder β] (f : αβ) (s : Set α) (h : Set.Finite s) (hs : Set.Nonempty s) :
                            a, a s ∀ (a' : α), a' sf a' f af a = f a'
                            theorem Set.Finite.exists_minimal_wrt' {α : Type u} {β : Type v} [PartialOrder β] (f : αβ) (s : Set α) (h : Set.Finite (f '' s)) (hs : Set.Nonempty s) :
                            a, a s ∀ (a' : α), a' sf a' f af a = f a'

                            A version of Finite.exists_minimal_wrt with the (weaker) hypothesis that the image of s is finite rather than s itself.

                            theorem Set.Finite.bddAbove {α : Type u} [Preorder α] [IsDirected α fun x x_1 => x x_1] [Nonempty α] {s : Set α} (hs : Set.Finite s) :

                            A finite set is bounded above.

                            theorem Set.Finite.bddAbove_biUnion {α : Type u} {β : Type v} [Preorder α] [IsDirected α fun x x_1 => x x_1] [Nonempty α] {I : Set β} {S : βSet α} (H : Set.Finite I) :
                            BddAbove (⋃ (i : β) (_ : i I), S i) ∀ (i : β), i IBddAbove (S i)

                            A finite union of sets which are all bounded above is still bounded above.

                            theorem Set.infinite_of_not_bddAbove {α : Type u} [Preorder α] [IsDirected α fun x x_1 => x x_1] [Nonempty α] {s : Set α} :
                            theorem Set.Finite.bddBelow {α : Type u} [Preorder α] [IsDirected α fun x x_1 => x x_1] [Nonempty α] {s : Set α} (hs : Set.Finite s) :

                            A finite set is bounded below.

                            theorem Set.Finite.bddBelow_biUnion {α : Type u} {β : Type v} [Preorder α] [IsDirected α fun x x_1 => x x_1] [Nonempty α] {I : Set β} {S : βSet α} (H : Set.Finite I) :
                            BddBelow (⋃ (i : β) (_ : i I), S i) ∀ (i : β), i IBddBelow (S i)

                            A finite union of sets which are all bounded below is still bounded below.

                            theorem Set.infinite_of_not_bddBelow {α : Type u} [Preorder α] [IsDirected α fun x x_1 => x x_1] [Nonempty α] {s : Set α} :
                            theorem Finset.bddAbove {α : Type u} [SemilatticeSup α] [Nonempty α] (s : Finset α) :

                            A finset is bounded above.

                            theorem Finset.bddBelow {α : Type u} [SemilatticeInf α] [Nonempty α] (s : Finset α) :

                            A finset is bounded below.

                            theorem Finite.of_forall_not_lt_lt {α : Type u} [LinearOrder α] (h : ∀ ⦃x y z : α⦄, x < yy < zFalse) :

                            If a linear order does not contain any triple of elements x < y < z, then this type is finite.

                            theorem Set.finite_of_forall_not_lt_lt {α : Type u} [LinearOrder α] {s : Set α} (h : ∀ (x : α), x s∀ (y : α), y s∀ (z : α), z sx < yy < zFalse) :

                            If a set s does not contain any triple of elements x < y < z, then s is finite.

                            theorem Set.finite_diff_iUnion_Ioo {α : Type u} [LinearOrder α] (s : Set α) :
                            Set.Finite (s \ ⋃ (x : α) (_ : x s) (y : α) (_ : y s), Set.Ioo x y)
                            theorem Set.finite_diff_iUnion_Ioo' {α : Type u} [LinearOrder α] (s : Set α) :
                            Set.Finite (s \ ⋃ (x : s × s), Set.Ioo x.fst x.snd)