(* ========================================================================= *)
(* Arithmetization of syntax and Tarski's theorem. *)
(* ========================================================================= *)
prioritize_num();;
(* ------------------------------------------------------------------------- *)
(* This is to fake the fact that we might really be using strings. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Arithmetization. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Injectivity. *)
(* ------------------------------------------------------------------------- *)
let GTERM_INJ = prove
(`!s t. (
gterm s =
gterm t) <=> (s = t)`,
MATCH_MP_TAC term_INDUCT THEN REPEAT CONJ_TAC THENL
[ALL_TAC;
GEN_TAC;
GEN_TAC THEN DISCH_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC] THEN
MATCH_MP_TAC term_INDUCT THEN
ASM_REWRITE_TAC[term_DISTINCT; term_INJ;
gterm;
NPAIR_INJ;
NUMBER_INJ;
ARITH_EQ]);;
let GFORM_INJ = prove
(`!p q. (
gform p =
gform q) <=> (p = q)`,
MATCH_MP_TAC form_INDUCT THEN REPEAT CONJ_TAC THENL
[ALL_TAC;
ALL_TAC;
GEN_TAC THEN GEN_TAC;
GEN_TAC THEN GEN_TAC;
GEN_TAC THEN GEN_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC;
REPEAT GEN_TAC THEN STRIP_TAC] THEN
MATCH_MP_TAC form_INDUCT THEN
ASM_REWRITE_TAC[form_DISTINCT; form_INJ;
gform;
NPAIR_INJ;
ARITH_EQ] THEN
REWRITE_TAC[
GTERM_INJ;
NUMBER_INJ]);;
(* ------------------------------------------------------------------------- *)
(* Useful case theorems. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Definability of "godel number of numeral n". *)
(* ------------------------------------------------------------------------- *)
FV_RTC; FV_GNUMERAL1]);;
ARITH_PAIR; TERMVAL_NUMERAL] THEN
REWRITE_TAC[termval; ARITH_EQ; o_THM; valmod] THEN
MP_TAC(INST
[`(gterm o numeral)`,`fn:num->num`;
`3`,`e:num`;
`\a:num b:num. NPAIR 2 a`,`f:num->num->num`] PRIMREC_SIGMA) THEN
ANTS_TAC THENL
[REWRITE_TAC[gterm; numeral; o_THM] THEN REWRITE_TAC[NPAIR; ARITH];
SIMP_TAC[gnumeral; o_THM]]);;
FVT_PAIR; FVT_NUMERAL]);;
(* ------------------------------------------------------------------------- *)
(* Diagonal substitution. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Hence diagonalization of a predicate. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* And hence the fixed point. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Hence Tarski's theorem on the undefinability of truth. *)
(* ------------------------------------------------------------------------- *)
(* ------------------------------------------------------------------------- *)
(* Misc. stuff to sanity-check the book. *)
(* ------------------------------------------------------------------------- *)
(*****
let pairpair = new_definition
`pair(x,y) = NPAIR x y`;;
let BREAK =
rand o concl o (ONCE_REWRITE_CONV[gform; gterm] THENC
REWRITE_CONV[GSYM pairpair]);;
let tm0 = `gform(?? x (V x === k && p))`;;
let tm1 = BREAK tm0;;
let tm2 = BREAK tm1;;
let tm3 = BREAK tm2;;
let tm4 = BREAK tm3;;
******)