Constructors for Fintype
#
This file contains basic constructors for Fintype
instances,
given maps from/to finite types.
Main results #
Fintype.ofBijective
,Fintype.ofInjective
,Fintype.ofSurjective
: a type is finite if there is a bi/in/surjection from/to a finite type.
Construct a proof of Fintype α
from a universal multiset
Equations
- Fintype.ofMultiset s H = { elems := s.toFinset, complete := ⋯ }
Instances For
Construct a proof of Fintype α
from a universal list
Equations
- Fintype.ofList l H = { elems := l.toFinset, complete := ⋯ }
Instances For
If f : α → β
is a bijection and α
is a fintype, then β
is also a fintype.
Equations
- Fintype.ofBijective f H = { elems := Finset.map { toFun := f, inj' := ⋯ } Finset.univ, complete := ⋯ }
Instances For
If f : α → β
is a surjection and α
is a fintype, then β
is also a fintype.
Equations
- Fintype.ofSurjective f H = { elems := Finset.image f Finset.univ, complete := ⋯ }
Instances For
Given an injective function to a fintype, the domain is also a fintype. This is noncomputable because injectivity alone cannot be used to construct preimages.
Equations
- Fintype.ofInjective f H = if hα : Nonempty α then Fintype.ofSurjective (Function.invFun f) ⋯ else { elems := ∅, complete := ⋯ }
Instances For
If f : α ≃ β
and α
is a fintype, then β
is also a fintype.
Equations
- Fintype.ofEquiv α f = Fintype.ofBijective ⇑f ⋯
Instances For
Any subsingleton type with a witness is a fintype (with one term).
Equations
- Fintype.ofSubsingleton a = { elems := {a}, complete := ⋯ }
Instances For
An empty type is a fintype. Not registered as an instance, to make sure that there aren't two
conflicting Fintype ι
instances around when casing over whether a fintype ι
is empty or not.
Equations
- Fintype.ofIsEmpty = { elems := ∅, complete := ⋯ }
Instances For
Note: this lemma is specifically about Fintype.ofIsEmpty
. For a statement about
arbitrary Fintype
instances, use Finset.univ_eq_empty
.