Documentation

Mathlib.Data.Fintype.Card

Cardinalities of finite types #

Main declarations #

We also provide the following versions of the pigeonholes principle.

Some more pigeonhole-like statements can be found in Data.Fintype.CardEmbedding.

Types which have an injection from/a surjection to an Infinite type are themselves Infinite. See Infinite.of_injective and Infinite.of_surjective.

Instances #

We provide Infinite instances for

def Fintype.card (α : Type u_4) [Fintype α] :

card α is the number of elements in α, defined when α is a fintype.

Equations
Instances For

    There is (computably) an equivalence between α and Fin (card α).

    Since it is not unique and depends on which permutation of the universe list is used, the equivalence is wrapped in Trunc to preserve computability.

    See Fintype.equivFin for the noncomputable version, and Fintype.truncEquivFinOfCardEq and Fintype.equivFinOfCardEq for an equiv α ≃ Fin n given Fintype.card α = n.

    See Fintype.truncFinBijection for a version without [DecidableEq α].

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Fintype.equivFin (α : Type u_4) [Fintype α] :

      There is (noncomputably) an equivalence between α and Fin (card α).

      See Fintype.truncEquivFin for the computable version, and Fintype.truncEquivFinOfCardEq and Fintype.equivFinOfCardEq for an equiv α ≃ Fin n given Fintype.card α = n.

      Equations
      Instances For

        There is (computably) a bijection between Fin (card α) and α.

        Since it is not unique and depends on which permutation of the universe list is used, the bijection is wrapped in Trunc to preserve computability.

        See Fintype.truncEquivFin for a version that gives an equivalence given [DecidableEq α].

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Fintype.subtype_card {α : Type u_1} {p : αProp} (s : Finset α) (H : ∀ (x : α), x s p x) :
          Fintype.card { x // p x } = Finset.card s
          theorem Fintype.card_of_subtype {α : Type u_1} {p : αProp} (s : Finset α) (H : ∀ (x : α), x s p x) [Fintype { x // p x }] :
          Fintype.card { x // p x } = Finset.card s
          @[simp]
          theorem Fintype.card_ofFinset {α : Type u_1} {p : Set α} (s : Finset α) (H : ∀ (x : α), x s x p) :
          theorem Fintype.card_of_finset' {α : Type u_1} {p : Set α} (s : Finset α) (H : ∀ (x : α), x s x p) [Fintype p] :
          theorem Fintype.ofEquiv_card {α : Type u_1} {β : Type u_2} [Fintype α] (f : α β) :
          theorem Fintype.card_congr {α : Type u_4} {β : Type u_5} [Fintype α] [Fintype β] (f : α β) :
          theorem Fintype.card_congr' {α : Type u_4} {β : Type u_4} [Fintype α] [Fintype β] (h : α = β) :
          def Fintype.truncEquivFinOfCardEq {α : Type u_1} [Fintype α] [DecidableEq α] {n : } (h : Fintype.card α = n) :
          Trunc (α Fin n)

          If the cardinality of α is n, there is computably a bijection between α and Fin n.

          See Fintype.equivFinOfCardEq for the noncomputable definition, and Fintype.truncEquivFin and Fintype.equivFin for the bijection α ≃ Fin (card α).

          Equations
          Instances For
            noncomputable def Fintype.equivFinOfCardEq {α : Type u_1} [Fintype α] {n : } (h : Fintype.card α = n) :
            α Fin n

            If the cardinality of α is n, there is noncomputably a bijection between α and Fin n.

            See Fintype.truncEquivFinOfCardEq for the computable definition, and Fintype.truncEquivFin and Fintype.equivFin for the bijection α ≃ Fin (card α).

            Equations
            Instances For
              def Fintype.truncEquivOfCardEq {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (h : Fintype.card α = Fintype.card β) :
              Trunc (α β)

              Two Fintypes with the same cardinality are (computably) in bijection.

              See Fintype.equivOfCardEq for the noncomputable version, and Fintype.truncEquivFinOfCardEq and Fintype.equivFinOfCardEq for the specialization to Fin.

              Equations
              Instances For
                noncomputable def Fintype.equivOfCardEq {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (h : Fintype.card α = Fintype.card β) :
                α β

                Two Fintypes with the same cardinality are (noncomputably) in bijection.

                See Fintype.truncEquivOfCardEq for the computable version, and Fintype.truncEquivFinOfCardEq and Fintype.equivFinOfCardEq for the specialization to Fin.

                Equations
                Instances For
                  theorem Fintype.card_eq {α : Type u_4} {β : Type u_5} [_F : Fintype α] [_G : Fintype β] :
                  @[simp]
                  theorem Fintype.card_ofSubsingleton {α : Type u_1} (a : α) [Subsingleton α] :

                  Note: this lemma is specifically about Fintype.ofSubsingleton. For a statement about arbitrary Fintype instances, use either Fintype.card_le_one_iff_subsingleton or Fintype.card_unique.

                  @[simp]
                  theorem Fintype.card_unique {α : Type u_1} [Unique α] [h : Fintype α] :
                  @[simp]
                  theorem Fintype.card_of_isEmpty {α : Type u_1} [IsEmpty α] :

                  Note: this lemma is specifically about Fintype.of_is_empty. For a statement about arbitrary Fintype instances, use Fintype.card_eq_zero_iff.

                  @[simp]
                  theorem Set.toFinset_card {α : Type u_4} (s : Set α) [Fintype s] :
                  theorem Finset.card_univ {α : Type u_1} [Fintype α] :
                  Finset.card Finset.univ = Fintype.card α
                  theorem Finset.eq_univ_of_card {α : Type u_1} [Fintype α] (s : Finset α) (hs : Finset.card s = Fintype.card α) :
                  s = Finset.univ
                  theorem Finset.card_eq_iff_eq_univ {α : Type u_1} [Fintype α] (s : Finset α) :
                  Finset.card s = Fintype.card α s = Finset.univ
                  theorem Finset.card_lt_univ_of_not_mem {α : Type u_1} [Fintype α] {s : Finset α} {x : α} (hx : ¬x s) :
                  theorem Finset.card_lt_iff_ne_univ {α : Type u_1} [Fintype α] (s : Finset α) :
                  Finset.card s < Fintype.card α s Finset.univ
                  theorem Finset.card_univ_diff {α : Type u_1} [DecidableEq α] [Fintype α] (s : Finset α) :
                  Finset.card (Finset.univ \ s) = Fintype.card α - Finset.card s
                  @[simp]
                  @[simp]
                  theorem Fintype.card_compl_set {α : Type u_1} [Fintype α] (s : Set α) [Fintype s] [Fintype s] :
                  @[simp]
                  theorem Fintype.card_fin (n : ) :
                  theorem Fintype.card_fin_lt_of_le {m : } {n : } (h : m n) :
                  Fintype.card { i // i < m } = m
                  @[simp]
                  theorem Finset.card_fin (n : ) :
                  Finset.card Finset.univ = n

                  Fin as a map from to Type is injective. Note that since this is a statement about equality of types, using it should be avoided if possible.

                  theorem Fin.cast_eq_cast' {n : } {m : } (h : Fin n = Fin m) :
                  cast h = Fin.cast (_ : n = m)

                  A reversed version of Fin.cast_eq_cast that is easier to rewrite with.

                  theorem card_finset_fin_le {n : } (s : Finset (Fin n)) :
                  theorem Fin.equiv_iff_eq {m : } {n : } :
                  Nonempty (Fin m Fin n) m = n
                  theorem Fintype.card_subtype_eq {α : Type u_1} (y : α) [Fintype { x // x = y }] :
                  Fintype.card { x // x = y } = 1
                  theorem Fintype.card_subtype_eq' {α : Type u_1} (y : α) [Fintype { x // y = x }] :
                  Fintype.card { x // y = x } = 1
                  @[simp]
                  @[simp]
                  theorem Fintype.card_lex (α : Type u_4) [Fintype α] :
                  noncomputable def Fintype.sumLeft {α : Type u_4} {β : Type u_5} [Fintype (α β)] :

                  Given that α ⊕ β is a fintype, α is also a fintype. This is non-computable as it uses that Sum.inl is an injection, but there's no clear inverse if α is empty.

                  Equations
                  Instances For
                    noncomputable def Fintype.sumRight {α : Type u_4} {β : Type u_5} [Fintype (α β)] :

                    Given that α ⊕ β is a fintype, β is also a fintype. This is non-computable as it uses that Sum.inr is an injection, but there's no clear inverse if β is empty.

                    Equations
                    Instances For

                      Relation to Finite #

                      In this section we prove that α : Type* is Finite if and only if Fintype α is nonempty.

                      theorem Fintype.finite {α : Type u_4} (_inst : Fintype α) :
                      instance Finite.of_fintype (α : Type u_4) [Fintype α] :

                      For efficiency reasons, we want Finite instances to have higher priority than ones coming from Fintype instances.

                      Equations
                      theorem nonempty_fintype (α : Type u_4) [Finite α] :

                      See also nonempty_encodable, nonempty_denumerable.

                      noncomputable def Fintype.ofFinite (α : Type u_4) [Finite α] :

                      Noncomputably get a Fintype instance from a Finite instance. This is not an instance because we want Fintype instances to be useful for computations.

                      Equations
                      Instances For
                        theorem Finite.of_injective {α : Sort u_4} {β : Sort u_5} [Finite β] (f : αβ) (H : Function.Injective f) :
                        theorem Finite.of_surjective {α : Sort u_4} {β : Sort u_5} [Finite α] (f : αβ) (H : Function.Surjective f) :
                        theorem Finite.exists_univ_list (α : Type u_4) [Finite α] :
                        l, List.Nodup l ∀ (x : α), x l
                        theorem Fintype.card_le_of_injective {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (f : αβ) (hf : Function.Injective f) :
                        theorem Fintype.card_le_of_embedding {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (f : α β) :
                        theorem Fintype.card_lt_of_injective_of_not_mem {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (f : αβ) (h : Function.Injective f) {b : β} (w : ¬b Set.range f) :
                        theorem Fintype.card_le_of_surjective {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (f : αβ) (h : Function.Surjective f) :
                        theorem Fintype.card_range_le {α : Type u_4} {β : Type u_5} (f : αβ) [Fintype α] [Fintype ↑(Set.range f)] :
                        theorem Fintype.card_range {α : Type u_4} {β : Type u_5} {F : Type u_6} [EmbeddingLike F α β] (f : F) [Fintype α] [Fintype ↑(Set.range f)] :
                        theorem Fintype.exists_ne_map_eq_of_card_lt {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (f : αβ) (h : Fintype.card β < Fintype.card α) :
                        x y, x y f x = f y

                        The pigeonhole principle for finitely many pigeons and pigeonholes. This is the Fintype version of Finset.exists_ne_map_eq_of_card_lt_of_maps_to.

                        theorem Fintype.card_eq_one_iff {α : Type u_1} [Fintype α] :
                        Fintype.card α = 1 x, ∀ (y : α), y = x
                        theorem Fintype.card_eq_zero {α : Type u_1} [Fintype α] [IsEmpty α] :

                        A Fintype with cardinality zero is equivalent to Empty.

                        Equations
                        Instances For
                          theorem Fintype.card_pos {α : Type u_1} [Fintype α] [h : Nonempty α] :
                          @[simp]
                          theorem Fintype.card_ne_zero {α : Type u_1} [Fintype α] [Nonempty α] :
                          theorem Fintype.card_le_one_iff {α : Type u_1} [Fintype α] :
                          Fintype.card α 1 ∀ (a b : α), a = b
                          theorem Fintype.exists_ne_of_one_lt_card {α : Type u_1} [Fintype α] (h : 1 < Fintype.card α) (a : α) :
                          b, b a
                          theorem Fintype.exists_pair_of_one_lt_card {α : Type u_1} [Fintype α] (h : 1 < Fintype.card α) :
                          a b, a b
                          theorem Fintype.card_eq_one_of_forall_eq {α : Type u_1} [Fintype α] {i : α} (h : ∀ (j : α), j = i) :
                          theorem Fintype.exists_unique_iff_card_one {α : Type u_4} [Fintype α] (p : αProp) [DecidablePred p] :
                          (∃! a, p a) Finset.card (Finset.filter p Finset.univ) = 1
                          theorem Fintype.one_lt_card {α : Type u_1} [Fintype α] [h : Nontrivial α] :
                          theorem Fintype.one_lt_card_iff {α : Type u_1} [Fintype α] :
                          1 < Fintype.card α a b, a b
                          theorem Fintype.two_lt_card_iff {α : Type u_1} [Fintype α] :
                          2 < Fintype.card α a b c, a b a c b c
                          theorem Fintype.card_of_bijective {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] {f : αβ} (hf : Function.Bijective f) :
                          theorem Finite.surjective_of_injective {α : Type u_1} [Finite α] {f : αα} (hinj : Function.Injective f) :
                          theorem Finite.injective_iff_surjective_of_equiv {α : Type u_1} {β : Type u_2} [Finite α] {f : αβ} (e : α β) :

                          Alias of the forward direction of Finite.injective_iff_bijective.

                          Alias of the forward direction of Finite.surjective_iff_bijective.

                          theorem Function.Injective.surjective_of_fintype {α : Type u_1} {β : Type u_2} [Finite α] {f : αβ} (e : α β) :

                          Alias of the forward direction of Finite.injective_iff_surjective_of_equiv.

                          theorem Function.Surjective.injective_of_fintype {α : Type u_1} {β : Type u_2} [Finite α] {f : αβ} (e : α β) :

                          Alias of the reverse direction of Finite.injective_iff_surjective_of_equiv.

                          theorem Function.LeftInverse.rightInverse_of_card_le {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] {f : αβ} {g : βα} (hfg : Function.LeftInverse f g) (hcard : Fintype.card α Fintype.card β) :
                          theorem Function.RightInverse.leftInverse_of_card_le {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] {f : αβ} {g : βα} (hfg : Function.RightInverse f g) (hcard : Fintype.card β Fintype.card α) :
                          @[simp]
                          theorem Equiv.ofLeftInverseOfCardLE_apply {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (hβα : Fintype.card β Fintype.card α) (f : αβ) (g : βα) (h : Function.LeftInverse g f) :
                          ∀ (a : α), ↑(Equiv.ofLeftInverseOfCardLE hβα f g h) a = f a
                          @[simp]
                          theorem Equiv.ofLeftInverseOfCardLE_symm_apply {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (hβα : Fintype.card β Fintype.card α) (f : αβ) (g : βα) (h : Function.LeftInverse g f) :
                          ∀ (a : β), (Equiv.ofLeftInverseOfCardLE hβα f g h).symm a = g a
                          def Equiv.ofLeftInverseOfCardLE {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (hβα : Fintype.card β Fintype.card α) (f : αβ) (g : βα) (h : Function.LeftInverse g f) :
                          α β

                          Construct an equivalence from functions that are inverse to each other.

                          Equations
                          Instances For
                            @[simp]
                            theorem Equiv.ofRightInverseOfCardLE_symm_apply {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (hαβ : Fintype.card α Fintype.card β) (f : αβ) (g : βα) (h : Function.RightInverse g f) :
                            ∀ (a : β), (Equiv.ofRightInverseOfCardLE hαβ f g h).symm a = g a
                            @[simp]
                            theorem Equiv.ofRightInverseOfCardLE_apply {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (hαβ : Fintype.card α Fintype.card β) (f : αβ) (g : βα) (h : Function.RightInverse g f) :
                            ∀ (a : α), ↑(Equiv.ofRightInverseOfCardLE hαβ f g h) a = f a
                            def Equiv.ofRightInverseOfCardLE {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (hαβ : Fintype.card α Fintype.card β) (f : αβ) (g : βα) (h : Function.RightInverse g f) :
                            α β

                            Construct an equivalence from functions that are inverse to each other.

                            Equations
                            Instances For
                              @[simp]
                              theorem Fintype.card_coe {α : Type u_1} (s : Finset α) [Fintype { x // x s }] :
                              Fintype.card { x // x s } = Finset.card s
                              noncomputable def Finset.equivFin {α : Type u_1} (s : Finset α) :
                              { x // x s } Fin (Finset.card s)

                              Noncomputable equivalence between a finset s coerced to a type and Fin s.card.

                              Equations
                              Instances For
                                noncomputable def Finset.equivFinOfCardEq {α : Type u_1} {s : Finset α} {n : } (h : Finset.card s = n) :
                                { x // x s } Fin n

                                Noncomputable equivalence between a finset s as a fintype and Fin n, when there is a proof that s.card = n.

                                Equations
                                Instances For
                                  noncomputable def Finset.equivOfCardEq {α : Type u_1} {s : Finset α} {t : Finset α} (h : Finset.card s = Finset.card t) :
                                  { x // x s } { x // x t }

                                  Noncomputable equivalence between two finsets s and t as fintypes when there is a proof that s.card = t.card.

                                  Equations
                                  Instances For
                                    theorem set_fintype_card_le_univ {α : Type u_1} [Fintype α] (s : Set α) [Fintype s] :
                                    theorem set_fintype_card_eq_univ_iff {α : Type u_1} [Fintype α] (s : Set α) [Fintype s] :
                                    Fintype.card s = Fintype.card α s = Set.univ
                                    noncomputable def Function.Embedding.equivOfFintypeSelfEmbedding {α : Type u_1} [Finite α] (e : α α) :
                                    α α

                                    An embedding from a Fintype to itself can be promoted to an equivalence.

                                    Equations
                                    Instances For
                                      @[simp]
                                      theorem Function.Embedding.isEmpty_of_card_lt {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (h : Fintype.card β < Fintype.card α) :
                                      IsEmpty (α β)

                                      If ‖β‖ < ‖α‖ there are no embeddings α ↪ β. This is a formulation of the pigeonhole principle.

                                      Note this cannot be an instance as it needs h.

                                      def Function.Embedding.truncOfCardLE {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] (h : Fintype.card α Fintype.card β) :
                                      Trunc (α β)

                                      A constructive embedding of a fintype α in another fintype β when card α ≤ card β.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Function.Embedding.nonempty_of_card_le {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (h : Fintype.card α Fintype.card β) :
                                        Nonempty (α β)
                                        theorem Function.Embedding.exists_of_card_le_finset {α : Type u_1} {β : Type u_2} [Fintype α] {s : Finset β} (h : Fintype.card α Finset.card s) :
                                        f, Set.range f s
                                        @[simp]
                                        theorem Finset.univ_map_embedding {α : Type u_4} [Fintype α] (e : α α) :
                                        Finset.map e Finset.univ = Finset.univ
                                        theorem Fintype.card_subtype_le {α : Type u_1} [Fintype α] (p : αProp) [DecidablePred p] :
                                        Fintype.card { x // p x } Fintype.card α
                                        theorem Fintype.card_subtype_lt {α : Type u_1} [Fintype α] {p : αProp} [DecidablePred p] {x : α} (hx : ¬p x) :
                                        Fintype.card { x // p x } < Fintype.card α
                                        theorem Fintype.card_subtype {α : Type u_1} [Fintype α] (p : αProp) [DecidablePred p] :
                                        Fintype.card { x // p x } = Finset.card (Finset.filter p Finset.univ)
                                        @[simp]
                                        theorem Fintype.card_subtype_compl {α : Type u_1} [Fintype α] (p : αProp) [Fintype { x // p x }] [Fintype { x // ¬p x }] :
                                        Fintype.card { x // ¬p x } = Fintype.card α - Fintype.card { x // p x }
                                        theorem Fintype.card_subtype_mono {α : Type u_1} (p : αProp) (q : αProp) (h : p q) [Fintype { x // p x }] [Fintype { x // q x }] :
                                        Fintype.card { x // p x } Fintype.card { x // q x }
                                        theorem Fintype.card_compl_eq_card_compl {α : Type u_1} [Finite α] (p : αProp) (q : αProp) [Fintype { x // p x }] [Fintype { x // ¬p x }] [Fintype { x // q x }] [Fintype { x // ¬q x }] (h : Fintype.card { x // p x } = Fintype.card { x // q x }) :
                                        Fintype.card { x // ¬p x } = Fintype.card { x // ¬q x }

                                        If two subtypes of a fintype have equal cardinality, so do their complements.

                                        theorem Fintype.card_quotient_le {α : Type u_1} [Fintype α] (s : Setoid α) [DecidableRel fun x x_1 => x x_1] :
                                        theorem Fintype.card_quotient_lt {α : Type u_1} [Fintype α] {s : Setoid α} [DecidableRel fun x x_1 => x x_1] {x : α} {y : α} (h1 : x y) (h2 : x y) :
                                        theorem univ_eq_singleton_of_card_one {α : Type u_4} [Fintype α] (x : α) (h : Fintype.card α = 1) :
                                        Finset.univ = {x}
                                        theorem Finite.wellFounded_of_trans_of_irrefl {α : Type u_1} [Finite α] (r : ααProp) [IsTrans α r] [IsIrrefl α r] :
                                        theorem Fintype.false {α : Type u_1} [Infinite α] (_h : Fintype α) :
                                        @[simp]
                                        theorem isEmpty_fintype {α : Type u_4} :
                                        noncomputable def fintypeOfNotInfinite {α : Type u_4} (h : ¬Infinite α) :

                                        A non-infinite type is a fintype.

                                        Equations
                                        Instances For
                                          noncomputable def fintypeOrInfinite (α : Type u_4) :

                                          Any type is (classically) either a Fintype, or Infinite.

                                          One can obtain the relevant typeclasses via cases fintypeOrInfinite α.

                                          Equations
                                          Instances For
                                            theorem Finset.exists_minimal {α : Type u_4} [Preorder α] (s : Finset α) (h : Finset.Nonempty s) :
                                            m, m s ∀ (x : α), x s¬x < m
                                            theorem Finset.exists_maximal {α : Type u_4} [Preorder α] (s : Finset α) (h : Finset.Nonempty s) :
                                            m, m s ∀ (x : α), x s¬m < x
                                            theorem Infinite.of_not_fintype {α : Type u_1} (h : Fintype αFalse) :
                                            theorem Infinite.of_injective_to_set {α : Type u_1} {s : Set α} (hs : s Set.univ) {f : αs} (hf : Function.Injective f) :

                                            If s : Set α is a proper subset of α and f : α → s is injective, then α is infinite.

                                            theorem Infinite.of_surjective_from_set {α : Type u_1} {s : Set α} (hs : s Set.univ) {f : sα} (hf : Function.Surjective f) :

                                            If s : Set α is a proper subset of α and f : s → α is surjective, then α is infinite.

                                            theorem Infinite.exists_not_mem_finset {α : Type u_1} [Infinite α] (s : Finset α) :
                                            x, ¬x s
                                            theorem Infinite.nonempty (α : Type u_4) [Infinite α] :
                                            theorem Infinite.of_injective {α : Sort u_4} {β : Sort u_5} [Infinite β] (f : βα) (hf : Function.Injective f) :
                                            theorem Infinite.of_surjective {α : Sort u_4} {β : Sort u_5} [Infinite β] (f : αβ) (hf : Function.Surjective f) :
                                            noncomputable def Infinite.natEmbedding (α : Type u_4) [Infinite α] :
                                            α

                                            Embedding of into an infinite type.

                                            Equations
                                            Instances For
                                              theorem Infinite.exists_subset_card_eq (α : Type u_4) [Infinite α] (n : ) :
                                              s, Finset.card s = n

                                              See Infinite.exists_superset_card_eq for a version that, for an s : Finset α, provides a superset t : Finset α, s ⊆ t such that t.card is fixed.

                                              theorem Infinite.exists_superset_card_eq {α : Type u_1} [Infinite α] (s : Finset α) (n : ) (hn : Finset.card s n) :
                                              t, s t Finset.card t = n

                                              See Infinite.exists_subset_card_eq for a version that provides an arbitrary s : Finset α for any cardinality.

                                              noncomputable def fintypeOfFinsetCardLe {ι : Type u_4} (n : ) (w : ∀ (s : Finset ι), Finset.card s n) :

                                              If every finset in a type has bounded cardinality, that type is finite.

                                              Equations
                                              Instances For
                                                theorem not_injective_infinite_finite {α : Sort u_4} {β : Sort u_5} [Infinite α] [Finite β] (f : αβ) :
                                                theorem Finite.exists_ne_map_eq_of_infinite {α : Sort u_4} {β : Sort u_5} [Infinite α] [Finite β] (f : αβ) :
                                                x y, x y f x = f y

                                                The pigeonhole principle for infinitely many pigeons in finitely many pigeonholes. If there are infinitely many pigeons in finitely many pigeonholes, then there are at least two pigeons in the same pigeonhole.

                                                See also: Fintype.exists_ne_map_eq_of_card_lt, Finite.exists_infinite_fiber.

                                                theorem Finite.exists_infinite_fiber {α : Type u_1} {β : Type u_2} [Infinite α] [Finite β] (f : αβ) :
                                                y, Infinite ↑(f ⁻¹' {y})

                                                The strong pigeonhole principle for infinitely many pigeons in finitely many pigeonholes. If there are infinitely many pigeons in finitely many pigeonholes, then there is a pigeonhole with infinitely many pigeons.

                                                See also: Finite.exists_ne_map_eq_of_infinite

                                                theorem not_surjective_finite_infinite {α : Sort u_4} {β : Sort u_5} [Finite α] [Infinite β] (f : αβ) :
                                                def truncOfCardPos {α : Type u_4} [Fintype α] (h : 0 < Fintype.card α) :

                                                A Fintype with positive cardinality constructively contains an element.

                                                Equations
                                                Instances For
                                                  theorem Fintype.induction_subsingleton_or_nontrivial {P : (α : Type u_4) → [inst : Fintype α] → Prop} (α : Type u_4) [Fintype α] (hbase : (α : Type u_4) → [inst : Fintype α] → [inst_1 : Subsingleton α] → P α inst) (hstep : (α : Type u_4) → [inst : Fintype α] → [inst_1 : Nontrivial α] → ((β : Type u_4) → [inst_2 : Fintype β] → Fintype.card β < Fintype.card αP β inst_2) → P α inst) :
                                                  P α inst✝

                                                  A custom induction principle for fintypes. The base case is a subsingleton type, and the induction step is for non-trivial types, and one can assume the hypothesis for smaller types (via Fintype.card).

                                                  The major premise is Fintype α, so to use this with the induction tactic you have to give a name to that instance and use that name.