src/HOL/Library/Zorn.thy
changeset 17200 3a4d03d1a31b
parent 15140 322485b816ac
child 18143 fe14f0282c60
     1.1 --- a/src/HOL/Library/Zorn.thy	Wed Aug 31 15:46:36 2005 +0200
     1.2 +++ b/src/HOL/Library/Zorn.thy	Wed Aug 31 15:46:37 2005 +0200
     1.3 @@ -42,18 +42,20 @@
     1.4  
     1.5  subsection{*Mathematical Preamble*}
     1.6  
     1.7 -lemma Union_lemma0: "(\<forall>x \<in> C. x \<subseteq> A | B \<subseteq> x) ==> Union(C)<=A | B \<subseteq> Union(C)"
     1.8 -by blast
     1.9 +lemma Union_lemma0:
    1.10 +    "(\<forall>x \<in> C. x \<subseteq> A | B \<subseteq> x) ==> Union(C)<=A | B \<subseteq> Union(C)"
    1.11 +  by blast
    1.12  
    1.13  
    1.14  text{*This is theorem @{text increasingD2} of ZF/Zorn.thy*}
    1.15 +
    1.16  lemma Abrial_axiom1: "x \<subseteq> succ S x"
    1.17 -apply (unfold succ_def)
    1.18 -apply (rule split_if [THEN iffD2])
    1.19 -apply (auto simp add: super_def maxchain_def psubset_def)
    1.20 -apply (rule swap, assumption)
    1.21 -apply (rule someI2, blast+)
    1.22 -done
    1.23 +  apply (unfold succ_def)
    1.24 +  apply (rule split_if [THEN iffD2])
    1.25 +  apply (auto simp add: super_def maxchain_def psubset_def)
    1.26 +  apply (rule swap, assumption)
    1.27 +  apply (rule someI2, blast+)
    1.28 +  done
    1.29  
    1.30  lemmas TFin_UnionI = TFin.Pow_UnionI [OF PowI]
    1.31  
    1.32 @@ -62,79 +64,77 @@
    1.33               !!x. [| x \<in> TFin S; P(x) |] ==> P(succ S x);
    1.34               !!Y. [| Y \<subseteq> TFin S; Ball Y P |] ==> P(Union Y) |]
    1.35            ==> P(n)"
    1.36 -apply (erule TFin.induct, blast+)
    1.37 -done
    1.38 +  apply (erule TFin.induct)
    1.39 +   apply blast+
    1.40 +  done
    1.41  
    1.42  lemma succ_trans: "x \<subseteq> y ==> x \<subseteq> succ S y"
    1.43 -apply (erule subset_trans)
    1.44 -apply (rule Abrial_axiom1)
    1.45 -done
    1.46 +  apply (erule subset_trans)
    1.47 +  apply (rule Abrial_axiom1)
    1.48 +  done
    1.49  
    1.50  text{*Lemma 1 of section 3.1*}
    1.51  lemma TFin_linear_lemma1:
    1.52       "[| n \<in> TFin S;  m \<in> TFin S;
    1.53           \<forall>x \<in> TFin S. x \<subseteq> m --> x = m | succ S x \<subseteq> m
    1.54        |] ==> n \<subseteq> m | succ S m \<subseteq> n"
    1.55 -apply (erule TFin_induct)
    1.56 -apply (erule_tac [2] Union_lemma0) (*or just blast*)
    1.57 -apply (blast del: subsetI intro: succ_trans)
    1.58 -done
    1.59 +  apply (erule TFin_induct)
    1.60 +   apply (erule_tac [2] Union_lemma0)
    1.61 +  apply (blast del: subsetI intro: succ_trans)
    1.62 +  done
    1.63  
    1.64  text{* Lemma 2 of section 3.2 *}
    1.65  lemma TFin_linear_lemma2:
    1.66       "m \<in> TFin S ==> \<forall>n \<in> TFin S. n \<subseteq> m --> n=m | succ S n \<subseteq> m"
    1.67 -apply (erule TFin_induct)
    1.68 -apply (rule impI [THEN ballI])
    1.69 -txt{*case split using @{text TFin_linear_lemma1}*}
    1.70 -apply (rule_tac n1 = n and m1 = x in TFin_linear_lemma1 [THEN disjE],
    1.71 -       assumption+)
    1.72 -apply (drule_tac x = n in bspec, assumption)
    1.73 -apply (blast del: subsetI intro: succ_trans, blast)
    1.74 -txt{*second induction step*}
    1.75 -apply (rule impI [THEN ballI])
    1.76 -apply (rule Union_lemma0 [THEN disjE])
    1.77 -apply (rule_tac [3] disjI2)
    1.78 - prefer 2 apply blast
    1.79 -apply (rule ballI)
    1.80 -apply (rule_tac n1 = n and m1 = x in TFin_linear_lemma1 [THEN disjE],
    1.81 -       assumption+, auto)
    1.82 -apply (blast intro!: Abrial_axiom1 [THEN subsetD])
    1.83 -done
    1.84 +  apply (erule TFin_induct)
    1.85 +   apply (rule impI [THEN ballI])
    1.86 +   txt{*case split using @{text TFin_linear_lemma1}*}
    1.87 +   apply (rule_tac n1 = n and m1 = x in TFin_linear_lemma1 [THEN disjE],
    1.88 +     assumption+)
    1.89 +    apply (drule_tac x = n in bspec, assumption)
    1.90 +    apply (blast del: subsetI intro: succ_trans, blast)
    1.91 +  txt{*second induction step*}
    1.92 +  apply (rule impI [THEN ballI])
    1.93 +  apply (rule Union_lemma0 [THEN disjE])
    1.94 +    apply (rule_tac [3] disjI2)
    1.95 +    prefer 2 apply blast
    1.96 +   apply (rule ballI)
    1.97 +   apply (rule_tac n1 = n and m1 = x in TFin_linear_lemma1 [THEN disjE],
    1.98 +     assumption+, auto)
    1.99 +  apply (blast intro!: Abrial_axiom1 [THEN subsetD])
   1.100 +  done
   1.101  
   1.102  text{*Re-ordering the premises of Lemma 2*}
   1.103  lemma TFin_subsetD:
   1.104       "[| n \<subseteq> m;  m \<in> TFin S;  n \<in> TFin S |] ==> n=m | succ S n \<subseteq> m"
   1.105 -apply (rule TFin_linear_lemma2 [rule_format])
   1.106 -apply (assumption+)
   1.107 -done
   1.108 +  by (rule TFin_linear_lemma2 [rule_format])
   1.109  
   1.110  text{*Consequences from section 3.3 -- Property 3.2, the ordering is total*}
   1.111  lemma TFin_subset_linear: "[| m \<in> TFin S;  n \<in> TFin S|] ==> n \<subseteq> m | m \<subseteq> n"
   1.112 -apply (rule disjE)
   1.113 -apply (rule TFin_linear_lemma1 [OF _ _TFin_linear_lemma2])
   1.114 -apply (assumption+, erule disjI2)
   1.115 -apply (blast del: subsetI
   1.116 -             intro: subsetI Abrial_axiom1 [THEN subset_trans])
   1.117 -done
   1.118 +  apply (rule disjE)
   1.119 +    apply (rule TFin_linear_lemma1 [OF _ _TFin_linear_lemma2])
   1.120 +      apply (assumption+, erule disjI2)
   1.121 +  apply (blast del: subsetI
   1.122 +    intro: subsetI Abrial_axiom1 [THEN subset_trans])
   1.123 +  done
   1.124  
   1.125  text{*Lemma 3 of section 3.3*}
   1.126  lemma eq_succ_upper: "[| n \<in> TFin S;  m \<in> TFin S;  m = succ S m |] ==> n \<subseteq> m"
   1.127 -apply (erule TFin_induct)
   1.128 -apply (drule TFin_subsetD)
   1.129 -apply (assumption+, force, blast)
   1.130 -done
   1.131 +  apply (erule TFin_induct)
   1.132 +   apply (drule TFin_subsetD)
   1.133 +     apply (assumption+, force, blast)
   1.134 +  done
   1.135  
   1.136  text{*Property 3.3 of section 3.3*}
   1.137  lemma equal_succ_Union: "m \<in> TFin S ==> (m = succ S m) = (m = Union(TFin S))"
   1.138 -apply (rule iffI)
   1.139 -apply (rule Union_upper [THEN equalityI])
   1.140 -apply (rule_tac [2] eq_succ_upper [THEN Union_least])
   1.141 -apply (assumption+)
   1.142 -apply (erule ssubst)
   1.143 -apply (rule Abrial_axiom1 [THEN equalityI])
   1.144 -apply (blast del: subsetI
   1.145 -             intro: subsetI TFin_UnionI TFin.succI)
   1.146 -done
   1.147 +  apply (rule iffI)
   1.148 +   apply (rule Union_upper [THEN equalityI])
   1.149 +    apply (rule_tac [2] eq_succ_upper [THEN Union_least])
   1.150 +      apply (assumption+)
   1.151 +  apply (erule ssubst)
   1.152 +  apply (rule Abrial_axiom1 [THEN equalityI])
   1.153 +  apply (blast del: subsetI intro: subsetI TFin_UnionI TFin.succI)
   1.154 +  done
   1.155  
   1.156  subsection{*Hausdorff's Theorem: Every Set Contains a Maximal Chain.*}
   1.157  
   1.158 @@ -142,60 +142,58 @@
   1.159   the subset relation!*}
   1.160  
   1.161  lemma empty_set_mem_chain: "({} :: 'a set set) \<in> chain S"
   1.162 -by (unfold chain_def, auto)
   1.163 +  by (unfold chain_def) auto
   1.164  
   1.165  lemma super_subset_chain: "super S c \<subseteq> chain S"
   1.166 -by (unfold super_def, fast)
   1.167 +  by (unfold super_def) blast
   1.168  
   1.169  lemma maxchain_subset_chain: "maxchain S \<subseteq> chain S"
   1.170 -by (unfold maxchain_def, fast)
   1.171 +  by (unfold maxchain_def) blast
   1.172  
   1.173  lemma mem_super_Ex: "c \<in> chain S - maxchain S ==> ? d. d \<in> super S c"
   1.174 -by (unfold super_def maxchain_def, auto)
   1.175 +  by (unfold super_def maxchain_def) auto
   1.176  
   1.177  lemma select_super: "c \<in> chain S - maxchain S ==>
   1.178 -                          (@c'. c': super S c): super S c"
   1.179 -apply (erule mem_super_Ex [THEN exE])
   1.180 -apply (rule someI2, auto)
   1.181 -done
   1.182 +                          (\<some>c'. c': super S c): super S c"
   1.183 +  apply (erule mem_super_Ex [THEN exE])
   1.184 +  apply (rule someI2, auto)
   1.185 +  done
   1.186  
   1.187  lemma select_not_equals: "c \<in> chain S - maxchain S ==>
   1.188 -                          (@c'. c': super S c) \<noteq> c"
   1.189 -apply (rule notI)
   1.190 -apply (drule select_super)
   1.191 -apply (simp add: super_def psubset_def)
   1.192 -done
   1.193 +                          (\<some>c'. c': super S c) \<noteq> c"
   1.194 +  apply (rule notI)
   1.195 +  apply (drule select_super)
   1.196 +  apply (simp add: super_def psubset_def)
   1.197 +  done
   1.198  
   1.199 -lemma succI3: "c \<in> chain S - maxchain S ==> succ S c = (@c'. c': super S c)"
   1.200 -apply (unfold succ_def)
   1.201 -apply (fast intro!: if_not_P)
   1.202 -done
   1.203 +lemma succI3: "c \<in> chain S - maxchain S ==> succ S c = (\<some>c'. c': super S c)"
   1.204 +  by (unfold succ_def) (blast intro!: if_not_P)
   1.205  
   1.206  lemma succ_not_equals: "c \<in> chain S - maxchain S ==> succ S c \<noteq> c"
   1.207 -apply (frule succI3)
   1.208 -apply (simp (no_asm_simp))
   1.209 -apply (rule select_not_equals, assumption)
   1.210 -done
   1.211 +  apply (frule succI3)
   1.212 +  apply (simp (no_asm_simp))
   1.213 +  apply (rule select_not_equals, assumption)
   1.214 +  done
   1.215  
   1.216  lemma TFin_chain_lemma4: "c \<in> TFin S ==> (c :: 'a set set): chain S"
   1.217 -apply (erule TFin_induct)
   1.218 -apply (simp add: succ_def select_super [THEN super_subset_chain[THEN subsetD]])
   1.219 -apply (unfold chain_def)
   1.220 -apply (rule CollectI, safe)
   1.221 -apply (drule bspec, assumption)
   1.222 -apply (rule_tac [2] m1 = Xa and n1 = X in TFin_subset_linear [THEN disjE],
   1.223 -       blast+)
   1.224 -done
   1.225 +  apply (erule TFin_induct)
   1.226 +   apply (simp add: succ_def select_super [THEN super_subset_chain[THEN subsetD]])
   1.227 +  apply (unfold chain_def)
   1.228 +  apply (rule CollectI, safe)
   1.229 +   apply (drule bspec, assumption)
   1.230 +   apply (rule_tac [2] m1 = Xa and n1 = X in TFin_subset_linear [THEN disjE],
   1.231 +     blast+)
   1.232 +  done
   1.233  
   1.234  theorem Hausdorff: "\<exists>c. (c :: 'a set set): maxchain S"
   1.235 -apply (rule_tac x = "Union (TFin S) " in exI)
   1.236 -apply (rule classical)
   1.237 -apply (subgoal_tac "succ S (Union (TFin S)) = Union (TFin S) ")
   1.238 - prefer 2
   1.239 - apply (blast intro!: TFin_UnionI equal_succ_Union [THEN iffD2, symmetric])
   1.240 -apply (cut_tac subset_refl [THEN TFin_UnionI, THEN TFin_chain_lemma4])
   1.241 -apply (drule DiffI [THEN succ_not_equals], blast+)
   1.242 -done
   1.243 +  apply (rule_tac x = "Union (TFin S) " in exI)
   1.244 +  apply (rule classical)
   1.245 +  apply (subgoal_tac "succ S (Union (TFin S)) = Union (TFin S) ")
   1.246 +   prefer 2
   1.247 +   apply (blast intro!: TFin_UnionI equal_succ_Union [THEN iffD2, symmetric])
   1.248 +  apply (cut_tac subset_refl [THEN TFin_UnionI, THEN TFin_chain_lemma4])
   1.249 +  apply (drule DiffI [THEN succ_not_equals], blast+)
   1.250 +  done
   1.251  
   1.252  
   1.253  subsection{*Zorn's Lemma: If All Chains Have Upper Bounds Then
   1.254 @@ -204,61 +202,61 @@
   1.255  lemma chain_extend:
   1.256      "[| c \<in> chain S; z \<in> S;
   1.257          \<forall>x \<in> c. x<=(z:: 'a set) |] ==> {z} Un c \<in> chain S"
   1.258 -by (unfold chain_def, blast)
   1.259 +  by (unfold chain_def) blast
   1.260  
   1.261  lemma chain_Union_upper: "[| c \<in> chain S; x \<in> c |] ==> x \<subseteq> Union(c)"
   1.262 -by (unfold chain_def, auto)
   1.263 +  by (unfold chain_def) auto
   1.264  
   1.265  lemma chain_ball_Union_upper: "c \<in> chain S ==> \<forall>x \<in> c. x \<subseteq> Union(c)"
   1.266 -by (unfold chain_def, auto)
   1.267 +  by (unfold chain_def) auto
   1.268  
   1.269  lemma maxchain_Zorn:
   1.270       "[| c \<in> maxchain S; u \<in> S; Union(c) \<subseteq> u |] ==> Union(c) = u"
   1.271 -apply (rule ccontr)
   1.272 -apply (simp add: maxchain_def)
   1.273 -apply (erule conjE)
   1.274 -apply (subgoal_tac " ({u} Un c) \<in> super S c")
   1.275 -apply simp
   1.276 -apply (unfold super_def psubset_def)
   1.277 -apply (blast intro: chain_extend dest: chain_Union_upper)
   1.278 -done
   1.279 +  apply (rule ccontr)
   1.280 +  apply (simp add: maxchain_def)
   1.281 +  apply (erule conjE)
   1.282 +  apply (subgoal_tac " ({u} Un c) \<in> super S c")
   1.283 +   apply simp
   1.284 +  apply (unfold super_def psubset_def)
   1.285 +  apply (blast intro: chain_extend dest: chain_Union_upper)
   1.286 +  done
   1.287  
   1.288  theorem Zorn_Lemma:
   1.289 -     "\<forall>c \<in> chain S. Union(c): S ==> \<exists>y \<in> S. \<forall>z \<in> S. y \<subseteq> z --> y = z"
   1.290 -apply (cut_tac Hausdorff maxchain_subset_chain)
   1.291 -apply (erule exE)
   1.292 -apply (drule subsetD, assumption)
   1.293 -apply (drule bspec, assumption)
   1.294 -apply (rule_tac x = "Union (c) " in bexI)
   1.295 -apply (rule ballI, rule impI)
   1.296 -apply (blast dest!: maxchain_Zorn, assumption)
   1.297 -done
   1.298 +    "\<forall>c \<in> chain S. Union(c): S ==> \<exists>y \<in> S. \<forall>z \<in> S. y \<subseteq> z --> y = z"
   1.299 +  apply (cut_tac Hausdorff maxchain_subset_chain)
   1.300 +  apply (erule exE)
   1.301 +  apply (drule subsetD, assumption)
   1.302 +  apply (drule bspec, assumption)
   1.303 +  apply (rule_tac x = "Union (c) " in bexI)
   1.304 +   apply (rule ballI, rule impI)
   1.305 +   apply (blast dest!: maxchain_Zorn, assumption)
   1.306 +  done
   1.307  
   1.308  subsection{*Alternative version of Zorn's Lemma*}
   1.309  
   1.310  lemma Zorn_Lemma2:
   1.311 -     "\<forall>c \<in> chain S. \<exists>y \<in> S. \<forall>x \<in> c. x \<subseteq> y
   1.312 -      ==> \<exists>y \<in> S. \<forall>x \<in> S. (y :: 'a set) \<subseteq> x --> y = x"
   1.313 -apply (cut_tac Hausdorff maxchain_subset_chain)
   1.314 -apply (erule exE)
   1.315 -apply (drule subsetD, assumption)
   1.316 -apply (drule bspec, assumption, erule bexE)
   1.317 -apply (rule_tac x = y in bexI)
   1.318 - prefer 2 apply assumption
   1.319 -apply clarify
   1.320 -apply (rule ccontr)
   1.321 -apply (frule_tac z = x in chain_extend)
   1.322 -apply (assumption, blast)
   1.323 -apply (unfold maxchain_def super_def psubset_def)
   1.324 -apply (blast elim!: equalityCE)
   1.325 -done
   1.326 +  "\<forall>c \<in> chain S. \<exists>y \<in> S. \<forall>x \<in> c. x \<subseteq> y
   1.327 +    ==> \<exists>y \<in> S. \<forall>x \<in> S. (y :: 'a set) \<subseteq> x --> y = x"
   1.328 +  apply (cut_tac Hausdorff maxchain_subset_chain)
   1.329 +  apply (erule exE)
   1.330 +  apply (drule subsetD, assumption)
   1.331 +  apply (drule bspec, assumption, erule bexE)
   1.332 +  apply (rule_tac x = y in bexI)
   1.333 +   prefer 2 apply assumption
   1.334 +  apply clarify
   1.335 +  apply (rule ccontr)
   1.336 +  apply (frule_tac z = x in chain_extend)
   1.337 +    apply (assumption, blast)
   1.338 +  apply (unfold maxchain_def super_def psubset_def)
   1.339 +  apply (blast elim!: equalityCE)
   1.340 +  done
   1.341  
   1.342  text{*Various other lemmas*}
   1.343  
   1.344  lemma chainD: "[| c \<in> chain S; x \<in> c; y \<in> c |] ==> x \<subseteq> y | y \<subseteq> x"
   1.345 -by (unfold chain_def, blast)
   1.346 +  by (unfold chain_def) blast
   1.347  
   1.348  lemma chainD2: "!!(c :: 'a set set). c \<in> chain S ==> c \<subseteq> S"
   1.349 -by (unfold chain_def, blast)
   1.350 +  by (unfold chain_def) blast
   1.351  
   1.352  end