mathlib3documentation

data.finite.basic

Finite types #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

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 #

• fintype.finite, finite.of_fintype creates a finite instance from a fintype instance. The former lemma takes fintype α as an explicit argument while the latter takes it as an instance argument.
• fintype.of_finite noncomputably creates a fintype instance from a finite instance.

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

@[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 finite.set.finite {α : Type u_1} [finite α] :
finite (set α)
@[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)