isabelle update_cartouches -c -t;
authorwenzelm
Mon Dec 07 10:38:04 2015 +0100 (2015-12-07)
changeset 617994cf66f21b764
parent 61798 27f3c10b0b50
child 61800 f3789d5b96ca
child 61806 d2e62ae01cd8
isabelle update_cartouches -c -t;
src/HOL/BNF_Cardinal_Order_Relation.thy
src/HOL/BNF_Wellorder_Constructions.thy
src/HOL/BNF_Wellorder_Embedding.thy
src/HOL/BNF_Wellorder_Relation.thy
src/HOL/Binomial.thy
src/HOL/Code_Evaluation.thy
src/HOL/Complete_Lattices.thy
src/HOL/Complex.thy
src/HOL/Deriv.thy
src/HOL/Divides.thy
src/HOL/Enum.thy
src/HOL/Equiv_Relations.thy
src/HOL/Fields.thy
src/HOL/Finite_Set.thy
src/HOL/Fun.thy
src/HOL/Fun_Def.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/Int.thy
src/HOL/Isar_Examples/Basic_Logic.thy
src/HOL/Isar_Examples/Expr_Compiler.thy
src/HOL/Isar_Examples/Fibonacci.thy
src/HOL/Isar_Examples/Group.thy
src/HOL/Isar_Examples/Hoare.thy
src/HOL/Isar_Examples/Hoare_Ex.thy
src/HOL/Isar_Examples/Structured_Statements.thy
src/HOL/Lattices.thy
src/HOL/Library/Float.thy
src/HOL/Library/Formal_Power_Series.thy
src/HOL/Lifting.thy
src/HOL/Limits.thy
src/HOL/List.thy
src/HOL/MacLaurin.thy
src/HOL/Map.thy
src/HOL/Meson.thy
src/HOL/Nat.thy
src/HOL/Nitpick.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/Power.thy
src/HOL/Presburger.thy
src/HOL/Product_Type.thy
src/HOL/Quickcheck_Narrowing.thy
src/HOL/Quickcheck_Random.thy
src/HOL/Quotient.thy
src/HOL/Random.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/SMT.thy
src/HOL/Series.thy
src/HOL/Set.thy
src/HOL/Set_Interval.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/Transitive_Closure.thy
src/HOL/Typedef.thy
src/HOL/Wellfounded.thy
src/HOL/Wfrec.thy
src/HOL/Word/Bit_Comparison.thy
src/HOL/Word/Bit_Representation.thy
src/HOL/Word/Bits.thy
src/HOL/Word/Bits_Bit.thy
src/HOL/Word/Bits_Int.thy
src/HOL/Word/Bool_List_Representation.thy
src/HOL/Word/Misc_Numeric.thy
src/HOL/Word/Misc_Typedef.thy
src/HOL/Word/Type_Length.thy
src/HOL/Word/Word.thy
src/HOL/Word/WordBitwise.thy
src/HOL/Word/Word_Miscellaneous.thy
src/HOL/Zorn.thy
     1.1 --- a/src/HOL/BNF_Cardinal_Order_Relation.thy	Mon Dec 07 10:23:50 2015 +0100
     1.2 +++ b/src/HOL/BNF_Cardinal_Order_Relation.thy	Mon Dec 07 10:38:04 2015 +0100
     1.3 @@ -19,7 +19,7 @@
     1.4  \item standard set-theoretic constructions: products,
     1.5  sums, unions, lists, powersets, set-of finite sets operator;
     1.6  \item finiteness and infiniteness (in particular, with the numeric cardinal operator
     1.7 -for finite sets, @{text "card"}, from the theory @{text "Finite_Sets.thy"}).
     1.8 +for finite sets, \<open>card\<close>, from the theory \<open>Finite_Sets.thy\<close>).
     1.9  \end{itemize}
    1.10  %
    1.11  On the way, we define the canonical $\omega$ cardinal and finite cardinals.  We also
    1.12 @@ -37,8 +37,8 @@
    1.13  subsection \<open>Cardinal orders\<close>
    1.14  
    1.15  text\<open>A cardinal order in our setting shall be a well-order {\em minim} w.r.t. the
    1.16 -order-embedding relation, @{text "\<le>o"} (which is the same as being {\em minimal} w.r.t. the
    1.17 -strict order-embedding relation, @{text "<o"}), among all the well-orders on its field.\<close>
    1.18 +order-embedding relation, \<open>\<le>o\<close> (which is the same as being {\em minimal} w.r.t. the
    1.19 +strict order-embedding relation, \<open><o\<close>), among all the well-orders on its field.\<close>
    1.20  
    1.21  definition card_order_on :: "'a set \<Rightarrow> 'a rel \<Rightarrow> bool"
    1.22  where
    1.23 @@ -59,9 +59,9 @@
    1.24  text\<open>The existence of a cardinal relation on any given set (which will mean
    1.25  that any set has a cardinal) follows from two facts:
    1.26  \begin{itemize}
    1.27 -\item Zermelo's theorem (proved in @{text "Zorn.thy"} as theorem @{text "well_order_on"}),
    1.28 +\item Zermelo's theorem (proved in \<open>Zorn.thy\<close> as theorem \<open>well_order_on\<close>),
    1.29  which states that on any given set there exists a well-order;
    1.30 -\item The well-founded-ness of @{text "<o"}, ensuring that then there exists a minimal
    1.31 +\item The well-founded-ness of \<open><o\<close>, ensuring that then there exists a minimal
    1.32  such well-order, i.e., a cardinal order.
    1.33  \end{itemize}
    1.34  \<close>
    1.35 @@ -348,7 +348,7 @@
    1.36  text\<open>Here we embark in a long journey of simple results showing
    1.37  that the standard set-theoretic operations are well-behaved w.r.t. the notion of
    1.38  cardinal -- essentially, this means that they preserve the ``cardinal identity"
    1.39 -@{text "=o"} and are monotonic w.r.t. @{text "\<le>o"}.
    1.40 +\<open>=o\<close> and are monotonic w.r.t. \<open>\<le>o\<close>.
    1.41  \<close>
    1.42  
    1.43  lemma card_of_empty: "|{}| \<le>o |A|"
    1.44 @@ -823,7 +823,7 @@
    1.45  
    1.46  text\<open>Here we show that, for infinite sets, most set-theoretic constructions
    1.47  do not increase the cardinality.  The cornerstone for this is
    1.48 -theorem @{text "Card_order_Times_same_infinite"}, which states that self-product
    1.49 +theorem \<open>Card_order_Times_same_infinite\<close>, which states that self-product
    1.50  does not increase cardinality -- the proof of this fact adapts a standard
    1.51  set-theoretic argument, as presented, e.g., in the proof of theorem 1.5.11
    1.52  at page 47 in @{cite "card-book"}. Then everything else follows fairly easily.\<close>
    1.53 @@ -1144,9 +1144,9 @@
    1.54  
    1.55  text\<open>The cardinal $\omega$, of natural numbers, shall be the standard non-strict
    1.56  order relation on
    1.57 -@{text "nat"}, that we abbreviate by @{text "natLeq"}.  The finite cardinals
    1.58 +\<open>nat\<close>, that we abbreviate by \<open>natLeq\<close>.  The finite cardinals
    1.59  shall be the restrictions of these relations to the numbers smaller than
    1.60 -fixed numbers @{text "n"}, that we abbreviate by @{text "natLeq_on n"}.\<close>
    1.61 +fixed numbers \<open>n\<close>, that we abbreviate by \<open>natLeq_on n\<close>.\<close>
    1.62  
    1.63  definition "(natLeq::(nat * nat) set) \<equiv> {(x,y). x \<le> y}"
    1.64  definition "(natLess::(nat * nat) set) \<equiv> {(x,y). x < y}"
    1.65 @@ -1260,9 +1260,9 @@
    1.66  
    1.67  subsection \<open>The successor of a cardinal\<close>
    1.68  
    1.69 -text\<open>First we define @{text "isCardSuc r r'"}, the notion of @{text "r'"}
    1.70 -being a successor cardinal of @{text "r"}. Although the definition does
    1.71 -not require @{text "r"} to be a cardinal, only this case will be meaningful.\<close>
    1.72 +text\<open>First we define \<open>isCardSuc r r'\<close>, the notion of \<open>r'\<close>
    1.73 +being a successor cardinal of \<open>r\<close>. Although the definition does
    1.74 +not require \<open>r\<close> to be a cardinal, only this case will be meaningful.\<close>
    1.75  
    1.76  definition isCardSuc :: "'a rel \<Rightarrow> 'a set rel \<Rightarrow> bool"
    1.77  where
    1.78 @@ -1270,8 +1270,8 @@
    1.79   Card_order r' \<and> r <o r' \<and>
    1.80   (\<forall>(r''::'a set rel). Card_order r'' \<and> r <o r'' \<longrightarrow> r' \<le>o r'')"
    1.81  
    1.82 -text\<open>Now we introduce the cardinal-successor operator @{text "cardSuc"},
    1.83 -by picking {\em some} cardinal-order relation fulfilling @{text "isCardSuc"}.
    1.84 +text\<open>Now we introduce the cardinal-successor operator \<open>cardSuc\<close>,
    1.85 +by picking {\em some} cardinal-order relation fulfilling \<open>isCardSuc\<close>.
    1.86  Again, the picked item shall be proved unique up to order-isomorphism.\<close>
    1.87  
    1.88  definition cardSuc :: "'a rel \<Rightarrow> 'a set rel"
    1.89 @@ -1312,8 +1312,8 @@
    1.90  "Card_order r \<Longrightarrow> r \<le>o cardSuc r"
    1.91  using cardSuc_greater ordLeq_iff_ordLess_or_ordIso by blast
    1.92  
    1.93 -text\<open>The minimality property of @{text "cardSuc"} originally present in its definition
    1.94 -is local to the type @{text "'a set rel"}, i.e., that of @{text "cardSuc r"}:\<close>
    1.95 +text\<open>The minimality property of \<open>cardSuc\<close> originally present in its definition
    1.96 +is local to the type \<open>'a set rel\<close>, i.e., that of \<open>cardSuc r\<close>:\<close>
    1.97  
    1.98  lemma cardSuc_least_aux:
    1.99  "\<lbrakk>Card_order (r::'a rel); Card_order (r'::'a set rel); r <o r'\<rbrakk> \<Longrightarrow> cardSuc r \<le>o r'"
     2.1 --- a/src/HOL/BNF_Wellorder_Constructions.thy	Mon Dec 07 10:23:50 2015 +0100
     2.2 +++ b/src/HOL/BNF_Wellorder_Constructions.thy	Mon Dec 07 10:38:04 2015 +0100
     2.3 @@ -14,11 +14,11 @@
     2.4  text \<open>In this section, we study basic constructions on well-orders, such as restriction to
     2.5  a set/order filter, copy via direct images, ordinal-like sum of disjoint well-orders,
     2.6  and bounded square.  We also define between well-orders
     2.7 -the relations @{text "ordLeq"}, of being embedded (abbreviated @{text "\<le>o"}),
     2.8 -@{text "ordLess"}, of being strictly embedded (abbreviated @{text "<o"}), and
     2.9 -@{text "ordIso"}, of being isomorphic (abbreviated @{text "=o"}).  We study the
    2.10 +the relations \<open>ordLeq\<close>, of being embedded (abbreviated \<open>\<le>o\<close>),
    2.11 +\<open>ordLess\<close>, of being strictly embedded (abbreviated \<open><o\<close>), and
    2.12 +\<open>ordIso\<close>, of being isomorphic (abbreviated \<open>=o\<close>).  We study the
    2.13  connections between these relations, order filters, and the aforementioned constructions.
    2.14 -A main result of this section is that @{text "<o"} is well-founded.\<close>
    2.15 +A main result of this section is that \<open><o\<close> is well-founded.\<close>
    2.16  
    2.17  
    2.18  subsection \<open>Restriction to a set\<close>
    2.19 @@ -306,14 +306,14 @@
    2.20  
    2.21  text \<open>We define three relations between well-orders:
    2.22  \begin{itemize}
    2.23 -\item @{text "ordLeq"}, of being embedded (abbreviated @{text "\<le>o"});
    2.24 -\item @{text "ordLess"}, of being strictly embedded (abbreviated @{text "<o"});
    2.25 -\item @{text "ordIso"}, of being isomorphic (abbreviated @{text "=o"}).
    2.26 +\item \<open>ordLeq\<close>, of being embedded (abbreviated \<open>\<le>o\<close>);
    2.27 +\item \<open>ordLess\<close>, of being strictly embedded (abbreviated \<open><o\<close>);
    2.28 +\item \<open>ordIso\<close>, of being isomorphic (abbreviated \<open>=o\<close>).
    2.29  \end{itemize}
    2.30  %
    2.31  The prefix "ord" and the index "o" in these names stand for "ordinal-like".
    2.32  These relations shall be proved to be inter-connected in a similar fashion as the trio
    2.33 -@{text "\<le>"}, @{text "<"}, @{text "="} associated to a total order on a set.
    2.34 +\<open>\<le>\<close>, \<open><\<close>, \<open>=\<close> associated to a total order on a set.
    2.35  \<close>
    2.36  
    2.37  definition ordLeq :: "('a rel * 'a' rel) set"
    2.38 @@ -347,10 +347,10 @@
    2.39  shows "Well_order r \<and> Well_order r'"
    2.40  using assms unfolding ordLeq_def by simp
    2.41  
    2.42 -text\<open>Notice that the relations @{text "\<le>o"}, @{text "<o"}, @{text "=o"} connect well-orders
    2.43 +text\<open>Notice that the relations \<open>\<le>o\<close>, \<open><o\<close>, \<open>=o\<close> connect well-orders
    2.44  on potentially {\em distinct} types. However, some of the lemmas below, including the next one,
    2.45 -restrict implicitly the type of these relations to @{text "(('a rel) * ('a rel)) set"} , i.e.,
    2.46 -to @{text "'a rel rel"}.\<close>
    2.47 +restrict implicitly the type of these relations to \<open>(('a rel) * ('a rel)) set\<close> , i.e.,
    2.48 +to \<open>'a rel rel\<close>.\<close>
    2.49  
    2.50  lemma ordLeq_reflexive:
    2.51  "Well_order r \<Longrightarrow> r \<le>o r"
    2.52 @@ -822,12 +822,12 @@
    2.53    ultimately show ?thesis using assms ordLeq_total ordIso_symmetric by blast
    2.54  qed
    2.55  
    2.56 -subsection\<open>@{text "<o"} is well-founded\<close>
    2.57 +subsection\<open>\<open><o\<close> is well-founded\<close>
    2.58  
    2.59 -text \<open>Of course, it only makes sense to state that the @{text "<o"} is well-founded
    2.60 -on the restricted type @{text "'a rel rel"}.  We prove this by first showing that, for any set
    2.61 +text \<open>Of course, it only makes sense to state that the \<open><o\<close> is well-founded
    2.62 +on the restricted type \<open>'a rel rel\<close>.  We prove this by first showing that, for any set
    2.63  of well-orders all embedded in a fixed well-order, the function mapping each well-order
    2.64 -in the set to an order filter of the fixed well-order is compatible w.r.t. to @{text "<o"} versus
    2.65 +in the set to an order filter of the fixed well-order is compatible w.r.t. to \<open><o\<close> versus
    2.66  {\em strict inclusion}; and we already know that strict inclusion of order filters is well-founded.\<close>
    2.67  
    2.68  definition ord_to_filter :: "'a rel \<Rightarrow> 'a rel \<Rightarrow> 'a set"
    2.69 @@ -885,8 +885,8 @@
    2.70  
    2.71  subsection \<open>Copy via direct images\<close>
    2.72  
    2.73 -text\<open>The direct image operator is the dual of the inverse image operator @{text "inv_image"}
    2.74 -from @{text "Relation.thy"}.  It is useful for transporting a well-order between
    2.75 +text\<open>The direct image operator is the dual of the inverse image operator \<open>inv_image\<close>
    2.76 +from \<open>Relation.thy\<close>.  It is useful for transporting a well-order between
    2.77  different types.\<close>
    2.78  
    2.79  definition dir_image :: "'a rel \<Rightarrow> ('a \<Rightarrow> 'a') \<Rightarrow> 'a' rel"
    2.80 @@ -1045,8 +1045,8 @@
    2.81  
    2.82  subsection \<open>Bounded square\<close>
    2.83  
    2.84 -text\<open>This construction essentially defines, for an order relation @{text "r"}, a lexicographic
    2.85 -order @{text "bsqr r"} on @{text "(Field r) \<times> (Field r)"}, applying the
    2.86 +text\<open>This construction essentially defines, for an order relation \<open>r\<close>, a lexicographic
    2.87 +order \<open>bsqr r\<close> on \<open>(Field r) \<times> (Field r)\<close>, applying the
    2.88  following criteria (in this order):
    2.89  \begin{itemize}
    2.90  \item compare the maximums;
     3.1 --- a/src/HOL/BNF_Wellorder_Embedding.thy	Mon Dec 07 10:23:50 2015 +0100
     3.2 +++ b/src/HOL/BNF_Wellorder_Embedding.thy	Mon Dec 07 10:38:04 2015 +0100
     3.3 @@ -60,13 +60,13 @@
     3.4  
     3.5  text\<open>Standardly, a function is an embedding of a well-order in another if it injectively and
     3.6  order-compatibly maps the former into an order filter of the latter.
     3.7 -Here we opt for a more succinct definition (operator @{text "embed"}),
     3.8 +Here we opt for a more succinct definition (operator \<open>embed\<close>),
     3.9  asking that, for any element in the source, the function should be a bijection
    3.10  between the set of strict lower bounds of that element
    3.11  and the set of strict lower bounds of its image.  (Later we prove equivalence with
    3.12 -the standard definition -- lemma @{text "embed_iff_compat_inj_on_ofilter"}.)
    3.13 -A {\em strict embedding} (operator @{text "embedS"})  is a non-bijective embedding
    3.14 -and an isomorphism (operator @{text "iso"}) is a bijective embedding.\<close>
    3.15 +the standard definition -- lemma \<open>embed_iff_compat_inj_on_ofilter\<close>.)
    3.16 +A {\em strict embedding} (operator \<open>embedS\<close>)  is a non-bijective embedding
    3.17 +and an isomorphism (operator \<open>iso\<close>) is a bijective embedding.\<close>
    3.18  
    3.19  definition embed :: "'a rel \<Rightarrow> 'a' rel \<Rightarrow> ('a \<Rightarrow> 'a') \<Rightarrow> bool"
    3.20  where
    3.21 @@ -151,7 +151,7 @@
    3.22  using assms unfolding iso_def
    3.23  by (auto simp add: comp_embed bij_betw_trans)
    3.24  
    3.25 -text\<open>That @{text "embedS"} is also preserved by function composition shall be proved only later.\<close>
    3.26 +text\<open>That \<open>embedS\<close> is also preserved by function composition shall be proved only later.\<close>
    3.27  
    3.28  lemma embed_Field:
    3.29  "\<lbrakk>Well_order r; embed r r' f\<rbrakk> \<Longrightarrow> f`(Field r) \<le> Field r'"
    3.30 @@ -454,22 +454,22 @@
    3.31  subsection \<open>Given any two well-orders, one can be embedded in the other\<close>
    3.32  
    3.33  text\<open>Here is an overview of the proof of of this fact, stated in theorem
    3.34 -@{text "wellorders_totally_ordered"}:
    3.35 +\<open>wellorders_totally_ordered\<close>:
    3.36  
    3.37 -   Fix the well-orders @{text "r::'a rel"} and @{text "r'::'a' rel"}.
    3.38 -   Attempt to define an embedding @{text "f::'a \<Rightarrow> 'a'"} from @{text "r"} to @{text "r'"} in the
    3.39 -   natural way by well-order recursion ("hoping" that @{text "Field r"} turns out to be smaller
    3.40 -   than @{text "Field r'"}), but also record, at the recursive step, in a function
    3.41 -   @{text "g::'a \<Rightarrow> bool"}, the extra information of whether @{text "Field r'"}
    3.42 +   Fix the well-orders \<open>r::'a rel\<close> and \<open>r'::'a' rel\<close>.
    3.43 +   Attempt to define an embedding \<open>f::'a \<Rightarrow> 'a'\<close> from \<open>r\<close> to \<open>r'\<close> in the
    3.44 +   natural way by well-order recursion ("hoping" that \<open>Field r\<close> turns out to be smaller
    3.45 +   than \<open>Field r'\<close>), but also record, at the recursive step, in a function
    3.46 +   \<open>g::'a \<Rightarrow> bool\<close>, the extra information of whether \<open>Field r'\<close>
    3.47     gets exhausted or not.
    3.48  
    3.49 -   If @{text "Field r'"} does not get exhausted, then @{text "Field r"} is indeed smaller
    3.50 -   and @{text "f"} is the desired embedding from @{text "r"} to @{text "r'"}
    3.51 -   (lemma @{text "wellorders_totally_ordered_aux"}).
    3.52 +   If \<open>Field r'\<close> does not get exhausted, then \<open>Field r\<close> is indeed smaller
    3.53 +   and \<open>f\<close> is the desired embedding from \<open>r\<close> to \<open>r'\<close>
    3.54 +   (lemma \<open>wellorders_totally_ordered_aux\<close>).
    3.55  
    3.56 -   Otherwise, it means that @{text "Field r'"} is the smaller one, and the inverse of
    3.57 -   (the "good" segment of) @{text "f"} is the desired embedding from @{text "r'"} to @{text "r"}
    3.58 -   (lemma @{text "wellorders_totally_ordered_aux2"}).
    3.59 +   Otherwise, it means that \<open>Field r'\<close> is the smaller one, and the inverse of
    3.60 +   (the "good" segment of) \<open>f\<close> is the desired embedding from \<open>r'\<close> to \<open>r\<close>
    3.61 +   (lemma \<open>wellorders_totally_ordered_aux2\<close>).
    3.62  \<close>
    3.63  
    3.64  lemma wellorders_totally_ordered_aux:
     4.1 --- a/src/HOL/BNF_Wellorder_Relation.thy	Mon Dec 07 10:23:50 2015 +0100
     4.2 +++ b/src/HOL/BNF_Wellorder_Relation.thy	Mon Dec 07 10:38:04 2015 +0100
     4.3 @@ -117,10 +117,10 @@
     4.4  
     4.5  text\<open>
     4.6  We define the successor {\em of a set}, and not of an element (the latter is of course
     4.7 -a particular case).  Also, we define the maximum {\em of two elements}, @{text "max2"},
     4.8 -and the minimum {\em of a set}, @{text "minim"} -- we chose these variants since we
     4.9 +a particular case).  Also, we define the maximum {\em of two elements}, \<open>max2\<close>,
    4.10 +and the minimum {\em of a set}, \<open>minim\<close> -- we chose these variants since we
    4.11  consider them the most useful for well-orders.  The minimum is defined in terms of the
    4.12 -auxiliary relational operator @{text "isMinim"}.  Then, supremum and successor are
    4.13 +auxiliary relational operator \<open>isMinim\<close>.  Then, supremum and successor are
    4.14  defined in terms of minimum as expected.
    4.15  The minimum is only meaningful for non-empty sets, and the successor is only
    4.16  meaningful for sets for which strict upper bounds exist.
     5.1 --- a/src/HOL/Binomial.thy	Mon Dec 07 10:23:50 2015 +0100
     5.2 +++ b/src/HOL/Binomial.thy	Mon Dec 07 10:38:04 2015 +0100
     5.3 @@ -146,7 +146,7 @@
     5.4      by (induct r rule: nat.induct) (auto simp add: fact_div_fact Suc_diff_Suc mult_le_mono)
     5.5  qed
     5.6  
     5.7 -lemma fact_numeral:  --\<open>Evaluation for specific numerals\<close>
     5.8 +lemma fact_numeral:  \<comment>\<open>Evaluation for specific numerals\<close>
     5.9    "fact (numeral k) = (numeral k) * (fact (pred_numeral k))"
    5.10    by (metis fact.simps(2) numeral_eq_Suc of_nat_numeral)
    5.11  
    5.12 @@ -230,7 +230,7 @@
    5.13    by (auto split add: nat_diff_split)
    5.14  
    5.15  
    5.16 -subsection \<open>Combinatorial theorems involving @{text "choose"}\<close>
    5.17 +subsection \<open>Combinatorial theorems involving \<open>choose\<close>\<close>
    5.18  
    5.19  text \<open>By Florian Kamm\"uller, tidied by LCP.\<close>
    5.20  
    5.21 @@ -890,7 +890,7 @@
    5.22      by (subst setsum_right_distrib, rule setsum.cong[OF refl], subst Suc_times_binomial)
    5.23         (simp add: algebra_simps of_nat_mult)
    5.24    also have "(\<Sum>i\<le>m. (-1 :: 'a) ^ i * of_nat ((m choose i))) = 0"
    5.25 -    using choose_alternating_sum[OF `m > 0`] by simp
    5.26 +    using choose_alternating_sum[OF \<open>m > 0\<close>] by simp
    5.27    finally show ?thesis by simp
    5.28  qed simp
    5.29  
    5.30 @@ -1266,7 +1266,7 @@
    5.31  text\<open>Versions of the theorems above for the natural-number version of "choose"\<close>
    5.32  lemma binomial_altdef_of_nat:
    5.33    fixes n k :: nat
    5.34 -    and x :: "'a :: {field_char_0,field}"  --\<open>the point is to constrain @{typ 'a}\<close>
    5.35 +    and x :: "'a :: {field_char_0,field}"  \<comment>\<open>the point is to constrain @{typ 'a}\<close>
    5.36    assumes "k \<le> n"
    5.37    shows "of_nat (n choose k) = (\<Prod>i<k. of_nat (n - i) / of_nat (k - i) :: 'a)"
    5.38  using assms
    5.39 @@ -1426,7 +1426,7 @@
    5.40    finally show ?thesis ..
    5.41  qed
    5.42  
    5.43 -text\<open>The number of nat lists of length @{text m} summing to @{text N} is
    5.44 +text\<open>The number of nat lists of length \<open>m\<close> summing to \<open>N\<close> is
    5.45  @{term "(N + m - 1) choose N"}:\<close>
    5.46  
    5.47  lemma card_length_listsum_rec:
    5.48 @@ -1473,7 +1473,7 @@
    5.49    finally show ?thesis .
    5.50  qed
    5.51  
    5.52 -lemma card_length_listsum: --"By Holden Lee, tidied by Tobias Nipkow"
    5.53 +lemma card_length_listsum: \<comment>"By Holden Lee, tidied by Tobias Nipkow"
    5.54    "card {l::nat list. size l = m \<and> listsum l = N} = (N + m - 1) choose N"
    5.55  proof (cases m)
    5.56    case 0 then show ?thesis
    5.57 @@ -1483,7 +1483,7 @@
    5.58      have m: "m\<ge>1" by (simp add: Suc)
    5.59      then show ?thesis
    5.60      proof (induct "N + m - 1" arbitrary: N m)
    5.61 -      case 0   -- "In the base case, the only solution is [0]."
    5.62 +      case 0   \<comment> "In the base case, the only solution is [0]."
    5.63        have [simp]: "{l::nat list. length l = Suc 0 \<and> (\<forall>n\<in>set l. n = 0)} = {[0]}"
    5.64          by (auto simp: length_Suc_conv)
    5.65        have "m=1 \<and> N=0" using 0 by linarith
    5.66 @@ -1519,7 +1519,7 @@
    5.67  qed
    5.68  
    5.69  
    5.70 -lemma Suc_times_binomial_add: -- \<open>by Lukas Bulwahn\<close>
    5.71 +lemma Suc_times_binomial_add: \<comment> \<open>by Lukas Bulwahn\<close>
    5.72    "Suc a * (Suc (a + b) choose Suc a) = Suc b * (Suc (a + b) choose a)"
    5.73  proof -
    5.74    have dvd: "Suc a * (fact a * fact b) dvd fact (Suc (a + b))" for a b
     6.1 --- a/src/HOL/Code_Evaluation.thy	Mon Dec 07 10:23:50 2015 +0100
     6.2 +++ b/src/HOL/Code_Evaluation.thy	Mon Dec 07 10:38:04 2015 +0100
     6.3 @@ -11,7 +11,7 @@
     6.4  
     6.5  subsection \<open>Term representation\<close>
     6.6  
     6.7 -subsubsection \<open>Terms and class @{text term_of}\<close>
     6.8 +subsubsection \<open>Terms and class \<open>term_of\<close>\<close>
     6.9  
    6.10  datatype (plugins only: code extraction) "term" = dummy_term
    6.11  
    6.12 @@ -87,7 +87,7 @@
    6.13  ML_file "~~/src/HOL/Tools/value.ML"
    6.14  
    6.15  
    6.16 -subsection \<open>@{text term_of} instances\<close>
    6.17 +subsection \<open>\<open>term_of\<close> instances\<close>
    6.18  
    6.19  instantiation "fun" :: (typerep, typerep) term_of
    6.20  begin
     7.1 --- a/src/HOL/Complete_Lattices.thy	Mon Dec 07 10:23:50 2015 +0100
     7.2 +++ b/src/HOL/Complete_Lattices.thy	Mon Dec 07 10:38:04 2015 +0100
     7.3 @@ -81,7 +81,7 @@
     7.4  
     7.5  text \<open>
     7.6    Note: must use names @{const INFIMUM} and @{const SUPREMUM} here instead of
     7.7 -  @{text INF} and @{text SUP} to allow the following syntax coexist
     7.8 +  \<open>INF\<close> and \<open>SUP\<close> to allow the following syntax coexist
     7.9    with the plain constant names.
    7.10  \<close>
    7.11  
    7.12 @@ -110,7 +110,7 @@
    7.13  print_translation \<open>
    7.14    [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax INFIMUM} @{syntax_const "_INF"},
    7.15      Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax SUPREMUM} @{syntax_const "_SUP"}]
    7.16 -\<close> -- \<open>to avoid eta-contraction of body\<close>
    7.17 +\<close> \<comment> \<open>to avoid eta-contraction of body\<close>
    7.18  
    7.19  subsection \<open>Abstract complete lattices\<close>
    7.20  
    7.21 @@ -274,7 +274,7 @@
    7.22  
    7.23  lemma INF_superset_mono:
    7.24    "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)"
    7.25 -  -- \<open>The last inclusion is POSITIVE!\<close>
    7.26 +  \<comment> \<open>The last inclusion is POSITIVE!\<close>
    7.27    by (blast intro: INF_mono dest: subsetD)
    7.28  
    7.29  lemma SUP_subset_mono:
    7.30 @@ -926,14 +926,14 @@
    7.31  text \<open>
    7.32    \medskip A ``destruct'' rule -- every @{term X} in @{term C}
    7.33    contains @{term A} as an element, but @{prop "A \<in> X"} can hold when
    7.34 -  @{prop "X \<in> C"} does not!  This rule is analogous to @{text spec}.
    7.35 +  @{prop "X \<in> C"} does not!  This rule is analogous to \<open>spec\<close>.
    7.36  \<close>
    7.37  
    7.38  lemma InterD [elim, Pure.elim]: "A \<in> \<Inter>C \<Longrightarrow> X \<in> C \<Longrightarrow> A \<in> X"
    7.39    by auto
    7.40  
    7.41  lemma InterE [elim]: "A \<in> \<Inter>C \<Longrightarrow> (X \<notin> C \<Longrightarrow> R) \<Longrightarrow> (A \<in> X \<Longrightarrow> R) \<Longrightarrow> R"
    7.42 -  -- \<open>``Classical'' elimination rule -- does not require proving
    7.43 +  \<comment> \<open>``Classical'' elimination rule -- does not require proving
    7.44      @{prop "X \<in> C"}.\<close>
    7.45    by (unfold Inter_eq) blast
    7.46  
    7.47 @@ -977,7 +977,7 @@
    7.48    "INTER \<equiv> INFIMUM"
    7.49  
    7.50  text \<open>
    7.51 -  Note: must use name @{const INTER} here instead of @{text INT}
    7.52 +  Note: must use name @{const INTER} here instead of \<open>INT\<close>
    7.53    to allow the following syntax coexist with the plain constant name.
    7.54  \<close>
    7.55  
    7.56 @@ -1001,7 +1001,7 @@
    7.57  
    7.58  print_translation \<open>
    7.59    [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax INTER} @{syntax_const "_INTER"}]
    7.60 -\<close> -- \<open>to avoid eta-contraction of body\<close>
    7.61 +\<close> \<comment> \<open>to avoid eta-contraction of body\<close>
    7.62  
    7.63  lemma INTER_eq:
    7.64    "(\<Inter>x\<in>A. B x) = {y. \<forall>x\<in>A. y \<in> B x}"
    7.65 @@ -1021,7 +1021,7 @@
    7.66    by auto
    7.67  
    7.68  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"
    7.69 -  -- \<open>"Classical" elimination -- by the Excluded Middle on @{prop "a\<in>A"}.\<close>
    7.70 +  \<comment> \<open>"Classical" elimination -- by the Excluded Middle on @{prop "a\<in>A"}.\<close>
    7.71    by (auto simp add: INF_def image_def)
    7.72  
    7.73  lemma Collect_ball_eq: "{x. \<forall>y\<in>A. P x y} = (\<Inter>y\<in>A. {x. P x y})"
    7.74 @@ -1068,7 +1068,7 @@
    7.75  
    7.76  lemma INT_anti_mono:
    7.77    "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)"
    7.78 -  -- \<open>The last inclusion is POSITIVE!\<close>
    7.79 +  \<comment> \<open>The last inclusion is POSITIVE!\<close>
    7.80    by (fact INF_superset_mono)
    7.81  
    7.82  lemma Pow_INT_eq: "Pow (\<Inter>x\<in>A. B x) = (\<Inter>x\<in>A. Pow (B x))"
    7.83 @@ -1102,7 +1102,7 @@
    7.84  
    7.85  lemma UnionI [intro]:
    7.86    "X \<in> C \<Longrightarrow> A \<in> X \<Longrightarrow> A \<in> \<Union>C"
    7.87 -  -- \<open>The order of the premises presupposes that @{term C} is rigid;
    7.88 +  \<comment> \<open>The order of the premises presupposes that @{term C} is rigid;
    7.89      @{term A} may be flexible.\<close>
    7.90    by auto
    7.91  
    7.92 @@ -1153,7 +1153,7 @@
    7.93    "UNION \<equiv> SUPREMUM"
    7.94  
    7.95  text \<open>
    7.96 -  Note: must use name @{const UNION} here instead of @{text UN}
    7.97 +  Note: must use name @{const UNION} here instead of \<open>UN\<close>
    7.98    to allow the following syntax coexist with the plain constant name.
    7.99  \<close>
   7.100  
   7.101 @@ -1177,7 +1177,7 @@
   7.102  
   7.103  text \<open>
   7.104    Note the difference between ordinary xsymbol syntax of indexed
   7.105 -  unions and intersections (e.g.\ @{text"\<Union>a\<^sub>1\<in>A\<^sub>1. B"})
   7.106 +  unions and intersections (e.g.\ \<open>\<Union>a\<^sub>1\<in>A\<^sub>1. B\<close>)
   7.107    and their \LaTeX\ rendition: @{term"\<Union>a\<^sub>1\<in>A\<^sub>1. B"}. The
   7.108    former does not make the index expression a subscript of the
   7.109    union/intersection symbol because this leads to problems with nested
   7.110 @@ -1186,7 +1186,7 @@
   7.111  
   7.112  print_translation \<open>
   7.113    [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax UNION} @{syntax_const "_UNION"}]
   7.114 -\<close> -- \<open>to avoid eta-contraction of body\<close>
   7.115 +\<close> \<comment> \<open>to avoid eta-contraction of body\<close>
   7.116  
   7.117  lemma UNION_eq:
   7.118    "(\<Union>x\<in>A. B x) = {y. \<exists>x\<in>A. y \<in> B x}"
   7.119 @@ -1211,7 +1211,7 @@
   7.120    using Union_iff [of _ "B ` A"] by simp
   7.121  
   7.122  lemma UN_I [intro]: "a \<in> A \<Longrightarrow> b \<in> B a \<Longrightarrow> b \<in> (\<Union>x\<in>A. B x)"
   7.123 -  -- \<open>The order of the premises presupposes that @{term A} is rigid;
   7.124 +  \<comment> \<open>The order of the premises presupposes that @{term A} is rigid;
   7.125      @{term b} may be flexible.\<close>
   7.126    by auto
   7.127  
   7.128 @@ -1295,7 +1295,7 @@
   7.129    by blast
   7.130  
   7.131  lemma vimage_eq_UN: "f -` B = (\<Union>y\<in>B. f -` {y})"
   7.132 -  -- \<open>NOT suitable for rewriting\<close>
   7.133 +  \<comment> \<open>NOT suitable for rewriting\<close>
   7.134    by blast
   7.135  
   7.136  lemma image_UN: "f ` UNION A B = (\<Union>x\<in>A. f ` B x)"
   7.137 @@ -1322,19 +1322,19 @@
   7.138  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)"
   7.139    by (rule sym) (rule SUP_sup_distrib)
   7.140  
   7.141 -lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A ` C) \<inter> \<Inter>(B ` C)" -- \<open>FIXME drop\<close>
   7.142 +lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A ` C) \<inter> \<Inter>(B ` C)" \<comment> \<open>FIXME drop\<close>
   7.143    by (simp add: INT_Int_distrib)
   7.144  
   7.145 -lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A ` C) \<union> \<Union>(B ` C)" -- \<open>FIXME drop\<close>
   7.146 -  -- \<open>Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5:\<close>
   7.147 -  -- \<open>Union of a family of unions\<close>
   7.148 +lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A ` C) \<union> \<Union>(B ` C)" \<comment> \<open>FIXME drop\<close>
   7.149 +  \<comment> \<open>Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5:\<close>
   7.150 +  \<comment> \<open>Union of a family of unions\<close>
   7.151    by (simp add: UN_Un_distrib)
   7.152  
   7.153  lemma Un_INT_distrib: "B \<union> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. B \<union> A i)"
   7.154    by (fact sup_INF)
   7.155  
   7.156  lemma Int_UN_distrib: "B \<inter> (\<Union>i\<in>I. A i) = (\<Union>i\<in>I. B \<inter> A i)"
   7.157 -  -- \<open>Halmos, Naive Set Theory, page 35.\<close>
   7.158 +  \<comment> \<open>Halmos, Naive Set Theory, page 35.\<close>
   7.159    by (fact inf_SUP)
   7.160  
   7.161  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)"
   7.162 @@ -1516,7 +1516,7 @@
   7.163  lemmas mem_simps =
   7.164    insert_iff empty_iff Un_iff Int_iff Compl_iff Diff_iff
   7.165    mem_Collect_eq UN_iff Union_iff INT_iff Inter_iff
   7.166 -  -- \<open>Each of these has ALREADY been added @{text "[simp]"} above.\<close>
   7.167 +  \<comment> \<open>Each of these has ALREADY been added \<open>[simp]\<close> above.\<close>
   7.168  
   7.169  end
   7.170  
     8.1 --- a/src/HOL/Complex.thy	Mon Dec 07 10:23:50 2015 +0100
     8.2 +++ b/src/HOL/Complex.thy	Mon Dec 07 10:38:04 2015 +0100
     8.3 @@ -11,8 +11,8 @@
     8.4  begin
     8.5  
     8.6  text \<open>
     8.7 -We use the @{text codatatype} command to define the type of complex numbers. This allows us to use
     8.8 -@{text primcorec} to define complex functions by defining their real and imaginary result
     8.9 +We use the \<open>codatatype\<close> command to define the type of complex numbers. This allows us to use
    8.10 +\<open>primcorec\<close> to define complex functions by defining their real and imaginary result
    8.11  separately.
    8.12  \<close>
    8.13  
     9.1 --- a/src/HOL/Deriv.thy	Mon Dec 07 10:23:50 2015 +0100
     9.2 +++ b/src/HOL/Deriv.thy	Mon Dec 07 10:38:04 2015 +0100
     9.3 @@ -444,7 +444,7 @@
     9.4  text \<open>
     9.5  
     9.6  This can not generally shown for @{const has_derivative}, as we need to approach the point from
     9.7 -all directions. There is a proof in @{text Multivariate_Analysis} for @{text euclidean_space}.
     9.8 +all directions. There is a proof in \<open>Multivariate_Analysis\<close> for \<open>euclidean_space\<close>.
     9.9  
    9.10  \<close>
    9.11  
    9.12 @@ -800,7 +800,7 @@
    9.13      by (auto intro: has_derivative_imp_has_field_derivative has_derivative_inverse)
    9.14  qed
    9.15  
    9.16 -text \<open>Power of @{text "-1"}\<close>
    9.17 +text \<open>Power of \<open>-1\<close>\<close>
    9.18  
    9.19  lemma DERIV_inverse:
    9.20    "x \<noteq> 0 \<Longrightarrow> ((\<lambda>x. inverse(x)) has_field_derivative - (inverse x ^ Suc (Suc 0))) (at x within s)"
    9.21 @@ -1079,9 +1079,9 @@
    9.22  
    9.23  text\<open>Rolle's Theorem.
    9.24     If @{term f} is defined and continuous on the closed interval
    9.25 -   @{text "[a,b]"} and differentiable on the open interval @{text "(a,b)"},
    9.26 +   \<open>[a,b]\<close> and differentiable on the open interval \<open>(a,b)\<close>,
    9.27     and @{term "f(a) = f(b)"},
    9.28 -   then there exists @{text "x0 \<in> (a,b)"} such that @{term "f'(x0) = 0"}\<close>
    9.29 +   then there exists \<open>x0 \<in> (a,b)\<close> such that @{term "f'(x0) = 0"}\<close>
    9.30  theorem Rolle:
    9.31    assumes lt: "a < b"
    9.32        and eq: "f(a) = f(b)"
    9.33 @@ -1101,7 +1101,7 @@
    9.34    show ?thesis
    9.35    proof cases
    9.36      assume axb: "a < x & x < b"
    9.37 -        --\<open>@{term f} attains its maximum within the interval\<close>
    9.38 +        \<comment>\<open>@{term f} attains its maximum within the interval\<close>
    9.39      hence ax: "a<x" and xb: "x<b" by arith + 
    9.40      from lemma_interval [OF ax xb]
    9.41      obtain d where d: "0<d" and bound: "\<forall>y. \<bar>x-y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b"
    9.42 @@ -1111,7 +1111,7 @@
    9.43      from differentiableD [OF dif [OF axb]]
    9.44      obtain l where der: "DERIV f x :> l" ..
    9.45      have "l=0" by (rule DERIV_local_max [OF der d bound'])
    9.46 -        --\<open>the derivative at a local maximum is zero\<close>
    9.47 +        \<comment>\<open>the derivative at a local maximum is zero\<close>
    9.48      thus ?thesis using ax xb der by auto
    9.49    next
    9.50      assume notaxb: "~ (a < x & x < b)"
    9.51 @@ -1120,7 +1120,7 @@
    9.52      show ?thesis
    9.53      proof cases
    9.54        assume ax'b: "a < x' & x' < b"
    9.55 -        --\<open>@{term f} attains its minimum within the interval\<close>
    9.56 +        \<comment>\<open>@{term f} attains its minimum within the interval\<close>
    9.57        hence ax': "a<x'" and x'b: "x'<b" by arith+ 
    9.58        from lemma_interval [OF ax' x'b]
    9.59        obtain d where d: "0<d" and bound: "\<forall>y. \<bar>x'-y\<bar> < d \<longrightarrow> a \<le> y \<and> y \<le> b"
    9.60 @@ -1130,11 +1130,11 @@
    9.61        from differentiableD [OF dif [OF ax'b]]
    9.62        obtain l where der: "DERIV f x' :> l" ..
    9.63        have "l=0" by (rule DERIV_local_min [OF der d bound'])
    9.64 -        --\<open>the derivative at a local minimum is zero\<close>
    9.65 +        \<comment>\<open>the derivative at a local minimum is zero\<close>
    9.66        thus ?thesis using ax' x'b der by auto
    9.67      next
    9.68        assume notax'b: "~ (a < x' & x' < b)"
    9.69 -        --\<open>@{term f} is constant througout the interval\<close>
    9.70 +        \<comment>\<open>@{term f} is constant througout the interval\<close>
    9.71        hence x'eqab: "x'=a | x'=b" using alex' x'leb by arith
    9.72        hence fb_eq_fx': "f b = f x'" by (auto simp add: eq)
    9.73        from dense [OF lt]
    9.74 @@ -1162,7 +1162,7 @@
    9.75        from differentiableD [OF dif [OF conjI [OF ar rb]]]
    9.76        obtain l where der: "DERIV f r :> l" ..
    9.77        have "l=0" by (rule DERIV_local_const [OF der d bound'])
    9.78 -        --\<open>the derivative of a constant function is zero\<close>
    9.79 +        \<comment>\<open>the derivative of a constant function is zero\<close>
    9.80        thus ?thesis using ar rb der by auto
    9.81      qed
    9.82    qed
    10.1 --- a/src/HOL/Divides.thy	Mon Dec 07 10:23:50 2015 +0100
    10.2 +++ b/src/HOL/Divides.thy	Mon Dec 07 10:38:04 2015 +0100
    10.3 @@ -220,7 +220,7 @@
    10.4  
    10.5  text \<open>Addition respects modular equivalence.\<close>
    10.6  
    10.7 -lemma mod_add_left_eq: -- \<open>FIXME reorient\<close>
    10.8 +lemma mod_add_left_eq: \<comment> \<open>FIXME reorient\<close>
    10.9    "(a + b) mod c = (a mod c + b) mod c"
   10.10  proof -
   10.11    have "(a + b) mod c = (a div c * c + a mod c + b) mod c"
   10.12 @@ -232,7 +232,7 @@
   10.13    finally show ?thesis .
   10.14  qed
   10.15  
   10.16 -lemma mod_add_right_eq: -- \<open>FIXME reorient\<close>
   10.17 +lemma mod_add_right_eq: \<comment> \<open>FIXME reorient\<close>
   10.18    "(a + b) mod c = (a + b mod c) mod c"
   10.19  proof -
   10.20    have "(a + b) mod c = (a + (b div c * c + b mod c)) mod c"
   10.21 @@ -244,7 +244,7 @@
   10.22    finally show ?thesis .
   10.23  qed
   10.24  
   10.25 -lemma mod_add_eq: -- \<open>FIXME reorient\<close>
   10.26 +lemma mod_add_eq: \<comment> \<open>FIXME reorient\<close>
   10.27    "(a + b) mod c = (a mod c + b mod c) mod c"
   10.28  by (rule trans [OF mod_add_left_eq mod_add_right_eq])
   10.29  
   10.30 @@ -261,7 +261,7 @@
   10.31  
   10.32  text \<open>Multiplication respects modular equivalence.\<close>
   10.33  
   10.34 -lemma mod_mult_left_eq: -- \<open>FIXME reorient\<close>
   10.35 +lemma mod_mult_left_eq: \<comment> \<open>FIXME reorient\<close>
   10.36    "(a * b) mod c = ((a mod c) * b) mod c"
   10.37  proof -
   10.38    have "(a * b) mod c = ((a div c * c + a mod c) * b) mod c"
   10.39 @@ -273,7 +273,7 @@
   10.40    finally show ?thesis .
   10.41  qed
   10.42  
   10.43 -lemma mod_mult_right_eq: -- \<open>FIXME reorient\<close>
   10.44 +lemma mod_mult_right_eq: \<comment> \<open>FIXME reorient\<close>
   10.45    "(a * b) mod c = (a * (b mod c)) mod c"
   10.46  proof -
   10.47    have "(a * b) mod c = (a * (b div c * c + b mod c)) mod c"
   10.48 @@ -285,7 +285,7 @@
   10.49    finally show ?thesis .
   10.50  qed
   10.51  
   10.52 -lemma mod_mult_eq: -- \<open>FIXME reorient\<close>
   10.53 +lemma mod_mult_eq: \<comment> \<open>FIXME reorient\<close>
   10.54    "(a * b) mod c = ((a mod c) * (b mod c)) mod c"
   10.55  by (rule trans [OF mod_mult_left_eq mod_mult_right_eq])
   10.56  
   10.57 @@ -573,7 +573,7 @@
   10.58      and divmod_step_def: "divmod_step l qr = (let (q, r) = qr
   10.59      in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
   10.60      else (2 * q, r))"
   10.61 -    -- \<open>These are conceptually definitions but force generated code
   10.62 +    \<comment> \<open>These are conceptually definitions but force generated code
   10.63      to be monomorphic wrt. particular instances of this class which
   10.64      yields a significant speedup.\<close>
   10.65  
   10.66 @@ -733,7 +733,7 @@
   10.67    with False show ?thesis by simp
   10.68  qed
   10.69  
   10.70 -text \<open>The division rewrite proper -- first, trivial results involving @{text 1}\<close>
   10.71 +text \<open>The division rewrite proper -- first, trivial results involving \<open>1\<close>\<close>
   10.72  
   10.73  lemma divmod_trivial [simp]:
   10.74    "divmod Num.One Num.One = (numeral Num.One, 0)"
   10.75 @@ -1428,7 +1428,7 @@
   10.76      fix k
   10.77      show "?A k"
   10.78      proof (induct k)
   10.79 -      show "?A 0" by simp  -- "by contradiction"
   10.80 +      show "?A 0" by simp  \<comment> "by contradiction"
   10.81      next
   10.82        fix n
   10.83        assume ih: "?A n"
   10.84 @@ -1638,7 +1638,7 @@
   10.85  
   10.86  subsection \<open>Division on @{typ int}\<close>
   10.87  
   10.88 -definition divmod_int_rel :: "int \<Rightarrow> int \<Rightarrow> int \<times> int \<Rightarrow> bool" -- \<open>definition of quotient and remainder\<close>
   10.89 +definition divmod_int_rel :: "int \<Rightarrow> int \<Rightarrow> int \<times> int \<Rightarrow> bool" \<comment> \<open>definition of quotient and remainder\<close>
   10.90    where "divmod_int_rel a b = (\<lambda>(q, r). a = b * q + r \<and>
   10.91      (if 0 < b then 0 \<le> r \<and> r < b else if b < 0 then b < r \<and> r \<le> 0 else q = 0))"
   10.92  
   10.93 @@ -1860,7 +1860,7 @@
   10.94  apply (auto simp add: divmod_int_rel_def)
   10.95  done
   10.96  
   10.97 -text\<open>There is no @{text mod_neg_pos_trivial}.\<close>
   10.98 +text\<open>There is no \<open>mod_neg_pos_trivial\<close>.\<close>
   10.99  
  10.100  
  10.101  subsubsection \<open>Laws for div and mod with Unary Minus\<close>
  10.102 @@ -2170,7 +2170,7 @@
  10.103  declare split_zmod [of _ _ "numeral k", arith_split] for k
  10.104  
  10.105  
  10.106 -subsubsection \<open>Computing @{text "div"} and @{text "mod"} with shifting\<close>
  10.107 +subsubsection \<open>Computing \<open>div\<close> and \<open>mod\<close> with shifting\<close>
  10.108  
  10.109  lemma pos_divmod_int_rel_mult_2:
  10.110    assumes "0 \<le> b"
  10.111 @@ -2272,8 +2272,8 @@
  10.112  lemma div_nonpos_pos_le0: "[| (a::int) \<le> 0; b > 0 |] ==> a div b \<le> 0"
  10.113  by (drule zdiv_mono1, auto)
  10.114  
  10.115 -text\<open>Now for some equivalences of the form @{text"a div b >=< 0 \<longleftrightarrow> \<dots>"}
  10.116 -conditional upon the sign of @{text a} or @{text b}. There are many more.
  10.117 +text\<open>Now for some equivalences of the form \<open>a div b >=< 0 \<longleftrightarrow> \<dots>\<close>
  10.118 +conditional upon the sign of \<open>a\<close> or \<open>b\<close>. There are many more.
  10.119  They should all be simp rules unless that causes too much search.\<close>
  10.120  
  10.121  lemma pos_imp_zdiv_nonneg_iff: "(0::int) < b ==> (0 \<le> a div b) = (0 \<le> a)"
  10.122 @@ -2466,7 +2466,7 @@
  10.123    power_mod
  10.124    zminus_zmod zdiff_zmod_left zdiff_zmod_right
  10.125  
  10.126 -text \<open>Distributive laws for function @{text nat}.\<close>
  10.127 +text \<open>Distributive laws for function \<open>nat\<close>.\<close>
  10.128  
  10.129  lemma nat_div_distrib: "0 \<le> x \<Longrightarrow> nat (x div y) = nat x div nat y"
  10.130  apply (rule linorder_cases [of y 0])
    11.1 --- a/src/HOL/Enum.thy	Mon Dec 07 10:23:50 2015 +0100
    11.2 +++ b/src/HOL/Enum.thy	Mon Dec 07 10:38:04 2015 +0100
    11.3 @@ -6,7 +6,7 @@
    11.4  imports Map Groups_List
    11.5  begin
    11.6  
    11.7 -subsection \<open>Class @{text enum}\<close>
    11.8 +subsection \<open>Class \<open>enum\<close>\<close>
    11.9  
   11.10  class enum =
   11.11    fixes enum :: "'a list"
   11.12 @@ -16,7 +16,7 @@
   11.13      and enum_distinct: "distinct enum"
   11.14    assumes enum_all_UNIV: "enum_all P \<longleftrightarrow> Ball UNIV P"
   11.15    assumes enum_ex_UNIV: "enum_ex P \<longleftrightarrow> Bex UNIV P" 
   11.16 -   -- \<open>tailored towards simple instantiation\<close>
   11.17 +   \<comment> \<open>tailored towards simple instantiation\<close>
   11.18  begin
   11.19  
   11.20  subclass finite proof
    12.1 --- a/src/HOL/Equiv_Relations.thy	Mon Dec 07 10:23:50 2015 +0100
    12.2 +++ b/src/HOL/Equiv_Relations.thy	Mon Dec 07 10:38:04 2015 +0100
    12.3 @@ -23,10 +23,10 @@
    12.4    using assms by (simp add: equiv_def)
    12.5  
    12.6  text \<open>
    12.7 -  Suppes, Theorem 70: @{text r} is an equiv relation iff @{text "r\<inverse> O
    12.8 -  r = r"}.
    12.9 +  Suppes, Theorem 70: \<open>r\<close> is an equiv relation iff \<open>r\<inverse> O
   12.10 +  r = r\<close>.
   12.11  
   12.12 -  First half: @{text "equiv A r ==> r\<inverse> O r = r"}.
   12.13 +  First half: \<open>equiv A r ==> r\<inverse> O r = r\<close>.
   12.14  \<close>
   12.15  
   12.16  lemma sym_trans_comp_subset:
   12.17 @@ -59,7 +59,7 @@
   12.18  
   12.19  lemma equiv_class_subset:
   12.20    "equiv A r ==> (a, b) \<in> r ==> r``{a} \<subseteq> r``{b}"
   12.21 -  -- \<open>lemma for the next result\<close>
   12.22 +  \<comment> \<open>lemma for the next result\<close>
   12.23    by (unfold equiv_def trans_def sym_def) blast
   12.24  
   12.25  theorem equiv_class_eq: "equiv A r ==> (a, b) \<in> r ==> r``{a} = r``{b}"
   12.26 @@ -73,7 +73,7 @@
   12.27  
   12.28  lemma subset_equiv_class:
   12.29      "equiv A r ==> r``{b} \<subseteq> r``{a} ==> b \<in> A ==> (a,b) \<in> r"
   12.30 -  -- \<open>lemma for the next result\<close>
   12.31 +  \<comment> \<open>lemma for the next result\<close>
   12.32    by (unfold equiv_def refl_on_def) blast
   12.33  
   12.34  lemma eq_equiv_class:
   12.35 @@ -99,7 +99,7 @@
   12.36  subsection \<open>Quotients\<close>
   12.37  
   12.38  definition quotient :: "'a set \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> 'a set set"  (infixl "'/'/" 90) where
   12.39 -  "A//r = (\<Union>x \<in> A. {r``{x}})"  -- \<open>set of equiv classes\<close>
   12.40 +  "A//r = (\<Union>x \<in> A. {r``{x}})"  \<comment> \<open>set of equiv classes\<close>
   12.41  
   12.42  lemma quotientI: "x \<in> A ==> r``{x} \<in> A//r"
   12.43    by (unfold quotient_def) blast
   12.44 @@ -209,13 +209,13 @@
   12.45  
   12.46  
   12.47  lemma UN_constant_eq: "a \<in> A ==> \<forall>y \<in> A. f y = c ==> (\<Union>y \<in> A. f(y))=c"
   12.48 -  -- \<open>lemma required to prove @{text UN_equiv_class}\<close>
   12.49 +  \<comment> \<open>lemma required to prove \<open>UN_equiv_class\<close>\<close>
   12.50    by auto
   12.51  
   12.52  lemma UN_equiv_class:
   12.53    "equiv A r ==> f respects r ==> a \<in> A
   12.54      ==> (\<Union>x \<in> r``{a}. f x) = f a"
   12.55 -  -- \<open>Conversion rule\<close>
   12.56 +  \<comment> \<open>Conversion rule\<close>
   12.57    apply (rule equiv_class_self [THEN UN_constant_eq], assumption+)
   12.58    apply (unfold equiv_def congruent_def sym_def)
   12.59    apply (blast del: equalityI)
   12.60 @@ -232,8 +232,8 @@
   12.61  
   12.62  text \<open>
   12.63    Sufficient conditions for injectiveness.  Could weaken premises!
   12.64 -  major premise could be an inclusion; bcong could be @{text "!!y. y \<in>
   12.65 -  A ==> f y \<in> B"}.
   12.66 +  major premise could be an inclusion; bcong could be \<open>!!y. y \<in>
   12.67 +  A ==> f y \<in> B\<close>.
   12.68  \<close>
   12.69  
   12.70  lemma UN_equiv_class_inject:
   12.71 @@ -310,8 +310,8 @@
   12.72  lemma UN_UN_split_split_eq:
   12.73    "(\<Union>(x1, x2) \<in> X. \<Union>(y1, y2) \<in> Y. A x1 x2 y1 y2) =
   12.74      (\<Union>x \<in> X. \<Union>y \<in> Y. (\<lambda>(x1, x2). (\<lambda>(y1, y2). A x1 x2 y1 y2) y) x)"
   12.75 -  -- \<open>Allows a natural expression of binary operators,\<close>
   12.76 -  -- \<open>without explicit calls to @{text split}\<close>
   12.77 +  \<comment> \<open>Allows a natural expression of binary operators,\<close>
   12.78 +  \<comment> \<open>without explicit calls to \<open>split\<close>\<close>
   12.79    by auto
   12.80  
   12.81  lemma congruent2I:
   12.82 @@ -319,8 +319,8 @@
   12.83      ==> (!!y z w. w \<in> A2 ==> (y,z) \<in> r1 ==> f y w = f z w)
   12.84      ==> (!!y z w. w \<in> A1 ==> (y,z) \<in> r2 ==> f w y = f w z)
   12.85      ==> congruent2 r1 r2 f"
   12.86 -  -- \<open>Suggested by John Harrison -- the two subproofs may be\<close>
   12.87 -  -- \<open>\emph{much} simpler than the direct proof.\<close>
   12.88 +  \<comment> \<open>Suggested by John Harrison -- the two subproofs may be\<close>
   12.89 +  \<comment> \<open>\emph{much} simpler than the direct proof.\<close>
   12.90    apply (unfold congruent2_def equiv_def refl_on_def)
   12.91    apply clarify
   12.92    apply (blast intro: trans)
   12.93 @@ -345,7 +345,7 @@
   12.94  text \<open>Suggested by Florian Kammüller\<close>
   12.95  
   12.96  lemma finite_quotient: "finite A ==> r \<subseteq> A \<times> A ==> finite (A//r)"
   12.97 -  -- \<open>recall @{thm equiv_type}\<close>
   12.98 +  \<comment> \<open>recall @{thm equiv_type}\<close>
   12.99    apply (rule finite_subset)
  12.100     apply (erule_tac [2] finite_Pow_iff [THEN iffD2])
  12.101    apply (unfold quotient_def)
  12.102 @@ -435,7 +435,7 @@
  12.103  
  12.104  definition part_equivp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
  12.105    "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)"
  12.106 -    -- \<open>John-Harrison-style characterization\<close>
  12.107 +    \<comment> \<open>John-Harrison-style characterization\<close>
  12.108  
  12.109  lemma part_equivpI:
  12.110    "(\<exists>x. R x x) \<Longrightarrow> symp R \<Longrightarrow> transp R \<Longrightarrow> part_equivp R"
  12.111 @@ -484,7 +484,7 @@
  12.112  text \<open>Total equivalences\<close>
  12.113  
  12.114  definition equivp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
  12.115 -  "equivp R \<longleftrightarrow> (\<forall>x y. R x y = (R x = R y))" -- \<open>John-Harrison-style characterization\<close>
  12.116 +  "equivp R \<longleftrightarrow> (\<forall>x y. R x y = (R x = R y))" \<comment> \<open>John-Harrison-style characterization\<close>
  12.117  
  12.118  lemma equivpI:
  12.119    "reflp R \<Longrightarrow> symp R \<Longrightarrow> transp R \<Longrightarrow> equivp R"
    13.1 --- a/src/HOL/Fields.thy	Mon Dec 07 10:23:50 2015 +0100
    13.2 +++ b/src/HOL/Fields.thy	Mon Dec 07 10:38:04 2015 +0100
    13.3 @@ -29,7 +29,7 @@
    13.4  
    13.5  end
    13.6  
    13.7 -text\<open>Lemmas @{text divide_simps} move division to the outside and eliminates them on (in)equalities.\<close>
    13.8 +text\<open>Lemmas \<open>divide_simps\<close> move division to the outside and eliminates them on (in)equalities.\<close>
    13.9  
   13.10  named_theorems divide_simps "rewrite rules to eliminate divisions"
   13.11  
   13.12 @@ -396,8 +396,7 @@
   13.13  
   13.14  text \<open>Calculations with fractions\<close>
   13.15  
   13.16 -text\<open>There is a whole bunch of simp-rules just for class @{text
   13.17 -field} but none for class @{text field} and @{text nonzero_divides}
   13.18 +text\<open>There is a whole bunch of simp-rules just for class \<open>field\<close> but none for class \<open>field\<close> and \<open>nonzero_divides\<close>
   13.19  because the latter are covered by a simproc.\<close>
   13.20  
   13.21  lemma mult_divide_mult_cancel_left:
   13.22 @@ -736,7 +735,7 @@
   13.23    finally show ?thesis .
   13.24  qed
   13.25  
   13.26 -text\<open>The following @{text field_simps} rules are necessary, as minus is always moved atop of
   13.27 +text\<open>The following \<open>field_simps\<close> rules are necessary, as minus is always moved atop of
   13.28  division but we want to get rid of division.\<close>
   13.29  
   13.30  lemma pos_le_minus_divide_eq [field_simps]: "0 < c \<Longrightarrow> a \<le> - (b / c) \<longleftrightarrow> a * c \<le> - b"
   13.31 @@ -771,9 +770,8 @@
   13.32    "y \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> x / y \<le> w / z \<longleftrightarrow> (x * z - w * y) / (y * z) \<le> 0"
   13.33    by (subst le_iff_diff_le_0) (simp add: diff_frac_eq )
   13.34  
   13.35 -text\<open>Lemmas @{text sign_simps} is a first attempt to automate proofs
   13.36 -of positivity/negativity needed for @{text field_simps}. Have not added @{text
   13.37 -sign_simps} to @{text field_simps} because the former can lead to case
   13.38 +text\<open>Lemmas \<open>sign_simps\<close> is a first attempt to automate proofs
   13.39 +of positivity/negativity needed for \<open>field_simps\<close>. Have not added \<open>sign_simps\<close> to \<open>field_simps\<close> because the former can lead to case
   13.40  explosions.\<close>
   13.41  
   13.42  lemmas sign_simps = algebra_simps zero_less_mult_iff mult_less_0_iff
   13.43 @@ -1006,7 +1004,7 @@
   13.44  lemma one_divide_eq_0_iff [simp]: "1 / a = 0 \<longleftrightarrow> a = 0"
   13.45    using zero_eq_1_divide_iff[of a] by simp
   13.46  
   13.47 -text\<open>Simplify expressions such as @{text "0 < 1/x"} to @{text "0 < x"}\<close>
   13.48 +text\<open>Simplify expressions such as \<open>0 < 1/x\<close> to \<open>0 < x\<close>\<close>
   13.49  
   13.50  lemma zero_le_divide_1_iff [simp]:
   13.51    "0 \<le> 1 / a \<longleftrightarrow> 0 \<le> a"
    14.1 --- a/src/HOL/Finite_Set.thy	Mon Dec 07 10:23:50 2015 +0100
    14.2 +++ b/src/HOL/Finite_Set.thy	Mon Dec 07 10:38:04 2015 +0100
    14.3 @@ -27,7 +27,7 @@
    14.4  declare [[simproc del: finite_Collect]]
    14.5  
    14.6  lemma finite_induct [case_names empty insert, induct set: finite]:
    14.7 -  -- \<open>Discharging @{text "x \<notin> F"} entails extra work.\<close>
    14.8 +  \<comment> \<open>Discharging \<open>x \<notin> F\<close> entails extra work.\<close>
    14.9    assumes "finite F"
   14.10    assumes "P {}"
   14.11      and insert: "\<And>x F. finite F \<Longrightarrow> x \<notin> F \<Longrightarrow> P F \<Longrightarrow> P (insert x F)"
   14.12 @@ -61,7 +61,7 @@
   14.13  
   14.14  subsubsection \<open>Choice principles\<close>
   14.15  
   14.16 -lemma ex_new_if_finite: -- "does not depend on def of finite at all"
   14.17 +lemma ex_new_if_finite: \<comment> "does not depend on def of finite at all"
   14.18    assumes "\<not> finite (UNIV :: 'a set)" and "finite A"
   14.19    shows "\<exists>a::'a. a \<notin> A"
   14.20  proof -
   14.21 @@ -574,7 +574,7 @@
   14.22  qed
   14.23  
   14.24  
   14.25 -subsection \<open>Class @{text finite}\<close>
   14.26 +subsection \<open>Class \<open>finite\<close>\<close>
   14.27  
   14.28  class finite =
   14.29    assumes finite_UNIV: "finite (UNIV :: 'a set)"
   14.30 @@ -624,8 +624,8 @@
   14.31  subsection \<open>A basic fold functional for finite sets\<close>
   14.32  
   14.33  text \<open>The intended behaviour is
   14.34 -@{text "fold f z {x\<^sub>1, ..., x\<^sub>n} = f x\<^sub>1 (\<dots> (f x\<^sub>n z)\<dots>)"}
   14.35 -if @{text f} is ``left-commutative'':
   14.36 +\<open>fold f z {x\<^sub>1, ..., x\<^sub>n} = f x\<^sub>1 (\<dots> (f x\<^sub>n z)\<dots>)\<close>
   14.37 +if \<open>f\<close> is ``left-commutative'':
   14.38  \<close>
   14.39  
   14.40  locale comp_fun_commute =
   14.41 @@ -656,7 +656,7 @@
   14.42  text\<open>A tempting alternative for the definiens is
   14.43  @{term "if finite A then THE y. fold_graph f z A y else e"}.
   14.44  It allows the removal of finiteness assumptions from the theorems
   14.45 -@{text fold_comm}, @{text fold_reindex} and @{text fold_distrib}.
   14.46 +\<open>fold_comm\<close>, \<open>fold_reindex\<close> and \<open>fold_distrib\<close>.
   14.47  The proofs become ugly. It is not worth the effort. (???)\<close>
   14.48  
   14.49  lemma finite_imp_fold_graph: "finite A \<Longrightarrow> \<exists>x. fold_graph f z A x"
   14.50 @@ -723,7 +723,7 @@
   14.51    with assms show ?thesis by (simp add: fold_def)
   14.52  qed
   14.53  
   14.54 -text \<open>The base case for @{text fold}:\<close>
   14.55 +text \<open>The base case for \<open>fold\<close>:\<close>
   14.56  
   14.57  lemma (in -) fold_infinite [simp]:
   14.58    assumes "\<not> finite A"
   14.59 @@ -747,7 +747,7 @@
   14.60  qed
   14.61  
   14.62  declare (in -) empty_fold_graphE [rule del] fold_graph.intros [rule del]
   14.63 -  -- \<open>No more proofs involve these.\<close>
   14.64 +  \<comment> \<open>No more proofs involve these.\<close>
   14.65  
   14.66  lemma fold_fun_left_comm:
   14.67    "finite A \<Longrightarrow> f x (fold f z A) = fold f (f x z) A"
   14.68 @@ -884,7 +884,7 @@
   14.69  end
   14.70  
   14.71  
   14.72 -subsubsection \<open>Liftings to @{text comp_fun_commute} etc.\<close>
   14.73 +subsubsection \<open>Liftings to \<open>comp_fun_commute\<close> etc.\<close>
   14.74  
   14.75  lemma (in comp_fun_commute) comp_comp_fun_commute:
   14.76    "comp_fun_commute (f \<circ> g)"
    15.1 --- a/src/HOL/Fun.thy	Mon Dec 07 10:23:50 2015 +0100
    15.2 +++ b/src/HOL/Fun.thy	Mon Dec 07 10:38:04 2015 +0100
    15.3 @@ -22,7 +22,7 @@
    15.4  lemma b_uniq_choice: "\<forall>x\<in>S. \<exists>!y. Q x y \<Longrightarrow> \<exists>f. \<forall>x\<in>S. Q x (f x)"
    15.5    by (force intro: theI')
    15.6  
    15.7 -subsection \<open>The Identity Function @{text id}\<close>
    15.8 +subsection \<open>The Identity Function \<open>id\<close>\<close>
    15.9  
   15.10  definition id :: "'a \<Rightarrow> 'a" where
   15.11    "id = (\<lambda>x. x)"
   15.12 @@ -40,7 +40,7 @@
   15.13    constant id \<rightharpoonup> (Haskell) "id"
   15.14  
   15.15  
   15.16 -subsection \<open>The Composition Operator @{text "f \<circ> g"}\<close>
   15.17 +subsection \<open>The Composition Operator \<open>f \<circ> g\<close>\<close>
   15.18  
   15.19  definition comp :: "('b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "o" 55) where
   15.20    "f o g = (\<lambda>x. f (g x))"
   15.21 @@ -103,7 +103,7 @@
   15.22    constant comp \<rightharpoonup> (SML) infixl 5 "o" and (Haskell) infixr 9 "."
   15.23  
   15.24  
   15.25 -subsection \<open>The Forward Composition Operator @{text fcomp}\<close>
   15.26 +subsection \<open>The Forward Composition Operator \<open>fcomp\<close>\<close>
   15.27  
   15.28  definition fcomp :: "('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'c) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "\<circ>>" 60) where
   15.29    "f \<circ>> g = (\<lambda>x. g (f x))"
   15.30 @@ -141,10 +141,10 @@
   15.31  
   15.32  subsection \<open>Injectivity and Bijectivity\<close>
   15.33  
   15.34 -definition inj_on :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool" where -- "injective"
   15.35 +definition inj_on :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool" where \<comment> "injective"
   15.36    "inj_on f A \<longleftrightarrow> (\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y)"
   15.37  
   15.38 -definition bij_betw :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set \<Rightarrow> bool" where -- "bijective"
   15.39 +definition bij_betw :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set \<Rightarrow> bool" where \<comment> "bijective"
   15.40    "bij_betw f A B \<longleftrightarrow> inj_on f A \<and> f ` A = B"
   15.41  
   15.42  text\<open>A common special case: functions injective, surjective or bijective over
   15.43 @@ -153,7 +153,7 @@
   15.44  abbreviation
   15.45    "inj f \<equiv> inj_on f UNIV"
   15.46  
   15.47 -abbreviation surj :: "('a \<Rightarrow> 'b) \<Rightarrow> bool" where -- "surjective"
   15.48 +abbreviation surj :: "('a \<Rightarrow> 'b) \<Rightarrow> bool" where \<comment> "surjective"
   15.49    "surj f \<equiv> (range f = UNIV)"
   15.50  
   15.51  abbreviation
   15.52 @@ -290,7 +290,7 @@
   15.53  lemma linorder_injI:
   15.54    assumes hyp: "\<And>x y. x < (y::'a::linorder) \<Longrightarrow> f x \<noteq> f y"
   15.55    shows "inj f"
   15.56 -  -- \<open>Courtesy of Stephan Merz\<close>
   15.57 +  \<comment> \<open>Courtesy of Stephan Merz\<close>
   15.58  proof (rule inj_onI)
   15.59    fix x y
   15.60    assume f_eq: "f x = f y"
   15.61 @@ -524,7 +524,7 @@
   15.62  done
   15.63  
   15.64  lemma inj_vimage_singleton: "inj f \<Longrightarrow> f -` {a} \<subseteq> {THE x. f x = a}"
   15.65 -  -- \<open>The inverse image of a singleton under an injective function
   15.66 +  \<comment> \<open>The inverse image of a singleton under an injective function
   15.67           is included in a singleton.\<close>
   15.68    apply (auto simp add: inj_on_def)
   15.69    apply (blast intro: the_equality [symmetric])
   15.70 @@ -669,7 +669,7 @@
   15.71  lemma fun_upd_eqD: "f(x := y) = g(x := z) \<Longrightarrow> y = z"
   15.72  by(simp add: fun_eq_iff split: split_if_asm)
   15.73  
   15.74 -subsection \<open>@{text override_on}\<close>
   15.75 +subsection \<open>\<open>override_on\<close>\<close>
   15.76  
   15.77  definition override_on :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'a \<Rightarrow> 'b" where
   15.78    "override_on f g A = (\<lambda>a. if a \<in> A then g a else f a)"
   15.79 @@ -684,7 +684,7 @@
   15.80  by(simp add:override_on_def)
   15.81  
   15.82  
   15.83 -subsection \<open>@{text swap}\<close>
   15.84 +subsection \<open>\<open>swap\<close>\<close>
   15.85  
   15.86  definition swap :: "'a \<Rightarrow> 'a \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b)"
   15.87  where
    16.1 --- a/src/HOL/Fun_Def.thy	Mon Dec 07 10:23:50 2015 +0100
    16.2 +++ b/src/HOL/Fun_Def.thy	Mon Dec 07 10:38:04 2015 +0100
    16.3 @@ -223,7 +223,7 @@
    16.4  lemma wf_pair_less[simp]: "wf pair_less"
    16.5    by (auto simp: pair_less_def)
    16.6  
    16.7 -text \<open>Introduction rules for @{text pair_less}/@{text pair_leq}\<close>
    16.8 +text \<open>Introduction rules for \<open>pair_less\<close>/\<open>pair_leq\<close>\<close>
    16.9  lemma pair_leqI1: "a < b \<Longrightarrow> ((a, s), (b, t)) \<in> pair_leq"
   16.10    and pair_leqI2: "a \<le> b \<Longrightarrow> s \<le> t \<Longrightarrow> ((a, s), (b, t)) \<in> pair_leq"
   16.11    and pair_lessI1: "a < b  \<Longrightarrow> ((a, s), (b, t)) \<in> pair_less"
   16.12 @@ -301,7 +301,7 @@
   16.13  ML_file "Tools/Function/scnp_reconstruct.ML"
   16.14  ML_file "Tools/Function/fun_cases.ML"
   16.15  
   16.16 -ML_val -- "setup inactive"
   16.17 +ML_val \<comment> "setup inactive"
   16.18  \<open>
   16.19    Context.theory_map (Function_Common.set_termination_prover
   16.20      (K (ScnpReconstruct.decomp_scnp_tac [ScnpSolve.MAX, ScnpSolve.MIN, ScnpSolve.MS])))
    17.1 --- a/src/HOL/GCD.thy	Mon Dec 07 10:23:50 2015 +0100
    17.2 +++ b/src/HOL/GCD.thy	Mon Dec 07 10:38:04 2015 +0100
    17.3 @@ -417,7 +417,7 @@
    17.4      by (auto intro: associated_eqI)
    17.5  qed
    17.6  
    17.7 -lemma dvd_Gcd: -- \<open>FIXME remove\<close>
    17.8 +lemma dvd_Gcd: \<comment> \<open>FIXME remove\<close>
    17.9    "\<forall>b\<in>A. a dvd b \<Longrightarrow> a dvd Gcd A"
   17.10    by (blast intro: Gcd_greatest)
   17.11  
   17.12 @@ -745,7 +745,7 @@
   17.13  declare gcd_nat.simps [simp del]
   17.14  
   17.15  text \<open>
   17.16 -  \medskip @{term "gcd m n"} divides @{text m} and @{text n}.  The
   17.17 +  \medskip @{term "gcd m n"} divides \<open>m\<close> and \<open>n\<close>.  The
   17.18    conjunctions don't seem provable separately.
   17.19  \<close>
   17.20  
   17.21 @@ -873,7 +873,7 @@
   17.22  \<close>
   17.23  
   17.24  lemma gcd_mult_distrib_nat: "(k::nat) * gcd m n = gcd (k * m) (k * n)"
   17.25 -    -- \<open>@{cite \<open>page 27\<close> davenport92}\<close>
   17.26 +    \<comment> \<open>@{cite \<open>page 27\<close> davenport92}\<close>
   17.27    apply (induct m n rule: gcd_nat_induct)
   17.28    apply simp
   17.29    apply (case_tac "k = 0")
    18.1 --- a/src/HOL/Groebner_Basis.thy	Mon Dec 07 10:23:50 2015 +0100
    18.2 +++ b/src/HOL/Groebner_Basis.thy	Mon Dec 07 10:38:04 2015 +0100
    18.3 @@ -10,9 +10,9 @@
    18.4  
    18.5  subsection \<open>Groebner Bases\<close>
    18.6  
    18.7 -lemmas bool_simps = simp_thms(1-34) -- \<open>FIXME move to @{theory HOL}\<close>
    18.8 +lemmas bool_simps = simp_thms(1-34) \<comment> \<open>FIXME move to @{theory HOL}\<close>
    18.9  
   18.10 -lemma nnf_simps: -- \<open>FIXME shadows fact binding in @{theory HOL}\<close>
   18.11 +lemma nnf_simps: \<comment> \<open>FIXME shadows fact binding in @{theory HOL}\<close>
   18.12    "(\<not>(P \<and> Q)) = (\<not>P \<or> \<not>Q)" "(\<not>(P \<or> Q)) = (\<not>P \<and> \<not>Q)"
   18.13    "(P \<longrightarrow> Q) = (\<not>P \<or> Q)"
   18.14    "(P = Q) = ((P \<and> Q) \<or> (\<not>P \<and> \<not> Q))" "(\<not> \<not>(P)) = P"
    19.1 --- a/src/HOL/Groups.thy	Mon Dec 07 10:23:50 2015 +0100
    19.2 +++ b/src/HOL/Groups.thy	Mon Dec 07 10:38:04 2015 +0100
    19.3 @@ -13,22 +13,22 @@
    19.4  named_theorems ac_simps "associativity and commutativity simplification rules"
    19.5  
    19.6  
    19.7 -text\<open>The rewrites accumulated in @{text algebra_simps} deal with the
    19.8 +text\<open>The rewrites accumulated in \<open>algebra_simps\<close> deal with the
    19.9  classical algebraic structures of groups, rings and family. They simplify
   19.10  terms by multiplying everything out (in case of a ring) and bringing sums and
   19.11  products into a canonical form (by ordered rewriting). As a result it decides
   19.12  group and ring equalities but also helps with inequalities.
   19.13  
   19.14  Of course it also works for fields, but it knows nothing about multiplicative
   19.15 -inverses or division. This is catered for by @{text field_simps}.\<close>
   19.16 +inverses or division. This is catered for by \<open>field_simps\<close>.\<close>
   19.17  
   19.18  named_theorems algebra_simps "algebra simplification rules"
   19.19  
   19.20  
   19.21 -text\<open>Lemmas @{text field_simps} multiply with denominators in (in)equations
   19.22 +text\<open>Lemmas \<open>field_simps\<close> multiply with denominators in (in)equations
   19.23  if they can be proved to be non-zero (for equations) or positive/negative
   19.24  (for inequations). Can be too aggressive and is therefore separate from the
   19.25 -more benign @{text algebra_simps}.\<close>
   19.26 +more benign \<open>algebra_simps\<close>.\<close>
   19.27  
   19.28  named_theorems field_simps "algebra simplification rules for fields"
   19.29  
   19.30 @@ -110,7 +110,7 @@
   19.31            Syntax_Phases.term_of_typ ctxt T
   19.32        else raise Match);
   19.33    in map tr' [@{const_syntax Groups.one}, @{const_syntax Groups.zero}] end;
   19.34 -\<close> -- \<open>show types that are presumably too general\<close>
   19.35 +\<close> \<comment> \<open>show types that are presumably too general\<close>
   19.36  
   19.37  class plus =
   19.38    fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "+" 65)
   19.39 @@ -1383,10 +1383,10 @@
   19.40  
   19.41  hide_fact (open) ab_diff_conv_add_uminus add_0 mult_1 ab_left_minus
   19.42  
   19.43 -lemmas add_0 = add_0_left -- \<open>FIXME duplicate\<close>
   19.44 -lemmas mult_1 = mult_1_left -- \<open>FIXME duplicate\<close>
   19.45 -lemmas ab_left_minus = left_minus -- \<open>FIXME duplicate\<close>
   19.46 -lemmas diff_diff_eq = diff_diff_add -- \<open>FIXME duplicate\<close>
   19.47 +lemmas add_0 = add_0_left \<comment> \<open>FIXME duplicate\<close>
   19.48 +lemmas mult_1 = mult_1_left \<comment> \<open>FIXME duplicate\<close>
   19.49 +lemmas ab_left_minus = left_minus \<comment> \<open>FIXME duplicate\<close>
   19.50 +lemmas diff_diff_eq = diff_diff_add \<comment> \<open>FIXME duplicate\<close>
   19.51  
   19.52  
   19.53  subsection \<open>Tools setup\<close>
    20.1 --- a/src/HOL/Groups_Big.thy	Mon Dec 07 10:23:50 2015 +0100
    20.2 +++ b/src/HOL/Groups_Big.thy	Mon Dec 07 10:38:04 2015 +0100
    20.3 @@ -67,7 +67,7 @@
    20.4  lemma union_inter:
    20.5    assumes "finite A" and "finite B"
    20.6    shows "F g (A \<union> B) * F g (A \<inter> B) = F g A * F g B"
    20.7 -  -- \<open>The reversed orientation looks more natural, but LOOPS as a simprule!\<close>
    20.8 +  \<comment> \<open>The reversed orientation looks more natural, but LOOPS as a simprule!\<close>
    20.9  using assms proof (induct A)
   20.10    case empty then show ?case by simp
   20.11  next
   20.12 @@ -478,19 +478,19 @@
   20.13  end
   20.14  
   20.15  text\<open>Now: lot's of fancy syntax. First, @{term "setsum (%x. e) A"} is
   20.16 -written @{text"\<Sum>x\<in>A. e"}.\<close>
   20.17 +written \<open>\<Sum>x\<in>A. e\<close>.\<close>
   20.18  
   20.19  syntax
   20.20    "_setsum" :: "pttrn => 'a set => 'b => 'b::comm_monoid_add"    ("(3SUM _:_./ _)" [0, 51, 10] 10)
   20.21  syntax (xsymbols)
   20.22    "_setsum" :: "pttrn => 'a set => 'b => 'b::comm_monoid_add"    ("(2\<Sum>_\<in>_./ _)" [0, 51, 10] 10)
   20.23  
   20.24 -translations -- \<open>Beware of argument permutation!\<close>
   20.25 +translations \<comment> \<open>Beware of argument permutation!\<close>
   20.26    "SUM i:A. b" == "CONST setsum (%i. b) A"
   20.27    "\<Sum>i\<in>A. b" == "CONST setsum (%i. b) A"
   20.28  
   20.29  text\<open>Instead of @{term"\<Sum>x\<in>{x. P}. e"} we introduce the shorter
   20.30 - @{text"\<Sum>x|P. e"}.\<close>
   20.31 + \<open>\<Sum>x|P. e\<close>.\<close>
   20.32  
   20.33  syntax
   20.34    "_qsetsum" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a" ("(3SUM _ |/ _./ _)" [0,0,10] 10)
   20.35 @@ -857,7 +857,7 @@
   20.36  
   20.37  lemma setsum_Un_nat: "finite A ==> finite B ==>
   20.38    (setsum f (A Un B) :: nat) = setsum f A + setsum f B - setsum f (A Int B)"
   20.39 -  -- \<open>For the natural numbers, we have subtraction.\<close>
   20.40 +  \<comment> \<open>For the natural numbers, we have subtraction.\<close>
   20.41  by (subst setsum.union_inter [symmetric], auto simp add: algebra_simps)
   20.42  
   20.43  lemma setsum_diff1_nat: "(setsum f (A - {a}) :: nat) =
   20.44 @@ -1064,12 +1064,12 @@
   20.45  syntax (xsymbols)
   20.46    "_setprod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult"  ("(2\<Prod>_\<in>_./ _)" [0, 51, 10] 10)
   20.47  
   20.48 -translations -- \<open>Beware of argument permutation!\<close>
   20.49 +translations \<comment> \<open>Beware of argument permutation!\<close>
   20.50    "PROD i:A. b" == "CONST setprod (%i. b) A" 
   20.51    "\<Prod>i\<in>A. b" == "CONST setprod (%i. b) A" 
   20.52  
   20.53  text\<open>Instead of @{term"\<Prod>x\<in>{x. P}. e"} we introduce the shorter
   20.54 - @{text"\<Prod>x|P. e"}.\<close>
   20.55 + \<open>\<Prod>x|P. e\<close>.\<close>
   20.56  
   20.57  syntax
   20.58    "_qsetprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a" ("(4PROD _ |/ _./ _)" [0,0,10] 10)
    21.1 --- a/src/HOL/Groups_List.thy	Mon Dec 07 10:23:50 2015 +0100
    21.2 +++ b/src/HOL/Groups_List.thy	Mon Dec 07 10:38:04 2015 +0100
    21.3 @@ -99,7 +99,7 @@
    21.4  syntax (xsymbols)
    21.5    "_listsum" :: "pttrn => 'a list => 'b => 'b"    ("(3\<Sum>_\<leftarrow>_. _)" [0, 51, 10] 10)
    21.6  
    21.7 -translations -- \<open>Beware of argument permutation!\<close>
    21.8 +translations \<comment> \<open>Beware of argument permutation!\<close>
    21.9    "SUM x<-xs. b" == "CONST listsum (CONST map (%x. b) xs)"
   21.10    "\<Sum>x\<leftarrow>xs. b" == "CONST listsum (CONST map (%x. b) xs)"
   21.11  
   21.12 @@ -179,7 +179,7 @@
   21.13    "(\<Sum>x\<leftarrow>xs. 0) = 0"
   21.14    by (induct xs) (simp_all add: distrib_right)
   21.15  
   21.16 -text\<open>For non-Abelian groups @{text xs} needs to be reversed on one side:\<close>
   21.17 +text\<open>For non-Abelian groups \<open>xs\<close> needs to be reversed on one side:\<close>
   21.18  lemma (in ab_group_add) uminus_listsum_map:
   21.19    "- listsum (map f xs) = listsum (map (uminus \<circ> f) xs)"
   21.20    by (induct xs) simp_all
   21.21 @@ -357,7 +357,7 @@
   21.22  syntax (xsymbols)
   21.23    "_listprod" :: "pttrn => 'a list => 'b => 'b"    ("(3\<Prod>_\<leftarrow>_. _)" [0, 51, 10] 10)
   21.24  
   21.25 -translations -- \<open>Beware of argument permutation!\<close>
   21.26 +translations \<comment> \<open>Beware of argument permutation!\<close>
   21.27    "PROD x<-xs. b" == "CONST listprod (CONST map (%x. b) xs)"
   21.28    "\<Prod>x\<leftarrow>xs. b" == "CONST listprod (CONST map (%x. b) xs)"
   21.29  
    22.1 --- a/src/HOL/HOL.thy	Mon Dec 07 10:23:50 2015 +0100
    22.2 +++ b/src/HOL/HOL.thy	Mon Dec 07 10:38:04 2015 +0100
    22.3 @@ -125,7 +125,7 @@
    22.4    [(@{const_syntax The}, fn _ => fn [Abs abs] =>
    22.5        let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
    22.6        in Syntax.const @{syntax_const "_The"} $ x $ t end)]
    22.7 -\<close>  -- \<open>To avoid eta-contraction of body\<close>
    22.8 +\<close>  \<comment> \<open>To avoid eta-contraction of body\<close>
    22.9  
   22.10  nonterminal letbinds and letbind
   22.11  syntax
   22.12 @@ -160,7 +160,7 @@
   22.13    refl: "t = (t::'a)" and
   22.14    subst: "s = t \<Longrightarrow> P s \<Longrightarrow> P t" and
   22.15    ext: "(\<And>x::'a. (f x ::'b) = g x) \<Longrightarrow> (\<lambda>x. f x) = (\<lambda>x. g x)"
   22.16 -    -- \<open>Extensionality is built into the meta-logic, and this rule expresses
   22.17 +    \<comment> \<open>Extensionality is built into the meta-logic, and this rule expresses
   22.18           a related property.  It is an eta-expanded version of the traditional
   22.19           rule, and similar to the ABS rule of HOL\<close> and
   22.20  
   22.21 @@ -219,7 +219,7 @@
   22.22    shows "A = B"
   22.23    by (unfold meq) (rule refl)
   22.24  
   22.25 -text \<open>Useful with @{text erule} for proving equalities from known equalities.\<close>
   22.26 +text \<open>Useful with \<open>erule\<close> for proving equalities from known equalities.\<close>
   22.27       (* a = b
   22.28          |   |
   22.29          c = d   *)
   22.30 @@ -241,13 +241,13 @@
   22.31  
   22.32  subsubsection \<open>Congruence rules for application\<close>
   22.33  
   22.34 -text \<open>Similar to @{text AP_THM} in Gordon's HOL.\<close>
   22.35 +text \<open>Similar to \<open>AP_THM\<close> in Gordon's HOL.\<close>
   22.36  lemma fun_cong: "(f :: 'a \<Rightarrow> 'b) = g \<Longrightarrow> f x = g x"
   22.37  apply (erule subst)
   22.38  apply (rule refl)
   22.39  done
   22.40  
   22.41 -text \<open>Similar to @{text AP_TERM} in Gordon's HOL and FOL's @{text subst_context}.\<close>
   22.42 +text \<open>Similar to \<open>AP_TERM\<close> in Gordon's HOL and FOL's \<open>subst_context\<close>.\<close>
   22.43  lemma arg_cong: "x = y \<Longrightarrow> f x = f y"
   22.44  apply (erule subst)
   22.45  apply (rule refl)
   22.46 @@ -329,7 +329,7 @@
   22.47  subsubsection \<open>False\<close>
   22.48  
   22.49  text \<open>
   22.50 -  Depends upon @{text spec}; it is impossible to do propositional
   22.51 +  Depends upon \<open>spec\<close>; it is impossible to do propositional
   22.52    logic before quantifiers!
   22.53  \<close>
   22.54  
   22.55 @@ -968,7 +968,7 @@
   22.56  lemma imp_conjL: "((P \<and> Q) \<longrightarrow> R) = (P \<longrightarrow> (Q \<longrightarrow> R))" by iprover
   22.57  lemma imp_disjL: "((P \<or> Q) \<longrightarrow> R) = ((P \<longrightarrow> R) \<and> (Q \<longrightarrow> R))" by iprover
   22.58  
   22.59 -text \<open>These two are specialized, but @{text imp_disj_not1} is useful in @{text "Auth/Yahalom"}.\<close>
   22.60 +text \<open>These two are specialized, but \<open>imp_disj_not1\<close> is useful in \<open>Auth/Yahalom\<close>.\<close>
   22.61  lemma imp_disj_not1: "(P \<longrightarrow> Q \<or> R) = (\<not> Q \<longrightarrow> P \<longrightarrow> R)" by blast
   22.62  lemma imp_disj_not2: "(P \<longrightarrow> Q \<or> R) = (\<not> R \<longrightarrow> P \<longrightarrow> Q)" by blast
   22.63  
   22.64 @@ -983,7 +983,7 @@
   22.65  lemma not_imp: "(\<not> (P \<longrightarrow> Q)) = (P \<and> \<not> Q)" by blast
   22.66  lemma not_iff: "(P \<noteq> Q) = (P = (\<not> Q))" by blast
   22.67  lemma disj_not1: "(\<not> P \<or> Q) = (P \<longrightarrow> Q)" by blast
   22.68 -lemma disj_not2: "(P \<or> \<not> Q) = (Q \<longrightarrow> P)"  -- \<open>changes orientation :-(\<close>
   22.69 +lemma disj_not2: "(P \<or> \<not> Q) = (Q \<longrightarrow> P)"  \<comment> \<open>changes orientation :-(\<close>
   22.70    by blast
   22.71  lemma imp_conv_disj: "(P \<longrightarrow> Q) = ((\<not> P) \<or> Q)" by blast
   22.72  
   22.73 @@ -991,8 +991,8 @@
   22.74  
   22.75  
   22.76  lemma cases_simp: "((P \<longrightarrow> Q) \<and> (\<not> P \<longrightarrow> Q)) = Q"
   22.77 -  -- \<open>Avoids duplication of subgoals after @{text split_if}, when the true and false\<close>
   22.78 -  -- \<open>cases boil down to the same thing.\<close>
   22.79 +  \<comment> \<open>Avoids duplication of subgoals after \<open>split_if\<close>, when the true and false\<close>
   22.80 +  \<comment> \<open>cases boil down to the same thing.\<close>
   22.81    by blast
   22.82  
   22.83  lemma not_all: "(\<not> (\<forall>x. P x)) = (\<exists>x. \<not> P x)" by blast
   22.84 @@ -1007,7 +1007,7 @@
   22.85  lemma all_conj_distrib: "(\<forall>x. P x \<and> Q x) = ((\<forall>x. P x) \<and> (\<forall>x. Q x))" by iprover
   22.86  
   22.87  text \<open>
   22.88 -  \medskip The @{text "\<and>"} congruence rule: not included by default!
   22.89 +  \medskip The \<open>\<and>\<close> congruence rule: not included by default!
   22.90    May slow rewrite proofs down by as much as 50\%\<close>
   22.91  
   22.92  lemma conj_cong:
   22.93 @@ -1018,7 +1018,7 @@
   22.94      "(Q = Q') \<Longrightarrow> (Q' \<Longrightarrow> (P = P')) \<Longrightarrow> ((P \<and> Q) = (P' \<and> Q'))"
   22.95    by iprover
   22.96  
   22.97 -text \<open>The @{text "|"} congruence rule: not included by default!\<close>
   22.98 +text \<open>The \<open>|\<close> congruence rule: not included by default!\<close>
   22.99  
  22.100  lemma disj_cong:
  22.101      "(P = P') \<Longrightarrow> (\<not> P' \<Longrightarrow> (Q = Q')) \<Longrightarrow> ((P \<or> Q) = (P' \<or> Q'))"
  22.102 @@ -1057,11 +1057,11 @@
  22.103  by (simplesubst split_if, blast)
  22.104  
  22.105  lemma if_bool_eq_conj: "(if P then Q else R) = ((P \<longrightarrow> Q) \<and> (\<not> P \<longrightarrow> R))"
  22.106 -  -- \<open>This form is useful for expanding @{text "if"}s on the RIGHT of the @{text "\<Longrightarrow>"} symbol.\<close>
  22.107 +  \<comment> \<open>This form is useful for expanding \<open>if\<close>s on the RIGHT of the \<open>\<Longrightarrow>\<close> symbol.\<close>
  22.108    by (rule split_if)
  22.109  
  22.110  lemma if_bool_eq_disj: "(if P then Q else R) = ((P \<and> Q) \<or> (\<not> P \<and> R))"
  22.111 -  -- \<open>And this form is useful for expanding @{text "if"}s on the LEFT.\<close>
  22.112 +  \<comment> \<open>And this form is useful for expanding \<open>if\<close>s on the LEFT.\<close>
  22.113    by (simplesubst split_if) blast
  22.114  
  22.115  lemma Eq_TrueI: "P \<Longrightarrow> P \<equiv> True" by (unfold atomize_eq) iprover
  22.116 @@ -1156,7 +1156,7 @@
  22.117  simproc_setup defined_Ex ("\<exists>x. P x") = \<open>fn _ => Quantifier1.rearrange_ex\<close>
  22.118  simproc_setup defined_All ("\<forall>x. P x") = \<open>fn _ => Quantifier1.rearrange_all\<close>
  22.119  
  22.120 -text \<open>Simproc for proving @{text "(y = x) \<equiv> False"} from premise @{text "\<not> (x = y)"}:\<close>
  22.121 +text \<open>Simproc for proving \<open>(y = x) \<equiv> False\<close> from premise \<open>\<not> (x = y)\<close>:\<close>
  22.122  
  22.123  simproc_setup neq ("x = y") = \<open>fn _ =>
  22.124  let
  22.125 @@ -1261,7 +1261,7 @@
  22.126    "\<And>P Q. (\<exists>x. P \<or> Q x)   = (P \<or> (\<exists>x. Q x))"
  22.127    "\<And>P Q. (\<exists>x. P x \<longrightarrow> Q) = ((\<forall>x. P x) \<longrightarrow> Q)"
  22.128    "\<And>P Q. (\<exists>x. P \<longrightarrow> Q x) = (P \<longrightarrow> (\<exists>x. Q x))"
  22.129 -  -- \<open>Miniscoping: pushing in existential quantifiers.\<close>
  22.130 +  \<comment> \<open>Miniscoping: pushing in existential quantifiers.\<close>
  22.131    by (iprover | blast)+
  22.132  
  22.133  lemma all_simps:
  22.134 @@ -1271,7 +1271,7 @@
  22.135    "\<And>P Q. (\<forall>x. P \<or> Q x)   = (P \<or> (\<forall>x. Q x))"
  22.136    "\<And>P Q. (\<forall>x. P x \<longrightarrow> Q) = ((\<exists>x. P x) \<longrightarrow> Q)"
  22.137    "\<And>P Q. (\<forall>x. P \<longrightarrow> Q x) = (P \<longrightarrow> (\<forall>x. Q x))"
  22.138 -  -- \<open>Miniscoping: pushing in universal quantifiers.\<close>
  22.139 +  \<comment> \<open>Miniscoping: pushing in universal quantifiers.\<close>
  22.140    by (iprover | blast)+
  22.141  
  22.142  lemmas [simp] =
  22.143 @@ -1654,7 +1654,7 @@
  22.144  ML_file "Tools/cnf.ML"
  22.145  
  22.146  
  22.147 -section \<open>@{text NO_MATCH} simproc\<close>
  22.148 +section \<open>\<open>NO_MATCH\<close> simproc\<close>
  22.149  
  22.150  text \<open>
  22.151   The simplification procedure can be used to avoid simplification of terms of a certain form
    23.1 --- a/src/HOL/Hilbert_Choice.thy	Mon Dec 07 10:23:50 2015 +0100
    23.2 +++ b/src/HOL/Hilbert_Choice.thy	Mon Dec 07 10:38:04 2015 +0100
    23.3 @@ -28,7 +28,7 @@
    23.4    [(@{const_syntax Eps}, fn _ => fn [Abs abs] =>
    23.5        let val (x, t) = Syntax_Trans.atomic_abs_tr' abs
    23.6        in Syntax.const @{syntax_const "_Eps"} $ x $ t end)]
    23.7 -\<close> -- \<open>to avoid eta-contraction of body\<close>
    23.8 +\<close> \<comment> \<open>to avoid eta-contraction of body\<close>
    23.9  
   23.10  definition inv_into :: "'a set => ('a => 'b) => ('b => 'a)" where
   23.11  "inv_into A f == %x. SOME y. y : A & f y = x"
   23.12 @@ -39,19 +39,19 @@
   23.13  
   23.14  subsection \<open>Hilbert's Epsilon-operator\<close>
   23.15  
   23.16 -text\<open>Easier to apply than @{text someI} if the witness comes from an
   23.17 +text\<open>Easier to apply than \<open>someI\<close> if the witness comes from an
   23.18  existential formula\<close>
   23.19  lemma someI_ex [elim?]: "\<exists>x. P x ==> P (SOME x. P x)"
   23.20  apply (erule exE)
   23.21  apply (erule someI)
   23.22  done
   23.23  
   23.24 -text\<open>Easier to apply than @{text someI} because the conclusion has only one
   23.25 +text\<open>Easier to apply than \<open>someI\<close> because the conclusion has only one
   23.26  occurrence of @{term P}.\<close>
   23.27  lemma someI2: "[| P a;  !!x. P x ==> Q x |] ==> Q (SOME x. P x)"
   23.28    by (blast intro: someI)
   23.29  
   23.30 -text\<open>Easier to apply than @{text someI2} if the witness comes from an
   23.31 +text\<open>Easier to apply than \<open>someI2\<close> if the witness comes from an
   23.32  existential formula\<close>
   23.33  
   23.34  lemma someI2_ex: "[| \<exists>a. P a; !!x. P x ==> Q x |] ==> Q (SOME x. P x)"
   23.35 @@ -294,20 +294,20 @@
   23.36  
   23.37  text \<open>
   23.38    Every infinite set contains a countable subset. More precisely we
   23.39 -  show that a set @{text S} is infinite if and only if there exists an
   23.40 -  injective function from the naturals into @{text S}.
   23.41 +  show that a set \<open>S\<close> is infinite if and only if there exists an
   23.42 +  injective function from the naturals into \<open>S\<close>.
   23.43  
   23.44    The ``only if'' direction is harder because it requires the
   23.45    construction of a sequence of pairwise different elements of an
   23.46 -  infinite set @{text S}. The idea is to construct a sequence of
   23.47 -  non-empty and infinite subsets of @{text S} obtained by successively
   23.48 -  removing elements of @{text S}.
   23.49 +  infinite set \<open>S\<close>. The idea is to construct a sequence of
   23.50 +  non-empty and infinite subsets of \<open>S\<close> obtained by successively
   23.51 +  removing elements of \<open>S\<close>.
   23.52  \<close>
   23.53  
   23.54  lemma infinite_countable_subset:
   23.55    assumes inf: "\<not> finite (S::'a set)"
   23.56    shows "\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S"
   23.57 -  -- \<open>Courtesy of Stephan Merz\<close>
   23.58 +  \<comment> \<open>Courtesy of Stephan Merz\<close>
   23.59  proof -
   23.60    def Sseq \<equiv> "rec_nat S (\<lambda>n T. T - {SOME e. e \<in> T})"
   23.61    def pick \<equiv> "\<lambda>n. (SOME e. e \<in> Sseq n)"
   23.62 @@ -325,7 +325,7 @@
   23.63  qed
   23.64  
   23.65  lemma infinite_iff_countable_subset: "\<not> finite S \<longleftrightarrow> (\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S)"
   23.66 -  -- \<open>Courtesy of Stephan Merz\<close>
   23.67 +  \<comment> \<open>Courtesy of Stephan Merz\<close>
   23.68    using finite_imageD finite_subset infinite_UNIV_char_0 infinite_countable_subset by auto
   23.69  
   23.70  lemma image_inv_into_cancel:
   23.71 @@ -703,7 +703,7 @@
   23.72    done
   23.73  
   23.74  
   23.75 -text \<open>\medskip Specialization to @{text GREATEST}.\<close>
   23.76 +text \<open>\medskip Specialization to \<open>GREATEST\<close>.\<close>
   23.77  
   23.78  lemma GreatestI: "P (k::nat) ==> \<forall>y. P y --> y < b ==> P (GREATEST x. P x)"
   23.79    apply (simp add: Greatest_def)
    24.1 --- a/src/HOL/Inductive.thy	Mon Dec 07 10:23:50 2015 +0100
    24.2 +++ b/src/HOL/Inductive.thy	Mon Dec 07 10:38:04 2015 +0100
    24.3 @@ -21,11 +21,11 @@
    24.4  
    24.5  definition
    24.6    lfp :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a" where
    24.7 -  "lfp f = Inf {u. f u \<le> u}"    --\<open>least fixed point\<close>
    24.8 +  "lfp f = Inf {u. f u \<le> u}"    \<comment>\<open>least fixed point\<close>
    24.9  
   24.10  definition
   24.11    gfp :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a" where
   24.12 -  "gfp f = Sup {u. u \<le> f u}"    --\<open>greatest fixed point\<close>
   24.13 +  "gfp f = Sup {u. u \<le> f u}"    \<comment>\<open>greatest fixed point\<close>
   24.14  
   24.15  
   24.16  subsection\<open>Proof of Knaster-Tarski Theorem using @{term lfp}\<close>
   24.17 @@ -101,7 +101,7 @@
   24.18    using assms by (rule lfp_ordinal_induct)
   24.19  
   24.20  
   24.21 -text\<open>Definition forms of @{text lfp_unfold} and @{text lfp_induct}, 
   24.22 +text\<open>Definition forms of \<open>lfp_unfold\<close> and \<open>lfp_induct\<close>, 
   24.23      to control unfolding\<close>
   24.24  
   24.25  lemma def_lfp_unfold: "[| h==lfp(f);  mono(f) |] ==> h = f(h)"
   24.26 @@ -230,7 +230,7 @@
   24.27  apply (simp_all)
   24.28  done
   24.29  
   24.30 -text\<open>Definition forms of @{text gfp_unfold} and @{text coinduct}, 
   24.31 +text\<open>Definition forms of \<open>gfp_unfold\<close> and \<open>coinduct\<close>, 
   24.32      to control unfolding\<close>
   24.33  
   24.34  lemma def_gfp_unfold: "[| A==gfp(f);  mono(f) |] ==> A = f(A)"
    25.1 --- a/src/HOL/Int.thy	Mon Dec 07 10:23:50 2015 +0100
    25.2 +++ b/src/HOL/Int.thy	Mon Dec 07 10:38:04 2015 +0100
    25.3 @@ -198,7 +198,7 @@
    25.4    for z1 z2 w :: int
    25.5  
    25.6  
    25.7 -subsection \<open>Embedding of the Integers into any @{text ring_1}: @{text of_int}\<close>
    25.8 +subsection \<open>Embedding of the Integers into any \<open>ring_1\<close>: \<open>of_int\<close>\<close>
    25.9  
   25.10  context ring_1
   25.11  begin
   25.12 @@ -270,7 +270,7 @@
   25.13  context linordered_idom
   25.14  begin
   25.15  
   25.16 -text\<open>Every @{text linordered_idom} has characteristic zero.\<close>
   25.17 +text\<open>Every \<open>linordered_idom\<close> has characteristic zero.\<close>
   25.18  subclass ring_char_0 ..
   25.19  
   25.20  lemma of_int_le_iff [simp]:
   25.21 @@ -364,7 +364,7 @@
   25.22    apply simp
   25.23    done
   25.24  
   25.25 -subsection \<open>Magnitude of an Integer, as a Natural Number: @{text nat}\<close>
   25.26 +subsection \<open>Magnitude of an Integer, as a Natural Number: \<open>nat\<close>\<close>
   25.27  
   25.28  lift_definition nat :: "int \<Rightarrow> nat" is "\<lambda>(x, y). x - y"
   25.29    by auto
   25.30 @@ -525,9 +525,9 @@
   25.31  by simp
   25.32  
   25.33  text\<open>This version is proved for all ordered rings, not just integers!
   25.34 -      It is proved here because attribute @{text arith_split} is not available
   25.35 -      in theory @{text Rings}.
   25.36 -      But is it really better than just rewriting with @{text abs_if}?\<close>
   25.37 +      It is proved here because attribute \<open>arith_split\<close> is not available
   25.38 +      in theory \<open>Rings\<close>.
   25.39 +      But is it really better than just rewriting with \<open>abs_if\<close>?\<close>
   25.40  lemma abs_split [arith_split, no_atp]:
   25.41       "P(abs(a::'a::linordered_idom)) = ((0 \<le> a --> P a) & (a < 0 --> P(-a)))"
   25.42  by (force dest: order_less_le_trans simp add: abs_if linorder_not_less)
   25.43 @@ -588,14 +588,14 @@
   25.44    using assms by (rule nonneg_eq_int)
   25.45  
   25.46  lemma Let_numeral [simp]: "Let (numeral v) f = f (numeral v)"
   25.47 -  -- \<open>Unfold all @{text let}s involving constants\<close>
   25.48 -  by (fact Let_numeral) -- \<open>FIXME drop\<close>
   25.49 +  \<comment> \<open>Unfold all \<open>let\<close>s involving constants\<close>
   25.50 +  by (fact Let_numeral) \<comment> \<open>FIXME drop\<close>
   25.51  
   25.52  lemma Let_neg_numeral [simp]: "Let (- numeral v) f = f (- numeral v)"
   25.53 -  -- \<open>Unfold all @{text let}s involving constants\<close>
   25.54 -  by (fact Let_neg_numeral) -- \<open>FIXME drop\<close>
   25.55 +  \<comment> \<open>Unfold all \<open>let\<close>s involving constants\<close>
   25.56 +  by (fact Let_neg_numeral) \<comment> \<open>FIXME drop\<close>
   25.57  
   25.58 -text \<open>Unfold @{text min} and @{text max} on numerals.\<close>
   25.59 +text \<open>Unfold \<open>min\<close> and \<open>max\<close> on numerals.\<close>
   25.60  
   25.61  lemmas max_number_of [simp] =
   25.62    max_def [of "numeral u" "numeral v"]
   25.63 @@ -1220,7 +1220,7 @@
   25.64  lemmas divide_le_0_iff_numeral [simp, no_atp] = divide_le_0_iff [of "numeral w"] for w
   25.65  
   25.66  
   25.67 -text \<open>Replaces @{text "inverse #nn"} by @{text "1/#nn"}.  It looks
   25.68 +text \<open>Replaces \<open>inverse #nn\<close> by \<open>1/#nn\<close>.  It looks
   25.69    strange, but then other simprocs simplify the quotient.\<close>
   25.70  
   25.71  lemmas inverse_eq_divide_numeral [simp] =
   25.72 @@ -1250,10 +1250,10 @@
   25.73  lemmas minus_less_iff_numeral [no_atp] =
   25.74    minus_less_iff [of _ "numeral v"] for v
   25.75  
   25.76 --- \<open>FIXME maybe simproc\<close>
   25.77 +\<comment> \<open>FIXME maybe simproc\<close>
   25.78  
   25.79  
   25.80 -text \<open>Cancellation of constant factors in comparisons (@{text "<"} and @{text "\<le>"})\<close>
   25.81 +text \<open>Cancellation of constant factors in comparisons (\<open><\<close> and \<open>\<le>\<close>)\<close>
   25.82  
   25.83  lemmas mult_less_cancel_left_numeral [simp, no_atp] = mult_less_cancel_left [of "numeral v"] for v
   25.84  lemmas mult_less_cancel_right_numeral [simp, no_atp] = mult_less_cancel_right [of _ "numeral v"] for v
   25.85 @@ -1261,7 +1261,7 @@
   25.86  lemmas mult_le_cancel_right_numeral [simp, no_atp] = mult_le_cancel_right [of _ "numeral v"] for v
   25.87  
   25.88  
   25.89 -text \<open>Multiplying out constant divisors in comparisons (@{text "<"}, @{text "\<le>"} and @{text "="})\<close>
   25.90 +text \<open>Multiplying out constant divisors in comparisons (\<open><\<close>, \<open>\<le>\<close> and \<open>=\<close>)\<close>
   25.91  
   25.92  named_theorems divide_const_simps "simplification rules to simplify comparisons involving constant divisors"
   25.93  
   25.94 @@ -1689,7 +1689,7 @@
   25.95  lemmas zpower_numeral_even = power_numeral_even [where 'a=int]
   25.96  lemmas zpower_numeral_odd = power_numeral_odd [where 'a=int]
   25.97  
   25.98 -text \<open>De-register @{text "int"} as a quotient type:\<close>
   25.99 +text \<open>De-register \<open>int\<close> as a quotient type:\<close>
  25.100  
  25.101  lifting_update int.lifting
  25.102  lifting_forget int.lifting
    26.1 --- a/src/HOL/Isar_Examples/Basic_Logic.thy	Mon Dec 07 10:23:50 2015 +0100
    26.2 +++ b/src/HOL/Isar_Examples/Basic_Logic.thy	Mon Dec 07 10:38:04 2015 +0100
    26.3 @@ -172,9 +172,9 @@
    26.4  proof
    26.5    assume "A \<and> B"
    26.6    then show "B \<and> A"
    26.7 -  proof                    -- \<open>rule \<open>conjE\<close> of \<open>A \<and> B\<close>\<close>
    26.8 +  proof                    \<comment> \<open>rule \<open>conjE\<close> of \<open>A \<and> B\<close>\<close>
    26.9      assume B A
   26.10 -    then show ?thesis ..   -- \<open>rule \<open>conjI\<close> of \<open>B \<and> A\<close>\<close>
   26.11 +    then show ?thesis ..   \<comment> \<open>rule \<open>conjI\<close> of \<open>B \<and> A\<close>\<close>
   26.12    qed
   26.13  qed
   26.14  
   26.15 @@ -202,7 +202,7 @@
   26.16      from \<open>A \<and> B\<close> have B ..
   26.17      from \<open>B\<close> \<open>A\<close> have "B \<and> A" ..
   26.18    }
   26.19 -  then show ?thesis ..         -- \<open>rule \<open>impI\<close>\<close>
   26.20 +  then show ?thesis ..         \<comment> \<open>rule \<open>impI\<close>\<close>
   26.21  qed
   26.22  
   26.23  text \<open>
   26.24 @@ -253,7 +253,7 @@
   26.25  proof
   26.26    assume "P \<or> P"
   26.27    then show P
   26.28 -  proof                    -- \<open>rule \<open>disjE\<close>: \smash{$\infer{\<open>C\<close>}{\<open>A \<or> B\<close> & \infer*{\<open>C\<close>}{[\<open>A\<close>]} & \infer*{\<open>C\<close>}{[\<open>B\<close>]}}$}\<close>
   26.29 +  proof                    \<comment> \<open>rule \<open>disjE\<close>: \smash{$\infer{\<open>C\<close>}{\<open>A \<or> B\<close> & \infer*{\<open>C\<close>}{[\<open>A\<close>]} & \infer*{\<open>C\<close>}{[\<open>B\<close>]}}$}\<close>
   26.30      assume P show P by fact
   26.31    next
   26.32      assume P show P by fact
   26.33 @@ -322,7 +322,7 @@
   26.34  proof
   26.35    assume "\<exists>x. P (f x)"
   26.36    then show "\<exists>y. P y"
   26.37 -  proof (rule exE)             -- \<open>rule \<open>exE\<close>: \smash{$\infer{\<open>B\<close>}{\<open>\<exists>x. A(x)\<close> & \infer*{\<open>B\<close>}{[\<open>A(x)\<close>]_x}}$}\<close>
   26.38 +  proof (rule exE)             \<comment> \<open>rule \<open>exE\<close>: \smash{$\infer{\<open>B\<close>}{\<open>\<exists>x. A(x)\<close> & \infer*{\<open>B\<close>}{[\<open>A(x)\<close>]_x}}$}\<close>
   26.39      fix a
   26.40      assume "P (f a)" (is "P ?witness")
   26.41      then show ?thesis by (rule exI [of P ?witness])
    27.1 --- a/src/HOL/Isar_Examples/Expr_Compiler.thy	Mon Dec 07 10:23:50 2015 +0100
    27.2 +++ b/src/HOL/Isar_Examples/Expr_Compiler.thy	Mon Dec 07 10:38:04 2015 +0100
    27.3 @@ -157,7 +157,7 @@
    27.4    next
    27.5      case (Load adr)
    27.6      from Cons show ?case
    27.7 -      by simp -- \<open>same as above\<close>
    27.8 +      by simp \<comment> \<open>same as above\<close>
    27.9    next
   27.10      case (Apply fn)
   27.11      have "exec ((Apply fn # xs) @ ys) s env =
   27.12 @@ -187,7 +187,7 @@
   27.13      finally show ?case .
   27.14    next
   27.15      case (Constant val s)
   27.16 -    show ?case by simp -- \<open>same as above\<close>
   27.17 +    show ?case by simp \<comment> \<open>same as above\<close>
   27.18    next
   27.19      case (Binop fn e1 e2 s)
   27.20      have "exec (compile (Binop fn e1 e2)) s env =
    28.1 --- a/src/HOL/Isar_Examples/Fibonacci.thy	Mon Dec 07 10:23:50 2015 +0100
    28.2 +++ b/src/HOL/Isar_Examples/Fibonacci.thy	Mon Dec 07 10:38:04 2015 +0100
    28.3 @@ -52,7 +52,7 @@
    28.4  lemma fib_add:
    28.5    "fib (n + k + 1) = fib (k + 1) * fib (n + 1) + fib k * fib n"
    28.6    (is "?P n")
    28.7 -  -- \<open>see @{cite \<open>page 280\<close> "Concrete-Math"}\<close>
    28.8 +  \<comment> \<open>see @{cite \<open>page 280\<close> "Concrete-Math"}\<close>
    28.9  proof (induct n rule: fib_induct)
   28.10    show "?P 0" by simp
   28.11    show "?P 1" by simp
    29.1 --- a/src/HOL/Isar_Examples/Group.thy	Mon Dec 07 10:23:50 2015 +0100
    29.2 +++ b/src/HOL/Isar_Examples/Group.thy	Mon Dec 07 10:38:04 2015 +0100
    29.3 @@ -87,27 +87,27 @@
    29.4      by (simp only: group_left_inverse)
    29.5  
    29.6    note calculation = this
    29.7 -    -- \<open>first calculational step: init calculation register\<close>
    29.8 +    \<comment> \<open>first calculational step: init calculation register\<close>
    29.9  
   29.10    have "\<dots> = x * inverse x * x"
   29.11      by (simp only: group_assoc)
   29.12  
   29.13    note calculation = trans [OF calculation this]
   29.14 -    -- \<open>general calculational step: compose with transitivity rule\<close>
   29.15 +    \<comment> \<open>general calculational step: compose with transitivity rule\<close>
   29.16  
   29.17    have "\<dots> = 1 * x"
   29.18      by (simp only: group_right_inverse)
   29.19  
   29.20    note calculation = trans [OF calculation this]
   29.21 -    -- \<open>general calculational step: compose with transitivity rule\<close>
   29.22 +    \<comment> \<open>general calculational step: compose with transitivity rule\<close>
   29.23  
   29.24    have "\<dots> = x"
   29.25      by (simp only: group_left_one)
   29.26  
   29.27    note calculation = trans [OF calculation this]
   29.28 -    -- \<open>final calculational step: compose with transitivity rule \dots\<close>
   29.29 +    \<comment> \<open>final calculational step: compose with transitivity rule \dots\<close>
   29.30    from calculation
   29.31 -    -- \<open>\dots\ and pick up the final result\<close>
   29.32 +    \<comment> \<open>\dots\ and pick up the final result\<close>
   29.33  
   29.34    show ?thesis .
   29.35  qed
    30.1 --- a/src/HOL/Isar_Examples/Hoare.thy	Mon Dec 07 10:23:50 2015 +0100
    30.2 +++ b/src/HOL/Isar_Examples/Hoare.thy	Mon Dec 07 10:38:04 2015 +0100
    30.3 @@ -384,7 +384,7 @@
    30.4  lemma Compl_Collect: "- Collect b = {x. \<not> b x}"
    30.5    by blast
    30.6  
    30.7 -lemmas AbortRule = SkipRule  -- "dummy version"
    30.8 +lemmas AbortRule = SkipRule  \<comment> "dummy version"
    30.9  
   30.10  ML_file "~~/src/HOL/Hoare/hoare_tac.ML"
   30.11  
    31.1 --- a/src/HOL/Isar_Examples/Hoare_Ex.thy	Mon Dec 07 10:23:50 2015 +0100
    31.2 +++ b/src/HOL/Isar_Examples/Hoare_Ex.thy	Mon Dec 07 10:38:04 2015 +0100
    31.3 @@ -79,7 +79,7 @@
    31.4  
    31.5  lemma
    31.6    "Valid {s. x s = a} (Basic (\<lambda>s. x_update (x s) s)) {s. x s = n}"
    31.7 -  -- \<open>same statement without concrete syntax\<close>
    31.8 +  \<comment> \<open>same statement without concrete syntax\<close>
    31.9    oops
   31.10  
   31.11  
   31.12 @@ -99,8 +99,8 @@
   31.13  lemma "\<turnstile> \<lbrace>\<acute>M = \<acute>N\<rbrace> \<acute>M := \<acute>M + 1 \<lbrace>\<acute>M \<noteq> \<acute>N\<rbrace>"
   31.14  proof -
   31.15    have "m = n \<longrightarrow> m + 1 \<noteq> n" for m n :: nat
   31.16 -      -- \<open>inclusion of assertions expressed in ``pure'' logic,\<close>
   31.17 -      -- \<open>without mentioning the state space\<close>
   31.18 +      \<comment> \<open>inclusion of assertions expressed in ``pure'' logic,\<close>
   31.19 +      \<comment> \<open>without mentioning the state space\<close>
   31.20      by simp
   31.21    also have "\<turnstile> \<lbrace>\<acute>M + 1 \<noteq> \<acute>N\<rbrace> \<acute>M := \<acute>M + 1 \<lbrace>\<acute>M \<noteq> \<acute>N\<rbrace>"
   31.22      by hoare
    32.1 --- a/src/HOL/Isar_Examples/Structured_Statements.thy	Mon Dec 07 10:23:50 2015 +0100
    32.2 +++ b/src/HOL/Isar_Examples/Structured_Statements.thy	Mon Dec 07 10:38:04 2015 +0100
    32.3 @@ -152,9 +152,9 @@
    32.4  
    32.5    have C
    32.6    proof -
    32.7 -    show ?thesis when "A x" (is ?A) for x :: 'a  -- \<open>abstract @{term x}\<close>
    32.8 +    show ?thesis when "A x" (is ?A) for x :: 'a  \<comment> \<open>abstract @{term x}\<close>
    32.9        using that sorry
   32.10 -    show "?A a"  -- \<open>concrete @{term a}\<close>
   32.11 +    show "?A a"  \<comment> \<open>concrete @{term a}\<close>
   32.12        sorry
   32.13    qed
   32.14  end
    33.1 --- a/src/HOL/Lattices.thy	Mon Dec 07 10:23:50 2015 +0100
    33.2 +++ b/src/HOL/Lattices.thy	Mon Dec 07 10:38:04 2015 +0100
    33.3 @@ -741,12 +741,12 @@
    33.4  ML_file "Tools/boolean_algebra_cancel.ML"
    33.5  
    33.6  simproc_setup boolean_algebra_cancel_sup ("sup a b::'a::boolean_algebra") =
    33.7 -  {* fn phi => fn ss => try Boolean_Algebra_Cancel.cancel_sup_conv *}
    33.8 +  \<open>fn phi => fn ss => try Boolean_Algebra_Cancel.cancel_sup_conv\<close>
    33.9  
   33.10  simproc_setup boolean_algebra_cancel_inf ("inf a b::'a::boolean_algebra") =
   33.11 -  {* fn phi => fn ss => try Boolean_Algebra_Cancel.cancel_inf_conv *}
   33.12 +  \<open>fn phi => fn ss => try Boolean_Algebra_Cancel.cancel_inf_conv\<close>
   33.13  
   33.14 -subsection \<open>@{text "min/max"} as special case of lattice\<close>
   33.15 +subsection \<open>\<open>min/max\<close> as special case of lattice\<close>
   33.16  
   33.17  context linorder
   33.18  begin
   33.19 @@ -1002,8 +1002,8 @@
   33.20    by (simp add: sup_fun_def) iprover
   33.21  
   33.22  text \<open>
   33.23 -  \medskip Classical introduction rule: no commitment to @{text A} vs
   33.24 -  @{text B}.
   33.25 +  \medskip Classical introduction rule: no commitment to \<open>A\<close> vs
   33.26 +  \<open>B\<close>.
   33.27  \<close>
   33.28  
   33.29  lemma sup1CI: "(\<not> B x \<Longrightarrow> A x) \<Longrightarrow> (A \<squnion> B) x"
    34.1 --- a/src/HOL/Library/Float.thy	Mon Dec 07 10:23:50 2015 +0100
    34.2 +++ b/src/HOL/Library/Float.thy	Mon Dec 07 10:38:04 2015 +0100
    34.3 @@ -529,7 +529,7 @@
    34.4    show "m = mantissa f * 2 ^ nat (exponent f - e)" 
    34.5      by linarith
    34.6    show "e = exponent f - nat (exponent f - e)"
    34.7 -    using `e \<le> exponent f` by auto
    34.8 +    using \<open>e \<le> exponent f\<close> by auto
    34.9  qed
   34.10  
   34.11  context
    35.1 --- a/src/HOL/Library/Formal_Power_Series.thy	Mon Dec 07 10:23:50 2015 +0100
    35.2 +++ b/src/HOL/Library/Formal_Power_Series.thy	Mon Dec 07 10:38:04 2015 +0100
    35.3 @@ -476,7 +476,7 @@
    35.4  qed simp_all
    35.5    
    35.6  
    35.7 -subsection {* Subdegrees *}  
    35.8 +subsection \<open>Subdegrees\<close>  
    35.9    
   35.10  definition subdegree :: "('a::zero) fps \<Rightarrow> nat" where
   35.11    "subdegree f = (if f = 0 then 0 else LEAST n. f$n \<noteq> 0)"
   35.12 @@ -1467,7 +1467,7 @@
   35.13      assume "Lcm A \<noteq> 0"
   35.14      from unbounded obtain f where f: "f \<in> A" "subdegree (Lcm A) < subdegree f"
   35.15        unfolding bdd_above_def by (auto simp: not_le)
   35.16 -    moreover from this and `Lcm A \<noteq> 0` have "subdegree f \<le> subdegree (Lcm A)"
   35.17 +    moreover from this and \<open>Lcm A \<noteq> 0\<close> have "subdegree f \<le> subdegree (Lcm A)"
   35.18        by (intro dvd_imp_subdegree_le) simp_all
   35.19      ultimately show False by simp
   35.20    qed
    36.1 --- a/src/HOL/Lifting.thy	Mon Dec 07 10:23:50 2015 +0100
    36.2 +++ b/src/HOL/Lifting.thy	Mon Dec 07 10:38:04 2015 +0100
    36.3 @@ -55,7 +55,7 @@
    36.4    by blast
    36.5  
    36.6  lemma Quotient_rel:
    36.7 -  "R r r \<and> R s s \<and> Abs r = Abs s \<longleftrightarrow> R r s" -- \<open>orientation does not loop on rewriting\<close>
    36.8 +  "R r r \<and> R s s \<and> Abs r = Abs s \<longleftrightarrow> R r s" \<comment> \<open>orientation does not loop on rewriting\<close>
    36.9    using a unfolding Quotient_def
   36.10    by blast
   36.11  
   36.12 @@ -318,7 +318,7 @@
   36.13  
   36.14  end
   36.15  
   36.16 -text \<open>Generating transfer rules for a type defined with @{text "typedef"}.\<close>
   36.17 +text \<open>Generating transfer rules for a type defined with \<open>typedef\<close>.\<close>
   36.18  
   36.19  context
   36.20    fixes Rep Abs A T
   36.21 @@ -350,7 +350,7 @@
   36.22  end
   36.23  
   36.24  text \<open>Generating the correspondence rule for a constant defined with
   36.25 -  @{text "lift_definition"}.\<close>
   36.26 +  \<open>lift_definition\<close>.\<close>
   36.27  
   36.28  lemma Quotient_to_transfer:
   36.29    assumes "Quotient R Abs Rep T" and "R c c" and "c' \<equiv> Abs c"
    37.1 --- a/src/HOL/Limits.thy	Mon Dec 07 10:23:50 2015 +0100
    37.2 +++ b/src/HOL/Limits.thy	Mon Dec 07 10:38:04 2015 +0100
    37.3 @@ -279,7 +279,7 @@
    37.4    assume "c \<noteq> 0" "Bseq (\<lambda>x. c * f x)"
    37.5    find_theorems "Bfun (\<lambda>_. ?c) _"
    37.6    from Bfun_const this(2) have "Bseq (\<lambda>x. inverse c * (c * f x))" by (rule Bseq_mult)
    37.7 -  with `c \<noteq> 0` show "Bseq f" by (simp add: divide_simps)
    37.8 +  with \<open>c \<noteq> 0\<close> show "Bseq f" by (simp add: divide_simps)
    37.9  qed (intro Bseq_mult Bfun_const)
   37.10  
   37.11  lemma Bseq_subseq: "Bseq (f :: nat \<Rightarrow> 'a :: real_normed_vector) \<Longrightarrow> Bseq (\<lambda>x. f (g x))"
    38.1 --- a/src/HOL/List.thy	Mon Dec 07 10:23:50 2015 +0100
    38.2 +++ b/src/HOL/List.thy	Mon Dec 07 10:38:04 2015 +0100
    38.3 @@ -20,12 +20,12 @@
    38.4  datatype_compat list
    38.5  
    38.6  lemma [case_names Nil Cons, cases type: list]:
    38.7 -  -- \<open>for backward compatibility -- names of variables differ\<close>
    38.8 +  \<comment> \<open>for backward compatibility -- names of variables differ\<close>
    38.9    "(y = [] \<Longrightarrow> P) \<Longrightarrow> (\<And>a list. y = a # list \<Longrightarrow> P) \<Longrightarrow> P"
   38.10  by (rule list.exhaust)
   38.11  
   38.12  lemma [case_names Nil Cons, induct type: list]:
   38.13 -  -- \<open>for backward compatibility -- names of variables differ\<close>
   38.14 +  \<comment> \<open>for backward compatibility -- names of variables differ\<close>
   38.15    "P [] \<Longrightarrow> (\<And>a list. P list \<Longrightarrow> P (a # list)) \<Longrightarrow> P list"
   38.16  by (rule list.induct)
   38.17  
   38.18 @@ -42,7 +42,7 @@
   38.19  lemmas set_simps = list.set (* legacy *)
   38.20  
   38.21  syntax
   38.22 -  -- \<open>list Enumeration\<close>
   38.23 +  \<comment> \<open>list Enumeration\<close>
   38.24    "_list" :: "args => 'a list"    ("[(_)]")
   38.25  
   38.26  translations
   38.27 @@ -78,7 +78,7 @@
   38.28  "filter P (x # xs) = (if P x then x # filter P xs else filter P xs)"
   38.29  
   38.30  syntax
   38.31 -  -- \<open>Special syntax for filter\<close>
   38.32 +  \<comment> \<open>Special syntax for filter\<close>
   38.33    "_filter" :: "[pttrn, 'a list, bool] => 'a list"    ("(1[_<-_./ _])")
   38.34  syntax (xsymbols)
   38.35    "_filter" :: "[pttrn, 'a list, bool] => 'a list"("(1[_\<leftarrow>_ ./ _])")
   38.36 @@ -104,19 +104,19 @@
   38.37  primrec drop:: "nat \<Rightarrow> 'a list \<Rightarrow> 'a list" where
   38.38  drop_Nil: "drop n [] = []" |
   38.39  drop_Cons: "drop n (x # xs) = (case n of 0 \<Rightarrow> x # xs | Suc m \<Rightarrow> drop m xs)"
   38.40 -  -- \<open>Warning: simpset does not contain this definition, but separate
   38.41 -       theorems for @{text "n = 0"} and @{text "n = Suc k"}\<close>
   38.42 +  \<comment> \<open>Warning: simpset does not contain this definition, but separate
   38.43 +       theorems for \<open>n = 0\<close> and \<open>n = Suc k\<close>\<close>
   38.44  
   38.45  primrec take:: "nat \<Rightarrow> 'a list \<Rightarrow> 'a list" where
   38.46  take_Nil:"take n [] = []" |
   38.47  take_Cons: "take n (x # xs) = (case n of 0 \<Rightarrow> [] | Suc m \<Rightarrow> x # take m xs)"
   38.48 -  -- \<open>Warning: simpset does not contain this definition, but separate
   38.49 -       theorems for @{text "n = 0"} and @{text "n = Suc k"}\<close>
   38.50 +  \<comment> \<open>Warning: simpset does not contain this definition, but separate
   38.51 +       theorems for \<open>n = 0\<close> and \<open>n = Suc k\<close>\<close>
   38.52  
   38.53  primrec (nonexhaustive) nth :: "'a list => nat => 'a" (infixl "!" 100) where
   38.54  nth_Cons: "(x # xs) ! n = (case n of 0 \<Rightarrow> x | Suc k \<Rightarrow> xs ! k)"
   38.55 -  -- \<open>Warning: simpset does not contain this definition, but separate
   38.56 -       theorems for @{text "n = 0"} and @{text "n = Suc k"}\<close>
   38.57 +  \<comment> \<open>Warning: simpset does not contain this definition, but separate
   38.58 +       theorems for \<open>n = 0\<close> and \<open>n = Suc k\<close>\<close>
   38.59  
   38.60  primrec list_update :: "'a list \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> 'a list" where
   38.61  "list_update [] i v = []" |
   38.62 @@ -147,8 +147,8 @@
   38.63  "zip xs [] = []" |
   38.64  zip_Cons: "zip xs (y # ys) =
   38.65    (case xs of [] => [] | z # zs => (z, y) # zip zs ys)"
   38.66 -  -- \<open>Warning: simpset does not contain this definition, but separate
   38.67 -       theorems for @{text "xs = []"} and @{text "xs = z # zs"}\<close>
   38.68 +  \<comment> \<open>Warning: simpset does not contain this definition, but separate
   38.69 +       theorems for \<open>xs = []\<close> and \<open>xs = z # zs\<close>\<close>
   38.70  
   38.71  primrec product :: "'a list \<Rightarrow> 'b list \<Rightarrow> ('a \<times> 'b) list" where
   38.72  "product [] _ = []" |
   38.73 @@ -177,7 +177,7 @@
   38.74  "find _ [] = None" |
   38.75  "find P (x#xs) = (if P x then Some x else find P xs)"
   38.76  
   38.77 -text \<open>In the context of multisets, @{text count_list} is equivalent to
   38.78 +text \<open>In the context of multisets, \<open>count_list\<close> is equivalent to
   38.79    @{term "count o mset"} and it it advisable to use the latter.\<close>
   38.80  primrec count_list :: "'a list \<Rightarrow> 'a \<Rightarrow> nat" where
   38.81  "count_list [] y = 0" |
   38.82 @@ -225,8 +225,8 @@
   38.83  replicate_Suc: "replicate (Suc n) x = x # replicate n x"
   38.84  
   38.85  text \<open>
   38.86 -  Function @{text size} is overloaded for all datatypes. Users may
   38.87 -  refer to the list version as @{text length}.\<close>
   38.88 +  Function \<open>size\<close> is overloaded for all datatypes. Users may
   38.89 +  refer to the list version as \<open>length\<close>.\<close>
   38.90  
   38.91  abbreviation length :: "'a list \<Rightarrow> nat" where
   38.92  "length \<equiv> size"
   38.93 @@ -367,23 +367,23 @@
   38.94  subsubsection \<open>List comprehension\<close>
   38.95  
   38.96  text\<open>Input syntax for Haskell-like list comprehension notation.
   38.97 -Typical example: @{text"[(x,y). x \<leftarrow> xs, y \<leftarrow> ys, x \<noteq> y]"},
   38.98 -the list of all pairs of distinct elements from @{text xs} and @{text ys}.
   38.99 -The syntax is as in Haskell, except that @{text"|"} becomes a dot
  38.100 -(like in Isabelle's set comprehension): @{text"[e. x \<leftarrow> xs, \<dots>]"} rather than
  38.101 +Typical example: \<open>[(x,y). x \<leftarrow> xs, y \<leftarrow> ys, x \<noteq> y]\<close>,
  38.102 +the list of all pairs of distinct elements from \<open>xs\<close> and \<open>ys\<close>.
  38.103 +The syntax is as in Haskell, except that \<open>|\<close> becomes a dot
  38.104 +(like in Isabelle's set comprehension): \<open>[e. x \<leftarrow> xs, \<dots>]\<close> rather than
  38.105  \verb![e| x <- xs, ...]!.
  38.106  
  38.107  The qualifiers after the dot are
  38.108  \begin{description}
  38.109 -\item[generators] @{text"p \<leftarrow> xs"},
  38.110 - where @{text p} is a pattern and @{text xs} an expression of list type, or
  38.111 -\item[guards] @{text"b"}, where @{text b} is a boolean expression.
  38.112 +\item[generators] \<open>p \<leftarrow> xs\<close>,
  38.113 + where \<open>p\<close> is a pattern and \<open>xs\<close> an expression of list type, or
  38.114 +\item[guards] \<open>b\<close>, where \<open>b\<close> is a boolean expression.
  38.115  %\item[local bindings] @ {text"let x = e"}.
  38.116  \end{description}
  38.117  
  38.118  Just like in Haskell, list comprehension is just a shorthand. To avoid
  38.119  misunderstandings, the translation into desugared form is not reversed
  38.120 -upon output. Note that the translation of @{text"[e. x \<leftarrow> xs]"} is
  38.121 +upon output. Note that the translation of \<open>[e. x \<leftarrow> xs]\<close> is
  38.122  optmized to @{term"map (%x. e) xs"}.
  38.123  
  38.124  It is easy to write short list comprehensions which stand for complex
  38.125 @@ -801,8 +801,7 @@
  38.126  subsubsection \<open>@{const length}\<close>
  38.127  
  38.128  text \<open>
  38.129 -  Needs to come before @{text "@"} because of theorem @{text
  38.130 -  append_eq_append_conv}.
  38.131 +  Needs to come before \<open>@\<close> because of theorem \<open>append_eq_append_conv\<close>.
  38.132  \<close>
  38.133  
  38.134  lemma length_append [simp]: "length (xs @ ys) = length xs + length ys"
  38.135 @@ -926,7 +925,7 @@
  38.136  \<close>
  38.137  
  38.138  
  38.139 -subsubsection \<open>@{text "@"} -- append\<close>
  38.140 +subsubsection \<open>\<open>@\<close> -- append\<close>
  38.141  
  38.142  lemma append_assoc [simp]: "(xs @ ys) @ zs = xs @ (ys @ zs)"
  38.143  by (induct xs) auto
  38.144 @@ -1003,7 +1002,7 @@
  38.145  by(cases ys) auto
  38.146  
  38.147  
  38.148 -text \<open>Trivial rules for solving @{text "@"}-equations automatically.\<close>
  38.149 +text \<open>Trivial rules for solving \<open>@\<close>-equations automatically.\<close>
  38.150  
  38.151  lemma eq_Nil_appendI: "xs = ys ==> xs = [] @ ys"
  38.152  by simp
  38.153 @@ -1019,7 +1018,7 @@
  38.154  
  38.155  text \<open>
  38.156  Simplification procedure for all list equalities.
  38.157 -Currently only tries to rearrange @{text "@"} to see if
  38.158 +Currently only tries to rearrange \<open>@\<close> to see if
  38.159  - both lists end in a singleton list,
  38.160  - or both lists end in the same list.
  38.161  \<close>
  38.162 @@ -1258,7 +1257,7 @@
  38.163  
  38.164  subsubsection \<open>@{const set}\<close>
  38.165  
  38.166 -declare list.set[code_post]  --"pretty output"
  38.167 +declare list.set[code_post]  \<comment>"pretty output"
  38.168  
  38.169  lemma finite_set [iff]: "finite (set xs)"
  38.170  by (induct xs) auto
  38.171 @@ -2782,7 +2781,7 @@
  38.172  
  38.173  subsubsection \<open>@{const fold} with natural argument order\<close>
  38.174  
  38.175 -lemma fold_simps [code]: -- \<open>eta-expanded variant for generated code -- enables tail-recursion optimisation in Scala\<close>
  38.176 +lemma fold_simps [code]: \<comment> \<open>eta-expanded variant for generated code -- enables tail-recursion optimisation in Scala\<close>
  38.177    "fold f [] s = s"
  38.178    "fold f (x # xs) s = fold f xs (f x s)" 
  38.179  by simp_all
  38.180 @@ -2934,7 +2933,7 @@
  38.181  lemma foldl_conv_fold: "foldl f s xs = fold (\<lambda>x s. f s x) xs s"
  38.182  by (induct xs arbitrary: s) simp_all
  38.183  
  38.184 -lemma foldr_conv_foldl: -- \<open>The ``Third Duality Theorem'' in Bird \& Wadler:\<close>
  38.185 +lemma foldr_conv_foldl: \<comment> \<open>The ``Third Duality Theorem'' in Bird \& Wadler:\<close>
  38.186    "foldr f xs a = foldl (\<lambda>x y. f y x) a (rev xs)"
  38.187  by (simp add: foldr_conv_fold foldl_conv_fold)
  38.188  
  38.189 @@ -2980,7 +2979,7 @@
  38.190  subsubsection \<open>@{const upt}\<close>
  38.191  
  38.192  lemma upt_rec[code]: "[i..<j] = (if i<j then i#[Suc i..<j] else [])"
  38.193 --- \<open>simp does not terminate!\<close>
  38.194 +\<comment> \<open>simp does not terminate!\<close>
  38.195  by (induct j) auto
  38.196  
  38.197  lemmas upt_rec_numeral[simp] = upt_rec[of "numeral m" "numeral n"] for m n
  38.198 @@ -3000,14 +2999,14 @@
  38.199  done
  38.200  
  38.201  lemma upt_Suc_append: "i <= j ==> [i..<(Suc j)] = [i..<j]@[j]"
  38.202 --- \<open>Only needed if @{text upt_Suc} is deleted from the simpset.\<close>
  38.203 +\<comment> \<open>Only needed if \<open>upt_Suc\<close> is deleted from the simpset.\<close>
  38.204  by simp
  38.205  
  38.206  lemma upt_conv_Cons: "i < j ==> [i..<j] = i # [Suc i..<j]"
  38.207  by (simp add: upt_rec)
  38.208  
  38.209  lemma upt_add_eq_append: "i<=j ==> [i..<j+k] = [i..<j]@[j..<j+k]"
  38.210 --- \<open>LOOPS as a simprule, since @{text "j <= j"}.\<close>
  38.211 +\<comment> \<open>LOOPS as a simprule, since \<open>j <= j\<close>.\<close>
  38.212  by (induct k) auto
  38.213  
  38.214  lemma length_upt [simp]: "length [i..<j] = j - i"
  38.215 @@ -3080,7 +3079,7 @@
  38.216  done
  38.217  
  38.218  lemma take_equalityI: "(\<forall>i. take i xs = take i ys) ==> xs = ys"
  38.219 --- \<open>The famous take-lemma.\<close>
  38.220 +\<comment> \<open>The famous take-lemma.\<close>
  38.221  apply (drule_tac x = "max (length xs) (length ys)" in spec)
  38.222  apply (simp add: le_max_iff_disj)
  38.223  done
  38.224 @@ -3110,7 +3109,7 @@
  38.225  by (simp add: nth_Cons')
  38.226  
  38.227  
  38.228 -subsubsection \<open>@{text upto}: interval-list on @{typ int}\<close>
  38.229 +subsubsection \<open>\<open>upto\<close>: interval-list on @{typ int}\<close>
  38.230  
  38.231  function upto :: "int \<Rightarrow> int \<Rightarrow> int list" ("(1[_../_])") where
  38.232    "upto i j = (if i \<le> j then i # [i+1..j] else [])"
  38.233 @@ -5155,14 +5154,14 @@
  38.234  qed
  38.235  
  38.236  
  38.237 -subsubsection \<open>@{text sorted_list_of_set}\<close>
  38.238 +subsubsection \<open>\<open>sorted_list_of_set\<close>\<close>
  38.239  
  38.240  text\<open>This function maps (finite) linearly ordered sets to sorted
  38.241  lists. Warning: in most cases it is not a good idea to convert from
  38.242  sets to lists but one should convert in the other direction (via
  38.243  @{const set}).\<close>
  38.244  
  38.245 -subsubsection \<open>@{text sorted_list_of_set}\<close>
  38.246 +subsubsection \<open>\<open>sorted_list_of_set\<close>\<close>
  38.247  
  38.248  text\<open>This function maps (finite) linearly ordered sets to sorted
  38.249  lists. Warning: in most cases it is not a good idea to convert from
  38.250 @@ -5230,7 +5229,7 @@
  38.251    by (rule sorted_distinct_set_unique) simp_all
  38.252  
  38.253  
  38.254 -subsubsection \<open>@{text lists}: the list-forming operator over sets\<close>
  38.255 +subsubsection \<open>\<open>lists\<close>: the list-forming operator over sets\<close>
  38.256  
  38.257  inductive_set
  38.258    lists :: "'a set => 'a list set"
  38.259 @@ -5277,7 +5276,7 @@
  38.260  lemmas append_in_lists_conv [iff] = append_in_listsp_conv [to_set]
  38.261  
  38.262  lemma in_listsp_conv_set: "(listsp A xs) = (\<forall>x \<in> set xs. A x)"
  38.263 --- \<open>eliminate @{text listsp} in favour of @{text set}\<close>
  38.264 +\<comment> \<open>eliminate \<open>listsp\<close> in favour of \<open>set\<close>\<close>
  38.265  by (induct xs) auto
  38.266  
  38.267  lemmas in_lists_conv_set [code_unfold] = in_listsp_conv_set [to_set]
  38.268 @@ -5326,7 +5325,7 @@
  38.269  
  38.270  subsubsection \<open>Lists as Cartesian products\<close>
  38.271  
  38.272 -text\<open>@{text"set_Cons A Xs"}: the set of lists with head drawn from
  38.273 +text\<open>\<open>set_Cons A Xs\<close>: the set of lists with head drawn from
  38.274  @{term A} and tail drawn from @{term Xs}.\<close>
  38.275  
  38.276  definition set_Cons :: "'a set \<Rightarrow> 'a list set \<Rightarrow> 'a list set" where
  38.277 @@ -5350,7 +5349,7 @@
  38.278  text\<open>These orderings preserve well-foundedness: shorter lists 
  38.279    precede longer lists. These ordering are not used in dictionaries.\<close>
  38.280          
  38.281 -primrec -- \<open>The lexicographic ordering for lists of the specified length\<close>
  38.282 +primrec \<comment> \<open>The lexicographic ordering for lists of the specified length\<close>
  38.283    lexn :: "('a \<times> 'a) set \<Rightarrow> nat \<Rightarrow> ('a list \<times> 'a list) set" where
  38.284  "lexn r 0 = {}" |
  38.285  "lexn r (Suc n) =
  38.286 @@ -5358,11 +5357,11 @@
  38.287    {(xs, ys). length xs = Suc n \<and> length ys = Suc n}"
  38.288  
  38.289  definition lex :: "('a \<times> 'a) set \<Rightarrow> ('a list \<times> 'a list) set" where
  38.290 -"lex r = (\<Union>n. lexn r n)" -- \<open>Holds only between lists of the same length\<close>
  38.291 +"lex r = (\<Union>n. lexn r n)" \<comment> \<open>Holds only between lists of the same length\<close>
  38.292  
  38.293  definition lenlex :: "('a \<times> 'a) set => ('a list \<times> 'a list) set" where
  38.294  "lenlex r = inv_image (less_than <*lex*> lex r) (\<lambda>xs. (length xs, xs))"
  38.295 -        -- \<open>Compares lists by their length and then lexicographically\<close>
  38.296 +        \<comment> \<open>Compares lists by their length and then lexicographically\<close>
  38.297  
  38.298  lemma wf_lexn: "wf r ==> wf (lexn r n)"
  38.299  apply (induct n, simp, simp)
  38.300 @@ -5486,7 +5485,7 @@
  38.301    apply (rule_tac x="drop (Suc i) y" in exI)
  38.302    by (simp add: Cons_nth_drop_Suc) 
  38.303  
  38.304 --- \<open>lexord is extension of partial ordering List.lex\<close> 
  38.305 +\<comment> \<open>lexord is extension of partial ordering List.lex\<close> 
  38.306  lemma lexord_lex: "(x,y) \<in> lex r = ((x,y) \<in> lexord r \<and> length x = length y)"
  38.307    apply (rule_tac x = y in spec) 
  38.308    apply (induct_tac x, clarsimp) 
  38.309 @@ -6159,7 +6158,7 @@
  38.310  [code_abbrev]: "member xs x \<longleftrightarrow> x \<in> set xs"
  38.311  
  38.312  text \<open>
  38.313 -  Use @{text member} only for generating executable code.  Otherwise use
  38.314 +  Use \<open>member\<close> only for generating executable code.  Otherwise use
  38.315    @{prop "x \<in> set xs"} instead --- it is much easier to reason about.
  38.316  \<close>
  38.317  
  38.318 @@ -6184,8 +6183,8 @@
  38.319  list_ex1_iff [code_abbrev]: "list_ex1 P xs \<longleftrightarrow> (\<exists>! x. x \<in> set xs \<and> P x)"
  38.320  
  38.321  text \<open>
  38.322 -  Usually you should prefer @{text "\<forall>x\<in>set xs"}, @{text "\<exists>x\<in>set xs"}
  38.323 -  and @{text "\<exists>!x. x\<in>set xs \<and> _"} over @{const list_all}, @{const list_ex}
  38.324 +  Usually you should prefer \<open>\<forall>x\<in>set xs\<close>, \<open>\<exists>x\<in>set xs\<close>
  38.325 +  and \<open>\<exists>!x. x\<in>set xs \<and> _\<close> over @{const list_all}, @{const list_ex}
  38.326    and @{const list_ex1} in specifications.
  38.327  \<close>
  38.328  
  38.329 @@ -6322,7 +6321,7 @@
  38.330    "(\<exists>m\<le>n::nat. P m) \<longleftrightarrow> (\<exists>m \<in> {0..n}. P m)"
  38.331    by auto
  38.332  
  38.333 -text\<open>Bounded @{text LEAST} operator:\<close>
  38.334 +text\<open>Bounded \<open>LEAST\<close> operator:\<close>
  38.335  
  38.336  definition "Bleast S P = (LEAST x. x \<in> S \<and> P x)"
  38.337  
  38.338 @@ -6422,8 +6421,8 @@
  38.339    "map f (filter P xs) = map_filter (\<lambda>x. if P x then Some (f x) else None) xs"
  38.340    by (simp add: map_filter_def)
  38.341  
  38.342 -text \<open>Optimized code for @{text"\<forall>i\<in>{a..b::int}"} and @{text"\<forall>n:{a..<b::nat}"}
  38.343 -and similiarly for @{text"\<exists>"}.\<close>
  38.344 +text \<open>Optimized code for \<open>\<forall>i\<in>{a..b::int}\<close> and \<open>\<forall>n:{a..<b::nat}\<close>
  38.345 +and similiarly for \<open>\<exists>\<close>.\<close>
  38.346  
  38.347  definition all_interval_nat :: "(nat \<Rightarrow> bool) \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" where
  38.348    "all_interval_nat P i j \<longleftrightarrow> (\<forall>n \<in> {i..<j}. P n)"
    39.1 --- a/src/HOL/MacLaurin.thy	Mon Dec 07 10:23:50 2015 +0100
    39.2 +++ b/src/HOL/MacLaurin.thy	Mon Dec 07 10:38:04 2015 +0100
    39.3 @@ -209,7 +209,7 @@
    39.4           f h = (\<Sum>m<n. diff m 0 / (fact m) * h ^ m) +
    39.5           diff n t / (fact n) * h ^ n"
    39.6  proof -
    39.7 -  txt "Transform @{text ABL'} into @{text derivative_intros} format."
    39.8 +  txt "Transform \<open>ABL'\<close> into \<open>derivative_intros\<close> format."
    39.9    note DERIV' = DERIV_chain'[OF _ DERIV[rule_format], THEN DERIV_cong]
   39.10    from assms
   39.11    have "\<exists>t>0. t < - h \<and>
    40.1 --- a/src/HOL/Map.thy	Mon Dec 07 10:23:50 2015 +0100
    40.2 +++ b/src/HOL/Map.thy	Mon Dec 07 10:38:04 2015 +0100
    40.3 @@ -275,7 +275,7 @@
    40.4  by (auto simp: map_comp_def split: option.splits)
    40.5  
    40.6  
    40.7 -subsection \<open>@{text "++"}\<close>
    40.8 +subsection \<open>\<open>++\<close>\<close>
    40.9  
   40.10  lemma map_add_empty[simp]: "m ++ empty = m"
   40.11  by(simp add: map_add_def)
   40.12 @@ -640,7 +640,7 @@
   40.13    by (auto simp add: ran_def)
   40.14  
   40.15  
   40.16 -subsection \<open>@{text "map_le"}\<close>
   40.17 +subsection \<open>\<open>map_le\<close>\<close>
   40.18  
   40.19  lemma map_le_empty [simp]: "empty \<subseteq>\<^sub>m g"
   40.20    by (simp add: map_le_def)
    41.1 --- a/src/HOL/Meson.thy	Mon Dec 07 10:23:50 2015 +0100
    41.2 +++ b/src/HOL/Meson.thy	Mon Dec 07 10:38:04 2015 +0100
    41.3 @@ -22,14 +22,14 @@
    41.4    and not_exD: "!!P. ~(\<exists>x. P(x)) ==> \<forall>x. ~P(x)"
    41.5    by fast+
    41.6  
    41.7 -text \<open>Removal of @{text "-->"} and @{text "<->"} (positive and
    41.8 +text \<open>Removal of \<open>-->\<close> and \<open><->\<close> (positive and
    41.9  negative occurrences)\<close>
   41.10  
   41.11  lemma imp_to_disjD: "P-->Q ==> ~P | Q"
   41.12    and not_impD: "~(P-->Q) ==> P & ~Q"
   41.13    and iff_to_disjD: "P=Q ==> (~P | Q) & (~Q | P)"
   41.14    and not_iffD: "~(P=Q) ==> (P | Q) & (~P | ~Q)"
   41.15 -    -- \<open>Much more efficient than @{prop "(P & ~Q) | (Q & ~P)"} for computing CNF\<close>
   41.16 +    \<comment> \<open>Much more efficient than @{prop "(P & ~Q) | (Q & ~P)"} for computing CNF\<close>
   41.17    and not_refl_disj_D: "x ~= x | P ==> P"
   41.18    by fast+
   41.19  
   41.20 @@ -46,8 +46,8 @@
   41.21  text \<open>Disjunction\<close>
   41.22  
   41.23  lemma disj_exD: "!!P Q. (\<exists>x. P(x)) | (\<exists>x. Q(x)) ==> \<exists>x. P(x) | Q(x)"
   41.24 -  -- \<open>DO NOT USE with forall-Skolemization: makes fewer schematic variables!!\<close>
   41.25 -  -- \<open>With ex-Skolemization, makes fewer Skolem constants\<close>
   41.26 +  \<comment> \<open>DO NOT USE with forall-Skolemization: makes fewer schematic variables!!\<close>
   41.27 +  \<comment> \<open>With ex-Skolemization, makes fewer Skolem constants\<close>
   41.28    and disj_exD1: "!!P Q. (\<exists>x. P(x)) | Q ==> \<exists>x. P(x) | Q"
   41.29    and disj_exD2: "!!P Q. P | (\<exists>x. Q(x)) ==> \<exists>x. P | Q(x)"
   41.30    by fast+
   41.31 @@ -75,7 +75,7 @@
   41.32  lemma make_pos_rule: "P|Q ==> ((P==>~P) ==> Q)"
   41.33  by blast
   41.34  
   41.35 -text\<open>Versions of @{text make_neg_rule} and @{text make_pos_rule} that don't
   41.36 +text\<open>Versions of \<open>make_neg_rule\<close> and \<open>make_pos_rule\<close> that don't
   41.37  insert new assumptions, for ordinary resolution.\<close>
   41.38  
   41.39  lemmas make_neg_rule' = make_refined_neg_rule
    42.1 --- a/src/HOL/Nat.thy	Mon Dec 07 10:23:50 2015 +0100
    42.2 +++ b/src/HOL/Nat.thy	Mon Dec 07 10:38:04 2015 +0100
    42.3 @@ -18,12 +18,12 @@
    42.4  ML_file "~~/src/Provers/Arith/fast_lin_arith.ML"
    42.5  
    42.6  
    42.7 -subsection \<open>Type @{text ind}\<close>
    42.8 +subsection \<open>Type \<open>ind\<close>\<close>
    42.9  
   42.10  typedecl ind
   42.11  
   42.12  axiomatization Zero_Rep :: ind and Suc_Rep :: "ind => ind" where
   42.13 -  -- \<open>the axiom of infinity in 2 parts\<close>
   42.14 +  \<comment> \<open>the axiom of infinity in 2 parts\<close>
   42.15    Suc_Rep_inject:       "Suc_Rep x = Suc_Rep y ==> x = y" and
   42.16    Suc_Rep_not_Zero_Rep: "Suc_Rep x \<noteq> Zero_Rep"
   42.17  
   42.18 @@ -79,7 +79,7 @@
   42.19    shows "P n"
   42.20  using assms
   42.21  apply (unfold Zero_nat_def Suc_def)
   42.22 -apply (rule Rep_Nat_inverse [THEN subst]) -- \<open>types force good instantiation\<close>
   42.23 +apply (rule Rep_Nat_inverse [THEN subst]) \<comment> \<open>types force good instantiation\<close>
   42.24  apply (erule Nat_Rep_Nat [THEN Nat.induct])
   42.25  apply (iprover elim: Nat_Abs_Nat_inverse [THEN subst])
   42.26  done
   42.27 @@ -96,7 +96,7 @@
   42.28    apply (simp only: Suc_not_Zero)
   42.29    done
   42.30  
   42.31 --- \<open>Avoid name clashes by prefixing the output of @{text old_rep_datatype} with @{text old}.\<close>
   42.32 +\<comment> \<open>Avoid name clashes by prefixing the output of \<open>old_rep_datatype\<close> with \<open>old\<close>.\<close>
   42.33  setup \<open>Sign.mandatory_path "old"\<close>
   42.34  
   42.35  old_rep_datatype "0 :: nat" Suc
   42.36 @@ -107,7 +107,7 @@
   42.37  
   42.38  setup \<open>Sign.parent_path\<close>
   42.39  
   42.40 --- \<open>But erase the prefix for properties that are not generated by @{text free_constructors}.\<close>
   42.41 +\<comment> \<open>But erase the prefix for properties that are not generated by \<open>free_constructors\<close>.\<close>
   42.42  setup \<open>Sign.mandatory_path "nat"\<close>
   42.43  
   42.44  declare
   42.45 @@ -126,7 +126,7 @@
   42.46  
   42.47  declare nat.sel[code del]
   42.48  
   42.49 -hide_const (open) Nat.pred -- \<open>hide everything related to the selector\<close>
   42.50 +hide_const (open) Nat.pred \<comment> \<open>hide everything related to the selector\<close>
   42.51  hide_fact
   42.52    nat.case_eq_if
   42.53    nat.collapse
   42.54 @@ -137,12 +137,12 @@
   42.55    nat.split_sel_asm
   42.56  
   42.57  lemma nat_exhaust [case_names 0 Suc, cases type: nat]:
   42.58 -  -- \<open>for backward compatibility -- names of variables differ\<close>
   42.59 +  \<comment> \<open>for backward compatibility -- names of variables differ\<close>
   42.60    "(y = 0 \<Longrightarrow> P) \<Longrightarrow> (\<And>nat. y = Suc nat \<Longrightarrow> P) \<Longrightarrow> P"
   42.61  by (rule old.nat.exhaust)
   42.62  
   42.63  lemma nat_induct [case_names 0 Suc, induct type: nat]:
   42.64 -  -- \<open>for backward compatibility -- names of variables differ\<close>
   42.65 +  \<comment> \<open>for backward compatibility -- names of variables differ\<close>
   42.66    fixes n
   42.67    assumes "P 0" and "\<And>n. P n \<Longrightarrow> P (Suc n)"
   42.68    shows "P n"
   42.69 @@ -313,7 +313,7 @@
   42.70    shows "m + k = n + k \<longleftrightarrow> m = n"
   42.71    by (fact add_right_cancel)
   42.72  
   42.73 -text \<open>Reasoning about @{text "m + 0 = 0"}, etc.\<close>
   42.74 +text \<open>Reasoning about \<open>m + 0 = 0\<close>, etc.\<close>
   42.75  
   42.76  lemma add_is_0 [iff]:
   42.77    fixes m n :: nat
   42.78 @@ -630,7 +630,7 @@
   42.79    apply (blast dest: Suc_lessD)
   42.80    done
   42.81  
   42.82 -text \<open>Can be used with @{text less_Suc_eq} to get @{term "n = m | n < m"}\<close>
   42.83 +text \<open>Can be used with \<open>less_Suc_eq\<close> to get @{term "n = m | n < m"}\<close>
   42.84  lemma not_less_eq: "\<not> m < n \<longleftrightarrow> n < Suc m"
   42.85    unfolding not_less less_Suc_eq_le ..
   42.86  
   42.87 @@ -654,14 +654,14 @@
   42.88  lemma Suc_leI: "m < n ==> Suc(m) \<le> n"
   42.89    unfolding Suc_le_eq .
   42.90  
   42.91 -text \<open>Stronger version of @{text Suc_leD}\<close>
   42.92 +text \<open>Stronger version of \<open>Suc_leD\<close>\<close>
   42.93  lemma Suc_le_lessD: "Suc m \<le> n ==> m < n"
   42.94    unfolding Suc_le_eq .
   42.95  
   42.96  lemma less_imp_le_nat: "m < n ==> m \<le> (n::nat)"
   42.97    unfolding less_eq_Suc_le by (rule Suc_leD)
   42.98  
   42.99 -text \<open>For instance, @{text "(Suc m < Suc n) = (Suc m \<le> n) = (m < n)"}\<close>
  42.100 +text \<open>For instance, \<open>(Suc m < Suc n) = (Suc m \<le> n) = (m < n)\<close>\<close>
  42.101  lemmas le_simps = less_imp_le_nat less_Suc_eq_le Suc_le_eq
  42.102  
  42.103  
  42.104 @@ -673,7 +673,7 @@
  42.105  lemma le_eq_less_or_eq: "(m \<le> (n::nat)) = (m < n | m=n)"
  42.106    by (rule le_less)
  42.107  
  42.108 -text \<open>Useful with @{text blast}.\<close>
  42.109 +text \<open>Useful with \<open>blast\<close>.\<close>
  42.110  lemma eq_imp_le: "(m::nat) = n ==> m \<le> n"
  42.111    by auto
  42.112  
  42.113 @@ -717,7 +717,7 @@
  42.114  lemma neq0_conv[iff]: fixes n :: nat shows "(n \<noteq> 0) = (0 < n)"
  42.115  by (cases n) simp_all
  42.116  
  42.117 -text \<open>This theorem is useful with @{text blast}\<close>
  42.118 +text \<open>This theorem is useful with \<open>blast\<close>\<close>
  42.119  lemma gr0I: "((n::nat) = 0 ==> False) ==> 0 < n"
  42.120  by (rule neq0_conv[THEN iffD1], iprover)
  42.121  
  42.122 @@ -762,7 +762,7 @@
  42.123    apply (induct j, simp_all)
  42.124    done
  42.125  
  42.126 -text \<open>Deleted @{text less_natE}; use @{text "less_imp_Suc_add RS exE"}\<close>
  42.127 +text \<open>Deleted \<open>less_natE\<close>; use \<open>less_imp_Suc_add RS exE\<close>\<close>
  42.128  lemma less_imp_Suc_add: "m < n ==> (\<exists>k. n = Suc (m + k))"
  42.129    apply (induct n)
  42.130    apply (simp_all add: order_le_less)
  42.131 @@ -773,7 +773,7 @@
  42.132  lemma le_Suc_ex: "(k::nat) \<le> l \<Longrightarrow> (\<exists>n. l = k + n)"
  42.133    by (auto simp: less_Suc_eq_le[symmetric] dest: less_imp_Suc_add)
  42.134  
  42.135 -text \<open>strict, in 1st argument; proof is by induction on @{text "k > 0"}\<close>
  42.136 +text \<open>strict, in 1st argument; proof is by induction on \<open>k > 0\<close>\<close>
  42.137  lemma mult_less_mono2: "(i::nat) < j ==> 0<k ==> k * i < k * j"
  42.138  apply(auto simp: gr0_conv_Suc)
  42.139  apply (induct_tac m)
  42.140 @@ -786,7 +786,7 @@
  42.141  by (induct m n rule: diff_induct) simp_all
  42.142  
  42.143  
  42.144 -text\<open>The naturals form an ordered @{text semidom}\<close>
  42.145 +text\<open>The naturals form an ordered \<open>semidom\<close>\<close>
  42.146  instance nat :: linordered_semidom
  42.147  proof
  42.148    show "0 < (1::nat)" by simp
  42.149 @@ -1015,9 +1015,9 @@
  42.150    obtain n where "n = V x" by auto
  42.151    moreover have "\<And>x. V x = n \<Longrightarrow> P x"
  42.152    proof (induct n rule: infinite_descent0)
  42.153 -    case 0 -- "i.e. $V(x) = 0$"
  42.154 +    case 0 \<comment> "i.e. $V(x) = 0$"
  42.155      with A0 show "P x" by auto
  42.156 -  next -- "now $n>0$ and $P(x)$ does not hold for some $x$ with $V(x)=n$"
  42.157 +  next \<comment> "now $n>0$ and $P(x)$ does not hold for some $x$ with $V(x)=n$"
  42.158      case (smaller n)
  42.159      then obtain x where vxn: "V x = n " and "V x > 0 \<and> \<not> P x" by auto
  42.160      with A1 obtain y where "V y < V x \<and> \<not> P y" by auto
  42.161 @@ -1040,8 +1040,8 @@
  42.162    ultimately show "P x" by auto
  42.163  qed
  42.164  
  42.165 -text \<open>A [clumsy] way of lifting @{text "<"}
  42.166 -  monotonicity to @{text "\<le>"} monotonicity\<close>
  42.167 +text \<open>A [clumsy] way of lifting \<open><\<close>
  42.168 +  monotonicity to \<open>\<le>\<close> monotonicity\<close>
  42.169  lemma less_mono_imp_le_mono:
  42.170    "\<lbrakk> !!i j::nat. i < j \<Longrightarrow> f i < f j; i \<le> j \<rbrakk> \<Longrightarrow> f i \<le> ((f j)::nat)"
  42.171  by (simp add: order_le_less) (blast)
  42.172 @@ -1109,7 +1109,7 @@
  42.173  lemma add_leE: "(m::nat) + k \<le> n ==> (m \<le> n ==> k \<le> n ==> R) ==> R"
  42.174  by (blast dest: add_leD1 add_leD2)
  42.175  
  42.176 -text \<open>needs @{text "!!k"} for @{text ac_simps} to work\<close>
  42.177 +text \<open>needs \<open>!!k\<close> for \<open>ac_simps\<close> to work\<close>
  42.178  lemma less_add_eq_less: "!!k::nat. k < l ==> m + l = k + n ==> m < n"
  42.179  by (force simp del: add_Suc_right
  42.180      simp add: less_iff_Suc_add add_Suc_right [symmetric] ac_simps)
  42.181 @@ -1177,14 +1177,14 @@
  42.182  
  42.183  lemma nat_diff_split:
  42.184    "P(a - b::nat) = ((a<b --> P 0) & (ALL d. a = b + d --> P d))"
  42.185 -    -- \<open>elimination of @{text -} on @{text nat}\<close>
  42.186 +    \<comment> \<open>elimination of \<open>-\<close> on \<open>nat\<close>\<close>
  42.187  by (cases "a < b")
  42.188    (auto simp add: diff_is_0_eq [THEN iffD2] diff_add_inverse
  42.189      not_less le_less dest!: add_eq_self_zero add_eq_self_zero[OF sym])
  42.190  
  42.191  lemma nat_diff_split_asm:
  42.192    "P(a - b::nat) = (~ (a < b & ~ P 0 | (EX d. a = b + d & ~ P d)))"
  42.193 -    -- \<open>elimination of @{text -} on @{text nat} in assumptions\<close>
  42.194 +    \<comment> \<open>elimination of \<open>-\<close> on \<open>nat\<close> in assumptions\<close>
  42.195  by (auto split: nat_diff_split)
  42.196  
  42.197  lemma Suc_pred': "0 < n ==> n = Suc(n - 1)"
  42.198 @@ -1214,14 +1214,14 @@
  42.199  lemma mult_le_mono2: "i \<le> (j::nat) ==> k * i \<le> k * j"
  42.200  by (simp add: mult_left_mono)
  42.201  
  42.202 -text \<open>@{text "\<le>"} monotonicity, BOTH arguments\<close>
  42.203 +text \<open>\<open>\<le>\<close> monotonicity, BOTH arguments\<close>
  42.204  lemma mult_le_mono: "i \<le> (j::nat) ==> k \<le> l ==> i * k \<le> j * l"
  42.205  by (simp add: mult_mono)
  42.206  
  42.207  lemma mult_less_mono1: "(i::nat) < j ==> 0 < k ==> i * k < j * k"
  42.208  by (simp add: mult_strict_right_mono)
  42.209  
  42.210 -text\<open>Differs from the standard @{text zero_less_mult_iff} in that
  42.211 +text\<open>Differs from the standard \<open>zero_less_mult_iff\<close> in that
  42.212        there are no negative numbers.\<close>
  42.213  lemma nat_0_less_mult_iff [simp]: "(0 < (m::nat) * n) = (0 < m & 0 < n)"
  42.214    apply (induct m)
  42.215 @@ -1265,7 +1265,7 @@
  42.216  lemma le_cube: "(m::nat) \<le> m * (m * m)"
  42.217    by (cases m) (auto intro: le_add1)
  42.218  
  42.219 -text \<open>Lemma for @{text gcd}\<close>
  42.220 +text \<open>Lemma for \<open>gcd\<close>\<close>
  42.221  lemma mult_eq_self_implies_10: "(m::nat) = m * n ==> n = 1 | m = 0"
  42.222    apply (drule sym)
  42.223    apply (rule disjCI)
  42.224 @@ -1317,7 +1317,7 @@
  42.225  notation (latex output)
  42.226    compower ("(_\<^bsup>_\<^esup>)" [1000] 1000)
  42.227  
  42.228 -text \<open>@{text "f ^^ n = f o ... o f"}, the n-fold composition of @{text f}\<close>
  42.229 +text \<open>\<open>f ^^ n = f o ... o f\<close>, the n-fold composition of \<open>f\<close>\<close>
  42.230  
  42.231  overloading
  42.232    funpow == "compow :: nat \<Rightarrow> ('a \<Rightarrow> 'a) \<Rightarrow> ('a \<Rightarrow> 'a)"
  42.233 @@ -1450,7 +1450,7 @@
  42.234      by (intro gfp_upperbound) (simp del: funpow.simps)
  42.235  qed
  42.236  
  42.237 -subsection \<open>Embedding of the naturals into any @{text semiring_1}: @{term of_nat}\<close>
  42.238 +subsection \<open>Embedding of the naturals into any \<open>semiring_1\<close>: @{term of_nat}\<close>
  42.239  
  42.240  context semiring_1
  42.241  begin
  42.242 @@ -1477,7 +1477,7 @@
  42.243  
  42.244  primrec of_nat_aux :: "('a \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> 'a" where
  42.245    "of_nat_aux inc 0 i = i"
  42.246 -| "of_nat_aux inc (Suc n) i = of_nat_aux inc n (inc i)" -- \<open>tail recursive\<close>
  42.247 +| "of_nat_aux inc (Suc n) i = of_nat_aux inc n (inc i)" \<comment> \<open>tail recursive\<close>
  42.248  
  42.249  lemma of_nat_code:
  42.250    "of_nat n = of_nat_aux (\<lambda>i. i + 1) n 0"
  42.251 @@ -1545,7 +1545,7 @@
  42.252  lemma of_nat_less_imp_less: "of_nat m < of_nat n \<Longrightarrow> m < n"
  42.253    by simp
  42.254  
  42.255 -text\<open>Every @{text linordered_semidom} has characteristic zero.\<close>
  42.256 +text\<open>Every \<open>linordered_semidom\<close> has characteristic zero.\<close>
  42.257  
  42.258  subclass semiring_char_0 proof
  42.259  qed (auto intro!: injI simp add: eq_iff)
  42.260 @@ -1685,7 +1685,7 @@
  42.261    case True
  42.262    then show ?thesis
  42.263      by (induct n n' rule: less_Suc_induct [consumes 1]) (auto intro: mono)
  42.264 -qed (insert \<open>n \<le> n'\<close>, auto) -- \<open>trivial for @{prop "n = n'"}\<close>
  42.265 +qed (insert \<open>n \<le> n'\<close>, auto) \<comment> \<open>trivial for @{prop "n = n'"}\<close>
  42.266  
  42.267  lemma lift_Suc_antimono_le:
  42.268    assumes mono: "\<And>n. f n \<ge> f (Suc n)" and "n \<le> n'"
  42.269 @@ -1694,7 +1694,7 @@
  42.270    case True
  42.271    then show ?thesis
  42.272      by (induct n n' rule: less_Suc_induct [consumes 1]) (auto intro: mono)
  42.273 -qed (insert \<open>n \<le> n'\<close>, auto) -- \<open>trivial for @{prop "n = n'"}\<close>
  42.274 +qed (insert \<open>n \<le> n'\<close>, auto) \<comment> \<open>trivial for @{prop "n = n'"}\<close>
  42.275  
  42.276  lemma lift_Suc_mono_less:
  42.277    assumes mono: "\<And>n. f n < f (Suc n)" and "n < n'"
  42.278 @@ -1750,13 +1750,13 @@
  42.279  by arith
  42.280  
  42.281  lemma le_diff_conv2: "k \<le> j ==> (i \<le> j-k) = (i+k \<le> (j::nat))"
  42.282 -  by (fact le_diff_conv2) -- \<open>FIXME delete\<close>
  42.283 +  by (fact le_diff_conv2) \<comment> \<open>FIXME delete\<close>
  42.284  
  42.285  lemma diff_diff_cancel [simp]: "i \<le> (n::nat) ==> n - (n - i) = i"
  42.286  by arith
  42.287  
  42.288  lemma le_add_diff: "k \<le> (n::nat) ==> m \<le> n + m - k"
  42.289 -  by (fact le_add_diff) -- \<open>FIXME delete\<close>
  42.290 +  by (fact le_add_diff) \<comment> \<open>FIXME delete\<close>
  42.291  
  42.292  (*Replaces the previous diff_less and le_diff_less, which had the stronger
  42.293    second premise n\<le>m*)
  42.294 @@ -1829,8 +1829,7 @@
  42.295  lemmas add_diff_assoc2 = diff_add_assoc2[symmetric]
  42.296  declare diff_diff_left [simp]  add_diff_assoc [simp] add_diff_assoc2[simp]
  42.297  
  42.298 -text\<open>At present we prove no analogue of @{text not_less_Least} or @{text
  42.299 -Least_Suc}, since there appears to be no need.\<close>
  42.300 +text\<open>At present we prove no analogue of \<open>not_less_Least\<close> or \<open>Least_Suc\<close>, since there appears to be no need.\<close>
  42.301  
  42.302  text\<open>Lemmas for ex/Factorization\<close>
  42.303  
  42.304 @@ -2015,7 +2014,7 @@
  42.305  subsection \<open>Size of a datatype value\<close>
  42.306  
  42.307  class size =
  42.308 -  fixes size :: "'a \<Rightarrow> nat" -- \<open>see further theory @{text Wellfounded}\<close>
  42.309 +  fixes size :: "'a \<Rightarrow> nat" \<comment> \<open>see further theory \<open>Wellfounded\<close>\<close>
  42.310  
  42.311  instantiation nat :: size
  42.312  begin
    43.1 --- a/src/HOL/Nitpick.thy	Mon Dec 07 10:23:50 2015 +0100
    43.2 +++ b/src/HOL/Nitpick.thy	Mon Dec 07 10:38:04 2015 +0100
    43.3 @@ -116,7 +116,7 @@
    43.4  
    43.5  text \<open>
    43.6  Auxiliary definitions used to provide an alternative representation for
    43.7 -@{text rat} and @{text real}.
    43.8 +\<open>rat\<close> and \<open>real\<close>.
    43.9  \<close>
   43.10  
   43.11  function nat_gcd :: "nat \<Rightarrow> nat \<Rightarrow> nat" where
    44.1 --- a/src/HOL/Num.thy	Mon Dec 07 10:23:50 2015 +0100
    44.2 +++ b/src/HOL/Num.thy	Mon Dec 07 10:38:04 2015 +0100
    44.3 @@ -9,7 +9,7 @@
    44.4  imports BNF_Least_Fixpoint
    44.5  begin
    44.6  
    44.7 -subsection \<open>The @{text num} type\<close>
    44.8 +subsection \<open>The \<open>num\<close> type\<close>
    44.9  
   44.10  datatype num = One | Bit0 num | Bit1 num
   44.11  
   44.12 @@ -83,8 +83,8 @@
   44.13  
   44.14  text \<open>
   44.15    From now on, there are two possible models for @{typ num}:
   44.16 -  as positive naturals (rule @{text "num_induct"})
   44.17 -  and as digit representation (rules @{text "num.induct"}, @{text "num.cases"}).
   44.18 +  as positive naturals (rule \<open>num_induct\<close>)
   44.19 +  and as digit representation (rules \<open>num.induct\<close>, \<open>num.cases\<close>).
   44.20  \<close>
   44.21  
   44.22  
   44.23 @@ -177,7 +177,7 @@
   44.24  lemma le_num_One_iff: "x \<le> num.One \<longleftrightarrow> x = num.One"
   44.25  by (simp add: antisym_conv)
   44.26  
   44.27 -text \<open>Rules using @{text One} and @{text inc} as constructors\<close>
   44.28 +text \<open>Rules using \<open>One\<close> and \<open>inc\<close> as constructors\<close>
   44.29  
   44.30  lemma add_One: "x + One = inc x"
   44.31    by (simp add: num_eq_iff nat_of_num_add nat_of_num_inc)
   44.32 @@ -237,7 +237,7 @@
   44.33  
   44.34  text \<open>
   44.35    We embed binary representations into a generic algebraic
   44.36 -  structure using @{text numeral}.
   44.37 +  structure using \<open>numeral\<close>.
   44.38  \<close>
   44.39  
   44.40  class numeral = one + semigroup_add
   44.41 @@ -327,7 +327,7 @@
   44.42    @{const numeral} is a morphism.
   44.43  \<close>
   44.44  
   44.45 -subsubsection \<open>Structures with addition: class @{text numeral}\<close>
   44.46 +subsubsection \<open>Structures with addition: class \<open>numeral\<close>\<close>
   44.47  
   44.48  context numeral
   44.49  begin
   44.50 @@ -354,7 +354,7 @@
   44.51  end
   44.52  
   44.53  subsubsection \<open>
   44.54 -  Structures with negation: class @{text neg_numeral}
   44.55 +  Structures with negation: class \<open>neg_numeral\<close>
   44.56  \<close>
   44.57  
   44.58  class neg_numeral = numeral + group_add
   44.59 @@ -492,7 +492,7 @@
   44.60  end
   44.61  
   44.62  subsubsection \<open>
   44.63 -  Structures with multiplication: class @{text semiring_numeral}
   44.64 +  Structures with multiplication: class \<open>semiring_numeral\<close>
   44.65  \<close>
   44.66  
   44.67  class semiring_numeral = semiring + monoid_mult
   44.68 @@ -518,7 +518,7 @@
   44.69  end
   44.70  
   44.71  subsubsection \<open>
   44.72 -  Structures with a zero: class @{text semiring_1}
   44.73 +  Structures with a zero: class \<open>semiring_1\<close>
   44.74  \<close>
   44.75  
   44.76  context semiring_1
   44.77 @@ -548,7 +548,7 @@
   44.78    by (simp_all add: Let_def)
   44.79  
   44.80  subsubsection \<open>
   44.81 -  Equality: class @{text semiring_char_0}
   44.82 +  Equality: class \<open>semiring_char_0\<close>
   44.83  \<close>
   44.84  
   44.85  context semiring_char_0
   44.86 @@ -581,7 +581,7 @@
   44.87  end
   44.88  
   44.89  subsubsection \<open>
   44.90 -  Comparisons: class @{text linordered_semidom}
   44.91 +  Comparisons: class \<open>linordered_semidom\<close>
   44.92  \<close>
   44.93  
   44.94  text \<open>Could be perhaps more general than here.\<close>
   44.95 @@ -672,7 +672,7 @@
   44.96  end
   44.97  
   44.98  subsubsection \<open>
   44.99 -  Multiplication and negation: class @{text ring_1}
  44.100 +  Multiplication and negation: class \<open>ring_1\<close>
  44.101  \<close>
  44.102  
  44.103  context ring_1
  44.104 @@ -696,7 +696,7 @@
  44.105  end
  44.106  
  44.107  subsubsection \<open>
  44.108 -  Equality using @{text iszero} for rings with non-zero characteristic
  44.109 +  Equality using \<open>iszero\<close> for rings with non-zero characteristic
  44.110  \<close>
  44.111  
  44.112  context ring_1
  44.113 @@ -728,16 +728,15 @@
  44.114  lemma eq_iff_iszero_diff: "x = y \<longleftrightarrow> iszero (x - y)"
  44.115    unfolding iszero_def by (rule eq_iff_diff_eq_0)
  44.116  
  44.117 -text \<open>The @{text "eq_numeral_iff_iszero"} lemmas are not declared
  44.118 -@{text "[simp]"} by default, because for rings of characteristic zero,
  44.119 -better simp rules are possible. For a type like integers mod @{text
  44.120 -"n"}, type-instantiated versions of these rules should be added to the
  44.121 +text \<open>The \<open>eq_numeral_iff_iszero\<close> lemmas are not declared
  44.122 +\<open>[simp]\<close> by default, because for rings of characteristic zero,
  44.123 +better simp rules are possible. For a type like integers mod \<open>n\<close>, type-instantiated versions of these rules should be added to the
  44.124  simplifier, along with a type-specific rule for deciding propositions
  44.125 -of the form @{text "iszero (numeral w)"}.
  44.126 +of the form \<open>iszero (numeral w)\<close>.
  44.127  
  44.128  bh: Maybe it would not be so bad to just declare these as simp
  44.129  rules anyway? I should test whether these rules take precedence over
  44.130 -the @{text "ring_char_0"} rules in the simplifier.
  44.131 +the \<open>ring_char_0\<close> rules in the simplifier.
  44.132  \<close>
  44.133  
  44.134  lemma eq_numeral_iff_iszero:
  44.135 @@ -759,7 +758,7 @@
  44.136  end
  44.137  
  44.138  subsubsection \<open>
  44.139 -  Equality and negation: class @{text ring_char_0}
  44.140 +  Equality and negation: class \<open>ring_char_0\<close>
  44.141  \<close>
  44.142  
  44.143  class ring_char_0 = ring_1 + semiring_char_0
  44.144 @@ -835,7 +834,7 @@
  44.145  end
  44.146  
  44.147  subsubsection \<open>
  44.148 -  Structures with negation and order: class @{text linordered_idom}
  44.149 +  Structures with negation and order: class \<open>linordered_idom\<close>
  44.150  \<close>
  44.151  
  44.152  context linordered_idom
  44.153 @@ -1179,7 +1178,7 @@
  44.154  
  44.155  text \<open>
  44.156    For making a minimal simpset, one must include these default simprules.
  44.157 -  Also include @{text simp_thms}.
  44.158 +  Also include \<open>simp_thms\<close>.
  44.159  \<close>
  44.160  
  44.161  lemmas arith_simps =
  44.162 @@ -1209,11 +1208,11 @@
  44.163    eq_numeral_simps eq_neg_numeral_simps eq_numeral_extra
  44.164  
  44.165  lemma Let_numeral [simp]: "Let (numeral v) f = f (numeral v)"
  44.166 -  -- \<open>Unfold all @{text let}s involving constants\<close>
  44.167 +  \<comment> \<open>Unfold all \<open>let\<close>s involving constants\<close>
  44.168    unfolding Let_def ..
  44.169  
  44.170  lemma Let_neg_numeral [simp]: "Let (- numeral v) f = f (- numeral v)"
  44.171 -  -- \<open>Unfold all @{text let}s involving constants\<close>
  44.172 +  \<comment> \<open>Unfold all \<open>let\<close>s involving constants\<close>
  44.173    unfolding Let_def ..
  44.174  
  44.175  declaration \<open>
    45.1 --- a/src/HOL/Numeral_Simprocs.thy	Mon Dec 07 10:23:50 2015 +0100
    45.2 +++ b/src/HOL/Numeral_Simprocs.thy	Mon Dec 07 10:38:04 2015 +0100
    45.3 @@ -23,12 +23,12 @@
    45.4  declare split_div [of _ _ "numeral k", arith_split] for k
    45.5  declare split_mod [of _ _ "numeral k", arith_split] for k
    45.6  
    45.7 -text \<open>For @{text combine_numerals}\<close>
    45.8 +text \<open>For \<open>combine_numerals\<close>\<close>
    45.9  
   45.10  lemma left_add_mult_distrib: "i*u + (j*u + k) = (i+j)*u + (k::nat)"
   45.11  by (simp add: add_mult_distrib)
   45.12  
   45.13 -text \<open>For @{text cancel_numerals}\<close>
   45.14 +text \<open>For \<open>cancel_numerals\<close>\<close>
   45.15  
   45.16  lemma nat_diff_add_eq1:
   45.17       "j <= (i::nat) ==> ((i*u + m) - (j*u + n)) = (((i-j)*u + m) - n)"
   45.18 @@ -62,7 +62,7 @@
   45.19       "i <= (j::nat) ==> (i*u + m <= j*u + n) = (m <= (j-i)*u + n)"
   45.20  by (auto split add: nat_diff_split simp add: add_mult_distrib)
   45.21  
   45.22 -text \<open>For @{text cancel_numeral_factors}\<close>
   45.23 +text \<open>For \<open>cancel_numeral_factors\<close>\<close>
   45.24  
   45.25  lemma nat_mult_le_cancel1: "(0::nat) < k ==> (k*m <= k*n) = (m<=n)"
   45.26  by auto
   45.27 @@ -83,7 +83,7 @@
   45.28  lemma nat_mult_dvd_cancel1: "0 < k \<Longrightarrow> (k*m) dvd (k*n::nat) = (m dvd n)"
   45.29  by(auto)
   45.30  
   45.31 -text \<open>For @{text cancel_factor}\<close>
   45.32 +text \<open>For \<open>cancel_factor\<close>\<close>
   45.33  
   45.34  lemmas nat_mult_le_cancel_disj = mult_le_cancel1
   45.35  
    46.1 --- a/src/HOL/Option.thy	Mon Dec 07 10:23:50 2015 +0100
    46.2 +++ b/src/HOL/Option.thy	Mon Dec 07 10:38:04 2015 +0100
    46.3 @@ -15,12 +15,12 @@
    46.4  datatype_compat option
    46.5  
    46.6  lemma [case_names None Some, cases type: option]:
    46.7 -  -- \<open>for backward compatibility -- names of variables differ\<close>
    46.8 +  \<comment> \<open>for backward compatibility -- names of variables differ\<close>
    46.9    "(y = None \<Longrightarrow> P) \<Longrightarrow> (\<And>a. y = Some a \<Longrightarrow> P) \<Longrightarrow> P"
   46.10    by (rule option.exhaust)
   46.11  
   46.12  lemma [case_names None Some, induct type: option]:
   46.13 -  -- \<open>for backward compatibility -- names of variables differ\<close>
   46.14 +  \<comment> \<open>for backward compatibility -- names of variables differ\<close>
   46.15    "P None \<Longrightarrow> (\<And>option. P (Some option)) \<Longrightarrow> P option"
   46.16    by (rule option.induct)
   46.17  
    47.1 --- a/src/HOL/Order_Relation.thy	Mon Dec 07 10:23:50 2015 +0100
    47.2 +++ b/src/HOL/Order_Relation.thy	Mon Dec 07 10:38:04 2015 +0100
    47.3 @@ -180,9 +180,9 @@
    47.4  subsubsection \<open>The upper and lower bounds operators\<close>
    47.5  
    47.6  text\<open>Here we define upper (``above") and lower (``below") bounds operators.
    47.7 -We think of @{text "r"} as a {\em non-strict} relation.  The suffix ``S"
    47.8 +We think of \<open>r\<close> as a {\em non-strict} relation.  The suffix ``S"
    47.9  at the names of some operators indicates that the bounds are strict -- e.g.,
   47.10 -@{text "underS a"} is the set of all strict lower bounds of @{text "a"} (w.r.t. @{text "r"}).
   47.11 +\<open>underS a\<close> is the set of all strict lower bounds of \<open>a\<close> (w.r.t. \<open>r\<close>).
   47.12  Capitalization of the first letter in the name reminds that the operator acts on sets, rather
   47.13  than on individual elements.\<close>
   47.14  
   47.15 @@ -213,9 +213,9 @@
   47.16  definition ofilter :: "'a rel \<Rightarrow> 'a set \<Rightarrow> bool"
   47.17  where "ofilter r A \<equiv> (A \<le> Field r) \<and> (\<forall>a \<in> A. under r a \<le> A)"
   47.18  
   47.19 -text\<open>Note:  In the definitions of @{text "Above[S]"} and @{text "Under[S]"},
   47.20 -  we bounded comprehension by @{text "Field r"} in order to properly cover
   47.21 -  the case of @{text "A"} being empty.\<close>
   47.22 +text\<open>Note:  In the definitions of \<open>Above[S]\<close> and \<open>Under[S]\<close>,
   47.23 +  we bounded comprehension by \<open>Field r\<close> in order to properly cover
   47.24 +  the case of \<open>A\<close> being empty.\<close>
   47.25  
   47.26  lemma underS_subset_under: "underS r a \<le> under r a"
   47.27  by(auto simp add: underS_def under_def)
   47.28 @@ -362,7 +362,7 @@
   47.29    ultimately show ?thesis using R_def by blast
   47.30  qed
   47.31  
   47.32 -text \<open>The next lemma is a variation of @{text "wf_eq_minimal"} from Wellfounded,
   47.33 +text \<open>The next lemma is a variation of \<open>wf_eq_minimal\<close> from Wellfounded,
   47.34  allowing one to assume the set included in the field.\<close>
   47.35  
   47.36  lemma wf_eq_minimal2:
    48.1 --- a/src/HOL/Orderings.thy	Mon Dec 07 10:23:50 2015 +0100
    48.2 +++ b/src/HOL/Orderings.thy	Mon Dec 07 10:38:04 2015 +0100
    48.3 @@ -18,7 +18,7 @@
    48.4    fixes less_eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<preceq>" 50)
    48.5     and less :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<prec>" 50)
    48.6    assumes strict_iff_order: "a \<prec> b \<longleftrightarrow> a \<preceq> b \<and> a \<noteq> b"
    48.7 -  assumes refl: "a \<preceq> a" -- \<open>not @{text iff}: makes problems due to multiple (dual) interpretations\<close>
    48.8 +  assumes refl: "a \<preceq> a" \<comment> \<open>not \<open>iff\<close>: makes problems due to multiple (dual) interpretations\<close>
    48.9      and antisym: "a \<preceq> b \<Longrightarrow> b \<preceq> a \<Longrightarrow> a = b"
   48.10      and trans: "a \<preceq> b \<Longrightarrow> b \<preceq> c \<Longrightarrow> a \<preceq> c"
   48.11  begin
   48.12 @@ -39,7 +39,7 @@
   48.13    "a \<preceq> b \<longleftrightarrow> a \<prec> b \<or> a = b"
   48.14    by (auto simp add: strict_iff_order refl)
   48.15  
   48.16 -lemma irrefl: -- \<open>not @{text iff}: makes problems due to multiple (dual) interpretations\<close>
   48.17 +lemma irrefl: \<comment> \<open>not \<open>iff\<close>: makes problems due to multiple (dual) interpretations\<close>
   48.18    "\<not> a \<prec> a"
   48.19    by (simp add: strict_iff_order)
   48.20  
   48.21 @@ -127,7 +127,7 @@
   48.22  text \<open>Reflexivity.\<close>
   48.23  
   48.24  lemma eq_refl: "x = y \<Longrightarrow> x \<le> y"
   48.25 -    -- \<open>This form is useful with the classical reasoner.\<close>
   48.26 +    \<comment> \<open>This form is useful with the classical reasoner.\<close>
   48.27  by (erule ssubst) (rule order_refl)
   48.28  
   48.29  lemma less_irrefl [iff]: "\<not> x < x"
   48.30 @@ -198,7 +198,7 @@
   48.31  text \<open>Reflexivity.\<close>
   48.32  
   48.33  lemma le_less: "x \<le> y \<longleftrightarrow> x < y \<or> x = y"
   48.34 -    -- \<open>NOT suitable for iff, since it can cause PROOF FAILED.\<close>
   48.35 +    \<comment> \<open>NOT suitable for iff, since it can cause PROOF FAILED.\<close>
   48.36  by (fact order.order_iff_strict)
   48.37  
   48.38  lemma le_imp_less_or_eq: "x \<le> y \<Longrightarrow> x < y \<or> x = y"
   48.39 @@ -1360,7 +1360,7 @@
   48.40    then show "P (LEAST x. P x)" and "(LEAST x. P x) \<le> k" by auto
   48.41  qed
   48.42  
   48.43 --- "The following 3 lemmas are due to Brian Huffman"
   48.44 +\<comment> "The following 3 lemmas are due to Brian Huffman"
   48.45  lemma LeastI_ex: "\<exists>x. P x \<Longrightarrow> P (Least P)"
   48.46    by (erule exE) (erule LeastI)
   48.47  
    49.1 --- a/src/HOL/Parity.thy	Mon Dec 07 10:23:50 2015 +0100
    49.2 +++ b/src/HOL/Parity.thy	Mon Dec 07 10:38:04 2015 +0100
    49.3 @@ -9,7 +9,7 @@
    49.4  imports Nat_Transfer
    49.5  begin
    49.6  
    49.7 -subsection \<open>Ring structures with parity and @{text even}/@{text odd} predicates\<close>
    49.8 +subsection \<open>Ring structures with parity and \<open>even\<close>/\<open>odd\<close> predicates\<close>
    49.9  
   49.10  class semiring_parity = comm_semiring_1_cancel + numeral +
   49.11    assumes odd_one [simp]: "\<not> 2 dvd 1"
    50.1 --- a/src/HOL/Power.thy	Mon Dec 07 10:23:50 2015 +0100
    50.2 +++ b/src/HOL/Power.thy	Mon Dec 07 10:38:04 2015 +0100
    50.3 @@ -465,7 +465,7 @@
    50.4    "of_nat x ^ n > 0 \<longleftrightarrow> x > 0 \<or> n = 0"
    50.5    by (induct n) auto
    50.6  
    50.7 -text\<open>Surely we can strengthen this? It holds for @{text "0<a<1"} too.\<close>
    50.8 +text\<open>Surely we can strengthen this? It holds for \<open>0<a<1\<close> too.\<close>
    50.9  lemma power_inject_exp [simp]:
   50.10    "1 < a \<Longrightarrow> a ^ m = a ^ n \<longleftrightarrow> m = n"
   50.11    by (force simp add: order_antisym power_le_imp_le_exp)
   50.12 @@ -482,7 +482,7 @@
   50.13    by (induct n)
   50.14     (auto simp add: mult_strict_mono le_less_trans [of 0 a b])
   50.15  
   50.16 -text\<open>Lemma for @{text power_strict_decreasing}\<close>
   50.17 +text\<open>Lemma for \<open>power_strict_decreasing\<close>\<close>
   50.18  lemma power_Suc_less:
   50.19    "0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a * a ^ n < a ^ n"
   50.20    by (induct n)
   50.21 @@ -501,7 +501,7 @@
   50.22    done
   50.23  qed
   50.24  
   50.25 -text\<open>Proof resembles that of @{text power_strict_decreasing}\<close>
   50.26 +text\<open>Proof resembles that of \<open>power_strict_decreasing\<close>\<close>
   50.27  lemma power_decreasing [rule_format]:
   50.28    "n \<le> N \<Longrightarrow> 0 \<le> a \<Longrightarrow> a \<le> 1 \<longrightarrow> a ^ N \<le> a ^ n"
   50.29  proof (induct N)
   50.30 @@ -518,7 +518,7 @@
   50.31    "0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a ^ Suc n < 1"
   50.32    using power_strict_decreasing [of 0 "Suc n" a] by simp
   50.33  
   50.34 -text\<open>Proof again resembles that of @{text power_strict_decreasing}\<close>
   50.35 +text\<open>Proof again resembles that of \<open>power_strict_decreasing\<close>\<close>
   50.36  lemma power_increasing [rule_format]:
   50.37    "n \<le> N \<Longrightarrow> 1 \<le> a \<Longrightarrow> a ^ n \<le> a ^ N"
   50.38  proof (induct N)
   50.39 @@ -531,7 +531,7 @@
   50.40    done
   50.41  qed
   50.42  
   50.43 -text\<open>Lemma for @{text power_strict_increasing}\<close>
   50.44 +text\<open>Lemma for \<open>power_strict_increasing\<close>\<close>
   50.45  lemma power_less_power_Suc:
   50.46    "1 < a \<Longrightarrow> a ^ n < a * a ^ n"
   50.47    by (induct n) (auto simp add: mult_strict_left_mono less_trans [OF zero_less_one])
   50.48 @@ -795,7 +795,7 @@
   50.49    "Suc 0 ^ n = Suc 0"
   50.50    by simp
   50.51  
   50.52 -text\<open>Valid for the naturals, but what if @{text"0<i<1"}?
   50.53 +text\<open>Valid for the naturals, but what if \<open>0<i<1\<close>?
   50.54  Premises cannot be weakened: consider the case where @{term "i=0"},
   50.55  @{term "m=1"} and @{term "n=0"}.\<close>
   50.56  lemma nat_power_less_imp_less:
    51.1 --- a/src/HOL/Presburger.thy	Mon Dec 07 10:23:50 2015 +0100
    51.2 +++ b/src/HOL/Presburger.thy	Mon Dec 07 10:38:04 2015 +0100
    51.3 @@ -12,7 +12,7 @@
    51.4  ML_file "Tools/Qelim/qelim.ML"
    51.5  ML_file "Tools/Qelim/cooper_procedure.ML"
    51.6  
    51.7 -subsection\<open>The @{text "-\<infinity>"} and @{text "+\<infinity>"} Properties\<close>
    51.8 +subsection\<open>The \<open>-\<infinity>\<close> and \<open>+\<infinity>\<close> Properties\<close>
    51.9  
   51.10  lemma minf:
   51.11    "\<lbrakk>\<exists>(z ::'a::linorder).\<forall>x<z. P x = P' x; \<exists>z.\<forall>x<z. Q x = Q' x\<rbrakk> 
   51.12 @@ -176,7 +176,7 @@
   51.13    thus "\<forall>(x::int).(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (\<not>d dvd x+t) \<longrightarrow> (\<not>d dvd (x + D) + t)" by auto
   51.14  qed blast
   51.15  
   51.16 -subsection\<open>Cooper's Theorem @{text "-\<infinity>"} and @{text "+\<infinity>"} Version\<close>
   51.17 +subsection\<open>Cooper's Theorem \<open>-\<infinity>\<close> and \<open>+\<infinity>\<close> Version\<close>
   51.18  
   51.19  subsubsection\<open>First some trivial facts about periodic sets or predicates\<close>
   51.20  lemma periodic_finite_ex:
   51.21 @@ -209,7 +209,7 @@
   51.22    qed
   51.23  qed auto
   51.24  
   51.25 -subsubsection\<open>The @{text "-\<infinity>"} Version\<close>
   51.26 +subsubsection\<open>The \<open>-\<infinity>\<close> Version\<close>
   51.27  
   51.28  lemma decr_lemma: "0 < (d::int) \<Longrightarrow> x - (abs(x-z)+1) * d < z"
   51.29  by(induct rule: int_gr_induct,simp_all add:int_distrib)
   51.30 @@ -277,7 +277,7 @@
   51.31   ultimately show ?thesis by blast
   51.32  qed
   51.33  
   51.34 -subsubsection \<open>The @{text "+\<infinity>"} Version\<close>
   51.35 +subsubsection \<open>The \<open>+\<infinity>\<close> Version\<close>
   51.36  
   51.37  lemma  plusinfinity:
   51.38    assumes dpos: "(0::int) < d" and
   51.39 @@ -372,7 +372,7 @@
   51.40    shows "d dvd t \<equiv> - d dvd t" and "d dvd t \<equiv> d dvd - t"
   51.41    by simp_all
   51.42  
   51.43 -text \<open>\bigskip Theorems for transforming predicates on nat to predicates on @{text int}\<close>
   51.44 +text \<open>\bigskip Theorems for transforming predicates on nat to predicates on \<open>int\<close>\<close>
   51.45  
   51.46  lemma zdiff_int_split: "P (int (x - y)) =
   51.47    ((y \<le> x \<longrightarrow> P (int x - int y)) \<and> (x < y \<longrightarrow> P 0))"
    52.1 --- a/src/HOL/Product_Type.thy	Mon Dec 07 10:23:50 2015 +0100
    52.2 +++ b/src/HOL/Product_Type.thy	Mon Dec 07 10:38:04 2015 +0100
    52.3 @@ -15,7 +15,7 @@
    52.4  free_constructors case_bool for True | False
    52.5    by auto
    52.6  
    52.7 -text \<open>Avoid name clashes by prefixing the output of @{text old_rep_datatype} with @{text old}.\<close>
    52.8 +text \<open>Avoid name clashes by prefixing the output of \<open>old_rep_datatype\<close> with \<open>old\<close>.\<close>
    52.9  
   52.10  setup \<open>Sign.mandatory_path "old"\<close>
   52.11  
   52.12 @@ -23,7 +23,7 @@
   52.13  
   52.14  setup \<open>Sign.parent_path\<close>
   52.15  
   52.16 -text \<open>But erase the prefix for properties that are not generated by @{text free_constructors}.\<close>
   52.17 +text \<open>But erase the prefix for properties that are not generated by \<open>free_constructors\<close>.\<close>
   52.18  
   52.19  setup \<open>Sign.mandatory_path "bool"\<close>
   52.20  
   52.21 @@ -35,7 +35,7 @@
   52.22  setup \<open>Sign.parent_path\<close>
   52.23  
   52.24  declare case_split [cases type: bool]
   52.25 -  -- "prefer plain propositional version"
   52.26 +  \<comment> "prefer plain propositional version"
   52.27  
   52.28  lemma
   52.29    shows [code]: "HOL.equal False P \<longleftrightarrow> \<not> P"
   52.30 @@ -57,7 +57,7 @@
   52.31  | class_instance "bool" :: "equal" \<rightharpoonup> (Haskell) -
   52.32  
   52.33  
   52.34 -subsection \<open>The @{text unit} type\<close>
   52.35 +subsection \<open>The \<open>unit\<close> type\<close>
   52.36  
   52.37  typedef unit = "{True}"
   52.38    by auto
   52.39 @@ -82,7 +82,7 @@
   52.40  free_constructors case_unit for "()"
   52.41    by auto
   52.42  
   52.43 -text \<open>Avoid name clashes by prefixing the output of @{text old_rep_datatype} with @{text old}.\<close>
   52.44 +text \<open>Avoid name clashes by prefixing the output of \<open>old_rep_datatype\<close> with \<open>old\<close>.\<close>
   52.45  
   52.46  setup \<open>Sign.mandatory_path "old"\<close>
   52.47  
   52.48 @@ -90,7 +90,7 @@
   52.49  
   52.50  setup \<open>Sign.parent_path\<close>
   52.51  
   52.52 -text \<open>But erase the prefix for properties that are not generated by @{text free_constructors}.\<close>
   52.53 +text \<open>But erase the prefix for properties that are not generated by \<open>free_constructors\<close>.\<close>
   52.54  
   52.55  setup \<open>Sign.mandatory_path "unit"\<close>
   52.56  
   52.57 @@ -108,7 +108,7 @@
   52.58    by (rule triv_forall_equality)
   52.59  
   52.60  text \<open>
   52.61 -  This rewrite counters the effect of simproc @{text unit_eq} on @{term
   52.62 +  This rewrite counters the effect of simproc \<open>unit_eq\<close> on @{term
   52.63    [source] "%u::unit. f u"}, replacing it by @{term [source]
   52.64    f} rather than by @{term [source] "%u. f ()"}.
   52.65  \<close>
   52.66 @@ -253,7 +253,7 @@
   52.67      by (simp add: Pair_def Abs_prod_inject)
   52.68  qed
   52.69  
   52.70 -text \<open>Avoid name clashes by prefixing the output of @{text old_rep_datatype} with @{text old}.\<close>
   52.71 +text \<open>Avoid name clashes by prefixing the output of \<open>old_rep_datatype\<close> with \<open>old\<close>.\<close>
   52.72  
   52.73  setup \<open>Sign.mandatory_path "old"\<close>
   52.74  
   52.75 @@ -262,7 +262,7 @@
   52.76  
   52.77  setup \<open>Sign.parent_path\<close>
   52.78  
   52.79 -text \<open>But erase the prefix for properties that are not generated by @{text free_constructors}.\<close>
   52.80 +text \<open>But erase the prefix for properties that are not generated by \<open>free_constructors\<close>.\<close>
   52.81  
   52.82  setup \<open>Sign.mandatory_path "prod"\<close>
   52.83  
   52.84 @@ -282,7 +282,7 @@
   52.85  declare prod.split_asm [no_atp]
   52.86  
   52.87  text \<open>
   52.88 -  @{thm [source] prod.split} could be declared as @{text "[split]"}
   52.89 +  @{thm [source] prod.split} could be declared as \<open>[split]\<close>
   52.90    done after the Splitter has been speeded up significantly;
   52.91    precompute the constants involved and don't do anything unless the
   52.92    current goal contains one of those constants.
   52.93 @@ -314,9 +314,9 @@
   52.94    "\<lambda>(x, y, zs). b" \<rightleftharpoons> "CONST case_prod (\<lambda>x (y, zs). b)"
   52.95    "\<lambda>(x, y). b" \<rightleftharpoons> "CONST case_prod (\<lambda>x y. b)"
   52.96    "_abs (CONST Pair x y) t" \<rightharpoonup> "\<lambda>(x, y). t"
   52.97 -  -- \<open>This rule accommodates tuples in @{text "case C \<dots> (x, y) \<dots> \<Rightarrow> \<dots>"}:
   52.98 -     The @{text "(x, y)"} is parsed as @{text "Pair x y"} because it is @{text logic},
   52.99 -     not @{text pttrn}.\<close>
  52.100 +  \<comment> \<open>This rule accommodates tuples in \<open>case C \<dots> (x, y) \<dots> \<Rightarrow> \<dots>\<close>:
  52.101 +     The \<open>(x, y)\<close> is parsed as \<open>Pair x y\<close> because it is \<open>logic\<close>,
  52.102 +     not \<open>pttrn\<close>.\<close>
  52.103  
  52.104  text \<open>print @{term "case_prod f"} as @{term "\<lambda>(x, y). f x y"} and
  52.105    @{term "case_prod (\<lambda>x. f x)"} as @{term "\<lambda>(x, y). f x y"}\<close>
  52.106 @@ -457,7 +457,7 @@
  52.107    by (simp add: fun_eq_iff split: prod.split)
  52.108  
  52.109  lemma case_prod_eta: "(\<lambda>(x, y). f (x, y)) = f"
  52.110 -  -- \<open>Subsumes the old @{text split_Pair} when @{term f} is the identity function.\<close>
  52.111 +  \<comment> \<open>Subsumes the old \<open>split_Pair\<close> when @{term f} is the identity function.\<close>
  52.112    by (simp add: fun_eq_iff split: prod.split)
  52.113  
  52.114  lemma case_prod_comp: "(case x of (a, b) \<Rightarrow> (f \<circ> g) a b) = f (g (fst x)) (snd x)"
  52.115 @@ -483,8 +483,8 @@
  52.116  text \<open>
  52.117    The rule @{thm [source] split_paired_all} does not work with the
  52.118    Simplifier because it also affects premises in congrence rules,
  52.119 -  where this can lead to premises of the form @{text "!!a b. ... =
  52.120 -  ?P(a, b)"} which cannot be solved by reflexivity.
  52.121 +  where this can lead to premises of the form \<open>!!a b. ... =
  52.122 +  ?P(a, b)\<close> which cannot be solved by reflexivity.
  52.123  \<close>
  52.124  
  52.125  lemmas split_tupled_all = split_paired_all unit_all_eq2
  52.126 @@ -518,22 +518,21 @@
  52.127  setup \<open>map_theory_claset (fn ctxt => ctxt addSbefore ("split_all_tac", split_all_tac))\<close>
  52.128  
  52.129  lemma split_paired_All [simp, no_atp]: "(ALL x. P x) = (ALL a b. P (a, b))"
  52.130 -  -- \<open>@{text "[iff]"} is not a good idea because it makes @{text blast} loop\<close>
  52.131 +  \<comment> \<open>\<open>[iff]\<close> is not a good idea because it makes \<open>blast\<close> loop\<close>
  52.132    by fast
  52.133  
  52.134  lemma split_paired_Ex [simp, no_atp]: "(EX x. P x) = (EX a b. P (a, b))"
  52.135    by fast
  52.136  
  52.137  lemma split_paired_The [no_atp]: "(THE x. P x) = (THE (a, b). P (a, b))"
  52.138 -  -- \<open>Can't be added to simpset: loops!\<close>
  52.139 +  \<comment> \<open>Can't be added to simpset: loops!\<close>
  52.140    by (simp add: case_prod_eta)
  52.141  
  52.142  text \<open>
  52.143    Simplification procedure for @{thm [source] cond_case_prod_eta}.  Using
  52.144    @{thm [source] case_prod_eta} as a rewrite rule is not general enough,
  52.145    and using @{thm [source] cond_case_prod_eta} directly would render some
  52.146 -  existing proofs very inefficient; similarly for @{text
  52.147 -  prod.case_eq_if}.
  52.148 +  existing proofs very inefficient; similarly for \<open>prod.case_eq_if\<close>.
  52.149  \<close>
  52.150  
  52.151  ML \<open>
  52.152 @@ -590,8 +589,8 @@
  52.153  text \<open>
  52.154    \medskip @{const case_prod} used as a logical connective or set former.
  52.155  
  52.156 -  \medskip These rules are for use with @{text blast}; could instead
  52.157 -  call @{text simp} using @{thm [source] prod.split} as rewrite.\<close>
  52.158 +  \medskip These rules are for use with \<open>blast\<close>; could instead
  52.159 +  call \<open>simp\<close> using @{thm [source] prod.split} as rewrite.\<close>
  52.160  
  52.161  lemma case_prodI2:
  52.162    "\<And>p. (\<And>a b. p = (a, b) \<Longrightarrow> c a b) \<Longrightarrow> case p of (a, b) \<Rightarrow> c a b"
  52.163 @@ -631,10 +630,10 @@
  52.164    "\<And>p. (\<And>a b. p = (a, b) \<Longrightarrow> z \<in> c a b) \<Longrightarrow> z \<in> (case p of (a, b) \<Rightarrow> c a b)"
  52.165    by (simp only: split_tupled_all) simp
  52.166  
  52.167 -declare mem_case_prodI [intro!] -- \<open>postponed to maintain traditional declaration order!\<close>
  52.168 -declare case_prodI2' [intro!] -- \<open>postponed to maintain traditional declaration order!\<close>
  52.169 -declare case_prodI2 [intro!] -- \<open>postponed to maintain traditional declaration order!\<close>
  52.170 -declare case_prodI [intro!] -- \<open>postponed to maintain traditional declaration order!\<close>
  52.171 +declare mem_case_prodI [intro!] \<comment> \<open>postponed to maintain traditional declaration order!\<close>
  52.172 +declare case_prodI2' [intro!] \<comment> \<open>postponed to maintain traditional declaration order!\<close>
  52.173 +declare case_prodI2 [intro!] \<comment> \<open>postponed to maintain traditional declaration order!\<close>
  52.174 +declare case_prodI [intro!] \<comment> \<open>postponed to maintain traditional declaration order!\<close>
  52.175    
  52.176  lemma mem_case_prodE [elim!]:
  52.177    assumes "z \<in> case_prod c p"
  52.178 @@ -666,7 +665,7 @@
  52.179    by (rule ext) fast
  52.180  
  52.181  lemma split_part [simp]: "(%(a,b). P & Q a b) = (%ab. P & case_prod Q ab)"
  52.182 -  -- \<open>Allows simplifications of nested splits in case of independent predicates.\<close>
  52.183 +  \<comment> \<open>Allows simplifications of nested splits in case of independent predicates.\<close>
  52.184    by (rule ext) blast
  52.185  
  52.186  (* Do NOT make this a simp rule as it
  52.187 @@ -1027,7 +1026,7 @@
  52.188      "[| c: Sigma A B;
  52.189          !!x y.[| x:A;  y:B(x);  c=(x,y) |] ==> P
  52.190       |] ==> P"
  52.191 -  -- \<open>The general elimination rule.\<close>
  52.192 +  \<comment> \<open>The general elimination rule.\<close>
  52.193    by (unfold Sigma_def) blast
  52.194  
  52.195  text \<open>
  52.196 @@ -1105,7 +1104,7 @@
  52.197    
  52.198  lemma UN_Times_distrib:
  52.199    "(\<Union>(a, b)\<in>A \<times> B. E a \<times> F b) = UNION A E \<times> UNION B F"
  52.200 -  -- \<open>Suggested by Pierre Chartier\<close>
  52.201 +  \<comment> \<open>Suggested by Pierre Chartier\<close>
  52.202    by blast
  52.203  
  52.204  lemma split_paired_Ball_Sigma [simp, no_atp]:
    53.1 --- a/src/HOL/Quickcheck_Narrowing.thy	Mon Dec 07 10:23:50 2015 +0100
    53.2 +++ b/src/HOL/Quickcheck_Narrowing.thy	Mon Dec 07 10:38:04 2015 +0100
    53.3 @@ -155,9 +155,9 @@
    53.4  where
    53.5    "all f = (case narrowing (100 :: integer) of Narrowing_cons ty cs => Universal ty (\<lambda>t. f (conv cs t)) (partial_term_of (TYPE('a))))"
    53.6  
    53.7 -subsubsection \<open>class @{text is_testable}\<close>
    53.8 +subsubsection \<open>class \<open>is_testable\<close>\<close>
    53.9  
   53.10 -text \<open>The class @{text is_testable} ensures that all necessary type instances are generated.\<close>
   53.11 +text \<open>The class \<open>is_testable\<close> ensures that all necessary type instances are generated.\<close>
   53.12  
   53.13  class is_testable
   53.14  
   53.15 @@ -319,7 +319,7 @@
   53.16             (Generated'_Code.Const \"Groups.uminus'_class.uminus\" (mkFunT t t))
   53.17             (mkNumber (- i)); } in mkNumber)"
   53.18  
   53.19 -subsection \<open>The @{text find_unused_assms} command\<close>
   53.20 +subsection \<open>The \<open>find_unused_assms\<close> command\<close>
   53.21  
   53.22  ML_file "Tools/Quickcheck/find_unused_assms.ML"
   53.23  
    54.1 --- a/src/HOL/Quickcheck_Random.thy	Mon Dec 07 10:23:50 2015 +0100
    54.2 +++ b/src/HOL/Quickcheck_Random.thy	Mon Dec 07 10:38:04 2015 +0100
    54.3 @@ -18,7 +18,7 @@
    54.4  code_printing
    54.5    constant catch_match \<rightharpoonup> (Quickcheck) "((_) handle Match => _)"
    54.6  
    54.7 -subsection \<open>The @{text random} class\<close>
    54.8 +subsection \<open>The \<open>random\<close> class\<close>
    54.9  
   54.10  class random = typerep +
   54.11    fixes random :: "natural \<Rightarrow> Random.seed \<Rightarrow> ('a \<times> (unit \<Rightarrow> term)) \<times> Random.seed"
   54.12 @@ -213,8 +213,8 @@
   54.13  
   54.14  code_printing
   54.15    constant random_fun_aux \<rightharpoonup> (Quickcheck) "Random'_Generators.random'_fun"
   54.16 -  -- \<open>With enough criminal energy this can be abused to derive @{prop False};
   54.17 -  for this reason we use a distinguished target @{text Quickcheck}
   54.18 +  \<comment> \<open>With enough criminal energy this can be abused to derive @{prop False};
   54.19 +  for this reason we use a distinguished target \<open>Quickcheck\<close>
   54.20    not spoiling the regular trusted code generation\<close>
   54.21  
   54.22  code_reserved Quickcheck Random_Generators
    55.1 --- a/src/HOL/Quotient.thy	Mon Dec 07 10:23:50 2015 +0100
    55.2 +++ b/src/HOL/Quotient.thy	Mon Dec 07 10:38:04 2015 +0100
    55.3 @@ -64,7 +64,7 @@
    55.4    by blast
    55.5  
    55.6  lemma Quotient3_rel:
    55.7 -  "R r r \<and> R s s \<and> Abs r = Abs s \<longleftrightarrow> R r s" -- \<open>orientation does not loop on rewriting\<close>
    55.8 +  "R r r \<and> R s s \<and> Abs r = Abs s \<longleftrightarrow> R r s" \<comment> \<open>orientation does not loop on rewriting\<close>
    55.9    using a
   55.10    unfolding Quotient3_def
   55.11    by blast
   55.12 @@ -196,7 +196,7 @@
   55.13    In the following theorem R1 can be instantiated with anything,
   55.14    but we know some of the types of the Rep and Abs functions;
   55.15    so by solving Quotient assumptions we can get a unique R1 that
   55.16 -  will be provable; which is why we need to use @{text apply_rsp} and
   55.17 +  will be provable; which is why we need to use \<open>apply_rsp\<close> and
   55.18    not the primed version\<close>
   55.19  
   55.20  lemma apply_rspQ3:
   55.21 @@ -392,7 +392,7 @@
   55.22    using a unfolding Quotient3_def Bex_def in_respects id_apply comp_def map_fun_def
   55.23    by metis
   55.24  
   55.25 -subsection \<open>@{text Bex1_rel} quantifier\<close>
   55.26 +subsection \<open>\<open>Bex1_rel\<close> quantifier\<close>
   55.27  
   55.28  definition
   55.29    Bex1_rel :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
    56.1 --- a/src/HOL/Random.thy	Mon Dec 07 10:23:50 2015 +0100
    56.2 +++ b/src/HOL/Random.thy	Mon Dec 07 10:38:04 2015 +0100
    56.3 @@ -136,7 +136,7 @@
    56.4  qed
    56.5  
    56.6  
    56.7 -subsection \<open>@{text ML} interface\<close>
    56.8 +subsection \<open>\<open>ML\<close> interface\<close>
    56.9  
   56.10  code_reflect Random_Engine
   56.11    functions range select select_weight
    57.1 --- a/src/HOL/Rat.thy	Mon Dec 07 10:23:50 2015 +0100
    57.2 +++ b/src/HOL/Rat.thy	Mon Dec 07 10:38:04 2015 +0100
    57.3 @@ -244,7 +244,7 @@
    57.4    with Fract \<open>q = Fract a b\<close> \<open>b > 0\<close> \<open>coprime a b\<close> show C by blast
    57.5  qed
    57.6  
    57.7 -subsubsection \<open>Function @{text normalize}\<close>
    57.8 +subsubsection \<open>Function \<open>normalize\<close>\<close>
    57.9  
   57.10  lemma Fract_coprime: "Fract (a div gcd a b) (b div gcd a b) = Fract a b"
   57.11  proof (cases "b = 0")
    58.1 --- a/src/HOL/Real.thy	Mon Dec 07 10:23:50 2015 +0100
    58.2 +++ b/src/HOL/Real.thy	Mon Dec 07 10:38:04 2015 +0100
    58.3 @@ -1401,7 +1401,7 @@
    58.4  done
    58.5  
    58.6  
    58.7 -text\<open>Similar results are proved in @{text Fields}\<close>
    58.8 +text\<open>Similar results are proved in \<open>Fields\<close>\<close>
    58.9  lemma real_less_half_sum: "x < y ==> x < (x+y) / (2::real)"
   58.10    by auto
   58.11  
   58.12 @@ -1488,7 +1488,7 @@
   58.13      moreover have "j * b < 1 + i"
   58.14      proof -
   58.15        have "real_of_int (j * b) < real_of_int i + 1"
   58.16 -        using `a < 1 + real_of_int i` `real_of_int j * real_of_int b \<le> a` by force
   58.17 +        using \<open>a < 1 + real_of_int i\<close> \<open>real_of_int j * real_of_int b \<le> a\<close> by force
   58.18        thus "j * b < 1 + i"
   58.19          by linarith
   58.20      qed
    59.1 --- a/src/HOL/Real_Vector_Spaces.thy	Mon Dec 07 10:23:50 2015 +0100
    59.2 +++ b/src/HOL/Real_Vector_Spaces.thy	Mon Dec 07 10:38:04 2015 +0100
    59.3 @@ -264,7 +264,7 @@
    59.4    by metis
    59.5  
    59.6  
    59.7 -subsection \<open>Embedding of the Reals into any @{text real_algebra_1}:
    59.8 +subsection \<open>Embedding of the Reals into any \<open>real_algebra_1\<close>:
    59.9  @{term of_real}\<close>
   59.10  
   59.11  definition
   59.12 @@ -927,7 +927,7 @@
   59.13      "norm (of_real b - of_real a :: 'a::real_normed_algebra_1) \<le> \<bar>b - a\<bar>"
   59.14    by (metis norm_of_real of_real_diff order_refl)
   59.15  
   59.16 -text\<open>Despite a superficial resemblance, @{text norm_eq_1} is not relevant.\<close>
   59.17 +text\<open>Despite a superficial resemblance, \<open>norm_eq_1\<close> is not relevant.\<close>
   59.18  lemma square_norm_one:
   59.19    fixes x :: "'a::real_normed_div_algebra"
   59.20    assumes "x^2 = 1" shows "norm x = 1"
   59.21 @@ -1222,17 +1222,17 @@
   59.22  
   59.23  subsection \<open>Extra type constraints\<close>
   59.24  
   59.25 -text \<open>Only allow @{term "open"} in class @{text topological_space}.\<close>
   59.26 +text \<open>Only allow @{term "open"} in class \<open>topological_space\<close>.\<close>
   59.27  
   59.28  setup \<open>Sign.add_const_constraint
   59.29    (@{const_name "open"}, SOME @{typ "'a::topological_space set \<Rightarrow> bool"})\<close>
   59.30  
   59.31 -text \<open>Only allow @{term dist} in class @{text metric_space}.\<close>
   59.32 +text \<open>Only allow @{term dist} in class \<open>metric_space\<close>.\<close>
   59.33  
   59.34  setup \<open>Sign.add_const_constraint
   59.35    (@{const_name dist}, SOME @{typ "'a::metric_space \<Rightarrow> 'a \<Rightarrow> real"})\<close>
   59.36  
   59.37 -text \<open>Only allow @{term norm} in class @{text real_normed_vector}.\<close>
   59.38 +text \<open>Only allow @{term norm} in class \<open>real_normed_vector\<close>.\<close>
   59.39  
   59.40  setup \<open>Sign.add_const_constraint
   59.41    (@{const_name norm}, SOME @{typ "'a::real_normed_vector \<Rightarrow> real"})\<close>
   59.42 @@ -1731,7 +1731,7 @@
   59.43    show "\<forall>e>0. \<exists>M. \<forall>m\<ge>M. \<forall>n>m. dist (f m) (f n) < e"
   59.44    proof (intro allI impI)
   59.45      fix e :: real assume e: "e > 0"
   59.46 -    with `Cauchy f` obtain M where "\<And>m n. m \<ge> M \<Longrightarrow> n \<ge> M \<Longrightarrow> dist (f m) (f n) < e"
   59.47 +    with \<open>Cauchy f\<close> obtain M where "\<And>m n. m \<ge> M \<Longrightarrow> n \<ge> M \<Longrightarrow> dist (f m) (f n) < e"
   59.48        unfolding Cauchy_def by blast
   59.49      thus "\<exists>M. \<forall>m\<ge>M. \<forall>n>m. dist (f m) (f n) < e" by (intro exI[of _ M]) force
   59.50    qed
    60.1 --- a/src/HOL/Record.thy	Mon Dec 07 10:23:50 2015 +0100
    60.2 +++ b/src/HOL/Record.thy	Mon Dec 07 10:38:04 2015 +0100
    60.3 @@ -18,14 +18,14 @@
    60.4  text \<open>
    60.5    Records are isomorphic to compound tuple types. To implement
    60.6    efficient records, we make this isomorphism explicit. Consider the
    60.7 -  record access/update simplification @{text "alpha (beta_update f
    60.8 -  rec) = alpha rec"} for distinct fields alpha and beta of some record
    60.9 -  rec with n fields. There are @{text "n ^ 2"} such theorems, which
   60.10 +  record access/update simplification \<open>alpha (beta_update f
   60.11 +  rec) = alpha rec\<close> for distinct fields alpha and beta of some record
   60.12 +  rec with n fields. There are \<open>n ^ 2\<close> such theorems, which
   60.13    prohibits storage of all of them for large n. The rules can be
   60.14    proved on the fly by case decomposition and simplification in O(n)
   60.15    time. By creating O(n) isomorphic-tuple types while defining the
   60.16    record, however, we can prove the access/update simplification in
   60.17 -  @{text "O(log(n)^2)"} time.
   60.18 +  \<open>O(log(n)^2)\<close> time.
   60.19  
   60.20    The O(n) cost of case decomposition is not because O(n) steps are
   60.21    taken, but rather because the resulting rule must contain O(n) new
   60.22 @@ -34,39 +34,36 @@
   60.23    access/update theorems.
   60.24  
   60.25    Record types are defined as isomorphic to tuple types. For instance,
   60.26 -  a record type with fields @{text "'a"}, @{text "'b"}, @{text "'c"}
   60.27 -  and @{text "'d"} might be introduced as isomorphic to @{text "'a \<times>
   60.28 -  ('b \<times> ('c \<times> 'd))"}. If we balance the tuple tree to @{text "('a \<times>
   60.29 -  'b) \<times> ('c \<times> 'd)"} then accessors can be defined by converting to the
   60.30 +  a record type with fields \<open>'a\<close>, \<open>'b\<close>, \<open>'c\<close>
   60.31 +  and \<open>'d\<close> might be introduced as isomorphic to \<open>'a \<times>
   60.32 +  ('b \<times> ('c \<times> 'd))\<close>. If we balance the tuple tree to \<open>('a \<times>
   60.33 +  'b) \<times> ('c \<times> 'd)\<close> then accessors can be defined by converting to the
   60.34    underlying type then using O(log(n)) fst or snd operations.
   60.35 -  Updators can be defined similarly, if we introduce a @{text
   60.36 -  "fst_update"} and @{text "snd_update"} function. Furthermore, we can
   60.37 +  Updators can be defined similarly, if we introduce a \<open>fst_update\<close> and \<open>snd_update\<close> function. Furthermore, we can
   60.38    prove the access/update theorem in O(log(n)) steps by using simple
   60.39 -  rewrites on fst, snd, @{text "fst_update"} and @{text "snd_update"}.
   60.40 +  rewrites on fst, snd, \<open>fst_update\<close> and \<open>snd_update\<close>.
   60.41  
   60.42    The catch is that, although O(log(n)) steps were taken, the
   60.43    underlying type we converted to is a tuple tree of size
   60.44    O(n). Processing this term type wastes performance. We avoid this
   60.45    for large n by taking each subtree of size K and defining a new type
   60.46    isomorphic to that tuple subtree. A record can now be defined as
   60.47 -  isomorphic to a tuple tree of these O(n/K) new types, or, if @{text
   60.48 -  "n > K*K"}, we can repeat the process, until the record can be
   60.49 +  isomorphic to a tuple tree of these O(n/K) new types, or, if \<open>n > K*K\<close>, we can repeat the process, until the record can be
   60.50    defined in terms of a tuple tree of complexity less than the
   60.51    constant K.
   60.52  
   60.53    If we prove the access/update theorem on this type with the
   60.54 -  analogous steps to the tuple tree, we consume @{text "O(log(n)^2)"}
   60.55 -  time as the intermediate terms are @{text "O(log(n))"} in size and
   60.56 +  analogous steps to the tuple tree, we consume \<open>O(log(n)^2)\<close>
   60.57 +  time as the intermediate terms are \<open>O(log(n))\<close> in size and
   60.58    the types needed have size bounded by K.  To enable this analogous
   60.59 -  traversal, we define the functions seen below: @{text
   60.60 -  "iso_tuple_fst"}, @{text "iso_tuple_snd"}, @{text "iso_tuple_fst_update"}
   60.61 -  and @{text "iso_tuple_snd_update"}. These functions generalise tuple
   60.62 +  traversal, we define the functions seen below: \<open>iso_tuple_fst\<close>, \<open>iso_tuple_snd\<close>, \<open>iso_tuple_fst_update\<close>
   60.63 +  and \<open>iso_tuple_snd_update\<close>. These functions generalise tuple
   60.64    operations by taking a parameter that encapsulates a tuple
   60.65    isomorphism.  The rewrites needed on these functions now need an
   60.66    additional assumption which is that the isomorphism works.
   60.67  
   60.68    These rewrites are typically used in a structured way. They are here
   60.69 -  presented as the introduction rule @{text "isomorphic_tuple.intros"}
   60.70 +  presented as the introduction rule \<open>isomorphic_tuple.intros\<close>
   60.71    rather than as a rewrite rule set. The introduction form is an
   60.72    optimisation, as net matching can be performed at one term location
   60.73    for each step rather than the simplifier searching the term for
    61.1 --- a/src/HOL/Relation.thy	Mon Dec 07 10:23:50 2015 +0100
    61.2 +++ b/src/HOL/Relation.thy	Mon Dec 07 10:38:04 2015 +0100
    61.3 @@ -57,11 +57,11 @@
    61.4  
    61.5  type_synonym 'a rel = "('a * 'a) set"
    61.6  
    61.7 -lemma subrelI: -- \<open>Version of @{thm [source] subsetI} for binary relations\<close>
    61.8 +lemma subrelI: \<comment> \<open>Version of @{thm [source] subsetI} for binary relations\<close>
    61.9    "(\<And>x y. (x, y) \<in> r \<Longrightarrow> (x, y) \<in> s) \<Longrightarrow> r \<subseteq> s"
   61.10    by auto
   61.11  
   61.12 -lemma lfp_induct2: -- \<open>Version of @{thm [source] lfp_induct} for binary relations\<close>
   61.13 +lemma lfp_induct2: \<comment> \<open>Version of @{thm [source] lfp_induct} for binary relations\<close>
   61.14    "(a, b) \<in> lfp f \<Longrightarrow> mono f \<Longrightarrow>
   61.15      (\<And>a b. (a, b) \<in> f (lfp f \<inter> {(x, y). P x y}) \<Longrightarrow> P a b) \<Longrightarrow> P a b"
   61.16    using lfp_induct_set [of "(a, b)" f "case_prod P"] by auto
   61.17 @@ -150,7 +150,7 @@
   61.18    "refl_on A r \<longleftrightarrow> r \<subseteq> A \<times> A \<and> (\<forall>x\<in>A. (x, x) \<in> r)"
   61.19  
   61.20  abbreviation refl :: "'a rel \<Rightarrow> bool"
   61.21 -where -- \<open>reflexivity over a type\<close>
   61.22 +where \<comment> \<open>reflexivity over a type\<close>
   61.23    "refl \<equiv> refl_on UNIV"
   61.24  
   61.25  definition reflp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
   61.26 @@ -380,7 +380,7 @@
   61.27    by (simp add: trans_def transp_def)
   61.28  
   61.29  abbreviation transP :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
   61.30 -where -- \<open>FIXME drop\<close>
   61.31 +where \<comment> \<open>FIXME drop\<close>
   61.32    "transP r \<equiv> trans {(x, y). r x y}"
   61.33  
   61.34  lemma transI:
   61.35 @@ -494,7 +494,7 @@
   61.36    by (simp add: refl_on_def)
   61.37  
   61.38  lemma antisym_Id: "antisym Id"
   61.39 -  -- \<open>A strange result, since @{text Id} is also symmetric.\<close>
   61.40 +  \<comment> \<open>A strange result, since \<open>Id\<close> is also symmetric.\<close>
   61.41    by (simp add: antisym_def)
   61.42  
   61.43  lemma sym_Id: "sym Id"
   61.44 @@ -533,7 +533,7 @@
   61.45  
   61.46  lemma Id_onE [elim!]:
   61.47    "c : Id_on A ==> (!!x. x : A ==> c = (x, x) ==> P) ==> P"
   61.48 -  -- \<open>The general elimination rule.\<close>
   61.49 +  \<comment> \<open>The general elimination rule.\<close>
   61.50    by (unfold Id_on_def) (iprover elim!: UN_E singletonE)
   61.51  
   61.52  lemma Id_on_iff: "((x, y) : Id_on A) = (x = y & x : A)"
   61.53 @@ -715,7 +715,7 @@
   61.54    by (fact converseD [to_pred])
   61.55  
   61.56  lemma converseE [elim!]:
   61.57 -  -- \<open>More general than @{text converseD}, as it ``splits'' the member of the relation.\<close>
   61.58 +  \<comment> \<open>More general than \<open>converseD\<close>, as it ``splits'' the member of the relation.\<close>
   61.59    "yx \<in> r\<inverse> \<Longrightarrow> (\<And>x y. yx = (y, x) \<Longrightarrow> (x, y) \<in> r \<Longrightarrow> P) \<Longrightarrow> P"
   61.60    by (cases yx) (simp, erule converse.cases, iprover)
   61.61  
   61.62 @@ -1008,7 +1008,7 @@
   61.63    by (unfold Image_def) (iprover elim!: CollectE bexE)
   61.64  
   61.65  lemma rev_ImageI: "a : A ==> (a, b) : r ==> b : r `` A"
   61.66 -  -- \<open>This version's more effective when we already have the required @{text a}\<close>
   61.67 +  \<comment> \<open>This version's more effective when we already have the required \<open>a\<close>\<close>
   61.68    by blast
   61.69  
   61.70  lemma Image_empty [simp]: "R``{} = {}"
   61.71 @@ -1037,7 +1037,7 @@
   61.72    by (iprover intro!: subsetI elim!: ImageE dest!: subsetD SigmaD2)
   61.73  
   61.74  lemma Image_eq_UN: "r``B = (\<Union>y\<in> B. r``{y})"
   61.75 -  -- \<open>NOT suitable for rewriting\<close>
   61.76 +  \<comment> \<open>NOT suitable for rewriting\<close>
   61.77    by blast
   61.78  
   61.79  lemma Image_mono: "r' \<subseteq> r ==> A' \<subseteq> A ==> (r' `` A') \<subseteq> (r `` A)"
    62.1 --- a/src/HOL/Rings.thy	Mon Dec 07 10:23:50 2015 +0100
    62.2 +++ b/src/HOL/Rings.thy	Mon Dec 07 10:38:04 2015 +0100
    62.3 @@ -18,7 +18,7 @@
    62.4    assumes distrib_left[algebra_simps]: "a * (b + c) = a * b + a * c"
    62.5  begin
    62.6  
    62.7 -text\<open>For the @{text combine_numerals} simproc\<close>
    62.8 +text\<open>For the \<open>combine_numerals\<close> simproc\<close>
    62.9  lemma combine_common_factor:
   62.10    "a * e + (b * e + c) = (a + b) * e + c"
   62.11  by (simp add: distrib_right ac_simps)
   62.12 @@ -890,7 +890,7 @@
   62.13    by (erule is_unitE [of _ c]) (simp add: dvd_mult_unit_iff)
   62.14  
   62.15  lemmas unit_dvd_iff = mult_unit_dvd_iff div_unit_dvd_iff
   62.16 -  dvd_mult_unit_iff dvd_div_unit_iff -- \<open>FIXME consider fact collection\<close>
   62.17 +  dvd_mult_unit_iff dvd_div_unit_iff \<comment> \<open>FIXME consider fact collection\<close>
   62.18  
   62.19  lemma unit_mult_div_div [simp]:
   62.20    "is_unit a \<Longrightarrow> b * (1 div a) = b div a"
   62.21 @@ -1298,7 +1298,7 @@
   62.22  lemma mult_nonpos_nonneg: "a \<le> 0 \<Longrightarrow> 0 \<le> b \<Longrightarrow> a * b \<le> 0"
   62.23  using mult_right_mono [of a 0 b] by simp
   62.24  
   62.25 -text \<open>Legacy - use @{text mult_nonpos_nonneg}\<close>
   62.26 +text \<open>Legacy - use \<open>mult_nonpos_nonneg\<close>\<close>
   62.27  lemma mult_nonneg_nonpos2: "0 \<le> a \<Longrightarrow> b \<le> 0 \<Longrightarrow> b * a \<le> 0"
   62.28  by (drule mult_right_mono [of b 0], auto)
   62.29  
   62.30 @@ -1374,7 +1374,7 @@
   62.31  lemma mult_neg_pos: "a < 0 \<Longrightarrow> 0 < b \<Longrightarrow> a * b < 0"
   62.32  using mult_strict_right_mono [of a 0 b] by simp
   62.33  
   62.34 -text \<open>Legacy - use @{text mult_neg_pos}\<close>
   62.35 +text \<open>Legacy - use \<open>mult_neg_pos\<close>\<close>
   62.36  lemma mult_pos_neg2: "0 < a \<Longrightarrow> b < 0 \<Longrightarrow> b * a < 0"
   62.37  by (drule mult_strict_right_mono [of b 0], auto)
   62.38  
   62.39 @@ -1627,7 +1627,7 @@
   62.40    done
   62.41  
   62.42  text\<open>Cancellation laws for @{term "c*a < c*b"} and @{term "a*c < b*c"},
   62.43 -   also with the relations @{text "\<le>"} and equality.\<close>
   62.44 +   also with the relations \<open>\<le>\<close> and equality.\<close>
   62.45  
   62.46  text\<open>These ``disjunction'' versions produce two cases when the comparison is
   62.47   an assumption, but effectively four when the comparison is a goal.\<close>
    63.1 --- a/src/HOL/SMT.thy	Mon Dec 07 10:23:50 2015 +0100
    63.2 +++ b/src/HOL/SMT.thy	Mon Dec 07 10:38:04 2015 +0100
    63.3 @@ -123,8 +123,8 @@
    63.4  subsection \<open>Integer division and modulo for Z3\<close>
    63.5  
    63.6  text \<open>
    63.7 -The following Z3-inspired definitions are overspecified for the case where @{text "l = 0"}. This
    63.8 -Schönheitsfehler is corrected in the @{text div_as_z3div} and @{text mod_as_z3mod} theorems.
    63.9 +The following Z3-inspired definitions are overspecified for the case where \<open>l = 0\<close>. This
   63.10 +Schönheitsfehler is corrected in the \<open>div_as_z3div\<close> and \<open>mod_as_z3mod\<close> theorems.
   63.11  \<close>
   63.12  
   63.13  definition z3div :: "int \<Rightarrow> int \<Rightarrow> int" where
   63.14 @@ -182,15 +182,15 @@
   63.15  
   63.16  text \<open>
   63.17  The current configuration can be printed by the command
   63.18 -@{text smt_status}, which shows the values of most options.
   63.19 +\<open>smt_status\<close>, which shows the values of most options.
   63.20  \<close>
   63.21  
   63.22  
   63.23  subsection \<open>General configuration options\<close>
   63.24  
   63.25  text \<open>
   63.26 -The option @{text smt_solver} can be used to change the target SMT
   63.27 -solver. The possible values can be obtained from the @{text smt_status}
   63.28 +The option \<open>smt_solver\<close> can be used to change the target SMT
   63.29 +solver. The possible values can be obtained from the \<open>smt_status\<close>
   63.30  command.
   63.31  \<close>
   63.32  
   63.33 @@ -258,7 +258,7 @@
   63.34  subsection \<open>Certificates\<close>
   63.35  
   63.36  text \<open>
   63.37 -By setting the option @{text smt_certificates} to the name of a file,
   63.38 +By setting the option \<open>smt_certificates\<close> to the name of a file,
   63.39  all following applications of an SMT solver a cached in that file.
   63.40  Any further application of the same SMT solver (using the very same
   63.41  configuration) re-uses the cached certificate instead of invoking the
   63.42 @@ -266,7 +266,7 @@
   63.43  
   63.44  The filename should be given as an explicit path. It is good
   63.45  practice to use the name of the current theory (with ending
   63.46 -@{text ".certs"} instead of @{text ".thy"}) as the certificates file.
   63.47 +\<open>.certs\<close> instead of \<open>.thy\<close>) as the certificates file.
   63.48  Certificate files should be used at most once in a certain theory context,
   63.49  to avoid race conditions with other concurrent accesses.
   63.50  \<close>
   63.51 @@ -274,11 +274,11 @@
   63.52  declare [[smt_certificates = ""]]
   63.53  
   63.54  text \<open>
   63.55 -The option @{text smt_read_only_certificates} controls whether only
   63.56 +The option \<open>smt_read_only_certificates\<close> controls whether only
   63.57  stored certificates are should be used or invocation of an SMT solver
   63.58 -is allowed. When set to @{text true}, no SMT solver will ever be
   63.59 +is allowed. When set to \<open>true\<close>, no SMT solver will ever be
   63.60  invoked and only the existing certificates found in the configured
   63.61 -cache are used;  when set to @{text false} and there is no cached
   63.62 +cache are used;  when set to \<open>false\<close> and there is no cached
   63.63  certificate for some proposition, then the configured SMT solver is
   63.64  invoked.
   63.65  \<close>
   63.66 @@ -290,7 +290,7 @@
   63.67  
   63.68  text \<open>
   63.69  The SMT method, when applied, traces important information. To
   63.70 -make it entirely silent, set the following option to @{text false}.
   63.71 +make it entirely silent, set the following option to \<open>false\<close>.
   63.72  \<close>
   63.73  
   63.74  declare [[smt_verbose = true]]
   63.75 @@ -298,7 +298,7 @@
   63.76  text \<open>
   63.77  For tracing the generated problem file given to the SMT solver as
   63.78  well as the returned result of the solver, the option
   63.79 -@{text smt_trace} should be set to @{text true}.
   63.80 +\<open>smt_trace\<close> should be set to \<open>true\<close>.
   63.81  \<close>
   63.82  
   63.83  declare [[smt_trace = false]]
   63.84 @@ -309,9 +309,9 @@
   63.85  text \<open>
   63.86  Several prof rules of Z3 are not very well documented. There are two
   63.87  lemma groups which can turn failing Z3 proof reconstruction attempts
   63.88 -into succeeding ones: the facts in @{text z3_rule} are tried prior to
   63.89 +into succeeding ones: the facts in \<open>z3_rule\<close> are tried prior to
   63.90  any implemented reconstruction procedure for all uncertain Z3 proof
   63.91 -rules;  the facts in @{text z3_simp} are only fed to invocations of
   63.92 +rules;  the facts in \<open>z3_simp\<close> are only fed to invocations of
   63.93  the simplifier when reconstructing theory-specific proof steps.
   63.94  \<close>
   63.95  
    64.1 --- a/src/HOL/Series.thy	Mon Dec 07 10:23:50 2015 +0100
    64.2 +++ b/src/HOL/Series.thy	Mon Dec 07 10:38:04 2015 +0100
    64.3 @@ -384,7 +384,7 @@
    64.4  lemma summable_minus_iff:
    64.5    fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
    64.6    shows "summable (\<lambda>n. - f n) \<longleftrightarrow> summable f"
    64.7 -  by (auto dest: summable_minus) --\<open>used two ways, hence must be outside the context above\<close>
    64.8 +  by (auto dest: summable_minus) \<comment>\<open>used two ways, hence must be outside the context above\<close>
    64.9  
   64.10  
   64.11  context
    65.1 --- a/src/HOL/Set.thy	Mon Dec 07 10:23:50 2015 +0100
    65.2 +++ b/src/HOL/Set.thy	Mon Dec 07 10:38:04 2015 +0100
    65.3 @@ -10,8 +10,8 @@
    65.4  
    65.5  typedecl 'a set
    65.6  
    65.7 -axiomatization Collect :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set" -- "comprehension"
    65.8 -  and member :: "'a \<Rightarrow> 'a set \<Rightarrow> bool" -- "membership"
    65.9 +axiomatization Collect :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set" \<comment> "comprehension"
   65.10 +  and member :: "'a \<Rightarrow> 'a set \<Rightarrow> bool" \<comment> "membership"
   65.11  where
   65.12    mem_Collect_eq [iff, code_unfold]: "member a (Collect P) = P a"
   65.13    and Collect_mem_eq [simp]: "Collect (\<lambda>x. member x A) = A"
   65.14 @@ -21,7 +21,7 @@
   65.15    member  ("(_/ : _)" [51, 51] 50)
   65.16  
   65.17  abbreviation not_member where
   65.18 -  "not_member x A \<equiv> ~ (x : A)" -- "non-membership"
   65.19 +  "not_member x A \<equiv> ~ (x : A)" \<comment> "non-membership"
   65.20  
   65.21  notation
   65.22    not_member  ("op ~:") and
   65.23 @@ -58,8 +58,8 @@
   65.24    by simp
   65.25  
   65.26  text \<open>
   65.27 -Simproc for pulling @{text "x=t"} in @{text "{x. \<dots> & x=t & \<dots>}"}
   65.28 -to the front (and similarly for @{text "t=x"}):
   65.29 +Simproc for pulling \<open>x=t\<close> in \<open>{x. \<dots> & x=t & \<dots>}\<close>
   65.30 +to the front (and similarly for \<open>t=x\<close>):
   65.31  \<close>
   65.32  
   65.33  simproc_setup defined_Collect ("{x. P x & Q x}") = \<open>
   65.34 @@ -176,10 +176,10 @@
   65.35    supset_eq  ("(_/ \<supseteq> _)" [51, 51] 50)
   65.36  
   65.37  definition Ball :: "'a set \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where
   65.38 -  "Ball A P \<longleftrightarrow> (\<forall>x. x \<in> A \<longrightarrow> P x)"   -- "bounded universal quantifiers"
   65.39 +  "Ball A P \<longleftrightarrow> (\<forall>x. x \<in> A \<longrightarrow> P x)"   \<comment> "bounded universal quantifiers"
   65.40  
   65.41  definition Bex :: "'a set \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where
   65.42 -  "Bex A P \<longleftrightarrow> (\<exists>x. x \<in> A \<and> P x)"   -- "bounded existential quantifiers"
   65.43 +  "Bex A P \<longleftrightarrow> (\<exists>x. x \<in> A \<and> P x)"   \<comment> "bounded existential quantifiers"
   65.44  
   65.45  syntax
   65.46    "_Ball"       :: "pttrn => 'a set => bool => bool"      ("(3ALL _:_./ _)" [0, 0, 10] 10)
   65.47 @@ -267,9 +267,8 @@
   65.48  
   65.49  
   65.50  text \<open>
   65.51 -  \medskip Translate between @{text "{e | x1...xn. P}"} and @{text
   65.52 -  "{u. EX x1..xn. u = e & P}"}; @{text "{y. EX x1..xn. y = e & P}"} is
   65.53 -  only translated if @{text "[0..n] subset bvs(e)"}.
   65.54 +  \medskip Translate between \<open>{e | x1...xn. P}\<close> and \<open>{u. EX x1..xn. u = e & P}\<close>; \<open>{y. EX x1..xn. y = e & P}\<close> is
   65.55 +  only translated if \<open>[0..n] subset bvs(e)\<close>.
   65.56  \<close>
   65.57  
   65.58  syntax
   65.59 @@ -295,7 +294,7 @@
   65.60  print_translation \<open>
   65.61   [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax Ball} @{syntax_const "_Ball"},
   65.62    Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax Bex} @{syntax_const "_Bex"}]
   65.63 -\<close> -- \<open>to avoid eta-contraction of body\<close>
   65.64 +\<close> \<comment> \<open>to avoid eta-contraction of body\<close>
   65.65  
   65.66  print_translation \<open>
   65.67  let
   65.68 @@ -383,12 +382,12 @@
   65.69    by (unfold Ball_def) blast
   65.70  
   65.71  lemma bexI [intro]: "P x ==> x:A ==> EX x:A. P x"
   65.72 -  -- \<open>Normally the best argument order: @{prop "P x"} constrains the
   65.73 +  \<comment> \<open>Normally the best argument order: @{prop "P x"} constrains the
   65.74      choice of @{prop "x:A"}.\<close>
   65.75    by (unfold Bex_def) blast
   65.76  
   65.77  lemma rev_bexI [intro?]: "x:A ==> P x ==> EX x:A. P x"
   65.78 -  -- \<open>The best argument order when there is only one @{prop "x:A"}.\<close>
   65.79 +  \<comment> \<open>The best argument order when there is only one @{prop "x:A"}.\<close>
   65.80    by (unfold Bex_def) blast
   65.81  
   65.82  lemma bexCI: "(ALL x:A. ~P x ==> P a) ==> a:A ==> EX x:A. P x"
   65.83 @@ -398,11 +397,11 @@
   65.84    by (unfold Bex_def) blast
   65.85  
   65.86  lemma ball_triv [simp]: "(ALL x:A. P) = ((EX x. x:A) --> P)"
   65.87 -  -- \<open>Trival rewrite rule.\<close>
   65.88 +  \<comment> \<open>Trival rewrite rule.\<close>
   65.89    by (simp add: Ball_def)
   65.90  
   65.91  lemma bex_triv [simp]: "(EX x:A. P) = ((EX x. x:A) & P)"
   65.92 -  -- \<open>Dual form for existentials.\<close>
   65.93 +  \<comment> \<open>Dual form for existentials.\<close>
   65.94    by (simp add: Bex_def)
   65.95  
   65.96  lemma bex_triv_one_point1 [simp]: "(EX x:A. x = a) = (a:A)"
   65.97 @@ -465,18 +464,18 @@
   65.98    by (simp add: less_eq_set_def le_fun_def)
   65.99  
  65.100  text \<open>
  65.101 -  \medskip Map the type @{text "'a set => anything"} to just @{typ
  65.102 +  \medskip Map the type \<open>'a set => anything\<close> to just @{typ
  65.103    'a}; for overloading constants whose first argument has type @{typ
  65.104    "'a set"}.
  65.105  \<close>
  65.106  
  65.107  lemma subsetD [elim, intro?]: "A \<subseteq> B ==> c \<in> A ==> c \<in> B"
  65.108    by (simp add: less_eq_set_def le_fun_def)
  65.109 -  -- \<open>Rule in Modus Ponens style.\<close>
  65.110 +  \<comment> \<open>Rule in Modus Ponens style.\<close>
  65.111  
  65.112  lemma rev_subsetD [intro?]: "c \<in> A ==> A \<subseteq> B ==> c \<in> B"
  65.113 -  -- \<open>The same, with reversed premises for use with @{text erule} --
  65.114 -      cf @{text rev_mp}.\<close>
  65.115 +  \<comment> \<open>The same, with reversed premises for use with \<open>erule\<close> --
  65.116 +      cf \<open>rev_mp\<close>.\<close>
  65.117    by (rule subsetD)
  65.118  
  65.119  text \<open>
  65.120 @@ -484,7 +483,7 @@
  65.121  \<close>
  65.122  
  65.123  lemma subsetCE [elim]: "A \<subseteq> B ==> (c \<notin> A ==> P) ==> (c \<in> B ==> P) ==> P"
  65.124 -  -- \<open>Classical elimination rule.\<close>
  65.125 +  \<comment> \<open>Classical elimination rule.\<close>
  65.126    by (auto simp add: less_eq_set_def le_fun_def)
  65.127  
  65.128  lemma subset_eq: "A \<le> B = (\<forall>x\<in>A. x \<in> B)" by blast
  65.129 @@ -518,7 +517,7 @@
  65.130  subsubsection \<open>Equality\<close>
  65.131  
  65.132  lemma subset_antisym [intro!]: "A \<subseteq> B ==> B \<subseteq> A ==> A = B"
  65.133 -  -- \<open>Anti-symmetry of the subset relation.\<close>
  65.134 +  \<comment> \<open>Anti-symmetry of the subset relation.\<close>
  65.135    by (iprover intro: set_eqI subsetD)
  65.136  
  65.137  text \<open>
  65.138 @@ -533,8 +532,7 @@
  65.139    by simp
  65.140  
  65.141  text \<open>
  65.142 -  \medskip Be careful when adding this to the claset as @{text
  65.143 -  subset_empty} is in the simpset: @{prop "A = {}"} goes to @{prop "{}
  65.144 +  \medskip Be careful when adding this to the claset as \<open>subset_empty\<close> is in the simpset: @{prop "A = {}"} goes to @{prop "{}
  65.145    \<subseteq> A"} and @{prop "A \<subseteq> {}"} and then back to @{prop "A = {}"}!
  65.146  \<close>
  65.147  
  65.148 @@ -565,14 +563,14 @@
  65.149    by simp
  65.150  
  65.151  lemma empty_subsetI [iff]: "{} \<subseteq> A"
  65.152 -    -- \<open>One effect is to delete the ASSUMPTION @{prop "{} <= A"}\<close>
  65.153 +    \<comment> \<open>One effect is to delete the ASSUMPTION @{prop "{} <= A"}\<close>
  65.154    by blast
  65.155  
  65.156  lemma equals0I: "(!!y. y \<in> A ==> False) ==> A = {}"
  65.157    by blast
  65.158  
  65.159  lemma equals0D: "A = {} ==> a \<notin> A"
  65.160 -    -- \<open>Use for reasoning about disjointness: @{text "A Int B = {}"}\<close>
  65.161 +    \<comment> \<open>Use for reasoning about disjointness: \<open>A Int B = {}\<close>\<close>
  65.162    by blast
  65.163  
  65.164  lemma ball_empty [simp]: "Ball {} P = True"
  65.165 @@ -594,7 +592,7 @@
  65.166  lemma UNIV_I [simp]: "x : UNIV"
  65.167    by (simp add: UNIV_def)
  65.168  
  65.169 -declare UNIV_I [intro]  -- \<open>unsafe makes it less likely to cause problems\<close>
  65.170 +declare UNIV_I [intro]  \<comment> \<open>unsafe makes it less likely to cause problems\<close>
  65.171  
  65.172  lemma UNIV_witness [intro?]: "EX x. x : UNIV"
  65.173    by simp
  65.174 @@ -603,7 +601,7 @@
  65.175    by (fact top_greatest) (* already simp *)
  65.176  
  65.177  text \<open>
  65.178 -  \medskip Eta-contracting these two rules (to remove @{text P})
  65.179 +  \medskip Eta-contracting these two rules (to remove \<open>P\<close>)
  65.180    causes them to be ignored because of their interaction with
  65.181    congruence rules.
  65.182  \<close>
  65.183 @@ -777,7 +775,7 @@
  65.184    by (unfold insert_def) blast
  65.185  
  65.186  lemma insertCI [intro!]: "(a~:B ==> a = b) ==> a: insert b B"
  65.187 -  -- \<open>Classical introduction rule.\<close>
  65.188 +  \<comment> \<open>Classical introduction rule.\<close>
  65.189    by auto
  65.190  
  65.191  lemma subset_insert_iff: "(A \<subseteq> insert x B) = (if x:A then A - {x} \<subseteq> B else A \<subseteq> B)"
  65.192 @@ -821,7 +819,7 @@
  65.193  subsubsection \<open>Singletons, using insert\<close>
  65.194  
  65.195  lemma singletonI [intro!]: "a : {a}"
  65.196 -    -- \<open>Redundant? But unlike @{text insertCI}, it proves the subgoal immediately!\<close>
  65.197 +    \<comment> \<open>Redundant? But unlike \<open>insertCI\<close>, it proves the subgoal immediately!\<close>
  65.198    by (rule insertI1)
  65.199  
  65.200  lemma singletonD [dest!]: "b : {a} ==> b = a"
  65.201 @@ -887,12 +885,12 @@
  65.202  
  65.203  lemma rev_image_eqI:
  65.204    "x \<in> A \<Longrightarrow> b = f x \<Longrightarrow> b \<in> f ` A"
  65.205 -  -- \<open>This version's more effective when we already have the
  65.206 +  \<comment> \<open>This version's more effective when we already have the
  65.207      required @{term x}.\<close>
  65.208    by (rule image_eqI)
  65.209  
  65.210  lemma imageE [elim!]:
  65.211 -  assumes "b \<in> (\<lambda>x. f x) ` A" -- \<open>The eta-expansion gives variable-name preservation.\<close>
  65.212 +  assumes "b \<in> (\<lambda>x. f x) ` A" \<comment> \<open>The eta-expansion gives variable-name preservation.\<close>
  65.213    obtains x where "b = f x" and "x \<in> A"
  65.214    using assms by (unfold image_def) blast
  65.215  
  65.216 @@ -910,13 +908,13 @@
  65.217  
  65.218  lemma image_subsetI:
  65.219    "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> B) \<Longrightarrow> f ` A \<subseteq> B"
  65.220 -  -- \<open>Replaces the three steps @{text subsetI}, @{text imageE},
  65.221 -    @{text hypsubst}, but breaks too many existing proofs.\<close>
  65.222 +  \<comment> \<open>Replaces the three steps \<open>subsetI\<close>, \<open>imageE\<close>,
  65.223 +    \<open>hypsubst\<close>, but breaks too many existing proofs.\<close>
  65.224    by blast
  65.225  
  65.226  lemma image_subset_iff:
  65.227    "f ` A \<subseteq> B \<longleftrightarrow> (\<forall>x\<in>A. f x \<in> B)"
  65.228 -  -- \<open>This rewrite rule would confuse users if made default.\<close>
  65.229 +  \<comment> \<open>This rewrite rule would confuse users if made default.\<close>
  65.230    by blast
  65.231  
  65.232  lemma subset_imageE:
  65.233 @@ -970,7 +968,7 @@
  65.234  
  65.235  lemma image_Collect:
  65.236    "f ` {x. P x} = {f x | x. P x}"
  65.237 -  -- \<open>NOT suitable as a default simprule: the RHS isn't simpler than the LHS,
  65.238 +  \<comment> \<open>NOT suitable as a default simprule: the RHS isn't simpler than the LHS,
  65.239        with its implicit quantifier and conjunction.  Also image enjoys better
  65.240        equational properties than does the RHS.\<close>
  65.241    by blast
  65.242 @@ -1011,7 +1009,7 @@
  65.243  \<close>
  65.244  
  65.245  abbreviation range :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b set"
  65.246 -where -- "of function"
  65.247 +where \<comment> "of function"
  65.248    "range f \<equiv> f ` UNIV"
  65.249  
  65.250  lemma range_eqI:
  65.251 @@ -1035,9 +1033,9 @@
  65.252    by auto
  65.253  
  65.254  
  65.255 -subsubsection \<open>Some rules with @{text "if"}\<close>
  65.256 -
  65.257 -text\<open>Elimination of @{text"{x. \<dots> & x=t & \<dots>}"}.\<close>
  65.258 +subsubsection \<open>Some rules with \<open>if\<close>\<close>
  65.259 +
  65.260 +text\<open>Elimination of \<open>{x. \<dots> & x=t & \<dots>}\<close>.\<close>
  65.261  
  65.262  lemma Collect_conv_if: "{x. x=a & P x} = (if P a then {a} else {})"
  65.263    by auto
  65.264 @@ -1046,8 +1044,7 @@
  65.265    by auto
  65.266  
  65.267  text \<open>
  65.268 -  Rewrite rules for boolean case-splitting: faster than @{text
  65.269 -  "split_if [split]"}.
  65.270 +  Rewrite rules for boolean case-splitting: faster than \<open>split_if [split]\<close>.
  65.271  \<close>
  65.272  
  65.273  lemma split_if_eq1: "((if Q then x else y) = b) = ((Q --> x = b) & (~ Q --> y = b))"
  65.274 @@ -1057,8 +1054,7 @@
  65.275    by (rule split_if)
  65.276  
  65.277  text \<open>
  65.278 -  Split ifs on either side of the membership relation.  Not for @{text
  65.279 -  "[simp]"} -- can cause goals to blow up!
  65.280 +  Split ifs on either side of the membership relation.  Not for \<open>[simp]\<close> -- can cause goals to blow up!
  65.281  \<close>
  65.282  
  65.283  lemma split_if_mem1: "((if Q then x else y) : b) = ((Q --> x : b) & (~ Q --> y : b))"
  65.284 @@ -1139,7 +1135,7 @@
  65.285  
  65.286  subsubsection \<open>Derived rules involving subsets.\<close>
  65.287  
  65.288 -text \<open>@{text insert}.\<close>
  65.289 +text \<open>\<open>insert\<close>.\<close>
  65.290  
  65.291  lemma subset_insertI: "B \<subseteq> insert a B"
  65.292    by (rule subsetI) (erule insertI2)
  65.293 @@ -1186,10 +1182,10 @@
  65.294  
  65.295  subsubsection \<open>Equalities involving union, intersection, inclusion, etc.\<close>
  65.296  
  65.297 -text \<open>@{text "{}"}.\<close>
  65.298 +text \<open>\<open>{}\<close>.\<close>
  65.299  
  65.300  lemma Collect_const [simp]: "{s. P} = (if P then UNIV else {})"
  65.301 -  -- \<open>supersedes @{text "Collect_False_empty"}\<close>
  65.302 +  \<comment> \<open>supersedes \<open>Collect_False_empty\<close>\<close>
  65.303    by auto
  65.304  
  65.305  lemma subset_empty [simp]: "(A \<subseteq> {}) = (A = {})"
  65.306 @@ -1220,10 +1216,10 @@
  65.307    by blast
  65.308  
  65.309  
  65.310 -text \<open>\medskip @{text insert}.\<close>
  65.311 +text \<open>\medskip \<open>insert\<close>.\<close>
  65.312  
  65.313  lemma insert_is_Un: "insert a A = {a} Un A"
  65.314 -  -- \<open>NOT SUITABLE FOR REWRITING since @{text "{a} == insert a {}"}\<close>
  65.315 +  \<comment> \<open>NOT SUITABLE FOR REWRITING since \<open>{a} == insert a {}\<close>\<close>
  65.316    by blast
  65.317  
  65.318  lemma insert_not_empty [simp]: "insert a A \<noteq> {}"
  65.319 @@ -1233,8 +1229,8 @@
  65.320  declare empty_not_insert [simp]
  65.321  
  65.322  lemma insert_absorb: "a \<in> A ==> insert a A = A"
  65.323 -  -- \<open>@{text "[simp]"} causes recursive calls when there are nested inserts\<close>
  65.324 -  -- \<open>with \emph{quadratic} running time\<close>
  65.325 +  \<comment> \<open>\<open>[simp]\<close> causes recursive calls when there are nested inserts\<close>
  65.326 +  \<comment> \<open>with \emph{quadratic} running time\<close>
  65.327    by blast
  65.328  
  65.329  lemma insert_absorb2 [simp]: "insert x (insert x A) = insert x A"
  65.330 @@ -1247,7 +1243,7 @@
  65.331    by blast
  65.332  
  65.333  lemma mk_disjoint_insert: "a \<in> A ==> \<exists>B. A = insert a B & a \<notin> B"
  65.334 -  -- \<open>use new @{text B} rather than @{text "A - {a}"} to avoid infinite unfolding\<close>
  65.335 +  \<comment> \<open>use new \<open>B\<close> rather than \<open>A - {a}\<close> to avoid infinite unfolding\<close>
  65.336    apply (rule_tac x = "A - {a}" in exI, blast)
  65.337    done
  65.338  
  65.339 @@ -1268,7 +1264,7 @@
  65.340    by auto
  65.341  
  65.342  
  65.343 -text \<open>\medskip @{text Int}\<close>
  65.344 +text \<open>\medskip \<open>Int\<close>\<close>
  65.345  
  65.346  lemma Int_absorb: "A \<inter> A = A"
  65.347    by (fact inf_idem) (* already simp *)
  65.348 @@ -1286,7 +1282,7 @@
  65.349    by (fact inf_assoc)
  65.350  
  65.351  lemmas Int_ac = Int_assoc Int_left_absorb Int_commute Int_left_commute
  65.352 -  -- \<open>Intersection is an AC-operator\<close>
  65.353 +  \<comment> \<open>Intersection is an AC-operator\<close>
  65.354  
  65.355  lemma Int_absorb1: "B \<subseteq> A ==> A \<inter> B = B"
  65.356    by (fact inf_absorb2)
  65.357 @@ -1328,7 +1324,7 @@
  65.358    by blast
  65.359  
  65.360  
  65.361 -text \<open>\medskip @{text Un}.\<close>
  65.362 +text \<open>\medskip \<open>Un\<close>.\<close>
  65.363  
  65.364  lemma Un_absorb: "A \<union> A = A"
  65.365    by (fact sup_idem) (* already simp *)
  65.366 @@ -1346,7 +1342,7 @@
  65.367    by (fact sup_assoc)
  65.368  
  65.369  lemmas Un_ac = Un_assoc Un_left_absorb Un_commute Un_left_commute
  65.370 -  -- \<open>Union is an AC-operator\<close>
  65.371 +  \<comment> \<open>Union is an AC-operator\<close>
  65.372  
  65.373  lemma Un_absorb1: "A \<subseteq> B ==> A \<union> B = B"
  65.374    by (fact sup_absorb2)
  65.375 @@ -1449,7 +1445,7 @@
  65.376    by blast
  65.377  
  65.378  lemma Un_Int_assoc_eq: "((A \<inter> B) \<union> C = A \<inter> (B \<union> C)) = (C \<subseteq> A)"
  65.379 -  -- \<open>Halmos, Naive Set Theory, page 16.\<close>
  65.380 +  \<comment> \<open>Halmos, Naive Set Theory, page 16.\<close>
  65.381    by blast
  65.382  
  65.383  lemma Compl_UNIV_eq: "-UNIV = {}"
  65.384 @@ -1470,7 +1466,7 @@
  65.385  text \<open>\medskip Bounded quantifiers.
  65.386  
  65.387    The following are not added to the default simpset because
  65.388 -  (a) they duplicate the body and (b) there are no similar rules for @{text Int}.\<close>
  65.389 +  (a) they duplicate the body and (b) there are no similar rules for \<open>Int\<close>.\<close>
  65.390  
  65.391  lemma ball_Un: "(\<forall>x \<in> A \<union> B. P x) = ((\<forall>x\<in>A. P x) & (\<forall>x\<in>B. P x))"
  65.392    by blast
  65.393 @@ -1509,11 +1505,11 @@
  65.394    by blast
  65.395  
  65.396  lemma Diff_insert: "A - insert a B = A - B - {a}"
  65.397 -  -- \<open>NOT SUITABLE FOR REWRITING since @{text "{a} == insert a 0"}\<close>
  65.398 +  \<comment> \<open>NOT SUITABLE FOR REWRITING since \<open>{a} == insert a 0\<close>\<close>
  65.399    by blast
  65.400  
  65.401  lemma Diff_insert2: "A - insert a B = A - {a} - B"
  65.402 -  -- \<open>NOT SUITABLE FOR REWRITING since @{text "{a} == insert a 0"}\<close>
  65.403 +  \<comment> \<open>NOT SUITABLE FOR REWRITING since \<open>{a} == insert a 0\<close>\<close>
  65.404    by blast
  65.405  
  65.406  lemma insert_Diff_if: "insert x A - B = (if x \<in> B then A - B else insert x (A - B))"
  65.407 @@ -1591,7 +1587,7 @@
  65.408  lemma UNIV_bool: "UNIV = {False, True}"
  65.409    by (auto intro: bool_induct)
  65.410  
  65.411 -text \<open>\medskip @{text Pow}\<close>
  65.412 +text \<open>\medskip \<open>Pow\<close>\<close>
  65.413  
  65.414  lemma Pow_empty [simp]: "Pow {} = {{}}"
  65.415    by (auto simp add: Pow_def)
  65.416 @@ -1764,7 +1760,7 @@
  65.417    by blast
  65.418  
  65.419  lemma vimage_insert: "f-`(insert a B) = (f-`{a}) Un (f-`B)"
  65.420 -  -- \<open>NOT suitable for rewriting because of the recurrence of @{term "{a}"}.\<close>
  65.421 +  \<comment> \<open>NOT suitable for rewriting because of the recurrence of @{term "{a}"}.\<close>
  65.422    by blast
  65.423  
  65.424  lemma vimage_Diff: "f -` (A - B) = (f -` A) - (f -` B)"
  65.425 @@ -1774,7 +1770,7 @@
  65.426    by blast
  65.427  
  65.428  lemma vimage_mono: "A \<subseteq> B ==> f -` A \<subseteq> f -` B"
  65.429 -  -- \<open>monotonicity\<close>
  65.430 +  \<comment> \<open>monotonicity\<close>
  65.431    by blast
  65.432  
  65.433  lemma vimage_image_eq: "f -` (f ` A) = {y. EX x:A. f x = f y}"
  65.434 @@ -1831,7 +1827,7 @@
  65.435  lemma Least_mono:
  65.436    "mono (f::'a::order => 'b::order) ==> EX x:S. ALL y:S. x <= y
  65.437      ==> (LEAST y. y : f ` S) = f (LEAST x. x : S)"
  65.438 -    -- \<open>Courtesy of Stephan Merz\<close>
  65.439 +    \<comment> \<open>Courtesy of Stephan Merz\<close>
  65.440    apply clarify
  65.441    apply (erule_tac P = "%x. x : S" in LeastI2_order, fast)
  65.442    apply (rule LeastI2_order)
    66.1 --- a/src/HOL/Set_Interval.thy	Mon Dec 07 10:23:50 2015 +0100
    66.2 +++ b/src/HOL/Set_Interval.thy	Mon Dec 07 10:38:04 2015 +0100
    66.3 @@ -798,15 +798,15 @@
    66.4  
    66.5  subsubsection \<open>Intervals and numerals\<close>
    66.6  
    66.7 -lemma lessThan_nat_numeral:  --\<open>Evaluation for specific numerals\<close>
    66.8 +lemma lessThan_nat_numeral:  \<comment>\<open>Evaluation for specific numerals\<close>
    66.9    "lessThan (numeral k :: nat) = insert (pred_numeral k) (lessThan (pred_numeral k))"
   66.10    by (simp add: numeral_eq_Suc lessThan_Suc)
   66.11  
   66.12 -lemma atMost_nat_numeral:  --\<open>Evaluation for specific numerals\<close>
   66.13 +lemma atMost_nat_numeral:  \<comment>\<open>Evaluation for specific numerals\<close>
   66.14    "atMost (numeral k :: nat) = insert (numeral k) (atMost (pred_numeral k))"
   66.15    by (simp add: numeral_eq_Suc atMost_Suc)
   66.16  
   66.17 -lemma atLeastLessThan_nat_numeral:  --\<open>Evaluation for specific numerals\<close>
   66.18 +lemma atLeastLessThan_nat_numeral:  \<comment>\<open>Evaluation for specific numerals\<close>
   66.19    "atLeastLessThan m (numeral k :: nat) = 
   66.20       (if m \<le> (pred_numeral k) then insert (pred_numeral k) (atLeastLessThan m (pred_numeral k))
   66.21                   else {})"
   66.22 @@ -1468,12 +1468,12 @@
   66.23  the middle column shows the new (default) syntax, and the right column
   66.24  shows a special syntax. The latter is only meaningful for latex output
   66.25  and has to be activated explicitly by setting the print mode to
   66.26 -@{text latex_sum} (e.g.\ via @{text "mode = latex_sum"} in
   66.27 +\<open>latex_sum\<close> (e.g.\ via \<open>mode = latex_sum\<close> in
   66.28  antiquotations). It is not the default \LaTeX\ output because it only
   66.29  works well with italic-style formulae, not tt-style.
   66.30  
   66.31  Note that for uniformity on @{typ nat} it is better to use
   66.32 -@{term"\<Sum>x::nat=0..<n. e"} rather than @{text"\<Sum>x<n. e"}: @{text setsum} may
   66.33 +@{term"\<Sum>x::nat=0..<n. e"} rather than \<open>\<Sum>x<n. e\<close>: \<open>setsum\<close> may
   66.34  not provide all lemmas available for @{term"{m..<n}"} also in the
   66.35  special form for @{term"{..<n}"}.\<close>
   66.36  
   66.37 @@ -1697,7 +1697,7 @@
   66.38    finally show ?case .
   66.39  qed simp
   66.40  
   66.41 -corollary power_diff_sumr2: --\<open>@{text COMPLEX_POLYFUN} in HOL Light\<close>
   66.42 +corollary power_diff_sumr2: \<comment>\<open>\<open>COMPLEX_POLYFUN\<close> in HOL Light\<close>
   66.43    fixes x :: "'a::{comm_ring,monoid_mult}"
   66.44    shows   "x^n - y^n = (x - y) * (\<Sum>i<n. y^(n - Suc i) * x^i)"
   66.45  using diff_power_eq_setsum[of x "n - 1" y]
    67.1 --- a/src/HOL/String.thy	Mon Dec 07 10:23:50 2015 +0100
    67.2 +++ b/src/HOL/String.thy	Mon Dec 07 10:38:04 2015 +0100
    67.3 @@ -115,7 +115,7 @@
    67.4    by (simp add: nibble_of_nat_def)
    67.5  
    67.6  datatype char = Char nibble nibble
    67.7 -  -- "Note: canonical order of character encoding coincides with standard term ordering"
    67.8 +  \<comment> "Note: canonical order of character encoding coincides with standard term ordering"
    67.9  
   67.10  syntax
   67.11    "_Char" :: "str_position => char"    ("CHR _")
   67.12 @@ -281,7 +281,7 @@
   67.13    with Char show ?thesis by (simp add: nat_of_char_def add.commute)
   67.14  qed
   67.15  
   67.16 -code_datatype Char -- \<open>drop case certificate for char\<close>
   67.17 +code_datatype Char \<comment> \<open>drop case certificate for char\<close>
   67.18  
   67.19  lemma case_char_code [code]:
   67.20    "case_char f c = (let n = nat_of_char c in f (nibble_of_nat (n div 16)) (nibble_of_nat n))"
    68.1 --- a/src/HOL/Sum_Type.thy	Mon Dec 07 10:23:50 2015 +0100
    68.2 +++ b/src/HOL/Sum_Type.thy	Mon Dec 07 10:38:04 2015 +0100
    68.3 @@ -90,7 +90,7 @@
    68.4    | Inr projr
    68.5    by (erule sumE, assumption) (auto dest: Inl_inject Inr_inject simp add: Inl_not_Inr)
    68.6  
    68.7 -text \<open>Avoid name clashes by prefixing the output of @{text old_rep_datatype} with @{text old}.\<close>
    68.8 +text \<open>Avoid name clashes by prefixing the output of \<open>old_rep_datatype\<close> with \<open>old\<close>.\<close>
    68.9  
   68.10  setup \<open>Sign.mandatory_path "old"\<close>
   68.11  
   68.12 @@ -104,7 +104,7 @@
   68.13  
   68.14  setup \<open>Sign.parent_path\<close>
   68.15  
   68.16 -text \<open>But erase the prefix for properties that are not generated by @{text free_constructors}.\<close>
   68.17 +text \<open>But erase the prefix for properties that are not generated by \<open>free_constructors\<close>.\<close>
   68.18  
   68.19  setup \<open>Sign.mandatory_path "sum"\<close>
   68.20  
   68.21 @@ -206,7 +206,7 @@
   68.22  definition Plus :: "'a set \<Rightarrow> 'b set \<Rightarrow> ('a + 'b) set" (infixr "<+>" 65) where
   68.23    "A <+> B = Inl ` A \<union> Inr ` B"
   68.24  
   68.25 -hide_const (open) Plus --"Valuable identifier"
   68.26 +hide_const (open) Plus \<comment>"Valuable identifier"
   68.27  
   68.28  lemma InlI [intro!]: "a \<in> A \<Longrightarrow> Inl a \<in> A <+> B"
   68.29  by (simp add: Plus_def)
    69.1 --- a/src/HOL/Taylor.thy	Mon Dec 07 10:23:50 2015 +0100
    69.2 +++ b/src/HOL/Taylor.thy	Mon Dec 07 10:38:04 2015 +0100
    69.3 @@ -9,7 +9,7 @@
    69.4  begin
    69.5  
    69.6  text \<open>
    69.7 -We use MacLaurin and the translation of the expansion point @{text c} to @{text 0}
    69.8 +We use MacLaurin and the translation of the expansion point \<open>c\<close> to \<open>0\<close>
    69.9  to prove Taylor's theorem.
   69.10  \<close>
   69.11  
    70.1 --- a/src/HOL/Topological_Spaces.thy	Mon Dec 07 10:23:50 2015 +0100
    70.2 +++ b/src/HOL/Topological_Spaces.thy	Mon Dec 07 10:38:04 2015 +0100
    70.3 @@ -644,7 +644,7 @@
    70.4    assume "d \<noteq> c"
    70.5    from t1_space[OF this] obtain U where "open U" "d \<in> U" "c \<notin> U" by blast
    70.6    from this assms have "eventually (\<lambda>x. f x \<in> U) F" unfolding tendsto_def by blast
    70.7 -  hence "eventually (\<lambda>x. f x \<noteq> c) F" by eventually_elim (insert `c \<notin> U`, blast)
    70.8 +  hence "eventually (\<lambda>x. f x \<noteq> c) F" by eventually_elim (insert \<open>c \<notin> U\<close>, blast)
    70.9    with assms(2) show False unfolding frequently_def by contradiction
   70.10  qed
   70.11  
   70.12 @@ -795,7 +795,7 @@
   70.13  
   70.14  definition
   70.15    monoseq :: "(nat \<Rightarrow> 'a::order) \<Rightarrow> bool" where
   70.16 -    --\<open>Definition of monotonicity.
   70.17 +    \<comment>\<open>Definition of monotonicity.
   70.18          The use of disjunction here complicates proofs considerably.
   70.19          One alternative is to add a Boolean argument to indicate the direction.
   70.20          Another is to develop the notions of increasing and decreasing first.\<close>
   70.21 @@ -815,7 +815,7 @@
   70.22  
   70.23  definition
   70.24    subseq :: "(nat \<Rightarrow> nat) \<Rightarrow> bool" where
   70.25 -    --\<open>Definition of subsequence\<close>
   70.26 +    \<comment>\<open>Definition of subsequence\<close>
   70.27    "subseq f \<longleftrightarrow> (\<forall>m. \<forall>n>m. f m < f n)"
   70.28  
   70.29  lemma incseq_SucI:
   70.30 @@ -1641,7 +1641,7 @@
   70.31  begin
   70.32  
   70.33  definition compact :: "'a set \<Rightarrow> bool" where
   70.34 -  compact_eq_heine_borel: -- "This name is used for backwards compatibility"
   70.35 +  compact_eq_heine_borel: \<comment> "This name is used for backwards compatibility"
   70.36      "compact S \<longleftrightarrow> (\<forall>C. (\<forall>c\<in>C. open c) \<and> S \<subseteq> \<Union>C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union>D))"
   70.37  
   70.38  lemma compactI:
    71.1 --- a/src/HOL/Transcendental.thy	Mon Dec 07 10:23:50 2015 +0100
    71.2 +++ b/src/HOL/Transcendental.thy	Mon Dec 07 10:38:04 2015 +0100
    71.3 @@ -41,7 +41,7 @@
    71.4  
    71.5  lemma root_test_convergence:
    71.6    fixes f :: "nat \<Rightarrow> 'a::banach"
    71.7 -  assumes f: "(\<lambda>n. root n (norm (f n))) ----> x" -- "could be weakened to lim sup"
    71.8 +  assumes f: "(\<lambda>n. root n (norm (f n))) ----> x" \<comment> "could be weakened to lim sup"
    71.9    assumes "x < 1"
   71.10    shows "summable f"
   71.11  proof -
   71.12 @@ -1459,7 +1459,7 @@
   71.13    assumes ln_one [simp]: "ln 1 = 0"
   71.14  
   71.15  definition powr :: "['a,'a] => 'a::ln"     (infixr "powr" 80)
   71.16 -  -- \<open>exponentation via ln and exp\<close>
   71.17 +  \<comment> \<open>exponentation via ln and exp\<close>
   71.18    where  [code del]: "x powr a \<equiv> if x = 0 then 0 else exp(a * ln x)"
   71.19  
   71.20  lemma powr_0 [simp]: "0 powr z = 0"
   71.21 @@ -2084,7 +2084,7 @@
   71.22  
   71.23  
   71.24  definition log :: "[real,real] => real"
   71.25 -  -- \<open>logarithm of @{term x} to base @{term a}\<close>
   71.26 +  \<comment> \<open>logarithm of @{term x} to base @{term a}\<close>
   71.27    where "log a x = ln x / ln a"
   71.28  
   71.29  
   71.30 @@ -3519,7 +3519,7 @@
   71.31    using sin_ge_zero [of "x-pi"]
   71.32    by (simp add: sin_diff)
   71.33  
   71.34 -text \<open>FIXME: This proof is almost identical to lemma @{text cos_is_zero}.
   71.35 +text \<open>FIXME: This proof is almost identical to lemma \<open>cos_is_zero\<close>.
   71.36    It should be possible to factor out some of the common parts.\<close>
   71.37  
   71.38  lemma cos_total: "\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> EX! x. 0 \<le> x & x \<le> pi & (cos x = y)"
   71.39 @@ -3855,7 +3855,7 @@
   71.40  qed
   71.41  
   71.42  lemma cos_one_2pi_int: "cos(x) = 1 \<longleftrightarrow> (\<exists>n::int. x = n * 2*pi)"
   71.43 -  apply auto  --\<open>FIXME simproc bug\<close>
   71.44 +  apply auto  \<comment>\<open>FIXME simproc bug\<close>
   71.45    apply (auto simp: cos_one_2pi)
   71.46    apply (metis of_int_of_nat_eq)
   71.47    apply (metis mult_minus_right of_int_minus of_int_of_nat_eq)
   71.48 @@ -5573,7 +5573,7 @@
   71.49    then have wnz: "\<And>w. w \<noteq> 0 \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * w^i) = 0"
   71.50      using Suc  by auto
   71.51    then have "(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h^i) -- 0 --> 0"
   71.52 -    by (simp cong: LIM_cong)                   --\<open>the case @{term"w=0"} by continuity\<close>
   71.53 +    by (simp cong: LIM_cong)                   \<comment>\<open>the case @{term"w=0"} by continuity\<close>
   71.54    then have "(\<Sum>i\<le>n. c (Suc i) * 0^i) = 0"
   71.55      using isCont_polynom [of 0 "\<lambda>i. c (Suc i)" n] LIM_unique
   71.56      by (force simp add: Limits.isCont_iff)
    72.1 --- a/src/HOL/Transitive_Closure.thy	Mon Dec 07 10:23:50 2015 +0100
    72.2 +++ b/src/HOL/Transitive_Closure.thy	Mon Dec 07 10:38:04 2015 +0100
    72.3 @@ -12,9 +12,9 @@
    72.4  ML_file "~~/src/Provers/trancl.ML"
    72.5  
    72.6  text \<open>
    72.7 -  @{text rtrancl} is reflexive/transitive closure,
    72.8 -  @{text trancl} is transitive closure,
    72.9 -  @{text reflcl} is reflexive closure.
   72.10 +  \<open>rtrancl\<close> is reflexive/transitive closure,
   72.11 +  \<open>trancl\<close> is transitive closure,
   72.12 +  \<open>reflcl\<close> is reflexive closure.
   72.13  
   72.14    These postfix operators have \emph{maximum priority}, forcing their
   72.15    operands to be atomic.
   72.16 @@ -86,17 +86,17 @@
   72.17    by (auto simp add: fun_eq_iff)
   72.18  
   72.19  lemma r_into_rtrancl [intro]: "!!p. p \<in> r ==> p \<in> r^*"
   72.20 -  -- \<open>@{text rtrancl} of @{text r} contains @{text r}\<close>
   72.21 +  \<comment> \<open>\<open>rtrancl\<close> of \<open>r\<close> contains \<open>r\<close>\<close>
   72.22    apply (simp only: split_tupled_all)
   72.23    apply (erule rtrancl_refl [THEN rtrancl_into_rtrancl])
   72.24    done
   72.25  
   72.26  lemma r_into_rtranclp [intro]: "r x y ==> r^** x y"
   72.27 -  -- \<open>@{text rtrancl} of @{text r} contains @{text r}\<close>
   72.28 +  \<comment> \<open>\<open>rtrancl\<close> of \<open>r\<close> contains \<open>r\<close>\<close>
   72.29    by (erule rtranclp.rtrancl_refl [THEN rtranclp.rtrancl_into_rtrancl])
   72.30  
   72.31  lemma rtranclp_mono: "r \<le> s ==> r^** \<le> s^**"
   72.32 -  -- \<open>monotonicity of @{text rtrancl}\<close>
   72.33 +  \<comment> \<open>monotonicity of \<open>rtrancl\<close>\<close>
   72.34    apply (rule predicate2I)
   72.35    apply (erule rtranclp.induct)
   72.36     apply (rule_tac [2] rtranclp.rtrancl_into_rtrancl, blast+)
   72.37 @@ -157,7 +157,7 @@
   72.38    obtains
   72.39      (base) "a = b"
   72.40    | (step) y where "(a, y) : r^*" and "(y, b) : r"
   72.41 -  -- \<open>elimination of @{text rtrancl} -- by induction on a special formula\<close>
   72.42 +  \<comment> \<open>elimination of \<open>rtrancl\<close> -- by induction on a special formula\<close>
   72.43    apply (subgoal_tac "(a::'a) = b | (EX y. (a,y) : r^* & (y,b) : r)")
   72.44     apply (rule_tac [2] major [THEN rtrancl_induct])
   72.45      prefer 2 apply blast
   72.46 @@ -347,7 +347,7 @@
   72.47    by (simp only: split_tupled_all) (erule r_into_trancl)
   72.48  
   72.49  text \<open>
   72.50 -  \medskip Conversions between @{text trancl} and @{text rtrancl}.
   72.51 +  \medskip Conversions between \<open>trancl\<close> and \<open>rtrancl\<close>.
   72.52  \<close>
   72.53  
   72.54  lemma tranclp_into_rtranclp: "r^++ a b ==> r^** a b"
   72.55 @@ -362,7 +362,7 @@
   72.56  lemmas rtrancl_into_trancl1 = rtranclp_into_tranclp1 [to_set]
   72.57  
   72.58  lemma rtranclp_into_tranclp2: "[| r a b; r^** b c |] ==> r^++ a c"
   72.59 -  -- \<open>intro rule from @{text r} and @{text rtrancl}\<close>
   72.60 +  \<comment> \<open>intro rule from \<open>r\<close> and \<open>rtrancl\<close>\<close>
   72.61    apply (erule rtranclp.cases)
   72.62     apply iprover
   72.63    apply (rule rtranclp_trans [THEN rtranclp_into_tranclp1])
   72.64 @@ -371,7 +371,7 @@
   72.65  
   72.66  lemmas rtrancl_into_trancl2 = rtranclp_into_tranclp2 [to_set]
   72.67  
   72.68 -text \<open>Nice induction rule for @{text trancl}\<close>
   72.69 +text \<open>Nice induction rule for \<open>trancl\<close>\<close>
   72.70  lemma tranclp_induct [consumes 1, case_names base step, induct pred: tranclp]:
   72.71    assumes a: "r^++ a b"
   72.72    and cases: "!!y. r a y ==> P y"
   72.73 @@ -394,7 +394,7 @@
   72.74      and cases: "!!x y. r x y ==> P x y"
   72.75        "!!x y z. [| r^++ x y; P x y; r^++ y z; P y z |] ==> P x z"
   72.76    shows "P x y"
   72.77 -  -- \<open>Another induction rule for trancl, incorporating transitivity\<close>
   72.78 +  \<comment> \<open>Another induction rule for trancl, incorporating transitivity\<close>
   72.79    by (iprover intro: major [THEN tranclp_induct] cases)
   72.80  
   72.81  lemmas trancl_trans_induct = tranclp_trans_induct [to_set]
   72.82 @@ -594,7 +594,7 @@
   72.83  
   72.84  lemma trancl_insert:
   72.85    "(insert (y, x) r)^+ = r^+ \<union> {(a, b). (a, y) \<in> r^* \<and> (x, b) \<in> r^*}"
   72.86 -  -- \<open>primitive recursion for @{text trancl} over finite relations\<close>
   72.87 +  \<comment> \<open>primitive recursion for \<open>trancl\<close> over finite relations\<close>
   72.88    apply (rule equalityI)
   72.89     apply (rule subsetI)
   72.90     apply (simp only: split_tupled_all)
   72.91 @@ -627,7 +627,7 @@
   72.92  by auto
   72.93  
   72.94  
   72.95 -text \<open>@{text Domain} and @{text Range}\<close>
   72.96 +text \<open>\<open>Domain\<close> and \<open>Range\<close>\<close>
   72.97  
   72.98  lemma Domain_rtrancl [simp]: "Domain (R^*) = UNIV"
   72.99    by blast
  72.100 @@ -671,7 +671,7 @@
  72.101     apply (auto simp add: finite_Field)
  72.102    done
  72.103  
  72.104 -text \<open>More about converse @{text rtrancl} and @{text trancl}, should
  72.105 +text \<open>More about converse \<open>rtrancl\<close> and \<open>trancl\<close>, should
  72.106    be merged with main body.\<close>
  72.107  
  72.108  lemma single_valued_confluent:
  72.109 @@ -720,7 +720,7 @@
  72.110  
  72.111  subsection \<open>The power operation on relations\<close>
  72.112  
  72.113 -text \<open>@{text "R ^^ n = R O ... O R"}, the n-fold composition of @{text R}\<close>
  72.114 +text \<open>\<open>R ^^ n = R O ... O R\<close>, the n-fold composition of \<open>R\<close>\<close>
  72.115  
  72.116  overloading
  72.117    relpow == "compow :: nat \<Rightarrow> ('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set"
    73.1 --- a/src/HOL/Typedef.thy	Mon Dec 07 10:23:50 2015 +0100
    73.2 +++ b/src/HOL/Typedef.thy	Mon Dec 07 10:38:04 2015 +0100
    73.3 @@ -14,7 +14,7 @@
    73.4    assumes Rep: "Rep x \<in> A"
    73.5      and Rep_inverse: "Abs (Rep x) = x"
    73.6      and Abs_inverse: "y \<in> A \<Longrightarrow> Rep (Abs y) = y"
    73.7 -  -- \<open>This will be axiomatized for each typedef!\<close>
    73.8 +  \<comment> \<open>This will be axiomatized for each typedef!\<close>
    73.9  begin
   73.10  
   73.11  lemma Rep_inject: "Rep x = Rep y \<longleftrightarrow> x = y"
    74.1 --- a/src/HOL/Wellfounded.thy	Mon Dec 07 10:23:50 2015 +0100
    74.2 +++ b/src/HOL/Wellfounded.thy	Mon Dec 07 10:38:04 2015 +0100
    74.3 @@ -233,7 +233,7 @@
    74.4  apply (rule_tac x = "{z. z:Q & (z,y) : r^*}" in allE)
    74.5   apply assumption
    74.6  apply (erule_tac V = "ALL Q. (EX x. x : Q) --> P Q" for P in thin_rl) 
    74.7 -  --\<open>essential for speed\<close>
    74.8 +  \<comment>\<open>essential for speed\<close>
    74.9  txt\<open>Blast with new substOccur fails\<close>
   74.10  apply (fast intro: converse_rtrancl_into_rtrancl)
   74.11  done
   74.12 @@ -375,7 +375,7 @@
   74.13    qed
   74.14  qed
   74.15  
   74.16 -lemma wf_comp_self: "wf R = wf (R O R)"  -- \<open>special case\<close>
   74.17 +lemma wf_comp_self: "wf R = wf (R O R)"  \<comment> \<open>special case\<close>
   74.18    by (rule wf_union_merge [where S = "{}", simplified])
   74.19  
   74.20  
   74.21 @@ -384,7 +384,7 @@
   74.22  text \<open>Bachmair and Dershowitz 1986, Lemma 2. [Provided by Tjark Weber]\<close>
   74.23  
   74.24  lemma qc_wf_relto_iff:
   74.25 -  assumes "R O S \<subseteq> (R \<union> S)\<^sup>* O R" -- \<open>R quasi-commutes over S\<close>
   74.26 +  assumes "R O S \<subseteq> (R \<union> S)\<^sup>* O R" \<comment> \<open>R quasi-commutes over S\<close>
   74.27    shows "wf (S\<^sup>* O R O S\<^sup>*) \<longleftrightarrow> wf R" (is "wf ?S \<longleftrightarrow> _")
   74.28  proof
   74.29    assume "wf ?S"
    75.1 --- a/src/HOL/Wfrec.thy	Mon Dec 07 10:23:50 2015 +0100
    75.2 +++ b/src/HOL/Wfrec.thy	Mon Dec 07 10:38:04 2015 +0100
    75.3 @@ -79,11 +79,11 @@
    75.4    finally show "wfrec R F x = F (wfrec R F) x" .
    75.5  qed
    75.6  
    75.7 -subsection \<open>Wellfoundedness of @{text same_fst}\<close>
    75.8 +subsection \<open>Wellfoundedness of \<open>same_fst\<close>\<close>
    75.9  
   75.10  definition same_fst :: "('a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> ('b \<times> 'b) set) \<Rightarrow> (('a \<times> 'b) \<times> ('a \<times> 'b)) set" where
   75.11    "same_fst P R = {((x', y'), (x, y)) . x' = x \<and> P x \<and> (y',y) \<in> R x}"
   75.12 -   --\<open>For @{const wfrec} declarations where the first n parameters
   75.13 +   \<comment>\<open>For @{const wfrec} declarations where the first n parameters
   75.14         stay unchanged in the recursive call.\<close>
   75.15  
   75.16  lemma same_fstI [intro!]: "P x \<Longrightarrow> (y', y) \<in> R x \<Longrightarrow> ((x, y'), (x, y)) \<in> same_fst P R"
    76.1 --- a/src/HOL/Word/Bit_Comparison.thy	Mon Dec 07 10:23:50 2015 +0100
    76.2 +++ b/src/HOL/Word/Bit_Comparison.thy	Mon Dec 07 10:38:04 2015 +0100
    76.3 @@ -137,7 +137,7 @@
    76.4        with 3 have "bin BIT bit = 0" by simp
    76.5        then have "bin = 0" and "\<not> bit"
    76.6          by (auto simp add: Bit_def split: if_splits) arith
    76.7 -      then show ?thesis using 0 1 `y < 2 ^ n`
    76.8 +      then show ?thesis using 0 1 \<open>y < 2 ^ n\<close>
    76.9          by simp
   76.10      next
   76.11        case (Suc m)
   76.12 @@ -170,7 +170,7 @@
   76.13        with 3 have "bin BIT bit = 0" by simp
   76.14        then have "bin = 0" and "\<not> bit"
   76.15          by (auto simp add: Bit_def split: if_splits) arith
   76.16 -      then show ?thesis using 0 1 `y < 2 ^ n`
   76.17 +      then show ?thesis using 0 1 \<open>y < 2 ^ n\<close>
   76.18          by simp
   76.19      next
   76.20        case (Suc m)
    77.1 --- a/src/HOL/Word/Bit_Representation.thy	Mon Dec 07 10:23:50 2015 +0100
    77.2 +++ b/src/HOL/Word/Bit_Representation.thy	Mon Dec 07 10:38:04 2015 +0100
    77.3 @@ -2,13 +2,13 @@
    77.4    Author: Jeremy Dawson, NICTA
    77.5  *) 
    77.6  
    77.7 -section {* Integers as implict bit strings *}
    77.8 +section \<open>Integers as implict bit strings\<close>
    77.9  
   77.10  theory Bit_Representation
   77.11  imports Misc_Numeric
   77.12  begin
   77.13  
   77.14 -subsection {* Constructors and destructors for binary integers *}
   77.15 +subsection \<open>Constructors and destructors for binary integers\<close>
   77.16  
   77.17  definition Bit :: "int \<Rightarrow> bool \<Rightarrow> int" (infixl "BIT" 90)
   77.18  where
   77.19 @@ -270,7 +270,7 @@
   77.20    bin_nth_numeral_simps
   77.21  
   77.22  
   77.23 -subsection {* Truncating binary integers *}
   77.24 +subsection \<open>Truncating binary integers\<close>
   77.25  
   77.26  definition bin_sign :: "int \<Rightarrow> int"
   77.27  where
   77.28 @@ -750,7 +750,7 @@
   77.29    [THEN rco_lem [THEN fun_cong], unfolded o_def]
   77.30  
   77.31    
   77.32 -subsection {* Splitting and concatenation *}
   77.33 +subsection \<open>Splitting and concatenation\<close>
   77.34  
   77.35  primrec bin_split :: "nat \<Rightarrow> int \<Rightarrow> int \<times> int" where
   77.36    Z: "bin_split 0 w = (w, 0)"
    78.1 --- a/src/HOL/Word/Bits.thy	Mon Dec 07 10:23:50 2015 +0100
    78.2 +++ b/src/HOL/Word/Bits.thy	Mon Dec 07 10:38:04 2015 +0100
    78.3 @@ -2,7 +2,7 @@
    78.4      Author:     Author: Brian Huffman, PSU and Gerwin Klein, NICTA
    78.5  *)
    78.6  
    78.7 -section {* Syntactic classes for bitwise operations *}
    78.8 +section \<open>Syntactic classes for bitwise operations\<close>
    78.9  
   78.10  theory Bits
   78.11  imports Main
   78.12 @@ -14,15 +14,15 @@
   78.13      and bitOR  :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixr "OR"  59)
   78.14      and bitXOR :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixr "XOR" 59)
   78.15  
   78.16 -text {*
   78.17 +text \<open>
   78.18    We want the bitwise operations to bind slightly weaker
   78.19 -  than @{text "+"} and @{text "-"}, but @{text "~~"} to 
   78.20 -  bind slightly stronger than @{text "*"}.
   78.21 -*}
   78.22 +  than \<open>+\<close> and \<open>-\<close>, but \<open>~~\<close> to 
   78.23 +  bind slightly stronger than \<open>*\<close>.
   78.24 +\<close>
   78.25  
   78.26 -text {*
   78.27 +text \<open>
   78.28    Testing and shifting operations.
   78.29 -*}
   78.30 +\<close>
   78.31  
   78.32  class bits = bit +
   78.33    fixes test_bit :: "'a \<Rightarrow> nat \<Rightarrow> bool" (infixl "!!" 100)
    79.1 --- a/src/HOL/Word/Bits_Bit.thy	Mon Dec 07 10:23:50 2015 +0100
    79.2 +++ b/src/HOL/Word/Bits_Bit.thy	Mon Dec 07 10:38:04 2015 +0100
    79.3 @@ -2,7 +2,7 @@
    79.4      Author:     Author: Brian Huffman, PSU and Gerwin Klein, NICTA
    79.5  *)
    79.6  
    79.7 -section {* Bit operations in $\cal Z_2$ *}
    79.8 +section \<open>Bit operations in $\cal Z_2$\<close>
    79.9  
   79.10  theory Bits_Bit
   79.11  imports Bits "~~/src/HOL/Library/Bit"
    80.1 --- a/src/HOL/Word/Bits_Int.thy	Mon Dec 07 10:23:50 2015 +0100
    80.2 +++ b/src/HOL/Word/Bits_Int.thy	Mon Dec 07 10:38:04 2015 +0100
    80.3 @@ -6,13 +6,13 @@
    80.4    and converting them to and from lists of bools.
    80.5  *) 
    80.6  
    80.7 -section {* Bitwise Operations on Binary Integers *}
    80.8 +section \<open>Bitwise Operations on Binary Integers\<close>
    80.9  
   80.10  theory Bits_Int
   80.11  imports Bits Bit_Representation
   80.12  begin
   80.13  
   80.14 -subsection {* Logical operations *}
   80.15 +subsection \<open>Logical operations\<close>
   80.16  
   80.17  text "bit-wise logical operations on the int type"
   80.18  
   80.19 @@ -43,7 +43,7 @@
   80.20  
   80.21  end
   80.22  
   80.23 -subsubsection {* Basic simplification rules *}
   80.24 +subsubsection \<open>Basic simplification rules\<close>
   80.25  
   80.26  lemma int_not_BIT [simp]:
   80.27    "NOT (w BIT b) = (NOT w) BIT (\<not> b)"
   80.28 @@ -88,7 +88,7 @@
   80.29    "(x BIT b) XOR (y BIT c) = (x XOR y) BIT ((b \<or> c) \<and> \<not> (b \<and> c))"
   80.30    unfolding int_xor_def by auto
   80.31  
   80.32 -subsubsection {* Binary destructors *}
   80.33 +subsubsection \<open>Binary destructors\<close>
   80.34  
   80.35  lemma bin_rest_NOT [simp]: "bin_rest (NOT x) = NOT (bin_rest x)"
   80.36    by (cases x rule: bin_exhaust, simp)
   80.37 @@ -121,7 +121,7 @@
   80.38    "!!x. bin_nth (NOT x) n = (~ bin_nth x n)"
   80.39    by (induct n) auto
   80.40  
   80.41 -subsubsection {* Derived properties *}
   80.42 +subsubsection \<open>Derived properties\<close>
   80.43  
   80.44  lemma int_xor_minus1 [simp]: "(-1::int) XOR x = NOT x"
   80.45    by (auto simp add: bin_eq_iff bin_nth_ops)
   80.46 @@ -219,10 +219,10 @@
   80.47  declare bin_ops_comm [simp] bbw_assocs [simp] 
   80.48  *)
   80.49  
   80.50 -subsubsection {* Simplification with numerals *}
   80.51 +subsubsection \<open>Simplification with numerals\<close>
   80.52  
   80.53 -text {* Cases for @{text "0"} and @{text "-1"} are already covered by
   80.54 -  other simp rules. *}
   80.55 +text \<open>Cases for \<open>0\<close> and \<open>-1\<close> are already covered by
   80.56 +  other simp rules.\<close>
   80.57  
   80.58  lemma bin_rl_eqI: "\<lbrakk>bin_rest x = bin_rest y; bin_last x = bin_last y\<rbrakk> \<Longrightarrow> x = y"
   80.59    by (metis (mono_tags) BIT_eq_iff bin_ex_rl bin_last_BIT bin_rest_BIT)
   80.60 @@ -235,8 +235,8 @@
   80.61    "bin_last (- numeral (Num.BitM w))"
   80.62    by (simp only: BIT_bin_simps [symmetric] bin_last_BIT)
   80.63  
   80.64 -text {* FIXME: The rule sets below are very large (24 rules for each
   80.65 -  operator). Is there a simpler way to do this? *}
   80.66 +text \<open>FIXME: The rule sets below are very large (24 rules for each
   80.67 +  operator). Is there a simpler way to do this?\<close>
   80.68  
   80.69  lemma int_and_numerals [simp]:
   80.70    "numeral (Num.Bit0 x) AND numeral (Num.Bit0 y) = (numeral x AND numeral y) BIT False"
   80.71 @@ -319,7 +319,7 @@
   80.72    "- numeral (Num.Bit1 x) XOR (1::int) = - numeral (Num.Bit0 (x + Num.One))"
   80.73    by (rule bin_rl_eqI, simp, simp)+
   80.74  
   80.75 -subsubsection {* Interactions with arithmetic *}
   80.76 +subsubsection \<open>Interactions with arithmetic\<close>
   80.77  
   80.78  lemma plus_and_or [rule_format]:
   80.79    "ALL y::int. (x AND y) + (x OR y) = x + y"
   80.80 @@ -358,7 +358,7 @@
   80.81    apply (case_tac bit, auto)
   80.82    done
   80.83  
   80.84 -subsubsection {* Truncating results of bit-wise operations *}
   80.85 +subsubsection \<open>Truncating results of bit-wise operations\<close>
   80.86  
   80.87  lemma bin_trunc_ao: 
   80.88    "!!x y. (bintrunc n x) AND (bintrunc n y) = bintrunc n (x AND y)" 
   80.89 @@ -382,7 +382,7 @@
   80.90  lemmas bin_trunc_and = bin_trunc_ao(1) [THEN bintr_bintr_i]
   80.91  lemmas bin_trunc_or = bin_trunc_ao(2) [THEN bintr_bintr_i]
   80.92  
   80.93 -subsection {* Setting and clearing bits *}
   80.94 +subsection \<open>Setting and clearing bits\<close>
   80.95  
   80.96  (** nth bit, set/clear **)
   80.97  
   80.98 @@ -480,7 +480,7 @@
   80.99    by (simp add: numeral_eq_Suc)
  80.100  
  80.101  
  80.102 -subsection {* Splitting and concatenation *}
  80.103 +subsection \<open>Splitting and concatenation\<close>
  80.104  
  80.105  definition bin_rcat :: "nat \<Rightarrow> int list \<Rightarrow> int"
  80.106  where
  80.107 @@ -619,7 +619,7 @@
  80.108    apply (simp add: Bit_def mod_mult_mult1 p1mod22k)
  80.109    done
  80.110  
  80.111 -subsection {* Miscellaneous lemmas *}
  80.112 +subsection \<open>Miscellaneous lemmas\<close>
  80.113  
  80.114  lemma nth_2p_bin: 
  80.115    "bin_nth (2 ^ n) m = (m = n)"
    81.1 --- a/src/HOL/Word/Bool_List_Representation.thy	Mon Dec 07 10:23:50 2015 +0100
    81.2 +++ b/src/HOL/Word/Bool_List_Representation.thy	Mon Dec 07 10:38:04 2015 +0100
    81.3 @@ -29,7 +29,7 @@
    81.4    unfolding map2_def by auto
    81.5  
    81.6  
    81.7 -subsection {* Operations on lists of booleans *}
    81.8 +subsection \<open>Operations on lists of booleans\<close>
    81.9  
   81.10  primrec bl_to_bin_aux :: "bool list \<Rightarrow> int \<Rightarrow> int"
   81.11  where
   81.12 @@ -66,10 +66,10 @@
   81.13  
   81.14  subsection "Arithmetic in terms of bool lists"
   81.15  
   81.16 -text {* 
   81.17 +text \<open>
   81.18    Arithmetic operations in terms of the reversed bool list,
   81.19    assuming input list(s) the same length, and don't extend them. 
   81.20 -*}
   81.21 +\<close>
   81.22  
   81.23  primrec rbl_succ :: "bool list => bool list"
   81.24  where
   81.25 @@ -83,14 +83,14 @@
   81.26  
   81.27  primrec rbl_add :: "bool list => bool list => bool list"
   81.28  where
   81.29 -  -- "result is length of first arg, second arg may be longer"
   81.30 +  \<comment> "result is length of first arg, second arg may be longer"
   81.31    Nil: "rbl_add Nil x = Nil"
   81.32    | Cons: "rbl_add (y # ys) x = (let ws = rbl_add ys (tl x) in 
   81.33      (y ~= hd x) # (if hd x & y then rbl_succ ws else ws))"
   81.34  
   81.35  primrec rbl_mult :: "bool list => bool list => bool list"
   81.36  where
   81.37 -  -- "result is length of first arg, second arg may be longer"
   81.38 +  \<comment> "result is length of first arg, second arg may be longer"
   81.39    Nil: "rbl_mult Nil x = Nil"
   81.40    | Cons: "rbl_mult (y # ys) x = (let ws = False # rbl_mult ys x in 
   81.41      if y then rbl_add ws x else ws)"
   81.42 @@ -129,7 +129,7 @@
   81.43      bin_to_bl_aux (n - 1) (numeral w) (True # bl)"
   81.44    by (cases n) auto
   81.45  
   81.46 -text {* Link between bin and bool list. *}
   81.47 +text \<open>Link between bin and bool list.\<close>
   81.48  
   81.49  lemma bl_to_bin_aux_append: 
   81.50    "bl_to_bin_aux (bs @ cs) w = bl_to_bin_aux cs (bl_to_bin_aux bs w)"
   81.51 @@ -1118,14 +1118,14 @@
   81.52  proof (induct n nw w cs arbitrary: v bs rule: bin_rsplit_aux.induct)
   81.53    case (1 n m w cs v bs) show ?case
   81.54    proof (cases "m = 0")
   81.55 -    case True then show ?thesis using `length bs = length cs` by simp
   81.56 +    case True then show ?thesis using \<open>length bs = length cs\<close> by simp
   81.57    next
   81.58      case False
   81.59 -    from "1.hyps" `m \<noteq> 0` `n \<noteq> 0` have hyp: "\<And>v bs. length bs = Suc (length cs) \<Longrightarrow>
   81.60 +    from "1.hyps" \<open>m \<noteq> 0\<close> \<open>n \<noteq> 0\<close> have hyp: "\<And>v bs. length bs = Suc (length cs) \<Longrightarrow>
   81.61        length (bin_rsplit_aux n (m - n) v bs) =
   81.62        length (bin_rsplit_aux n (m - n) (fst (bin_split n w)) (snd (bin_split n w) # cs))"
   81.63      by auto
   81.64 -    show ?thesis using `length bs = length cs` `n \<noteq> 0`
   81.65 +    show ?thesis using \<open>length bs = length cs\<close> \<open>n \<noteq> 0\<close>
   81.66        by (auto simp add: bin_rsplit_aux_simp_alt Let_def bin_rsplit_len
   81.67          split: prod.split)
   81.68    qed
   81.69 @@ -1140,7 +1140,7 @@
   81.70    done
   81.71  
   81.72  
   81.73 -text {* Even more bit operations *}
   81.74 +text \<open>Even more bit operations\<close>
   81.75  
   81.76  instantiation int :: bitss
   81.77  begin
    82.1 --- a/src/HOL/Word/Misc_Numeric.thy	Mon Dec 07 10:23:50 2015 +0100
    82.2 +++ b/src/HOL/Word/Misc_Numeric.thy	Mon Dec 07 10:38:04 2015 +0100
    82.3 @@ -2,7 +2,7 @@
    82.4    Author:  Jeremy Dawson, NICTA
    82.5  *) 
    82.6  
    82.7 -section {* Useful Numerical Lemmas *}
    82.8 +section \<open>Useful Numerical Lemmas\<close>
    82.9  
   82.10  theory Misc_Numeric
   82.11  imports Main
    83.1 --- a/src/HOL/Word/Misc_Typedef.thy	Mon Dec 07 10:23:50 2015 +0100
    83.2 +++ b/src/HOL/Word/Misc_Typedef.thy	Mon Dec 07 10:38:04 2015 +0100
    83.3 @@ -4,7 +4,7 @@
    83.4    Consequences of type definition theorems, and of extended type definition.
    83.5  *)
    83.6  
    83.7 -section {* Type Definition Theorems *}
    83.8 +section \<open>Type Definition Theorems\<close>
    83.9  
   83.10  theory Misc_Typedef
   83.11  imports Main
    84.1 --- a/src/HOL/Word/Type_Length.thy	Mon Dec 07 10:23:50 2015 +0100
    84.2 +++ b/src/HOL/Word/Type_Length.thy	Mon Dec 07 10:38:04 2015 +0100
    84.3 @@ -2,24 +2,24 @@
    84.4      Author:     John Matthews, Galois Connections, Inc., copyright 2006
    84.5  *)
    84.6  
    84.7 -section {* Assigning lengths to types by typeclasses *}
    84.8 +section \<open>Assigning lengths to types by typeclasses\<close>
    84.9  
   84.10  theory Type_Length
   84.11  imports "~~/src/HOL/Library/Numeral_Type"
   84.12  begin
   84.13  
   84.14 -text {*
   84.15 +text \<open>
   84.16    The aim of this is to allow any type as index type, but to provide a
   84.17    default instantiation for numeral types. This independence requires
   84.18 -  some duplication with the definitions in @{text "Numeral_Type"}.
   84.19 -*}
   84.20 +  some duplication with the definitions in \<open>Numeral_Type\<close>.
   84.21 +\<close>
   84.22  
   84.23  class len0 =
   84.24    fixes len_of :: "'a itself \<Rightarrow> nat"
   84.25  
   84.26 -text {* 
   84.27 +text \<open>
   84.28    Some theorems are only true on words with length greater 0.
   84.29 -*}
   84.30 +\<close>
   84.31  
   84.32  class len = len0 +
   84.33    assumes len_gt_0 [iff]: "0 < len_of TYPE ('a)"
    85.1 --- a/src/HOL/Word/Word.thy	Mon Dec 07 10:23:50 2015 +0100
    85.2 +++ b/src/HOL/Word/Word.thy	Mon Dec 07 10:38:04 2015 +0100
    85.3 @@ -2,7 +2,7 @@
    85.4      Author:     Jeremy Dawson and Gerwin Klein, NICTA
    85.5  *)
    85.6  
    85.7 -section {* A type of finite bit strings *}
    85.8 +section \<open>A type of finite bit strings\<close>
    85.9  
   85.10  theory Word
   85.11  imports
   85.12 @@ -14,9 +14,9 @@
   85.13    Word_Miscellaneous
   85.14  begin
   85.15  
   85.16 -text {* See @{file "Examples/WordExamples.thy"} for examples. *}
   85.17 -
   85.18 -subsection {* Type definition *}
   85.19 +text \<open>See @{file "Examples/WordExamples.thy"} for examples.\<close>
   85.20 +
   85.21 +subsection \<open>Type definition\<close>
   85.22  
   85.23  typedef (overloaded) 'a word = "{(0::int) ..< 2 ^ len_of TYPE('a::len0)}"
   85.24    morphisms uint Abs_word by auto
   85.25 @@ -45,8 +45,8 @@
   85.26  
   85.27  definition word_of_int :: "int \<Rightarrow> 'a::len0 word"
   85.28  where
   85.29 -  -- {* representation of words using unsigned or signed bins,
   85.30 -    only difference in these is the type class *}
   85.31 +  \<comment> \<open>representation of words using unsigned or signed bins,
   85.32 +    only difference in these is the type class\<close>
   85.33    "word_of_int k = Abs_word (k mod 2 ^ len_of TYPE('a))"
   85.34  
   85.35  lemma uint_word_of_int:
   85.36 @@ -67,11 +67,11 @@
   85.37  qed
   85.38  
   85.39  
   85.40 -subsection {* Type conversions and casting *}
   85.41 +subsection \<open>Type conversions and casting\<close>
   85.42  
   85.43  definition sint :: "'a::len word \<Rightarrow> int"
   85.44  where
   85.45 -  -- {* treats the most-significant-bit as a sign bit *}
   85.46 +  \<comment> \<open>treats the most-significant-bit as a sign bit\<close>
   85.47    sint_uint: "sint w = sbintrunc (len_of TYPE ('a) - 1) (uint w)"
   85.48  
   85.49  definition unat :: "'a::len0 word \<Rightarrow> nat"
   85.50 @@ -80,7 +80,7 @@
   85.51  
   85.52  definition uints :: "nat \<Rightarrow> int set"
   85.53  where
   85.54 -  -- "the sets of integers representing the words"
   85.55 +  \<comment> "the sets of integers representing the words"
   85.56    "uints n = range (bintrunc n)"
   85.57  
   85.58  definition sints :: "nat \<Rightarrow> int set"
   85.59 @@ -105,7 +105,7 @@
   85.60  
   85.61  definition scast :: "'a::len word \<Rightarrow> 'b::len word"
   85.62  where
   85.63 -  -- "cast a word to a different length"
   85.64 +  \<comment> "cast a word to a different length"
   85.65    "scast w = word_of_int (sint w)"
   85.66  
   85.67  definition ucast :: "'a::len0 word \<Rightarrow> 'b::len0 word"
   85.68 @@ -135,7 +135,7 @@
   85.69  
   85.70  definition source_size :: "('a::len0 word \<Rightarrow> 'b) \<Rightarrow> nat"
   85.71  where
   85.72 -  -- "whether a cast (or other) function is to a longer or shorter length"
   85.73 +  \<comment> "whether a cast (or other) function is to a longer or shorter length"
   85.74    [code del]: "source_size c = (let arb = undefined; x = c arb in size arb)"
   85.75  
   85.76  definition target_size :: "('a \<Rightarrow> 'b::len0 word) \<Rightarrow> nat"
   85.77 @@ -171,7 +171,7 @@
   85.78    "case x of (XCONST of_int :: 'a) y => b" => "CONST word_int_case (%y. b) x"
   85.79  
   85.80  
   85.81 -subsection {* Correspondence relation for theorem transfer *}
   85.82 +subsection \<open>Correspondence relation for theorem transfer\<close>
   85.83  
   85.84  definition cr_word :: "int \<Rightarrow> 'a::len0 word \<Rightarrow> bool"
   85.85  where
   85.86 @@ -189,7 +189,7 @@
   85.87  
   85.88  setup_lifting Quotient_word reflp_word
   85.89  
   85.90 -text {* TODO: The next lemma could be generated automatically. *}
   85.91 +text \<open>TODO: The next lemma could be generated automatically.\<close>
   85.92  
   85.93  lemma uint_transfer [transfer_rule]:
   85.94    "(rel_fun pcr_word op =) (bintrunc (len_of TYPE('a)))
   85.95 @@ -198,7 +198,7 @@
   85.96    by (simp add: no_bintr_alt1 uint_word_of_int)
   85.97  
   85.98  
   85.99 -subsection {* Basic code generation setup *}
  85.100 +subsection \<open>Basic code generation setup\<close>
  85.101  
  85.102  definition Word :: "int \<Rightarrow> 'a::len0 word"
  85.103  where
  85.104 @@ -241,7 +241,7 @@
  85.105  no_notation scomp (infixl "\<circ>\<rightarrow>" 60)
  85.106  
  85.107  
  85.108 -subsection {* Type-definition locale instantiations *}
  85.109 +subsection \<open>Type-definition locale instantiations\<close>
  85.110  
  85.111  lemmas uint_0 = uint_nonnegative (* FIXME duplicate *)
  85.112  lemmas uint_lt = uint_bounded (* FIXME duplicate *)
  85.113 @@ -279,7 +279,7 @@
  85.114    by (fact td_ext_ubin)
  85.115  
  85.116  
  85.117 -subsection {* Arithmetic operations *}
  85.118 +subsection \<open>Arithmetic operations\<close>
  85.119  
  85.120  lift_definition word_succ :: "'a::len0 word \<Rightarrow> 'a word" is "\<lambda>x. x + 1"
  85.121    by (metis bintr_ariths(6))
  85.122 @@ -317,7 +317,7 @@
  85.123  
  85.124  end
  85.125  
  85.126 -text {* Legacy theorems: *}
  85.127 +text \<open>Legacy theorems:\<close>
  85.128  
  85.129  lemma word_arith_wis [code]: shows
  85.130    word_add_def: "a + b = word_of_int (uint a + uint b)" and
  85.131 @@ -372,7 +372,7 @@
  85.132    "a udvd b = (EX n>=0. uint b = n * uint a)"
  85.133  
  85.134  
  85.135 -subsection {* Ordering *}
  85.136 +subsection \<open>Ordering\<close>
  85.137  
  85.138  instantiation word :: (len0) linorder
  85.139  begin
  85.140 @@ -397,7 +397,7 @@
  85.141    "(x <s y) = (x <=s y & x ~= y)"
  85.142  
  85.143  
  85.144 -subsection {* Bit-wise operations *}
  85.145 +subsection \<open>Bit-wise operations\<close>
  85.146  
  85.147  instantiation word :: (len0) bits
  85.148  begin
  85.149 @@ -433,7 +433,7 @@
  85.150  
  85.151  definition shiftr1 :: "'a word \<Rightarrow> 'a word"
  85.152  where
  85.153 -  -- "shift right as unsigned or as signed, ie logical or arithmetic"
  85.154 +  \<comment> "shift right as unsigned or as signed, ie logical or arithmetic"
  85.155    "shiftr1 w = word_of_int (bin_rest (uint w))"
  85.156  
  85.157  definition
  85.158 @@ -474,7 +474,7 @@
  85.159    "clearBit w n = set_bit w n False"
  85.160  
  85.161  
  85.162 -subsection {* Shift operations *}
  85.163 +subsection \<open>Shift operations\<close>
  85.164  
  85.165  definition sshiftr1 :: "'a :: len word => 'a word"
  85.166  where 
  85.167 @@ -505,7 +505,7 @@
  85.168    "slice n w = slice1 (size w - n) w"
  85.169  
  85.170  
  85.171 -subsection {* Rotation *}
  85.172 +subsection \<open>Rotation\<close>
  85.173  
  85.174  definition rotater1 :: "'a list => 'a list"
  85.175  where
  85.176 @@ -530,7 +530,7 @@
  85.177                      else word_rotl (nat (- i)) w)"
  85.178  
  85.179  
  85.180 -subsection {* Split and cat operations *}
  85.181 +subsection \<open>Split and cat operations\<close>
  85.182  
  85.183  definition word_cat :: "'a :: len0 word => 'b :: len0 word => 'c :: len0 word"
  85.184  where
  85.185 @@ -552,14 +552,14 @@
  85.186    "word_rsplit w = 
  85.187    map word_of_int (bin_rsplit (len_of TYPE ('b)) (len_of TYPE ('a), uint w))"
  85.188  
  85.189 -definition max_word :: "'a::len word" -- "Largest representable machine integer."
  85.190 +definition max_word :: "'a::len word" \<comment> "Largest representable machine integer."
  85.191  where
  85.192    "max_word = word_of_int (2 ^ len_of TYPE('a) - 1)"
  85.193  
  85.194  lemmas of_nth_def = word_set_bits_def (* FIXME duplicate *)
  85.195  
  85.196  
  85.197 -subsection {* Theorems about typedefs *}
  85.198 +subsection \<open>Theorems about typedefs\<close>
  85.199  
  85.200  lemma sint_sbintrunc': 
  85.201    "sint (word_of_int bin :: 'a word) = 
  85.202 @@ -805,7 +805,7 @@
  85.203    unfolding word_size by (rule order_trans [OF _ sint_ge])
  85.204  
  85.205  
  85.206 -subsection {* Testing bits *}
  85.207 +subsection \<open>Testing bits\<close>
  85.208  
  85.209  lemma test_bit_eq_iff: "(test_bit (u::'a::len0 word) = test_bit v) = (u = v)"
  85.210    unfolding word_test_bit_def by (simp add: bin_nth_eq_iff)
  85.211 @@ -1188,7 +1188,7 @@
  85.212  lemmas word_log_defs = word_and_def word_or_def word_xor_def word_not_def
  85.213  
  85.214  
  85.215 -subsection {* Word Arithmetic *}
  85.216 +subsection \<open>Word Arithmetic\<close>
  85.217  
  85.218  lemma word_less_alt: "(a < b) = (uint a < uint b)"
  85.219    by (fact word_less_def)
  85.220 @@ -1292,7 +1292,7 @@
  85.221  (* now, to get the weaker results analogous to word_div/mod_def *)
  85.222  
  85.223  
  85.224 -subsection {* Transferring goals from words to ints *}
  85.225 +subsection \<open>Transferring goals from words to ints\<close>
  85.226  
  85.227  lemma word_ths:  
  85.228    shows
  85.229 @@ -1368,7 +1368,7 @@
  85.230    by (rule_tac x="uint x" in exI) simp
  85.231  
  85.232  
  85.233 -subsection {* Order on fixed-length words *}
  85.234 +subsection \<open>Order on fixed-length words\<close>
  85.235  
  85.236  lemma word_zero_le [simp] :
  85.237    "0 <= (y :: 'a :: len0 word)"
  85.238 @@ -1438,9 +1438,9 @@
  85.239    moreover from assms have "0 \<noteq> uint w" by (simp add: uint_0_iff)
  85.240    ultimately have "1 \<le> uint w" by arith
  85.241    from uint_lt2p [of w] have "uint w - 1 < 2 ^ len_of TYPE('a)" by arith
  85.242 -  with `1 \<le> uint w` have "(uint w - 1) mod 2 ^ len_of TYPE('a) = uint w - 1"
  85.243 +  with \<open>1 \<le> uint w\<close> have "(uint w - 1) mod 2 ^ len_of TYPE('a) = uint w - 1"
  85.244      by (auto intro: mod_pos_pos_trivial)
  85.245 -  with `1 \<le> uint w` have "nat ((uint w - 1) mod 2 ^ len_of TYPE('a)) = nat (uint w) - 1"
  85.246 +  with \<open>1 \<le> uint w\<close> have "nat ((uint w - 1) mod 2 ^ len_of TYPE('a)) = nat (uint w) - 1"
  85.247      by auto
  85.248    then show ?thesis
  85.249      by (simp only: unat_def int_word_uint word_arith_wis mod_diff_right_eq [symmetric])
  85.250 @@ -1458,7 +1458,7 @@
  85.251    using uint_ge_0 [of y] uint_lt2p [of x] by arith
  85.252  
  85.253  
  85.254 -subsection {* Conditions for the addition (etc) of two words to overflow *}
  85.255 +subsection \<open>Conditions for the addition (etc) of two words to overflow\<close>
  85.256  
  85.257  lemma uint_add_lem: 
  85.258    "(uint x + uint y < 2 ^ len_of TYPE('a)) = 
  85.259 @@ -1503,7 +1503,7 @@
  85.260    using mod_sub_if_z [of "uint a" _ "uint b"] by (simp add: uint_word_ariths)
  85.261  
  85.262  
  85.263 -subsection {* Definition of @{text uint_arith} *}
  85.264 +subsection \<open>Definition of \<open>uint_arith\<close>\<close>
  85.265  
  85.266  lemma word_of_int_inverse:
  85.267    "word_of_int r = a \<Longrightarrow> 0 <= r \<Longrightarrow> r < 2 ^ len_of TYPE('a) \<Longrightarrow> 
  85.268 @@ -1541,7 +1541,7 @@
  85.269    by auto
  85.270  
  85.271  (* uint_arith_tac: reduce to arithmetic on int, try to solve by arith *)
  85.272 -ML {*
  85.273 +ML \<open>
  85.274  fun uint_arith_simpset ctxt = 
  85.275    ctxt addsimps @{thms uint_arith_simps}
  85.276       delsimps @{thms word_uint.Rep_inject}
  85.277 @@ -1570,14 +1570,14 @@
  85.278    end
  85.279  
  85.280  fun uint_arith_tac ctxt = SELECT_GOAL (EVERY (uint_arith_tacs ctxt))
  85.281 -*}
  85.282 +\<close>
  85.283  
  85.284  method_setup uint_arith = 
  85.285 -  {* Scan.succeed (SIMPLE_METHOD' o uint_arith_tac) *}
  85.286 +  \<open>Scan.succeed (SIMPLE_METHOD' o uint_arith_tac)\<close>
  85.287    "solving word arithmetic via integers and arith"
  85.288  
  85.289  
  85.290 -subsection {* More on overflows and monotonicity *}
  85.291 +subsection \<open>More on overflows and monotonicity\<close>
  85.292  
  85.293  lemma no_plus_overflow_uint_size: 
  85.294    "((x :: 'a :: len0 word) <= x + y) = (uint x + uint y < 2 ^ size x)"
  85.295 @@ -1803,7 +1803,7 @@
  85.296                   word_pred_rbl word_mult_rbl word_add_rbl)
  85.297  
  85.298  
  85.299 -subsection {* Arithmetic type class instantiations *}
  85.300 +subsection \<open>Arithmetic type class instantiations\<close>
  85.301  
  85.302  lemmas word_le_0_iff [simp] =
  85.303    word_zero_le [THEN leD, THEN linorder_antisym_conv1]
  85.304 @@ -1820,13 +1820,13 @@
  85.305    using word_ubin.norm_eq_iff [where 'a='a, of "numeral bin" 0]
  85.306    by (simp add: iszero_def [symmetric])
  85.307      
  85.308 -text {* Use @{text iszero} to simplify equalities between word numerals. *}
  85.309 +text \<open>Use \<open>iszero\<close> to simplify equalities between word numerals.\<close>
  85.310  
  85.311  lemmas word_eq_numeral_iff_iszero [simp] =
  85.312    eq_numeral_iff_iszero [where 'a="'a::len word"]
  85.313  
  85.314  
  85.315 -subsection {* Word and nat *}
  85.316 +subsection \<open>Word and nat\<close>
  85.317  
  85.318  lemma td_ext_unat [OF refl]:
  85.319    "n = len_of TYPE ('a :: len) \<Longrightarrow> 
  85.320 @@ -2017,7 +2017,7 @@
  85.321    unfolding uint_nat by (simp add : unat_mod zmod_int)
  85.322  
  85.323  
  85.324 -subsection {* Definition of @{text unat_arith} tactic *}
  85.325 +subsection \<open>Definition of \<open>unat_arith\<close> tactic\<close>
  85.326  
  85.327  lemma unat_split:
  85.328    fixes x::"'a::len word"
  85.329 @@ -2043,7 +2043,7 @@
  85.330  
  85.331  (* unat_arith_tac: tactic to reduce word arithmetic to nat, 
  85.332     try to solve via arith *)
  85.333 -ML {*
  85.334 +ML \<open>
  85.335  fun unat_arith_simpset ctxt = 
  85.336    ctxt addsimps @{thms unat_arith_simps}
  85.337       delsimps @{thms word_unat.Rep_inject}
  85.338 @@ -2070,10 +2070,10 @@
  85.339    end
  85.340  
  85.341  fun unat_arith_tac ctxt = SELECT_GOAL (EVERY (unat_arith_tacs ctxt))
  85.342 -*}
  85.343 +\<close>
  85.344  
  85.345  method_setup unat_arith = 
  85.346 -  {* Scan.succeed (SIMPLE_METHOD' o unat_arith_tac) *}
  85.347 +  \<open>Scan.succeed (SIMPLE_METHOD' o unat_arith_tac)\<close>
  85.348    "solving word arithmetic via natural numbers and arith"
  85.349  
  85.350  lemma no_plus_overflow_unat_size: 
  85.351 @@ -2202,7 +2202,7 @@
  85.352    done
  85.353  
  85.354  
  85.355 -subsection {* Cardinality, finiteness of set of words *}
  85.356 +subsection \<open>Cardinality, finiteness of set of words\<close>
  85.357  
  85.358  instance word :: (len0) finite
  85.359    by standard (simp add: type_definition.univ [OF type_definition_word])
  85.360 @@ -2215,7 +2215,7 @@
  85.361  unfolding word_size by (rule card_word)
  85.362  
  85.363  
  85.364 -subsection {* Bitwise Operations on Words *}
  85.365 +subsection \<open>Bitwise Operations on Words\<close>
  85.366  
  85.367  lemmas bin_log_bintrs = bin_trunc_not bin_trunc_xor bin_trunc_and bin_trunc_or
  85.368    
  85.369 @@ -2254,7 +2254,7 @@
  85.370    "- numeral a XOR - numeral b = word_of_int (- numeral a XOR - numeral b)"
  85.371    by (transfer, rule refl)+
  85.372  
  85.373 -text {* Special cases for when one of the arguments equals 1. *}
  85.374 +text \<open>Special cases for when one of the arguments equals 1.\<close>
  85.375  
  85.376  lemma word_bitwise_1_simps [simp]:
  85.377    "NOT (1::'a::len0 word) = -2"
  85.378 @@ -2272,7 +2272,7 @@
  85.379    "- numeral a XOR 1 = word_of_int (- numeral a XOR 1)"
  85.380    by (transfer, simp)+
  85.381  
  85.382 -text {* Special cases for when one of the arguments equals -1. *}
  85.383 +text \<open>Special cases for when one of the arguments equals -1.\<close>
  85.384  
  85.385  lemma word_bitwise_m1_simps [simp]:
  85.386    "NOT (-1::'a::len0 word) = 0"
  85.387 @@ -2759,7 +2759,7 @@
  85.388    done
  85.389  
  85.390  
  85.391 -subsection {* Shifting, Rotating, and Splitting Words *}
  85.392 +subsection \<open>Shifting, Rotating, and Splitting Words\<close>
  85.393  
  85.394  lemma shiftl1_wi [simp]: "shiftl1 (word_of_int w) = word_of_int (w BIT False)"
  85.395    unfolding shiftl1_def
  85.396 @@ -2923,7 +2923,7 @@
  85.397    done
  85.398  
  85.399  
  85.400 -subsubsection {* shift functions in terms of lists of bools *}
  85.401 +subsubsection \<open>shift functions in terms of lists of bools\<close>
  85.402  
  85.403  lemmas bshiftr1_numeral [simp] = 
  85.404    bshiftr1_def [where w="numeral w", unfolded to_bl_numeral] for w
  85.405 @@ -3215,7 +3215,7 @@
  85.406    done
  85.407  
  85.408  
  85.409 -subsubsection {* Mask *}
  85.410 +subsubsection \<open>Mask\<close>
  85.411  
  85.412  lemma nth_mask [OF refl, simp]:
  85.413    "m = mask n \<Longrightarrow> test_bit m i = (i < n & i < size m)"
  85.414 @@ -3350,7 +3350,7 @@
  85.415    by (clarsimp simp: and_mask_wi word_of_int_power_hom bintr_ariths)
  85.416  
  85.417  
  85.418 -subsubsection {* Revcast *}
  85.419 +subsubsection \<open>Revcast\<close>
  85.420  
  85.421  lemmas revcast_def' = revcast_def [simplified]
  85.422  lemmas revcast_def'' = revcast_def' [simplified word_size]
  85.423 @@ -3382,7 +3382,7 @@
  85.424    by (fact revcast_ucast [THEN word_rev_gal'])
  85.425  
  85.426  
  85.427 --- "linking revcast and cast via shift"
  85.428 +\<comment> "linking revcast and cast via shift"
  85.429  
  85.430  lemmas wsst_TYs = source_size target_size word_size
  85.431  
  85.432 @@ -3465,7 +3465,7 @@
  85.433    rc2 [simplified rev_shiftr revcast_ucast [symmetric]]
  85.434  
  85.435  
  85.436 -subsubsection {* Slices *}
  85.437 +subsubsection \<open>Slices\<close>
  85.438  
  85.439  lemma slice1_no_bin [simp]:
  85.440    "slice1 n (numeral w :: 'b word) = of_bl (takefill False n (bin_to_bl (len_of TYPE('b :: len0)) (numeral w)))"
  85.441 @@ -3488,7 +3488,7 @@
  85.442  
  85.443  lemmas slice_take = slice_take' [unfolded word_size]
  85.444  
  85.445 --- "shiftr to a word of the same size is just slice, 
  85.446 +\<comment> "shiftr to a word of the same size is just slice, 
  85.447      slice is just shiftr then ucast"
  85.448  lemmas shiftr_slice = trans [OF shiftr_bl [THEN meta_eq_to_obj_eq] slice_take [symmetric]]
  85.449  
  85.450 @@ -3573,8 +3573,8 @@
  85.451  lemmas sym_notr = 
  85.452    not_iff [THEN iffD2, THEN not_sym, THEN not_iff [THEN iffD1]]
  85.453  
  85.454 --- {* problem posed by TPHOLs referee:
  85.455 -      criterion for overflow of addition of signed integers *}
  85.456 +\<comment> \<open>problem posed by TPHOLs referee:
  85.457 +      criterion for overflow of addition of signed integers\<close>
  85.458  
  85.459  lemma sofl_test:
  85.460    "(sint (x :: 'a :: len word) + sint y = sint (x + y)) = 
  85.461 @@ -3605,7 +3605,7 @@
  85.462    done
  85.463  
  85.464  
  85.465 -subsection {* Split and cat *}
  85.466 +subsection \<open>Split and cat\<close>
  85.467  
  85.468  lemmas word_split_bin' = word_split_def
  85.469  lemmas word_cat_bin' = word_cat_def
  85.470 @@ -3711,7 +3711,7 @@
  85.471    apply (rule refl conjI)+
  85.472    done
  85.473  
  85.474 --- "keep quantifiers for use in simplification"
  85.475 +\<comment> "keep quantifiers for use in simplification"
  85.476  lemma test_bit_split':
  85.477    "word_split c = (a, b) --> (ALL n m. b !! n = (n < size b & c !! n) & 
  85.478      a !! m = (m < size a & c !! (m + size b)))"
  85.479 @@ -3742,13 +3742,13 @@
  85.480    apply (fastforce intro ! : word_eqI simp add : word_size)
  85.481    done
  85.482  
  85.483 --- {* this odd result is analogous to @{text "ucast_id"}, 
  85.484 -      result to the length given by the result type *}
  85.485 +\<comment> \<open>this odd result is analogous to \<open>ucast_id\<close>, 
  85.486 +      result to the length given by the result type\<close>
  85.487  
  85.488  lemma word_cat_id: "word_cat a b = b"
  85.489    unfolding word_cat_bin' by (simp add: word_ubin.inverse_norm)
  85.490  
  85.491 --- "limited hom result"
  85.492 +\<comment> "limited hom result"
  85.493  lemma word_cat_hom:
  85.494    "len_of TYPE('a::len0) <= len_of TYPE('b::len0) + len_of TYPE ('c::len0)
  85.495    \<Longrightarrow>
  85.496 @@ -3771,7 +3771,7 @@
  85.497  lemmas word_cat_split_size = sym [THEN [2] word_cat_split_alt [symmetric]]
  85.498  
  85.499  
  85.500 -subsubsection {* Split and slice *}
  85.501 +subsubsection \<open>Split and slice\<close>
  85.502  
  85.503  lemma split_slices: 
  85.504    "word_split w = (u, v) \<Longrightarrow> u = slice (size v) w & v = slice 0 w"
  85.505 @@ -3816,9 +3816,9 @@
  85.506  lemmas word_split_bl_no_bin [simp] =
  85.507    word_split_bl_eq [where c="numeral c", unfolded to_bl_numeral] for c
  85.508  
  85.509 -text {* this odd result arises from the fact that the statement of the
  85.510 +text \<open>this odd result arises from the fact that the statement of the
  85.511        result implies that the decoded words are of the same type, 
  85.512 -      and therefore of the same length, as the original word *}
  85.513 +      and therefore of the same length, as the original word\<close>
  85.514  
  85.515  lemma word_rsplit_same: "word_rsplit w = [w]"
  85.516    unfolding word_rsplit_def by (simp add : bin_rsplit_all)
  85.517 @@ -3892,7 +3892,7 @@
  85.518    trans [OF nth_rev_alt [THEN test_bit_cong] 
  85.519    test_bit_rsplit [OF refl asm_rl diff_Suc_less]]
  85.520  
  85.521 --- "lazy way of expressing that u and v, and su and sv, have same types"
  85.522 +\<comment> "lazy way of expressing that u and v, and su and sv, have same types"
  85.523  lemma word_rsplit_len_indep [OF refl refl refl refl]:
  85.524    "[u,v] = p \<Longrightarrow> [su,sv] = q \<Longrightarrow> word_rsplit u = su \<Longrightarrow> 
  85.525      word_rsplit v = sv \<Longrightarrow> length su = length sv"
  85.526 @@ -3975,7 +3975,7 @@
  85.527    done
  85.528  
  85.529  
  85.530 -subsection {* Rotation *}
  85.531 +subsection \<open>Rotation\<close>
  85.532  
  85.533  lemmas rotater_0' [simp] = rotater_def [where n = "0", simplified]
  85.534  
  85.535 @@ -3997,7 +3997,7 @@
  85.536    rotate_eq_mod
  85.537  
  85.538  
  85.539 -subsubsection {* Rotation of list to right *}
  85.540 +subsubsection \<open>Rotation of list to right\<close>
  85.541  
  85.542  lemma rotate1_rl': "rotater1 (l @ [a]) = a # l"
  85.543    unfolding rotater1_def by (cases l) auto
  85.544 @@ -4072,7 +4072,7 @@
  85.545  lemmas rotater_add = rotater_eqs (2)
  85.546  
  85.547  
  85.548 -subsubsection {* map, map2, commuting with rotate(r) *}
  85.549 +subsubsection \<open>map, map2, commuting with rotate(r)\<close>
  85.550  
  85.551  lemma butlast_map:
  85.552    "xs ~= [] \<Longrightarrow> butlast (map f xs) = map f (butlast xs)"
  85.553 @@ -4147,7 +4147,7 @@
  85.554    by (induct n) (auto intro!: lth)
  85.555  
  85.556  
  85.557 --- "corresponding equalities for word rotation"
  85.558 +\<comment> "corresponding equalities for word rotation"
  85.559  
  85.560  lemma to_bl_rotl: 
  85.561    "to_bl (word_rotl n w) = rotate n (to_bl w)"
  85.562 @@ -4248,7 +4248,7 @@
  85.563  lemmas word_roti_conv_mod = word_roti_conv_mod' [unfolded word_size]
  85.564  
  85.565  
  85.566 -subsubsection {* "Word rotation commutes with bit-wise operations *}
  85.567 +subsubsection \<open>"Word rotation commutes with bit-wise operations\<close>
  85.568  
  85.569  (* using locale to not pollute lemma namespace *)
  85.570  locale word_rotate 
  85.571 @@ -4328,7 +4328,7 @@
  85.572  declare word_roti_def [simp]
  85.573  
  85.574  
  85.575 -subsection {* Maximum machine word *}
  85.576 +subsection \<open>Maximum machine word\<close>
  85.577  
  85.578  lemma word_int_cases:
  85.579    obtains n where "(x ::'a::len0 word) = word_of_int n" and "0 \<le> n" and "n < 2^len_of TYPE('a)"
  85.580 @@ -4630,7 +4630,7 @@
  85.581    done
  85.582  
  85.583  
  85.584 -subsection {* Recursion combinator for words *}
  85.585 +subsection \<open>Recursion combinator for words\<close>
  85.586  
  85.587  definition word_rec :: "'a \<Rightarrow> ('b::len word \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'b word \<Rightarrow> 'a"
  85.588  where
    86.1 --- a/src/HOL/Word/WordBitwise.thy	Mon Dec 07 10:23:50 2015 +0100
    86.2 +++ b/src/HOL/Word/WordBitwise.thy	Mon Dec 07 10:38:04 2015 +0100
    86.3 @@ -9,7 +9,7 @@
    86.4  
    86.5  begin
    86.6  
    86.7 -text {* Helper constants used in defining addition *}
    86.8 +text \<open>Helper constants used in defining addition\<close>
    86.9  
   86.10  definition
   86.11    xor3 :: "bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool"
   86.12 @@ -39,9 +39,9 @@
   86.13    "xor3 a b False = (a \<noteq> b)"
   86.14    by (simp_all add: xor3_def)
   86.15  
   86.16 -text {* Breaking up word equalities into equalities on their
   86.17 +text \<open>Breaking up word equalities into equalities on their
   86.18  bit lists. Equalities are generated and manipulated in the
   86.19 -reverse order to to_bl. *}
   86.20 +reverse order to to_bl.\<close>
   86.21  
   86.22  lemma word_eq_rbl_eq:
   86.23    "(x = y) = (rev (to_bl x) = rev (to_bl y))"
   86.24 @@ -322,7 +322,7 @@
   86.25    using word_rbl_mul_induct[where xs="rev (to_bl x)" and y=y]
   86.26    by (simp add: word_size)
   86.27  
   86.28 -text {* Breaking up inequalities into bitlist properties. *}
   86.29 +text \<open>Breaking up inequalities into bitlist properties.\<close>
   86.30  
   86.31  definition
   86.32    "rev_bl_order F xs ys =
   86.33 @@ -449,8 +449,8 @@
   86.34     apply auto
   86.35    done
   86.36  
   86.37 -text {* Lemmas for unpacking rev (to_bl n) for numerals n and also
   86.38 -for irreducible values and expressions. *}
   86.39 +text \<open>Lemmas for unpacking rev (to_bl n) for numerals n and also
   86.40 +for irreducible values and expressions.\<close>
   86.41  
   86.42  lemma rev_bin_to_bl_simps:
   86.43    "rev (bin_to_bl 0 x) = []"
   86.44 @@ -494,9 +494,9 @@
   86.45    "\<lbrakk> i = x; x < j; [x + 1 ..< j] = xs \<rbrakk> \<Longrightarrow> [i ..< j] = (x # xs)"
   86.46    by (simp_all add: upt_eq_Nil_conv upt_eq_Cons_conv)
   86.47  
   86.48 -text {* Tactic definition *}
   86.49 +text \<open>Tactic definition\<close>
   86.50  
   86.51 -ML {*
   86.52 +ML \<open>
   86.53  structure Word_Bitwise_Tac =
   86.54  struct
   86.55  
   86.56 @@ -617,10 +617,10 @@
   86.57  
   86.58  end
   86.59  
   86.60 -*}
   86.61 +\<close>
   86.62  
   86.63  method_setup word_bitwise =
   86.64 -  {* Scan.succeed (fn ctxt => Method.SIMPLE_METHOD (Word_Bitwise_Tac.tac ctxt 1))  *}
   86.65 +  \<open>Scan.succeed (fn ctxt => Method.SIMPLE_METHOD (Word_Bitwise_Tac.tac ctxt 1))\<close>
   86.66    "decomposer for word equalities and inequalities into bit propositions"
   86.67  
   86.68  end
    87.1 --- a/src/HOL/Word/Word_Miscellaneous.thy	Mon Dec 07 10:23:50 2015 +0100
    87.2 +++ b/src/HOL/Word/Word_Miscellaneous.thy	Mon Dec 07 10:38:04 2015 +0100
    87.3 @@ -2,7 +2,7 @@
    87.4      Author:     Miscellaneous
    87.5  *)
    87.6  
    87.7 -section {* Miscellaneous lemmas, of at least doubtful value *}
    87.8 +section \<open>Miscellaneous lemmas, of at least doubtful value\<close>
    87.9  
   87.10  theory Word_Miscellaneous
   87.11  imports Main "~~/src/HOL/Library/Bit" Misc_Numeric
   87.12 @@ -67,7 +67,7 @@
   87.13    apply (erule y)
   87.14    done
   87.15  
   87.16 --- "simplifications for specific word lengths"
   87.17 +\<comment> "simplifications for specific word lengths"
   87.18  lemmas n2s_ths [THEN eq_reflection] = add_2_eq_Suc add_2_eq_Suc'
   87.19  
   87.20  lemmas s2n_ths = n2s_ths [symmetric]
    88.1 --- a/src/HOL/Zorn.thy	Mon Dec 07 10:23:50 2015 +0100
    88.2 +++ b/src/HOL/Zorn.thy	Mon Dec 07 10:38:04 2015 +0100
    88.3 @@ -17,7 +17,7 @@
    88.4  
    88.5  subsubsection \<open>Results that do not require an order\<close>
    88.6  
    88.7 -text \<open>Let @{text P} be a binary predicate on the set @{text A}.\<close>
    88.8 +text \<open>Let \<open>P\<close> be a binary predicate on the set \<open>A\<close>.\<close>
    88.9  locale pred_on =
   88.10    fixes A :: "'a set"
   88.11      and P :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "\<sqsubset>" 50)
   88.12 @@ -464,7 +464,7 @@
   88.13    shows "\<exists>m\<in>Field r. \<forall>a\<in>Field r. (m, a) \<in> r \<longrightarrow> a = m"
   88.14  proof -
   88.15    have "Preorder r" using po by (simp add: partial_order_on_def)
   88.16 ---\<open>Mirror r in the set of subsets below (wrt r) elements of A\<close>
   88.17 +\<comment>\<open>Mirror r in the set of subsets below (wrt r) elements of A\<close>
   88.18    let ?B = "%x. r\<inverse> `` {x}" let ?S = "?B ` Field r"
   88.19    {
   88.20      fix C assume 1: "C \<subseteq> ?S" and 2: "\<forall>A\<in>C. \<forall>B\<in>C. A \<subseteq> B \<or> B \<subseteq> A"
   88.21 @@ -607,7 +607,7 @@
   88.22  
   88.23  theorem well_ordering: "\<exists>r::'a rel. Well_order r \<and> Field r = UNIV"
   88.24  proof -
   88.25 --- \<open>The initial segment relation on well-orders:\<close>
   88.26 +\<comment> \<open>The initial segment relation on well-orders:\<close>
   88.27    let ?WO = "{r::'a rel. Well_order r}"
   88.28    def I \<equiv> "init_seg_of \<inter> ?WO \<times> ?WO"
   88.29    have I_init: "I \<subseteq> init_seg_of" by (auto simp: I_def)
   88.30 @@ -619,7 +619,7 @@
   88.31    hence 0: "Partial_order I"
   88.32      by (auto simp: partial_order_on_def preorder_on_def antisym_def antisym_init_seg_of refl_on_def
   88.33        trans_def I_def elim!: trans_init_seg_of)
   88.34 --- \<open>I-chains have upper bounds in ?WO wrt I: their Union\<close>
   88.35 +\<comment> \<open>I-chains have upper bounds in ?WO wrt I: their Union\<close>
   88.36    { fix R assume "R \<in> Chains I"
   88.37      hence Ris: "R \<in> Chains init_seg_of" using mono_Chains [OF I_init] by blast
   88.38      have subch: "chain\<^sub>\<subseteq> R" using \<open>R : Chains I\<close> I_init
   88.39 @@ -648,13 +648,13 @@
   88.40        unfolding I_def by blast
   88.41    }
   88.42    hence 1: "\<forall>R \<in> Chains I. \<exists>u\<in>Field I. \<forall>r\<in>R. (r, u) \<in> I" by (subst FI) blast
   88.43 ---\<open>Zorn's Lemma yields a maximal well-order m:\<close>
   88.44 +\<comment>\<open>Zorn's Lemma yields a maximal well-order m:\<close>
   88.45    then obtain m::"'a rel" where "Well_order m" and
   88.46      max: "\<forall>r. Well_order r \<and> (m, r) \<in> I \<longrightarrow> r = m"
   88.47      using Zorns_po_lemma[OF 0 1] unfolding FI by fastforce
   88.48 ---\<open>Now show by contradiction that m covers the whole type:\<close>
   88.49 +\<comment>\<open>Now show by contradiction that m covers the whole type:\<close>
   88.50    { fix x::'a assume "x \<notin> Field m"
   88.51 ---\<open>We assume that x is not covered and extend m at the top with x\<close>
   88.52 +\<comment>\<open>We assume that x is not covered and extend m at the top with x\<close>
   88.53      have "m \<noteq> {}"
   88.54      proof
   88.55        assume "m = {}"
   88.56 @@ -666,14 +666,14 @@
   88.57      hence "Field m \<noteq> {}" by(auto simp:Field_def)
   88.58      moreover have "wf (m - Id)" using \<open>Well_order m\<close>
   88.59        by (simp add: well_order_on_def)
   88.60 ---\<open>The extension of m by x:\<close>
   88.61 +\<comment>\<open>The extension of m by x:\<close>
   88.62      let ?s = "{(a, x) | a. a \<in> Field m}"
   88.63      let ?m = "insert (x, x) m \<union> ?s"
   88.64      have Fm: "Field ?m = insert x (Field m)"
   88.65        by (auto simp: Field_def)
   88.66      have "Refl m" and "trans m" and "antisym m" and "Total m" and "wf (m - Id)"
   88.67        using \<open>Well_order m\<close> by (simp_all add: order_on_defs)
   88.68 ---\<open>We show that the extension is a well-order\<close>
   88.69 +\<comment>\<open>We show that the extension is a well-order\<close>
   88.70      have "Refl ?m" using \<open>Refl m\<close> Fm unfolding refl_on_def by blast
   88.71      moreover have "trans ?m" using \<open>trans m\<close> and \<open>x \<notin> Field m\<close>
   88.72        unfolding trans_def Field_def by blast
   88.73 @@ -689,11 +689,11 @@
   88.74          unfolding Un_Diff Field_def by (auto intro: wf_Un)
   88.75      qed
   88.76      ultimately have "Well_order ?m" by (simp add: order_on_defs)
   88.77 ---\<open>We show that the extension is above m\<close>
   88.78 +\<comment>\<open>We show that the extension is above m\<close>
   88.79      moreover have "(m, ?m) \<in> I" using \<open>Well_order ?m\<close> and \<open>Well_order m\<close> and \<open>x \<notin> Field m\<close>
   88.80        by (fastforce simp: I_def init_seg_of_def Field_def)
   88.81      ultimately
   88.82 ---\<open>This contradicts maximality of m:\<close>
   88.83 +\<comment>\<open>This contradicts maximality of m:\<close>
   88.84      have False using max and \<open>x \<notin> Field m\<close> unfolding Field_def by blast
   88.85    }
   88.86    hence "Field m = UNIV" by auto