src/HOL/Library/Zorn.thy
author haftmann
Tue, 18 Dec 2007 14:37:00 +0100
changeset 25691 8f8d83af100a
parent 25594 43c718438f9f
child 26191 ae537f315b34
permissions -rw-r--r--
switched from PreList to ATP_Linkup
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
     1
(*  Title       : HOL/Library/Zorn.thy
13652
172600c40793 fixed comments and types
paulson
parents: 13551
diff changeset
     2
    ID          : $Id$
172600c40793 fixed comments and types
paulson
parents: 13551
diff changeset
     3
    Author      : Jacques D. Fleuriot
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
     4
    Description : Zorn's Lemma -- see Larry Paulson's Zorn.thy in ZF
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
     5
*)
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
     6
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
     7
header {* Zorn's Lemma *}
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
     8
15131
c69542757a4d New theory header syntax.
nipkow
parents: 14706
diff changeset
     9
theory Zorn
25691
8f8d83af100a switched from PreList to ATP_Linkup
haftmann
parents: 25594
diff changeset
    10
imports ATP_Linkup Hilbert_Choice
15131
c69542757a4d New theory header syntax.
nipkow
parents: 14706
diff changeset
    11
begin
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    12
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    13
text{*
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    14
  The lemma and section numbers refer to an unpublished article
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    15
  \cite{Abrial-Laffitte}.
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    16
*}
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    17
19736
wenzelm
parents: 18585
diff changeset
    18
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    19
  chain     ::  "'a set set => 'a set set set" where
19736
wenzelm
parents: 18585
diff changeset
    20
  "chain S  = {F. F \<subseteq> S & (\<forall>x \<in> F. \<forall>y \<in> F. x \<subseteq> y | y \<subseteq> x)}"
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    21
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    22
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    23
  super     ::  "['a set set,'a set set] => 'a set set set" where
19736
wenzelm
parents: 18585
diff changeset
    24
  "super S c = {d. d \<in> chain S & c \<subset> d}"
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    25
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    26
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    27
  maxchain  ::  "'a set set => 'a set set set" where
19736
wenzelm
parents: 18585
diff changeset
    28
  "maxchain S = {c. c \<in> chain S & super S c = {}}"
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    29
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    30
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 19736
diff changeset
    31
  succ      ::  "['a set set,'a set set] => 'a set set" where
19736
wenzelm
parents: 18585
diff changeset
    32
  "succ S c =
wenzelm
parents: 18585
diff changeset
    33
    (if c \<notin> chain S | c \<in> maxchain S
wenzelm
parents: 18585
diff changeset
    34
    then c else SOME c'. c' \<in> super S c)"
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    35
23755
1c4672d130b1 Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    36
inductive_set
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    37
  TFin :: "'a set set => 'a set set set"
23755
1c4672d130b1 Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    38
  for S :: "'a set set"
1c4672d130b1 Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    39
  where
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    40
    succI:        "x \<in> TFin S ==> succ S x \<in> TFin S"
23755
1c4672d130b1 Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    41
  | Pow_UnionI:   "Y \<in> Pow(TFin S) ==> Union(Y) \<in> TFin S"
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    42
  monos          Pow_mono
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    43
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    44
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    45
subsection{*Mathematical Preamble*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    46
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    47
lemma Union_lemma0:
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
    48
    "(\<forall>x \<in> C. x \<subseteq> A | B \<subseteq> x) ==> Union(C) \<subseteq> A | B \<subseteq> Union(C)"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    49
  by blast
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    50
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    51
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    52
text{*This is theorem @{text increasingD2} of ZF/Zorn.thy*}
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    53
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    54
lemma Abrial_axiom1: "x \<subseteq> succ S x"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    55
  apply (unfold succ_def)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    56
  apply (rule split_if [THEN iffD2])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    57
  apply (auto simp add: super_def maxchain_def psubset_def)
18585
5d379fe2eb74 replaced swap by contrapos_np;
wenzelm
parents: 18143
diff changeset
    58
  apply (rule contrapos_np, assumption)
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    59
  apply (rule someI2, blast+)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    60
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    61
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    62
lemmas TFin_UnionI = TFin.Pow_UnionI [OF PowI]
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    63
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    64
lemma TFin_induct:
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    65
          "[| n \<in> TFin S;
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    66
             !!x. [| x \<in> TFin S; P(x) |] ==> P(succ S x);
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    67
             !!Y. [| Y \<subseteq> TFin S; Ball Y P |] ==> P(Union Y) |]
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    68
          ==> P(n)"
19736
wenzelm
parents: 18585
diff changeset
    69
  apply (induct set: TFin)
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    70
   apply blast+
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    71
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    72
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    73
lemma succ_trans: "x \<subseteq> y ==> x \<subseteq> succ S y"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    74
  apply (erule subset_trans)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    75
  apply (rule Abrial_axiom1)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    76
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    77
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    78
text{*Lemma 1 of section 3.1*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    79
lemma TFin_linear_lemma1:
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    80
     "[| n \<in> TFin S;  m \<in> TFin S;
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
    81
         \<forall>x \<in> TFin S. x \<subseteq> m --> x = m | succ S x \<subseteq> m
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    82
      |] ==> n \<subseteq> m | succ S m \<subseteq> n"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    83
  apply (erule TFin_induct)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    84
   apply (erule_tac [2] Union_lemma0)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    85
  apply (blast del: subsetI intro: succ_trans)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    86
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    87
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    88
text{* Lemma 2 of section 3.2 *}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    89
lemma TFin_linear_lemma2:
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
    90
     "m \<in> TFin S ==> \<forall>n \<in> TFin S. n \<subseteq> m --> n=m | succ S n \<subseteq> m"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    91
  apply (erule TFin_induct)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    92
   apply (rule impI [THEN ballI])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    93
   txt{*case split using @{text TFin_linear_lemma1}*}
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    94
   apply (rule_tac n1 = n and m1 = x in TFin_linear_lemma1 [THEN disjE],
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    95
     assumption+)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    96
    apply (drule_tac x = n in bspec, assumption)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    97
    apply (blast del: subsetI intro: succ_trans, blast)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    98
  txt{*second induction step*}
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
    99
  apply (rule impI [THEN ballI])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   100
  apply (rule Union_lemma0 [THEN disjE])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   101
    apply (rule_tac [3] disjI2)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   102
    prefer 2 apply blast
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   103
   apply (rule ballI)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   104
   apply (rule_tac n1 = n and m1 = x in TFin_linear_lemma1 [THEN disjE],
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   105
     assumption+, auto)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   106
  apply (blast intro!: Abrial_axiom1 [THEN subsetD])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   107
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   108
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   109
text{*Re-ordering the premises of Lemma 2*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   110
lemma TFin_subsetD:
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   111
     "[| n \<subseteq> m;  m \<in> TFin S;  n \<in> TFin S |] ==> n=m | succ S n \<subseteq> m"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   112
  by (rule TFin_linear_lemma2 [rule_format])
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   113
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   114
text{*Consequences from section 3.3 -- Property 3.2, the ordering is total*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   115
lemma TFin_subset_linear: "[| m \<in> TFin S;  n \<in> TFin S|] ==> n \<subseteq> m | m \<subseteq> n"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   116
  apply (rule disjE)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   117
    apply (rule TFin_linear_lemma1 [OF _ _TFin_linear_lemma2])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   118
      apply (assumption+, erule disjI2)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   119
  apply (blast del: subsetI
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   120
    intro: subsetI Abrial_axiom1 [THEN subset_trans])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   121
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   122
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   123
text{*Lemma 3 of section 3.3*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   124
lemma eq_succ_upper: "[| n \<in> TFin S;  m \<in> TFin S;  m = succ S m |] ==> n \<subseteq> m"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   125
  apply (erule TFin_induct)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   126
   apply (drule TFin_subsetD)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   127
     apply (assumption+, force, blast)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   128
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   129
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   130
text{*Property 3.3 of section 3.3*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   131
lemma equal_succ_Union: "m \<in> TFin S ==> (m = succ S m) = (m = Union(TFin S))"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   132
  apply (rule iffI)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   133
   apply (rule Union_upper [THEN equalityI])
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   134
    apply assumption
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   135
   apply (rule eq_succ_upper [THEN Union_least], assumption+)
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   136
  apply (erule ssubst)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   137
  apply (rule Abrial_axiom1 [THEN equalityI])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   138
  apply (blast del: subsetI intro: subsetI TFin_UnionI TFin.succI)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   139
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   140
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   141
subsection{*Hausdorff's Theorem: Every Set Contains a Maximal Chain.*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   142
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
   143
text{*NB: We assume the partial ordering is @{text "\<subseteq>"},
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   144
 the subset relation!*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   145
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   146
lemma empty_set_mem_chain: "({} :: 'a set set) \<in> chain S"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   147
  by (unfold chain_def) auto
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   148
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   149
lemma super_subset_chain: "super S c \<subseteq> chain S"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   150
  by (unfold super_def) blast
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   151
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   152
lemma maxchain_subset_chain: "maxchain S \<subseteq> chain S"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   153
  by (unfold maxchain_def) blast
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   154
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   155
lemma mem_super_Ex: "c \<in> chain S - maxchain S ==> ? d. d \<in> super S c"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   156
  by (unfold super_def maxchain_def) auto
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   157
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   158
lemma select_super:
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   159
     "c \<in> chain S - maxchain S ==> (\<some>c'. c': super S c): super S c"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   160
  apply (erule mem_super_Ex [THEN exE])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   161
  apply (rule someI2, auto)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   162
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   163
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   164
lemma select_not_equals:
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   165
     "c \<in> chain S - maxchain S ==> (\<some>c'. c': super S c) \<noteq> c"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   166
  apply (rule notI)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   167
  apply (drule select_super)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   168
  apply (simp add: super_def psubset_def)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   169
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   170
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   171
lemma succI3: "c \<in> chain S - maxchain S ==> succ S c = (\<some>c'. c': super S c)"
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   172
  by (unfold succ_def) (blast intro!: if_not_P)
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   173
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   174
lemma succ_not_equals: "c \<in> chain S - maxchain S ==> succ S c \<noteq> c"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   175
  apply (frule succI3)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   176
  apply (simp (no_asm_simp))
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   177
  apply (rule select_not_equals, assumption)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   178
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   179
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   180
lemma TFin_chain_lemma4: "c \<in> TFin S ==> (c :: 'a set set): chain S"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   181
  apply (erule TFin_induct)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   182
   apply (simp add: succ_def select_super [THEN super_subset_chain[THEN subsetD]])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   183
  apply (unfold chain_def)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   184
  apply (rule CollectI, safe)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   185
   apply (drule bspec, assumption)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   186
   apply (rule_tac [2] m1 = Xa and n1 = X in TFin_subset_linear [THEN disjE],
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   187
     blast+)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   188
  done
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
   189
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   190
theorem Hausdorff: "\<exists>c. (c :: 'a set set): maxchain S"
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   191
  apply (rule_tac x = "Union (TFin S)" in exI)
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   192
  apply (rule classical)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   193
  apply (subgoal_tac "succ S (Union (TFin S)) = Union (TFin S) ")
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   194
   prefer 2
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   195
   apply (blast intro!: TFin_UnionI equal_succ_Union [THEN iffD2, symmetric])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   196
  apply (cut_tac subset_refl [THEN TFin_UnionI, THEN TFin_chain_lemma4])
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   197
  apply (drule DiffI [THEN succ_not_equals], blast+)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   198
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   199
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   200
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
   201
subsection{*Zorn's Lemma: If All Chains Have Upper Bounds Then
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   202
                               There Is  a Maximal Element*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   203
14706
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
   204
lemma chain_extend:
71590b7733b7 tuned document;
wenzelm
parents: 13652
diff changeset
   205
    "[| c \<in> chain S; z \<in> S;
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   206
        \<forall>x \<in> c. x \<subseteq> (z:: 'a set) |] ==> {z} Un c \<in> chain S"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   207
  by (unfold chain_def) blast
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   208
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   209
lemma chain_Union_upper: "[| c \<in> chain S; x \<in> c |] ==> x \<subseteq> Union(c)"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   210
  by (unfold chain_def) auto
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   211
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   212
lemma chain_ball_Union_upper: "c \<in> chain S ==> \<forall>x \<in> c. x \<subseteq> Union(c)"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   213
  by (unfold chain_def) auto
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   214
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   215
lemma maxchain_Zorn:
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   216
     "[| c \<in> maxchain S; u \<in> S; Union(c) \<subseteq> u |] ==> Union(c) = u"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   217
  apply (rule ccontr)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   218
  apply (simp add: maxchain_def)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   219
  apply (erule conjE)
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   220
  apply (subgoal_tac "({u} Un c) \<in> super S c")
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   221
   apply simp
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   222
  apply (unfold super_def psubset_def)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   223
  apply (blast intro: chain_extend dest: chain_Union_upper)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   224
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   225
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   226
theorem Zorn_Lemma:
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   227
    "\<forall>c \<in> chain S. Union(c): S ==> \<exists>y \<in> S. \<forall>z \<in> S. y \<subseteq> z --> y = z"
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   228
  apply (cut_tac Hausdorff maxchain_subset_chain)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   229
  apply (erule exE)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   230
  apply (drule subsetD, assumption)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   231
  apply (drule bspec, assumption)
18143
fe14f0282c60 tidying
paulson
parents: 17200
diff changeset
   232
  apply (rule_tac x = "Union(c)" in bexI)
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   233
   apply (rule ballI, rule impI)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   234
   apply (blast dest!: maxchain_Zorn, assumption)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   235
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   236
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   237
subsection{*Alternative version of Zorn's Lemma*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   238
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   239
lemma Zorn_Lemma2:
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   240
  "\<forall>c \<in> chain S. \<exists>y \<in> S. \<forall>x \<in> c. x \<subseteq> y
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   241
    ==> \<exists>y \<in> S. \<forall>x \<in> S. (y :: 'a set) \<subseteq> x --> y = x"
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   242
  apply (cut_tac Hausdorff maxchain_subset_chain)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   243
  apply (erule exE)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   244
  apply (drule subsetD, assumption)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   245
  apply (drule bspec, assumption, erule bexE)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   246
  apply (rule_tac x = y in bexI)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   247
   prefer 2 apply assumption
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   248
  apply clarify
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   249
  apply (rule ccontr)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   250
  apply (frule_tac z = x in chain_extend)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   251
    apply (assumption, blast)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   252
  apply (unfold maxchain_def super_def psubset_def)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   253
  apply (blast elim!: equalityCE)
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   254
  done
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   255
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   256
text{*Various other lemmas*}
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   257
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   258
lemma chainD: "[| c \<in> chain S; x \<in> c; y \<in> c |] ==> x \<subseteq> y | y \<subseteq> x"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   259
  by (unfold chain_def) blast
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   260
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   261
lemma chainD2: "!!(c :: 'a set set). c \<in> chain S ==> c \<subseteq> S"
17200
3a4d03d1a31b tuned presentation;
wenzelm
parents: 15140
diff changeset
   262
  by (unfold chain_def) blast
13551
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   263
b7f64ee8da84 converted Hyperreal/Zorn to Isar format and moved to Library
paulson
parents:
diff changeset
   264
end