Reasoning about finite type cardinality in Coq
  • Rocq Prover 99.4%
  • Makefile 0.6%
Find a file
2018-08-30 11:49:27 -04:00
.gitignore Proofs that Fin.t n ~ Fin.t m means n = m 2016-03-12 17:17:36 -05:00
_CoqProject Tools to prove types are inequal with cardinality 2016-03-12 17:19:26 -05:00
cardinality.v Add top-level comment to cardinality 2016-03-12 19:42:32 -05:00
Finite.v Add copy of Finite library 2016-03-12 17:11:26 -05:00
finite_function.v Fix references to Coq terms in coqdoc comments 2016-03-12 19:40:15 -05:00
finite_iso.v Automate finite_iso.v proofs 2016-03-14 11:22:55 -04:00
Iso.v Add copy of Finite library 2016-03-12 17:11:26 -05:00
Makefile Proofs that Fin.t n ~ Fin.t m means n = m 2016-03-12 17:17:36 -05:00
README.md Remove LaTeX 2016-03-12 17:53:14 -05:00
type_neq.v Add a complete proof that nat <> (nat -> nat) 2018-08-30 11:49:27 -04:00

Type cardinalities

Reasoning about the size of finite types in Coq. Building on Ben's Finite library, we show inequality of types with different cardinalities.

Type cardinality is defined in terms of an isomorphism (Iso.T) between a type A and Fin.t n.

A crucial theorem with non-trivial proof is that if Fin.t n is ismorphic to Fin.t m, then n = m, which is proven by deriving a contradiction from an isomorphism from a smaller to a larger type. The inductive case is achieved by proving an injectivity of type successor (see injective_plus in finite_iso.v), using the formulation of Finite.Fin of finite types (which are proven isomorphic to Fin.t).

In analogy to the proof of Cantor's diagonalization between natural numbers and sequences (the theorem Cantor in Iso.v), we prove there is no isomorphism between a type A and its (computable) subsets A -> bool using a similar diagonalization argument (see powerset_bigger in type_neq.v).