fact
stringlengths
5
2k
type
stringclasses
22 values
library
stringclasses
1 value
imports
listlengths
0
15.1k
filename
stringlengths
13
83
symbolic_name
stringlengths
1
82
docstring
stringclasses
1 value
Int_greatest : "\<lbrakk>C<=A; C<=B\<rbrakk> \<Longrightarrow> C <= A Int B" by (blast intro: subsetI IntI dest: subsetD)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_greatest
monoI : "(\<And>A B. A <= B \<Longrightarrow> f(A) <= f(B)) \<Longrightarrow> mono(f)" unfolding mono_def by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
monoI
monoD : "\<lbrakk>mono(f); A <= B\<rbrakk> \<Longrightarrow> f(A) <= f(B)" unfolding mono_def by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
monoD
mono_Un : "mono(f) \<Longrightarrow> f(A) Un f(B) <= f(A Un B)" by (blast intro: Un_least dest: monoD intro: Un_upper1 Un_upper2)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
mono_Un
mono_Int : "mono(f) \<Longrightarrow> f(A Int B) <= f(A) Int f(B)" by (blast intro: Int_greatest dest: monoD intro: Int_lower1 Int_lower2)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
mono_Int
mem_rews : "(a : A Un B) \<longleftrightarrow> (a:A | a:B)" "(a : A Int B) \<longleftrightarrow> (a:A \<and> a:B)" "(a : Compl(B)) \<longleftrightarrow> (\<not>a:B)" "(a : {b}) \<longleftrightarrow> (a=b)" "(a : {}) \<longleftrightarrow> False" "(a : {x. P(x)}) \<longleftrightarrow> P(a)" by blast+ lemmas [simp] = trivial_set empty_eq mem_rews and [cong] = ball_cong bex_cong INT_cong UN_cong
lemma
src
[ "FOL" ]
src/CCL/Set.thy
mem_rews
Int_absorb : "A Int A = A" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_absorb
Int_commute : "A Int B = B Int A" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_commute
Int_assoc : "(A Int B) Int C = A Int (B Int C)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_assoc
Int_Un_distrib : "(A Un B) Int C = (A Int C) Un (B Int C)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_Un_distrib
subset_Int_eq : "(A<=B) \<longleftrightarrow> (A Int B = A)" by (blast intro: equalityI elim: equalityE)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
subset_Int_eq
Un_absorb : "A Un A = A" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_absorb
Un_commute : "A Un B = B Un A" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_commute
Un_assoc : "(A Un B) Un C = A Un (B Un C)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_assoc
Un_Int_distrib : "(A Int B) Un C = (A Un C) Int (B Un C)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_Int_distrib
Un_Int_crazy : "(A Int B) Un (B Int C) Un (C Int A) = (A Un B) Int (B Un C) Int (C Un A)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_Int_crazy
subset_Un_eq : "(A<=B) \<longleftrightarrow> (A Un B = B)" by (blast intro: equalityI elim: equalityE)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
subset_Un_eq
Compl_disjoint : "A Int Compl(A) = {x. False}" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_disjoint
Compl_partition : "A Un Compl(A) = {x. True}" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_partition
double_complement : "Compl(Compl(A)) = A" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
double_complement
Compl_Un : "Compl(A Un B) = Compl(A) Int Compl(B)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_Un
Compl_Int : "Compl(A Int B) = Compl(A) Un Compl(B)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_Int
Compl_UN : "Compl(UN x:A. B(x)) = (INT x:A. Compl(B(x)))" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_UN
Compl_INT : "Compl(INT x:A. B(x)) = (UN x:A. Compl(B(x)))" by (blast intro: equalityI) (*Halmos, Naive Set Theory, page 16.*)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_INT
Un_Int_assoc_eq : "((A Int B) Un C = A Int (B Un C)) \<longleftrightarrow> (C<=A)" by (blast intro: equalityI elim: equalityE)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_Int_assoc_eq
Union_Un_distrib : "Union(A Un B) = Union(A) Un Union(B)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Union_Un_distrib
Union_disjoint : "(Union(C) Int A = {x. False}) \<longleftrightarrow> (ALL B:C. B Int A = {x. False})" by (blast intro: equalityI elim: equalityE)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Union_disjoint
Inter_Un_distrib : "Inter(A Un B) = Inter(A) Int Inter(B)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Inter_Un_distrib
UN_eq : "(UN x:A. B(x)) = Union({Y. EX x:A. Y=B(x)})" by (blast intro: equalityI) (*Look: it has an EXISTENTIAL quantifier*)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
UN_eq
INT_eq : "(INT x:A. B(x)) = Inter({Y. EX x:A. Y=B(x)})" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
INT_eq
Int_Union_image : "A Int Union(B) = (UN C:B. A Int C)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_Union_image
Un_Inter_image : "A Un Inter(B) = (INT C:B. A Un C)" by (blast intro: equalityI)
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_Inter_image
Union_mono : "A<=B \<Longrightarrow> Union(A) <= Union(B)" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Union_mono
Inter_anti_mono : "B <= A \<Longrightarrow> Inter(A) <= Inter(B)" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Inter_anti_mono
UN_mono : "\<lbrakk>A <= B; \<And>x. x:A \<Longrightarrow> f(x)<=g(x)\<rbrakk> \<Longrightarrow> (UN x:A. f(x)) <= (UN x:B. g(x))" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
UN_mono
INT_anti_mono : "\<lbrakk>B <= A; \<And>x. x:A \<Longrightarrow> f(x) <= g(x)\<rbrakk> \<Longrightarrow> (INT x:A. f(x)) <= (INT x:A. g(x))" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
INT_anti_mono
Un_mono : "\<lbrakk>A <= C; B <= D\<rbrakk> \<Longrightarrow> A Un B <= C Un D" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Un_mono
Int_mono : "\<lbrakk>A <= C; B <= D\<rbrakk> \<Longrightarrow> A Int B <= C Int D" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Int_mono
Compl_anti_mono : "A <= B \<Longrightarrow> Compl(B) <= Compl(A)" by blast
lemma
src
[ "FOL" ]
src/CCL/Set.thy
Compl_anti_mono
one :: "i" where "one == true"
definition
src
[ "CCL" ]
src/CCL/Term.thy
one
inl :: "i\<Rightarrow>i" where "inl(a) == <true,a>"
definition
src
[ "CCL" ]
src/CCL/Term.thy
inl
inr :: "i\<Rightarrow>i" where "inr(b) == <false,b>"
definition
src
[ "CCL" ]
src/CCL/Term.thy
inr
split :: "[i,[i,i]\<Rightarrow>i]\<Rightarrow>i" where "split(t,f) == case(t, bot, bot, f, \<lambda>u. bot)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
split
fst :: "i\<Rightarrow>i" where "fst(t) == split(t, \<lambda>x y. x)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
fst
snd :: "i\<Rightarrow>i" where "snd(t) == split(t, \<lambda>x y. y)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
snd
thd :: "i\<Rightarrow>i" where "thd(t) == split(t, \<lambda>x p. split(p, \<lambda>y z. z))"
definition
src
[ "CCL" ]
src/CCL/Term.thy
thd
zero :: "i" where "zero == inl(one)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
zero
succ :: "i\<Rightarrow>i" where "succ(n) == inr(n)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
succ
ncase :: "[i,i,i\<Rightarrow>i]\<Rightarrow>i" where "ncase(n,b,c) == when(n, \<lambda>x. b, \<lambda>y. c(y))"
definition
src
[ "CCL" ]
src/CCL/Term.thy
ncase
letrec :: "[[i,i\<Rightarrow>i]\<Rightarrow>i,(i\<Rightarrow>i)\<Rightarrow>i]\<Rightarrow>i" where "letrec(h, b) == b(\<lambda>x. fix(\<lambda>f. lam x. h(x,\<lambda>y. f`y))`x)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
letrec
letrec2 :: "[[i,i,i\<Rightarrow>i\<Rightarrow>i]\<Rightarrow>i,(i\<Rightarrow>i\<Rightarrow>i)\<Rightarrow>i]\<Rightarrow>i" where "letrec2 (h, f) == letrec (\<lambda>p g'. split(p,\<lambda>x y. h(x,y,\<lambda>u v. g'(<u,v>))), \<lambda>g'. f(\<lambda>x y. g'(<x,y>)))"
definition
src
[ "CCL" ]
src/CCL/Term.thy
letrec2
letrec3 :: "[[i,i,i,i\<Rightarrow>i\<Rightarrow>i\<Rightarrow>i]\<Rightarrow>i,(i\<Rightarrow>i\<Rightarrow>i\<Rightarrow>i)\<Rightarrow>i]\<Rightarrow>i" where "letrec3 (h, f) == letrec (\<lambda>p g'. split(p,\<lambda>x xs. split(xs,\<lambda>y z. h(x,y,z,\<lambda>u v w. g'(<u,<v,w>>)))), \<lambda>g'. f(\<lambda>x y z. g'(<x,<y,z>>)))" syntax "_letrec" :: "[idt,idt,i,i]\<Rightarrow>i" (\<open>(\<open>indent=3 notation=\<open>mixfix letrec be in\<close>\<close>letrec _ _ be _/ in _)\<close> [0,0,0,60] 60) "_letrec2" :: "[idt,idt,idt,i,i]\<Rightarrow>i" (\<open>(\<open>indent=3 notation=\<open>mixfix letrec be in\<close>\<close>letrec _ _ _ be _/ in _)\<close> [0,0,0,0,60] 60) "_letrec3" :: "[idt,idt,idt,idt,i,i]\<Rightarrow>i" (\<open>(\<open>indent=3 notation=\<open>mixfix letrec be in\<close>\<close>letrec _ _ _ _ be _/ in _)\<close> [0,0,0,0,0,60] 60) syntax_consts "_letrec" == letrec and "_letrec2" == letrec2 and "_letrec3" == letrec3 parse_translation \<open> let
definition
src
[ "CCL" ]
src/CCL/Term.thy
letrec3
nrec :: "[i,i,[i,i]\<Rightarrow>i]\<Rightarrow>i" where "nrec(n,b,c) == letrec g x be ncase(x, b, \<lambda>y. c(y,g(y))) in g(n)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
nrec
nil :: "i" (\<open>[]\<close>) where "[] == inl(one)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
nil
cons :: "[i,i]\<Rightarrow>i" (infixr \<open>$\<close> 80) where "h$t == inr(<h,t>)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
cons
lcase :: "[i,i,[i,i]\<Rightarrow>i]\<Rightarrow>i" where "lcase(l,b,c) == when(l, \<lambda>x. b, \<lambda>y. split(y,c))"
definition
src
[ "CCL" ]
src/CCL/Term.thy
lcase
lrec :: "[i,i,[i,i,i]\<Rightarrow>i]\<Rightarrow>i" where "lrec(l,b,c) == letrec g x be lcase(x, b, \<lambda>h t. c(h,t,g(t))) in g(l)"
definition
src
[ "CCL" ]
src/CCL/Term.thy
lrec
napply :: "[i\<Rightarrow>i,i,i]\<Rightarrow>i" (\<open>(\<open>notation=\<open>mixfix napply\<close>\<close>_ ^ _ ` _)\<close> [56,56,56] 56) where "f ^n` a == nrec(n,a,\<lambda>x g. f(g))" lemmas simp_can_defs = one_def inl_def inr_def and simp_ncan_defs = if_def when_def split_def fst_def snd_def thd_def lemmas simp_defs = simp_can_defs simp_ncan_defs lemmas ind_can_defs = zero_def succ_def nil_def cons_def and ind_ncan_defs = ncase_def nrec_def lcase_def lrec_def lemmas ind_defs = ind_can_defs ind_ncan_defs lemmas data_defs = simp_defs ind_defs napply_def and genrec_defs = letrec_def letrec2_def letrec3_def
definition
src
[ "CCL" ]
src/CCL/Term.thy
napply
letB : "\<not> t=bot \<Longrightarrow> let x be t in f(x) = f(t)" apply (unfold let_def) apply (erule rev_mp) apply (rule_tac t = "t" in term_case) apply simp_all done
lemma
src
[ "CCL" ]
src/CCL/Term.thy
letB
letBabot : "let x be bot in f(x) = bot" unfolding let_def by (rule caseBbot)
lemma
src
[ "CCL" ]
src/CCL/Term.thy
letBabot
letBbbot : "let x be t in bot = bot" apply (unfold let_def) apply (rule_tac t = t in term_case) apply (rule caseBbot) apply simp_all done
lemma
src
[ "CCL" ]
src/CCL/Term.thy
letBbbot
applyB : "(lam x. b(x)) ` a = b(a)" by (simp add: apply_def)
lemma
src
[ "CCL" ]
src/CCL/Term.thy
applyB
applyBbot : "bot ` a = bot" unfolding apply_def by (rule caseBbot)
lemma
src
[ "CCL" ]
src/CCL/Term.thy
applyBbot
fixB : "fix(f) = f(fix(f))" apply (unfold fix_def) apply (rule applyB [THEN ssubst], rule refl) done
lemma
src
[ "CCL" ]
src/CCL/Term.thy
fixB
letrecB : "letrec g x be h(x,g) in g(a) = h(a,\<lambda>y. letrec g x be h(x,g) in g(y))" apply (unfold letrec_def) apply (rule fixB [THEN ssubst], rule applyB [THEN ssubst], rule refl) done lemmas rawBs = caseBs applyB applyBbot method_setup beta_rl = \<open> Scan.succeed (fn ctxt => let val ctxt' = ctxt |> Context_Position.set_visible false |> Simplifier.add_simps @{thms rawBs} |> Simplifier.set_loop (fn _ => stac ctxt @{thm letrecB}); in SIMPLE_METHOD' (CHANGED o simp_tac ctxt') end) \<close>
lemma
src
[ "CCL" ]
src/CCL/Term.thy
letrecB
ifBtrue : "if true then t else u = t" and ifBfalse: "if false then t else u = u" and ifBbot: "if bot then t else u = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
ifBtrue
whenBinl : "when(inl(a),t,u) = t(a)" and whenBinr: "when(inr(a),t,u) = u(a)" and whenBbot: "when(bot,t,u) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
whenBinl
splitB : "split(<a,b>,h) = h(a,b)" and splitBbot: "split(bot,h) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
splitB
fstB : "fst(<a,b>) = a" and fstBbot: "fst(bot) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
fstB
sndB : "snd(<a,b>) = b" and sndBbot: "snd(bot) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
sndB
thdB : "thd(<a,<b,c>>) = c" and thdBbot: "thd(bot) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
thdB
ncaseBzero : "ncase(zero,t,u) = t" and ncaseBsucc: "ncase(succ(n),t,u) = u(n)" and ncaseBbot: "ncase(bot,t,u) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
ncaseBzero
nrecBzero : "nrec(zero,t,u) = t" and nrecBsucc: "nrec(succ(n),t,u) = u(n,nrec(n,t,u))" and nrecBbot: "nrec(bot,t,u) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
nrecBzero
lcaseBnil : "lcase([],t,u) = t" and lcaseBcons: "lcase(x$xs,t,u) = u(x,xs)" and lcaseBbot: "lcase(bot,t,u) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
lcaseBnil
lrecBnil : "lrec([],t,u) = t" and lrecBcons: "lrec(x$xs,t,u) = u(x,xs,lrec(xs,t,u))" and lrecBbot: "lrec(bot,t,u) = bot" unfolding data_defs by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
lrecBnil
letrec2B : "letrec g x y be h(x,y,g) in g(p,q) = h(p,q,\<lambda>u v. letrec g x y be h(x,y,g) in g(u,v))" unfolding data_defs letrec2_def by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
letrec2B
letrec3B : "letrec g x y z be h(x,y,z,g) in g(p,q,r) = h(p,q,r,\<lambda>u v w. letrec g x y z be h(x,y,z,g) in g(u,v,w))" unfolding data_defs letrec3_def by beta_rl+
lemma
src
[ "CCL" ]
src/CCL/Term.thy
letrec3B
napplyBzero : "f^zero`a = a" and napplyBsucc: "f^succ(n)`a = f(f^n`a)" unfolding data_defs by beta_rl+ lemmas termBs = letB applyB applyBbot splitB splitBbot fstB fstBbot sndB sndBbot thdB thdBbot ifBtrue ifBfalse ifBbot whenBinl whenBinr whenBbot ncaseBzero ncaseBsucc ncaseBbot nrecBzero nrecBsucc nrecBbot lcaseBnil lcaseBcons lcaseBbot lrecBnil lrecBcons lrecBbot napplyBzero napplyBsucc
lemma
src
[ "CCL" ]
src/CCL/Term.thy
napplyBzero
term_injs : "(inl(a) = inl(a')) \<longleftrightarrow> (a=a')" "(inr(a) = inr(a')) \<longleftrightarrow> (a=a')" "(succ(a) = succ(a')) \<longleftrightarrow> (a=a')" "(a$b = a'$b') \<longleftrightarrow> (a=a' \<and> b=b')" by (inj_rl applyB splitB whenBinl whenBinr ncaseBsucc lcaseBcons)
lemma
src
[ "CCL" ]
src/CCL/Term.thy
term_injs
term_porews : "inl(a) [= inl(a') \<longleftrightarrow> a [= a'" "inr(b) [= inr(b') \<longleftrightarrow> b [= b'" "succ(n) [= succ(n') \<longleftrightarrow> n [= n'" "x$xs [= x'$xs' \<longleftrightarrow> x [= x' \<and> xs [= xs'" by (simp_all add: data_defs ccl_porews)
lemma
src
[ "CCL" ]
src/CCL/Term.thy
term_porews
trans :: "i set \<Rightarrow> o" (*transitivity predicate*) where "trans(r) == (ALL x y z. <x,y>:r \<longrightarrow> <y,z>:r \<longrightarrow> <x,z>:r)"
definition
src
[ "CCL" ]
src/CCL/Trancl.thy
trans
id :: "i set" (*the identity relation*) where "id == {p. EX x. p = <x,x>}"
definition
src
[ "CCL" ]
src/CCL/Trancl.thy
id
relcomp :: "[i set,i set] \<Rightarrow> i set" (infixr \<open>O\<close> 60) (*composition of relations*) where "r O s == {xz. EX x y z. xz = <x,z> \<and> <x,y>:s \<and> <y,z>:r}"
definition
src
[ "CCL" ]
src/CCL/Trancl.thy
relcomp
rtrancl :: "i set \<Rightarrow> i set" (\<open>(\<open>notation=\<open>postfix ^*\<close>\<close>_^*)\<close> [100] 100) where "r^* == lfp(\<lambda>s. id Un (r O s))"
definition
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl
trancl :: "i set \<Rightarrow> i set" (\<open>(\<open>notation=\<open>postfix ^+\<close>\<close>_^+)\<close> [100] 100) where "r^+ == r O rtrancl(r)"
definition
src
[ "CCL" ]
src/CCL/Trancl.thy
trancl
transI : "(\<And>x y z. \<lbrakk><x,y>:r; <y,z>:r\<rbrakk> \<Longrightarrow> <x,z>:r) \<Longrightarrow> trans(r)" unfolding trans_def by blast
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
transI
transD : "\<lbrakk>trans(r); <a,b>:r; <b,c>:r\<rbrakk> \<Longrightarrow> <a,c>:r" unfolding trans_def by blast
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
transD
idI : "<a,a> : id" apply (unfold id_def) apply (rule CollectI) apply (rule exI) apply (rule refl) done
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
idI
idE : "\<lbrakk>p: id; \<And>x. p = <x,x> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P" apply (unfold id_def) apply (erule CollectE) apply blast done
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
idE
compI : "\<lbrakk><a,b>:s; <b,c>:r\<rbrakk> \<Longrightarrow> <a,c> : r O s" unfolding relcomp_def by blast (*proof requires higher-level assumptions or a delaying of hyp_subst_tac*)
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
compI
compE : "\<lbrakk>xz : r O s; \<And>x y z. \<lbrakk>xz = <x,z>; <x,y>:s; <y,z>:r\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P" unfolding relcomp_def by blast
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
compE
compEpair : "\<lbrakk><a,c> : r O s; \<And>y. \<lbrakk><a,y>:s; <y,c>:r\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P" apply (erule compE) apply (simp add: pair_inject) done lemmas [intro] = compI idI and [elim] = compE idE
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
compEpair
comp_mono : "\<lbrakk>r'<=r; s'<=s\<rbrakk> \<Longrightarrow> (r' O s') <= (r O s)" by blast
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
comp_mono
rtrancl_fun_mono : "mono(\<lambda>s. id Un (r O s))" apply (rule monoI) apply (rule monoI subset_refl comp_mono Un_mono)+ apply assumption done
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl_fun_mono
rtrancl_unfold : "r^* = id Un (r O r^*)" by (rule rtrancl_fun_mono [THEN rtrancl_def [THEN def_lfp_Tarski]]) (*Reflexivity of rtrancl*)
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl_unfold
rtrancl_refl : "<a,a> : r^*" apply (subst rtrancl_unfold) apply blast done (*Closure under composition with r*)
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl_refl
rtrancl_into_rtrancl : "\<lbrakk><a,b> : r^*; <b,c> : r\<rbrakk> \<Longrightarrow> <a,c> : r^*" apply (subst rtrancl_unfold) apply blast done (*rtrancl of r contains r*)
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl_into_rtrancl
r_into_rtrancl : "<a,b> : r \<Longrightarrow> <a,b> : r^*" apply (rule rtrancl_refl [THEN rtrancl_into_rtrancl]) apply assumption done
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
r_into_rtrancl
rtrancl_full_induct : "\<lbrakk><a,b> : r^*; \<And>x. P(<x,x>); \<And>x y z. \<lbrakk>P(<x,y>); <x,y>: r^*; <y,z>: r\<rbrakk> \<Longrightarrow> P(<x,z>)\<rbrakk> \<Longrightarrow> P(<a,b>)" apply (erule def_induct [OF rtrancl_def]) apply (rule rtrancl_fun_mono) apply blast done (*nice induction rule*)
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl_full_induct
rtrancl_induct : "\<lbrakk><a,b> : r^*; P(a); \<And>y z. \<lbrakk><a,y> : r^*; <y,z> : r; P(y)\<rbrakk> \<Longrightarrow> P(z) \<rbrakk> \<Longrightarrow> P(b)" (*by induction on this formula*) apply (subgoal_tac "ALL y. <a,b> = <a,y> \<longrightarrow> P(y)") (*now solve first subgoal: this formula is sufficient*) apply blast (*now do the induction*) apply (erule rtrancl_full_induct) apply blast apply blast done (*transitivity of transitive closure!! -- by induction.*)
lemma
src
[ "CCL" ]
src/CCL/Trancl.thy
rtrancl_induct