# HG changeset patch # User urbanc # Date 1133694867 -3600 # Node ID d37fb71754fe4ca2be4712d366a6b8fea5b916d2 # Parent 95083a68cbbb2046c008102604e81ce10bd78311 added an Isar-proof for the abs_ALL lemma diff -r 95083a68cbbb -r d37fb71754fe src/HOL/Nominal/Examples/SN.thy --- a/src/HOL/Nominal/Examples/SN.thy Sun Dec 04 12:14:03 2005 +0100 +++ b/src/HOL/Nominal/Examples/SN.thy Sun Dec 04 12:14:27 2005 +0100 @@ -836,7 +836,7 @@ apply(auto simp add: fresh_prod fresh_list_cons) done -lemma psubs_subs[rule_format]: "c\\\ (t[<\>])[c::=s] = t[<((c,s)#\)>]" +lemma psubst_subst[rule_format]: "c\\\ (t[<\>])[c::=s] = t[<((c,s)#\)>]" apply(nominal_induct t avoiding: \ c s rule: lam_induct) apply(auto dest: fresh_domain) apply(drule fresh_at) @@ -849,148 +849,42 @@ apply(simp add: fresh_list_cons fresh_prod) done +thm fresh_context + lemma all_RED: - "\\t:\ \ (\a \. (a,\)\set(\)\(a\set(domain \)\\\RED \)) \ (t[<\>]\RED \)" + assumes a: "\\t:\" + and b: "\a \. (a,\)\set(\) \ (a\set(domain \)\\\RED \)" + shows "t[<\>]\RED \" +using a b +proof(nominal_induct t avoiding: \ \ \ rule: lam_induct) + case (Lam a t) --"lambda case" + have ih: "\\ \ \. \ \ t:\ \ + (\c \. (c,\)\set \ \ c\set (domain \) \ \\RED \) + \ t[<\>]\RED \" + and \_cond: "\c \. (c,\)\set \ \ c\set (domain \) \ \\RED \" + and fresh: "a\\" "a\\" + and "\ \ Lam [a].t:\" by fact + hence "\\1 \2. \=\1\\2 \ ((a,\1)#\)\t:\2" using t3_elim fresh by simp + then obtain \1 \2 where \_inst: "\=\1\\2" and typing: "((a,\1)#\)\t:\2" by blast + from ih have "\s\RED \1. t[<\>][a::=s] \ RED \2" using fresh typing \_cond + by (force dest: fresh_context simp add: psubst_subst) + hence "(Lam [a].(t[<\>])) \ RED (\1 \ \2)" by (simp only: abs_RED) + thus "(Lam [a].t)[<\>] \ RED \" using fresh \_inst by simp +qed (force dest!: t1_elim t2_elim)+ + +lemma all_RED: + assumes a: "\\t:\" + and b: "\a \. (a,\)\set(\) \ (a\set(domain \)\\\RED \)" + shows "t[<\>]\RED \" +using a b apply(nominal_induct t avoiding: \ \ \ rule: lam_induct) (* Variables *) apply(force dest: t1_elim) (* Applications *) apply(atomize) apply(force dest!: t2_elim) -(* Abstractions *) -apply(auto dest!: t3_elim simp only:) -apply(simp only: fresh_prod psubst_Lam) +(* Abstractions *) +apply(auto dest!: t3_elim simp only: psubst_Lam) apply(rule abs_RED[THEN mp]) apply(force dest: fresh_context simp add: psubs_subs) -done - -lemma all_RED: - "\\t:\ \ (\a \. (a,\)\set(\)\(a\set(domain \)\\\RED \)) \ (t[<\>]\RED \)" -apply(nominal_induct t avoiding: \ \ \ rule: lam_induct) -(* Variables *) -apply(force dest: t1_elim) -(* Applications *) -apply(atomize) -apply(clarify) -apply(drule t2_elim) -apply(erule exE, erule conjE) -apply(drule_tac x="\" in spec) -apply(drule_tac x="\" in spec) -apply(drule_tac x="\'\\" in spec) -apply(drule_tac x="\'" in spec) -apply(drule_tac x="\" in spec) -apply(drule_tac x="\" in spec) -apply(force) -(* Abstractions *) -apply(clarify) -apply(drule t3_elim) -apply(simp add: fresh_prod) -apply(erule exE)+ -apply(erule conjE) -apply(simp only: fresh_prod psubst_Lam) -apply(rule abs_RED[THEN mp]) -apply(clarify) -apply(atomize) -apply(force dest: fresh_context simp add: psubs_subs) -done - - -lemma all_RED: - "\\t:\ \ (\a \. (a,\)\set(\)\(a\set(domain \)\\\RED \)) \ (t[<\>]\RED \)" -proof(nominal_induct t rule: lam_induct) - case Var - show ?case by (force dest: t1_elim) -next - case App - thus ?case by (force dest!: t2_elim) -(* HERE *) -next - case (Lam \ \ \ a t) - have ih: - "\\ \ \. (\\ c. (c,\)\set \ \ c\set (domain \) \ \\RED \) \ \ \ t : \ \ t[<\>]\RED \" - by fact - have "a\(\,\,\)" by fact - hence b1: "a\\" and b2: "a\\" and b3: "a\\" by (simp_all add: fresh_prod) - from b1 have c1: "\(\\. (a,\)\set \)" by (rule fresh_context) - show ?case using b1 - proof (auto dest!: t3_elim simp only: psubst_Lam) - fix \1::"ty" and \2::"ty" - assume a1: "((a,\1)#\) \ t : \2" - and a3: "\(\\ty) (c\name). (c,\) \ set \ \ c \ set (domain \) \ \ \ RED \" - have "\s\RED \1. (t[<\>])[a::=s]\RED \2" - proof -(* HERE *) - - fix s::"lam" - assume a4: "s \ RED \1" - from ih have "\\ c. (c,\)\set ((a,\1)#\) \ c\set (domain ((c,s)#\)) \ (((c,s)#\))\RED \" - using c1 a4 proof (auto) -apply(simp) - apply(rule allI)+ - apply(rule conjI) - - proof (auto) *) - have "(((a,\1)#\) \ t : \2) \ t[<((a,s)#\)>] \ RED \2" using Lam a3 b3 - proof(blast dest: fresh_context) - - show "(t[<\>])[a::=s] \ RED \2" - - qed - thus "Lam [a].(t[<\>]) \ RED (\1\\2)" by (simp only: abs_RED) - qed -qed - - - - - - have "(((a,\1)#\) \ t : \2) \ t[<((a,u)#\)>] \ RED \2" using Lam a3 sorry - hence "t[<((a,u)#\)>] \ RED \2" using a1 by simp - hence "t[<\>][a::=u] \ RED \2" using b3 by (simp add: psubs_subs) - show "Lam [a].(t[<\>]) \ RED (\1\\2)" - hence "Lam [a].(t[<\>]) \ RED (\\\)" using a2 abs_RED by force - show "App (Lam [a].(t[<\>])) u \ RED \2" - - - - thus ?case using t2_elim - proof(auto, blast) - -qed - -(* Variables *) -apply(force dest: t1_elim) -(* Applications *) -apply(clarify) -apply(drule t2_elim) -apply(erule exE, erule conjE) -apply(drule_tac x="a" in spec) -apply(drule_tac x="a" in spec) -apply(drule_tac x="\\aa" in spec) -apply(drule_tac x="\" in spec) -apply(drule_tac x="b" in spec) -apply(drule_tac x="b" in spec) -apply(force) -(* Abstractions *) -apply(clarify) -apply(drule t3_elim) -apply(simp add: fresh_prod) -apply(erule exE)+ -apply(erule conjE) -apply(simp only: fresh_prod psubst_Lam) -apply(rule abs_RED) -apply(auto) -apply(drule_tac x="(ab,\)#a" in spec) -apply(drule_tac x="\'" in spec) -apply(drule_tac x="(ab,s)#b" in spec) -apply(simp) -apply(auto) -apply(drule fresh_context) -apply(simp) -apply(simp add: psubs_subs) -done - - - -done - +done \ No newline at end of file