diff -r f2094906e491 -r e44d86131648 src/ZF/Zorn.thy --- a/src/ZF/Zorn.thy Tue Sep 27 13:34:54 2022 +0200 +++ b/src/ZF/Zorn.thy Tue Sep 27 16:51:35 2022 +0100 @@ -12,27 +12,27 @@ definition Subset_rel :: "i=>i" where - "Subset_rel(A) == {z \ A*A . \x y. z= & x<=y & x\y}" + "Subset_rel(A) \ {z \ A*A . \x y. z= & x<=y & x\y}" definition chain :: "i=>i" where - "chain(A) == {F \ Pow(A). \X\F. \Y\F. X<=Y | Y<=X}" + "chain(A) \ {F \ Pow(A). \X\F. \Y\F. X<=Y | Y<=X}" definition super :: "[i,i]=>i" where - "super(A,c) == {d \ chain(A). c<=d & c\d}" + "super(A,c) \ {d \ chain(A). c<=d & c\d}" definition maxchain :: "i=>i" where - "maxchain(A) == {c \ chain(A). super(A,c)=0}" + "maxchain(A) \ {c \ chain(A). super(A,c)=0}" definition increasing :: "i=>i" where - "increasing(A) == {f \ Pow(A)->Pow(A). \x. x<=A \ x<=f`x}" + "increasing(A) \ {f \ Pow(A)->Pow(A). \x. x<=A \ x<=f`x}" text\Lemma for the inductive definition below\ -lemma Union_in_Pow: "Y \ Pow(Pow(A)) ==> \(Y) \ Pow(A)" +lemma Union_in_Pow: "Y \ Pow(Pow(A)) \ \(Y) \ Pow(A)" by blast @@ -47,10 +47,10 @@ inductive domains "TFin(S,next)" \ "Pow(S)" intros - nextI: "[| x \ TFin(S,next); next \ increasing(S) |] - ==> next`x \ TFin(S,next)" + nextI: "\x \ TFin(S,next); next \ increasing(S)\ + \ next`x \ TFin(S,next)" - Pow_UnionI: "Y \ Pow(TFin(S,next)) ==> \(Y) \ TFin(S,next)" + Pow_UnionI: "Y \ Pow(TFin(S,next)) \ \(Y) \ TFin(S,next)" monos Pow_mono con_defs increasing_def @@ -59,22 +59,22 @@ subsection\Mathematical Preamble\ -lemma Union_lemma0: "(\x\C. x<=A | B<=x) ==> \(C)<=A | B<=\(C)" +lemma Union_lemma0: "(\x\C. x<=A | B<=x) \ \(C)<=A | B<=\(C)" by blast lemma Inter_lemma0: - "[| c \ C; \x\C. A<=x | x<=B |] ==> A \ \(C) | \(C) \ B" + "\c \ C; \x\C. A<=x | x<=B\ \ A \ \(C) | \(C) \ B" by blast subsection\The Transfinite Construction\ -lemma increasingD1: "f \ increasing(A) ==> f \ Pow(A)->Pow(A)" +lemma increasingD1: "f \ increasing(A) \ f \ Pow(A)->Pow(A)" apply (unfold increasing_def) apply (erule CollectD1) done -lemma increasingD2: "[| f \ increasing(A); x<=A |] ==> x \ f`x" +lemma increasingD2: "\f \ increasing(A); x<=A\ \ x \ f`x" by (unfold increasing_def, blast) lemmas TFin_UnionI = PowI [THEN TFin.Pow_UnionI] @@ -84,10 +84,10 @@ text\Structural induction on \<^term>\TFin(S,next)\\ lemma TFin_induct: - "[| n \ TFin(S,next); - !!x. [| x \ TFin(S,next); P(x); next \ increasing(S) |] ==> P(next`x); - !!Y. [| Y \ TFin(S,next); \y\Y. P(y) |] ==> P(\(Y)) - |] ==> P(n)" + "\n \ TFin(S,next); + \x. \x \ TFin(S,next); P(x); next \ increasing(S)\ \ P(next`x); + \Y. \Y \ TFin(S,next); \y\Y. P(y)\ \ P(\(Y)) +\ \ P(n)" by (erule TFin.induct, blast+) @@ -98,9 +98,9 @@ text\Lemma 1 of section 3.1\ lemma TFin_linear_lemma1: - "[| n \ TFin(S,next); m \ TFin(S,next); - \x \ TFin(S,next) . x<=m \ x=m | next`x<=m |] - ==> n<=m | next`m<=n" + "\n \ TFin(S,next); m \ TFin(S,next); + \x \ TFin(S,next) . x<=m \ x=m | next`x<=m\ + \ n<=m | next`m<=n" apply (erule TFin_induct) apply (erule_tac [2] Union_lemma0) (*or just Blast_tac*) (*downgrade subsetI from intro! to intro*) @@ -110,8 +110,8 @@ text\Lemma 2 of section 3.2. Interesting in its own right! Requires \<^term>\next \ increasing(S)\ in the second induction step.\ lemma TFin_linear_lemma2: - "[| m \ TFin(S,next); next \ increasing(S) |] - ==> \n \ TFin(S,next). n<=m \ n=m | next`n \ m" + "\m \ TFin(S,next); next \ increasing(S)\ + \ \n \ TFin(S,next). n<=m \ n=m | next`n \ m" apply (erule TFin_induct) apply (rule impI [THEN ballI]) txt\case split using \TFin_linear_lemma1\\ @@ -135,14 +135,14 @@ text\a more convenient form for Lemma 2\ lemma TFin_subsetD: - "[| n<=m; m \ TFin(S,next); n \ TFin(S,next); next \ increasing(S) |] - ==> n=m | next`n \ m" + "\n<=m; m \ TFin(S,next); n \ TFin(S,next); next \ increasing(S)\ + \ n=m | next`n \ m" by (blast dest: TFin_linear_lemma2 [rule_format]) text\Consequences from section 3.3 -- Property 3.2, the ordering is total\ lemma TFin_subset_linear: - "[| m \ TFin(S,next); n \ TFin(S,next); next \ increasing(S) |] - ==> n \ m | m<=n" + "\m \ TFin(S,next); n \ TFin(S,next); next \ increasing(S)\ + \ n \ m | m<=n" apply (rule disjE) apply (rule TFin_linear_lemma1 [OF _ _TFin_linear_lemma2]) apply (assumption+, erule disjI2) @@ -153,7 +153,7 @@ text\Lemma 3 of section 3.3\ lemma equal_next_upper: - "[| n \ TFin(S,next); m \ TFin(S,next); m = next`m |] ==> n \ m" + "\n \ TFin(S,next); m \ TFin(S,next); m = next`m\ \ n \ m" apply (erule TFin_induct) apply (drule TFin_subsetD) apply (assumption+, force, blast) @@ -161,8 +161,8 @@ text\Property 3.3 of section 3.3\ lemma equal_next_Union: - "[| m \ TFin(S,next); next \ increasing(S) |] - ==> m = next`m <-> m = \(TFin(S,next))" + "\m \ TFin(S,next); next \ increasing(S)\ + \ m = next`m <-> m = \(TFin(S,next))" apply (rule iffI) apply (rule Union_upper [THEN equalityI]) apply (rule_tac [2] equal_next_upper [THEN Union_least]) @@ -197,15 +197,15 @@ done lemma choice_super: - "[| ch \ (\X \ Pow(chain(S)) - {0}. X); X \ chain(S); X \ maxchain(S) |] - ==> ch ` super(S,X) \ super(S,X)" + "\ch \ (\X \ Pow(chain(S)) - {0}. X); X \ chain(S); X \ maxchain(S)\ + \ ch ` super(S,X) \ super(S,X)" apply (erule apply_type) apply (unfold super_def maxchain_def, blast) done lemma choice_not_equals: - "[| ch \ (\X \ Pow(chain(S)) - {0}. X); X \ chain(S); X \ maxchain(S) |] - ==> ch ` super(S,X) \ X" + "\ch \ (\X \ Pow(chain(S)) - {0}. X); X \ chain(S); X \ maxchain(S)\ + \ ch ` super(S,X) \ X" apply (rule notI) apply (drule choice_super, assumption, assumption) apply (simp add: super_def) @@ -213,7 +213,7 @@ text\This justifies Definition 4.4\ lemma Hausdorff_next_exists: - "ch \ (\X \ Pow(chain(S))-{0}. X) ==> + "ch \ (\X \ Pow(chain(S))-{0}. X) \ \next \ increasing(S). \X \ Pow(S). next`X = if(X \ chain(S)-maxchain(S), ch`super(S,X), X)" apply (rule_tac x="\X\Pow(S). @@ -236,12 +236,12 @@ text\Lemma 4\ lemma TFin_chain_lemma4: - "[| c \ TFin(S,next); + "\c \ TFin(S,next); ch \ (\X \ Pow(chain(S))-{0}. X); next \ increasing(S); \X \ Pow(S). next`X = - if(X \ chain(S)-maxchain(S), ch`super(S,X), X) |] - ==> c \ chain(S)" + if(X \ chain(S)-maxchain(S), ch`super(S,X), X)\ + \ c \ chain(S)" apply (erule TFin_induct) apply (simp (no_asm_simp) add: chain_subset_Pow [THEN subsetD, THEN PowD] choice_super [THEN super_subset_chain [THEN subsetD]]) @@ -277,10 +277,10 @@ text\Used in the proof of Zorn's Lemma\ lemma chain_extend: - "[| c \ chain(A); z \ A; \x \ c. x<=z |] ==> cons(z,c) \ chain(A)" + "\c \ chain(A); z \ A; \x \ c. x<=z\ \ cons(z,c) \ chain(A)" by (unfold chain_def, blast) -lemma Zorn: "\c \ chain(S). \(c) \ S ==> \y \ S. \z \ S. y<=z \ y=z" +lemma Zorn: "\c \ chain(S). \(c) \ S \ \y \ S. \z \ S. y<=z \ y=z" apply (rule Hausdorff [THEN exE]) apply (simp add: maxchain_def) apply (rename_tac c) @@ -299,7 +299,7 @@ text \Alternative version of Zorn's Lemma\ theorem Zorn2: - "\c \ chain(S). \y \ S. \x \ c. x \ y ==> \y \ S. \z \ S. y<=z \ y=z" + "\c \ chain(S). \y \ S. \x \ c. x \ y \ \y \ S. \z \ S. y<=z \ y=z" apply (cut_tac Hausdorff maxchain_subset_chain) apply (erule exE) apply (drule subsetD, assumption) @@ -321,8 +321,8 @@ text\Lemma 5\ lemma TFin_well_lemma5: - "[| n \ TFin(S,next); Z \ TFin(S,next); z:Z; ~ \(Z) \ Z |] - ==> \m \ Z. n \ m" + "\n \ TFin(S,next); Z \ TFin(S,next); z:Z; \ \(Z) \ Z\ + \ \m \ Z. n \ m" apply (erule TFin_induct) prefer 2 apply blast txt\second induction step is easy\ apply (rule ballI) @@ -332,7 +332,7 @@ done text\Well-ordering of \<^term>\TFin(S,next)\\ -lemma well_ord_TFin_lemma: "[| Z \ TFin(S,next); z \ Z |] ==> \(Z) \ Z" +lemma well_ord_TFin_lemma: "\Z \ TFin(S,next); z \ Z\ \ \(Z) \ Z" apply (rule classical) apply (subgoal_tac "Z = {\(TFin (S,next))}") apply (simp (no_asm_simp) add: Inter_singleton) @@ -344,7 +344,7 @@ text\This theorem just packages the previous result\ lemma well_ord_TFin: "next \ increasing(S) - ==> well_ord(TFin(S,next), Subset_rel(TFin(S,next)))" + \ well_ord(TFin(S,next), Subset_rel(TFin(S,next)))" apply (rule well_ordI) apply (unfold Subset_rel_def linear_def) txt\Prove the well-foundedness goal\ @@ -364,14 +364,14 @@ text\* Defining the "next" operation for Zermelo's Theorem *\ lemma choice_Diff: - "[| ch \ (\X \ Pow(S) - {0}. X); X \ S; X\S |] ==> ch ` (S-X) \ S-X" + "\ch \ (\X \ Pow(S) - {0}. X); X \ S; X\S\ \ ch ` (S-X) \ S-X" apply (erule apply_type) apply (blast elim!: equalityE) done text\This justifies Definition 6.1\ lemma Zermelo_next_exists: - "ch \ (\X \ Pow(S)-{0}. X) ==> + "ch \ (\X \ Pow(S)-{0}. X) \ \next \ increasing(S). \X \ Pow(S). next`X = (if X=S then S else cons(ch`(S-X), X))" apply (rule_tac x="\X\Pow(S). if X=S then S else cons(ch`(S-X), X)" @@ -391,10 +391,10 @@ text\The construction of the injection\ lemma choice_imp_injection: - "[| ch \ (\X \ Pow(S)-{0}. X); + "\ch \ (\X \ Pow(S)-{0}. X); next \ increasing(S); - \X \ Pow(S). next`X = if(X=S, S, cons(ch`(S-X), X)) |] - ==> (\ x \ S. \({y \ TFin(S,next). x \ y})) + \X \ Pow(S). next`X = if(X=S, S, cons(ch`(S-X), X))\ + \ (\ x \ S. \({y \ TFin(S,next). x \ y})) \ inj(S, TFin(S,next) - {S})" apply (rule_tac d = "%y. ch` (S-y) " in lam_injective) apply (rule DiffI) @@ -406,7 +406,7 @@ prefer 2 apply (blast elim: equalityE) txt\For proving \x \ next`\(...)\. Abrial and Laffitte's justification appears to be faulty.\ -apply (subgoal_tac "~ next ` Union({y \ TFin (S,next) . x \ y}) +apply (subgoal_tac "\ next ` Union({y \ TFin (S,next) . x \ y}) \ \({y \ TFin (S,next) . x \ y}) ") prefer 2 apply (simp del: Union_iff @@ -439,7 +439,7 @@ "Chain(r) = {A \ Pow(field(r)). \a\A. \b\A. \ r | \ r}" lemma mono_Chain: - "r \ s ==> Chain(r) \ Chain(s)" + "r \ s \ Chain(r) \ Chain(s)" unfolding Chain_def by blast