# HG changeset patch # User urbanc # Date 1133133943 -3600 # Node ID 734f23ad5d8f6ea94c57f1221fcc24a8c52c7a49 # Parent 5ee688e36eebfdc8fdc73737969a322dd9e43068 ISAR-fied two proofs about equality for abstraction functions. diff -r 5ee688e36eeb -r 734f23ad5d8f src/HOL/Nominal/Nominal.thy --- a/src/HOL/Nominal/Nominal.thy Sun Nov 27 20:06:24 2005 +0100 +++ b/src/HOL/Nominal/Nominal.thy Mon Nov 28 00:25:43 2005 +0100 @@ -2242,9 +2242,7 @@ by (force simp add: abs_fun_def expand_fun_eq) from a3 have "?P a = ?Q a" by (blast) hence a4: "nSome(x) = ?Q a" by simp - from a3 have "?P b = ?Q b" by (blast) - hence a5: "nSome(y) = ?P b" by simp - show ?thesis using a4 a5 + show ?thesis using a4 (*a5*) proof (cases "a\y") assume a6: "a\y" hence a7: "x = [(b,a)]\y" using a4 a1 by simp @@ -2258,6 +2256,35 @@ qed qed +lemma abs_fun_eq2: + fixes x :: "'a" + and y :: "'a" + and a :: "'x" + and b :: "'x" + assumes pt: "pt TYPE('a) TYPE('x)" + and at: "at TYPE('x)" + and a1: "a\b" + and a2: "[a].x = [b].y" + shows "x=[(a,b)]\y \ a\y" +proof - + from a2 have "\c::'x. ([a].x) c = ([b].y) c" by (force simp add: expand_fun_eq) + hence "([a].x) a = ([b].y) a" by simp + hence a3: "nSome(x) = ([b].y) a" by (simp add: abs_fun_def) + show "x=[(a,b)]\y \ a\y" + proof (cases "a\y") + assume a4: "a\y" + hence "x=[(b,a)]\y" using a3 a1 by (simp add: abs_fun_def) + moreover + have "[(a,b)]\y = [(b,a)]\y" by (rule pt3[OF pt], rule at_ds5[OF at]) + ultimately show ?thesis using a4 by simp + next + assume "\a\y" + hence "nSome(x) = nNone" using a1 a3 by (simp add: abs_fun_def) + hence False by simp + thus ?thesis by simp + qed +qed + lemma abs_fun_eq3: fixes x :: "'a" and y :: "'a" @@ -2270,32 +2297,54 @@ and a3: "a\y" shows "[a].x =[b].y" proof - - show ?thesis using a1 a2 a3 - apply(auto simp add: abs_fun_def) - apply(simp only: expand_fun_eq) - apply(rule allI) - apply(case_tac "x=a") - apply(simp) - apply(rule pt3[OF pt], rule at_ds5[OF at]) - apply(case_tac "x=b") - apply(simp add: pt_swap_bij[OF pt, OF at]) - apply(simp add: at_calc[OF at] at_bij[OF at] pt_fresh_left[OF pt, OF at]) - apply(simp only: if_False) - apply(simp add: at_calc[OF at] at_bij[OF at] pt_fresh_left[OF pt, OF at]) - apply(rule impI) - apply(subgoal_tac "[(a,x)]\([(a,b)]\y) = [(b,x)]\([(a,x)]\y)")(*A*) - apply(simp) - apply(simp only: pt_bij[OF pt, OF at]) - apply(rule pt_fresh_fresh[OF pt, OF at]) - apply(assumption)+ - (*A*) - apply(simp only: pt2[OF pt, symmetric]) - apply(rule pt3[OF pt]) - apply(simp, rule at_ds6[OF at]) - apply(force) - done + show ?thesis + proof (simp only: abs_fun_def expand_fun_eq, intro strip) + fix c::"'x" + let ?LHS = "if c=a then nSome(x) else if c\x then nSome([(a,c)]\x) else nNone" + and ?RHS = "if c=b then nSome(y) else if c\y then nSome([(b,c)]\y) else nNone" + show "?LHS=?RHS" + proof - + have "(c=a) \ (c=b) \ (c\a \ c\b)" by blast + moreover --"case c=a" + { have "nSome(x) = nSome([(a,b)]\y)" using a2 by simp + also have "\ = nSome([(b,a)]\y)" by (simp, rule pt3[OF pt], rule at_ds5[OF at]) + finally have "nSome(x) = nSome([(b,a)]\y)" by simp + moreover + assume "c=a" + ultimately have "?LHS=?RHS" using a1 a3 by simp + } + moreover -- "case c=b" + { have a4: "y=[(a,b)]\x" using a2 by (simp only: pt_swap_bij[OF pt, OF at]) + hence "a\([(a,b)]\x)" using a3 by simp + hence "b\x" by (simp add: at_calc[OF at] pt_fresh_left[OF pt, OF at]) + moreover + assume "c=b" + ultimately have "?LHS=?RHS" using a1 a4 by simp + } + moreover -- "case c\a \ c\b" + { assume a5: "c\a \ c\b" + moreover + have "c\x = c\y" using a2 a5 by (force simp add: at_calc[OF at] pt_fresh_left[OF pt, OF at]) + moreover + have "c\y \ [(a,c)]\x = [(b,c)]\y" + proof (intro strip) + assume a6: "c\y" + have "[(a,c),(b,c),(a,c)] \ [(a,b)]" using a1 a5 by (force intro: at_ds3[OF at]) + hence "[(a,c)]\([(b,c)]\([(a,c)]\y)) = [(a,b)]\y" + by (simp add: pt2[OF pt, symmetric] pt3[OF pt]) + hence "[(a,c)]\([(b,c)]\y) = [(a,b)]\y" using a3 a6 + by (simp add: pt_fresh_fresh[OF pt, OF at]) + hence "[(a,c)]\([(b,c)]\y) = x" using a2 by simp + hence "[(b,c)]\y = [(a,c)]\x" by (drule_tac pt_bij1[OF pt, OF at], simp) + thus "[(a,c)]\x = [(b,c)]\y" by simp + qed + ultimately have "?LHS=?RHS" by simp + } + ultimately show "?LHS = ?RHS" by blast + qed qed - +qed + lemma abs_fun_eq: fixes x :: "'a" and y :: "'a"