src/HOL/Wellfounded.thy
changeset 60148 f0fc2378a479
parent 59807 22bc39064290
child 60493 866f41a869e6
equal deleted inserted replaced
60147:6d7b7a037e8d 60148:f0fc2378a479
   376   qed
   376   qed
   377 qed
   377 qed
   378 
   378 
   379 lemma wf_comp_self: "wf R = wf (R O R)"  -- {* special case *}
   379 lemma wf_comp_self: "wf R = wf (R O R)"  -- {* special case *}
   380   by (rule wf_union_merge [where S = "{}", simplified])
   380   by (rule wf_union_merge [where S = "{}", simplified])
       
   381 
       
   382 
       
   383 subsection {* Well-Foundedness of Composition *}
       
   384 
       
   385 text{* Provided by Tjark Weber: *}
       
   386 
       
   387 lemma wf_relcomp_compatible:
       
   388   assumes "wf R" and "R O S \<subseteq> S O R"
       
   389   shows "wf (S O R)"
       
   390 proof (rule wfI_pf)
       
   391   fix A assume A: "A \<subseteq> (S O R) `` A"
       
   392   {
       
   393     fix n have "(S ^^ n) `` A \<subseteq> R `` (S ^^ Suc n) `` A"
       
   394     proof (induction n)
       
   395       case 0 show ?case using A by (simp add: relcomp_Image)
       
   396     next
       
   397       case (Suc n)
       
   398       then have "S `` (S ^^ n) `` A \<subseteq> S `` R `` (S ^^ Suc n) `` A"
       
   399         by (simp add: Image_mono)
       
   400       also have "\<dots> \<subseteq> R `` S `` (S ^^ Suc n) `` A" using assms(2)
       
   401         by (simp add: Image_mono O_assoc relcomp_Image[symmetric] relcomp_mono)
       
   402       finally show ?case by (simp add: relcomp_Image)
       
   403     qed
       
   404   }
       
   405   then have "(\<Union>n. (S ^^ n) `` A) \<subseteq> R `` (\<Union>n. (S ^^ n) `` A)" by blast
       
   406   then have "(\<Union>n. (S ^^ n) `` A) = {}"
       
   407     using assms(1) by (simp only: wfE_pf)
       
   408   then show "A = {}" using relpow.simps(1) by blast
       
   409 qed
   381 
   410 
   382 
   411 
   383 subsection {* Acyclic relations *}
   412 subsection {* Acyclic relations *}
   384 
   413 
   385 lemma wf_acyclic: "wf r ==> acyclic r"
   414 lemma wf_acyclic: "wf r ==> acyclic r"