mathlib documentation

data.finite.basic

Finite types #

In this file we prove some theorems about finite and provide some instances. This typeclass is a Prop-valued counterpart of the typeclass fintype. See more details in the file where finite is defined.

Main definitions #

Implementation notes #

There is an apparent duplication of many fintype instances in this module, however they follow a pattern: if a fintype instance depends on decidable instances or other fintype instances, then we need to "lower" the instance to be a finite instance by removing the decidable instances and switching the fintype instances to finite instances. These are precisely the ones that cannot be inferred using finite.of_fintype. (However, when using open_locale classical or the classical tactic the instances relying only on decidable instances will give finite instances.) In the future we might consider writing automation to create these "lowered" instances.

Tags #

finiteness, finite types

theorem not_finite_iff_infinite {α : Type u_1} :
theorem finite_or_infinite (α : Type u_1) :
theorem not_finite (α : Type u_1) [h1 : infinite α] [h2 : finite α] :
theorem finite.of_not_infinite {α : Type u_1} (h : ¬infinite α) :
theorem infinite.of_not_finite {α : Type u_1} (h : ¬finite α) :
theorem not_infinite_iff_finite {α : Type u_1} :
theorem finite.exists_max {α : Type u_1} {β : Type u_2} [finite α] [nonempty α] [linear_order β] (f : α → β) :
∃ (x₀ : α), ∀ (x : α), f x f x₀
theorem finite.exists_min {α : Type u_1} {β : Type u_2} [finite α] [nonempty α] [linear_order β] (f : α → β) :
∃ (x₀ : α), ∀ (x : α), f x₀ f x
@[protected, instance]
def finite.of_subsingleton {α : Sort u_1} [subsingleton α] :
@[protected, nolint, instance]
def finite.prop (p : Prop) :
@[protected, instance]
def finite.prod.finite {α : Type u_1} {β : Type u_2} [finite α] [finite β] :
finite × β)
@[protected, instance]
def finite.pprod.finite {α : Sort u_1} {β : Sort u_2} [finite α] [finite β] :
finite (pprod α β)
theorem finite.prod_left {α : Type u_1} (β : Type u_2) [finite × β)] [nonempty β] :
theorem finite.prod_right {β : Type u_2} (α : Type u_1) [finite × β)] [nonempty α] :
@[protected, instance]
def finite.sum.finite {α : Type u_1} {β : Type u_2} [finite α] [finite β] :
finite β)
theorem finite.sum_left {α : Type u_1} (β : Type u_2) [finite β)] :
theorem finite.sum_right {β : Type u_2} (α : Type u_1) [finite β)] :
@[protected, instance]
def finite.sigma.finite {α : Type u_1} {β : α → Type u_2} [finite α] [∀ (a : α), finite (β a)] :
finite (Σ (a : α), β a)
@[protected, instance]
def finite.psigma.finite {ι : Sort u_1} {π : ι → Sort u_2} [finite ι] [∀ (i : ι), finite (π i)] :
finite (Σ' (i : ι), π i)
@[protected, instance]
def subtype.finite {α : Sort u_1} [finite α] {p : α → Prop} :
finite {x // p x}

This instance also provides [finite s] for s : set α.

@[protected, instance]
def pi.finite {α : Sort u_1} {β : α → Sort u_2} [finite α] [∀ (a : α), finite (β a)] :
finite (Π (a : α), β a)
@[protected, instance]
def vector.finite {α : Type u_1} [finite α] {n : } :
finite (vector α n)
@[protected, instance]
def quot.finite {α : Sort u_1} [finite α] (r : α → α → Prop) :
finite (quot r)
@[protected, instance]
def quotient.finite {α : Sort u_1} [finite α] (s : setoid α) :
@[protected, instance]
def function.embedding.finite {α : Sort u_1} {β : Sort u_2} [finite β] :
finite β)
@[protected, instance]
def equiv.finite_right {α : Sort u_1} {β : Sort u_2} [finite β] :
finite β)
@[protected, instance]
def equiv.finite_left {α : Sort u_1} {β : Sort u_2} [finite α] :
finite β)
@[protected, instance]
def sym.finite {α : Type u_1} [finite α] {n : } :
finite (sym α n)