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 #
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 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
This instance also provides [Finite s]
for s : Set α
.