diff -r b87b14e885af -r 43f5dfb7fa35 src/HOL/BNF_Wellorder_Relation.thy --- a/src/HOL/BNF_Wellorder_Relation.thy Fri Jul 15 09:18:21 2022 +0200 +++ b/src/HOL/BNF_Wellorder_Relation.thy Fri Jul 22 14:39:56 2022 +0200 @@ -220,27 +220,26 @@ shows "\b. isMinim B b" proof- from spec[OF WF[unfolded wf_eq_minimal[of "r - Id"]], of B] NE obtain b where - *: "b \ B \ (\b'. b' \ b \ (b',b) \ r \ b' \ B)" by auto - show ?thesis - proof(simp add: isMinim_def, rule exI[of _ b], auto) - show "b \ B" using * by simp - next - fix b' assume As: "b' \ B" - hence **: "b \ Field r \ b' \ Field r" using As SUB * by auto - (* *) - from As * have "b' = b \ (b',b) \ r" by auto - moreover - {assume "b' = b" - hence "(b,b') \ r" - using ** REFL by (auto simp add: refl_on_def) - } - moreover - {assume "b' \ b \ (b',b) \ r" - hence "(b,b') \ r" - using ** TOTAL by (auto simp add: total_on_def) - } - ultimately show "(b,b') \ r" by blast + *: "b \ B \ (\b'. b' \ b \ (b',b) \ r \ b' \ B)" by auto + have "\b'. b' \ B \ (b, b') \ r" + proof + fix b' + show "b' \ B \ (b, b') \ r" + proof + assume As: "b' \ B" + hence **: "b \ Field r \ b' \ Field r" using As SUB * by auto + from As * have "b' = b \ (b',b) \ r" by auto + moreover have "b' = b \ (b, b') \ r" + using ** REFL by (auto simp add: refl_on_def) + moreover have "b' \ b \ (b',b) \ r \ (b,b') \ r" + using ** TOTAL by (auto simp add: total_on_def) + ultimately show "(b,b') \ r" by blast + qed qed + then have "isMinim B b" + unfolding isMinim_def using * by auto + then show ?thesis + by auto qed lemma minim_isMinim: @@ -395,16 +394,22 @@ lemma under_ofilter: "ofilter (under a)" -proof(unfold ofilter_def under_def, auto simp add: Field_def) - fix aa x - assume "(aa,a) \ r" "(x,aa) \ r" - thus "(x,a) \ r" - using TRANS trans_def[of r] by blast +proof - + have "\aa x. (aa, a) \ r \ (x, aa) \ r \ (x, a) \ r" + proof - + fix aa x + assume "(aa,a) \ r" "(x,aa) \ r" + then show "(x,a) \ r" + using TRANS trans_def[of r] by blast + qed + then show ?thesis unfolding ofilter_def under_def + by (auto simp add: Field_def) qed lemma underS_ofilter: "ofilter (underS a)" -proof(unfold ofilter_def underS_def under_def, auto simp add: Field_def) + unfolding ofilter_def underS_def under_def +proof safe fix aa assume "(a, aa) \ r" "(aa, a) \ r" and DIFF: "aa \ a" thus False using ANTISYM antisym_def[of r] by blast @@ -412,7 +417,13 @@ fix aa x assume "(aa,a) \ r" "aa \ a" "(x,aa) \ r" thus "(x,a) \ r" - using TRANS trans_def[of r] by blast + using TRANS trans_def[of r] by blast +next + fix x + assume "x \ a" and "(x, a) \ r" + then show "x \ Field r" + unfolding Field_def + by auto qed lemma Field_ofilter: @@ -430,7 +441,7 @@ let ?One = "(\a\Field r. A = underS a)" let ?Two = "(A = Field r)" show "?One \ ?Two" - proof(cases ?Two, simp) + proof(cases ?Two) let ?B = "(Field r) - A" let ?a = "minim ?B" assume "A \ Field r" @@ -445,7 +456,7 @@ have "A = underS ?a" proof show "A \ underS ?a" - proof(unfold underS_def, auto simp add: 4) + proof fix x assume **: "x \ A" hence 11: "x \ Field r" using 5 by auto have 12: "x \ ?a" using 4 ** by auto @@ -458,25 +469,32 @@ hence "?a \ A" using ** 13 by blast with 4 have False by simp } - thus "(x,?a) \ r" by blast + then have "(x,?a) \ r" by blast + thus "x \ underS ?a" + unfolding underS_def by (auto simp add: 12) qed next show "underS ?a \ A" - proof(unfold underS_def, auto) + proof fix x - assume **: "x \ ?a" and ***: "(x,?a) \ r" - hence 11: "x \ Field r" using Field_def by fastforce + assume **: "x \ underS ?a" + hence 11: "x \ Field r" + using Field_def unfolding underS_def by fastforce {assume "x \ A" hence "x \ ?B" using 11 by auto hence "(?a,x) \ r" using 3 minim_least[of ?B x] by blast hence False - using ANTISYM antisym_def[of r] ** *** by auto + using ANTISYM antisym_def[of r] ** unfolding underS_def by auto } thus "x \ A" by blast qed qed ultimately have ?One using 2 by blast thus ?thesis by simp + next + assume "A = Field r" + then show ?thesis + by simp qed qed