isabelle update_cartouches;
authorwenzelm
Tue Oct 06 17:47:28 2015 +0200 (2015-10-06)
changeset 613435b5656a63bd6
parent 61342 b98cd131e2b5
child 61344 ebf296fe88d7
child 61352 201c21438177
isabelle update_cartouches;
src/HOL/ex/Adhoc_Overloading_Examples.thy
src/HOL/ex/Arith_Examples.thy
src/HOL/ex/Ballot.thy
src/HOL/ex/BinEx.thy
src/HOL/ex/Birthday_Paradox.thy
src/HOL/ex/Bubblesort.thy
src/HOL/ex/CTL.thy
src/HOL/ex/Case_Product.thy
src/HOL/ex/Chinese.thy
src/HOL/ex/Classical.thy
src/HOL/ex/Code_Binary_Nat_examples.thy
src/HOL/ex/Coherent.thy
src/HOL/ex/Dedekind_Real.thy
src/HOL/ex/Erdoes_Szekeres.thy
src/HOL/ex/Eval_Examples.thy
src/HOL/ex/Executable_Relation.thy
src/HOL/ex/Execute_Choice.thy
src/HOL/ex/FinFunPred.thy
src/HOL/ex/Fundefs.thy
src/HOL/ex/Gauge_Integration.thy
src/HOL/ex/Groebner_Examples.thy
src/HOL/ex/Guess.thy
src/HOL/ex/HarmonicSeries.thy
src/HOL/ex/Hex_Bin_Examples.thy
src/HOL/ex/Induction_Schema.thy
src/HOL/ex/Intuitionistic.thy
src/HOL/ex/Lagrange.thy
src/HOL/ex/List_to_Set_Comprehension_Examples.thy
src/HOL/ex/LocaleTest2.thy
src/HOL/ex/MT.thy
src/HOL/ex/MergeSort.thy
src/HOL/ex/Meson_Test.thy
src/HOL/ex/MonoidGroup.thy
src/HOL/ex/NatSum.thy
src/HOL/ex/Normalization_by_Evaluation.thy
src/HOL/ex/Parallel_Example.thy
src/HOL/ex/PresburgerEx.thy
src/HOL/ex/Primrec.thy
src/HOL/ex/Pythagoras.thy
src/HOL/ex/Quicksort.thy
src/HOL/ex/Records.thy
src/HOL/ex/Reflection_Examples.thy
src/HOL/ex/Refute_Examples.thy
src/HOL/ex/SAT_Examples.thy
src/HOL/ex/Serbian.thy
src/HOL/ex/Set_Comprehension_Pointfree_Examples.thy
src/HOL/ex/Set_Theory.thy
src/HOL/ex/Simproc_Tests.thy
src/HOL/ex/Simps_Case_Conv_Examples.thy
src/HOL/ex/Sqrt_Script.thy
src/HOL/ex/Sudoku.thy
src/HOL/ex/Sum_of_Powers.thy
src/HOL/ex/Tarski.thy
src/HOL/ex/Termination.thy
src/HOL/ex/ThreeDivides.thy
src/HOL/ex/Transfer_Ex.thy
src/HOL/ex/Transfer_Int_Nat.thy
src/HOL/ex/Transitive_Closure_Table_Ex.thy
src/HOL/ex/Tree23.thy
src/HOL/ex/Unification.thy
src/HOL/ex/While_Combinator_Example.thy
     1.1 --- a/src/HOL/ex/Adhoc_Overloading_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
     1.2 +++ b/src/HOL/ex/Adhoc_Overloading_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
     1.3 @@ -2,7 +2,7 @@
     1.4      Author:     Christian Sternagel
     1.5  *)
     1.6  
     1.7 -section {* Ad Hoc Overloading *}
     1.8 +section \<open>Ad Hoc Overloading\<close>
     1.9  
    1.10  theory Adhoc_Overloading_Examples
    1.11  imports
    1.12 @@ -11,30 +11,30 @@
    1.13    "~~/src/HOL/Library/Infinite_Set"
    1.14  begin
    1.15  
    1.16 -text {*Adhoc overloading allows to overload a constant depending on
    1.17 +text \<open>Adhoc overloading allows to overload a constant depending on
    1.18  its type. Typically this involves to introduce an uninterpreted
    1.19  constant (used for input and output) and then add some variants (used
    1.20 -internally).*}
    1.21 +internally).\<close>
    1.22  
    1.23 -subsection {* Plain Ad Hoc Overloading *}
    1.24 +subsection \<open>Plain Ad Hoc Overloading\<close>
    1.25  
    1.26 -text {*Consider the type of first-order terms.*}
    1.27 +text \<open>Consider the type of first-order terms.\<close>
    1.28  datatype ('a, 'b) "term" =
    1.29    Var 'b |
    1.30    Fun 'a "('a, 'b) term list"
    1.31  
    1.32 -text {*The set of variables of a term might be computed as follows.*}
    1.33 +text \<open>The set of variables of a term might be computed as follows.\<close>
    1.34  fun term_vars :: "('a, 'b) term \<Rightarrow> 'b set" where
    1.35    "term_vars (Var x) = {x}" |
    1.36    "term_vars (Fun f ts) = \<Union>set (map term_vars ts)"
    1.37  
    1.38 -text {*However, also for \emph{rules} (i.e., pairs of terms) and term
    1.39 +text \<open>However, also for \emph{rules} (i.e., pairs of terms) and term
    1.40  rewrite systems (i.e., sets of rules), the set of variables makes
    1.41 -sense. Thus we introduce an unspecified constant @{text vars}.*}
    1.42 +sense. Thus we introduce an unspecified constant @{text vars}.\<close>
    1.43  
    1.44  consts vars :: "'a \<Rightarrow> 'b set"
    1.45  
    1.46 -text {*Which is then overloaded with variants for terms, rules, and TRSs.*}
    1.47 +text \<open>Which is then overloaded with variants for terms, rules, and TRSs.\<close>
    1.48  adhoc_overloading
    1.49    vars term_vars
    1.50  
    1.51 @@ -56,20 +56,20 @@
    1.52  
    1.53  value "vars {(Var 1, Var 0)}"
    1.54  
    1.55 -text {*Sometimes it is necessary to add explicit type constraints
    1.56 -before a variant can be determined.*}
    1.57 +text \<open>Sometimes it is necessary to add explicit type constraints
    1.58 +before a variant can be determined.\<close>
    1.59  (*value "vars R" (*has multiple instances*)*)
    1.60  value "vars (R :: (('a, 'b) term \<times> ('a, 'b) term) set)"
    1.61  
    1.62 -text {*It is also possible to remove variants.*}
    1.63 +text \<open>It is also possible to remove variants.\<close>
    1.64  no_adhoc_overloading
    1.65    vars term_vars rule_vars 
    1.66  
    1.67  (*value "vars (Var 1)" (*does not have an instance*)*)
    1.68  
    1.69 -text {*As stated earlier, the overloaded constant is only used for
    1.70 +text \<open>As stated earlier, the overloaded constant is only used for
    1.71  input and output. Internally, always a variant is used, as can be
    1.72 -observed by the configuration option @{text show_variants}.*}
    1.73 +observed by the configuration option @{text show_variants}.\<close>
    1.74  
    1.75  adhoc_overloading
    1.76    vars term_vars
    1.77 @@ -79,10 +79,10 @@
    1.78  term "vars (Var 1)" (*which yields: "term_vars (Var 1)"*)
    1.79  
    1.80  
    1.81 -subsection {* Adhoc Overloading inside Locales *}
    1.82 +subsection \<open>Adhoc Overloading inside Locales\<close>
    1.83  
    1.84 -text {*As example we use permutations that are parametrized over an
    1.85 -atom type @{typ "'a"}.*}
    1.86 +text \<open>As example we use permutations that are parametrized over an
    1.87 +atom type @{typ "'a"}.\<close>
    1.88  
    1.89  definition perms :: "('a \<Rightarrow> 'a) set" where
    1.90    "perms = {f. bij f \<and> finite {x. f x \<noteq> x}}"
    1.91 @@ -90,7 +90,7 @@
    1.92  typedef 'a perm = "perms :: ('a \<Rightarrow> 'a) set"
    1.93    by standard (auto simp: perms_def)
    1.94  
    1.95 -text {*First we need some auxiliary lemmas.*}
    1.96 +text \<open>First we need some auxiliary lemmas.\<close>
    1.97  lemma permsI [Pure.intro]:
    1.98    assumes "bij f" and "MOST x. f x = x"
    1.99    shows "f \<in> perms"
   1.100 @@ -170,16 +170,16 @@
   1.101    Rep_perm_uminus
   1.102  
   1.103  
   1.104 -section {* Permutation Types *}
   1.105 +section \<open>Permutation Types\<close>
   1.106  
   1.107 -text {*We want to be able to apply permutations to arbitrary types. To
   1.108 +text \<open>We want to be able to apply permutations to arbitrary types. To
   1.109  this end we introduce a constant @{text PERMUTE} together with
   1.110 -convenient infix syntax.*}
   1.111 +convenient infix syntax.\<close>
   1.112  
   1.113  consts PERMUTE :: "'a perm \<Rightarrow> 'b \<Rightarrow> 'b" (infixr "\<bullet>" 75)
   1.114  
   1.115 -text {*Then we add a locale for types @{typ 'b} that support
   1.116 -appliciation of permutations.*}
   1.117 +text \<open>Then we add a locale for types @{typ 'b} that support
   1.118 +appliciation of permutations.\<close>
   1.119  locale permute =
   1.120    fixes permute :: "'a perm \<Rightarrow> 'b \<Rightarrow> 'b"
   1.121    assumes permute_zero [simp]: "permute 0 x = x"
   1.122 @@ -191,7 +191,7 @@
   1.123  
   1.124  end
   1.125  
   1.126 -text {*Permuting atoms.*}
   1.127 +text \<open>Permuting atoms.\<close>
   1.128  definition permute_atom :: "'a perm \<Rightarrow> 'a \<Rightarrow> 'a" where
   1.129    "permute_atom p a = (Rep_perm p) a"
   1.130  
   1.131 @@ -201,7 +201,7 @@
   1.132  interpretation atom_permute: permute permute_atom
   1.133    by standard (simp_all add: permute_atom_def Rep_perm_simps)
   1.134  
   1.135 -text {*Permuting permutations.*}
   1.136 +text \<open>Permuting permutations.\<close>
   1.137  definition permute_perm :: "'a perm \<Rightarrow> 'a perm \<Rightarrow> 'a perm" where
   1.138    "permute_perm p q = p + q - p"
   1.139  
   1.140 @@ -215,7 +215,7 @@
   1.141    apply (simp only: diff_conv_add_uminus minus_add add.assoc)
   1.142    done
   1.143  
   1.144 -text {*Permuting functions.*}
   1.145 +text \<open>Permuting functions.\<close>
   1.146  locale fun_permute =
   1.147    dom: permute perm1 + ran: permute perm2
   1.148    for perm1 :: "'a perm \<Rightarrow> 'b \<Rightarrow> 'b"
     2.1 --- a/src/HOL/ex/Arith_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
     2.2 +++ b/src/HOL/ex/Arith_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
     2.3 @@ -2,13 +2,13 @@
     2.4      Author: Tjark Weber
     2.5  *)
     2.6  
     2.7 -section {* Arithmetic *}
     2.8 +section \<open>Arithmetic\<close>
     2.9  
    2.10  theory Arith_Examples
    2.11  imports Main
    2.12  begin
    2.13  
    2.14 -text {*
    2.15 +text \<open>
    2.16    The @{text arith} method is used frequently throughout the Isabelle
    2.17    distribution.  This file merely contains some additional tests and special
    2.18    corner cases.  Some rather technical remarks:
    2.19 @@ -26,12 +26,12 @@
    2.20    at the moment (namely inequalities only).  (On the other hand, it
    2.21    does take apart conjunctions, which @{ML Lin_Arith.simple_tac} currently
    2.22    does not do.)
    2.23 -*}
    2.24 +\<close>
    2.25  
    2.26  
    2.27 -subsection {* Splitting of Operators: @{term max}, @{term min}, @{term abs},
    2.28 +subsection \<open>Splitting of Operators: @{term max}, @{term min}, @{term abs},
    2.29             @{term minus}, @{term nat}, @{term Divides.mod},
    2.30 -           @{term divide} *}
    2.31 +           @{term divide}\<close>
    2.32  
    2.33  lemma "(i::nat) <= max i j"
    2.34    by linarith
    2.35 @@ -72,7 +72,7 @@
    2.36  lemma "abs (abs (i::int)) = abs i"
    2.37    by linarith
    2.38  
    2.39 -text {* Also testing subgoals with bound variables. *}
    2.40 +text \<open>Also testing subgoals with bound variables.\<close>
    2.41  
    2.42  lemma "!!x. (x::nat) <= y ==> x - y = 0"
    2.43    by linarith
    2.44 @@ -131,7 +131,7 @@
    2.45    by linarith
    2.46  
    2.47  
    2.48 -subsection {* Meta-Logic *}
    2.49 +subsection \<open>Meta-Logic\<close>
    2.50  
    2.51  lemma "x < Suc y == x <= y"
    2.52    by linarith
    2.53 @@ -140,7 +140,7 @@
    2.54    by linarith
    2.55  
    2.56  
    2.57 -subsection {* Various Other Examples *}
    2.58 +subsection \<open>Various Other Examples\<close>
    2.59  
    2.60  lemma "(x < Suc y) = (x <= y)"
    2.61    by linarith
    2.62 @@ -151,8 +151,8 @@
    2.63  lemma "(x::nat) < y & y < z ==> x < z"
    2.64    by linarith
    2.65  
    2.66 -text {* This example involves no arithmetic at all, but is solved by
    2.67 -  preprocessing (i.e. NNF normalization) alone. *}
    2.68 +text \<open>This example involves no arithmetic at all, but is solved by
    2.69 +  preprocessing (i.e. NNF normalization) alone.\<close>
    2.70  
    2.71  lemma "(P::bool) = Q ==> Q = P"
    2.72    by linarith
    2.73 @@ -210,7 +210,7 @@
    2.74  (* by (tactic {* Lin_Arith.simple_tac 1 *}) *)
    2.75  oops
    2.76  
    2.77 -text {* Constants. *}
    2.78 +text \<open>Constants.\<close>
    2.79  
    2.80  lemma "(0::nat) < 1"
    2.81    by linarith
    2.82 @@ -224,13 +224,13 @@
    2.83  lemma "(47::int) + 11 < 8 * 15"
    2.84    by linarith
    2.85  
    2.86 -text {* Splitting of inequalities of different type. *}
    2.87 +text \<open>Splitting of inequalities of different type.\<close>
    2.88  
    2.89  lemma "[| (a::nat) ~= b; (i::int) ~= j; a < 2; b < 2 |] ==>
    2.90    a + b <= nat (max (abs i) (abs j))"
    2.91    by linarith
    2.92  
    2.93 -text {* Again, but different order. *}
    2.94 +text \<open>Again, but different order.\<close>
    2.95  
    2.96  lemma "[| (i::int) ~= j; (a::nat) ~= b; a < 2; b < 2 |] ==>
    2.97    a + b <= nat (max (abs i) (abs j))"
     3.1 --- a/src/HOL/ex/Ballot.thy	Tue Oct 06 17:46:07 2015 +0200
     3.2 +++ b/src/HOL/ex/Ballot.thy	Tue Oct 06 17:47:28 2015 +0200
     3.3 @@ -3,7 +3,7 @@
     3.4       Author: Johannes Hölzl <hoelzl@in.tum.de>
     3.5  *)
     3.6  
     3.7 -section {* Bertrand's Ballot Theorem *}
     3.8 +section \<open>Bertrand's Ballot Theorem\<close>
     3.9  
    3.10  theory Ballot
    3.11  imports
    3.12 @@ -11,7 +11,7 @@
    3.13    "~~/src/HOL/Library/FuncSet"
    3.14  begin
    3.15  
    3.16 -subsection {* Preliminaries *}
    3.17 +subsection \<open>Preliminaries\<close>
    3.18  
    3.19  lemma card_bij':
    3.20    assumes "f \<in> A \<rightarrow> B" "\<And>x. x \<in> A \<Longrightarrow> g (f x) = x"
    3.21 @@ -22,9 +22,9 @@
    3.22    apply fact+
    3.23    done
    3.24  
    3.25 -subsection {* Formalization of Problem Statement *}
    3.26 +subsection \<open>Formalization of Problem Statement\<close>
    3.27  
    3.28 -subsubsection {* Basic Definitions *}
    3.29 +subsubsection \<open>Basic Definitions\<close>
    3.30  
    3.31  datatype vote = A | B
    3.32  
    3.33 @@ -38,7 +38,7 @@
    3.34        card {x\<in>{1..a+b}. f x = A} = a \<and> card {x\<in>{1..a+b}. f x = B} = b \<and>
    3.35        (\<forall>m\<in>{1..a+b}. card {x\<in>{1..m}. f x = A} > card {x\<in>{1..m}. f x = B})}"
    3.36  
    3.37 -subsubsection {* Equivalence with Set Cardinality *}
    3.38 +subsubsection \<open>Equivalence with Set Cardinality\<close>
    3.39  
    3.40  lemma Collect_on_transfer:
    3.41    assumes "rel_set R X Y"
    3.42 @@ -139,9 +139,9 @@
    3.43  lemma all_countings: "all_countings a b = (a + b) choose a"
    3.44    unfolding all_countings_set by (simp add: n_subsets)
    3.45  
    3.46 -subsection {* Facts About @{term valid_countings} *}
    3.47 +subsection \<open>Facts About @{term valid_countings}\<close>
    3.48  
    3.49 -subsubsection {* Non-Recursive Cases *}
    3.50 +subsubsection \<open>Non-Recursive Cases\<close>
    3.51  
    3.52  lemma card_V_eq_a: "V \<subseteq> {0..<a} \<Longrightarrow> card V = a \<longleftrightarrow> V = {0..<a}"
    3.53    using card_subset_eq[of "{0..<a}" V] by auto
    3.54 @@ -187,7 +187,7 @@
    3.55          if "m \<le> Suc ?l" for m
    3.56          using that by auto }
    3.57      then show "insert ?l \<in> {V \<in> Pow {0..<a + Suc b}. card V = a \<and> ?Q V (a + Suc b)} \<rightarrow> ?V (\<lambda>V. ?l \<in> V)"
    3.58 -      using `b < a` by auto
    3.59 +      using \<open>b < a\<close> by auto
    3.60    qed auto
    3.61    also have "card (?V (\<lambda>V. ?l \<notin> V)) = valid_countings (Suc a) b"
    3.62      unfolding valid_countings_set
    3.63 @@ -196,7 +196,7 @@
    3.64      then have [simp]: "V \<subseteq> {0..<Suc ?l}"
    3.65        by auto
    3.66      show "?Q V (Suc ?l) = ?Q V (Suc a + b)"
    3.67 -      using `b<a` by (simp add: Int_absorb1 Icc_Suc2)
    3.68 +      using \<open>b<a\<close> by (simp add: Int_absorb1 Icc_Suc2)
    3.69    qed (auto simp: subset_eq less_Suc_eq)
    3.70    finally show ?thesis
    3.71      by simp
    3.72 @@ -224,9 +224,9 @@
    3.73          (Suc a * a - Suc a * Suc b) + (Suc a * Suc b - Suc b * b)"
    3.74          by (simp add: sign_simps)
    3.75        also have "\<dots> = (Suc a * a + (Suc a * Suc b - Suc b * b)) - Suc a * Suc b"
    3.76 -        using `b<a` by (intro add_diff_assoc2 mult_mono) auto
    3.77 +        using \<open>b<a\<close> by (intro add_diff_assoc2 mult_mono) auto
    3.78        also have "\<dots> = (Suc a * a + Suc a * Suc b) - Suc b * b - Suc a * Suc b"
    3.79 -        using `b<a` by (intro arg_cong2[where f="op -"] add_diff_assoc mult_mono) auto
    3.80 +        using \<open>b<a\<close> by (intro arg_cong2[where f="op -"] add_diff_assoc mult_mono) auto
    3.81        also have "\<dots> = (Suc a * Suc (a + b)) - (Suc b * Suc (a + b))"
    3.82          by (simp add: sign_simps)
    3.83        finally have rearrange: "Suc a * (a - Suc b) + (Suc a - b) * Suc b = (Suc a - Suc b) * Suc (a + b)"
    3.84 @@ -234,7 +234,7 @@
    3.85  
    3.86        have "(Suc a * Suc (a + b)) * ((Suc a + Suc b) * valid_countings (Suc a) (Suc b)) =
    3.87          (Suc a + Suc b) * Suc a * ((a + Suc b) * valid_countings a (Suc b) + (Suc a + b) * valid_countings (Suc a) b)"
    3.88 -        unfolding valid_countings_Suc_Suc[OF `b < a`] by (simp add: field_simps)
    3.89 +        unfolding valid_countings_Suc_Suc[OF \<open>b < a\<close>] by (simp add: field_simps)
    3.90        also have "... = (Suc a + Suc b) * ((a - Suc b) * (Suc a * (Suc (a + b) choose a)) +
    3.91          (Suc a - b) * (Suc a * (Suc (a + b) choose Suc a)))"
    3.92          unfolding Suc_a Suc_b by (simp add: field_simps)
    3.93 @@ -254,7 +254,7 @@
    3.94    "valid_countings a b = (if a + b = 0 then 1 else ((a - b) * ((a + b) choose a)) div (a + b))"
    3.95    by (simp add: valid_countings[symmetric] valid_countings_a_0)
    3.96  
    3.97 -subsection {* Relation Between @{term valid_countings} and @{term all_countings} *}
    3.98 +subsection \<open>Relation Between @{term valid_countings} and @{term all_countings}\<close>
    3.99  
   3.100  lemma main_nat: "(a + b) * valid_countings a b = (a - b) * all_countings a b"
   3.101    unfolding valid_countings all_countings ..
   3.102 @@ -264,10 +264,10 @@
   3.103    shows "valid_countings a b = (a - b) / (a + b) * all_countings a b"
   3.104  using assms
   3.105  proof -
   3.106 -  from main_nat[of a b] `b < a` have
   3.107 +  from main_nat[of a b] \<open>b < a\<close> have
   3.108      "(real a + real b) * real (valid_countings a b) = (real a - real b) * real (all_countings a b)"
   3.109      by (simp only: real_of_nat_add[symmetric] real_of_nat_mult[symmetric]) auto
   3.110 -  from this `b < a` show ?thesis
   3.111 +  from this \<open>b < a\<close> show ?thesis
   3.112      by (subst mult_left_cancel[of "real a + real b", symmetric]) auto
   3.113  qed
   3.114  
   3.115 @@ -282,7 +282,7 @@
   3.116        by (auto simp add: valid_countings_a_0 all_countings valid_countings_eq_zero)
   3.117  qed
   3.118  
   3.119 -subsubsection {* Executable Definition *}
   3.120 +subsubsection \<open>Executable Definition\<close>
   3.121  
   3.122  declare all_countings_def [code del]
   3.123  declare all_countings[code]
   3.124 @@ -295,7 +295,7 @@
   3.125  value "all_countings 2 4"
   3.126  value "all_countings 4 2"
   3.127  
   3.128 -subsubsection {* Executable Definition *}
   3.129 +subsubsection \<open>Executable Definition\<close>
   3.130  
   3.131  declare valid_countings_def [code del]
   3.132  
     4.1 --- a/src/HOL/ex/BinEx.thy	Tue Oct 06 17:46:07 2015 +0200
     4.2 +++ b/src/HOL/ex/BinEx.thy	Tue Oct 06 17:47:28 2015 +0200
     4.3 @@ -3,13 +3,13 @@
     4.4      Copyright   1998  University of Cambridge
     4.5  *)
     4.6  
     4.7 -section {* Binary arithmetic examples *}
     4.8 +section \<open>Binary arithmetic examples\<close>
     4.9  
    4.10  theory BinEx
    4.11  imports Complex_Main
    4.12  begin
    4.13  
    4.14 -subsection {* Regression Testing for Cancellation Simprocs *}
    4.15 +subsection \<open>Regression Testing for Cancellation Simprocs\<close>
    4.16  
    4.17  lemma "l + 2 + 2 + 2 + (l + 2) + (oo + 2) = (uu::int)"
    4.18  apply simp  oops
    4.19 @@ -83,7 +83,7 @@
    4.20  apply simp oops
    4.21  
    4.22  
    4.23 -subsection {* Arithmetic Method Tests *}
    4.24 +subsection \<open>Arithmetic Method Tests\<close>
    4.25  
    4.26  
    4.27  lemma "!!a::int. [| a <= b; c <= d; x+y<z |] ==> a+c <= b+d"
    4.28 @@ -129,9 +129,9 @@
    4.29  
    4.30  
    4.31  
    4.32 -subsection {* The Integers *}
    4.33 +subsection \<open>The Integers\<close>
    4.34  
    4.35 -text {* Addition *}
    4.36 +text \<open>Addition\<close>
    4.37  
    4.38  lemma "(13::int) + 19 = 32"
    4.39    by simp
    4.40 @@ -146,7 +146,7 @@
    4.41    by simp
    4.42  
    4.43  
    4.44 -text {* \medskip Negation *}
    4.45 +text \<open>\medskip Negation\<close>
    4.46  
    4.47  lemma "- (65745::int) = -65745"
    4.48    by simp
    4.49 @@ -155,7 +155,7 @@
    4.50    by simp
    4.51  
    4.52  
    4.53 -text {* \medskip Multiplication *}
    4.54 +text \<open>\medskip Multiplication\<close>
    4.55  
    4.56  lemma "(13::int) * 19 = 247"
    4.57    by simp
    4.58 @@ -187,12 +187,12 @@
    4.59  lemma "(1234567::int) \<le> 1234567"
    4.60    by simp
    4.61  
    4.62 -text{*No integer overflow!*}
    4.63 +text\<open>No integer overflow!\<close>
    4.64  lemma "1234567 * (1234567::int) < 1234567*1234567*1234567"
    4.65    by simp
    4.66  
    4.67  
    4.68 -text {* \medskip Quotient and Remainder *}
    4.69 +text \<open>\medskip Quotient and Remainder\<close>
    4.70  
    4.71  lemma "(10::int) div 3 = 3"
    4.72    by simp
    4.73 @@ -200,7 +200,7 @@
    4.74  lemma "(10::int) mod 3 = 1"
    4.75    by simp
    4.76  
    4.77 -text {* A negative divisor *}
    4.78 +text \<open>A negative divisor\<close>
    4.79  
    4.80  lemma "(10::int) div -3 = -4"
    4.81    by simp
    4.82 @@ -208,10 +208,10 @@
    4.83  lemma "(10::int) mod -3 = -2"
    4.84    by simp
    4.85  
    4.86 -text {*
    4.87 +text \<open>
    4.88    A negative dividend\footnote{The definition agrees with mathematical
    4.89    convention and with ML, but not with the hardware of most computers}
    4.90 -*}
    4.91 +\<close>
    4.92  
    4.93  lemma "(-10::int) div 3 = -4"
    4.94    by simp
    4.95 @@ -219,7 +219,7 @@
    4.96  lemma "(-10::int) mod 3 = 2"
    4.97    by simp
    4.98  
    4.99 -text {* A negative dividend \emph{and} divisor *}
   4.100 +text \<open>A negative dividend \emph{and} divisor\<close>
   4.101  
   4.102  lemma "(-10::int) div -3 = 3"
   4.103    by simp
   4.104 @@ -227,7 +227,7 @@
   4.105  lemma "(-10::int) mod -3 = -1"
   4.106    by simp
   4.107  
   4.108 -text {* A few bigger examples *}
   4.109 +text \<open>A few bigger examples\<close>
   4.110  
   4.111  lemma "(8452::int) mod 3 = 1"
   4.112    by simp
   4.113 @@ -239,7 +239,7 @@
   4.114    by simp
   4.115  
   4.116  
   4.117 -text {* \medskip Division by shifting *}
   4.118 +text \<open>\medskip Division by shifting\<close>
   4.119  
   4.120  lemma "10000000 div 2 = (5000000::int)"
   4.121    by simp
   4.122 @@ -260,7 +260,7 @@
   4.123    by simp
   4.124  
   4.125  
   4.126 -text {* \medskip Powers *}
   4.127 +text \<open>\medskip Powers\<close>
   4.128  
   4.129  lemma "2 ^ 10 = (1024::int)"
   4.130    by simp
   4.131 @@ -278,15 +278,15 @@
   4.132    by simp
   4.133  
   4.134  
   4.135 -subsection {* The Natural Numbers *}
   4.136 +subsection \<open>The Natural Numbers\<close>
   4.137  
   4.138 -text {* Successor *}
   4.139 +text \<open>Successor\<close>
   4.140  
   4.141  lemma "Suc 99999 = 100000"
   4.142    by simp
   4.143  
   4.144  
   4.145 -text {* \medskip Addition *}
   4.146 +text \<open>\medskip Addition\<close>
   4.147  
   4.148  lemma "(13::nat) + 19 = 32"
   4.149    by simp
   4.150 @@ -298,7 +298,7 @@
   4.151    by simp
   4.152  
   4.153  
   4.154 -text {* \medskip Subtraction *}
   4.155 +text \<open>\medskip Subtraction\<close>
   4.156  
   4.157  lemma "(32::nat) - 14 = 18"
   4.158    by simp
   4.159 @@ -313,7 +313,7 @@
   4.160    by simp
   4.161  
   4.162  
   4.163 -text {* \medskip Multiplication *}
   4.164 +text \<open>\medskip Multiplication\<close>
   4.165  
   4.166  lemma "(12::nat) * 11 = 132"
   4.167    by simp
   4.168 @@ -322,7 +322,7 @@
   4.169    by simp
   4.170  
   4.171  
   4.172 -text {* \medskip Quotient and Remainder *}
   4.173 +text \<open>\medskip Quotient and Remainder\<close>
   4.174  
   4.175  lemma "(10::nat) div 3 = 3"
   4.176    by simp
   4.177 @@ -343,7 +343,7 @@
   4.178    by simp
   4.179  
   4.180  
   4.181 -text {* \medskip Powers *}
   4.182 +text \<open>\medskip Powers\<close>
   4.183  
   4.184  lemma "2 ^ 12 = (4096::nat)"
   4.185    by simp
   4.186 @@ -361,7 +361,7 @@
   4.187    by simp
   4.188  
   4.189  
   4.190 -text {* \medskip Testing the cancellation of complementary terms *}
   4.191 +text \<open>\medskip Testing the cancellation of complementary terms\<close>
   4.192  
   4.193  lemma "y + (x + -x) = (0::int) + y"
   4.194    by simp
   4.195 @@ -391,9 +391,9 @@
   4.196    by simp
   4.197  
   4.198  
   4.199 -subsection{*Real Arithmetic*}
   4.200 +subsection\<open>Real Arithmetic\<close>
   4.201  
   4.202 -subsubsection {*Addition *}
   4.203 +subsubsection \<open>Addition\<close>
   4.204  
   4.205  lemma "(1359::real) + -2468 = -1109"
   4.206  by simp
   4.207 @@ -402,7 +402,7 @@
   4.208  by simp
   4.209  
   4.210  
   4.211 -subsubsection {*Negation *}
   4.212 +subsubsection \<open>Negation\<close>
   4.213  
   4.214  lemma "- (65745::real) = -65745"
   4.215  by simp
   4.216 @@ -411,7 +411,7 @@
   4.217  by simp
   4.218  
   4.219  
   4.220 -subsubsection {*Multiplication *}
   4.221 +subsubsection \<open>Multiplication\<close>
   4.222  
   4.223  lemma "(-84::real) * 51 = -4284"
   4.224  by simp
   4.225 @@ -423,7 +423,7 @@
   4.226  by simp
   4.227  
   4.228  
   4.229 -subsubsection {*Inequalities *}
   4.230 +subsubsection \<open>Inequalities\<close>
   4.231  
   4.232  lemma "(89::real) * 10 \<noteq> 889"
   4.233  by simp
   4.234 @@ -444,7 +444,7 @@
   4.235  by simp
   4.236  
   4.237  
   4.238 -subsubsection {*Powers *}
   4.239 +subsubsection \<open>Powers\<close>
   4.240  
   4.241  lemma "2 ^ 15 = (32768::real)"
   4.242  by simp
   4.243 @@ -462,7 +462,7 @@
   4.244  by simp
   4.245  
   4.246  
   4.247 -subsubsection {*Tests *}
   4.248 +subsubsection \<open>Tests\<close>
   4.249  
   4.250  lemma "(x + y = x) = (y = (0::real))"
   4.251  by arith
   4.252 @@ -748,7 +748,7 @@
   4.253  by linarith
   4.254  
   4.255  
   4.256 -subsection{*Complex Arithmetic*}
   4.257 +subsection\<open>Complex Arithmetic\<close>
   4.258  
   4.259  lemma "(1359 + 93746*ii) - (2468 + 46375*ii) = -1109 + 47371*ii"
   4.260  by simp
   4.261 @@ -756,8 +756,8 @@
   4.262  lemma "- (65745 + -47371*ii) = -65745 + 47371*ii"
   4.263  by simp
   4.264  
   4.265 -text{*Multiplication requires distributive laws.  Perhaps versions instantiated
   4.266 -to literal constants should be added to the simpset.*}
   4.267 +text\<open>Multiplication requires distributive laws.  Perhaps versions instantiated
   4.268 +to literal constants should be added to the simpset.\<close>
   4.269  
   4.270  lemma "(1 + ii) * (1 - ii) = 2"
   4.271  by (simp add: ring_distribs)
   4.272 @@ -768,8 +768,8 @@
   4.273  lemma "(-84 + 255*ii) + (51 * 255*ii) = -84 + 13260 * ii"
   4.274  by (simp add: ring_distribs)
   4.275  
   4.276 -text{*No inequalities or linear arithmetic: the complex numbers are unordered!*}
   4.277 +text\<open>No inequalities or linear arithmetic: the complex numbers are unordered!\<close>
   4.278  
   4.279 -text{*No powers (not supported yet)*}
   4.280 +text\<open>No powers (not supported yet)\<close>
   4.281  
   4.282  end
     5.1 --- a/src/HOL/ex/Birthday_Paradox.thy	Tue Oct 06 17:46:07 2015 +0200
     5.2 +++ b/src/HOL/ex/Birthday_Paradox.thy	Tue Oct 06 17:47:28 2015 +0200
     5.3 @@ -2,13 +2,13 @@
     5.4      Author: Lukas Bulwahn, TU Muenchen, 2007
     5.5  *)
     5.6  
     5.7 -section {* A Formulation of the Birthday Paradox *}
     5.8 +section \<open>A Formulation of the Birthday Paradox\<close>
     5.9  
    5.10  theory Birthday_Paradox
    5.11  imports Main "~~/src/HOL/Binomial" "~~/src/HOL/Library/FuncSet"
    5.12  begin
    5.13  
    5.14 -section {* Cardinality *}
    5.15 +section \<open>Cardinality\<close>
    5.16  
    5.17  lemma card_product_dependent:
    5.18    assumes "finite S"
    5.19 @@ -26,8 +26,8 @@
    5.20  next
    5.21    case (insert x S)
    5.22    { fix x
    5.23 -    from `finite T` have "finite (T - {x})" by auto
    5.24 -    from `finite S` this have "finite (extensional_funcset S (T - {x}))"
    5.25 +    from \<open>finite T\<close> have "finite (T - {x})" by auto
    5.26 +    from \<open>finite S\<close> this have "finite (extensional_funcset S (T - {x}))"
    5.27        by (rule finite_PiE)
    5.28      moreover
    5.29      have "{f : extensional_funcset S (T - {x}). inj_on f S} \<subseteq> (extensional_funcset S (T - {x}))" by auto
    5.30 @@ -35,15 +35,15 @@
    5.31        by (auto intro: finite_subset)
    5.32    } note finite_delete = this
    5.33    from insert have hyps: "\<forall>y \<in> T. card ({g. g \<in> extensional_funcset S (T - {y}) \<and> inj_on g S}) = fact (card T - 1) div fact ((card T - 1) - card S)"(is "\<forall> _ \<in> T. _ = ?k") by auto
    5.34 -  from extensional_funcset_extend_domain_inj_on_eq[OF `x \<notin> S`]
    5.35 +  from extensional_funcset_extend_domain_inj_on_eq[OF \<open>x \<notin> S\<close>]
    5.36    have "card {f. f : extensional_funcset (insert x S) T & inj_on f (insert x S)} =
    5.37      card ((%(y, g). g(x := y)) ` {(y, g). y : T & g : extensional_funcset S (T - {y}) & inj_on g S})"
    5.38      by metis
    5.39 -  also from extensional_funcset_extend_domain_inj_onI[OF `x \<notin> S`, of T] have "... =  card {(y, g). y : T & g : extensional_funcset S (T - {y}) & inj_on g S}"
    5.40 +  also from extensional_funcset_extend_domain_inj_onI[OF \<open>x \<notin> S\<close>, of T] have "... =  card {(y, g). y : T & g : extensional_funcset S (T - {y}) & inj_on g S}"
    5.41      by (simp add: card_image)
    5.42    also have "card {(y, g). y \<in> T \<and> g \<in> extensional_funcset S (T - {y}) \<and> inj_on g S} =
    5.43      card {(y, g). y \<in> T \<and> g \<in> {f \<in> extensional_funcset S (T - {y}). inj_on f S}}" by auto
    5.44 -  also from `finite T` finite_delete have "... = (\<Sum>y \<in> T. card {g. g \<in> extensional_funcset S (T - {y}) \<and>  inj_on g S})"
    5.45 +  also from \<open>finite T\<close> finite_delete have "... = (\<Sum>y \<in> T. card {g. g \<in> extensional_funcset S (T - {y}) \<and>  inj_on g S})"
    5.46      by (subst card_product_dependent) auto
    5.47    also from hyps have "... = (card T) * ?k"
    5.48      by auto
    5.49 @@ -71,16 +71,16 @@
    5.50    "setprod f {m..(n::nat)} = (if n < m then 1 else (if n = 0 then f 0 else f n * setprod f {m..(n - 1)}))"
    5.51    by auto (auto simp add: gr0_conv_Suc atLeastAtMostSuc_conv)
    5.52  
    5.53 -section {* Birthday paradox *}
    5.54 +section \<open>Birthday paradox\<close>
    5.55  
    5.56  lemma birthday_paradox:
    5.57    assumes "card S = 23" "card T = 365"
    5.58    shows "2 * card {f \<in> extensional_funcset S T. \<not> inj_on f S} \<ge> card (extensional_funcset S T)"
    5.59  proof -
    5.60 -  from `card S = 23` `card T = 365` have "finite S" "finite T" "card S <= card T" by (auto intro: card_ge_0_finite)
    5.61 +  from \<open>card S = 23\<close> \<open>card T = 365\<close> have "finite S" "finite T" "card S <= card T" by (auto intro: card_ge_0_finite)
    5.62    from assms show ?thesis
    5.63 -    using card_PiE[OF `finite S`, of "\<lambda>i. T"] `finite S`
    5.64 -      card_extensional_funcset_not_inj_on[OF `finite S` `finite T` `card S <= card T`]
    5.65 +    using card_PiE[OF \<open>finite S\<close>, of "\<lambda>i. T"] \<open>finite S\<close>
    5.66 +      card_extensional_funcset_not_inj_on[OF \<open>finite S\<close> \<open>finite T\<close> \<open>card S <= card T\<close>]
    5.67      by (simp add: fact_div_fact setprod_upto_nat_unfold setprod_constant)
    5.68  qed
    5.69  
     6.1 --- a/src/HOL/ex/Bubblesort.thy	Tue Oct 06 17:46:07 2015 +0200
     6.2 +++ b/src/HOL/ex/Bubblesort.thy	Tue Oct 06 17:47:28 2015 +0200
     6.3 @@ -1,12 +1,12 @@
     6.4  (* Author: Tobias Nipkow *)
     6.5  
     6.6 -section {* Bubblesort *}
     6.7 +section \<open>Bubblesort\<close>
     6.8  
     6.9  theory Bubblesort
    6.10  imports "~~/src/HOL/Library/Multiset"
    6.11  begin
    6.12  
    6.13 -text{* This is \emph{a} version of bubblesort. *}
    6.14 +text\<open>This is \emph{a} version of bubblesort.\<close>
    6.15  
    6.16  context linorder
    6.17  begin
     7.1 --- a/src/HOL/ex/CTL.thy	Tue Oct 06 17:46:07 2015 +0200
     7.2 +++ b/src/HOL/ex/CTL.thy	Tue Oct 06 17:47:28 2015 +0200
     7.3 @@ -2,13 +2,13 @@
     7.4      Author:     Gertrud Bauer
     7.5  *)
     7.6  
     7.7 -section {* CTL formulae *}
     7.8 +section \<open>CTL formulae\<close>
     7.9  
    7.10  theory CTL
    7.11  imports Main
    7.12  begin
    7.13  
    7.14 -text {*
    7.15 +text \<open>
    7.16    We formalize basic concepts of Computational Tree Logic (CTL)
    7.17    @{cite "McMillan-PhDThesis" and "McMillan-LectureNotes"} within the
    7.18    simply-typed set theory of HOL.
    7.19 @@ -19,7 +19,7 @@
    7.20    disjunction simply become complement, intersection, union of sets.
    7.21    We only require a separate operation for implication, as point-wise
    7.22    inclusion is usually not encountered in plain set-theory.
    7.23 -*}
    7.24 +\<close>
    7.25  
    7.26  lemmas [intro!] = Int_greatest Un_upper2 Un_upper1 Int_lower1 Int_lower2
    7.27  
    7.28 @@ -33,15 +33,15 @@
    7.29  lemma [intro!]: "p \<subseteq> (q \<rightarrow> p)" unfolding imp_def by rule
    7.30  
    7.31  
    7.32 -text {*
    7.33 +text \<open>
    7.34    \smallskip The CTL path operators are more interesting; they are
    7.35    based on an arbitrary, but fixed model @{text \<M>}, which is simply
    7.36    a transition relation over states @{typ "'a"}.
    7.37 -*}
    7.38 +\<close>
    7.39  
    7.40  axiomatization \<M> :: "('a \<times> 'a) set"
    7.41  
    7.42 -text {*
    7.43 +text \<open>
    7.44    The operators @{text \<EX>}, @{text \<EF>}, @{text \<EG>} are taken
    7.45    as primitives, while @{text \<AX>}, @{text \<AF>}, @{text \<AG>} are
    7.46    defined as derived ones.  The formula @{text "\<EX> p"} holds in a
    7.47 @@ -56,7 +56,7 @@
    7.48    @{term s'}.  It is easy to see that @{text "\<EF> p"} and @{text
    7.49    "\<EG> p"} may be expressed using least and greatest fixed points
    7.50    @{cite "McMillan-PhDThesis"}.
    7.51 -*}
    7.52 +\<close>
    7.53  
    7.54  definition
    7.55    EX  ("\<EX> _" [80] 90) where "\<EX> p = {s. \<exists>s'. (s, s') \<in> \<M> \<and> s' \<in> p}"
    7.56 @@ -65,11 +65,11 @@
    7.57  definition
    7.58    EG ("\<EG> _" [80] 90)  where "\<EG> p = gfp (\<lambda>s. p \<inter> \<EX> s)"
    7.59  
    7.60 -text {*
    7.61 +text \<open>
    7.62    @{text "\<AX>"}, @{text "\<AF>"} and @{text "\<AG>"} are now defined
    7.63    dually in terms of @{text "\<EX>"}, @{text "\<EF>"} and @{text
    7.64    "\<EG>"}.
    7.65 -*}
    7.66 +\<close>
    7.67  
    7.68  definition
    7.69    AX  ("\<AX> _" [80] 90) where "\<AX> p = - \<EX> - p"
    7.70 @@ -81,11 +81,11 @@
    7.71  lemmas [simp] = EX_def EG_def AX_def EF_def AF_def AG_def
    7.72  
    7.73  
    7.74 -subsection {* Basic fixed point properties *}
    7.75 +subsection \<open>Basic fixed point properties\<close>
    7.76  
    7.77 -text {*
    7.78 +text \<open>
    7.79    First of all, we use the de-Morgan property of fixed points
    7.80 -*}
    7.81 +\<close>
    7.82  
    7.83  lemma lfp_gfp: "lfp f = - gfp (\<lambda>s::'a set. - (f (- s)))"
    7.84  proof
    7.85 @@ -100,7 +100,7 @@
    7.86        then have "f (- u) \<subseteq> - u" by auto
    7.87        then have "lfp f \<subseteq> - u" by (rule lfp_lowerbound)
    7.88        from l and this have "x \<notin> u" by auto
    7.89 -      with `x \<in> u` show False by contradiction
    7.90 +      with \<open>x \<in> u\<close> show False by contradiction
    7.91      qed
    7.92    qed
    7.93    show "- gfp (\<lambda>s. - f (- s)) \<subseteq> lfp f"
    7.94 @@ -119,10 +119,10 @@
    7.95  lemma gfp_lfp': "- gfp f = lfp (\<lambda>s::'a set. - (f (- s)))"
    7.96    by (simp add: lfp_gfp)
    7.97  
    7.98 -text {*
    7.99 +text \<open>
   7.100    in order to give dual fixed point representations of @{term "AF p"}
   7.101    and @{term "AG p"}:
   7.102 -*}
   7.103 +\<close>
   7.104  
   7.105  lemma AF_lfp: "\<AF> p = lfp (\<lambda>s. p \<union> \<AX> s)" by (simp add: lfp_gfp)
   7.106  lemma AG_gfp: "\<AG> p = gfp (\<lambda>s. p \<inter> \<AX> s)" by (simp add: lfp_gfp)
   7.107 @@ -145,12 +145,12 @@
   7.108    then show ?thesis by (simp only: EG_def) (rule gfp_unfold)
   7.109  qed
   7.110  
   7.111 -text {*
   7.112 +text \<open>
   7.113    From the greatest fixed point definition of @{term "\<AG> p"}, we
   7.114    derive as a consequence of the Knaster-Tarski theorem on the one
   7.115    hand that @{term "\<AG> p"} is a fixed point of the monotonic
   7.116    function @{term "\<lambda>s. p \<inter> \<AX> s"}.
   7.117 -*}
   7.118 +\<close>
   7.119  
   7.120  lemma AG_fp: "\<AG> p = p \<inter> \<AX> \<AG> p"
   7.121  proof -
   7.122 @@ -158,11 +158,11 @@
   7.123    then show ?thesis by (simp only: AG_gfp) (rule gfp_unfold)
   7.124  qed
   7.125  
   7.126 -text {*
   7.127 +text \<open>
   7.128    This fact may be split up into two inequalities (merely using
   7.129    transitivity of @{text "\<subseteq>" }, which is an instance of the overloaded
   7.130    @{text "\<le>"} in Isabelle/HOL).
   7.131 -*}
   7.132 +\<close>
   7.133  
   7.134  lemma AG_fp_1: "\<AG> p \<subseteq> p"
   7.135  proof -
   7.136 @@ -176,36 +176,36 @@
   7.137    finally show ?thesis .
   7.138  qed
   7.139  
   7.140 -text {*
   7.141 +text \<open>
   7.142    On the other hand, we have from the Knaster-Tarski fixed point
   7.143    theorem that any other post-fixed point of @{term "\<lambda>s. p \<inter> AX s"} is
   7.144    smaller than @{term "AG p"}.  A post-fixed point is a set of states
   7.145    @{term q} such that @{term "q \<subseteq> p \<inter> AX q"}.  This leads to the
   7.146    following co-induction principle for @{term "AG p"}.
   7.147 -*}
   7.148 +\<close>
   7.149  
   7.150  lemma AG_I: "q \<subseteq> p \<inter> \<AX> q \<Longrightarrow> q \<subseteq> \<AG> p"
   7.151    by (simp only: AG_gfp) (rule gfp_upperbound)
   7.152  
   7.153  
   7.154 -subsection {* The tree induction principle \label{sec:calc-ctl-tree-induct} *}
   7.155 +subsection \<open>The tree induction principle \label{sec:calc-ctl-tree-induct}\<close>
   7.156  
   7.157 -text {*
   7.158 +text \<open>
   7.159    With the most basic facts available, we are now able to establish a
   7.160    few more interesting results, leading to the \emph{tree induction}
   7.161    principle for @{text AG} (see below).  We will use some elementary
   7.162    monotonicity and distributivity rules.
   7.163 -*}
   7.164 +\<close>
   7.165  
   7.166  lemma AX_int: "\<AX> (p \<inter> q) = \<AX> p \<inter> \<AX> q" by auto 
   7.167  lemma AX_mono: "p \<subseteq> q \<Longrightarrow> \<AX> p \<subseteq> \<AX> q" by auto
   7.168  lemma AG_mono: "p \<subseteq> q \<Longrightarrow> \<AG> p \<subseteq> \<AG> q"
   7.169    by (simp only: AG_gfp, rule gfp_mono) auto 
   7.170  
   7.171 -text {*
   7.172 +text \<open>
   7.173    The formula @{term "AG p"} implies @{term "AX p"} (we use
   7.174    substitution of @{text "\<subseteq>"} with monotonicity).
   7.175 -*}
   7.176 +\<close>
   7.177  
   7.178  lemma AG_AX: "\<AG> p \<subseteq> \<AX> p"
   7.179  proof -
   7.180 @@ -214,11 +214,11 @@
   7.181    finally show ?thesis .
   7.182  qed
   7.183  
   7.184 -text {*
   7.185 +text \<open>
   7.186    Furthermore we show idempotency of the @{text "\<AG>"} operator.
   7.187    The proof is a good example of how accumulated facts may get
   7.188    used to feed a single rule step.
   7.189 -*}
   7.190 +\<close>
   7.191  
   7.192  lemma AG_AG: "\<AG> \<AG> p = \<AG> p"
   7.193  proof
   7.194 @@ -232,7 +232,7 @@
   7.195    qed
   7.196  qed
   7.197  
   7.198 -text {*
   7.199 +text \<open>
   7.200    \smallskip We now give an alternative characterization of the @{text
   7.201    "\<AG>"} operator, which describes the @{text "\<AG>"} operator in
   7.202    an ``operational'' way by tree induction: In a state holds @{term
   7.203 @@ -241,7 +241,7 @@
   7.204    @{term s}, that @{term p} also holds in all successor states of
   7.205    @{term s}.  We use the co-induction principle @{thm [source] AG_I}
   7.206    to establish this in a purely algebraic manner.
   7.207 -*}
   7.208 +\<close>
   7.209  
   7.210  theorem AG_induct: "p \<inter> \<AG> (p \<rightarrow> \<AX> p) = \<AG> p"
   7.211  proof
   7.212 @@ -284,13 +284,13 @@
   7.213  qed
   7.214  
   7.215  
   7.216 -subsection {* An application of tree induction \label{sec:calc-ctl-commute} *}
   7.217 +subsection \<open>An application of tree induction \label{sec:calc-ctl-commute}\<close>
   7.218  
   7.219 -text {*
   7.220 +text \<open>
   7.221    Further interesting properties of CTL expressions may be
   7.222    demonstrated with the help of tree induction; here we show that
   7.223    @{text \<AX>} and @{text \<AG>} commute.
   7.224 -*}
   7.225 +\<close>
   7.226  
   7.227  theorem AG_AX_commute: "\<AG> \<AX> p = \<AX> \<AG> p"
   7.228  proof -
     8.1 --- a/src/HOL/ex/Case_Product.thy	Tue Oct 06 17:46:07 2015 +0200
     8.2 +++ b/src/HOL/ex/Case_Product.thy	Tue Oct 06 17:47:28 2015 +0200
     8.3 @@ -3,28 +3,28 @@
     8.4      Copyright   2011 TU Muenchen
     8.5  *)
     8.6  
     8.7 -section {* Examples for the 'case_product' attribute *}
     8.8 +section \<open>Examples for the 'case_product' attribute\<close>
     8.9  
    8.10  theory Case_Product
    8.11  imports Main
    8.12  begin
    8.13  
    8.14 -text {*
    8.15 +text \<open>
    8.16    The {@attribute case_product} attribute combines multiple case distinction
    8.17    lemmas into a single case distinction lemma by building the product of all
    8.18    these case distinctions.
    8.19 -*}
    8.20 +\<close>
    8.21  
    8.22  lemmas nat_list_exhaust = nat.exhaust[case_product list.exhaust]
    8.23  
    8.24 -text {*
    8.25 +text \<open>
    8.26    The attribute honors preconditions
    8.27 -*}
    8.28 +\<close>
    8.29  
    8.30  lemmas trancl_acc_cases= trancl.cases[case_product acc.cases]
    8.31  
    8.32 -text {*
    8.33 +text \<open>
    8.34    Also, case names are generated based on the old names
    8.35 -*}
    8.36 +\<close>
    8.37  
    8.38  end
     9.1 --- a/src/HOL/ex/Chinese.thy	Tue Oct 06 17:46:07 2015 +0200
     9.2 +++ b/src/HOL/ex/Chinese.thy	Tue Oct 06 17:47:28 2015 +0200
     9.3 @@ -4,17 +4,17 @@
     9.4  formal and informal ones.
     9.5  *)
     9.6  
     9.7 -section {* A Chinese theory *}
     9.8 +section \<open>A Chinese theory\<close>
     9.9  
    9.10  theory Chinese imports Main begin
    9.11  
    9.12 -text{* 数学家能把咖啡变成理论,如今中国的数学家也可
    9.13 +text\<open>数学家能把咖啡变成理论,如今中国的数学家也可
    9.14         以在伊莎贝拉的帮助下把茶变成理论.  
    9.15  
    9.16         伊莎贝拉-世界数学家的新宠,现今能识别中文,成为
    9.17         中国数学家理论推导的得力助手.
    9.18  
    9.19 -    *}
    9.20 +\<close>
    9.21  
    9.22  datatype shuzi =
    9.23      One   ("一")
    10.1 --- a/src/HOL/ex/Classical.thy	Tue Oct 06 17:46:07 2015 +0200
    10.2 +++ b/src/HOL/ex/Classical.thy	Tue Oct 06 17:47:28 2015 +0200
    10.3 @@ -3,22 +3,22 @@
    10.4      Copyright   1994  University of Cambridge
    10.5  *)
    10.6  
    10.7 -section{*Classical Predicate Calculus Problems*}
    10.8 +section\<open>Classical Predicate Calculus Problems\<close>
    10.9  
   10.10  theory Classical imports Main begin
   10.11  
   10.12 -subsection{*Traditional Classical Reasoner*}
   10.13 +subsection\<open>Traditional Classical Reasoner\<close>
   10.14  
   10.15 -text{*The machine "griffon" mentioned below is a 2.5GHz Power Mac G5.*}
   10.16 +text\<open>The machine "griffon" mentioned below is a 2.5GHz Power Mac G5.\<close>
   10.17  
   10.18 -text{*Taken from @{text "FOL/Classical.thy"}. When porting examples from
   10.19 +text\<open>Taken from @{text "FOL/Classical.thy"}. When porting examples from
   10.20  first-order logic, beware of the precedence of @{text "="} versus @{text
   10.21 -"\<leftrightarrow>"}.*}
   10.22 +"\<leftrightarrow>"}.\<close>
   10.23  
   10.24  lemma "(P --> Q | R) --> (P-->Q) | (P-->R)"
   10.25  by blast
   10.26  
   10.27 -text{*If and only if*}
   10.28 +text\<open>If and only if\<close>
   10.29  
   10.30  lemma "(P=Q) = (Q = (P::bool))"
   10.31  by blast
   10.32 @@ -27,7 +27,7 @@
   10.33  by blast
   10.34  
   10.35  
   10.36 -text{*Sample problems from
   10.37 +text\<open>Sample problems from
   10.38    F. J. Pelletier,
   10.39    Seventy-Five Problems for Testing Automatic Theorem Provers,
   10.40    J. Automated Reasoning 2 (1986), 191-216.
   10.41 @@ -35,79 +35,79 @@
   10.42  
   10.43  The hardest problems -- judging by experience with several theorem provers,
   10.44  including matrix ones -- are 34 and 43.
   10.45 -*}
   10.46 +\<close>
   10.47  
   10.48 -subsubsection{*Pelletier's examples*}
   10.49 +subsubsection\<open>Pelletier's examples\<close>
   10.50  
   10.51 -text{*1*}
   10.52 +text\<open>1\<close>
   10.53  lemma "(P-->Q)  =  (~Q --> ~P)"
   10.54  by blast
   10.55  
   10.56 -text{*2*}
   10.57 +text\<open>2\<close>
   10.58  lemma "(~ ~ P) =  P"
   10.59  by blast
   10.60  
   10.61 -text{*3*}
   10.62 +text\<open>3\<close>
   10.63  lemma "~(P-->Q) --> (Q-->P)"
   10.64  by blast
   10.65  
   10.66 -text{*4*}
   10.67 +text\<open>4\<close>
   10.68  lemma "(~P-->Q)  =  (~Q --> P)"
   10.69  by blast
   10.70  
   10.71 -text{*5*}
   10.72 +text\<open>5\<close>
   10.73  lemma "((P|Q)-->(P|R)) --> (P|(Q-->R))"
   10.74  by blast
   10.75  
   10.76 -text{*6*}
   10.77 +text\<open>6\<close>
   10.78  lemma "P | ~ P"
   10.79  by blast
   10.80  
   10.81 -text{*7*}
   10.82 +text\<open>7\<close>
   10.83  lemma "P | ~ ~ ~ P"
   10.84  by blast
   10.85  
   10.86 -text{*8.  Peirce's law*}
   10.87 +text\<open>8.  Peirce's law\<close>
   10.88  lemma "((P-->Q) --> P)  -->  P"
   10.89  by blast
   10.90  
   10.91 -text{*9*}
   10.92 +text\<open>9\<close>
   10.93  lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
   10.94  by blast
   10.95  
   10.96 -text{*10*}
   10.97 +text\<open>10\<close>
   10.98  lemma "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P=Q)"
   10.99  by blast
  10.100  
  10.101 -text{*11.  Proved in each direction (incorrectly, says Pelletier!!)  *}
  10.102 +text\<open>11.  Proved in each direction (incorrectly, says Pelletier!!)\<close>
  10.103  lemma "P=(P::bool)"
  10.104  by blast
  10.105  
  10.106 -text{*12.  "Dijkstra's law"*}
  10.107 +text\<open>12.  "Dijkstra's law"\<close>
  10.108  lemma "((P = Q) = R) = (P = (Q = R))"
  10.109  by blast
  10.110  
  10.111 -text{*13.  Distributive law*}
  10.112 +text\<open>13.  Distributive law\<close>
  10.113  lemma "(P | (Q & R)) = ((P | Q) & (P | R))"
  10.114  by blast
  10.115  
  10.116 -text{*14*}
  10.117 +text\<open>14\<close>
  10.118  lemma "(P = Q) = ((Q | ~P) & (~Q|P))"
  10.119  by blast
  10.120  
  10.121 -text{*15*}
  10.122 +text\<open>15\<close>
  10.123  lemma "(P --> Q) = (~P | Q)"
  10.124  by blast
  10.125  
  10.126 -text{*16*}
  10.127 +text\<open>16\<close>
  10.128  lemma "(P-->Q) | (Q-->P)"
  10.129  by blast
  10.130  
  10.131 -text{*17*}
  10.132 +text\<open>17\<close>
  10.133  lemma "((P & (Q-->R))-->S)  =  ((~P | Q | S) & (~P | ~R | S))"
  10.134  by blast
  10.135  
  10.136 -subsubsection{*Classical Logic: examples with quantifiers*}
  10.137 +subsubsection\<open>Classical Logic: examples with quantifiers\<close>
  10.138  
  10.139  lemma "(\<forall>x. P(x) & Q(x)) = ((\<forall>x. P(x)) & (\<forall>x. Q(x)))"
  10.140  by blast
  10.141 @@ -121,24 +121,24 @@
  10.142  lemma "((\<forall>x. P(x)) | Q)  =  (\<forall>x. P(x) | Q)"
  10.143  by blast
  10.144  
  10.145 -text{*From Wishnu Prasetya*}
  10.146 +text\<open>From Wishnu Prasetya\<close>
  10.147  lemma "(\<forall>s. q(s) --> r(s)) & ~r(s) & (\<forall>s. ~r(s) & ~q(s) --> p(t) | q(t))
  10.148      --> p(t) | r(t)"
  10.149  by blast
  10.150  
  10.151  
  10.152 -subsubsection{*Problems requiring quantifier duplication*}
  10.153 +subsubsection\<open>Problems requiring quantifier duplication\<close>
  10.154  
  10.155 -text{*Theorem B of Peter Andrews, Theorem Proving via General Matings,
  10.156 -  JACM 28 (1981).*}
  10.157 +text\<open>Theorem B of Peter Andrews, Theorem Proving via General Matings,
  10.158 +  JACM 28 (1981).\<close>
  10.159  lemma "(\<exists>x. \<forall>y. P(x) = P(y)) --> ((\<exists>x. P(x)) = (\<forall>y. P(y)))"
  10.160  by blast
  10.161  
  10.162 -text{*Needs multiple instantiation of the quantifier.*}
  10.163 +text\<open>Needs multiple instantiation of the quantifier.\<close>
  10.164  lemma "(\<forall>x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))"
  10.165  by blast
  10.166  
  10.167 -text{*Needs double instantiation of the quantifier*}
  10.168 +text\<open>Needs double instantiation of the quantifier\<close>
  10.169  lemma "\<exists>x. P(x) --> P(a) & P(b)"
  10.170  by blast
  10.171  
  10.172 @@ -148,40 +148,40 @@
  10.173  lemma "\<exists>x. (\<exists>y. P(y)) --> P(x)"
  10.174  by blast
  10.175  
  10.176 -subsubsection{*Hard examples with quantifiers*}
  10.177 +subsubsection\<open>Hard examples with quantifiers\<close>
  10.178  
  10.179 -text{*Problem 18*}
  10.180 +text\<open>Problem 18\<close>
  10.181  lemma "\<exists>y. \<forall>x. P(y)-->P(x)"
  10.182  by blast
  10.183  
  10.184 -text{*Problem 19*}
  10.185 +text\<open>Problem 19\<close>
  10.186  lemma "\<exists>x. \<forall>y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))"
  10.187  by blast
  10.188  
  10.189 -text{*Problem 20*}
  10.190 +text\<open>Problem 20\<close>
  10.191  lemma "(\<forall>x y. \<exists>z. \<forall>w. (P(x)&Q(y)-->R(z)&S(w)))
  10.192      --> (\<exists>x y. P(x) & Q(y)) --> (\<exists>z. R(z))"
  10.193  by blast
  10.194  
  10.195 -text{*Problem 21*}
  10.196 +text\<open>Problem 21\<close>
  10.197  lemma "(\<exists>x. P-->Q(x)) & (\<exists>x. Q(x)-->P) --> (\<exists>x. P=Q(x))"
  10.198  by blast
  10.199  
  10.200 -text{*Problem 22*}
  10.201 +text\<open>Problem 22\<close>
  10.202  lemma "(\<forall>x. P = Q(x))  -->  (P = (\<forall>x. Q(x)))"
  10.203  by blast
  10.204  
  10.205 -text{*Problem 23*}
  10.206 +text\<open>Problem 23\<close>
  10.207  lemma "(\<forall>x. P | Q(x))  =  (P | (\<forall>x. Q(x)))"
  10.208  by blast
  10.209  
  10.210 -text{*Problem 24*}
  10.211 +text\<open>Problem 24\<close>
  10.212  lemma "~(\<exists>x. S(x)&Q(x)) & (\<forall>x. P(x) --> Q(x)|R(x)) &
  10.213       (~(\<exists>x. P(x)) --> (\<exists>x. Q(x))) & (\<forall>x. Q(x)|R(x) --> S(x))
  10.214      --> (\<exists>x. P(x)&R(x))"
  10.215  by blast
  10.216  
  10.217 -text{*Problem 25*}
  10.218 +text\<open>Problem 25\<close>
  10.219  lemma "(\<exists>x. P(x)) &
  10.220          (\<forall>x. L(x) --> ~ (M(x) & R(x))) &
  10.221          (\<forall>x. P(x) --> (M(x) & L(x))) &
  10.222 @@ -189,13 +189,13 @@
  10.223      --> (\<exists>x. Q(x)&P(x))"
  10.224  by blast
  10.225  
  10.226 -text{*Problem 26*}
  10.227 +text\<open>Problem 26\<close>
  10.228  lemma "((\<exists>x. p(x)) = (\<exists>x. q(x))) &
  10.229        (\<forall>x. \<forall>y. p(x) & q(y) --> (r(x) = s(y)))
  10.230    --> ((\<forall>x. p(x)-->r(x)) = (\<forall>x. q(x)-->s(x)))"
  10.231  by blast
  10.232  
  10.233 -text{*Problem 27*}
  10.234 +text\<open>Problem 27\<close>
  10.235  lemma "(\<exists>x. P(x) & ~Q(x)) &
  10.236                (\<forall>x. P(x) --> R(x)) &
  10.237                (\<forall>x. M(x) & L(x) --> P(x)) &
  10.238 @@ -203,57 +203,57 @@
  10.239            --> (\<forall>x. M(x) --> ~L(x))"
  10.240  by blast
  10.241  
  10.242 -text{*Problem 28.  AMENDED*}
  10.243 +text\<open>Problem 28.  AMENDED\<close>
  10.244  lemma "(\<forall>x. P(x) --> (\<forall>x. Q(x))) &
  10.245          ((\<forall>x. Q(x)|R(x)) --> (\<exists>x. Q(x)&S(x))) &
  10.246          ((\<exists>x. S(x)) --> (\<forall>x. L(x) --> M(x)))
  10.247      --> (\<forall>x. P(x) & L(x) --> M(x))"
  10.248  by blast
  10.249  
  10.250 -text{*Problem 29.  Essentially the same as Principia Mathematica *11.71*}
  10.251 +text\<open>Problem 29.  Essentially the same as Principia Mathematica *11.71\<close>
  10.252  lemma "(\<exists>x. F(x)) & (\<exists>y. G(y))
  10.253      --> ( ((\<forall>x. F(x)-->H(x)) & (\<forall>y. G(y)-->J(y)))  =
  10.254            (\<forall>x y. F(x) & G(y) --> H(x) & J(y)))"
  10.255  by blast
  10.256  
  10.257 -text{*Problem 30*}
  10.258 +text\<open>Problem 30\<close>
  10.259  lemma "(\<forall>x. P(x) | Q(x) --> ~ R(x)) &
  10.260          (\<forall>x. (Q(x) --> ~ S(x)) --> P(x) & R(x))
  10.261      --> (\<forall>x. S(x))"
  10.262  by blast
  10.263  
  10.264 -text{*Problem 31*}
  10.265 +text\<open>Problem 31\<close>
  10.266  lemma "~(\<exists>x. P(x) & (Q(x) | R(x))) &
  10.267          (\<exists>x. L(x) & P(x)) &
  10.268          (\<forall>x. ~ R(x) --> M(x))
  10.269      --> (\<exists>x. L(x) & M(x))"
  10.270  by blast
  10.271  
  10.272 -text{*Problem 32*}
  10.273 +text\<open>Problem 32\<close>
  10.274  lemma "(\<forall>x. P(x) & (Q(x)|R(x))-->S(x)) &
  10.275          (\<forall>x. S(x) & R(x) --> L(x)) &
  10.276          (\<forall>x. M(x) --> R(x))
  10.277      --> (\<forall>x. P(x) & M(x) --> L(x))"
  10.278  by blast
  10.279  
  10.280 -text{*Problem 33*}
  10.281 +text\<open>Problem 33\<close>
  10.282  lemma "(\<forall>x. P(a) & (P(x)-->P(b))-->P(c))  =
  10.283       (\<forall>x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))"
  10.284  by blast
  10.285  
  10.286 -text{*Problem 34  AMENDED (TWICE!!)*}
  10.287 -text{*Andrews's challenge*}
  10.288 +text\<open>Problem 34  AMENDED (TWICE!!)\<close>
  10.289 +text\<open>Andrews's challenge\<close>
  10.290  lemma "((\<exists>x. \<forall>y. p(x) = p(y))  =
  10.291                 ((\<exists>x. q(x)) = (\<forall>y. p(y))))   =
  10.292                ((\<exists>x. \<forall>y. q(x) = q(y))  =
  10.293                 ((\<exists>x. p(x)) = (\<forall>y. q(y))))"
  10.294  by blast
  10.295  
  10.296 -text{*Problem 35*}
  10.297 +text\<open>Problem 35\<close>
  10.298  lemma "\<exists>x y. P x y -->  (\<forall>u v. P u v)"
  10.299  by blast
  10.300  
  10.301 -text{*Problem 36*}
  10.302 +text\<open>Problem 36\<close>
  10.303  lemma "(\<forall>x. \<exists>y. J x y) &
  10.304          (\<forall>x. \<exists>y. G x y) &
  10.305          (\<forall>x y. J x y | G x y -->
  10.306 @@ -261,7 +261,7 @@
  10.307      --> (\<forall>x. \<exists>y. H x y)"
  10.308  by blast
  10.309  
  10.310 -text{*Problem 37*}
  10.311 +text\<open>Problem 37\<close>
  10.312  lemma "(\<forall>z. \<exists>w. \<forall>x. \<exists>y.
  10.313             (P x z -->P y w) & P y z & (P y w --> (\<exists>u. Q u w))) &
  10.314          (\<forall>x z. ~(P x z) --> (\<exists>y. Q y z)) &
  10.315 @@ -269,7 +269,7 @@
  10.316      --> (\<forall>x. \<exists>y. R x y)"
  10.317  by blast
  10.318  
  10.319 -text{*Problem 38*}
  10.320 +text\<open>Problem 38\<close>
  10.321  lemma "(\<forall>x. p(a) & (p(x) --> (\<exists>y. p(y) & r x y)) -->
  10.322             (\<exists>z. \<exists>w. p(z) & r x w & r w z))  =
  10.323       (\<forall>x. (~p(a) | p(x) | (\<exists>z. \<exists>w. p(z) & r x w & r w z)) &
  10.324 @@ -277,37 +277,37 @@
  10.325              (\<exists>z. \<exists>w. p(z) & r x w & r w z)))"
  10.326  by blast (*beats fast!*)
  10.327  
  10.328 -text{*Problem 39*}
  10.329 +text\<open>Problem 39\<close>
  10.330  lemma "~ (\<exists>x. \<forall>y. F y x = (~ F y y))"
  10.331  by blast
  10.332  
  10.333 -text{*Problem 40.  AMENDED*}
  10.334 +text\<open>Problem 40.  AMENDED\<close>
  10.335  lemma "(\<exists>y. \<forall>x. F x y = F x x)
  10.336          -->  ~ (\<forall>x. \<exists>y. \<forall>z. F z y = (~ F z x))"
  10.337  by blast
  10.338  
  10.339 -text{*Problem 41*}
  10.340 +text\<open>Problem 41\<close>
  10.341  lemma "(\<forall>z. \<exists>y. \<forall>x. f x y = (f x z & ~ f x x))
  10.342                 --> ~ (\<exists>z. \<forall>x. f x z)"
  10.343  by blast
  10.344  
  10.345 -text{*Problem 42*}
  10.346 +text\<open>Problem 42\<close>
  10.347  lemma "~ (\<exists>y. \<forall>x. p x y = (~ (\<exists>z. p x z & p z x)))"
  10.348  by blast
  10.349  
  10.350 -text{*Problem 43!!*}
  10.351 +text\<open>Problem 43!!\<close>
  10.352  lemma "(\<forall>x::'a. \<forall>y::'a. q x y = (\<forall>z. p z x = (p z y::bool)))
  10.353    --> (\<forall>x. (\<forall>y. q x y = (q y x::bool)))"
  10.354  by blast
  10.355  
  10.356 -text{*Problem 44*}
  10.357 +text\<open>Problem 44\<close>
  10.358  lemma "(\<forall>x. f(x) -->
  10.359                (\<exists>y. g(y) & h x y & (\<exists>y. g(y) & ~ h x y)))  &
  10.360                (\<exists>x. j(x) & (\<forall>y. g(y) --> h x y))
  10.361                --> (\<exists>x. j(x) & ~f(x))"
  10.362  by blast
  10.363  
  10.364 -text{*Problem 45*}
  10.365 +text\<open>Problem 45\<close>
  10.366  lemma "(\<forall>x. f(x) & (\<forall>y. g(y) & h x y --> j x y)
  10.367                        --> (\<forall>y. g(y) & h x y --> k(y))) &
  10.368       ~ (\<exists>y. l(y) & k(y)) &
  10.369 @@ -317,37 +317,37 @@
  10.370  by blast
  10.371  
  10.372  
  10.373 -subsubsection{*Problems (mainly) involving equality or functions*}
  10.374 +subsubsection\<open>Problems (mainly) involving equality or functions\<close>
  10.375  
  10.376 -text{*Problem 48*}
  10.377 +text\<open>Problem 48\<close>
  10.378  lemma "(a=b | c=d) & (a=c | b=d) --> a=d | b=c"
  10.379  by blast
  10.380  
  10.381 -text{*Problem 49  NOT PROVED AUTOMATICALLY.
  10.382 +text\<open>Problem 49  NOT PROVED AUTOMATICALLY.
  10.383       Hard because it involves substitution for Vars
  10.384 -  the type constraint ensures that x,y,z have the same type as a,b,u. *}
  10.385 +  the type constraint ensures that x,y,z have the same type as a,b,u.\<close>
  10.386  lemma "(\<exists>x y::'a. \<forall>z. z=x | z=y) & P(a) & P(b) & (~a=b)
  10.387                  --> (\<forall>u::'a. P(u))"
  10.388  by metis
  10.389  
  10.390 -text{*Problem 50.  (What has this to do with equality?) *}
  10.391 +text\<open>Problem 50.  (What has this to do with equality?)\<close>
  10.392  lemma "(\<forall>x. P a x | (\<forall>y. P x y)) --> (\<exists>x. \<forall>y. P x y)"
  10.393  by blast
  10.394  
  10.395 -text{*Problem 51*}
  10.396 +text\<open>Problem 51\<close>
  10.397  lemma "(\<exists>z w. \<forall>x y. P x y = (x=z & y=w)) -->
  10.398       (\<exists>z. \<forall>x. \<exists>w. (\<forall>y. P x y = (y=w)) = (x=z))"
  10.399  by blast
  10.400  
  10.401 -text{*Problem 52. Almost the same as 51. *}
  10.402 +text\<open>Problem 52. Almost the same as 51.\<close>
  10.403  lemma "(\<exists>z w. \<forall>x y. P x y = (x=z & y=w)) -->
  10.404       (\<exists>w. \<forall>y. \<exists>z. (\<forall>x. P x y = (x=z)) = (y=w))"
  10.405  by blast
  10.406  
  10.407 -text{*Problem 55*}
  10.408 +text\<open>Problem 55\<close>
  10.409  
  10.410 -text{*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
  10.411 -  fast DISCOVERS who killed Agatha. *}
  10.412 +text\<open>Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
  10.413 +  fast DISCOVERS who killed Agatha.\<close>
  10.414  schematic_goal "lives(agatha) & lives(butler) & lives(charles) &
  10.415     (killed agatha agatha | killed butler agatha | killed charles agatha) &
  10.416     (\<forall>x y. killed x y --> hates x y & ~richer x y) &
  10.417 @@ -359,49 +359,49 @@
  10.418      killed ?who agatha"
  10.419  by fast
  10.420  
  10.421 -text{*Problem 56*}
  10.422 +text\<open>Problem 56\<close>
  10.423  lemma "(\<forall>x. (\<exists>y. P(y) & x=f(y)) --> P(x)) = (\<forall>x. P(x) --> P(f(x)))"
  10.424  by blast
  10.425  
  10.426 -text{*Problem 57*}
  10.427 +text\<open>Problem 57\<close>
  10.428  lemma "P (f a b) (f b c) & P (f b c) (f a c) &
  10.429       (\<forall>x y z. P x y & P y z --> P x z)    -->   P (f a b) (f a c)"
  10.430  by blast
  10.431  
  10.432 -text{*Problem 58  NOT PROVED AUTOMATICALLY*}
  10.433 +text\<open>Problem 58  NOT PROVED AUTOMATICALLY\<close>
  10.434  lemma "(\<forall>x y. f(x)=g(y)) --> (\<forall>x y. f(f(x))=f(g(y)))"
  10.435  by (fast intro: arg_cong [of concl: f])
  10.436  
  10.437 -text{*Problem 59*}
  10.438 +text\<open>Problem 59\<close>
  10.439  lemma "(\<forall>x. P(x) = (~P(f(x)))) --> (\<exists>x. P(x) & ~P(f(x)))"
  10.440  by blast
  10.441  
  10.442 -text{*Problem 60*}
  10.443 +text\<open>Problem 60\<close>
  10.444  lemma "\<forall>x. P x (f x) = (\<exists>y. (\<forall>z. P z y --> P z (f x)) & P x y)"
  10.445  by blast
  10.446  
  10.447 -text{*Problem 62 as corrected in JAR 18 (1997), page 135*}
  10.448 +text\<open>Problem 62 as corrected in JAR 18 (1997), page 135\<close>
  10.449  lemma "(\<forall>x. p a & (p x --> p(f x)) --> p(f(f x)))  =
  10.450        (\<forall>x. (~ p a | p x | p(f(f x))) &
  10.451                (~ p a | ~ p(f x) | p(f(f x))))"
  10.452  by blast
  10.453  
  10.454 -text{*From Davis, Obvious Logical Inferences, IJCAI-81, 530-531
  10.455 -  fast indeed copes!*}
  10.456 +text\<open>From Davis, Obvious Logical Inferences, IJCAI-81, 530-531
  10.457 +  fast indeed copes!\<close>
  10.458  lemma "(\<forall>x. F(x) & ~G(x) --> (\<exists>y. H(x,y) & J(y))) &
  10.459         (\<exists>x. K(x) & F(x) & (\<forall>y. H(x,y) --> K(y))) &
  10.460         (\<forall>x. K(x) --> ~G(x))  -->  (\<exists>x. K(x) & J(x))"
  10.461  by fast
  10.462  
  10.463 -text{*From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.
  10.464 -  It does seem obvious!*}
  10.465 +text\<open>From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.
  10.466 +  It does seem obvious!\<close>
  10.467  lemma "(\<forall>x. F(x) & ~G(x) --> (\<exists>y. H(x,y) & J(y))) &
  10.468         (\<exists>x. K(x) & F(x) & (\<forall>y. H(x,y) --> K(y)))  &
  10.469         (\<forall>x. K(x) --> ~G(x))   -->   (\<exists>x. K(x) --> ~G(x))"
  10.470  by fast
  10.471  
  10.472 -text{*Attributed to Lewis Carroll by S. G. Pulman.  The first or last
  10.473 -assumption can be deleted.*}
  10.474 +text\<open>Attributed to Lewis Carroll by S. G. Pulman.  The first or last
  10.475 +assumption can be deleted.\<close>
  10.476  lemma "(\<forall>x. honest(x) & industrious(x) --> healthy(x)) &
  10.477        ~ (\<exists>x. grocer(x) & healthy(x)) &
  10.478        (\<forall>x. industrious(x) & grocer(x) --> honest(x)) &
  10.479 @@ -416,93 +416,93 @@
  10.480  by blast
  10.481  
  10.482  
  10.483 -subsection{*Model Elimination Prover*}
  10.484 +subsection\<open>Model Elimination Prover\<close>
  10.485  
  10.486  
  10.487 -text{*Trying out meson with arguments*}
  10.488 +text\<open>Trying out meson with arguments\<close>
  10.489  lemma "x < y & y < z --> ~ (z < (x::nat))"
  10.490  by (meson order_less_irrefl order_less_trans)
  10.491  
  10.492 -text{*The "small example" from Bezem, Hendriks and de Nivelle,
  10.493 +text\<open>The "small example" from Bezem, Hendriks and de Nivelle,
  10.494  Automatic Proof Construction in Type Theory Using Resolution,
  10.495 -JAR 29: 3-4 (2002), pages 253-275 *}
  10.496 +JAR 29: 3-4 (2002), pages 253-275\<close>
  10.497  lemma "(\<forall>x y z. R(x,y) & R(y,z) --> R(x,z)) &
  10.498         (\<forall>x. \<exists>y. R(x,y)) -->
  10.499         ~ (\<forall>x. P x = (\<forall>y. R(x,y) --> ~ P y))"
  10.500 -by (tactic{*Meson.safe_best_meson_tac @{context} 1*})
  10.501 -    --{*In contrast, @{text meson} is SLOW: 7.6s on griffon*}
  10.502 +by (tactic\<open>Meson.safe_best_meson_tac @{context} 1\<close>)
  10.503 +    --\<open>In contrast, @{text meson} is SLOW: 7.6s on griffon\<close>
  10.504  
  10.505  
  10.506 -subsubsection{*Pelletier's examples*}
  10.507 -text{*1*}
  10.508 +subsubsection\<open>Pelletier's examples\<close>
  10.509 +text\<open>1\<close>
  10.510  lemma "(P --> Q)  =  (~Q --> ~P)"
  10.511  by blast
  10.512  
  10.513 -text{*2*}
  10.514 +text\<open>2\<close>
  10.515  lemma "(~ ~ P) =  P"
  10.516  by blast
  10.517  
  10.518 -text{*3*}
  10.519 +text\<open>3\<close>
  10.520  lemma "~(P-->Q) --> (Q-->P)"
  10.521  by blast
  10.522  
  10.523 -text{*4*}
  10.524 +text\<open>4\<close>
  10.525  lemma "(~P-->Q)  =  (~Q --> P)"
  10.526  by blast
  10.527  
  10.528 -text{*5*}
  10.529 +text\<open>5\<close>
  10.530  lemma "((P|Q)-->(P|R)) --> (P|(Q-->R))"
  10.531  by blast
  10.532  
  10.533 -text{*6*}
  10.534 +text\<open>6\<close>
  10.535  lemma "P | ~ P"
  10.536  by blast
  10.537  
  10.538 -text{*7*}
  10.539 +text\<open>7\<close>
  10.540  lemma "P | ~ ~ ~ P"
  10.541  by blast
  10.542  
  10.543 -text{*8.  Peirce's law*}
  10.544 +text\<open>8.  Peirce's law\<close>
  10.545  lemma "((P-->Q) --> P)  -->  P"
  10.546  by blast
  10.547  
  10.548 -text{*9*}
  10.549 +text\<open>9\<close>
  10.550  lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
  10.551  by blast
  10.552  
  10.553 -text{*10*}
  10.554 +text\<open>10\<close>
  10.555  lemma "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P=Q)"
  10.556  by blast
  10.557  
  10.558 -text{*11.  Proved in each direction (incorrectly, says Pelletier!!)  *}
  10.559 +text\<open>11.  Proved in each direction (incorrectly, says Pelletier!!)\<close>
  10.560  lemma "P=(P::bool)"
  10.561  by blast
  10.562  
  10.563 -text{*12.  "Dijkstra's law"*}
  10.564 +text\<open>12.  "Dijkstra's law"\<close>
  10.565  lemma "((P = Q) = R) = (P = (Q = R))"
  10.566  by blast
  10.567  
  10.568 -text{*13.  Distributive law*}
  10.569 +text\<open>13.  Distributive law\<close>
  10.570  lemma "(P | (Q & R)) = ((P | Q) & (P | R))"
  10.571  by blast
  10.572  
  10.573 -text{*14*}
  10.574 +text\<open>14\<close>
  10.575  lemma "(P = Q) = ((Q | ~P) & (~Q|P))"
  10.576  by blast
  10.577  
  10.578 -text{*15*}
  10.579 +text\<open>15\<close>
  10.580  lemma "(P --> Q) = (~P | Q)"
  10.581  by blast
  10.582  
  10.583 -text{*16*}
  10.584 +text\<open>16\<close>
  10.585  lemma "(P-->Q) | (Q-->P)"
  10.586  by blast
  10.587  
  10.588 -text{*17*}
  10.589 +text\<open>17\<close>
  10.590  lemma "((P & (Q-->R))-->S)  =  ((~P | Q | S) & (~P | ~R | S))"
  10.591  by blast
  10.592  
  10.593 -subsubsection{*Classical Logic: examples with quantifiers*}
  10.594 +subsubsection\<open>Classical Logic: examples with quantifiers\<close>
  10.595  
  10.596  lemma "(\<forall>x. P x & Q x) = ((\<forall>x. P x) & (\<forall>x. Q x))"
  10.597  by blast
  10.598 @@ -519,51 +519,51 @@
  10.599  lemma "(\<forall>x. P x --> P(f x))  &  P d --> P(f(f(f d)))"
  10.600  by blast
  10.601  
  10.602 -text{*Needs double instantiation of EXISTS*}
  10.603 +text\<open>Needs double instantiation of EXISTS\<close>
  10.604  lemma "\<exists>x. P x --> P a & P b"
  10.605  by blast
  10.606  
  10.607  lemma "\<exists>z. P z --> (\<forall>x. P x)"
  10.608  by blast
  10.609  
  10.610 -text{*From a paper by Claire Quigley*}
  10.611 +text\<open>From a paper by Claire Quigley\<close>
  10.612  lemma "\<exists>y. ((P c & Q y) | (\<exists>z. ~ Q z)) | (\<exists>x. ~ P x & Q d)"
  10.613  by fast
  10.614  
  10.615 -subsubsection{*Hard examples with quantifiers*}
  10.616 +subsubsection\<open>Hard examples with quantifiers\<close>
  10.617  
  10.618 -text{*Problem 18*}
  10.619 +text\<open>Problem 18\<close>
  10.620  lemma "\<exists>y. \<forall>x. P y --> P x"
  10.621  by blast
  10.622  
  10.623 -text{*Problem 19*}
  10.624 +text\<open>Problem 19\<close>
  10.625  lemma "\<exists>x. \<forall>y z. (P y --> Q z) --> (P x --> Q x)"
  10.626  by blast
  10.627  
  10.628 -text{*Problem 20*}
  10.629 +text\<open>Problem 20\<close>
  10.630  lemma "(\<forall>x y. \<exists>z. \<forall>w. (P x & Q y --> R z & S w))
  10.631      --> (\<exists>x y. P x & Q y) --> (\<exists>z. R z)"
  10.632  by blast
  10.633  
  10.634 -text{*Problem 21*}
  10.635 +text\<open>Problem 21\<close>
  10.636  lemma "(\<exists>x. P --> Q x) & (\<exists>x. Q x --> P) --> (\<exists>x. P=Q x)"
  10.637  by blast
  10.638  
  10.639 -text{*Problem 22*}
  10.640 +text\<open>Problem 22\<close>
  10.641  lemma "(\<forall>x. P = Q x)  -->  (P = (\<forall>x. Q x))"
  10.642  by blast
  10.643  
  10.644 -text{*Problem 23*}
  10.645 +text\<open>Problem 23\<close>
  10.646  lemma "(\<forall>x. P | Q x)  =  (P | (\<forall>x. Q x))"
  10.647  by blast
  10.648  
  10.649 -text{*Problem 24*}  (*The first goal clause is useless*)
  10.650 +text\<open>Problem 24\<close>  (*The first goal clause is useless*)
  10.651  lemma "~(\<exists>x. S x & Q x) & (\<forall>x. P x --> Q x | R x) &
  10.652        (~(\<exists>x. P x) --> (\<exists>x. Q x)) & (\<forall>x. Q x | R x --> S x)
  10.653      --> (\<exists>x. P x & R x)"
  10.654  by blast
  10.655  
  10.656 -text{*Problem 25*}
  10.657 +text\<open>Problem 25\<close>
  10.658  lemma "(\<exists>x. P x) &
  10.659        (\<forall>x. L x --> ~ (M x & R x)) &
  10.660        (\<forall>x. P x --> (M x & L x)) &
  10.661 @@ -571,13 +571,13 @@
  10.662      --> (\<exists>x. Q x & P x)"
  10.663  by blast
  10.664  
  10.665 -text{*Problem 26; has 24 Horn clauses*}
  10.666 +text\<open>Problem 26; has 24 Horn clauses\<close>
  10.667  lemma "((\<exists>x. p x) = (\<exists>x. q x)) &
  10.668        (\<forall>x. \<forall>y. p x & q y --> (r x = s y))
  10.669    --> ((\<forall>x. p x --> r x) = (\<forall>x. q x --> s x))"
  10.670  by blast
  10.671  
  10.672 -text{*Problem 27; has 13 Horn clauses*}
  10.673 +text\<open>Problem 27; has 13 Horn clauses\<close>
  10.674  lemma "(\<exists>x. P x & ~Q x) &
  10.675        (\<forall>x. P x --> R x) &
  10.676        (\<forall>x. M x & L x --> P x) &
  10.677 @@ -585,70 +585,70 @@
  10.678        --> (\<forall>x. M x --> ~L x)"
  10.679  by blast
  10.680  
  10.681 -text{*Problem 28.  AMENDED; has 14 Horn clauses*}
  10.682 +text\<open>Problem 28.  AMENDED; has 14 Horn clauses\<close>
  10.683  lemma "(\<forall>x. P x --> (\<forall>x. Q x)) &
  10.684        ((\<forall>x. Q x | R x) --> (\<exists>x. Q x & S x)) &
  10.685        ((\<exists>x. S x) --> (\<forall>x. L x --> M x))
  10.686      --> (\<forall>x. P x & L x --> M x)"
  10.687  by blast
  10.688  
  10.689 -text{*Problem 29.  Essentially the same as Principia Mathematica *11.71.
  10.690 -      62 Horn clauses*}
  10.691 +text\<open>Problem 29.  Essentially the same as Principia Mathematica *11.71.
  10.692 +      62 Horn clauses\<close>
  10.693  lemma "(\<exists>x. F x) & (\<exists>y. G y)
  10.694      --> ( ((\<forall>x. F x --> H x) & (\<forall>y. G y --> J y))  =
  10.695            (\<forall>x y. F x & G y --> H x & J y))"
  10.696  by blast
  10.697  
  10.698  
  10.699 -text{*Problem 30*}
  10.700 +text\<open>Problem 30\<close>
  10.701  lemma "(\<forall>x. P x | Q x --> ~ R x) & (\<forall>x. (Q x --> ~ S x) --> P x & R x)
  10.702         --> (\<forall>x. S x)"
  10.703  by blast
  10.704  
  10.705 -text{*Problem 31; has 10 Horn clauses; first negative clauses is useless*}
  10.706 +text\<open>Problem 31; has 10 Horn clauses; first negative clauses is useless\<close>
  10.707  lemma "~(\<exists>x. P x & (Q x | R x)) &
  10.708        (\<exists>x. L x & P x) &
  10.709        (\<forall>x. ~ R x --> M x)
  10.710      --> (\<exists>x. L x & M x)"
  10.711  by blast
  10.712  
  10.713 -text{*Problem 32*}
  10.714 +text\<open>Problem 32\<close>
  10.715  lemma "(\<forall>x. P x & (Q x | R x)-->S x) &
  10.716        (\<forall>x. S x & R x --> L x) &
  10.717        (\<forall>x. M x --> R x)
  10.718      --> (\<forall>x. P x & M x --> L x)"
  10.719  by blast
  10.720  
  10.721 -text{*Problem 33; has 55 Horn clauses*}
  10.722 +text\<open>Problem 33; has 55 Horn clauses\<close>
  10.723  lemma "(\<forall>x. P a & (P x --> P b)-->P c)  =
  10.724        (\<forall>x. (~P a | P x | P c) & (~P a | ~P b | P c))"
  10.725  by blast
  10.726  
  10.727 -text{*Problem 34: Andrews's challenge has 924 Horn clauses*}
  10.728 +text\<open>Problem 34: Andrews's challenge has 924 Horn clauses\<close>
  10.729  lemma "((\<exists>x. \<forall>y. p x = p y)  = ((\<exists>x. q x) = (\<forall>y. p y)))     =
  10.730        ((\<exists>x. \<forall>y. q x = q y)  = ((\<exists>x. p x) = (\<forall>y. q y)))"
  10.731  by blast
  10.732  
  10.733 -text{*Problem 35*}
  10.734 +text\<open>Problem 35\<close>
  10.735  lemma "\<exists>x y. P x y -->  (\<forall>u v. P u v)"
  10.736  by blast
  10.737  
  10.738 -text{*Problem 36; has 15 Horn clauses*}
  10.739 +text\<open>Problem 36; has 15 Horn clauses\<close>
  10.740  lemma "(\<forall>x. \<exists>y. J x y) & (\<forall>x. \<exists>y. G x y) &
  10.741         (\<forall>x y. J x y | G x y --> (\<forall>z. J y z | G y z --> H x z))
  10.742         --> (\<forall>x. \<exists>y. H x y)"
  10.743  by blast
  10.744  
  10.745 -text{*Problem 37; has 10 Horn clauses*}
  10.746 +text\<open>Problem 37; has 10 Horn clauses\<close>
  10.747  lemma "(\<forall>z. \<exists>w. \<forall>x. \<exists>y.
  10.748             (P x z --> P y w) & P y z & (P y w --> (\<exists>u. Q u w))) &
  10.749        (\<forall>x z. ~P x z --> (\<exists>y. Q y z)) &
  10.750        ((\<exists>x y. Q x y) --> (\<forall>x. R x x))
  10.751      --> (\<forall>x. \<exists>y. R x y)"
  10.752 -by blast --{*causes unification tracing messages*}
  10.753 +by blast --\<open>causes unification tracing messages\<close>
  10.754  
  10.755  
  10.756 -text{*Problem 38*}  text{*Quite hard: 422 Horn clauses!!*}
  10.757 +text\<open>Problem 38\<close>  text\<open>Quite hard: 422 Horn clauses!!\<close>
  10.758  lemma "(\<forall>x. p a & (p x --> (\<exists>y. p y & r x y)) -->
  10.759             (\<exists>z. \<exists>w. p z & r x w & r w z))  =
  10.760        (\<forall>x. (~p a | p x | (\<exists>z. \<exists>w. p z & r x w & r w z)) &
  10.761 @@ -656,36 +656,36 @@
  10.762               (\<exists>z. \<exists>w. p z & r x w & r w z)))"
  10.763  by blast
  10.764  
  10.765 -text{*Problem 39*}
  10.766 +text\<open>Problem 39\<close>
  10.767  lemma "~ (\<exists>x. \<forall>y. F y x = (~F y y))"
  10.768  by blast
  10.769  
  10.770 -text{*Problem 40.  AMENDED*}
  10.771 +text\<open>Problem 40.  AMENDED\<close>
  10.772  lemma "(\<exists>y. \<forall>x. F x y = F x x)
  10.773        -->  ~ (\<forall>x. \<exists>y. \<forall>z. F z y = (~F z x))"
  10.774  by blast
  10.775  
  10.776 -text{*Problem 41*}
  10.777 +text\<open>Problem 41\<close>
  10.778  lemma "(\<forall>z. (\<exists>y. (\<forall>x. f x y = (f x z & ~ f x x))))
  10.779        --> ~ (\<exists>z. \<forall>x. f x z)"
  10.780  by blast
  10.781  
  10.782 -text{*Problem 42*}
  10.783 +text\<open>Problem 42\<close>
  10.784  lemma "~ (\<exists>y. \<forall>x. p x y = (~ (\<exists>z. p x z & p z x)))"
  10.785  by blast
  10.786  
  10.787 -text{*Problem 43  NOW PROVED AUTOMATICALLY!!*}
  10.788 +text\<open>Problem 43  NOW PROVED AUTOMATICALLY!!\<close>
  10.789  lemma "(\<forall>x. \<forall>y. q x y = (\<forall>z. p z x = (p z y::bool)))
  10.790        --> (\<forall>x. (\<forall>y. q x y = (q y x::bool)))"
  10.791  by blast
  10.792  
  10.793 -text{*Problem 44: 13 Horn clauses; 7-step proof*}
  10.794 +text\<open>Problem 44: 13 Horn clauses; 7-step proof\<close>
  10.795  lemma "(\<forall>x. f x --> (\<exists>y. g y & h x y & (\<exists>y. g y & ~ h x y)))  &
  10.796         (\<exists>x. j x & (\<forall>y. g y --> h x y))
  10.797         --> (\<exists>x. j x & ~f x)"
  10.798  by blast
  10.799  
  10.800 -text{*Problem 45; has 27 Horn clauses; 54-step proof*}
  10.801 +text\<open>Problem 45; has 27 Horn clauses; 54-step proof\<close>
  10.802  lemma "(\<forall>x. f x & (\<forall>y. g y & h x y --> j x y)
  10.803              --> (\<forall>y. g y & h x y --> k y)) &
  10.804        ~ (\<exists>y. l y & k y) &
  10.805 @@ -694,7 +694,7 @@
  10.806        --> (\<exists>x. f x & ~ (\<exists>y. g y & h x y))"
  10.807  by blast
  10.808  
  10.809 -text{*Problem 46; has 26 Horn clauses; 21-step proof*}
  10.810 +text\<open>Problem 46; has 26 Horn clauses; 21-step proof\<close>
  10.811  lemma "(\<forall>x. f x & (\<forall>y. f y & h y x --> g y) --> g x) &
  10.812         ((\<exists>x. f x & ~g x) -->
  10.813         (\<exists>x. f x & ~g x & (\<forall>y. f y & ~g y --> j x y))) &
  10.814 @@ -702,9 +702,9 @@
  10.815         --> (\<forall>x. f x --> g x)"
  10.816  by blast
  10.817  
  10.818 -text{*Problem 47.  Schubert's Steamroller.
  10.819 +text\<open>Problem 47.  Schubert's Steamroller.
  10.820        26 clauses; 63 Horn clauses.
  10.821 -      87094 inferences so far.  Searching to depth 36*}
  10.822 +      87094 inferences so far.  Searching to depth 36\<close>
  10.823  lemma "(\<forall>x. wolf x \<longrightarrow> animal x) & (\<exists>x. wolf x) &
  10.824         (\<forall>x. fox x \<longrightarrow> animal x) & (\<exists>x. fox x) &
  10.825         (\<forall>x. bird x \<longrightarrow> animal x) & (\<exists>x. bird x) &
  10.826 @@ -723,11 +723,11 @@
  10.827         (\<forall>x y. bird x & snail y \<longrightarrow> ~eats x y) &
  10.828         (\<forall>x. (caterpillar x \<or> snail x) \<longrightarrow> (\<exists>y. plant y & eats x y))
  10.829         \<longrightarrow> (\<exists>x y. animal x & animal y & (\<exists>z. grain z & eats y z & eats x y))"
  10.830 -by (tactic{*Meson.safe_best_meson_tac @{context} 1*})
  10.831 -    --{*Nearly twice as fast as @{text meson},
  10.832 -        which performs iterative deepening rather than best-first search*}
  10.833 +by (tactic\<open>Meson.safe_best_meson_tac @{context} 1\<close>)
  10.834 +    --\<open>Nearly twice as fast as @{text meson},
  10.835 +        which performs iterative deepening rather than best-first search\<close>
  10.836  
  10.837 -text{*The Los problem. Circulated by John Harrison*}
  10.838 +text\<open>The Los problem. Circulated by John Harrison\<close>
  10.839  lemma "(\<forall>x y z. P x y & P y z --> P x z) &
  10.840         (\<forall>x y z. Q x y & Q y z --> Q x z) &
  10.841         (\<forall>x y. P x y --> P y x) &
  10.842 @@ -735,28 +735,28 @@
  10.843         --> (\<forall>x y. P x y) | (\<forall>x y. Q x y)"
  10.844  by meson
  10.845  
  10.846 -text{*A similar example, suggested by Johannes Schumann and
  10.847 - credited to Pelletier*}
  10.848 +text\<open>A similar example, suggested by Johannes Schumann and
  10.849 + credited to Pelletier\<close>
  10.850  lemma "(\<forall>x y z. P x y --> P y z --> P x z) -->
  10.851         (\<forall>x y z. Q x y --> Q y z --> Q x z) -->
  10.852         (\<forall>x y. Q x y --> Q y x) -->  (\<forall>x y. P x y | Q x y) -->
  10.853         (\<forall>x y. P x y) | (\<forall>x y. Q x y)"
  10.854  by meson
  10.855  
  10.856 -text{*Problem 50.  What has this to do with equality?*}
  10.857 +text\<open>Problem 50.  What has this to do with equality?\<close>
  10.858  lemma "(\<forall>x. P a x | (\<forall>y. P x y)) --> (\<exists>x. \<forall>y. P x y)"
  10.859  by blast
  10.860  
  10.861 -text{*Problem 54: NOT PROVED*}
  10.862 +text\<open>Problem 54: NOT PROVED\<close>
  10.863  lemma "(\<forall>y::'a. \<exists>z. \<forall>x. F x z = (x=y)) -->
  10.864        ~ (\<exists>w. \<forall>x. F x w = (\<forall>u. F x u --> (\<exists>y. F y u & ~ (\<exists>z. F z u & F z y))))"
  10.865  oops 
  10.866  
  10.867  
  10.868 -text{*Problem 55*}
  10.869 +text\<open>Problem 55\<close>
  10.870  
  10.871 -text{*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
  10.872 -  @{text meson} cannot report who killed Agatha. *}
  10.873 +text\<open>Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
  10.874 +  @{text meson} cannot report who killed Agatha.\<close>
  10.875  lemma "lives agatha & lives butler & lives charles &
  10.876         (killed agatha agatha | killed butler agatha | killed charles agatha) &
  10.877         (\<forall>x y. killed x y --> hates x y & ~richer x y) &
  10.878 @@ -768,30 +768,30 @@
  10.879         (\<exists>x. killed x agatha)"
  10.880  by meson
  10.881  
  10.882 -text{*Problem 57*}
  10.883 +text\<open>Problem 57\<close>
  10.884  lemma "P (f a b) (f b c) & P (f b c) (f a c) &
  10.885        (\<forall>x y z. P x y & P y z --> P x z)    -->   P (f a b) (f a c)"
  10.886  by blast
  10.887  
  10.888 -text{*Problem 58: Challenge found on info-hol *}
  10.889 +text\<open>Problem 58: Challenge found on info-hol\<close>
  10.890  lemma "\<forall>P Q R x. \<exists>v w. \<forall>y z. P x & Q y --> (P v | R w) & (R z --> Q v)"
  10.891  by blast
  10.892  
  10.893 -text{*Problem 59*}
  10.894 +text\<open>Problem 59\<close>
  10.895  lemma "(\<forall>x. P x = (~P(f x))) --> (\<exists>x. P x & ~P(f x))"
  10.896  by blast
  10.897  
  10.898 -text{*Problem 60*}
  10.899 +text\<open>Problem 60\<close>
  10.900  lemma "\<forall>x. P x (f x) = (\<exists>y. (\<forall>z. P z y --> P z (f x)) & P x y)"
  10.901  by blast
  10.902  
  10.903 -text{*Problem 62 as corrected in JAR 18 (1997), page 135*}
  10.904 +text\<open>Problem 62 as corrected in JAR 18 (1997), page 135\<close>
  10.905  lemma "(\<forall>x. p a & (p x --> p(f x)) --> p(f(f x)))  =
  10.906         (\<forall>x. (~ p a | p x | p(f(f x))) &
  10.907              (~ p a | ~ p(f x) | p(f(f x))))"
  10.908  by blast
  10.909  
  10.910 -text{** Charles Morgan's problems **}
  10.911 +text\<open>* Charles Morgan's problems *\<close>
  10.912  
  10.913  lemma
  10.914    assumes a: "\<forall>x y.  T(i x(i y x))"
  10.915 @@ -802,16 +802,16 @@
  10.916   shows True
  10.917  proof -
  10.918    from a b d have "\<forall>x. T(i x x)" by blast
  10.919 -  from a b c d have "\<forall>x. T(i x (n(n x)))" --{*Problem 66*}
  10.920 +  from a b c d have "\<forall>x. T(i x (n(n x)))" --\<open>Problem 66\<close>
  10.921      by metis
  10.922 -  from a b c d have "\<forall>x. T(i (n(n x)) x)" --{*Problem 67*}
  10.923 +  from a b c d have "\<forall>x. T(i (n(n x)) x)" --\<open>Problem 67\<close>
  10.924      by meson
  10.925 -      --{*4.9s on griffon. 51061 inferences, depth 21 *}
  10.926 +      --\<open>4.9s on griffon. 51061 inferences, depth 21\<close>
  10.927    from a b c' d have "\<forall>x. T(i x (n(n x)))" 
  10.928 -      --{*Problem 68: not proved.  Listed as satisfiable in TPTP (LCL078-1)*}
  10.929 +      --\<open>Problem 68: not proved.  Listed as satisfiable in TPTP (LCL078-1)\<close>
  10.930  oops
  10.931  
  10.932 -text{*Problem 71, as found in TPTP (SYN007+1.005)*}
  10.933 +text\<open>Problem 71, as found in TPTP (SYN007+1.005)\<close>
  10.934  lemma "p1 = (p2 = (p3 = (p4 = (p5 = (p1 = (p2 = (p3 = (p4 = p5))))))))"
  10.935  by blast
  10.936  
    11.1 --- a/src/HOL/ex/Code_Binary_Nat_examples.thy	Tue Oct 06 17:46:07 2015 +0200
    11.2 +++ b/src/HOL/ex/Code_Binary_Nat_examples.thy	Tue Oct 06 17:47:28 2015 +0200
    11.3 @@ -2,7 +2,7 @@
    11.4      Author:     Florian Haftmann, TU Muenchen
    11.5  *)
    11.6  
    11.7 -section {* Simple examples for natural numbers implemented in binary representation. *}
    11.8 +section \<open>Simple examples for natural numbers implemented in binary representation.\<close>
    11.9  
   11.10  theory Code_Binary_Nat_examples
   11.11  imports Complex_Main "~~/src/HOL/Library/Code_Binary_Nat"
    12.1 --- a/src/HOL/ex/Coherent.thy	Tue Oct 06 17:46:07 2015 +0200
    12.2 +++ b/src/HOL/ex/Coherent.thy	Tue Oct 06 17:47:28 2015 +0200
    12.3 @@ -3,13 +3,13 @@
    12.4      Author:     Marc Bezem, Institutt for Informatikk, Universitetet i Bergen 
    12.5  *)
    12.6  
    12.7 -section {* Coherent Logic Problems *}
    12.8 +section \<open>Coherent Logic Problems\<close>
    12.9  
   12.10  theory Coherent
   12.11  imports Main
   12.12  begin
   12.13  
   12.14 -subsection {* Equivalence of two versions of Pappus' Axiom *}
   12.15 +subsection \<open>Equivalence of two versions of Pappus' Axiom\<close>
   12.16  
   12.17  no_notation
   12.18    comp (infixl "o" 55) and
   12.19 @@ -79,7 +79,7 @@
   12.20    by coherent
   12.21  
   12.22  
   12.23 -subsection {* Preservation of the Diamond Property under reflexive closure *}
   12.24 +subsection \<open>Preservation of the Diamond Property under reflexive closure\<close>
   12.25  
   12.26  lemma diamond:
   12.27    assumes
    13.1 --- a/src/HOL/ex/Dedekind_Real.thy	Tue Oct 06 17:46:07 2015 +0200
    13.2 +++ b/src/HOL/ex/Dedekind_Real.thy	Tue Oct 06 17:47:28 2015 +0200
    13.3 @@ -11,9 +11,9 @@
    13.4  imports Complex_Main
    13.5  begin
    13.6  
    13.7 -section {* Positive real numbers *}
    13.8 +section \<open>Positive real numbers\<close>
    13.9  
   13.10 -text{*Could be generalized and moved to @{text Groups}*}
   13.11 +text\<open>Could be generalized and moved to @{text Groups}\<close>
   13.12  lemma add_eq_exists: "\<exists>x. a+x = (b::rat)"
   13.13  by (rule_tac x="b-a" in exI, simp)
   13.14  
   13.15 @@ -113,7 +113,7 @@
   13.16  end
   13.17  
   13.18  
   13.19 -text{*Reduces equality on abstractions to equality on representatives*}
   13.20 +text\<open>Reduces equality on abstractions to equality on representatives\<close>
   13.21  declare Abs_preal_inject [simp]
   13.22  declare Abs_preal_inverse [simp]
   13.23  
   13.24 @@ -142,15 +142,15 @@
   13.25  lemma preal_downwards_closed: "[| cut A; y \<in> A; 0 < z; z < y |] ==> z \<in> A"
   13.26    unfolding cut_def [abs_def] by blast
   13.27  
   13.28 -text{*Relaxing the final premise*}
   13.29 +text\<open>Relaxing the final premise\<close>
   13.30  lemma preal_downwards_closed':
   13.31       "[| cut A; y \<in> A; 0 < z; z \<le> y |] ==> z \<in> A"
   13.32  apply (simp add: order_le_less)
   13.33  apply (blast intro: preal_downwards_closed)
   13.34  done
   13.35  
   13.36 -text{*A positive fraction not in a positive real is an upper bound.
   13.37 - Gleason p. 122 - Remark (1)*}
   13.38 +text\<open>A positive fraction not in a positive real is an upper bound.
   13.39 + Gleason p. 122 - Remark (1)\<close>
   13.40  
   13.41  lemma not_in_preal_ub:
   13.42    assumes A: "cut A"
   13.43 @@ -170,7 +170,7 @@
   13.44    thus ?thesis .
   13.45  qed
   13.46  
   13.47 -text {* preal lemmas instantiated to @{term "Rep_preal X"} *}
   13.48 +text \<open>preal lemmas instantiated to @{term "Rep_preal X"}\<close>
   13.49  
   13.50  lemma mem_Rep_preal_Ex: "\<exists>x. x \<in> Rep_preal X"
   13.51  thm preal_Ex_mem
   13.52 @@ -182,7 +182,7 @@
   13.53  lemmas not_in_Rep_preal_ub = not_in_preal_ub [OF Rep_preal]
   13.54  
   13.55  
   13.56 -subsection{*Properties of Ordering*}
   13.57 +subsection\<open>Properties of Ordering\<close>
   13.58  
   13.59  instance preal :: order
   13.60  proof
   13.61 @@ -231,7 +231,7 @@
   13.62  
   13.63  end
   13.64  
   13.65 -subsection{*Properties of Addition*}
   13.66 +subsection\<open>Properties of Addition\<close>
   13.67  
   13.68  lemma preal_add_commute: "(x::preal) + y = y + x"
   13.69  apply (unfold preal_add_def add_set_def)
   13.70 @@ -239,18 +239,18 @@
   13.71  apply (force simp add: add.commute)
   13.72  done
   13.73  
   13.74 -text{*Lemmas for proving that addition of two positive reals gives
   13.75 - a positive real*}
   13.76 +text\<open>Lemmas for proving that addition of two positive reals gives
   13.77 + a positive real\<close>
   13.78  
   13.79 -text{*Part 1 of Dedekind sections definition*}
   13.80 +text\<open>Part 1 of Dedekind sections definition\<close>
   13.81  lemma add_set_not_empty:
   13.82       "[|cut A; cut B|] ==> {} \<subset> add_set A B"
   13.83  apply (drule preal_nonempty)+
   13.84  apply (auto simp add: add_set_def)
   13.85  done
   13.86  
   13.87 -text{*Part 2 of Dedekind sections definition.  A structured version of
   13.88 -this proof is @{text preal_not_mem_mult_set_Ex} below.*}
   13.89 +text\<open>Part 2 of Dedekind sections definition.  A structured version of
   13.90 +this proof is @{text preal_not_mem_mult_set_Ex} below.\<close>
   13.91  lemma preal_not_mem_add_set_Ex:
   13.92       "[|cut A; cut B|] ==> \<exists>q>0. q \<notin> add_set A B"
   13.93  apply (insert preal_exists_bound [of A] preal_exists_bound [of B], auto) 
   13.94 @@ -272,7 +272,7 @@
   13.95      by (insert preal_not_mem_add_set_Ex [OF A B], blast) 
   13.96  qed
   13.97  
   13.98 -text{*Part 3 of Dedekind sections definition*}
   13.99 +text\<open>Part 3 of Dedekind sections definition\<close>
  13.100  lemma add_set_lemma3:
  13.101       "[|cut A; cut B; u \<in> add_set A B; 0 < z; z < u|] 
  13.102        ==> z \<in> add_set A B"
  13.103 @@ -315,7 +315,7 @@
  13.104    qed
  13.105  qed
  13.106  
  13.107 -text{*Part 4 of Dedekind sections definition*}
  13.108 +text\<open>Part 4 of Dedekind sections definition\<close>
  13.109  lemma add_set_lemma4:
  13.110       "[|cut A; cut B; y \<in> add_set A B|] ==> \<exists>u \<in> add_set A B. y < u"
  13.111  apply (auto simp add: add_set_def)
  13.112 @@ -344,9 +344,9 @@
  13.113  qed
  13.114  
  13.115  
  13.116 -subsection{*Properties of Multiplication*}
  13.117 +subsection\<open>Properties of Multiplication\<close>
  13.118  
  13.119 -text{*Proofs essentially same as for addition*}
  13.120 +text\<open>Proofs essentially same as for addition\<close>
  13.121  
  13.122  lemma preal_mult_commute: "(x::preal) * y = y * x"
  13.123  apply (unfold preal_mult_def mult_set_def)
  13.124 @@ -354,18 +354,18 @@
  13.125  apply (force simp add: mult.commute)
  13.126  done
  13.127  
  13.128 -text{*Multiplication of two positive reals gives a positive real.*}
  13.129 +text\<open>Multiplication of two positive reals gives a positive real.\<close>
  13.130  
  13.131 -text{*Lemmas for proving positive reals multiplication set in @{typ preal}*}
  13.132 +text\<open>Lemmas for proving positive reals multiplication set in @{typ preal}\<close>
  13.133  
  13.134 -text{*Part 1 of Dedekind sections definition*}
  13.135 +text\<open>Part 1 of Dedekind sections definition\<close>
  13.136  lemma mult_set_not_empty:
  13.137       "[|cut A; cut B|] ==> {} \<subset> mult_set A B"
  13.138  apply (insert preal_nonempty [of A] preal_nonempty [of B]) 
  13.139  apply (auto simp add: mult_set_def)
  13.140  done
  13.141  
  13.142 -text{*Part 2 of Dedekind sections definition*}
  13.143 +text\<open>Part 2 of Dedekind sections definition\<close>
  13.144  lemma preal_not_mem_mult_set_Ex:
  13.145    assumes A: "cut A" 
  13.146      and B: "cut B"
  13.147 @@ -386,7 +386,7 @@
  13.148          from A B 1 2 u v have "0\<le>v"
  13.149            by (blast intro: preal_imp_pos [OF B] order_less_imp_le)
  13.150          moreover
  13.151 -        from A B 1 `u < x` `v < y` `0 \<le> v`
  13.152 +        from A B 1 \<open>u < x\<close> \<open>v < y\<close> \<open>0 \<le> v\<close>
  13.153          have "u*v < x*y" by (blast intro: mult_strict_mono)
  13.154          ultimately have False by force
  13.155        }
  13.156 @@ -409,7 +409,7 @@
  13.157  
  13.158  
  13.159  
  13.160 -text{*Part 3 of Dedekind sections definition*}
  13.161 +text\<open>Part 3 of Dedekind sections definition\<close>
  13.162  lemma mult_set_lemma3:
  13.163       "[|cut A; cut B; u \<in> mult_set A B; 0 < z; z < u|] 
  13.164        ==> z \<in> mult_set A B"
  13.165 @@ -441,7 +441,7 @@
  13.166    qed
  13.167  qed
  13.168  
  13.169 -text{*Part 4 of Dedekind sections definition*}
  13.170 +text\<open>Part 4 of Dedekind sections definition\<close>
  13.171  lemma mult_set_lemma4:
  13.172       "[|cut A; cut B; y \<in> mult_set A B|] ==> \<exists>u \<in> mult_set A B. y < u"
  13.173  apply (auto simp add: mult_set_def)
  13.174 @@ -472,7 +472,7 @@
  13.175  qed
  13.176  
  13.177  
  13.178 -text{* Positive real 1 is the multiplicative identity element *}
  13.179 +text\<open>Positive real 1 is the multiplicative identity element\<close>
  13.180  
  13.181  lemma preal_mult_1: "(1::preal) * z = z"
  13.182  proof (induct z)
  13.183 @@ -485,7 +485,7 @@
  13.184        fix x::rat and u::rat and v::rat
  13.185        assume upos: "0<u" and "u<1" and v: "v \<in> A"
  13.186        have vpos: "0<v" by (rule preal_imp_pos [OF A v])
  13.187 -      hence "u*v < 1*v" by (simp only: mult_strict_right_mono upos `u < 1` v)
  13.188 +      hence "u*v < 1*v" by (simp only: mult_strict_right_mono upos \<open>u < 1\<close> v)
  13.189        thus "u * v \<in> A"
  13.190          by (force intro: preal_downwards_closed [OF A v] mult_pos_pos 
  13.191            upos vpos)
  13.192 @@ -524,7 +524,7 @@
  13.193  by intro_classes (rule preal_mult_1)
  13.194  
  13.195  
  13.196 -subsection{*Distribution of Multiplication across Addition*}
  13.197 +subsection\<open>Distribution of Multiplication across Addition\<close>
  13.198  
  13.199  lemma mem_Rep_preal_add_iff:
  13.200        "(z \<in> Rep_preal(R+S)) = (\<exists>x \<in> Rep_preal R. \<exists>y \<in> Rep_preal S. z = x + y)"
  13.201 @@ -592,7 +592,7 @@
  13.202  by intro_classes (rule preal_add_mult_distrib)
  13.203  
  13.204  
  13.205 -subsection{*Existence of Inverse, a Positive Real*}
  13.206 +subsection\<open>Existence of Inverse, a Positive Real\<close>
  13.207  
  13.208  lemma mem_inv_set_ex:
  13.209    assumes A: "cut A" shows "\<exists>x y. 0 < x & x < y & inverse y \<notin> A"
  13.210 @@ -610,14 +610,14 @@
  13.211    qed
  13.212  qed
  13.213  
  13.214 -text{*Part 1 of Dedekind sections definition*}
  13.215 +text\<open>Part 1 of Dedekind sections definition\<close>
  13.216  lemma inverse_set_not_empty:
  13.217       "cut A ==> {} \<subset> inverse_set A"
  13.218  apply (insert mem_inv_set_ex [of A])
  13.219  apply (auto simp add: inverse_set_def)
  13.220  done
  13.221  
  13.222 -text{*Part 2 of Dedekind sections definition*}
  13.223 +text\<open>Part 2 of Dedekind sections definition\<close>
  13.224  
  13.225  lemma preal_not_mem_inverse_set_Ex:
  13.226     assumes A: "cut A"  shows "\<exists>q. 0 < q & q \<notin> inverse_set A"
  13.227 @@ -650,7 +650,7 @@
  13.228      by (insert preal_not_mem_inverse_set_Ex [OF A], blast)
  13.229  qed
  13.230  
  13.231 -text{*Part 3 of Dedekind sections definition*}
  13.232 +text\<open>Part 3 of Dedekind sections definition\<close>
  13.233  lemma inverse_set_lemma3:
  13.234       "[|cut A; u \<in> inverse_set A; 0 < z; z < u|] 
  13.235        ==> z \<in> inverse_set A"
  13.236 @@ -658,7 +658,7 @@
  13.237  apply (auto intro: order_less_trans)
  13.238  done
  13.239  
  13.240 -text{*Part 4 of Dedekind sections definition*}
  13.241 +text\<open>Part 4 of Dedekind sections definition\<close>
  13.242  lemma inverse_set_lemma4:
  13.243       "[|cut A; y \<in> inverse_set A|] ==> \<exists>u \<in> inverse_set A. y < u"
  13.244  apply (auto simp add: inverse_set_def)
  13.245 @@ -675,7 +675,7 @@
  13.246  done
  13.247  
  13.248  
  13.249 -subsection{*Gleason's Lemma 9-3.4, page 122*}
  13.250 +subsection\<open>Gleason's Lemma 9-3.4, page 122\<close>
  13.251  
  13.252  lemma Gleason9_34_exists:
  13.253    assumes A: "cut A"
  13.254 @@ -754,7 +754,7 @@
  13.255  
  13.256  
  13.257  
  13.258 -subsection{*Gleason's Lemma 9-3.6*}
  13.259 +subsection\<open>Gleason's Lemma 9-3.6\<close>
  13.260  
  13.261  lemma lemma_gleason9_36:
  13.262    assumes A: "cut A"
  13.263 @@ -800,7 +800,7 @@
  13.264    qed  
  13.265  qed
  13.266  
  13.267 -subsection{*Existence of Inverse: Part 2*}
  13.268 +subsection\<open>Existence of Inverse: Part 2\<close>
  13.269  
  13.270  lemma mem_Rep_preal_inverse_iff:
  13.271        "(z \<in> Rep_preal(inverse R)) = 
  13.272 @@ -882,7 +882,7 @@
  13.273  done
  13.274  
  13.275  
  13.276 -text{*Theorems needing @{text Gleason9_34}*}
  13.277 +text\<open>Theorems needing @{text Gleason9_34}\<close>
  13.278  
  13.279  lemma Rep_preal_self_subset: "Rep_preal (R) \<subseteq> Rep_preal(R + S)"
  13.280  proof 
  13.281 @@ -913,19 +913,19 @@
  13.282  lemma Rep_preal_sum_not_eq: "Rep_preal (R + S) \<noteq> Rep_preal(R)"
  13.283  by (insert Rep_preal_sum_not_subset, blast)
  13.284  
  13.285 -text{*at last, Gleason prop. 9-3.5(iii) page 123*}
  13.286 +text\<open>at last, Gleason prop. 9-3.5(iii) page 123\<close>
  13.287  lemma preal_self_less_add_left: "(R::preal) < R + S"
  13.288  apply (unfold preal_less_def less_le)
  13.289  apply (simp add: Rep_preal_self_subset Rep_preal_sum_not_eq [THEN not_sym])
  13.290  done
  13.291  
  13.292  
  13.293 -subsection{*Subtraction for Positive Reals*}
  13.294 +subsection\<open>Subtraction for Positive Reals\<close>
  13.295  
  13.296 -text{*Gleason prop. 9-3.5(iv), page 123: proving @{prop "A < B ==> \<exists>D. A + D =
  13.297 -B"}. We define the claimed @{term D} and show that it is a positive real*}
  13.298 +text\<open>Gleason prop. 9-3.5(iv), page 123: proving @{prop "A < B ==> \<exists>D. A + D =
  13.299 +B"}. We define the claimed @{term D} and show that it is a positive real\<close>
  13.300  
  13.301 -text{*Part 1 of Dedekind sections definition*}
  13.302 +text\<open>Part 1 of Dedekind sections definition\<close>
  13.303  lemma diff_set_not_empty:
  13.304       "R < S ==> {} \<subset> diff_set (Rep_preal S) (Rep_preal R)"
  13.305  apply (auto simp add: preal_less_def diff_set_def elim!: equalityE) 
  13.306 @@ -934,7 +934,7 @@
  13.307  apply (cut_tac a=x and b=u in add_eq_exists, force) 
  13.308  done
  13.309  
  13.310 -text{*Part 2 of Dedekind sections definition*}
  13.311 +text\<open>Part 2 of Dedekind sections definition\<close>
  13.312  lemma diff_set_nonempty:
  13.313       "\<exists>q. 0 < q & q \<notin> diff_set (Rep_preal S) (Rep_preal R)"
  13.314  apply (cut_tac X = S in Rep_preal_exists_bound)
  13.315 @@ -951,7 +951,7 @@
  13.316    show "?lhs \<noteq> ?rhs" using diff_set_nonempty by blast
  13.317  qed
  13.318  
  13.319 -text{*Part 3 of Dedekind sections definition*}
  13.320 +text\<open>Part 3 of Dedekind sections definition\<close>
  13.321  lemma diff_set_lemma3:
  13.322       "[|R < S; u \<in> diff_set (Rep_preal S) (Rep_preal R); 0 < z; z < u|] 
  13.323        ==> z \<in> diff_set (Rep_preal S) (Rep_preal R)"
  13.324 @@ -960,7 +960,7 @@
  13.325  apply (drule Rep_preal [THEN preal_downwards_closed], auto)
  13.326  done
  13.327  
  13.328 -text{*Part 4 of Dedekind sections definition*}
  13.329 +text\<open>Part 4 of Dedekind sections definition\<close>
  13.330  lemma diff_set_lemma4:
  13.331       "[|R < S; y \<in> diff_set (Rep_preal S) (Rep_preal R)|] 
  13.332        ==> \<exists>u \<in> diff_set (Rep_preal S) (Rep_preal R). y < u"
  13.333 @@ -987,7 +987,7 @@
  13.334  done
  13.335  
  13.336  
  13.337 -text{*proving that @{term "R + D \<le> S"}*}
  13.338 +text\<open>proving that @{term "R + D \<le> S"}\<close>
  13.339  
  13.340  lemma less_add_left_lemma:
  13.341    assumes Rless: "R < S"
  13.342 @@ -1012,7 +1012,7 @@
  13.343  apply (blast intro: less_add_left_lemma) 
  13.344  done
  13.345  
  13.346 -subsection{*proving that @{term "S \<le> R + D"} --- trickier*}
  13.347 +subsection\<open>proving that @{term "S \<le> R + D"} --- trickier\<close>
  13.348  
  13.349  lemma lemma_sum_mem_Rep_preal_ex:
  13.350       "x \<in> Rep_preal S ==> \<exists>e. 0 < e & x + e \<in> Rep_preal S"
  13.351 @@ -1106,11 +1106,11 @@
  13.352  qed
  13.353  
  13.354  
  13.355 -subsection{*Completeness of type @{typ preal}*}
  13.356 +subsection\<open>Completeness of type @{typ preal}\<close>
  13.357  
  13.358 -text{*Prove that supremum is a cut*}
  13.359 +text\<open>Prove that supremum is a cut\<close>
  13.360  
  13.361 -text{*Part 1 of Dedekind sections definition*}
  13.362 +text\<open>Part 1 of Dedekind sections definition\<close>
  13.363  
  13.364  lemma preal_sup_set_not_empty:
  13.365       "P \<noteq> {} ==> {} \<subset> (\<Union>X \<in> P. Rep_preal(X))"
  13.366 @@ -1119,7 +1119,7 @@
  13.367  done
  13.368  
  13.369  
  13.370 -text{*Part 2 of Dedekind sections definition*}
  13.371 +text\<open>Part 2 of Dedekind sections definition\<close>
  13.372  
  13.373  lemma preal_sup_not_exists:
  13.374       "\<forall>X \<in> P. X \<le> Y ==> \<exists>q. 0 < q & q \<notin> (\<Union>X \<in> P. Rep_preal(X))"
  13.375 @@ -1133,13 +1133,13 @@
  13.376  apply (blast intro: preal_imp_pos [OF Rep_preal])  
  13.377  done
  13.378  
  13.379 -text{*Part 3 of Dedekind sections definition*}
  13.380 +text\<open>Part 3 of Dedekind sections definition\<close>
  13.381  lemma preal_sup_set_lemma3:
  13.382       "[|P \<noteq> {}; \<forall>X \<in> P. X \<le> Y; u \<in> (\<Union>X \<in> P. Rep_preal(X)); 0 < z; z < u|]
  13.383        ==> z \<in> (\<Union>X \<in> P. Rep_preal(X))"
  13.384  by (auto elim: Rep_preal [THEN preal_downwards_closed])
  13.385  
  13.386 -text{*Part 4 of Dedekind sections definition*}
  13.387 +text\<open>Part 4 of Dedekind sections definition\<close>
  13.388  lemma preal_sup_set_lemma4:
  13.389       "[|P \<noteq> {}; \<forall>X \<in> P. X \<le> Y; y \<in> (\<Union>X \<in> P. Rep_preal(X)) |]
  13.390            ==> \<exists>u \<in> (\<Union>X \<in> P. Rep_preal(X)). y < u"
  13.391 @@ -1165,7 +1165,7 @@
  13.392  apply (auto simp add: preal_le_def)
  13.393  done
  13.394  
  13.395 -text{*Supremum property*}
  13.396 +text\<open>Supremum property\<close>
  13.397  lemma preal_complete:
  13.398       "[| P \<noteq> {}; \<forall>X \<in> P. X \<le> Y |] ==> (\<exists>X \<in> P. Z < X) = (Z < psup P)"
  13.399  apply (simp add: preal_less_def psup_def preal_sup)
  13.400 @@ -1175,7 +1175,7 @@
  13.401  apply (auto simp add: preal_less_def)
  13.402  done
  13.403  
  13.404 -section {*Defining the Reals from the Positive Reals*}
  13.405 +section \<open>Defining the Reals from the Positive Reals\<close>
  13.406  
  13.407  definition
  13.408    realrel   ::  "((preal * preal) * (preal * preal)) set" where
  13.409 @@ -1241,7 +1241,7 @@
  13.410  
  13.411  end
  13.412  
  13.413 -subsection {* Equivalence relation over positive reals *}
  13.414 +subsection \<open>Equivalence relation over positive reals\<close>
  13.415  
  13.416  lemma preal_trans_lemma:
  13.417    assumes "x + y1 = x1 + y"
  13.418 @@ -1266,8 +1266,8 @@
  13.419  apply (blast dest: preal_trans_lemma) 
  13.420  done
  13.421  
  13.422 -text{*Reduces equality of equivalence classes to the @{term realrel} relation:
  13.423 -  @{term "(realrel `` {x} = realrel `` {y}) = ((x,y) \<in> realrel)"} *}
  13.424 +text\<open>Reduces equality of equivalence classes to the @{term realrel} relation:
  13.425 +  @{term "(realrel `` {x} = realrel `` {y}) = ((x,y) \<in> realrel)"}\<close>
  13.426  lemmas equiv_realrel_iff = 
  13.427         eq_equiv_class_iff [OF equiv_realrel UNIV_I UNIV_I]
  13.428  
  13.429 @@ -1281,8 +1281,8 @@
  13.430  declare Abs_Real_inverse [simp]
  13.431  
  13.432  
  13.433 -text{*Case analysis on the representation of a real number as an equivalence
  13.434 -      class of pairs of positive reals.*}
  13.435 +text\<open>Case analysis on the representation of a real number as an equivalence
  13.436 +      class of pairs of positive reals.\<close>
  13.437  lemma eq_Abs_Real [case_names Abs_Real, cases type: real]: 
  13.438       "(!!x y. z = Abs_Real(realrel``{(x,y)}) ==> P) ==> P"
  13.439  apply (rule Rep_Real [of z, unfolded Real_def, THEN quotientE])
  13.440 @@ -1291,7 +1291,7 @@
  13.441  done
  13.442  
  13.443  
  13.444 -subsection {* Addition and Subtraction *}
  13.445 +subsection \<open>Addition and Subtraction\<close>
  13.446  
  13.447  lemma real_add_congruent2_lemma:
  13.448       "[|a + ba = aa + b; ab + bc = ac + bb|]
  13.449 @@ -1338,7 +1338,7 @@
  13.450  qed
  13.451  
  13.452  
  13.453 -subsection {* Multiplication *}
  13.454 +subsection \<open>Multiplication\<close>
  13.455  
  13.456  lemma real_mult_congruent2_lemma:
  13.457       "!!(x1::preal). [| x1 + y2 = x2 + y1 |] ==>
  13.458 @@ -1383,7 +1383,7 @@
  13.459  apply (simp add: real_add real_mult algebra_simps)
  13.460  done
  13.461  
  13.462 -text{*one and zero are distinct*}
  13.463 +text\<open>one and zero are distinct\<close>
  13.464  lemma real_zero_not_eq_one: "0 \<noteq> (1::real)"
  13.465  proof -
  13.466    have "(1::preal) < 1 + 1"
  13.467 @@ -1402,13 +1402,13 @@
  13.468    show "0 \<noteq> (1::real)" by (rule real_zero_not_eq_one)
  13.469  qed
  13.470  
  13.471 -subsection {* Inverse and Division *}
  13.472 +subsection \<open>Inverse and Division\<close>
  13.473  
  13.474  lemma real_zero_iff: "Abs_Real (realrel `` {(x, x)}) = 0"
  13.475  by (simp add: real_zero_def add.commute)
  13.476  
  13.477 -text{*Instead of using an existential quantifier and constructing the inverse
  13.478 -within the proof, we could define the inverse explicitly.*}
  13.479 +text\<open>Instead of using an existential quantifier and constructing the inverse
  13.480 +within the proof, we could define the inverse explicitly.\<close>
  13.481  
  13.482  lemma real_mult_inverse_left_ex: "x \<noteq> 0 ==> \<exists>y. y*x = (1::real)"
  13.483  apply (simp add: real_zero_def real_one_def, cases x)
  13.484 @@ -1433,7 +1433,7 @@
  13.485  done
  13.486  
  13.487  
  13.488 -subsection{*The Real Numbers form a Field*}
  13.489 +subsection\<open>The Real Numbers form a Field\<close>
  13.490  
  13.491  instance real :: field
  13.492  proof
  13.493 @@ -1444,14 +1444,14 @@
  13.494  qed
  13.495  
  13.496  
  13.497 -subsection{*The @{text "\<le>"} Ordering*}
  13.498 +subsection\<open>The @{text "\<le>"} Ordering\<close>
  13.499  
  13.500  lemma real_le_refl: "w \<le> (w::real)"
  13.501  by (cases w, force simp add: real_le_def)
  13.502  
  13.503 -text{*The arithmetic decision procedure is not set up for type preal.
  13.504 +text\<open>The arithmetic decision procedure is not set up for type preal.
  13.505    This lemma is currently unused, but it could simplify the proofs of the
  13.506 -  following two lemmas.*}
  13.507 +  following two lemmas.\<close>
  13.508  lemma preal_eq_le_imp_le:
  13.509    assumes eq: "a+b = c+d" and le: "c \<le> a"
  13.510    shows "b \<le> (d::preal)"
  13.511 @@ -1545,7 +1545,7 @@
  13.512  apply (simp add: linorder_not_le [where 'a = real, symmetric] 
  13.513                   linorder_not_le [where 'a = preal] 
  13.514                    real_zero_def real_le real_mult)
  13.515 -  --{*Reduce to the (simpler) @{text "\<le>"} relation *}
  13.516 +  --\<open>Reduce to the (simpler) @{text "\<le>"} relation\<close>
  13.517  apply (auto dest!: less_add_left_Ex
  13.518       simp add: algebra_simps preal_self_less_add_left)
  13.519  done
  13.520 @@ -1572,7 +1572,7 @@
  13.521  end
  13.522  
  13.523  
  13.524 -subsection{*The Reals Form an Ordered Field*}
  13.525 +subsection\<open>The Reals Form an Ordered Field\<close>
  13.526  
  13.527  instance real :: linordered_field
  13.528  proof
  13.529 @@ -1584,9 +1584,9 @@
  13.530      by (simp only: real_sgn_def)
  13.531  qed
  13.532  
  13.533 -text{*The function @{term real_of_preal} requires many proofs, but it seems
  13.534 +text\<open>The function @{term real_of_preal} requires many proofs, but it seems
  13.535  to be essential for proving completeness of the reals from that of the
  13.536 -positive reals.*}
  13.537 +positive reals.\<close>
  13.538  
  13.539  lemma real_of_preal_add:
  13.540       "real_of_preal ((x::preal) + y) = real_of_preal x + real_of_preal y"
  13.541 @@ -1597,7 +1597,7 @@
  13.542  by (simp add: real_of_preal_def real_mult algebra_simps)
  13.543  
  13.544  
  13.545 -text{*Gleason prop 9-4.4 p 127*}
  13.546 +text\<open>Gleason prop 9-4.4 p 127\<close>
  13.547  lemma real_of_preal_trichotomy:
  13.548        "\<exists>m. (x::real) = real_of_preal m | x = 0 | x = -(real_of_preal m)"
  13.549  apply (simp add: real_of_preal_def real_zero_def, cases x)
  13.550 @@ -1641,7 +1641,7 @@
  13.551  qed
  13.552  
  13.553  
  13.554 -subsection{*Theorems About the Ordering*}
  13.555 +subsection\<open>Theorems About the Ordering\<close>
  13.556  
  13.557  lemma real_gt_zero_preal_Ex: "(0 < x) = (\<exists>y. x = real_of_preal y)"
  13.558  apply (auto simp add: real_of_preal_zero_less)
  13.559 @@ -1666,9 +1666,9 @@
  13.560  lemma real_less_all_real2: "~ 0 < y ==> \<forall>x. y < real_of_preal x"
  13.561  by (blast intro!: real_less_all_preal linorder_not_less [THEN iffD1])
  13.562  
  13.563 -subsection {* Completeness of Positive Reals *}
  13.564 +subsection \<open>Completeness of Positive Reals\<close>
  13.565  
  13.566 -text {*
  13.567 +text \<open>
  13.568    Supremum property for the set of positive reals
  13.569  
  13.570    Let @{text "P"} be a non-empty set of positive reals, with an upper
  13.571 @@ -1676,7 +1676,7 @@
  13.572    (written @{text "S"}).
  13.573  
  13.574    FIXME: Can the premise be weakened to @{text "\<forall>x \<in> P. x\<le> y"}?
  13.575 -*}
  13.576 +\<close>
  13.577  
  13.578  lemma posreal_complete:
  13.579    assumes positive_P: "\<forall>x \<in> P. (0::real) < x"
  13.580 @@ -1713,12 +1713,12 @@
  13.581      with positive_P have a_pos: "0 < a" ..
  13.582      then obtain pa where "a = real_of_preal pa"
  13.583        by (auto simp add: real_gt_zero_preal_Ex)
  13.584 -    hence "pa \<in> ?pP" using `a \<in> P` by auto
  13.585 +    hence "pa \<in> ?pP" using \<open>a \<in> P\<close> by auto
  13.586      hence pP_not_empty: "?pP \<noteq> {}" by auto
  13.587  
  13.588      obtain sup where sup: "\<forall>x \<in> P. x < sup"
  13.589        using upper_bound_Ex ..
  13.590 -    from this and `a \<in> P` have "a < sup" ..
  13.591 +    from this and \<open>a \<in> P\<close> have "a < sup" ..
  13.592      hence "0 < sup" using a_pos by arith
  13.593      then obtain possup where "sup = real_of_preal possup"
  13.594        by (auto simp add: real_gt_zero_preal_Ex)
  13.595 @@ -1766,9 +1766,9 @@
  13.596    qed
  13.597  qed
  13.598  
  13.599 -text {*
  13.600 +text \<open>
  13.601    \medskip Completeness
  13.602 -*}
  13.603 +\<close>
  13.604  
  13.605  lemma reals_complete:
  13.606    fixes S :: "real set"
  13.607 @@ -1860,7 +1860,7 @@
  13.608    qed
  13.609  qed
  13.610  
  13.611 -subsection {* The Archimedean Property of the Reals *}
  13.612 +subsection \<open>The Archimedean Property of the Reals\<close>
  13.613  
  13.614  theorem reals_Archimedean:
  13.615    fixes x :: real
  13.616 @@ -1908,10 +1908,10 @@
  13.617    thus False using x_pos by arith
  13.618  qed
  13.619  
  13.620 -text {*
  13.621 +text \<open>
  13.622    There must be other proofs, e.g. @{text Suc} of the largest
  13.623    integer in the cut representing @{text "x"}.
  13.624 -*}
  13.625 +\<close>
  13.626  
  13.627  lemma reals_Archimedean2: "\<exists>n. (x::real) < of_nat (n::nat)"
  13.628  proof cases
    14.1 --- a/src/HOL/ex/Erdoes_Szekeres.thy	Tue Oct 06 17:46:07 2015 +0200
    14.2 +++ b/src/HOL/ex/Erdoes_Szekeres.thy	Tue Oct 06 17:47:28 2015 +0200
    14.3 @@ -2,13 +2,13 @@
    14.4       Author: Lukas Bulwahn <lukas.bulwahn-at-gmail.com>
    14.5  *)
    14.6  
    14.7 -section {* The Erdoes-Szekeres Theorem *}
    14.8 +section \<open>The Erdoes-Szekeres Theorem\<close>
    14.9  
   14.10  theory Erdoes_Szekeres
   14.11  imports Main
   14.12  begin
   14.13  
   14.14 -subsection {* Addition to @{theory Lattices_Big} Theory *}
   14.15 +subsection \<open>Addition to @{theory Lattices_Big} Theory\<close>
   14.16  
   14.17  lemma Max_gr:
   14.18    assumes "finite A"
   14.19 @@ -16,7 +16,7 @@
   14.20    shows "x < Max A"
   14.21  using assms Max_ge less_le_trans by blast
   14.22  
   14.23 -subsection {* Additions to @{theory Finite_Set} Theory *}
   14.24 +subsection \<open>Additions to @{theory Finite_Set} Theory\<close>
   14.25  
   14.26  lemma obtain_subset_with_card_n:
   14.27    assumes "n \<le> card S"
   14.28 @@ -43,12 +43,12 @@
   14.29      from this insertI.hyps(2) obtain s where s: "s \<in> S'" "card s = Max (card ` S')" by auto
   14.30      from this(1) have that: "(if card s \<ge> card s' then s else s') \<in> insert s' S'" by auto
   14.31      have "card (if card s \<ge> card s' then s else s') = Max (card ` insert s' S')"
   14.32 -      using insertI(1) `S' \<noteq> {}` s by auto
   14.33 +      using insertI(1) \<open>S' \<noteq> {}\<close> s by auto
   14.34      from this that show ?thesis by blast
   14.35    qed (auto)
   14.36  qed (auto)
   14.37  
   14.38 -subsection {* Definition of Monotonicity over a Carrier Set *}
   14.39 +subsection \<open>Definition of Monotonicity over a Carrier Set\<close>
   14.40  
   14.41  definition
   14.42    "mono_on f R S = (\<forall>i\<in>S. \<forall>j\<in>S. i \<le> j \<longrightarrow> R (f i) (f j))"
   14.43 @@ -72,7 +72,7 @@
   14.44    "transp (op \<ge> :: 'a::order \<Rightarrow> _ \<Rightarrow> bool)"
   14.45  unfolding reflp_def transp_def by auto
   14.46  
   14.47 -subsection {* The Erdoes-Szekeres Theorem following Seidenberg's (1959) argument *}
   14.48 +subsection \<open>The Erdoes-Szekeres Theorem following Seidenberg's (1959) argument\<close>
   14.49  
   14.50  lemma Erdoes_Szekeres:
   14.51    fixes f :: "_ \<Rightarrow> 'a::linorder"
   14.52 @@ -98,7 +98,7 @@
   14.53      {
   14.54        fix S
   14.55        assume "S \<subseteq> {0..m * n}" "card S \<ge> b + 1"
   14.56 -      moreover from `card S \<ge> b + 1` obtain T where "T \<subseteq> S \<and> card T = Suc b"
   14.57 +      moreover from \<open>card S \<ge> b + 1\<close> obtain T where "T \<subseteq> S \<and> card T = Suc b"
   14.58          using obtain_subset_with_card_n by (metis Suc_eq_plus1)
   14.59        ultimately have "\<not> mono_on f R S" using not_mono_at by (auto dest: not_mono_on_subset)
   14.60      }
   14.61 @@ -131,19 +131,19 @@
   14.62      {
   14.63        fix R
   14.64        assume R: "reflp (R :: 'a::linorder \<Rightarrow> _)" "transp R" "R (f i) (f j)"
   14.65 -      from one_member[OF `reflp R`, of "i"] have
   14.66 +      from one_member[OF \<open>reflp R\<close>, of "i"] have
   14.67          "\<exists>S \<in> {S. S \<subseteq> {0..i} \<and> mono_on f R S \<and> i \<in> S}. card S = ?max_subseq R i"
   14.68          by (intro exists_set_with_max_card) auto
   14.69        from this obtain S where S: "S \<subseteq> {0..i} \<and> mono_on f R S \<and> i \<in> S" "card S = ?max_subseq R i" by auto
   14.70 -      from S `i < j` finite_subset have "j \<notin> S" "finite S" "insert j S \<subseteq> {0..j}" by auto
   14.71 -      from S(1) R `i < j` this have "mono_on f R (insert j S)"
   14.72 +      from S \<open>i < j\<close> finite_subset have "j \<notin> S" "finite S" "insert j S \<subseteq> {0..j}" by auto
   14.73 +      from S(1) R \<open>i < j\<close> this have "mono_on f R (insert j S)"
   14.74          unfolding mono_on_def reflp_def transp_def
   14.75          by (metis atLeastAtMost_iff insert_iff le_antisym subsetCE)
   14.76        from this have d: "insert j S \<in> {S. S \<subseteq> {0..j} \<and> mono_on f R S \<and> j \<in> S}"
   14.77 -        using `insert j S \<subseteq> {0..j}` by blast
   14.78 -      from this `j \<notin> S` S(1) have "card (insert j S) \<in>
   14.79 +        using \<open>insert j S \<subseteq> {0..j}\<close> by blast
   14.80 +      from this \<open>j \<notin> S\<close> S(1) have "card (insert j S) \<in>
   14.81          card ` {S. S \<subseteq> {0..j} \<and> mono_on f R S \<and> j \<in> S} \<and> card S < card (insert j S)"
   14.82 -        by (auto intro!: imageI) (auto simp add: `finite S`)
   14.83 +        by (auto intro!: imageI) (auto simp add: \<open>finite S\<close>)
   14.84        from this S(2) have "?max_subseq R i < ?max_subseq R j" by (auto intro: Max_gr)
   14.85      } note max_subseq_increase = this
   14.86      have "?max_subseq (op \<le>) i < ?max_subseq (op \<le>) j \<or> ?max_subseq (op \<ge>) i < ?max_subseq (op \<ge>) j"
    15.1 --- a/src/HOL/ex/Eval_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    15.2 +++ b/src/HOL/ex/Eval_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    15.3 @@ -1,12 +1,12 @@
    15.4  (* Author: Florian Haftmann, TU Muenchen *)
    15.5  
    15.6 -section {* Small examples for evaluation mechanisms *}
    15.7 +section \<open>Small examples for evaluation mechanisms\<close>
    15.8  
    15.9  theory Eval_Examples
   15.10  imports Complex_Main
   15.11  begin
   15.12  
   15.13 -text {* evaluation oracle *}
   15.14 +text \<open>evaluation oracle\<close>
   15.15  
   15.16  lemma "True \<or> False" by eval
   15.17  lemma "Suc 0 \<noteq> Suc 1" by eval
   15.18 @@ -14,7 +14,7 @@
   15.19  lemma "[()] = [()]" by eval
   15.20  lemma "fst ([] :: nat list, Suc 0) = []" by eval
   15.21  
   15.22 -text {* normalization *}
   15.23 +text \<open>normalization\<close>
   15.24  
   15.25  lemma "True \<or> False" by normalization
   15.26  lemma "Suc 0 \<noteq> Suc 1" by normalization
   15.27 @@ -22,7 +22,7 @@
   15.28  lemma "[()] = [()]" by normalization
   15.29  lemma "fst ([] :: nat list, Suc 0) = []" by normalization
   15.30  
   15.31 -text {* term evaluation *}
   15.32 +text \<open>term evaluation\<close>
   15.33  
   15.34  value "(Suc 2 + 1) * 4"
   15.35  
   15.36 @@ -40,7 +40,7 @@
   15.37  
   15.38  value "[(nat 100, ())]"
   15.39  
   15.40 -text {* a fancy datatype *}
   15.41 +text \<open>a fancy datatype\<close>
   15.42  
   15.43  datatype ('a, 'b) foo =
   15.44      Foo "'a::order" 'b
    16.1 --- a/src/HOL/ex/Executable_Relation.thy	Tue Oct 06 17:46:07 2015 +0200
    16.2 +++ b/src/HOL/ex/Executable_Relation.thy	Tue Oct 06 17:47:28 2015 +0200
    16.3 @@ -2,9 +2,9 @@
    16.4  imports Main
    16.5  begin
    16.6  
    16.7 -subsection {* A dedicated type for relations *}
    16.8 +subsection \<open>A dedicated type for relations\<close>
    16.9  
   16.10 -subsubsection {* Definition of the dedicated type for relations *}
   16.11 +subsubsection \<open>Definition of the dedicated type for relations\<close>
   16.12  
   16.13  typedef 'a rel = "UNIV :: (('a * 'a) set) set"
   16.14  morphisms set_of_rel rel_of_set by simp
   16.15 @@ -13,7 +13,7 @@
   16.16  
   16.17  lift_definition Rel :: "'a set => ('a * 'a) set => 'a rel" is "\<lambda> X R. Id_on X Un R" .
   16.18  
   16.19 -subsubsection {* Constant definitions on relations *}
   16.20 +subsubsection \<open>Constant definitions on relations\<close>
   16.21  
   16.22  hide_const (open) converse relcomp rtrancl Image
   16.23  
   16.24 @@ -29,7 +29,7 @@
   16.25  
   16.26  lift_definition Image :: "'a rel => 'a set => 'a set" is "Relation.Image" .
   16.27  
   16.28 -subsubsection {* Code generation *}
   16.29 +subsubsection \<open>Code generation\<close>
   16.30  
   16.31  code_datatype Rel
   16.32  
    17.1 --- a/src/HOL/ex/Execute_Choice.thy	Tue Oct 06 17:46:07 2015 +0200
    17.2 +++ b/src/HOL/ex/Execute_Choice.thy	Tue Oct 06 17:47:28 2015 +0200
    17.3 @@ -1,22 +1,22 @@
    17.4  (* Author: Florian Haftmann, TU Muenchen *)
    17.5  
    17.6 -section {* A simple cookbook example how to eliminate choice in programs. *}
    17.7 +section \<open>A simple cookbook example how to eliminate choice in programs.\<close>
    17.8  
    17.9  theory Execute_Choice
   17.10  imports Main "~~/src/HOL/Library/AList_Mapping"
   17.11  begin
   17.12  
   17.13 -text {*
   17.14 +text \<open>
   17.15    A trivial example:
   17.16 -*}
   17.17 +\<close>
   17.18  
   17.19  definition valuesum :: "('a, 'b :: ab_group_add) mapping \<Rightarrow> 'b" where
   17.20    "valuesum m = (\<Sum>k \<in> Mapping.keys m. the (Mapping.lookup m k))"
   17.21  
   17.22 -text {*
   17.23 +text \<open>
   17.24    Not that instead of defining @{term valuesum} with choice, we define it
   17.25    directly and derive a description involving choice afterwards:
   17.26 -*}
   17.27 +\<close>
   17.28  
   17.29  lemma valuesum_rec:
   17.30    assumes fin: "finite (dom (Mapping.lookup m))"
   17.31 @@ -44,11 +44,11 @@
   17.32    then show ?thesis unfolding is_empty_def valuesum_def by transfer simp
   17.33  qed
   17.34  
   17.35 -text {*
   17.36 +text \<open>
   17.37    In the context of the else-branch we can show that the exact choice is
   17.38    irrelvant; in practice, finding this point where choice becomes irrelevant is the
   17.39    most difficult thing!
   17.40 -*}
   17.41 +\<close>
   17.42  
   17.43  lemma valuesum_choice:
   17.44    "finite (Mapping.keys M) \<Longrightarrow> x \<in> Mapping.keys M \<Longrightarrow> y \<in> Mapping.keys M \<Longrightarrow>
   17.45 @@ -56,11 +56,11 @@
   17.46      the (Mapping.lookup M y) + valuesum (Mapping.delete y M)"
   17.47    unfolding valuesum_def  by transfer (simp add: setsum_diff)
   17.48  
   17.49 -text {*
   17.50 +text \<open>
   17.51    Given @{text valuesum_rec} as initial description, we stepwise refine it to something executable;
   17.52    first, we formally insert the constructor @{term Mapping} and split the one equation into two,
   17.53    where the second one provides the necessary context:
   17.54 -*}
   17.55 +\<close>
   17.56  
   17.57  lemma valuesum_rec_Mapping:
   17.58    shows [code]: "valuesum (Mapping []) = 0"
   17.59 @@ -68,12 +68,12 @@
   17.60      the (Mapping.lookup (Mapping (x # xs)) l) + valuesum (Mapping.delete l (Mapping (x # xs))))"
   17.61    by (simp_all add: valuesum_rec finite_dom_map_of is_empty_Mapping null_def)
   17.62  
   17.63 -text {*
   17.64 +text \<open>
   17.65    As a side effect the precondition disappears (but note this has nothing to do with choice!).
   17.66    The first equation deals with the uncritical empty case and can already be used for code generation.
   17.67  
   17.68    Using @{text valuesum_choice}, we are able to prove an executable version of @{term valuesum}:
   17.69 -*}
   17.70 +\<close>
   17.71  
   17.72  lemma valuesum_rec_exec [code]:
   17.73    "valuesum (Mapping (x # xs)) = (let l = fst (hd (x # xs)) in
   17.74 @@ -93,9 +93,9 @@
   17.75    then show ?thesis by (simp add: valuesum_rec_Mapping)
   17.76  qed
   17.77    
   17.78 -text {*
   17.79 +text \<open>
   17.80    See how it works:
   17.81 -*}
   17.82 +\<close>
   17.83  
   17.84  value "valuesum (Mapping [(''abc'', (42::int)), (''def'', 1705)])"
   17.85  
    18.1 --- a/src/HOL/ex/FinFunPred.thy	Tue Oct 06 17:46:07 2015 +0200
    18.2 +++ b/src/HOL/ex/FinFunPred.thy	Tue Oct 06 17:47:28 2015 +0200
    18.3 @@ -1,12 +1,12 @@
    18.4  (*  Author:     Andreas Lochbihler *)
    18.5  
    18.6 -section {*
    18.7 +section \<open>
    18.8    Predicates modelled as FinFuns
    18.9 -*}
   18.10 +\<close>
   18.11  
   18.12  theory FinFunPred imports "~~/src/HOL/Library/FinFun_Syntax" begin
   18.13  
   18.14 -text {* Instantiate FinFun predicates just like predicates *}
   18.15 +text \<open>Instantiate FinFun predicates just like predicates\<close>
   18.16  
   18.17  type_synonym 'a pred\<^sub>f = "'a \<Rightarrow>f bool"
   18.18  
   18.19 @@ -97,9 +97,9 @@
   18.20  by(intro_classes)
   18.21    (simp_all add: uminus_finfun_def inf_finfun_def expand_finfun_eq sup_fun_def inf_fun_def fun_Compl_def o_def inf_compl_bot sup_compl_top diff_eq)
   18.22  
   18.23 -text {*
   18.24 +text \<open>
   18.25    Replicate predicate operations for FinFuns
   18.26 -*}
   18.27 +\<close>
   18.28  
   18.29  abbreviation finfun_empty :: "'a pred\<^sub>f" ("{}\<^sub>f")
   18.30  where "{}\<^sub>f \<equiv> bot"
   18.31 @@ -125,9 +125,9 @@
   18.32  lemma finfun_leD [elim]: "\<lbrakk> A \<le> B; A $ x \<rbrakk> \<Longrightarrow> B $ x"
   18.33  by(simp add: le_finfun_def)
   18.34  
   18.35 -text {* Bounded quantification.
   18.36 +text \<open>Bounded quantification.
   18.37    Warning: @{text "finfun_Ball"} and @{text "finfun_Ex"} may raise an exception, they should not be used for quickcheck
   18.38 -*}
   18.39 +\<close>
   18.40  
   18.41  definition finfun_Ball_except :: "'a list \<Rightarrow> 'a pred\<^sub>f \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
   18.42  where [code del]: "finfun_Ball_except xs A P = (\<forall>a. A $ a \<longrightarrow> a \<in> set xs \<or> P a)"
   18.43 @@ -183,7 +183,7 @@
   18.44  by(auto intro!: ext simp add: finfun_Bex_except_def finfun_Bex_def)
   18.45  
   18.46  
   18.47 -text {* Automatically replace predicate operations by finfun predicate operations where possible *}
   18.48 +text \<open>Automatically replace predicate operations by finfun predicate operations where possible\<close>
   18.49  
   18.50  lemma iso_finfun_le [code_unfold]:
   18.51    "op $ A \<le> op $ B \<longleftrightarrow> A \<le> B"
   18.52 @@ -236,11 +236,11 @@
   18.53    shows "op $ A - op $ B = op $ (A - B)"
   18.54  by(simp)
   18.55  
   18.56 -text {*
   18.57 +text \<open>
   18.58    Do not declare the following two theorems as @{text "[code_unfold]"},
   18.59    because this causes quickcheck to fail frequently when bounded quantification is used which raises an exception.
   18.60    For code generation, the same problems occur, but then, no randomly generated FinFun is usually around.
   18.61 -*}
   18.62 +\<close>
   18.63  
   18.64  lemma iso_finfun_Ball_Ball:
   18.65    "(\<forall>x. A $ x \<longrightarrow> P x) \<longleftrightarrow> finfun_Ball A P"
   18.66 @@ -250,7 +250,7 @@
   18.67    "(\<exists>x. A $ x \<and> P x) \<longleftrightarrow> finfun_Bex A P"
   18.68  by(simp add: finfun_Bex_def)
   18.69  
   18.70 -text {* Test code setup *}
   18.71 +text \<open>Test code setup\<close>
   18.72  
   18.73  notepad begin
   18.74  have "inf ((\<lambda>_ :: nat. False)(1 := True, 2 := True)) ((\<lambda>_. True)(3 := False)) \<le> 
    19.1 --- a/src/HOL/ex/Fundefs.thy	Tue Oct 06 17:46:07 2015 +0200
    19.2 +++ b/src/HOL/ex/Fundefs.thy	Tue Oct 06 17:47:28 2015 +0200
    19.3 @@ -2,13 +2,13 @@
    19.4      Author:     Alexander Krauss, TU Muenchen
    19.5  *)
    19.6  
    19.7 -section {* Examples of function definitions *}
    19.8 +section \<open>Examples of function definitions\<close>
    19.9  
   19.10  theory Fundefs 
   19.11  imports Main "~~/src/HOL/Library/Monad_Syntax"
   19.12  begin
   19.13  
   19.14 -subsection {* Very basic *}
   19.15 +subsection \<open>Very basic\<close>
   19.16  
   19.17  fun fib :: "nat \<Rightarrow> nat"
   19.18  where
   19.19 @@ -16,22 +16,22 @@
   19.20  | "fib (Suc 0) = 1"
   19.21  | "fib (Suc (Suc n)) = fib n + fib (Suc n)"
   19.22  
   19.23 -text {* partial simp and induction rules: *}
   19.24 +text \<open>partial simp and induction rules:\<close>
   19.25  thm fib.psimps
   19.26  thm fib.pinduct
   19.27  
   19.28 -text {* There is also a cases rule to distinguish cases along the definition *}
   19.29 +text \<open>There is also a cases rule to distinguish cases along the definition\<close>
   19.30  thm fib.cases
   19.31  
   19.32  
   19.33 -text {* total simp and induction rules: *}
   19.34 +text \<open>total simp and induction rules:\<close>
   19.35  thm fib.simps
   19.36  thm fib.induct
   19.37  
   19.38 -text {* elimination rules *}
   19.39 +text \<open>elimination rules\<close>
   19.40  thm fib.elims
   19.41  
   19.42 -subsection {* Currying *}
   19.43 +subsection \<open>Currying\<close>
   19.44  
   19.45  fun add
   19.46  where
   19.47 @@ -39,10 +39,10 @@
   19.48  | "add (Suc x) y = Suc (add x y)"
   19.49  
   19.50  thm add.simps
   19.51 -thm add.induct -- {* Note the curried induction predicate *}
   19.52 +thm add.induct -- \<open>Note the curried induction predicate\<close>
   19.53  
   19.54  
   19.55 -subsection {* Nested recursion *}
   19.56 +subsection \<open>Nested recursion\<close>
   19.57  
   19.58  function nz 
   19.59  where
   19.60 @@ -50,7 +50,7 @@
   19.61  | "nz (Suc x) = nz (nz x)"
   19.62  by pat_completeness auto
   19.63  
   19.64 -lemma nz_is_zero: -- {* A lemma we need to prove termination *}
   19.65 +lemma nz_is_zero: -- \<open>A lemma we need to prove termination\<close>
   19.66    assumes trm: "nz_dom x"
   19.67    shows "nz x = 0"
   19.68  using trm
   19.69 @@ -62,7 +62,7 @@
   19.70  thm nz.simps
   19.71  thm nz.induct
   19.72  
   19.73 -text {* Here comes McCarthy's 91-function *}
   19.74 +text \<open>Here comes McCarthy's 91-function\<close>
   19.75  
   19.76  
   19.77  function f91 :: "nat => nat"
   19.78 @@ -86,21 +86,21 @@
   19.79  
   19.80    assume inner_trm: "f91_dom (n + 11)" (* Outer call *)
   19.81    with f91_estimate have "n + 11 < f91 (n + 11) + 11" .
   19.82 -  with `~ 100 < n` show "(f91 (n + 11), n) : ?R" by simp 
   19.83 +  with \<open>~ 100 < n\<close> show "(f91 (n + 11), n) : ?R" by simp 
   19.84  qed
   19.85  
   19.86 -text{* Now trivial (even though it does not belong here): *}
   19.87 +text\<open>Now trivial (even though it does not belong here):\<close>
   19.88  lemma "f91 n = (if 100 < n then n - 10 else 91)"
   19.89  by (induct n rule:f91.induct) auto
   19.90  
   19.91  
   19.92 -subsection {* More general patterns *}
   19.93 +subsection \<open>More general patterns\<close>
   19.94  
   19.95 -subsubsection {* Overlapping patterns *}
   19.96 +subsubsection \<open>Overlapping patterns\<close>
   19.97  
   19.98 -text {* Currently, patterns must always be compatible with each other, since
   19.99 +text \<open>Currently, patterns must always be compatible with each other, since
  19.100  no automatic splitting takes place. But the following definition of
  19.101 -gcd is ok, although patterns overlap: *}
  19.102 +gcd is ok, although patterns overlap:\<close>
  19.103  
  19.104  fun gcd2 :: "nat \<Rightarrow> nat \<Rightarrow> nat"
  19.105  where
  19.106 @@ -112,9 +112,9 @@
  19.107  thm gcd2.simps
  19.108  thm gcd2.induct
  19.109  
  19.110 -subsubsection {* Guards *}
  19.111 +subsubsection \<open>Guards\<close>
  19.112  
  19.113 -text {* We can reformulate the above example using guarded patterns *}
  19.114 +text \<open>We can reformulate the above example using guarded patterns\<close>
  19.115  
  19.116  function gcd3 :: "nat \<Rightarrow> nat \<Rightarrow> nat"
  19.117  where
  19.118 @@ -131,13 +131,13 @@
  19.119  thm gcd3.induct
  19.120  
  19.121  
  19.122 -text {* General patterns allow even strange definitions: *}
  19.123 +text \<open>General patterns allow even strange definitions:\<close>
  19.124  
  19.125  function ev :: "nat \<Rightarrow> bool"
  19.126  where
  19.127    "ev (2 * n) = True"
  19.128  | "ev (2 * n + 1) = False"
  19.129 -proof -  -- {* completeness is more difficult here \dots *}
  19.130 +proof -  -- \<open>completeness is more difficult here \dots\<close>
  19.131    fix P :: bool
  19.132      and x :: nat
  19.133    assume c1: "\<And>n. x = 2 * n \<Longrightarrow> P"
  19.134 @@ -154,7 +154,7 @@
  19.135      with divmod have "x = 2 * (x div 2) + 1" by simp
  19.136      with c2 show "P" .
  19.137    qed
  19.138 -qed presburger+ -- {* solve compatibility with presburger *} 
  19.139 +qed presburger+ -- \<open>solve compatibility with presburger\<close> 
  19.140  termination by lexicographic_order
  19.141  
  19.142  thm ev.simps
  19.143 @@ -162,7 +162,7 @@
  19.144  thm ev.cases
  19.145  
  19.146  
  19.147 -subsection {* Mutual Recursion *}
  19.148 +subsection \<open>Mutual Recursion\<close>
  19.149  
  19.150  fun evn od :: "nat \<Rightarrow> bool"
  19.151  where
  19.152 @@ -180,7 +180,7 @@
  19.153  thm evn.elims
  19.154  thm od.elims
  19.155  
  19.156 -subsection {* Definitions in local contexts *}
  19.157 +subsection \<open>Definitions in local contexts\<close>
  19.158  
  19.159  locale my_monoid = 
  19.160  fixes opr :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
  19.161 @@ -213,9 +213,9 @@
  19.162  thm my_monoid.foldL.simps
  19.163  thm my_monoid.foldR_foldL
  19.164  
  19.165 -subsection {* @{text fun_cases} *}
  19.166 +subsection \<open>@{text fun_cases}\<close>
  19.167  
  19.168 -subsubsection {* Predecessor *}
  19.169 +subsubsection \<open>Predecessor\<close>
  19.170  
  19.171  fun pred :: "nat \<Rightarrow> nat" where
  19.172  "pred 0 = 0" |
  19.173 @@ -227,7 +227,7 @@
  19.174  obtains "x = 0" "y = 0" | "n" where "x = Suc n" "y = n"
  19.175  by (fact pred.elims[OF assms])
  19.176  
  19.177 -text {* If the predecessor of a number is 0, that number must be 0 or 1. *}
  19.178 +text \<open>If the predecessor of a number is 0, that number must be 0 or 1.\<close>
  19.179  
  19.180  fun_cases pred0E[elim]: "pred n = 0"
  19.181  
  19.182 @@ -235,16 +235,16 @@
  19.183  by (erule pred0E) metis+
  19.184  
  19.185  
  19.186 -text {* Other expressions on the right-hand side also work, but whether the
  19.187 +text \<open>Other expressions on the right-hand side also work, but whether the
  19.188          generated rule is useful depends on how well the simplifier can
  19.189 -        simplify it. This example works well: *}
  19.190 +        simplify it. This example works well:\<close>
  19.191  
  19.192  fun_cases pred42E[elim]: "pred n = 42"
  19.193  
  19.194  lemma "pred n = 42 \<Longrightarrow> n = 43"
  19.195  by (erule pred42E)
  19.196  
  19.197 -subsubsection {* List to option *}
  19.198 +subsubsection \<open>List to option\<close>
  19.199  
  19.200  fun list_to_option :: "'a list \<Rightarrow> 'a option" where
  19.201  "list_to_option [x] = Some x" |
  19.202 @@ -256,7 +256,7 @@
  19.203  lemma "list_to_option xs = Some y \<Longrightarrow> xs = [y]"
  19.204  by (erule list_to_option_SomeE)
  19.205  
  19.206 -subsubsection {* Boolean Functions *}
  19.207 +subsubsection \<open>Boolean Functions\<close>
  19.208  
  19.209  fun xor :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
  19.210  "xor False False = False" |
  19.211 @@ -265,13 +265,13 @@
  19.212  
  19.213  thm xor.elims
  19.214  
  19.215 -text {* @{text fun_cases} does not only recognise function equations, but also works with
  19.216 -   functions that return a boolean, e.g.: *}
  19.217 +text \<open>@{text fun_cases} does not only recognise function equations, but also works with
  19.218 +   functions that return a boolean, e.g.:\<close>
  19.219  
  19.220  fun_cases xor_TrueE: "xor a b" and xor_FalseE: "\<not>xor a b"
  19.221  print_theorems
  19.222  
  19.223 -subsubsection {* Many parameters *}
  19.224 +subsubsection \<open>Many parameters\<close>
  19.225  
  19.226  fun sum4 :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat" where
  19.227  "sum4 a b c d = a + b + c + d"
  19.228 @@ -282,9 +282,9 @@
  19.229  by (erule sum40E)
  19.230  
  19.231  
  19.232 -subsection {* Partial Function Definitions *}
  19.233 +subsection \<open>Partial Function Definitions\<close>
  19.234  
  19.235 -text {* Partial functions in the option monad: *}
  19.236 +text \<open>Partial functions in the option monad:\<close>
  19.237  
  19.238  partial_function (option)
  19.239    collatz :: "nat \<Rightarrow> nat list option"
  19.240 @@ -299,17 +299,17 @@
  19.241  value "collatz 23"
  19.242  
  19.243  
  19.244 -text {* Tail-recursive functions: *}
  19.245 +text \<open>Tail-recursive functions:\<close>
  19.246  
  19.247  partial_function (tailrec) fixpoint :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a"
  19.248  where
  19.249    "fixpoint f x = (if f x = x then x else fixpoint f (f x))"
  19.250  
  19.251  
  19.252 -subsection {* Regression tests *}
  19.253 +subsection \<open>Regression tests\<close>
  19.254  
  19.255 -text {* The following examples mainly serve as tests for the 
  19.256 -  function package *}
  19.257 +text \<open>The following examples mainly serve as tests for the 
  19.258 +  function package\<close>
  19.259  
  19.260  fun listlen :: "'a list \<Rightarrow> nat"
  19.261  where
    20.1 --- a/src/HOL/ex/Gauge_Integration.thy	Tue Oct 06 17:46:07 2015 +0200
    20.2 +++ b/src/HOL/ex/Gauge_Integration.thy	Tue Oct 06 17:47:28 2015 +0200
    20.3 @@ -4,13 +4,13 @@
    20.4      Replaced by ~~/src/HOL/Multivariate_Analysis/Real_Integral.thy .
    20.5  *)
    20.6  
    20.7 -section{*Theory of Integration on real intervals*}
    20.8 +section\<open>Theory of Integration on real intervals\<close>
    20.9  
   20.10  theory Gauge_Integration
   20.11  imports Complex_Main
   20.12  begin
   20.13  
   20.14 -text {*
   20.15 +text \<open>
   20.16  
   20.17  \textbf{Attention}: This theory defines the Integration on real
   20.18  intervals.  This is just a example theory for historical / expository interests.
   20.19 @@ -20,18 +20,18 @@
   20.20  Multivariate Analysis package also provides a better support for analysis on
   20.21  integrals.
   20.22  
   20.23 -*}
   20.24 +\<close>
   20.25  
   20.26 -text{*We follow John Harrison in formalizing the Gauge integral.*}
   20.27 +text\<open>We follow John Harrison in formalizing the Gauge integral.\<close>
   20.28  
   20.29 -subsection {* Gauges *}
   20.30 +subsection \<open>Gauges\<close>
   20.31  
   20.32  definition
   20.33    gauge :: "[real set, real => real] => bool" where
   20.34    "gauge E g = (\<forall>x\<in>E. 0 < g(x))"
   20.35  
   20.36  
   20.37 -subsection {* Gauge-fine divisions *}
   20.38 +subsection \<open>Gauge-fine divisions\<close>
   20.39  
   20.40  inductive
   20.41    fine :: "[real \<Rightarrow> real, real \<times> real, (real \<times> real \<times> real) list] \<Rightarrow> bool"
   20.42 @@ -99,7 +99,7 @@
   20.43    shows "P a b"
   20.44    using 1 2 3 by (rule Bolzano)
   20.45  
   20.46 -text{*We can always find a division that is fine wrt any gauge*}
   20.47 +text\<open>We can always find a division that is fine wrt any gauge\<close>
   20.48  
   20.49  lemma fine_exists:
   20.50    assumes "a \<le> b" and "gauge {a..b} \<delta>" shows "\<exists>D. fine \<delta> (a, b) D"
   20.51 @@ -107,12 +107,12 @@
   20.52    {
   20.53      fix u v :: real assume "u \<le> v"
   20.54      have "a \<le> u \<Longrightarrow> v \<le> b \<Longrightarrow> \<exists>D. fine \<delta> (u, v) D"
   20.55 -      apply (induct u v rule: BOLZANO, rule `u \<le> v`)
   20.56 +      apply (induct u v rule: BOLZANO, rule \<open>u \<le> v\<close>)
   20.57         apply (simp, fast intro: fine_append)
   20.58        apply (case_tac "a \<le> x \<and> x \<le> b")
   20.59         apply (rule_tac x="\<delta> x" in exI)
   20.60         apply (rule conjI)
   20.61 -        apply (simp add: `gauge {a..b} \<delta>` [unfolded gauge_def])
   20.62 +        apply (simp add: \<open>gauge {a..b} \<delta>\<close> [unfolded gauge_def])
   20.63         apply (clarify, rename_tac u v)
   20.64         apply (case_tac "u = v")
   20.65          apply (fast intro: fine_Nil)
   20.66 @@ -120,7 +120,7 @@
   20.67        apply (rule_tac x="1" in exI, clarsimp)
   20.68        done
   20.69    }
   20.70 -  with `a \<le> b` show ?thesis by auto
   20.71 +  with \<open>a \<le> b\<close> show ?thesis by auto
   20.72  qed
   20.73  
   20.74  lemma fine_covers_all:
   20.75 @@ -160,11 +160,11 @@
   20.76      proof (cases D1)
   20.77        case Nil
   20.78        hence "fst (hd D2) = a'" using 2 by auto
   20.79 -      with fine_Cons[OF `fine \<delta> (b,c) D` induct(3,4,5)] Nil induct
   20.80 +      with fine_Cons[OF \<open>fine \<delta> (b,c) D\<close> induct(3,4,5)] Nil induct
   20.81        show ?thesis by (auto intro: fine_Nil)
   20.82      next
   20.83        case (Cons d1 D1')
   20.84 -      with induct(2)[OF `D2 \<noteq> []`, of D1'] induct(8)
   20.85 +      with induct(2)[OF \<open>D2 \<noteq> []\<close>, of D1'] induct(8)
   20.86        have "fine \<delta> (b, fst (hd D2)) D1'" and "fine \<delta> (fst (hd D2), c) D2" and
   20.87          "d1 = (a', x, b)" by auto
   20.88        with fine_Cons[OF this(1) induct(3,4,5), OF induct(6)] Cons
   20.89 @@ -185,9 +185,9 @@
   20.90    show ?case
   20.91    proof (rule fine_Cons)
   20.92      show "fine \<delta>' (b,c) D" using 2 by auto
   20.93 -    from fine_imp_le[OF 2(1)] 2(6) `x \<le> b`
   20.94 +    from fine_imp_le[OF 2(1)] 2(6) \<open>x \<le> b\<close>
   20.95      show "b - a < \<delta>' x"
   20.96 -      using 2(7)[OF `a \<le> x`] by auto
   20.97 +      using 2(7)[OF \<open>a \<le> x\<close>] by auto
   20.98    qed (auto simp add: 2)
   20.99  qed
  20.100  
  20.101 @@ -198,7 +198,7 @@
  20.102    case (2 b c  D a x)
  20.103    hence "D = []" and "a = d" and "b = e" by auto
  20.104    moreover
  20.105 -  from `fine \<delta> (b,c) D` `D = []` have "b = c"
  20.106 +  from \<open>fine \<delta> (b,c) D\<close> \<open>D = []\<close> have "b = c"
  20.107      by (rule empty_fine_imp_eq)
  20.108    ultimately show ?case by simp
  20.109  qed auto
  20.110 @@ -208,7 +208,7 @@
  20.111    shows "fine \<delta> (a, b) D \<Longrightarrow> (\<Sum>(u, x, v)\<leftarrow>D. f v - f u) = f b - f a"
  20.112  by (induct set: fine) simp_all
  20.113  
  20.114 -text{*Lemmas about combining gauges*}
  20.115 +text\<open>Lemmas about combining gauges\<close>
  20.116  
  20.117  lemma gauge_min:
  20.118       "[| gauge(E) g1; gauge(E) g2 |]
  20.119 @@ -223,7 +223,7 @@
  20.120  apply (simp add: fine_Cons)
  20.121  done
  20.122  
  20.123 -subsection {* Riemann sum *}
  20.124 +subsection \<open>Riemann sum\<close>
  20.125  
  20.126  definition
  20.127    rsum :: "[(real \<times> real \<times> real) list, real \<Rightarrow> real] \<Rightarrow> real" where
  20.128 @@ -251,7 +251,7 @@
  20.129  unfolding rsum_def map_append listsum_append ..
  20.130  
  20.131  
  20.132 -subsection {* Gauge integrability (definite) *}
  20.133 +subsection \<open>Gauge integrability (definite)\<close>
  20.134  
  20.135  definition
  20.136    Integral :: "[(real*real),real=>real,real] => bool" where
  20.137 @@ -287,7 +287,7 @@
  20.138  apply force
  20.139  done
  20.140  
  20.141 -text{*The integral is unique if it exists*}
  20.142 +text\<open>The integral is unique if it exists\<close>
  20.143  
  20.144  lemma Integral_unique:
  20.145    assumes le: "a \<le> b"
  20.146 @@ -304,7 +304,7 @@
  20.147      d2: "\<forall>D. fine d2 (a, b) D \<longrightarrow> \<bar>rsum D f - k2\<bar> < \<bar>k1 - k2\<bar> / 2"
  20.148      using 2 e by (rule IntegralE)
  20.149    have "gauge {a..b} (\<lambda>x. min (d1 x) (d2 x))"
  20.150 -    using `gauge {a..b} d1` and `gauge {a..b} d2`
  20.151 +    using \<open>gauge {a..b} d1\<close> and \<open>gauge {a..b} d2\<close>
  20.152      by (rule gauge_min)
  20.153    then obtain D where "fine (\<lambda>x. min (d1 x) (d2 x)) (a, b) D"
  20.154      using fine_exists [OF le] by fast
  20.155 @@ -373,11 +373,11 @@
  20.156  
  20.157    obtain \<delta>1 where \<delta>1_gauge: "gauge {a..b} \<delta>1"
  20.158      and I1: "\<And> D. fine \<delta>1 (a,b) D \<Longrightarrow> \<bar> rsum D f - x1 \<bar> < (\<epsilon> / 2)"
  20.159 -    using IntegralE [OF `Integral (a, b) f x1` `0 < \<epsilon>/2`] by auto
  20.160 +    using IntegralE [OF \<open>Integral (a, b) f x1\<close> \<open>0 < \<epsilon>/2\<close>] by auto
  20.161  
  20.162    obtain \<delta>2 where \<delta>2_gauge: "gauge {b..c} \<delta>2"
  20.163      and I2: "\<And> D. fine \<delta>2 (b,c) D \<Longrightarrow> \<bar> rsum D f - x2 \<bar> < (\<epsilon> / 2)"
  20.164 -    using IntegralE [OF `Integral (b, c) f x2` `0 < \<epsilon>/2`] by auto
  20.165 +    using IntegralE [OF \<open>Integral (b, c) f x2\<close> \<open>0 < \<epsilon>/2\<close>] by auto
  20.166  
  20.167    def \<delta> \<equiv> "\<lambda> x. if x < b then min (\<delta>1 x) (b - x)
  20.168             else if x = b then min (\<delta>1 b) (\<delta>2 b)
  20.169 @@ -389,14 +389,14 @@
  20.170    moreover {
  20.171      fix D :: "(real \<times> real \<times> real) list"
  20.172      assume fine: "fine \<delta> (a,c) D"
  20.173 -    from fine_covers_all[OF this `a < b` `b \<le> c`]
  20.174 +    from fine_covers_all[OF this \<open>a < b\<close> \<open>b \<le> c\<close>]
  20.175      obtain N where "N < length D"
  20.176        and *: "\<forall> d t e. D ! N = (d, t, e) \<longrightarrow> d < b \<and> b \<le> e"
  20.177        by auto
  20.178      obtain d t e where D_eq: "D ! N = (d, t, e)" by (cases "D!N", auto)
  20.179      with * have "d < b" and "b \<le> e" by auto
  20.180      have in_D: "(d, t, e) \<in> set D"
  20.181 -      using D_eq[symmetric] using `N < length D` by auto
  20.182 +      using D_eq[symmetric] using \<open>N < length D\<close> by auto
  20.183  
  20.184      from mem_fine[OF fine in_D]
  20.185      have "d < e" and "d \<le> t" and "t \<le> e" by auto
  20.186 @@ -404,7 +404,7 @@
  20.187      have "t = b"
  20.188      proof (rule ccontr)
  20.189        assume "t \<noteq> b"
  20.190 -      with mem_fine3[OF fine in_D] `b \<le> e` `d \<le> t` `t \<le> e` `d < b` \<delta>_def
  20.191 +      with mem_fine3[OF fine in_D] \<open>b \<le> e\<close> \<open>d \<le> t\<close> \<open>t \<le> e\<close> \<open>d < b\<close> \<delta>_def
  20.192        show False by (cases "t < b") auto
  20.193      qed
  20.194  
  20.195 @@ -413,30 +413,30 @@
  20.196      def D1 \<equiv> "take N D @ [(d, t, b)]"
  20.197      def D2 \<equiv> "(if b = e then [] else [(b, t, e)]) @ drop (Suc N) D"
  20.198  
  20.199 -    from hd_drop_conv_nth[OF `N < length D`]
  20.200 -    have "fst (hd ?D2) = d" using `D ! N = (d, t, e)` by auto
  20.201 +    from hd_drop_conv_nth[OF \<open>N < length D\<close>]
  20.202 +    have "fst (hd ?D2) = d" using \<open>D ! N = (d, t, e)\<close> by auto
  20.203      with fine_append_split[OF _ _ append_take_drop_id[symmetric]]
  20.204      have fine1: "fine \<delta> (a,d) ?D1" and fine2: "fine \<delta> (d,c) ?D2"
  20.205 -      using `N < length D` fine by auto
  20.206 +      using \<open>N < length D\<close> fine by auto
  20.207  
  20.208      have "fine \<delta>1 (a,b) D1" unfolding D1_def
  20.209      proof (rule fine_append)
  20.210        show "fine \<delta>1 (a, d) ?D1"
  20.211        proof (rule fine1[THEN fine_\<delta>_expand])
  20.212          fix x assume "a \<le> x" "x \<le> d"
  20.213 -        hence "x \<le> b" using `d < b` `x \<le> d` by auto
  20.214 +        hence "x \<le> b" using \<open>d < b\<close> \<open>x \<le> d\<close> by auto
  20.215          thus "\<delta> x \<le> \<delta>1 x" unfolding \<delta>_def by auto
  20.216        qed
  20.217  
  20.218        have "b - d < \<delta>1 t"
  20.219 -        using mem_fine3[OF fine in_D] \<delta>_def `b \<le> e` `t = b` by auto
  20.220 -      from `d < b` `d \<le> t` `t = b` this
  20.221 +        using mem_fine3[OF fine in_D] \<delta>_def \<open>b \<le> e\<close> \<open>t = b\<close> by auto
  20.222 +      from \<open>d < b\<close> \<open>d \<le> t\<close> \<open>t = b\<close> this
  20.223        show "fine \<delta>1 (d, b) [(d, t, b)]" using fine_single by auto
  20.224      qed
  20.225      note rsum1 = I1[OF this]
  20.226  
  20.227      have drop_split: "drop N D = [D ! N] @ drop (Suc N) D"
  20.228 -      using Cons_nth_drop_Suc[OF `N < length D`] by simp
  20.229 +      using Cons_nth_drop_Suc[OF \<open>N < length D\<close>] by simp
  20.230  
  20.231      have fine2: "fine \<delta>2 (e,c) (drop (Suc N) D)"
  20.232      proof (cases "drop (Suc N) D = []")
  20.233 @@ -453,7 +453,7 @@
  20.234        thus ?thesis
  20.235        proof (rule fine_\<delta>_expand)
  20.236          fix x assume "e \<le> x" and "x \<le> c"
  20.237 -        thus "\<delta> x \<le> \<delta>2 x" using `b \<le> e` unfolding \<delta>_def by auto
  20.238 +        thus "\<delta> x \<le> \<delta>2 x" using \<open>b \<le> e\<close> unfolding \<delta>_def by auto
  20.239        qed
  20.240      qed
  20.241  
  20.242 @@ -463,8 +463,8 @@
  20.243      next
  20.244        case False
  20.245        have "e - b < \<delta>2 b"
  20.246 -        using mem_fine3[OF fine in_D] \<delta>_def `d < b` `t = b` by auto
  20.247 -      with False `t = b` `b \<le> e`
  20.248 +        using mem_fine3[OF fine in_D] \<delta>_def \<open>d < b\<close> \<open>t = b\<close> by auto
  20.249 +      with False \<open>t = b\<close> \<open>b \<le> e\<close>
  20.250        show ?thesis using D2_def
  20.251          by (auto intro!: fine_append[OF _ fine2] fine_single
  20.252                 simp del: append_Cons)
  20.253 @@ -472,7 +472,7 @@
  20.254      note rsum2 = I2[OF this]
  20.255  
  20.256      have "rsum D f = rsum (take N D) f + rsum [D ! N] f + rsum (drop (Suc N) D) f"
  20.257 -      using rsum_append[symmetric] Cons_nth_drop_Suc[OF `N < length D`] by auto
  20.258 +      using rsum_append[symmetric] Cons_nth_drop_Suc[OF \<open>N < length D\<close>] by auto
  20.259      also have "\<dots> = rsum D1 f + rsum D2 f"
  20.260        by (cases "b = e", auto simp add: D1_def D2_def D_eq rsum_append algebra_simps)
  20.261      finally have "\<bar>rsum D f - (x1 + x2)\<bar> < \<epsilon>"
  20.262 @@ -483,22 +483,22 @@
  20.263      by blast
  20.264  next
  20.265    case False
  20.266 -  hence "a = b \<or> b = c" using `a \<le> b` and `b \<le> c` by auto
  20.267 +  hence "a = b \<or> b = c" using \<open>a \<le> b\<close> and \<open>b \<le> c\<close> by auto
  20.268    thus ?thesis
  20.269    proof (rule disjE)
  20.270      assume "a = b" hence "x1 = 0"
  20.271 -      using `Integral (a, b) f x1` by simp
  20.272 -    thus ?thesis using `a = b` `Integral (b, c) f x2` by simp
  20.273 +      using \<open>Integral (a, b) f x1\<close> by simp
  20.274 +    thus ?thesis using \<open>a = b\<close> \<open>Integral (b, c) f x2\<close> by simp
  20.275    next
  20.276      assume "b = c" hence "x2 = 0"
  20.277 -      using `Integral (b, c) f x2` by simp
  20.278 -    thus ?thesis using `b = c` `Integral (a, b) f x1` by simp
  20.279 +      using \<open>Integral (b, c) f x2\<close> by simp
  20.280 +    thus ?thesis using \<open>b = c\<close> \<open>Integral (a, b) f x1\<close> by simp
  20.281    qed
  20.282  qed
  20.283  
  20.284 -text{*Fundamental theorem of calculus (Part I)*}
  20.285 +text\<open>Fundamental theorem of calculus (Part I)\<close>
  20.286  
  20.287 -text{*"Straddle Lemma" : Swartz and Thompson: AMM 95(7) 1988 *}
  20.288 +text\<open>"Straddle Lemma" : Swartz and Thompson: AMM 95(7) 1988\<close>
  20.289  
  20.290  lemma strad1:
  20.291    fixes z x s e :: real
  20.292 @@ -515,7 +515,7 @@
  20.293      apply (simp add: mult.assoc divide_inverse)
  20.294      apply (simp add: ring_distribs)
  20.295      done
  20.296 -  moreover from False `\<bar>z - x\<bar> < s` have "\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2"
  20.297 +  moreover from False \<open>\<bar>z - x\<bar> < s\<close> have "\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2"
  20.298      by (rule P)
  20.299    ultimately have "\<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2)
  20.300      \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)"
  20.301 @@ -539,7 +539,7 @@
  20.302      with f' have "DERIV f x :> f'(x)" by simp
  20.303      then have "\<forall>r>0. \<exists>s>0. \<forall>z. z \<noteq> x \<and> \<bar>z - x\<bar> < s \<longrightarrow> \<bar>(f z - f x) / (z - x) - f' x\<bar> < r"
  20.304        by (simp add: DERIV_iff2 LIM_eq)
  20.305 -    with `0 < e` obtain s
  20.306 +    with \<open>0 < e\<close> obtain s
  20.307      where "\<And>z. z \<noteq> x \<Longrightarrow> \<bar>z - x\<bar> < s \<Longrightarrow> \<bar>(f z - f x) / (z - x) - f' x\<bar> < e/2" and "0 < s"
  20.308        by (drule_tac x="e/2" in spec, auto)
  20.309      with strad1 [of x s f f' e] have strad:
  20.310 @@ -558,9 +558,9 @@
  20.311        also have "\<dots> = \<bar>f v - f x - f' x * (v - x)\<bar> + \<bar>f u - f x - f' x * (u - x)\<bar>"
  20.312          by (simp add: right_diff_distrib)
  20.313        also have "\<dots> \<le> (e/2) * \<bar>v - x\<bar> + (e/2) * \<bar>u - x\<bar>"
  20.314 -        using `u \<le> x` `x \<le> v` `v - u < s` by (intro add_mono strad, simp_all)
  20.315 +        using \<open>u \<le> x\<close> \<open>x \<le> v\<close> \<open>v - u < s\<close> by (intro add_mono strad, simp_all)
  20.316        also have "\<dots> \<le> e * (v - u) / 2 + e * (v - u) / 2"
  20.317 -        using `u \<le> x` `x \<le> v` `0 < e` by (intro add_mono, simp_all)
  20.318 +        using \<open>u \<le> x\<close> \<open>x \<le> v\<close> \<open>0 < e\<close> by (intro add_mono, simp_all)
  20.319        also have "\<dots> = e * (v - u)"
  20.320          by simp
  20.321        finally show "\<bar>f v - f u - f' x * (v - u)\<bar> \<le> e * (v - u)" .
  20.322 @@ -577,11 +577,11 @@
  20.323  proof (cases "a = b")
  20.324    assume "a = b" thus ?thesis by simp
  20.325  next
  20.326 -  assume "a \<noteq> b" with `a \<le> b` have "a < b" by simp
  20.327 +  assume "a \<noteq> b" with \<open>a \<le> b\<close> have "a < b" by simp
  20.328    show ?thesis
  20.329    proof (simp add: Integral_def2, clarify)
  20.330      fix e :: real assume "0 < e"
  20.331 -    with `a < b` have "0 < e / (b - a)" by simp
  20.332 +    with \<open>a < b\<close> have "0 < e / (b - a)" by simp
  20.333  
  20.334      from lemma_straddle [OF f' this]
  20.335      obtain \<delta> where "gauge {a..b} \<delta>"
  20.336 @@ -608,11 +608,11 @@
  20.337        also have "\<dots> = e"
  20.338          using fine_listsum_eq_diff [OF D, where f="\<lambda>x. x"]
  20.339          unfolding split_def listsum_const_mult
  20.340 -        using `a < b` by simp
  20.341 +        using \<open>a < b\<close> by simp
  20.342        finally show "\<bar>rsum D f' - (f b - f a)\<bar> \<le> e" .
  20.343      qed
  20.344  
  20.345 -    with `gauge {a..b} \<delta>`
  20.346 +    with \<open>gauge {a..b} \<delta>\<close>
  20.347      show "\<exists>\<delta>. gauge {a..b} \<delta> \<and> (\<forall>D. fine \<delta> (a, b) D \<longrightarrow> \<bar>rsum D f' - (f b - f a)\<bar> \<le> e)"
  20.348        by auto
  20.349    qed
    21.1 --- a/src/HOL/ex/Groebner_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    21.2 +++ b/src/HOL/ex/Groebner_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    21.3 @@ -2,33 +2,33 @@
    21.4      Author:     Amine Chaieb, TU Muenchen
    21.5  *)
    21.6  
    21.7 -section {* Groebner Basis Examples *}
    21.8 +section \<open>Groebner Basis Examples\<close>
    21.9  
   21.10  theory Groebner_Examples
   21.11  imports "~~/src/HOL/Groebner_Basis"
   21.12  begin
   21.13  
   21.14 -subsection {* Basic examples *}
   21.15 +subsection \<open>Basic examples\<close>
   21.16  
   21.17  lemma
   21.18    fixes x :: int
   21.19    shows "x ^ 3 = x ^ 3"
   21.20 -  apply (tactic {* ALLGOALS (CONVERSION
   21.21 -    (Conv.arg_conv (Conv.arg1_conv (Semiring_Normalizer.semiring_normalize_conv @{context})))) *})
   21.22 +  apply (tactic \<open>ALLGOALS (CONVERSION
   21.23 +    (Conv.arg_conv (Conv.arg1_conv (Semiring_Normalizer.semiring_normalize_conv @{context}))))\<close>)
   21.24    by (rule refl)
   21.25  
   21.26  lemma
   21.27    fixes x :: int
   21.28    shows "(x - (-2))^5 = x ^ 5 + (10 * x ^ 4 + (40 * x ^ 3 + (80 * x\<^sup>2 + (80 * x + 32))))" 
   21.29 -  apply (tactic {* ALLGOALS (CONVERSION
   21.30 -    (Conv.arg_conv (Conv.arg1_conv (Semiring_Normalizer.semiring_normalize_conv @{context})))) *})
   21.31 +  apply (tactic \<open>ALLGOALS (CONVERSION
   21.32 +    (Conv.arg_conv (Conv.arg1_conv (Semiring_Normalizer.semiring_normalize_conv @{context}))))\<close>)
   21.33    by (rule refl)
   21.34  
   21.35  schematic_goal
   21.36    fixes x :: int
   21.37    shows "(x - (-2))^5  * (y - 78) ^ 8 = ?X" 
   21.38 -  apply (tactic {* ALLGOALS (CONVERSION
   21.39 -    (Conv.arg_conv (Conv.arg1_conv (Semiring_Normalizer.semiring_normalize_conv @{context})))) *})
   21.40 +  apply (tactic \<open>ALLGOALS (CONVERSION
   21.41 +    (Conv.arg_conv (Conv.arg1_conv (Semiring_Normalizer.semiring_normalize_conv @{context}))))\<close>)
   21.42    by (rule refl)
   21.43  
   21.44  lemma "((-3) ^ (Suc (Suc (Suc 0)))) == (X::'a::{comm_ring_1})"
   21.45 @@ -63,7 +63,7 @@
   21.46    shows "x\<^sup>2*y = x\<^sup>2 & x*y\<^sup>2 = y\<^sup>2 \<longleftrightarrow>  x = 1 & y = 1 | x = 0 & y = 0"
   21.47    by algebra
   21.48  
   21.49 -subsection {* Lemmas for Lagrange's theorem *}
   21.50 +subsection \<open>Lemmas for Lagrange's theorem\<close>
   21.51  
   21.52  definition
   21.53    sq :: "'a::times => 'a" where
   21.54 @@ -95,7 +95,7 @@
   21.55    by (algebra add: sq_def)
   21.56  
   21.57  
   21.58 -subsection {* Colinearity is invariant by rotation *}
   21.59 +subsection \<open>Colinearity is invariant by rotation\<close>
   21.60  
   21.61  type_synonym point = "int \<times> int"
   21.62  
    22.1 --- a/src/HOL/ex/Guess.thy	Tue Oct 06 17:46:07 2015 +0200
    22.2 +++ b/src/HOL/ex/Guess.thy	Tue Oct 06 17:47:28 2015 +0200
    22.3 @@ -2,7 +2,7 @@
    22.4      Author:     Makarius
    22.5  *)
    22.6  
    22.7 -section {* Proof by guessing *}
    22.8 +section \<open>Proof by guessing\<close>
    22.9  
   22.10  theory Guess
   22.11  imports Main
    23.1 --- a/src/HOL/ex/HarmonicSeries.thy	Tue Oct 06 17:46:07 2015 +0200
    23.2 +++ b/src/HOL/ex/HarmonicSeries.thy	Tue Oct 06 17:47:28 2015 +0200
    23.3 @@ -2,15 +2,15 @@
    23.4      Author:     Benjamin Porter, 2006
    23.5  *)
    23.6  
    23.7 -section {* Divergence of the Harmonic Series *}
    23.8 +section \<open>Divergence of the Harmonic Series\<close>
    23.9  
   23.10  theory HarmonicSeries
   23.11  imports Complex_Main
   23.12  begin
   23.13  
   23.14 -subsection {* Abstract *}
   23.15 +subsection \<open>Abstract\<close>
   23.16  
   23.17 -text {* The following document presents a proof of the Divergence of
   23.18 +text \<open>The following document presents a proof of the Divergence of
   23.19  Harmonic Series theorem formalised in the Isabelle/Isar theorem
   23.20  proving system.
   23.21  
   23.22 @@ -33,21 +33,21 @@
   23.23    $\sum_{n=1}^{2^N} \frac{1}{n} > s$. This leads to a contradiction
   23.24    and hence $\sum_{n=1}^{\infty} \frac{1}{n}$ is not summable.
   23.25    QED.
   23.26 -*}
   23.27 +\<close>
   23.28  
   23.29 -subsection {* Formal Proof *}
   23.30 +subsection \<open>Formal Proof\<close>
   23.31  
   23.32  lemma two_pow_sub:
   23.33    "0 < m \<Longrightarrow> (2::nat)^m - 2^(m - 1) = 2^(m - 1)"
   23.34    by (induct m) auto
   23.35  
   23.36 -text {* We first prove the following auxillary lemma. This lemma
   23.37 +text \<open>We first prove the following auxillary lemma. This lemma
   23.38  simply states that the finite sums: $\frac{1}{2}$, $\frac{1}{3} +
   23.39  \frac{1}{4}$, $\frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8}$
   23.40  etc. are all greater than or equal to $\frac{1}{2}$. We do this by
   23.41  observing that each term in the sum is greater than or equal to the
   23.42  last term, e.g. $\frac{1}{3} > \frac{1}{4}$ and thus $\frac{1}{3} +
   23.43 -\frac{1}{4} > \frac{1}{4} + \frac{1}{4} = \frac{1}{2}$. *}
   23.44 +\frac{1}{4} > \frac{1}{4} + \frac{1}{4} = \frac{1}{2}$.\<close>
   23.45  
   23.46  lemma harmonic_aux:
   23.47    "\<forall>m>0. (\<Sum>n\<in>{(2::nat)^(m - 1)+1..2^m}. 1/real n) \<ge> 1/2"
   23.48 @@ -122,12 +122,12 @@
   23.49    thus "0 < m \<longrightarrow> 1 / 2 \<le> (\<Sum>n\<in>(?S m). 1 / real n)" by simp
   23.50  qed
   23.51  
   23.52 -text {* We then show that the sum of a finite number of terms from the
   23.53 +text \<open>We then show that the sum of a finite number of terms from the
   23.54  harmonic series can be regrouped in increasing powers of 2. For
   23.55  example: $1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} +
   23.56  \frac{1}{6} + \frac{1}{7} + \frac{1}{8} = 1 + (\frac{1}{2}) +
   23.57  (\frac{1}{3} + \frac{1}{4}) + (\frac{1}{5} + \frac{1}{6} + \frac{1}{7}
   23.58 -+ \frac{1}{8})$. *}
   23.59 ++ \frac{1}{8})$.\<close>
   23.60  
   23.61  lemma harmonic_aux2 [rule_format]:
   23.62    "0<M \<Longrightarrow> (\<Sum>n\<in>{1..(2::nat)^M}. 1/real n) =
   23.63 @@ -219,10 +219,10 @@
   23.64    thus ?case by simp
   23.65  qed
   23.66  
   23.67 -text {* Using @{thm [source] harmonic_aux} and @{thm [source] harmonic_aux2} we now show
   23.68 +text \<open>Using @{thm [source] harmonic_aux} and @{thm [source] harmonic_aux2} we now show
   23.69  that each group sum is greater than or equal to $\frac{1}{2}$ and thus
   23.70  the finite sum is bounded below by a value proportional to the number
   23.71 -of elements we choose. *}
   23.72 +of elements we choose.\<close>
   23.73  
   23.74  lemma harmonic_aux3 [rule_format]:
   23.75    shows "\<forall>(M::nat). (\<Sum>n\<in>{1..(2::nat)^M}. 1 / real n) \<ge> 1 + (real M)/2"
   23.76 @@ -266,12 +266,12 @@
   23.77    ultimately show "(?P M) \<ge> (1 + (real M)/2)" by simp
   23.78  qed
   23.79  
   23.80 -text {* The final theorem shows that as we take more and more elements
   23.81 +text \<open>The final theorem shows that as we take more and more elements
   23.82  (see @{thm [source] harmonic_aux3}) we get an ever increasing sum. By assuming
   23.83  the sum converges, the lemma @{thm [source] setsum_less_suminf} ( @{thm
   23.84  setsum_less_suminf} ) states that each sum is bounded above by the
   23.85  series' limit. This contradicts our first statement and thus we prove
   23.86 -that the harmonic series is divergent. *}
   23.87 +that the harmonic series is divergent.\<close>
   23.88  
   23.89  theorem DivergenceOfHarmonicSeries:
   23.90    shows "\<not>summable (\<lambda>n. 1/real (Suc n))"
    24.1 --- a/src/HOL/ex/Hex_Bin_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    24.2 +++ b/src/HOL/ex/Hex_Bin_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    24.3 @@ -2,7 +2,7 @@
    24.4      Author:     Gerwin Klein, NICTA
    24.5  *)
    24.6  
    24.7 -section {* Examples for hexadecimal and binary numerals *}
    24.8 +section \<open>Examples for hexadecimal and binary numerals\<close>
    24.9  
   24.10  theory Hex_Bin_Examples imports Main 
   24.11  begin
   24.12 @@ -12,10 +12,10 @@
   24.13  lemma "0xFF = 255" by (rule refl)
   24.14  lemma "0xF = 0b1111" by (rule refl)
   24.15  
   24.16 -text {* 
   24.17 +text \<open>
   24.18    Just like decimal numeral they are polymorphic, for arithmetic 
   24.19    they need to be constrained
   24.20 -*}
   24.21 +\<close>
   24.22  lemma "0x0A + 0x10 = (0x1A :: nat)" by simp
   24.23  
   24.24  text "The number of leading zeros is irrelevant"
   24.25 @@ -24,17 +24,17 @@
   24.26  text "Unary minus works as for decimal numerals"
   24.27  lemma "- 0x0A = - 10" by (rule refl)
   24.28  
   24.29 -text {*
   24.30 +text \<open>
   24.31    Hex and bin numerals are printed as decimal: @{term "0b10"}
   24.32 -*}
   24.33 +\<close>
   24.34  term "0b10"
   24.35  term "0x0A"
   24.36  
   24.37 -text {* 
   24.38 +text \<open>
   24.39    The numerals 0 and 1 are syntactically different from the 
   24.40    constants 0 and 1. For the usual numeric types, their values 
   24.41    are the same, though.
   24.42 -*}
   24.43 +\<close>
   24.44  lemma "0x01 = 1" oops 
   24.45  lemma "0x00 = 0" oops 
   24.46  
    25.1 --- a/src/HOL/ex/Induction_Schema.thy	Tue Oct 06 17:46:07 2015 +0200
    25.2 +++ b/src/HOL/ex/Induction_Schema.thy	Tue Oct 06 17:47:28 2015 +0200
    25.3 @@ -2,13 +2,13 @@
    25.4      Author:     Alexander Krauss, TU Muenchen
    25.5  *)
    25.6  
    25.7 -section {* Examples of automatically derived induction rules *}
    25.8 +section \<open>Examples of automatically derived induction rules\<close>
    25.9  
   25.10  theory Induction_Schema
   25.11  imports Main
   25.12  begin
   25.13  
   25.14 -subsection {* Some simple induction principles on nat *}
   25.15 +subsection \<open>Some simple induction principles on nat\<close>
   25.16  
   25.17  lemma nat_standard_induct: (* cf. Nat.thy *)
   25.18    "\<lbrakk>P 0; \<And>n. P n \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P x"
    26.1 --- a/src/HOL/ex/Intuitionistic.thy	Tue Oct 06 17:46:07 2015 +0200
    26.2 +++ b/src/HOL/ex/Intuitionistic.thy	Tue Oct 06 17:47:28 2015 +0200
    26.3 @@ -5,7 +5,7 @@
    26.4  Taken from FOL/ex/int.ML
    26.5  *)
    26.6  
    26.7 -section {* Higher-Order Logic: Intuitionistic predicate calculus problems *}
    26.8 +section \<open>Higher-Order Logic: Intuitionistic predicate calculus problems\<close>
    26.9  
   26.10  theory Intuitionistic imports Main begin
   26.11  
    27.1 --- a/src/HOL/ex/Lagrange.thy	Tue Oct 06 17:46:07 2015 +0200
    27.2 +++ b/src/HOL/ex/Lagrange.thy	Tue Oct 06 17:47:28 2015 +0200
    27.3 @@ -3,24 +3,24 @@
    27.4      Copyright   1996 TU Muenchen
    27.5  *)
    27.6  
    27.7 -section {* A lemma for Lagrange's theorem *}
    27.8 +section \<open>A lemma for Lagrange's theorem\<close>
    27.9  
   27.10  theory Lagrange imports Main begin
   27.11  
   27.12 -text {* This theory only contains a single theorem, which is a lemma
   27.13 +text \<open>This theory only contains a single theorem, which is a lemma
   27.14  in Lagrange's proof that every natural number is the sum of 4 squares.
   27.15  Its sole purpose is to demonstrate ordered rewriting for commutative
   27.16  rings.
   27.17  
   27.18  The enterprising reader might consider proving all of Lagrange's
   27.19 -theorem.  *}
   27.20 +theorem.\<close>
   27.21  
   27.22  definition sq :: "'a::times => 'a" where "sq x == x*x"
   27.23  
   27.24 -text {* The following lemma essentially shows that every natural
   27.25 +text \<open>The following lemma essentially shows that every natural
   27.26  number is the sum of four squares, provided all prime numbers are.
   27.27  However, this is an abstract theorem about commutative rings.  It has,
   27.28 -a priori, nothing to do with nat. *}
   27.29 +a priori, nothing to do with nat.\<close>
   27.30  
   27.31  lemma Lagrange_lemma: fixes x1 :: "'a::comm_ring" shows
   27.32    "(sq x1 + sq x2 + sq x3 + sq x4) * (sq y1 + sq y2 + sq y3 + sq y4) =
   27.33 @@ -31,7 +31,7 @@
   27.34  by (simp only: sq_def algebra_simps)
   27.35  
   27.36  
   27.37 -text {* A challenge by John Harrison. Takes about 12s on a 1.6GHz machine. *}
   27.38 +text \<open>A challenge by John Harrison. Takes about 12s on a 1.6GHz machine.\<close>
   27.39  
   27.40  lemma fixes p1 :: "'a::comm_ring" shows
   27.41    "(sq p1 + sq q1 + sq r1 + sq s1 + sq t1 + sq u1 + sq v1 + sq w1) * 
    28.1 --- a/src/HOL/ex/List_to_Set_Comprehension_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    28.2 +++ b/src/HOL/ex/List_to_Set_Comprehension_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    28.3 @@ -3,18 +3,18 @@
    28.4      Copyright   2011 TU Muenchen
    28.5  *)
    28.6  
    28.7 -section {* Examples for the list comprehension to set comprehension simproc *}
    28.8 +section \<open>Examples for the list comprehension to set comprehension simproc\<close>
    28.9  
   28.10  theory List_to_Set_Comprehension_Examples
   28.11  imports Main
   28.12  begin
   28.13  
   28.14 -text {*
   28.15 +text \<open>
   28.16  Examples that show and test the simproc that rewrites list comprehensions
   28.17  applied to List.set to set comprehensions.
   28.18 -*}
   28.19 +\<close>
   28.20  
   28.21 -subsection {* Some own examples for set (case ..) simpproc *}
   28.22 +subsection \<open>Some own examples for set (case ..) simpproc\<close>
   28.23  
   28.24  lemma "set [(x, xs). x # xs <- as] = {(x, xs). x # xs \<in> set as}"
   28.25  by auto
   28.26 @@ -31,7 +31,7 @@
   28.27  lemma "set [(x, y). x # y <- zs, x = x'] = {(x, y). x # y \<in> set zs & x = x'}"
   28.28  by auto
   28.29  
   28.30 -subsection {* Existing examples from the List theory *}
   28.31 +subsection \<open>Existing examples from the List theory\<close>
   28.32  
   28.33  lemma "set [(x,y,z). b] = {(x', y', z'). x = x' & y = y' & z = z' & b}"
   28.34  by auto
    29.1 --- a/src/HOL/ex/LocaleTest2.thy	Tue Oct 06 17:46:07 2015 +0200
    29.2 +++ b/src/HOL/ex/LocaleTest2.thy	Tue Oct 06 17:47:28 2015 +0200
    29.3 @@ -8,23 +8,23 @@
    29.4  which is FOL/ex/LocaleTest.thy
    29.5  *)
    29.6  
    29.7 -section {* Test of Locale Interpretation *}
    29.8 +section \<open>Test of Locale Interpretation\<close>
    29.9  
   29.10  theory LocaleTest2
   29.11  imports Main GCD
   29.12  begin
   29.13  
   29.14 -section {* Interpretation of Defined Concepts *}
   29.15 +section \<open>Interpretation of Defined Concepts\<close>
   29.16  
   29.17 -text {* Naming convention for global objects: prefixes D and d *}
   29.18 +text \<open>Naming convention for global objects: prefixes D and d\<close>
   29.19  
   29.20  
   29.21 -subsection {* Lattices *}
   29.22 +subsection \<open>Lattices\<close>
   29.23  
   29.24 -text {* Much of the lattice proofs are from HOL/Lattice. *}
   29.25 +text \<open>Much of the lattice proofs are from HOL/Lattice.\<close>
   29.26  
   29.27  
   29.28 -subsubsection {* Definitions *}
   29.29 +subsubsection \<open>Definitions\<close>
   29.30  
   29.31  locale dpo =
   29.32    fixes le :: "['a, 'a] => bool" (infixl "\<sqsubseteq>" 50)
   29.33 @@ -116,7 +116,7 @@
   29.34  proof (unfold meet_def)
   29.35    assume "is_inf x y i"
   29.36    then show "(THE i. is_inf x y i) = i"
   29.37 -    by (rule the_equality) (rule is_inf_uniq [OF _ `is_inf x y i`])
   29.38 +    by (rule the_equality) (rule is_inf_uniq [OF _ \<open>is_inf x y i\<close>])
   29.39  qed
   29.40  
   29.41  lemma meetI [intro?]:
   29.42 @@ -127,7 +127,7 @@
   29.43  proof (unfold meet_def)
   29.44    from ex_inf obtain i where "is_inf x y i" ..
   29.45    then show "is_inf x y (THE i. is_inf x y i)"
   29.46 -    by (rule theI) (rule is_inf_uniq [OF _ `is_inf x y i`])
   29.47 +    by (rule theI) (rule is_inf_uniq [OF _ \<open>is_inf x y i\<close>])
   29.48  qed
   29.49  
   29.50  lemma meet_left [intro?]:
   29.51 @@ -189,7 +189,7 @@
   29.52  proof (unfold join_def)
   29.53    assume "is_sup x y s"
   29.54    then show "(THE s. is_sup x y s) = s"
   29.55 -    by (rule the_equality) (rule is_sup_uniq [OF _ `is_sup x y s`])
   29.56 +    by (rule the_equality) (rule is_sup_uniq [OF _ \<open>is_sup x y s\<close>])
   29.57  qed
   29.58  
   29.59  lemma joinI [intro?]: "x \<sqsubseteq> s \<Longrightarrow> y \<sqsubseteq> s \<Longrightarrow>
   29.60 @@ -200,7 +200,7 @@
   29.61  proof (unfold join_def)
   29.62    from ex_sup obtain s where "is_sup x y s" ..
   29.63    then show "is_sup x y (THE s. is_sup x y s)"
   29.64 -    by (rule theI) (rule is_sup_uniq [OF _ `is_sup x y s`])
   29.65 +    by (rule theI) (rule is_sup_uniq [OF _ \<open>is_sup x y s\<close>])
   29.66  qed
   29.67  
   29.68  lemma join_left [intro?]:
   29.69 @@ -359,7 +359,7 @@
   29.70    by (drule join_related) (simp add: join_commute)
   29.71  
   29.72  
   29.73 -text {* Additional theorems *}
   29.74 +text \<open>Additional theorems\<close>
   29.75  
   29.76  theorem meet_connection: "(x \<sqsubseteq> y) = (x \<sqinter> y = x)"
   29.77  proof
   29.78 @@ -390,7 +390,7 @@
   29.79    using join_commute join_connection by simp
   29.80  
   29.81  
   29.82 -text {* Naming according to Jacobson I, p.\ 459. *}
   29.83 +text \<open>Naming according to Jacobson I, p.\ 459.\<close>
   29.84  
   29.85  lemmas L1 = join_commute meet_commute
   29.86  lemmas L2 = join_assoc meet_assoc
   29.87 @@ -408,7 +408,7 @@
   29.88  
   29.89  lemma join_distr:
   29.90    "x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)"
   29.91 -  txt {* Jacobson I, p.\ 462 *}
   29.92 +  txt \<open>Jacobson I, p.\ 462\<close>
   29.93  proof -
   29.94    have "x \<squnion> (y \<sqinter> z) = (x \<squnion> (x \<sqinter> z)) \<squnion> (y \<sqinter> z)" by (simp add: L4)
   29.95    also have "... = x \<squnion> ((x \<sqinter> z) \<squnion> (y \<sqinter> z))" by (simp add: L2)
   29.96 @@ -447,7 +447,7 @@
   29.97  proof
   29.98    fix x y z
   29.99    show "x \<sqinter> (y \<squnion> z) = x \<sqinter> y \<squnion> x \<sqinter> z" (is "?l = ?r")
  29.100 -    txt {* Jacobson I, p.\ 462 *}
  29.101 +    txt \<open>Jacobson I, p.\ 462\<close>
  29.102    proof -
  29.103      { assume c: "y \<sqsubseteq> x" "z \<sqsubseteq> x"
  29.104        from c have "?l = y \<squnion> z"
  29.105 @@ -466,16 +466,16 @@
  29.106    qed
  29.107  qed
  29.108  
  29.109 -subsubsection {* Total order @{text "<="} on @{typ int} *}
  29.110 +subsubsection \<open>Total order @{text "<="} on @{typ int}\<close>
  29.111  
  29.112  interpretation int: dpo "op <= :: [int, int] => bool"
  29.113    where "(dpo.less (op <=) (x::int) y) = (x < y)"
  29.114 -  txt {* We give interpretation for less, but not @{text is_inf} and @{text is_sub}. *}
  29.115 +  txt \<open>We give interpretation for less, but not @{text is_inf} and @{text is_sub}.\<close>
  29.116  proof -
  29.117    show "dpo (op <= :: [int, int] => bool)"
  29.118      proof qed auto
  29.119    then interpret int: dpo "op <= :: [int, int] => bool" .
  29.120 -    txt {* Gives interpreted version of @{text less_def} (without condition). *}
  29.121 +    txt \<open>Gives interpreted version of @{text less_def} (without condition).\<close>
  29.122    show "(dpo.less (op <=) (x::int) y) = (x < y)"
  29.123      by (unfold int.less_def) auto
  29.124  qed
  29.125 @@ -497,8 +497,8 @@
  29.126      apply arith+
  29.127      done
  29.128    then interpret int: dlat "op <= :: [int, int] => bool" .
  29.129 -  txt {* Interpretation to ease use of definitions, which are
  29.130 -    conditional in general but unconditional after interpretation. *}
  29.131 +  txt \<open>Interpretation to ease use of definitions, which are
  29.132 +    conditional in general but unconditional after interpretation.\<close>
  29.133    show "dlat.meet (op <=) (x::int) y = min x y"
  29.134      apply (unfold int.meet_def)
  29.135      apply (rule the_equality)
  29.136 @@ -514,24 +514,24 @@
  29.137  interpretation int: dlo "op <= :: [int, int] => bool"
  29.138    proof qed arith
  29.139  
  29.140 -text {* Interpreted theorems from the locales, involving defined terms. *}
  29.141 +text \<open>Interpreted theorems from the locales, involving defined terms.\<close>
  29.142  
  29.143 -thm int.less_def text {* from dpo *}
  29.144 -thm int.meet_left text {* from dlat *}
  29.145 -thm int.meet_distr text {* from ddlat *}
  29.146 -thm int.less_total text {* from dlo *}
  29.147 +thm int.less_def text \<open>from dpo\<close>
  29.148 +thm int.meet_left text \<open>from dlat\<close>
  29.149 +thm int.meet_distr text \<open>from ddlat\<close>
  29.150 +thm int.less_total text \<open>from dlo\<close>
  29.151  
  29.152  
  29.153 -subsubsection {* Total order @{text "<="} on @{typ nat} *}
  29.154 +subsubsection \<open>Total order @{text "<="} on @{typ nat}\<close>
  29.155  
  29.156  interpretation nat: dpo "op <= :: [nat, nat] => bool"
  29.157    where "dpo.less (op <=) (x::nat) y = (x < y)"
  29.158 -  txt {* We give interpretation for less, but not @{text is_inf} and @{text is_sub}. *}
  29.159 +  txt \<open>We give interpretation for less, but not @{text is_inf} and @{text is_sub}.\<close>
  29.160  proof -
  29.161    show "dpo (op <= :: [nat, nat] => bool)"
  29.162      proof qed auto
  29.163    then interpret nat: dpo "op <= :: [nat, nat] => bool" .
  29.164 -    txt {* Gives interpreted version of @{text less_def} (without condition). *}
  29.165 +    txt \<open>Gives interpreted version of @{text less_def} (without condition).\<close>
  29.166    show "dpo.less (op <=) (x::nat) y = (x < y)"
  29.167      apply (unfold nat.less_def)
  29.168      apply auto
  29.169 @@ -548,8 +548,8 @@
  29.170      apply arith+
  29.171      done
  29.172    then interpret nat: dlat "op <= :: [nat, nat] => bool" .
  29.173 -  txt {* Interpretation to ease use of definitions, which are
  29.174 -    conditional in general but unconditional after interpretation. *}
  29.175 +  txt \<open>Interpretation to ease use of definitions, which are
  29.176 +    conditional in general but unconditional after interpretation.\<close>
  29.177    show "dlat.meet (op <=) (x::nat) y = min x y"
  29.178      apply (unfold nat.meet_def)
  29.179      apply (rule the_equality)
  29.180 @@ -565,24 +565,24 @@
  29.181  interpretation nat: dlo "op <= :: [nat, nat] => bool"
  29.182    proof qed arith
  29.183  
  29.184 -text {* Interpreted theorems from the locales, involving defined terms. *}
  29.185 +text \<open>Interpreted theorems from the locales, involving defined terms.\<close>
  29.186  
  29.187 -thm nat.less_def text {* from dpo *}
  29.188 -thm nat.meet_left text {* from dlat *}
  29.189 -thm nat.meet_distr text {* from ddlat *}
  29.190 -thm nat.less_total text {* from ldo *}
  29.191 +thm nat.less_def text \<open>from dpo\<close>
  29.192 +thm nat.meet_left text \<open>from dlat\<close>
  29.193 +thm nat.meet_distr text \<open>from ddlat\<close>
  29.194 +thm nat.less_total text \<open>from ldo\<close>
  29.195  
  29.196  
  29.197 -subsubsection {* Lattice @{text "dvd"} on @{typ nat} *}
  29.198 +subsubsection \<open>Lattice @{text "dvd"} on @{typ nat}\<close>
  29.199  
  29.200  interpretation nat_dvd: dpo "op dvd :: [nat, nat] => bool"
  29.201    where "dpo.less (op dvd) (x::nat) y = (x dvd y & x ~= y)"
  29.202 -  txt {* We give interpretation for less, but not @{text is_inf} and @{text is_sub}. *}
  29.203 +  txt \<open>We give interpretation for less, but not @{text is_inf} and @{text is_sub}.\<close>
  29.204  proof -
  29.205    show "dpo (op dvd :: [nat, nat] => bool)"
  29.206      proof qed (auto simp: dvd_def)
  29.207    then interpret nat_dvd: dpo "op dvd :: [nat, nat] => bool" .
  29.208 -    txt {* Gives interpreted version of @{text less_def} (without condition). *}
  29.209 +    txt \<open>Gives interpreted version of @{text less_def} (without condition).\<close>
  29.210    show "dpo.less (op dvd) (x::nat) y = (x dvd y & x ~= y)"
  29.211      apply (unfold nat_dvd.less_def)
  29.212      apply auto
  29.213 @@ -602,8 +602,8 @@
  29.214      apply (auto intro: lcm_dvd1_nat lcm_dvd2_nat lcm_least_nat)
  29.215      done
  29.216    then interpret nat_dvd: dlat "op dvd :: [nat, nat] => bool" .
  29.217 -  txt {* Interpretation to ease use of definitions, which are
  29.218 -    conditional in general but unconditional after interpretation. *}
  29.219 +  txt \<open>Interpretation to ease use of definitions, which are
  29.220 +    conditional in general but unconditional after interpretation.\<close>
  29.221    show "dlat.meet (op dvd) (x::nat) y = gcd x y"
  29.222      apply (unfold nat_dvd.meet_def)
  29.223      apply (rule the_equality)
  29.224 @@ -616,19 +616,19 @@
  29.225      by (auto intro: lcm_dvd1_nat lcm_dvd2_nat lcm_least_nat)
  29.226  qed
  29.227  
  29.228 -text {* Interpreted theorems from the locales, involving defined terms. *}
  29.229 +text \<open>Interpreted theorems from the locales, involving defined terms.\<close>
  29.230  
  29.231 -thm nat_dvd.less_def text {* from dpo *}
  29.232 +thm nat_dvd.less_def text \<open>from dpo\<close>
  29.233  lemma "((x::nat) dvd y & x ~= y) = (x dvd y & x ~= y)"
  29.234    apply (rule nat_dvd.less_def) done
  29.235 -thm nat_dvd.meet_left text {* from dlat *}
  29.236 +thm nat_dvd.meet_left text \<open>from dlat\<close>
  29.237  lemma "gcd x y dvd (x::nat)"
  29.238    apply (rule nat_dvd.meet_left) done
  29.239  
  29.240  
  29.241 -subsection {* Group example with defined operations @{text inv} and @{text unit} *}
  29.242 +subsection \<open>Group example with defined operations @{text inv} and @{text unit}\<close>
  29.243  
  29.244 -subsubsection {* Locale declarations and lemmas *}
  29.245 +subsubsection \<open>Locale declarations and lemmas\<close>
  29.246  
  29.247  locale Dsemi =
  29.248    fixes prod (infixl "**" 65)
  29.249 @@ -832,7 +832,7 @@
  29.250  end
  29.251  
  29.252  
  29.253 -subsubsection {* Interpretation of Functions *}
  29.254 +subsubsection \<open>Interpretation of Functions\<close>
  29.255  
  29.256  interpretation Dfun: Dmonoid "op o" "id :: 'a => 'a"
  29.257    where "Dmonoid.unit (op o) id f = bij (f::'a => 'a)"
    30.1 --- a/src/HOL/ex/MT.thy	Tue Oct 06 17:46:07 2015 +0200
    30.2 +++ b/src/HOL/ex/MT.thy	Tue Oct 06 17:47:28 2015 +0200
    30.3 @@ -12,7 +12,7 @@
    30.4      Report 308, Computer Lab, University of Cambridge (1993).
    30.5  *)
    30.6  
    30.7 -section {* Milner-Tofte: Co-induction in Relational Semantics *}
    30.8 +section \<open>Milner-Tofte: Co-induction in Relational Semantics\<close>
    30.9  
   30.10  theory MT
   30.11  imports Main
   30.12 @@ -275,9 +275,9 @@
   30.13  (* Inference systems                                            *)
   30.14  (* ############################################################ *)
   30.15  
   30.16 -ML {*
   30.17 +ML \<open>
   30.18  fun infsys_mono_tac ctxt = REPEAT (ares_tac ctxt (@{thms basic_monos} @ [allI, impI]) 1)
   30.19 -*}
   30.20 +\<close>
   30.21  
   30.22  lemma infsys_p1: "P a b ==> P (fst (a,b)) (snd (a,b))"
   30.23    by simp
   30.24 @@ -874,7 +874,7 @@
   30.25           ve + {ev |-> v} hastyenv te + {ev |=> t}"
   30.26  apply (unfold hasty_env_def)
   30.27  apply (simp del: mem_simps add: ve_dom_owr te_dom_owr)
   30.28 -apply (tactic {* safe_tac (put_claset HOL_cs @{context}) *})
   30.29 +apply (tactic \<open>safe_tac (put_claset HOL_cs @{context})\<close>)
   30.30  apply (case_tac "ev=x")
   30.31  apply (simp (no_asm_simp) add: ve_app_owr1 te_app_owr1)
   30.32  apply (simp add: ve_app_owr2 te_app_owr2)
   30.33 @@ -911,7 +911,7 @@
   30.34      v_clos(cl) hasty t"
   30.35  apply (unfold hasty_env_def hasty_def)
   30.36  apply (drule elab_fix_elim)
   30.37 -apply (tactic {* safe_tac (put_claset HOL_cs @{context}) *})
   30.38 +apply (tactic \<open>safe_tac (put_claset HOL_cs @{context})\<close>)
   30.39  (*Do a single unfolding of cl*)
   30.40  apply (frule ssubst) prefer 2 apply assumption
   30.41  apply (rule hasty_rel_clos_coind)
   30.42 @@ -919,7 +919,7 @@
   30.43  apply (simp (no_asm_simp) add: ve_dom_owr te_dom_owr)
   30.44  
   30.45  apply (simp (no_asm_simp) del: mem_simps add: ve_dom_owr)
   30.46 -apply (tactic {* safe_tac (put_claset HOL_cs @{context}) *})
   30.47 +apply (tactic \<open>safe_tac (put_claset HOL_cs @{context})\<close>)
   30.48  apply (case_tac "ev2=ev1a")
   30.49  apply (simp (no_asm_simp) del: mem_simps add: ve_app_owr1 te_app_owr1)
   30.50  apply blast
    31.1 --- a/src/HOL/ex/MergeSort.thy	Tue Oct 06 17:46:07 2015 +0200
    31.2 +++ b/src/HOL/ex/MergeSort.thy	Tue Oct 06 17:47:28 2015 +0200
    31.3 @@ -3,7 +3,7 @@
    31.4      Copyright   2002 TU Muenchen
    31.5  *)
    31.6  
    31.7 -section{*Merge Sort*}
    31.8 +section\<open>Merge Sort\<close>
    31.9  
   31.10  theory MergeSort
   31.11  imports "~~/src/HOL/Library/Multiset"
    32.1 --- a/src/HOL/ex/Meson_Test.thy	Tue Oct 06 17:46:07 2015 +0200
    32.2 +++ b/src/HOL/ex/Meson_Test.thy	Tue Oct 06 17:47:28 2015 +0200
    32.3 @@ -1,36 +1,36 @@
    32.4  
    32.5 -section {* Meson test cases *}
    32.6 +section \<open>Meson test cases\<close>
    32.7  
    32.8  theory Meson_Test
    32.9  imports Main
   32.10  begin
   32.11  
   32.12 -text {*
   32.13 +text \<open>
   32.14    WARNING: there are many potential conflicts between variables used
   32.15    below and constants declared in HOL!
   32.16 -*}
   32.17 +\<close>
   32.18  
   32.19  hide_const (open) implies union inter subset quotient
   32.20  
   32.21 -text {*
   32.22 +text \<open>
   32.23    Test data for the MESON proof procedure
   32.24    (Excludes the equality problems 51, 52, 56, 58)
   32.25 -*}
   32.26 +\<close>
   32.27  
   32.28  
   32.29 -subsection {* Interactive examples *}
   32.30 +subsection \<open>Interactive examples\<close>
   32.31  
   32.32  lemma problem_25:
   32.33    "(\<exists>x. P x) & (\<forall>x. L x --> ~ (M x & R x)) & (\<forall>x. P x --> (M x & L x)) & ((\<forall>x. P x --> Q x) | (\<exists>x. P x & R x)) --> (\<exists>x. Q x & P x)"
   32.34    apply (rule ccontr)
   32.35 -  ML_prf {*
   32.36 +  ML_prf \<open>
   32.37      val ctxt = @{context};
   32.38      val prem25 = Thm.assume @{cprop "\<not> ?thesis"};
   32.39      val nnf25 = Meson.make_nnf ctxt prem25;
   32.40      val xsko25 = Meson.skolemize ctxt nnf25;
   32.41 -  *}
   32.42 -  apply (tactic {* cut_tac xsko25 1 THEN REPEAT (eresolve_tac @{context} [exE] 1) *})
   32.43 -  ML_val {*
   32.44 +\<close>
   32.45 +  apply (tactic \<open>cut_tac xsko25 1 THEN REPEAT (eresolve_tac @{context} [exE] 1)\<close>)
   32.46 +  ML_val \<open>
   32.47      val ctxt = @{context};
   32.48      val [_, sko25] = #prems (#1 (Subgoal.focus ctxt 1 NONE (#goal @{Isar.goal})));
   32.49      val clauses25 = Meson.make_clauses ctxt [sko25];   (*7 clauses*)
   32.50 @@ -41,20 +41,20 @@
   32.51      Goal.prove ctxt' [] [] @{prop False} (fn _ =>
   32.52        resolve_tac ctxt' [go25] 1 THEN
   32.53        Meson.depth_prolog_tac ctxt' horns25);
   32.54 -  *}
   32.55 +\<close>
   32.56    oops
   32.57  
   32.58  lemma problem_26:
   32.59    "((\<exists>x. p x) = (\<exists>x. q x)) & (\<forall>x. \<forall>y. p x & q y --> (r x = s y)) --> ((\<forall>x. p x --> r x) = (\<forall>x. q x --> s x))"
   32.60    apply (rule ccontr)
   32.61 -  ML_prf {*
   32.62 +  ML_prf \<open>
   32.63      val ctxt = @{context};
   32.64      val prem26 = Thm.assume @{cprop "\<not> ?thesis"}
   32.65      val nnf26 = Meson.make_nnf ctxt prem26;
   32.66      val xsko26 = Meson.skolemize ctxt nnf26;
   32.67 -  *}
   32.68 -  apply (tactic {* cut_tac xsko26 1 THEN REPEAT (eresolve_tac @{context} [exE] 1) *})
   32.69 -  ML_val {*
   32.70 +\<close>
   32.71 +  apply (tactic \<open>cut_tac xsko26 1 THEN REPEAT (eresolve_tac @{context} [exE] 1)\<close>)
   32.72 +  ML_val \<open>
   32.73      val ctxt = @{context};
   32.74      val [_, sko26] = #prems (#1 (Subgoal.focus ctxt 1 NONE (#goal @{Isar.goal})));
   32.75      val clauses26 = Meson.make_clauses ctxt [sko26];
   32.76 @@ -68,20 +68,20 @@
   32.77        resolve_tac ctxt' [go26] 1 THEN
   32.78        Meson.depth_prolog_tac ctxt' horns26);  (*7 ms*)
   32.79      (*Proof is of length 107!!*)
   32.80 -  *}
   32.81 +\<close>
   32.82    oops
   32.83  
   32.84  lemma problem_43:  -- "NOW PROVED AUTOMATICALLY!!"  (*16 Horn clauses*)
   32.85    "(\<forall>x. \<forall>y. q x y = (\<forall>z. p z x = (p z y::bool))) --> (\<forall>x. (\<forall>y. q x y = (q y x::bool)))"
   32.86    apply (rule ccontr)
   32.87 -  ML_prf {*
   32.88 +  ML_prf \<open>
   32.89      val ctxt = @{context};
   32.90      val prem43 = Thm.assume @{cprop "\<not> ?thesis"};
   32.91      val nnf43 = Meson.make_nnf ctxt prem43;
   32.92      val xsko43 = Meson.skolemize ctxt nnf43;
   32.93 -  *}
   32.94 -  apply (tactic {* cut_tac xsko43 1 THEN REPEAT (eresolve_tac @{context} [exE] 1) *})
   32.95 -  ML_val {*
   32.96 +\<close>
   32.97 +  apply (tactic \<open>cut_tac xsko43 1 THEN REPEAT (eresolve_tac @{context} [exE] 1)\<close>)
   32.98 +  ML_val \<open>
   32.99      val ctxt = @{context};
  32.100      val [_, sko43] = #prems (#1 (Subgoal.focus ctxt 1 NONE (#goal @{Isar.goal})));
  32.101      val clauses43 = Meson.make_clauses ctxt [sko43];
  32.102 @@ -94,7 +94,7 @@
  32.103      Goal.prove ctxt' [] [] @{prop False} (fn _ =>
  32.104        resolve_tac ctxt' [go43] 1 THEN
  32.105        Meson.best_prolog_tac ctxt' Meson.size_of_subgoals horns43);   (*7ms*)
  32.106 -    *}
  32.107 +\<close>
  32.108    oops
  32.109  
  32.110  (*
  32.111 @@ -133,10 +133,10 @@
  32.112  *)
  32.113  
  32.114  
  32.115 -text {*
  32.116 +text \<open>
  32.117    MORE and MUCH HARDER test data for the MESON proof procedure
  32.118    (courtesy John Harrison).
  32.119 -*}
  32.120 +\<close>
  32.121  
  32.122  (* ========================================================================= *)
  32.123  (* 100 problems selected from the TPTP library                               *)
    33.1 --- a/src/HOL/ex/MonoidGroup.thy	Tue Oct 06 17:46:07 2015 +0200
    33.2 +++ b/src/HOL/ex/MonoidGroup.thy	Tue Oct 06 17:47:28 2015 +0200
    33.3 @@ -2,7 +2,7 @@
    33.4      Author:     Markus Wenzel
    33.5  *)
    33.6  
    33.7 -section {* Monoids and Groups as predicates over record schemes *}
    33.8 +section \<open>Monoids and Groups as predicates over record schemes\<close>
    33.9  
   33.10  theory MonoidGroup imports Main begin
   33.11  
    34.1 --- a/src/HOL/ex/NatSum.thy	Tue Oct 06 17:46:07 2015 +0200
    34.2 +++ b/src/HOL/ex/NatSum.thy	Tue Oct 06 17:47:28 2015 +0200
    34.3 @@ -2,51 +2,51 @@
    34.4      Author: Tobias Nipkow
    34.5  *)
    34.6  
    34.7 -section {* Summing natural numbers *}
    34.8 +section \<open>Summing natural numbers\<close>
    34.9  
   34.10  theory NatSum imports Main begin
   34.11  
   34.12 -text {*
   34.13 +text \<open>
   34.14    Summing natural numbers, squares, cubes, etc.
   34.15  
   34.16    Thanks to Sloane's On-Line Encyclopedia of Integer Sequences,
   34.17    @{url "http://www.research.att.com/~njas/sequences/"}.
   34.18 -*}
   34.19 +\<close>
   34.20  
   34.21  lemmas [simp] =
   34.22    ring_distribs
   34.23 -  diff_mult_distrib diff_mult_distrib2 --{*for type nat*}
   34.24 +  diff_mult_distrib diff_mult_distrib2 --\<open>for type nat\<close>
   34.25  
   34.26 -text {*
   34.27 +text \<open>
   34.28    \medskip The sum of the first @{text n} odd numbers equals @{text n}
   34.29    squared.
   34.30 -*}
   34.31 +\<close>
   34.32  
   34.33  lemma sum_of_odds: "(\<Sum>i=0..<n. Suc (i + i)) = n * n"
   34.34    by (induct n) auto
   34.35  
   34.36  
   34.37 -text {*
   34.38 +text \<open>
   34.39    \medskip The sum of the first @{text n} odd squares.
   34.40 -*}
   34.41 +\<close>
   34.42  
   34.43  lemma sum_of_odd_squares:
   34.44    "3 * (\<Sum>i=0..<n. Suc(2*i) * Suc(2*i)) = n * (4 * n * n - 1)"
   34.45    by (induct n) auto
   34.46  
   34.47  
   34.48 -text {*
   34.49 +text \<open>
   34.50    \medskip The sum of the first @{text n} odd cubes
   34.51 -*}
   34.52 +\<close>
   34.53  
   34.54  lemma sum_of_odd_cubes:
   34.55    "(\<Sum>i=0..<n. Suc (2*i) * Suc (2*i) * Suc (2*i)) =
   34.56      n * n * (2 * n * n - 1)"
   34.57    by (induct n) auto
   34.58  
   34.59 -text {*
   34.60 +text \<open>
   34.61    \medskip The sum of the first @{text n} positive integers equals
   34.62 -  @{text "n (n + 1) / 2"}.*}
   34.63 +  @{text "n (n + 1) / 2"}.\<close>
   34.64  
   34.65  lemma sum_of_naturals:
   34.66      "2 * (\<Sum>i=0..n. i) = n * Suc n"
   34.67 @@ -60,7 +60,7 @@
   34.68      "4 * (\<Sum>i=0..n. i * i * i) = n * n * Suc n * Suc n"
   34.69    by (induct n) auto
   34.70  
   34.71 -text{* \medskip A cute identity: *}
   34.72 +text\<open>\medskip A cute identity:\<close>
   34.73  
   34.74  lemma sum_squared: "(\<Sum>i=0..n. i)^2 = (\<Sum>i=0..n::nat. i^3)"
   34.75  proof(induct n)
   34.76 @@ -77,22 +77,22 @@
   34.77    finally show ?case .
   34.78  qed
   34.79  
   34.80 -text {*
   34.81 +text \<open>
   34.82    \medskip Sum of fourth powers: three versions.
   34.83 -*}
   34.84 +\<close>
   34.85  
   34.86  lemma sum_of_fourth_powers:
   34.87    "30 * (\<Sum>i=0..n. i * i * i * i) =
   34.88      n * Suc n * Suc (2 * n) * (3 * n * n + 3 * n - 1)"
   34.89    apply (induct n)
   34.90     apply simp_all
   34.91 -  apply (case_tac n)  -- {* eliminates the subtraction *} 
   34.92 +  apply (case_tac n)  -- \<open>eliminates the subtraction\<close> 
   34.93     apply (simp_all (no_asm_simp))
   34.94    done
   34.95  
   34.96 -text {*
   34.97 +text \<open>
   34.98    Two alternative proofs, with a change of variables and much more
   34.99 -  subtraction, performed using the integers. *}
  34.100 +  subtraction, performed using the integers.\<close>
  34.101  
  34.102  lemma int_sum_of_fourth_powers:
  34.103    "30 * int (\<Sum>i=0..<m. i * i * i * i) =
  34.104 @@ -107,10 +107,10 @@
  34.105    by (induct m) (simp_all add: of_nat_mult)
  34.106  
  34.107  
  34.108 -text {*
  34.109 +text \<open>
  34.110    \medskip Sums of geometric series: @{text 2}, @{text 3} and the
  34.111    general case.
  34.112 -*}
  34.113 +\<close>
  34.114  
  34.115  lemma sum_of_2_powers: "(\<Sum>i=0..<n. 2^i) = 2^n - (1::nat)"
  34.116    by (induct n) (auto split: nat_diff_split)
    35.1 --- a/src/HOL/ex/Normalization_by_Evaluation.thy	Tue Oct 06 17:46:07 2015 +0200
    35.2 +++ b/src/HOL/ex/Normalization_by_Evaluation.thy	Tue Oct 06 17:47:28 2015 +0200
    35.3 @@ -1,6 +1,6 @@
    35.4  (*  Authors:  Klaus Aehlig, Tobias Nipkow *)
    35.5  
    35.6 -section {* Testing implementation of normalization by evaluation *}
    35.7 +section \<open>Testing implementation of normalization by evaluation\<close>
    35.8  
    35.9  theory Normalization_by_Evaluation
   35.10  imports Complex_Main
    36.1 --- a/src/HOL/ex/Parallel_Example.thy	Tue Oct 06 17:46:07 2015 +0200
    36.2 +++ b/src/HOL/ex/Parallel_Example.thy	Tue Oct 06 17:47:28 2015 +0200
    36.3 @@ -1,23 +1,23 @@
    36.4 -section {* A simple example demonstrating parallelism for code generated towards Isabelle/ML *}
    36.5 +section \<open>A simple example demonstrating parallelism for code generated towards Isabelle/ML\<close>
    36.6  
    36.7  theory Parallel_Example
    36.8  imports Complex_Main "~~/src/HOL/Library/Parallel" "~~/src/HOL/Library/Debug"
    36.9  begin
   36.10  
   36.11 -subsection {* Compute-intensive examples. *}
   36.12 +subsection \<open>Compute-intensive examples.\<close>
   36.13  
   36.14 -subsubsection {* Fragments of the harmonic series *}
   36.15 +subsubsection \<open>Fragments of the harmonic series\<close>
   36.16  
   36.17  definition harmonic :: "nat \<Rightarrow> rat" where
   36.18    "harmonic n = listsum (map (\<lambda>n. 1 / of_nat n) [1..<n])"
   36.19  
   36.20  
   36.21 -subsubsection {* The sieve of Erathostenes *}
   36.22 +subsubsection \<open>The sieve of Erathostenes\<close>
   36.23  
   36.24 -text {*
   36.25 +text \<open>
   36.26    The attentive reader may relate this ad-hoc implementation to the
   36.27    arithmetic notion of prime numbers as a little exercise.
   36.28 -*}
   36.29 +\<close>
   36.30  
   36.31  primrec mark :: "nat \<Rightarrow> nat \<Rightarrow> bool list \<Rightarrow> bool list" where
   36.32    "mark _ _ [] = []"
   36.33 @@ -34,7 +34,7 @@
   36.34      | p#ps' \<Rightarrow> let n = m - length ps' in takeWhile Not ps @ p # sieve m (mark n n ps'))"
   36.35  by pat_completeness auto
   36.36  
   36.37 -termination -- {* tuning of this proof is left as an exercise to the reader *}
   36.38 +termination -- \<open>tuning of this proof is left as an exercise to the reader\<close>
   36.39    apply (relation "measure (length \<circ> snd)")
   36.40    apply rule
   36.41    apply (auto simp add: length_dropWhile_le)
   36.42 @@ -56,7 +56,7 @@
   36.43    "list_primes (Suc n) = natify 1 (sieve n (False # replicate n True))"
   36.44  
   36.45  
   36.46 -subsubsection {* Naive factorisation *}
   36.47 +subsubsection \<open>Naive factorisation\<close>
   36.48  
   36.49  function factorise_from :: "nat \<Rightarrow> nat \<Rightarrow> nat list" where
   36.50    "factorise_from k n = (if 1 < k \<and> k \<le> n
   36.51 @@ -67,7 +67,7 @@
   36.52      else [])" 
   36.53  by pat_completeness auto
   36.54  
   36.55 -termination factorise_from -- {* tuning of this proof is left as an exercise to the reader *}
   36.56 +termination factorise_from -- \<open>tuning of this proof is left as an exercise to the reader\<close>
   36.57  term measure
   36.58  apply (relation "measure (\<lambda>(k, n). 2 * n - k)")
   36.59  apply (auto simp add: prod_eq_iff)
   36.60 @@ -80,7 +80,7 @@
   36.61    "factorise n = factorise_from 2 n"
   36.62  
   36.63  
   36.64 -subsection {* Concurrent computation via futures *}
   36.65 +subsection \<open>Concurrent computation via futures\<close>
   36.66  
   36.67  definition computation_harmonic :: "unit \<Rightarrow> rat" where
   36.68    "computation_harmonic _ = Debug.timing (STR ''harmonic example'') harmonic 300"
    37.1 --- a/src/HOL/ex/PresburgerEx.thy	Tue Oct 06 17:46:07 2015 +0200
    37.2 +++ b/src/HOL/ex/PresburgerEx.thy	Tue Oct 06 17:47:28 2015 +0200
    37.3 @@ -2,7 +2,7 @@
    37.4      Author:     Amine Chaieb, TU Muenchen
    37.5  *)
    37.6  
    37.7 -section {* Some examples for Presburger Arithmetic *}
    37.8 +section \<open>Some examples for Presburger Arithmetic\<close>
    37.9  
   37.10  theory PresburgerEx
   37.11  imports Presburger
   37.12 @@ -28,7 +28,7 @@
   37.13  theorem "\<forall>(x::nat). \<exists>(y::nat). (0::nat) \<le> 5 --> y = 5 + x "
   37.14    by presburger
   37.15  
   37.16 -text{*Slow: about 7 seconds on a 1.6GHz machine.*}
   37.17 +text\<open>Slow: about 7 seconds on a 1.6GHz machine.\<close>
   37.18  theorem "\<forall>(x::nat). \<exists>(y::nat). y = 5 + x | x div 6 + 1= 2"
   37.19    by presburger
   37.20  
   37.21 @@ -88,17 +88,17 @@
   37.22  theorem "~ (\<forall>j (i::int). j \<le> i --> (\<exists>x y. 0 \<le> x & 0 \<le> y & 3 * x + 5 * y = i))"
   37.23    by presburger
   37.24  
   37.25 -text{*Slow: about 5 seconds on a 1.6GHz machine.*}
   37.26 +text\<open>Slow: about 5 seconds on a 1.6GHz machine.\<close>
   37.27  theorem "(\<exists>m::nat. n = 2 * m) --> (n + 1) div 2 = n div 2"
   37.28    by presburger
   37.29  
   37.30 -text{* This following theorem proves that all solutions to the
   37.31 +text\<open>This following theorem proves that all solutions to the
   37.32  recurrence relation $x_{i+2} = |x_{i+1}| - x_i$ are periodic with
   37.33  period 9.  The example was brought to our attention by John
   37.34  Harrison. It does does not require Presburger arithmetic but merely
   37.35  quantifier-free linear arithmetic and holds for the rationals as well.
   37.36  
   37.37 -Warning: it takes (in 2006) over 4.2 minutes! *}
   37.38 +Warning: it takes (in 2006) over 4.2 minutes!\<close>
   37.39  
   37.40  lemma "\<lbrakk> x3 = abs x2 - x1; x4 = abs x3 - x2; x5 = abs x4 - x3;
   37.41           x6 = abs x5 - x4; x7 = abs x6 - x5; x8 = abs x7 - x6;
    38.1 --- a/src/HOL/ex/Primrec.thy	Tue Oct 06 17:46:07 2015 +0200
    38.2 +++ b/src/HOL/ex/Primrec.thy	Tue Oct 06 17:47:28 2015 +0200
    38.3 @@ -6,11 +6,11 @@
    38.4  Primitive Recursive Functions.
    38.5  *)
    38.6  
    38.7 -section {* Primitive Recursive Functions *}
    38.8 +section \<open>Primitive Recursive Functions\<close>
    38.9  
   38.10  theory Primrec imports Main begin
   38.11  
   38.12 -text {*
   38.13 +text \<open>
   38.14    Proof adopted from
   38.15  
   38.16    Nora Szasz, A Machine Checked Proof that Ackermann's Function is not
   38.17 @@ -20,10 +20,10 @@
   38.18    See also E. Mendelson, Introduction to Mathematical Logic.  (Van
   38.19    Nostrand, 1964), page 250, exercise 11.
   38.20    \medskip
   38.21 -*}
   38.22 +\<close>
   38.23  
   38.24  
   38.25 -subsection{* Ackermann's Function *}
   38.26 +subsection\<open>Ackermann's Function\<close>
   38.27  
   38.28  fun ack :: "nat => nat => nat" where
   38.29  "ack 0 n =  Suc n" |
   38.30 @@ -31,26 +31,26 @@
   38.31  "ack (Suc m) (Suc n) = ack m (ack (Suc m) n)"
   38.32  
   38.33  
   38.34 -text {* PROPERTY A 4 *}
   38.35 +text \<open>PROPERTY A 4\<close>
   38.36  
   38.37  lemma less_ack2 [iff]: "j < ack i j"
   38.38  by (induct i j rule: ack.induct) simp_all
   38.39  
   38.40  
   38.41 -text {* PROPERTY A 5-, the single-step lemma *}
   38.42 +text \<open>PROPERTY A 5-, the single-step lemma\<close>
   38.43  
   38.44  lemma ack_less_ack_Suc2 [iff]: "ack i j < ack i (Suc j)"
   38.45  by (induct i j rule: ack.induct) simp_all
   38.46  
   38.47  
   38.48 -text {* PROPERTY A 5, monotonicity for @{text "<"} *}
   38.49 +text \<open>PROPERTY A 5, monotonicity for @{text "<"}\<close>
   38.50  
   38.51  lemma ack_less_mono2: "j < k ==> ack i j < ack i k"
   38.52  using lift_Suc_mono_less[where f = "ack i"]
   38.53  by (metis ack_less_ack_Suc2)
   38.54  
   38.55  
   38.56 -text {* PROPERTY A 5', monotonicity for @{text \<le>} *}
   38.57 +text \<open>PROPERTY A 5', monotonicity for @{text \<le>}\<close>
   38.58  
   38.59  lemma ack_le_mono2: "j \<le> k ==> ack i j \<le> ack i k"
   38.60  apply (simp add: order_le_less)
   38.61 @@ -58,7 +58,7 @@
   38.62  done
   38.63  
   38.64  
   38.65 -text {* PROPERTY A 6 *}
   38.66 +text \<open>PROPERTY A 6\<close>
   38.67  
   38.68  lemma ack2_le_ack1 [iff]: "ack i (Suc j) \<le> ack (Suc i) j"
   38.69  proof (induct j)
   38.70 @@ -70,13 +70,13 @@
   38.71  qed
   38.72  
   38.73  
   38.74 -text {* PROPERTY A 7-, the single-step lemma *}
   38.75 +text \<open>PROPERTY A 7-, the single-step lemma\<close>
   38.76  
   38.77  lemma ack_less_ack_Suc1 [iff]: "ack i j < ack (Suc i) j"
   38.78  by (blast intro: ack_less_mono2 less_le_trans)
   38.79  
   38.80  
   38.81 -text {* PROPERTY A 4'? Extra lemma needed for @{term CONSTANT} case, constant functions *}
   38.82 +text \<open>PROPERTY A 4'? Extra lemma needed for @{term CONSTANT} case, constant functions\<close>
   38.83  
   38.84  lemma less_ack1 [iff]: "i < ack i j"
   38.85  apply (induct i)
   38.86 @@ -85,21 +85,21 @@
   38.87  done
   38.88  
   38.89  
   38.90 -text {* PROPERTY A 8 *}
   38.91 +text \<open>PROPERTY A 8\<close>
   38.92  
   38.93  lemma ack_1 [simp]: "ack (Suc 0) j = j + 2"
   38.94  by (induct j) simp_all
   38.95  
   38.96  
   38.97 -text {* PROPERTY A 9.  The unary @{text 1} and @{text 2} in @{term
   38.98 -  ack} is essential for the rewriting. *}
   38.99 +text \<open>PROPERTY A 9.  The unary @{text 1} and @{text 2} in @{term
  38.100 +  ack} is essential for the rewriting.\<close>
  38.101  
  38.102  lemma ack_2 [simp]: "ack (Suc (Suc 0)) j = 2 * j + 3"
  38.103  by (induct j) simp_all
  38.104  
  38.105  
  38.106 -text {* PROPERTY A 7, monotonicity for @{text "<"} [not clear why
  38.107 -  @{thm [source] ack_1} is now needed first!] *}
  38.108 +text \<open>PROPERTY A 7, monotonicity for @{text "<"} [not clear why
  38.109 +  @{thm [source] ack_1} is now needed first!]\<close>
  38.110  
  38.111  lemma ack_less_mono1_aux: "ack i k < ack (Suc (i +i')) k"
  38.112  proof (induct i k rule: ack.induct)
  38.113 @@ -118,7 +118,7 @@
  38.114  done
  38.115  
  38.116  
  38.117 -text {* PROPERTY A 7', monotonicity for @{text "\<le>"} *}
  38.118 +text \<open>PROPERTY A 7', monotonicity for @{text "\<le>"}\<close>
  38.119  
  38.120  lemma ack_le_mono1: "i \<le> j ==> ack i k \<le> ack j k"
  38.121  apply (simp add: order_le_less)
  38.122 @@ -126,7 +126,7 @@
  38.123  done
  38.124  
  38.125  
  38.126 -text {* PROPERTY A 10 *}
  38.127 +text \<open>PROPERTY A 10\<close>
  38.128  
  38.129  lemma ack_nest_bound: "ack i1 (ack i2 j) < ack (2 + (i1 + i2)) j"
  38.130  apply (simp add: numerals)
  38.131 @@ -138,7 +138,7 @@
  38.132  done
  38.133  
  38.134  
  38.135 -text {* PROPERTY A 11 *}
  38.136 +text \<open>PROPERTY A 11\<close>
  38.137  
  38.138  lemma ack_add_bound: "ack i1 j + ack i2 j < ack (4 + (i1 + i2)) j"
  38.139  apply (rule less_trans [of _ "ack (Suc (Suc 0)) (ack (i1 + i2) j)"])
  38.140 @@ -152,9 +152,9 @@
  38.141  done
  38.142  
  38.143  
  38.144 -text {* PROPERTY A 12.  Article uses existential quantifier but the ALF proof
  38.145 +text \<open>PROPERTY A 12.  Article uses existential quantifier but the ALF proof
  38.146    used @{text "k + 4"}.  Quantified version must be nested @{text
  38.147 -  "\<exists>k'. \<forall>i j. ..."} *}
  38.148 +  "\<exists>k'. \<forall>i j. ..."}\<close>
  38.149  
  38.150  lemma ack_add_bound2: "i < ack k j ==> i + j < ack (4 + k) j"
  38.151  apply (rule less_trans [of _ "ack k j + ack 0 j"])
  38.152 @@ -164,14 +164,14 @@
  38.153  done
  38.154  
  38.155  
  38.156 -subsection{*Primitive Recursive Functions*}
  38.157 +subsection\<open>Primitive Recursive Functions\<close>
  38.158  
  38.159  primrec hd0 :: "nat list => nat" where
  38.160  "hd0 [] = 0" |
  38.161  "hd0 (m # ms) = m"
  38.162  
  38.163  
  38.164 -text {* Inductive definition of the set of primitive recursive functions of type @{typ "nat list => nat"}. *}
  38.165 +text \<open>Inductive definition of the set of primitive recursive functions of type @{typ "nat list => nat"}.\<close>
  38.166  
  38.167  definition SC :: "nat list => nat" where
  38.168  "SC l = Suc (hd0 l)"
  38.169 @@ -192,7 +192,7 @@
  38.170      (case l of
  38.171        [] => 0
  38.172      | x # l' => rec_nat (f l') (\<lambda>y r. g (r # y # l')) x)"
  38.173 -  -- {* Note that @{term g} is applied first to @{term "PREC f g y"} and then to @{term y}! *}
  38.174 +  -- \<open>Note that @{term g} is applied first to @{term "PREC f g y"} and then to @{term y}!\<close>
  38.175  
  38.176  inductive PRIMREC :: "(nat list => nat) => bool" where
  38.177  SC: "PRIMREC SC" |
  38.178 @@ -202,7 +202,7 @@
  38.179  PREC: "PRIMREC f ==> PRIMREC g ==> PRIMREC (PREC f g)"
  38.180  
  38.181  
  38.182 -text {* Useful special cases of evaluation *}
  38.183 +text \<open>Useful special cases of evaluation\<close>
  38.184  
  38.185  lemma SC [simp]: "SC (x # l) = Suc x"
  38.186  by (simp add: SC_def)
  38.187 @@ -223,7 +223,7 @@
  38.188  by (simp add: PREC_def)
  38.189  
  38.190  
  38.191 -text {* MAIN RESULT *}
  38.192 +text \<open>MAIN RESULT\<close>
  38.193  
  38.194  lemma SC_case: "SC l < ack 1 (listsum l)"
  38.195  apply (unfold SC_def)
  38.196 @@ -242,7 +242,7 @@
  38.197  done
  38.198  
  38.199  
  38.200 -text {* @{term COMP} case *}
  38.201 +text \<open>@{term COMP} case\<close>
  38.202  
  38.203  lemma COMP_map_aux: "\<forall>f \<in> set fs. PRIMREC f \<and> (\<exists>kf. \<forall>l. f l < ack kf (listsum l))
  38.204    ==> \<exists>k. \<forall>l. listsum (map (\<lambda>f. f l) fs) < ack k (listsum l)"
  38.205 @@ -263,7 +263,7 @@
  38.206  done
  38.207  
  38.208  
  38.209 -text {* @{term PREC} case *}
  38.210 +text \<open>@{term PREC} case\<close>
  38.211  
  38.212  lemma PREC_case_aux:
  38.213    "\<forall>l. f l + listsum l < ack kf (listsum l) ==>
  38.214 @@ -273,18 +273,18 @@
  38.215  apply (case_tac l)
  38.216   apply simp_all
  38.217   apply (blast intro: less_trans)
  38.218 -apply (erule ssubst) -- {* get rid of the needless assumption *}
  38.219 +apply (erule ssubst) -- \<open>get rid of the needless assumption\<close>
  38.220  apply (induct_tac a)
  38.221   apply simp_all
  38.222 - txt {* base case *}
  38.223 + txt \<open>base case\<close>
  38.224   apply (blast intro: le_add1 [THEN le_imp_less_Suc, THEN ack_less_mono1] less_trans)
  38.225 -txt {* induction step *}
  38.226 +txt \<open>induction step\<close>
  38.227  apply (rule Suc_leI [THEN le_less_trans])
  38.228   apply (rule le_refl [THEN add_le_mono, THEN le_less_trans])
  38.229    prefer 2
  38.230    apply (erule spec)
  38.231   apply (simp add: le_add2)
  38.232 -txt {* final part of the simplification *}
  38.233 +txt \<open>final part of the simplification\<close>
  38.234  apply simp
  38.235  apply (rule le_add2 [THEN ack_le_mono1, THEN le_less_trans])
  38.236  apply (erule ack_less_mono2)
    39.1 --- a/src/HOL/ex/Pythagoras.thy	Tue Oct 06 17:46:07 2015 +0200
    39.2 +++ b/src/HOL/ex/Pythagoras.thy	Tue Oct 06 17:47:28 2015 +0200
    39.3 @@ -8,7 +8,7 @@
    39.4  imports Complex_Main
    39.5  begin
    39.6  
    39.7 -text {* Expressed in real numbers: *}
    39.8 +text \<open>Expressed in real numbers:\<close>
    39.9  
   39.10  lemma pythagoras_verbose:
   39.11    "((A1::real) - B1) * (C1 - B1) + (A2 - B2) * (C2 - B2) = 0 \<Longrightarrow> 
   39.12 @@ -17,7 +17,7 @@
   39.13    by algebra
   39.14  
   39.15  
   39.16 -text {* Expressed in vectors: *}
   39.17 +text \<open>Expressed in vectors:\<close>
   39.18  
   39.19  type_synonym point = "real \<times> real"
   39.20  
    40.1 --- a/src/HOL/ex/Quicksort.thy	Tue Oct 06 17:46:07 2015 +0200
    40.2 +++ b/src/HOL/ex/Quicksort.thy	Tue Oct 06 17:47:28 2015 +0200
    40.3 @@ -2,7 +2,7 @@
    40.4      Copyright   1994 TU Muenchen
    40.5  *)
    40.6  
    40.7 -section {* Quicksort with function package *}
    40.8 +section \<open>Quicksort with function package\<close>
    40.9  
   40.10  theory Quicksort
   40.11  imports "~~/src/HOL/Library/Multiset"
    41.1 --- a/src/HOL/ex/Records.thy	Tue Oct 06 17:46:07 2015 +0200
    41.2 +++ b/src/HOL/ex/Records.thy	Tue Oct 06 17:47:28 2015 +0200
    41.3 @@ -3,29 +3,29 @@
    41.4                  TU Muenchen
    41.5  *)
    41.6  
    41.7 -section {* Using extensible records in HOL -- points and coloured points *}
    41.8 +section \<open>Using extensible records in HOL -- points and coloured points\<close>
    41.9  
   41.10  theory Records
   41.11  imports Main
   41.12  begin
   41.13  
   41.14 -subsection {* Points *}
   41.15 +subsection \<open>Points\<close>
   41.16  
   41.17  record point =
   41.18    xpos :: nat
   41.19    ypos :: nat
   41.20  
   41.21 -text {*
   41.22 +text \<open>
   41.23    Apart many other things, above record declaration produces the
   41.24    following theorems:
   41.25 -*}
   41.26 +\<close>
   41.27  
   41.28  
   41.29  thm point.simps
   41.30  thm point.iffs
   41.31  thm point.defs
   41.32  
   41.33 -text {*
   41.34 +text \<open>
   41.35    The set of theorems @{thm [source] point.simps} is added
   41.36    automatically to the standard simpset, @{thm [source] point.iffs} is
   41.37    added to the Classical Reasoner and Simplifier context.
   41.38 @@ -34,13 +34,13 @@
   41.39    @{text [display]
   41.40  "  point = \<lparr>xpos :: nat, ypos :: nat\<rparr> = () point_ext_type
   41.41    'a point_scheme = \<lparr>xpos :: nat, ypos :: nat, ... :: 'a\<rparr>  = 'a point_ext_type"}
   41.42 -*}
   41.43 +\<close>
   41.44  
   41.45  consts foo2 :: "(| xpos :: nat, ypos :: nat |)"
   41.46  consts foo4 :: "'a => (| xpos :: nat, ypos :: nat, ... :: 'a |)"
   41.47  
   41.48  
   41.49 -subsubsection {* Introducing concrete records and record schemes *}
   41.50 +subsubsection \<open>Introducing concrete records and record schemes\<close>
   41.51  
   41.52  definition foo1 :: point
   41.53    where "foo1 = (| xpos = 1, ypos = 0 |)"
   41.54 @@ -49,7 +49,7 @@
   41.55    where "foo3 ext = (| xpos = 1, ypos = 0, ... = ext |)"
   41.56  
   41.57  
   41.58 -subsubsection {* Record selection and record update *}
   41.59 +subsubsection \<open>Record selection and record update\<close>
   41.60  
   41.61  definition getX :: "'a point_scheme => nat"
   41.62    where "getX r = xpos r"
   41.63 @@ -58,9 +58,9 @@
   41.64    where "setX r n = r (| xpos := n |)"
   41.65  
   41.66  
   41.67 -subsubsection {* Some lemmas about records *}
   41.68 +subsubsection \<open>Some lemmas about records\<close>
   41.69  
   41.70 -text {* Basic simplifications. *}
   41.71 +text \<open>Basic simplifications.\<close>
   41.72  
   41.73  lemma "point.make n p = (| xpos = n, ypos = p |)"
   41.74    by (simp only: point.make_def)
   41.75 @@ -72,7 +72,7 @@
   41.76    by simp
   41.77  
   41.78  
   41.79 -text {* \medskip Equality of records. *}
   41.80 +text \<open>\medskip Equality of records.\<close>
   41.81  
   41.82  lemma "n = n' ==> p = p' ==> (| xpos = n, ypos = p |) = (| xpos = n', ypos = p' |)"
   41.83    -- "introduction of concrete record equality"
   41.84 @@ -95,7 +95,7 @@
   41.85  qed
   41.86  
   41.87  
   41.88 -text {* \medskip Surjective pairing *}
   41.89 +text \<open>\medskip Surjective pairing\<close>
   41.90  
   41.91  lemma "r = (| xpos = xpos r, ypos = ypos r |)"
   41.92    by simp
   41.93 @@ -104,10 +104,10 @@
   41.94    by simp
   41.95  
   41.96  
   41.97 -text {*
   41.98 +text \<open>
   41.99    \medskip Representation of records by cases or (degenerate)
  41.100    induction.
  41.101 -*}
  41.102 +\<close>
  41.103  
  41.104  lemma "r(| xpos := n |) (| ypos := m |) = r (| ypos := m |) (| xpos := n |)"
  41.105  proof (cases r)
  41.106 @@ -141,15 +141,15 @@
  41.107    by (cases r) simp
  41.108  
  41.109  
  41.110 -text {*
  41.111 +text \<open>
  41.112   \medskip Concrete records are type instances of record schemes.
  41.113 -*}
  41.114 +\<close>
  41.115  
  41.116  definition foo5 :: nat
  41.117    where "foo5 = getX (| xpos = 1, ypos = 0 |)"
  41.118  
  41.119  
  41.120 -text {* \medskip Manipulating the ``@{text "..."}'' (more) part. *}
  41.121 +text \<open>\medskip Manipulating the ``@{text "..."}'' (more) part.\<close>
  41.122  
  41.123  definition incX :: "'a point_scheme => 'a point_scheme"
  41.124    where "incX r = (| xpos = xpos r + 1, ypos = ypos r, ... = point.more r |)"
  41.125 @@ -158,13 +158,13 @@
  41.126    by (simp add: getX_def setX_def incX_def)
  41.127  
  41.128  
  41.129 -text {* An alternative definition. *}
  41.130 +text \<open>An alternative definition.\<close>
  41.131  
  41.132  definition incX' :: "'a point_scheme => 'a point_scheme"
  41.133    where "incX' r = r (| xpos := xpos r + 1 |)"
  41.134  
  41.135  
  41.136 -subsection {* Coloured points: record extension *}
  41.137 +subsection \<open>Coloured points: record extension\<close>
  41.138  
  41.139  datatype colour = Red | Green | Blue
  41.140  
  41.141 @@ -172,14 +172,14 @@
  41.142    colour :: colour
  41.143  
  41.144  
  41.145 -text {*
  41.146 +text \<open>
  41.147    The record declaration defines a new type constructure and abbreviations:
  41.148    @{text [display]
  41.149  "  cpoint = (| xpos :: nat, ypos :: nat, colour :: colour |) =
  41.150       () cpoint_ext_type point_ext_type
  41.151     'a cpoint_scheme = (| xpos :: nat, ypos :: nat, colour :: colour, ... :: 'a |) =
  41.152       'a cpoint_ext_type point_ext_type"}
  41.153 -*}
  41.154 +\<close>
  41.155  
  41.156  consts foo6 :: cpoint
  41.157  consts foo7 :: "(| xpos :: nat, ypos :: nat, colour :: colour |)"
  41.158 @@ -187,39 +187,39 @@
  41.159  consts foo9 :: "(| xpos :: nat, ypos :: nat, colour :: colour, ... :: 'a |)"
  41.160  
  41.161  
  41.162 -text {*
  41.163 +text \<open>
  41.164   Functions on @{text point} schemes work for @{text cpoints} as well.
  41.165 -*}
  41.166 +\<close>
  41.167  
  41.168  definition foo10 :: nat
  41.169    where "foo10 = getX (| xpos = 2, ypos = 0, colour = Blue |)"
  41.170  
  41.171  
  41.172 -subsubsection {* Non-coercive structural subtyping *}
  41.173 +subsubsection \<open>Non-coercive structural subtyping\<close>
  41.174  
  41.175 -text {*
  41.176 +text \<open>
  41.177   Term @{term foo11} has type @{typ cpoint}, not type @{typ point} ---
  41.178   Great!
  41.179 -*}
  41.180 +\<close>
  41.181  
  41.182  definition foo11 :: cpoint
  41.183    where "foo11 = setX (| xpos = 2, ypos = 0, colour = Blue |) 0"
  41.184  
  41.185  
  41.186 -subsection {* Other features *}
  41.187 +subsection \<open>Other features\<close>
  41.188  
  41.189 -text {* Field names contribute to record identity. *}
  41.190 +text \<open>Field names contribute to record identity.\<close>
  41.191  
  41.192  record point' =
  41.193    xpos' :: nat
  41.194    ypos' :: nat
  41.195  
  41.196 -text {*
  41.197 +text \<open>
  41.198    \noindent May not apply @{term getX} to @{term [source] "(| xpos' =
  41.199    2, ypos' = 0 |)"} -- type error.
  41.200 -*}
  41.201 +\<close>
  41.202  
  41.203 -text {* \medskip Polymorphic records. *}
  41.204 +text \<open>\medskip Polymorphic records.\<close>
  41.205  
  41.206  record 'a point'' = point +
  41.207    content :: 'a
  41.208 @@ -228,15 +228,15 @@
  41.209  
  41.210  
  41.211  
  41.212 -text {* Updating a record field with an identical value is simplified.*}
  41.213 +text \<open>Updating a record field with an identical value is simplified.\<close>
  41.214  lemma "r (| xpos := xpos r |) = r"
  41.215    by simp
  41.216  
  41.217 -text {* Only the most recent update to a component survives simplification. *}
  41.218 +text \<open>Only the most recent update to a component survives simplification.\<close>
  41.219  lemma "r (| xpos := x, ypos := y, xpos := x' |) = r (| ypos := y, xpos := x' |)"
  41.220    by simp
  41.221  
  41.222 -text {* In some cases its convenient to automatically split
  41.223 +text \<open>In some cases its convenient to automatically split
  41.224  (quantified) records. For this purpose there is the simproc @{ML [source]
  41.225  "Record.split_simproc"} and the tactic @{ML [source]
  41.226  "Record.split_simp_tac"}.  The simplification procedure
  41.227 @@ -251,43 +251,43 @@
  41.228  @{ML [source] "Record.split_simp_tac"} additionally takes a list of
  41.229  equations for simplification and can also split fixed record variables.
  41.230  
  41.231 -*}
  41.232 +\<close>
  41.233  
  41.234  lemma "(\<forall>r. P (xpos r)) \<longrightarrow> (\<forall>x. P x)"
  41.235 -  apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context}
  41.236 -    addsimprocs [Record.split_simproc (K ~1)]) 1 *})
  41.237 +  apply (tactic \<open>simp_tac (put_simpset HOL_basic_ss @{context}
  41.238 +    addsimprocs [Record.split_simproc (K ~1)]) 1\<close>)
  41.239    apply simp
  41.240    done
  41.241  
  41.242  lemma "(\<forall>r. P (xpos r)) \<longrightarrow> (\<forall>x. P x)"
  41.243 -  apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1*})
  41.244 +  apply (tactic \<open>Record.split_simp_tac @{context} [] (K ~1) 1\<close>)
  41.245    apply simp
  41.246    done
  41.247  
  41.248  lemma "(\<exists>r. P (xpos r)) \<longrightarrow> (\<exists>x. P x)"
  41.249 -  apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context}
  41.250 -    addsimprocs [Record.split_simproc (K ~1)]) 1 *})
  41.251 +  apply (tactic \<open>simp_tac (put_simpset HOL_basic_ss @{context}
  41.252 +    addsimprocs [Record.split_simproc (K ~1)]) 1\<close>)
  41.253    apply simp
  41.254    done
  41.255  
  41.256  lemma "(\<exists>r. P (xpos r)) \<longrightarrow> (\<exists>x. P x)"
  41.257 -  apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1 *})
  41.258 +  apply (tactic \<open>Record.split_simp_tac @{context} [] (K ~1) 1\<close>)
  41.259    apply simp
  41.260    done
  41.261  
  41.262  lemma "\<And>r. P (xpos r) \<Longrightarrow> (\<exists>x. P x)"
  41.263 -  apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context}
  41.264 -    addsimprocs [Record.split_simproc (K ~1)]) 1 *})
  41.265 +  apply (tactic \<open>simp_tac (put_simpset HOL_basic_ss @{context}
  41.266 +    addsimprocs [Record.split_simproc (K ~1)]) 1\<close>)
  41.267    apply auto
  41.268    done
  41.269  
  41.270  lemma "\<And>r. P (xpos r) \<Longrightarrow> (\<exists>x. P x)"
  41.271 -  apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1*})
  41.272 +  apply (tactic \<open>Record.split_simp_tac @{context} [] (K ~1) 1\<close>)
  41.273    apply auto
  41.274    done
  41.275  
  41.276  lemma "P (xpos r) \<Longrightarrow> (\<exists>x. P x)"
  41.277 -  apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1*})
  41.278 +  apply (tactic \<open>Record.split_simp_tac @{context} [] (K ~1) 1\<close>)
  41.279    apply auto
  41.280    done
  41.281  
  41.282 @@ -298,23 +298,23 @@
  41.283      assume pre: "P (xpos r)"
  41.284      then have "\<exists>x. P x"
  41.285        apply -
  41.286 -      apply (tactic {* Record.split_simp_tac @{context} [] (K ~1) 1 *})
  41.287 +      apply (tactic \<open>Record.split_simp_tac @{context} [] (K ~1) 1\<close>)
  41.288        apply auto
  41.289        done
  41.290    }
  41.291    show ?thesis ..
  41.292  qed
  41.293  
  41.294 -text {* The effect of simproc @{ML [source] Record.ex_sel_eq_simproc} is
  41.295 -  illustrated by the following lemma. *}
  41.296 +text \<open>The effect of simproc @{ML [source] Record.ex_sel_eq_simproc} is
  41.297 +  illustrated by the following lemma.\<close>
  41.298  
  41.299  lemma "\<exists>r. xpos r = x"
  41.300 -  apply (tactic {* simp_tac (put_simpset HOL_basic_ss @{context}
  41.301 -    addsimprocs [Record.ex_sel_eq_simproc]) 1 *})
  41.302 +  apply (tactic \<open>simp_tac (put_simpset HOL_basic_ss @{context}
  41.303 +    addsimprocs [Record.ex_sel_eq_simproc]) 1\<close>)
  41.304    done
  41.305  
  41.306  
  41.307 -subsection {* A more complex record expression *}
  41.308 +subsection \<open>A more complex record expression\<close>
  41.309  
  41.310  record ('a, 'b, 'c) bar = bar1 :: 'a
  41.311    bar2 :: 'b
  41.312 @@ -324,13 +324,13 @@
  41.313    bar31 :: "'c \<times> 'a"
  41.314  
  41.315  
  41.316 -subsection {* Some code generation *}
  41.317 +subsection \<open>Some code generation\<close>
  41.318  
  41.319  export_code foo1 foo3 foo5 foo10 checking SML
  41.320  
  41.321 -text {*
  41.322 +text \<open>
  41.323    Code generation can also be switched off, for instance for very large records
  41.324 -*}
  41.325 +\<close>
  41.326  
  41.327  declare [[record_codegen = false]]
  41.328  
    42.1 --- a/src/HOL/ex/Reflection_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    42.2 +++ b/src/HOL/ex/Reflection_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    42.3 @@ -2,15 +2,15 @@
    42.4      Author:     Amine Chaieb, TU Muenchen
    42.5  *)
    42.6  
    42.7 -section {* Examples for generic reflection and reification *}
    42.8 +section \<open>Examples for generic reflection and reification\<close>
    42.9  
   42.10  theory Reflection_Examples
   42.11  imports Complex_Main "~~/src/HOL/Library/Reflection"
   42.12  begin
   42.13  
   42.14 -text {* This theory presents two methods: reify and reflection *}
   42.15 +text \<open>This theory presents two methods: reify and reflection\<close>
   42.16  
   42.17 -text {* 
   42.18 +text \<open>
   42.19  Consider an HOL type @{text \<sigma>}, the structure of which is not recongnisable
   42.20  on the theory level.  This is the case of @{typ bool}, arithmetical terms such as @{typ int},
   42.21  @{typ real} etc \dots  In order to implement a simplification on terms of type @{text \<sigma>} we
   42.22 @@ -41,10 +41,10 @@
   42.23  and hence using @{text corr_thm} derives @{prop "t = I xs (f s)"}.  It then uses
   42.24  normalization by equational rewriting to prove @{prop "f s = s'"} which almost finishes
   42.25  the proof of @{prop "t = t'"} where @{prop "I xs s' = t'"}.
   42.26 -*}
   42.27 +\<close>
   42.28  
   42.29 -text {* Example 1 : Propositional formulae and NNF. *}
   42.30 -text {* The type @{text fm} represents simple propositional formulae: *}
   42.31 +text \<open>Example 1 : Propositional formulae and NNF.\<close>
   42.32 +text \<open>The type @{text fm} represents simple propositional formulae:\<close>
   42.33  
   42.34  datatype form = TrueF | FalseF | Less nat nat
   42.35    | And form form | Or form form | Neg form | ExQ form
   42.36 @@ -81,15 +81,15 @@
   42.37    apply (reify Ifm.simps)
   42.38  oops
   42.39  
   42.40 -text {* Method @{text reify} maps a @{typ bool} to an @{typ fm}.  For this it needs the 
   42.41 -semantics of @{text fm}, i.e.\ the rewrite rules in @{text Ifm.simps}. *}
   42.42 +text \<open>Method @{text reify} maps a @{typ bool} to an @{typ fm}.  For this it needs the 
   42.43 +semantics of @{text fm}, i.e.\ the rewrite rules in @{text Ifm.simps}.\<close>
   42.44  
   42.45 -text {* You can also just pick up a subterm to reify. *}
   42.46 +text \<open>You can also just pick up a subterm to reify.\<close>
   42.47  lemma "Q \<longrightarrow> (D \<and> F \<and> ((\<not> D) \<and> (\<not> F)))"
   42.48    apply (reify Ifm.simps ("((\<not> D) \<and> (\<not> F))"))
   42.49  oops
   42.50  
   42.51 -text {* Let's perform NNF. This is a version that tends to generate disjunctions *}
   42.52 +text \<open>Let's perform NNF. This is a version that tends to generate disjunctions\<close>
   42.53  primrec fmsize :: "fm \<Rightarrow> nat"
   42.54  where
   42.55    "fmsize (At n) = 1"
   42.56 @@ -115,29 +115,29 @@
   42.57  | "nnf (NOT (NOT p)) = nnf p"
   42.58  | "nnf (NOT p) = NOT p"
   42.59  
   42.60 -text {* The correctness theorem of @{const nnf}: it preserves the semantics of @{typ fm} *}
   42.61 +text \<open>The correctness theorem of @{const nnf}: it preserves the semantics of @{typ fm}\<close>
   42.62  lemma nnf [reflection]:
   42.63    "Ifm (nnf p) vs = Ifm p vs"
   42.64    by (induct p rule: nnf.induct) auto
   42.65  
   42.66 -text {* Now let's perform NNF using our @{const nnf} function defined above.  First to the
   42.67 -  whole subgoal. *}
   42.68 +text \<open>Now let's perform NNF using our @{const nnf} function defined above.  First to the
   42.69 +  whole subgoal.\<close>
   42.70  lemma "A \<noteq> B \<and> (B \<longrightarrow> A \<noteq> (B \<or> C \<and> (B \<longrightarrow> A \<or> D))) \<longrightarrow> A \<or> B \<and> D"
   42.71    apply (reflection Ifm.simps)
   42.72  oops
   42.73  
   42.74 -text {* Now we specify on which subterm it should be applied *}
   42.75 +text \<open>Now we specify on which subterm it should be applied\<close>
   42.76  lemma "A \<noteq> B \<and> (B \<longrightarrow> A \<noteq> (B \<or> C \<and> (B \<longrightarrow> A \<or> D))) \<longrightarrow> A \<or> B \<and> D"
   42.77    apply (reflection Ifm.simps only: "B \<or> C \<and> (B \<longrightarrow> A \<or> D)")
   42.78  oops
   42.79  
   42.80  
   42.81 -text {* Example 2: Simple arithmetic formulae *}
   42.82 +text \<open>Example 2: Simple arithmetic formulae\<close>
   42.83  
   42.84 -text {* The type @{text num} reflects linear expressions over natural number *}
   42.85 +text \<open>The type @{text num} reflects linear expressions over natural number\<close>
   42.86  datatype num = C nat | Add num num | Mul nat num | Var nat | CN nat nat num
   42.87  
   42.88 -text {* This is just technical to make recursive definitions easier. *}
   42.89 +text \<open>This is just technical to make recursive definitions easier.\<close>
   42.90  primrec num_size :: "num \<Rightarrow> nat" 
   42.91  where
   42.92    "num_size (C c) = 1"
   42.93 @@ -148,7 +148,7 @@
   42.94  
   42.95  lemma [measure_function]: "is_measure num_size" ..
   42.96  
   42.97 -text {* The semantics of num *}
   42.98 +text \<open>The semantics of num\<close>
   42.99  primrec Inum:: "num \<Rightarrow> nat list \<Rightarrow> nat"
  42.100  where
  42.101    Inum_C  : "Inum (C i) vs = i"
  42.102 @@ -157,50 +157,50 @@
  42.103  | Inum_Mul: "Inum (Mul c t) vs = c * Inum t vs "
  42.104  | Inum_CN : "Inum (CN n c t) vs = c*(vs!n) + Inum t vs "
  42.105  
  42.106 -text {* Let's reify some nat expressions \dots *}
  42.107 +text \<open>Let's reify some nat expressions \dots\<close>
  42.108  lemma "4 * (2 * x + (y::nat)) + f a \<noteq> 0"
  42.109    apply (reify Inum.simps ("4 * (2 * x + (y::nat)) + f a"))
  42.110  oops
  42.111 -text {* We're in a bad situation! @{text x}, @{text y} and @{text f} have been recongnized
  42.112 +text \<open>We're in a bad situation! @{text x}, @{text y} and @{text f} have been recongnized
  42.113  as constants, which is correct but does not correspond to our intuition of the constructor C.
  42.114 -It should encapsulate constants, i.e. numbers, i.e. numerals. *}
  42.115 +It should encapsulate constants, i.e. numbers, i.e. numerals.\<close>
  42.116  
  42.117 -text {* So let's leave the @{text "Inum_C"} equation at the end and see what happens \dots*}
  42.118 +text \<open>So let's leave the @{text "Inum_C"} equation at the end and see what happens \dots\<close>
  42.119  lemma "4 * (2 * x + (y::nat)) \<noteq> 0"
  42.120    apply (reify Inum_Var Inum_Add Inum_Mul Inum_CN Inum_C ("4 * (2 * x + (y::nat))"))
  42.121  oops
  42.122 -text {* Hm, let's specialize @{text Inum_C} with numerals.*}
  42.123 +text \<open>Hm, let's specialize @{text Inum_C} with numerals.\<close>
  42.124  
  42.125  lemma Inum_number: "Inum (C (numeral t)) vs = numeral t" by simp
  42.126  lemmas Inum_eqs = Inum_Var Inum_Add Inum_Mul Inum_CN Inum_number
  42.127  
  42.128 -text {* Second attempt *}
  42.129 +text \<open>Second attempt\<close>
  42.130  lemma "1 * (2 * x + (y::nat)) \<noteq> 0"
  42.131    apply (reify Inum_eqs ("1 * (2 * x + (y::nat))"))
  42.132  oops
  42.133  
  42.134 -text{* That was fine, so let's try another one \dots *}
  42.135 +text\<open>That was fine, so let's try another one \dots\<close>
  42.136  
  42.137  lemma "1 * (2 * x + (y::nat) + 0 + 1) \<noteq> 0"
  42.138    apply (reify Inum_eqs ("1 * (2 * x + (y::nat) + 0 + 1)"))
  42.139  oops
  42.140  
  42.141 -text {* Oh!! 0 is not a variable \dots\ Oh! 0 is not a @{text "numeral"} \dots\ thing.
  42.142 -The same for 1. So let's add those equations, too. *}
  42.143 +text \<open>Oh!! 0 is not a variable \dots\ Oh! 0 is not a @{text "numeral"} \dots\ thing.
  42.144 +The same for 1. So let's add those equations, too.\<close>
  42.145  
  42.146  lemma Inum_01: "Inum (C 0) vs = 0" "Inum (C 1) vs = 1" "Inum (C(Suc n)) vs = Suc n"
  42.147    by simp_all
  42.148  
  42.149  lemmas Inum_eqs'= Inum_eqs Inum_01
  42.150  
  42.151 -text{* Third attempt: *}
  42.152 +text\<open>Third attempt:\<close>
  42.153  
  42.154  lemma "1 * (2 * x + (y::nat) + 0 + 1) \<noteq> 0"
  42.155    apply (reify Inum_eqs' ("1 * (2 * x + (y::nat) + 0 + 1)"))
  42.156  oops
  42.157  
  42.158 -text {* Okay, let's try reflection. Some simplifications on @{typ num} follow. You can
  42.159 -  skim until the main theorem @{text linum}. *}
  42.160 +text \<open>Okay, let's try reflection. Some simplifications on @{typ num} follow. You can
  42.161 +  skim until the main theorem @{text linum}.\<close>
  42.162    
  42.163  fun lin_add :: "num \<Rightarrow> num \<Rightarrow> num"
  42.164  where
  42.165 @@ -244,13 +244,13 @@
  42.166    "Inum (linum t) bs = Inum t bs"
  42.167    by (induct t rule: linum.induct) (simp_all add: lin_mul lin_add)
  42.168  
  42.169 -text {* Now we can use linum to simplify nat terms using reflection *}
  42.170 +text \<open>Now we can use linum to simplify nat terms using reflection\<close>
  42.171  
  42.172  lemma "Suc (Suc 1) * (x + Suc 1 * y) = 3 * x + 6 * y"
  42.173    apply (reflection Inum_eqs' only: "Suc (Suc 1) * (x + Suc 1 * y)")
  42.174  oops
  42.175  
  42.176 -text {* Let's lift this to formulae and see what happens *}
  42.177 +text \<open>Let's lift this to formulae and see what happens\<close>
  42.178  
  42.179  datatype aform = Lt num num  | Eq num num | Ge num num | NEq num num | 
  42.180    Conj aform aform | Disj aform aform | NEG aform | T | F
  42.181 @@ -281,17 +281,17 @@
  42.182  | "is_aform (Conj p q) vs = (is_aform p vs \<and> is_aform q vs)"
  42.183  | "is_aform (Disj p q) vs = (is_aform p vs \<or> is_aform q vs)"
  42.184  
  42.185 -text{* Let's reify and do reflection *}
  42.186 +text\<open>Let's reify and do reflection\<close>
  42.187  lemma "(3::nat) * x + t < 0 \<and> (2 * x + y \<noteq> 17)"
  42.188    apply (reify Inum_eqs' is_aform.simps) 
  42.189  oops
  42.190  
  42.191 -text {* Note that reification handles several interpretations at the same time*}
  42.192 +text \<open>Note that reification handles several interpretations at the same time\<close>
  42.193  lemma "(3::nat) * x + t < 0 \<and> x * x + t * x + 3 + 1 = z * t * 4 * z \<or> x + x + 1 < 0"
  42.194    apply (reflection Inum_eqs' is_aform.simps only: "x + x + 1") 
  42.195  oops
  42.196  
  42.197 -text {* For reflection we now define a simple transformation on aform: NNF + linum on atoms *}
  42.198 +text \<open>For reflection we now define a simple transformation on aform: NNF + linum on atoms\<close>
  42.199  
  42.200  fun linaform:: "aform \<Rightarrow> aform"
  42.201  where
  42.202 @@ -327,9 +327,9 @@
  42.203    apply (reflection Inum_eqs' is_aform.simps)
  42.204  oops
  42.205  
  42.206 -text {* We now give an example where interpretaions have zero or more than only
  42.207 +text \<open>We now give an example where interpretaions have zero or more than only
  42.208    one envornement of different types and show that automatic reification also deals with
  42.209 -  bindings *}
  42.210 +  bindings\<close>
  42.211    
  42.212  datatype rb = BC bool | BAnd rb rb | BOr rb rb
  42.213  
  42.214 @@ -449,7 +449,7 @@
  42.215    apply (reify Irifm.simps Irnat_simps Irlist.simps Irint_simps)
  42.216  oops
  42.217  
  42.218 -text {* An example for equations containing type variables *}
  42.219 +text \<open>An example for equations containing type variables\<close>
  42.220  
  42.221  datatype prod = Zero | One | Var nat | Mul prod prod 
  42.222    | Pw prod nat | PNM nat nat prod
    43.1 --- a/src/HOL/ex/Refute_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    43.2 +++ b/src/HOL/ex/Refute_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    43.3 @@ -5,7 +5,7 @@
    43.4  See HOL/Refute.thy for help.
    43.5  *)
    43.6  
    43.7 -section {* Examples for the 'refute' command *}
    43.8 +section \<open>Examples for the 'refute' command\<close>
    43.9  
   43.10  theory Refute_Examples
   43.11  imports "~~/src/HOL/Library/Refute"
   43.12 @@ -15,20 +15,20 @@
   43.13  
   43.14  lemma "P \<and> Q"
   43.15  apply (rule conjI)
   43.16 -refute [expect = genuine] 1  -- {* refutes @{term "P"} *}
   43.17 -refute [expect = genuine] 2  -- {* refutes @{term "Q"} *}
   43.18 -refute [expect = genuine]    -- {* equivalent to 'refute 1' *}
   43.19 -  -- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *}
   43.20 -refute [maxsize = 5, expect = genuine]   -- {* we can override parameters ... *}
   43.21 +refute [expect = genuine] 1  -- \<open>refutes @{term "P"}\<close>
   43.22 +refute [expect = genuine] 2  -- \<open>refutes @{term "Q"}\<close>
   43.23 +refute [expect = genuine]    -- \<open>equivalent to 'refute 1'\<close>
   43.24 +  -- \<open>here 'refute 3' would cause an exception, since we only have 2 subgoals\<close>
   43.25 +refute [maxsize = 5, expect = genuine]   -- \<open>we can override parameters ...\<close>
   43.26  refute [satsolver = "cdclite", expect = genuine] 2
   43.27 -  -- {* ... and specify a subgoal at the same time *}
   43.28 +  -- \<open>... and specify a subgoal at the same time\<close>
   43.29  oops
   43.30  
   43.31  (*****************************************************************************)
   43.32  
   43.33 -subsection {* Examples and Test Cases *}
   43.34 +subsection \<open>Examples and Test Cases\<close>
   43.35  
   43.36 -subsubsection {* Propositional logic *}
   43.37 +subsubsection \<open>Propositional logic\<close>
   43.38  
   43.39  lemma "True"
   43.40  refute [expect = none]
   43.41 @@ -68,7 +68,7 @@
   43.42  
   43.43  (*****************************************************************************)
   43.44  
   43.45 -subsubsection {* Predicate logic *}
   43.46 +subsubsection \<open>Predicate logic\<close>
   43.47  
   43.48  lemma "P x y z"
   43.49  refute [expect = genuine]
   43.50 @@ -84,7 +84,7 @@
   43.51  
   43.52  (*****************************************************************************)
   43.53  
   43.54 -subsubsection {* Equality *}
   43.55 +subsubsection \<open>Equality\<close>
   43.56  
   43.57  lemma "P = True"
   43.58  refute [expect = genuine]
   43.59 @@ -118,7 +118,7 @@
   43.60  
   43.61  (*****************************************************************************)
   43.62  
   43.63 -subsubsection {* First-Order Logic *}
   43.64 +subsubsection \<open>First-Order Logic\<close>
   43.65  
   43.66  lemma "\<exists>x. P x"
   43.67  refute [expect = genuine]
   43.68 @@ -156,13 +156,13 @@
   43.69  refute [expect = genuine]
   43.70  oops
   43.71  
   43.72 -text {* A true statement (also testing names of free and bound variables being identical) *}
   43.73 +text \<open>A true statement (also testing names of free and bound variables being identical)\<close>
   43.74  
   43.75  lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x"
   43.76  refute [maxsize = 4, expect = none]
   43.77  by fast
   43.78  
   43.79 -text {* "A type has at most 4 elements." *}
   43.80 +text \<open>"A type has at most 4 elements."\<close>
   43.81  
   43.82  lemma "a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e"
   43.83  refute [expect = genuine]
   43.84 @@ -172,37 +172,37 @@
   43.85  refute [expect = genuine]
   43.86  oops
   43.87  
   43.88 -text {* "Every reflexive and symmetric relation is transitive." *}
   43.89 +text \<open>"Every reflexive and symmetric relation is transitive."\<close>
   43.90  
   43.91  lemma "\<lbrakk> \<forall>x. P x x; \<forall>x y. P x y \<longrightarrow> P y x \<rbrakk> \<Longrightarrow> P x y \<longrightarrow> P y z \<longrightarrow> P x z"
   43.92  refute [expect = genuine]
   43.93  oops
   43.94  
   43.95 -text {* The "Drinker's theorem" ... *}
   43.96 +text \<open>The "Drinker's theorem" ...\<close>
   43.97  
   43.98  lemma "\<exists>x. f x = g x \<longrightarrow> f = g"
   43.99  refute [maxsize = 4, expect = none]
  43.100  by (auto simp add: ext)
  43.101  
  43.102 -text {* ... and an incorrect version of it *}
  43.103 +text \<open>... and an incorrect version of it\<close>
  43.104  
  43.105  lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g"
  43.106  refute [expect = genuine]
  43.107  oops
  43.108  
  43.109 -text {* "Every function has a fixed point." *}
  43.110 +text \<open>"Every function has a fixed point."\<close>
  43.111  
  43.112  lemma "\<exists>x. f x = x"
  43.113  refute [expect = genuine]
  43.114  oops
  43.115  
  43.116 -text {* "Function composition is commutative." *}
  43.117 +text \<open>"Function composition is commutative."\<close>
  43.118  
  43.119  lemma "f (g x) = g (f x)"
  43.120  refute [expect = genuine]
  43.121  oops
  43.122  
  43.123 -text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *}
  43.124 +text \<open>"Two functions that are equivalent wrt.\ the same predicate 'P' are equal."\<close>
  43.125  
  43.126  lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)"
  43.127  refute [expect = genuine]
  43.128 @@ -210,7 +210,7 @@
  43.129  
  43.130  (*****************************************************************************)
  43.131  
  43.132 -subsubsection {* Higher-Order Logic *}
  43.133 +subsubsection \<open>Higher-Order Logic\<close>
  43.134  
  43.135  lemma "\<exists>P. P"
  43.136  refute [expect = none]
  43.137 @@ -244,7 +244,7 @@
  43.138  refute [expect = genuine]
  43.139  oops
  43.140  
  43.141 -text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *}
  43.142 +text \<open>"The transitive closure 'T' of an arbitrary relation 'P' is non-empty."\<close>
  43.143  
  43.144  definition "trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
  43.145    "trans P == (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)"
  43.146 @@ -259,32 +259,32 @@
  43.147  refute [expect = genuine]
  43.148  oops
  43.149  
  43.150 -text {* "Every surjective function is invertible." *}
  43.151 +text \<open>"Every surjective function is invertible."\<close>
  43.152  
  43.153  lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)"
  43.154  refute [expect = genuine]
  43.155  oops
  43.156  
  43.157 -text {* "Every invertible function is surjective." *}
  43.158 +text \<open>"Every invertible function is surjective."\<close>
  43.159  
  43.160  lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)"
  43.161  refute [expect = genuine]
  43.162  oops
  43.163  
  43.164 -text {* Every point is a fixed point of some function. *}
  43.165 +text \<open>Every point is a fixed point of some function.\<close>
  43.166  
  43.167  lemma "\<exists>f. f x = x"
  43.168  refute [maxsize = 4, expect = none]
  43.169  apply (rule_tac x="\<lambda>x. x" in exI)
  43.170  by simp
  43.171  
  43.172 -text {* Axiom of Choice: first an incorrect version ... *}
  43.173 +text \<open>Axiom of Choice: first an incorrect version ...\<close>
  43.174  
  43.175  lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))"
  43.176  refute [expect = genuine]
  43.177  oops
  43.178  
  43.179 -text {* ... and now two correct ones *}
  43.180 +text \<open>... and now two correct ones\<close>
  43.181  
  43.182  lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))"
  43.183  refute [maxsize = 4, expect = none]
  43.184 @@ -298,7 +298,7 @@
  43.185  
  43.186  (*****************************************************************************)
  43.187  
  43.188 -subsubsection {* Meta-logic *}
  43.189 +subsubsection \<open>Meta-logic\<close>
  43.190  
  43.191  lemma "!!x. P x"
  43.192  refute [expect = genuine]
  43.193 @@ -330,7 +330,7 @@
  43.194  
  43.195  (*****************************************************************************)
  43.196  
  43.197 -subsubsection {* Schematic variables *}
  43.198 +subsubsection \<open>Schematic variables\<close>
  43.199  
  43.200  schematic_goal "?P"
  43.201  refute [expect = none]
  43.202 @@ -342,7 +342,7 @@
  43.203  
  43.204  (******************************************************************************)
  43.205  
  43.206 -subsubsection {* Abstractions *}
  43.207 +subsubsection \<open>Abstractions\<close>
  43.208  
  43.209  lemma "(\<lambda>x. x) = (\<lambda>x. y)"
  43.210  refute [expect = genuine]
  43.211 @@ -358,7 +358,7 @@
  43.212  
  43.213  (*****************************************************************************)
  43.214  
  43.215 -subsubsection {* Sets *}
  43.216 +subsubsection \<open>Sets\<close>
  43.217  
  43.218  lemma "P (A::'a set)"
  43.219  refute
  43.220 @@ -402,7 +402,7 @@
  43.221  
  43.222  (*****************************************************************************)
  43.223  
  43.224 -subsubsection {* undefined *}
  43.225 +subsubsection \<open>undefined\<close>
  43.226  
  43.227  lemma "undefined"
  43.228  refute [expect = genuine]
  43.229 @@ -422,7 +422,7 @@
  43.230  
  43.231  (*****************************************************************************)
  43.232  
  43.233 -subsubsection {* The *}
  43.234 +subsubsection \<open>The\<close>
  43.235  
  43.236  lemma "The P"
  43.237  refute [expect = genuine]
  43.238 @@ -446,7 +446,7 @@
  43.239  
  43.240  (*****************************************************************************)
  43.241  
  43.242 -subsubsection {* Eps *}
  43.243 +subsubsection \<open>Eps\<close>
  43.244  
  43.245  lemma "Eps P"
  43.246  refute [expect = genuine]
  43.247 @@ -470,9 +470,9 @@
  43.248  
  43.249  (*****************************************************************************)
  43.250  
  43.251 -subsubsection {* Subtypes (typedef), typedecl *}
  43.252 +subsubsection \<open>Subtypes (typedef), typedecl\<close>
  43.253  
  43.254 -text {* A completely unspecified non-empty subset of @{typ "'a"}: *}
  43.255 +text \<open>A completely unspecified non-empty subset of @{typ "'a"}:\<close>
  43.256  
  43.257  definition "myTdef = insert (undefined::'a) (undefined::'a set)"
  43.258  
  43.259 @@ -496,9 +496,9 @@
  43.260  
  43.261  (*****************************************************************************)
  43.262  
  43.263 -subsubsection {* Inductive datatypes *}
  43.264 +subsubsection \<open>Inductive datatypes\<close>
  43.265  
  43.266 -text {* unit *}
  43.267 +text \<open>unit\<close>
  43.268  
  43.269  lemma "P (x::unit)"
  43.270  refute [expect = genuine]
  43.271 @@ -516,7 +516,7 @@
  43.272  refute [expect = genuine]
  43.273  oops
  43.274  
  43.275 -text {* option *}
  43.276 +text \<open>option\<close>
  43.277  
  43.278  lemma "P (x::'a option)"
  43.279  refute [expect = genuine]
  43.280 @@ -538,7 +538,7 @@
  43.281  refute [expect = genuine]
  43.282  oops
  43.283  
  43.284 -text {* * *}
  43.285 +text \<open>*\<close>
  43.286  
  43.287  lemma "P (x::'a*'b)"
  43.288  refute [expect = genuine]
  43.289 @@ -568,7 +568,7 @@
  43.290  refute [expect = genuine]
  43.291  oops
  43.292  
  43.293 -text {* + *}
  43.294 +text \<open>+\<close>
  43.295  
  43.296  lemma "P (x::'a+'b)"
  43.297  refute [expect = genuine]
  43.298 @@ -594,7 +594,7 @@
  43.299  refute [expect = genuine]
  43.300  oops
  43.301  
  43.302 -text {* Non-recursive datatypes *}
  43.303 +text \<open>Non-recursive datatypes\<close>
  43.304  
  43.305  datatype T1 = A | B
  43.306  
  43.307 @@ -686,9 +686,9 @@
  43.308  refute [expect = genuine]
  43.309  oops
  43.310  
  43.311 -text {* Recursive datatypes *}
  43.312 +text \<open>Recursive datatypes\<close>
  43.313  
  43.314 -text {* nat *}
  43.315 +text \<open>nat\<close>
  43.316  
  43.317  lemma "P (x::nat)"
  43.318  refute [expect = potential]
  43.319 @@ -704,9 +704,9 @@
  43.320  
  43.321  lemma "P Suc"
  43.322  refute [maxsize = 3, expect = none]
  43.323 --- {* @{term Suc} is a partial function (regardless of the size
  43.324 +-- \<open>@{term Suc} is a partial function (regardless of the size
  43.325        of the model), hence @{term "P Suc"} is undefined and no
  43.326 -      model will be found *}
  43.327 +      model will be found\<close>
  43.328  oops
  43.329  
  43.330  lemma "rec_nat zero suc 0 = zero"
  43.331 @@ -725,7 +725,7 @@
  43.332  refute [expect = potential]
  43.333  oops
  43.334  
  43.335 -text {* 'a list *}
  43.336 +text \<open>'a list\<close>
  43.337  
  43.338  lemma "P (xs::'a list)"
  43.339  refute [expect = potential]
  43.340 @@ -795,14 +795,14 @@
  43.341  
  43.342  (*****************************************************************************)
  43.343  
  43.344 -subsubsection {* Examples involving special functions *}
  43.345 +subsubsection \<open>Examples involving special functions\<close>
  43.346  
  43.347  lemma "card x = 0"
  43.348  refute [expect = potential]
  43.349  oops
  43.350  
  43.351  lemma "finite x"
  43.352 -refute -- {* no finite countermodel exists *}
  43.353 +refute -- \<open>no finite countermodel exists\<close>
  43.354  oops
  43.355  
  43.356  lemma "(x::nat) + y = 0"
  43.357 @@ -835,9 +835,9 @@
  43.358  
  43.359  (*****************************************************************************)
  43.360  
  43.361 -subsubsection {* Type classes and overloading *}
  43.362 +subsubsection \<open>Type classes and overloading\<close>
  43.363  
  43.364 -text {* A type class without axioms: *}
  43.365 +text \<open>A type class without axioms:\<close>
  43.366  
  43.367  class classA
  43.368  
  43.369 @@ -845,7 +845,7 @@
  43.370  refute [expect = genuine]
  43.371  oops
  43.372  
  43.373 -text {* An axiom with a type variable (denoting types which have at least two elements): *}
  43.374 +text \<open>An axiom with a type variable (denoting types which have at least two elements):\<close>
  43.375  
  43.376  class classC =
  43.377    assumes classC_ax: "\<exists>x y. x \<noteq> y"
  43.378 @@ -858,7 +858,7 @@
  43.379  (* refute [expect = none] FIXME *)
  43.380  oops
  43.381  
  43.382 -text {* A type class for which a constant is defined: *}
  43.383 +text \<open>A type class for which a constant is defined:\<close>
  43.384  
  43.385  class classD =
  43.386    fixes classD_const :: "'a \<Rightarrow> 'a"
  43.387 @@ -868,7 +868,7 @@
  43.388  refute [expect = genuine]
  43.389  oops
  43.390  
  43.391 -text {* A type class with multiple superclasses: *}
  43.392 +text \<open>A type class with multiple superclasses:\<close>
  43.393  
  43.394  class classE = classC + classD
  43.395  
  43.396 @@ -876,7 +876,7 @@
  43.397  refute [expect = genuine]
  43.398  oops
  43.399  
  43.400 -text {* OFCLASS: *}
  43.401 +text \<open>OFCLASS:\<close>
  43.402  
  43.403  lemma "OFCLASS('a::type, type_class)"
  43.404  refute [expect = none]
  43.405 @@ -890,7 +890,7 @@
  43.406  refute [expect = genuine]
  43.407  oops
  43.408  
  43.409 -text {* Overloading: *}
  43.410 +text \<open>Overloading:\<close>
  43.411  
  43.412  consts inverse :: "'a \<Rightarrow> 'a"
  43.413  
  43.414 @@ -911,7 +911,7 @@
  43.415  refute [expect = genuine]
  43.416  oops
  43.417  
  43.418 -text {* Structured proofs *}
  43.419 +text \<open>Structured proofs\<close>
  43.420  
  43.421  lemma "x = y"
  43.422  proof cases
    44.1 --- a/src/HOL/ex/SAT_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    44.2 +++ b/src/HOL/ex/SAT_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    44.3 @@ -3,7 +3,7 @@
    44.4      Copyright   2005-2009
    44.5  *)
    44.6  
    44.7 -section {* Examples for proof methods "sat" and "satx" *}
    44.8 +section \<open>Examples for proof methods "sat" and "satx"\<close>
    44.9  
   44.10  theory SAT_Examples
   44.11  imports Main
   44.12 @@ -74,7 +74,7 @@
   44.13  ~(c | (~p & (p | (q & ~q)))) |] ==> False"
   44.14  by satx
   44.15  
   44.16 -text {* eta-Equivalence *}
   44.17 +text \<open>eta-Equivalence\<close>
   44.18  
   44.19  lemma "(ALL x. P x) | ~ All P"
   44.20  by sat
   44.21 @@ -82,9 +82,9 @@
   44.22  declare [[sat_trace = false]]
   44.23  declare [[quick_and_dirty = false]]
   44.24  
   44.25 -method_setup rawsat = {*
   44.26 +method_setup rawsat = \<open>
   44.27    Scan.succeed (SIMPLE_METHOD' o SAT.rawsat_tac)
   44.28 -*} "SAT solver (no preprocessing)"
   44.29 +\<close> "SAT solver (no preprocessing)"
   44.30  
   44.31  (* Translated from TPTP problem library: PUZ015-2.006.dimacs *)
   44.32  
   44.33 @@ -277,7 +277,7 @@
   44.34  (*
   44.35  by sat
   44.36  *)
   44.37 -by rawsat  -- {* this is without CNF conversion *}
   44.38 +by rawsat  -- \<open>this is without CNF conversion\<close>
   44.39  
   44.40  (* Translated from TPTP problem library: MSC007-1.008.dimacs *)
   44.41  
   44.42 @@ -490,7 +490,7 @@
   44.43  (*
   44.44  by sat
   44.45  *)
   44.46 -by rawsat  -- {* this is without CNF conversion *}
   44.47 +by rawsat  -- \<open>this is without CNF conversion\<close>
   44.48  
   44.49  (* Old sequent clause representation ("[c_i, p, ~q, \<dots>] \<turnstile> False"):
   44.50     sat, zchaff_with_proofs: 8705 resolution steps in
   44.51 @@ -512,21 +512,21 @@
   44.52     (as of 2006-08-30, on a 2.5 GHz Pentium 4)
   44.53  *)
   44.54  
   44.55 -text {*
   44.56 +text \<open>
   44.57  Function {\tt benchmark} takes the name of an existing DIMACS CNF
   44.58  file, parses this file, passes the problem to a SAT solver, and checks
   44.59  the proof of unsatisfiability found by the solver.  The function
   44.60  measures the time spent on proof reconstruction (at least real time
   44.61  also includes time spent in the SAT solver), and additionally returns
   44.62  the number of resolution steps in the proof.
   44.63 -*}
   44.64 +\<close>
   44.65  
   44.66  (*
   44.67  declare [[sat_solver = zchaff_with_proofs]]
   44.68  declare [[sat_trace = false]]
   44.69  declare [[quick_and_dirty = false]]
   44.70  *)
   44.71 -ML {*
   44.72 +ML \<open>
   44.73    fun benchmark dimacsfile =
   44.74      let
   44.75        val prop_fm = SAT_Solver.read_dimacs_cnf_file (Path.explode dimacsfile)
   44.76 @@ -540,6 +540,6 @@
   44.77      in
   44.78        (Timing.result start, ! SAT.counter)
   44.79      end;
   44.80 -*}
   44.81 +\<close>
   44.82  
   44.83  end
    45.1 --- a/src/HOL/ex/Serbian.thy	Tue Oct 06 17:46:07 2015 +0200
    45.2 +++ b/src/HOL/ex/Serbian.thy	Tue Oct 06 17:47:28 2015 +0200
    45.3 @@ -4,13 +4,13 @@
    45.4  Conversion between Serbian cyrillic and latin letters (српска ћирилица и латиница)
    45.5  *)
    45.6  
    45.7 -section {* A Serbian theory *}
    45.8 +section \<open>A Serbian theory\<close>
    45.9  
   45.10  theory Serbian
   45.11  imports Main
   45.12  begin
   45.13  
   45.14 -text{* Serbian cyrillic letters *}
   45.15 +text\<open>Serbian cyrillic letters\<close>
   45.16  datatype azbuka =
   45.17    azbA   ("А")
   45.18  | azbB   ("Б")
   45.19 @@ -46,7 +46,7 @@
   45.20  
   45.21  thm azbuka.induct
   45.22  
   45.23 -text{* Serbian latin letters *}
   45.24 +text\<open>Serbian latin letters\<close>
   45.25  datatype abeceda =
   45.26    abcA   ("A")
   45.27  | abcB   ("B")
   45.28 @@ -79,8 +79,8 @@
   45.29  thm abeceda.induct
   45.30  
   45.31  
   45.32 -text{* Conversion from cyrillic to latin - 
   45.33 -       this conversion is valid in all cases *}
   45.34 +text\<open>Conversion from cyrillic to latin - 
   45.35 +       this conversion is valid in all cases\<close>
   45.36  primrec azb2abc_aux :: "azbuka \<Rightarrow> abeceda list"
   45.37  where
   45.38    "azb2abc_aux А = [A]"
   45.39 @@ -123,8 +123,8 @@
   45.40  value "azb2abc [Д, О, Б, А, Р, azbSpc, Д, А, Н, azbSpc, С, В, И, М, А]"
   45.41  value "azb2abc [Љ, У, Б, И, Ч, И, Ц, А, azbSpc, Н, А, azbSpc, П, О, Љ, У]"
   45.42  
   45.43 -text{* The conversion from latin to cyrillic - 
   45.44 -       this conversion is valid in most cases but there are some exceptions *}
   45.45 +text\<open>The conversion from latin to cyrillic - 
   45.46 +       this conversion is valid in most cases but there are some exceptions\<close>
   45.47  primrec abc2azb_aux :: "abeceda \<Rightarrow> azbuka"
   45.48  where
   45.49     "abc2azb_aux A = А"
   45.50 @@ -175,18 +175,18 @@
   45.51  value "abc2azb [D, O, B, A, R, abcSpc, D, A, N, abcSpc, S, V, I, M, A]"
   45.52  value "abc2azb [L, J, U, B, I, Č, I, C, A, abcSpc, N, A, abcSpc, P, O, L, J, U]"
   45.53  
   45.54 -text{* Here are some invalid conversions *}
   45.55 +text\<open>Here are some invalid conversions\<close>
   45.56  lemma "abc2azb [N, A, D, Ž, I, V, E, T, I] = [Н, А, Џ, И, В, Е, Т, И]"
   45.57    by simp
   45.58 -text{* but it should be: НАДЖИВЕТИ *}
   45.59 +text\<open>but it should be: НАДЖИВЕТИ\<close>
   45.60  lemma "abc2azb [I, N, J, E, K, C, I, J, A] = [И, Њ, Е, К, Ц, И, Ј, А]"
   45.61    by simp
   45.62 -text{* but it should be: ИНЈЕКЦИЈА *}
   45.63 +text\<open>but it should be: ИНЈЕКЦИЈА\<close>
   45.64  
   45.65 -text{* The conversion fails for all cyrrilic words that contain НЈ ЛЈ ДЈ ДЖ *}
   45.66 +text\<open>The conversion fails for all cyrrilic words that contain НЈ ЛЈ ДЈ ДЖ\<close>
   45.67  
   45.68  
   45.69 -text{* Idempotency in one direction *}
   45.70 +text\<open>Idempotency in one direction\<close>
   45.71  lemma [simp]: "azb2abc_aux (abc2azb_aux x) = [x]"
   45.72    by (cases x) auto
   45.73  
   45.74 @@ -203,14 +203,14 @@
   45.75    proof (cases xs)
   45.76      case (Cons x2 xss)
   45.77      thus ?thesis
   45.78 -      using `azb2abc (abc2azb xs) = xs`
   45.79 +      using \<open>azb2abc (abc2azb xs) = xs\<close>
   45.80        by auto
   45.81    qed simp
   45.82  qed simp
   45.83  
   45.84 -text{* Idempotency in the other direction does not hold *}
   45.85 +text\<open>Idempotency in the other direction does not hold\<close>
   45.86  lemma "abc2azb (azb2abc [И, Н, Ј, Е, К, Ц, И, Ј, А]) \<noteq> [И, Н, Ј, Е, К, Ц, И, Ј, А]"
   45.87    by simp
   45.88 -text{* It fails for all cyrrilic words that contain НЈ ЛЈ ДЈ ДЖ *}
   45.89 +text\<open>It fails for all cyrrilic words that contain НЈ ЛЈ ДЈ ДЖ\<close>
   45.90  
   45.91  end
    46.1 --- a/src/HOL/ex/Set_Comprehension_Pointfree_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    46.2 +++ b/src/HOL/ex/Set_Comprehension_Pointfree_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    46.3 @@ -3,7 +3,7 @@
    46.4      Copyright   2012 TU Muenchen
    46.5  *)
    46.6  
    46.7 -section {* Examples for the set comprehension to pointfree simproc *}
    46.8 +section \<open>Examples for the set comprehension to pointfree simproc\<close>
    46.9  
   46.10  theory Set_Comprehension_Pointfree_Examples
   46.11  imports Main
   46.12 @@ -119,7 +119,7 @@
   46.13  declare [[simproc del: finite_Collect]]
   46.14  
   46.15  
   46.16 -section {* Testing simproc in code generation *}
   46.17 +section \<open>Testing simproc in code generation\<close>
   46.18  
   46.19  definition union :: "nat set => nat set => nat set"
   46.20  where
    47.1 --- a/src/HOL/ex/Set_Theory.thy	Tue Oct 06 17:46:07 2015 +0200
    47.2 +++ b/src/HOL/ex/Set_Theory.thy	Tue Oct 06 17:47:28 2015 +0200
    47.3 @@ -3,17 +3,17 @@
    47.4      Copyright   1991  University of Cambridge
    47.5  *)
    47.6  
    47.7 -section {* Set Theory examples: Cantor's Theorem, Schröder-Bernstein Theorem, etc. *}
    47.8 +section \<open>Set Theory examples: Cantor's Theorem, Schröder-Bernstein Theorem, etc.\<close>
    47.9  
   47.10  theory Set_Theory
   47.11  imports Main
   47.12  begin
   47.13  
   47.14 -text{*
   47.15 +text\<open>
   47.16    These two are cited in Benzmueller and Kohlhase's system description
   47.17    of LEO, CADE-15, 1998 (pages 139-143) as theorems LEO could not
   47.18    prove.
   47.19 -*}
   47.20 +\<close>
   47.21  
   47.22  lemma "(X = Y \<union> Z) =
   47.23      (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<forall>V. Y \<subseteq> V \<and> Z \<subseteq> V \<longrightarrow> X \<subseteq> V))"
   47.24 @@ -23,22 +23,22 @@
   47.25      (X \<subseteq> Y \<and> X \<subseteq> Z \<and> (\<forall>V. V \<subseteq> Y \<and> V \<subseteq> Z \<longrightarrow> V \<subseteq> X))"
   47.26    by blast
   47.27  
   47.28 -text {*
   47.29 +text \<open>
   47.30    Trivial example of term synthesis: apparently hard for some provers!
   47.31 -*}
   47.32 +\<close>
   47.33  
   47.34  schematic_goal "a \<noteq> b \<Longrightarrow> a \<in> ?X \<and> b \<notin> ?X"
   47.35    by blast
   47.36  
   47.37  
   47.38 -subsection {* Examples for the @{text blast} paper *}
   47.39 +subsection \<open>Examples for the @{text blast} paper\<close>
   47.40  
   47.41  lemma "(\<Union>x \<in> C. f x \<union> g x) = \<Union>(f ` C)  \<union>  \<Union>(g ` C)"
   47.42 -  -- {* Union-image, called @{text Un_Union_image} in Main HOL *}
   47.43 +  -- \<open>Union-image, called @{text Un_Union_image} in Main HOL\<close>
   47.44    by blast
   47.45  
   47.46  lemma "(\<Inter>x \<in> C. f x \<inter> g x) = \<Inter>(f ` C) \<inter> \<Inter>(g ` C)"
   47.47 -  -- {* Inter-image, called @{text Int_Inter_image} in Main HOL *}
   47.48 +  -- \<open>Inter-image, called @{text Int_Inter_image} in Main HOL\<close>
   47.49    by blast
   47.50  
   47.51  lemma singleton_example_1:
   47.52 @@ -47,34 +47,34 @@
   47.53  
   47.54  lemma singleton_example_2:
   47.55       "\<forall>x \<in> S. \<Union>S \<subseteq> x \<Longrightarrow> \<exists>z. S \<subseteq> {z}"
   47.56 -  -- {*Variant of the problem above. *}
   47.57 +  -- \<open>Variant of the problem above.\<close>
   47.58    by blast
   47.59  
   47.60  lemma "\<exists>!x. f (g x) = x \<Longrightarrow> \<exists>!y. g (f y) = y"
   47.61 -  -- {* A unique fixpoint theorem --- @{text fast}/@{text best}/@{text meson} all fail. *}
   47.62 +  -- \<open>A unique fixpoint theorem --- @{text fast}/@{text best}/@{text meson} all fail.\<close>
   47.63    by metis
   47.64  
   47.65  
   47.66 -subsection {* Cantor's Theorem: There is no surjection from a set to its powerset *}
   47.67 +subsection \<open>Cantor's Theorem: There is no surjection from a set to its powerset\<close>
   47.68  
   47.69  lemma cantor1: "\<not> (\<exists>f:: 'a \<Rightarrow> 'a set. \<forall>S. \<exists>x. f x = S)"
   47.70 -  -- {* Requires best-first search because it is undirectional. *}
   47.71 +  -- \<open>Requires best-first search because it is undirectional.\<close>
   47.72    by best
   47.73  
   47.74  schematic_goal "\<forall>f:: 'a \<Rightarrow> 'a set. \<forall>x. f x \<noteq> ?S f"
   47.75 -  -- {*This form displays the diagonal term. *}
   47.76 +  -- \<open>This form displays the diagonal term.\<close>
   47.77    by best
   47.78  
   47.79  schematic_goal "?S \<notin> range (f :: 'a \<Rightarrow> 'a set)"
   47.80 -  -- {* This form exploits the set constructs. *}
   47.81 +  -- \<open>This form exploits the set constructs.\<close>
   47.82    by (rule notI, erule rangeE, best)
   47.83  
   47.84  schematic_goal "?S \<notin> range (f :: 'a \<Rightarrow> 'a set)"
   47.85 -  -- {* Or just this! *}
   47.86 +  -- \<open>Or just this!\<close>
   47.87    by best
   47.88  
   47.89  
   47.90 -subsection {* The Schröder-Berstein Theorem *}
   47.91 +subsection \<open>The Schröder-Berstein Theorem\<close>
   47.92  
   47.93  lemma disj_lemma: "- (f ` X) = g ` (-X) \<Longrightarrow> f a = g b \<Longrightarrow> a \<in> X \<Longrightarrow> b \<in> X"
   47.94    by blast
   47.95 @@ -102,7 +102,7 @@
   47.96      \<Longrightarrow> \<exists>h:: 'a \<Rightarrow> 'b. inj h \<and> surj h"
   47.97    apply (rule decomposition [where f=f and g=g, THEN exE])
   47.98    apply (rule_tac x = "(\<lambda>z. if z \<in> x then f z else inv g z)" in exI) 
   47.99 -    --{*The term above can be synthesized by a sufficiently detailed proof.*}
  47.100 +    --\<open>The term above can be synthesized by a sufficiently detailed proof.\<close>
  47.101    apply (rule bij_if_then_else)
  47.102       apply (rule_tac [4] refl)
  47.103      apply (rule_tac [2] inj_on_inv_into)
  47.104 @@ -112,13 +112,13 @@
  47.105    done
  47.106  
  47.107  
  47.108 -subsection {* A simple party theorem *}
  47.109 +subsection \<open>A simple party theorem\<close>
  47.110  
  47.111 -text{* \emph{At any party there are two people who know the same
  47.112 +text\<open>\emph{At any party there are two people who know the same
  47.113  number of people}. Provided the party consists of at least two people
  47.114  and the knows relation is symmetric. Knowing yourself does not count
  47.115  --- otherwise knows needs to be reflexive. (From Freek Wiedijk's talk
  47.116 -at TPHOLs 2007.) *}
  47.117 +at TPHOLs 2007.)\<close>
  47.118  
  47.119  lemma equal_number_of_acquaintances:
  47.120  assumes "Domain R <= A" and "sym R" and "card A \<ge> 2"
  47.121 @@ -126,99 +126,99 @@
  47.122  proof -
  47.123    let ?N = "%a. card(R `` {a} - {a})"
  47.124    let ?n = "card A"
  47.125 -  have "finite A" using `card A \<ge> 2` by(auto intro:ccontr)
  47.126 -  have 0: "R `` A <= A" using `sym R` `Domain R <= A`
  47.127 +  have "finite A" using \<open>card A \<ge> 2\<close> by(auto intro:ccontr)
  47.128 +  have 0: "R `` A <= A" using \<open>sym R\<close> \<open>Domain R <= A\<close>
  47.129      unfolding Domain_unfold sym_def by blast
  47.130    have h: "ALL a:A. R `` {a} <= A" using 0 by blast
  47.131 -  hence 1: "ALL a:A. finite(R `` {a})" using `finite A`
  47.132 +  hence 1: "ALL a:A. finite(R `` {a})" using \<open>finite A\<close>
  47.133      by(blast intro: finite_subset)
  47.134    have sub: "?N ` A <= {0..<?n}"
  47.135    proof -
  47.136      have "ALL a:A. R `` {a} - {a} < A" using h by blast
  47.137 -    thus ?thesis using psubset_card_mono[OF `finite A`] by auto
  47.138 +    thus ?thesis using psubset_card_mono[OF \<open>finite A\<close>] by auto
  47.139    qed
  47.140    show "~ inj_on ?N A" (is "~ ?I")
  47.141    proof
  47.142      assume ?I
  47.143      hence "?n = card(?N ` A)" by(rule card_image[symmetric])
  47.144 -    with sub `finite A` have 2[simp]: "?N ` A = {0..<?n}"
  47.145 +    with sub \<open>finite A\<close> have 2[simp]: "?N ` A = {0..<?n}"
  47.146        using subset_card_intvl_is_intvl[of _ 0] by(auto)
  47.147 -    have "0 : ?N ` A" and "?n - 1 : ?N ` A"  using `card A \<ge> 2` by simp+
  47.148 +    have "0 : ?N ` A" and "?n - 1 : ?N ` A"  using \<open>card A \<ge> 2\<close> by simp+
  47.149      then obtain a b where ab: "a:A" "b:A" and Na: "?N a = 0" and Nb: "?N b = ?n - 1"
  47.150        by (auto simp del: 2)
  47.151 -    have "a \<noteq> b" using Na Nb `card A \<ge> 2` by auto
  47.152 +    have "a \<noteq> b" using Na Nb \<open>card A \<ge> 2\<close> by auto
  47.153      have "R `` {a} - {a} = {}" by (metis 1 Na ab card_eq_0_iff finite_Diff)
  47.154 -    hence "b \<notin> R `` {a}" using `a\<noteq>b` by blast
  47.155 +    hence "b \<notin> R `` {a}" using \<open>a\<noteq>b\<close> by blast
  47.156      hence "a \<notin> R `` {b}" by (metis Image_singleton_iff assms(2) sym_def)
  47.157      hence 3: "R `` {b} - {b} <= A - {a,b}" using 0 ab by blast
  47.158 -    have 4: "finite (A - {a,b})" using `finite A` by simp
  47.159 -    have "?N b <= ?n - 2" using ab `a\<noteq>b` `finite A` card_mono[OF 4 3] by simp
  47.160 -    then show False using Nb `card A \<ge>  2` by arith
  47.161 +    have 4: "finite (A - {a,b})" using \<open>finite A\<close> by simp
  47.162 +    have "?N b <= ?n - 2" using ab \<open>a\<noteq>b\<close> \<open>finite A\<close> card_mono[OF 4 3] by simp
  47.163 +    then show False using Nb \<open>card A \<ge>  2\<close> by arith
  47.164    qed
  47.165  qed
  47.166  
  47.167 -text {*
  47.168 +text \<open>
  47.169    From W. W. Bledsoe and Guohui Feng, SET-VAR. JAR 11 (3), 1993, pages
  47.170    293-314.
  47.171  
  47.172    Isabelle can prove the easy examples without any special mechanisms,
  47.173    but it can't prove the hard ones.
  47.174 -*}
  47.175 +\<close>
  47.176  
  47.177  lemma "\<exists>A. (\<forall>x \<in> A. x \<le> (0::int))"
  47.178 -  -- {* Example 1, page 295. *}
  47.179 +  -- \<open>Example 1, page 295.\<close>
  47.180    by force
  47.181  
  47.182  lemma "D \<in> F \<Longrightarrow> \<exists>G. \<forall>A \<in> G. \<exists>B \<in> F. A \<subseteq> B"
  47.183 -  -- {* Example 2. *}
  47.184 +  -- \<open>Example 2.\<close>
  47.185    by force
  47.186  
  47.187  lemma "P a \<Longrightarrow> \<exists>A. (\<forall>x \<in> A. P x) \<and> (\<exists>y. y \<in> A)"
  47.188 -  -- {* Example 3. *}
  47.189 +  -- \<open>Example 3.\<close>
  47.190    by force
  47.191  
  47.192  lemma "a < b \<and> b < (c::int) \<Longrightarrow> \<exists>A. a \<notin> A \<and> b \<in> A \<and> c \<notin> A"
  47.193 -  -- {* Example 4. *}
  47.194 -  by auto --{*slow*}
  47.195 +  -- \<open>Example 4.\<close>
  47.196 +  by auto --\<open>slow\<close>
  47.197  
  47.198  lemma "P (f b) \<Longrightarrow> \<exists>s A. (\<forall>x \<in> A. P x) \<and> f s \<in> A"
  47.199 -  -- {*Example 5, page 298. *}
  47.200 +  -- \<open>Example 5, page 298.\<close>
  47.201    by force
  47.202  
  47.203  lemma "P (f b) \<Longrightarrow> \<exists>s A. (\<forall>x \<in> A. P x) \<and> f s \<in> A"
  47.204 -  -- {* Example 6. *}
  47.205 +  -- \<open>Example 6.\<close>
  47.206    by force
  47.207  
  47.208  lemma "\<exists>A. a \<notin> A"
  47.209 -  -- {* Example 7. *}
  47.210 +  -- \<open>Example 7.\<close>
  47.211    by force
  47.212  
  47.213  lemma "(\<forall>u v. u < (0::int) \<longrightarrow> u \<noteq> abs v)
  47.214      \<longrightarrow> (\<exists>A::int set. -2 \<in> A & (\<forall>y. abs y \<notin> A))"
  47.215 -  -- {* Example 8 needs a small hint. *}
  47.216 +  -- \<open>Example 8 needs a small hint.\<close>
  47.217    by force
  47.218 -    -- {* not @{text blast}, which can't simplify @{text "-2 < 0"} *}
  47.219 +    -- \<open>not @{text blast}, which can't simplify @{text "-2 < 0"}\<close>
  47.220  
  47.221 -text {* Example 9 omitted (requires the reals). *}
  47.222 +text \<open>Example 9 omitted (requires the reals).\<close>
  47.223  
  47.224 -text {* The paper has no Example 10! *}
  47.225 +text \<open>The paper has no Example 10!\<close>
  47.226  
  47.227  lemma "(\<forall>A. 0 \<in> A \<and> (\<forall>x \<in> A. Suc x \<in> A) \<longrightarrow> n \<in> A) \<and>
  47.228    P 0 \<and> (\<forall>x. P x \<longrightarrow> P (Suc x)) \<longrightarrow> P n"
  47.229 -  -- {* Example 11: needs a hint. *}
  47.230 +  -- \<open>Example 11: needs a hint.\<close>
  47.231  by(metis nat.induct)
  47.232  
  47.233  lemma
  47.234    "(\<forall>A. (0, 0) \<in> A \<and> (\<forall>x y. (x, y) \<in> A \<longrightarrow> (Suc x, Suc y) \<in> A) \<longrightarrow> (n, m) \<in> A)
  47.235      \<and> P n \<longrightarrow> P m"
  47.236 -  -- {* Example 12. *}
  47.237 +  -- \<open>Example 12.\<close>
  47.238    by auto
  47.239  
  47.240  lemma
  47.241    "(\<forall>x. (\<exists>u. x = 2 * u) = (\<not> (\<exists>v. Suc x = 2 * v))) \<longrightarrow>
  47.242      (\<exists>A. \<forall>x. (x \<in> A) = (Suc x \<notin> A))"
  47.243 -  -- {* Example EO1: typo in article, and with the obvious fix it seems
  47.244 -      to require arithmetic reasoning. *}
  47.245 +  -- \<open>Example EO1: typo in article, and with the obvious fix it seems
  47.246 +      to require arithmetic reasoning.\<close>
  47.247    apply clarify
  47.248    apply (rule_tac x = "{x. \<exists>u. x = 2 * u}" in exI, auto)
  47.249     apply metis+
    48.1 --- a/src/HOL/ex/Simproc_Tests.thy	Tue Oct 06 17:46:07 2015 +0200
    48.2 +++ b/src/HOL/ex/Simproc_Tests.thy	Tue Oct 06 17:47:28 2015 +0200
    48.3 @@ -2,64 +2,64 @@
    48.4      Author:     Brian Huffman
    48.5  *)
    48.6  
    48.7 -section {* Testing of arithmetic simprocs *}
    48.8 +section \<open>Testing of arithmetic simprocs\<close>
    48.9  
   48.10  theory Simproc_Tests
   48.11  imports Main
   48.12  begin
   48.13  
   48.14 -text {*
   48.15 +text \<open>
   48.16    This theory tests the various simprocs defined in @{file
   48.17    "~~/src/HOL/Nat.thy"} and @{file "~~/src/HOL/Numeral_Simprocs.thy"}.
   48.18    Many of the tests are derived from commented-out code originally
   48.19    found in @{file "~~/src/HOL/Tools/numeral_simprocs.ML"}.
   48.20 -*}
   48.21 +\<close>
   48.22  
   48.23 -subsection {* ML bindings *}
   48.24 +subsection \<open>ML bindings\<close>
   48.25  
   48.26 -ML {*
   48.27 +ML \<open>
   48.28    fun test ctxt ps =
   48.29      CHANGED (asm_simp_tac (put_simpset HOL_basic_ss ctxt addsimprocs ps) 1)
   48.30 -*}
   48.31 +\<close>
   48.32  
   48.33 -subsection {* Cancellation simprocs from @{text Nat.thy} *}
   48.34 +subsection \<open>Cancellation simprocs from @{text Nat.thy}\<close>
   48.35  
   48.36  notepad begin
   48.37    fix a b c d :: nat
   48.38    {
   48.39      assume "b = Suc c" have "a + b = Suc (c + a)"
   48.40 -      by (tactic {* test @{context} [@{simproc nateq_cancel_sums}] *}) fact
   48.41 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_sums}]\<close>) fact
   48.42    next
   48.43      assume "b < Suc c" have "a + b < Suc (c + a)"
   48.44 -      by (tactic {* test @{context} [@{simproc natless_cancel_sums}] *}) fact
   48.45 +      by (tactic \<open>test @{context} [@{simproc natless_cancel_sums}]\<close>) fact
   48.46    next
   48.47      assume "b \<le> Suc c" have "a + b \<le> Suc (c + a)"
   48.48 -      by (tactic {* test @{context} [@{simproc natle_cancel_sums}] *}) fact
   48.49 +      by (tactic \<open>test @{context} [@{simproc natle_cancel_sums}]\<close>) fact
   48.50    next
   48.51      assume "b - Suc c = d" have "a + b - Suc (c + a) = d"
   48.52 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_sums}] *}) fact
   48.53 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_sums}]\<close>) fact
   48.54    }
   48.55  end
   48.56  
   48.57  schematic_goal "\<And>(y::?'b::size). size (?x::?'a::size) \<le> size y + size ?x"
   48.58 -  by (tactic {* test @{context} [@{simproc natle_cancel_sums}] *}) (rule le0)
   48.59 +  by (tactic \<open>test @{context} [@{simproc natle_cancel_sums}]\<close>) (rule le0)
   48.60  (* TODO: test more simprocs with schematic variables *)
   48.61  
   48.62 -subsection {* Abelian group cancellation simprocs *}
   48.63 +subsection \<open>Abelian group cancellation simprocs\<close>
   48.64  
   48.65  notepad begin
   48.66    fix a b c u :: "'a::ab_group_add"
   48.67    {
   48.68      assume "(a + 0) - (b + 0) = u" have "(a + c) - (b + c) = u"
   48.69 -      by (tactic {* test @{context} [@{simproc group_cancel_diff}] *}) fact
   48.70 +      by (tactic \<open>test @{context} [@{simproc group_cancel_diff}]\<close>) fact
   48.71    next
   48.72      assume "a + 0 = b + 0" have "a + c = b + c"
   48.73 -      by (tactic {* test @{context} [@{simproc group_cancel_eq}] *}) fact
   48.74 +      by (tactic \<open>test @{context} [@{simproc group_cancel_eq}]\<close>) fact
   48.75    }
   48.76  end
   48.77  (* TODO: more tests for Groups.group_cancel_{add,diff,eq,less,le} *)
   48.78  
   48.79 -subsection {* @{text int_combine_numerals} *}
   48.80 +subsection \<open>@{text int_combine_numerals}\<close>
   48.81  
   48.82  (* FIXME: int_combine_numerals often unnecessarily regroups addition
   48.83  and rewrites subtraction to negation. Ideally it should behave more
   48.84 @@ -70,305 +70,305 @@
   48.85    fix a b c d oo uu i j k l u v w x y z :: "'a::comm_ring_1"
   48.86    {
   48.87      assume "a + - b = u" have "(a + c) - (b + c) = u"
   48.88 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
   48.89 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
   48.90    next
   48.91      assume "10 + (2 * l + oo) = uu"
   48.92      have "l + 2 + 2 + 2 + (l + 2) + (oo + 2) = uu"
   48.93 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
   48.94 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
   48.95    next
   48.96      assume "-3 + (i + (j + k)) = y"
   48.97      have "(i + j + 12 + k) - 15 = y"
   48.98 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
   48.99 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.100    next
  48.101      assume "7 + (i + (j + k)) = y"
  48.102      have "(i + j + 12 + k) - 5 = y"
  48.103 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.104 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.105    next
  48.106      assume "-4 * (u * v) + (2 * x + y) = w"
  48.107      have "(2*x - (u*v) + y) - v*3*u = w"
  48.108 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.109 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.110    next
  48.111      assume "2 * x * u * v + y = w"
  48.112      have "(2*x*u*v + (u*v)*4 + y) - v*u*4 = w"
  48.113 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.114 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.115    next
  48.116      assume "3 * (u * v) + (2 * x * u * v + y) = w"
  48.117      have "(2*x*u*v + (u*v)*4 + y) - v*u = w"
  48.118 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.119 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.120    next
  48.121      assume "-3 * (u * v) + (- (x * u * v) + - y) = w"
  48.122      have "u*v - (x*u*v + (u*v)*4 + y) = w"
  48.123 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.124 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.125    next
  48.126      assume "a + - c = d"
  48.127      have "a + -(b+c) + b = d"
  48.128        apply (simp only: minus_add_distrib)
  48.129 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.130 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.131    next
  48.132      assume "-2 * b + (a + - c) = d"
  48.133      have "a + -(b+c) - b = d"
  48.134        apply (simp only: minus_add_distrib)
  48.135 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.136 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.137    next
  48.138      assume "-7 + (i + (j + (k + (- u + - y)))) = z"
  48.139      have "(i + j + -2 + k) - (u + 5 + y) = z"
  48.140 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.141 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.142    next
  48.143      assume "-27 + (i + (j + k)) = y"
  48.144      have "(i + j + -12 + k) - 15 = y"
  48.145 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.146 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.147    next
  48.148      assume "27 + (i + (j + k)) = y"
  48.149      have "(i + j + 12 + k) - -15 = y"
  48.150 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.151 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.152    next
  48.153      assume "3 + (i + (j + k)) = y"
  48.154      have "(i + j + -12 + k) - -15 = y"
  48.155 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}] *}) fact
  48.156 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}]\<close>) fact
  48.157    }
  48.158  end
  48.159  
  48.160 -subsection {* @{text inteq_cancel_numerals} *}
  48.161 +subsection \<open>@{text inteq_cancel_numerals}\<close>
  48.162  
  48.163  notepad begin
  48.164    fix i j k u vv w y z w' y' z' :: "'a::comm_ring_1"
  48.165    {
  48.166      assume "u = 0" have "2*u = u"
  48.167 -      by (tactic {* test @{context} [@{simproc inteq_cancel_numerals}] *}) fact
  48.168 +      by (tactic \<open>test @{context} [@{simproc inteq_cancel_numerals}]\<close>) fact
  48.169  (* conclusion matches Rings.ring_1_no_zero_divisors_class.mult_cancel_right2 *)
  48.170    next
  48.171      assume "i + (j + k) = 3 + (u + y)"
  48.172      have "(i + j + 12 + k) = u + 15 + y"
  48.173 -      by (tactic {* test @{context} [@{simproc inteq_cancel_numerals}] *}) fact
  48.174 +      by (tactic \<open>test @{context} [@{simproc inteq_cancel_numerals}]\<close>) fact
  48.175    next
  48.176      assume "7 + (j + (i + k)) = y"
  48.177      have "(i + j*2 + 12 + k) = j + 5 + y"
  48.178 -      by (tactic {* test @{context} [@{simproc inteq_cancel_numerals}] *}) fact
  48.179 +      by (tactic \<open>test @{context} [@{simproc inteq_cancel_numerals}]\<close>) fact
  48.180    next
  48.181      assume "u + (6*z + (4*y + 6*w)) = 6*z' + (4*y' + (6*w' + vv))"
  48.182      have "2*y + 3*z + 6*w + 2*y + 3*z + 2*u = 2*y' + 3*z' + 6*w' + 2*y' + 3*z' + u + vv"
  48.183 -      by (tactic {* test @{context} [@{simproc int_combine_numerals}, @{simproc inteq_cancel_numerals}] *}) fact
  48.184 +      by (tactic \<open>test @{context} [@{simproc int_combine_numerals}, @{simproc inteq_cancel_numerals}]\<close>) fact
  48.185    }
  48.186  end
  48.187  
  48.188 -subsection {* @{text intless_cancel_numerals} *}
  48.189 +subsection \<open>@{text intless_cancel_numerals}\<close>
  48.190  
  48.191  notepad begin
  48.192    fix b c i j k u y :: "'a::linordered_idom"
  48.193    {
  48.194      assume "y < 2 * b" have "y - b < b"
  48.195 -      by (tactic {* test @{context} [@{simproc intless_cancel_numerals}] *}) fact
  48.196 +      by (tactic \<open>test @{context} [@{simproc intless_cancel_numerals}]\<close>) fact
  48.197    next
  48.198      assume "c + y < 4 * b" have "y - (3*b + c) < b - 2*c"
  48.199 -      by (tactic {* test @{context} [@{simproc intless_cancel_numerals}] *}) fact
  48.200 +      by (tactic \<open>test @{context} [@{simproc intless_cancel_numerals}]\<close>) fact
  48.201    next
  48.202      assume "i + (j + k) < 8 + (u + y)"
  48.203      have "(i + j + -3 + k) < u + 5 + y"
  48.204 -      by (tactic {* test @{context} [@{simproc intless_cancel_numerals}] *}) fact
  48.205 +      by (tactic \<open>test @{context} [@{simproc intless_cancel_numerals}]\<close>) fact
  48.206    next
  48.207      assume "9 + (i + (j + k)) < u + y"
  48.208      have "(i + j + 3 + k) < u + -6 + y"
  48.209 -      by (tactic {* test @{context} [@{simproc intless_cancel_numerals}] *}) fact
  48.210 +      by (tactic \<open>test @{context} [@{simproc intless_cancel_numerals}]\<close>) fact
  48.211    }
  48.212  end
  48.213  
  48.214 -subsection {* @{text ring_eq_cancel_numeral_factor} *}
  48.215 +subsection \<open>@{text ring_eq_cancel_numeral_factor}\<close>
  48.216  
  48.217  notepad begin
  48.218    fix x y :: "'a::{idom,ring_char_0}"
  48.219    {
  48.220      assume "3*x = 4*y" have "9*x = 12 * y"
  48.221 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_numeral_factor}] *}) fact
  48.222 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_numeral_factor}]\<close>) fact
  48.223    next
  48.224      assume "-3*x = 4*y" have "-99*x = 132 * y"
  48.225 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_numeral_factor}] *}) fact
  48.226 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_numeral_factor}]\<close>) fact
  48.227    next
  48.228      assume "111*x = -44*y" have "999*x = -396 * y"
  48.229 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_numeral_factor}] *}) fact
  48.230 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_numeral_factor}]\<close>) fact
  48.231    next
  48.232      assume "11*x = 9*y" have "-99*x = -81 * y"
  48.233 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_numeral_factor}] *}) fact
  48.234 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_numeral_factor}]\<close>) fact
  48.235    next
  48.236      assume "2*x = y" have "-2 * x = -1 * y"
  48.237 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_numeral_factor}] *}) fact
  48.238 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_numeral_factor}]\<close>) fact
  48.239    next
  48.240      assume "2*x = y" have "-2 * x = -y"
  48.241 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_numeral_factor}] *}) fact
  48.242 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_numeral_factor}]\<close>) fact
  48.243    }
  48.244  end
  48.245  
  48.246 -subsection {* @{text int_div_cancel_numeral_factors} *}
  48.247 +subsection \<open>@{text int_div_cancel_numeral_factors}\<close>
  48.248  
  48.249  notepad begin
  48.250    fix x y z :: "'a::{semiring_div,comm_ring_1,ring_char_0}"
  48.251    {
  48.252      assume "(3*x) div (4*y) = z" have "(9*x) div (12*y) = z"
  48.253 -      by (tactic {* test @{context} [@{simproc int_div_cancel_numeral_factors}] *}) fact
  48.254 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_numeral_factors}]\<close>) fact
  48.255    next
  48.256      assume "(-3*x) div (4*y) = z" have "(-99*x) div (132*y) = z"
  48.257 -      by (tactic {* test @{context} [@{simproc int_div_cancel_numeral_factors}] *}) fact
  48.258 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_numeral_factors}]\<close>) fact
  48.259    next
  48.260      assume "(111*x) div (-44*y) = z" have "(999*x) div (-396*y) = z"
  48.261 -      by (tactic {* test @{context} [@{simproc int_div_cancel_numeral_factors}] *}) fact
  48.262 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_numeral_factors}]\<close>) fact
  48.263    next
  48.264      assume "(11*x) div (9*y) = z" have "(-99*x) div (-81*y) = z"
  48.265 -      by (tactic {* test @{context} [@{simproc int_div_cancel_numeral_factors}] *}) fact
  48.266 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_numeral_factors}]\<close>) fact
  48.267    next
  48.268      assume "(2*x) div y = z"
  48.269      have "(-2 * x) div (-1 * y) = z"
  48.270 -      by (tactic {* test @{context} [@{simproc int_div_cancel_numeral_factors}] *}) fact
  48.271 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_numeral_factors}]\<close>) fact
  48.272    }
  48.273  end
  48.274  
  48.275 -subsection {* @{text ring_less_cancel_numeral_factor} *}
  48.276 +subsection \<open>@{text ring_less_cancel_numeral_factor}\<close>
  48.277  
  48.278  notepad begin
  48.279    fix x y :: "'a::linordered_idom"
  48.280    {
  48.281      assume "3*x < 4*y" have "9*x < 12 * y"
  48.282 -      by (tactic {* test @{context} [@{simproc ring_less_cancel_numeral_factor}] *}) fact
  48.283 +      by (tactic \<open>test @{context} [@{simproc ring_less_cancel_numeral_factor}]\<close>) fact
  48.284    next
  48.285      assume "-3*x < 4*y" have "-99*x < 132 * y"
  48.286 -      by (tactic {* test @{context} [@{simproc ring_less_cancel_numeral_factor}] *}) fact
  48.287 +      by (tactic \<open>test @{context} [@{simproc ring_less_cancel_numeral_factor}]\<close>) fact
  48.288    next
  48.289      assume "111*x < -44*y" have "999*x < -396 * y"
  48.290 -      by (tactic {* test @{context} [@{simproc ring_less_cancel_numeral_factor}] *}) fact
  48.291 +      by (tactic \<open>test @{context} [@{simproc ring_less_cancel_numeral_factor}]\<close>) fact
  48.292    next
  48.293      assume "9*y < 11*x" have "-99*x < -81 * y"
  48.294 -      by (tactic {* test @{context} [@{simproc ring_less_cancel_numeral_factor}] *}) fact
  48.295 +      by (tactic \<open>test @{context} [@{simproc ring_less_cancel_numeral_factor}]\<close>) fact
  48.296    next
  48.297      assume "y < 2*x" have "-2 * x < -y"
  48.298 -      by (tactic {* test @{context} [@{simproc ring_less_cancel_numeral_factor}] *}) fact
  48.299 +      by (tactic \<open>test @{context} [@{simproc ring_less_cancel_numeral_factor}]\<close>) fact
  48.300    next
  48.301      assume "23*y < x" have "-x < -23 * y"
  48.302 -      by (tactic {* test @{context} [@{simproc ring_less_cancel_numeral_factor}] *}) fact
  48.303 +      by (tactic \<open>test @{context} [@{simproc ring_less_cancel_numeral_factor}]\<close>) fact
  48.304    }
  48.305  end
  48.306  
  48.307 -subsection {* @{text ring_le_cancel_numeral_factor} *}
  48.308 +subsection \<open>@{text ring_le_cancel_numeral_factor}\<close>
  48.309  
  48.310  notepad begin
  48.311    fix x y :: "'a::linordered_idom"
  48.312    {
  48.313      assume "3*x \<le> 4*y" have "9*x \<le> 12 * y"
  48.314 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.315 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.316    next
  48.317      assume "-3*x \<le> 4*y" have "-99*x \<le> 132 * y"
  48.318 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.319 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.320    next
  48.321      assume "111*x \<le> -44*y" have "999*x \<le> -396 * y"
  48.322 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.323 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.324    next
  48.325      assume "9*y \<le> 11*x" have "-99*x \<le> -81 * y"
  48.326 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.327 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.328    next
  48.329      assume "y \<le> 2*x" have "-2 * x \<le> -1 * y"
  48.330 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.331 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.332    next
  48.333      assume "23*y \<le> x" have "-x \<le> -23 * y"
  48.334 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.335 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.336    next
  48.337      assume "y \<le> 0" have "0 \<le> y * -2"
  48.338 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.339 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.340    next
  48.341      assume "- x \<le> y" have "- (2 * x) \<le> 2*y"
  48.342 -      by (tactic {* test @{context} [@{simproc ring_le_cancel_numeral_factor}] *}) fact
  48.343 +      by (tactic \<open>test @{context} [@{simproc ring_le_cancel_numeral_factor}]\<close>) fact
  48.344    }
  48.345  end
  48.346  
  48.347 -subsection {* @{text divide_cancel_numeral_factor} *}
  48.348 +subsection \<open>@{text divide_cancel_numeral_factor}\<close>
  48.349  
  48.350  notepad begin
  48.351    fix x y z :: "'a::{field,ring_char_0}"
  48.352    {
  48.353      assume "(3*x) / (4*y) = z" have "(9*x) / (12 * y) = z"
  48.354 -      by (tactic {* test @{context} [@{simproc divide_cancel_numeral_factor}] *}) fact
  48.355 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_numeral_factor}]\<close>) fact
  48.356    next
  48.357      assume "(-3*x) / (4*y) = z" have "(-99*x) / (132 * y) = z"
  48.358 -      by (tactic {* test @{context} [@{simproc divide_cancel_numeral_factor}] *}) fact
  48.359 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_numeral_factor}]\<close>) fact
  48.360    next
  48.361      assume "(111*x) / (-44*y) = z" have "(999*x) / (-396 * y) = z"
  48.362 -      by (tactic {* test @{context} [@{simproc divide_cancel_numeral_factor}] *}) fact
  48.363 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_numeral_factor}]\<close>) fact
  48.364    next
  48.365      assume "(11*x) / (9*y) = z" have "(-99*x) / (-81 * y) = z"
  48.366 -      by (tactic {* test @{context} [@{simproc divide_cancel_numeral_factor}] *}) fact
  48.367 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_numeral_factor}]\<close>) fact
  48.368    next
  48.369      assume "(2*x) / y = z" have "(-2 * x) / (-1 * y) = z"
  48.370 -      by (tactic {* test @{context} [@{simproc divide_cancel_numeral_factor}] *}) fact
  48.371 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_numeral_factor}]\<close>) fact
  48.372    }
  48.373  end
  48.374  
  48.375 -subsection {* @{text ring_eq_cancel_factor} *}
  48.376 +subsection \<open>@{text ring_eq_cancel_factor}\<close>
  48.377  
  48.378  notepad begin
  48.379    fix a b c d k x y :: "'a::idom"
  48.380    {
  48.381      assume "k = 0 \<or> x = y" have "x*k = k*y"
  48.382 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_factor}] *}) fact
  48.383 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_factor}]\<close>) fact
  48.384    next
  48.385      assume "k = 0 \<or> 1 = y" have "k = k*y"
  48.386 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_factor}] *}) fact
  48.387 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_factor}]\<close>) fact
  48.388    next
  48.389      assume "b = 0 \<or> a*c = 1" have "a*(b*c) = b"
  48.390 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_factor}] *}) fact
  48.391 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_factor}]\<close>) fact
  48.392    next
  48.393      assume "a = 0 \<or> b = 0 \<or> c = d*x" have "a*(b*c) = d*b*(x*a)"
  48.394 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_factor}] *}) fact
  48.395 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_factor}]\<close>) fact
  48.396    next
  48.397      assume "k = 0 \<or> x = y" have "x*k = k*y"
  48.398 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_factor}] *}) fact
  48.399 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_factor}]\<close>) fact
  48.400    next
  48.401      assume "k = 0 \<or> 1 = y" have "k = k*y"
  48.402 -      by (tactic {* test @{context} [@{simproc ring_eq_cancel_factor}] *}) fact
  48.403 +      by (tactic \<open>test @{context} [@{simproc ring_eq_cancel_factor}]\<close>) fact
  48.404    }
  48.405  end
  48.406  
  48.407 -subsection {* @{text int_div_cancel_factor} *}
  48.408 +subsection \<open>@{text int_div_cancel_factor}\<close>
  48.409  
  48.410  notepad begin
  48.411    fix a b c d k uu x y :: "'a::semiring_div"
  48.412    {
  48.413      assume "(if k = 0 then 0 else x div y) = uu"
  48.414      have "(x*k) div (k*y) = uu"
  48.415 -      by (tactic {* test @{context} [@{simproc int_div_cancel_factor}] *}) fact
  48.416 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_factor}]\<close>) fact
  48.417    next
  48.418      assume "(if k = 0 then 0 else 1 div y) = uu"
  48.419      have "(k) div (k*y) = uu"
  48.420 -      by (tactic {* test @{context} [@{simproc int_div_cancel_factor}] *}) fact
  48.421 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_factor}]\<close>) fact
  48.422    next
  48.423      assume "(if b = 0 then 0 else a * c) = uu"
  48.424      have "(a*(b*c)) div b = uu"
  48.425 -      by (tactic {* test @{context} [@{simproc int_div_cancel_factor}] *}) fact
  48.426 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_factor}]\<close>) fact
  48.427    next
  48.428      assume "(if a = 0 then 0 else if b = 0 then 0 else c div (d * x)) = uu"
  48.429      have "(a*(b*c)) div (d*b*(x*a)) = uu"
  48.430 -      by (tactic {* test @{context} [@{simproc int_div_cancel_factor}] *}) fact
  48.431 +      by (tactic \<open>test @{context} [@{simproc int_div_cancel_factor}]\<close>) fact
  48.432    }
  48.433  end
  48.434  
  48.435  lemma shows "a*(b*c)/(y*z) = d*(b::'a::linordered_field)*(x*a)/z"
  48.436  oops -- "FIXME: need simproc to cover this case"
  48.437  
  48.438 -subsection {* @{text divide_cancel_factor} *}
  48.439 +subsection \<open>@{text divide_cancel_factor}\<close>
  48.440  
  48.441  notepad begin
  48.442    fix a b c d k uu x y :: "'a::field"
  48.443    {
  48.444      assume "(if k = 0 then 0 else x / y) = uu"
  48.445      have "(x*k) / (k*y) = uu"
  48.446 -      by (tactic {* test @{context} [@{simproc divide_cancel_factor}] *}) fact
  48.447 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_factor}]\<close>) fact
  48.448    next
  48.449      assume "(if k = 0 then 0 else 1 / y) = uu"
  48.450      have "(k) / (k*y) = uu"
  48.451 -      by (tactic {* test @{context} [@{simproc divide_cancel_factor}] *}) fact
  48.452 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_factor}]\<close>) fact
  48.453    next
  48.454      assume "(if b = 0 then 0 else a * c / 1) = uu"
  48.455      have "(a*(b*c)) / b = uu"
  48.456 -      by (tactic {* test @{context} [@{simproc divide_cancel_factor}] *}) fact
  48.457 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_factor}]\<close>) fact
  48.458    next
  48.459      assume "(if a = 0 then 0 else if b = 0 then 0 else c / (d * x)) = uu"
  48.460      have "(a*(b*c)) / (d*b*(x*a)) = uu"
  48.461 -      by (tactic {* test @{context} [@{simproc divide_cancel_factor}] *}) fact
  48.462 +      by (tactic \<open>test @{context} [@{simproc divide_cancel_factor}]\<close>) fact
  48.463    }
  48.464  end
  48.465  
  48.466 @@ -377,173 +377,173 @@
  48.467    shows "a*(b*c)/(y*z) = d*(b)*(x*a)/z"
  48.468  oops -- "FIXME: need simproc to cover this case"
  48.469  
  48.470 -subsection {* @{text linordered_ring_less_cancel_factor} *}
  48.471 +subsection \<open>@{text linordered_ring_less_cancel_factor}\<close>
  48.472  
  48.473  notepad begin
  48.474    fix x y z :: "'a::linordered_idom"
  48.475    {
  48.476      assume "0 < z \<Longrightarrow> x < y" have "0 < z \<Longrightarrow> x*z < y*z"
  48.477 -      by (tactic {* test @{context} [@{simproc linordered_ring_less_cancel_factor}] *}) fact
  48.478 +      by (tactic \<open>test @{context} [@{simproc linordered_ring_less_cancel_factor}]\<close>) fact
  48.479    next
  48.480      assume "0 < z \<Longrightarrow> x < y" have "0 < z \<Longrightarrow> x*z < z*y"
  48.481 -      by (tactic {* test @{context} [@{simproc linordered_ring_less_cancel_factor}] *}) fact
  48.482 +      by (tactic \<open>test @{context} [@{simproc linordered_ring_less_cancel_factor}]\<close>) fact
  48.483    next
  48.484      assume "0 < z \<Longrightarrow> x < y" have "0 < z \<Longrightarrow> z*x < y*z"
  48.485 -      by (tactic {* test @{context} [@{simproc linordered_ring_less_cancel_factor}] *}) fact
  48.486 +      by (tactic \<open>test @{context} [@{simproc linordered_ring_less_cancel_factor}]\<close>) fact
  48.487    next
  48.488      assume "0 < z \<Longrightarrow> x < y" have "0 < z \<Longrightarrow> z*x < z*y"
  48.489 -      by (tactic {* test @{context} [@{simproc linordered_ring_less_cancel_factor}] *}) fact
  48.490 +      by (tactic \<open>test @{context} [@{simproc linordered_ring_less_cancel_factor}]\<close>) fact
  48.491    next
  48.492      txt "This simproc now uses the simplifier to prove that terms to
  48.493        be canceled are positive/negative."
  48.494      assume z_pos: "0 < z"
  48.495      assume "x < y" have "z*x < z*y"
  48.496 -      by (tactic {* CHANGED (asm_simp_tac (put_simpset HOL_basic_ss @{context}
  48.497 +      by (tactic \<open>CHANGED (asm_simp_tac (put_simpset HOL_basic_ss @{context}
  48.498          addsimprocs [@{simproc linordered_ring_less_cancel_factor}]
  48.499 -        addsimps [@{thm z_pos}]) 1) *}) fact
  48.500 +        addsimps [@{thm z_pos}]) 1)\<close>) fact
  48.501    }
  48.502  end
  48.503  
  48.504 -subsection {* @{text linordered_ring_le_cancel_factor} *}
  48.505 +subsection \<open>@{text linordered_ring_le_cancel_factor}\<close>
  48.506  
  48.507  notepad begin
  48.508    fix x y z :: "'a::linordered_idom"
  48.509    {
  48.510      assume "0 < z \<Longrightarrow> x \<le> y" have "0 < z \<Longrightarrow> x*z \<le> y*z"
  48.511 -      by (tactic {* test @{context} [@{simproc linordered_ring_le_cancel_factor}] *}) fact
  48.512 +      by (tactic \<open>test @{context} [@{simproc linordered_ring_le_cancel_factor}]\<close>) fact
  48.513    next
  48.514      assume "0 < z \<Longrightarrow> x \<le> y" have "0 < z \<Longrightarrow> z*x \<le> z*y"
  48.515 -      by (tactic {* test @{context} [@{simproc linordered_ring_le_cancel_factor}] *}) fact
  48.516 +      by (tactic \<open>test @{context} [@{simproc linordered_ring_le_cancel_factor}]\<close>) fact
  48.517    }
  48.518  end
  48.519  
  48.520 -subsection {* @{text field_combine_numerals} *}
  48.521 +subsection \<open>@{text field_combine_numerals}\<close>
  48.522  
  48.523  notepad begin
  48.524    fix x y z uu :: "'a::{field,ring_char_0}"
  48.525    {
  48.526      assume "5 / 6 * x = uu" have "x / 2 + x / 3 = uu"
  48.527 -      by (tactic {* test @{context} [@{simproc field_combine_numerals}] *}) fact
  48.528 +      by (tactic \<open>test @{context} [@{simproc field_combine_numerals}]\<close>) fact
  48.529    next
  48.530      assume "6 / 9 * x + y = uu" have "x / 3 + y + x / 3 = uu"
  48.531 -      by (tactic {* test @{context} [@{simproc field_combine_numerals}] *}) fact
  48.532 +      by (tactic \<open>test @{context} [@{simproc field_combine_numerals}]\<close>) fact
  48.533    next
  48.534      assume "9 / 9 * x = uu" have "2 * x / 3 + x / 3 = uu"
  48.535 -      by (tactic {* test @{context} [@{simproc field_combine_numerals}] *}) fact
  48.536 +      by (tactic \<open>test @{context} [@{simproc field_combine_numerals}]\<close>) fact
  48.537    next
  48.538      assume "y + z = uu"
  48.539      have "x / 2 + y - 3 * x / 6 + z = uu"
  48.540 -      by (tactic {* test @{context} [@{simproc field_combine_numerals}] *}) fact
  48.541 +      by (tactic \<open>test @{context} [@{simproc field_combine_numerals}]\<close>) fact
  48.542    next
  48.543      assume "1 / 15 * x + y = uu"
  48.544      have "7 * x / 5 + y - 4 * x / 3 = uu"
  48.545 -      by (tactic {* test @{context} [@{simproc field_combine_numerals}] *}) fact
  48.546 +      by (tactic \<open>test @{context} [@{simproc field_combine_numerals}]\<close>) fact
  48.547    }
  48.548  end
  48.549  
  48.550  lemma
  48.551    fixes x :: "'a::{linordered_field}"
  48.552    shows "2/3 * x + x / 3 = uu"
  48.553 -apply (tactic {* test @{context} [@{simproc field_combine_numerals}] *})?
  48.554 +apply (tactic \<open>test @{context} [@{simproc field_combine_numerals}]\<close>)?
  48.555  oops -- "FIXME: test fails"
  48.556  
  48.557 -subsection {* @{text nat_combine_numerals} *}
  48.558 +subsection \<open>@{text nat_combine_numerals}\<close>
  48.559  
  48.560  notepad begin
  48.561    fix i j k m n u :: nat
  48.562    {
  48.563      assume "4*k = u" have "k + 3*k = u"
  48.564 -      by (tactic {* test @{context} [@{simproc nat_combine_numerals}] *}) fact
  48.565 +      by (tactic \<open>test @{context} [@{simproc nat_combine_numerals}]\<close>) fact
  48.566    next
  48.567      (* FIXME "Suc (i + 3) \<equiv> i + 4" *)
  48.568      assume "4 * Suc 0 + i = u" have "Suc (i + 3) = u"
  48.569 -      by (tactic {* test @{context} [@{simproc nat_combine_numerals}] *}) fact
  48.570 +      by (tactic \<open>test @{context} [@{simproc nat_combine_numerals}]\<close>) fact
  48.571    next
  48.572      (* FIXME "Suc (i + j + 3 + k) \<equiv> i + j + 4 + k" *)
  48.573      assume "4 * Suc 0 + (i + (j + k)) = u" have "Suc (i + j + 3 + k) = u"
  48.574 -      by (tactic {* test @{context} [@{simproc nat_combine_numerals}] *}) fact
  48.575 +      by (tactic \<open>test @{context} [@{simproc nat_combine_numerals}]\<close>) fact
  48.576    next
  48.577      assume "2 * j + 4 * k = u" have "k + j + 3*k + j = u"
  48.578 -      by (tactic {* test @{context} [@{simproc nat_combine_numerals}] *}) fact
  48.579 +      by (tactic \<open>test @{context} [@{simproc nat_combine_numerals}]\<close>) fact
  48.580    next
  48.581      assume "6 * Suc 0 + (5 * (i * j) + (4 * k + i)) = u"
  48.582      have "Suc (j*i + i + k + 5 + 3*k + i*j*4) = u"
  48.583 -      by (tactic {* test @{context} [@{simproc nat_combine_numerals}] *}) fact
  48.584 +      by (tactic \<open>test @{context} [@{simproc nat_combine_numerals}]\<close>) fact
  48.585    next
  48.586      assume "5 * (m * n) = u" have "(2*n*m) + (3*(m*n)) = u"
  48.587 -      by (tactic {* test @{context} [@{simproc nat_combine_numerals}] *}) fact
  48.588 +      by (tactic \<open>test @{context} [@{simproc nat_combine_numerals}]\<close>) fact
  48.589    }
  48.590  end
  48.591  
  48.592 -subsection {* @{text nateq_cancel_numerals} *}
  48.593 +subsection \<open>@{text nateq_cancel_numerals}\<close>
  48.594  
  48.595  notepad begin
  48.596    fix i j k l oo u uu vv w y z w' y' z' :: "nat"
  48.597    {
  48.598      assume "Suc 0 * u = 0" have "2*u = (u::nat)"
  48.599 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.600 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.601    next
  48.602      assume "Suc 0 * u = Suc 0" have "2*u = Suc (u)"
  48.603 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.604 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.605    next
  48.606      assume "i + (j + k) = 3 * Suc 0 + (u + y)"
  48.607      have "(i + j + 12 + k) = u + 15 + y"
  48.608 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.609 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.610    next
  48.611      assume "7 * Suc 0 + (i + (j + k)) = u + y"
  48.612      have "(i + j + 12 + k) = u + 5 + y"
  48.613 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.614 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.615    next
  48.616      assume "11 * Suc 0 + (i + (j + k)) = u + y"
  48.617      have "(i + j + 12 + k) = Suc (u + y)"
  48.618 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.619 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.620    next
  48.621      assume "i + (j + k) = 2 * Suc 0 + (u + y)"
  48.622      have "(i + j + 5 + k) = Suc (Suc (Suc (Suc (Suc (Suc (Suc (u + y)))))))"
  48.623 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.624 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.625    next
  48.626      assume "Suc 0 * u + (2 * y + 3 * z) = Suc 0"
  48.627      have "2*y + 3*z + 2*u = Suc (u)"
  48.628 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.629 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.630    next
  48.631      assume "Suc 0 * u + (2 * y + (3 * z + (6 * w + (2 * y + 3 * z)))) = Suc 0"
  48.632      have "2*y + 3*z + 6*w + 2*y + 3*z + 2*u = Suc (u)"
  48.633 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.634 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.635    next
  48.636      assume "Suc 0 * u + (2 * y + (3 * z + (6 * w + (2 * y + 3 * z)))) =
  48.637        2 * y' + (3 * z' + (6 * w' + (2 * y' + (3 * z' + vv))))"
  48.638      have "2*y + 3*z + 6*w + 2*y + 3*z + 2*u =
  48.639        2*y' + 3*z' + 6*w' + 2*y' + 3*z' + u + vv"
  48.640 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.641 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.642    next
  48.643      assume "2 * u + (2 * z + (5 * Suc 0 + 2 * y)) = vv"
  48.644      have "6 + 2*y + 3*z + 4*u = Suc (vv + 2*u + z)"
  48.645 -      by (tactic {* test @{context} [@{simproc nateq_cancel_numerals}] *}) fact
  48.646 +      by (tactic \<open>test @{context} [@{simproc nateq_cancel_numerals}]\<close>) fact
  48.647    }
  48.648  end
  48.649  
  48.650 -subsection {* @{text natless_cancel_numerals} *}
  48.651 +subsection \<open>@{text natless_cancel_numerals}\<close>
  48.652  
  48.653  notepad begin
  48.654    fix length :: "'a \<Rightarrow> nat" and l1 l2 xs :: "'a" and f :: "nat \<Rightarrow> 'a"
  48.655    fix c i j k l m oo u uu vv w y z w' y' z' :: "nat"
  48.656    {
  48.657      assume "0 < j" have "(2*length xs < 2*length xs + j)"
  48.658 -      by (tactic {* test @{context} [@{simproc natless_cancel_numerals}] *}) fact
  48.659 +      by (tactic \<open>test @{context} [@{simproc natless_cancel_numerals}]\<close>) fact
  48.660    next
  48.661      assume "0 < j" have "(2*length xs < length xs * 2 + j)"
  48.662 -      by (tactic {* test @{context} [@{simproc natless_cancel_numerals}] *}) fact
  48.663 +      by (tactic \<open>test @{context} [@{simproc natless_cancel_numerals}]\<close>) fact
  48.664    next
  48.665      assume "i + (j + k) < u + y"
  48.666      have "(i + j + 5 + k) < Suc (Suc (Suc (Suc (Suc (u + y)))))"
  48.667 -      by (tactic {* test @{context} [@{simproc natless_cancel_numerals}] *}) fact
  48.668 +      by (tactic \<open>test @{context} [@{simproc natless_cancel_numerals}]\<close>) fact
  48.669    next
  48.670      assume "0 < Suc 0 * (m * n) + u" have "(2*n*m) < (3*(m*n)) + u"
  48.671 -      by (tactic {* test @{context} [@{simproc natless_cancel_numerals}] *}) fact
  48.672 +      by (tactic \<open>test @{context} [@{simproc natless_cancel_numerals}]\<close>) fact
  48.673    }
  48.674  end
  48.675  
  48.676 -subsection {* @{text natle_cancel_numerals} *}
  48.677 +subsection \<open>@{text natle_cancel_numerals}\<close>
  48.678  
  48.679  notepad begin
  48.680    fix length :: "'a \<Rightarrow> nat" and l2 l3 :: "'a" and f :: "nat \<Rightarrow> 'a"
  48.681 @@ -551,217 +551,217 @@
  48.682    {
  48.683      assume "u + y \<le> 36 * Suc 0 + (i + (j + k))"
  48.684      have "Suc (Suc (Suc (Suc (Suc (u + y))))) \<le> ((i + j) + 41 + k)"
  48.685 -      by (tactic {* test @{context} [@{simproc natle_cancel_numerals}] *}) fact
  48.686 +      by (tactic \<open>test @{context} [@{simproc natle_cancel_numerals}]\<close>) fact
  48.687    next
  48.688      assume "5 * Suc 0 + (case length (f c) of 0 \<Rightarrow> 0 | Suc k \<Rightarrow> k) = 0"
  48.689      have "(Suc (Suc (Suc (Suc (Suc (Suc (case length (f c) of 0 => 0 | Suc k => k)))))) \<le> Suc 0)"
  48.690 -      by (tactic {* test @{context} [@{simproc natle_cancel_numerals}] *}) fact
  48.691 +      by (tactic \<open>test @{context} [@{simproc natle_cancel_numerals}]\<close>) fact
  48.692    next
  48.693      assume "6 + length l2 = 0" have "Suc (Suc (Suc (Suc (Suc (Suc (length l1 + length l2)))))) \<le> length l1"
  48.694 -      by (tactic {* test @{context} [@{simproc natle_cancel_numerals}] *}) fact
  48.695 +      by (tactic \<open>test @{context} [@{simproc natle_cancel_numerals}]\<close>) fact
  48.696    next
  48.697      assume "5 + length l3 = 0"
  48.698      have "( (Suc (Suc (Suc (Suc (Suc (length (compT P E A ST mxr e) + length l3)))))) \<le> length (compT P E A ST mxr e))"
  48.699 -      by (tactic {* test @{context} [@{simproc natle_cancel_numerals}] *}) fact
  48.700 +      by (tactic \<open>test @{context} [@{simproc natle_cancel_numerals}]\<close>) fact
  48.701    next
  48.702      assume "5 + length (compT P E (A \<union> A' e) ST mxr c) = 0"
  48.703      have "( (Suc (Suc (Suc (Suc (Suc (length (compT P E A ST mxr e) + length (compT P E (A Un A' e) ST mxr c))))))) \<le> length (compT P E A ST mxr e))"
  48.704 -      by (tactic {* test @{context} [@{simproc natle_cancel_numerals}] *}) fact
  48.705 +      by (tactic \<open>test @{context} [@{simproc natle_cancel_numerals}]\<close>) fact
  48.706    }
  48.707  end
  48.708  
  48.709 -subsection {* @{text natdiff_cancel_numerals} *}
  48.710 +subsection \<open>@{text natdiff_cancel_numerals}\<close>
  48.711  
  48.712  notepad begin
  48.713    fix length :: "'a \<Rightarrow> nat" and l2 l3 :: "'a" and f :: "nat \<Rightarrow> 'a"
  48.714    fix c e i j k l oo u uu vv v w x y z zz w' y' z' :: "nat"
  48.715    {
  48.716      assume "i + (j + k) - 3 * Suc 0 = y" have "(i + j + 12 + k) - 15 = y"
  48.717 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.718 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.719    next
  48.720      assume "7 * Suc 0 + (i + (j + k)) - 0 = y" have "(i + j + 12 + k) - 5 = y"
  48.721 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.722 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.723    next
  48.724      assume "u - Suc 0 * Suc 0 = y" have "Suc u - 2 = y"
  48.725 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.726 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.727    next
  48.728      assume "Suc 0 * Suc 0 + u - 0 = y" have "Suc (Suc (Suc u)) - 2 = y"
  48.729 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.730 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.731    next
  48.732      assume "Suc 0 * Suc 0 + (i + (j + k)) - 0 = y"
  48.733      have "(i + j + 2 + k) - 1 = y"
  48.734 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.735 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.736    next
  48.737      assume "i + (j + k) - Suc 0 * Suc 0 = y"
  48.738      have "(i + j + 1 + k) - 2 = y"
  48.739 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.740 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.741    next
  48.742      assume "2 * x + y - 2 * (u * v) = w"
  48.743      have "(2*x + (u*v) + y) - v*3*u = w"
  48.744 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.745 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.746    next
  48.747      assume "2 * x * u * v + (5 + y) - 0 = w"
  48.748      have "(2*x*u*v + 5 + (u*v)*4 + y) - v*u*4 = w"
  48.749 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.750 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.751    next
  48.752      assume "3 * (u * v) + (2 * x * u * v + y) - 0 = w"
  48.753      have "(2*x*u*v + (u*v)*4 + y) - v*u = w"
  48.754 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.755 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.756    next
  48.757      assume "3 * u + (2 + (2 * x * u * v + y)) - 0 = w"
  48.758      have "Suc (Suc (2*x*u*v + u*4 + y)) - u = w"
  48.759 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.760 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.761    next
  48.762      assume "Suc (Suc 0 * (u * v)) - 0 = w"
  48.763      have "Suc ((u*v)*4) - v*3*u = w"
  48.764 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.765 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.766    next
  48.767      assume "2 - 0 = w" have "Suc (Suc ((u*v)*3)) - v*3*u = w"
  48.768 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.769 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.770    next
  48.771      assume "17 * Suc 0 + (i + (j + k)) - (u + y) = zz"
  48.772      have "(i + j + 32 + k) - (u + 15 + y) = zz"
  48.773 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.774 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.775    next
  48.776      assume "u + y - 0 = v" have "Suc (Suc (Suc (Suc (Suc (u + y))))) - 5 = v"
  48.777 -      by (tactic {* test @{context} [@{simproc natdiff_cancel_numerals}] *}) fact
  48.778 +      by (tactic \<open>test @{context} [@{simproc natdiff_cancel_numerals}]\<close>) fact
  48.779    }
  48.780  end
  48.781  
  48.782 -subsection {* Factor-cancellation simprocs for type @{typ nat} *}
  48.783 +subsection \<open>Factor-cancellation simprocs for type @{typ nat}\<close>
  48.784  
  48.785 -text {* @{text nat_eq_cancel_factor}, @{text nat_less_cancel_factor},
  48.786 +text \<open>@{text nat_eq_cancel_factor}, @{text nat_less_cancel_factor},
  48.787  @{text nat_le_cancel_factor}, @{text nat_divide_cancel_factor}, and
  48.788 -@{text nat_dvd_cancel_factor}. *}
  48.789 +@{text nat_dvd_cancel_factor}.\<close>
  48.790  
  48.791  notepad begin
  48.792    fix a b c d k x y uu :: nat
  48.793    {
  48.794      assume "k = 0 \<or> x = y" have "x*k = k*y"
  48.795 -      by (tactic {* test @{context} [@{simproc nat_eq_cancel_factor}] *}) fact
  48.796 +      by (tactic \<open>test @{context} [@{simproc nat_eq_cancel_factor}]\<close>) fact
  48.797    next
  48.798      assume "k = 0 \<or> Suc 0 = y" have "k = k*y"
  48.799 -      by (tactic {* test @{context} [@{simproc nat_eq_cancel_factor}] *}) fact
  48.800 +      by (tactic \<open>test @{context} [@{simproc nat_eq_cancel_factor}]\<close>) fact
  48.801    next
  48.802      assume "b = 0 \<or> a * c = Suc 0" have "a*(b*c) = b"
  48.803 -      by (tactic {* test @{context} [@{simproc nat_eq_cancel_factor}] *}) fact
  48.804 +      by (tactic \<open>test @{context} [@{simproc nat_eq_cancel_factor}]\<close>) fact
  48.805    next
  48.806      assume "a = 0 \<or> b = 0 \<or> c = d * x" have "a*(b*c) = d*b*(x*a)"
  48.807 -      by (tactic {* test @{context} [@{simproc nat_eq_cancel_factor}] *}) fact
  48.808 +      by (tactic \<open>test @{context} [@{simproc nat_eq_cancel_factor}]\<close>) fact
  48.809    next
  48.810      assume "0 < k \<and> x < y" have "x*k < k*y"
  48.811 -      by (tactic {* test @{context} [@{simproc nat_less_cancel_factor}] *}) fact
  48.812 +      by (tactic \<open>test @{context} [@{simproc nat_less_cancel_factor}]\<close>) fact
  48.813    next
  48.814      assume "0 < k \<and> Suc 0 < y" have "k < k*y"
  48.815 -      by (tactic {* test @{context} [@{simproc nat_less_cancel_factor}] *}) fact
  48.816 +      by (tactic \<open>test @{context} [@{simproc nat_less_cancel_factor}]\<close>) fact
  48.817    next
  48.818      assume "0 < b \<and> a * c < Suc 0" have "a*(b*c) < b"
  48.819 -      by (tactic {* test @{context} [@{simproc nat_less_cancel_factor}] *}) fact
  48.820 +      by (tactic \<open>test @{context} [@{simproc nat_less_cancel_factor}]\<close>) fact
  48.821    next
  48.822      assume "0 < a \<and> 0 < b \<and> c < d * x" have "a*(b*c) < d*b*(x*a)"
  48.823 -      by (tactic {* test @{context} [@{simproc nat_less_cancel_factor}] *}) fact
  48.824 +      by (tactic \<open>test @{context} [@{simproc nat_less_cancel_factor}]\<close>) fact
  48.825    next
  48.826      assume "0 < k \<longrightarrow> x \<le> y" have "x*k \<le> k*y"
  48.827 -      by (tactic {* test @{context} [@{simproc nat_le_cancel_factor}] *}) fact
  48.828 +      by (tactic \<open>test @{context} [@{simproc nat_le_cancel_factor}]\<close>) fact
  48.829    next
  48.830      assume "0 < k \<longrightarrow> Suc 0 \<le> y" have "k \<le> k*y"
  48.831 -      by (tactic {* test @{context} [@{simproc nat_le_cancel_factor}] *}) fact
  48.832 +      by (tactic \<open>test @{context} [@{simproc nat_le_cancel_factor}]\<close>) fact
  48.833    next
  48.834      assume "0 < b \<longrightarrow> a * c \<le> Suc 0" have "a*(b*c) \<le> b"
  48.835 -      by (tactic {* test @{context} [@{simproc nat_le_cancel_factor}] *}) fact
  48.836 +      by (tactic \<open>test @{context} [@{simproc nat_le_cancel_factor}]\<close>) fact
  48.837    next
  48.838      assume "0 < a \<longrightarrow> 0 < b \<longrightarrow> c \<le> d * x" have "a*(b*c) \<le> d*b*(x*a)"
  48.839 -      by (tactic {* test @{context} [@{simproc nat_le_cancel_factor}] *}) fact
  48.840 +      by (tactic \<open>test @{context} [@{simproc nat_le_cancel_factor}]\<close>) fact
  48.841    next
  48.842      assume "(if k = 0 then 0 else x div y) = uu" have "(x*k) div (k*y) = uu"
  48.843 -      by (tactic {* test @{context} [@{simproc nat_div_cancel_factor}] *}) fact
  48.844 +      by (tactic \<open>test @{context} [@{simproc nat_div_cancel_factor}]\<close>) fact
  48.845    next
  48.846      assume "(if k = 0 then 0 else Suc 0 div y) = uu" have "k div (k*y) = uu"
  48.847 -      by (tactic {* test @{context} [@{simproc nat_div_cancel_factor}] *}) fact
  48.848 +      by (tactic \<open>test @{context} [@{simproc nat_div_cancel_factor}]\<close>) fact
  48.849    next
  48.850      assume "(if b = 0 then 0 else a * c) = uu" have "(a*(b*c)) div (b) = uu"
  48.851 -      by (tactic {* test @{context} [@{simproc nat_div_cancel_factor}] *}) fact
  48.852 +      by (tactic \<open>test @{context} [@{simproc nat_div_cancel_factor}]\<close>) fact
  48.853    next
  48.854      assume "(if a = 0 then 0 else if b = 0 then 0 else c div (d * x)) = uu"
  48.855      have "(a*(b*c)) div (d*b*(x*a)) = uu"
  48.856 -      by (tactic {* test @{context} [@{simproc nat_div_cancel_factor}] *}) fact
  48.857 +      by (tactic \<open>test @{context} [@{simproc nat_div_cancel_factor}]\<close>) fact
  48.858    next
  48.859      assume "k = 0 \<or> x dvd y" have "(x*k) dvd (k*y)"
  48.860 -      by (tactic {* test @{context} [@{simproc nat_dvd_cancel_factor}] *}) fact
  48.861 +      by (tactic \<open>test @{context} [@{simproc nat_dvd_cancel_factor}]\<close>) fact
  48.862    next
  48.863      assume "k = 0 \<or> Suc 0 dvd y" have "k dvd (k*y)"
  48.864 -      by (tactic {* test @{context} [@{simproc nat_dvd_cancel_factor}] *}) fact
  48.865 +      by (tactic \<open>test @{context} [@{simproc nat_dvd_cancel_factor}]\<close>) fact
  48.866    next
  48.867      assume "b = 0 \<or> a * c dvd Suc 0" have "(a*(b*c)) dvd (b)"
  48.868 -      by (tactic {* test @{context} [@{simproc nat_dvd_cancel_factor}] *}) fact
  48.869 +      by (tactic \<open>test @{context} [@{simproc nat_dvd_cancel_factor}]\<close>) fact
  48.870    next
  48.871      assume "b = 0 \<or> Suc 0 dvd a * c" have "b dvd (a*(b*c))"
  48.872 -      by (tactic {* test @{context} [@{simproc nat_dvd_cancel_factor}] *}) fact
  48.873 +      by (tactic \<open>test @{context} [@{simproc nat_dvd_cancel_factor}]\<close>) fact
  48.874    next
  48.875      assume "a = 0 \<or> b = 0 \<or> c dvd d * x" have "(a*(b*c)) dvd (d*b*(x*a))"
  48.876 -      by (tactic {* test @{context} [@{simproc nat_dvd_cancel_factor}] *}) fact
  48.877 +      by (tactic \<open>test @{context} [@{simproc nat_dvd_cancel_factor}]\<close>) fact
  48.878    }
  48.879  end
  48.880  
  48.881 -subsection {* Numeral-cancellation simprocs for type @{typ nat} *}
  48.882 +subsection \<open>Numeral-cancellation simprocs for type @{typ nat}\<close>
  48.883  
  48.884  notepad begin
  48.885    fix x y z :: nat
  48.886    {
  48.887      assume "3 * x = 4 * y" have "9*x = 12 * y"
  48.888 -      by (tactic {* test @{context} [@{simproc nat_eq_cancel_numeral_factor}] *}) fact
  48.889 +      by (tactic \<open>test @{context} [@{simproc nat_eq_cancel_numeral_factor}]\<close>) fact
  48.890    next
  48.891      assume "3 * x < 4 * y" have "9*x < 12 * y"
  48.892 -      by (tactic {* test @{context} [@{simproc nat_less_cancel_numeral_factor}] *}) fact
  48.893 +      by (tactic \<open>test @{context} [@{simproc nat_less_cancel_numeral_factor}]\<close>) fact
  48.894    next
  48.895      assume "3 * x \<le> 4 * y" have "9*x \<le> 12 * y"
  48.896 -      by (tactic {* test @{context} [@{simproc nat_le_cancel_numeral_factor}] *}) fact
  48.897 +      by (tactic \<open>test @{context} [@{simproc nat_le_cancel_numeral_factor}]\<close>) fact
  48.898    next
  48.899      assume "(3 * x) div (4 * y) = z" have "(9*x) div (12 * y) = z"
  48.900 -      by (tactic {* test @{context} [@{simproc nat_div_cancel_numeral_factor}] *}) fact
  48.901 +      by (tactic \<open>test @{context} [@{simproc nat_div_cancel_numeral_factor}]\<close>) fact
  48.902    next
  48.903      assume "(3 * x) dvd (4 * y)" have "(9*x) dvd (12 * y)"
  48.904 -      by (tactic {* test @{context} [@{simproc nat_dvd_cancel_numeral_factor}] *}) fact
  48.905 +      by (tactic \<open>test @{context} [@{simproc nat_dvd_cancel_numeral_factor}]\<close>) fact
  48.906    }
  48.907  end
  48.908  
  48.909 -subsection {* Integer numeral div/mod simprocs *}
  48.910 +subsection \<open>Integer numeral div/mod simprocs\<close>
  48.911  
  48.912  notepad begin
  48.913    have "(10::int) div 3 = 3"
  48.914 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.915 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.916    have "(10::int) mod 3 = 1"
  48.917 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.918 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.919    have "(10::int) div -3 = -4"
  48.920 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.921 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.922    have "(10::int) mod -3 = -2"
  48.923 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.924 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.925    have "(-10::int) div 3 = -4"
  48.926 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.927 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.928    have "(-10::int) mod 3 = 2"
  48.929 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.930 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.931    have "(-10::int) div -3 = 3"
  48.932 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.933 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.934    have "(-10::int) mod -3 = -1"
  48.935 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.936 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.937    have "(8452::int) mod 3 = 1"
  48.938 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.939 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.940    have "(59485::int) div 434 = 137"
  48.941 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.942 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.943    have "(1000006::int) mod 10 = 6"
  48.944 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.945 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.946    have "10000000 div 2 = (5000000::int)"
  48.947 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.948 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.949    have "10000001 mod 2 = (1::int)"
  48.950 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.951 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.952    have "10000055 div 32 = (312501::int)"
  48.953 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.954 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.955    have "10000055 mod 32 = (23::int)"
  48.956 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.957 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.958    have "100094 div 144 = (695::int)"
  48.959 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.960 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.961    have "100094 mod 144 = (14::int)"
  48.962 -    by (tactic {* test @{context} [@{simproc numeral_divmod}] *})
  48.963 +    by (tactic \<open>test @{context} [@{simproc numeral_divmod}]\<close>)
  48.964  end
  48.965  
  48.966  end
    49.1 --- a/src/HOL/ex/Simps_Case_Conv_Examples.thy	Tue Oct 06 17:46:07 2015 +0200
    49.2 +++ b/src/HOL/ex/Simps_Case_Conv_Examples.thy	Tue Oct 06 17:47:28 2015 +0200
    49.3 @@ -2,7 +2,7 @@
    49.4    "~~/src/HOL/Library/Simps_Case_Conv"
    49.5  begin
    49.6  
    49.7 -section {* Tests for the Simps<->Case conversion tools *}
    49.8 +section \<open>Tests for the Simps<->Case conversion tools\<close>
    49.9  
   49.10  fun foo where
   49.11    "foo (x # xs) Nil = 0" |
   49.12 @@ -26,7 +26,7 @@
   49.13  definition nosplit where "nosplit x = x @ (case x of [] \<Rightarrow> [1] | xs \<Rightarrow> xs)"
   49.14  
   49.15  
   49.16 -text {* Function with complete, non-overlapping patterns *}
   49.17 +text \<open>Function with complete, non-overlapping patterns\<close>
   49.18  case_of_simps foo_cases1: foo.simps
   49.19  lemma
   49.20    fixes xs :: "'a list" and ys :: "'b list"
   49.21 @@ -37,7 +37,7 @@
   49.22      | (x # xs, y # ys) \<Rightarrow> foo ([] :: 'a list) ([] :: 'b list))"
   49.23    by (fact foo_cases1)
   49.24  
   49.25 -text {* Redundant equations are ignored *}
   49.26 +text \<open>Redundant equations are ignored\<close>
   49.27  case_of_simps foo_cases2: foo.simps foo.simps
   49.28  lemma
   49.29    fixes xs :: "'a list" and ys :: "'b list"
   49.30 @@ -48,11 +48,11 @@
   49.31      | (x # xs, y # ys) \<Rightarrow> foo ([] :: 'a list) ([] :: 'b list))"
   49.32    by (fact foo_cases2)
   49.33  
   49.34 -text {* Variable patterns *}
   49.35 +text \<open>Variable patterns\<close>
   49.36  case_of_simps bar_cases: bar.simps
   49.37  print_theorems
   49.38  
   49.39 -text {* Case expression not at top level *}
   49.40 +text \<open>Case expression not at top level\<close>
   49.41  simps_of_case split_rule_test_simps: split_rule_test_def
   49.42  lemma
   49.43    "split_rule_test (Inl x) f = f (x 1)"
   49.44 @@ -60,14 +60,14 @@
   49.45    "split_rule_test (Inr (x, Some y)) f = f (y x)"
   49.46    by (fact split_rule_test_simps)+
   49.47  
   49.48 -text {* Argument occurs both as case parameter and seperately*}
   49.49 +text \<open>Argument occurs both as case parameter and seperately\<close>
   49.50  simps_of_case nosplit_simps1: nosplit_def
   49.51  lemma
   49.52    "nosplit [] = [] @ [1]"
   49.53    "nosplit (x # xs) = (x # xs) @ x # xs"
   49.54    by (fact nosplit_simps1)+
   49.55  
   49.56 -text {* Nested case expressions *}
   49.57 +text \<open>Nested case expressions\<close>
   49.58  simps_of_case test_simps1: test_def
   49.59  lemma
   49.60    "test None [] = 1"
   49.61 @@ -75,12 +75,12 @@
   49.62    "test (Some x) y = x"
   49.63    by (fact test_simps1)+
   49.64  
   49.65 -text {* Single-constructor patterns*}
   49.66 +text \<open>Single-constructor patterns\<close>
   49.67  case_of_simps fst_conv_simps: fst_conv
   49.68  lemma "fst x = (case x of (a,b) \<Rightarrow> a)"
   49.69    by (fact fst_conv_simps)
   49.70  
   49.71 -text {* Partial split of case *}
   49.72 +text \<open>Partial split of case\<close>
   49.73  simps_of_case nosplit_simps2: nosplit_def (splits: list.split)
   49.74  lemma
   49.75    "nosplit [] = [] @ [1]"
   49.76 @@ -93,7 +93,7 @@
   49.77    "test (Some x) y = x"
   49.78    by (fact test_simps2)+
   49.79  
   49.80 -text {* Reversal *}
   49.81 +text \<open>Reversal\<close>
   49.82  case_of_simps test_def1: test_simps1
   49.83  lemma
   49.84    "test x y = (case (x,y) of
   49.85 @@ -102,12 +102,12 @@
   49.86    | (Some x, _) \<Rightarrow> x)"
   49.87    by (fact test_def1)
   49.88  
   49.89 -text {* Case expressions on RHS *}
   49.90 +text \<open>Case expressions on RHS\<close>
   49.91  case_of_simps test_def2: test_simps2
   49.92  lemma "test xs y = (case (xs, y) of (None, []) \<Rightarrow> 1 | (None, x # xa) \<Rightarrow> 2 | (Some x, y) \<Rightarrow> x)"
   49.93    by (fact test_def2)
   49.94  
   49.95 -text {* Partial split of simps *}
   49.96 +text \<open>Partial split of simps\<close>
   49.97  case_of_simps foo_cons_def: foo.simps(1,2)
   49.98  lemma
   49.99    fixes xs :: "'a list" and ys :: "'b list"
    50.1 --- a/src/HOL/ex/Sqrt_Script.thy	Tue Oct 06 17:46:07 2015 +0200
    50.2 +++ b/src/HOL/ex/Sqrt_Script.thy	Tue Oct 06 17:47:28 2015 +0200
    50.3 @@ -3,18 +3,18 @@
    50.4      Copyright   2001  University of Cambridge
    50.5  *)
    50.6  
    50.7 -section {* Square roots of primes are irrational (script version) *}
    50.8 +section \<open>Square roots of primes are irrational (script version)\<close>
    50.9  
   50.10  theory Sqrt_Script
   50.11  imports Complex_Main "~~/src/HOL/Number_Theory/Primes"
   50.12  begin
   50.13  
   50.14 -text {*
   50.15 +text \<open>
   50.16    \medskip Contrast this linear Isabelle/Isar script with Markus
   50.17    Wenzel's more mathematical version.
   50.18 -*}
   50.19 +\<close>
   50.20  
   50.21 -subsection {* Preliminaries *}
   50.22 +subsection \<open>Preliminaries\<close>
   50.23  
   50.24  lemma prime_nonzero:  "prime (p::nat) \<Longrightarrow> p \<noteq> 0"
   50.25    by (force simp add: prime_nat_def)
   50.26 @@ -49,12 +49,12 @@
   50.27    done
   50.28  
   50.29  
   50.30 -subsection {* Main theorem *}
   50.31 +subsection \<open>Main theorem\<close>
   50.32  
   50.33 -text {*
   50.34 +text \<open>
   50.35    The square root of any prime number (including @{text 2}) is
   50.36    irrational.
   50.37 -*}
   50.38 +\<close>
   50.39  
   50.40  theorem prime_sqrt_irrational:
   50.41      "prime (p::nat) \<Longrightarrow> x * x = real p \<Longrightarrow> 0 \<le> x \<Longrightarrow> x \<notin> \<rat>"
    51.1 --- a/src/HOL/ex/Sudoku.thy	Tue Oct 06 17:46:07 2015 +0200
    51.2 +++ b/src/HOL/ex/Sudoku.thy	Tue Oct 06 17:47:28 2015 +0200
    51.3 @@ -3,19 +3,19 @@
    51.4      Copyright   2005-2014
    51.5  *)
    51.6  
    51.7 -section {* A SAT-based Sudoku Solver *}
    51.8 +section \<open>A SAT-based Sudoku Solver\<close>
    51.9  
   51.10  theory Sudoku
   51.11  imports Main
   51.12  begin
   51.13  
   51.14 -text {*
   51.15 +text \<open>
   51.16    See the paper ``A SAT-based Sudoku Solver'' (Tjark Weber, published at
   51.17    LPAR'05) for further explanations.  (The paper describes an older version of
   51.18    this theory that used the model finder @{text refute} to find Sudoku
   51.19    solutions.  The @{text refute} tool has since been superseded by
   51.20    @{text nitpick}, which is used below.)
   51.21 -*}
   51.22 +\<close>
   51.23  
   51.24  no_notation Groups.one_class.one ("1")
   51.25  
   51.26 @@ -83,9 +83,9 @@
   51.27       \<and> valid x74 x75 x76 x84 x85 x86 x94 x95 x96
   51.28       \<and> valid x77 x78 x79 x87 x88 x89 x97 x98 x99"
   51.29  
   51.30 -text {*
   51.31 +text \<open>
   51.32    Just an arbitrary Sudoku grid:
   51.33 -*}
   51.34 +\<close>
   51.35  
   51.36  theorem "\<not> sudoku
   51.37      x11 x12 x13 x14 x15 x16 x17 x18 x19
   51.38 @@ -100,9 +100,9 @@
   51.39    nitpick [expect=genuine]
   51.40  oops
   51.41  
   51.42 -text {*
   51.43 +text \<open>
   51.44    An ``easy'' Sudoku:
   51.45 -*}
   51.46 +\<close>
   51.47  
   51.48  theorem "\<not> sudoku
   51.49       5   3  x13 x14  7  x16 x17 x18 x19
   51.50 @@ -117,9 +117,9 @@
   51.51    nitpick [expect=genuine]
   51.52  oops
   51.53  
   51.54 -text {*
   51.55 +text \<open>
   51.56    A ``hard'' Sudoku:
   51.57 -*}
   51.58 +\<close>
   51.59  
   51.60  theorem "\<not> sudoku
   51.61      x11  2  x13 x14 x15 x16 x17 x18 x19
   51.62 @@ -134,13 +134,13 @@
   51.63    nitpick [expect=genuine]
   51.64  oops
   51.65  
   51.66 -text {*
   51.67 +text \<open>
   51.68    Some ``exceptionally difficult'' Sudokus, taken from
   51.69    @{url "http://en.wikipedia.org/w/index.php?title=Algorithmics_of_sudoku&oldid=254685903"}
   51.70    (accessed December~2, 2008).
   51.71 -*}
   51.72 +\<close>
   51.73  
   51.74 -text {*
   51.75 +text \<open>
   51.76  \begin{verbatim}
   51.77  Rating Program: gsf's sudoku q1 (rating) 
   51.78  Rating: 99408 
   51.79 @@ -159,7 +159,7 @@
   51.80  . 3 . | . . 9 | . 8 .  
   51.81  . . 2 | . . . | . . 1  
   51.82  \end{verbatim}
   51.83 -*}
   51.84 +\<close>
   51.85  
   51.86  theorem "\<not> sudoku
   51.87       1  x12 x13 x14 x15 x16 x17 x18  2 
   51.88 @@ -174,7 +174,7 @@
   51.89    nitpick [expect=genuine]
   51.90  oops
   51.91  
   51.92 -text {*
   51.93 +text \<open>
   51.94  \begin{verbatim}
   51.95  Rating Program: gsf's sudoku q1 (Processing time) 
   51.96  Rating: 4m19s@2 GHz 
   51.97 @@ -193,7 +193,7 @@
   51.98  . . 9 | 2 . . | . . .  
   51.99  . 4 . | . . 1 | . . .  
  51.100  \end{verbatim}
  51.101 -*}
  51.102 +\<close>
  51.103  
  51.104  theorem "\<not> sudoku
  51.105      x11 x12  1  x14 x15  4  x17 x18 x19
  51.106 @@ -208,7 +208,7 @@
  51.107    nitpick [expect=genuine]
  51.108  oops
  51.109  
  51.110 -text {*
  51.111 +text \<open>
  51.112  \begin{verbatim}
  51.113  Rating Program: Nicolas Juillerat's Sudoku explainer 1.2.1 
  51.114  Rating: 11.9 
  51.115 @@ -227,7 +227,7 @@
  51.116  . 2 . | . . . | 6 . .  
  51.117  4 . . | 7 . . | . . .  
  51.118  \end{verbatim}
  51.119 -*}
  51.120 +\<close>
  51.121  
  51.122  theorem "\<not> sudoku
  51.123      x11 x12 x13 x14 x15 x16 x17  3   9 
  51.124 @@ -242,7 +242,7 @@
  51.125    nitpick [expect=genuine]
  51.126  oops
  51.127  
  51.128 -text {*
  51.129 +text \<open>
  51.130  \begin{verbatim}
  51.131  Rating Program: dukuso's suexrat9 
  51.132  Rating: 4483 
  51.133 @@ -261,7 +261,7 @@
  51.134  . 3 . | 9 . . | . . 7  
  51.135  . . 1 | . . 8 | 6 . .  
  51.136  \end{verbatim}
  51.137 -*}
  51.138 +\<close>
  51.139  
  51.140  theorem "\<not> sudoku
  51.141      x11  2  x13  4  x15  3   7  x18 x19
  51.142 @@ -276,7 +276,7 @@
  51.143    nitpick [expect=genuine]
  51.144  oops
  51.145  
  51.146 -text {*
  51.147 +text \<open>
  51.148  \begin{verbatim}
  51.149  Rating Program: dukuso's suexratt (10000 2 option) 
  51.150  Rating: 2141 
  51.151 @@ -295,7 +295,7 @@
  51.152  . 2 . | . . . | 6 . .  
  51.153  4 . . | 7 . . | . . .
  51.154  \end{verbatim}
  51.155 -*}
  51.156 +\<close>
  51.157  
  51.158  theorem "\<not> sudoku
  51.159      x11 x12 x13 x14 x15 x16 x17  3   9 
    52.1 --- a/src/HOL/ex/Sum_of_Powers.thy	Tue Oct 06 17:46:07 2015 +0200
    52.2 +++ b/src/HOL/ex/Sum_of_Powers.thy	Tue Oct 06 17:47:28 2015 +0200
    52.3 @@ -2,13 +2,13 @@
    52.4      Author:     Lukas Bulwahn <lukas.bulwahn-at-gmail.com>
    52.5  *)
    52.6  
    52.7 -section {* Sum of Powers *}
    52.8 +section \<open>Sum of Powers\<close>
    52.9  
   52.10  theory Sum_of_Powers
   52.11  imports Complex_Main
   52.12  begin
   52.13  
   52.14 -subsection {* Additions to @{theory Binomial} Theory *}
   52.15 +subsection \<open>Additions to @{theory Binomial} Theory\<close>
   52.16  
   52.17  lemma of_nat_binomial_eq_mult_binomial_Suc:
   52.18    assumes "k \<le> n"
   52.19 @@ -51,7 +51,7 @@
   52.20      by (metis (no_types, lifting) assms le_add1 le_trans of_nat_diff real_of_nat_1 real_of_nat_add real_of_nat_def)
   52.21  qed
   52.22  
   52.23 -subsection {* Preliminaries *}
   52.24 +subsection \<open>Preliminaries\<close>
   52.25  
   52.26  lemma integrals_eq:
   52.27    assumes "f 0 = g 0"
   52.28 @@ -71,7 +71,7 @@
   52.29  
   52.30  declare One_nat_def [simp del]
   52.31  
   52.32 -subsection {* Bernoulli Numbers and Bernoulli Polynomials  *}
   52.33 +subsection \<open>Bernoulli Numbers and Bernoulli Polynomials\<close>
   52.34  
   52.35  declare setsum.cong [fundef_cong]
   52.36  
   52.37 @@ -85,7 +85,7 @@
   52.38  definition
   52.39    "bernpoly n = (\<lambda>x. \<Sum>k \<le> n. (n choose k) * bernoulli k * x ^ (n - k))"
   52.40  
   52.41 -subsection {* Basic Observations on Bernoulli Polynomials *}
   52.42 +subsection \<open>Basic Observations on Bernoulli Polynomials\<close>
   52.43  
   52.44  lemma bernpoly_0: "bernpoly n 0 = bernoulli n"
   52.45  proof (cases n)
   52.46 @@ -112,7 +112,7 @@
   52.47      (simp add: field_simps add_2_eq_Suc'[symmetric] del: add_2_eq_Suc add_2_eq_Suc')
   52.48  qed
   52.49  
   52.50 -subsection {* Sum of Powers with Bernoulli Polynomials *}
   52.51 +subsection \<open>Sum of Powers with Bernoulli Polynomials\<close>
   52.52  
   52.53  lemma bernpoly_derivative [derivative_intros]:
   52.54    "(bernpoly (Suc n) has_real_derivative ((n + 1) * bernpoly n x)) (at x)"
   52.55 @@ -154,7 +154,7 @@
   52.56    finally show ?thesis by (auto simp add: field_simps intro!: eq_divide_imp)
   52.57  qed
   52.58  
   52.59 -subsection {* Instances for Square And Cubic Numbers *}
   52.60 +subsection \<open>Instances for Square And Cubic Numbers\<close>
   52.61  
   52.62  lemma binomial_unroll:
   52.63    "n > 0 \<Longrightarrow> (n choose k) = (if k = 0 then 1 else (n - 1) choose (k - 1) + ((n - 1) choose k))"
    53.1 --- a/src/HOL/ex/Tarski.thy	Tue Oct 06 17:46:07 2015 +0200
    53.2 +++ b/src/HOL/ex/Tarski.thy	Tue Oct 06 17:47:28 2015 +0200
    53.3 @@ -2,20 +2,20 @@
    53.4      Author:     Florian Kammüller, Cambridge University Computer Laboratory
    53.5  *)
    53.6  
    53.7 -section {* The Full Theorem of Tarski *}
    53.8 +section \<open>The Full Theorem of Tarski\<close>
    53.9  
   53.10  theory Tarski
   53.11  imports Main "~~/src/HOL/Library/FuncSet"
   53.12  begin
   53.13  
   53.14 -text {*
   53.15 +text \<open>
   53.16    Minimal version of lattice theory plus the full theorem of Tarski:
   53.17    The fixedpoints of a complete lattice themselves form a complete
   53.18    lattice.
   53.19  
   53.20    Illustrates first-class theories, using the Sigma representation of
   53.21    structures.  Tidied and converted to Isar by lcp.
   53.22 -*}
   53.23 +\<close>
   53.24  
   53.25  record 'a potype =
   53.26    pset  :: "'a set"
   53.27 @@ -148,7 +148,7 @@
   53.28                        (| pset=intY1, order=induced intY1 r|)"
   53.29  
   53.30  
   53.31 -subsection {* Partial Order *}
   53.32 +subsection \<open>Partial Order\<close>
   53.33  
   53.34  lemma (in PO) dual:
   53.35    "PO (dual cl)"
   53.36 @@ -196,13 +196,13 @@
   53.37       "S \<subseteq> A ==> (| pset = S, order = induced S r |) \<in> PartialOrder"
   53.38  apply (simp (no_asm) add: PartialOrder_def)
   53.39  apply auto
   53.40 --- {* refl *}
   53.41 +-- \<open>refl\<close>
   53.42  apply (simp add: refl_on_def induced_def)
   53.43  apply (blast intro: reflE)
   53.44 --- {* antisym *}
   53.45 +-- \<open>antisym\<close>
   53.46  apply (simp add: antisym_def induced_def)
   53.47  apply (blast intro: antisymE)
   53.48 --- {* trans *}
   53.49 +-- \<open>trans\<close>
   53.50  apply (simp add: trans_def induced_def)
   53.51  apply (blast intro: transE)
   53.52  done
   53.53 @@ -334,7 +334,7 @@
   53.54  done
   53.55  
   53.56  
   53.57 -subsection {* sublattice *}
   53.58 +subsection \<open>sublattice\<close>
   53.59  
   53.60  lemma (in PO) sublattice_imp_CL:
   53.61       "S <<= cl  ==> (| pset = S, order = induced S r |) \<in> CompleteLattice"
   53.62 @@ -353,7 +353,7 @@
   53.63  done
   53.64  
   53.65  
   53.66 -subsection {* lub *}
   53.67 +subsection \<open>lub\<close>
   53.68  
   53.69  lemma (in CL) lub_unique: "[| S \<subseteq> A; isLub S cl x; isLub S cl L|] ==> x = L"
   53.70  apply (rule antisymE)
   53.71 @@ -419,7 +419,7 @@
   53.72  by (simp add: isLub_def A_def r_def)
   53.73  
   53.74  
   53.75 -subsection {* glb *}
   53.76 +subsection \<open>glb\<close>
   53.77  
   53.78  lemma (in CL) glb_in_lattice: "S \<subseteq> A ==> glb S cl \<in> A"
   53.79  apply (subst glb_dual_lub)
   53.80 @@ -439,10 +439,10 @@
   53.81  apply (simp add: dualA_iff A_def, assumption)
   53.82  done
   53.83  
   53.84 -text {*
   53.85 +text \<open>
   53.86    Reduce the sublattice property by using substructural properties;
   53.87    abandoned see @{text "Tarski_4.ML"}.
   53.88 -*}
   53.89 +\<close>
   53.90  
   53.91  lemma (in CLF) [simp]:
   53.92      "f: pset cl -> pset cl & monotone f (pset cl) (order cl)"
   53.93 @@ -471,7 +471,7 @@
   53.94  done
   53.95  
   53.96  
   53.97 -subsection {* fixed points *}
   53.98 +subsection \<open>fixed points\<close>
   53.99  
  53.100  lemma fix_subset: "fix f A \<subseteq> A"
  53.101  by (simp add: fix_def, fast)
  53.102 @@ -484,19 +484,19 @@
  53.103  by (simp add: fix_def, auto)
  53.104  
  53.105  
  53.106 -subsection {* lemmas for Tarski, lub *}
  53.107 +subsection \<open>lemmas for Tarski, lub\<close>
  53.108  lemma (in CLF) lubH_le_flubH:
  53.109       "H = {x. (x, f x) \<in> r & x \<in> A} ==> (lub H cl, f (lub H cl)) \<in> r"
  53.110  apply (rule lub_least, fast)
  53.111  apply (rule f_in_funcset [THEN funcset_mem])
  53.112  apply (rule lub_in_lattice, fast)
  53.113 --- {* @{text "\<forall>x:H. (x, f (lub H r)) \<in> r"} *}
  53.114 +-- \<open>@{text "\<forall>x:H. (x, f (lub H r)) \<in> r"}\<close>
  53.115  apply (rule ballI)
  53.116  apply (rule transE)
  53.117 --- {* instantiates @{text "(x, ???z) \<in> order cl to (x, f x)"}, *}
  53.118 --- {* because of the def of @{text H} *}
  53.119 +-- \<open>instantiates @{text "(x, ???z) \<in> order cl to (x, f x)"},\<close>
  53.120 +-- \<open>because of the def of @{text H}\<close>
  53.121  apply fast
  53.122 --- {* so it remains to show @{text "(f x, f (lub H cl)) \<in> r"} *}
  53.123 +-- \<open>so it remains to show @{text "(f x, f (lub H cl)) \<in> r"}\<close>
  53.124  apply (rule_tac f = "f" in monotoneE)
  53.125  apply (rule monotone_f, fast)
  53.126  apply (rule lub_in_lattice, fast)
  53.127 @@ -552,7 +552,7 @@
  53.128  apply (rule lubH_is_fixp, assumption)
  53.129  done
  53.130  
  53.131 -subsection {* Tarski fixpoint theorem 1, first part *}
  53.132 +subsection \<open>Tarski fixpoint theorem 1, first part\<close>
  53.133  lemma (in CLF) T_thm_1_lub: "lub P cl = lub {x. (x, f x) \<in> r & x \<in> A} cl"
  53.134  apply (rule sym)
  53.135  apply (simp add: P_def)
  53.136 @@ -564,7 +564,7 @@
  53.137  done
  53.138  
  53.139  lemma (in CLF) glbH_is_fixp: "H = {x. (f x, x) \<in> r & x \<in> A} ==> glb H cl \<in> P"
  53.140 -  -- {* Tarski for glb *}
  53.141 +  -- \<open>Tarski for glb\<close>
  53.142  apply (simp add: glb_dual_lub P_def A_def r_def)
  53.143  apply (rule dualA_iff [THEN subst])
  53.144  apply (rule CLF.lubH_is_fixp)
  53.145 @@ -579,7 +579,7 @@
  53.146                   dualPO CL_dualCL CLF_dual dualr_iff)
  53.147  done
  53.148  
  53.149 -subsection {* interval *}
  53.150 +subsection \<open>interval\<close>
  53.151  
  53.152  lemma (in CLF) rel_imp_elem: "(x, y) \<in> r ==> x \<in> A"
  53.153  apply (insert CO_refl_on)
  53.154 @@ -627,7 +627,7 @@
  53.155  apply (rule ballI)
  53.156  apply (simp add: interval_lemma1)
  53.157  apply (simp add: isLub_upper)
  53.158 --- {* @{text "(L, b) \<in> r"} *}
  53.159 +-- \<open>@{text "(L, b) \<in> r"}\<close>
  53.160  apply (simp add: isLub_least interval_lemma2)
  53.161  done
  53.162  
  53.163 @@ -657,38 +657,38 @@
  53.164  prefer 2 apply assumption
  53.165  apply assumption
  53.166  apply (erule exE)
  53.167 --- {* define the lub for the interval as *}
  53.168 +-- \<open>define the lub for the interval as\<close>
  53.169  apply (rule_tac x = "if S = {} then a else L" in exI)
  53.170  apply (simp (no_asm_simp) add: isLub_def split del: split_if)
  53.171  apply (intro impI conjI)
  53.172 --- {* @{text "(if S = {} then a else L) \<in> interval r a b"} *}
  53.173 +-- \<open>@{text "(if S = {} then a else L) \<in> interval r a b"}\<close>
  53.174  apply (simp add: CL_imp_PO L_in_interval)
  53.175  apply (simp add: left_in_interval)
  53.176 --- {* lub prop 1 *}
  53.177 +-- \<open>lub prop 1\<close>
  53.178  apply (case_tac "S = {}")
  53.179 --- {* @{text "S = {}, y \<in> S = False => everything"} *}
  53.180 +-- \<open>@{text "S = {}, y \<in> S = False => everything"}\<close>
  53.181  apply fast
  53.182 --- {* @{text "S \<noteq> {}"} *}
  53.183 +-- \<open>@{text "S \<noteq> {}"}\<close>
  53.184  apply simp
  53.185 --- {* @{text "\<forall>y:S. (y, L) \<in> induced (interval r a b) r"} *}
  53.186 +-- \<open>@{text "\<forall>y:S. (y, L) \<in> induced (interval r a b) r"}\<close>
  53.187  apply (rule ballI)
  53.188  apply (simp add: induced_def  L_in_interval)
  53.189  apply (rule conjI)
  53.190  apply (rule subsetD)
  53.191  apply (simp add: S_intv_cl, assumption)
  53.192  apply (simp add: isLub_upper)
  53.193 --- {* @{text "\<forall>z:interval r a b. (\<forall>y:S. (y, z) \<in> induced (interval r a b) r \<longrightarrow> (if S = {} then a else L, z) \<in> induced (interval r a b) r"} *}
  53.194 +-- \<open>@{text "\<forall>z:interval r a b. (\<forall>y:S. (y, z) \<in> induced (interval r a b) r \<longrightarrow> (if S = {} then a else L, z) \<in> induced (interval r a b) r"}\<close>
  53.195  apply (rule ballI)
  53.196  apply (rule impI)
  53.197  apply (case_tac "S = {}")
  53.198 --- {* @{text "S = {}"} *}
  53.199 +-- \<open>@{text "S = {}"}\<close>
  53.200  apply simp
  53.201  apply (simp add: induced_def  interval_def)
  53.202  apply (rule conjI)
  53.203  apply (rule reflE, assumption)
  53.204  apply (rule interval_not_empty)
  53.205  apply (simp add: interval_def)
  53.206 --- {* @{text "S \<noteq> {}"} *}
  53.207 +-- \<open>@{text "S \<noteq> {}"}\<close>
  53.208  apply simp
  53.209  apply (simp add: induced_def  L_in_interval)
  53.210  apply (rule isLub_least, assumption)
  53.211 @@ -714,7 +714,7 @@
  53.212      interval_is_sublattice [THEN sublattice_imp_CL]
  53.213  
  53.214  
  53.215 -subsection {* Top and Bottom *}
  53.216 +subsection \<open>Top and Bottom\<close>
  53.217  lemma (in CLF) Top_dual_Bot: "Top cl = Bot (dual cl)"
  53.218  by (simp add: Top_def Bot_def least_def greatest_def dualA_iff dualr_iff)
  53.219  
  53.220 @@ -767,7 +767,7 @@
  53.221  apply (simp add: dualA_iff A_def)
  53.222  done
  53.223  
  53.224 -subsection {* fixed points form a partial order *}
  53.225 +subsection \<open>fixed points form a partial order\<close>
  53.226  
  53.227  lemma (in CLF) fixf_po: "(| pset = P, order = induced P r|) \<in> PartialOrder"
  53.228  by (simp add: P_def fix_subset po_subset_po)
  53.229 @@ -785,11 +785,11 @@
  53.230  apply (rule Y_subset_A)
  53.231  apply (rule f_in_funcset [THEN funcset_mem])
  53.232  apply (rule lubY_in_A)
  53.233 --- {* @{text "Y \<subseteq> P ==> f x = x"} *}
  53.234 +-- \<open>@{text "Y \<subseteq> P ==> f x = x"}\<close>
  53.235  apply (rule ballI)
  53.236  apply (rule_tac t = "x" in fix_imp_eq [THEN subst])
  53.237  apply (erule Y_ss [simplified P_def, THEN subsetD])
  53.238 --- {* @{text "reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r"} by monotonicity *}
  53.239 +-- \<open>@{text "reduce (f x, f (lub Y cl)) \<in> r to (x, lub Y cl) \<in> r"} by monotonicity\<close>
  53.240  apply (rule_tac f = "f" in monotoneE)
  53.241  apply (rule monotone_f)
  53.242  apply (simp add: Y_subset_A [THEN subsetD])
  53.243 @@ -811,13 +811,13 @@
  53.244  apply (rule conjI)
  53.245  apply (rule transE)
  53.246  apply (rule lubY_le_flubY)
  53.247 --- {* @{text "(f (lub Y cl), f x) \<in> r"} *}
  53.248 +-- \<open>@{text "(f (lub Y cl), f x) \<in> r"}\<close>
  53.249  apply (rule_tac f=f in monotoneE)
  53.250  apply (rule monotone_f)
  53.251  apply (rule lubY_in_A)
  53.252  apply (simp add: intY1_def interval_def  intY1_elem)
  53.253  apply (simp add: intY1_def  interval_def)
  53.254 --- {* @{text "(f x, Top cl) \<in> r"} *}
  53.255 +-- \<open>@{text "(f x, Top cl) \<in> r"}\<close>
  53.256  apply (rule Top_prop)
  53.257  apply (rule f_in_funcset [THEN funcset_mem])
  53.258  apply (simp add: intY1_def interval_def  intY1_elem)
  53.259 @@ -874,11 +874,11 @@
  53.260       "\<exists>L. isLub Y (| pset = P, order = induced P r |) L"
  53.261  apply (rule_tac x = "v" in exI)
  53.262  apply (simp add: isLub_def)
  53.263 --- {* @{text "v \<in> P"} *}
  53.264 +-- \<open>@{text "v \<in> P"}\<close>
  53.265  apply (simp add: v_in_P)
  53.266  apply (rule conjI)
  53.267 --- {* @{text v} is lub *}
  53.268 --- {* @{text "1. \<forall>y:Y. (y, v) \<in> induced P r"} *}
  53.269 +-- \<open>@{text v} is lub\<close>
  53.270 +-- \<open>@{text "1. \<forall>y:Y. (y, v) \<in> induced P r"}\<close>
  53.271  apply (rule ballI)
  53.272  apply (simp add: induced_def subsetD v_in_P)
  53.273  apply (rule conjI)
    54.1 --- a/src/HOL/ex/Termination.thy	Tue Oct 06 17:46:07 2015 +0200
    54.2 +++ b/src/HOL/ex/Termination.thy	Tue Oct 06 17:47:28 2015 +0200
    54.3 @@ -3,14 +3,14 @@
    54.4     Author:      Alexander Krauss, TU Muenchen
    54.5  *)
    54.6  
    54.7 -section {* Examples and regression tests for automated termination proofs *}
    54.8 +section \<open>Examples and regression tests for automated termination proofs\<close>
    54.9   
   54.10  theory Termination
   54.11  imports Main "~~/src/HOL/Library/Multiset"
   54.12  begin
   54.13  
   54.14 -subsection {* Manually giving termination relations using @{text relation} and
   54.15 -@{term measure} *}
   54.16 +subsection \<open>Manually giving termination relations using @{text relation} and
   54.17 +@{term measure}\<close>
   54.18  
   54.19  function sum :: "nat \<Rightarrow> nat \<Rightarrow> nat"
   54.20  where
   54.21 @@ -29,12 +29,12 @@
   54.22  termination by (relation "measures [\<lambda>(i, N). N, \<lambda>(i,N). N + 1 - i]") auto
   54.23  
   54.24  
   54.25 -subsection {* @{text lexicographic_order}: Trivial examples *}
   54.26 +subsection \<open>@{text lexicographic_order}: Trivial examples\<close>
   54.27  
   54.28 -text {*
   54.29 +text \<open>
   54.30    The @{text fun} command uses the method @{text lexicographic_order} by default,
   54.31    so it is not explicitly invoked.
   54.32 -*}
   54.33 +\<close>
   54.34  
   54.35  fun identity :: "nat \<Rightarrow> nat"
   54.36  where
   54.37 @@ -46,7 +46,7 @@
   54.38  | "yaSuc (Suc n) = Suc (yaSuc n)"
   54.39  
   54.40  
   54.41 -subsection {* Examples on natural numbers *}
   54.42 +subsection \<open>Examples on natural numbers\<close>
   54.43  
   54.44  fun bin :: "(nat * nat) \<Rightarrow> nat"
   54.45  where
   54.46 @@ -116,7 +116,7 @@
   54.47  | "blowup (Suc a) b c d e f g h i = Suc (blowup a b c d e f g h i)"
   54.48  
   54.49    
   54.50 -subsection {* Simple examples with other datatypes than nat, e.g. trees and lists *}
   54.51 +subsection \<open>Simple examples with other datatypes than nat, e.g. trees and lists\<close>
   54.52  
   54.53  datatype tree = Node | Branch tree tree
   54.54  
   54.55 @@ -135,7 +135,7 @@
   54.56  |  "acklist ((n#ns), (m#ms)) = acklist (ns, acklist ((n#ns), ms))"
   54.57  
   54.58  
   54.59 -subsection {* Examples with mutual recursion *}
   54.60 +subsection \<open>Examples with mutual recursion\<close>
   54.61  
   54.62  fun evn od :: "nat \<Rightarrow> bool"
   54.63  where
   54.64 @@ -168,9 +168,9 @@
   54.65  
   54.66  
   54.67  
   54.68 -subsection {* Refined analysis: The @{text size_change} method *}
   54.69 +subsection \<open>Refined analysis: The @{text size_change} method\<close>
   54.70  
   54.71 -text {* Unsolvable for @{text lexicographic_order} *}
   54.72 +text \<open>Unsolvable for @{text lexicographic_order}\<close>
   54.73  
   54.74  function fun1 :: "nat * nat \<Rightarrow> nat"
   54.75  where
   54.76 @@ -182,9 +182,9 @@
   54.77  termination by size_change
   54.78  
   54.79  
   54.80 -text {* 
   54.81 +text \<open>
   54.82    @{text lexicographic_order} can do the following, but it is much slower. 
   54.83 -*}
   54.84 +\<close>
   54.85  
   54.86  function
   54.87    prod :: "nat => nat => nat => nat" and
   54.88 @@ -197,9 +197,9 @@
   54.89  by pat_completeness auto
   54.90  termination by size_change
   54.91  
   54.92 -text {* 
   54.93 +text \<open>
   54.94    Permutations of arguments:
   54.95 -*}
   54.96 +\<close>
   54.97  
   54.98  function perm :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat"
   54.99  where
  54.100 @@ -209,9 +209,9 @@
  54.101  by auto
  54.102  termination by size_change
  54.103  
  54.104 -text {*
  54.105 +text \<open>
  54.106    Artificial examples and regression tests:
  54.107 -*}
  54.108 +\<close>
  54.109  
  54.110  function
  54.111    fun2 :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat"
  54.112 @@ -227,7 +227,7 @@
  54.113             0
  54.114        )"
  54.115  by pat_completeness auto
  54.116 -termination by size_change -- {* requires Multiset *}
  54.117 +termination by size_change -- \<open>requires Multiset\<close>
  54.118  
  54.119  definition negate :: "int \<Rightarrow> int"
  54.120  where "negate i = - i"
    55.1 --- a/src/HOL/ex/ThreeDivides.thy	Tue Oct 06 17:46:07 2015 +0200
    55.2 +++ b/src/HOL/ex/ThreeDivides.thy	Tue Oct 06 17:47:28 2015 +0200
    55.3 @@ -2,15 +2,15 @@
    55.4      Author:     Benjamin Porter, 2005
    55.5  *)
    55.6  
    55.7 -section {* Three Divides Theorem *}
    55.8 +section \<open>Three Divides Theorem\<close>
    55.9  
   55.10  theory ThreeDivides
   55.11  imports Main "~~/src/HOL/Library/LaTeXsugar"
   55.12  begin
   55.13  
   55.14 -subsection {* Abstract *}
   55.15 +subsection \<open>Abstract\<close>
   55.16  
   55.17 -text {*
   55.18 +text \<open>
   55.19  The following document presents a proof of the Three Divides N theorem
   55.20  formalised in the Isabelle/Isar theorem proving system.
   55.21  
   55.22 @@ -24,15 +24,15 @@
   55.23  - 1)} $$ We know $\forall j\; 3|(10^j - 1) $ and hence $3|LHS$,
   55.24  therefore $$\forall n\; 3|n \Longleftrightarrow 3|\sum{n_j}$$
   55.25  @{text "\<box>"}
   55.26 -*}
   55.27 +\<close>
   55.28  
   55.29  
   55.30 -subsection {* Formal proof *}
   55.31 +subsection \<open>Formal proof\<close>
   55.32  
   55.33 -subsubsection {* Miscellaneous summation lemmas *}
   55.34 +subsubsection \<open>Miscellaneous summation lemmas\<close>
   55.35  
   55.36 -text {* If $a$ divides @{text "A x"} for all x then $a$ divides any
   55.37 -sum over terms of the form @{text "(A x)*(P x)"} for arbitrary $P$. *}
   55.38 +text \<open>If $a$ divides @{text "A x"} for all x then $a$ divides any
   55.39 +sum over terms of the form @{text "(A x)*(P x)"} for arbitrary $P$.\<close>
   55.40  
   55.41  lemma div_sum:
   55.42    fixes a::nat and n::nat
   55.43 @@ -49,16 +49,16 @@
   55.44  qed
   55.45  
   55.46  
   55.47 -subsubsection {* Generalised Three Divides *}
   55.48 +subsubsection \<open>Generalised Three Divides\<close>
   55.49  
   55.50 -text {* This section solves a generalised form of the three divides
   55.51 +text \<open>This section solves a generalised form of the three divides
   55.52  problem. Here we show that for any sequence of numbers the theorem
   55.53  holds. In the next section we specialise this theorem to apply
   55.54 -directly to the decimal expansion of the natural numbers. *}
   55.55 +directly to the decimal expansion of the natural numbers.\<close>
   55.56  
   55.57 -text {* Here we show that the first statement in the informal proof is
   55.58 +text \<open>Here we show that the first statement in the informal proof is
   55.59  true for all natural numbers. Note we are using @{term "D i"} to
   55.60 -denote the $i$'th element in a sequence of numbers. *}
   55.61 +denote the $i$'th element in a sequence of numbers.\<close>
   55.62  
   55.63  lemma digit_diff_split:
   55.64    fixes n::nat and nd::nat and x::nat
   55.65 @@ -66,7 +66,7 @@
   55.66               (n - (\<Sum>x<nd. (D x))) = (\<Sum>x<nd. (D x)*(10^x - 1))"
   55.67  by (simp add: sum_diff_distrib diff_mult_distrib2)
   55.68  
   55.69 -text {* Now we prove that 3 always divides numbers of the form $10^x - 1$. *}
   55.70 +text \<open>Now we prove that 3 always divides numbers of the form $10^x - 1$.\<close>
   55.71  lemma three_divs_0:
   55.72    shows "(3::nat) dvd (10^x - 1)"
   55.73  proof (induct x)
   55.74 @@ -84,15 +84,15 @@
   55.75    thus ?case by simp
   55.76  qed
   55.77  
   55.78 -text {* Expanding on the previous lemma and lemma @{text "div_sum"}. *}
   55.79 +text \<open>Expanding on the previous lemma and lemma @{text "div_sum"}.\<close>
   55.80  lemma three_divs_1:
   55.81    fixes D :: "nat \<Rightarrow> nat"
   55.82    shows "3 dvd (\<Sum>x<nd. D x * (10^x - 1))"
   55.83    by (subst mult.commute, rule div_sum) (simp add: three_divs_0 [simplified])
   55.84  
   55.85 -text {* Using lemmas @{text "digit_diff_split"} and 
   55.86 +text \<open>Using lemmas @{text "digit_diff_split"} and 
   55.87  @{text "three_divs_1"} we now prove the following lemma. 
   55.88 -*}
   55.89 +\<close>
   55.90  lemma three_divs_2:
   55.91    fixes nd::nat and D::"nat\<Rightarrow>nat"
   55.92    shows "3 dvd ((\<Sum>x<nd. (D x)*(10^x)) - (\<Sum>x<nd. (D x)))"
   55.93 @@ -101,21 +101,21 @@
   55.94    thus ?thesis by (simp only: digit_diff_split)
   55.95  qed
   55.96  
   55.97 -text {* 
   55.98 +text \<open>
   55.99  We now present the final theorem of this section. For any
  55.100  sequence of numbers (defined by a function @{term "D :: (nat\<Rightarrow>nat)"}),
  55.101  we show that 3 divides the expansive sum $\sum{(D\;x)*10^x}$ over $x$
  55.102  if and only if 3 divides the sum of the individual numbers
  55.103  $\sum{D\;x}$. 
  55.104 -*}
  55.105 +\<close>
  55.106  lemma three_div_general:
  55.107    fixes D :: "nat \<Rightarrow> nat"
  55.108    shows "(3 dvd (\<Sum>x<nd. D x * 10^x)) = (3 dvd (\<Sum>x<nd. D x))"
  55.109  proof
  55.110    have mono: "(\<Sum>x<nd. D x) \<le> (\<Sum>x<nd. D x * 10^x)"
  55.111      by (rule setsum_mono) simp
  55.112 -  txt {* This lets us form the term
  55.113 -         @{term "(\<Sum>x<nd. D x * 10^x) - (\<Sum>x<nd. D x)"} *}
  55.114 +  txt \<open>This lets us form the term
  55.115 +         @{term "(\<Sum>x<nd. D x * 10^x) - (\<Sum>x<nd. D x)"}\<close>
  55.116  
  55.117    {
  55.118      assume "3 dvd (\<Sum>x<nd. D x)"
  55.119 @@ -132,36 +132,36 @@
  55.120  qed
  55.121  
  55.122  
  55.123 -subsubsection {* Three Divides Natural *}
  55.124 +subsubsection \<open>Three Divides Natural\<close>
  55.125  
  55.126 -text {* This section shows that for all natural numbers we can
  55.127 +text \<open>This section shows that for all natural numbers we can
  55.128  generate a sequence of digits less than ten that represent the decimal
  55.129  expansion of the number. We then use the lemma @{text
  55.130 -"three_div_general"} to prove our final theorem. *}
  55.131 +"three_div_general"} to prove our final theorem.\<close>
  55.132  
  55.133  
  55.134 -text {* \medskip Definitions of length and digit sum. *}
  55.135 +text \<open>\medskip Definitions of length and digit sum.\<close>
  55.136  
  55.137 -text {* This section introduces some functions to calculate the
  55.138 +text \<open>This section introduces some functions to calculate the
  55.139  required properties of natural numbers. We then proceed to prove some
  55.140  properties of these functions.
  55.141  
  55.142  The function @{text "nlen"} returns the number of digits in a natural
  55.143 -number n. *}
  55.144 +number n.\<close>
  55.145  
  55.146  fun nlen :: "nat \<Rightarrow> nat"
  55.147  where
  55.148    "nlen 0 = 0"
  55.149  | "nlen x = 1 + nlen (x div 10)"
  55.150  
  55.151 -text {* The function @{text "sumdig"} returns the sum of all digits in
  55.152 -some number n. *}
  55.153 +text \<open>The function @{text "sumdig"} returns the sum of all digits in
  55.154 +some number n.\<close>
  55.155  
  55.156  definition
  55.157    sumdig :: "nat \<Rightarrow> nat" where
  55.158    "sumdig n = (\<Sum>x < nlen n. n div 10^x mod 10)"
  55.159  
  55.160 -text {* Some properties of these functions follow. *}
  55.161 +text \<open>Some properties of these functions follow.\<close>
  55.162  
  55.163  lemma nlen_zero:
  55.164    "0 = nlen x \<Longrightarrow> x = 0"
  55.165 @@ -172,9 +172,9 @@
  55.166    by (induct n rule: nlen.induct) simp_all
  55.167  
  55.168  
  55.169 -text {* The following lemma is the principle lemma required to prove
  55.170 +text \<open>The following lemma is the principle lemma required to prove
  55.171  our theorem. It states that an expansion of some natural number $n$
  55.172 -into a sequence of its individual digits is always possible. *}
  55.173 +into a sequence of its individual digits is always possible.\<close>
  55.174  
  55.175  lemma exp_exists:
  55.176    "m = (\<Sum>x<nlen m. (m div (10::nat)^x mod 10) * 10^x)"
  55.177 @@ -186,7 +186,7 @@
  55.178      and cdef: "c = m mod 10" by simp
  55.179    show "m = (\<Sum>x<nlen m. m div 10^x mod 10 * 10^x)"
  55.180    proof -
  55.181 -    from `Suc nd = nlen m`
  55.182 +    from \<open>Suc nd = nlen m\<close>
  55.183      have "nd = nlen (m div 10)" by (rule nlen_suc)
  55.184      with Suc have
  55.185        "m div 10 = (\<Sum>x<nd. m div 10 div 10^x mod 10 * 10^x)" by simp
  55.186 @@ -205,18 +205,18 @@
  55.187      also have
  55.188        "\<dots> = (\<Sum>x<Suc nd. m div 10^x mod 10 * 10^x)"
  55.189        by (simp add: atLeast0LessThan[symmetric] setsum_head_upt_Suc cdef)
  55.190 -    also note `Suc nd = nlen m`
  55.191 +    also note \<open>Suc nd = nlen m\<close>
  55.192      finally
  55.193      show "m = (\<Sum>x<nlen m. m div 10^x mod 10 * 10^x)" .
  55.194    qed
  55.195  qed
  55.196  
  55.197  
  55.198 -text {* \medskip Final theorem. *}
  55.199 +text \<open>\medskip Final theorem.\<close>
  55.200  
  55.201 -text {* We now combine the general theorem @{text "three_div_general"}
  55.202 +text \<open>We now combine the general theorem @{text "three_div_general"}
  55.203  and existence result of @{text "exp_exists"} to prove our final
  55.204 -theorem. *}
  55.205 +theorem.\<close>
  55.206  
  55.207  theorem three_divides_nat:
  55.208    shows "(3 dvd n) = (3 dvd sumdig n)"
    56.1 --- a/src/HOL/ex/Transfer_Ex.thy	Tue Oct 06 17:46:07 2015 +0200
    56.2 +++ b/src/HOL/ex/Transfer_Ex.thy	Tue Oct 06 17:47:28 2015 +0200
    56.3 @@ -1,5 +1,5 @@
    56.4  
    56.5 -section {* Various examples for transfer procedure *}
    56.6 +section \<open>Various examples for transfer procedure\<close>
    56.7  
    56.8  theory Transfer_Ex
    56.9  imports Main Transfer_Int_Nat
    57.1 --- a/src/HOL/ex/Transfer_Int_Nat.thy	Tue Oct 06 17:46:07 2015 +0200
    57.2 +++ b/src/HOL/ex/Transfer_Int_Nat.thy	Tue Oct 06 17:47:28 2015 +0200
    57.3 @@ -2,23 +2,23 @@
    57.4      Author:     Brian Huffman, TU Muenchen
    57.5  *)
    57.6  
    57.7 -section {* Using the transfer method between nat and int *}
    57.8 +section \<open>Using the transfer method between nat and int\<close>
    57.9  
   57.10  theory Transfer_Int_Nat
   57.11  imports GCD
   57.12  begin
   57.13  
   57.14 -subsection {* Correspondence relation *}
   57.15 +subsection \<open>Correspondence relation\<close>
   57.16  
   57.17  definition ZN :: "int \<Rightarrow> nat \<Rightarrow> bool"
   57.18    where "ZN = (\<lambda>z n. z = of_nat n)"
   57.19  
   57.20 -subsection {* Transfer domain rules *}
   57.21 +subsection \<open>Transfer domain rules\<close>
   57.22  
   57.23  lemma Domainp_ZN [transfer_domain_rule]: "Domainp ZN = (\<lambda>x. x \<ge> 0)" 
   57.24    unfolding ZN_def Domainp_iff[abs_def] by (auto intro: zero_le_imp_eq_int)
   57.25  
   57.26 -subsection {* Transfer rules *}
   57.27 +subsection \<open>Transfer rules\<close>
   57.28  
   57.29  context
   57.30  begin
   57.31 @@ -114,15 +114,15 @@
   57.32    apply simp_all
   57.33    done
   57.34  
   57.35 -text {* For derived operations, we can use the @{text "transfer_prover"}
   57.36 -  method to help generate transfer rules. *}
   57.37 +text \<open>For derived operations, we can use the @{text "transfer_prover"}
   57.38 +  method to help generate transfer rules.\<close>
   57.39  
   57.40  lemma ZN_listsum [transfer_rule]: "(list_all2 ZN ===> ZN) listsum listsum"
   57.41    by transfer_prover
   57.42  
   57.43  end
   57.44  
   57.45 -subsection {* Transfer examples *}
   57.46 +subsection \<open>Transfer examples\<close>
   57.47  
   57.48  lemma
   57.49    assumes "\<And>i::int. 0 \<le> i \<Longrightarrow> i + 0 = i"
   57.50 @@ -159,8 +159,8 @@
   57.51  apply fact
   57.52  done
   57.53  
   57.54 -text {* The @{text "fixing"} option prevents generalization over the free
   57.55 -  variable @{text "n"}, allowing the local transfer rule to be used. *}
   57.56 +text \<open>The @{text "fixing"} option prevents generalization over the free
   57.57 +  variable @{text "n"}, allowing the local transfer rule to be used.\<close>
   57.58  
   57.59  lemma
   57.60    assumes [transfer_rule]: "ZN x n"
   57.61 @@ -185,8 +185,8 @@
   57.62  apply fact
   57.63  done
   57.64  
   57.65 -text {* Quantifiers over higher types (e.g. @{text "nat list"}) are
   57.66 -  transferred to a readable formula thanks to the transfer domain rule @{thm Domainp_ZN} *}
   57.67 +text \<open>Quantifiers over higher types (e.g. @{text "nat list"}) are
   57.68 +  transferred to a readable formula thanks to the transfer domain rule @{thm Domainp_ZN}\<close>
   57.69  
   57.70  lemma
   57.71    assumes "\<And>xs::int list. list_all (\<lambda>x. x \<ge> 0) xs \<Longrightarrow>
   57.72 @@ -196,8 +196,8 @@
   57.73  apply fact
   57.74  done
   57.75  
   57.76 -text {* Equality on a higher type can be transferred if the relations
   57.77 -  involved are bi-unique. *}
   57.78 +text \<open>Equality on a higher type can be transferred if the relations
   57.79 +  involved are bi-unique.\<close>
   57.80  
   57.81  lemma
   57.82    assumes "\<And>xs::int list. \<lbrakk>list_all (\<lambda>x. x \<ge> 0) xs; xs \<noteq> []\<rbrakk> \<Longrightarrow>
    58.1 --- a/src/HOL/ex/Transitive_Closure_Table_Ex.thy	Tue Oct 06 17:46:07 2015 +0200
    58.2 +++ b/src/HOL/ex/Transitive_Closure_Table_Ex.thy	Tue Oct 06 17:47:28 2015 +0200
    58.3 @@ -1,6 +1,6 @@
    58.4  (* Author: Stefan Berghofer, Lukas Bulwahn, TU Muenchen *)
    58.5  
    58.6 -section {* Simple example for table-based implementation of the reflexive transitive closure *}
    58.7 +section \<open>Simple example for table-based implementation of the reflexive transitive closure\<close>
    58.8  
    58.9  theory Transitive_Closure_Table_Ex
   58.10  imports "~~/src/HOL/Library/Transitive_Closure_Table"
   58.11 @@ -15,7 +15,7 @@
   58.12  | "test B C"
   58.13  
   58.14  
   58.15 -text {* Invoking with the predicate compiler and the generic code generator *}
   58.16 +text \<open>Invoking with the predicate compiler and the generic code generator\<close>
   58.17  
   58.18  code_pred test .
   58.19  
    59.1 --- a/src/HOL/ex/Tree23.thy	Tue Oct 06 17:46:07 2015 +0200
    59.2 +++ b/src/HOL/ex/Tree23.thy	Tue Oct 06 17:47:28 2015 +0200
    59.3 @@ -2,13 +2,13 @@
    59.4      Author:     Tobias Nipkow, TU Muenchen
    59.5  *)
    59.6  
    59.7 -section {* 2-3 Trees *}
    59.8 +section \<open>2-3 Trees\<close>
    59.9  
   59.10  theory Tree23
   59.11  imports Main
   59.12  begin
   59.13  
   59.14 -text{* This is a very direct translation of some of the functions in table.ML
   59.15 +text\<open>This is a very direct translation of some of the functions in table.ML
   59.16  in the Isabelle source code. That source is due to Makarius Wenzel and Stefan
   59.17  Berghofer.
   59.18  
   59.19 @@ -17,9 +17,9 @@
   59.20  
   59.21  Note that because of complicated patterns and mutual recursion, these
   59.22  function definitions take a few minutes and can also be seen as stress tests
   59.23 -for the function definition facility.  *}
   59.24 +for the function definition facility.\<close>
   59.25  
   59.26 -type_synonym key = int -- {*for simplicity, should be a type class*}
   59.27 +type_synonym key = int -- \<open>for simplicity, should be a type class\<close>
   59.28  
   59.29  datatype ord = LESS | EQUAL | GREATER
   59.30  
   59.31 @@ -136,7 +136,7 @@
   59.32  definition del0 :: "key \<Rightarrow> 'a tree23 \<Rightarrow> 'a tree23" where
   59.33  "del0 k t = (case del (Some k) t of None \<Rightarrow> t | Some(_,(_,t')) \<Rightarrow> t')"
   59.34  
   59.35 -text {* Ordered trees *}
   59.36 +text \<open>Ordered trees\<close>
   59.37  
   59.38  definition opt_less :: "key option \<Rightarrow> key option \<Rightarrow> bool" where
   59.39    "opt_less x y = (case x of None \<Rightarrow> True | Some a \<Rightarrow> (case y of None \<Rightarrow> True | Some b \<Rightarrow> a < b))"
   59.40 @@ -155,7 +155,7 @@
   59.41  definition ord0 :: "'a tree23 \<Rightarrow> bool" where
   59.42    "ord0 t = ord' None t None"
   59.43  
   59.44 -text {* Balanced trees *}
   59.45 +text \<open>Balanced trees\<close>
   59.46  
   59.47  inductive full :: "nat \<Rightarrow> 'a tree23 \<Rightarrow> bool" where
   59.48  "full 0 Empty" |
   59.49<