(* ========================================================================= *)
(* Cantor's theorem. *)
(* ========================================================================= *)
(* ------------------------------------------------------------------------- *)
(* Ad hoc version for whole type. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Proper version for any set, in terms of cardinality operators. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* More explicit "injective" version as in Paul Taylor's book. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Another sequence of versions (Lawvere, Cantor, Taylor) taken from *)
(* http://ncatlab.org/nlab/show/Cantor%27s+theorem. *)
(* ------------------------------------------------------------------------- *)
let CANTOR_LAWVERE = prove
(`!h:A->(A->B).
(!f:A->B. ?x:A. h(x) = f) ==> !n:B->B. ?x. n(x) = x`,
REPEAT STRIP_TAC THEN
ABBREV_TAC `g:A->B = \a. (n:B->B) (h a a)` THEN
RULE_ASSUM_TAC(REWRITE_RULE[
FUN_EQ_THM]) THEN
ASM_MESON_TAC[]);;
let CANTOR = prove
(`!f:A->(A->bool). ~(!s. ?x. f x = s)`,
GEN_TAC THEN DISCH_THEN(MP_TAC o MATCH_MP
CANTOR_LAWVERE) THEN
DISCH_THEN(MP_TAC o SPEC `(~)`) THEN MESON_TAC[]);;