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 afinite
instance from afintype
instance. The former lemma takesfintype α
as an explicit argument while the latter takes it as an instance argument.fintype.of_finite
noncomputably creates afintype
instance from afinite
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