equal
deleted
inserted
replaced
109 |
109 |
110 lemma wfE_min: |
110 lemma wfE_min: |
111 assumes wf: "wf R" and Q: "x \<in> Q" |
111 assumes wf: "wf R" and Q: "x \<in> Q" |
112 obtains z where "z \<in> Q" "\<And>y. (y, z) \<in> R \<Longrightarrow> y \<notin> Q" |
112 obtains z where "z \<in> Q" "\<And>y. (y, z) \<in> R \<Longrightarrow> y \<notin> Q" |
113 using Q wfE_pf[OF wf, of Q] by blast |
113 using Q wfE_pf[OF wf, of Q] by blast |
|
114 |
|
115 lemma wfE_min': |
|
116 "wf R \<Longrightarrow> Q \<noteq> {} \<Longrightarrow> (\<And>z. z \<in> Q \<Longrightarrow> (\<And>y. (y, z) \<in> R \<Longrightarrow> y \<notin> Q) \<Longrightarrow> thesis) \<Longrightarrow> thesis" |
|
117 using wfE_min[of R _ Q] by blast |
114 |
118 |
115 lemma wfI_min: |
119 lemma wfI_min: |
116 assumes a: "\<And>x Q. x \<in> Q \<Longrightarrow> \<exists>z\<in>Q. \<forall>y. (y, z) \<in> R \<longrightarrow> y \<notin> Q" |
120 assumes a: "\<And>x Q. x \<in> Q \<Longrightarrow> \<exists>z\<in>Q. \<forall>y. (y, z) \<in> R \<longrightarrow> y \<notin> Q" |
117 shows "wf R" |
121 shows "wf R" |
118 proof (rule wfI_pf) |
122 proof (rule wfI_pf) |
916 apply(rule wf_bounded_measure[of r "%a. card(ub a)" "%a. card(f a)"]) |
920 apply(rule wf_bounded_measure[of r "%a. card(ub a)" "%a. card(f a)"]) |
917 apply(drule assms) |
921 apply(drule assms) |
918 apply (blast intro: card_mono finite_subset psubset_card_mono dest: psubset_eq[THEN iffD2]) |
922 apply (blast intro: card_mono finite_subset psubset_card_mono dest: psubset_eq[THEN iffD2]) |
919 done |
923 done |
920 |
924 |
|
925 lemma finite_subset_wf: |
|
926 assumes "finite A" |
|
927 shows "wf {(X,Y). X \<subset> Y \<and> Y \<subseteq> A}" |
|
928 proof (intro finite_acyclic_wf) |
|
929 have "{(X,Y). X \<subset> Y \<and> Y \<subseteq> A} \<subseteq> Pow A \<times> Pow A" by blast |
|
930 thus "finite {(X,Y). X \<subset> Y \<and> Y \<subseteq> A}" |
|
931 by (rule finite_subset) (auto simp: assms finite_cartesian_product) |
|
932 next |
|
933 have "{(X, Y). X \<subset> Y \<and> Y \<subseteq> A}\<^sup>+ = {(X, Y). X \<subset> Y \<and> Y \<subseteq> A}" |
|
934 by (intro trancl_id transI) blast |
|
935 also have " \<forall>x. (x, x) \<notin> \<dots>" by blast |
|
936 finally show "acyclic {(X,Y). X \<subset> Y \<and> Y \<subseteq> A}" by (rule acyclicI) |
|
937 qed |
921 |
938 |
922 hide_const (open) acc accp |
939 hide_const (open) acc accp |
923 |
940 |
924 end |
941 end |