isabelle update_cartouches;
authorwenzelm
Sat Jul 18 22:58:50 2015 +0200 (2015-07-18)
changeset 60758d8d85a8172b5
parent 60757 c09598a97436
child 60759 36d9f215c982
isabelle update_cartouches;
src/HOL/ATP.thy
src/HOL/Archimedean_Field.thy
src/HOL/BNF_Cardinal_Arithmetic.thy
src/HOL/BNF_Cardinal_Order_Relation.thy
src/HOL/BNF_Composition.thy
src/HOL/BNF_Def.thy
src/HOL/BNF_Fixpoint_Base.thy
src/HOL/BNF_Greatest_Fixpoint.thy
src/HOL/BNF_Least_Fixpoint.thy
src/HOL/BNF_Wellorder_Constructions.thy
src/HOL/BNF_Wellorder_Embedding.thy
src/HOL/BNF_Wellorder_Relation.thy
src/HOL/Basic_BNFs.thy
src/HOL/Binomial.thy
src/HOL/Code_Evaluation.thy
src/HOL/Code_Numeral.thy
src/HOL/Coinduction.thy
src/HOL/Complete_Lattices.thy
src/HOL/Complete_Partial_Order.thy
src/HOL/Complex.thy
src/HOL/Complex_Main.thy
src/HOL/Conditionally_Complete_Lattices.thy
src/HOL/Ctr_Sugar.thy
src/HOL/Deriv.thy
src/HOL/Divides.thy
src/HOL/Enum.thy
src/HOL/Equiv_Relations.thy
src/HOL/Extraction.thy
src/HOL/Fields.thy
src/HOL/Filter.thy
src/HOL/Finite_Set.thy
src/HOL/Fun.thy
src/HOL/Fun_Def.thy
src/HOL/Fun_Def_Base.thy
src/HOL/GCD.thy
src/HOL/Groebner_Basis.thy
src/HOL/Groups.thy
src/HOL/Groups_Big.thy
src/HOL/Groups_List.thy
src/HOL/HOL.thy
src/HOL/Hilbert_Choice.thy
src/HOL/Inductive.thy
src/HOL/Inequalities.thy
src/HOL/Int.thy
src/HOL/Lattices.thy
src/HOL/Lattices_Big.thy
src/HOL/Lazy_Sequence.thy
src/HOL/Lifting.thy
src/HOL/Lifting_Set.thy
src/HOL/Limited_Sequence.thy
src/HOL/Limits.thy
src/HOL/List.thy
src/HOL/MacLaurin.thy
src/HOL/Main.thy
src/HOL/Map.thy
src/HOL/Meson.thy
src/HOL/Metis.thy
src/HOL/Nat.thy
src/HOL/Nat_Transfer.thy
src/HOL/Nitpick.thy
src/HOL/NthRoot.thy
src/HOL/Num.thy
src/HOL/Numeral_Simprocs.thy
src/HOL/Option.thy
src/HOL/Order_Relation.thy
src/HOL/Orderings.thy
src/HOL/Parity.thy
src/HOL/Partial_Function.thy
src/HOL/Power.thy
src/HOL/Predicate.thy
src/HOL/Predicate_Compile.thy
src/HOL/Presburger.thy
src/HOL/Product_Type.thy
src/HOL/Quickcheck_Exhaustive.thy
src/HOL/Quickcheck_Narrowing.thy
src/HOL/Quickcheck_Random.thy
src/HOL/Quotient.thy
src/HOL/Random.thy
src/HOL/Random_Pred.thy
src/HOL/Random_Sequence.thy
src/HOL/Rat.thy
src/HOL/Real.thy
src/HOL/Real_Vector_Spaces.thy
src/HOL/Record.thy
src/HOL/Relation.thy
src/HOL/Rings.thy
src/HOL/SAT.thy
src/HOL/SMT.thy
src/HOL/Semiring_Normalization.thy
src/HOL/Series.thy
src/HOL/Set.thy
src/HOL/Set_Interval.thy
src/HOL/Sledgehammer.thy
src/HOL/String.thy
src/HOL/Sum_Type.thy
src/HOL/Taylor.thy
src/HOL/Topological_Spaces.thy
src/HOL/Transcendental.thy
src/HOL/Transfer.thy
src/HOL/Transitive_Closure.thy
src/HOL/Typedef.thy
src/HOL/Typerep.thy
src/HOL/Wellfounded.thy
src/HOL/Wfrec.thy
src/HOL/Zorn.thy
     1.1 --- a/src/HOL/ATP.thy	Sat Jul 18 21:44:18 2015 +0200
     1.2 +++ b/src/HOL/ATP.thy	Sat Jul 18 22:58:50 2015 +0200
     1.3 @@ -3,13 +3,13 @@
     1.4      Author:     Jasmin Blanchette, TU Muenchen
     1.5  *)
     1.6  
     1.7 -section {* Automatic Theorem Provers (ATPs) *}
     1.8 +section \<open>Automatic Theorem Provers (ATPs)\<close>
     1.9  
    1.10  theory ATP
    1.11  imports Meson
    1.12  begin
    1.13  
    1.14 -subsection {* ATP problems and proofs *}
    1.15 +subsection \<open>ATP problems and proofs\<close>
    1.16  
    1.17  ML_file "Tools/ATP/atp_util.ML"
    1.18  ML_file "Tools/ATP/atp_problem.ML"
    1.19 @@ -18,7 +18,7 @@
    1.20  ML_file "Tools/ATP/atp_satallax.ML"
    1.21  
    1.22  
    1.23 -subsection {* Higher-order reasoning helpers *}
    1.24 +subsection \<open>Higher-order reasoning helpers\<close>
    1.25  
    1.26  definition fFalse :: bool where
    1.27  "fFalse \<longleftrightarrow> False"
    1.28 @@ -131,7 +131,7 @@
    1.29  unfolding fFalse_def fTrue_def fequal_def by auto
    1.30  
    1.31  
    1.32 -subsection {* Waldmeister helpers *}
    1.33 +subsection \<open>Waldmeister helpers\<close>
    1.34  
    1.35  (* Has all needed simplification lemmas for logic. *)
    1.36  lemma boolean_equality: "(P \<longleftrightarrow> P) = True"
    1.37 @@ -144,7 +144,7 @@
    1.38    simp_thms(1-5,7-8,11-25,27-33) disj_comms disj_assoc conj_comms conj_assoc
    1.39  
    1.40  
    1.41 -subsection {* Basic connection between ATPs and HOL *}
    1.42 +subsection \<open>Basic connection between ATPs and HOL\<close>
    1.43  
    1.44  ML_file "Tools/lambda_lifting.ML"
    1.45  ML_file "Tools/monomorph.ML"
     2.1 --- a/src/HOL/Archimedean_Field.thy	Sat Jul 18 21:44:18 2015 +0200
     2.2 +++ b/src/HOL/Archimedean_Field.thy	Sat Jul 18 22:58:50 2015 +0200
     2.3 @@ -2,15 +2,15 @@
     2.4      Author:     Brian Huffman
     2.5  *)
     2.6  
     2.7 -section {* Archimedean Fields, Floor and Ceiling Functions *}
     2.8 +section \<open>Archimedean Fields, Floor and Ceiling Functions\<close>
     2.9  
    2.10  theory Archimedean_Field
    2.11  imports Main
    2.12  begin
    2.13  
    2.14 -subsection {* Class of Archimedean fields *}
    2.15 +subsection \<open>Class of Archimedean fields\<close>
    2.16  
    2.17 -text {* Archimedean fields have no infinite elements. *}
    2.18 +text \<open>Archimedean fields have no infinite elements.\<close>
    2.19  
    2.20  class archimedean_field = linordered_field +
    2.21    assumes ex_le_of_int: "\<exists>z. x \<le> of_int z"
    2.22 @@ -48,53 +48,53 @@
    2.23    then show ?thesis ..
    2.24  qed
    2.25  
    2.26 -text {* Archimedean fields have no infinitesimal elements. *}
    2.27 +text \<open>Archimedean fields have no infinitesimal elements.\<close>
    2.28  
    2.29  lemma ex_inverse_of_nat_Suc_less:
    2.30    fixes x :: "'a::archimedean_field"
    2.31    assumes "0 < x" shows "\<exists>n. inverse (of_nat (Suc n)) < x"
    2.32  proof -
    2.33 -  from `0 < x` have "0 < inverse x"
    2.34 +  from \<open>0 < x\<close> have "0 < inverse x"
    2.35      by (rule positive_imp_inverse_positive)
    2.36    obtain n where "inverse x < of_nat n"
    2.37      using ex_less_of_nat ..
    2.38    then obtain m where "inverse x < of_nat (Suc m)"
    2.39 -    using `0 < inverse x` by (cases n) (simp_all del: of_nat_Suc)
    2.40 +    using \<open>0 < inverse x\<close> by (cases n) (simp_all del: of_nat_Suc)
    2.41    then have "inverse (of_nat (Suc m)) < inverse (inverse x)"
    2.42 -    using `0 < inverse x` by (rule less_imp_inverse_less)
    2.43 +    using \<open>0 < inverse x\<close> by (rule less_imp_inverse_less)
    2.44    then have "inverse (of_nat (Suc m)) < x"
    2.45 -    using `0 < x` by (simp add: nonzero_inverse_inverse_eq)
    2.46 +    using \<open>0 < x\<close> by (simp add: nonzero_inverse_inverse_eq)
    2.47    then show ?thesis ..
    2.48  qed
    2.49  
    2.50  lemma ex_inverse_of_nat_less:
    2.51    fixes x :: "'a::archimedean_field"
    2.52    assumes "0 < x" shows "\<exists>n>0. inverse (of_nat n) < x"
    2.53 -  using ex_inverse_of_nat_Suc_less [OF `0 < x`] by auto
    2.54 +  using ex_inverse_of_nat_Suc_less [OF \<open>0 < x\<close>] by auto
    2.55  
    2.56  lemma ex_less_of_nat_mult:
    2.57    fixes x :: "'a::archimedean_field"
    2.58    assumes "0 < x" shows "\<exists>n. y < of_nat n * x"
    2.59  proof -
    2.60    obtain n where "y / x < of_nat n" using ex_less_of_nat ..
    2.61 -  with `0 < x` have "y < of_nat n * x" by (simp add: pos_divide_less_eq)
    2.62 +  with \<open>0 < x\<close> have "y < of_nat n * x" by (simp add: pos_divide_less_eq)
    2.63    then show ?thesis ..
    2.64  qed
    2.65  
    2.66  
    2.67 -subsection {* Existence and uniqueness of floor function *}
    2.68 +subsection \<open>Existence and uniqueness of floor function\<close>
    2.69  
    2.70  lemma exists_least_lemma:
    2.71    assumes "\<not> P 0" and "\<exists>n. P n"
    2.72    shows "\<exists>n. \<not> P n \<and> P (Suc n)"
    2.73  proof -
    2.74 -  from `\<exists>n. P n` have "P (Least P)" by (rule LeastI_ex)
    2.75 -  with `\<not> P 0` obtain n where "Least P = Suc n"
    2.76 +  from \<open>\<exists>n. P n\<close> have "P (Least P)" by (rule LeastI_ex)
    2.77 +  with \<open>\<not> P 0\<close> obtain n where "Least P = Suc n"
    2.78      by (cases "Least P") auto
    2.79    then have "n < Least P" by simp
    2.80    then have "\<not> P n" by (rule not_less_Least)
    2.81    then have "\<not> P n \<and> P (Suc n)"
    2.82 -    using `P (Least P)` `Least P = Suc n` by simp
    2.83 +    using \<open>P (Least P)\<close> \<open>Least P = Suc n\<close> by simp
    2.84    then show ?thesis ..
    2.85  qed
    2.86  
    2.87 @@ -135,7 +135,7 @@
    2.88  qed
    2.89  
    2.90  
    2.91 -subsection {* Floor function *}
    2.92 +subsection \<open>Floor function\<close>
    2.93  
    2.94  class floor_ceiling = archimedean_field +
    2.95    fixes floor :: "'a \<Rightarrow> int"
    2.96 @@ -185,7 +185,7 @@
    2.97  lemma floor_mono: assumes "x \<le> y" shows "floor x \<le> floor y"
    2.98  proof -
    2.99    have "of_int (floor x) \<le> x" by (rule of_int_floor_le)
   2.100 -  also note `x \<le> y`
   2.101 +  also note \<open>x \<le> y\<close>
   2.102    finally show ?thesis by (simp add: le_floor_iff)
   2.103  qed
   2.104  
   2.105 @@ -201,7 +201,7 @@
   2.106  lemma le_floor_add: "floor x + floor y \<le> floor (x + y)"
   2.107    by (simp only: le_floor_iff of_int_add add_mono of_int_floor_le)
   2.108  
   2.109 -text {* Floor with numerals *}
   2.110 +text \<open>Floor with numerals\<close>
   2.111  
   2.112  lemma floor_zero [simp]: "floor 0 = 0"
   2.113    using floor_of_int [of 0] by simp
   2.114 @@ -271,7 +271,7 @@
   2.115    "floor x < - numeral v \<longleftrightarrow> x < - numeral v"
   2.116    by (simp add: floor_less_iff)
   2.117  
   2.118 -text {* Addition and subtraction of integers *}
   2.119 +text \<open>Addition and subtraction of integers\<close>
   2.120  
   2.121  lemma floor_add_of_int [simp]: "floor (x + of_int z) = floor x + z"
   2.122    using floor_correct [of x] by (simp add: floor_unique)
   2.123 @@ -324,7 +324,7 @@
   2.124      case False
   2.125      obtain r where "r = - l" by blast
   2.126      then have l: "l = - r" by simp
   2.127 -    moreover with `l \<noteq> 0` False have "r > 0" by simp
   2.128 +    moreover with \<open>l \<noteq> 0\<close> False have "r > 0" by simp
   2.129      ultimately show ?thesis using pos_mod_bound [of r]
   2.130        by (auto simp add: zmod_zminus2_eq_if less_le field_simps intro: floor_unique)
   2.131    qed
   2.132 @@ -374,7 +374,7 @@
   2.133  qed
   2.134  
   2.135  
   2.136 -subsection {* Ceiling function *}
   2.137 +subsection \<open>Ceiling function\<close>
   2.138  
   2.139  definition
   2.140    ceiling :: "'a::floor_ceiling \<Rightarrow> int" where
   2.141 @@ -422,7 +422,7 @@
   2.142  lemma ceiling_add_le: "ceiling (x + y) \<le> ceiling x + ceiling y"
   2.143    by (simp only: ceiling_le_iff of_int_add add_mono le_of_int_ceiling)
   2.144  
   2.145 -text {* Ceiling with numerals *}
   2.146 +text \<open>Ceiling with numerals\<close>
   2.147  
   2.148  lemma ceiling_zero [simp]: "ceiling 0 = 0"
   2.149    using ceiling_of_int [of 0] by simp
   2.150 @@ -492,7 +492,7 @@
   2.151    "- numeral v < ceiling x \<longleftrightarrow> - numeral v < x"
   2.152    by (simp add: less_ceiling_iff)
   2.153  
   2.154 -text {* Addition and subtraction of integers *}
   2.155 +text \<open>Addition and subtraction of integers\<close>
   2.156  
   2.157  lemma ceiling_add_of_int [simp]: "ceiling (x + of_int z) = ceiling x + z"
   2.158    using ceiling_correct [of x] by (simp add: ceiling_unique)
   2.159 @@ -529,7 +529,7 @@
   2.160      unfolding of_int_less_iff by simp
   2.161  qed
   2.162  
   2.163 -subsection {* Negation *}
   2.164 +subsection \<open>Negation\<close>
   2.165  
   2.166  lemma floor_minus: "floor (- x) = - ceiling x"
   2.167    unfolding ceiling_def by simp
   2.168 @@ -537,7 +537,7 @@
   2.169  lemma ceiling_minus: "ceiling (- x) = - floor x"
   2.170    unfolding ceiling_def by simp
   2.171  
   2.172 -subsection {* Frac Function *}
   2.173 +subsection \<open>Frac Function\<close>
   2.174  
   2.175  
   2.176  definition frac :: "'a \<Rightarrow> 'a::floor_ceiling" where
     3.1 --- a/src/HOL/BNF_Cardinal_Arithmetic.thy	Sat Jul 18 21:44:18 2015 +0200
     3.2 +++ b/src/HOL/BNF_Cardinal_Arithmetic.thy	Sat Jul 18 22:58:50 2015 +0200
     3.3 @@ -5,7 +5,7 @@
     3.4  Cardinal arithmetic as needed by bounded natural functors.
     3.5  *)
     3.6  
     3.7 -section {* Cardinal Arithmetic as Needed by Bounded Natural Functors *}
     3.8 +section \<open>Cardinal Arithmetic as Needed by Bounded Natural Functors\<close>
     3.9  
    3.10  theory BNF_Cardinal_Arithmetic
    3.11  imports BNF_Cardinal_Order_Relation
    3.12 @@ -39,7 +39,7 @@
    3.13  using card_order_on_Card_order[of UNIV r] by simp
    3.14  
    3.15  
    3.16 -subsection {* Zero *}
    3.17 +subsection \<open>Zero\<close>
    3.18  
    3.19  definition czero where
    3.20    "czero = card_of {}"
    3.21 @@ -80,7 +80,7 @@
    3.22  apply (simp only: card_of_empty3)
    3.23  done
    3.24  
    3.25 -subsection {* (In)finite cardinals *}
    3.26 +subsection \<open>(In)finite cardinals\<close>
    3.27  
    3.28  definition cinfinite where
    3.29    "cinfinite r = (\<not> finite (Field r))"
    3.30 @@ -127,7 +127,7 @@
    3.31  unfolding cinfinite_def by (auto dest: card_of_ordLeq_infinite[OF card_of_mono2])
    3.32  
    3.33  
    3.34 -subsection {* Binary sum *}
    3.35 +subsection \<open>Binary sum\<close>
    3.36  
    3.37  definition csum (infixr "+c" 65) where
    3.38    "r1 +c r2 \<equiv> |Field r1 <+> Field r2|"
    3.39 @@ -223,7 +223,7 @@
    3.40  using ordLeq_ordIso_trans[OF card_of_Un_Plus_ordLeq Plus_csum] by blast
    3.41  
    3.42  
    3.43 -subsection {* One *}
    3.44 +subsection \<open>One\<close>
    3.45  
    3.46  definition cone where
    3.47    "cone = card_of {()}"
    3.48 @@ -241,7 +241,7 @@
    3.49  unfolding cone_def by (rule Card_order_singl_ordLeq) (auto intro: czeroI)
    3.50  
    3.51  
    3.52 -subsection {* Two *}
    3.53 +subsection \<open>Two\<close>
    3.54  
    3.55  definition ctwo where
    3.56    "ctwo = |UNIV :: bool set|"
    3.57 @@ -257,7 +257,7 @@
    3.58  by (simp add: ctwo_not_czero Card_order_ctwo)
    3.59  
    3.60  
    3.61 -subsection {* Family sum *}
    3.62 +subsection \<open>Family sum\<close>
    3.63  
    3.64  definition Csum where
    3.65    "Csum r rs \<equiv> |SIGMA i : Field r. Field (rs i)|"
    3.66 @@ -278,7 +278,7 @@
    3.67  This should make cardinal reasoning more direct and natural.  *)
    3.68  
    3.69  
    3.70 -subsection {* Product *}
    3.71 +subsection \<open>Product\<close>
    3.72  
    3.73  definition cprod (infixr "*c" 80) where
    3.74    "r1 *c r2 = |Field r1 <*> Field r2|"
    3.75 @@ -360,7 +360,7 @@
    3.76  by (rule csum_absorb1') auto
    3.77  
    3.78  
    3.79 -subsection {* Exponentiation *}
    3.80 +subsection \<open>Exponentiation\<close>
    3.81  
    3.82  definition cexp (infixr "^c" 90) where
    3.83    "r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
    3.84 @@ -386,7 +386,7 @@
    3.85      with n have "Field r2 = {}" .
    3.86      hence "cone \<le>o r1 ^c r2" unfolding cone_def cexp_def Func_def
    3.87        by (auto intro: card_of_ordLeqI[where f="\<lambda>_ _. undefined"])
    3.88 -    thus ?thesis using `p1 ^c p2 \<le>o cone` ordLeq_transitive by auto
    3.89 +    thus ?thesis using \<open>p1 ^c p2 \<le>o cone\<close> ordLeq_transitive by auto
    3.90    next
    3.91      case False with True have "|Field (p1 ^c p2)| =o czero"
    3.92        unfolding card_of_ordIso_czero_iff_empty cexp_def Field_card_of Func_def by auto
     4.1 --- a/src/HOL/BNF_Cardinal_Order_Relation.thy	Sat Jul 18 21:44:18 2015 +0200
     4.2 +++ b/src/HOL/BNF_Cardinal_Order_Relation.thy	Sat Jul 18 22:58:50 2015 +0200
     4.3 @@ -5,13 +5,13 @@
     4.4  Cardinal-order relations as needed by bounded natural functors.
     4.5  *)
     4.6  
     4.7 -section {* Cardinal-Order Relations as Needed by Bounded Natural Functors *}
     4.8 +section \<open>Cardinal-Order Relations as Needed by Bounded Natural Functors\<close>
     4.9  
    4.10  theory BNF_Cardinal_Order_Relation
    4.11  imports Zorn BNF_Wellorder_Constructions
    4.12  begin
    4.13  
    4.14 -text{* In this section, we define cardinal-order relations to be minim well-orders
    4.15 +text\<open>In this section, we define cardinal-order relations to be minim well-orders
    4.16  on their field.  Then we define the cardinal of a set to be {\em some} cardinal-order
    4.17  relation on that set, which will be unique up to order isomorphism.  Then we study
    4.18  the connection between cardinals and:
    4.19 @@ -31,14 +31,14 @@
    4.20  most of the standard set-theoretic constructions (except for the powerset)
    4.21  {\em do not increase cardinality}.  In particular, e.g., the set of words/lists over
    4.22  any infinite set has the same cardinality (hence, is in bijection) with that set.
    4.23 -*}
    4.24 +\<close>
    4.25  
    4.26  
    4.27 -subsection {* Cardinal orders *}
    4.28 +subsection \<open>Cardinal orders\<close>
    4.29  
    4.30 -text{* A cardinal order in our setting shall be a well-order {\em minim} w.r.t. the
    4.31 +text\<open>A cardinal order in our setting shall be a well-order {\em minim} w.r.t. the
    4.32  order-embedding relation, @{text "\<le>o"} (which is the same as being {\em minimal} w.r.t. the
    4.33 -strict order-embedding relation, @{text "<o"}), among all the well-orders on its field. *}
    4.34 +strict order-embedding relation, @{text "<o"}), among all the well-orders on its field.\<close>
    4.35  
    4.36  definition card_order_on :: "'a set \<Rightarrow> 'a rel \<Rightarrow> bool"
    4.37  where
    4.38 @@ -56,7 +56,7 @@
    4.39  "card_order_on A r \<Longrightarrow> A = Field r \<and> Card_order r"
    4.40  unfolding card_order_on_def using well_order_on_Field by blast
    4.41  
    4.42 -text{* The existence of a cardinal relation on any given set (which will mean
    4.43 +text\<open>The existence of a cardinal relation on any given set (which will mean
    4.44  that any set has a cardinal) follows from two facts:
    4.45  \begin{itemize}
    4.46  \item Zermelo's theorem (proved in @{text "Zorn.thy"} as theorem @{text "well_order_on"}),
    4.47 @@ -64,7 +64,7 @@
    4.48  \item The well-founded-ness of @{text "<o"}, ensuring that then there exists a minimal
    4.49  such well-order, i.e., a cardinal order.
    4.50  \end{itemize}
    4.51 -*}
    4.52 +\<close>
    4.53  
    4.54  theorem card_order_on: "\<exists>r. card_order_on A r"
    4.55  proof-
    4.56 @@ -111,11 +111,11 @@
    4.57  using assms Card_order_ordIso ordIso_symmetric by blast
    4.58  
    4.59  
    4.60 -subsection {* Cardinal of a set *}
    4.61 +subsection \<open>Cardinal of a set\<close>
    4.62  
    4.63 -text{* We define the cardinal of set to be {\em some} cardinal order on that set.
    4.64 +text\<open>We define the cardinal of set to be {\em some} cardinal order on that set.
    4.65  We shall prove that this notion is unique up to order isomorphism, meaning
    4.66 -that order isomorphism shall be the true identity of cardinals. *}
    4.67 +that order isomorphism shall be the true identity of cardinals.\<close>
    4.68  
    4.69  definition card_of :: "'a set \<Rightarrow> 'a rel" ("|_|" )
    4.70  where "card_of A = (SOME r. card_order_on A r)"
    4.71 @@ -343,13 +343,13 @@
    4.72  using internalize_card_of_ordLeq[of "A" "|C|"] Field_card_of[of C] by auto
    4.73  
    4.74  
    4.75 -subsection {* Cardinals versus set operations on arbitrary sets *}
    4.76 +subsection \<open>Cardinals versus set operations on arbitrary sets\<close>
    4.77  
    4.78 -text{* Here we embark in a long journey of simple results showing
    4.79 +text\<open>Here we embark in a long journey of simple results showing
    4.80  that the standard set-theoretic operations are well-behaved w.r.t. the notion of
    4.81  cardinal -- essentially, this means that they preserve the ``cardinal identity"
    4.82  @{text "=o"} and are monotonic w.r.t. @{text "\<le>o"}.
    4.83 -*}
    4.84 +\<close>
    4.85  
    4.86  lemma card_of_empty: "|{}| \<le>o |A|"
    4.87  using card_of_ordLeq inj_on_id by blast
    4.88 @@ -819,21 +819,21 @@
    4.89  using assms card_of_Field_ordIso card_of_ordIso_finite ordIso_equivalence by blast
    4.90  
    4.91  
    4.92 -subsection {* Cardinals versus set operations involving infinite sets *}
    4.93 +subsection \<open>Cardinals versus set operations involving infinite sets\<close>
    4.94  
    4.95 -text{* Here we show that, for infinite sets, most set-theoretic constructions
    4.96 +text\<open>Here we show that, for infinite sets, most set-theoretic constructions
    4.97  do not increase the cardinality.  The cornerstone for this is
    4.98  theorem @{text "Card_order_Times_same_infinite"}, which states that self-product
    4.99  does not increase cardinality -- the proof of this fact adapts a standard
   4.100  set-theoretic argument, as presented, e.g., in the proof of theorem 1.5.11
   4.101 -at page 47 in @{cite "card-book"}. Then everything else follows fairly easily. *}
   4.102 +at page 47 in @{cite "card-book"}. Then everything else follows fairly easily.\<close>
   4.103  
   4.104  lemma infinite_iff_card_of_nat:
   4.105  "\<not> finite A \<longleftrightarrow> ( |UNIV::nat set| \<le>o |A| )"
   4.106  unfolding infinite_iff_countable_subset card_of_ordLeq ..
   4.107  
   4.108 -text{* The next two results correspond to the ZF fact that all infinite cardinals are
   4.109 -limit ordinals: *}
   4.110 +text\<open>The next two results correspond to the ZF fact that all infinite cardinals are
   4.111 +limit ordinals:\<close>
   4.112  
   4.113  lemma Card_order_infinite_not_under:
   4.114  assumes CARD: "Card_order r" and INF: "\<not>finite (Field r)"
   4.115 @@ -1140,13 +1140,13 @@
   4.116  qed
   4.117  
   4.118  
   4.119 -subsection {* The cardinal $\omega$ and the finite cardinals *}
   4.120 +subsection \<open>The cardinal $\omega$ and the finite cardinals\<close>
   4.121  
   4.122 -text{* The cardinal $\omega$, of natural numbers, shall be the standard non-strict
   4.123 +text\<open>The cardinal $\omega$, of natural numbers, shall be the standard non-strict
   4.124  order relation on
   4.125  @{text "nat"}, that we abbreviate by @{text "natLeq"}.  The finite cardinals
   4.126  shall be the restrictions of these relations to the numbers smaller than
   4.127 -fixed numbers @{text "n"}, that we abbreviate by @{text "natLeq_on n"}. *}
   4.128 +fixed numbers @{text "n"}, that we abbreviate by @{text "natLeq_on n"}.\<close>
   4.129  
   4.130  definition "(natLeq::(nat * nat) set) \<equiv> {(x,y). x \<le> y}"
   4.131  definition "(natLess::(nat * nat) set) \<equiv> {(x,y). x < y}"
   4.132 @@ -1160,12 +1160,12 @@
   4.133  proof
   4.134    assume "finite (A \<times> B)"
   4.135    from assms(1) have "A \<noteq> {}" by auto
   4.136 -  with `finite (A \<times> B)` have "finite B" using finite_cartesian_productD2 by auto
   4.137 +  with \<open>finite (A \<times> B)\<close> have "finite B" using finite_cartesian_productD2 by auto
   4.138    with assms(2) show False by simp
   4.139  qed
   4.140  
   4.141  
   4.142 -subsubsection {* First as well-orders *}
   4.143 +subsubsection \<open>First as well-orders\<close>
   4.144  
   4.145  lemma Field_natLeq: "Field natLeq = (UNIV::nat set)"
   4.146  by(unfold Field_def natLeq_def, auto)
   4.147 @@ -1225,7 +1225,7 @@
   4.148  unfolding wo_rel_def using natLeq_on_Well_order .
   4.149  
   4.150  
   4.151 -subsubsection {* Then as cardinals *}
   4.152 +subsubsection \<open>Then as cardinals\<close>
   4.153  
   4.154  lemma natLeq_Card_order: "Card_order natLeq"
   4.155  proof(auto simp add: natLeq_Well_order
   4.156 @@ -1258,11 +1258,11 @@
   4.157        card_of_Well_order natLeq_Well_order by blast
   4.158  
   4.159  
   4.160 -subsection {* The successor of a cardinal *}
   4.161 +subsection \<open>The successor of a cardinal\<close>
   4.162  
   4.163 -text{* First we define @{text "isCardSuc r r'"}, the notion of @{text "r'"}
   4.164 +text\<open>First we define @{text "isCardSuc r r'"}, the notion of @{text "r'"}
   4.165  being a successor cardinal of @{text "r"}. Although the definition does
   4.166 -not require @{text "r"} to be a cardinal, only this case will be meaningful. *}
   4.167 +not require @{text "r"} to be a cardinal, only this case will be meaningful.\<close>
   4.168  
   4.169  definition isCardSuc :: "'a rel \<Rightarrow> 'a set rel \<Rightarrow> bool"
   4.170  where
   4.171 @@ -1270,9 +1270,9 @@
   4.172   Card_order r' \<and> r <o r' \<and>
   4.173   (\<forall>(r''::'a set rel). Card_order r'' \<and> r <o r'' \<longrightarrow> r' \<le>o r'')"
   4.174  
   4.175 -text{* Now we introduce the cardinal-successor operator @{text "cardSuc"},
   4.176 +text\<open>Now we introduce the cardinal-successor operator @{text "cardSuc"},
   4.177  by picking {\em some} cardinal-order relation fulfilling @{text "isCardSuc"}.
   4.178 -Again, the picked item shall be proved unique up to order-isomorphism. *}
   4.179 +Again, the picked item shall be proved unique up to order-isomorphism.\<close>
   4.180  
   4.181  definition cardSuc :: "'a rel \<Rightarrow> 'a set rel"
   4.182  where
   4.183 @@ -1312,14 +1312,14 @@
   4.184  "Card_order r \<Longrightarrow> r \<le>o cardSuc r"
   4.185  using cardSuc_greater ordLeq_iff_ordLess_or_ordIso by blast
   4.186  
   4.187 -text{* The minimality property of @{text "cardSuc"} originally present in its definition
   4.188 -is local to the type @{text "'a set rel"}, i.e., that of @{text "cardSuc r"}: *}
   4.189 +text\<open>The minimality property of @{text "cardSuc"} originally present in its definition
   4.190 +is local to the type @{text "'a set rel"}, i.e., that of @{text "cardSuc r"}:\<close>
   4.191  
   4.192  lemma cardSuc_least_aux:
   4.193  "\<lbrakk>Card_order (r::'a rel); Card_order (r'::'a set rel); r <o r'\<rbrakk> \<Longrightarrow> cardSuc r \<le>o r'"
   4.194  using cardSuc_isCardSuc unfolding isCardSuc_def by blast
   4.195  
   4.196 -text{* But from this we can infer general minimality: *}
   4.197 +text\<open>But from this we can infer general minimality:\<close>
   4.198  
   4.199  lemma cardSuc_least:
   4.200  assumes CARD: "Card_order r" and CARD': "Card_order r'" and LESS: "r <o r'"
   4.201 @@ -1497,7 +1497,7 @@
   4.202  ordLeq_transitive by fast
   4.203  
   4.204  
   4.205 -subsection {* Regular cardinals *}
   4.206 +subsection \<open>Regular cardinals\<close>
   4.207  
   4.208  definition cofinal where
   4.209  "cofinal A r \<equiv>
   4.210 @@ -1616,7 +1616,7 @@
   4.211  qed
   4.212  
   4.213  
   4.214 -subsection {* Others *}
   4.215 +subsection \<open>Others\<close>
   4.216  
   4.217  lemma card_of_Func_Times:
   4.218  "|Func (A <*> B) C| =o |Func A (Func B C)|"
     5.1 --- a/src/HOL/BNF_Composition.thy	Sat Jul 18 21:44:18 2015 +0200
     5.2 +++ b/src/HOL/BNF_Composition.thy	Sat Jul 18 22:58:50 2015 +0200
     5.3 @@ -6,7 +6,7 @@
     5.4  Composition of bounded natural functors.
     5.5  *)
     5.6  
     5.7 -section {* Composition of Bounded Natural Functors *}
     5.8 +section \<open>Composition of Bounded Natural Functors\<close>
     5.9  
    5.10  theory BNF_Composition
    5.11  imports BNF_Def
    5.12 @@ -129,7 +129,7 @@
    5.13    fix b assume "F b"
    5.14    show "\<exists>b'. F (Rep b')"
    5.15    proof (rule exI)
    5.16 -    from `F b` show "F (Rep (Abs b))" using type_definition.Abs_inverse[OF type_copy] by auto
    5.17 +    from \<open>F b\<close> show "F (Rep (Abs b))" using type_definition.Abs_inverse[OF type_copy] by auto
    5.18    qed
    5.19  qed blast
    5.20  
     6.1 --- a/src/HOL/BNF_Def.thy	Sat Jul 18 21:44:18 2015 +0200
     6.2 +++ b/src/HOL/BNF_Def.thy	Sat Jul 18 22:58:50 2015 +0200
     6.3 @@ -6,7 +6,7 @@
     6.4  Definition of bounded natural functors.
     6.5  *)
     6.6  
     6.7 -section {* Definition of Bounded Natural Functors *}
     6.8 +section \<open>Definition of Bounded Natural Functors\<close>
     6.9  
    6.10  theory BNF_Def
    6.11  imports BNF_Cardinal_Arithmetic Fun_Def_Base
     7.1 --- a/src/HOL/BNF_Fixpoint_Base.thy	Sat Jul 18 21:44:18 2015 +0200
     7.2 +++ b/src/HOL/BNF_Fixpoint_Base.thy	Sat Jul 18 22:58:50 2015 +0200
     7.3 @@ -8,7 +8,7 @@
     7.4  Shared fixpoint operations on bounded natural functors.
     7.5  *)
     7.6  
     7.7 -section {* Shared Fixpoint Operations on Bounded Natural Functors *}
     7.8 +section \<open>Shared Fixpoint Operations on Bounded Natural Functors\<close>
     7.9  
    7.10  theory BNF_Fixpoint_Base
    7.11  imports BNF_Composition Basic_BNFs
     8.1 --- a/src/HOL/BNF_Greatest_Fixpoint.thy	Sat Jul 18 21:44:18 2015 +0200
     8.2 +++ b/src/HOL/BNF_Greatest_Fixpoint.thy	Sat Jul 18 22:58:50 2015 +0200
     8.3 @@ -7,7 +7,7 @@
     8.4  Greatest fixpoint (codatatype) operation on bounded natural functors.
     8.5  *)
     8.6  
     8.7 -section {* Greatest Fixpoint (Codatatype) Operation on Bounded Natural Functors *}
     8.8 +section \<open>Greatest Fixpoint (Codatatype) Operation on Bounded Natural Functors\<close>
     8.9  
    8.10  theory BNF_Greatest_Fixpoint
    8.11  imports BNF_Fixpoint_Base String
    8.12 @@ -17,7 +17,7 @@
    8.13    "primcorec" :: thy_decl
    8.14  begin
    8.15  
    8.16 -setup {* Sign.const_alias @{binding proj} @{const_name Equiv_Relations.proj} *}
    8.17 +setup \<open>Sign.const_alias @{binding proj} @{const_name Equiv_Relations.proj}\<close>
    8.18  
    8.19  lemma one_pointE: "\<lbrakk>\<And>x. s = x \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
    8.20    by simp
    8.21 @@ -240,7 +240,7 @@
    8.22    unfolding rel_fun_def image2p_def by auto
    8.23  
    8.24  
    8.25 -subsection {* Equivalence relations, quotients, and Hilbert's choice *}
    8.26 +subsection \<open>Equivalence relations, quotients, and Hilbert's choice\<close>
    8.27  
    8.28  lemma equiv_Eps_in:
    8.29  "\<lbrakk>equiv A r; X \<in> A//r\<rbrakk> \<Longrightarrow> Eps (%x. x \<in> X) \<in> X"
     9.1 --- a/src/HOL/BNF_Least_Fixpoint.thy	Sat Jul 18 21:44:18 2015 +0200
     9.2 +++ b/src/HOL/BNF_Least_Fixpoint.thy	Sat Jul 18 22:58:50 2015 +0200
     9.3 @@ -7,7 +7,7 @@
     9.4  Least fixpoint (datatype) operation on bounded natural functors.
     9.5  *)
     9.6  
     9.7 -section {* Least Fixpoint (Datatype) Operation on Bounded Natural Functors *}
     9.8 +section \<open>Least Fixpoint (Datatype) Operation on Bounded Natural Functors\<close>
     9.9  
    9.10  theory BNF_Least_Fixpoint
    9.11  imports BNF_Fixpoint_Base
    10.1 --- a/src/HOL/BNF_Wellorder_Constructions.thy	Sat Jul 18 21:44:18 2015 +0200
    10.2 +++ b/src/HOL/BNF_Wellorder_Constructions.thy	Sat Jul 18 22:58:50 2015 +0200
    10.3 @@ -5,23 +5,23 @@
    10.4  Constructions on wellorders as needed by bounded natural functors.
    10.5  *)
    10.6  
    10.7 -section {* Constructions on Wellorders as Needed by Bounded Natural Functors *}
    10.8 +section \<open>Constructions on Wellorders as Needed by Bounded Natural Functors\<close>
    10.9  
   10.10  theory BNF_Wellorder_Constructions
   10.11  imports BNF_Wellorder_Embedding
   10.12  begin
   10.13  
   10.14 -text {* In this section, we study basic constructions on well-orders, such as restriction to
   10.15 +text \<open>In this section, we study basic constructions on well-orders, such as restriction to
   10.16  a set/order filter, copy via direct images, ordinal-like sum of disjoint well-orders,
   10.17  and bounded square.  We also define between well-orders
   10.18  the relations @{text "ordLeq"}, of being embedded (abbreviated @{text "\<le>o"}),
   10.19  @{text "ordLess"}, of being strictly embedded (abbreviated @{text "<o"}), and
   10.20  @{text "ordIso"}, of being isomorphic (abbreviated @{text "=o"}).  We study the
   10.21  connections between these relations, order filters, and the aforementioned constructions.
   10.22 -A main result of this section is that @{text "<o"} is well-founded. *}
   10.23 +A main result of this section is that @{text "<o"} is well-founded.\<close>
   10.24  
   10.25  
   10.26 -subsection {* Restriction to a set *}
   10.27 +subsection \<open>Restriction to a set\<close>
   10.28  
   10.29  abbreviation Restr :: "'a rel \<Rightarrow> 'a set \<Rightarrow> 'a rel"
   10.30  where "Restr r A \<equiv> r Int (A \<times> A)"
   10.31 @@ -90,7 +90,7 @@
   10.32       order_on_defs[of "Field r" r] by auto
   10.33  
   10.34  
   10.35 -subsection {* Order filters versus restrictions and embeddings *}
   10.36 +subsection \<open>Order filters versus restrictions and embeddings\<close>
   10.37  
   10.38  lemma Field_Restr_ofilter:
   10.39  "\<lbrakk>Well_order r; wo_rel.ofilter r A\<rbrakk> \<Longrightarrow> Field(Restr r A) = A"
   10.40 @@ -261,7 +261,7 @@
   10.41  qed
   10.42  
   10.43  
   10.44 -subsection {* The strict inclusion on proper ofilters is well-founded *}
   10.45 +subsection \<open>The strict inclusion on proper ofilters is well-founded\<close>
   10.46  
   10.47  definition ofilterIncl :: "'a rel \<Rightarrow> 'a set rel"
   10.48  where
   10.49 @@ -302,9 +302,9 @@
   10.50  qed
   10.51  
   10.52  
   10.53 -subsection {* Ordering the well-orders by existence of embeddings *}
   10.54 +subsection \<open>Ordering the well-orders by existence of embeddings\<close>
   10.55  
   10.56 -text {* We define three relations between well-orders:
   10.57 +text \<open>We define three relations between well-orders:
   10.58  \begin{itemize}
   10.59  \item @{text "ordLeq"}, of being embedded (abbreviated @{text "\<le>o"});
   10.60  \item @{text "ordLess"}, of being strictly embedded (abbreviated @{text "<o"});
   10.61 @@ -314,7 +314,7 @@
   10.62  The prefix "ord" and the index "o" in these names stand for "ordinal-like".
   10.63  These relations shall be proved to be inter-connected in a similar fashion as the trio
   10.64  @{text "\<le>"}, @{text "<"}, @{text "="} associated to a total order on a set.
   10.65 -*}
   10.66 +\<close>
   10.67  
   10.68  definition ordLeq :: "('a rel * 'a' rel) set"
   10.69  where
   10.70 @@ -347,10 +347,10 @@
   10.71  shows "Well_order r \<and> Well_order r'"
   10.72  using assms unfolding ordLeq_def by simp
   10.73  
   10.74 -text{* Notice that the relations @{text "\<le>o"}, @{text "<o"}, @{text "=o"} connect well-orders
   10.75 +text\<open>Notice that the relations @{text "\<le>o"}, @{text "<o"}, @{text "=o"} connect well-orders
   10.76  on potentially {\em distinct} types. However, some of the lemmas below, including the next one,
   10.77  restrict implicitly the type of these relations to @{text "(('a rel) * ('a rel)) set"} , i.e.,
   10.78 -to @{text "'a rel rel"}. *}
   10.79 +to @{text "'a rel rel"}.\<close>
   10.80  
   10.81  lemma ordLeq_reflexive:
   10.82  "Well_order r \<Longrightarrow> r \<le>o r"
   10.83 @@ -822,13 +822,13 @@
   10.84    ultimately show ?thesis using assms ordLeq_total ordIso_symmetric by blast
   10.85  qed
   10.86  
   10.87 -subsection{* @{text "<o"} is well-founded *}
   10.88 +subsection\<open>@{text "<o"} is well-founded\<close>
   10.89  
   10.90 -text {* Of course, it only makes sense to state that the @{text "<o"} is well-founded
   10.91 +text \<open>Of course, it only makes sense to state that the @{text "<o"} is well-founded
   10.92  on the restricted type @{text "'a rel rel"}.  We prove this by first showing that, for any set
   10.93  of well-orders all embedded in a fixed well-order, the function mapping each well-order
   10.94  in the set to an order filter of the fixed well-order is compatible w.r.t. to @{text "<o"} versus
   10.95 -{\em strict inclusion}; and we already know that strict inclusion of order filters is well-founded. *}
   10.96 +{\em strict inclusion}; and we already know that strict inclusion of order filters is well-founded.\<close>
   10.97  
   10.98  definition ord_to_filter :: "'a rel \<Rightarrow> 'a rel \<Rightarrow> 'a set"
   10.99  where "ord_to_filter r0 r \<equiv> (SOME f. embed r r0 f) ` (Field r)"
  10.100 @@ -883,11 +883,11 @@
  10.101  qed
  10.102  
  10.103  
  10.104 -subsection {* Copy via direct images *}
  10.105 +subsection \<open>Copy via direct images\<close>
  10.106  
  10.107 -text{* The direct image operator is the dual of the inverse image operator @{text "inv_image"}
  10.108 +text\<open>The direct image operator is the dual of the inverse image operator @{text "inv_image"}
  10.109  from @{text "Relation.thy"}.  It is useful for transporting a well-order between
  10.110 -different types. *}
  10.111 +different types.\<close>
  10.112  
  10.113  definition dir_image :: "'a rel \<Rightarrow> ('a \<Rightarrow> 'a') \<Rightarrow> 'a' rel"
  10.114  where
  10.115 @@ -1043,9 +1043,9 @@
  10.116  qed
  10.117  
  10.118  
  10.119 -subsection {* Bounded square *}
  10.120 +subsection \<open>Bounded square\<close>
  10.121  
  10.122 -text{* This construction essentially defines, for an order relation @{text "r"}, a lexicographic
  10.123 +text\<open>This construction essentially defines, for an order relation @{text "r"}, a lexicographic
  10.124  order @{text "bsqr r"} on @{text "(Field r) \<times> (Field r)"}, applying the
  10.125  following criteria (in this order):
  10.126  \begin{itemize}
  10.127 @@ -1058,7 +1058,7 @@
  10.128  at proving that the square of an infinite set has the same cardinal
  10.129  as that set. The essential property required there (and which is ensured by this
  10.130  construction) is that any proper order filter of the product order is included in a rectangle, i.e.,
  10.131 -in a product of proper filters on the original relation (assumed to be a well-order). *}
  10.132 +in a product of proper filters on the original relation (assumed to be a well-order).\<close>
  10.133  
  10.134  definition bsqr :: "'a rel => ('a * 'a)rel"
  10.135  where
  10.136 @@ -1639,9 +1639,9 @@
  10.137          show ?thesis
  10.138          proof (cases "h b2 = undefined")
  10.139            case True
  10.140 -          hence b1: "h b2 \<in> f1 ` A1" using h `b2 \<in> B2` unfolding B1 Func_def by auto
  10.141 +          hence b1: "h b2 \<in> f1 ` A1" using h \<open>b2 \<in> B2\<close> unfolding B1 Func_def by auto
  10.142            show ?thesis using A2 f_inv_into_f[OF b1]
  10.143 -            unfolding True g_def Func_map_def j1_def j2[OF `b2 \<in> B2`] by auto
  10.144 +            unfolding True g_def Func_map_def j1_def j2[OF \<open>b2 \<in> B2\<close>] by auto
  10.145          qed(insert A2 True j2[OF True] h B1, unfold j1_def g_def Func_def Func_map_def,
  10.146            auto intro: f_inv_into_f)
  10.147        qed(insert h, unfold Func_def Func_map_def, auto)
    11.1 --- a/src/HOL/BNF_Wellorder_Embedding.thy	Sat Jul 18 21:44:18 2015 +0200
    11.2 +++ b/src/HOL/BNF_Wellorder_Embedding.thy	Sat Jul 18 22:58:50 2015 +0200
    11.3 @@ -5,22 +5,22 @@
    11.4  Well-order embeddings as needed by bounded natural functors.
    11.5  *)
    11.6  
    11.7 -section {* Well-Order Embeddings as Needed by Bounded Natural Functors *}
    11.8 +section \<open>Well-Order Embeddings as Needed by Bounded Natural Functors\<close>
    11.9  
   11.10  theory BNF_Wellorder_Embedding
   11.11  imports Hilbert_Choice BNF_Wellorder_Relation
   11.12  begin
   11.13  
   11.14 -text{* In this section, we introduce well-order {\em embeddings} and {\em isomorphisms} and
   11.15 +text\<open>In this section, we introduce well-order {\em embeddings} and {\em isomorphisms} and
   11.16  prove their basic properties.  The notion of embedding is considered from the point
   11.17  of view of the theory of ordinals, and therefore requires the source to be injected
   11.18  as an {\em initial segment} (i.e., {\em order filter}) of the target.  A main result
   11.19  of this section is the existence of embeddings (in one direction or another) between
   11.20  any two well-orders, having as a consequence the fact that, given any two sets on
   11.21 -any two types, one is smaller than (i.e., can be injected into) the other. *}
   11.22 +any two types, one is smaller than (i.e., can be injected into) the other.\<close>
   11.23  
   11.24  
   11.25 -subsection {* Auxiliaries *}
   11.26 +subsection \<open>Auxiliaries\<close>
   11.27  
   11.28  lemma UNION_inj_on_ofilter:
   11.29  assumes WELL: "Well_order r" and
   11.30 @@ -55,10 +55,10 @@
   11.31  qed
   11.32  
   11.33  
   11.34 -subsection {* (Well-order) embeddings, strict embeddings, isomorphisms and order-compatible
   11.35 -functions *}
   11.36 +subsection \<open>(Well-order) embeddings, strict embeddings, isomorphisms and order-compatible
   11.37 +functions\<close>
   11.38  
   11.39 -text{* Standardly, a function is an embedding of a well-order in another if it injectively and
   11.40 +text\<open>Standardly, a function is an embedding of a well-order in another if it injectively and
   11.41  order-compatibly maps the former into an order filter of the latter.
   11.42  Here we opt for a more succinct definition (operator @{text "embed"}),
   11.43  asking that, for any element in the source, the function should be a bijection
   11.44 @@ -66,7 +66,7 @@
   11.45  and the set of strict lower bounds of its image.  (Later we prove equivalence with
   11.46  the standard definition -- lemma @{text "embed_iff_compat_inj_on_ofilter"}.)
   11.47  A {\em strict embedding} (operator @{text "embedS"})  is a non-bijective embedding
   11.48 -and an isomorphism (operator @{text "iso"}) is a bijective embedding. *}
   11.49 +and an isomorphism (operator @{text "iso"}) is a bijective embedding.\<close>
   11.50  
   11.51  definition embed :: "'a rel \<Rightarrow> 'a' rel \<Rightarrow> ('a \<Rightarrow> 'a') \<Rightarrow> bool"
   11.52  where
   11.53 @@ -74,7 +74,7 @@
   11.54  
   11.55  lemmas embed_defs = embed_def embed_def[abs_def]
   11.56  
   11.57 -text {* Strict embeddings: *}
   11.58 +text \<open>Strict embeddings:\<close>
   11.59  
   11.60  definition embedS :: "'a rel \<Rightarrow> 'a' rel \<Rightarrow> ('a \<Rightarrow> 'a') \<Rightarrow> bool"
   11.61  where
   11.62 @@ -151,7 +151,7 @@
   11.63  using assms unfolding iso_def
   11.64  by (auto simp add: comp_embed bij_betw_trans)
   11.65  
   11.66 -text{* That @{text "embedS"} is also preserved by function composition shall be proved only later. *}
   11.67 +text\<open>That @{text "embedS"} is also preserved by function composition shall be proved only later.\<close>
   11.68  
   11.69  lemma embed_Field:
   11.70  "\<lbrakk>Well_order r; embed r r' f\<rbrakk> \<Longrightarrow> f`(Field r) \<le> Field r'"
   11.71 @@ -451,9 +451,9 @@
   11.72  qed
   11.73  
   11.74  
   11.75 -subsection {* Given any two well-orders, one can be embedded in the other *}
   11.76 +subsection \<open>Given any two well-orders, one can be embedded in the other\<close>
   11.77  
   11.78 -text{* Here is an overview of the proof of of this fact, stated in theorem
   11.79 +text\<open>Here is an overview of the proof of of this fact, stated in theorem
   11.80  @{text "wellorders_totally_ordered"}:
   11.81  
   11.82     Fix the well-orders @{text "r::'a rel"} and @{text "r'::'a' rel"}.
   11.83 @@ -470,7 +470,7 @@
   11.84     Otherwise, it means that @{text "Field r'"} is the smaller one, and the inverse of
   11.85     (the "good" segment of) @{text "f"} is the desired embedding from @{text "r'"} to @{text "r"}
   11.86     (lemma @{text "wellorders_totally_ordered_aux2"}).
   11.87 -*}
   11.88 +\<close>
   11.89  
   11.90  lemma wellorders_totally_ordered_aux:
   11.91  fixes r ::"'a rel"  and r'::"'a' rel" and
   11.92 @@ -768,12 +768,12 @@
   11.93  qed
   11.94  
   11.95  
   11.96 -subsection {* Uniqueness of embeddings *}
   11.97 +subsection \<open>Uniqueness of embeddings\<close>
   11.98  
   11.99 -text{* Here we show a fact complementary to the one from the previous subsection -- namely,
  11.100 +text\<open>Here we show a fact complementary to the one from the previous subsection -- namely,
  11.101  that between any two well-orders there is {\em at most} one embedding, and is the one
  11.102  definable by the expected well-order recursive equation.  As a consequence, any two
  11.103 -embeddings of opposite directions are mutually inverse. *}
  11.104 +embeddings of opposite directions are mutually inverse.\<close>
  11.105  
  11.106  lemma embed_determined:
  11.107  assumes WELL: "Well_order r" and WELL': "Well_order r'" and
  11.108 @@ -864,7 +864,7 @@
  11.109  unfolding iso_def using assms by (auto simp add: embed_bothWays_bij_betw)
  11.110  
  11.111  
  11.112 -subsection {* More properties of embeddings, strict embeddings and isomorphisms *}
  11.113 +subsection \<open>More properties of embeddings, strict embeddings and isomorphisms\<close>
  11.114  
  11.115  lemma embed_bothWays_Field_bij_betw:
  11.116  assumes WELL: "Well_order r" and WELL': "Well_order r'" and
    12.1 --- a/src/HOL/BNF_Wellorder_Relation.thy	Sat Jul 18 21:44:18 2015 +0200
    12.2 +++ b/src/HOL/BNF_Wellorder_Relation.thy	Sat Jul 18 22:58:50 2015 +0200
    12.3 @@ -5,24 +5,24 @@
    12.4  Well-order relations as needed by bounded natural functors.
    12.5  *)
    12.6  
    12.7 -section {* Well-Order Relations as Needed by Bounded Natural Functors *}
    12.8 +section \<open>Well-Order Relations as Needed by Bounded Natural Functors\<close>
    12.9  
   12.10  theory BNF_Wellorder_Relation
   12.11  imports Order_Relation
   12.12  begin
   12.13  
   12.14 -text{* In this section, we develop basic concepts and results pertaining
   12.15 +text\<open>In this section, we develop basic concepts and results pertaining
   12.16  to well-order relations.  Note that we consider well-order relations
   12.17  as {\em non-strict relations},
   12.18 -i.e., as containing the diagonals of their fields. *}
   12.19 +i.e., as containing the diagonals of their fields.\<close>
   12.20  
   12.21  locale wo_rel =
   12.22    fixes r :: "'a rel"
   12.23    assumes WELL: "Well_order r"
   12.24  begin
   12.25  
   12.26 -text{* The following context encompasses all this section. In other words,
   12.27 -for the whole section, we consider a fixed well-order relation @{term "r"}. *}
   12.28 +text\<open>The following context encompasses all this section. In other words,
   12.29 +for the whole section, we consider a fixed well-order relation @{term "r"}.\<close>
   12.30  
   12.31  (* context wo_rel  *)
   12.32  
   12.33 @@ -38,7 +38,7 @@
   12.34  lemmas ofilter_def = Order_Relation.ofilter_def[of r]
   12.35  
   12.36  
   12.37 -subsection {* Auxiliaries *}
   12.38 +subsection \<open>Auxiliaries\<close>
   12.39  
   12.40  lemma REFL: "Refl r"
   12.41  using WELL order_on_defs[of _ r] by auto
   12.42 @@ -72,13 +72,13 @@
   12.43  using TOTALS by auto
   12.44  
   12.45  
   12.46 -subsection {* Well-founded induction and recursion adapted to non-strict well-order relations *}
   12.47 +subsection \<open>Well-founded induction and recursion adapted to non-strict well-order relations\<close>
   12.48  
   12.49 -text{* Here we provide induction and recursion principles specific to {\em non-strict}
   12.50 +text\<open>Here we provide induction and recursion principles specific to {\em non-strict}
   12.51  well-order relations.
   12.52  Although minor variations of those for well-founded relations, they will be useful
   12.53  for doing away with the tediousness of
   12.54 -having to take out the diagonal each time in order to switch to a well-founded relation. *}
   12.55 +having to take out the diagonal each time in order to switch to a well-founded relation.\<close>
   12.56  
   12.57  lemma well_order_induct:
   12.58  assumes IND: "\<And>x. \<forall>y. y \<noteq> x \<and> (y, x) \<in> r \<longrightarrow> P y \<Longrightarrow> P x"
   12.59 @@ -113,9 +113,9 @@
   12.60  qed
   12.61  
   12.62  
   12.63 -subsection {* The notions of maximum, minimum, supremum, successor and order filter *}
   12.64 +subsection \<open>The notions of maximum, minimum, supremum, successor and order filter\<close>
   12.65  
   12.66 -text{*
   12.67 +text\<open>
   12.68  We define the successor {\em of a set}, and not of an element (the latter is of course
   12.69  a particular case).  Also, we define the maximum {\em of two elements}, @{text "max2"},
   12.70  and the minimum {\em of a set}, @{text "minim"} -- we chose these variants since we
   12.71 @@ -124,7 +124,7 @@
   12.72  defined in terms of minimum as expected.
   12.73  The minimum is only meaningful for non-empty sets, and the successor is only
   12.74  meaningful for sets for which strict upper bounds exist.
   12.75 -Order filters for well-orders are also known as ``initial segments". *}
   12.76 +Order filters for well-orders are also known as ``initial segments".\<close>
   12.77  
   12.78  definition max2 :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
   12.79  where "max2 a b \<equiv> if (a,b) \<in> r then b else a"
   12.80 @@ -142,7 +142,7 @@
   12.81  where "suc A \<equiv> minim (AboveS A)"
   12.82  
   12.83  
   12.84 -subsubsection {* Properties of max2 *}
   12.85 +subsubsection \<open>Properties of max2\<close>
   12.86  
   12.87  lemma max2_greater_among:
   12.88  assumes "a \<in> Field r" and "b \<in> Field r"
   12.89 @@ -191,7 +191,7 @@
   12.90  unfolding max2_def by auto
   12.91  
   12.92  
   12.93 -subsubsection {* Existence and uniqueness for isMinim and well-definedness of minim *}
   12.94 +subsubsection \<open>Existence and uniqueness for isMinim and well-definedness of minim\<close>
   12.95  
   12.96  lemma isMinim_unique:
   12.97  assumes MINIM: "isMinim B a" and MINIM': "isMinim B a'"
   12.98 @@ -254,7 +254,7 @@
   12.99    unfolding minim_def using theI[of ?phi b] by blast
  12.100  qed
  12.101  
  12.102 -subsubsection{* Properties of minim *}
  12.103 +subsubsection\<open>Properties of minim\<close>
  12.104  
  12.105  lemma minim_in:
  12.106  assumes "B \<le> Field r" and "B \<noteq> {}"
  12.107 @@ -294,7 +294,7 @@
  12.108    using isMinim_unique by auto
  12.109  qed
  12.110  
  12.111 -subsubsection{* Properties of successor *}
  12.112 +subsubsection\<open>Properties of successor\<close>
  12.113  
  12.114  lemma suc_AboveS:
  12.115  assumes SUB: "B \<le> Field r" and ABOVES: "AboveS B \<noteq> {}"
  12.116 @@ -388,7 +388,7 @@
  12.117  qed
  12.118  
  12.119  
  12.120 -subsubsection {* Properties of order filters *}
  12.121 +subsubsection \<open>Properties of order filters\<close>
  12.122  
  12.123  lemma under_ofilter:
  12.124  "ofilter (under a)"
  12.125 @@ -494,7 +494,7 @@
  12.126    thus "A \<le> (\<Union>a \<in> A. under a)" by blast
  12.127  qed
  12.128  
  12.129 -subsubsection{* Other properties *}
  12.130 +subsubsection\<open>Other properties\<close>
  12.131  
  12.132  lemma ofilter_linord:
  12.133  assumes OF1: "ofilter A" and OF2: "ofilter B"
    13.1 --- a/src/HOL/Basic_BNFs.thy	Sat Jul 18 21:44:18 2015 +0200
    13.2 +++ b/src/HOL/Basic_BNFs.thy	Sat Jul 18 22:58:50 2015 +0200
    13.3 @@ -7,7 +7,7 @@
    13.4  Registration of basic types as bounded natural functors.
    13.5  *)
    13.6  
    13.7 -section {* Registration of Basic Types as Bounded Natural Functors *}
    13.8 +section \<open>Registration of Basic Types as Bounded Natural Functors\<close>
    13.9  
   13.10  theory Basic_BNFs
   13.11  imports BNF_Def
    14.1 --- a/src/HOL/Binomial.thy	Sat Jul 18 21:44:18 2015 +0200
    14.2 +++ b/src/HOL/Binomial.thy	Sat Jul 18 22:58:50 2015 +0200
    14.3 @@ -5,13 +5,13 @@
    14.4      The integer version of factorial and other additions by Jeremy Avigad.
    14.5  *)
    14.6  
    14.7 -section{*Factorial Function, Binomial Coefficients and Binomial Theorem*}
    14.8 +section\<open>Factorial Function, Binomial Coefficients and Binomial Theorem\<close>
    14.9  
   14.10  theory Binomial
   14.11  imports Main
   14.12  begin
   14.13  
   14.14 -subsection {* Factorial *}
   14.15 +subsection \<open>Factorial\<close>
   14.16  
   14.17  fun fact :: "nat \<Rightarrow> ('a::semiring_char_0)"
   14.18    where "fact 0 = 1" | "fact (Suc n) = of_nat (Suc n) * fact n"
   14.19 @@ -74,7 +74,7 @@
   14.20  
   14.21  end
   14.22  
   14.23 -text{*Note that @{term "fact 0 = fact 1"}*}
   14.24 +text\<open>Note that @{term "fact 0 = fact 1"}\<close>
   14.25  lemma fact_less_mono_nat: "\<lbrakk>0 < m; m < n\<rbrakk> \<Longrightarrow> fact m < (fact n :: nat)"
   14.26    by (induct n) (auto simp: less_Suc_eq)
   14.27  
   14.28 @@ -121,7 +121,7 @@
   14.29        by (simp add: atLeastAtMostSuc_conv)
   14.30      finally show ?case .
   14.31    qed
   14.32 -  from this `m = n + d` show ?thesis by simp
   14.33 +  from this \<open>m = n + d\<close> show ?thesis by simp
   14.34  qed
   14.35  
   14.36  lemma fact_num_eq_if: 
   14.37 @@ -141,15 +141,15 @@
   14.38      by (induct r rule: nat.induct) (auto simp add: fact_div_fact Suc_diff_Suc mult_le_mono)
   14.39  qed
   14.40  
   14.41 -lemma fact_numeral:  --{*Evaluation for specific numerals*}
   14.42 +lemma fact_numeral:  --\<open>Evaluation for specific numerals\<close>
   14.43    "fact (numeral k) = (numeral k) * (fact (pred_numeral k))"
   14.44    by (metis fact.simps(2) numeral_eq_Suc of_nat_numeral)
   14.45  
   14.46  
   14.47 -text {* This development is based on the work of Andy Gordon and
   14.48 -  Florian Kammueller. *}
   14.49 +text \<open>This development is based on the work of Andy Gordon and
   14.50 +  Florian Kammueller.\<close>
   14.51  
   14.52 -subsection {* Basic definitions and lemmas *}
   14.53 +subsection \<open>Basic definitions and lemmas\<close>
   14.54  
   14.55  primrec binomial :: "nat \<Rightarrow> nat \<Rightarrow> nat" (infixl "choose" 65)
   14.56  where
   14.57 @@ -207,27 +207,27 @@
   14.58    apply (auto simp: power_Suc)
   14.59    by (simp add: add_le_mono mult_2)
   14.60  
   14.61 -text{*The absorption property*}
   14.62 +text\<open>The absorption property\<close>
   14.63  lemma Suc_times_binomial:
   14.64    "Suc k * (Suc n choose Suc k) = Suc n * (n choose k)"
   14.65    using Suc_times_binomial_eq by auto
   14.66  
   14.67 -text{*This is the well-known version of absorption, but it's harder to use because of the
   14.68 -  need to reason about division.*}
   14.69 +text\<open>This is the well-known version of absorption, but it's harder to use because of the
   14.70 +  need to reason about division.\<close>
   14.71  lemma binomial_Suc_Suc_eq_times:
   14.72      "(Suc n choose Suc k) = (Suc n * (n choose k)) div Suc k"
   14.73    by (simp add: Suc_times_binomial_eq del: mult_Suc mult_Suc_right)
   14.74  
   14.75 -text{*Another version of absorption, with -1 instead of Suc.*}
   14.76 +text\<open>Another version of absorption, with -1 instead of Suc.\<close>
   14.77  lemma times_binomial_minus1_eq:
   14.78    "0 < k \<Longrightarrow> k * (n choose k) = n * ((n - 1) choose (k - 1))"
   14.79    using Suc_times_binomial_eq [where n = "n - 1" and k = "k - 1"]
   14.80    by (auto split add: nat_diff_split)
   14.81  
   14.82  
   14.83 -subsection {* Combinatorial theorems involving @{text "choose"} *}
   14.84 +subsection \<open>Combinatorial theorems involving @{text "choose"}\<close>
   14.85  
   14.86 -text {*By Florian Kamm\"uller, tidied by LCP.*}
   14.87 +text \<open>By Florian Kamm\"uller, tidied by LCP.\<close>
   14.88  
   14.89  lemma card_s_0_eq_empty: "finite A \<Longrightarrow> card {B. B \<subseteq> A & card B = 0} = 1"
   14.90    by (simp cong add: conj_cong add: finite_subset [THEN card_0_eq])
   14.91 @@ -246,9 +246,9 @@
   14.92    shows "finite {x. \<exists>A \<subseteq> B. P x A}"
   14.93    by (metis (no_types) assms finite_Collect_bounded_ex finite_Collect_subsets)
   14.94  
   14.95 -text{*There are as many subsets of @{term A} having cardinality @{term k}
   14.96 +text\<open>There are as many subsets of @{term A} having cardinality @{term k}
   14.97   as there are sets obtained from the former by inserting a fixed element
   14.98 - @{term x} into each.*}
   14.99 + @{term x} into each.\<close>
  14.100  lemma constr_bij:
  14.101     "finite A \<Longrightarrow> x \<notin> A \<Longrightarrow>
  14.102      card {B. \<exists>C. C \<subseteq> A \<and> card C = k \<and> B = insert x C} =
  14.103 @@ -258,16 +258,16 @@
  14.104    apply (metis card_Diff_singleton_if finite_subset in_mono)
  14.105    done
  14.106  
  14.107 -text {*
  14.108 +text \<open>
  14.109    Main theorem: combinatorial statement about number of subsets of a set.
  14.110 -*}
  14.111 +\<close>
  14.112  
  14.113  theorem n_subsets: "finite A \<Longrightarrow> card {B. B \<subseteq> A \<and> card B = k} = (card A choose k)"
  14.114  proof (induct k arbitrary: A)
  14.115    case 0 then show ?case by (simp add: card_s_0_eq_empty)
  14.116  next
  14.117    case (Suc k)
  14.118 -  show ?case using `finite A`
  14.119 +  show ?case using \<open>finite A\<close>
  14.120    proof (induct A)
  14.121      case empty show ?case by (simp add: card_s_0_eq_empty)
  14.122    next
  14.123 @@ -285,9 +285,9 @@
  14.124  qed
  14.125  
  14.126  
  14.127 -subsection {* The binomial theorem (courtesy of Tobias Nipkow): *}
  14.128 +subsection \<open>The binomial theorem (courtesy of Tobias Nipkow):\<close>
  14.129  
  14.130 -text{* Avigad's version, generalized to any commutative ring *}
  14.131 +text\<open>Avigad's version, generalized to any commutative ring\<close>
  14.132  theorem binomial_ring: "(a+b::'a::{comm_ring_1,power})^n =
  14.133    (\<Sum>k=0..n. (of_nat (n choose k)) * a^k * b^(n-k))" (is "?P n")
  14.134  proof (induct n)
  14.135 @@ -324,7 +324,7 @@
  14.136    finally show "?P (Suc n)" by simp
  14.137  qed
  14.138  
  14.139 -text{* Original version for the naturals *}
  14.140 +text\<open>Original version for the naturals\<close>
  14.141  corollary binomial: "(a+b::nat)^n = (\<Sum>k=0..n. (of_nat (n choose k)) * a^k * b^(n-k))"
  14.142      using binomial_ring [of "int a" "int b" n]
  14.143    by (simp only: of_nat_add [symmetric] of_nat_mult [symmetric] of_nat_power [symmetric]
  14.144 @@ -386,7 +386,7 @@
  14.145    shows "(\<And>k. m \<le> k \<Longrightarrow> k \<le> n \<Longrightarrow> g k = f (m + n - k)) \<Longrightarrow> (\<Sum>k=m..n. f k) = (\<Sum>k=m..n. g k)"
  14.146    by (rule setsum.reindex_bij_witness[where i="\<lambda>k. m+n-k" and j="\<lambda>k. m+n-k"]) auto
  14.147  
  14.148 -text{*NW diagonal sum property*}
  14.149 +text\<open>NW diagonal sum property\<close>
  14.150  lemma sum_choose_diagonal:
  14.151    assumes "m\<le>n" shows "(\<Sum>k=0..m. (n-k) choose (m-k)) = Suc n choose m"
  14.152  proof -
  14.153 @@ -399,9 +399,9 @@
  14.154    finally show ?thesis .
  14.155  qed
  14.156  
  14.157 -subsection{* Pochhammer's symbol : generalized rising factorial *}
  14.158 +subsection\<open>Pochhammer's symbol : generalized rising factorial\<close>
  14.159  
  14.160 -text {* See @{url "http://en.wikipedia.org/wiki/Pochhammer_symbol"} *}
  14.161 +text \<open>See @{url "http://en.wikipedia.org/wiki/Pochhammer_symbol"}\<close>
  14.162  
  14.163  definition "pochhammer (a::'a::comm_semiring_1) n =
  14.164    (if n = 0 then 1 else setprod (\<lambda>n. a + of_nat n) {0 .. n - 1})"
  14.165 @@ -548,7 +548,7 @@
  14.166    by (simp add: of_nat_diff pochhammer_fact)
  14.167  
  14.168  
  14.169 -subsection{* Generalized binomial coefficients *}
  14.170 +subsection\<open>Generalized binomial coefficients\<close>
  14.171  
  14.172  definition gbinomial :: "'a::field_char_0 \<Rightarrow> nat \<Rightarrow> 'a" (infixl "gchoose" 65)
  14.173    where "a gchoose n =
  14.174 @@ -729,8 +729,8 @@
  14.175    then show ?thesis using kn by simp
  14.176  qed
  14.177  
  14.178 -text{*Contributed by Manuel Eberl, generalised by LCP.
  14.179 -  Alternative definition of the binomial coefficient as @{term "\<Prod>i<k. (n - i) / (k - i)"} *}
  14.180 +text\<open>Contributed by Manuel Eberl, generalised by LCP.
  14.181 +  Alternative definition of the binomial coefficient as @{term "\<Prod>i<k. (n - i) / (k - i)"}\<close>
  14.182  lemma gbinomial_altdef_of_nat:
  14.183    fixes k :: nat
  14.184      and x :: "'a :: {field_char_0,field}"
  14.185 @@ -769,15 +769,15 @@
  14.186      then have "x * of_nat (k - i) \<le> (x - of_nat i) * (of_nat k :: 'a)"
  14.187        unfolding of_nat_mult[symmetric] of_nat_le_iff .
  14.188      with assms show "x / of_nat k \<le> (x - of_nat i) / (of_nat (k - i) :: 'a)"
  14.189 -      using `i < k` by (simp add: field_simps)
  14.190 +      using \<open>i < k\<close> by (simp add: field_simps)
  14.191    qed (simp add: x zero_le_divide_iff)
  14.192    finally show ?thesis .
  14.193  qed
  14.194  
  14.195 -text{*Versions of the theorems above for the natural-number version of "choose"*}
  14.196 +text\<open>Versions of the theorems above for the natural-number version of "choose"\<close>
  14.197  lemma binomial_altdef_of_nat:
  14.198    fixes n k :: nat
  14.199 -    and x :: "'a :: {field_char_0,field}"  --{*the point is to constrain @{typ 'a}*}
  14.200 +    and x :: "'a :: {field_char_0,field}"  --\<open>the point is to constrain @{typ 'a}\<close>
  14.201    assumes "k \<le> n"
  14.202    shows "of_nat (n choose k) = (\<Prod>i<k. of_nat (n - i) / of_nat (k - i) :: 'a)"
  14.203  using assms
  14.204 @@ -795,7 +795,7 @@
  14.205    shows "n choose r \<le> n ^ r"
  14.206  proof -
  14.207    have "n choose r \<le> fact n div fact (n - r)"
  14.208 -    using `r \<le> n` by (subst binomial_fact_lemma[symmetric]) auto
  14.209 +    using \<open>r \<le> n\<close> by (subst binomial_fact_lemma[symmetric]) auto
  14.210    with fact_div_fact_le_pow [OF assms] show ?thesis by auto
  14.211  qed
  14.212  
  14.213 @@ -838,7 +838,7 @@
  14.214      by (simp add: binomial_altdef_nat mult.commute)
  14.215  qed
  14.216  
  14.217 -text{*The "Subset of a Subset" identity*}
  14.218 +text\<open>The "Subset of a Subset" identity\<close>
  14.219  lemma choose_mult:
  14.220    assumes "k\<le>m" "m\<le>n"
  14.221      shows "(n choose m) * (m choose k) = (n choose k) * ((n-k) choose (m-k))"
  14.222 @@ -846,7 +846,7 @@
  14.223  by simp
  14.224  
  14.225  
  14.226 -subsection {* Binomial coefficients *}
  14.227 +subsection \<open>Binomial coefficients\<close>
  14.228  
  14.229  lemma choose_one: "(n::nat) choose 1 = n"
  14.230    by simp
  14.231 @@ -885,7 +885,7 @@
  14.232      fix x
  14.233      assume x: "x \<in> \<Union>A"
  14.234      def K \<equiv> "{X \<in> A. x \<in> X}"
  14.235 -    with `finite A` have K: "finite K" by auto
  14.236 +    with \<open>finite A\<close> have K: "finite K" by auto
  14.237      let ?I = "\<lambda>i. {I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I}"
  14.238      have "inj_on snd (SIGMA i:{1..card A}. ?I i)"
  14.239        using assms by(auto intro!: inj_onI)
  14.240 @@ -901,7 +901,7 @@
  14.241        by(subst setsum_right_distrib) simp
  14.242      also have "\<dots> = (\<Sum>i=1..card K. (- 1) ^ (i + 1) * (\<Sum>I|I \<subseteq> K \<and> card I = i. 1))" (is "_ = ?rhs")
  14.243      proof(rule setsum.mono_neutral_cong_right[rule_format])
  14.244 -      show "{1..card K} \<subseteq> {1..card A}" using `finite A`
  14.245 +      show "{1..card K} \<subseteq> {1..card A}" using \<open>finite A\<close>
  14.246          by(auto simp add: K_def intro: card_mono)
  14.247      next
  14.248        fix i
  14.249 @@ -909,7 +909,7 @@
  14.250        hence i: "i \<le> card A" "card K < i" by auto
  14.251        have "{I. I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I} = {I. I \<subseteq> K \<and> card I = i}"
  14.252          by(auto simp add: K_def)
  14.253 -      also have "\<dots> = {}" using `finite A` i
  14.254 +      also have "\<dots> = {}" using \<open>finite A\<close> i
  14.255          by(auto simp add: K_def dest: card_mono[rotated 1])
  14.256        finally show "(- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. 1 :: int) = 0"
  14.257          by(simp only:) simp
  14.258 @@ -937,8 +937,8 @@
  14.259    finally show ?thesis ..
  14.260  qed
  14.261  
  14.262 -text{* The number of nat lists of length @{text m} summing to @{text N} is
  14.263 -@{term "(N + m - 1) choose N"}: *}
  14.264 +text\<open>The number of nat lists of length @{text m} summing to @{text N} is
  14.265 +@{term "(N + m - 1) choose N"}:\<close>
  14.266  
  14.267  lemma card_length_listsum_rec:
  14.268    assumes "m\<ge>1"
  14.269 @@ -1007,7 +1007,7 @@
  14.270        proof cases
  14.271          assume "m = 1"
  14.272          with Suc.hyps have "N\<ge>1" by auto
  14.273 -        with `m = 1` show ?thesis by (simp add: binomial_eq_0)
  14.274 +        with \<open>m = 1\<close> show ?thesis by (simp add: binomial_eq_0)
  14.275        next
  14.276          assume "m \<noteq> 1" thus ?thesis using Suc by fastforce
  14.277        qed
    15.1 --- a/src/HOL/Code_Evaluation.thy	Sat Jul 18 21:44:18 2015 +0200
    15.2 +++ b/src/HOL/Code_Evaluation.thy	Sat Jul 18 22:58:50 2015 +0200
    15.3 @@ -2,16 +2,16 @@
    15.4      Author:     Florian Haftmann, TU Muenchen
    15.5  *)
    15.6  
    15.7 -section {* Term evaluation using the generic code generator *}
    15.8 +section \<open>Term evaluation using the generic code generator\<close>
    15.9  
   15.10  theory Code_Evaluation
   15.11  imports Typerep Limited_Sequence
   15.12  keywords "value" :: diag
   15.13  begin
   15.14  
   15.15 -subsection {* Term representation *}
   15.16 +subsection \<open>Term representation\<close>
   15.17  
   15.18 -subsubsection {* Terms and class @{text term_of} *}
   15.19 +subsubsection \<open>Terms and class @{text term_of}\<close>
   15.20  
   15.21  datatype (plugins only: code extraction) "term" = dummy_term
   15.22  
   15.23 @@ -44,7 +44,7 @@
   15.24    by (simp only: valapp_def fst_conv snd_conv)
   15.25  
   15.26  
   15.27 -subsubsection {* Syntax *}
   15.28 +subsubsection \<open>Syntax\<close>
   15.29  
   15.30  definition termify :: "'a \<Rightarrow> term" where
   15.31    [code del]: "termify x = dummy_term"
   15.32 @@ -66,7 +66,7 @@
   15.33    and valapp (infixl "{\<cdot>}" 70)
   15.34  
   15.35  
   15.36 -subsection {* Tools setup and evaluation *}
   15.37 +subsection \<open>Tools setup and evaluation\<close>
   15.38  
   15.39  lemma eq_eq_TrueD:
   15.40    assumes "(x \<equiv> y) \<equiv> Trueprop True"
   15.41 @@ -87,7 +87,7 @@
   15.42  ML_file "~~/src/HOL/Tools/value.ML"
   15.43  
   15.44  
   15.45 -subsection {* @{text term_of} instances *}
   15.46 +subsection \<open>@{text term_of} instances\<close>
   15.47  
   15.48  instantiation "fun" :: (typerep, typerep) term_of
   15.49  begin
   15.50 @@ -138,12 +138,12 @@
   15.51  code_reserved Eval HOLogic
   15.52  
   15.53  
   15.54 -subsection {* Generic reification *}
   15.55 +subsection \<open>Generic reification\<close>
   15.56  
   15.57  ML_file "~~/src/HOL/Tools/reification.ML"
   15.58  
   15.59  
   15.60 -subsection {* Diagnostic *}
   15.61 +subsection \<open>Diagnostic\<close>
   15.62  
   15.63  definition tracing :: "String.literal \<Rightarrow> 'a \<Rightarrow> 'a" where
   15.64    [code del]: "tracing s x = x"
    16.1 --- a/src/HOL/Code_Numeral.thy	Sat Jul 18 21:44:18 2015 +0200
    16.2 +++ b/src/HOL/Code_Numeral.thy	Sat Jul 18 22:58:50 2015 +0200
    16.3 @@ -2,13 +2,13 @@
    16.4      Author:     Florian Haftmann, TU Muenchen
    16.5  *)
    16.6  
    16.7 -section {* Numeric types for code generation onto target language numerals only *}
    16.8 +section \<open>Numeric types for code generation onto target language numerals only\<close>
    16.9  
   16.10  theory Code_Numeral
   16.11  imports Nat_Transfer Divides Lifting
   16.12  begin
   16.13  
   16.14 -subsection {* Type of target language integers *}
   16.15 +subsection \<open>Type of target language integers\<close>
   16.16  
   16.17  typedef integer = "UNIV \<Colon> int set"
   16.18    morphisms int_of_integer integer_of_int ..
   16.19 @@ -238,9 +238,9 @@
   16.20    "integer_of_nat (numeral n) = numeral n"
   16.21  by transfer simp
   16.22  
   16.23 -subsection {* Code theorems for target language integers *}
   16.24 +subsection \<open>Code theorems for target language integers\<close>
   16.25  
   16.26 -text {* Constructors *}
   16.27 +text \<open>Constructors\<close>
   16.28  
   16.29  definition Pos :: "num \<Rightarrow> integer"
   16.30  where
   16.31 @@ -261,7 +261,7 @@
   16.32  code_datatype "0::integer" Pos Neg
   16.33  
   16.34  
   16.35 -text {* Auxiliary operations *}
   16.36 +text \<open>Auxiliary operations\<close>
   16.37  
   16.38  lift_definition dup :: "integer \<Rightarrow> integer"
   16.39    is "\<lambda>k::int. k + k"
   16.40 @@ -290,7 +290,7 @@
   16.41    by (transfer, simp add: dbl_def dbl_inc_def dbl_dec_def)+
   16.42  
   16.43  
   16.44 -text {* Implementations *}
   16.45 +text \<open>Implementations\<close>
   16.46  
   16.47  lemma one_integer_code [code, code_unfold]:
   16.48    "1 = Pos Num.One"
   16.49 @@ -520,7 +520,7 @@
   16.50  hide_const (open) Pos Neg sub dup divmod_abs
   16.51  
   16.52  
   16.53 -subsection {* Serializer setup for target language integers *}
   16.54 +subsection \<open>Serializer setup for target language integers\<close>
   16.55  
   16.56  code_reserved Eval int Integer abs
   16.57  
   16.58 @@ -541,12 +541,12 @@
   16.59      and (Haskell) "!(0/ ::/ Integer)"
   16.60      and (Scala) "BigInt(0)"
   16.61  
   16.62 -setup {*
   16.63 +setup \<open>
   16.64    fold (fn target =>
   16.65      Numeral.add_code @{const_name Code_Numeral.Pos} I Code_Printer.literal_numeral target
   16.66      #> Numeral.add_code @{const_name Code_Numeral.Neg} (op ~) Code_Printer.literal_numeral target)
   16.67      ["SML", "OCaml", "Haskell", "Scala"]
   16.68 -*}
   16.69 +\<close>
   16.70  
   16.71  code_printing
   16.72    constant "plus :: integer \<Rightarrow> _ \<Rightarrow> _" \<rightharpoonup>
   16.73 @@ -613,7 +613,7 @@
   16.74    code_module Code_Numeral \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
   16.75  
   16.76  
   16.77 -subsection {* Type of target language naturals *}
   16.78 +subsection \<open>Type of target language naturals\<close>
   16.79  
   16.80  typedef natural = "UNIV \<Colon> nat set"
   16.81    morphisms nat_of_natural natural_of_nat ..
   16.82 @@ -787,7 +787,7 @@
   16.83    by (rule is_measure_trivial)
   16.84  
   16.85  
   16.86 -subsection {* Inductive representation of target language naturals *}
   16.87 +subsection \<open>Inductive representation of target language naturals\<close>
   16.88  
   16.89  lift_definition Suc :: "natural \<Rightarrow> natural"
   16.90    is Nat.Suc
   16.91 @@ -831,7 +831,7 @@
   16.92  hide_const (open) Suc
   16.93  
   16.94  
   16.95 -subsection {* Code refinement for target language naturals *}
   16.96 +subsection \<open>Code refinement for target language naturals\<close>
   16.97  
   16.98  lift_definition Nat :: "integer \<Rightarrow> natural"
   16.99    is nat
    17.1 --- a/src/HOL/Coinduction.thy	Sat Jul 18 21:44:18 2015 +0200
    17.2 +++ b/src/HOL/Coinduction.thy	Sat Jul 18 22:58:50 2015 +0200
    17.3 @@ -6,7 +6,7 @@
    17.4  Coinduction method that avoids some boilerplate compared to coinduct.
    17.5  *)
    17.6  
    17.7 -section {* Coinduction Method *}
    17.8 +section \<open>Coinduction Method\<close>
    17.9  
   17.10  theory Coinduction
   17.11  imports Ctr_Sugar
    18.1 --- a/src/HOL/Complete_Lattices.thy	Sat Jul 18 21:44:18 2015 +0200
    18.2 +++ b/src/HOL/Complete_Lattices.thy	Sat Jul 18 22:58:50 2015 +0200
    18.3 @@ -1,6 +1,6 @@
    18.4  (*  Author:     Tobias Nipkow, Lawrence C Paulson and Markus Wenzel; Florian Haftmann, TU Muenchen *)
    18.5  
    18.6 -section {* Complete lattices *}
    18.7 +section \<open>Complete lattices\<close>
    18.8  
    18.9  theory Complete_Lattices
   18.10  imports Fun
   18.11 @@ -11,7 +11,7 @@
   18.12    less (infix "\<sqsubset>" 50)
   18.13  
   18.14  
   18.15 -subsection {* Syntactic infimum and supremum operations *}
   18.16 +subsection \<open>Syntactic infimum and supremum operations\<close>
   18.17  
   18.18  class Inf =
   18.19    fixes Inf :: "'a set \<Rightarrow> 'a" ("\<Sqinter>_" [900] 900)
   18.20 @@ -79,11 +79,11 @@
   18.21  
   18.22  end
   18.23  
   18.24 -text {*
   18.25 +text \<open>
   18.26    Note: must use names @{const INFIMUM} and @{const SUPREMUM} here instead of
   18.27    @{text INF} and @{text SUP} to allow the following syntax coexist
   18.28    with the plain constant names.
   18.29 -*}
   18.30 +\<close>
   18.31  
   18.32  syntax
   18.33    "_INF1"     :: "pttrns \<Rightarrow> 'b \<Rightarrow> 'b"           ("(3INF _./ _)" [0, 10] 10)
   18.34 @@ -107,17 +107,17 @@
   18.35    "SUP x. B"     == "SUP x:CONST UNIV. B"
   18.36    "SUP x:A. B"   == "CONST SUPREMUM A (%x. B)"
   18.37  
   18.38 -print_translation {*
   18.39 +print_translation \<open>
   18.40    [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax INFIMUM} @{syntax_const "_INF"},
   18.41      Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax SUPREMUM} @{syntax_const "_SUP"}]
   18.42 -*} -- {* to avoid eta-contraction of body *}
   18.43 +\<close> -- \<open>to avoid eta-contraction of body\<close>
   18.44  
   18.45 -subsection {* Abstract complete lattices *}
   18.46 +subsection \<open>Abstract complete lattices\<close>
   18.47  
   18.48 -text {* A complete lattice always has a bottom and a top,
   18.49 +text \<open>A complete lattice always has a bottom and a top,
   18.50  so we include them into the following type class,
   18.51  along with assumptions that define bottom and top
   18.52 -in terms of infimum and supremum. *}
   18.53 +in terms of infimum and supremum.\<close>
   18.54  
   18.55  class complete_lattice = lattice + Inf + Sup + bot + top +
   18.56    assumes Inf_lower: "x \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> x"
   18.57 @@ -250,8 +250,8 @@
   18.58  proof (rule Inf_greatest)
   18.59    fix b assume "b \<in> B"
   18.60    with assms obtain a where "a \<in> A" and "a \<sqsubseteq> b" by blast
   18.61 -  from `a \<in> A` have "\<Sqinter>A \<sqsubseteq> a" by (rule Inf_lower)
   18.62 -  with `a \<sqsubseteq> b` show "\<Sqinter>A \<sqsubseteq> b" by auto
   18.63 +  from \<open>a \<in> A\<close> have "\<Sqinter>A \<sqsubseteq> a" by (rule Inf_lower)
   18.64 +  with \<open>a \<sqsubseteq> b\<close> show "\<Sqinter>A \<sqsubseteq> b" by auto
   18.65  qed
   18.66  
   18.67  lemma INF_mono:
   18.68 @@ -264,8 +264,8 @@
   18.69  proof (rule Sup_least)
   18.70    fix a assume "a \<in> A"
   18.71    with assms obtain b where "b \<in> B" and "a \<sqsubseteq> b" by blast
   18.72 -  from `b \<in> B` have "b \<sqsubseteq> \<Squnion>B" by (rule Sup_upper)
   18.73 -  with `a \<sqsubseteq> b` show "a \<sqsubseteq> \<Squnion>B" by auto
   18.74 +  from \<open>b \<in> B\<close> have "b \<sqsubseteq> \<Squnion>B" by (rule Sup_upper)
   18.75 +  with \<open>a \<sqsubseteq> b\<close> show "a \<sqsubseteq> \<Squnion>B" by auto
   18.76  qed
   18.77  
   18.78  lemma SUP_mono:
   18.79 @@ -274,7 +274,7 @@
   18.80  
   18.81  lemma INF_superset_mono:
   18.82    "B \<subseteq> A \<Longrightarrow> (\<And>x. x \<in> B \<Longrightarrow> f x \<sqsubseteq> g x) \<Longrightarrow> (\<Sqinter>x\<in>A. f x) \<sqsubseteq> (\<Sqinter>x\<in>B. g x)"
   18.83 -  -- {* The last inclusion is POSITIVE! *}
   18.84 +  -- \<open>The last inclusion is POSITIVE!\<close>
   18.85    by (blast intro: INF_mono dest: subsetD)
   18.86  
   18.87  lemma SUP_subset_mono:
   18.88 @@ -286,8 +286,8 @@
   18.89      and "A \<noteq> {}"
   18.90    shows "\<Sqinter>A \<sqsubseteq> u"
   18.91  proof -
   18.92 -  from `A \<noteq> {}` obtain v where "v \<in> A" by blast
   18.93 -  moreover from `v \<in> A` assms(1) have "v \<sqsubseteq> u" by blast
   18.94 +  from \<open>A \<noteq> {}\<close> obtain v where "v \<in> A" by blast
   18.95 +  moreover from \<open>v \<in> A\<close> assms(1) have "v \<sqsubseteq> u" by blast
   18.96    ultimately show ?thesis by (rule Inf_lower2)
   18.97  qed
   18.98  
   18.99 @@ -296,8 +296,8 @@
  18.100      and "A \<noteq> {}"
  18.101    shows "u \<sqsubseteq> \<Squnion>A"
  18.102  proof -
  18.103 -  from `A \<noteq> {}` obtain v where "v \<in> A" by blast
  18.104 -  moreover from `v \<in> A` assms(1) have "u \<sqsubseteq> v" by blast
  18.105 +  from \<open>A \<noteq> {}\<close> obtain v where "v \<in> A" by blast
  18.106 +  moreover from \<open>v \<in> A\<close> assms(1) have "u \<sqsubseteq> v" by blast
  18.107    ultimately show ?thesis by (rule Sup_upper2)
  18.108  qed
  18.109  
  18.110 @@ -359,7 +359,7 @@
  18.111        assume "\<not> (\<forall>x\<in>A. x = \<top>)"
  18.112        then obtain x where "x \<in> A" and "x \<noteq> \<top>" by blast
  18.113        then obtain B where "A = insert x B" by blast
  18.114 -      with `\<Sqinter>A = \<top>` `x \<noteq> \<top>` show False by simp
  18.115 +      with \<open>\<Sqinter>A = \<top>\<close> \<open>x \<noteq> \<top>\<close> show False by simp
  18.116      qed
  18.117    qed
  18.118    then show "\<top> = \<Sqinter>A \<longleftrightarrow> (\<forall>x\<in>A. x = \<top>)" by auto
  18.119 @@ -435,8 +435,8 @@
  18.120  lemma less_INF_D:
  18.121    assumes "y < (\<Sqinter>i\<in>A. f i)" "i \<in> A" shows "y < f i"
  18.122  proof -
  18.123 -  note `y < (\<Sqinter>i\<in>A. f i)`
  18.124 -  also have "(\<Sqinter>i\<in>A. f i) \<le> f i" using `i \<in> A`
  18.125 +  note \<open>y < (\<Sqinter>i\<in>A. f i)\<close>
  18.126 +  also have "(\<Sqinter>i\<in>A. f i) \<le> f i" using \<open>i \<in> A\<close>
  18.127      by (rule INF_lower)
  18.128    finally show "y < f i" .
  18.129  qed
  18.130 @@ -444,9 +444,9 @@
  18.131  lemma SUP_lessD:
  18.132    assumes "(\<Squnion>i\<in>A. f i) < y" "i \<in> A" shows "f i < y"
  18.133  proof -
  18.134 -  have "f i \<le> (\<Squnion>i\<in>A. f i)" using `i \<in> A`
  18.135 +  have "f i \<le> (\<Squnion>i\<in>A. f i)" using \<open>i \<in> A\<close>
  18.136      by (rule SUP_upper)
  18.137 -  also note `(\<Squnion>i\<in>A. f i) < y`
  18.138 +  also note \<open>(\<Squnion>i\<in>A. f i) < y\<close>
  18.139    finally show "f i < y" .
  18.140  qed
  18.141  
  18.142 @@ -550,19 +550,19 @@
  18.143  
  18.144  lemma mono_Inf:
  18.145    shows "f (\<Sqinter>A) \<le> (\<Sqinter>x\<in>A. f x)"
  18.146 -  using `mono f` by (auto intro: complete_lattice_class.INF_greatest Inf_lower dest: monoD)
  18.147 +  using \<open>mono f\<close> by (auto intro: complete_lattice_class.INF_greatest Inf_lower dest: monoD)
  18.148  
  18.149  lemma mono_Sup:
  18.150    shows "(\<Squnion>x\<in>A. f x) \<le> f (\<Squnion>A)"
  18.151 -  using `mono f` by (auto intro: complete_lattice_class.SUP_least Sup_upper dest: monoD)
  18.152 +  using \<open>mono f\<close> by (auto intro: complete_lattice_class.SUP_least Sup_upper dest: monoD)
  18.153  
  18.154  lemma mono_INF:
  18.155    "f (INF i : I. A i) \<le> (INF x : I. f (A x))"
  18.156 -  by (intro complete_lattice_class.INF_greatest monoD[OF `mono f`] INF_lower)
  18.157 +  by (intro complete_lattice_class.INF_greatest monoD[OF \<open>mono f\<close>] INF_lower)
  18.158  
  18.159  lemma mono_SUP:
  18.160    "(SUP x : I. f (A x)) \<le> f (SUP i : I. A i)"
  18.161 -  by (intro complete_lattice_class.SUP_least monoD[OF `mono f`] SUP_upper)
  18.162 +  by (intro complete_lattice_class.SUP_least monoD[OF \<open>mono f\<close>] SUP_upper)
  18.163  
  18.164  end
  18.165  
  18.166 @@ -698,7 +698,7 @@
  18.167  end
  18.168  
  18.169  
  18.170 -subsection {* Complete lattice on @{typ bool} *}
  18.171 +subsection \<open>Complete lattice on @{typ bool}\<close>
  18.172  
  18.173  instantiation bool :: complete_lattice
  18.174  begin
  18.175 @@ -734,7 +734,7 @@
  18.176  qed (auto intro: bool_induct)
  18.177  
  18.178  
  18.179 -subsection {* Complete lattice on @{typ "_ \<Rightarrow> _"} *}
  18.180 +subsection \<open>Complete lattice on @{typ "_ \<Rightarrow> _"}\<close>
  18.181  
  18.182  instantiation "fun" :: (type, Inf) Inf
  18.183  begin
  18.184 @@ -787,7 +787,7 @@
  18.185  instance "fun" :: (type, complete_boolean_algebra) complete_boolean_algebra ..
  18.186  
  18.187  
  18.188 -subsection {* Complete lattice on unary and binary predicates *}
  18.189 +subsection \<open>Complete lattice on unary and binary predicates\<close>
  18.190  
  18.191  lemma Inf1_I: 
  18.192    "(\<And>P. P \<in> A \<Longrightarrow> P a) \<Longrightarrow> (\<Sqinter>A) a"
  18.193 @@ -878,7 +878,7 @@
  18.194    using assms by auto
  18.195  
  18.196  
  18.197 -subsection {* Complete lattice on @{typ "_ set"} *}
  18.198 +subsection \<open>Complete lattice on @{typ "_ set"}\<close>
  18.199  
  18.200  instantiation "set" :: (type) complete_lattice
  18.201  begin
  18.202 @@ -899,7 +899,7 @@
  18.203  qed (auto simp add: INF_def SUP_def Inf_set_def Sup_set_def image_def)
  18.204    
  18.205  
  18.206 -subsubsection {* Inter *}
  18.207 +subsubsection \<open>Inter\<close>
  18.208  
  18.209  abbreviation Inter :: "'a set set \<Rightarrow> 'a set" where
  18.210    "Inter S \<equiv> \<Sqinter>S"
  18.211 @@ -923,18 +923,18 @@
  18.212  lemma InterI [intro!]: "(\<And>X. X \<in> C \<Longrightarrow> A \<in> X) \<Longrightarrow> A \<in> \<Inter>C"
  18.213    by (simp add: Inter_eq)
  18.214  
  18.215 -text {*
  18.216 +text \<open>
  18.217    \medskip A ``destruct'' rule -- every @{term X} in @{term C}
  18.218    contains @{term A} as an element, but @{prop "A \<in> X"} can hold when
  18.219    @{prop "X \<in> C"} does not!  This rule is analogous to @{text spec}.
  18.220 -*}
  18.221 +\<close>
  18.222  
  18.223  lemma InterD [elim, Pure.elim]: "A \<in> \<Inter>C \<Longrightarrow> X \<in> C \<Longrightarrow> A \<in> X"
  18.224    by auto
  18.225  
  18.226  lemma InterE [elim]: "A \<in> \<Inter>C \<Longrightarrow> (X \<notin> C \<Longrightarrow> R) \<Longrightarrow> (A \<in> X \<Longrightarrow> R) \<Longrightarrow> R"
  18.227 -  -- {* ``Classical'' elimination rule -- does not require proving
  18.228 -    @{prop "X \<in> C"}. *}
  18.229 +  -- \<open>``Classical'' elimination rule -- does not require proving
  18.230 +    @{prop "X \<in> C"}.\<close>
  18.231    by (unfold Inter_eq) blast
  18.232  
  18.233  lemma Inter_lower: "B \<in> A \<Longrightarrow> \<Inter>A \<subseteq> B"
  18.234 @@ -971,15 +971,15 @@
  18.235    by (fact Inf_superset_mono)
  18.236  
  18.237  
  18.238 -subsubsection {* Intersections of families *}
  18.239 +subsubsection \<open>Intersections of families\<close>
  18.240  
  18.241  abbreviation INTER :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" where
  18.242    "INTER \<equiv> INFIMUM"
  18.243  
  18.244 -text {*
  18.245 +text \<open>
  18.246    Note: must use name @{const INTER} here instead of @{text INT}
  18.247    to allow the following syntax coexist with the plain constant name.
  18.248 -*}
  18.249 +\<close>
  18.250  
  18.251  syntax
  18.252    "_INTER1"     :: "pttrns => 'b set => 'b set"           ("(3INT _./ _)" [0, 10] 10)
  18.253 @@ -999,9 +999,9 @@
  18.254    "INT x. B"    == "INT x:CONST UNIV. B"
  18.255    "INT x:A. B"  == "CONST INTER A (%x. B)"
  18.256  
  18.257 -print_translation {*
  18.258 +print_translation \<open>
  18.259    [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax INTER} @{syntax_const "_INTER"}]
  18.260 -*} -- {* to avoid eta-contraction of body *}
  18.261 +\<close> -- \<open>to avoid eta-contraction of body\<close>
  18.262  
  18.263  lemma INTER_eq:
  18.264    "(\<Inter>x\<in>A. B x) = {y. \<forall>x\<in>A. y \<in> B x}"
  18.265 @@ -1021,7 +1021,7 @@
  18.266    by auto
  18.267  
  18.268  lemma INT_E [elim]: "b \<in> (\<Inter>x\<in>A. B x) \<Longrightarrow> (b \<in> B a \<Longrightarrow> R) \<Longrightarrow> (a \<notin> A \<Longrightarrow> R) \<Longrightarrow> R"
  18.269 -  -- {* "Classical" elimination -- by the Excluded Middle on @{prop "a\<in>A"}. *}
  18.270 +  -- \<open>"Classical" elimination -- by the Excluded Middle on @{prop "a\<in>A"}.\<close>
  18.271    by (auto simp add: INF_def image_def)
  18.272  
  18.273  lemma Collect_ball_eq: "{x. \<forall>y\<in>A. P x y} = (\<Inter>y\<in>A. {x. P x y})"
  18.274 @@ -1068,7 +1068,7 @@
  18.275  
  18.276  lemma INT_anti_mono:
  18.277    "A \<subseteq> B \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<subseteq> g x) \<Longrightarrow> (\<Inter>x\<in>B. f x) \<subseteq> (\<Inter>x\<in>A. g x)"
  18.278 -  -- {* The last inclusion is POSITIVE! *}
  18.279 +  -- \<open>The last inclusion is POSITIVE!\<close>
  18.280    by (fact INF_superset_mono)
  18.281  
  18.282  lemma Pow_INT_eq: "Pow (\<Inter>x\<in>A. B x) = (\<Inter>x\<in>A. Pow (B x))"
  18.283 @@ -1078,7 +1078,7 @@
  18.284    by blast
  18.285  
  18.286  
  18.287 -subsubsection {* Union *}
  18.288 +subsubsection \<open>Union\<close>
  18.289  
  18.290  abbreviation Union :: "'a set set \<Rightarrow> 'a set" where
  18.291    "Union S \<equiv> \<Squnion>S"
  18.292 @@ -1102,8 +1102,8 @@
  18.293  
  18.294  lemma UnionI [intro]:
  18.295    "X \<in> C \<Longrightarrow> A \<in> X \<Longrightarrow> A \<in> \<Union>C"
  18.296 -  -- {* The order of the premises presupposes that @{term C} is rigid;
  18.297 -    @{term A} may be flexible. *}
  18.298 +  -- \<open>The order of the premises presupposes that @{term C} is rigid;
  18.299 +    @{term A} may be flexible.\<close>
  18.300    by auto
  18.301  
  18.302  lemma UnionE [elim!]:
  18.303 @@ -1147,15 +1147,15 @@
  18.304    by (fact Sup_subset_mono)
  18.305  
  18.306  
  18.307 -subsubsection {* Unions of families *}
  18.308 +subsubsection \<open>Unions of families\<close>
  18.309  
  18.310  abbreviation UNION :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" where
  18.311    "UNION \<equiv> SUPREMUM"
  18.312  
  18.313 -text {*
  18.314 +text \<open>
  18.315    Note: must use name @{const UNION} here instead of @{text UN}
  18.316    to allow the following syntax coexist with the plain constant name.
  18.317 -*}
  18.318 +\<close>
  18.319  
  18.320  syntax
  18.321    "_UNION1"     :: "pttrns => 'b set => 'b set"           ("(3UN _./ _)" [0, 10] 10)
  18.322 @@ -1175,18 +1175,18 @@
  18.323    "UN x. B"     == "UN x:CONST UNIV. B"
  18.324    "UN x:A. B"   == "CONST UNION A (%x. B)"
  18.325  
  18.326 -text {*
  18.327 +text \<open>
  18.328    Note the difference between ordinary xsymbol syntax of indexed
  18.329    unions and intersections (e.g.\ @{text"\<Union>a\<^sub>1\<in>A\<^sub>1. B"})
  18.330    and their \LaTeX\ rendition: @{term"\<Union>a\<^sub>1\<in>A\<^sub>1. B"}. The
  18.331    former does not make the index expression a subscript of the
  18.332    union/intersection symbol because this leads to problems with nested
  18.333    subscripts in Proof General.
  18.334 -*}
  18.335 +\<close>
  18.336  
  18.337 -print_translation {*
  18.338 +print_translation \<open>
  18.339    [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax UNION} @{syntax_const "_UNION"}]
  18.340 -*} -- {* to avoid eta-contraction of body *}
  18.341 +\<close> -- \<open>to avoid eta-contraction of body\<close>
  18.342  
  18.343  lemma UNION_eq:
  18.344    "(\<Union>x\<in>A. B x) = {y. \<exists>x\<in>A. y \<in> B x}"
  18.345 @@ -1211,8 +1211,8 @@
  18.346    using Union_iff [of _ "B ` A"] by simp
  18.347  
  18.348  lemma UN_I [intro]: "a \<in> A \<Longrightarrow> b \<in> B a \<Longrightarrow> b \<in> (\<Union>x\<in>A. B x)"
  18.349 -  -- {* The order of the premises presupposes that @{term A} is rigid;
  18.350 -    @{term b} may be flexible. *}
  18.351 +  -- \<open>The order of the premises presupposes that @{term A} is rigid;
  18.352 +    @{term b} may be flexible.\<close>
  18.353    by auto
  18.354  
  18.355  lemma UN_E [elim!]: "b \<in> (\<Union>x\<in>A. B x) \<Longrightarrow> (\<And>x. x\<in>A \<Longrightarrow> b \<in> B x \<Longrightarrow> R) \<Longrightarrow> R"
  18.356 @@ -1295,7 +1295,7 @@
  18.357    by blast
  18.358  
  18.359  lemma vimage_eq_UN: "f -` B = (\<Union>y\<in>B. f -` {y})"
  18.360 -  -- {* NOT suitable for rewriting *}
  18.361 +  -- \<open>NOT suitable for rewriting\<close>
  18.362    by blast
  18.363  
  18.364  lemma image_UN: "f ` UNION A B = (\<Union>x\<in>A. f ` B x)"
  18.365 @@ -1305,7 +1305,7 @@
  18.366    by blast
  18.367  
  18.368  
  18.369 -subsubsection {* Distributive laws *}
  18.370 +subsubsection \<open>Distributive laws\<close>
  18.371  
  18.372  lemma Int_Union: "A \<inter> \<Union>B = (\<Union>C\<in>B. A \<inter> C)"
  18.373    by (fact inf_Sup)
  18.374 @@ -1322,19 +1322,19 @@
  18.375  lemma UN_Un_distrib: "(\<Union>i\<in>I. A i \<union> B i) = (\<Union>i\<in>I. A i) \<union> (\<Union>i\<in>I. B i)"
  18.376    by (rule sym) (rule SUP_sup_distrib)
  18.377  
  18.378 -lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A ` C) \<inter> \<Inter>(B ` C)" -- {* FIXME drop *}
  18.379 +lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A ` C) \<inter> \<Inter>(B ` C)" -- \<open>FIXME drop\<close>
  18.380    by (simp add: INT_Int_distrib)
  18.381  
  18.382 -lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A ` C) \<union> \<Union>(B ` C)" -- {* FIXME drop *}
  18.383 -  -- {* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: *}
  18.384 -  -- {* Union of a family of unions *}
  18.385 +lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A ` C) \<union> \<Union>(B ` C)" -- \<open>FIXME drop\<close>
  18.386 +  -- \<open>Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5:\<close>
  18.387 +  -- \<open>Union of a family of unions\<close>
  18.388    by (simp add: UN_Un_distrib)
  18.389  
  18.390  lemma Un_INT_distrib: "B \<union> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. B \<union> A i)"
  18.391    by (fact sup_INF)
  18.392  
  18.393  lemma Int_UN_distrib: "B \<inter> (\<Union>i\<in>I. A i) = (\<Union>i\<in>I. B \<inter> A i)"
  18.394 -  -- {* Halmos, Naive Set Theory, page 35. *}
  18.395 +  -- \<open>Halmos, Naive Set Theory, page 35.\<close>
  18.396    by (fact inf_SUP)
  18.397  
  18.398  lemma Int_UN_distrib2: "(\<Union>i\<in>I. A i) \<inter> (\<Union>j\<in>J. B j) = (\<Union>i\<in>I. \<Union>j\<in>J. A i \<inter> B j)"
  18.399 @@ -1347,7 +1347,7 @@
  18.400    by (fact Sup_inf_eq_bot_iff)
  18.401  
  18.402  
  18.403 -subsection {* Injections and bijections *}
  18.404 +subsection \<open>Injections and bijections\<close>
  18.405  
  18.406  lemma inj_on_Inter:
  18.407    "S \<noteq> {} \<Longrightarrow> (\<And>A. A \<in> S \<Longrightarrow> inj_on f A) \<Longrightarrow> inj_on f (\<Inter>S)"
  18.408 @@ -1429,7 +1429,7 @@
  18.409  by (auto split: if_splits)
  18.410  
  18.411  
  18.412 -subsubsection {* Complement *}
  18.413 +subsubsection \<open>Complement\<close>
  18.414  
  18.415  lemma Compl_INT [simp]: "- (\<Inter>x\<in>A. B x) = (\<Union>x\<in>A. -B x)"
  18.416    by (fact uminus_INF)
  18.417 @@ -1438,10 +1438,10 @@
  18.418    by (fact uminus_SUP)
  18.419  
  18.420  
  18.421 -subsubsection {* Miniscoping and maxiscoping *}
  18.422 +subsubsection \<open>Miniscoping and maxiscoping\<close>
  18.423  
  18.424 -text {* \medskip Miniscoping: pushing in quantifiers and big Unions
  18.425 -           and Intersections. *}
  18.426 +text \<open>\medskip Miniscoping: pushing in quantifiers and big Unions
  18.427 +           and Intersections.\<close>
  18.428  
  18.429  lemma UN_simps [simp]:
  18.430    "\<And>a B C. (\<Union>x\<in>C. insert a (B x)) = (if C={} then {} else insert a (\<Union>x\<in>C. B x))"
  18.431 @@ -1477,7 +1477,7 @@
  18.432    by auto
  18.433  
  18.434  
  18.435 -text {* \medskip Maxiscoping: pulling out big Unions and Intersections. *}
  18.436 +text \<open>\medskip Maxiscoping: pulling out big Unions and Intersections.\<close>
  18.437  
  18.438  lemma UN_extend_simps:
  18.439    "\<And>a B C. insert a (\<Union>x\<in>C. B x) = (if C={} then {a} else (\<Union>x\<in>C. insert a (B x)))"
  18.440 @@ -1505,7 +1505,7 @@
  18.441    "\<And>A B f. (\<Inter>a\<in>A. B (f a)) = (\<Inter>x\<in>f`A. B x)"
  18.442    by auto
  18.443  
  18.444 -text {* Finally *}
  18.445 +text \<open>Finally\<close>
  18.446  
  18.447  no_notation
  18.448    less_eq (infix "\<sqsubseteq>" 50) and
  18.449 @@ -1514,7 +1514,7 @@
  18.450  lemmas mem_simps =
  18.451    insert_iff empty_iff Un_iff Int_iff Compl_iff Diff_iff
  18.452    mem_Collect_eq UN_iff Union_iff INT_iff Inter_iff
  18.453 -  -- {* Each of these has ALREADY been added @{text "[simp]"} above. *}
  18.454 +  -- \<open>Each of these has ALREADY been added @{text "[simp]"} above.\<close>
  18.455  
  18.456  end
  18.457  
    19.1 --- a/src/HOL/Complete_Partial_Order.thy	Sat Jul 18 21:44:18 2015 +0200
    19.2 +++ b/src/HOL/Complete_Partial_Order.thy	Sat Jul 18 22:58:50 2015 +0200
    19.3 @@ -3,15 +3,15 @@
    19.4     Author:   Alexander Krauss, TU Muenchen
    19.5  *)
    19.6  
    19.7 -section {* Chain-complete partial orders and their fixpoints *}
    19.8 +section \<open>Chain-complete partial orders and their fixpoints\<close>
    19.9  
   19.10  theory Complete_Partial_Order
   19.11  imports Product_Type
   19.12  begin
   19.13  
   19.14 -subsection {* Monotone functions *}
   19.15 +subsection \<open>Monotone functions\<close>
   19.16  
   19.17 -text {* Dictionary-passing version of @{const Orderings.mono}. *}
   19.18 +text \<open>Dictionary-passing version of @{const Orderings.mono}.\<close>
   19.19  
   19.20  definition monotone :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool"
   19.21  where "monotone orda ordb f \<longleftrightarrow> (\<forall>x y. orda x y \<longrightarrow> ordb (f x) (f y))"
   19.22 @@ -24,11 +24,11 @@
   19.23  unfolding monotone_def by iprover
   19.24  
   19.25  
   19.26 -subsection {* Chains *}
   19.27 +subsection \<open>Chains\<close>
   19.28  
   19.29 -text {* A chain is a totally-ordered set. Chains are parameterized over
   19.30 +text \<open>A chain is a totally-ordered set. Chains are parameterized over
   19.31    the order for maximal flexibility, since type classes are not enough.
   19.32 -*}
   19.33 +\<close>
   19.34  
   19.35  definition
   19.36    chain :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> bool"
   19.37 @@ -67,12 +67,12 @@
   19.38    shows "chain le_b (f ` Y)"
   19.39  by(blast intro: chainI dest: chainD[OF chain] mono)
   19.40  
   19.41 -subsection {* Chain-complete partial orders *}
   19.42 +subsection \<open>Chain-complete partial orders\<close>
   19.43  
   19.44 -text {*
   19.45 +text \<open>
   19.46    A ccpo has a least upper bound for any chain.  In particular, the
   19.47    empty set is a chain, so every ccpo must have a bottom element.
   19.48 -*}
   19.49 +\<close>
   19.50  
   19.51  class ccpo = order + Sup +
   19.52    assumes ccpo_Sup_upper: "\<lbrakk>chain (op \<le>) A; x \<in> A\<rbrakk> \<Longrightarrow> x \<le> Sup A"
   19.53 @@ -85,7 +85,7 @@
   19.54  lemma ccpo_Sup_singleton [simp]: "\<Squnion>{x} = x"
   19.55  by(rule antisym)(auto intro: ccpo_Sup_least ccpo_Sup_upper simp add: chain_singleton)
   19.56  
   19.57 -subsection {* Transfinite iteration of a function *}
   19.58 +subsection \<open>Transfinite iteration of a function\<close>
   19.59  
   19.60  inductive_set iterates :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a set"
   19.61  for f :: "'a \<Rightarrow> 'a"
   19.62 @@ -145,7 +145,7 @@
   19.63  lemma bot_in_iterates: "Sup {} \<in> iterates f"
   19.64  by(auto intro: iterates.Sup simp add: chain_empty)
   19.65  
   19.66 -subsection {* Fixpoint combinator *}
   19.67 +subsection \<open>Fixpoint combinator\<close>
   19.68  
   19.69  definition
   19.70    fixp :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a"
   19.71 @@ -183,9 +183,9 @@
   19.72  
   19.73  end
   19.74  
   19.75 -subsection {* Fixpoint induction *}
   19.76 +subsection \<open>Fixpoint induction\<close>
   19.77  
   19.78 -setup {* Sign.map_naming (Name_Space.mandatory_path "ccpo") *}
   19.79 +setup \<open>Sign.map_naming (Name_Space.mandatory_path "ccpo")\<close>
   19.80  
   19.81  definition admissible :: "('a set \<Rightarrow> 'a) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
   19.82  where "admissible lub ord P = (\<forall>A. chain ord A \<longrightarrow> (A \<noteq> {}) \<longrightarrow> (\<forall>x\<in>A. P x) \<longrightarrow> P (lub A))"
   19.83 @@ -203,7 +203,7 @@
   19.84    shows "P (lub A)"
   19.85  using assms by (auto simp: ccpo.admissible_def)
   19.86  
   19.87 -setup {* Sign.map_naming Name_Space.parent_path *}
   19.88 +setup \<open>Sign.map_naming Name_Space.parent_path\<close>
   19.89  
   19.90  lemma (in ccpo) fixp_induct:
   19.91    assumes adm: "ccpo.admissible Sup (op \<le>) P"
    20.1 --- a/src/HOL/Complex.thy	Sat Jul 18 21:44:18 2015 +0200
    20.2 +++ b/src/HOL/Complex.thy	Sat Jul 18 22:58:50 2015 +0200
    20.3 @@ -4,17 +4,17 @@
    20.4      Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4
    20.5  *)
    20.6  
    20.7 -section {* Complex Numbers: Rectangular and Polar Representations *}
    20.8 +section \<open>Complex Numbers: Rectangular and Polar Representations\<close>
    20.9  
   20.10  theory Complex
   20.11  imports Transcendental
   20.12  begin
   20.13  
   20.14 -text {*
   20.15 +text \<open>
   20.16  We use the @{text codatatype} command to define the type of complex numbers. This allows us to use
   20.17  @{text primcorec} to define complex functions by defining their real and imaginary result
   20.18  separately.
   20.19 -*}
   20.20 +\<close>
   20.21  
   20.22  codatatype complex = Complex (Re: real) (Im: real)
   20.23  
   20.24 @@ -27,7 +27,7 @@
   20.25  lemma complex_eq_iff: "x = y \<longleftrightarrow> Re x = Re y \<and> Im x = Im y"
   20.26    by (auto intro: complex.expand)
   20.27  
   20.28 -subsection {* Addition and Subtraction *}
   20.29 +subsection \<open>Addition and Subtraction\<close>
   20.30  
   20.31  instantiation complex :: ab_group_add
   20.32  begin
   20.33 @@ -53,7 +53,7 @@
   20.34  
   20.35  end
   20.36  
   20.37 -subsection {* Multiplication and Division *}
   20.38 +subsection \<open>Multiplication and Division\<close>
   20.39  
   20.40  instantiation complex :: field
   20.41  begin
   20.42 @@ -99,7 +99,7 @@
   20.43  lemma Im_power_real [simp]: "Im x = 0 \<Longrightarrow> Im (x ^ n) = 0"
   20.44    by (induct n) simp_all
   20.45  
   20.46 -subsection {* Scalar Multiplication *}
   20.47 +subsection \<open>Scalar Multiplication\<close>
   20.48  
   20.49  instantiation complex :: real_field
   20.50  begin
   20.51 @@ -127,7 +127,7 @@
   20.52  
   20.53  end
   20.54  
   20.55 -subsection {* Numerals, Arithmetic, and Embedding from Reals *}
   20.56 +subsection \<open>Numerals, Arithmetic, and Embedding from Reals\<close>
   20.57  
   20.58  abbreviation complex_of_real :: "real \<Rightarrow> complex"
   20.59    where "complex_of_real \<equiv> of_real"
   20.60 @@ -171,7 +171,7 @@
   20.61      "z \<in> \<real> \<Longrightarrow> of_real (Re z) = z"
   20.62    by (auto simp: Reals_def)
   20.63  
   20.64 -subsection {* The Complex Number $i$ *}
   20.65 +subsection \<open>The Complex Number $i$\<close>
   20.66  
   20.67  primcorec "ii" :: complex  ("\<i>") where
   20.68    "Re ii = 0"
   20.69 @@ -231,7 +231,7 @@
   20.70  lemma divide_numeral_i [simp]: "z / (numeral n * ii) = -(ii*z) / numeral n"
   20.71    by (metis divide_divide_eq_left divide_i mult.commute mult_minus_right)
   20.72  
   20.73 -subsection {* Vector Norm *}
   20.74 +subsection \<open>Vector Norm\<close>
   20.75  
   20.76  instantiation complex :: real_normed_field
   20.77  begin
   20.78 @@ -329,7 +329,7 @@
   20.79    by (simp add: norm_complex_def divide_simps complex_eq_iff)
   20.80  
   20.81  
   20.82 -text {* Properties of complex signum. *}
   20.83 +text \<open>Properties of complex signum.\<close>
   20.84  
   20.85  lemma sgn_eq: "sgn z = z / complex_of_real (cmod z)"
   20.86    by (simp add: sgn_div_norm divide_inverse scaleR_conv_of_real mult.commute)
   20.87 @@ -341,7 +341,7 @@
   20.88    by (simp add: complex_sgn_def divide_inverse)
   20.89  
   20.90  
   20.91 -subsection {* Completeness of the Complexes *}
   20.92 +subsection \<open>Completeness of the Complexes\<close>
   20.93  
   20.94  lemma bounded_linear_Re: "bounded_linear Re"
   20.95    by (rule bounded_linear_intro [where K=1], simp_all add: norm_complex_def)
   20.96 @@ -407,7 +407,7 @@
   20.97  declare
   20.98    DERIV_power[where 'a=complex, unfolded of_nat_def[symmetric], derivative_intros]
   20.99  
  20.100 -subsection {* Complex Conjugation *}
  20.101 +subsection \<open>Complex Conjugation\<close>
  20.102  
  20.103  primcorec cnj :: "complex \<Rightarrow> complex" where
  20.104    "Re (cnj z) = Re z"
  20.105 @@ -514,7 +514,7 @@
  20.106    by (simp add: sums_def lim_cnj cnj_setsum [symmetric] del: cnj_setsum)
  20.107  
  20.108  
  20.109 -subsection{*Basic Lemmas*}
  20.110 +subsection\<open>Basic Lemmas\<close>
  20.111  
  20.112  lemma complex_eq_0: "z=0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 = 0"
  20.113    by (metis zero_complex.sel complex_eqI sum_power2_eq_zero_iff)
  20.114 @@ -616,13 +616,13 @@
  20.115      done
  20.116  qed
  20.117  
  20.118 -subsection{*Polar Form for Complex Numbers*}
  20.119 +subsection\<open>Polar Form for Complex Numbers\<close>
  20.120  
  20.121  lemma complex_unimodular_polar: "(norm z = 1) \<Longrightarrow> \<exists>x. z = Complex (cos x) (sin x)"
  20.122    using sincos_total_2pi [of "Re z" "Im z"]
  20.123    by auto (metis cmod_power2 complex_eq power_one)
  20.124  
  20.125 -subsubsection {* $\cos \theta + i \sin \theta$ *}
  20.126 +subsubsection \<open>$\cos \theta + i \sin \theta$\<close>
  20.127  
  20.128  primcorec cis :: "real \<Rightarrow> complex" where
  20.129    "Re (cis a) = cos a"
  20.130 @@ -661,7 +661,7 @@
  20.131  lemma cis_pi: "cis pi = -1"
  20.132    by (simp add: complex_eq_iff)
  20.133  
  20.134 -subsubsection {* $r(\cos \theta + i \sin \theta)$ *}
  20.135 +subsubsection \<open>$r(\cos \theta + i \sin \theta)$\<close>
  20.136  
  20.137  definition rcis :: "real \<Rightarrow> real \<Rightarrow> complex" where
  20.138    "rcis r a = complex_of_real r * cis a"
  20.139 @@ -702,7 +702,7 @@
  20.140  lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1/r2) (a - b)"
  20.141    by (simp add: rcis_def cis_divide [symmetric])
  20.142  
  20.143 -subsubsection {* Complex exponential *}
  20.144 +subsubsection \<open>Complex exponential\<close>
  20.145  
  20.146  abbreviation Exp :: "complex \<Rightarrow> complex"
  20.147    where "Exp \<equiv> exp"
  20.148 @@ -747,7 +747,7 @@
  20.149  lemma Exp_two_pi_i [simp]: "Exp((2::complex) * complex_of_real pi * ii) = 1"
  20.150    by (simp add: Exp_eq_polar complex_eq_iff)
  20.151  
  20.152 -subsubsection {* Complex argument *}
  20.153 +subsubsection \<open>Complex argument\<close>
  20.154  
  20.155  definition arg :: "complex \<Rightarrow> real" where
  20.156    "arg z = (if z = 0 then 0 else (SOME a. sgn z = cis a \<and> -pi < a \<and> a \<le> pi))"
  20.157 @@ -775,7 +775,7 @@
  20.158        by (auto elim!: evenE dest!: less_2_cases)
  20.159      thus "a = x" unfolding d_def by simp
  20.160    qed (simp add: assms del: Re_sgn Im_sgn)
  20.161 -  with `z \<noteq> 0` show "arg z = x"
  20.162 +  with \<open>z \<noteq> 0\<close> show "arg z = x"
  20.163      unfolding arg_def by simp
  20.164  qed
  20.165  
  20.166 @@ -786,7 +786,7 @@
  20.167    with assms have "r \<noteq> 0" by auto
  20.168    def b \<equiv> "if 0 < r then a else a + pi"
  20.169    have b: "sgn z = cis b"
  20.170 -    unfolding z b_def rcis_def using `r \<noteq> 0`
  20.171 +    unfolding z b_def rcis_def using \<open>r \<noteq> 0\<close>
  20.172      by (simp add: of_real_def sgn_scaleR sgn_if complex_eq_iff)
  20.173    have cis_2pi_nat: "\<And>n. cis (2 * pi * real_of_nat n) = 1"
  20.174      by (induct_tac n) (simp_all add: distrib_left cis_mult [symmetric] complex_eq_iff)
  20.175 @@ -815,7 +815,7 @@
  20.176  lemma cos_arg_i_mult_zero [simp]: "y \<noteq> 0 \<Longrightarrow> Re y = 0 \<Longrightarrow> cos (arg y) = 0"
  20.177    using cis_arg [of y] by (simp add: complex_eq_iff)
  20.178  
  20.179 -subsection {* Square root of complex numbers *}
  20.180 +subsection \<open>Square root of complex numbers\<close>
  20.181  
  20.182  primcorec csqrt :: "complex \<Rightarrow> complex" where
  20.183    "Re (csqrt z) = sqrt ((cmod z + Re z) / 2)"
  20.184 @@ -902,7 +902,7 @@
  20.185    finally show ?thesis .
  20.186  qed
  20.187  
  20.188 -text {* Legacy theorem names *}
  20.189 +text \<open>Legacy theorem names\<close>
  20.190  
  20.191  lemmas expand_complex_eq = complex_eq_iff
  20.192  lemmas complex_Re_Im_cancel_iff = complex_eq_iff
    21.1 --- a/src/HOL/Complex_Main.thy	Sat Jul 18 21:44:18 2015 +0200
    21.2 +++ b/src/HOL/Complex_Main.thy	Sat Jul 18 22:58:50 2015 +0200
    21.3 @@ -1,4 +1,4 @@
    21.4 -section {* Comprehensive Complex Theory *}
    21.5 +section \<open>Comprehensive Complex Theory\<close>
    21.6  
    21.7  theory Complex_Main
    21.8  imports
    22.1 --- a/src/HOL/Conditionally_Complete_Lattices.thy	Sat Jul 18 21:44:18 2015 +0200
    22.2 +++ b/src/HOL/Conditionally_Complete_Lattices.thy	Sat Jul 18 22:58:50 2015 +0200
    22.3 @@ -4,7 +4,7 @@
    22.4      Author:     Luke S. Serafin, Carnegie Mellon University
    22.5  *)
    22.6  
    22.7 -section {* Conditionally-complete Lattices *}
    22.8 +section \<open>Conditionally-complete Lattices\<close>
    22.9  
   22.10  theory Conditionally_Complete_Lattices
   22.11  imports Main
   22.12 @@ -166,12 +166,12 @@
   22.13  end
   22.14  
   22.15  
   22.16 -text {*
   22.17 +text \<open>
   22.18  
   22.19  To avoid name classes with the @{class complete_lattice}-class we prefix @{const Sup} and
   22.20  @{const Inf} in theorem names with c.
   22.21  
   22.22 -*}
   22.23 +\<close>
   22.24  
   22.25  class conditionally_complete_lattice = lattice + Sup + Inf +
   22.26    assumes cInf_lower: "x \<in> X \<Longrightarrow> bdd_below X \<Longrightarrow> Inf X \<le> x"
   22.27 @@ -426,13 +426,13 @@
   22.28  proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x & x < d --> P x}"], auto)
   22.29    show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   22.30      by (rule cSup_upper, auto simp: bdd_above_def)
   22.31 -       (metis `a < b` `\<not> P b` linear less_le)
   22.32 +       (metis \<open>a < b\<close> \<open>\<not> P b\<close> linear less_le)
   22.33  next
   22.34    show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b"
   22.35      apply (rule cSup_least) 
   22.36      apply auto
   22.37      apply (metis less_le_not_le)
   22.38 -    apply (metis `a<b` `~ P b` linear less_le)
   22.39 +    apply (metis \<open>a<b\<close> \<open>~ P b\<close> linear less_le)
   22.40      done
   22.41  next
   22.42    fix x
   22.43 @@ -447,7 +447,7 @@
   22.44      assume 0: "\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x"
   22.45      thus "d \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   22.46        by (rule_tac cSup_upper, auto simp: bdd_above_def)
   22.47 -         (metis `a<b` `~ P b` linear less_le)
   22.48 +         (metis \<open>a<b\<close> \<open>~ P b\<close> linear less_le)
   22.49  qed
   22.50  
   22.51  end
   22.52 @@ -538,13 +538,13 @@
   22.53        { fix z assume "z \<in> X"
   22.54          have "z \<le> Max (X \<inter> {x..y})"
   22.55          proof cases
   22.56 -          assume "x \<le> z" with `z \<in> X` `X \<subseteq> {..y}` *(1) show ?thesis
   22.57 +          assume "x \<le> z" with \<open>z \<in> X\<close> \<open>X \<subseteq> {..y}\<close> *(1) show ?thesis
   22.58              by (auto intro!: Max_ge)
   22.59          next
   22.60            assume "\<not> x \<le> z"
   22.61            then have "z < x" by simp
   22.62            also have "x \<le> Max (X \<inter> {x..y})"
   22.63 -            using `x \<in> X` *(1) `x \<le> y` by (intro Max_ge) auto
   22.64 +            using \<open>x \<in> X\<close> *(1) \<open>x \<le> y\<close> by (intro Max_ge) auto
   22.65            finally show ?thesis by simp
   22.66          qed }
   22.67        note le = this
    23.1 --- a/src/HOL/Ctr_Sugar.thy	Sat Jul 18 21:44:18 2015 +0200
    23.2 +++ b/src/HOL/Ctr_Sugar.thy	Sat Jul 18 22:58:50 2015 +0200
    23.3 @@ -6,7 +6,7 @@
    23.4  Wrapping existing freely generated type's constructors.
    23.5  *)
    23.6  
    23.7 -section {* Wrapping Existing Freely Generated Type's Constructors *}
    23.8 +section \<open>Wrapping Existing Freely Generated Type's Constructors\<close>
    23.9  
   23.10  theory Ctr_Sugar
   23.11  imports HOL
    24.1 --- a/src/HOL/Deriv.thy	Sat Jul 18 21:44:18 2015 +0200
    24.2 +++ b/src/HOL/Deriv.thy	Sat Jul 18 22:58:50 2015 +0200
    24.3 @@ -6,13 +6,13 @@
    24.4      GMVT by Benjamin Porter, 2005
    24.5  *)
    24.6  
    24.7 -section{* Differentiation *}
    24.8 +section\<open>Differentiation\<close>
    24.9  
   24.10  theory Deriv
   24.11  imports Limits
   24.12  begin
   24.13  
   24.14 -subsection {* Frechet derivative *}
   24.15 +subsection \<open>Frechet derivative\<close>
   24.16  
   24.17  definition
   24.18    has_derivative :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a filter \<Rightarrow>  bool"
   24.19 @@ -22,12 +22,12 @@
   24.20      (bounded_linear f' \<and>
   24.21       ((\<lambda>y. ((f y - f (Lim F (\<lambda>x. x))) - f' (y - Lim F (\<lambda>x. x))) /\<^sub>R norm (y - Lim F (\<lambda>x. x))) ---> 0) F)"
   24.22  
   24.23 -text {*
   24.24 +text \<open>
   24.25    Usually the filter @{term F} is @{term "at x within s"}.  @{term "(f has_derivative D)
   24.26    (at x within s)"} means: @{term D} is the derivative of function @{term f} at point @{term x}
   24.27    within the set @{term s}. Where @{term s} is used to express left or right sided derivatives. In
   24.28    most cases @{term s} is either a variable or @{term UNIV}.
   24.29 -*}
   24.30 +\<close>
   24.31  
   24.32  lemma has_derivative_eq_rhs: "(f has_derivative f') F \<Longrightarrow> f' = g' \<Longrightarrow> (f has_derivative g') F"
   24.33    by simp
   24.34 @@ -51,7 +51,7 @@
   24.35    by simp
   24.36  
   24.37  named_theorems derivative_intros "structural introduction rules for derivatives"
   24.38 -setup {*
   24.39 +setup \<open>
   24.40    let
   24.41      val eq_thms = @{thms has_derivative_eq_rhs DERIV_cong has_vector_derivative_eq_rhs}
   24.42      fun eq_rule thm = get_first (try (fn eq_thm => eq_thm OF [thm])) eq_thms
   24.43 @@ -62,11 +62,11 @@
   24.44            Named_Theorems.get (Context.proof_of context) @{named_theorems derivative_intros}
   24.45            |> map_filter eq_rule)
   24.46    end;
   24.47 -*}
   24.48 +\<close>
   24.49  
   24.50 -text {*
   24.51 +text \<open>
   24.52    The following syntax is only used as a legacy syntax.
   24.53 -*}
   24.54 +\<close>
   24.55  abbreviation (input)
   24.56    FDERIV :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a \<Rightarrow>  ('a \<Rightarrow> 'b) \<Rightarrow> bool"
   24.57    ("(FDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
   24.58 @@ -189,7 +189,7 @@
   24.59  lemmas has_derivative_within_subset = has_derivative_subset 
   24.60  
   24.61  
   24.62 -subsection {* Continuity *}
   24.63 +subsection \<open>Continuity\<close>
   24.64  
   24.65  lemma has_derivative_continuous:
   24.66    assumes f: "(f has_derivative f') (at x within s)"
   24.67 @@ -214,7 +214,7 @@
   24.68      by (simp add: continuous_within)
   24.69  qed
   24.70  
   24.71 -subsection {* Composition *}
   24.72 +subsection \<open>Composition\<close>
   24.73  
   24.74  lemma tendsto_at_iff_tendsto_nhds_within: "f x = y \<Longrightarrow> (f ---> y) (at x within s) \<longleftrightarrow> (f ---> y) (inf (nhds x) (principal s))"
   24.75    unfolding tendsto_def eventually_inf_principal eventually_at_filter
   24.76 @@ -390,7 +390,7 @@
   24.77    then have "y \<noteq> 0"
   24.78      by (auto simp: norm_conv_dist dist_commute)
   24.79    have "norm (?inv y - ?inv x - ?f (y -x)) / norm (y - x) = norm ((?inv y - ?inv x) * (y - x) * ?inv x) / norm (y - x)"
   24.80 -    apply (subst inverse_diff_inverse [OF `y \<noteq> 0` x])
   24.81 +    apply (subst inverse_diff_inverse [OF \<open>y \<noteq> 0\<close> x])
   24.82      apply (subst minus_diff_minus)
   24.83      apply (subst norm_minus_cancel)
   24.84      apply (simp add: left_diff_distrib)
   24.85 @@ -422,7 +422,7 @@
   24.86    using has_derivative_mult[OF f has_derivative_inverse[OF x g]]
   24.87    by (simp add: field_simps)
   24.88  
   24.89 -text{*Conventional form requires mult-AC laws. Types real and complex only.*}
   24.90 +text\<open>Conventional form requires mult-AC laws. Types real and complex only.\<close>
   24.91  
   24.92  lemma has_derivative_divide'[derivative_intros]: 
   24.93    fixes f :: "_ \<Rightarrow> 'a::real_normed_field"
   24.94 @@ -439,14 +439,14 @@
   24.95      by simp
   24.96  qed
   24.97  
   24.98 -subsection {* Uniqueness *}
   24.99 +subsection \<open>Uniqueness\<close>
  24.100  
  24.101 -text {*
  24.102 +text \<open>
  24.103  
  24.104  This can not generally shown for @{const has_derivative}, as we need to approach the point from
  24.105  all directions. There is a proof in @{text Multivariate_Analysis} for @{text euclidean_space}.
  24.106  
  24.107 -*}
  24.108 +\<close>
  24.109  
  24.110  lemma has_derivative_zero_unique:
  24.111    assumes "((\<lambda>x. 0) has_derivative F) (at x)" shows "F = (\<lambda>h. 0)"
  24.112 @@ -485,7 +485,7 @@
  24.113      unfolding fun_eq_iff right_minus_eq .
  24.114  qed
  24.115  
  24.116 -subsection {* Differentiability predicate *}
  24.117 +subsection \<open>Differentiability predicate\<close>
  24.118  
  24.119  definition
  24.120    differentiable :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a filter \<Rightarrow> bool"
  24.121 @@ -609,7 +609,7 @@
  24.122  lemma mult_commute_abs: "(\<lambda>x. x * c) = op * (c::'a::ab_semigroup_mult)"
  24.123    by (simp add: fun_eq_iff mult.commute)
  24.124  
  24.125 -subsection {* Vector derivative *}
  24.126 +subsection \<open>Vector derivative\<close>
  24.127  
  24.128  lemma has_field_derivative_iff_has_vector_derivative:
  24.129    "(f has_field_derivative y) F \<longleftrightarrow> (f has_vector_derivative y) F"
  24.130 @@ -687,7 +687,7 @@
  24.131    by (rule bounded_linear.has_vector_derivative[OF bounded_linear_mult_left])
  24.132  
  24.133  
  24.134 -subsection {* Derivatives *}
  24.135 +subsection \<open>Derivatives\<close>
  24.136  
  24.137  lemma DERIV_D: "DERIV f x :> D \<Longrightarrow> (\<lambda>h. (f (x + h) - f x) / h) -- 0 --> D"
  24.138    by (simp add: DERIV_def)
  24.139 @@ -748,7 +748,7 @@
  24.140    by (rule has_derivative_imp_has_field_derivative[OF has_derivative_mult])
  24.141       (auto simp: field_simps dest: has_field_derivative_imp_has_derivative)
  24.142  
  24.143 -text {* Derivative of linear multiplication *}
  24.144 +text \<open>Derivative of linear multiplication\<close>
  24.145  
  24.146  lemma DERIV_cmult:
  24.147    "(f has_field_derivative D) (at x within s) ==> ((\<lambda>x. c * f x) has_field_derivative c * D) (at x within s)"
  24.148 @@ -784,24 +784,24 @@
  24.149      by (rule arg_cong [of "\<lambda>x. x * D"]) (simp add: fun_eq_iff)
  24.150    with assms have "(f has_derivative (\<lambda>x. x * D)) (at x within s)"
  24.151      by (auto dest!: has_field_derivative_imp_has_derivative)
  24.152 -  then show ?thesis using `f x \<noteq> 0`
  24.153 +  then show ?thesis using \<open>f x \<noteq> 0\<close>
  24.154      by (auto intro: has_derivative_imp_has_field_derivative has_derivative_inverse)
  24.155  qed
  24.156  
  24.157 -text {* Power of @{text "-1"} *}
  24.158 +text \<open>Power of @{text "-1"}\<close>
  24.159  
  24.160  lemma DERIV_inverse:
  24.161    "x \<noteq> 0 \<Longrightarrow> ((\<lambda>x. inverse(x)) has_field_derivative - (inverse x ^ Suc (Suc 0))) (at x within s)"
  24.162    by (drule DERIV_inverse' [OF DERIV_ident]) simp
  24.163  
  24.164 -text {* Derivative of inverse *}
  24.165 +text \<open>Derivative of inverse\<close>
  24.166  
  24.167  lemma DERIV_inverse_fun:
  24.168    "(f has_field_derivative d) (at x within s) \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow>
  24.169    ((\<lambda>x. inverse (f x)) has_field_derivative (- (d * inverse(f x ^ Suc (Suc 0))))) (at x within s)"
  24.170    by (drule (1) DERIV_inverse') (simp add: ac_simps nonzero_inverse_mult_distrib)
  24.171  
  24.172 -text {* Derivative of quotient *}
  24.173 +text \<open>Derivative of quotient\<close>
  24.174  
  24.175  lemma DERIV_divide[derivative_intros]:
  24.176    "(f has_field_derivative D) (at x within s) \<Longrightarrow>
  24.177 @@ -842,7 +842,7 @@
  24.178    ((\<lambda>x. f (g x)) has_field_derivative Da * Db) (at x within s)"
  24.179    by (rule DERIV_chain')
  24.180  
  24.181 -text {* Standard version *}
  24.182 +text \<open>Standard version\<close>
  24.183  
  24.184  lemma DERIV_chain:
  24.185    "DERIV f (g x) :> Da \<Longrightarrow> (g has_field_derivative Db) (at x within s) \<Longrightarrow> 
  24.186 @@ -872,7 +872,7 @@
  24.187  declare
  24.188    DERIV_power[where 'a=real, unfolded real_of_nat_def[symmetric], derivative_intros]
  24.189  
  24.190 -text{*Alternative definition for differentiability*}
  24.191 +text\<open>Alternative definition for differentiability\<close>
  24.192  
  24.193  lemma DERIV_LIM_iff:
  24.194    fixes f :: "'a::{real_normed_vector,inverse} \<Rightarrow> 'a" shows
  24.195 @@ -908,7 +908,7 @@
  24.196    by (simp add: DERIV_def filterlim_at_split filterlim_at_left_to_right
  24.197                  tendsto_minus_cancel_left field_simps conj_commute)
  24.198  
  24.199 -text {* Caratheodory formulation of derivative at a point *}
  24.200 +text \<open>Caratheodory formulation of derivative at a point\<close>
  24.201  
  24.202  lemma CARAT_DERIV: (*FIXME: SUPERSEDED BY THE ONE IN Deriv.thy. But still used by NSA/HDeriv.thy*)
  24.203    "(DERIV f x :> l) \<longleftrightarrow> (\<exists>g. (\<forall>z. f z - f x = g z * (z - x)) \<and> isCont g x \<and> g x = l)"
  24.204 @@ -932,9 +932,9 @@
  24.205  qed
  24.206  
  24.207  
  24.208 -subsection {* Local extrema *}
  24.209 +subsection \<open>Local extrema\<close>
  24.210  
  24.211 -text{*If @{term "0 < f'(x)"} then @{term x} is Locally Strictly Increasing At The Right*}
  24.212 +text\<open>If @{term "0 < f'(x)"} then @{term x} is Locally Strictly Increasing At The Right\<close>
  24.213  
  24.214  lemma DERIV_pos_inc_right:
  24.215    fixes f :: "real => real"
  24.216 @@ -1037,23 +1037,23 @@
  24.217  qed
  24.218  
  24.219  
  24.220 -text{*Similar theorem for a local minimum*}
  24.221 +text\<open>Similar theorem for a local minimum\<close>
  24.222  lemma DERIV_local_min:
  24.223    fixes f :: "real => real"
  24.224    shows "[| DERIV f x :> l; 0 < d; \<forall>y. \<bar>x-y\<bar> < d --> f(x) \<le> f(y) |] ==> l = 0"
  24.225  by (drule DERIV_minus [THEN DERIV_local_max], auto)
  24.226  
  24.227  
  24.228 -text{*In particular, if a function is locally flat*}
  24.229 +text\<open>In particular, if a function is locally flat\<close>
  24.230  lemma DERIV_local_const:
  24.231    fixes f :: "real => real"
  24.232    shows "[| DERIV f x :> l; 0 < d; \<forall>y. \<bar>x-y\<bar> < d --> f(x) = f(y) |] ==> l = 0"
  24.233  by (auto dest!: DERIV_local_max)
  24.234  
  24.235  
  24.236 -subsection {* Rolle's Theorem *}
  24.237 +subsection \<open>Rolle's Theorem\<close>
  24.238  
  24.239 -text{*Lemma about introducing open ball in open interval*}
  24.240 +text\<open>Lemma about introducing open ball in open interval\<close>
  24.241  lemma lemma_interval_lt:
  24.242       "[| a < x;  x < b |]
  24.243        ==> \<exists>d::real. 0 < d & (\<forall>y. \<bar>x-y\<bar> < d --> a < y & y < b)"
  24.244 @@ -1070,11 +1070,11 @@
  24.245  apply force
  24.246  done
  24.247  
  24.248 -text{*Rolle's Theorem.
  24.249 +text\<open>Rolle's Theorem.
  24.250     If @{term f} is defined and continuous on the closed interval
  24.251     @{text "[a,b]"} and differentiable on the open interval @{text "(a,b)"},
  24.252     and @{term "f(a) = f(b)"},
  24.253 -   then there exists @{text "x0 \<in> (a,b)"} such that @{term "f'(x0) = 0"}*}
  24.254 +   then there exists @{text "x0 \<in> (a,b)"} such that @{term "f'(x0) = 0"}\<close>
  24.255  theorem Rolle:
  24.256    assumes lt: "a < b"
  24.257        and eq: "f(a) = f(b)"
  24.258 @@ -1094,7 +1094,7 @@
  24.259    show ?thesis
  24.260    proof cases
  24.261      assume axb: "a < x & x < b"
  24.262 -        --{*@{term f} attains its maximum within the interval*}
  24.263 +        --\<open>@{term f} attains its maximum within the interval\<close>
  24.264      hence ax: "a<x" and xb: "x<b" by arith + 
  24.265      from lemma_interval [OF ax xb]
  24.266      obtain d where d: "0<d" and bound: "\<forall>y. \<bar>x-y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b"
  24.267 @@ -1104,7 +1104,7 @@
  24.268      from differentiableD [OF dif [OF axb]]
  24.269      obtain l where der: "DERIV f x :> l" ..
  24.270      have "l=0" by (rule DERIV_local_max [OF der d bound'])
  24.271 -        --{*the derivative at a local maximum is zero*}
  24.272 +        --\<open>the derivative at a local maximum is zero\<close>
  24.273      thus ?thesis using ax xb der by auto
  24.274    next
  24.275      assume notaxb: "~ (a < x & x < b)"
  24.276 @@ -1113,7 +1113,7 @@
  24.277      show ?thesis
  24.278      proof cases
  24.279        assume ax'b: "a < x' & x' < b"
  24.280 -        --{*@{term f} attains its minimum within the interval*}
  24.281 +        --\<open>@{term f} attains its minimum within the interval\<close>
  24.282        hence ax': "a<x'" and x'b: "x'<b" by arith+ 
  24.283        from lemma_interval [OF ax' x'b]
  24.284        obtain d where d: "0<d" and bound: "\<forall>y. \<bar>x'-y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b"
  24.285 @@ -1123,11 +1123,11 @@
  24.286        from differentiableD [OF dif [OF ax'b]]
  24.287        obtain l where der: "DERIV f x' :> l" ..
  24.288        have "l=0" by (rule DERIV_local_min [OF der d bound'])
  24.289 -        --{*the derivative at a local minimum is zero*}
  24.290 +        --\<open>the derivative at a local minimum is zero\<close>
  24.291        thus ?thesis using ax' x'b der by auto
  24.292      next
  24.293        assume notax'b: "~ (a < x' & x' < b)"
  24.294 -        --{*@{term f} is constant througout the interval*}
  24.295 +        --\<open>@{term f} is constant througout the interval\<close>
  24.296        hence x'eqab: "x'=a | x'=b" using alex' x'leb by arith
  24.297        hence fb_eq_fx': "f b = f x'" by (auto simp add: eq)
  24.298        from dense [OF lt]
  24.299 @@ -1155,14 +1155,14 @@
  24.300        from differentiableD [OF dif [OF conjI [OF ar rb]]]
  24.301        obtain l where der: "DERIV f r :> l" ..
  24.302        have "l=0" by (rule DERIV_local_const [OF der d bound'])
  24.303 -        --{*the derivative of a constant function is zero*}
  24.304 +        --\<open>the derivative of a constant function is zero\<close>
  24.305        thus ?thesis using ar rb der by auto
  24.306      qed
  24.307    qed
  24.308  qed
  24.309  
  24.310  
  24.311 -subsection{*Mean Value Theorem*}
  24.312 +subsection\<open>Mean Value Theorem\<close>
  24.313  
  24.314  lemma lemma_MVT:
  24.315       "f a - (f b - f a)/(b-a) * a = f b - (f b - f a)/(b-a) * (b::real)"
  24.316 @@ -1215,7 +1215,7 @@
  24.317  done
  24.318  
  24.319  
  24.320 -text{*A function is constant if its derivative is 0 over an interval.*}
  24.321 +text\<open>A function is constant if its derivative is 0 over an interval.\<close>
  24.322  
  24.323  lemma DERIV_isconst_end:
  24.324    fixes f :: "real => real"
  24.325 @@ -1261,14 +1261,14 @@
  24.326    have "\<forall>z. ?a \<le> z \<and> z \<le> ?b \<longrightarrow> DERIV f z :> 0"
  24.327    proof (rule allI, rule impI)
  24.328      fix z :: real assume "?a \<le> z \<and> z \<le> ?b"
  24.329 -    hence "a < z" and "z < b" using `x \<in> {a <..< b}` and `y \<in> {a <..< b}` by auto
  24.330 +    hence "a < z" and "z < b" using \<open>x \<in> {a <..< b}\<close> and \<open>y \<in> {a <..< b}\<close> by auto
  24.331      hence "z \<in> {a<..<b}" by auto
  24.332      thus "DERIV f z :> 0" by (rule derivable)
  24.333    qed
  24.334    hence isCont: "\<forall>z. ?a \<le> z \<and> z \<le> ?b \<longrightarrow> isCont f z"
  24.335      and DERIV: "\<forall>z. ?a < z \<and> z < ?b \<longrightarrow> DERIV f z :> 0" using DERIV_isCont by auto
  24.336  
  24.337 -  have "?a < ?b" using `x \<noteq> y` by auto
  24.338 +  have "?a < ?b" using \<open>x \<noteq> y\<close> by auto
  24.339    from DERIV_isconst2[OF this isCont DERIV, of x] and DERIV_isconst2[OF this isCont DERIV, of y]
  24.340    show ?thesis by auto
  24.341  qed auto
  24.342 @@ -1302,7 +1302,7 @@
  24.343  lemma real_average_minus_second [simp]: "((b + a)/2 - a) = (b-a)/(2::real)"
  24.344  by (simp)
  24.345  
  24.346 -text{*Gallileo's "trick": average velocity = av. of end velocities*}
  24.347 +text\<open>Gallileo's "trick": average velocity = av. of end velocities\<close>
  24.348  
  24.349  lemma DERIV_const_average:
  24.350    fixes v :: "real => real"
  24.351 @@ -1455,7 +1455,7 @@
  24.352    apply (metis filterlim_at_top_mirror lim)
  24.353    done
  24.354  
  24.355 -text {* Derivative of inverse function *}
  24.356 +text \<open>Derivative of inverse function\<close>
  24.357  
  24.358  lemma DERIV_inverse_function:
  24.359    fixes f g :: "real \<Rightarrow> real"
  24.360 @@ -1504,7 +1504,7 @@
  24.361      using neq by (rule tendsto_inverse)
  24.362  qed
  24.363  
  24.364 -subsection {* Generalized Mean Value Theorem *}
  24.365 +subsection \<open>Generalized Mean Value Theorem\<close>
  24.366  
  24.367  theorem GMVT:
  24.368    fixes a b :: real
  24.369 @@ -1581,7 +1581,7 @@
  24.370  qed
  24.371  
  24.372  
  24.373 -subsection {* L'Hopitals rule *}
  24.374 +subsection \<open>L'Hopitals rule\<close>
  24.375  
  24.376  lemma isCont_If_ge:
  24.377    fixes a :: "'a :: linorder_topology"
  24.378 @@ -1645,21 +1645,21 @@
  24.379    proof (rule bchoice, rule)
  24.380      fix x assume "x \<in> {0 <..< a}"
  24.381      then have x[arith]: "0 < x" "x < a" by auto
  24.382 -    with g'_neq_0 g_neq_0 `g 0 = 0` have g': "\<And>x. 0 < x \<Longrightarrow> x < a  \<Longrightarrow> 0 \<noteq> g' x" "g 0 \<noteq> g x"
  24.383 +    with g'_neq_0 g_neq_0 \<open>g 0 = 0\<close> have g': "\<And>x. 0 < x \<Longrightarrow> x < a  \<Longrightarrow> 0 \<noteq> g' x" "g 0 \<noteq> g x"
  24.384        by auto
  24.385      have "\<And>x. 0 \<le> x \<Longrightarrow> x < a \<Longrightarrow> isCont f x"
  24.386 -      using `isCont f 0` f by (auto intro: DERIV_isCont simp: le_less)
  24.387 +      using \<open>isCont f 0\<close> f by (auto intro: DERIV_isCont simp: le_less)
  24.388      moreover have "\<And>x. 0 \<le> x \<Longrightarrow> x < a \<Longrightarrow> isCont g x"
  24.389 -      using `isCont g 0` g by (auto intro: DERIV_isCont simp: le_less)
  24.390 +      using \<open>isCont g 0\<close> g by (auto intro: DERIV_isCont simp: le_less)
  24.391      ultimately have "\<exists>c. 0 < c \<and> c < x \<and> (f x - f 0) * g' c = (g x - g 0) * f' c"
  24.392 -      using f g `x < a` by (intro GMVT') auto
  24.393 +      using f g \<open>x < a\<close> by (intro GMVT') auto
  24.394      then obtain c where *: "0 < c" "c < x" "(f x - f 0) * g' c = (g x - g 0) * f' c"
  24.395        by blast
  24.396      moreover
  24.397      from * g'(1)[of c] g'(2) have "(f x - f 0)  / (g x - g 0) = f' c / g' c"
  24.398        by (simp add: field_simps)
  24.399      ultimately show "\<exists>y. 0 < y \<and> y < x \<and> f x / g x = f' y / g' y"
  24.400 -      using `f 0 = 0` `g 0 = 0` by (auto intro!: exI[of _ c])
  24.401 +      using \<open>f 0 = 0\<close> \<open>g 0 = 0\<close> by (auto intro!: exI[of _ c])
  24.402    qed
  24.403    then obtain \<zeta> where "\<forall>x\<in>{0 <..< a}. 0 < \<zeta> x \<and> \<zeta> x < x \<and> f x / g x = f' (\<zeta> x) / g' (\<zeta> x)" ..
  24.404    then have \<zeta>: "eventually (\<lambda>x. 0 < \<zeta> x \<and> \<zeta> x < x \<and> f x / g x = f' (\<zeta> x) / g' (\<zeta> x)) (at_right 0)"
  24.405 @@ -1765,7 +1765,7 @@
  24.406      by (intro tendsto_intros)
  24.407    then have "((\<lambda>t. norm (f a - x * g a) / norm (g t)) ---> 0) (at_right 0)"
  24.408      by (simp add: inverse_eq_divide)
  24.409 -  from this[unfolded tendsto_iff, rule_format, of "e / 2"] `0 < e`
  24.410 +  from this[unfolded tendsto_iff, rule_format, of "e / 2"] \<open>0 < e\<close>
  24.411    have "eventually (\<lambda>t. norm (f a - x * g a) / norm (g t) < e / 2) (at_right 0)"
  24.412      by (auto simp: dist_real_def)
  24.413  
  24.414 @@ -1780,7 +1780,7 @@
  24.415        and D_eq0: "(g a - g t) * f' y = (f a - f t) * g' y"
  24.416        by blast
  24.417      from D_eq0 have D_eq: "(f t - f a) / (g t - g a) = f' y / g' y"
  24.418 -      using `g a < g t` g'_neq_0[of y] by (auto simp add: field_simps)
  24.419 +      using \<open>g a < g t\<close> g'_neq_0[of y] by (auto simp add: field_simps)
  24.420  
  24.421      have *: "f t / g t - x = ((f t - f a) / (g t - g a) - x) * (1 - g a / g t) + (f a - x * g a) / g t"
  24.422        by (simp add: field_simps)
  24.423 @@ -1790,7 +1790,7 @@
  24.424      also have "\<dots> = dist (f' y / g' y) x * norm (1 - g a / g t) + norm (f a - x * g a) / norm (g t)"
  24.425        by (simp add: abs_mult D_eq dist_real_def)
  24.426      also have "\<dots> < (e / 4) * 2 + e / 2"
  24.427 -      using ineq Df[of y] `0 < e` by (intro add_le_less_mono mult_mono) auto
  24.428 +      using ineq Df[of y] \<open>0 < e\<close> by (intro add_le_less_mono mult_mono) auto
  24.429      finally show "dist (f t / g t) x < e"
  24.430        by (simp add: dist_real_def)
  24.431    qed
    25.1 --- a/src/HOL/Divides.thy	Sat Jul 18 21:44:18 2015 +0200
    25.2 +++ b/src/HOL/Divides.thy	Sat Jul 18 22:58:50 2015 +0200
    25.3 @@ -3,13 +3,13 @@
    25.4      Copyright   1999  University of Cambridge
    25.5  *)
    25.6  
    25.7 -section {* The division operators div and mod *}
    25.8 +section \<open>The division operators div and mod\<close>
    25.9  
   25.10  theory Divides
   25.11  imports Parity
   25.12  begin
   25.13  
   25.14 -subsection {* Abstract division in commutative semirings. *}
   25.15 +subsection \<open>Abstract division in commutative semirings.\<close>
   25.16  
   25.17  class div = dvd + divide +
   25.18    fixes mod :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "mod" 70)
   25.19 @@ -38,7 +38,7 @@
   25.20    "n \<noteq> 0 \<Longrightarrow> a ^ n = 0 \<longleftrightarrow> a = 0"
   25.21    using power_not_zero [of a n] by (auto simp add: zero_power)
   25.22  
   25.23 -text {* @{const divide} and @{const mod} *}
   25.24 +text \<open>@{const divide} and @{const mod}\<close>
   25.25  
   25.26  lemma mod_div_equality2: "b * (a div b) + a mod b = a"
   25.27    unfolding mult.commute [of b]
   25.28 @@ -232,7 +232,7 @@
   25.29    then show ?thesis by (simp add: mod_div_equality)
   25.30  qed
   25.31  
   25.32 -text {* Addition respects modular equivalence. *}
   25.33 +text \<open>Addition respects modular equivalence.\<close>
   25.34  
   25.35  lemma mod_add_left_eq: "(a + b) mod c = (a mod c + b) mod c"
   25.36  proof -
   25.37 @@ -274,7 +274,7 @@
   25.38    \<Longrightarrow> (x + y) div z = x div z + y div z"
   25.39  by (cases "z = 0", simp, unfold dvd_def, auto simp add: algebra_simps)
   25.40  
   25.41 -text {* Multiplication respects modular equivalence. *}
   25.42 +text \<open>Multiplication respects modular equivalence.\<close>
   25.43  
   25.44  lemma mod_mult_left_eq: "(a * b) mod c = ((a mod c) * b) mod c"
   25.45  proof -
   25.46 @@ -312,7 +312,7 @@
   25.47      by (simp only: mod_mult_eq [symmetric])
   25.48  qed
   25.49  
   25.50 -text {* Exponentiation respects modular equivalence. *}
   25.51 +text \<open>Exponentiation respects modular equivalence.\<close>
   25.52  
   25.53  lemma power_mod: "(a mod b)^n mod b = a^n mod b"
   25.54  apply (induct n, simp_all)
   25.55 @@ -325,10 +325,10 @@
   25.56    assumes "c dvd b"
   25.57    shows "a mod b mod c = a mod c"
   25.58  proof -
   25.59 -  from `c dvd b` obtain k where "b = c * k"
   25.60 +  from \<open>c dvd b\<close> obtain k where "b = c * k"
   25.61      by (rule dvdE)
   25.62    have "a mod b mod c = a mod (c * k) mod c"
   25.63 -    by (simp only: `b = c * k`)
   25.64 +    by (simp only: \<open>b = c * k\<close>)
   25.65    also have "\<dots> = (a mod (c * k) + a div (c * k) * k * c) mod c"
   25.66      by (simp only: mod_mult_self1)
   25.67    also have "\<dots> = (a div (c * k) * (c * k) + a mod (c * k)) mod c"
   25.68 @@ -400,7 +400,7 @@
   25.69  next
   25.70    assume "b div a = c"
   25.71    then have "b div a * a = c * a" by simp
   25.72 -  moreover from `a dvd b` have "b div a * a = b" by simp
   25.73 +  moreover from \<open>a dvd b\<close> have "b div a * a = b" by simp
   25.74    ultimately show "b = c * a" by simp
   25.75  qed
   25.76  
   25.77 @@ -416,7 +416,7 @@
   25.78  
   25.79  subclass idom_divide ..
   25.80  
   25.81 -text {* Negation respects modular equivalence. *}
   25.82 +text \<open>Negation respects modular equivalence.\<close>
   25.83  
   25.84  lemma mod_minus_eq: "(- a) mod b = (- (a mod b)) mod b"
   25.85  proof -
   25.86 @@ -439,7 +439,7 @@
   25.87      by (simp only: mod_minus_eq [symmetric])
   25.88  qed
   25.89  
   25.90 -text {* Subtraction respects modular equivalence. *}
   25.91 +text \<open>Subtraction respects modular equivalence.\<close>
   25.92  
   25.93  lemma mod_diff_left_eq:
   25.94    "(a - b) mod c = (a mod c - b) mod c"
   25.95 @@ -512,7 +512,7 @@
   25.96  end
   25.97  
   25.98  
   25.99 -subsubsection {* Parity and division *}
  25.100 +subsubsection \<open>Parity and division\<close>
  25.101  
  25.102  class semiring_div_parity = semiring_div + comm_semiring_1_cancel + numeral +
  25.103    assumes parity: "a mod 2 = 0 \<or> a mod 2 = 1"
  25.104 @@ -594,15 +594,15 @@
  25.105  end
  25.106  
  25.107  
  25.108 -subsection {* Generic numeral division with a pragmatic type class *}
  25.109 -
  25.110 -text {*
  25.111 +subsection \<open>Generic numeral division with a pragmatic type class\<close>
  25.112 +
  25.113 +text \<open>
  25.114    The following type class contains everything necessary to formulate
  25.115    a division algorithm in ring structures with numerals, restricted
  25.116    to its positive segments.  This is its primary motiviation, and it
  25.117    could surely be formulated using a more fine-grained, more algebraic
  25.118    and less technical class hierarchy.
  25.119 -*}
  25.120 +\<close>
  25.121  
  25.122  class semiring_numeral_div = semiring_div + comm_semiring_1_cancel + linordered_semidom +
  25.123    assumes div_less: "0 \<le> a \<Longrightarrow> a < b \<Longrightarrow> a div b = 0"
  25.124 @@ -636,11 +636,11 @@
  25.125      then have "a mod 2 \<noteq> 0" and "a mod 2 \<noteq> 1" by simp_all
  25.126      have "0 < 2" by simp
  25.127      with pos_mod_bound pos_mod_sign have "0 \<le> a mod 2" "a mod 2 < 2" by simp_all
  25.128 -    with `a mod 2 \<noteq> 0` have "0 < a mod 2" by simp
  25.129 +    with \<open>a mod 2 \<noteq> 0\<close> have "0 < a mod 2" by simp
  25.130      with discrete have "1 \<le> a mod 2" by simp
  25.131 -    with `a mod 2 \<noteq> 1` have "1 < a mod 2" by simp
  25.132 +    with \<open>a mod 2 \<noteq> 1\<close> have "1 < a mod 2" by simp
  25.133      with discrete have "2 \<le> a mod 2" by simp
  25.134 -    with `a mod 2 < 2` show False by simp
  25.135 +    with \<open>a mod 2 < 2\<close> show False by simp
  25.136    qed
  25.137  next
  25.138    show "1 mod 2 = 1"
  25.139 @@ -657,9 +657,9 @@
  25.140  proof -
  25.141    from assms mod_less_eq_dividend [of a "2 * b"] have "b \<le> a"
  25.142      by (auto intro: trans)
  25.143 -  with `0 < b` have "0 < a div b" by (auto intro: div_positive)
  25.144 +  with \<open>0 < b\<close> have "0 < a div b" by (auto intro: div_positive)
  25.145    then have [simp]: "1 \<le> a div b" by (simp add: discrete)
  25.146 -  with `0 < b` have mod_less: "a mod b < b" by (simp add: pos_mod_bound)
  25.147 +  with \<open>0 < b\<close> have mod_less: "a mod b < b" by (simp add: pos_mod_bound)
  25.148    def w \<equiv> "a div b mod 2" with parity have w_exhaust: "w = 0 \<or> w = 1" by auto
  25.149    have mod_w: "a mod (2 * b) = a mod b + b * w"
  25.150      by (simp add: w_def mod_mult2_eq ac_simps)
  25.151 @@ -668,7 +668,7 @@
  25.152    with mod_w have mod: "a mod (2 * b) = a mod b + b" by simp
  25.153    have "2 * (a div (2 * b)) = a div b - w"
  25.154      by (simp add: w_def div_mult2_eq mult_div_cancel ac_simps)
  25.155 -  with `w = 1` have div: "2 * (a div (2 * b)) = a div b - 1" by simp
  25.156 +  with \<open>w = 1\<close> have div: "2 * (a div (2 * b)) = a div b - 1" by simp
  25.157    then show ?P and ?Q
  25.158      by (simp_all add: div mod add_implies_diff [symmetric] le_add_diff_inverse2)
  25.159  qed
  25.160 @@ -683,7 +683,7 @@
  25.161      by (simp add: w_def mod_mult2_eq ac_simps)
  25.162    moreover have "b \<le> a mod b + b"
  25.163    proof -
  25.164 -    from `0 < b` pos_mod_sign have "0 \<le> a mod b" by blast
  25.165 +    from \<open>0 < b\<close> pos_mod_sign have "0 \<le> a mod b" by blast
  25.166      then have "0 + b \<le> a mod b + b" by (rule add_right_mono)
  25.167      then show ?thesis by simp
  25.168    qed
  25.169 @@ -692,7 +692,7 @@
  25.170    with mod_w have mod: "a mod (2 * b) = a mod b" by simp
  25.171    have "2 * (a div (2 * b)) = a div b - w"
  25.172      by (simp add: w_def div_mult2_eq mult_div_cancel ac_simps)
  25.173 -  with `w = 0` have div: "2 * (a div (2 * b)) = a div b" by simp
  25.174 +  with \<open>w = 0\<close> have div: "2 * (a div (2 * b)) = a div b" by simp
  25.175    then show ?P and ?Q
  25.176      by (simp_all add: div mod)
  25.177  qed
  25.178 @@ -715,12 +715,12 @@
  25.179      in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
  25.180      else (2 * q, r))"
  25.181  
  25.182 -text {*
  25.183 +text \<open>
  25.184    This is a formulation of one step (referring to one digit position)
  25.185    in school-method division: compare the dividend at the current
  25.186    digit position with the remainder from previous division steps
  25.187    and evaluate accordingly.
  25.188 -*}
  25.189 +\<close>
  25.190  
  25.191  lemma divmod_step_eq [code]:
  25.192    "divmod_step l (q, r) = (if numeral l \<le> r
  25.193 @@ -732,13 +732,13 @@
  25.194    "numeral l \<le> r \<Longrightarrow> divmod_step l (q, r) = (2 * q + 1, r - numeral l)"
  25.195    by (auto simp add: divmod_step_eq not_le)
  25.196  
  25.197 -text {*
  25.198 +text \<open>
  25.199    This is a formulation of school-method division.
  25.200    If the divisor is smaller than the dividend, terminate.
  25.201    If not, shift the dividend to the right until termination
  25.202    occurs and then reiterate single division steps in the
  25.203    opposite direction.
  25.204 -*}
  25.205 +\<close>
  25.206  
  25.207  lemma divmod_divmod_step [code]:
  25.208    "divmod m n = (if m < n then (0, numeral m)
  25.209 @@ -803,7 +803,7 @@
  25.210        div_mult2_eq [of _ _ 2] mod_mult2_eq [of _ _ 2] add.commute del: numeral_times_numeral)
  25.211  qed
  25.212  
  25.213 -text {* Special case: divisibility *}
  25.214 +text \<open>Special case: divisibility\<close>
  25.215  
  25.216  definition divides_aux :: "'a \<times> 'a \<Rightarrow> bool"
  25.217  where
  25.218 @@ -820,21 +820,21 @@
  25.219  end
  25.220  
  25.221  
  25.222 -subsection {* Division on @{typ nat} *}
  25.223 -
  25.224 -text {*
  25.225 +subsection \<open>Division on @{typ nat}\<close>
  25.226 +
  25.227 +text \<open>
  25.228    We define @{const divide} and @{const mod} on @{typ nat} by means
  25.229    of a characteristic relation with two input arguments
  25.230    @{term "m\<Colon>nat"}, @{term "n\<Colon>nat"} and two output arguments
  25.231    @{term "q\<Colon>nat"}(uotient) and @{term "r\<Colon>nat"}(emainder).
  25.232 -*}
  25.233 +\<close>
  25.234  
  25.235  definition divmod_nat_rel :: "nat \<Rightarrow> nat \<Rightarrow> nat \<times> nat \<Rightarrow> bool" where
  25.236    "divmod_nat_rel m n qr \<longleftrightarrow>
  25.237      m = fst qr * n + snd qr \<and>
  25.238        (if n = 0 then fst qr = 0 else if n > 0 then 0 \<le> snd qr \<and> snd qr < n else n < snd qr \<and> snd qr \<le> 0)"
  25.239  
  25.240 -text {* @{const divmod_nat_rel} is total: *}
  25.241 +text \<open>@{const divmod_nat_rel} is total:\<close>
  25.242  
  25.243  lemma divmod_nat_rel_ex:
  25.244    obtains q r where "divmod_nat_rel m n (q, r)"
  25.245 @@ -845,7 +845,7 @@
  25.246    case False
  25.247    have "\<exists>q r. m = q * n + r \<and> r < n"
  25.248    proof (induct m)
  25.249 -    case 0 with `n \<noteq> 0`
  25.250 +    case 0 with \<open>n \<noteq> 0\<close>
  25.251      have "(0\<Colon>nat) = 0 * n + 0 \<and> 0 < n" by simp
  25.252      then show ?case by blast
  25.253    next
  25.254 @@ -860,14 +860,14 @@
  25.255        moreover from n have "Suc r' \<le> n" by auto
  25.256        ultimately have "n = Suc r'" by auto
  25.257        with m have "Suc m = Suc q' * n + 0" by simp
  25.258 -      with `n \<noteq> 0` show ?thesis by blast
  25.259 +      with \<open>n \<noteq> 0\<close> show ?thesis by blast
  25.260      qed
  25.261    qed
  25.262    with that show thesis
  25.263 -    using `n \<noteq> 0` by (auto simp add: divmod_nat_rel_def)
  25.264 +    using \<open>n \<noteq> 0\<close> by (auto simp add: divmod_nat_rel_def)
  25.265  qed
  25.266  
  25.267 -text {* @{const divmod_nat_rel} is injective: *}
  25.268 +text \<open>@{const divmod_nat_rel} is injective:\<close>
  25.269  
  25.270  lemma divmod_nat_rel_unique:
  25.271    assumes "divmod_nat_rel m n qr"
  25.272 @@ -884,17 +884,17 @@
  25.273    apply (subst less_iff_Suc_add)
  25.274    apply (auto simp add: add_mult_distrib)
  25.275    done
  25.276 -  from `n \<noteq> 0` assms have *: "fst qr = fst qr'"
  25.277 +  from \<open>n \<noteq> 0\<close> assms have *: "fst qr = fst qr'"
  25.278      by (auto simp add: divmod_nat_rel_def intro: order_antisym dest: aux sym)
  25.279    with assms have "snd qr = snd qr'"
  25.280      by (simp add: divmod_nat_rel_def)
  25.281    with * show ?thesis by (cases qr, cases qr') simp
  25.282  qed
  25.283  
  25.284 -text {*
  25.285 +text \<open>
  25.286    We instantiate divisibility on the natural numbers by
  25.287    means of @{const divmod_nat_rel}:
  25.288 -*}
  25.289 +\<close>
  25.290  
  25.291  definition divmod_nat :: "nat \<Rightarrow> nat \<Rightarrow> nat \<times> nat" where
  25.292    "divmod_nat m n = (THE qr. divmod_nat_rel m n qr)"
  25.293 @@ -966,7 +966,7 @@
  25.294      unfolding divmod_nat_rel_def using assms by auto
  25.295  qed
  25.296  
  25.297 -text {* The ''recursion'' equations for @{const divide} and @{const mod} *}
  25.298 +text \<open>The ''recursion'' equations for @{const divide} and @{const mod}\<close>
  25.299  
  25.300  lemma div_less [simp]:
  25.301    fixes m n :: nat
  25.302 @@ -1043,11 +1043,11 @@
  25.303    let (q, r) = divmod_nat (m - n) n in (Suc q, r))"
  25.304    by (simp add: prod_eq_iff case_prod_beta not_less le_div_geq le_mod_geq)
  25.305  
  25.306 -text {* Simproc for cancelling @{const divide} and @{const mod} *}
  25.307 +text \<open>Simproc for cancelling @{const divide} and @{const mod}\<close>
  25.308  
  25.309  ML_file "~~/src/Provers/Arith/cancel_div_mod.ML"
  25.310  
  25.311 -ML {*
  25.312 +ML \<open>
  25.313  structure Cancel_Div_Mod_Nat = Cancel_Div_Mod
  25.314  (
  25.315    val div_name = @{const_name divide};
  25.316 @@ -1073,12 +1073,12 @@
  25.317    val prove_eq_sums = Arith_Data.prove_conv2 all_tac (Arith_Data.simp_all_tac
  25.318      (@{thm add_0_left} :: @{thm add_0_right} :: @{thms ac_simps}))
  25.319  )
  25.320 -*}
  25.321 -
  25.322 -simproc_setup cancel_div_mod_nat ("(m::nat) + n") = {* K Cancel_Div_Mod_Nat.proc *}
  25.323 -
  25.324 -
  25.325 -subsubsection {* Quotient *}
  25.326 +\<close>
  25.327 +
  25.328 +simproc_setup cancel_div_mod_nat ("(m::nat) + n") = \<open>K Cancel_Div_Mod_Nat.proc\<close>
  25.329 +
  25.330 +
  25.331 +subsubsection \<open>Quotient\<close>
  25.332  
  25.333  lemma div_geq: "0 < n \<Longrightarrow>  \<not> m < n \<Longrightarrow> m div n = Suc ((m - n) div n)"
  25.334  by (simp add: le_div_geq linorder_not_less)
  25.335 @@ -1098,15 +1098,15 @@
  25.336    assumes "m \<ge> n"
  25.337    shows "m div n > 0"
  25.338  proof -
  25.339 -  from `m \<ge> n` obtain q where "m = n + q"
  25.340 +  from \<open>m \<ge> n\<close> obtain q where "m = n + q"
  25.341      by (auto simp add: le_iff_add)
  25.342 -  with `n > 0` show ?thesis by simp
  25.343 +  with \<open>n > 0\<close> show ?thesis by simp
  25.344  qed
  25.345  
  25.346  lemma div_eq_0_iff: "(a div b::nat) = 0 \<longleftrightarrow> a < b \<or> b = 0"
  25.347    by (metis div_less div_positive div_by_0 gr0I less_numeral_extra(3) not_less)
  25.348  
  25.349 -subsubsection {* Remainder *}
  25.350 +subsubsection \<open>Remainder\<close>
  25.351  
  25.352  lemma mod_less_divisor [simp]:
  25.353    fixes m n :: nat
  25.354 @@ -1144,7 +1144,7 @@
  25.355    apply simp
  25.356    done
  25.357  
  25.358 -subsubsection {* Quotient and Remainder *}
  25.359 +subsubsection \<open>Quotient and Remainder\<close>
  25.360  
  25.361  lemma divmod_nat_rel_mult1_eq:
  25.362    "divmod_nat_rel b c (q, r)
  25.363 @@ -1192,7 +1192,7 @@
  25.364    by intro_classes (auto intro: div_positive simp add: mult_div_cancel mod_mult2_eq div_mult2_eq)
  25.365  
  25.366  
  25.367 -subsubsection {* Further Facts about Quotient and Remainder *}
  25.368 +subsubsection \<open>Further Facts about Quotient and Remainder\<close>
  25.369  
  25.370  lemma div_1 [simp]:
  25.371    "m div Suc 0 = m"
  25.372 @@ -1254,7 +1254,7 @@
  25.373    apply (simp_all)
  25.374  done
  25.375  
  25.376 -text{*A fact for the mutilated chess board*}
  25.377 +text\<open>A fact for the mutilated chess board\<close>
  25.378  lemma mod_Suc: "Suc(m) mod n = (if Suc(m mod n) = n then 0 else Suc(m mod n))"
  25.379  apply (case_tac "n=0", simp)
  25.380  apply (induct "m" rule: nat_less_induct)
  25.381 @@ -1400,7 +1400,7 @@
  25.382    done
  25.383  
  25.384  
  25.385 -subsubsection {* An ``induction'' law for modulus arithmetic. *}
  25.386 +subsubsection \<open>An ``induction'' law for modulus arithmetic.\<close>
  25.387  
  25.388  lemma mod_induct_0:
  25.389    assumes step: "\<forall>i<p. P i \<longrightarrow> P ((Suc i) mod p)"
  25.390 @@ -1505,9 +1505,9 @@
  25.391    then show ?thesis by auto
  25.392  qed
  25.393  
  25.394 -text{*These lemmas collapse some needless occurrences of Suc:
  25.395 +text\<open>These lemmas collapse some needless occurrences of Suc:
  25.396      at least three Sucs, since two and fewer are rewritten back to Suc again!
  25.397 -    We already have some rules to simplify operands smaller than 3.*}
  25.398 +    We already have some rules to simplify operands smaller than 3.\<close>
  25.399  
  25.400  lemma div_Suc_eq_div_add3 [simp]: "m div (Suc (Suc (Suc n))) = m div (3+n)"
  25.401  by (simp add: Suc3_eq_add_3)
  25.402 @@ -1611,27 +1611,27 @@
  25.403  qed
  25.404  
  25.405  
  25.406 -subsection {* Division on @{typ int} *}
  25.407 +subsection \<open>Division on @{typ int}\<close>
  25.408  
  25.409  definition divmod_int_rel :: "int \<Rightarrow> int \<Rightarrow> int \<times> int \<Rightarrow> bool" where
  25.410 -    --{*definition of quotient and remainder*}
  25.411 +    --\<open>definition of quotient and remainder\<close>
  25.412    "divmod_int_rel a b = (\<lambda>(q, r). a = b * q + r \<and>
  25.413      (if 0 < b then 0 \<le> r \<and> r < b else if b < 0 then b < r \<and> r \<le> 0 else q = 0))"
  25.414  
  25.415 -text {*
  25.416 +text \<open>
  25.417    The following algorithmic devlopment actually echos what has already
  25.418    been developed in class @{class semiring_numeral_div}.  In the long
  25.419    run it seems better to derive division on @{typ int} just from
  25.420    division on @{typ nat} and instantiate @{class semiring_numeral_div}
  25.421    accordingly.
  25.422 -*}
  25.423 +\<close>
  25.424  
  25.425  definition adjust :: "int \<Rightarrow> int \<times> int \<Rightarrow> int \<times> int" where
  25.426 -    --{*for the division algorithm*}
  25.427 +    --\<open>for the division algorithm\<close>
  25.428      "adjust b = (\<lambda>(q, r). if 0 \<le> r - b then (2 * q + 1, r - b)
  25.429                           else (2 * q, r))"
  25.430  
  25.431 -text{*algorithm for the case @{text "a\<ge>0, b>0"}*}
  25.432 +text\<open>algorithm for the case @{text "a\<ge>0, b>0"}\<close>
  25.433  function posDivAlg :: "int \<Rightarrow> int \<Rightarrow> int \<times> int" where
  25.434    "posDivAlg a b = (if a < b \<or>  b \<le> 0 then (0, a)
  25.435       else adjust b (posDivAlg a (2 * b)))"
  25.436 @@ -1639,7 +1639,7 @@
  25.437  termination by (relation "measure (\<lambda>(a, b). nat (a - b + 1))")
  25.438    (auto simp add: mult_2)
  25.439  
  25.440 -text{*algorithm for the case @{text "a<0, b>0"}*}
  25.441 +text\<open>algorithm for the case @{text "a<0, b>0"}\<close>
  25.442  function negDivAlg :: "int \<Rightarrow> int \<Rightarrow> int \<times> int" where
  25.443    "negDivAlg a b = (if 0 \<le>a + b \<or> b \<le> 0  then (-1, a + b)
  25.444       else adjust b (negDivAlg a (2 * b)))"
  25.445 @@ -1647,12 +1647,12 @@
  25.446  termination by (relation "measure (\<lambda>(a, b). nat (- a - b))")
  25.447    (auto simp add: mult_2)
  25.448  
  25.449 -text{*algorithm for the general case @{term "b\<noteq>0"}*}
  25.450 +text\<open>algorithm for the general case @{term "b\<noteq>0"}\<close>
  25.451  
  25.452  definition divmod_int :: "int \<Rightarrow> int \<Rightarrow> int \<times> int" where
  25.453 -    --{*The full division algorithm considers all possible signs for a, b
  25.454 +    --\<open>The full division algorithm considers all possible signs for a, b
  25.455         including the special case @{text "a=0, b<0"} because
  25.456 -       @{term negDivAlg} requires @{term "a<0"}.*}
  25.457 +       @{term negDivAlg} requires @{term "a<0"}.\<close>
  25.458    "divmod_int a b = (if 0 \<le> a then if 0 \<le> b then posDivAlg a b
  25.459                    else if a = 0 then (0, 0)
  25.460                         else apsnd uminus (negDivAlg (-a) (-b))
  25.461 @@ -1681,7 +1681,7 @@
  25.462    "divmod_int p q = (p div q, p mod q)"
  25.463    by (simp add: prod_eq_iff)
  25.464  
  25.465 -text{*
  25.466 +text\<open>
  25.467  Here is the division algorithm in ML:
  25.468  
  25.469  \begin{verbatim}
  25.470 @@ -1707,10 +1707,10 @@
  25.471                            if 0<b then negDivAlg (a,b)
  25.472                            else        negateSnd (posDivAlg (~a,~b));
  25.473  \end{verbatim}
  25.474 -*}
  25.475 -
  25.476 -
  25.477 -subsubsection {* Uniqueness and Monotonicity of Quotients and Remainders *}
  25.478 +\<close>
  25.479 +
  25.480 +
  25.481 +subsubsection \<open>Uniqueness and Monotonicity of Quotients and Remainders\<close>
  25.482  
  25.483  lemma unique_quotient_lemma:
  25.484       "[| b*q' + r'  \<le> b*q + r;  0 \<le> r';  r' < b;  r < b |]
  25.485 @@ -1750,9 +1750,9 @@
  25.486  done
  25.487  
  25.488  
  25.489 -subsubsection {* Correctness of @{term posDivAlg}, the Algorithm for Non-Negative Dividends *}
  25.490 -
  25.491 -text{*And positive divisors*}
  25.492 +subsubsection \<open>Correctness of @{term posDivAlg}, the Algorithm for Non-Negative Dividends\<close>
  25.493 +
  25.494 +text\<open>And positive divisors\<close>
  25.495  
  25.496  lemma adjust_eq [simp]:
  25.497       "adjust b (q, r) =
  25.498 @@ -1763,13 +1763,13 @@
  25.499  
  25.500  declare posDivAlg.simps [simp del]
  25.501  
  25.502 -text{*use with a simproc to avoid repeatedly proving the premise*}
  25.503 +text\<open>use with a simproc to avoid repeatedly proving the premise\<close>
  25.504  lemma posDivAlg_eqn:
  25.505       "0 < b ==>
  25.506        posDivAlg a b = (if a<b then (0,a) else adjust b (posDivAlg a (2*b)))"
  25.507  by (rule posDivAlg.simps [THEN trans], simp)
  25.508  
  25.509 -text{*Correctness of @{term posDivAlg}: it computes quotients correctly*}
  25.510 +text\<open>Correctness of @{term posDivAlg}: it computes quotients correctly\<close>
  25.511  theorem posDivAlg_correct:
  25.512    assumes "0 \<le> a" and "0 < b"
  25.513    shows "divmod_int_rel a b (posDivAlg a b)"
  25.514 @@ -1785,13 +1785,13 @@
  25.515    done
  25.516  
  25.517  
  25.518 -subsubsection {* Correctness of @{term negDivAlg}, the Algorithm for Negative Dividends *}
  25.519 -
  25.520 -text{*And positive divisors*}
  25.521 +subsubsection \<open>Correctness of @{term negDivAlg}, the Algorithm for Negative Dividends\<close>
  25.522 +
  25.523 +text\<open>And positive divisors\<close>
  25.524  
  25.525  declare negDivAlg.simps [simp del]
  25.526  
  25.527 -text{*use with a simproc to avoid repeatedly proving the premise*}
  25.528 +text\<open>use with a simproc to avoid repeatedly proving the premise\<close>
  25.529  lemma negDivAlg_eqn:
  25.530       "0 < b ==>
  25.531        negDivAlg a b =
  25.532 @@ -1815,7 +1815,7 @@
  25.533    done
  25.534  
  25.535  
  25.536 -subsubsection {* Existence Shown by Proving the Division Algorithm to be Correct *}
  25.537 +subsubsection \<open>Existence Shown by Proving the Division Algorithm to be Correct\<close>
  25.538  
  25.539  (*the case a=0*)
  25.540  lemma divmod_int_rel_0: "divmod_int_rel 0 b (0, 0)"
  25.541 @@ -1916,14 +1916,14 @@
  25.542    
  25.543  end
  25.544    
  25.545 -text{*Basic laws about division and remainder*}
  25.546 +text\<open>Basic laws about division and remainder\<close>
  25.547  
  25.548  lemma zmod_zdiv_equality: "(a::int) = b * (a div b) + (a mod b)"
  25.549    by (fact mod_div_equality2 [symmetric])
  25.550  
  25.551 -text {* Tool setup *}
  25.552 -
  25.553 -ML {*
  25.554 +text \<open>Tool setup\<close>
  25.555 +
  25.556 +ML \<open>
  25.557  structure Cancel_Div_Mod_Int = Cancel_Div_Mod
  25.558  (
  25.559    val div_name = @{const_name Rings.divide};
  25.560 @@ -1937,9 +1937,9 @@
  25.561    val prove_eq_sums = Arith_Data.prove_conv2 all_tac (Arith_Data.simp_all_tac
  25.562      (@{thm diff_conv_add_uminus} :: @{thms add_0_left add_0_right} @ @{thms ac_simps}))
  25.563  )
  25.564 -*}
  25.565 -
  25.566 -simproc_setup cancel_div_mod_int ("(k::int) + l") = {* K Cancel_Div_Mod_Int.proc *}
  25.567 +\<close>
  25.568 +
  25.569 +simproc_setup cancel_div_mod_int ("(k::int) + l") = \<open>K Cancel_Div_Mod_Int.proc\<close>
  25.570  
  25.571  lemma pos_mod_conj: "(0::int) < b \<Longrightarrow> 0 \<le> a mod b \<and> a mod b < b"
  25.572    using divmod_int_correct [of a b]
  25.573 @@ -1956,7 +1956,7 @@
  25.574     and neg_mod_bound [simp] = neg_mod_conj [THEN conjunct2]
  25.575  
  25.576  
  25.577 -subsubsection {* General Properties of div and mod *}
  25.578 +subsubsection \<open>General Properties of div and mod\<close>
  25.579  
  25.580  lemma div_pos_pos_trivial: "[| (0::int) \<le> a;  a < b |] ==> a div b = 0"
  25.581  apply (rule div_int_unique)
  25.582 @@ -1990,10 +1990,10 @@
  25.583  apply (auto simp add: divmod_int_rel_def)
  25.584  done
  25.585  
  25.586 -text{*There is no @{text mod_neg_pos_trivial}.*}
  25.587 -
  25.588 -
  25.589 -subsubsection {* Laws for div and mod with Unary Minus *}
  25.590 +text\<open>There is no @{text mod_neg_pos_trivial}.\<close>
  25.591 +
  25.592 +
  25.593 +subsubsection \<open>Laws for div and mod with Unary Minus\<close>
  25.594  
  25.595  lemma zminus1_lemma:
  25.596       "divmod_int_rel a b (q, r) ==> b \<noteq> 0
  25.597 @@ -2035,7 +2035,7 @@
  25.598    unfolding zmod_zminus2_eq_if by auto
  25.599  
  25.600  
  25.601 -subsubsection {* Computation of Division and Remainder *}
  25.602 +subsubsection \<open>Computation of Division and Remainder\<close>
  25.603  
  25.604  lemma div_eq_minus1: "(0::int) < b ==> -1 div b = -1"
  25.605  by (simp add: div_int_def divmod_int_def)
  25.606 @@ -2043,7 +2043,7 @@
  25.607  lemma zmod_minus1: "(0::int) < b ==> -1 mod b = b - 1"
  25.608  by (simp add: mod_int_def divmod_int_def)
  25.609  
  25.610 -text{*a positive, b positive *}
  25.611 +text\<open>a positive, b positive\<close>
  25.612  
  25.613  lemma div_pos_pos: "[| 0 < a;  0 \<le> b |] ==> a div b = fst (posDivAlg a b)"
  25.614  by (simp add: div_int_def divmod_int_def)
  25.615 @@ -2051,7 +2051,7 @@
  25.616  lemma mod_pos_pos: "[| 0 < a;  0 \<le> b |] ==> a mod b = snd (posDivAlg a b)"
  25.617  by (simp add: mod_int_def divmod_int_def)
  25.618  
  25.619 -text{*a negative, b positive *}
  25.620 +text\<open>a negative, b positive\<close>
  25.621  
  25.622  lemma div_neg_pos: "[| a < 0;  0 < b |] ==> a div b = fst (negDivAlg a b)"
  25.623  by (simp add: div_int_def divmod_int_def)
  25.624 @@ -2059,7 +2059,7 @@
  25.625  lemma mod_neg_pos: "[| a < 0;  0 < b |] ==> a mod b = snd (negDivAlg a b)"
  25.626  by (simp add: mod_int_def divmod_int_def)
  25.627  
  25.628 -text{*a positive, b negative *}
  25.629 +text\<open>a positive, b negative\<close>
  25.630  
  25.631  lemma div_pos_neg:
  25.632       "[| 0 < a;  b < 0 |] ==> a div b = fst (apsnd uminus (negDivAlg (-a) (-b)))"
  25.633 @@ -2069,7 +2069,7 @@
  25.634       "[| 0 < a;  b < 0 |] ==> a mod b = snd (apsnd uminus (negDivAlg (-a) (-b)))"
  25.635  by (simp add: mod_int_def divmod_int_def)
  25.636  
  25.637 -text{*a negative, b negative *}
  25.638 +text\<open>a negative, b negative\<close>
  25.639  
  25.640  lemma div_neg_neg:
  25.641       "[| a < 0;  b \<le> 0 |] ==> a div b = fst (apsnd uminus (posDivAlg (-a) (-b)))"
  25.642 @@ -2079,7 +2079,7 @@
  25.643       "[| a < 0;  b \<le> 0 |] ==> a mod b = snd (apsnd uminus (posDivAlg (-a) (-b)))"
  25.644  by (simp add: mod_int_def divmod_int_def)
  25.645  
  25.646 -text {*Simplify expresions in which div and mod combine numerical constants*}
  25.647 +text \<open>Simplify expresions in which div and mod combine numerical constants\<close>
  25.648  
  25.649  lemma int_div_pos_eq: "\<lbrakk>(a::int) = b * q + r; 0 \<le> r; r < b\<rbrakk> \<Longrightarrow> a div b = q"
  25.650    by (rule div_int_unique [of a b q r]) (simp add: divmod_int_rel_def)
  25.651 @@ -2096,12 +2096,12 @@
  25.652    by (rule mod_int_unique [of a b q r],
  25.653      simp add: divmod_int_rel_def)
  25.654  
  25.655 -text {*
  25.656 +text \<open>
  25.657    numeral simprocs -- high chance that these can be replaced
  25.658    by divmod algorithm from @{class semiring_numeral_div}
  25.659 -*}
  25.660 -
  25.661 -ML {*
  25.662 +\<close>
  25.663 +
  25.664 +ML \<open>
  25.665  local
  25.666    val mk_number = HOLogic.mk_number HOLogic.intT
  25.667    val plus = @{term "plus :: int \<Rightarrow> int \<Rightarrow> int"}
  25.668 @@ -2133,21 +2133,21 @@
  25.669              else (le $ r $ zero, less $ u $ r, negrule RS eq_reflection)
  25.670          in SOME (rule OF map (prove ctxt) [goal1, goal2, goal3]) end)
  25.671  end
  25.672 -*}
  25.673 +\<close>
  25.674  
  25.675  simproc_setup binary_int_div
  25.676    ("numeral m div numeral n :: int" |
  25.677     "numeral m div - numeral n :: int" |
  25.678     "- numeral m div numeral n :: int" |
  25.679     "- numeral m div - numeral n :: int") =
  25.680 -  {* K (divmod_proc @{thm int_div_pos_eq} @{thm int_div_neg_eq}) *}
  25.681 +  \<open>K (divmod_proc @{thm int_div_pos_eq} @{thm int_div_neg_eq})\<close>
  25.682  
  25.683  simproc_setup binary_int_mod
  25.684    ("numeral m mod numeral n :: int" |
  25.685     "numeral m mod - numeral n :: int" |
  25.686     "- numeral m mod numeral n :: int" |
  25.687     "- numeral m mod - numeral n :: int") =
  25.688 -  {* K (divmod_proc @{thm int_mod_pos_eq} @{thm int_mod_neg_eq}) *}
  25.689 +  \<open>K (divmod_proc @{thm int_mod_pos_eq} @{thm int_mod_neg_eq})\<close>
  25.690  
  25.691  lemmas posDivAlg_eqn_numeral [simp] =
  25.692      posDivAlg_eqn [of "numeral v" "numeral w", OF zero_less_numeral] for v w
  25.693 @@ -2156,7 +2156,7 @@
  25.694      negDivAlg_eqn [of "numeral v" "- numeral w", OF zero_less_numeral] for v w
  25.695  
  25.696  
  25.697 -text {* Special-case simplification: @{text "\<plusminus>1 div z"} and @{text "\<plusminus>1 mod z"} *}
  25.698 +text \<open>Special-case simplification: @{text "\<plusminus>1 div z"} and @{text "\<plusminus>1 mod z"}\<close>
  25.699  
  25.700  lemma [simp]:
  25.701    shows div_one_bit0: "1 div numeral (Num.Bit0 v) = (0 :: int)"
  25.702 @@ -2178,7 +2178,7 @@
  25.703    by (simp_all add: div_eq_minus1 zmod_minus1)
  25.704  
  25.705  
  25.706 -subsubsection {* Monotonicity in the First Argument (Dividend) *}
  25.707 +subsubsection \<open>Monotonicity in the First Argument (Dividend)\<close>
  25.708  
  25.709  lemma zdiv_mono1: "[| a \<le> a';  0 < (b::int) |] ==> a div b \<le> a' div b"
  25.710  apply (cut_tac a = a and b = b in zmod_zdiv_equality)
  25.711 @@ -2197,7 +2197,7 @@
  25.712  done
  25.713  
  25.714  
  25.715 -subsubsection {* Monotonicity in the Second Argument (Divisor) *}
  25.716 +subsubsection \<open>Monotonicity in the Second Argument (Divisor)\<close>
  25.717  
  25.718  lemma q_pos_lemma:
  25.719       "[| 0 \<le> b'*q' + r'; r' < b';  0 < b' |] ==> 0 \<le> (q'::int)"
  25.720 @@ -2259,9 +2259,9 @@
  25.721  done
  25.722  
  25.723  
  25.724 -subsubsection {* More Algebraic Laws for div and mod *}
  25.725 -
  25.726 -text{*proving (a*b) div c = a * (b div c) + a * (b mod c) *}
  25.727 +subsubsection \<open>More Algebraic Laws for div and mod\<close>
  25.728 +
  25.729 +text\<open>proving (a*b) div c = a * (b div c) + a * (b mod c)\<close>
  25.730  
  25.731  lemma zmult1_lemma:
  25.732       "[| divmod_int_rel b c (q, r) |]
  25.733 @@ -2273,7 +2273,7 @@
  25.734  apply (blast intro: divmod_int_rel_div_mod [THEN zmult1_lemma, THEN div_int_unique])
  25.735  done
  25.736  
  25.737 -text{*proving (a+b) div c = a div c + b div c + ((a mod c + b mod c) div c) *}
  25.738 +text\<open>proving (a+b) div c = a div c + b div c + ((a mod c + b mod c) div c)\<close>
  25.739  
  25.740  lemma zadd1_lemma:
  25.741       "[| divmod_int_rel a c (aq, ar);  divmod_int_rel b c (bq, br) |]
  25.742 @@ -2325,13 +2325,13 @@
  25.743    using mod_div_equality [of m n] by arith
  25.744  
  25.745  
  25.746 -subsubsection {* Proving  @{term "a div (b * c) = (a div b) div c"} *}
  25.747 +subsubsection \<open>Proving  @{term "a div (b * c) = (a div b) div c"}\<close>
  25.748  
  25.749  (*The condition c>0 seems necessary.  Consider that 7 div ~6 = ~2 but
  25.750    7 div 2 div ~3 = 3 div ~3 = ~1.  The subcase (a div b) mod c = 0 seems
  25.751    to cause particular problems.*)
  25.752  
  25.753 -text{*first, four lemmas to bound the remainder for the cases b<0 and b>0 *}
  25.754 +text\<open>first, four lemmas to bound the remainder for the cases b<0 and b>0\<close>
  25.755  
  25.756  lemma zmult2_lemma_aux1: "[| (0::int) < c;  b < r;  r \<le> 0 |] ==> b * c < b * (q mod c) + r"
  25.757  apply (subgoal_tac "b * (c - q mod c) < r * 1")
  25.758 @@ -2409,9 +2409,9 @@
  25.759  qed
  25.760  
  25.761  
  25.762 -subsubsection {* Splitting Rules for div and mod *}
  25.763 -
  25.764 -text{*The proofs of the two lemmas below are essentially identical*}
  25.765 +subsubsection \<open>Splitting Rules for div and mod\<close>
  25.766 +
  25.767 +text\<open>The proofs of the two lemmas below are essentially identical\<close>
  25.768  
  25.769  lemma split_pos_lemma:
  25.770   "0<k ==>
  25.771 @@ -2421,7 +2421,7 @@
  25.772   apply (subst mod_add_eq)
  25.773   apply (subst zdiv_zadd1_eq)
  25.774   apply (simp add: div_pos_pos_trivial mod_pos_pos_trivial)
  25.775 -txt{*converse direction*}
  25.776 +txt\<open>converse direction\<close>
  25.777  apply (drule_tac x = "n div k" in spec)
  25.778  apply (drule_tac x = "n mod k" in spec, simp)
  25.779  done
  25.780 @@ -2434,7 +2434,7 @@
  25.781   apply (subst mod_add_eq)
  25.782   apply (subst zdiv_zadd1_eq)
  25.783   apply (simp add: div_neg_neg_trivial mod_neg_neg_trivial)
  25.784 -txt{*converse direction*}
  25.785 +txt\<open>converse direction\<close>
  25.786  apply (drule_tac x = "n div k" in spec)
  25.787  apply (drule_tac x = "n mod k" in spec, simp)
  25.788  done
  25.789 @@ -2463,14 +2463,14 @@
  25.790                        split_neg_lemma [of concl: "%x y. P y"])
  25.791  done
  25.792  
  25.793 -text {* Enable (lin)arith to deal with @{const divide} and @{const mod}
  25.794 +text \<open>Enable (lin)arith to deal with @{const divide} and @{const mod}
  25.795    when these are applied to some constant that is of the form
  25.796 -  @{term "numeral k"}: *}
  25.797 +  @{term "numeral k"}:\<close>
  25.798  declare split_zdiv [of _ _ "numeral k", arith_split] for k
  25.799  declare split_zmod [of _ _ "numeral k", arith_split] for k
  25.800  
  25.801  
  25.802 -subsubsection {* Computing @{text "div"} and @{text "mod"} with shifting *}
  25.803 +subsubsection \<open>Computing @{text "div"} and @{text "mod"} with shifting\<close>
  25.804  
  25.805  lemma pos_divmod_int_rel_mult_2:
  25.806    assumes "0 \<le> b"
  25.807 @@ -2478,7 +2478,7 @@
  25.808    shows "divmod_int_rel (1 + 2*a) (2*b) (q, 1 + 2*r)"
  25.809    using assms unfolding divmod_int_rel_def by auto
  25.810  
  25.811 -declaration {* K (Lin_Arith.add_simps @{thms uminus_numeral_One}) *}
  25.812 +declaration \<open>K (Lin_Arith.add_simps @{thms uminus_numeral_One})\<close>
  25.813  
  25.814  lemma neg_divmod_int_rel_mult_2:
  25.815    assumes "b \<le> 0"
  25.816 @@ -2486,7 +2486,7 @@
  25.817    shows "divmod_int_rel (1 + 2*a) (2*b) (q, 2*r - 1)"
  25.818    using assms unfolding divmod_int_rel_def by auto
  25.819  
  25.820 -text{*computing div by shifting *}
  25.821 +text\<open>computing div by shifting\<close>
  25.822  
  25.823  lemma pos_zdiv_mult_2: "(0::int) \<le> a ==> (1 + 2*b) div (2*a) = b div a"
  25.824    using pos_divmod_int_rel_mult_2 [OF _ divmod_int_rel_div_mod]
  25.825 @@ -2544,14 +2544,14 @@
  25.826  proof
  25.827    assume ?L
  25.828    have "?L \<longrightarrow> ?R" by (rule split_zdiv[THEN iffD2]) simp
  25.829 -  with `?L` show ?R by blast
  25.830 +  with \<open>?L\<close> show ?R by blast
  25.831  next
  25.832    assume ?R thus ?L
  25.833      by(auto simp: div_pos_pos_trivial div_neg_neg_trivial)
  25.834  qed
  25.835  
  25.836  
  25.837 -subsubsection {* Quotients of Signs *}
  25.838 +subsubsection \<open>Quotients of Signs\<close>
  25.839  
  25.840  lemma div_neg_pos_less0: "[| a < (0::int);  0 < b |] ==> a div b < 0"
  25.841  apply (subgoal_tac "a div b \<le> -1", force)
  25.842 @@ -2566,9 +2566,9 @@
  25.843  lemma div_nonpos_pos_le0: "[| (a::int) \<le> 0; b > 0 |] ==> a div b \<le> 0"
  25.844  by (drule zdiv_mono1, auto)
  25.845  
  25.846 -text{* Now for some equivalences of the form @{text"a div b >=< 0 \<longleftrightarrow> \<dots>"}
  25.847 +text\<open>Now for some equivalences of the form @{text"a div b >=< 0 \<longleftrightarrow> \<dots>"}
  25.848  conditional upon the sign of @{text a} or @{text b}. There are many more.
  25.849 -They should all be simp rules unless that causes too much search. *}
  25.850 +They should all be simp rules unless that causes too much search.\<close>
  25.851  
  25.852  lemma pos_imp_zdiv_nonneg_iff: "(0::int) < b ==> (0 \<le> a div b) = (0 \<le> a)"
  25.853  apply auto
  25.854 @@ -2613,14 +2613,14 @@
  25.855  done
  25.856  
  25.857  
  25.858 -subsubsection {* The Divides Relation *}
  25.859 +subsubsection \<open>The Divides Relation\<close>
  25.860  
  25.861  lemma dvd_eq_mod_eq_0_numeral:
  25.862    "numeral x dvd (numeral y :: 'a) \<longleftrightarrow> numeral y mod numeral x = (0 :: 'a::semiring_div)"
  25.863    by (fact dvd_eq_mod_eq_0)
  25.864  
  25.865  
  25.866 -subsubsection {* Further properties *}
  25.867 +subsubsection \<open>Further properties\<close>
  25.868  
  25.869  lemma zmult_div_cancel: "(n::int) * (m div n) = m - (m mod n)"
  25.870    using zmod_zdiv_equality[where a="m" and b="n"]
  25.871 @@ -2650,7 +2650,7 @@
  25.872  lemma abs_div: "(y::int) dvd x \<Longrightarrow> abs (x div y) = abs x div abs y"
  25.873  by (unfold dvd_def, cases "y=0", auto simp add: abs_mult)
  25.874  
  25.875 -text{*Suggested by Matthias Daum*}
  25.876 +text\<open>Suggested by Matthias Daum\<close>
  25.877  lemma int_power_div_base:
  25.878       "\<lbrakk>0 < m; 0 < k\<rbrakk> \<Longrightarrow> k ^ m div k = (k::int) ^ (m - Suc 0)"
  25.879  apply (subgoal_tac "k ^ m = k ^ ((m - Suc 0) + Suc 0)")
  25.880 @@ -2659,7 +2659,7 @@
  25.881   apply simp_all
  25.882  done
  25.883  
  25.884 -text {* by Brian Huffman *}
  25.885 +text \<open>by Brian Huffman\<close>
  25.886  lemma zminus_zmod: "- ((x::int) mod m) mod m = - x mod m"
  25.887  by (rule mod_minus_eq [symmetric])
  25.888  
  25.889 @@ -2677,7 +2677,7 @@
  25.890    power_mod
  25.891    zminus_zmod zdiff_zmod_left zdiff_zmod_right
  25.892  
  25.893 -text {* Distributive laws for function @{text nat}. *}
  25.894 +text \<open>Distributive laws for function @{text nat}.\<close>
  25.895  
  25.896  lemma nat_div_distrib: "0 \<le> x \<Longrightarrow> nat (x div y) = nat x div nat y"
  25.897  apply (rule linorder_cases [of y 0])
  25.898 @@ -2693,7 +2693,7 @@
  25.899  apply (simp add: nat_eq_iff zmod_int)
  25.900  done
  25.901  
  25.902 -text  {* transfer setup *}
  25.903 +text  \<open>transfer setup\<close>
  25.904  
  25.905  lemma transfer_nat_int_functions:
  25.906      "(x::int) >= 0 \<Longrightarrow> y >= 0 \<Longrightarrow> (nat x) div (nat y) = nat (x div y)"
  25.907 @@ -2729,7 +2729,7 @@
  25.908    transfer_int_nat_function_closures
  25.909  ]
  25.910  
  25.911 -text{*Suggested by Matthias Daum*}
  25.912 +text\<open>Suggested by Matthias Daum\<close>
  25.913  lemma int_div_less_self: "\<lbrakk>0 < x; 1 < k\<rbrakk> \<Longrightarrow> x div k < (x::int)"
  25.914  apply (subgoal_tac "nat x div nat k < nat x")
  25.915   apply (simp add: nat_div_distrib [symmetric])
  25.916 @@ -2781,11 +2781,11 @@
  25.917    thus  ?lhs by simp
  25.918  qed
  25.919  
  25.920 -text {*
  25.921 +text \<open>
  25.922    This re-embedding of natural division on integers goes back to the
  25.923    time when numerals had been signed numerals.  It should
  25.924    now be replaced by the algorithm developed in @{class semiring_numeral_div}.
  25.925 -*}
  25.926 +\<close>
  25.927  
  25.928  lemma div_nat_numeral [simp]:
  25.929    "(numeral v :: nat) div numeral v' = nat (numeral v div numeral v')"
  25.930 @@ -2804,14 +2804,14 @@
  25.931    by (subst nat_mod_distrib) simp_all
  25.932  
  25.933  
  25.934 -subsubsection {* Tools setup *}
  25.935 -
  25.936 -text {* Nitpick *}
  25.937 +subsubsection \<open>Tools setup\<close>
  25.938 +
  25.939 +text \<open>Nitpick\<close>
  25.940  
  25.941  lemmas [nitpick_unfold] = dvd_eq_mod_eq_0 mod_div_equality' zmod_zdiv_equality'
  25.942  
  25.943  
  25.944 -subsubsection {* Code generation *}
  25.945 +subsubsection \<open>Code generation\<close>
  25.946  
  25.947  definition divmod_abs :: "int \<Rightarrow> int \<Rightarrow> int \<times> int"
  25.948  where
    26.1 --- a/src/HOL/Enum.thy	Sat Jul 18 21:44:18 2015 +0200
    26.2 +++ b/src/HOL/Enum.thy	Sat Jul 18 22:58:50 2015 +0200
    26.3 @@ -1,12 +1,12 @@
    26.4  (* Author: Florian Haftmann, TU Muenchen *)
    26.5  
    26.6 -section {* Finite types as explicit enumerations *}
    26.7 +section \<open>Finite types as explicit enumerations\<close>
    26.8  
    26.9  theory Enum
   26.10  imports Map Groups_List
   26.11  begin
   26.12  
   26.13 -subsection {* Class @{text enum} *}
   26.14 +subsection \<open>Class @{text enum}\<close>
   26.15  
   26.16  class enum =
   26.17    fixes enum :: "'a list"
   26.18 @@ -16,7 +16,7 @@
   26.19      and enum_distinct: "distinct enum"
   26.20    assumes enum_all_UNIV: "enum_all P \<longleftrightarrow> Ball UNIV P"
   26.21    assumes enum_ex_UNIV: "enum_ex P \<longleftrightarrow> Bex UNIV P" 
   26.22 -   -- {* tailored towards simple instantiation *}
   26.23 +   -- \<open>tailored towards simple instantiation\<close>
   26.24  begin
   26.25  
   26.26  subclass finite proof
   26.27 @@ -52,9 +52,9 @@
   26.28  end
   26.29  
   26.30  
   26.31 -subsection {* Implementations using @{class enum} *}
   26.32 +subsection \<open>Implementations using @{class enum}\<close>
   26.33  
   26.34 -subsubsection {* Unbounded operations and quantifiers *}
   26.35 +subsubsection \<open>Unbounded operations and quantifiers\<close>
   26.36  
   26.37  lemma Collect_code [code]:
   26.38    "Collect P = set (filter P enum)"
   26.39 @@ -82,7 +82,7 @@
   26.40    by (auto simp add: list_ex1_iff enum_UNIV)
   26.41  
   26.42  
   26.43 -subsubsection {* An executable choice operator *}
   26.44 +subsubsection \<open>An executable choice operator\<close>
   26.45  
   26.46  definition
   26.47    [code del]: "enum_the = The"
   26.48 @@ -106,7 +106,7 @@
   26.49            and "\<forall> x \<in> set vs. \<not> P x"
   26.50            and "P a"
   26.51            by (auto simp add: filter_eq_Cons_iff) (simp only: filter_empty_conv[symmetric])
   26.52 -        with `P x` in_enum[of x, unfolded enum_eq] `x \<noteq> a` show "False" by auto
   26.53 +        with \<open>P x\<close> in_enum[of x, unfolded enum_eq] \<open>x \<noteq> a\<close> show "False" by auto
   26.54        qed
   26.55      next
   26.56        from filter_enum show "P a" by (auto simp add: filter_eq_Cons_iff)
   26.57 @@ -122,7 +122,7 @@
   26.58    constant enum_the \<rightharpoonup> (Eval) "(fn '_ => raise Match)"
   26.59  
   26.60  
   26.61 -subsubsection {* Equality and order on functions *}
   26.62 +subsubsection \<open>Equality and order on functions\<close>
   26.63  
   26.64  instantiation "fun" :: (enum, equal) equal
   26.65  begin
   26.66 @@ -150,7 +150,7 @@
   26.67    by (simp_all add: fun_eq_iff le_fun_def order_less_le)
   26.68  
   26.69  
   26.70 -subsubsection {* Operations on relations *}
   26.71 +subsubsection \<open>Operations on relations\<close>
   26.72  
   26.73  lemma [code]:
   26.74    "Id = image (\<lambda>x. (x, x)) (set Enum.enum)"
   26.75 @@ -177,7 +177,7 @@
   26.76    by (auto simp add: mlex_prod_def)
   26.77  
   26.78  
   26.79 -subsubsection {* Bounded accessible part *}
   26.80 +subsubsection \<open>Bounded accessible part\<close>
   26.81  
   26.82  primrec bacc :: "('a \<times> 'a) set \<Rightarrow> nat \<Rightarrow> 'a set" 
   26.83  where
   26.84 @@ -219,7 +219,7 @@
   26.85        fix y assume y: "(y, x) : r"
   26.86        with n have "y : bacc r (n y)" by auto
   26.87        moreover have "n y <= Max ((%(y, x). n y) ` r)"
   26.88 -        using y `finite r` by (auto intro!: Max_ge)
   26.89 +        using y \<open>finite r\<close> by (auto intro!: Max_ge)
   26.90        note bacc_mono[OF this, of r]
   26.91        ultimately show "y : bacc r (Max ((%(y, x). n y) ` r))" by auto
   26.92      qed
   26.93 @@ -241,7 +241,7 @@
   26.94    by (simp add: card_UNIV_def acc_bacc_eq)
   26.95  
   26.96  
   26.97 -subsection {* Default instances for @{class enum} *}
   26.98 +subsection \<open>Default instances for @{class enum}\<close>
   26.99  
  26.100  lemma map_of_zip_enum_is_Some:
  26.101    assumes "length ys = length (enum \<Colon> 'a\<Colon>enum list)"
  26.102 @@ -329,7 +329,7 @@
  26.103        fix f :: "'a \<Rightarrow> 'b"
  26.104        have f: "f = the \<circ> map_of (zip (enum \<Colon> 'a\<Colon>enum list) (map f enum))"
  26.105          by (auto simp add: map_of_zip_map fun_eq_iff intro: in_enum)
  26.106 -      from `enum_all P` have "P (the \<circ> map_of (zip enum (map f enum)))"
  26.107 +      from \<open>enum_all P\<close> have "P (the \<circ> map_of (zip enum (map f enum)))"
  26.108          unfolding enum_all_fun_def all_n_lists_def
  26.109          apply (simp add: set_n_lists)
  26.110          apply (erule_tac x="map f enum" in allE)
  26.111 @@ -354,7 +354,7 @@
  26.112      from this obtain f where "P f" ..
  26.113      have f: "f = the \<circ> map_of (zip (enum \<Colon> 'a\<Colon>enum list) (map f enum))"
  26.114        by (auto simp add: map_of_zip_map fun_eq_iff intro: in_enum) 
  26.115 -    from `P f` this have "P (the \<circ> map_of (zip (enum \<Colon> 'a\<Colon>enum list) (map f enum)))"
  26.116 +    from \<open>P f\<close> this have "P (the \<circ> map_of (zip (enum \<Colon> 'a\<Colon>enum list) (map f enum)))"
  26.117        by auto
  26.118      from  this show "enum_ex P"
  26.119        unfolding enum_ex_fun_def ex_n_lists_def
  26.120 @@ -489,9 +489,9 @@
  26.121  end
  26.122  
  26.123  
  26.124 -subsection {* Small finite types *}
  26.125 +subsection \<open>Small finite types\<close>
  26.126  
  26.127 -text {* We define small finite types for use in Quickcheck *}
  26.128 +text \<open>We define small finite types for use in Quickcheck\<close>
  26.129  
  26.130  datatype (plugins only: code "quickcheck" extraction) finite_1 =
  26.131    a\<^sub>1
  26.132 @@ -562,12 +562,12 @@
  26.133  lemma finite_1_eq: "x = a\<^sub>1"
  26.134  by(cases x) simp
  26.135  
  26.136 -simproc_setup finite_1_eq ("x::finite_1") = {*
  26.137 +simproc_setup finite_1_eq ("x::finite_1") = \<open>
  26.138    fn _ => fn _ => fn ct =>
  26.139      (case Thm.term_of ct of
  26.140        Const (@{const_name a\<^sub>1}, _) => NONE
  26.141      | _ => SOME (mk_meta_eq @{thm finite_1_eq}))
  26.142 -*}
  26.143 +\<close>
  26.144  
  26.145  instantiation finite_1 :: complete_boolean_algebra
  26.146  begin
  26.147 @@ -864,8 +864,8 @@
  26.148  
  26.149  instantiation finite_4 :: complete_lattice begin
  26.150  
  26.151 -text {* @{term a\<^sub>1} $<$ @{term a\<^sub>2},@{term a\<^sub>3} $<$ @{term a\<^sub>4},
  26.152 -  but @{term a\<^sub>2} and @{term a\<^sub>3} are incomparable. *}
  26.153 +text \<open>@{term a\<^sub>1} $<$ @{term a\<^sub>2},@{term a\<^sub>3} $<$ @{term a\<^sub>4},
  26.154 +  but @{term a\<^sub>2} and @{term a\<^sub>3} are incomparable.\<close>
  26.155  
  26.156  definition
  26.157    "x < y \<longleftrightarrow> (case (x, y) of
  26.158 @@ -968,7 +968,7 @@
  26.159  instantiation finite_5 :: complete_lattice
  26.160  begin
  26.161  
  26.162 -text {* The non-distributive pentagon lattice $N_5$ *}
  26.163 +text \<open>The non-distributive pentagon lattice $N_5$\<close>
  26.164  
  26.165  definition
  26.166    "x < y \<longleftrightarrow> (case (x, y) of
  26.167 @@ -1034,7 +1034,7 @@
  26.168  hide_const (open) a\<^sub>1 a\<^sub>2 a\<^sub>3 a\<^sub>4 a\<^sub>5
  26.169  
  26.170  
  26.171 -subsection {* Closing up *}
  26.172 +subsection \<open>Closing up\<close>
  26.173  
  26.174  hide_type (open) finite_1 finite_2 finite_3 finite_4 finite_5
  26.175  hide_const (open) enum enum_all enum_ex all_n_lists ex_n_lists ntrancl
    27.1 --- a/src/HOL/Equiv_Relations.thy	Sat Jul 18 21:44:18 2015 +0200
    27.2 +++ b/src/HOL/Equiv_Relations.thy	Sat Jul 18 22:58:50 2015 +0200
    27.3 @@ -2,13 +2,13 @@
    27.4      Copyright   1996  University of Cambridge
    27.5  *)
    27.6  
    27.7 -section {* Equivalence Relations in Higher-Order Set Theory *}
    27.8 +section \<open>Equivalence Relations in Higher-Order Set Theory\<close>
    27.9  
   27.10  theory Equiv_Relations
   27.11  imports Groups_Big Relation
   27.12  begin
   27.13  
   27.14 -subsection {* Equivalence relations -- set version *}
   27.15 +subsection \<open>Equivalence relations -- set version\<close>
   27.16  
   27.17  definition equiv :: "'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> bool" where
   27.18    "equiv A r \<longleftrightarrow> refl_on A r \<and> sym r \<and> trans r"
   27.19 @@ -22,12 +22,12 @@
   27.20    obtains "refl_on A r" and "sym r" and "trans r"
   27.21    using assms by (simp add: equiv_def)
   27.22  
   27.23 -text {*
   27.24 +text \<open>
   27.25    Suppes, Theorem 70: @{text r} is an equiv relation iff @{text "r\<inverse> O
   27.26    r = r"}.
   27.27  
   27.28    First half: @{text "equiv A r ==> r\<inverse> O r = r"}.
   27.29 -*}
   27.30 +\<close>
   27.31  
   27.32  lemma sym_trans_comp_subset:
   27.33      "sym r ==> trans r ==> r\<inverse> O r \<subseteq> r"
   27.34 @@ -43,7 +43,7 @@
   27.35     apply (iprover intro: sym_trans_comp_subset refl_on_comp_subset)+
   27.36    done
   27.37  
   27.38 -text {* Second half. *}
   27.39 +text \<open>Second half.\<close>
   27.40  
   27.41  lemma comp_equivI:
   27.42      "r\<inverse> O r = r ==> Domain r = A ==> equiv A r"
   27.43 @@ -55,11 +55,11 @@
   27.44    done
   27.45  
   27.46  
   27.47 -subsection {* Equivalence classes *}
   27.48 +subsection \<open>Equivalence classes\<close>
   27.49  
   27.50  lemma equiv_class_subset:
   27.51    "equiv A r ==> (a, b) \<in> r ==> r``{a} \<subseteq> r``{b}"
   27.52 -  -- {* lemma for the next result *}
   27.53 +  -- \<open>lemma for the next result\<close>
   27.54    by (unfold equiv_def trans_def sym_def) blast
   27.55  
   27.56  theorem equiv_class_eq: "equiv A r ==> (a, b) \<in> r ==> r``{a} = r``{b}"
   27.57 @@ -73,7 +73,7 @@
   27.58  
   27.59  lemma subset_equiv_class:
   27.60      "equiv A r ==> r``{b} \<subseteq> r``{a} ==> b \<in> A ==> (a,b) \<in> r"
   27.61 -  -- {* lemma for the next result *}
   27.62 +  -- \<open>lemma for the next result\<close>
   27.63    by (unfold equiv_def refl_on_def) blast
   27.64  
   27.65  lemma eq_equiv_class:
   27.66 @@ -96,10 +96,10 @@
   27.67    by (blast intro!: equiv_class_eq dest: eq_equiv_class equiv_type)
   27.68  
   27.69  
   27.70 -subsection {* Quotients *}
   27.71 +subsection \<open>Quotients\<close>
   27.72  
   27.73  definition quotient :: "'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> 'a set set"  (infixl "'/'/" 90) where
   27.74 -  "A//r = (\<Union>x \<in> A. {r``{x}})"  -- {* set of equiv classes *}
   27.75 +  "A//r = (\<Union>x \<in> A. {r``{x}})"  -- \<open>set of equiv classes\<close>
   27.76  
   27.77  lemma quotientI: "x \<in> A ==> r``{x} \<in> A//r"
   27.78    by (unfold quotient_def) blast
   27.79 @@ -160,7 +160,7 @@
   27.80  apply blast
   27.81  done
   27.82  
   27.83 -subsection {* Refinement of one equivalence relation WRT another *}
   27.84 +subsection \<open>Refinement of one equivalence relation WRT another\<close>
   27.85  
   27.86  lemma refines_equiv_class_eq:
   27.87     "\<lbrakk>R \<subseteq> S; equiv A R; equiv A S\<rbrakk> \<Longrightarrow> R``(S``{a}) = S``{a}"
   27.88 @@ -187,9 +187,9 @@
   27.89    done
   27.90  
   27.91  
   27.92 -subsection {* Defining unary operations upon equivalence classes *}
   27.93 +subsection \<open>Defining unary operations upon equivalence classes\<close>
   27.94  
   27.95 -text{*A congruence-preserving function*}
   27.96 +text\<open>A congruence-preserving function\<close>
   27.97  
   27.98  definition congruent :: "('a \<times> 'a) set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool"  where
   27.99    "congruent r f \<longleftrightarrow> (\<forall>(y, z) \<in> r. f y = f z)"
  27.100 @@ -209,13 +209,13 @@
  27.101  
  27.102  
  27.103  lemma UN_constant_eq: "a \<in> A ==> \<forall>y \<in> A. f y = c ==> (\<Union>y \<in> A. f(y))=c"
  27.104 -  -- {* lemma required to prove @{text UN_equiv_class} *}
  27.105 +  -- \<open>lemma required to prove @{text UN_equiv_class}\<close>
  27.106    by auto
  27.107  
  27.108  lemma UN_equiv_class:
  27.109    "equiv A r ==> f respects r ==> a \<in> A
  27.110      ==> (\<Union>x \<in> r``{a}. f x) = f a"
  27.111 -  -- {* Conversion rule *}
  27.112 +  -- \<open>Conversion rule\<close>
  27.113    apply (rule equiv_class_self [THEN UN_constant_eq], assumption+)
  27.114    apply (unfold equiv_def congruent_def sym_def)
  27.115    apply (blast del: equalityI)
  27.116 @@ -230,11 +230,11 @@
  27.117       apply auto
  27.118    done
  27.119  
  27.120 -text {*
  27.121 +text \<open>
  27.122    Sufficient conditions for injectiveness.  Could weaken premises!
  27.123    major premise could be an inclusion; bcong could be @{text "!!y. y \<in>
  27.124    A ==> f y \<in> B"}.
  27.125 -*}
  27.126 +\<close>
  27.127  
  27.128  lemma UN_equiv_class_inject:
  27.129    "equiv A r ==> f respects r ==>
  27.130 @@ -252,9 +252,9 @@
  27.131    done
  27.132  
  27.133  
  27.134 -subsection {* Defining binary operations upon equivalence classes *}
  27.135 +subsection \<open>Defining binary operations upon equivalence classes\<close>
  27.136  
  27.137 -text{*A congruence-preserving function of two arguments*}
  27.138 +text\<open>A congruence-preserving function of two arguments\<close>
  27.139  
  27.140  definition congruent2 :: "('a \<times> 'a) set \<Rightarrow> ('b \<times> 'b) set \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> bool" where
  27.141    "congruent2 r1 r2 f \<longleftrightarrow> (\<forall>(y1, z1) \<in> r1. \<forall>(y2, z2) \<in> r2. f y1 y2 = f z1 z2)"
  27.142 @@ -268,7 +268,7 @@
  27.143    "congruent2 r1 r2 f \<Longrightarrow> (y1, z1) \<in> r1 \<Longrightarrow> (y2, z2) \<in> r2 \<Longrightarrow> f y1 y2 = f z1 z2"
  27.144    using assms by (auto simp add: congruent2_def)
  27.145  
  27.146 -text{*Abbreviation for the common case where the relations are identical*}
  27.147 +text\<open>Abbreviation for the common case where the relations are identical\<close>
  27.148  abbreviation
  27.149    RESPECTS2:: "['a => 'a => 'b, ('a * 'a) set] => bool"
  27.150      (infixr "respects2" 80) where
  27.151 @@ -310,8 +310,8 @@
  27.152  lemma UN_UN_split_split_eq:
  27.153    "(\<Union>(x1, x2) \<in> X. \<Union>(y1, y2) \<in> Y. A x1 x2 y1 y2) =
  27.154      (\<Union>x \<in> X. \<Union>y \<in> Y. (\<lambda>(x1, x2). (\<lambda>(y1, y2). A x1 x2 y1 y2) y) x)"
  27.155 -  -- {* Allows a natural expression of binary operators, *}
  27.156 -  -- {* without explicit calls to @{text split} *}
  27.157 +  -- \<open>Allows a natural expression of binary operators,\<close>
  27.158 +  -- \<open>without explicit calls to @{text split}\<close>
  27.159    by auto
  27.160  
  27.161  lemma congruent2I:
  27.162 @@ -319,8 +319,8 @@
  27.163      ==> (!!y z w. w \<in> A2 ==> (y,z) \<in> r1 ==> f y w = f z w)
  27.164      ==> (!!y z w. w \<in> A1 ==> (y,z) \<in> r2 ==> f w y = f w z)
  27.165      ==> congruent2 r1 r2 f"
  27.166 -  -- {* Suggested by John Harrison -- the two subproofs may be *}
  27.167 -  -- {* \emph{much} simpler than the direct proof. *}
  27.168 +  -- \<open>Suggested by John Harrison -- the two subproofs may be\<close>
  27.169 +  -- \<open>\emph{much} simpler than the direct proof.\<close>
  27.170    apply (unfold congruent2_def equiv_def refl_on_def)
  27.171    apply clarify
  27.172    apply (blast intro: trans)
  27.173 @@ -340,12 +340,12 @@
  27.174    done
  27.175  
  27.176  
  27.177 -subsection {* Quotients and finiteness *}
  27.178 +subsection \<open>Quotients and finiteness\<close>
  27.179  
  27.180 -text {*Suggested by Florian Kammüller*}
  27.181 +text \<open>Suggested by Florian Kammüller\<close>
  27.182  
  27.183  lemma finite_quotient: "finite A ==> r \<subseteq> A \<times> A ==> finite (A//r)"
  27.184 -  -- {* recall @{thm equiv_type} *}
  27.185 +  -- \<open>recall @{thm equiv_type}\<close>
  27.186    apply (rule finite_subset)
  27.187     apply (erule_tac [2] finite_Pow_iff [THEN iffD2])
  27.188    apply (unfold quotient_def)
  27.189 @@ -381,7 +381,7 @@
  27.190  done
  27.191  
  27.192  
  27.193 -subsection {* Projection *}
  27.194 +subsection \<open>Projection\<close>
  27.195  
  27.196  definition proj where "proj r x = r `` {x}"
  27.197  
  27.198 @@ -429,13 +429,13 @@
  27.199  using assms in_quotient_imp_in_rel equiv_type by fastforce
  27.200  
  27.201  
  27.202 -subsection {* Equivalence relations -- predicate version *}
  27.203 +subsection \<open>Equivalence relations -- predicate version\<close>
  27.204  
  27.205 -text {* Partial equivalences *}
  27.206 +text \<open>Partial equivalences\<close>
  27.207  
  27.208  definition part_equivp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
  27.209    "part_equivp R \<longleftrightarrow> (\<exists>x. R x x) \<and> (\<forall>x y. R x y \<longleftrightarrow> R x x \<and> R y y \<and> R x = R y)"
  27.210 -    -- {* John-Harrison-style characterization *}
  27.211 +    -- \<open>John-Harrison-style characterization\<close>
  27.212  
  27.213  lemma part_equivpI:
  27.214    "(\<exists>x. R x x) \<Longrightarrow> symp R \<Longrightarrow> transp R \<Longrightarrow> part_equivp R"
  27.215 @@ -481,10 +481,10 @@
  27.216    by (auto elim: part_equivpE)
  27.217  
  27.218  
  27.219 -text {* Total equivalences *}
  27.220 +text \<open>Total equivalences\<close>
  27.221  
  27.222  definition equivp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
  27.223 -  "equivp R \<longleftrightarrow> (\<forall>x y. R x y = (R x = R y))" -- {* John-Harrison-style characterization *}
  27.224 +  "equivp R \<longleftrightarrow> (\<forall>x y. R x y = (R x = R y))" -- \<open>John-Harrison-style characterization\<close>
  27.225  
  27.226  lemma equivpI:
  27.227    "reflp R \<Longrightarrow> symp R \<Longrightarrow> transp R \<Longrightarrow> equivp R"
    28.1 --- a/src/HOL/Extraction.thy	Sat Jul 18 21:44:18 2015 +0200
    28.2 +++ b/src/HOL/Extraction.thy	Sat Jul 18 22:58:50 2015 +0200
    28.3 @@ -2,7 +2,7 @@
    28.4      Author:     Stefan Berghofer, TU Muenchen
    28.5  *)
    28.6  
    28.7 -section {* Program extraction for HOL *}
    28.8 +section \<open>Program extraction for HOL\<close>
    28.9  
   28.10  theory Extraction
   28.11  imports Option
   28.12 @@ -10,9 +10,9 @@
   28.13  
   28.14  ML_file "Tools/rewrite_hol_proof.ML"
   28.15  
   28.16 -subsection {* Setup *}
   28.17 +subsection \<open>Setup\<close>
   28.18  
   28.19 -setup {*
   28.20 +setup \<open>
   28.21    Extraction.add_types
   28.22        [("bool", ([], NONE))] #>
   28.23    Extraction.set_preprocessor (fn thy =>
   28.24 @@ -22,7 +22,7 @@
   28.25          (RewriteHOLProof.rews,
   28.26           ProofRewriteRules.rprocs true @ [ProofRewriteRules.expand_of_class thy]) o
   28.27        ProofRewriteRules.elim_vars (curry Const @{const_name default}))
   28.28 -*}
   28.29 +\<close>
   28.30  
   28.31  lemmas [extraction_expand] =
   28.32    meta_spec atomize_eq atomize_all atomize_imp atomize_conj
   28.33 @@ -40,7 +40,7 @@
   28.34  
   28.35  datatype (plugins only: code extraction) sumbool = Left | Right
   28.36  
   28.37 -subsection {* Type of extracted program *}
   28.38 +subsection \<open>Type of extracted program\<close>
   28.39  
   28.40  extract_type
   28.41    "typeof (Trueprop P) \<equiv> typeof P"
   28.42 @@ -90,7 +90,7 @@
   28.43  
   28.44    "typeof (x \<in> P) \<equiv> typeof P"
   28.45  
   28.46 -subsection {* Realizability *}
   28.47 +subsection \<open>Realizability\<close>
   28.48  
   28.49  realizability
   28.50    "(realizes t (Trueprop P)) \<equiv> (Trueprop (realizes t P))"
   28.51 @@ -150,7 +150,7 @@
   28.52  
   28.53    "(realizes t (P = Q)) \<equiv> (realizes t ((P \<longrightarrow> Q) \<and> (Q \<longrightarrow> P)))"
   28.54  
   28.55 -subsection {* Computational content of basic inference rules *}
   28.56 +subsection \<open>Computational content of basic inference rules\<close>
   28.57  
   28.58  theorem disjE_realizer:
   28.59    assumes r: "case x of Inl p \<Rightarrow> P p | Inr q \<Rightarrow> Q q"
    29.1 --- a/src/HOL/Fields.thy	Sat Jul 18 21:44:18 2015 +0200
    29.2 +++ b/src/HOL/Fields.thy	Sat Jul 18 22:58:50 2015 +0200
    29.3 @@ -7,17 +7,17 @@
    29.4      Author:     Jeremy Avigad
    29.5  *)
    29.6  
    29.7 -section {* Fields *}
    29.8 +section \<open>Fields\<close>
    29.9  
   29.10  theory Fields
   29.11  imports Rings
   29.12  begin
   29.13  
   29.14 -subsection {* Division rings *}
   29.15 +subsection \<open>Division rings\<close>
   29.16  
   29.17 -text {*
   29.18 +text \<open>
   29.19    A division ring is like a field, but without the commutativity requirement.
   29.20 -*}
   29.21 +\<close>
   29.22  
   29.23  class inverse = divide +
   29.24    fixes inverse :: "'a \<Rightarrow> 'a"
   29.25 @@ -29,7 +29,7 @@
   29.26  
   29.27  end
   29.28  
   29.29 -text{* Lemmas @{text divide_simps} move division to the outside and eliminates them on (in)equalities. *}
   29.30 +text\<open>Lemmas @{text divide_simps} move division to the outside and eliminates them on (in)equalities.\<close>
   29.31  
   29.32  named_theorems divide_simps "rewrite rules to eliminate divisions"
   29.33  
   29.34 @@ -94,9 +94,9 @@
   29.35    assumes "inverse a = inverse b" and "a \<noteq> 0" and "b \<noteq> 0"
   29.36    shows "a = b"
   29.37  proof -
   29.38 -  from `inverse a = inverse b`
   29.39 +  from \<open>inverse a = inverse b\<close>
   29.40    have "inverse (inverse a) = inverse (inverse b)" by (rule arg_cong)
   29.41 -  with `a \<noteq> 0` and `b \<noteq> 0` show "a = b"
   29.42 +  with \<open>a \<noteq> 0\<close> and \<open>b \<noteq> 0\<close> show "a = b"
   29.43      by (simp add: nonzero_inverse_inverse_eq)
   29.44  qed
   29.45  
   29.46 @@ -272,7 +272,7 @@
   29.47  
   29.48  end
   29.49  
   29.50 -subsection {* Fields *}
   29.51 +subsection \<open>Fields\<close>
   29.52  
   29.53  class field = comm_ring_1 + inverse +
   29.54    assumes field_inverse: "a \<noteq> 0 \<Longrightarrow> inverse a * a = 1"
   29.55 @@ -306,7 +306,7 @@
   29.56      by (simp add: divide_inverse)
   29.57  qed
   29.58  
   29.59 -text{*There is no slick version using division by zero.*}
   29.60 +text\<open>There is no slick version using division by zero.\<close>
   29.61  lemma inverse_add:
   29.62    "a \<noteq> 0 \<Longrightarrow> b \<noteq> 0 \<Longrightarrow> inverse a + inverse b = (a + b) * inverse a * inverse b"
   29.63    by (simp add: division_ring_inverse_add ac_simps)
   29.64 @@ -345,7 +345,7 @@
   29.65      by (simp only: mult.commute)
   29.66  qed
   29.67  
   29.68 -text{*Special Cancellation Simprules for Division*}
   29.69 +text\<open>Special Cancellation Simprules for Division\<close>
   29.70  
   29.71  lemma nonzero_divide_mult_cancel_right [simp]:
   29.72    "b \<noteq> 0 \<Longrightarrow> b / (a * b) = 1 / a"
   29.73 @@ -374,8 +374,8 @@
   29.74  lemma divide_minus1 [simp]: "x / - 1 = - x"
   29.75    using nonzero_minus_divide_right [of "1" x] by simp
   29.76  
   29.77 -text{*This version builds in division by zero while also re-orienting
   29.78 -      the right-hand side.*}
   29.79 +text\<open>This version builds in division by zero while also re-orienting
   29.80 +      the right-hand side.\<close>
   29.81  lemma inverse_mult_distrib [simp]:
   29.82    "inverse (a * b) = inverse a * inverse b"
   29.83  proof cases
   29.84 @@ -391,11 +391,11 @@
   29.85    by (simp add: divide_inverse mult.commute)
   29.86  
   29.87  
   29.88 -text {* Calculations with fractions *}
   29.89 +text \<open>Calculations with fractions\<close>
   29.90  
   29.91 -text{* There is a whole bunch of simp-rules just for class @{text
   29.92 +text\<open>There is a whole bunch of simp-rules just for class @{text
   29.93  field} but none for class @{text field} and @{text nonzero_divides}
   29.94 -because the latter are covered by a simproc. *}
   29.95 +because the latter are covered by a simproc.\<close>
   29.96  
   29.97  lemma mult_divide_mult_cancel_left:
   29.98    "c \<noteq> 0 \<Longrightarrow> (c * a) / (c * b) = a / b"
   29.99 @@ -421,14 +421,14 @@
  29.100    "(x / y) / (z / w) = (x * w) / (y * z)"
  29.101    by simp
  29.102  
  29.103 -text {*Special Cancellation Simprules for Division*}
  29.104 +text \<open>Special Cancellation Simprules for Division\<close>
  29.105  
  29.106  lemma mult_divide_mult_cancel_left_if [simp]:
  29.107    shows "(c * a) / (c * b) = (if c = 0 then 0 else a / b)"
  29.108    by simp
  29.109  
  29.110  
  29.111 -text {* Division and Unary Minus *}
  29.112 +text \<open>Division and Unary Minus\<close>
  29.113  
  29.114  lemma minus_divide_right:
  29.115    "- (a / b) = a / - b"
  29.116 @@ -489,7 +489,7 @@
  29.117  end
  29.118  
  29.119  
  29.120 -subsection {* Ordered fields *}
  29.121 +subsection \<open>Ordered fields\<close>
  29.122  
  29.123  class linordered_field = field + linordered_idom
  29.124  begin
  29.125 @@ -579,7 +579,7 @@
  29.126  apply (force dest!: inverse_le_imp_le nonzero_inverse_eq_imp_eq)
  29.127  done
  29.128  
  29.129 -text{*Both premises are essential. Consider -1 and 1.*}
  29.130 +text\<open>Both premises are essential. Consider -1 and 1.\<close>
  29.131  lemma inverse_less_iff_less [simp]:
  29.132    "0 < a \<Longrightarrow> 0 < b \<Longrightarrow> inverse a < inverse b \<longleftrightarrow> b < a"
  29.133    by (blast intro: less_imp_inverse_less dest: inverse_less_imp_less)
  29.134 @@ -593,8 +593,8 @@
  29.135    by (blast intro: le_imp_inverse_le dest: inverse_le_imp_le)
  29.136  
  29.137  
  29.138 -text{*These results refer to both operands being negative.  The opposite-sign
  29.139 -case is trivial, since inverse preserves signs.*}
  29.140 +text\<open>These results refer to both operands being negative.  The opposite-sign
  29.141 +case is trivial, since inverse preserves signs.\<close>
  29.142  lemma inverse_le_imp_le_neg:
  29.143    "inverse a \<le> inverse b \<Longrightarrow> b < 0 \<Longrightarrow> b \<le> a"
  29.144  apply (rule classical)
  29.145 @@ -733,8 +733,8 @@
  29.146    finally show ?thesis .
  29.147  qed
  29.148  
  29.149 -text{* The following @{text field_simps} rules are necessary, as minus is always moved atop of
  29.150 -division but we want to get rid of division. *}
  29.151 +text\<open>The following @{text field_simps} rules are necessary, as minus is always moved atop of
  29.152 +division but we want to get rid of division.\<close>
  29.153  
  29.154  lemma pos_le_minus_divide_eq [field_simps]: "0 < c \<Longrightarrow> a \<le> - (b / c) \<longleftrightarrow> a * c \<le> - b"
  29.155    unfolding minus_divide_left by (rule pos_le_divide_eq)
  29.156 @@ -768,10 +768,10 @@
  29.157    "y \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> x / y \<le> w / z \<longleftrightarrow> (x * z - w * y) / (y * z) \<le> 0"
  29.158    by (subst le_iff_diff_le_0) (simp add: diff_frac_eq )
  29.159  
  29.160 -text{* Lemmas @{text sign_simps} is a first attempt to automate proofs
  29.161 +text\<open>Lemmas @{text sign_simps} is a first attempt to automate proofs
  29.162  of positivity/negativity needed for @{text field_simps}. Have not added @{text
  29.163  sign_simps} to @{text field_simps} because the former can lead to case
  29.164 -explosions. *}
  29.165 +explosions.\<close>
  29.166  
  29.167  lemmas sign_simps = algebra_simps zero_less_mult_iff mult_less_0_iff
  29.168  
  29.169 @@ -835,8 +835,8 @@
  29.170  apply (simp add: less_imp_not_eq nonzero_minus_divide_right [symmetric])
  29.171  done
  29.172  
  29.173 -text{*The last premise ensures that @{term a} and @{term b}
  29.174 -      have the same sign*}
  29.175 +text\<open>The last premise ensures that @{term a} and @{term b}
  29.176 +      have the same sign\<close>
  29.177  lemma divide_strict_left_mono:
  29.178    "[|b < a; 0 < c; 0 < a*b|] ==> c / a < c / b"
  29.179    by (auto simp: field_simps zero_less_mult_iff mult_strict_right_mono)
  29.180 @@ -984,7 +984,7 @@
  29.181      and minus_divide_less_eq: "- (b / c) < a \<longleftrightarrow> (if 0 < c then - b < a * c else if c < 0 then a * c < - b else 0 < a)"
  29.182    by (auto simp: field_simps not_less dest: antisym)
  29.183  
  29.184 -text {*Division and Signs*}
  29.185 +text \<open>Division and Signs\<close>
  29.186  
  29.187  lemma
  29.188    shows zero_less_divide_iff: "0 < a / b \<longleftrightarrow> 0 < a \<and> 0 < b \<or> a < 0 \<and> b < 0"
  29.189 @@ -993,9 +993,9 @@
  29.190      and divide_le_0_iff: "a / b \<le> 0 \<longleftrightarrow> 0 \<le> a \<and> b \<le> 0 \<or> a \<le> 0 \<and> 0 \<le> b"
  29.191    by (auto simp add: divide_simps)
  29.192  
  29.193 -text {* Division and the Number One *}
  29.194 +text \<open>Division and the Number One\<close>
  29.195  
  29.196 -text{*Simplify expressions equated with 1*}
  29.197 +text\<open>Simplify expressions equated with 1\<close>
  29.198  
  29.199  lemma zero_eq_1_divide_iff [simp]: "0 = 1 / a \<longleftrightarrow> a = 0"
  29.200    by (cases "a = 0") (auto simp: field_simps)
  29.201 @@ -1003,7 +1003,7 @@
  29.202  lemma one_divide_eq_0_iff [simp]: "1 / a = 0 \<longleftrightarrow> a = 0"
  29.203    using zero_eq_1_divide_iff[of a] by simp
  29.204  
  29.205 -text{*Simplify expressions such as @{text "0 < 1/x"} to @{text "0 < x"}*}
  29.206 +text\<open>Simplify expressions such as @{text "0 < 1/x"} to @{text "0 < x"}\<close>
  29.207  
  29.208  lemma zero_le_divide_1_iff [simp]:
  29.209    "0 \<le> 1 / a \<longleftrightarrow> 0 \<le> a"
  29.210 @@ -1050,7 +1050,7 @@
  29.211  lemma divide_less_cancel: "a / c < b / c \<longleftrightarrow> (0 < c \<longrightarrow> a < b) \<and> (c < 0 \<longrightarrow> b < a) \<and> c \<noteq> 0"
  29.212    by (auto simp add: divide_inverse mult_less_cancel_right)
  29.213  
  29.214 -text{*Simplify quotients that are compared with the value 1.*}
  29.215 +text\<open>Simplify quotients that are compared with the value 1.\<close>
  29.216  
  29.217  lemma le_divide_eq_1:
  29.218    "(1 \<le> b / a) = ((0 < a & a \<le> b) | (a < 0 & b \<le> a))"
  29.219 @@ -1084,7 +1084,7 @@
  29.220    "x \<le> 0 \<Longrightarrow> 0 \<le> y \<Longrightarrow> x / y \<le> 0"
  29.221    by (auto simp add: divide_simps)
  29.222  
  29.223 -text {*Conditional Simplification Rules: No Case Splits*}
  29.224 +text \<open>Conditional Simplification Rules: No Case Splits\<close>
  29.225  
  29.226  lemma le_divide_eq_1_pos [simp]:
  29.227    "0 < a \<Longrightarrow> (1 \<le> b/a) = (a \<le> b)"
  29.228 @@ -1158,11 +1158,11 @@
  29.229    assume "0 < x"
  29.230    thus ?thesis
  29.231      using dense_le_bounded[of 0 1 "y/x"] *
  29.232 -    unfolding le_divide_eq if_P[OF `0 < x`] by simp
  29.233 +    unfolding le_divide_eq if_P[OF \<open>0 < x\<close>] by simp
  29.234  next
  29.235    assume "\<not>0 < x" hence "x \<le> 0" by simp
  29.236    obtain s::'a where s: "0 < s" "s < 1" using dense[of 0 "1\<Colon>'a"] by auto
  29.237 -  hence "x \<le> s * x" using mult_le_cancel_right[of 1 x s] `x \<le> 0` by auto
  29.238 +  hence "x \<le> s * x" using mult_le_cancel_right[of 1 x s] \<open>x \<le> 0\<close> by auto
  29.239    also note *[OF s]
  29.240    finally show ?thesis .
  29.241  qed
    30.1 --- a/src/HOL/Filter.thy	Sat Jul 18 21:44:18 2015 +0200
    30.2 +++ b/src/HOL/Filter.thy	Sat Jul 18 22:58:50 2015 +0200
    30.3 @@ -3,17 +3,17 @@
    30.4      Author:     Johannes Hölzl
    30.5  *)
    30.6  
    30.7 -section {* Filters on predicates *}
    30.8 +section \<open>Filters on predicates\<close>
    30.9  
   30.10  theory Filter
   30.11  imports Set_Interval Lifting_Set
   30.12  begin
   30.13  
   30.14 -subsection {* Filters *}
   30.15 +subsection \<open>Filters\<close>
   30.16  
   30.17 -text {*
   30.18 +text \<open>
   30.19    This definition also allows non-proper filters.
   30.20 -*}
   30.21 +\<close>
   30.22  
   30.23  locale is_filter =
   30.24    fixes F :: "('a \<Rightarrow> bool) \<Rightarrow> bool"
   30.25 @@ -34,7 +34,7 @@
   30.26    using assms by (simp add: Abs_filter_inverse)
   30.27  
   30.28  
   30.29 -subsubsection {* Eventually *}
   30.30 +subsubsection \<open>Eventually\<close>
   30.31  
   30.32  definition eventually :: "('a \<Rightarrow> bool) \<Rightarrow> 'a filter \<Rightarrow> bool"
   30.33    where "eventually P F \<longleftrightarrow> Rep_filter F P"
   30.34 @@ -237,7 +237,7 @@
   30.35    frequently_all
   30.36    frequently_imp_iff
   30.37  
   30.38 -ML {*
   30.39 +ML \<open>
   30.40    fun eventually_elim_tac ctxt facts = SUBGOAL_CASES (fn (goal, i) =>
   30.41      let
   30.42        val mp_thms = facts RL @{thms eventually_rev_mp}
   30.43 @@ -252,16 +252,16 @@
   30.44      in
   30.45        CASES cases (resolve_tac ctxt [raw_elim_thm] i)
   30.46      end)
   30.47 -*}
   30.48 +\<close>
   30.49  
   30.50 -method_setup eventually_elim = {*
   30.51 +method_setup eventually_elim = \<open>
   30.52    Scan.succeed (fn ctxt => METHOD_CASES (HEADGOAL o eventually_elim_tac ctxt))
   30.53 -*} "elimination of eventually quantifiers"
   30.54 +\<close> "elimination of eventually quantifiers"
   30.55  
   30.56 -subsubsection {* Finer-than relation *}
   30.57 +subsubsection \<open>Finer-than relation\<close>
   30.58  
   30.59 -text {* @{term "F \<le> F'"} means that filter @{term F} is finer than
   30.60 -filter @{term F'}. *}
   30.61 +text \<open>@{term "F \<le> F'"} means that filter @{term F} is finer than
   30.62 +filter @{term F'}.\<close>
   30.63  
   30.64  instantiation filter :: (type) complete_lattice
   30.65  begin
   30.66 @@ -457,12 +457,12 @@
   30.67    then have "\<exists>b\<in>B. \<forall>x\<in>X. b \<le> x"
   30.68    proof induct
   30.69      case empty then show ?case
   30.70 -      using `B \<noteq> {}` by auto
   30.71 +      using \<open>B \<noteq> {}\<close> by auto
   30.72    next
   30.73      case (insert x X)
   30.74      then obtain b where "b \<in> B" "\<And>x. x \<in> X \<Longrightarrow> b \<le> x"
   30.75        by auto
   30.76 -    with `insert x X \<subseteq> B` base[of b x] show ?case
   30.77 +    with \<open>insert x X \<subseteq> B\<close> base[of b x] show ?case
   30.78        by (auto intro: order_trans)
   30.79    qed
   30.80    then obtain b where "b \<in> B" "b \<le> Inf X"
   30.81 @@ -477,7 +477,7 @@
   30.82    unfolding INF_def by (subst eventually_Inf_base) auto
   30.83  
   30.84  
   30.85 -subsubsection {* Map function for filters *}
   30.86 +subsubsection \<open>Map function for filters\<close>
   30.87  
   30.88  definition filtermap :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a filter \<Rightarrow> 'b filter"
   30.89    where "filtermap f F = Abs_filter (\<lambda>P. eventually (\<lambda>x. P (f x)) F)"
   30.90 @@ -526,7 +526,7 @@
   30.91      unfolding le_filter_def eventually_filtermap
   30.92      by (subst (1 2) eventually_INF) auto
   30.93  qed
   30.94 -subsubsection {* Standard filters *}
   30.95 +subsubsection \<open>Standard filters\<close>
   30.96  
   30.97  definition principal :: "'a set \<Rightarrow> 'a filter" where
   30.98    "principal S = Abs_filter (\<lambda>P. \<forall>x\<in>S. P x)"
   30.99 @@ -576,7 +576,7 @@
  30.100  lemma filtermap_principal[simp]: "filtermap f (principal A) = principal (f ` A)"
  30.101    unfolding filter_eq_iff eventually_filtermap eventually_principal by simp
  30.102  
  30.103 -subsubsection {* Order filters *}
  30.104 +subsubsection \<open>Order filters\<close>
  30.105  
  30.106  definition at_top :: "('a::order) filter"
  30.107    where "at_top = (INF k. principal {k ..})"
  30.108 @@ -648,7 +648,7 @@
  30.109    unfolding trivial_limit_def
  30.110    by (metis eventually_at_top_linorder order_refl)
  30.111  
  30.112 -subsection {* Sequentially *}
  30.113 +subsection \<open>Sequentially\<close>
  30.114  
  30.115  abbreviation sequentially :: "nat filter"
  30.116    where "sequentially \<equiv> at_top"
  30.117 @@ -734,7 +734,7 @@
  30.118      by (blast intro: finite_subset)
  30.119  qed
  30.120  
  30.121 -subsection {* Limits *}
  30.122 +subsection \<open>Limits\<close>
  30.123  
  30.124  definition filterlim :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b filter \<Rightarrow> 'a filter \<Rightarrow> bool" where
  30.125    "filterlim f F2 F1 \<longleftrightarrow> filtermap f F1 \<le> F2"
  30.126 @@ -828,7 +828,7 @@
  30.127    fix i j assume "i \<in> I" "j \<in> I"
  30.128    with chain[OF this] show "\<exists>x\<in>I. principal (F x) \<le> inf (principal (F i)) (principal (F j))"
  30.129      by auto
  30.130 -qed (auto simp: eventually_principal `I \<noteq> {}`)
  30.131 +qed (auto simp: eventually_principal \<open>I \<noteq> {}\<close>)
  30.132  
  30.133  lemma filterlim_filtermap: "filterlim f F1 (filtermap g F2) = filterlim (\<lambda>x. f (g x)) F1 F2"
  30.134    unfolding filterlim_def filtermap_filtermap ..
  30.135 @@ -850,7 +850,7 @@
  30.136      LIM x F. if P x then f x else g x :> G"
  30.137    unfolding filterlim_iff eventually_inf_principal by (auto simp: eventually_conj_iff)
  30.138  
  30.139 -subsection {* Limits to @{const at_top} and @{const at_bot} *}
  30.140 +subsection \<open>Limits to @{const at_top} and @{const at_bot}\<close>
  30.141  
  30.142  lemma filterlim_at_top:
  30.143    fixes f :: "'a \<Rightarrow> ('b::linorder)"
  30.144 @@ -890,7 +890,7 @@
  30.145      have "eventually (\<lambda>x. g z \<le> x) at_top"
  30.146        by (rule eventually_ge_at_top)
  30.147      with Q show "eventually (\<lambda>x. z \<le> f x) at_top"
  30.148 -      by eventually_elim (metis mono bij `P z`)
  30.149 +      by eventually_elim (metis mono bij \<open>P z\<close>)
  30.150    qed
  30.151  qed
  30.152  
  30.153 @@ -937,7 +937,7 @@
  30.154    by (metis filterlim_at_bot filterlim_at_bot_le lt_ex order_le_less_trans)
  30.155  
  30.156  
  30.157 -subsection {* Setup @{typ "'a filter"} for lifting and transfer *}
  30.158 +subsection \<open>Setup @{typ "'a filter"} for lifting and transfer\<close>
  30.159  
  30.160  context begin interpretation lifting_syntax .
  30.161  
  30.162 @@ -1011,7 +1011,7 @@
  30.163      fix P' Q'
  30.164      assume "G P'" "G Q'"
  30.165      moreover
  30.166 -    from bi_total_fun[OF `bi_unique A` bi_total_eq, unfolded bi_total_def]
  30.167 +    from bi_total_fun[OF \<open>bi_unique A\<close> bi_total_eq, unfolded bi_total_def]
  30.168      obtain P Q where [transfer_rule]: "(A ===> op =) P P'" "(A ===> op =) Q Q'" by blast
  30.169      have "F P = G P'" "F Q = G Q'" by transfer_prover+
  30.170      ultimately have "F (\<lambda>x. P x \<and> Q x)" by(simp add: conj)
  30.171 @@ -1021,7 +1021,7 @@
  30.172      fix P' Q'
  30.173      assume "\<forall>x. P' x \<longrightarrow> Q' x" "G P'"
  30.174      moreover
  30.175 -    from bi_total_fun[OF `bi_unique A` bi_total_eq, unfolded bi_total_def]
  30.176 +    from bi_total_fun[OF \<open>bi_unique A\<close> bi_total_eq, unfolded bi_total_def]
  30.177      obtain P Q where [transfer_rule]: "(A ===> op =) P P'" "(A ===> op =) Q Q'" by blast
  30.178      have "F P = G P'" by transfer_prover
  30.179      moreover have "(\<forall>x. P x \<longrightarrow> Q x) \<longleftrightarrow> (\<forall>x. P' x \<longrightarrow> Q' x)" by transfer_prover
  30.180 @@ -1046,7 +1046,7 @@
  30.181    shows "left_total (rel_filter A)"
  30.182  proof(rule left_totalI)
  30.183    fix F :: "'a filter"
  30.184 -  from bi_total_fun[OF bi_unique_fun[OF `bi_total A` bi_unique_eq] bi_total_eq]
  30.185 +  from bi_total_fun[OF bi_unique_fun[OF \<open>bi_total A\<close> bi_unique_eq] bi_total_eq]
  30.186    obtain G where [transfer_rule]: "((A ===> op =) ===> op =) (\<lambda>P. eventually P F) G" 
  30.187      unfolding  bi_total_def by blast
  30.188    moreover have "is_filter (\<lambda>P. eventually P F) \<longleftrightarrow> is_filter G" by transfer_prover
    31.1 --- a/src/HOL/Finite_Set.thy	Sat Jul 18 21:44:18 2015 +0200
    31.2 +++ b/src/HOL/Finite_Set.thy	Sat Jul 18 22:58:50 2015 +0200
    31.3 @@ -3,30 +3,30 @@
    31.4                  with contributions by Jeremy Avigad and Andrei Popescu
    31.5  *)
    31.6  
    31.7 -section {* Finite sets *}
    31.8 +section \<open>Finite sets\<close>
    31.9  
   31.10  theory Finite_Set
   31.11  imports Product_Type Sum_Type Nat
   31.12  begin
   31.13  
   31.14 -subsection {* Predicate for finite sets *}
   31.15 +subsection \<open>Predicate for finite sets\<close>
   31.16  
   31.17  inductive finite :: "'a set \<Rightarrow> bool"
   31.18    where
   31.19      emptyI [simp, intro!]: "finite {}"
   31.20    | insertI [simp, intro!]: "finite A \<Longrightarrow> finite (insert a A)"
   31.21  
   31.22 -simproc_setup finite_Collect ("finite (Collect P)") = {* K Set_Comprehension_Pointfree.simproc *}
   31.23 +simproc_setup finite_Collect ("finite (Collect P)") = \<open>K Set_Comprehension_Pointfree.simproc\<close>
   31.24  
   31.25  declare [[simproc del: finite_Collect]]
   31.26  
   31.27  lemma finite_induct [case_names empty insert, induct set: finite]:
   31.28 -  -- {* Discharging @{text "x \<notin> F"} entails extra work. *}
   31.29 +  -- \<open>Discharging @{text "x \<notin> F"} entails extra work.\<close>
   31.30    assumes "finite F"
   31.31    assumes "P {}"
   31.32      and insert: "\<And>x F. finite F \<Longrightarrow> x \<notin> F \<Longrightarrow> P F \<Longrightarrow> P (insert x F)"
   31.33    shows "P F"
   31.34 -using `finite F`
   31.35 +using \<open>finite F\<close>
   31.36  proof induct
   31.37    show "P {}" by fact
   31.38    fix x F assume F: "finite F" and P: "P F"
   31.39 @@ -53,7 +53,7 @@
   31.40  qed
   31.41  
   31.42  
   31.43 -subsubsection {* Choice principles *}
   31.44 +subsubsection \<open>Choice principles\<close>
   31.45  
   31.46  lemma ex_new_if_finite: -- "does not depend on def of finite at all"
   31.47    assumes "\<not> finite (UNIV :: 'a set)" and "finite A"
   31.48 @@ -63,7 +63,7 @@
   31.49    then show ?thesis by blast
   31.50  qed
   31.51  
   31.52 -text {* A finite choice principle. Does not need the SOME choice operator. *}
   31.53 +text \<open>A finite choice principle. Does not need the SOME choice operator.\<close>
   31.54  
   31.55  lemma finite_set_choice:
   31.56    "finite A \<Longrightarrow> \<forall>x\<in>A. \<exists>y. P x y \<Longrightarrow> \<exists>f. \<forall>x\<in>A. P x (f x)"
   31.57 @@ -79,7 +79,7 @@
   31.58  qed
   31.59  
   31.60  
   31.61 -subsubsection {* Finite sets are the images of initial segments of natural numbers *}
   31.62 +subsubsection \<open>Finite sets are the images of initial segments of natural numbers\<close>
   31.63  
   31.64  lemma finite_imp_nat_seg_image_inj_on:
   31.65    assumes "finite A" 
   31.66 @@ -130,7 +130,7 @@
   31.67    assumes "finite A"
   31.68    shows "\<exists>f n::nat. f ` A = {i. i < n} \<and> inj_on f A"
   31.69  proof -
   31.70 -  from finite_imp_nat_seg_image_inj_on[OF `finite A`]
   31.71 +  from finite_imp_nat_seg_image_inj_on[OF \<open>finite A\<close>]
   31.72    obtain f and n::nat where bij: "bij_betw f {i. i<n} A"
   31.73      by (auto simp:bij_betw_def)
   31.74    let ?f = "the_inv_into {i. i<n} f"
   31.75 @@ -148,7 +148,7 @@
   31.76    by (simp add: le_eq_less_or_eq Collect_disj_eq)
   31.77  
   31.78  
   31.79 -subsubsection {* Finiteness and common set operations *}
   31.80 +subsubsection \<open>Finiteness and common set operations\<close>
   31.81  
   31.82  lemma rev_finite_subset:
   31.83    "finite B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> finite A"
   31.84 @@ -215,7 +215,7 @@
   31.85    shows "finite (A - B) \<longleftrightarrow> finite A"
   31.86  proof -
   31.87    have "finite A \<longleftrightarrow> finite((A - B) \<union> (A \<inter> B))" by (simp add: Un_Diff_Int)
   31.88 -  also have "\<dots> \<longleftrightarrow> finite (A - B)" using `finite B` by simp
   31.89 +  also have "\<dots> \<longleftrightarrow> finite (A - B)" using \<open>finite B\<close> by simp
   31.90    finally show ?thesis ..
   31.91  qed
   31.92  
   31.93 @@ -277,10 +277,10 @@
   31.94    case (insert x B)
   31.95    then have B_A: "insert x B = f ` A" by simp
   31.96    then obtain y where "x = f y" and "y \<in> A" by blast
   31.97 -  from B_A `x \<notin> B` have "B = f ` A - {x}" by blast
   31.98 -  with B_A `x \<notin> B` `x = f y` `inj_on f A` `y \<in> A` have "B = f ` (A - {y})" 
   31.99 +  from B_A \<open>x \<notin> B\<close> have "B = f ` A - {x}" by blast
  31.100 +  with B_A \<open>x \<notin> B\<close> \<open>x = f y\<close> \<open>inj_on f A\<close> \<open>y \<in> A\<close> have "B = f ` (A - {y})" 
  31.101      by (simp add: inj_on_image_set_diff Set.Diff_subset)
  31.102 -  moreover from `inj_on f A` have "inj_on f (A - {y})" by (rule inj_on_diff)
  31.103 +  moreover from \<open>inj_on f A\<close> have "inj_on f (A - {y})" by (rule inj_on_diff)
  31.104    ultimately have "finite (A - {y})" by (rule insert.hyps)
  31.105    then show "finite A" by simp
  31.106  qed
  31.107 @@ -397,7 +397,7 @@
  31.108    from assms obtain n f where "A \<times> B = f ` {i::nat. i < n}"
  31.109      by (auto simp add: finite_conv_nat_seg_image)
  31.110    then have "fst ` (A \<times> B) = fst ` f ` {i::nat. i < n}" by simp
  31.111 -  with `B \<noteq> {}` have "A = (fst \<circ> f) ` {i::nat. i < n}"
  31.112 +  with \<open>B \<noteq> {}\<close> have "A = (fst \<circ> f) ` {i::nat. i < n}"
  31.113      by (simp add: image_comp)
  31.114    then have "\<exists>n f. A = f ` {i::nat. i < n}" by blast
  31.115    then show ?thesis
  31.116 @@ -411,7 +411,7 @@
  31.117    from assms obtain n f where "A \<times> B = f ` {i::nat. i < n}"
  31.118      by (auto simp add: finite_conv_nat_seg_image)
  31.119    then have "snd ` (A \<times> B) = snd ` f ` {i::nat. i < n}" by simp
  31.120 -  with `A \<noteq> {}` have "B = (snd \<circ> f) ` {i::nat. i < n}"
  31.121 +  with \<open>A \<noteq> {}\<close> have "B = (snd \<circ> f) ` {i::nat. i < n}"
  31.122      by (simp add: image_comp)
  31.123    then have "\<exists>n f. B = f ` {i::nat. i < n}" by blast
  31.124    then show ?thesis
  31.125 @@ -468,7 +468,7 @@
  31.126  qed
  31.127  
  31.128  
  31.129 -subsubsection {* Further induction rules on finite sets *}
  31.130 +subsubsection \<open>Further induction rules on finite sets\<close>
  31.131  
  31.132  lemma finite_ne_induct [case_names singleton insert, consumes 2]:
  31.133    assumes "finite F" and "F \<noteq> {}"
  31.134 @@ -487,7 +487,7 @@
  31.135    assumes empty: "P {}"
  31.136      and insert: "\<And>a F. finite F \<Longrightarrow> a \<in> A \<Longrightarrow> a \<notin> F \<Longrightarrow> P F \<Longrightarrow> P (insert a F)"
  31.137    shows "P F"
  31.138 -using `finite F` `F \<subseteq> A`
  31.139 +using \<open>finite F\<close> \<open>F \<subseteq> A\<close>
  31.140  proof induct
  31.141    show "P {}" by fact
  31.142  next
  31.143 @@ -514,16 +514,16 @@
  31.144    proof -
  31.145      fix B :: "'a set"
  31.146      assume "B \<subseteq> A"
  31.147 -    with `finite A` have "finite B" by (rule rev_finite_subset)
  31.148 -    from this `B \<subseteq> A` show "P (A - B)"
  31.149 +    with \<open>finite A\<close> have "finite B" by (rule rev_finite_subset)
  31.150 +    from this \<open>B \<subseteq> A\<close> show "P (A - B)"
  31.151      proof induct
  31.152        case empty
  31.153 -      from `P A` show ?case by simp
  31.154 +      from \<open>P A\<close> show ?case by simp
  31.155      next
  31.156        case (insert b B)
  31.157        have "P (A - B - {b})"
  31.158        proof (rule remove)
  31.159 -        from `finite A` show "finite (A - B)" by induct auto
  31.160 +        from \<open>finite A\<close> show "finite (A - B)" by induct auto
  31.161          from insert show "b \<in> A - B" by simp
  31.162          from insert show "P (A - B)" by simp
  31.163        qed
  31.164 @@ -546,19 +546,19 @@
  31.165    case (insert a A)
  31.166    then have "A = {a'. (f(a := c)) a' \<noteq> c}" and "f a \<noteq> c"
  31.167      by auto
  31.168 -  with `finite A` have "finite {a'. (f(a := c)) a' \<noteq> c}"
  31.169 +  with \<open>finite A\<close> have "finite {a'. (f(a := c)) a' \<noteq> c}"
  31.170      by simp
  31.171    have "(f(a := c)) a = c"
  31.172      by simp
  31.173 -  from insert `A = {a'. (f(a := c)) a' \<noteq> c}` have "P (f(a := c))"
  31.174 +  from insert \<open>A = {a'. (f(a := c)) a' \<noteq> c}\<close> have "P (f(a := c))"
  31.175      by simp
  31.176 -  with `finite {a'. (f(a := c)) a' \<noteq> c}` `(f(a := c)) a = c` `f a \<noteq> c` have "P ((f(a := c))(a := f a))"
  31.177 +  with \<open>finite {a'. (f(a := c)) a' \<noteq> c}\<close> \<open>(f(a := c)) a = c\<close> \<open>f a \<noteq> c\<close> have "P ((f(a := c))(a := f a))"
  31.178      by (rule update)
  31.179    then show ?case by simp
  31.180  qed
  31.181  
  31.182  
  31.183 -subsection {* Class @{text finite}  *}
  31.184 +subsection \<open>Class @{text finite}\<close>
  31.185  
  31.186  class finite =
  31.187    assumes finite_UNIV: "finite (UNIV \<Colon> 'a set)"
  31.188 @@ -605,12 +605,12 @@
  31.189    by default (simp only: UNIV_Plus_UNIV [symmetric] finite_Plus finite)
  31.190  
  31.191  
  31.192 -subsection {* A basic fold functional for finite sets *}
  31.193 +subsection \<open>A basic fold functional for finite sets\<close>
  31.194  
  31.195 -text {* The intended behaviour is
  31.196 +text \<open>The intended behaviour is
  31.197  @{text "fold f z {x\<^sub>1, ..., x\<^sub>n} = f x\<^sub>1 (\<dots> (f x\<^sub>n z)\<dots>)"}
  31.198  if @{text f} is ``left-commutative'':
  31.199 -*}
  31.200 +\<close>
  31.201  
  31.202  locale comp_fun_commute =
  31.203    fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'b"
  31.204 @@ -637,17 +637,17 @@
  31.205  definition fold :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a set \<Rightarrow> 'b" where
  31.206    "fold f z A = (if finite A then (THE y. fold_graph f z A y) else z)"
  31.207  
  31.208 -text{*A tempting alternative for the definiens is
  31.209 +text\<open>A tempting alternative for the definiens is
  31.210  @{term "if finite A then THE y. fold_graph f z A y else e"}.
  31.211  It allows the removal of finiteness assumptions from the theorems
  31.212  @{text fold_comm}, @{text fold_reindex} and @{text fold_distrib}.
  31.213 -The proofs become ugly. It is not worth the effort. (???) *}
  31.214 +The proofs become ugly. It is not worth the effort. (???)\<close>
  31.215  
  31.216  lemma finite_imp_fold_graph: "finite A \<Longrightarrow> \<exists>x. fold_graph f z A x"
  31.217  by (induct rule: finite_induct) auto
  31.218  
  31.219  
  31.220 -subsubsection{*From @{const fold_graph} to @{term fold}*}
  31.221 +subsubsection\<open>From @{const fold_graph} to @{term fold}\<close>
  31.222  
  31.223  context comp_fun_commute
  31.224  begin
  31.225 @@ -670,7 +670,7 @@
  31.226      have "f x y = f a (f x y')"
  31.227        unfolding y by (rule fun_left_comm)
  31.228      moreover have "fold_graph f z (insert x A - {a}) (f x y')"
  31.229 -      using y' and `x \<noteq> a` and `x \<notin> A`
  31.230 +      using y' and \<open>x \<noteq> a\<close> and \<open>x \<notin> A\<close>
  31.231        by (simp add: insert_Diff_if fold_graph.insertI)
  31.232      ultimately show ?case by fast
  31.233    qed
  31.234 @@ -685,11 +685,11 @@
  31.235    "fold_graph f z A x \<Longrightarrow> fold_graph f z A y \<Longrightarrow> y = x"
  31.236  proof (induct arbitrary: y set: fold_graph)
  31.237    case (insertI x A y v)
  31.238 -  from `fold_graph f z (insert x A) v` and `x \<notin> A`
  31.239 +  from \<open>fold_graph f z (insert x A) v\<close> and \<open>x \<notin> A\<close>
  31.240    obtain y' where "v = f x y'" and "fold_graph f z A y'"
  31.241      by (rule fold_graph_insertE)
  31.242 -  from `fold_graph f z A y'` have "y' = y" by (rule insertI)
  31.243 -  with `v = f x y'` show "v = f x y" by simp
  31.244 +  from \<open>fold_graph f z A y'\<close> have "y' = y" by (rule insertI)
  31.245 +  with \<open>v = f x y'\<close> show "v = f x y" by simp
  31.246  qed fast
  31.247  
  31.248  lemma fold_equality:
  31.249 @@ -707,7 +707,7 @@
  31.250    with assms show ?thesis by (simp add: fold_def)
  31.251  qed
  31.252  
  31.253 -text {* The base case for @{text fold}: *}
  31.254 +text \<open>The base case for @{text fold}:\<close>
  31.255  
  31.256  lemma (in -) fold_infinite [simp]:
  31.257    assumes "\<not> finite A"
  31.258 @@ -718,20 +718,20 @@
  31.259    "fold f z {} = z"
  31.260    by (auto simp add: fold_def)
  31.261  
  31.262 -text{* The various recursion equations for @{const fold}: *}
  31.263 +text\<open>The various recursion equations for @{const fold}:\<close>
  31.264  
  31.265  lemma fold_insert [simp]:
  31.266    assumes "finite A" and "x \<notin> A"
  31.267    shows "fold f z (insert x A) = f x (fold f z A)"
  31.268  proof (rule fold_equality)
  31.269    fix z
  31.270 -  from `finite A` have "fold_graph f z A (fold f z A)" by (rule fold_graph_fold)
  31.271 -  with `x \<notin> A` have "fold_graph f z (insert x A) (f x (fold f z A))" by (rule fold_graph.insertI)
  31.272 +  from \<open>finite A\<close> have "fold_graph f z A (fold f z A)" by (rule fold_graph_fold)
  31.273 +  with \<open>x \<notin> A\<close> have "fold_graph f z (insert x A) (f x (fold f z A))" by (rule fold_graph.insertI)
  31.274    then show "fold_graph f z (insert x A) (f x (fold f z A))" by simp
  31.275  qed
  31.276  
  31.277  declare (in -) empty_fold_graphE [rule del] fold_graph.intros [rule del]
  31.278 -  -- {* No more proofs involve these. *}
  31.279 +  -- \<open>No more proofs involve these.\<close>
  31.280  
  31.281  lemma fold_fun_left_comm:
  31.282    "finite A \<Longrightarrow> f x (fold f z A) = fold f (f x z) A"
  31.283 @@ -750,10 +750,10 @@
  31.284    assumes "finite A" and "x \<in> A"
  31.285    shows "fold f z A = f x (fold f z (A - {x}))"
  31.286  proof -
  31.287 -  have A: "A = insert x (A - {x})" using `x \<in> A` by blast
  31.288 +  have A: "A = insert x (A - {x})" using \<open>x \<in> A\<close> by blast
  31.289    then have "fold f z A = fold f z (insert x (A - {x}))" by simp
  31.290    also have "\<dots> = f x (fold f z (A - {x}))"
  31.291 -    by (rule fold_insert) (simp add: `finite A`)+
  31.292 +    by (rule fold_insert) (simp add: \<open>finite A\<close>)+
  31.293    finally show ?thesis .
  31.294  qed
  31.295  
  31.296 @@ -761,7 +761,7 @@
  31.297    assumes "finite A"
  31.298    shows "fold f z (insert x A) = f x (fold f z (A - {x}))"
  31.299  proof -
  31.300 -  from `finite A` have "finite (insert x A)" by auto
  31.301 +  from \<open>finite A\<close> have "finite (insert x A)" by auto
  31.302    moreover have "x \<in> insert x A" by auto
  31.303    ultimately have "fold f z (insert x A) = f x (fold f z (insert x A - {x}))"
  31.304      by (rule fold_rec)
  31.305 @@ -775,7 +775,7 @@
  31.306  
  31.307  end
  31.308  
  31.309 -text{* Other properties of @{const fold}: *}
  31.310 +text\<open>Other properties of @{const fold}:\<close>
  31.311  
  31.312  lemma fold_image:
  31.313    assumes "inj_on g A"
  31.314 @@ -794,12 +794,12 @@
  31.315          case emptyI then show ?case by (auto intro: fold_graph.emptyI)
  31.316        next
  31.317          case (insertI x A r B)
  31.318 -        from `inj_on g B` `x \<notin> A` `insert x A = image g B` obtain x' A' where
  31.319 +        from \<open>inj_on g B\<close> \<open>x \<notin> A\<close> \<open>insert x A = image g B\<close> obtain x' A' where
  31.320            "x' \<notin> A'" and [simp]: "B = insert x' A'" "x = g x'" "A = g ` A'"
  31.321            by (rule inj_img_insertE)
  31.322          from insertI.prems have "fold_graph (f o g) z A' r"
  31.323            by (auto intro: insertI.hyps)
  31.324 -        with `x' \<notin> A'` have "fold_graph (f \<circ> g) z (insert x' A') ((f \<circ> g) x' r)"
  31.325 +        with \<open>x' \<notin> A'\<close> have "fold_graph (f \<circ> g) z (insert x' A') ((f \<circ> g) x' r)"
  31.326            by (rule fold_graph.insertI)
  31.327          then show ?case by simp
  31.328        qed
  31.329 @@ -809,7 +809,7 @@
  31.330          case emptyI thus ?case by (auto intro: fold_graph.emptyI)
  31.331        next
  31.332          case (insertI x A r)
  31.333 -        from `x \<notin> A` insertI.prems have "g x \<notin> g ` A" by auto
  31.334 +        from \<open>x \<notin> A\<close> insertI.prems have "g x \<notin> g ` A" by auto
  31.335          moreover from insertI have "fold_graph f z (g ` A) r" by simp
  31.336          ultimately have "fold_graph f z (insert (g x) (g ` A)) (f (g x) r)"
  31.337            by (rule fold_graph.insertI)
  31.338 @@ -827,19 +827,19 @@
  31.339    shows "fold f s A = fold g t B"
  31.340  proof -
  31.341    have "fold f s A = fold g s A"  
  31.342 -  using `finite A` cong proof (induct A)
  31.343 +  using \<open>finite A\<close> cong proof (induct A)
  31.344      case empty then show ?case by simp
  31.345    next
  31.346      case (insert x A)
  31.347 -    interpret f: comp_fun_commute f by (fact `comp_fun_commute f`)
  31.348 -    interpret g: comp_fun_commute g by (fact `comp_fun_commute g`)
  31.349 +    interpret f: comp_fun_commute f by (fact \<open>comp_fun_commute f\<close>)
  31.350 +    interpret g: comp_fun_commute g by (fact \<open>comp_fun_commute g\<close>)
  31.351      from insert show ?case by simp
  31.352    qed
  31.353    with assms show ?thesis by simp
  31.354  qed
  31.355  
  31.356  
  31.357 -text {* A simplified version for idempotent functions: *}
  31.358 +text \<open>A simplified version for idempotent functions:\<close>
  31.359  
  31.360  locale comp_fun_idem = comp_fun_commute +
  31.361    assumes comp_fun_idem: "f x \<circ> f x = f x"
  31.362 @@ -868,7 +868,7 @@
  31.363  end
  31.364  
  31.365  
  31.366 -subsubsection {* Liftings to @{text comp_fun_commute} etc. *}
  31.367 +subsubsection \<open>Liftings to @{text comp_fun_commute} etc.\<close>
  31.368  
  31.369  lemma (in comp_fun_commute) comp_comp_fun_commute:
  31.370    "comp_fun_commute (f \<circ> g)"
  31.371 @@ -919,7 +919,7 @@
  31.372  qed
  31.373  
  31.374  
  31.375 -subsubsection {* Expressing set operations via @{const fold} *}
  31.376 +subsubsection \<open>Expressing set operations via @{const fold}\<close>
  31.377  
  31.378  lemma comp_fun_commute_const:
  31.379    "comp_fun_commute (\<lambda>_. f)"
  31.380 @@ -951,7 +951,7 @@
  31.381    shows "A \<union> B = fold insert B A"
  31.382  proof -
  31.383    interpret comp_fun_idem insert by (fact comp_fun_idem_insert)
  31.384 -  from `finite A` show ?thesis by (induct A arbitrary: B) simp_all
  31.385 +  from \<open>finite A\<close> show ?thesis by (induct A arbitrary: B) simp_all
  31.386  qed
  31.387  
  31.388  lemma minus_fold_remove:
  31.389 @@ -959,7 +959,7 @@
  31.390    shows "B - A = fold Set.remove B A"
  31.391  proof -
  31.392    interpret comp_fun_idem Set.remove by (fact comp_fun_idem_remove)
  31.393 -  from `finite A` have "fold Set.remove B A = B - A" by (induct A arbitrary: B) auto
  31.394 +  from \<open>finite A\<close> have "fold Set.remove B A = B - A" by (induct A arbitrary: B) auto
  31.395    then show ?thesis ..
  31.396  qed
  31.397  
  31.398 @@ -1053,7 +1053,7 @@
  31.399    shows "inf (Inf A) B = fold inf B A"
  31.400  proof -
  31.401    interpret comp_fun_idem inf by (fact comp_fun_idem_inf)
  31.402 -  from `finite A` fold_fun_left_comm show ?thesis by (induct A arbitrary: B)
  31.403 +  from \<open>finite A\<close> fold_fun_left_comm show ?thesis by (induct A arbitrary: B)
  31.404      (simp_all add: inf_commute fun_eq_iff)
  31.405  qed
  31.406  
  31.407 @@ -1062,7 +1062,7 @@
  31.408    shows "sup (Sup A) B = fold sup B A"
  31.409  proof -
  31.410    interpret comp_fun_idem sup by (fact comp_fun_idem_sup)
  31.411 -  from `finite A` fold_fun_left_comm show ?thesis by (induct A arbitrary: B)
  31.412 +  from \<open>finite A\<close> fold_fun_left_comm show ?thesis by (induct A arbitrary: B)
  31.413      (simp_all add: sup_commute fun_eq_iff)
  31.414  qed
  31.415  
  31.416 @@ -1082,7 +1082,7 @@
  31.417  proof (rule sym)
  31.418    interpret comp_fun_idem inf by (fact comp_fun_idem_inf)
  31.419    interpret comp_fun_idem "inf \<circ> f" by (fact comp_comp_fun_idem)
  31.420 -  from `finite A` show "?fold = ?inf"
  31.421 +  from \<open>finite A\<close> show "?fold = ?inf"
  31.422      by (induct A arbitrary: B)
  31.423        (simp_all add: inf_left_commute)
  31.424  qed
  31.425 @@ -1093,7 +1093,7 @@
  31.426  proof (rule sym)
  31.427    interpret comp_fun_idem sup by (fact comp_fun_idem_sup)
  31.428    interpret comp_fun_idem "sup \<circ> f" by (fact comp_comp_fun_idem)
  31.429 -  from `finite A` show "?fold = ?sup"
  31.430 +  from \<open>finite A\<close> show "?fold = ?sup"
  31.431      by (induct A arbitrary: B)
  31.432        (simp_all add: sup_left_commute)
  31.433  qed
  31.434 @@ -1111,9 +1111,9 @@
  31.435  end
  31.436  
  31.437  
  31.438 -subsection {* Locales as mini-packages for fold operations *}
  31.439 +subsection \<open>Locales as mini-packages for fold operations\<close>
  31.440  
  31.441 -subsubsection {* The natural case *}
  31.442 +subsubsection \<open>The natural case\<close>
  31.443  
  31.444  locale folding =
  31.445    fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'b"
  31.446 @@ -1142,16 +1142,16 @@
  31.447  proof -
  31.448    from fold_insert assms
  31.449    have "fold f z (insert x A) = f x (fold f z A)" by simp
  31.450 -  with `finite A` show ?thesis by (simp add: eq_fold fun_eq_iff)
  31.451 +  with \<open>finite A\<close> show ?thesis by (simp add: eq_fold fun_eq_iff)
  31.452  qed
  31.453   
  31.454  lemma remove:
  31.455    assumes "finite A" and "x \<in> A"
  31.456    shows "F A = f x (F (A - {x}))"
  31.457  proof -
  31.458 -  from `x \<in> A` obtain B where A: "A = insert x B" and "x \<notin> B"
  31.459 +  from \<open>x \<in> A\<close> obtain B where A: "A = insert x B" and "x \<notin> B"
  31.460      by (auto dest: mk_disjoint_insert)
  31.461 -  moreover from `finite A` A have "finite B" by simp
  31.462 +  moreover from \<open>finite A\<close> A have "finite B" by simp
  31.463    ultimately show ?thesis by simp
  31.464  qed
  31.465  
  31.466 @@ -1163,7 +1163,7 @@
  31.467  end
  31.468  
  31.469  
  31.470 -subsubsection {* With idempotency *}
  31.471 +subsubsection \<open>With idempotency\<close>
  31.472  
  31.473  locale folding_idem = folding +
  31.474    assumes comp_fun_idem: "f x \<circ> f x = f x"
  31.475 @@ -1180,20 +1180,20 @@
  31.476  proof -
  31.477    from fold_insert_idem assms
  31.478    have "fold f z (insert x A) = f x (fold f z A)" by simp
  31.479 -  with `finite A` show ?thesis by (simp add: eq_fold fun_eq_iff)
  31.480 +  with \<open>finite A\<close> show ?thesis by (simp add: eq_fold fun_eq_iff)
  31.481  qed
  31.482  
  31.483  end
  31.484  
  31.485  
  31.486 -subsection {* Finite cardinality *}
  31.487 +subsection \<open>Finite cardinality\<close>
  31.488  
  31.489 -text {*
  31.490 +text \<open>
  31.491    The traditional definition
  31.492    @{prop "card A \<equiv> LEAST n. EX f. A = {f i | i. i < n}"}
  31.493    is ugly to work with.
  31.494    But now that we have @{const fold} things are easy:
  31.495 -*}
  31.496 +\<close>
  31.497  
  31.498  definition card :: "'a set \<Rightarrow> nat" where
  31.499    "card = folding.F (\<lambda>_. Suc) 0"
  31.500 @@ -1289,7 +1289,7 @@
  31.501      then have "x \<in> B" by simp
  31.502      from insert have "A \<subseteq> B - {x}" and "finite (B - {x})" by auto
  31.503      with insert.hyps have "card A \<le> card (B - {x})" by auto
  31.504 -    with `finite A` `x \<notin> A` `finite B` `x \<in> B` show ?case by simp (simp only: card.remove)
  31.505 +    with \<open>finite A\<close> \<open>x \<notin> A\<close> \<open>finite B\<close> \<open>x \<in> B\<close> show ?case by simp (simp only: card.remove)
  31.506    qed
  31.507  qed
  31.508  
  31.509 @@ -1467,24 +1467,24 @@
  31.510    have "0 \<le> card S" by simp
  31.511    then have "\<exists>T \<subseteq> S. card T = card S \<and> P T"
  31.512    proof (induct rule: dec_induct)
  31.513 -    case base with `P {}` show ?case
  31.514 +    case base with \<open>P {}\<close> show ?case
  31.515        by (intro exI[of _ "{}"]) auto
  31.516    next
  31.517      case (step n)
  31.518      then obtain T where T: "T \<subseteq> S" "card T = n" "P T"
  31.519        by auto
  31.520 -    with `n < card S` have "T \<subset> S" "P T"
  31.521 +    with \<open>n < card S\<close> have "T \<subset> S" "P T"
  31.522        by auto
  31.523      with select[of T] obtain s where "s \<in> S" "s \<notin> T" "P (insert s T)"
  31.524        by auto
  31.525 -    with step(2) T `finite S` show ?case
  31.526 +    with step(2) T \<open>finite S\<close> show ?case
  31.527        by (intro exI[of _ "insert s T"]) (auto dest: finite_subset)
  31.528    qed
  31.529 -  with `finite S` show "P S"
  31.530 +  with \<open>finite S\<close> show "P S"
  31.531      by (auto dest: card_subset_eq)
  31.532  qed
  31.533  
  31.534 -text{* main cardinality theorem *}
  31.535 +text\<open>main cardinality theorem\<close>
  31.536  lemma card_partition [rule_format]:
  31.537    "finite C ==>
  31.538       finite (\<Union>C) -->
  31.539 @@ -1515,7 +1515,7 @@
  31.540    qed
  31.541  qed
  31.542  
  31.543 -text{*The form of a finite set of given cardinality*}
  31.544 +text\<open>The form of a finite set of given cardinality\<close>
  31.545  
  31.546  lemma card_eq_SucD:
  31.547  assumes "card A = Suc k"
  31.548 @@ -1568,7 +1568,7 @@
  31.549  next 
  31.550    case (Suc n)
  31.551    then guess B .. note B = this
  31.552 -  with `\<not> finite A` have "A \<noteq> B" by auto
  31.553 +  with \<open>\<not> finite A\<close> have "A \<noteq> B" by auto
  31.554    with B have "B \<subset> A" by auto
  31.555    hence "\<exists>x. x \<in> A - B" by (elim psubset_imp_ex_mem)
  31.556    then guess x .. note x = this
  31.557 @@ -1577,7 +1577,7 @@
  31.558    thus "\<exists>B. finite B \<and> card B = Suc n \<and> B \<subseteq> A" ..
  31.559  qed
  31.560  
  31.561 -subsubsection {* Cardinality of image *}
  31.562 +subsubsection \<open>Cardinality of image\<close>
  31.563  
  31.564  lemma card_image_le: "finite A ==> card (f ` A) \<le> card A"
  31.565    by (induct rule: finite_induct) (simp_all add: le_SucI card_insert_if)
  31.566 @@ -1643,7 +1643,7 @@
  31.567  lemma card_vimage_inj: "\<lbrakk> inj f; A \<subseteq> range f \<rbrakk> \<Longrightarrow> card (f -` A) = card A"
  31.568  by(auto 4 3 simp add: subset_image_iff inj_vimage_image_eq intro: card_image[symmetric, OF subset_inj_on])
  31.569  
  31.570 -subsubsection {* Pigeonhole Principles *}
  31.571 +subsubsection \<open>Pigeonhole Principles\<close>
  31.572  
  31.573  lemma pigeonhole: "card A > card(f ` A) \<Longrightarrow> ~ inj_on f A "
  31.574  by (auto dest: card_image less_irrefl_nat)
  31.575 @@ -1660,7 +1660,7 @@
  31.576      show ?case
  31.577      proof cases
  31.578        assume "finite{a:A. f a = b}"
  31.579 -      hence "~ finite(A - {a:A. f a = b})" using `\<not> finite A` by simp
  31.580 +      hence "~ finite(A - {a:A. f a = b})" using \<open>\<not> finite A\<close> by simp
  31.581        also have "A - {a:A. f a = b} = {a:A. f a \<noteq> b}" by blast
  31.582        finally have "~ finite({a:A. f a \<noteq> b})" .
  31.583        from insert(3)[OF _ this]
  31.584 @@ -1679,20 +1679,20 @@
  31.585  shows "EX b:B. ~finite{a:A. R a b}"
  31.586  proof -
  31.587     let ?F = "%a. {b:B. R a b}"
  31.588 -   from finite_Pow_iff[THEN iffD2, OF `finite B`]
  31.589 +   from finite_Pow_iff[THEN iffD2, OF \<open>finite B\<close>]
  31.590     have "finite(?F ` A)" by(blast intro: rev_finite_subset)
  31.591     from pigeonhole_infinite[where f = ?F, OF assms(1) this]
  31.592     obtain a0 where "a0\<in>A" and 1: "\<not> finite {a\<in>A. ?F a = ?F a0}" ..
  31.593 -   obtain b0 where "b0 : B" and "R a0 b0" using `a0:A` assms(3) by blast
  31.594 +   obtain b0 where "b0 : B" and "R a0 b0" using \<open>a0:A\<close> assms(3) by blast
  31.595     { assume "finite{a:A. R a b0}"
  31.596       then have "finite {a\<in>A. ?F a = ?F a0}"
  31.597 -       using `b0 : B` `R a0 b0` by(blast intro: rev_finite_subset)
  31.598 +       using \<open>b0 : B\<close> \<open>R a0 b0\<close> by(blast intro: rev_finite_subset)
  31.599     }
  31.600 -   with 1 `b0 : B` show ?thesis by blast
  31.601 +   with 1 \<open>b0 : B\<close> show ?thesis by blast
  31.602  qed
  31.603  
  31.604  
  31.605 -subsubsection {* Cardinality of sums *}
  31.606 +subsubsection \<open>Cardinality of sums\<close>
  31.607  
  31.608  lemma card_Plus:
  31.609    assumes "finite A" and "finite B"
  31.610 @@ -1708,7 +1708,7 @@
  31.611    "card (A <+> B) = (if finite A \<and> finite B then card A + card B else 0)"
  31.612    by (auto simp add: card_Plus)
  31.613  
  31.614 -text {* Relates to equivalence classes.  Based on a theorem of F. Kamm\"uller.  *}
  31.615 +text \<open>Relates to equivalence classes.  Based on a theorem of F. Kamm\"uller.\<close>
  31.616  
  31.617  lemma dvd_partition:
  31.618    assumes f: "finite (\<Union>C)" and "\<forall>c\<in>C. k dvd card c" "\<forall>c1\<in>C. \<forall>c2\<in>C. c1 \<noteq> c2 \<longrightarrow> c1 \<inter> c2 = {}"
  31.619 @@ -1729,7 +1729,7 @@
  31.620    qed
  31.621  qed
  31.622  
  31.623 -subsubsection {* Relating injectivity and surjectivity *}
  31.624 +subsubsection \<open>Relating injectivity and surjectivity\<close>
  31.625  
  31.626  lemma finite_surj_inj: assumes "finite A" "A \<subseteq> f ` A" shows "inj_on f A"
  31.627  proof -
    32.1 --- a/src/HOL/Fun.thy	Sat Jul 18 21:44:18 2015 +0200
    32.2 +++ b/src/HOL/Fun.thy	Sat Jul 18 22:58:50 2015 +0200
    32.3 @@ -4,7 +4,7 @@
    32.4      Copyright   1994, 2012
    32.5  *)
    32.6  
    32.7 -section {* Notions about functions *}
    32.8 +section \<open>Notions about functions\<close>
    32.9  
   32.10  theory Fun
   32.11  imports Set
   32.12 @@ -15,14 +15,14 @@
   32.13    "f x = u \<Longrightarrow> (\<And>x. P x \<Longrightarrow> g (f x) = x) \<Longrightarrow> P x \<Longrightarrow> x = g u"
   32.14    by auto
   32.15  
   32.16 -text{*Uniqueness, so NOT the axiom of choice.*}
   32.17 +text\<open>Uniqueness, so NOT the axiom of choice.\<close>
   32.18  lemma uniq_choice: "\<forall>x. \<exists>!y. Q x y \<Longrightarrow> \<exists>f. \<forall>x. Q x (f x)"
   32.19    by (force intro: theI')
   32.20  
   32.21  lemma b_uniq_choice: "\<forall>x\<in>S. \<exists>!y. Q x y \<Longrightarrow> \<exists>f. \<forall>x\<in>S. Q x (f x)"
   32.22    by (force intro: theI')
   32.23  
   32.24 -subsection {* The Identity Function @{text id} *}
   32.25 +subsection \<open>The Identity Function @{text id}\<close>
   32.26  
   32.27  definition id :: "'a \<Rightarrow> 'a" where
   32.28    "id = (\<lambda>x. x)"
   32.29 @@ -40,7 +40,7 @@
   32.30    constant id \<rightharpoonup> (Haskell) "id"
   32.31  
   32.32  
   32.33 -subsection {* The Composition Operator @{text "f \<circ> g"} *}
   32.34 +subsection \<open>The Composition Operator @{text "f \<circ> g"}\<close>
   32.35  
   32.36  definition comp :: "('b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "o" 55) where
   32.37    "f o g = (\<lambda>x. f (g x))"
   32.38 @@ -98,7 +98,7 @@
   32.39    constant comp \<rightharpoonup> (SML) infixl 5 "o" and (Haskell) infixr 9 "."
   32.40  
   32.41  
   32.42 -subsection {* The Forward Composition Operator @{text fcomp} *}
   32.43 +subsection \<open>The Forward Composition Operator @{text fcomp}\<close>
   32.44  
   32.45  definition fcomp :: "('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'c) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "\<circ>>" 60) where
   32.46    "f \<circ>> g = (\<lambda>x. g (f x))"
   32.47 @@ -121,7 +121,7 @@
   32.48  no_notation fcomp (infixl "\<circ>>" 60)
   32.49  
   32.50  
   32.51 -subsection {* Mapping functions *}
   32.52 +subsection \<open>Mapping functions\<close>
   32.53  
   32.54  definition map_fun :: "('c \<Rightarrow> 'a) \<Rightarrow> ('b \<Rightarrow> 'd) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'c \<Rightarrow> 'd" where
   32.55    "map_fun f g h = g \<circ> h \<circ> f"
   32.56 @@ -131,7 +131,7 @@
   32.57    by (simp add: map_fun_def)
   32.58  
   32.59  
   32.60 -subsection {* Injectivity and Bijectivity *}
   32.61 +subsection \<open>Injectivity and Bijectivity\<close>
   32.62  
   32.63  definition inj_on :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool" where -- "injective"
   32.64    "inj_on f A \<longleftrightarrow> (\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y)"
   32.65 @@ -139,8 +139,8 @@
   32.66  definition bij_betw :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set \<Rightarrow> bool" where -- "bijective"
   32.67    "bij_betw f A B \<longleftrightarrow> inj_on f A \<and> f ` A = B"
   32.68  
   32.69 -text{*A common special case: functions injective, surjective or bijective over
   32.70 -the entire domain type.*}
   32.71 +text\<open>A common special case: functions injective, surjective or bijective over
   32.72 +the entire domain type.\<close>
   32.73  
   32.74  abbreviation
   32.75    "inj f \<equiv> inj_on f UNIV"
   32.76 @@ -151,7 +151,7 @@
   32.77  abbreviation
   32.78    "bij f \<equiv> bij_betw f UNIV UNIV"
   32.79  
   32.80 -text{* The negated case: *}
   32.81 +text\<open>The negated case:\<close>
   32.82  translations
   32.83  "\<not> CONST surj f" <= "CONST range f \<noteq> CONST UNIV"
   32.84  
   32.85 @@ -278,14 +278,14 @@
   32.86    with assms * have "B = f ` (A - {x'})"
   32.87      by (auto dest: inj_on_contraD)
   32.88    have "x' \<notin> A - {x'}" by simp
   32.89 -  from `x' \<notin> A - {x'}` `A = insert x' (A - {x'})` `x = f x'` `B = image f (A - {x'})`
   32.90 +  from \<open>x' \<notin> A - {x'}\<close> \<open>A = insert x' (A - {x'})\<close> \<open>x = f x'\<close> \<open>B = image f (A - {x'})\<close>
   32.91    show ?thesis ..
   32.92  qed
   32.93  
   32.94  lemma linorder_injI:
   32.95    assumes hyp: "\<And>x y. x < (y::'a::linorder) \<Longrightarrow> f x \<noteq> f y"
   32.96    shows "inj f"
   32.97 -  -- {* Courtesy of Stephan Merz *}
   32.98 +  -- \<open>Courtesy of Stephan Merz\<close>
   32.99  proof (rule inj_onI)
  32.100    fix x y
  32.101    assume f_eq: "f x = f y"
  32.102 @@ -395,9 +395,9 @@
  32.103    have "inj_on ?g B"
  32.104    proof(rule inj_onI)
  32.105      fix x y assume "x:B" "y:B" "?g x = ?g y"
  32.106 -    from s `x:B` obtain a1 where a1: "?P x a1" by blast
  32.107 -    from s `y:B` obtain a2 where a2: "?P y a2" by blast
  32.108 -    from g[OF a1] a1 g[OF a2] a2 `?g x = ?g y` show "x=y" by simp
  32.109 +    from s \<open>x:B\<close> obtain a1 where a1: "?P x a1" by blast
  32.110 +    from s \<open>y:B\<close> obtain a2 where a2: "?P y a2" by blast
  32.111 +    from g[OF a1] a1 g[OF a2] a2 \<open>?g x = ?g y\<close> show "x=y" by simp
  32.112    qed
  32.113    moreover have "?g ` B = A"
  32.114    proof(auto simp: image_def)
  32.115 @@ -453,7 +453,7 @@
  32.116  
  32.117  lemma surj_vimage_empty:
  32.118    assumes "surj f" shows "f -` A = {} \<longleftrightarrow> A = {}"
  32.119 -  using surj_image_vimage_eq[OF `surj f`, of A]
  32.120 +  using surj_image_vimage_eq[OF \<open>surj f\<close>, of A]
  32.121    by (intro iffI) fastforce+
  32.122  
  32.123  lemma inj_vimage_image_eq: "inj f ==> f -` (f ` A) = A"
  32.124 @@ -515,8 +515,8 @@
  32.125  done
  32.126  
  32.127  lemma inj_vimage_singleton: "inj f \<Longrightarrow> f -` {a} \<subseteq> {THE x. f x = a}"
  32.128 -  -- {* The inverse image of a singleton under an injective function
  32.129 -         is included in a singleton. *}
  32.130 +  -- \<open>The inverse image of a singleton under an injective function
  32.131 +         is included in a singleton.\<close>
  32.132    apply (auto simp add: inj_on_def)
  32.133    apply (blast intro: the_equality [symmetric])
  32.134    done
  32.135 @@ -594,7 +594,7 @@
  32.136  qed
  32.137  
  32.138  
  32.139 -subsection{*Function Updating*}
  32.140 +subsection\<open>Function Updating\<close>
  32.141  
  32.142  definition fun_upd :: "('a => 'b) => 'a => 'b => ('a => 'b)" where
  32.143    "fun_upd f a b == % x. if x=a then b else f x"
  32.144 @@ -658,7 +658,7 @@
  32.145    by auto
  32.146  
  32.147  
  32.148 -subsection {* @{text override_on} *}
  32.149 +subsection \<open>@{text override_on}\<close>
  32.150  
  32.151  definition override_on :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'a \<Rightarrow> 'b" where
  32.152    "override_on f g A = (\<lambda>a. if a \<in> A then g a else f a)"
  32.153 @@ -673,7 +673,7 @@
  32.154  by(simp add:override_on_def)
  32.155  
  32.156  
  32.157 -subsection {* @{text swap} *}
  32.158 +subsection \<open>@{text swap}\<close>
  32.159  
  32.160  definition swap :: "'a \<Rightarrow> 'a \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b)"
  32.161  where
  32.162 @@ -750,7 +750,7 @@
  32.163  hide_const (open) swap
  32.164  
  32.165  
  32.166 -subsection {* Inversion of injective functions *}
  32.167 +subsection \<open>Inversion of injective functions\<close>
  32.168  
  32.169  definition the_inv_into :: "'a set => ('a => 'b) => ('b => 'a)" where
  32.170    "the_inv_into A f == %x. THE y. y : A & f y = x"
  32.171 @@ -813,7 +813,7 @@
  32.172    by (rule the_inv_into_f_f)
  32.173  
  32.174  
  32.175 -subsection {* Cantor's Paradox *}
  32.176 +subsection \<open>Cantor's Paradox\<close>
  32.177  
  32.178  lemma Cantors_paradox:
  32.179    "\<not>(\<exists>f. f ` A = Pow A)"
  32.180 @@ -825,14 +825,14 @@
  32.181    thus False by best
  32.182  qed
  32.183  
  32.184 -subsection {* Setup *} 
  32.185 +subsection \<open>Setup\<close> 
  32.186  
  32.187 -subsubsection {* Proof tools *}
  32.188 +subsubsection \<open>Proof tools\<close>
  32.189  
  32.190 -text {* simplifies terms of the form
  32.191 -  f(...,x:=y,...,x:=z,...) to f(...,x:=z,...) *}
  32.192 +text \<open>simplifies terms of the form
  32.193 +  f(...,x:=y,...,x:=z,...) to f(...,x:=z,...)\<close>
  32.194  
  32.195 -simproc_setup fun_upd2 ("f(v := w, x := y)") = {* fn _ =>
  32.196 +simproc_setup fun_upd2 ("f(v := w, x := y)") = \<open>fn _ =>
  32.197  let
  32.198    fun gen_fun_upd NONE T _ _ = NONE
  32.199      | gen_fun_upd (SOME f) T x y = SOME (Const (@{const_name fun_upd}, T) $ f $ x $ y)
  32.200 @@ -860,10 +860,10 @@
  32.201                simp_tac (put_simpset ss ctxt) 1))
  32.202      end
  32.203  in proc end
  32.204 -*}
  32.205 +\<close>
  32.206  
  32.207  
  32.208 -subsubsection {* Functorial structure of types *}
  32.209 +subsubsection \<open>Functorial structure of types\<close>
  32.210  
  32.211  ML_file "Tools/functor.ML"
  32.212  
  32.213 @@ -873,7 +873,7 @@
  32.214  functor vimage
  32.215    by (simp_all add: fun_eq_iff vimage_comp)
  32.216  
  32.217 -text {* Legacy theorem names *}
  32.218 +text \<open>Legacy theorem names\<close>
  32.219  
  32.220  lemmas o_def = comp_def
  32.221  lemmas o_apply = comp_apply
    33.1 --- a/src/HOL/Fun_Def.thy	Sat Jul 18 21:44:18 2015 +0200
    33.2 +++ b/src/HOL/Fun_Def.thy	Sat Jul 18 22:58:50 2015 +0200
    33.3 @@ -2,14 +2,14 @@
    33.4      Author:     Alexander Krauss, TU Muenchen
    33.5  *)
    33.6  
    33.7 -section {* Function Definitions and Termination Proofs *}
    33.8 +section \<open>Function Definitions and Termination Proofs\<close>
    33.9  
   33.10  theory Fun_Def
   33.11  imports Basic_BNF_LFPs Partial_Function SAT
   33.12  keywords "function" "termination" :: thy_goal and "fun" "fun_cases" :: thy_decl
   33.13  begin
   33.14  
   33.15 -subsection {* Definitions with default value *}
   33.16 +subsection \<open>Definitions with default value\<close>
   33.17  
   33.18  definition
   33.19    THE_default :: "'a \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> 'a" where
   33.20 @@ -66,7 +66,7 @@
   33.21    proof
   33.22      assume "\<exists>y. G x y"
   33.23      hence "D x" using graph ..
   33.24 -    with `\<not> D x` show False ..
   33.25 +    with \<open>\<not> D x\<close> show False ..
   33.26    qed
   33.27    hence "\<not>(\<exists>!y. G x y)" by blast
   33.28  
   33.29 @@ -88,26 +88,26 @@
   33.30  ML_file "Tools/Function/relation.ML"
   33.31  ML_file "Tools/Function/function_elims.ML"
   33.32  
   33.33 -method_setup relation = {*
   33.34 +method_setup relation = \<open>
   33.35    Args.term >> (fn t => fn ctxt => SIMPLE_METHOD' (Function_Relation.relation_infer_tac ctxt t))
   33.36 -*} "prove termination using a user-specified wellfounded relation"
   33.37 +\<close> "prove termination using a user-specified wellfounded relation"
   33.38  
   33.39  ML_file "Tools/Function/function.ML"
   33.40  ML_file "Tools/Function/pat_completeness.ML"
   33.41  
   33.42 -method_setup pat_completeness = {*
   33.43 +method_setup pat_completeness = \<open>
   33.44    Scan.succeed (SIMPLE_METHOD' o Pat_Completeness.pat_completeness_tac)
   33.45 -*} "prove completeness of (co)datatype patterns"
   33.46 +\<close> "prove completeness of (co)datatype patterns"
   33.47  
   33.48  ML_file "Tools/Function/fun.ML"
   33.49  ML_file "Tools/Function/induction_schema.ML"
   33.50  
   33.51 -method_setup induction_schema = {*
   33.52 +method_setup induction_schema = \<open>
   33.53    Scan.succeed (EMPTY_CASES oo Induction_Schema.induction_schema_tac)
   33.54 -*} "prove an induction principle"
   33.55 +\<close> "prove an induction principle"
   33.56  
   33.57  
   33.58 -subsection {* Measure functions *}
   33.59 +subsection \<open>Measure functions\<close>
   33.60  
   33.61  inductive is_measure :: "('a \<Rightarrow> nat) \<Rightarrow> bool"
   33.62  where is_measure_trivial: "is_measure f"
   33.63 @@ -125,13 +125,13 @@
   33.64  
   33.65  ML_file "Tools/Function/lexicographic_order.ML"
   33.66  
   33.67 -method_setup lexicographic_order = {*
   33.68 +method_setup lexicographic_order = \<open>
   33.69    Method.sections clasimp_modifiers >>
   33.70    (K (SIMPLE_METHOD o Lexicographic_Order.lexicographic_order_tac false))
   33.71 -*} "termination prover for lexicographic orderings"
   33.72 +\<close> "termination prover for lexicographic orderings"
   33.73  
   33.74  
   33.75 -subsection {* Congruence rules *}
   33.76 +subsection \<open>Congruence rules\<close>
   33.77  
   33.78  lemma let_cong [fundef_cong]:
   33.79    "M = N \<Longrightarrow> (\<And>x. x = N \<Longrightarrow> f x = g x) \<Longrightarrow> Let M f = Let N g"
   33.80 @@ -151,7 +151,7 @@
   33.81    unfolding o_apply .
   33.82  
   33.83  
   33.84 -subsection {* Simp rules for termination proofs *}
   33.85 +subsection \<open>Simp rules for termination proofs\<close>
   33.86  
   33.87  declare
   33.88    trans_less_add1[termination_simp]
   33.89 @@ -166,7 +166,7 @@
   33.90  by (induct p) auto
   33.91  
   33.92  
   33.93 -subsection {* Decomposition *}
   33.94 +subsection \<open>Decomposition\<close>
   33.95  
   33.96  lemma less_by_empty:
   33.97    "A = {} \<Longrightarrow> A \<subseteq> B"
   33.98 @@ -179,7 +179,7 @@
   33.99  by (auto simp add: wf_comp_self[of R])
  33.100  
  33.101  
  33.102 -subsection {* Reduction pairs *}
  33.103 +subsection \<open>Reduction pairs\<close>
  33.104  
  33.105  definition
  33.106    "reduction_pair P = (wf (fst P) \<and> fst P O snd P \<subseteq> fst P)"
  33.107 @@ -194,11 +194,11 @@
  33.108    assumes "wf S"
  33.109    shows "wf (R \<union> S)"
  33.110  proof -
  33.111 -  from rp `S \<subseteq> snd P` have "wf (fst P)" "fst P O S \<subseteq> fst P"
  33.112 +  from rp \<open>S \<subseteq> snd P\<close> have "wf (fst P)" "fst P O S \<subseteq> fst P"
  33.113      unfolding reduction_pair_def by auto
  33.114 -  with `wf S` have "wf (fst P \<union> S)"
  33.115 +  with \<open>wf S\<close> have "wf (fst P \<union> S)"
  33.116      by (auto intro: wf_union_compatible)
  33.117 -  moreover from `R \<subseteq> fst P` have "R \<union> S \<subseteq> fst P \<union> S" by auto
  33.118 +  moreover from \<open>R \<subseteq> fst P\<close> have "R \<union> S \<subseteq> fst P \<union> S" by auto
  33.119    ultimately show ?thesis by (rule wf_subset)
  33.120  qed
  33.121  
  33.122 @@ -211,7 +211,7 @@
  33.123    by force
  33.124  
  33.125  
  33.126 -subsection {* Concrete orders for SCNP termination proofs *}
  33.127 +subsection \<open>Concrete orders for SCNP termination proofs\<close>
  33.128  
  33.129  definition "pair_less = less_than <*lex*> less_than"
  33.130  definition "pair_leq = pair_less^="
  33.131 @@ -223,14 +223,14 @@
  33.132  lemma wf_pair_less[simp]: "wf pair_less"
  33.133    by (auto simp: pair_less_def)
  33.134  
  33.135 -text {* Introduction rules for @{text pair_less}/@{text pair_leq} *}
  33.136 +text \<open>Introduction rules for @{text pair_less}/@{text pair_leq}\<close>
  33.137  lemma pair_leqI1: "a < b \<Longrightarrow> ((a, s), (b, t)) \<in> pair_leq"
  33.138    and pair_leqI2: "a \<le> b \<Longrightarrow> s \<le> t \<Longrightarrow> ((a, s), (b, t)) \<in> pair_leq"
  33.139    and pair_lessI1: "a < b  \<Longrightarrow> ((a, s), (b, t)) \<in> pair_less"
  33.140    and pair_lessI2: "a \<le> b \<Longrightarrow> s < t \<Longrightarrow> ((a, s), (b, t)) \<in> pair_less"
  33.141    unfolding pair_leq_def pair_less_def by auto
  33.142  
  33.143 -text {* Introduction rules for max *}
  33.144 +text \<open>Introduction rules for max\<close>
  33.145  lemma smax_emptyI:
  33.146    "finite Y \<Longrightarrow> Y \<noteq> {} \<Longrightarrow> ({}, Y) \<in> max_strict"
  33.147    and smax_insertI:
  33.148 @@ -241,7 +241,7 @@
  33.149    "\<lbrakk>y \<in> YS; (x, y) \<in> pair_leq; (XS, YS) \<in> max_weak\<rbrakk> \<Longrightarrow> (insert x XS, YS) \<in> max_weak"
  33.150  unfolding max_strict_def max_weak_def by (auto elim!: max_ext.cases)
  33.151  
  33.152 -text {* Introduction rules for min *}
  33.153 +text \<open>Introduction rules for min\<close>
  33.154  lemma smin_emptyI:
  33.155    "X \<noteq> {} \<Longrightarrow> (X, {}) \<in> min_strict"
  33.156    and smin_insertI:
  33.157 @@ -252,7 +252,7 @@
  33.158    "\<lbrakk>x \<in> XS; (x, y) \<in> pair_leq; (XS, YS) \<in> min_weak\<rbrakk> \<Longrightarrow> (XS, insert y YS) \<in> min_weak"
  33.159  by (auto simp: min_strict_def min_weak_def min_ext_def)
  33.160  
  33.161 -text {* Reduction Pairs *}
  33.162 +text \<open>Reduction Pairs\<close>
  33.163  
  33.164  lemma max_ext_compat:
  33.165    assumes "R O S \<subseteq> R"
  33.166 @@ -294,7 +294,7 @@
  33.167  by (auto simp: pair_less_def pair_leq_def)
  33.168  
  33.169  
  33.170 -subsection {* Tool setup *}
  33.171 +subsection \<open>Tool setup\<close>
  33.172  
  33.173  ML_file "Tools/Function/termination.ML"
  33.174  ML_file "Tools/Function/scnp_solve.ML"
  33.175 @@ -302,9 +302,9 @@
  33.176  ML_file "Tools/Function/fun_cases.ML"
  33.177  
  33.178  ML_val -- "setup inactive"
  33.179 -{*
  33.180 +\<open>
  33.181    Context.theory_map (Function_Common.set_termination_prover
  33.182      (K (ScnpReconstruct.decomp_scnp_tac [ScnpSolve.MAX, ScnpSolve.MIN, ScnpSolve.MS])))
  33.183 -*}
  33.184 +\<close>
  33.185  
  33.186  end
    34.1 --- a/src/HOL/Fun_Def_Base.thy	Sat Jul 18 21:44:18 2015 +0200
    34.2 +++ b/src/HOL/Fun_Def_Base.thy	Sat Jul 18 22:58:50 2015 +0200
    34.3 @@ -2,7 +2,7 @@
    34.4      Author:     Alexander Krauss, TU Muenchen
    34.5  *)
    34.6  
    34.7 -section {* Function Definition Base *}
    34.8 +section \<open>Function Definition Base\<close>
    34.9  
   34.10  theory Fun_Def_Base
   34.11  imports Ctr_Sugar Set Wellfounded
    35.1 --- a/src/HOL/GCD.thy	Sat Jul 18 21:44:18 2015 +0200
    35.2 +++ b/src/HOL/GCD.thy	Sat Jul 18 22:58:50 2015 +0200
    35.3 @@ -25,13 +25,13 @@
    35.4  *)
    35.5  
    35.6  
    35.7 -section {* Greatest common divisor and least common multiple *}
    35.8 +section \<open>Greatest common divisor and least common multiple\<close>
    35.9  
   35.10  theory GCD
   35.11  imports Main
   35.12  begin
   35.13  
   35.14 -subsection {* GCD and LCM definitions *}
   35.15 +subsection \<open>GCD and LCM definitions\<close>
   35.16  
   35.17  class gcd = zero + one + dvd +
   35.18    fixes gcd :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
   35.19 @@ -592,7 +592,7 @@
   35.20  end
   35.21  
   35.22  
   35.23 -subsection {* Transfer setup *}
   35.24 +subsection \<open>Transfer setup\<close>
   35.25  
   35.26  lemma transfer_nat_int_gcd:
   35.27    "(x::int) >= 0 \<Longrightarrow> y >= 0 \<Longrightarrow> gcd (nat x) (nat y) = nat (gcd x y)"
   35.28 @@ -622,7 +622,7 @@
   35.29      transfer_int_nat_gcd transfer_int_nat_gcd_closures]
   35.30  
   35.31  
   35.32 -subsection {* GCD properties *}
   35.33 +subsection \<open>GCD properties\<close>
   35.34  
   35.35  (* was gcd_induct *)
   35.36  lemma gcd_nat_induct:
   35.37 @@ -744,10 +744,10 @@
   35.38  
   35.39  declare gcd_nat.simps [simp del]
   35.40  
   35.41 -text {*
   35.42 +text \<open>
   35.43    \medskip @{term "gcd m n"} divides @{text m} and @{text n}.  The
   35.44    conjunctions don't seem provable separately.
   35.45 -*}
   35.46 +\<close>
   35.47  
   35.48  instance nat :: semiring_gcd
   35.49  proof
   35.50 @@ -868,12 +868,12 @@
   35.51  lemma gcd_proj2_if_dvd_int [simp]: "y dvd x \<Longrightarrow> gcd (x::int) y = abs y"
   35.52    by (metis gcd_proj1_if_dvd_int gcd_commute_int)
   35.53  
   35.54 -text {*
   35.55 +text \<open>
   35.56    \medskip Multiplication laws
   35.57 -*}
   35.58 +\<close>
   35.59  
   35.60  lemma gcd_mult_distrib_nat: "(k::nat) * gcd m n = gcd (k * m) (k * n)"
   35.61 -    -- {* @{cite \<open>page 27\<close> davenport92} *}
   35.62 +    -- \<open>@{cite \<open>page 27\<close> davenport92}\<close>
   35.63    apply (induct m n rule: gcd_nat_induct)
   35.64    apply simp
   35.65    apply (case_tac "k = 0")
   35.66 @@ -944,16 +944,16 @@
   35.67    assume ?rhs then show ?lhs by simp
   35.68  next
   35.69    assume ?lhs
   35.70 -  from `?lhs` have "a dvd b * d" by (auto intro: dvdI dest: sym)
   35.71 -  with `coprime a d` have "a dvd b" by (simp add: coprime_dvd_mult_iff_nat)
   35.72 -  from `?lhs` have "b dvd a * c" by (auto intro: dvdI dest: sym)
   35.73 -  with `coprime b c` have "b dvd a" by (simp add: coprime_dvd_mult_iff_nat)
   35.74 -  from `?lhs` have "c dvd d * b" by (auto intro: dvdI dest: sym simp add: mult.commute)
   35.75 -  with `coprime b c` have "c dvd d" by (simp add: coprime_dvd_mult_iff_nat gcd_commute_nat)
   35.76 -  from `?lhs` have "d dvd c * a" by (auto intro: dvdI dest: sym simp add: mult.commute)
   35.77 -  with `coprime a d` have "d dvd c" by (simp add: coprime_dvd_mult_iff_nat gcd_commute_nat)
   35.78 -  from `a dvd b` `b dvd a` have "a = b" by (rule Nat.dvd.antisym)
   35.79 -  moreover from `c dvd d` `d dvd c` have "c = d" by (rule Nat.dvd.antisym)
   35.80 +  from \<open>?lhs\<close> have "a dvd b * d" by (auto intro: dvdI dest: sym)
   35.81 +  with \<open>coprime a d\<close> have "a dvd b" by (simp add: coprime_dvd_mult_iff_nat)
   35.82 +  from \<open>?lhs\<close> have "b dvd a * c" by (auto intro: dvdI dest: sym)
   35.83 +  with \<open>coprime b c\<close> have "b dvd a" by (simp add: coprime_dvd_mult_iff_nat)
   35.84 +  from \<open>?lhs\<close> have "c dvd d * b" by (auto intro: dvdI dest: sym simp add: mult.commute)
   35.85 +  with \<open>coprime b c\<close> have "c dvd d" by (simp add: coprime_dvd_mult_iff_nat gcd_commute_nat)
   35.86 +  from \<open>?lhs\<close> have "d dvd c * a" by (auto intro: dvdI dest: sym simp add: mult.commute)
   35.87 +  with \<open>coprime a d\<close> have "d dvd c" by (simp add: coprime_dvd_mult_iff_nat gcd_commute_nat)
   35.88 +  from \<open>a dvd b\<close> \<open>b dvd a\<close> have "a = b" by (rule Nat.dvd.antisym)
   35.89 +  moreover from \<open>c dvd d\<close> \<open>d dvd c\<close> have "c = d" by (rule Nat.dvd.antisym)
   35.90    ultimately show ?rhs ..
   35.91  qed
   35.92  
   35.93 @@ -963,7 +963,7 @@
   35.94    shows "\<bar>a\<bar> * \<bar>c\<bar> = \<bar>b\<bar> * \<bar>d\<bar> \<longleftrightarrow> \<bar>a\<bar> = \<bar>b\<bar> \<and> \<bar>c\<bar> = \<bar>d\<bar>"
   35.95    using assms by (intro coprime_crossproduct_nat [transferred]) auto
   35.96  
   35.97 -text {* \medskip Addition laws *}
   35.98 +text \<open>\medskip Addition laws\<close>
   35.99  
  35.100  lemma gcd_add1_nat [simp]: "gcd ((m::nat) + n) n = gcd m n"
  35.101    apply (case_tac "n = 0")
  35.102 @@ -1085,7 +1085,7 @@
  35.103    by (simp add: gcd_int_def nat_mod_distrib gcd_non_0_nat)
  35.104  
  35.105  
  35.106 -subsection {* Coprimality *}
  35.107 +subsection \<open>Coprimality\<close>
  35.108  
  35.109  context semiring_gcd
  35.110  begin
  35.111 @@ -1504,7 +1504,7 @@
  35.112  by (metis coprime_lmult_int gcd_1_int gcd_commute_int gcd_red_int)
  35.113  
  35.114  
  35.115 -subsection {* Bezout's theorem *}
  35.116 +subsection \<open>Bezout's theorem\<close>
  35.117  
  35.118  (* Function bezw returns a pair of witnesses to Bezout's theorem --
  35.119     see the theorems that follow the definition. *)
  35.120 @@ -1592,7 +1592,7 @@
  35.121    ultimately show ?thesis by blast
  35.122  qed
  35.123  
  35.124 -text {* versions of Bezout for nat, by Amine Chaieb *}
  35.125 +text \<open>versions of Bezout for nat, by Amine Chaieb\<close>
  35.126  
  35.127  lemma ind_euclid:
  35.128    assumes c: " \<forall>a b. P (a::nat) b \<longleftrightarrow> P b a" and z: "\<forall>a. P a 0"
  35.129 @@ -1744,7 +1744,7 @@
  35.130  qed
  35.131  
  35.132  
  35.133 -subsection {* LCM properties *}
  35.134 +subsection \<open>LCM properties\<close>
  35.135  
  35.136  lemma lcm_altdef_int [code]: "lcm (a::int) b = (abs a) * (abs b) div gcd a b"
  35.137    by (simp add: lcm_int_def lcm_nat_def zdiv_int
  35.138 @@ -1906,7 +1906,7 @@
  35.139  by (auto simp add: abs_mult_self trans [OF lcm_unique_int eq_commute, symmetric] zmult_eq_1_iff)
  35.140  
  35.141  
  35.142 -subsection {* The complete divisibility lattice *}
  35.143 +subsection \<open>The complete divisibility lattice\<close>
  35.144  
  35.145  interpretation gcd_semilattice_nat: semilattice_inf gcd "op dvd" "(\<lambda>m n::nat. m dvd n \<and> \<not> n dvd m)"
  35.146    by standard simp_all
  35.147 @@ -1916,9 +1916,9 @@
  35.148  
  35.149  interpretation gcd_lcm_lattice_nat: lattice gcd "op dvd" "(\<lambda>m n::nat. m dvd n & ~ n dvd m)" lcm ..
  35.150  
  35.151 -text{* Lifting gcd and lcm to sets (Gcd/Lcm).
  35.152 +text\<open>Lifting gcd and lcm to sets (Gcd/Lcm).
  35.153  Gcd is defined via Lcm to facilitate the proof that we have a complete lattice.
  35.154 -*}
  35.155 +\<close>
  35.156  
  35.157  instantiation nat :: Gcd
  35.158  begin
  35.159 @@ -2034,7 +2034,7 @@
  35.160        simp add: unit_factor_Gcd uf)
  35.161  qed
  35.162  
  35.163 -text{* Alternative characterizations of Gcd: *}
  35.164 +text\<open>Alternative characterizations of Gcd:\<close>
  35.165  
  35.166  lemma Gcd_eq_Max: "finite(M::nat set) \<Longrightarrow> M \<noteq> {} \<Longrightarrow> 0 \<notin> M \<Longrightarrow> Gcd M = Max(\<Inter>m\<in>M. {d. d dvd m})"
  35.167  apply(rule antisym)
  35.168 @@ -2097,7 +2097,7 @@
  35.169               dvd.neq_le_trans dvd_triv_right mult.commute)
  35.170  done
  35.171  
  35.172 -text{* Nitpick: *}
  35.173 +text\<open>Nitpick:\<close>
  35.174  
  35.175  lemma gcd_eq_nitpick_gcd [nitpick_unfold]: "gcd x y = Nitpick.nat_gcd x y"
  35.176  by (induct x y rule: nat_gcd.induct)
  35.177 @@ -2107,7 +2107,7 @@
  35.178  by (simp only: lcm_nat_def Nitpick.nat_lcm_def gcd_eq_nitpick_gcd)
  35.179  
  35.180  
  35.181 -subsubsection {* Setwise gcd and lcm for integers *}
  35.182 +subsubsection \<open>Setwise gcd and lcm for integers\<close>
  35.183  
  35.184  instantiation int :: Gcd
  35.185  begin
    36.1 --- a/src/HOL/Groebner_Basis.thy	Sat Jul 18 21:44:18 2015 +0200
    36.2 +++ b/src/HOL/Groebner_Basis.thy	Sat Jul 18 22:58:50 2015 +0200
    36.3 @@ -2,17 +2,17 @@
    36.4      Author:     Amine Chaieb, TU Muenchen
    36.5  *)
    36.6  
    36.7 -section {* Groebner bases *}
    36.8 +section \<open>Groebner bases\<close>
    36.9  
   36.10  theory Groebner_Basis
   36.11  imports Semiring_Normalization Parity
   36.12  begin
   36.13  
   36.14 -subsection {* Groebner Bases *}
   36.15 +subsection \<open>Groebner Bases\<close>
   36.16  
   36.17 -lemmas bool_simps = simp_thms(1-34) -- {* FIXME move to @{theory HOL} *}
   36.18 +lemmas bool_simps = simp_thms(1-34) -- \<open>FIXME move to @{theory HOL}\<close>
   36.19  
   36.20 -lemma nnf_simps: -- {* FIXME shadows fact binding in @{theory HOL} *}
   36.21 +lemma nnf_simps: -- \<open>FIXME shadows fact binding in @{theory HOL}\<close>
   36.22    "(\<not>(P \<and> Q)) = (\<not>P \<or> \<not>Q)" "(\<not>(P \<or> Q)) = (\<not>P \<and> \<not>Q)"
   36.23    "(P \<longrightarrow> Q) = (\<not>P \<or> Q)"
   36.24    "(P = Q) = ((P \<and> Q) \<or> (\<not>P \<and> \<not> Q))" "(\<not> \<not>(P)) = P"
   36.25 @@ -35,7 +35,7 @@
   36.26  named_theorems algebra "pre-simplification rules for algebraic methods"
   36.27  ML_file "Tools/groebner.ML"
   36.28  
   36.29 -method_setup algebra = {*
   36.30 +method_setup algebra = \<open>
   36.31    let
   36.32      fun keyword k = Scan.lift (Args.$$$ k -- Args.colon) >> K ()
   36.33      val addN = "add"
   36.34 @@ -48,7 +48,7 @@
   36.35      (fn (add_ths, del_ths) => fn ctxt =>
   36.36        SIMPLE_METHOD' (Groebner.algebra_tac add_ths del_ths ctxt))
   36.37    end
   36.38 -*} "solve polynomial equations over (semi)rings and ideal membership problems using Groebner bases"
   36.39 +\<close> "solve polynomial equations over (semi)rings and ideal membership problems using Groebner bases"
   36.40  
   36.41  declare dvd_def[algebra]
   36.42  declare dvd_eq_mod_eq_0[symmetric, algebra]
    37.1 --- a/src/HOL/Groups.thy	Sat Jul 18 21:44:18 2015 +0200
    37.2 +++ b/src/HOL/Groups.thy	Sat Jul 18 22:58:50 2015 +0200
    37.3 @@ -2,44 +2,44 @@
    37.4      Author:  Gertrud Bauer, Steven Obua, Lawrence C Paulson, Markus Wenzel, Jeremy Avigad
    37.5  *)
    37.6  
    37.7 -section {* Groups, also combined with orderings *}
    37.8 +section \<open>Groups, also combined with orderings\<close>
    37.9  
   37.10  theory Groups
   37.11  imports Orderings
   37.12  begin
   37.13  
   37.14 -subsection {* Dynamic facts *}
   37.15 +subsection \<open>Dynamic facts\<close>
   37.16  
   37.17  named_theorems ac_simps "associativity and commutativity simplification rules"
   37.18  
   37.19  
   37.20 -text{* The rewrites accumulated in @{text algebra_simps} deal with the
   37.21 +text\<open>The rewrites accumulated in @{text algebra_simps} deal with the
   37.22  classical algebraic structures of groups, rings and family. They simplify
   37.23  terms by multiplying everything out (in case of a ring) and bringing sums and
   37.24  products into a canonical form (by ordered rewriting). As a result it decides
   37.25  group and ring equalities but also helps with inequalities.
   37.26  
   37.27  Of course it also works for fields, but it knows nothing about multiplicative
   37.28 -inverses or division. This is catered for by @{text field_simps}. *}
   37.29 +inverses or division. This is catered for by @{text field_simps}.\<close>
   37.30  
   37.31  named_theorems algebra_simps "algebra simplification rules"
   37.32  
   37.33  
   37.34 -text{* Lemmas @{text field_simps} multiply with denominators in (in)equations
   37.35 +text\<open>Lemmas @{text field_simps} multiply with denominators in (in)equations
   37.36  if they can be proved to be non-zero (for equations) or positive/negative
   37.37  (for inequations). Can be too aggressive and is therefore separate from the
   37.38 -more benign @{text algebra_simps}. *}
   37.39 +more benign @{text algebra_simps}.\<close>
   37.40  
   37.41  named_theorems field_simps "algebra simplification rules for fields"
   37.42  
   37.43  
   37.44 -subsection {* Abstract structures *}
   37.45 +subsection \<open>Abstract structures\<close>
   37.46  
   37.47 -text {*
   37.48 +text \<open>
   37.49    These locales provide basic structures for interpretation into
   37.50    bigger structures;  extensions require careful thinking, otherwise
   37.51    undesired effects may occur due to interpretation.
   37.52 -*}
   37.53 +\<close>
   37.54  
   37.55  locale semigroup =
   37.56    fixes f :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
   37.57 @@ -76,7 +76,7 @@
   37.58  end
   37.59  
   37.60  
   37.61 -subsection {* Generic operations *}
   37.62 +subsection \<open>Generic operations\<close>
   37.63  
   37.64  class zero = 
   37.65    fixes zero :: 'a  ("0")
   37.66 @@ -92,17 +92,17 @@
   37.67  lemma Let_1 [simp]: "Let 1 f = f 1"
   37.68    unfolding Let_def ..
   37.69  
   37.70 -setup {*
   37.71 +setup \<open>
   37.72    Reorient_Proc.add
   37.73      (fn Const(@{const_name Groups.zero}, _) => true
   37.74        | Const(@{const_name Groups.one}, _) => true
   37.75        | _ => false)
   37.76 -*}
   37.77 +\<close>
   37.78  
   37.79  simproc_setup reorient_zero ("0 = x") = Reorient_Proc.proc
   37.80  simproc_setup reorient_one ("1 = x") = Reorient_Proc.proc
   37.81  
   37.82 -typed_print_translation {*
   37.83 +typed_print_translation \<open>
   37.84    let
   37.85      fun tr' c = (c, fn ctxt => fn T => fn ts =>
   37.86        if null ts andalso Printer.type_emphasis ctxt T then
   37.87 @@ -110,7 +110,7 @@
   37.88            Syntax_Phases.term_of_typ ctxt T
   37.89        else raise Match);
   37.90    in map tr' [@{const_syntax Groups.one}, @{const_syntax Groups.zero}] end;
   37.91 -*} -- {* show types that are presumably too general *}
   37.92 +\<close> -- \<open>show types that are presumably too general\<close>
   37.93  
   37.94  class plus =
   37.95    fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "+" 65)
   37.96 @@ -125,7 +125,7 @@
   37.97    fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "*" 70)
   37.98  
   37.99  
  37.100 -subsection {* Semigroups and Monoids *}
  37.101 +subsection \<open>Semigroups and Monoids\<close>
  37.102  
  37.103  class semigroup_add = plus +
  37.104    assumes add_assoc [algebra_simps, field_simps]: "(a + b) + c = a + (b + c)"
  37.105 @@ -327,7 +327,7 @@
  37.106  end
  37.107  
  37.108  
  37.109 -subsection {* Groups *}
  37.110 +subsection \<open>Groups\<close>
  37.111  
  37.112  class group_add = minus + uminus + monoid_add +
  37.113    assumes left_minus [simp]: "- a + a = 0"
  37.114 @@ -413,7 +413,7 @@
  37.115  proof
  37.116    assume "a - b = 0"
  37.117    have "a = (a - b) + b" by (simp add: add.assoc)
  37.118 -  also have "\<dots> = b" using `a - b = 0` by simp
  37.119 +  also have "\<dots> = b" using \<open>a - b = 0\<close> by simp
  37.120    finally show "a = b" .
  37.121  next
  37.122    assume "a = b" thus "a - b = 0" by simp
  37.123 @@ -454,7 +454,7 @@
  37.124    "0 = - a \<longleftrightarrow> 0 = a"
  37.125    by (subst neg_equal_iff_equal [symmetric]) simp
  37.126  
  37.127 -text{*The next two equations can make the simplifier loop!*}
  37.128 +text\<open>The next two equations can make the simplifier loop!\<close>
  37.129  
  37.130  lemma equation_minus_iff:
  37.131    "a = - b \<longleftrightarrow> b = - a"
  37.132 @@ -557,9 +557,9 @@
  37.133  end
  37.134  
  37.135  
  37.136 -subsection {* (Partially) Ordered Groups *} 
  37.137 +subsection \<open>(Partially) Ordered Groups\<close> 
  37.138  
  37.139 -text {*
  37.140 +text \<open>
  37.141    The theory of partially ordered groups is taken from the books:
  37.142    \begin{itemize}
  37.143    \item \emph{Lattice Theory} by Garret Birkhoff, American Mathematical Society 1979 
  37.144 @@ -570,7 +570,7 @@
  37.145    \item @{url "http://www.mathworld.com"} by Eric Weisstein et. al.
  37.146    \item \emph{Algebra I} by van der Waerden, Springer.
  37.147    \end{itemize}
  37.148 -*}
  37.149 +\<close>
  37.150  
  37.151  class ordered_ab_semigroup_add = order + ab_semigroup_add +
  37.152    assumes add_left_mono: "a \<le> b \<Longrightarrow> c + a \<le> c + b"
  37.153 @@ -580,7 +580,7 @@
  37.154    "a \<le> b \<Longrightarrow> a + c \<le> b + c"
  37.155  by (simp add: add.commute [of _ c] add_left_mono)
  37.156  
  37.157 -text {* non-strict, in both arguments *}
  37.158 +text \<open>non-strict, in both arguments\<close>
  37.159  lemma add_mono:
  37.160    "a \<le> b \<Longrightarrow> c \<le> d \<Longrightarrow> a + c \<le> b + d"
  37.161    apply (erule add_right_mono [THEN order_trans])
  37.162 @@ -601,7 +601,7 @@
  37.163    "a < b \<Longrightarrow> a + c < b + c"
  37.164  by (simp add: add.commute [of _ c] add_strict_left_mono)
  37.165  
  37.166 -text{*Strict monotonicity in both arguments*}
  37.167 +text\<open>Strict monotonicity in both arguments\<close>
  37.168  lemma add_strict_mono:
  37.169    "a < b \<Longrightarrow> c < d \<Longrightarrow> a + c < b + d"
  37.170  apply (erule add_strict_right_mono [THEN less_trans])
  37.171 @@ -700,23 +700,23 @@
  37.172  
  37.173  lemma add_diff_inverse:
  37.174    "a + (b - a) = b"
  37.175 -  using `a \<le> b` by (auto simp add: le_iff_add)
  37.176 +  using \<open>a \<le> b\<close> by (auto simp add: le_iff_add)
  37.177  
  37.178  lemma add_diff_assoc:
  37.179    "c + (b - a) = c + b - a"
  37.180 -  using `a \<le> b` by (auto simp add: le_iff_add add.left_commute [of c])
  37.181 +  using \<open>a \<le> b\<close> by (auto simp add: le_iff_add add.left_commute [of c])
  37.182  
  37.183  lemma add_diff_assoc2:
  37.184    "b - a + c = b + c - a"
  37.185 -  using `a \<le> b` by (auto simp add: le_iff_add add.assoc)
  37.186 +  using \<open>a \<le> b\<close> by (auto simp add: le_iff_add add.assoc)
  37.187  
  37.188  lemma diff_add_assoc:
  37.189    "c + b - a = c + (b - a)"
  37.190 -  using `a \<le> b` by (simp add: add.commute add_diff_assoc)
  37.191 +  using \<open>a \<le> b\<close> by (simp add: add.commute add_diff_assoc)
  37.192  
  37.193  lemma diff_add_assoc2:
  37.194    "b + c - a = b - a + c"
  37.195 -  using `a \<le> b`by (simp add: add.commute add_diff_assoc)
  37.196 +  using \<open>a \<le> b\<close>by (simp add: add.commute add_diff_assoc)
  37.197  
  37.198  lemma diff_diff_right:
  37.199    "c - (b - a) = c + a - b"
  37.200 @@ -751,7 +751,7 @@
  37.201  end
  37.202  
  37.203  
  37.204 -subsection {* Support for reasoning about signs *}
  37.205 +subsection \<open>Support for reasoning about signs\<close>
  37.206  
  37.207  class ordered_comm_monoid_add =
  37.208    ordered_cancel_ab_semigroup_add + comm_monoid_add
  37.209 @@ -915,7 +915,7 @@
  37.210  lemma le_imp_neg_le:
  37.211    assumes "a \<le> b" shows "-b \<le> -a"
  37.212  proof -
  37.213 -  have "-a+a \<le> -a+b" using `a \<le> b` by (rule add_left_mono) 
  37.214 +  have "-a+a \<le> -a+b" using \<open>a \<le> b\<close> by (rule add_left_mono) 
  37.215    then have "0 \<le> -a+b" by simp
  37.216    then have "0 + (-b) \<le> (-a + b) + (-b)" by (rule add_right_mono) 
  37.217    then show ?thesis by (simp add: algebra_simps)
  37.218 @@ -946,7 +946,7 @@
  37.219  lemma neg_0_less_iff_less [simp]: "0 < - a \<longleftrightarrow> a < 0"
  37.220  by (subst neg_less_iff_less [symmetric], simp)
  37.221  
  37.222 -text{*The next several equations can make the simplifier loop!*}
  37.223 +text\<open>The next several equations can make the simplifier loop!\<close>
  37.224  
  37.225  lemma less_minus_iff: "a < - b \<longleftrightarrow> b < - a"
  37.226  proof -
  37.227 @@ -1042,19 +1042,19 @@
  37.228  ML_file "Tools/group_cancel.ML"
  37.229  
  37.230  simproc_setup group_cancel_add ("a + b::'a::ab_group_add") =
  37.231 -  {* fn phi => fn ss => try Group_Cancel.cancel_add_conv *}
  37.232 +  \<open>fn phi => fn ss => try Group_Cancel.cancel_add_conv\<close>
  37.233  
  37.234  simproc_setup group_cancel_diff ("a - b::'a::ab_group_add") =
  37.235 -  {* fn phi => fn ss => try Group_Cancel.cancel_diff_conv *}
  37.236 +  \<open>fn phi => fn ss => try Group_Cancel.cancel_diff_conv\<close>
  37.237  
  37.238  simproc_setup group_cancel_eq ("a = (b::'a::ab_group_add)") =
  37.239 -  {* fn phi => fn ss => try Group_Cancel.cancel_eq_conv *}
  37.240 +  \<open>fn phi => fn ss => try Group_Cancel.cancel_eq_conv\<close>
  37.241  
  37.242  simproc_setup group_cancel_le ("a \<le> (b::'a::ordered_ab_group_add)") =
  37.243 -  {* fn phi => fn ss => try Group_Cancel.cancel_le_conv *}
  37.244 +  \<open>fn phi => fn ss => try Group_Cancel.cancel_le_conv\<close>
  37.245  
  37.246  simproc_setup group_cancel_less ("a < (b::'a::ordered_ab_group_add)") =
  37.247 -  {* fn phi => fn ss => try Group_Cancel.cancel_less_conv *}
  37.248 +  \<open>fn phi => fn ss => try Group_Cancel.cancel_less_conv\<close>
  37.249  
  37.250  class linordered_ab_semigroup_add =
  37.251    linorder + ordered_ab_semigroup_add
  37.252 @@ -1380,7 +1380,7 @@
  37.253  lemmas diff_diff_eq = diff_diff_add -- \<open>FIXME duplicate\<close>
  37.254  
  37.255  
  37.256 -subsection {* Tools setup *}
  37.257 +subsection \<open>Tools setup\<close>
  37.258  
  37.259  lemma add_mono_thms_linordered_semiring:
  37.260    fixes i j k :: "'a\<Colon>ordered_ab_semigroup_add"
    38.1 --- a/src/HOL/Groups_Big.thy	Sat Jul 18 21:44:18 2015 +0200
    38.2 +++ b/src/HOL/Groups_Big.thy	Sat Jul 18 22:58:50 2015 +0200
    38.3 @@ -3,13 +3,13 @@
    38.4                  with contributions by Jeremy Avigad
    38.5  *)
    38.6  
    38.7 -section {* Big sum and product over finite (non-empty) sets *}
    38.8 +section \<open>Big sum and product over finite (non-empty) sets\<close>
    38.9  
   38.10  theory Groups_Big
   38.11  imports Finite_Set
   38.12  begin
   38.13  
   38.14 -subsection {* Generic monoid operation over a set *}
   38.15 +subsection \<open>Generic monoid operation over a set\<close>
   38.16  
   38.17  no_notation times (infixl "*" 70)
   38.18  no_notation Groups.one ("1")
   38.19 @@ -44,9 +44,9 @@
   38.20    assumes "finite A" and "x \<in> A"
   38.21    shows "F g A = g x * F g (A - {x})"
   38.22  proof -
   38.23 -  from `x \<in> A` obtain B where A: "A = insert x B" and "x \<notin> B"
   38.24 +  from \<open>x \<in> A\<close> obtain B where A: "A = insert x B" and "x \<notin> B"
   38.25      by (auto dest: mk_disjoint_insert)
   38.26 -  moreover from `finite A` A have "finite B" by simp
   38.27 +  moreover from \<open>finite A\<close> A have "finite B" by simp
   38.28    ultimately show ?thesis by simp
   38.29  qed
   38.30  
   38.31 @@ -67,7 +67,7 @@
   38.32  lemma union_inter:
   38.33    assumes "finite A" and "finite B"
   38.34    shows "F g (A \<union> B) * F g (A \<inter> B) = F g A * F g B"
   38.35 -  -- {* The reversed orientation looks more natural, but LOOPS as a simprule! *}
   38.36 +  -- \<open>The reversed orientation looks more natural, but LOOPS as a simprule!\<close>
   38.37  using assms proof (induct A)
   38.38    case empty then show ?case by simp
   38.39  next
   38.40 @@ -140,7 +140,7 @@
   38.41    assumes "A = B"
   38.42    assumes g_h: "\<And>x. x \<in> B \<Longrightarrow> g x = h x"
   38.43    shows "F g A = F h B"
   38.44 -  using g_h unfolding `A = B`
   38.45 +  using g_h unfolding \<open>A = B\<close>
   38.46    by (induct B rule: infinite_finite_induct) auto
   38.47  
   38.48  lemma strong_cong [cong]:
   38.49 @@ -207,9 +207,9 @@
   38.50    assumes "finite T" and "S \<subseteq> T" and "\<forall>i \<in> T - S. h i = 1"
   38.51    and "\<And>x. x \<in> S \<Longrightarrow> g x = h x" shows "F g S = F h T"
   38.52  proof-
   38.53 -  have eq: "T = S \<union> (T - S)" using `S \<subseteq> T` by blast
   38.54 -  have d: "S \<inter> (T - S) = {}" using `S \<subseteq> T` by blast
   38.55 -  from `finite T` `S \<subseteq> T` have f: "finite S" "finite (T - S)"
   38.56 +  have eq: "T = S \<union> (T - S)" using \<open>S \<subseteq> T\<close> by blast
   38.57 +  have d: "S \<inter> (T - S) = {}" using \<open>S \<subseteq> T\<close> by blast
   38.58 +  from \<open>finite T\<close> \<open>S \<subseteq> T\<close> have f: "finite S" "finite (T - S)"
   38.59      by (auto intro: finite_subset)
   38.60    show ?thesis using assms(4)
   38.61      by (simp add: union_disjoint [OF f d, unfolded eq [symmetric]] neutral [OF assms(3)])
   38.62 @@ -268,7 +268,7 @@
   38.63      also have "\<dots> = F g (T - T')"
   38.64        using bij by (rule reindex_bij_betw)
   38.65      also have "\<dots> = F g T"
   38.66 -      using nn `finite S` by (intro mono_neutral_cong_left) auto
   38.67 +      using nn \<open>finite S\<close> by (intro mono_neutral_cong_left) auto
   38.68      finally show ?thesis .
   38.69    qed simp
   38.70  qed
   38.71 @@ -280,7 +280,7 @@
   38.72  proof (subst reindex_bij_betw_not_neutral [symmetric])
   38.73    show "bij_betw h (A - {x \<in> A. (g \<circ> h) x = 1}) (h ` A - h ` {x \<in> A. (g \<circ> h) x = 1})"
   38.74      using nz by (auto intro!: inj_onI simp: bij_betw_def)
   38.75 -qed (insert `finite A`, auto)
   38.76 +qed (insert \<open>finite A\<close>, auto)
   38.77  
   38.78  lemma reindex_bij_witness_not_neutral:
   38.79    assumes fin: "finite S'" "finite T'"
   38.80 @@ -369,7 +369,7 @@
   38.81    have "\<forall>i\<in>A - A \<inter> B. (if i \<in> A \<inter> B then g i else 1) = 1"
   38.82     by simp
   38.83    moreover have "A \<inter> B \<subseteq> A" by blast
   38.84 -  ultimately have "F ?g (A \<inter> B) = F ?g A" using `finite A`
   38.85 +  ultimately have "F ?g (A \<inter> B) = F ?g A" using \<open>finite A\<close>
   38.86      by (intro mono_neutral_left) auto
   38.87    then show ?thesis by simp
   38.88  qed
   38.89 @@ -395,7 +395,7 @@
   38.90      and H: "F g (\<Union>B) = (F o F) g B" by auto
   38.91    then have "F g (A \<union> \<Union>B) = F g A * F g (\<Union>B)"
   38.92      by (simp add: union_inter_neutral)
   38.93 -  with `finite B` `A \<notin> B` show ?case
   38.94 +  with \<open>finite B\<close> \<open>A \<notin> B\<close> show ?case
   38.95      by (simp add: H)
   38.96  qed
   38.97  
   38.98 @@ -430,7 +430,7 @@
   38.99    assumes trivial: "\<And>a. a \<in> C - A \<Longrightarrow> g a = 1" "\<And>b. b \<in> C - B \<Longrightarrow> h b = 1"
  38.100    shows "F g A = F h B \<longleftrightarrow> F g C = F h C"
  38.101  proof -
  38.102 -  from `finite C` subset have
  38.103 +  from \<open>finite C\<close> subset have
  38.104      "finite A" and "finite B" and "finite (C - A)" and "finite (C - B)"
  38.105      by (auto elim: finite_subset)
  38.106    from subset have [simp]: "A - (C - A) = A" by auto
  38.107 @@ -438,12 +438,12 @@
  38.108    from subset have "C = A \<union> (C - A)" by auto
  38.109    then have "F g C = F g (A \<union> (C - A))" by simp
  38.110    also have "\<dots> = F g (A - (C - A)) * F g (C - A - A) * F g (A \<inter> (C - A))"
  38.111 -    using `finite A` `finite (C - A)` by (simp only: union_diff2)
  38.112 +    using \<open>finite A\<close> \<open>finite (C - A)\<close> by (simp only: union_diff2)
  38.113    finally have P: "F g C = F g A" using trivial by simp
  38.114    from subset have "C = B \<union> (C - B)" by auto
  38.115    then have "F h C = F h (B \<union> (C - B))" by simp
  38.116    also have "\<dots> = F h (B - (C - B)) * F h (C - B - B) * F h (B \<inter> (C - B))"
  38.117 -    using `finite B` `finite (C - B)` by (simp only: union_diff2)
  38.118 +    using \<open>finite B\<close> \<open>finite (C - B)\<close> by (simp only: union_diff2)
  38.119    finally have Q: "F h C = F h B" using trivial by simp
  38.120    from P Q show ?thesis by simp
  38.121  qed
  38.122 @@ -462,7 +462,7 @@
  38.123  notation Groups.one ("1")
  38.124  
  38.125  
  38.126 -subsection {* Generalized summation over a set *}
  38.127 +subsection \<open>Generalized summation over a set\<close>
  38.128  
  38.129  context comm_monoid_add
  38.130  begin
  38.131 @@ -486,8 +486,8 @@
  38.132  
  38.133  end
  38.134  
  38.135 -text{* Now: lot's of fancy syntax. First, @{term "setsum (%x. e) A"} is
  38.136 -written @{text"\<Sum>x\<in>A. e"}. *}
  38.137 +text\<open>Now: lot's of fancy syntax. First, @{term "setsum (%x. e) A"} is
  38.138 +written @{text"\<Sum>x\<in>A. e"}.\<close>
  38.139  
  38.140  syntax
  38.141    "_setsum" :: "pttrn => 'a set => 'b => 'b::comm_monoid_add"    ("(3SUM _:_./ _)" [0, 51, 10] 10)
  38.142 @@ -496,12 +496,12 @@
  38.143  syntax (HTML output)
  38.144    "_setsum" :: "pttrn => 'a set => 'b => 'b::comm_monoid_add"    ("(2\<Sum>_\<in>_./ _)" [0, 51, 10] 10)
  38.145  
  38.146 -translations -- {* Beware of argument permutation! *}
  38.147 +translations -- \<open>Beware of argument permutation!\<close>
  38.148    "SUM i:A. b" == "CONST setsum (%i. b) A"
  38.149    "\<Sum>i\<in>A. b" == "CONST setsum (%i. b) A"
  38.150  
  38.151 -text{* Instead of @{term"\<Sum>x\<in>{x. P}. e"} we introduce the shorter
  38.152 - @{text"\<Sum>x|P. e"}. *}
  38.153 +text\<open>Instead of @{term"\<Sum>x\<in>{x. P}. e"} we introduce the shorter
  38.154 + @{text"\<Sum>x|P. e"}.\<close>
  38.155  
  38.156  syntax
  38.157    "_qsetsum" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a" ("(3SUM _ |/ _./ _)" [0,0,10] 10)
  38.158 @@ -514,7 +514,7 @@
  38.159    "SUM x|P. t" => "CONST setsum (%x. t) {x. P}"
  38.160    "\<Sum>x|P. t" => "CONST setsum (%x. t) {x. P}"
  38.161  
  38.162 -print_translation {*
  38.163 +print_translation \<open>
  38.164  let
  38.165    fun setsum_tr' [Abs (x, Tx, t), Const (@{const_syntax Collect}, _) $ Abs (y, Ty, P)] =
  38.166          if x <> y then raise Match
  38.167 @@ -528,9 +528,9 @@
  38.168            end
  38.169      | setsum_tr' _ = raise Match;
  38.170  in [(@{const_syntax setsum}, K setsum_tr')] end
  38.171 -*}
  38.172 +\<close>
  38.173  
  38.174 -text {* TODO generalization candidates *}
  38.175 +text \<open>TODO generalization candidates\<close>
  38.176  
  38.177  lemma setsum_image_gen:
  38.178    assumes fS: "finite S"
  38.179 @@ -545,7 +545,7 @@
  38.180  qed
  38.181  
  38.182  
  38.183 -subsubsection {* Properties in more restricted classes of structures *}
  38.184 +subsubsection \<open>Properties in more restricted classes of structures\<close>
  38.185  
  38.186  lemma setsum_Un: "finite A ==> finite B ==>
  38.187    (setsum f (A Un B) :: 'a :: ab_group_add) =
  38.188 @@ -618,15 +618,15 @@
  38.189  proof-
  38.190    from assms(3) obtain a where a: "a:A" "f a < g a" by blast
  38.191    have "setsum f A = setsum f ((A-{a}) \<union> {a})"
  38.192 -    by(simp add:insert_absorb[OF `a:A`])
  38.193 +    by(simp add:insert_absorb[OF \<open>a:A\<close>])
  38.194    also have "\<dots> = setsum f (A-{a}) + setsum f {a}"
  38.195 -    using `finite A` by(subst setsum.union_disjoint) auto
  38.196 +    using \<open>finite A\<close> by(subst setsum.union_disjoint) auto
  38.197    also have "setsum f (A-{a}) \<le> setsum g (A-{a})"
  38.198      by(rule setsum_mono)(simp add: assms(2))
  38.199    also have "setsum f {a} < setsum g {a}" using a by simp
  38.200    also have "setsum g (A - {a}) + setsum g {a} = setsum g((A-{a}) \<union> {a})"
  38.201 -    using `finite A` by(subst setsum.union_disjoint[symmetric]) auto
  38.202 -  also have "\<dots> = setsum g A" by(simp add:insert_absorb[OF `a:A`])
  38.203 +    using \<open>finite A\<close> by(subst setsum.union_disjoint[symmetric]) auto
  38.204 +  also have "\<dots> = setsum g A" by(simp add:insert_absorb[OF \<open>a:A\<close>])
  38.205    finally show ?thesis by (auto simp add: add_right_mono add_strict_left_mono)
  38.206  qed
  38.207  
  38.208 @@ -880,7 +880,7 @@
  38.209  
  38.210  lemma setsum_Un_nat: "finite A ==> finite B ==>
  38.211    (setsum f (A Un B) :: nat) = setsum f A + setsum f B - setsum f (A Int B)"
  38.212 -  -- {* For the natural numbers, we have subtraction. *}
  38.213 +  -- \<open>For the natural numbers, we have subtraction.\<close>
  38.214  by (subst setsum.union_inter [symmetric], auto simp add: algebra_simps)
  38.215  
  38.216  lemma setsum_diff1_nat: "(setsum f (A - {a}) :: nat) =
  38.217 @@ -932,7 +932,7 @@
  38.218    by (induct A rule: infinite_finite_induct) simp_all
  38.219  
  38.220  
  38.221 -subsubsection {* Cardinality as special case of @{const setsum} *}
  38.222 +subsubsection \<open>Cardinality as special case of @{const setsum}\<close>
  38.223  
  38.224  lemma card_eq_setsum:
  38.225    "card A = setsum (\<lambda>x. 1) A"
  38.226 @@ -1008,7 +1008,7 @@
  38.227    by (induct I rule: finite_ne_induct) (auto intro: add_pos_pos)
  38.228  
  38.229  
  38.230 -subsubsection {* Cardinality of products *}
  38.231 +subsubsection \<open>Cardinality of products\<close>
  38.232  
  38.233  lemma card_SigmaI [simp]:
  38.234    "\<lbrakk> finite A; ALL a:A. finite (B a) \<rbrakk>
  38.235 @@ -1029,7 +1029,7 @@
  38.236  by (simp add: card_cartesian_product)
  38.237  
  38.238  
  38.239 -subsection {* Generalized product over a set *}
  38.240 +subsection \<open>Generalized product over a set\<close>
  38.241  
  38.242  context comm_monoid_mult
  38.243  begin
  38.244 @@ -1060,12 +1060,12 @@
  38.245  syntax (HTML output)
  38.246    "_setprod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult"  ("(2\<Prod>_\<in>_./ _)" [0, 51, 10] 10)
  38.247  
  38.248 -translations -- {* Beware of argument permutation! *}
  38.249 +translations -- \<open>Beware of argument permutation!\<close>
  38.250    "PROD i:A. b" == "CONST setprod (%i. b) A" 
  38.251    "\<Prod>i\<in>A. b" == "CONST setprod (%i. b) A" 
  38.252  
  38.253 -text{* Instead of @{term"\<Prod>x\<in>{x. P}. e"} we introduce the shorter
  38.254 - @{text"\<Prod>x|P. e"}. *}
  38.255 +text\<open>Instead of @{term"\<Prod>x\<in>{x. P}. e"} we introduce the shorter
  38.256 + @{text"\<Prod>x|P. e"}.\<close>
  38.257  
  38.258  syntax
  38.259    "_qsetprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a" ("(4PROD _ |/ _./ _)" [0,0,10] 10)
  38.260 @@ -1102,7 +1102,7 @@
  38.261  end
  38.262  
  38.263  
  38.264 -subsubsection {* Properties in more restricted classes of structures *}
  38.265 +subsubsection \<open>Properties in more restricted classes of structures\<close>
  38.266  
  38.267  context comm_semiring_1
  38.268  begin
  38.269 @@ -1111,11 +1111,11 @@
  38.270    assumes "finite A" and "a \<in> A" and "b = f a"
  38.271    shows "b dvd setprod f A"
  38.272  proof -
  38.273 -  from `finite A` have "setprod f (insert a (A - {a})) = f a * setprod f (A - {a})"
  38.274 +  from \<open>finite A\<close> have "setprod f (insert a (A - {a})) = f a * setprod f (A - {a})"
  38.275      by (intro setprod.insert) auto
  38.276 -  also from `a \<in> A` have "insert a (A - {a}) = A" by blast
  38.277 +  also from \<open>a \<in> A\<close> have "insert a (A - {a}) = A" by blast
  38.278    finally have "setprod f A = f a * setprod f (A - {a})" .
  38.279 -  with `b = f a` show ?thesis by simp
  38.280 +  with \<open>b = f a\<close> show ?thesis by simp
  38.281  qed
  38.282  
  38.283  lemma dvd_setprodI [intro]:
  38.284 @@ -1170,7 +1170,7 @@
  38.285      next
  38.286        case False with insert have "a \<in> B" by simp
  38.287        def C \<equiv> "B - {a}"
  38.288 -      with `finite B` `a \<in> B`
  38.289 +      with \<open>finite B\<close> \<open>a \<in> B\<close>
  38.290          have *: "B = insert a C" "finite C" "a \<notin> C" by auto
  38.291        with insert show ?thesis by (auto simp add: insert_commute ac_simps)
  38.292      qed
    39.1 --- a/src/HOL/Groups_List.thy	Sat Jul 18 21:44:18 2015 +0200
    39.2 +++ b/src/HOL/Groups_List.thy	Sat Jul 18 22:58:50 2015 +0200
    39.3 @@ -1,6 +1,6 @@
    39.4  (* Author: Tobias Nipkow, TU Muenchen *)
    39.5  
    39.6 -section {* Sum and product over lists *}
    39.7 +section \<open>Sum and product over lists\<close>
    39.8  
    39.9  theory Groups_List
   39.10  imports List
   39.11 @@ -56,7 +56,7 @@
   39.12  notation Groups.one ("1")
   39.13  
   39.14  
   39.15 -subsection {* List summation *}
   39.16 +subsection \<open>List summation\<close>
   39.17  
   39.18  context monoid_add
   39.19  begin
   39.20 @@ -101,7 +101,7 @@
   39.21  
   39.22  end
   39.23  
   39.24 -text {* Some syntactic sugar for summing a function over a list: *}
   39.25 +text \<open>Some syntactic sugar for summing a function over a list:\<close>
   39.26  
   39.27  syntax
   39.28    "_listsum" :: "pttrn => 'a list => 'b => 'b"    ("(3SUM _<-_. _)" [0, 51, 10] 10)
   39.29 @@ -110,11 +110,11 @@
   39.30  syntax (HTML output)
   39.31    "_listsum" :: "pttrn => 'a list => 'b => 'b"    ("(3\<Sum>_\<leftarrow>_. _)" [0, 51, 10] 10)
   39.32  
   39.33 -translations -- {* Beware of argument permutation! *}
   39.34 +translations -- \<open>Beware of argument permutation!\<close>
   39.35    "SUM x<-xs. b" == "CONST listsum (CONST map (%x. b) xs)"
   39.36    "\<Sum>x\<leftarrow>xs. b" == "CONST listsum (CONST map (%x. b) xs)"
   39.37  
   39.38 -text {* TODO duplicates *}
   39.39 +text \<open>TODO duplicates\<close>
   39.40  lemmas listsum_simps = listsum.Nil listsum.Cons
   39.41  lemmas listsum_append = listsum.append
   39.42  lemmas listsum_rev = listsum.rev
   39.43 @@ -190,7 +190,7 @@
   39.44    "(\<Sum>x\<leftarrow>xs. 0) = 0"
   39.45    by (induct xs) (simp_all add: distrib_right)
   39.46  
   39.47 -text{* For non-Abelian groups @{text xs} needs to be reversed on one side: *}
   39.48 +text\<open>For non-Abelian groups @{text xs} needs to be reversed on one side:\<close>
   39.49  lemma (in ab_group_add) uminus_listsum_map:
   39.50    "- listsum (map f xs) = listsum (map (uminus \<circ> f) xs)"
   39.51    by (induct xs) simp_all
   39.52 @@ -232,7 +232,7 @@
   39.53    "listsum (map f [k..l]) = setsum f (set [k..l])"
   39.54    by (simp add: listsum_distinct_conv_setsum_set)
   39.55  
   39.56 -text {* General equivalence between @{const listsum} and @{const setsum} *}
   39.57 +text \<open>General equivalence between @{const listsum} and @{const setsum}\<close>
   39.58  lemma (in monoid_add) listsum_setsum_nth:
   39.59    "listsum xs = (\<Sum> i = 0 ..< length xs. xs ! i)"
   39.60    using interv_listsum_conv_setsum_set_nat [of "op ! xs" 0 "length xs"] by (simp add: map_nth)
   39.61 @@ -245,14 +245,14 @@
   39.62    proof cases
   39.63      assume "x \<in> set xs"
   39.64      have "?l = f x + (\<Sum>x\<in>set xs. count_list xs x * f x)" by (simp add: Cons.IH)
   39.65 -    also have "set xs = insert x (set xs - {x})" using `x \<in> set xs`by blast
   39.66 +    also have "set xs = insert x (set xs - {x})" using \<open>x \<in> set xs\<close>by blast
   39.67      also have "f x + (\<Sum>x\<in>insert x (set xs - {x}). count_list xs x * f x) = ?r"
   39.68        by (simp add: setsum.insert_remove eq_commute)
   39.69      finally show ?thesis .
   39.70    next
   39.71      assume "x \<notin> set xs"
   39.72      hence "\<And>xa. xa \<in> set xs \<Longrightarrow> x \<noteq> xa" by blast
   39.73 -    thus ?thesis by (simp add: Cons.IH `x \<notin> set xs`)
   39.74 +    thus ?thesis by (simp add: Cons.IH \<open>x \<notin> set xs\<close>)
   39.75    qed
   39.76  qed simp
   39.77  
   39.78 @@ -270,7 +270,7 @@
   39.79  qed
   39.80  
   39.81  
   39.82 -subsection {* Further facts about @{const List.n_lists} *}
   39.83 +subsection \<open>Further facts about @{const List.n_lists}\<close>
   39.84  
   39.85  lemma length_n_lists: "length (List.n_lists n xs) = length xs ^ n"
   39.86    by (induct n) (auto simp add: comp_def length_concat listsum_triv)
   39.87 @@ -298,7 +298,7 @@
   39.88  qed
   39.89  
   39.90  
   39.91 -subsection {* Tools setup *}
   39.92 +subsection \<open>Tools setup\<close>
   39.93  
   39.94  lemmas setsum_code = setsum.set_conv_list
   39.95  
   39.96 @@ -325,7 +325,7 @@
   39.97  end
   39.98  
   39.99  
  39.100 -subsection {* List product *}
  39.101 +subsection \<open>List product\<close>
  39.102  
  39.103  context monoid_mult
  39.104  begin
  39.105 @@ -370,7 +370,7 @@
  39.106  
  39.107  end
  39.108  
  39.109 -text {* Some syntactic sugar: *}
  39.110 +text \<open>Some syntactic sugar:\<close>
  39.111  
  39.112  syntax
  39.113    "_listprod" :: "pttrn => 'a list => 'b => 'b"    ("(3PROD _<-_. _)" [0, 51, 10] 10)
  39.114 @@ -379,7 +379,7 @@
  39.115  syntax (HTML output)
  39.116    "_listprod" :: "pttrn => 'a list => 'b => 'b"    ("(3\<Prod>_\<leftarrow>_. _)" [0, 51, 10] 10)
  39.117  
  39.118 -translations -- {* Beware of argument permutation! *}
  39.119 +translations -- \<open>Beware of argument permutation!\<close>
  39.120    "PROD x<-xs. b" == "CONST listprod (CONST map (%x. b) xs)"
  39.121    "\<Prod>x\<leftarrow>xs. b" == "CONST listprod (CONST map (%x. b) xs)"
  39.122  
    40.1 --- a/src/HOL/HOL.thy	Sat Jul 18 21:44:18 2015 +0200
    40.2 +++ b/src/HOL/HOL.thy	Sat Jul 18 22:58:50 2015 +0200
    40.3 @@ -2,7 +2,7 @@
    40.4      Author:     Tobias Nipkow, Markus Wenzel, and Larry Paulson
    40.5  *)
    40.6  
    40.7 -section {* The basis of Higher-Order Logic *}
    40.8 +section \<open>The basis of Higher-Order Logic\<close>
    40.9  
   40.10  theory HOL
   40.11  imports Pure "~~/src/Tools/Code_Generator"
   40.12 @@ -53,13 +53,13 @@
   40.13  \<close>
   40.14  
   40.15  
   40.16 -subsection {* Primitive logic *}
   40.17 +subsection \<open>Primitive logic\<close>
   40.18  
   40.19 -subsubsection {* Core syntax *}
   40.20 +subsubsection \<open>Core syntax\<close>
   40.21  
   40.22 -setup {* Axclass.class_axiomatization (@{binding type}, []) *}
   40.23 +setup \<open>Axclass.class_axiomatization (@{binding type}, [])\<close>
   40.24  default_sort type
   40.25 -setup {* Object_Logic.add_base_sort @{sort type} *}
   40.26 +setup \<open>Object_Logic.add_base_sort @{sort type}\<close>
   40.27  
   40.28  axiomatization where fun_arity: "OFCLASS('a \<Rightarrow> 'b, type_class)"
   40.29  instance "fun" :: (type, type) type by (rule fun_arity)
   40.30 @@ -90,7 +90,7 @@
   40.31    Ex1           :: "('a => bool) => bool"           (binder "EX! " 10)
   40.32  
   40.33  
   40.34 -subsubsection {* Additional concrete syntax *}
   40.35 +subsubsection \<open>Additional concrete syntax\<close>
   40.36  
   40.37  notation (output)
   40.38    eq  (infix "=" 50)
   40.39 @@ -127,11 +127,11 @@
   40.40  
   40.41  syntax "_The" :: "[pttrn, bool] => 'a"  ("(3THE _./ _)" [0, 10] 10)
   40.42  translations "THE x. P" == "CONST The (%x. P)"
   40.43 -print_translation {*
   40.44 +print_translation \<open>
   40.45    [(@{const_syntax The}, fn _ => fn [Abs abs] =>
   40.46        let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
   40.47        in Syntax.const @{syntax_const "_The"} $ x $ t end)]
   40.48 -*}  -- {* To avoid eta-contraction of body *}
   40.49 +\<close>  -- \<open>To avoid eta-contraction of body\<close>
   40.50  
   40.51  nonterminal letbinds and letbind
   40.52  syntax
   40.53 @@ -165,15 +165,15 @@
   40.54    Ex1  (binder "?! " 10)
   40.55  
   40.56  
   40.57 -subsubsection {* Axioms and basic definitions *}
   40.58 +subsubsection \<open>Axioms and basic definitions\<close>
   40.59  
   40.60  axiomatization where
   40.61    refl: "t = (t::'a)" and
   40.62    subst: "s = t \<Longrightarrow> P s \<Longrightarrow> P t" and
   40.63    ext: "(!!x::'a. (f x ::'b) = g x) ==> (%x. f x) = (%x. g x)"
   40.64 -    -- {*Extensionality is built into the meta-logic, and this rule expresses
   40.65 +    -- \<open>Extensionality is built into the meta-logic, and this rule expresses
   40.66           a related property.  It is an eta-expanded version of the traditional
   40.67 -         rule, and similar to the ABS rule of HOL*} and
   40.68 +         rule, and similar to the ABS rule of HOL\<close> and
   40.69  
   40.70    the_eq_trivial: "(THE x. x = a) = (a::'a)"
   40.71  
   40.72 @@ -209,9 +209,9 @@
   40.73  class default = fixes default :: 'a
   40.74  
   40.75  
   40.76 -subsection {* Fundamental rules *}
   40.77 +subsection \<open>Fundamental rules\<close>
   40.78  
   40.79 -subsubsection {* Equality *}
   40.80 +subsubsection \<open>Equality\<close>
   40.81  
   40.82  lemma sym: "s = t ==> t = s"
   40.83    by (erule subst) (rule refl)
   40.84 @@ -230,7 +230,7 @@
   40.85    shows "A = B"
   40.86    by (unfold meq) (rule refl)
   40.87  
   40.88 -text {* Useful with @{text erule} for proving equalities from known equalities. *}
   40.89 +text \<open>Useful with @{text erule} for proving equalities from known equalities.\<close>
   40.90       (* a = b
   40.91          |   |
   40.92          c = d   *)
   40.93 @@ -241,7 +241,7 @@
   40.94  apply assumption+
   40.95  done
   40.96  
   40.97 -text {* For calculational reasoning: *}
   40.98 +text \<open>For calculational reasoning:\<close>
   40.99  
  40.100  lemma forw_subst: "a = b ==> P b ==> P a"
  40.101    by (rule ssubst)
  40.102 @@ -250,15 +250,15 @@
  40.103    by (rule subst)
  40.104  
  40.105  
  40.106 -subsubsection {* Congruence rules for application *}
  40.107 +subsubsection \<open>Congruence rules for application\<close>
  40.108  
  40.109 -text {* Similar to @{text AP_THM} in Gordon's HOL. *}
  40.110 +text \<open>Similar to @{text AP_THM} in Gordon's HOL.\<close>
  40.111  lemma fun_cong: "(f::'a=>'b) = g ==> f(x)=g(x)"
  40.112  apply (erule subst)
  40.113  apply (rule refl)
  40.114  done
  40.115  
  40.116 -text {* Similar to @{text AP_TERM} in Gordon's HOL and FOL's @{text subst_context}. *}
  40.117 +text \<open>Similar to @{text AP_TERM} in Gordon's HOL and FOL's @{text subst_context}.\<close>
  40.118  lemma arg_cong: "x=y ==> f(x)=f(y)"
  40.119  apply (erule subst)
  40.120  apply (rule refl)
  40.121 @@ -274,10 +274,10 @@
  40.122  apply (rule refl)
  40.123  done
  40.124  
  40.125 -ML {* fun cong_tac ctxt = Cong_Tac.cong_tac ctxt @{thm cong} *}
  40.126 +ML \<open>fun cong_tac ctxt = Cong_Tac.cong_tac ctxt @{thm cong}\<close>
  40.127  
  40.128  
  40.129 -subsubsection {* Equality of booleans -- iff *}
  40.130 +subsubsection \<open>Equality of booleans -- iff\<close>
  40.131  
  40.132  lemma iffI: assumes "P ==> Q" and "Q ==> P" shows "P=Q"
  40.133    by (iprover intro: iff [THEN mp, THEN mp] impI assms)
  40.134 @@ -301,7 +301,7 @@
  40.135    by (iprover intro: minor impI major [THEN iffD2] major [THEN iffD1])
  40.136  
  40.137  
  40.138 -subsubsection {*True*}
  40.139 +subsubsection \<open>True\<close>
  40.140  
  40.141  lemma TrueI: "True"
  40.142    unfolding True_def by (rule refl)
  40.143 @@ -313,7 +313,7 @@
  40.144    by (erule iffD2) (rule TrueI)
  40.145  
  40.146  
  40.147 -subsubsection {*Universal quantifier*}
  40.148 +subsubsection \<open>Universal quantifier\<close>
  40.149  
  40.150  lemma allI: assumes "!!x::'a. P(x)" shows "ALL x. P(x)"
  40.151    unfolding All_def by (iprover intro: ext eqTrueI assms)
  40.152 @@ -337,12 +337,12 @@
  40.153    by (iprover intro: minor major major [THEN spec])
  40.154  
  40.155  
  40.156 -subsubsection {* False *}
  40.157 +subsubsection \<open>False\<close>
  40.158  
  40.159 -text {*
  40.160 +text \<open>
  40.161    Depends upon @{text spec}; it is impossible to do propositional
  40.162    logic before quantifiers!
  40.163 -*}
  40.164 +\<close>
  40.165  
  40.166  lemma FalseE: "False ==> P"
  40.167    apply (unfold False_def)
  40.168 @@ -353,7 +353,7 @@
  40.169    by (erule eqTrueE [THEN FalseE])
  40.170  
  40.171  
  40.172 -subsubsection {* Negation *}
  40.173 +subsubsection \<open>Negation\<close>
  40.174  
  40.175  lemma notI:
  40.176    assumes "P ==> False"
  40.177 @@ -383,7 +383,7 @@
  40.178    by (erule notE [THEN notI]) (erule meta_mp)
  40.179  
  40.180  
  40.181 -subsubsection {*Implication*}
  40.182 +subsubsection \<open>Implication\<close>
  40.183  
  40.184  lemma impE:
  40.185    assumes "P-->Q" "P" "Q ==> R"
  40.186 @@ -414,7 +414,7 @@
  40.187    by (erule subst, erule ssubst, assumption)
  40.188  
  40.189  
  40.190 -subsubsection {*Existential quantifier*}
  40.191 +subsubsection \<open>Existential quantifier\<close>
  40.192  
  40.193  lemma exI: "P x ==> EX x::'a. P x"
  40.194  apply (unfold Ex_def)
  40.195 @@ -430,7 +430,7 @@
  40.196  done
  40.197  
  40.198  
  40.199 -subsubsection {*Conjunction*}
  40.200 +subsubsection \<open>Conjunction\<close>
  40.201  
  40.202  lemma conjI: "[| P; Q |] ==> P&Q"
  40.203  apply (unfold and_def)
  40.204 @@ -461,7 +461,7 @@
  40.205  by (iprover intro: conjI assms)
  40.206  
  40.207  
  40.208 -subsubsection {*Disjunction*}
  40.209 +subsubsection \<open>Disjunction\<close>
  40.210  
  40.211  lemma disjI1: "P ==> P|Q"
  40.212  apply (unfold or_def)
  40.213 @@ -482,7 +482,7 @@
  40.214                   major [unfolded or_def, THEN spec, THEN mp, THEN mp])
  40.215  
  40.216  
  40.217 -subsubsection {*Classical logic*}
  40.218 +subsubsection \<open>Classical logic\<close>
  40.219  
  40.220  lemma classical:
  40.221    assumes prem: "~P ==> P"
  40.222 @@ -520,14 +520,14 @@
  40.223  by (iprover intro: classical p1 p2 notE)
  40.224  
  40.225  
  40.226 -subsubsection {*Unique existence*}
  40.227 +subsubsection \<open>Unique existence\<close>
  40.228  
  40.229  lemma ex1I:
  40.230    assumes "P a" "!!x. P(x) ==> x=a"
  40.231    shows "EX! x. P(x)"
  40.232  by (unfold Ex1_def, iprover intro: assms exI conjI allI impI)
  40.233  
  40.234 -text{*Sometimes easier to use: the premises have no shared variables.  Safe!*}
  40.235 +text\<open>Sometimes easier to use: the premises have no shared variables.  Safe!\<close>
  40.236  lemma ex_ex1I:
  40.237    assumes ex_prem: "EX x. P(x)"
  40.238        and eq: "!!x y. [| P(x); P(y) |] ==> x=y"
  40.239 @@ -550,7 +550,7 @@
  40.240  done
  40.241  
  40.242  
  40.243 -subsubsection {*Classical intro rules for disjunction and existential quantifiers*}
  40.244 +subsubsection \<open>Classical intro rules for disjunction and existential quantifiers\<close>
  40.245  
  40.246  lemma disjCI:
  40.247    assumes "~Q ==> P" shows "P|Q"
  40.248 @@ -561,10 +561,10 @@
  40.249  lemma excluded_middle: "~P | P"
  40.250  by (iprover intro: disjCI)
  40.251  
  40.252 -text {*
  40.253 +text \<open>
  40.254    case distinction as a natural deduction rule.
  40.255    Note that @{term "~P"} is the second case, not the first
  40.256 -*}
  40.257 +\<close>
  40.258  lemma case_split [case_names True False]:
  40.259    assumes prem1: "P ==> Q"
  40.260        and prem2: "~P ==> Q"
  40.261 @@ -611,7 +611,7 @@
  40.262  done
  40.263  
  40.264  
  40.265 -subsubsection {* Intuitionistic Reasoning *}
  40.266 +subsubsection \<open>Intuitionistic Reasoning\<close>
  40.267  
  40.268  lemma impE':
  40.269    assumes 1: "P --> Q"
  40.270 @@ -655,7 +655,7 @@
  40.271    and [Pure.elim?] = iffD1 iffD2 impE
  40.272  
  40.273  
  40.274 -subsubsection {* Atomizing meta-level connectives *}
  40.275 +subsubsection \<open>Atomizing meta-level connectives\<close>
  40.276  
  40.277  axiomatization where
  40.278    eq_reflection: "x = y \<Longrightarrow> x \<equiv> y" (*admissible axiom*)
  40.279 @@ -690,7 +690,7 @@
  40.280  lemma atomize_eq [atomize, code]: "(x == y) == Trueprop (x = y)"
  40.281  proof
  40.282    assume "x == y"
  40.283 -  show "x = y" by (unfold `x == y`) (rule refl)
  40.284 +  show "x = y" by (unfold \<open>x == y\<close>) (rule refl)
  40.285  next
  40.286    assume "x = y"
  40.287    then show "x == y" by (rule eq_reflection)
  40.288 @@ -717,7 +717,7 @@
  40.289    and [symmetric, defn] = atomize_all atomize_imp atomize_eq
  40.290  
  40.291  
  40.292 -subsubsection {* Atomizing elimination rules *}
  40.293 +subsubsection \<open>Atomizing elimination rules\<close>
  40.294  
  40.295  lemma atomize_exL[atomize_elim]: "(!!x. P x ==> Q) == ((EX x. P x) ==> Q)"
  40.296    by rule iprover+
  40.297 @@ -731,23 +731,23 @@
  40.298  lemma atomize_elimL[atomize_elim]: "(!!B. (A ==> B) ==> B) == Trueprop A" ..
  40.299  
  40.300  
  40.301 -subsection {* Package setup *}
  40.302 +subsection \<open>Package setup\<close>
  40.303  
  40.304  ML_file "Tools/hologic.ML"
  40.305  
  40.306  
  40.307 -subsubsection {* Sledgehammer setup *}
  40.308 +subsubsection \<open>Sledgehammer setup\<close>
  40.309  
  40.310 -text {*
  40.311 +text \<open>
  40.312  Theorems blacklisted to Sledgehammer. These theorems typically produce clauses
  40.313  that are prolific (match too many equality or membership literals) and relate to
  40.314  seldom-used facts. Some duplicate other rules.
  40.315 -*}
  40.316 +\<close>
  40.317  
  40.318  named_theorems no_atp "theorems that should be filtered out by Sledgehammer"
  40.319  
  40.320  
  40.321 -subsubsection {* Classical Reasoner setup *}
  40.322 +subsubsection \<open>Classical Reasoner setup\<close>
  40.323  
  40.324  lemma imp_elim: "P --> Q ==> (~ R ==> P) ==> (Q ==> R) ==> R"
  40.325    by (rule classical) iprover
  40.326 @@ -758,7 +758,7 @@
  40.327  lemma thin_refl:
  40.328    "\<And>X. \<lbrakk> x=x; PROP W \<rbrakk> \<Longrightarrow> PROP W" .
  40.329  
  40.330 -ML {*
  40.331 +ML \<open>
  40.332  structure Hypsubst = Hypsubst
  40.333  (
  40.334    val dest_eq = HOLogic.dest_eq
  40.335 @@ -786,9 +786,9 @@
  40.336  
  40.337  structure Basic_Classical: BASIC_CLASSICAL = Classical;
  40.338  open Basic_Classical;
  40.339 -*}
  40.340 +\<close>
  40.341  
  40.342 -setup {*
  40.343 +setup \<open>
  40.344    (*prevent substitution on bool*)
  40.345    let
  40.346      fun non_bool_eq (@{const_name HOL.eq}, Type (_, [T, _])) = T <> @{typ bool}
  40.347 @@ -801,7 +801,7 @@
  40.348    in
  40.349      Context_Rules.addSWrapper (fn ctxt => fn tac => hyp_subst_tac' ctxt ORELSE' tac)
  40.350    end
  40.351 -*}
  40.352 +\<close>
  40.353  
  40.354  declare iffI [intro!]
  40.355    and notI [intro!]
  40.356 @@ -824,7 +824,7 @@
  40.357  declare exE [elim!]
  40.358    allE [elim]
  40.359  
  40.360 -ML {* val HOL_cs = claset_of @{context} *}
  40.361 +ML \<open>val HOL_cs = claset_of @{context}\<close>
  40.362  
  40.363  lemma contrapos_np: "~ Q ==> (~ P ==> Q) ==> P"
  40.364    apply (erule swap)
  40.365 @@ -848,11 +848,11 @@
  40.366  apply (rule prem)
  40.367  apply assumption
  40.368  apply (rule allI)+
  40.369 -apply (tactic {* eresolve_tac @{context} [Classical.dup_elim @{context} @{thm allE}] 1 *})
  40.370 +apply (tactic \<open>eresolve_tac @{context} [Classical.dup_elim @{context} @{thm allE}] 1\<close>)
  40.371  apply iprover
  40.372  done
  40.373  
  40.374 -ML {*
  40.375 +ML \<open>
  40.376    structure Blast = Blast
  40.377    (
  40.378      structure Classical = Classical
  40.379 @@ -864,10 +864,10 @@
  40.380      val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
  40.381    );
  40.382    val blast_tac = Blast.blast_tac;
  40.383 -*}
  40.384 +\<close>
  40.385  
  40.386  
  40.387 -subsubsection {*THE: definite description operator*}
  40.388 +subsubsection \<open>THE: definite description operator\<close>
  40.389  
  40.390  lemma the_equality [intro]:
  40.391    assumes "P a"
  40.392 @@ -900,7 +900,7 @@
  40.393    by blast
  40.394  
  40.395  
  40.396 -subsubsection {* Simplifier *}
  40.397 +subsubsection \<open>Simplifier\<close>
  40.398  
  40.399  lemma eta_contract_eq: "(%s. f s) = f" ..
  40.400  
  40.401 @@ -980,7 +980,7 @@
  40.402  lemma imp_conjL: "((P&Q) -->R)  = (P --> (Q --> R))" by iprover
  40.403  lemma imp_disjL: "((P|Q) --> R) = ((P-->R)&(Q-->R))" by iprover
  40.404  
  40.405 -text {* These two are specialized, but @{text imp_disj_not1} is useful in @{text "Auth/Yahalom"}. *}
  40.406 +text \<open>These two are specialized, but @{text imp_disj_not1} is useful in @{text "Auth/Yahalom"}.\<close>
  40.407  lemma imp_disj_not1: "(P --> Q | R) = (~Q --> P --> R)" by blast
  40.408  lemma imp_disj_not2: "(P --> Q | R) = (~R --> P --> Q)" by blast
  40.409  
  40.410 @@ -995,7 +995,7 @@
  40.411  lemma not_imp: "(~(P --> Q)) = (P & ~Q)" by blast
  40.412  lemma not_iff: "(P~=Q) = (P = (~Q))" by blast
  40.413  lemma disj_not1: "(~P | Q) = (P --> Q)" by blast
  40.414 -lemma disj_not2: "(P | ~Q) = (Q --> P)"  -- {* changes orientation :-( *}
  40.415 +lemma disj_not2: "(P | ~Q) = (Q --> P)"  -- \<open>changes orientation :-(\<close>
  40.416    by blast
  40.417  lemma imp_conv_disj: "(P --> Q) = ((~P) | Q)" by blast
  40.418  
  40.419 @@ -1003,8 +1003,8 @@
  40.420  
  40.421  
  40.422  lemma cases_simp: "((P --> Q) & (~P --> Q)) = Q"
  40.423 -  -- {* Avoids duplication of subgoals after @{text split_if}, when the true and false *}
  40.424 -  -- {* cases boil down to the same thing. *}
  40.425 +  -- \<open>Avoids duplication of subgoals after @{text split_if}, when the true and false\<close>
  40.426 +  -- \<open>cases boil down to the same thing.\<close>
  40.427    by blast
  40.428  
  40.429  lemma not_all: "(~ (! x. P(x))) = (? x.~P(x))" by blast
  40.430 @@ -1018,9 +1018,9 @@
  40.431  lemma ex_disj_distrib: "(? x. P(x) | Q(x)) = ((? x. P(x)) | (? x. Q(x)))" by iprover
  40.432  lemma all_conj_distrib: "(!x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))" by iprover
  40.433  
  40.434 -text {*
  40.435 +text \<open>
  40.436    \medskip The @{text "&"} congruence rule: not included by default!
  40.437 -  May slow rewrite proofs down by as much as 50\% *}
  40.438 +  May slow rewrite proofs down by as much as 50\%\<close>
  40.439  
  40.440  lemma conj_cong:
  40.441      "(P = P') ==> (P' ==> (Q = Q')) ==> ((P & Q) = (P' & Q'))"
  40.442 @@ -1030,14 +1030,14 @@
  40.443      "(Q = Q') ==> (Q' ==> (P = P')) ==> ((P & Q) = (P' & Q'))"
  40.444    by iprover
  40.445  
  40.446 -text {* The @{text "|"} congruence rule: not included by default! *}
  40.447 +text \<open>The @{text "|"} congruence rule: not included by default!\<close>
  40.448  
  40.449  lemma disj_cong:
  40.450      "(P = P') ==> (~P' ==> (Q = Q')) ==> ((P | Q) = (P' | Q'))"
  40.451    by blast
  40.452  
  40.453  
  40.454 -text {* \medskip if-then-else rules *}
  40.455 +text \<open>\medskip if-then-else rules\<close>
  40.456  
  40.457  lemma if_True [code]: "(if True then x else y) = x"
  40.458    by (unfold If_def) blast
  40.459 @@ -1070,17 +1070,17 @@
  40.460  
  40.461  lemma if_bool_eq_conj:
  40.462  "(if P then Q else R) = ((P-->Q) & (~P-->R))"
  40.463 -  -- {* This form is useful for expanding @{text "if"}s on the RIGHT of the @{text "==>"} symbol. *}
  40.464 +  -- \<open>This form is useful for expanding @{text "if"}s on the RIGHT of the @{text "==>"} symbol.\<close>
  40.465    by (rule split_if)
  40.466  
  40.467  lemma if_bool_eq_disj: "(if P then Q else R) = ((P&Q) | (~P&R))"
  40.468 -  -- {* And this form is useful for expanding @{text "if"}s on the LEFT. *}
  40.469 +  -- \<open>And this form is useful for expanding @{text "if"}s on the LEFT.\<close>
  40.470    by (simplesubst split_if) blast
  40.471  
  40.472  lemma Eq_TrueI: "P ==> P == True" by (unfold atomize_eq) iprover
  40.473  lemma Eq_FalseI: "~P ==> P == False" by (unfold atomize_eq) iprover
  40.474  
  40.475 -text {* \medskip let rules for simproc *}
  40.476 +text \<open>\medskip let rules for simproc\<close>
  40.477  
  40.478  lemma Let_folded: "f x \<equiv> g x \<Longrightarrow>  Let x f \<equiv> Let x g"
  40.479    by (unfold Let_def)
  40.480 @@ -1088,11 +1088,11 @@
  40.481  lemma Let_unfold: "f x \<equiv> g \<Longrightarrow>  Let x f \<equiv> g"
  40.482    by (unfold Let_def)
  40.483  
  40.484 -text {*
  40.485 +text \<open>
  40.486    The following copy of the implication operator is useful for
  40.487    fine-tuning congruence rules.  It instructs the simplifier to simplify
  40.488    its premise.
  40.489 -*}
  40.490 +\<close>
  40.491  
  40.492  definition simp_implies :: "[prop, prop] => prop"  (infixr "=simp=>" 1) where
  40.493    "simp_implies \<equiv> op ==>"
  40.494 @@ -1159,19 +1159,19 @@
  40.495    by blast
  40.496  
  40.497  ML_file "Tools/simpdata.ML"
  40.498 -ML {* open Simpdata *}
  40.499 +ML \<open>open Simpdata\<close>
  40.500  
  40.501 -setup {*
  40.502 +setup \<open>
  40.503    map_theory_simpset (put_simpset HOL_basic_ss) #>
  40.504    Simplifier.method_setup Splitter.split_modifiers
  40.505 -*}
  40.506 +\<close>
  40.507  
  40.508 -simproc_setup defined_Ex ("EX x. P x") = {* fn _ => Quantifier1.rearrange_ex *}
  40.509 -simproc_setup defined_All ("ALL x. P x") = {* fn _ => Quantifier1.rearrange_all *}
  40.510 +simproc_setup defined_Ex ("EX x. P x") = \<open>fn _ => Quantifier1.rearrange_ex\<close>
  40.511 +simproc_setup defined_All ("ALL x. P x") = \<open>fn _ => Quantifier1.rearrange_all\<close>
  40.512  
  40.513 -text {* Simproc for proving @{text "(y = x) == False"} from premise @{text "~(x = y)"}: *}
  40.514 +text \<open>Simproc for proving @{text "(y = x) == False"} from premise @{text "~(x = y)"}:\<close>
  40.515  
  40.516 -simproc_setup neq ("x = y") = {* fn _ =>
  40.517 +simproc_setup neq ("x = y") = \<open>fn _ =>
  40.518  let
  40.519    val neq_to_EQ_False = @{thm not_sym} RS @{thm Eq_FalseI};
  40.520    fun is_neq eq lhs rhs thm =
  40.521 @@ -1188,9 +1188,9 @@
  40.522          | NONE => NONE)
  40.523       | _ => NONE);
  40.524  in proc end;
  40.525 -*}
  40.526 +\<close>
  40.527  
  40.528 -simproc_setup let_simp ("Let x f") = {*
  40.529 +simproc_setup let_simp ("Let x f") = \<open>
  40.530  let
  40.531    val (f_Let_unfold, x_Let_unfold) =
  40.532      let val [(_ $ (f $ x) $ _)] = Thm.prems_of @{thm Let_unfold}
  40.533 @@ -1253,7 +1253,7 @@
  40.534                end
  40.535            | _ => NONE)
  40.536        end
  40.537 -end *}
  40.538 +end\<close>
  40.539  
  40.540  lemma True_implies_equals: "(True \<Longrightarrow> PROP P) \<equiv> PROP P"
  40.541  proof
  40.542 @@ -1283,7 +1283,7 @@
  40.543    "!!P Q. (EX x. P | Q x)   = (P | (EX x. Q x))"
  40.544    "!!P Q. (EX x. P x --> Q) = ((ALL x. P x) --> Q)"
  40.545    "!!P Q. (EX x. P --> Q x) = (P --> (EX x. Q x))"
  40.546 -  -- {* Miniscoping: pushing in existential quantifiers. *}
  40.547 +  -- \<open>Miniscoping: pushing in existential quantifiers.\<close>
  40.548    by (iprover | blast)+
  40.549  
  40.550  lemma all_simps:
  40.551 @@ -1293,7 +1293,7 @@
  40.552    "!!P Q. (ALL x. P | Q x)   = (P | (ALL x. Q x))"
  40.553    "!!P Q. (ALL x. P x --> Q) = ((EX x. P x) --> Q)"
  40.554    "!!P Q. (ALL x. P --> Q x) = (P --> (ALL x. Q x))"
  40.555 -  -- {* Miniscoping: pushing in universal quantifiers. *}
  40.556 +  -- \<open>Miniscoping: pushing in universal quantifiers.\<close>
  40.557    by (iprover | blast)+
  40.558  
  40.559  lemmas [simp] =
  40.560 @@ -1330,9 +1330,9 @@
  40.561  lemmas [cong] = imp_cong simp_implies_cong
  40.562  lemmas [split] = split_if
  40.563  
  40.564 -ML {* val HOL_ss = simpset_of @{context} *}
  40.565 +ML \<open>val HOL_ss = simpset_of @{context}\<close>
  40.566  
  40.567 -text {* Simplifies x assuming c and y assuming ~c *}
  40.568 +text \<open>Simplifies x assuming c and y assuming ~c\<close>
  40.569  lemma if_cong:
  40.570    assumes "b = c"
  40.571        and "c \<Longrightarrow> x = u"
  40.572 @@ -1340,20 +1340,20 @@
  40.573    shows "(if b then x else y) = (if c then u else v)"
  40.574    using assms by simp
  40.575  
  40.576 -text {* Prevents simplification of x and y:
  40.577 -  faster and allows the execution of functional programs. *}
  40.578 +text \<open>Prevents simplification of x and y:
  40.579 +  faster and allows the execution of functional programs.\<close>
  40.580  lemma if_weak_cong [cong]:
  40.581    assumes "b = c"
  40.582    shows "(if b then x else y) = (if c then x else y)"
  40.583    using assms by (rule arg_cong)
  40.584  
  40.585 -text {* Prevents simplification of t: much faster *}
  40.586 +text \<open>Prevents simplification of t: much faster\<close>
  40.587  lemma let_weak_cong:
  40.588    assumes "a = b"
  40.589    shows "(let x = a in t x) = (let x = b in t x)"
  40.590    using assms by (rule arg_cong)
  40.591  
  40.592 -text {* To tidy up the result of a simproc.  Only the RHS will be simplified. *}
  40.593 +text \<open>To tidy up the result of a simproc.  Only the RHS will be simplified.\<close>
  40.594  lemma eq_cong2:
  40.595    assumes "u = u'"
  40.596    shows "(t \<equiv> u) \<equiv> (t \<equiv> u')"
  40.597 @@ -1363,23 +1363,23 @@
  40.598    "f (if c then x else y) = (if c then f x else f y)"
  40.599    by simp
  40.600  
  40.601 -text{*As a simplification rule, it replaces all function equalities by
  40.602 -  first-order equalities.*}
  40.603 +text\<open>As a simplification rule, it replaces all function equalities by
  40.604 +  first-order equalities.\<close>
  40.605  lemma fun_eq_iff: "f = g \<longleftrightarrow> (\<forall>x. f x = g x)"
  40.606    by auto
  40.607  
  40.608  
  40.609 -subsubsection {* Generic cases and induction *}
  40.610 +subsubsection \<open>Generic cases and induction\<close>
  40.611  
  40.612 -text {* Rule projections: *}
  40.613 -ML {*
  40.614 +text \<open>Rule projections:\<close>
  40.615 +ML \<open>
  40.616  structure Project_Rule = Project_Rule
  40.617  (
  40.618    val conjunct1 = @{thm conjunct1}
  40.619    val conjunct2 = @{thm conjunct2}
  40.620    val mp = @{thm mp}
  40.621  );
  40.622 -*}
  40.623 +\<close>
  40.624  
  40.625  context
  40.626  begin
  40.627 @@ -1435,10 +1435,10 @@
  40.628  lemma induct_trueI: "induct_true"
  40.629    by (simp add: induct_true_def)
  40.630  
  40.631 -text {* Method setup. *}
  40.632 +text \<open>Method setup.\<close>
  40.633  
  40.634  ML_file "~~/src/Tools/induct.ML"
  40.635 -ML {*
  40.636 +ML \<open>
  40.637  structure Induct = Induct
  40.638  (
  40.639    val cases_default = @{thm case_split}
  40.640 @@ -1450,11 +1450,11 @@
  40.641      | dest_def _ = NONE
  40.642    fun trivial_tac ctxt = match_tac ctxt @{thms induct_trueI}
  40.643  )
  40.644 -*}
  40.645 +\<close>
  40.646  
  40.647  ML_file "~~/src/Tools/induction.ML"
  40.648  
  40.649 -declaration {*
  40.650 +declaration \<open>
  40.651    fn _ => Induct.map_simpset (fn ss => ss
  40.652      addsimprocs
  40.653        [Simplifier.simproc_global @{theory} "swap_induct_false"
  40.654 @@ -1479,9 +1479,9 @@
  40.655      |> Simplifier.set_mksimps (fn ctxt =>
  40.656          Simpdata.mksimps Simpdata.mksimps_pairs ctxt #>
  40.657          map (rewrite_rule ctxt (map Thm.symmetric @{thms induct_rulify_fallback}))))
  40.658 -*}
  40.659 +\<close>
  40.660  
  40.661 -text {* Pre-simplification of induction and cases rules *}
  40.662 +text \<open>Pre-simplification of induction and cases rules\<close>
  40.663  
  40.664  lemma [induct_simp]: "(\<And>x. induct_equal x t \<Longrightarrow> PROP P x) \<equiv> PROP P t"
  40.665    unfolding induct_equal_def
  40.666 @@ -1538,10 +1538,10 @@
  40.667  ML_file "~~/src/Tools/induct_tacs.ML"
  40.668  
  40.669  
  40.670 -subsubsection {* Coherent logic *}
  40.671 +subsubsection \<open>Coherent logic\<close>
  40.672  
  40.673  ML_file "~~/src/Tools/coherent.ML"
  40.674 -ML {*
  40.675 +ML \<open>
  40.676  structure Coherent = Coherent
  40.677  (
  40.678    val atomize_elimL = @{thm atomize_elimL};
  40.679 @@ -1550,12 +1550,12 @@
  40.680    val atomize_disjL = @{thm atomize_disjL};
  40.681    val operator_names = [@{const_name HOL.disj}, @{const_name HOL.conj}, @{const_name Ex}];
  40.682  );
  40.683 -*}
  40.684 +\<close>
  40.685  
  40.686  
  40.687 -subsubsection {* Reorienting equalities *}
  40.688 +subsubsection \<open>Reorienting equalities\<close>
  40.689  
  40.690 -ML {*
  40.691 +ML \<open>
  40.692  signature REORIENT_PROC =
  40.693  sig
  40.694    val add : (term -> bool) -> theory -> theory
  40.695 @@ -1584,10 +1584,10 @@
  40.696        | _ => NONE
  40.697      end;
  40.698  end;
  40.699 -*}
  40.700 +\<close>
  40.701  
  40.702  
  40.703 -subsection {* Other simple lemmas and lemma duplicates *}
  40.704 +subsection \<open>Other simple lemmas and lemma duplicates\<close>
  40.705  
  40.706  lemma ex1_eq [iff]: "EX! x. x = t" "EX! x. t = x"
  40.707    by blast+
  40.708 @@ -1616,9 +1616,9 @@
  40.709    "(\<not> \<not>(P)) = P"
  40.710  by blast+
  40.711  
  40.712 -subsection {* Basic ML bindings *}
  40.713 +subsection \<open>Basic ML bindings\<close>
  40.714  
  40.715 -ML {*
  40.716 +ML \<open>
  40.717  val FalseE = @{thm FalseE}
  40.718  val Let_def = @{thm Let_def}
  40.719  val TrueI = @{thm TrueI}
  40.720 @@ -1667,16 +1667,16 @@
  40.721  val subst = @{thm subst}
  40.722  val sym = @{thm sym}
  40.723  val trans = @{thm trans}
  40.724 -*}
  40.725 +\<close>
  40.726  
  40.727  ML_file "Tools/cnf.ML"
  40.728  
  40.729  
  40.730 -section {* @{text NO_MATCH} simproc *}
  40.731 +section \<open>@{text NO_MATCH} simproc\<close>
  40.732  
  40.733 -text {*
  40.734 +text \<open>
  40.735   The simplification procedure can be used to avoid simplification of terms of a certain form
  40.736 -*}
  40.737 +\<close>
  40.738  
  40.739  definition NO_MATCH :: "'a \<Rightarrow> 'b \<Rightarrow> bool" where "NO_MATCH pat val \<equiv> True"
  40.740  
  40.741 @@ -1684,23 +1684,23 @@
  40.742  
  40.743  declare [[coercion_args NO_MATCH - -]]
  40.744  
  40.745 -simproc_setup NO_MATCH ("NO_MATCH pat val") = {* fn _ => fn ctxt => fn ct =>
  40.746 +simproc_setup NO_MATCH ("NO_MATCH pat val") = \<open>fn _ => fn ctxt => fn ct =>
  40.747    let
  40.748      val thy = Proof_Context.theory_of ctxt
  40.749      val dest_binop = Term.dest_comb #> apfst (Term.dest_comb #> snd)
  40.750      val m = Pattern.matches thy (dest_binop (Thm.term_of ct))
  40.751    in if m then NONE else SOME @{thm NO_MATCH_def} end
  40.752 -*}
  40.753 +\<close>
  40.754  
  40.755 -text {*
  40.756 +text \<open>
  40.757    This setup ensures that a rewrite rule of the form @{term "NO_MATCH pat val \<Longrightarrow> t"}
  40.758    is only applied, if the pattern @{term pat} does not match the value @{term val}.
  40.759 -*}
  40.760 +\<close>
  40.761  
  40.762  
  40.763 -subsection {* Code generator setup *}
  40.764 +subsection \<open>Code generator setup\<close>
  40.765  
  40.766 -subsubsection {* Generic code generator preprocessor setup *}
  40.767 +subsubsection \<open>Generic code generator preprocessor setup\<close>
  40.768  
  40.769  lemma conj_left_cong:
  40.770    "P \<longleftrightarrow> Q \<Longrightarrow> P \<and> R \<longleftrightarrow> Q \<and> R"
  40.771 @@ -1710,16 +1710,16 @@
  40.772    "P \<longleftrightarrow> Q \<Longrightarrow> P \<or> R \<longleftrightarrow> Q \<or> R"
  40.773    by (fact arg_cong)
  40.774  
  40.775 -setup {*
  40.776 +setup \<open>
  40.777    Code_Preproc.map_pre (put_simpset HOL_basic_ss) #>
  40.778    Code_Preproc.map_post (put_simpset HOL_basic_ss) #>
  40.779    Code_Simp.map_ss (put_simpset HOL_basic_ss #>
  40.780    Simplifier.add_cong @{thm conj_left_cong} #>
  40.781    Simplifier.add_cong @{thm disj_left_cong})
  40.782 -*}
  40.783 +\<close>
  40.784  
  40.785  
  40.786 -subsubsection {* Equality *}
  40.787 +subsubsection \<open>Equality\<close>
  40.788  
  40.789  class equal =
  40.790    fixes equal :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
  40.791 @@ -1740,16 +1740,16 @@
  40.792  declare eq_equal [symmetric, code_post]
  40.793  declare eq_equal [code]
  40.794  
  40.795 -setup {*
  40.796 +setup \<open>
  40.797    Code_Preproc.map_pre (fn ctxt =>
  40.798      ctxt addsimprocs [Simplifier.simproc_global_i @{theory} "equal" [@{term HOL.eq}]
  40.799        (fn _ => fn Const (_, Type ("fun", [Type _, _])) => SOME @{thm eq_equal} | _ => NONE)])
  40.800 -*}
  40.801 +\<close>
  40.802  
  40.803  
  40.804 -subsubsection {* Generic code generator foundation *}
  40.805 +subsubsection \<open>Generic code generator foundation\<close>
  40.806  
  40.807 -text {* Datatype @{typ bool} *}
  40.808 +text \<open>Datatype @{typ bool}\<close>
  40.809  
  40.810  code_datatype True False
  40.811  
  40.812 @@ -1771,7 +1771,7 @@
  40.813      and "(P \<longrightarrow> False) \<longleftrightarrow> \<not> P"
  40.814      and "(P \<longrightarrow> True) \<longleftrightarrow> True" by simp_all
  40.815  
  40.816 -text {* More about @{typ prop} *}
  40.817 +text \<open>More about @{typ prop}\<close>
  40.818  
  40.819  lemma [code nbe]:
  40.820    shows "(True \<Longrightarrow> PROP Q) \<equiv> PROP Q"
  40.821 @@ -1784,7 +1784,7 @@
  40.822  
  40.823  declare Trueprop_code [symmetric, code_post]
  40.824  
  40.825 -text {* Equality *}
  40.826 +text \<open>Equality\<close>
  40.827  
  40.828  declare simp_thms(6) [code nbe]
  40.829  
  40.830 @@ -1803,42 +1803,42 @@
  40.831    "equal TYPE('a) TYPE('a) \<longleftrightarrow> True"
  40.832    by (simp add: equal)
  40.833  
  40.834 -setup {* Sign.add_const_constraint (@{const_name equal}, SOME @{typ "'a\<Colon>type \<Rightarrow> 'a \<Rightarrow> bool"}) *}
  40.835 +setup \<open>Sign.add_const_constraint (@{const_name equal}, SOME @{typ "'a\<Colon>type \<Rightarrow> 'a \<Rightarrow> bool"})\<close>
  40.836  
  40.837  lemma equal_alias_cert: "OFCLASS('a, equal_class) \<equiv> ((op = :: 'a \<Rightarrow> 'a \<Rightarrow> bool) \<equiv> equal)" (is "?ofclass \<equiv> ?equal")
  40.838  proof
  40.839    assume "PROP ?ofclass"
  40.840    show "PROP ?equal"
  40.841 -    by (tactic {* ALLGOALS (resolve_tac @{context} [Thm.unconstrainT @{thm eq_equal}]) *})
  40.842 -      (fact `PROP ?ofclass`)
  40.843 +    by (tactic \<open>ALLGOALS (resolve_tac @{context} [Thm.unconstrainT @{thm eq_equal}])\<close>)
  40.844 +      (fact \<open>PROP ?ofclass\<close>)
  40.845  next
  40.846    assume "PROP ?equal"
  40.847    show "PROP ?ofclass" proof
  40.848 -  qed (simp add: `PROP ?equal`)
  40.849 +  qed (simp add: \<open>PROP ?equal\<close>)
  40.850  qed
  40.851  
  40.852 -setup {* Sign.add_const_constraint (@{const_name equal}, SOME @{typ "'a\<Colon>equal \<Rightarrow> 'a \<Rightarrow> bool"}) *}
  40.853 +setup \<open>Sign.add_const_constraint (@{const_name equal}, SOME @{typ "'a\<Colon>equal \<Rightarrow> 'a \<Rightarrow> bool"})\<close>
  40.854  
  40.855 -setup {* Nbe.add_const_alias @{thm equal_alias_cert} *}
  40.856 +setup \<open>Nbe.add_const_alias @{thm equal_alias_cert}\<close>
  40.857  
  40.858 -text {* Cases *}
  40.859 +text \<open>Cases\<close>
  40.860  
  40.861  lemma Let_case_cert:
  40.862    assumes "CASE \<equiv> (\<lambda>x. Let x f)"
  40.863    shows "CASE x \<equiv> f x"
  40.864    using assms by simp_all
  40.865  
  40.866 -setup {*
  40.867 +setup \<open>
  40.868    Code.add_case @{thm Let_case_cert} #>
  40.869    Code.add_undefined @{const_name undefined}
  40.870 -*}
  40.871 +\<close>
  40.872  
  40.873  declare [[code abort: undefined]]
  40.874  
  40.875  
  40.876 -subsubsection {* Generic code generator target languages *}
  40.877 +subsubsection \<open>Generic code generator target languages\<close>
  40.878  
  40.879 -text {* type @{typ bool} *}
  40.880 +text \<open>type @{typ bool}\<close>
  40.881  
  40.882  code_printing
  40.883    type_constructor bool \<rightharpoonup>
  40.884 @@ -1885,14 +1885,14 @@
  40.885    code_module Pure \<rightharpoonup>
  40.886      (SML) HOL and (OCaml) HOL and (Haskell) HOL and (Scala) HOL
  40.887  
  40.888 -text {* using built-in Haskell equality *}
  40.889 +text \<open>using built-in Haskell equality\<close>
  40.890  
  40.891  code_printing
  40.892    type_class equal \<rightharpoonup> (Haskell) "Eq"
  40.893  | constant HOL.equal \<rightharpoonup> (Haskell) infix 4 "=="
  40.894  | constant HOL.eq \<rightharpoonup> (Haskell) infix 4 "=="
  40.895  
  40.896 -text {* undefined *}
  40.897 +text \<open>undefined\<close>
  40.898  
  40.899  code_printing
  40.900    constant undefined \<rightharpoonup>
  40.901 @@ -1902,9 +1902,9 @@
  40.902      and (Scala) "!sys.error(\"undefined\")"
  40.903  
  40.904  
  40.905 -subsubsection {* Evaluation and normalization by evaluation *}
  40.906 +subsubsection \<open>Evaluation and normalization by evaluation\<close>
  40.907  
  40.908 -method_setup eval = {*
  40.909 +method_setup eval = \<open>
  40.910    let
  40.911      fun eval_tac ctxt =
  40.912        let val conv = Code_Runtime.dynamic_holds_conv ctxt
  40.913 @@ -1915,25 +1915,25 @@
  40.914    in
  40.915      Scan.succeed (SIMPLE_METHOD' o eval_tac)
  40.916    end
  40.917 -*} "solve goal by evaluation"
  40.918 +\<close> "solve goal by evaluation"
  40.919  
  40.920 -method_setup normalization = {*
  40.921 +method_setup normalization = \<open>
  40.922    Scan.succeed (fn ctxt =>
  40.923      SIMPLE_METHOD'
  40.924        (CHANGED_PROP o
  40.925          (CONVERSION (Nbe.dynamic_conv ctxt)
  40.926            THEN_ALL_NEW (TRY o resolve_tac ctxt [TrueI]))))
  40.927 -*} "solve goal by normalization"
  40.928 +\<close> "solve goal by normalization"
  40.929  
  40.930  
  40.931 -subsection {* Counterexample Search Units *}
  40.932 +subsection \<open>Counterexample Search Units\<close>
  40.933  
  40.934 -subsubsection {* Quickcheck *}
  40.935 +subsubsection \<open>Quickcheck\<close>
  40.936  
  40.937  quickcheck_params [size = 5, iterations = 50]
  40.938  
  40.939  
  40.940 -subsubsection {* Nitpick setup *}
  40.941 +subsubsection \<open>Nitpick setup\<close>
  40.942  
  40.943  named_theorems nitpick_unfold "alternative definitions of constants as needed by Nitpick"
  40.944    and nitpick_simp "equational specification of constants as needed by Nitpick"
  40.945 @@ -1944,16 +1944,16 @@
  40.946          if_bool_eq_disj [no_atp]
  40.947  
  40.948  
  40.949 -subsection {* Preprocessing for the predicate compiler *}
  40.950 +subsection \<open>Preprocessing for the predicate compiler\<close>
  40.951  
  40.952  named_theorems code_pred_def "alternative definitions of constants for the Predicate Compiler"
  40.953    and code_pred_inline "inlining definitions for the Predicate Compiler"
  40.954    and code_pred_simp "simplification rules for the optimisations in the Predicate Compiler"
  40.955  
  40.956  
  40.957 -subsection {* Legacy tactics and ML bindings *}
  40.958 +subsection \<open>Legacy tactics and ML bindings\<close>
  40.959  
  40.960 -ML {*
  40.961 +ML \<open>
  40.962    (* combination of (spec RS spec RS ...(j times) ... spec RS mp) *)
  40.963    local
  40.964      fun wrong_prem (Const (@{const_name All}, _) $ Abs (_, _, t)) = wrong_prem t
  40.965 @@ -1971,7 +1971,7 @@
  40.966    in
  40.967      fun nnf_conv ctxt = Simplifier.rewrite (put_simpset nnf_ss ctxt);
  40.968    end
  40.969 -*}
  40.970 +\<close>
  40.971  
  40.972  hide_const (open) eq equal
  40.973  
    41.1 --- a/src/HOL/Hilbert_Choice.thy	Sat Jul 18 21:44:18 2015 +0200
    41.2 +++ b/src/HOL/Hilbert_Choice.thy	Sat Jul 18 22:58:50 2015 +0200
    41.3 @@ -3,14 +3,14 @@
    41.4      Copyright   2001  University of Cambridge
    41.5  *)
    41.6  
    41.7 -section {* Hilbert's Epsilon-Operator and the Axiom of Choice *}
    41.8 +section \<open>Hilbert's Epsilon-Operator and the Axiom of Choice\<close>
    41.9  
   41.10  theory Hilbert_Choice
   41.11  imports Nat Wellfounded
   41.12  keywords "specification" :: thy_goal
   41.13  begin
   41.14  
   41.15 -subsection {* Hilbert's epsilon *}
   41.16 +subsection \<open>Hilbert's epsilon\<close>
   41.17  
   41.18  axiomatization Eps :: "('a => bool) => 'a" where
   41.19    someI: "P x ==> P (Eps P)"
   41.20 @@ -24,11 +24,11 @@
   41.21  translations
   41.22    "SOME x. P" == "CONST Eps (%x. P)"
   41.23  
   41.24 -print_translation {*
   41.25 +print_translation \<open>
   41.26    [(@{const_syntax Eps}, fn _ => fn [Abs abs] =>
   41.27        let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
   41.28        in Syntax.const @{syntax_const "_Eps"} $ x $ t end)]
   41.29 -*} -- {* to avoid eta-contraction of body *}
   41.30 +\<close> -- \<open>to avoid eta-contraction of body\<close>
   41.31  
   41.32  definition inv_into :: "'a set => ('a => 'b) => ('b => 'a)" where
   41.33  "inv_into A f == %x. SOME y. y : A & f y = x"
   41.34 @@ -37,22 +37,22 @@
   41.35  "inv == inv_into UNIV"
   41.36  
   41.37  
   41.38 -subsection {*Hilbert's Epsilon-operator*}
   41.39 +subsection \<open>Hilbert's Epsilon-operator\<close>
   41.40  
   41.41 -text{*Easier to apply than @{text someI} if the witness comes from an
   41.42 -existential formula*}
   41.43 +text\<open>Easier to apply than @{text someI} if the witness comes from an
   41.44 +existential formula\<close>
   41.45  lemma someI_ex [elim?]: "\<exists>x. P x ==> P (SOME x. P x)"
   41.46  apply (erule exE)
   41.47  apply (erule someI)
   41.48  done
   41.49  
   41.50 -text{*Easier to apply than @{text someI} because the conclusion has only one
   41.51 -occurrence of @{term P}.*}
   41.52 +text\<open>Easier to apply than @{text someI} because the conclusion has only one
   41.53 +occurrence of @{term P}.\<close>
   41.54  lemma someI2: "[| P a;  !!x. P x ==> Q x |] ==> Q (SOME x. P x)"
   41.55  by (blast intro: someI)
   41.56  
   41.57 -text{*Easier to apply than @{text someI2} if the witness comes from an
   41.58 -existential formula*}
   41.59 +text\<open>Easier to apply than @{text someI2} if the witness comes from an
   41.60 +existential formula\<close>
   41.61  lemma someI2_ex: "[| \<exists>a. P a; !!x. P x ==> Q x |] ==> Q (SOME x. P x)"
   41.62  by (blast intro: someI2)
   41.63  
   41.64 @@ -81,7 +81,7 @@
   41.65  done
   41.66  
   41.67  
   41.68 -subsection{*Axiom of Choice, Proved Using the Description Operator*}
   41.69 +subsection\<open>Axiom of Choice, Proved Using the Description Operator\<close>
   41.70  
   41.71  lemma choice: "\<forall>x. \<exists>y. Q x y ==> \<exists>f. \<forall>x. Q x (f x)"
   41.72  by (fast elim: someI)
   41.73 @@ -114,7 +114,7 @@
   41.74  qed
   41.75  
   41.76  
   41.77 -subsection {*Function Inverse*}
   41.78 +subsection \<open>Function Inverse\<close>
   41.79  
   41.80  lemma inv_def: "inv f = (%y. SOME x. f x = y)"
   41.81  by(simp add: inv_into_def)
   41.82 @@ -152,7 +152,7 @@
   41.83  lemma inj_imp_inv_eq: "[| inj f; ALL x. f(g x) = x |] ==> inv f = g"
   41.84    by (blast intro: inv_into_f_eq)
   41.85  
   41.86 -text{*But is it useful?*}
   41.87 +text\<open>But is it useful?\<close>
   41.88  lemma inj_transfer:
   41.89    assumes injf: "inj f" and minor: "!!y. y \<in> range(f) ==> P(inv f y)"
   41.90    shows "P x"
   41.91 @@ -288,7 +288,7 @@
   41.92    ultimately show "finite (UNIV :: 'a set)" by simp
   41.93  qed
   41.94  
   41.95 -text {*
   41.96 +text \<open>
   41.97    Every infinite set contains a countable subset. More precisely we
   41.98    show that a set @{text S} is infinite if and only if there exists an
   41.99    injective function from the naturals into @{text S}.
  41.100 @@ -298,12 +298,12 @@
  41.101    infinite set @{text S}. The idea is to construct a sequence of
  41.102    non-empty and infinite subsets of @{text S} obtained by successively
  41.103    removing elements of @{text S}.
  41.104 -*}
  41.105 +\<close>
  41.106  
  41.107  lemma infinite_countable_subset:
  41.108    assumes inf: "\<not> finite (S::'a set)"
  41.109    shows "\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S"
  41.110 -  -- {* Courtesy of Stephan Merz *}
  41.111 +  -- \<open>Courtesy of Stephan Merz\<close>
  41.112  proof -
  41.113    def Sseq \<equiv> "rec_nat S (\<lambda>n T. T - {SOME e. e \<in> T})"
  41.114    def pick \<equiv> "\<lambda>n. (SOME e. e \<in> Sseq n)"
  41.115 @@ -321,7 +321,7 @@
  41.116  qed
  41.117  
  41.118  lemma infinite_iff_countable_subset: "\<not> finite S \<longleftrightarrow> (\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S)"
  41.119 -  -- {* Courtesy of Stephan Merz *}
  41.120 +  -- \<open>Courtesy of Stephan Merz\<close>
  41.121    using finite_imageD finite_subset infinite_UNIV_char_0 infinite_countable_subset by auto
  41.122  
  41.123  lemma image_inv_into_cancel:
  41.124 @@ -345,9 +345,9 @@
  41.125    have 1: "bij_betw ?f' A' A" using assms
  41.126    by (auto simp add: bij_betw_inv_into)
  41.127    obtain a' where 2: "a' \<in> A'" and 3: "?f' a' = a"
  41.128 -    using 1 `a \<in> A` unfolding bij_betw_def by force
  41.129 +    using 1 \<open>a \<in> A\<close> unfolding bij_betw_def by force
  41.130    hence "?f'' a = a'"
  41.131 -    using `a \<in> A` 1 3 by (auto simp add: f_inv_into_f bij_betw_def)
  41.132 +    using \<open>a \<in> A\<close> 1 3 by (auto simp add: f_inv_into_f bij_betw_def)
  41.133    moreover have "f a = a'" using assms 2 3
  41.134      by (auto simp add: bij_betw_def)
  41.135    ultimately show "?f'' a = f a" by simp
  41.136 @@ -432,7 +432,7 @@
  41.137    using fg gf inv_equality[of g f] by (auto simp add: fun_eq_iff)
  41.138  
  41.139  
  41.140 -subsection {* The Cantor-Bernstein Theorem *}
  41.141 +subsection \<open>The Cantor-Bernstein Theorem\<close>
  41.142  
  41.143  lemma Cantor_Bernstein_aux:
  41.144    shows "\<exists>A' h. A' \<le> A \<and>
  41.145 @@ -534,11 +534,11 @@
  41.146    ultimately show ?thesis unfolding bij_betw_def by auto
  41.147  qed
  41.148  
  41.149 -subsection {*Other Consequences of Hilbert's Epsilon*}
  41.150 +subsection \<open>Other Consequences of Hilbert's Epsilon\<close>
  41.151  
  41.152 -text {*Hilbert's Epsilon and the @{term split} Operator*}
  41.153 +text \<open>Hilbert's Epsilon and the @{term split} Operator\<close>
  41.154  
  41.155 -text{*Looping simprule*}
  41.156 +text\<open>Looping simprule\<close>
  41.157  lemma split_paired_Eps: "(SOME x. P x) = (SOME (a,b). P(a,b))"
  41.158    by simp
  41.159  
  41.160 @@ -549,7 +549,7 @@
  41.161    by blast
  41.162  
  41.163  
  41.164 -text{*A relation is wellfounded iff it has no infinite descending chain*}
  41.165 +text\<open>A relation is wellfounded iff it has no infinite descending chain\<close>
  41.166  lemma wf_iff_no_infinite_down_chain:
  41.167    "wf r = (~(\<exists>f. \<forall>i. (f(Suc i),f i) \<in> r))"
  41.168  apply (simp only: wf_eq_minimal)
  41.169 @@ -569,15 +569,15 @@
  41.170  
  41.171  lemma wf_no_infinite_down_chainE:
  41.172    assumes "wf r" obtains k where "(f (Suc k), f k) \<notin> r"
  41.173 -using `wf r` wf_iff_no_infinite_down_chain[of r] by blast
  41.174 +using \<open>wf r\<close> wf_iff_no_infinite_down_chain[of r] by blast
  41.175  
  41.176  
  41.177 -text{*A dynamically-scoped fact for TFL *}
  41.178 +text\<open>A dynamically-scoped fact for TFL\<close>
  41.179  lemma tfl_some: "\<forall>P x. P x --> P (Eps P)"
  41.180    by (blast intro: someI)
  41.181  
  41.182  
  41.183 -subsection {* Least value operator *}
  41.184 +subsection \<open>Least value operator\<close>
  41.185  
  41.186  definition
  41.187    LeastM :: "['a => 'b::ord, 'a => bool] => 'a" where
  41.188 @@ -630,7 +630,7 @@
  41.189  by (rule LeastM_nat_lemma [THEN conjunct2, THEN spec, THEN mp], assumption, assumption)
  41.190  
  41.191  
  41.192 -subsection {* Greatest value operator *}
  41.193 +subsection \<open>Greatest value operator\<close>
  41.194  
  41.195  definition
  41.196    GreatestM :: "['a => 'b::ord, 'a => bool] => 'a" where
  41.197 @@ -699,7 +699,7 @@
  41.198    done
  41.199  
  41.200  
  41.201 -text {* \medskip Specialization to @{text GREATEST}. *}
  41.202 +text \<open>\medskip Specialization to @{text GREATEST}.\<close>
  41.203  
  41.204  lemma GreatestI: "P (k::nat) ==> \<forall>y. P y --> y < b ==> P (GREATEST x. P x)"
  41.205    apply (simp add: Greatest_def)
  41.206 @@ -713,9 +713,9 @@
  41.207    done
  41.208  
  41.209  
  41.210 -subsection {* An aside: bounded accessible part *}
  41.211 +subsection \<open>An aside: bounded accessible part\<close>
  41.212  
  41.213 -text {* Finite monotone eventually stable sequences *}
  41.214 +text \<open>Finite monotone eventually stable sequences\<close>
  41.215  
  41.216  lemma finite_mono_remains_stable_implies_strict_prefix:
  41.217    fixes f :: "nat \<Rightarrow> 'a::order"
  41.218 @@ -728,7 +728,7 @@
  41.219      assume "\<not> ?thesis"
  41.220      then have "\<And>n. f n \<noteq> f (Suc n)" by auto
  41.221      then have "\<And>n. f n < f (Suc n)"
  41.222 -      using  `mono f` by (auto simp: le_less mono_iff_le_Suc)
  41.223 +      using  \<open>mono f\<close> by (auto simp: le_less mono_iff_le_Suc)
  41.224      with lift_Suc_mono_less_iff[of f]
  41.225      have *: "\<And>n m. n < m \<Longrightarrow> f n < f m" by auto
  41.226      have "inj f"
  41.227 @@ -737,7 +737,7 @@
  41.228        assume "f x = f y"
  41.229        then show "x = y" by (cases x y rule: linorder_cases) (auto dest: *)
  41.230      qed
  41.231 -    with `finite (range f)` have "finite (UNIV::nat set)"
  41.232 +    with \<open>finite (range f)\<close> have "finite (UNIV::nat set)"
  41.233        by (rule finite_imageD)
  41.234      then show False by simp
  41.235    qed
  41.236 @@ -754,7 +754,7 @@
  41.237          using eq[rule_format, of "n - 1"] N
  41.238          by (cases n) (auto simp add: le_Suc_eq)
  41.239      qed simp
  41.240 -    from this[of n] `N \<le> n` show "f N = f n" by auto
  41.241 +    from this[of n] \<open>N \<le> n\<close> show "f N = f n" by auto
  41.242    next
  41.243      fix n m :: nat assume "m < n" "n \<le> N"
  41.244      then show "f m < f n"
  41.245 @@ -763,7 +763,7 @@
  41.246        then have "i < N" by simp
  41.247        then have "f i \<noteq> f (Suc i)"
  41.248          unfolding N_def by (rule not_less_Least)
  41.249 -      with `mono f` show ?case by (simp add: mono_iff_le_Suc less_le)
  41.250 +      with \<open>mono f\<close> show ?case by (simp add: mono_iff_le_Suc less_le)
  41.251      qed auto
  41.252    qed
  41.253  qed
  41.254 @@ -799,7 +799,7 @@
  41.255  qed
  41.256  
  41.257  
  41.258 -subsection {* More on injections, bijections, and inverses *}
  41.259 +subsection \<open>More on injections, bijections, and inverses\<close>
  41.260  
  41.261  lemma infinite_imp_bij_betw:
  41.262  assumes INF: "\<not> finite A"
  41.263 @@ -913,7 +913,7 @@
  41.264  by (auto intro: inj_on_inv_into)
  41.265  
  41.266  
  41.267 -subsection {* Specification package -- Hilbertized version *}
  41.268 +subsection \<open>Specification package -- Hilbertized version\<close>
  41.269  
  41.270  lemma exE_some: "[| Ex P ; c == Eps P |] ==> P c"
  41.271    by (simp only: someI_ex)
    42.1 --- a/src/HOL/Inductive.thy	Sat Jul 18 21:44:18 2015 +0200
    42.2 +++ b/src/HOL/Inductive.thy	Sat Jul 18 22:58:50 2015 +0200
    42.3 @@ -2,7 +2,7 @@
    42.4      Author:     Markus Wenzel, TU Muenchen
    42.5  *)
    42.6  
    42.7 -section {* Knaster-Tarski Fixpoint Theorem and inductive definitions *}
    42.8 +section \<open>Knaster-Tarski Fixpoint Theorem and inductive definitions\<close>
    42.9  
   42.10  theory Inductive
   42.11  imports Complete_Lattices Ctr_Sugar
   42.12 @@ -14,24 +14,24 @@
   42.13    "primrec" :: thy_decl
   42.14  begin
   42.15  
   42.16 -subsection {* Least and greatest fixed points *}
   42.17 +subsection \<open>Least and greatest fixed points\<close>
   42.18  
   42.19  context complete_lattice
   42.20  begin
   42.21  
   42.22  definition
   42.23    lfp :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a" where
   42.24 -  "lfp f = Inf {u. f u \<le> u}"    --{*least fixed point*}
   42.25 +  "lfp f = Inf {u. f u \<le> u}"    --\<open>least fixed point\<close>
   42.26  
   42.27  definition
   42.28    gfp :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a" where
   42.29 -  "gfp f = Sup {u. u \<le> f u}"    --{*greatest fixed point*}
   42.30 +  "gfp f = Sup {u. u \<le> f u}"    --\<open>greatest fixed point\<close>
   42.31  
   42.32  
   42.33 -subsection{* Proof of Knaster-Tarski Theorem using @{term lfp} *}
   42.34 +subsection\<open>Proof of Knaster-Tarski Theorem using @{term lfp}\<close>
   42.35  
   42.36 -text{*@{term "lfp f"} is the least upper bound of
   42.37 -      the set @{term "{u. f(u) \<le> u}"} *}
   42.38 +text\<open>@{term "lfp f"} is the least upper bound of
   42.39 +      the set @{term "{u. f(u) \<le> u}"}\<close>
   42.40  
   42.41  lemma lfp_lowerbound: "f A \<le> A ==> lfp f \<le> A"
   42.42    by (auto simp add: lfp_def intro: Inf_lower)
   42.43 @@ -54,7 +54,7 @@
   42.44    by (rule lfp_unfold) (simp add:mono_def)
   42.45  
   42.46  
   42.47 -subsection {* General induction rules for least fixed points *}
   42.48 +subsection \<open>General induction rules for least fixed points\<close>
   42.49  
   42.50  lemma lfp_ordinal_induct[case_names mono step union]:
   42.51    fixes f :: "'a\<Colon>complete_lattice \<Rightarrow> 'a"
   42.52 @@ -101,8 +101,8 @@
   42.53    using assms by (rule lfp_ordinal_induct)
   42.54  
   42.55  
   42.56 -text{*Definition forms of @{text lfp_unfold} and @{text lfp_induct}, 
   42.57 -    to control unfolding*}
   42.58 +text\<open>Definition forms of @{text lfp_unfold} and @{text lfp_induct}, 
   42.59 +    to control unfolding\<close>
   42.60  
   42.61  lemma def_lfp_unfold: "[| h==lfp(f);  mono(f) |] ==> h = f(h)"
   42.62    by (auto intro!: lfp_unfold)
   42.63 @@ -124,10 +124,10 @@
   42.64    by (rule lfp_lowerbound [THEN lfp_greatest], blast intro: order_trans)
   42.65  
   42.66  
   42.67 -subsection {* Proof of Knaster-Tarski Theorem using @{term gfp} *}
   42.68 +subsection \<open>Proof of Knaster-Tarski Theorem using @{term gfp}\<close>
   42.69  
   42.70 -text{*@{term "gfp f"} is the greatest lower bound of 
   42.71 -      the set @{term "{u. u \<le> f(u)}"} *}
   42.72 +text\<open>@{term "gfp f"} is the greatest lower bound of 
   42.73 +      the set @{term "{u. u \<le> f(u)}"}\<close>
   42.74  
   42.75  lemma gfp_upperbound: "X \<le> f X ==> X \<le> gfp f"
   42.76    by (auto simp add: gfp_def intro: Sup_upper)
   42.77 @@ -145,9 +145,9 @@
   42.78    by (iprover intro: order_antisym gfp_lemma2 gfp_lemma3)
   42.79  
   42.80  
   42.81 -subsection {* Coinduction rules for greatest fixed points *}
   42.82 +subsection \<open>Coinduction rules for greatest fixed points\<close>
   42.83  
   42.84 -text{*weak version*}
   42.85 +text\<open>weak version\<close>
   42.86  lemma weak_coinduct: "[| a: X;  X \<subseteq> f(X) |] ==> a : gfp(f)"
   42.87    by (rule gfp_upperbound [THEN subsetD]) auto
   42.88  
   42.89 @@ -169,7 +169,7 @@
   42.90    apply assumption
   42.91    done
   42.92  
   42.93 -text{*strong version, thanks to Coen and Frost*}
   42.94 +text\<open>strong version, thanks to Coen and Frost\<close>
   42.95  lemma coinduct_set: "[| mono(f);  a: X;  X \<subseteq> f(X Un gfp(f)) |] ==> a : gfp(f)"
   42.96    by (rule weak_coinduct[rotated], rule coinduct_lemma) blast+
   42.97  
   42.98 @@ -203,10 +203,10 @@
   42.99      by (intro order_trans[OF ind _] monoD[OF mono]) auto
  42.100  qed (auto intro: mono Inf_greatest)
  42.101  
  42.102 -subsection {* Even Stronger Coinduction Rule, by Martin Coen *}
  42.103 +subsection \<open>Even Stronger Coinduction Rule, by Martin Coen\<close>
  42.104  
  42.105 -text{* Weakens the condition @{term "X \<subseteq> f(X)"} to one expressed using both
  42.106 -  @{term lfp} and @{term gfp}*}
  42.107 +text\<open>Weakens the condition @{term "X \<subseteq> f(X)"} to one expressed using both
  42.108 +  @{term lfp} and @{term gfp}\<close>
  42.109  
  42.110  lemma coinduct3_mono_lemma: "mono(f) ==> mono(%x. f(x) Un X Un B)"
  42.111  by (iprover intro: subset_refl monoI Un_mono monoD)
  42.112 @@ -230,8 +230,8 @@
  42.113  apply (simp_all)
  42.114  done
  42.115  
  42.116 -text{*Definition forms of @{text gfp_unfold} and @{text coinduct}, 
  42.117 -    to control unfolding*}
  42.118 +text\<open>Definition forms of @{text gfp_unfold} and @{text coinduct}, 
  42.119 +    to control unfolding\<close>
  42.120  
  42.121  lemma def_gfp_unfold: "[| A==gfp(f);  mono(f) |] ==> A = f(A)"
  42.122    by (auto intro!: gfp_unfold)
  42.123 @@ -255,11 +255,11 @@
  42.124      "[| A==gfp(f); mono(f);  a:X;  X \<subseteq> f(lfp(%x. f(x) Un X Un A)) |] ==> a: A"
  42.125    by (auto intro!: coinduct3)
  42.126  
  42.127 -text{*Monotonicity of @{term gfp}!*}
  42.128 +text\<open>Monotonicity of @{term gfp}!\<close>
  42.129  lemma gfp_mono: "(!!Z. f Z \<le> g Z) ==> gfp f \<le> gfp g"
  42.130    by (rule gfp_upperbound [THEN gfp_least], blast intro: order_trans)
  42.131  
  42.132 -subsection {* Rules for fixed point calculus *}
  42.133 +subsection \<open>Rules for fixed point calculus\<close>
  42.134  
  42.135  
  42.136  lemma lfp_rolling:
  42.137 @@ -339,9 +339,9 @@
  42.138    qed
  42.139  qed
  42.140  
  42.141 -subsection {* Inductive predicates and sets *}
  42.142 +subsection \<open>Inductive predicates and sets\<close>
  42.143  
  42.144 -text {* Package setup. *}
  42.145 +text \<open>Package setup.\<close>
  42.146  
  42.147  theorems basic_monos =
  42.148    subset_refl imp_refl disj_mono conj_mono ex_mono all_mono if_bool_eq_conj
  42.149 @@ -356,9 +356,9 @@
  42.150    induct_rulify_fallback
  42.151  
  42.152  
  42.153 -subsection {* Inductive datatypes and primitive recursion *}
  42.154 +subsection \<open>Inductive datatypes and primitive recursion\<close>
  42.155  
  42.156 -text {* Package setup. *}
  42.157 +text \<open>Package setup.\<close>
  42.158  
  42.159  ML_file "Tools/Old_Datatype/old_datatype_aux.ML"
  42.160  ML_file "Tools/Old_Datatype/old_datatype_prop.ML"
  42.161 @@ -370,14 +370,14 @@
  42.162  ML_file "Tools/BNF/bnf_fp_rec_sugar_util.ML"
  42.163  ML_file "Tools/BNF/bnf_lfp_rec_sugar.ML"
  42.164  
  42.165 -text{* Lambda-abstractions with pattern matching: *}
  42.166 +text\<open>Lambda-abstractions with pattern matching:\<close>
  42.167  
  42.168  syntax
  42.169    "_lam_pats_syntax" :: "cases_syn => 'a => 'b"               ("(%_)" 10)
  42.170  syntax (xsymbols)
  42.171    "_lam_pats_syntax" :: "cases_syn => 'a => 'b"               ("(\<lambda>_)" 10)
  42.172  
  42.173 -parse_translation {*
  42.174 +parse_translation \<open>
  42.175    let
  42.176      fun fun_tr ctxt [cs] =
  42.177        let
  42.178 @@ -385,6 +385,6 @@
  42.179          val ft = Case_Translation.case_tr true ctxt [x, cs];
  42.180        in lambda x ft end
  42.181    in [(@{syntax_const "_lam_pats_syntax"}, fun_tr)] end
  42.182 -*}
  42.183 +\<close>
  42.184  
  42.185  end
    43.1 --- a/src/HOL/Inequalities.thy	Sat Jul 18 21:44:18 2015 +0200
    43.2 +++ b/src/HOL/Inequalities.thy	Sat Jul 18 22:58:50 2015 +0200
    43.3 @@ -16,7 +16,7 @@
    43.4    case (Suc i)
    43.5    have 0: "i = nat((n-1) - m)" "m \<le> n-1" using Suc(2,3) by arith+
    43.6    have "\<Sum> {m..n} = \<Sum> {m..1+(n-1)}" by simp
    43.7 -  also have "\<dots> = \<Sum> {m..n-1} + n" using `m \<le> n`
    43.8 +  also have "\<dots> = \<Sum> {m..n-1} + n" using \<open>m \<le> n\<close>
    43.9      by(subst atLeastAtMostPlus1_int_conv) simp_all
   43.10    also have "\<dots> = ((n-1)*(n-1+1) - m*(m-1)) div 2 + n"
   43.11      by(simp add: Suc(1)[OF 0])
   43.12 @@ -43,7 +43,7 @@
   43.13    hence "{m..<n} = {m..n-1}" by auto
   43.14    hence "\<Sum>{m..<n} = \<Sum>{m..n-1}" by simp
   43.15    also have "\<dots> = (n*(n-1) - m*(m-1)) div 2"
   43.16 -    using assms `m < n` by (simp add: Setsum_Icc_nat mult.commute)
   43.17 +    using assms \<open>m < n\<close> by (simp add: Setsum_Icc_nat mult.commute)
   43.18    finally show ?thesis .
   43.19  next
   43.20    assume "\<not> m < n" with assms show ?thesis by simp
    44.1 --- a/src/HOL/Int.thy	Sat Jul 18 21:44:18 2015 +0200
    44.2 +++ b/src/HOL/Int.thy	Sat Jul 18 22:58:50 2015 +0200
    44.3 @@ -3,13 +3,13 @@
    44.4      Author:     Tobias Nipkow, Florian Haftmann, TU Muenchen
    44.5  *)
    44.6  
    44.7 -section {* The Integers as Equivalence Classes over Pairs of Natural Numbers *}
    44.8 +section \<open>The Integers as Equivalence Classes over Pairs of Natural Numbers\<close>
    44.9  
   44.10  theory Int
   44.11  imports Equiv_Relations Power Quotient Fun_Def
   44.12  begin
   44.13  
   44.14 -subsection {* Definition of integers as a quotient type *}
   44.15 +subsection \<open>Definition of integers as a quotient type\<close>
   44.16  
   44.17  definition intrel :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> bool" where
   44.18    "intrel = (\<lambda>(x, y) (u, v). x + v = u + y)"
   44.19 @@ -32,7 +32,7 @@
   44.20       "(!!x y. z = Abs_Integ (x, y) ==> P) ==> P"
   44.21  by (induct z) auto
   44.22  
   44.23 -subsection {* Integers form a commutative ring *}
   44.24 +subsection \<open>Integers form a commutative ring\<close>
   44.25  
   44.26  instantiation int :: comm_ring_1
   44.27  begin
   44.28 @@ -85,7 +85,7 @@
   44.29    obtains (diff) m n where "z = int m - int n"
   44.30    by transfer clarsimp
   44.31  
   44.32 -subsection {* Integers are totally ordered *}
   44.33 +subsection \<open>Integers are totally ordered\<close>
   44.34  
   44.35  instantiation int :: linorder
   44.36  begin
   44.37 @@ -118,7 +118,7 @@
   44.38  
   44.39  end
   44.40  
   44.41 -subsection {* Ordering properties of arithmetic operations *}
   44.42 +subsection \<open>Ordering properties of arithmetic operations\<close>
   44.43  
   44.44  instance int :: ordered_cancel_ab_semigroup_add
   44.45  proof
   44.46 @@ -127,9 +127,9 @@
   44.47      by transfer clarsimp
   44.48  qed
   44.49  
   44.50 -text{*Strict Monotonicity of Multiplication*}
   44.51 +text\<open>Strict Monotonicity of Multiplication\<close>
   44.52  
   44.53 -text{*strict, in 1st argument; proof is by induction on k>0*}
   44.54 +text\<open>strict, in 1st argument; proof is by induction on k>0\<close>
   44.55  lemma zmult_zless_mono2_lemma:
   44.56       "(i::int)<j ==> 0<k ==> int k * i < int k * j"
   44.57  apply (induct k)
   44.58 @@ -156,7 +156,7 @@
   44.59  apply (auto simp add: zmult_zless_mono2_lemma)
   44.60  done
   44.61  
   44.62 -text{*The integers form an ordered integral domain*}
   44.63 +text\<open>The integers form an ordered integral domain\<close>
   44.64  instantiation int :: linordered_idom
   44.65  begin
   44.66  
   44.67 @@ -198,7 +198,7 @@
   44.68    for z1 z2 w :: int
   44.69  
   44.70  
   44.71 -subsection {* Embedding of the Integers into any @{text ring_1}: @{text of_int}*}
   44.72 +subsection \<open>Embedding of the Integers into any @{text ring_1}: @{text of_int}\<close>
   44.73  
   44.74  context ring_1
   44.75  begin
   44.76 @@ -225,7 +225,7 @@
   44.77  lemma of_int_mult [simp]: "of_int (w*z) = of_int w * of_int z"
   44.78    by (transfer fixing: times) (clarsimp simp add: algebra_simps of_nat_mult)
   44.79  
   44.80 -text{*Collapse nested embeddings*}
   44.81 +text\<open>Collapse nested embeddings\<close>
   44.82  lemma of_int_of_nat_eq [simp]: "of_int (int n) = of_nat n"
   44.83  by (induct n) auto
   44.84  
   44.85 @@ -249,7 +249,7 @@
   44.86    by transfer (clarsimp simp add: algebra_simps
   44.87      of_nat_add [symmetric] simp del: of_nat_add)
   44.88  
   44.89 -text{*Special cases where either operand is zero*}
   44.90 +text\<open>Special cases where either operand is zero\<close>
   44.91  lemma of_int_eq_0_iff [simp]:
   44.92    "of_int z = 0 \<longleftrightarrow> z = 0"
   44.93    using of_int_eq_iff [of z 0] by simp
   44.94 @@ -263,7 +263,7 @@
   44.95  context linordered_idom
   44.96  begin
   44.97  
   44.98 -text{*Every @{text linordered_idom} has characteristic zero.*}
   44.99 +text\<open>Every @{text linordered_idom} has characteristic zero.\<close>
  44.100  subclass ring_char_0 ..
  44.101  
  44.102  lemma of_int_le_iff [simp]:
  44.103 @@ -316,7 +316,7 @@
  44.104    apply simp
  44.105    done
  44.106  
  44.107 -subsection {* Magnitude of an Integer, as a Natural Number: @{text nat} *}
  44.108 +subsection \<open>Magnitude of an Integer, as a Natural Number: @{text nat}\<close>
  44.109  
  44.110  lift_definition nat :: "int \<Rightarrow> nat" is "\<lambda>(x, y). x - y"
  44.111    by auto
  44.112 @@ -336,7 +336,7 @@
  44.113  lemma nat_le_eq_zle: "0 < w | 0 \<le> z ==> (nat w \<le> nat z) = (w\<le>z)"
  44.114    by transfer (clarsimp, arith)
  44.115  
  44.116 -text{*An alternative condition is @{term "0 \<le> w"} *}
  44.117 +text\<open>An alternative condition is @{term "0 \<le> w"}\<close>
  44.118  corollary nat_mono_iff: "0 < z ==> (nat w < nat z) = (w < z)"
  44.119  by (simp add: nat_le_eq_zle linorder_not_le [symmetric])
  44.120  
  44.121 @@ -432,11 +432,11 @@
  44.122    by (simp only: nat_diff_distrib' zero_le_numeral nat_numeral)
  44.123  
  44.124  
  44.125 -text {* For termination proofs: *}
  44.126 +text \<open>For termination proofs:\<close>
  44.127  lemma measure_function_int[measure_function]: "is_measure (nat o abs)" ..
  44.128  
  44.129  
  44.130 -subsection{*Lemmas about the Function @{term of_nat} and Orderings*}
  44.131 +subsection\<open>Lemmas about the Function @{term of_nat} and Orderings\<close>
  44.132  
  44.133  lemma negative_zless_0: "- (int (Suc n)) < (0 \<Colon> int)"
  44.134  by (simp add: order_less_le del: of_nat_Suc)
  44.135 @@ -479,10 +479,10 @@
  44.136  lemma int_Suc0_eq_1: "int (Suc 0) = 1"
  44.137  by simp
  44.138  
  44.139 -text{*This version is proved for all ordered rings, not just integers!
  44.140 +text\<open>This version is proved for all ordered rings, not just integers!
  44.141        It is proved here because attribute @{text arith_split} is not available
  44.142        in theory @{text Rings}.