diff -r 2e48182cc82c -r cf58b5b794b2 src/HOL/ex/Set_Theory.thy --- a/src/HOL/ex/Set_Theory.thy Sat Dec 26 15:44:14 2015 +0100 +++ b/src/HOL/ex/Set_Theory.thy Sat Dec 26 15:59:27 2015 +0100 @@ -31,14 +31,14 @@ by blast -subsection \Examples for the @{text blast} paper\ +subsection \Examples for the \blast\ paper\ lemma "(\x \ C. f x \ g x) = \(f ` C) \ \(g ` C)" - -- \Union-image, called @{text Un_Union_image} in Main HOL\ + \ \Union-image, called \Un_Union_image\ in Main HOL\ by blast lemma "(\x \ C. f x \ g x) = \(f ` C) \ \(g ` C)" - -- \Inter-image, called @{text Int_Inter_image} in Main HOL\ + \ \Inter-image, called \Int_Inter_image\ in Main HOL\ by blast lemma singleton_example_1: @@ -47,30 +47,30 @@ lemma singleton_example_2: "\x \ S. \S \ x \ \z. S \ {z}" - -- \Variant of the problem above.\ + \ \Variant of the problem above.\ by blast lemma "\!x. f (g x) = x \ \!y. g (f y) = y" - -- \A unique fixpoint theorem --- @{text fast}/@{text best}/@{text meson} all fail.\ + \ \A unique fixpoint theorem --- \fast\/\best\/\meson\ all fail.\ by metis subsection \Cantor's Theorem: There is no surjection from a set to its powerset\ lemma cantor1: "\ (\f:: 'a \ 'a set. \S. \x. f x = S)" - -- \Requires best-first search because it is undirectional.\ + \ \Requires best-first search because it is undirectional.\ by best schematic_goal "\f:: 'a \ 'a set. \x. f x \ ?S f" - -- \This form displays the diagonal term.\ + \ \This form displays the diagonal term.\ by best schematic_goal "?S \ range (f :: 'a \ 'a set)" - -- \This form exploits the set constructs.\ + \ \This form exploits the set constructs.\ by (rule notI, erule rangeE, best) schematic_goal "?S \ range (f :: 'a \ 'a set)" - -- \Or just this!\ + \ \Or just this!\ by best @@ -102,7 +102,7 @@ \ \h:: 'a \ 'b. inj h \ surj h" apply (rule decomposition [where f=f and g=g, THEN exE]) apply (rule_tac x = "(\z. if z \ x then f z else inv g z)" in exI) - --\The term above can be synthesized by a sufficiently detailed proof.\ + \\The term above can be synthesized by a sufficiently detailed proof.\ apply (rule bij_if_then_else) apply (rule_tac [4] refl) apply (rule_tac [2] inj_on_inv_into) @@ -166,38 +166,38 @@ \ lemma "\A. (\x \ A. x \ (0::int))" - -- \Example 1, page 295.\ + \ \Example 1, page 295.\ by force lemma "D \ F \ \G. \A \ G. \B \ F. A \ B" - -- \Example 2.\ + \ \Example 2.\ by force lemma "P a \ \A. (\x \ A. P x) \ (\y. y \ A)" - -- \Example 3.\ + \ \Example 3.\ by force lemma "a < b \ b < (c::int) \ \A. a \ A \ b \ A \ c \ A" - -- \Example 4.\ - by auto --\slow\ + \ \Example 4.\ + by auto \\slow\ lemma "P (f b) \ \s A. (\x \ A. P x) \ f s \ A" - -- \Example 5, page 298.\ + \ \Example 5, page 298.\ by force lemma "P (f b) \ \s A. (\x \ A. P x) \ f s \ A" - -- \Example 6.\ + \ \Example 6.\ by force lemma "\A. a \ A" - -- \Example 7.\ + \ \Example 7.\ by force lemma "(\u v. u < (0::int) \ u \ abs v) \ (\A::int set. -2 \ A & (\y. abs y \ A))" - -- \Example 8 needs a small hint.\ + \ \Example 8 needs a small hint.\ by force - -- \not @{text blast}, which can't simplify @{text "-2 < 0"}\ + \ \not \blast\, which can't simplify \-2 < 0\\ text \Example 9 omitted (requires the reals).\ @@ -205,19 +205,19 @@ lemma "(\A. 0 \ A \ (\x \ A. Suc x \ A) \ n \ A) \ P 0 \ (\x. P x \ P (Suc x)) \ P n" - -- \Example 11: needs a hint.\ + \ \Example 11: needs a hint.\ by(metis nat.induct) lemma "(\A. (0, 0) \ A \ (\x y. (x, y) \ A \ (Suc x, Suc y) \ A) \ (n, m) \ A) \ P n \ P m" - -- \Example 12.\ + \ \Example 12.\ by auto lemma "(\x. (\u. x = 2 * u) = (\ (\v. Suc x = 2 * v))) \ (\A. \x. (x \ A) = (Suc x \ A))" - -- \Example EO1: typo in article, and with the obvious fix it seems + \ \Example EO1: typo in article, and with the obvious fix it seems to require arithmetic reasoning.\ apply clarify apply (rule_tac x = "{x. \u. x = 2 * u}" in exI, auto)