src/HOL/UNITY/WFair.thy
changeset 67613 ce654b0e6d69
parent 67443 3abf6a722518
child 69597 ff784d5a5bfb
equal deleted inserted replaced
67610:4939494ed791 67613:ce654b0e6d69
    89 apply (unfold transient_def, clarify)
    89 apply (unfold transient_def, clarify)
    90 apply (blast intro!: rev_bexI)
    90 apply (blast intro!: rev_bexI)
    91 done
    91 done
    92 
    92 
    93 lemma transientI: 
    93 lemma transientI: 
    94     "[| act: Acts F;  act``A \<subseteq> -A |] ==> F \<in> transient A"
    94     "[| act \<in> Acts F;  act``A \<subseteq> -A |] ==> F \<in> transient A"
    95 by (unfold transient_def, blast)
    95 by (unfold transient_def, blast)
    96 
    96 
    97 lemma transientE: 
    97 lemma transientE: 
    98     "[| F \<in> transient A;   
    98     "[| F \<in> transient A;   
    99         !!act. [| act: Acts F;  act``A \<subseteq> -A |] ==> P |]  
    99         \<And>act. [| act \<in> Acts F;  act``A \<subseteq> -A |] ==> P |]  
   100      ==> P"
   100      ==> P"
   101 by (unfold transient_def, blast)
   101 by (unfold transient_def, blast)
   102 
   102 
   103 lemma transient_empty [simp]: "transient {} = UNIV"
   103 lemma transient_empty [simp]: "transient {} = UNIV"
   104 by (unfold transient_def, auto)
   104 by (unfold transient_def, auto)
   113                  Un_Image, safe)
   113                  Un_Image, safe)
   114 apply (blast intro!: rev_bexI)+
   114 apply (blast intro!: rev_bexI)+
   115 done
   115 done
   116 
   116 
   117 lemma totalize_transientI: 
   117 lemma totalize_transientI: 
   118     "[| act: Acts F;  A \<subseteq> Domain act;  act``A \<subseteq> -A |] 
   118     "[| act \<in> Acts F;  A \<subseteq> Domain act;  act``A \<subseteq> -A |] 
   119      ==> totalize F \<in> transient A"
   119      ==> totalize F \<in> transient A"
   120 by (simp add: totalize_transient_iff, blast)
   120 by (simp add: totalize_transient_iff, blast)
   121 
   121 
   122 subsection\<open>ensures\<close>
   122 subsection\<open>ensures\<close>
   123 
   123 
   418 (** The most general rule: r is any wf relation; f is any variant function **)
   418 (** The most general rule: r is any wf relation; f is any variant function **)
   419 
   419 
   420 lemma leadsTo_wf_induct_lemma:
   420 lemma leadsTo_wf_induct_lemma:
   421      "[| wf r;      
   421      "[| wf r;      
   422          \<forall>m. F \<in> (A \<inter> f-`{m}) leadsTo                      
   422          \<forall>m. F \<in> (A \<inter> f-`{m}) leadsTo                      
   423                     ((A \<inter> f-`(r^-1 `` {m})) \<union> B) |]  
   423                     ((A \<inter> f-`(r\<inverse> `` {m})) \<union> B) |]  
   424       ==> F \<in> (A \<inter> f-`{m}) leadsTo B"
   424       ==> F \<in> (A \<inter> f-`{m}) leadsTo B"
   425 apply (erule_tac a = m in wf_induct)
   425 apply (erule_tac a = m in wf_induct)
   426 apply (subgoal_tac "F \<in> (A \<inter> (f -` (r^-1 `` {x}))) leadsTo B")
   426 apply (subgoal_tac "F \<in> (A \<inter> (f -` (r\<inverse> `` {x}))) leadsTo B")
   427  apply (blast intro: leadsTo_cancel1 leadsTo_Un_duplicate)
   427  apply (blast intro: leadsTo_cancel1 leadsTo_Un_duplicate)
   428 apply (subst vimage_eq_UN)
   428 apply (subst vimage_eq_UN)
   429 apply (simp only: UN_simps [symmetric])
   429 apply (simp only: UN_simps [symmetric])
   430 apply (blast intro: leadsTo_UN)
   430 apply (blast intro: leadsTo_UN)
   431 done
   431 done
   433 
   433 
   434 (** Meta or object quantifier ? **)
   434 (** Meta or object quantifier ? **)
   435 lemma leadsTo_wf_induct:
   435 lemma leadsTo_wf_induct:
   436      "[| wf r;      
   436      "[| wf r;      
   437          \<forall>m. F \<in> (A \<inter> f-`{m}) leadsTo                      
   437          \<forall>m. F \<in> (A \<inter> f-`{m}) leadsTo                      
   438                     ((A \<inter> f-`(r^-1 `` {m})) \<union> B) |]  
   438                     ((A \<inter> f-`(r\<inverse> `` {m})) \<union> B) |]  
   439       ==> F \<in> A leadsTo B"
   439       ==> F \<in> A leadsTo B"
   440 apply (rule_tac t = A in subst)
   440 apply (rule_tac t = A in subst)
   441  defer 1
   441  defer 1
   442  apply (rule leadsTo_UN)
   442  apply (rule leadsTo_UN)
   443  apply (erule leadsTo_wf_induct_lemma)
   443  apply (erule leadsTo_wf_induct_lemma)
   447 
   447 
   448 
   448 
   449 lemma bounded_induct:
   449 lemma bounded_induct:
   450      "[| wf r;      
   450      "[| wf r;      
   451          \<forall>m \<in> I. F \<in> (A \<inter> f-`{m}) leadsTo                    
   451          \<forall>m \<in> I. F \<in> (A \<inter> f-`{m}) leadsTo                    
   452                       ((A \<inter> f-`(r^-1 `` {m})) \<union> B) |]  
   452                       ((A \<inter> f-`(r\<inverse> `` {m})) \<union> B) |]  
   453       ==> F \<in> A leadsTo ((A - (f-`I)) \<union> B)"
   453       ==> F \<in> A leadsTo ((A - (f-`I)) \<union> B)"
   454 apply (erule leadsTo_wf_induct, safe)
   454 apply (erule leadsTo_wf_induct, safe)
   455 apply (case_tac "m \<in> I")
   455 apply (case_tac "m \<in> I")
   456 apply (blast intro: leadsTo_weaken)
   456 apply (blast intro: leadsTo_weaken)
   457 apply (blast intro: subset_imp_leadsTo)
   457 apply (blast intro: subset_imp_leadsTo)