# HG changeset patch # User urbanc # Date 1133063960 -3600 # Node ID 7f75925498da6a0d5794f8118a74a82ab6bba21c # Parent d0fcd4d684f5d9cf541592e719af7b082998d6f1 cleaned up all examples so that they work with the current nominal-setting. diff -r d0fcd4d684f5 -r 7f75925498da src/HOL/Nominal/Examples/Fsub.thy --- a/src/HOL/Nominal/Examples/Fsub.thy Sun Nov 27 03:55:16 2005 +0100 +++ b/src/HOL/Nominal/Examples/Fsub.thy Sun Nov 27 04:59:20 2005 +0100 @@ -1,5 +1,5 @@ theory fsub -imports nominal +imports "../nominal" begin atom_decl tyvrs vrs diff -r d0fcd4d684f5 -r 7f75925498da src/HOL/Nominal/Examples/Lam_substs.thy --- a/src/HOL/Nominal/Examples/Lam_substs.thy Sun Nov 27 03:55:16 2005 +0100 +++ b/src/HOL/Nominal/Examples/Lam_substs.thy Sun Nov 27 04:59:20 2005 +0100 @@ -1433,10 +1433,10 @@ consts - "dom_sss" :: "(name\lam) list \ (name list)" + "domain" :: "(name\lam) list \ (name list)" primrec - "dom_sss [] = []" - "dom_sss (x#\) = (fst x)#(dom_sss \)" + "domain [] = []" + "domain (x#\) = (fst x)#(domain \)" consts "apply_sss" :: "(name\lam) list \ name \ lam" (" _ < _ >" [80,80] 80) @@ -1446,15 +1446,15 @@ lemma apply_sss_eqvt[rule_format]: fixes pi::"name prm" - shows "a\set (dom_sss \) \ pi\(\) = (pi\\)a>" + shows "a\set (domain \) \ pi\(\) = (pi\\)a>" apply(induct_tac \) apply(auto) apply(simp add: pt_bij[OF pt_name_inst, OF at_name_inst]) done -lemma dom_sss_eqvt[rule_format]: +lemma domain_eqvt[rule_format]: fixes pi::"name prm" - shows "((pi\a)\set (dom_sss \)) = (a\set (dom_sss ((rev pi)\\)))" + shows "((pi\a)\set (domain \)) = (a\set (domain ((rev pi)\\)))" apply(induct_tac \) apply(auto) apply(simp_all add: pt_rev_pi[OF pt_name_inst, OF at_name_inst]) @@ -1463,7 +1463,7 @@ constdefs psubst_Var :: "(name\lam) list \ name \ lam" - "psubst_Var \ \ \a. (if a\set (dom_sss \) then \ else (Var a))" + "psubst_Var \ \ \a. (if a\set (domain \) then \ else (Var a))" psubst_App :: "(name\lam) list \ lam \ lam \ lam" "psubst_App \ \ \r1 r2. App r1 r2" @@ -1476,7 +1476,7 @@ lemma supports_psubst_Var: shows "((supp \)::name set) supports (psubst_Var \)" - by (supports_simp add: psubst_Var_def apply_sss_eqvt dom_sss_eqvt) + by (supports_simp add: psubst_Var_def apply_sss_eqvt domain_eqvt) lemma supports_psubst_App: shows "((supp \)::name set) supports psubst_App \" @@ -1516,7 +1516,7 @@ done lemma psubst_Var: - shows "psubst_lam \ (Var a) = (if a\set (dom_sss \) then \ else (Var a))" + shows "psubst_lam \ (Var a) = (if a\set (domain \) then \ else (Var a))" apply(simp add: psubst_lam_def) apply(auto simp add: rfun_Var[OF fin_supp_psubst, OF fresh_psubst_Lam]) apply(auto simp add: psubst_Var_def) diff -r d0fcd4d684f5 -r 7f75925498da src/HOL/Nominal/Examples/SN.thy --- a/src/HOL/Nominal/Examples/SN.thy Sun Nov 27 03:55:16 2005 +0100 +++ b/src/HOL/Nominal/Examples/SN.thy Sun Nov 27 04:59:20 2005 +0100 @@ -1,3 +1,4 @@ +(* $Id$ *) theory sn imports lam_substs Accessible_Part @@ -790,7 +791,7 @@ apply(blast) done -lemma abs_RED[rule_format]: "(\s\RED \. t[x::=s]\RED \)\Lam [x].t\RED (\\\)" +lemma abs_RED: "(\s\RED \. t[x::=s]\RED \)\Lam [x].t\RED (\\\)" apply(simp) apply(clarify) apply(subgoal_tac "t\termi Beta")(*1*) @@ -873,13 +874,38 @@ apply(force simp add: RED_props) done +lemma fresh_domain[rule_format]: "a\\\a\set(domain \)" +apply(induct_tac \) +apply(auto simp add: fresh_prod fresh_list_cons fresh_atm) +done + +lemma fresh_at[rule_format]: "a\set(domain \) \ c\\\c\(\)" +apply(induct_tac \) +apply(auto simp add: fresh_prod fresh_list_cons) +done + +lemma psubs_subs[rule_format]: "c\\\ (t[<\>])[c::=s] = t[<((c,s)#\)>]" +apply(nominal_induct t rule: lam_induct) +apply(auto dest: fresh_domain) +apply(drule fresh_at) +apply(assumption) +apply(rule forget) +apply(assumption) +apply(subgoal_tac "ab\((aa,b)#a)")(*A*) +apply(simp add: fresh_prod) +(*A*) +apply(simp add: fresh_list_cons fresh_prod) +done + lemma all_RED: - "((\a \. (a,\)\set(\)\(a\set(dom_sss \)\\\RED \))\\\t:\) \ (t[<\>]\RED \)" + "\\t:\ \ (\a \. (a,\)\set(\)\(a\set(domain \)\\\RED \)) \ (t[<\>]\RED \)" apply(nominal_induct t rule: lam_induct) (* Variables *) apply(force dest: t1_elim) (* Applications *) -apply(auto dest!: t2_elim) +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) @@ -888,14 +914,135 @@ apply(drule_tac x="b" in spec) apply(force) (* Abstractions *) +apply(clarify) apply(drule t3_elim) apply(simp add: fresh_prod) -apply(auto) -apply(drule_tac x="((ab,\)#a)" in spec) +apply(erule exE)+ +apply(erule conjE) +apply(simp only: fresh_prod psubst_Lam) +apply(rule abs_RED[THEN mp]) +apply(clarify) +apply(drule_tac x="(ab,\)#a" in spec) apply(drule_tac x="\'" in spec) -apply(drule_tac x="b" in spec) +apply(drule_tac x="(ab,s)#b" in spec) +apply(simp (no_asm_use)) +apply(simp add: split_if) +apply(auto) +apply(drule fresh_context) +apply(simp) +apply(simp add: psubs_subs) +done + +lemma all_RED: + "\\t:\ \ (\a \. (a,\)\set(\)\(a\set(domain \)\\\RED \)) \ (t[<\>]\RED \)" +apply(nominal_induct t rule: lam_induct) +(* Variables *) +apply(force dest: t1_elim) +(* Applications *) +apply(force dest!: t2_elim) +(* Abstractions *) +apply(auto dest!: t3_elim simp only:) +apply(simp add: fresh_prod) +apply(simp only: fresh_prod 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 \)" +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) -(* HERE *) + 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