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_1) [inst : Fintype α] :

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

Equations
def Fintype.truncEquivFin (α : Type u_1) [inst : DecidableEq α] [inst : Fintype α] :

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≃ 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.
noncomputable def Fintype.equivFin (α : Type u_1) [inst : 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≃ Fin n given Fintype.card α = n.

Equations
def Fintype.truncFinBijection (α : Type u_1) [inst : Fintype α] :

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.
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) [inst : 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) [inst : Fintype p] :
theorem Fintype.ofEquiv_card {α : Type u_1} {β : Type u_2} [inst : Fintype α] (f : α β) :
theorem Fintype.card_congr {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : α β) :
theorem Fintype.card_congr' {α : Type u_1} {β : Type u_1} [inst : Fintype α] [inst : Fintype β] (h : α = β) :
def Fintype.truncEquivFinOfCardEq {α : Type u_1} [inst : Fintype α] [inst : 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 α)≃ Fin (card α).

Equations
noncomputable def Fintype.equivFinOfCardEq {α : Type u_1} [inst : 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 α)≃ Fin (card α).

Equations
def Fintype.truncEquivOfCardEq {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] [inst : DecidableEq α] [inst : 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
noncomputable def Fintype.equivOfCardEq {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : 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
theorem Fintype.card_eq {α : Type u_1} {β : Type u_2} [_F : Fintype α] [_G : Fintype β] :
@[simp]
theorem Fintype.card_ofSubsingleton {α : Type u_1} (a : α) [inst : 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} [inst : Unique α] [h : Fintype α] :
@[simp]
theorem Fintype.card_of_isEmpty {α : Type u_1} [inst : 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_1} (s : Set α) [inst : Fintype s] :
theorem Finset.card_univ {α : Type u_1} [inst : Fintype α] :
Finset.card Finset.univ = Fintype.card α
theorem Finset.eq_univ_of_card {α : Type u_1} [inst : Fintype α] (s : Finset α) (hs : Finset.card s = Fintype.card α) :
s = Finset.univ
theorem Finset.card_eq_iff_eq_univ {α : Type u_1} [inst : Fintype α] (s : Finset α) :
Finset.card s = Fintype.card α s = Finset.univ
theorem Finset.card_le_univ {α : Type u_1} [inst : Fintype α] (s : Finset α) :
theorem Finset.card_lt_univ_of_not_mem {α : Type u_1} [inst : Fintype α] {s : Finset α} {x : α} (hx : ¬x s) :
theorem Finset.card_lt_iff_ne_univ {α : Type u_1} [inst : Fintype α] (s : Finset α) :
Finset.card s < Fintype.card α s Finset.univ
theorem Finset.card_univ_diff {α : Type u_1} [inst : DecidableEq α] [inst : Fintype α] (s : Finset α) :
Finset.card (Finset.univ \ s) = Fintype.card α - Finset.card s
theorem Finset.card_compl {α : Type u_1} [inst : DecidableEq α] [inst : Fintype α] (s : Finset α) :
theorem Fintype.card_compl_set {α : Type u_1} [inst : Fintype α] (s : Set α) [inst : Fintype s] [inst : Fintype ↑(s)] :
@[simp]
theorem Fintype.card_fin (n : ) :
@[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 = (RelIso.toRelEmbedding (Fin.cast (_ : n = m))).toEmbedding

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

theorem Fin.equiv_iff_eq {m : } {n : } :
Nonempty (Fin m Fin n) m = n
theorem Fintype.card_subtype_eq {α : Type u_1} (y : α) [inst : Fintype { x // x = y }] :
Fintype.card { x // x = y } = 1
theorem Fintype.card_subtype_eq' {α : Type u_1} (y : α) [inst : Fintype { x // y = x }] :
Fintype.card { x // y = x } = 1
@[simp]
theorem Fintype.card_ulift (α : Type u_1) [inst : Fintype α] :
@[simp]
theorem Fintype.card_plift (α : Type u_1) [inst : Fintype α] :
@[simp]
theorem Fintype.card_orderDual (α : Type u_1) [inst : Fintype α] :
@[simp]
theorem Fintype.card_lex (α : Type u_1) [inst : Fintype α] :
noncomputable def Fintype.sumLeft {α : Type u_1} {β : Type u_2} [inst : 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
noncomputable def Fintype.sumRight {α : Type u_1} {β : Type u_2} [inst : 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

Relation to Finite #

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

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

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

Equations
theorem nonempty_fintype (α : Type u_1) [inst : Finite α] :

See also nonempty_encodable, nonempty_denumerable.

noncomputable def Fintype.ofFinite (α : Type u_1) [inst : 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
theorem Finite.of_injective {α : Sort u_1} {β : Sort u_2} [inst : Finite β] (f : αβ) (H : Function.Injective f) :
theorem Finite.of_surjective {α : Sort u_1} {β : Sort u_2} [inst : Finite α] (f : αβ) (H : Function.Surjective f) :
theorem Finite.exists_univ_list (α : Type u_1) [inst : Finite α] :
l, List.Nodup l ∀ (x : α), x l
theorem List.Nodup.length_le_card {α : Type u_1} [inst : Fintype α] {l : List α} (h : List.Nodup l) :
theorem Fintype.card_le_of_injective {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : αβ) (hf : Function.Injective f) :
theorem Fintype.card_le_of_embedding {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : α β) :
theorem Fintype.card_lt_of_injective_of_not_mem {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : αβ) (h : Function.Injective f) {b : β} (w : ¬b Set.range f) :
theorem Fintype.card_lt_of_injective_not_surjective {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : αβ) (h : Function.Injective f) (h' : ¬Function.Surjective f) :
theorem Fintype.card_le_of_surjective {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : αβ) (h : Function.Surjective f) :
theorem Fintype.card_range_le {α : Type u_1} {β : Type u_2} (f : αβ) [inst : Fintype α] [inst : Fintype ↑(Set.range f)] :
theorem Fintype.card_range {α : Type u_1} {β : Type u_2} {F : Type u_3} [inst : EmbeddingLike F α β] (f : F) [inst : Fintype α] [inst : Fintype ↑(Set.range f)] :
theorem Fintype.exists_ne_map_eq_of_card_lt {α : Type u_2} {β : Type u_1} [inst : Fintype α] [inst : 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} [inst : Fintype α] :
Fintype.card α = 1 x, ∀ (y : α), y = x
theorem Fintype.card_eq_zero_iff {α : Type u_1} [inst : Fintype α] :
theorem Fintype.card_eq_zero {α : Type u_1} [inst : Fintype α] [inst : IsEmpty α] :

A Fintype with cardinality zero is equivalent to Empty.

Equations
theorem Fintype.card_pos_iff {α : Type u_1} [inst : Fintype α] :
theorem Fintype.card_pos {α : Type u_1} [inst : Fintype α] [h : Nonempty α] :
theorem Fintype.card_ne_zero {α : Type u_1} [inst : Fintype α] [inst : Nonempty α] :
theorem Fintype.card_le_one_iff {α : Type u_1} [inst : Fintype α] :
Fintype.card α 1 ∀ (a b : α), a = b
theorem Fintype.exists_ne_of_one_lt_card {α : Type u_1} [inst : Fintype α] (h : 1 < Fintype.card α) (a : α) :
b, b a
theorem Fintype.exists_pair_of_one_lt_card {α : Type u_1} [inst : Fintype α] (h : 1 < Fintype.card α) :
a b, a b
theorem Fintype.card_eq_one_of_forall_eq {α : Type u_1} [inst : Fintype α] {i : α} (h : ∀ (j : α), j = i) :
theorem Fintype.one_lt_card {α : Type u_1} [inst : Fintype α] [h : Nontrivial α] :
theorem Fintype.one_lt_card_iff {α : Type u_1} [inst : Fintype α] :
1 < Fintype.card α a b, a b
theorem Fintype.two_lt_card_iff {α : Type u_1} [inst : Fintype α] :
2 < Fintype.card α a b c, a b a c b c
theorem Fintype.card_of_bijective {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] {f : αβ} (hf : Function.Bijective f) :
theorem Finite.surjective_of_injective {α : Type u_1} [inst : Finite α] {f : αα} (hinj : Function.Injective f) :
theorem Finite.injective_iff_surjective_of_equiv {α : Type u_1} {β : Type u_2} [inst : Finite α] {f : αβ} (e : α β) :
theorem Function.Injective.bijective_of_finite {α : Type u_1} [inst : Finite α] {f : αα} :

Alias of the forward direction of Finite.injective_iff_bijective.

theorem Function.Surjective.bijective_of_finite {α : Type u_1} [inst : Finite α] {f : αα} :

Alias of the forward direction of Finite.surjective_iff_bijective.

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

Alias of the reverse direction of Finite.injective_iff_surjective_of_equiv.

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

Alias of the forward direction of Finite.injective_iff_surjective_of_equiv.

theorem Fintype.bijective_iff_injective_and_card {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : αβ) :
theorem Function.LeftInverse.rightInverse_of_card_le {α : Type u_2} {β : Type u_1} [inst : Fintype α] [inst : Fintype β] {f : αβ} {g : βα} (hfg : Function.LeftInverse f g) (hcard : Fintype.card α Fintype.card β) :
theorem Function.RightInverse.leftInverse_of_card_le {α : Type u_2} {β : Type u_1} [inst : Fintype α] [inst : Fintype β] {f : αβ} {g : βα} (hfg : Function.RightInverse f g) (hcard : Fintype.card β Fintype.card α) :
@[simp]
theorem Equiv.ofLeftInverseOfCardLe_apply {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : 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} [inst : Fintype α] [inst : Fintype β] (hβα : Fintype.card β Fintype.card α) (f : αβ) (g : βα) (h : Function.LeftInverse g f) :
∀ (a : β), ↑(Equiv.symm (Equiv.ofLeftInverseOfCardLe hβα f g h)) a = g a
def Equiv.ofLeftInverseOfCardLe {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : 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
@[simp]
theorem Equiv.ofRightInverseOfCardLe_apply {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (hαβ : Fintype.card α Fintype.card β) (f : αβ) (g : βα) (h : Function.RightInverse g f) :
∀ (a : α), ↑(Equiv.ofRightInverseOfCardLe hαβ f g h) a = f a
@[simp]
theorem Equiv.ofRightInverseOfCardLe_symm_apply {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (hαβ : Fintype.card α Fintype.card β) (f : αβ) (g : βα) (h : Function.RightInverse g f) :
∀ (a : β), ↑(Equiv.symm (Equiv.ofRightInverseOfCardLe hαβ f g h)) a = g a
def Equiv.ofRightInverseOfCardLe {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : 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
@[simp]
theorem Fintype.card_coe {α : Type u_1} (s : Finset α) [inst : 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
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
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
theorem set_fintype_card_le_univ {α : Type u_1} [inst : Fintype α] (s : Set α) [inst : Fintype s] :
theorem set_fintype_card_eq_univ_iff {α : Type u_1} [inst : Fintype α] (s : Set α) [inst : Fintype s] :
Fintype.card s = Fintype.card α s = Set.univ
noncomputable def Function.Embedding.equivOfFintypeSelfEmbedding {α : Type u_1} [inst : Finite α] (e : α α) :
α α

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

Equations
@[simp]
theorem Function.Embedding.is_empty_of_card_lt {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : 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} [inst : Fintype α] [inst : Fintype β] [inst : DecidableEq α] [inst : DecidableEq β] (h : Fintype.card α Fintype.card β) :
Trunc (α β)

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

Equations
  • One or more equations did not get rendered due to their size.
theorem Function.Embedding.nonempty_of_card_le {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (h : Fintype.card α Fintype.card β) :
Nonempty (α β)
theorem Function.Embedding.nonempty_iff_card_le {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] :
theorem Function.Embedding.exists_of_card_le_finset {α : Type u_1} {β : Type u_2} [inst : Fintype α] {s : Finset β} (h : Fintype.card α Finset.card s) :
f, Set.range f s
@[simp]
theorem Finset.univ_map_embedding {α : Type u_1} [inst : Fintype α] (e : α α) :
Finset.map e Finset.univ = Finset.univ
theorem Fintype.card_lt_of_surjective_not_injective {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst : Fintype β] (f : αβ) (h : Function.Surjective f) (h' : ¬Function.Injective f) :
theorem Fintype.card_subtype_le {α : Type u_1} [inst : Fintype α] (p : αProp) [inst : DecidablePred p] :
Fintype.card { x // p x } Fintype.card α
theorem Fintype.card_subtype_lt {α : Type u_1} [inst : Fintype α] {p : αProp} [inst : DecidablePred p] {x : α} (hx : ¬p x) :
Fintype.card { x // p x } < Fintype.card α
theorem Fintype.card_subtype {α : Type u_1} [inst : Fintype α] (p : αProp) [inst : DecidablePred p] :
Fintype.card { x // p x } = Finset.card (Finset.filter p Finset.univ)
@[simp]
theorem Fintype.card_subtype_compl {α : Type u_1} [inst : Fintype α] (p : αProp) [inst : Fintype { x // p x }] [inst : 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) [inst : Fintype { x // p x }] [inst : Fintype { x // q x }] :
Fintype.card { x // p x } Fintype.card { x // q x }
theorem Fintype.card_compl_eq_card_compl {α : Type u_1} [inst : Finite α] (p : αProp) (q : αProp) [inst : Fintype { x // p x }] [inst : Fintype { x // ¬p x }] [inst : Fintype { x // q x }] [inst : 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} [inst : Fintype α] (s : Setoid α) [inst : DecidableRel fun x x_1 => x x_1] :
theorem Fintype.card_quotient_lt {α : Type u_1} [inst : Fintype α] {s : Setoid α} [inst : 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_1} [inst : Fintype α] (x : α) (h : Fintype.card α = 1) :
Finset.univ = {x}
theorem Finite.wellFounded_of_trans_of_irrefl {α : Type u_1} [inst : Finite α] (r : ααProp) [inst : IsTrans α r] [inst : IsIrrefl α r] :
theorem Finite.Preorder.wellFounded_lt {α : Type u_1} [inst : Finite α] [inst : Preorder α] :
WellFounded fun x x_1 => x < x_1
theorem Finite.Preorder.wellFounded_gt {α : Type u_1} [inst : Finite α] [inst : Preorder α] :
WellFounded fun x x_1 => x > x_1
theorem Fintype.false {α : Type u_1} [inst : Infinite α] (_h : Fintype α) :
@[simp]
theorem is_empty_fintype {α : Type u_1} :
noncomputable def fintypeOfNotInfinite {α : Type u_1} (h : ¬Infinite α) :

A non-infinite type is a fintype.

Equations
noncomputable def fintypeOrInfinite (α : Type u_1) :

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

One can obtain the relevant typeclasses via cases fintype_or_infinite α; resetI.

Equations
theorem Finset.exists_minimal {α : Type u_1} [inst : Preorder α] (s : Finset α) (h : Finset.Nonempty s) :
m, m s ∀ (x : α), x s¬x < m
theorem Finset.exists_maximal {α : Type u_1} [inst : 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→ 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} [inst : Infinite α] (s : Finset α) :
x, ¬x s
theorem Infinite.nonempty (α : Type u_1) [inst : Infinite α] :
theorem Infinite.of_injective {α : Sort u_1} {β : Sort u_2} [inst : Infinite β] (f : βα) (hf : Function.Injective f) :
theorem Infinite.of_surjective {α : Sort u_1} {β : Sort u_2} [inst : Infinite β] (f : αβ) (hf : Function.Surjective f) :
instance Infinite.set {α : Type u_1} [inst : Infinite α] :
Equations
instance Prod.infinite_of_right {α : Type u_1} {β : Type u_2} [inst : Nonempty α] [inst : Infinite β] :
Infinite (α × β)
Equations
instance Prod.infinite_of_left {α : Type u_1} {β : Type u_2} [inst : Infinite α] [inst : Nonempty β] :
Infinite (α × β)
Equations
noncomputable def Infinite.natEmbedding (α : Type u_1) [inst : Infinite α] :
α

Embedding of into an infinite type.

Equations
theorem Infinite.exists_subset_card_eq (α : Type u_1) [inst : Infinite α] (n : ) :
s, Finset.card s = n

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

theorem Infinite.exists_superset_card_eq {α : Type u_1} [inst : 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_1} (n : ) (w : ∀ (s : Finset ι), Finset.card s n) :

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

Equations
theorem not_injective_infinite_finite {α : Sort u_1} {β : Sort u_2} [inst : Infinite α] [inst : Finite β] (f : αβ) :
theorem Finite.exists_ne_map_eq_of_infinite {α : Sort u_1} {β : Sort u_2} [inst : Infinite α] [inst : 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} [inst : Infinite α] [inst : 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_1} {β : Sort u_2} [inst : Finite α] [inst : Infinite β] (f : αβ) :
def truncOfCardPos {α : Type u_1} [inst : Fintype α] (h : 0 < Fintype.card α) :

A Fintype with positive cardinality constructively contains an element.

Equations
theorem Fintype.induction_subsingleton_or_nontrivial {P : (α : Type u_1) → [inst : Fintype α] → Prop} (α : Type u_1) [inst : Fintype α] (hbase : (α : Type u_1) → [inst : Fintype α] → [inst_1 : Subsingleton α] → P α inst) (hstep : (α : Type u_1) → [inst : Fintype α] → [inst_1 : Nontrivial α] → ((β : Type u_1) → [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.