(* Title: CCL/Hered.thy Author: Martin Coen Copyright 1993 University of Cambridge
*)
section \<open>Hereditary Termination -- cf. Martin Lo\"f\<close>
theory Hered imports Type begin
text\<open> Note that this is based on an untyped equality and so \<open>lam
x. b(x)\<close> is only hereditarily terminating if \<open>ALL x. b(x)\<close> is. Not so useful for functions! \<close>
definition HTTgen :: "i set \ i set" where "HTTgen(R) ==
{t. t=true | t=false | (EX a b. t= <a, b> \<and> a : R \<and> b : R) |
(EX f. t = lam x. f(x) \<and> (ALL x. f(x) : R))}"
definition HTT :: "i set" where"HTT == gfp(HTTgen)"
lemma HTTgenXH: "t : HTTgen(A) \ t=true | t=false | (EX a b. t= \ a : A \ b : A) |
(EX f. t=lam x. f(x) \<and> (ALL x. f(x) : A))" apply (unfold HTTgen_def) apply blast done
lemma HTTXH: "t : HTT \ t=true | t=false | (EX a b. t= \ a : HTT \ b : HTT) |
(EX f. t=lam x. f(x) \<and> (ALL x. f(x) : HTT))" apply (rule HTTgen_mono [THEN HTT_def [THEN def_gfp_Tarski], THEN XHlemma1, unfolded HTTgen_def]) apply blast done
subsection \<open>Introduction Rules for HTT\<close>
lemma HTT_rews2: "one : HTT" "inl(a) : HTT \ a : HTT" "inr(b) : HTT \ b : HTT" "zero : HTT" "succ(n) : HTT \ n : HTT" "[] : HTT" "x$xs : HTT \ x : HTT \ xs : HTT" by (simp_all add: data_defs HTT_rews1)
lemmas HTT_rews = HTT_rews1 HTT_rews2
subsection \<open>Coinduction for HTT\<close>
lemma HTT_coinduct: "\t : R; R <= HTTgen(R)\ \ t : HTT" apply (erule HTT_def [THEN def_coinduct]) apply assumption done
lemma HTT_coinduct3: "\t : R; R <= HTTgen(lfp(\x. HTTgen(x) Un R Un HTT))\ \ t : HTT" apply (erule HTTgen_mono [THEN [3] HTT_def [THEN def_coinduct3]]) apply assumption done
lemma HTTgenIs: "true : HTTgen(R)" "false : HTTgen(R)" "\a : R; b : R\ \ : HTTgen(R)" "\b. (\x. b(x) : R) \ lam x. b(x) : HTTgen(R)" "one : HTTgen(R)" "a : lfp(\x. HTTgen(x) Un R Un HTT) \ inl(a) : HTTgen(lfp(\x. HTTgen(x) Un R Un HTT))" "b : lfp(\x. HTTgen(x) Un R Un HTT) \ inr(b) : HTTgen(lfp(\x. HTTgen(x) Un R Un HTT))" "zero : HTTgen(lfp(\x. HTTgen(x) Un R Un HTT))" "n : lfp(\x. HTTgen(x) Un R Un HTT) \ succ(n) : HTTgen(lfp(\x. HTTgen(x) Un R Un HTT))" "[] : HTTgen(lfp(\x. HTTgen(x) Un R Un HTT))" "\h : lfp(\x. HTTgen(x) Un R Un HTT); t : lfp(\x. HTTgen(x) Un R Un HTT)\ \
h$t : HTTgen(lfp(\<lambda>x. HTTgen(x) Un R Un HTT))" unfolding data_defs by (genIs HTTgenXH HTTgen_mono)+
subsection \<open>Formation Rules for Types\<close>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.