added a more general lemma fro fundef_ex1
authorChristian Urban <urbanc@in.tum.de>
Sun, 05 Jun 2011 16:58:18 +0100
changeset 2818 8fe80e9f796d
parent 2817 2f5ce0ecbf31
child 2819 4bd584ff4fab
added a more general lemma fro fundef_ex1
Nominal/Nominal2_Base.thy
--- a/Nominal/Nominal2_Base.thy	Sat Jun 04 14:50:57 2011 +0900
+++ b/Nominal/Nominal2_Base.thy	Sun Jun 05 16:58:18 2011 +0100
@@ -1696,6 +1696,11 @@
 
 subsection {* helper functions for nominal_functions *}
 
+lemma THE_defaultI2:
+  assumes "P a" "\<exists>!x. P x" "\<And>x. P x \<Longrightarrow> Q x"
+  shows "Q (THE_default d P)"
+by (iprover intro: assms THE_defaultI')
+
 lemma the_default_eqvt:
   assumes unique: "\<exists>!x. P x"
   shows "(p \<bullet> (THE_default d P)) = (THE_default d (p \<bullet> P))"
@@ -1733,6 +1738,23 @@
   using assms
   by (auto intro: fundef_ex1_eqvt)
 
+(* fixme: polish *)
+lemma fundef_ex1_prop:
+  fixes x::"'a::pt"
+  assumes f_def: "f == (\<lambda>x::'a. THE_default d (G x))"
+  assumes P_all: "\<And>y. G x y \<Longrightarrow> P y"
+  assumes ex1: "\<exists>!y. G x y"
+  shows "P (f x)"
+  unfolding f_def
+  using ex1
+  apply(erule_tac ex1E)
+  apply(rule THE_defaultI2)
+  apply(assumption)
+  apply(blast)
+  apply(rule P_all)
+  apply(assumption)
+  done
+
 
 section {* Support of Finite Sets of Finitely Supported Elements *}