isabelle update_cartouches;
authorwenzelm
Wed Jun 17 11:03:05 2015 +0200 (2015-06-17)
changeset 60500903bb1495239
parent 60499 54a3db2ed201
child 60501 839169c70e92
isabelle update_cartouches;
src/HOL/Library/AList.thy
src/HOL/Library/AList_Mapping.thy
src/HOL/Library/BNF_Axiomatization.thy
src/HOL/Library/BigO.thy
src/HOL/Library/Bit.thy
src/HOL/Library/Boolean_Algebra.thy
src/HOL/Library/Cardinal_Notations.thy
src/HOL/Library/Cardinality.thy
src/HOL/Library/Char_ord.thy
src/HOL/Library/Code_Abstract_Nat.thy
src/HOL/Library/Code_Binary_Nat.thy
src/HOL/Library/Code_Char.thy
src/HOL/Library/Code_Prolog.thy
src/HOL/Library/Code_Real_Approx_By_Float.thy
src/HOL/Library/Code_Target_Int.thy
src/HOL/Library/Code_Target_Nat.thy
src/HOL/Library/Code_Target_Numeral.thy
src/HOL/Library/Code_Test.thy
src/HOL/Library/ContNotDenum.thy
src/HOL/Library/Countable.thy
src/HOL/Library/Countable_Set.thy
src/HOL/Library/Countable_Set_Type.thy
src/HOL/Library/Debug.thy
src/HOL/Library/Diagonal_Subsequence.thy
src/HOL/Library/Discrete.thy
src/HOL/Library/Dlist.thy
src/HOL/Library/Extended.thy
src/HOL/Library/Extended_Nat.thy
src/HOL/Library/Extended_Real.thy
src/HOL/Library/FSet.thy
src/HOL/Library/FinFun.thy
src/HOL/Library/FinFun_Syntax.thy
src/HOL/Library/Finite_Lattice.thy
src/HOL/Library/Float.thy
src/HOL/Library/Formal_Power_Series.thy
src/HOL/Library/Fraction_Field.thy
src/HOL/Library/Fun_Lexorder.thy
src/HOL/Library/Function_Algebras.thy
src/HOL/Library/Function_Division.thy
src/HOL/Library/Function_Growth.thy
src/HOL/Library/Groups_Big_Fun.thy
src/HOL/Library/IArray.thy
src/HOL/Library/Indicator_Function.thy
src/HOL/Library/Infinite_Set.thy
src/HOL/Library/Inner_Product.thy
src/HOL/Library/LaTeXsugar.thy
src/HOL/Library/Lattice_Algebras.thy
src/HOL/Library/Lattice_Constructions.thy
src/HOL/Library/Lattice_Syntax.thy
src/HOL/Library/Liminf_Limsup.thy
src/HOL/Library/Linear_Temporal_Logic_on_Streams.thy
src/HOL/Library/ListVector.thy
src/HOL/Library/List_lexord.thy
src/HOL/Library/Lub_Glb.thy
src/HOL/Library/Mapping.thy
src/HOL/Library/Monad_Syntax.thy
src/HOL/Library/More_List.thy
src/HOL/Library/Multiset.thy
src/HOL/Library/Multiset_Order.thy
src/HOL/Library/Nat_Bijection.thy
src/HOL/Library/Numeral_Type.thy
src/HOL/Library/Old_Datatype.thy
src/HOL/Library/Old_Recdef.thy
src/HOL/Library/Old_SMT.thy
src/HOL/Library/Option_ord.thy
src/HOL/Library/Order_Continuity.thy
src/HOL/Library/Parallel.thy
src/HOL/Library/Permutation.thy
src/HOL/Library/Permutations.thy
src/HOL/Library/Phantom_Type.thy
src/HOL/Library/Poly_Deriv.thy
src/HOL/Library/Polynomial.thy
src/HOL/Library/Predicate_Compile_Alternative_Defs.thy
src/HOL/Library/Predicate_Compile_Quickcheck.thy
src/HOL/Library/Prefix_Order.thy
src/HOL/Library/Preorder.thy
src/HOL/Library/Product_Lexorder.thy
src/HOL/Library/Product_Order.thy
src/HOL/Library/Product_Vector.thy
src/HOL/Library/Product_plus.thy
src/HOL/Library/Quadratic_Discriminant.thy
src/HOL/Library/Quotient_List.thy
src/HOL/Library/Quotient_Option.thy
src/HOL/Library/Quotient_Product.thy
src/HOL/Library/Quotient_Set.thy
src/HOL/Library/Quotient_Sum.thy
src/HOL/Library/Quotient_Syntax.thy
src/HOL/Library/RBT.thy
src/HOL/Library/RBT_Impl.thy
src/HOL/Library/RBT_Mapping.thy
src/HOL/Library/RBT_Set.thy
src/HOL/Library/Ramsey.thy
src/HOL/Library/Reflection.thy
src/HOL/Library/Refute.thy
src/HOL/Library/Saturated.thy
src/HOL/Library/Set_Algebras.thy
src/HOL/Library/State_Monad.thy
src/HOL/Library/Stream.thy
src/HOL/Library/Sublist.thy
src/HOL/Library/Sublist_Order.thy
src/HOL/Library/Sum_of_Squares.thy
src/HOL/Library/Sum_of_Squares_Remote.thy
src/HOL/Library/Transitive_Closure_Table.thy
src/HOL/Library/Tree.thy
src/HOL/Library/Tree_Multiset.thy
src/HOL/Library/While_Combinator.thy
     1.1 --- a/src/HOL/Library/AList.thy	Wed Jun 17 10:57:11 2015 +0200
     1.2 +++ b/src/HOL/Library/AList.thy	Wed Jun 17 11:03:05 2015 +0200
     1.3 @@ -2,7 +2,7 @@
     1.4      Author:     Norbert Schirmer, Tobias Nipkow, Martin Wildmoser, TU Muenchen
     1.5  *)
     1.6  
     1.7 -section {* Implementation of Association Lists *}
     1.8 +section \<open>Implementation of Association Lists\<close>
     1.9  
    1.10  theory AList
    1.11  imports Main
    1.12 @@ -11,14 +11,14 @@
    1.13  context
    1.14  begin
    1.15  
    1.16 -text {*
    1.17 +text \<open>
    1.18    The operations preserve distinctness of keys and
    1.19    function @{term "clearjunk"} distributes over them. Since
    1.20    @{term clearjunk} enforces distinctness of keys it can be used
    1.21    to establish the invariant, e.g. for inductive proofs.
    1.22 -*}
    1.23 +\<close>
    1.24  
    1.25 -subsection {* @{text update} and @{text updates} *}
    1.26 +subsection \<open>@{text update} and @{text updates}\<close>
    1.27  
    1.28  qualified primrec update :: "'key \<Rightarrow> 'val \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.29  where
    1.30 @@ -68,9 +68,9 @@
    1.31  lemma update_last [simp]: "update k v (update k v' al) = update k v al"
    1.32    by (induct al) auto
    1.33  
    1.34 -text {* Note that the lists are not necessarily the same:
    1.35 +text \<open>Note that the lists are not necessarily the same:
    1.36          @{term "update k v (update k' v' []) = [(k', v'), (k, v)]"} and
    1.37 -        @{term "update k' v' (update k v []) = [(k, v), (k', v')]"}.*}
    1.38 +        @{term "update k' v' (update k v []) = [(k, v), (k', v')]"}.\<close>
    1.39  
    1.40  lemma update_swap:
    1.41    "k \<noteq> k' \<Longrightarrow>
    1.42 @@ -163,7 +163,7 @@
    1.43    by (induct xs arbitrary: ys al) (auto split: list.splits)
    1.44  
    1.45  
    1.46 -subsection {* @{text delete} *}
    1.47 +subsection \<open>@{text delete}\<close>
    1.48  
    1.49  qualified definition delete :: "'key \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.50    where delete_eq: "delete k = filter (\<lambda>(k', _). k \<noteq> k')"
    1.51 @@ -215,17 +215,17 @@
    1.52    by (simp add: delete_eq)
    1.53  
    1.54  
    1.55 -subsection {* @{text update_with_aux} and @{text delete_aux}*}
    1.56 +subsection \<open>@{text update_with_aux} and @{text delete_aux}\<close>
    1.57  
    1.58  qualified primrec update_with_aux :: "'val \<Rightarrow> 'key \<Rightarrow> ('val \<Rightarrow> 'val) \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.59  where
    1.60    "update_with_aux v k f [] = [(k, f v)]"
    1.61  | "update_with_aux v k f (p # ps) = (if (fst p = k) then (k, f (snd p)) # ps else p # update_with_aux v k f ps)"
    1.62  
    1.63 -text {*
    1.64 +text \<open>
    1.65    The above @{term "delete"} traverses all the list even if it has found the key.
    1.66    This one does not have to keep going because is assumes the invariant that keys are distinct.
    1.67 -*}
    1.68 +\<close>
    1.69  qualified fun delete_aux :: "'key \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.70  where
    1.71    "delete_aux k [] = []"
    1.72 @@ -296,7 +296,7 @@
    1.73  by(cases ts)(auto split: split_if_asm)
    1.74  
    1.75  
    1.76 -subsection {* @{text restrict} *}
    1.77 +subsection \<open>@{text restrict}\<close>
    1.78  
    1.79  qualified definition restrict :: "'key set \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.80    where restrict_eq: "restrict A = filter (\<lambda>(k, v). k \<in> A)"
    1.81 @@ -380,7 +380,7 @@
    1.82    by (induct ps) auto
    1.83  
    1.84  
    1.85 -subsection {* @{text clearjunk} *}
    1.86 +subsection \<open>@{text clearjunk}\<close>
    1.87  
    1.88  qualified function clearjunk  :: "('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.89  where
    1.90 @@ -464,7 +464,7 @@
    1.91      (simp_all add: clearjunk_delete delete_map assms)
    1.92  
    1.93  
    1.94 -subsection {* @{text map_ran} *}
    1.95 +subsection \<open>@{text map_ran}\<close>
    1.96  
    1.97  definition map_ran :: "('key \<Rightarrow> 'val \<Rightarrow> 'val) \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
    1.98    where "map_ran f = map (\<lambda>(k, v). (k, f k v))"
    1.99 @@ -490,7 +490,7 @@
   1.100    by (simp add: map_ran_def split_def clearjunk_map)
   1.101  
   1.102  
   1.103 -subsection {* @{text merge} *}
   1.104 +subsection \<open>@{text merge}\<close>
   1.105  
   1.106  qualified definition merge :: "('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
   1.107    where "merge qs ps = foldr (\<lambda>(k, v). update k v) ps qs"
   1.108 @@ -558,7 +558,7 @@
   1.109    by (simp add: merge_conv')
   1.110  
   1.111  
   1.112 -subsection {* @{text compose} *}
   1.113 +subsection \<open>@{text compose}\<close>
   1.114  
   1.115  qualified function compose :: "('key \<times> 'a) list \<Rightarrow> ('a \<times> 'b) list \<Rightarrow> ('key \<times> 'b) list"
   1.116  where
   1.117 @@ -723,7 +723,7 @@
   1.118    by (simp add: compose_conv map_comp_None_iff)
   1.119  
   1.120  
   1.121 -subsection {* @{text map_entry} *}
   1.122 +subsection \<open>@{text map_entry}\<close>
   1.123  
   1.124  qualified fun map_entry :: "'key \<Rightarrow> ('val \<Rightarrow> 'val) \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
   1.125  where
   1.126 @@ -745,7 +745,7 @@
   1.127    using assms by (induct xs) (auto simp add: dom_map_entry)
   1.128  
   1.129  
   1.130 -subsection {* @{text map_default} *}
   1.131 +subsection \<open>@{text map_default}\<close>
   1.132  
   1.133  fun map_default :: "'key \<Rightarrow> 'val \<Rightarrow> ('val \<Rightarrow> 'val) \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
   1.134  where
     2.1 --- a/src/HOL/Library/AList_Mapping.thy	Wed Jun 17 10:57:11 2015 +0200
     2.2 +++ b/src/HOL/Library/AList_Mapping.thy	Wed Jun 17 11:03:05 2015 +0200
     2.3 @@ -2,7 +2,7 @@
     2.4     Author: Florian Haftmann, TU Muenchen
     2.5  *)
     2.6  
     2.7 -section {* Implementation of mappings with Association Lists *}
     2.8 +section \<open>Implementation of mappings with Association Lists\<close>
     2.9  
    2.10  theory AList_Mapping
    2.11  imports AList Mapping
     3.1 --- a/src/HOL/Library/BNF_Axiomatization.thy	Wed Jun 17 10:57:11 2015 +0200
     3.2 +++ b/src/HOL/Library/BNF_Axiomatization.thy	Wed Jun 17 11:03:05 2015 +0200
     3.3 @@ -5,7 +5,7 @@
     3.4  Axiomatic declaration of bounded natural functors.
     3.5  *)
     3.6  
     3.7 -section {* Axiomatic Declaration of Bounded Natural Functors *}
     3.8 +section \<open>Axiomatic Declaration of Bounded Natural Functors\<close>
     3.9  
    3.10  theory BNF_Axiomatization
    3.11  imports Main
     4.1 --- a/src/HOL/Library/BigO.thy	Wed Jun 17 10:57:11 2015 +0200
     4.2 +++ b/src/HOL/Library/BigO.thy	Wed Jun 17 11:03:05 2015 +0200
     4.3 @@ -2,13 +2,13 @@
     4.4      Authors:    Jeremy Avigad and Kevin Donnelly
     4.5  *)
     4.6  
     4.7 -section {* Big O notation *}
     4.8 +section \<open>Big O notation\<close>
     4.9  
    4.10  theory BigO
    4.11  imports Complex_Main Function_Algebras Set_Algebras
    4.12  begin
    4.13  
    4.14 -text {*
    4.15 +text \<open>
    4.16  This library is designed to support asymptotic ``big O'' calculations,
    4.17  i.e.~reasoning with expressions of the form $f = O(g)$ and $f = g +
    4.18  O(h)$.  An earlier version of this library is described in detail in
    4.19 @@ -30,9 +30,9 @@
    4.20  one should redeclare the theorem @{text "subsetI"} as an intro rule,
    4.21  rather than as an @{text "intro!"} rule, for example, using
    4.22  \isa{\isakeyword{declare}}~@{text "subsetI [del, intro]"}.
    4.23 -*}
    4.24 +\<close>
    4.25  
    4.26 -subsection {* Definitions *}
    4.27 +subsection \<open>Definitions\<close>
    4.28  
    4.29  definition bigo :: "('a \<Rightarrow> 'b::linordered_idom) \<Rightarrow> ('a \<Rightarrow> 'b) set"  ("(1O'(_'))")
    4.30    where "O(f:: 'a \<Rightarrow> 'b) = {h. \<exists>c. \<forall>x. abs (h x) \<le> c * abs (f x)}"
    4.31 @@ -558,7 +558,7 @@
    4.32    done
    4.33  
    4.34  
    4.35 -subsection {* Setsum *}
    4.36 +subsection \<open>Setsum\<close>
    4.37  
    4.38  lemma bigo_setsum_main: "\<forall>x. \<forall>y \<in> A x. 0 \<le> h x y \<Longrightarrow>
    4.39      \<exists>c. \<forall>x. \<forall>y \<in> A x. abs (f x y) \<le> c * (h x y) \<Longrightarrow>
    4.40 @@ -659,7 +659,7 @@
    4.41    done
    4.42  
    4.43  
    4.44 -subsection {* Misc useful stuff *}
    4.45 +subsection \<open>Misc useful stuff\<close>
    4.46  
    4.47  lemma bigo_useful_intro: "A \<subseteq> O(f) \<Longrightarrow> B \<subseteq> O(f) \<Longrightarrow> A + B \<subseteq> O(f)"
    4.48    apply (subst bigo_plus_idemp [symmetric])
    4.49 @@ -712,7 +712,7 @@
    4.50    done
    4.51  
    4.52  
    4.53 -subsection {* Less than or equal to *}
    4.54 +subsection \<open>Less than or equal to\<close>
    4.55  
    4.56  definition lesso :: "('a \<Rightarrow> 'b::linordered_idom) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"  (infixl "<o" 70)
    4.57    where "f <o g = (\<lambda>x. max (f x - g x) 0)"
     5.1 --- a/src/HOL/Library/Bit.thy	Wed Jun 17 10:57:11 2015 +0200
     5.2 +++ b/src/HOL/Library/Bit.thy	Wed Jun 17 11:03:05 2015 +0200
     5.3 @@ -2,13 +2,13 @@
     5.4      Author:     Brian Huffman
     5.5  *)
     5.6  
     5.7 -section {* The Field of Integers mod 2 *}
     5.8 +section \<open>The Field of Integers mod 2\<close>
     5.9  
    5.10  theory Bit
    5.11  imports Main
    5.12  begin
    5.13  
    5.14 -subsection {* Bits as a datatype *}
    5.15 +subsection \<open>Bits as a datatype\<close>
    5.16  
    5.17  typedef bit = "UNIV :: bool set"
    5.18    morphisms set Bit
    5.19 @@ -96,7 +96,7 @@
    5.20    by (simp_all add: equal set_iff)  
    5.21  
    5.22    
    5.23 -subsection {* Type @{typ bit} forms a field *}
    5.24 +subsection \<open>Type @{typ bit} forms a field\<close>
    5.25  
    5.26  instantiation bit :: field
    5.27  begin
    5.28 @@ -134,7 +134,7 @@
    5.29  lemma bit_mult_eq_1_iff [simp]: "x * y = (1 :: bit) \<longleftrightarrow> x = 1 \<and> y = 1"
    5.30    unfolding times_bit_def by (simp split: bit.split)
    5.31  
    5.32 -text {* Not sure whether the next two should be simp rules. *}
    5.33 +text \<open>Not sure whether the next two should be simp rules.\<close>
    5.34  
    5.35  lemma bit_add_eq_0_iff: "x + y = (0 :: bit) \<longleftrightarrow> x = y"
    5.36    unfolding plus_bit_def by (simp split: bit.split)
    5.37 @@ -143,9 +143,9 @@
    5.38    unfolding plus_bit_def by (simp split: bit.split)
    5.39  
    5.40  
    5.41 -subsection {* Numerals at type @{typ bit} *}
    5.42 +subsection \<open>Numerals at type @{typ bit}\<close>
    5.43  
    5.44 -text {* All numerals reduce to either 0 or 1. *}
    5.45 +text \<open>All numerals reduce to either 0 or 1.\<close>
    5.46  
    5.47  lemma bit_minus1 [simp]: "- 1 = (1 :: bit)"
    5.48    by (simp only: uminus_bit_def)
    5.49 @@ -160,7 +160,7 @@
    5.50    by (simp only: numeral_Bit1 bit_add_self add_0_left)
    5.51  
    5.52  
    5.53 -subsection {* Conversion from @{typ bit} *}
    5.54 +subsection \<open>Conversion from @{typ bit}\<close>
    5.55  
    5.56  context zero_neq_one
    5.57  begin
     6.1 --- a/src/HOL/Library/Boolean_Algebra.thy	Wed Jun 17 10:57:11 2015 +0200
     6.2 +++ b/src/HOL/Library/Boolean_Algebra.thy	Wed Jun 17 11:03:05 2015 +0200
     6.3 @@ -2,7 +2,7 @@
     6.4      Author:     Brian Huffman
     6.5  *)
     6.6  
     6.7 -section {* Boolean Algebras *}
     6.8 +section \<open>Boolean Algebras\<close>
     6.9  
    6.10  theory Boolean_Algebra
    6.11  imports Main
    6.12 @@ -53,7 +53,7 @@
    6.13  apply (rule conj_cancel_right)
    6.14  done
    6.15  
    6.16 -subsection {* Complement *}
    6.17 +subsection \<open>Complement\<close>
    6.18  
    6.19  lemma complement_unique:
    6.20    assumes 1: "a \<sqinter> x = \<zero>"
    6.21 @@ -81,7 +81,7 @@
    6.22  lemma compl_eq_compl_iff [simp]: "(\<sim> x = \<sim> y) = (x = y)"
    6.23  by (rule inj_eq [OF inj_on_inverseI], rule double_compl)
    6.24  
    6.25 -subsection {* Conjunction *}
    6.26 +subsection \<open>Conjunction\<close>
    6.27  
    6.28  lemma conj_absorb [simp]: "x \<sqinter> x = x"
    6.29  proof -
    6.30 @@ -124,7 +124,7 @@
    6.31  lemmas conj_disj_distribs =
    6.32     conj_disj_distrib conj_disj_distrib2
    6.33  
    6.34 -subsection {* Disjunction *}
    6.35 +subsection \<open>Disjunction\<close>
    6.36  
    6.37  lemma disj_absorb [simp]: "x \<squnion> x = x"
    6.38  by (rule boolean.conj_absorb [OF dual])
    6.39 @@ -154,7 +154,7 @@
    6.40  lemmas disj_conj_distribs =
    6.41     disj_conj_distrib disj_conj_distrib2
    6.42  
    6.43 -subsection {* De Morgan's Laws *}
    6.44 +subsection \<open>De Morgan's Laws\<close>
    6.45  
    6.46  lemma de_Morgan_conj [simp]: "\<sim> (x \<sqinter> y) = \<sim> x \<squnion> \<sim> y"
    6.47  proof (rule compl_unique)
    6.48 @@ -178,7 +178,7 @@
    6.49  
    6.50  end
    6.51  
    6.52 -subsection {* Symmetric Difference *}
    6.53 +subsection \<open>Symmetric Difference\<close>
    6.54  
    6.55  locale boolean_xor = boolean +
    6.56    fixes xor :: "'a => 'a => 'a"  (infixr "\<oplus>" 65)
     7.1 --- a/src/HOL/Library/Cardinal_Notations.thy	Wed Jun 17 10:57:11 2015 +0200
     7.2 +++ b/src/HOL/Library/Cardinal_Notations.thy	Wed Jun 17 11:03:05 2015 +0200
     7.3 @@ -5,7 +5,7 @@
     7.4  Cardinal notations.
     7.5  *)
     7.6  
     7.7 -section {* Cardinal Notations *}
     7.8 +section \<open>Cardinal Notations\<close>
     7.9  
    7.10  theory Cardinal_Notations
    7.11  imports Main
     8.1 --- a/src/HOL/Library/Cardinality.thy	Wed Jun 17 10:57:11 2015 +0200
     8.2 +++ b/src/HOL/Library/Cardinality.thy	Wed Jun 17 11:03:05 2015 +0200
     8.3 @@ -2,13 +2,13 @@
     8.4      Author:     Brian Huffman, Andreas Lochbihler
     8.5  *)
     8.6  
     8.7 -section {* Cardinality of types *}
     8.8 +section \<open>Cardinality of types\<close>
     8.9  
    8.10  theory Cardinality
    8.11  imports Phantom_Type
    8.12  begin
    8.13  
    8.14 -subsection {* Preliminary lemmas *}
    8.15 +subsection \<open>Preliminary lemmas\<close>
    8.16  (* These should be moved elsewhere *)
    8.17  
    8.18  lemma (in type_definition) univ:
    8.19 @@ -37,18 +37,18 @@
    8.20      by(auto simp add: type_definition.univ[OF type_definition_literal] infinite_UNIV_listI dest: finite_imageD)
    8.21  qed
    8.22  
    8.23 -subsection {* Cardinalities of types *}
    8.24 +subsection \<open>Cardinalities of types\<close>
    8.25  
    8.26  syntax "_type_card" :: "type => nat" ("(1CARD/(1'(_')))")
    8.27  
    8.28  translations "CARD('t)" => "CONST card (CONST UNIV \<Colon> 't set)"
    8.29  
    8.30 -print_translation {*
    8.31 +print_translation \<open>
    8.32    let
    8.33      fun card_univ_tr' ctxt [Const (@{const_syntax UNIV}, Type (_, [T]))] =
    8.34        Syntax.const @{syntax_const "_type_card"} $ Syntax_Phases.term_of_typ ctxt T
    8.35    in [(@{const_syntax card}, card_univ_tr')] end
    8.36 -*}
    8.37 +\<close>
    8.38  
    8.39  lemma card_prod [simp]: "CARD('a \<times> 'b) = CARD('a) * CARD('b)"
    8.40    unfolding UNIV_Times_UNIV [symmetric] by (simp only: card_cartesian_product)
    8.41 @@ -161,9 +161,9 @@
    8.42  lemma card_literal: "CARD(String.literal) = 0"
    8.43  by(simp add: card_eq_0_iff infinite_literal)
    8.44  
    8.45 -subsection {* Classes with at least 1 and 2  *}
    8.46 +subsection \<open>Classes with at least 1 and 2\<close>
    8.47  
    8.48 -text {* Class finite already captures "at least 1" *}
    8.49 +text \<open>Class finite already captures "at least 1"\<close>
    8.50  
    8.51  lemma zero_less_card_finite [simp]: "0 < CARD('a::finite)"
    8.52    unfolding neq0_conv [symmetric] by simp
    8.53 @@ -171,7 +171,7 @@
    8.54  lemma one_le_card_finite [simp]: "Suc 0 \<le> CARD('a::finite)"
    8.55    by (simp add: less_Suc_eq_le [symmetric])
    8.56  
    8.57 -text {* Class for cardinality "at least 2" *}
    8.58 +text \<open>Class for cardinality "at least 2"\<close>
    8.59  
    8.60  class card2 = finite + 
    8.61    assumes two_le_card: "2 \<le> CARD('a)"
    8.62 @@ -183,7 +183,7 @@
    8.63    using one_less_card [where 'a='a] by simp
    8.64  
    8.65  
    8.66 -subsection {* A type class for deciding finiteness of types *}
    8.67 +subsection \<open>A type class for deciding finiteness of types\<close>
    8.68  
    8.69  type_synonym 'a finite_UNIV = "('a, bool) phantom"
    8.70  
    8.71 @@ -196,7 +196,7 @@
    8.72    \<longleftrightarrow> of_phantom (finite_UNIV :: 'a finite_UNIV)"
    8.73  by(simp add: finite_UNIV)
    8.74  
    8.75 -subsection {* A type class for computing the cardinality of types *}
    8.76 +subsection \<open>A type class for computing the cardinality of types\<close>
    8.77  
    8.78  definition is_list_UNIV :: "'a list \<Rightarrow> bool"
    8.79  where "is_list_UNIV xs = (let c = CARD('a) in if c = 0 then False else size (remdups xs) = c)"
    8.80 @@ -211,7 +211,7 @@
    8.81    fixes card_UNIV :: "'a card_UNIV"
    8.82    assumes card_UNIV: "card_UNIV = Phantom('a) CARD('a)"
    8.83  
    8.84 -subsection {* Instantiations for @{text "card_UNIV"} *}
    8.85 +subsection \<open>Instantiations for @{text "card_UNIV"}\<close>
    8.86  
    8.87  instantiation nat :: card_UNIV begin
    8.88  definition "finite_UNIV = Phantom(nat) False"
    8.89 @@ -396,9 +396,9 @@
    8.90    by intro_classes (simp_all add: UNIV_finite_5 card_UNIV_finite_5_def finite_UNIV_finite_5_def)
    8.91  end
    8.92  
    8.93 -subsection {* Code setup for sets *}
    8.94 +subsection \<open>Code setup for sets\<close>
    8.95  
    8.96 -text {*
    8.97 +text \<open>
    8.98    Implement @{term "CARD('a)"} via @{term card_UNIV} and provide
    8.99    implementations for @{term "finite"}, @{term "card"}, @{term "op \<subseteq>"}, 
   8.100    and @{term "op ="}if the calling context already provides @{class finite_UNIV}
   8.101 @@ -406,7 +406,7 @@
   8.102    always via @{term card_UNIV}, we would require instances of essentially all 
   8.103    element types, i.e., a lot of instantiation proofs and -- at run time --
   8.104    possibly slow dictionary constructions.
   8.105 -*}
   8.106 +\<close>
   8.107  
   8.108  definition card_UNIV' :: "'a card_UNIV"
   8.109  where [code del]: "card_UNIV' = Phantom('a) CARD('a)"
   8.110 @@ -491,13 +491,13 @@
   8.111  
   8.112  end
   8.113  
   8.114 -text {* 
   8.115 +text \<open>
   8.116    Provide more informative exceptions than Match for non-rewritten cases.
   8.117    If generated code raises one these exceptions, then a code equation calls
   8.118    the mentioned operator for an element type that is not an instance of
   8.119    @{class card_UNIV} and is therefore not implemented via @{term card_UNIV}.
   8.120    Constrain the element type with sort @{class card_UNIV} to change this.
   8.121 -*}
   8.122 +\<close>
   8.123  
   8.124  lemma card_coset_error [code]:
   8.125    "card (List.coset xs) = 
     9.1 --- a/src/HOL/Library/Char_ord.thy	Wed Jun 17 10:57:11 2015 +0200
     9.2 +++ b/src/HOL/Library/Char_ord.thy	Wed Jun 17 11:03:05 2015 +0200
     9.3 @@ -2,7 +2,7 @@
     9.4      Author:     Norbert Voelker, Florian Haftmann
     9.5  *)
     9.6  
     9.7 -section {* Order on characters *}
     9.8 +section \<open>Order on characters\<close>
     9.9  
    9.10  theory Char_ord
    9.11  imports Main
    9.12 @@ -123,7 +123,7 @@
    9.13  lifting_update literal.lifting
    9.14  lifting_forget literal.lifting
    9.15  
    9.16 -text {* Legacy aliasses *}
    9.17 +text \<open>Legacy aliasses\<close>
    9.18  
    9.19  lemmas nibble_less_eq_def = less_eq_nibble_def
    9.20  lemmas nibble_less_def = less_nibble_def
    10.1 --- a/src/HOL/Library/Code_Abstract_Nat.thy	Wed Jun 17 10:57:11 2015 +0200
    10.2 +++ b/src/HOL/Library/Code_Abstract_Nat.thy	Wed Jun 17 11:03:05 2015 +0200
    10.3 @@ -2,41 +2,41 @@
    10.4      Author:     Stefan Berghofer, Florian Haftmann, TU Muenchen
    10.5  *)
    10.6  
    10.7 -section {* Avoidance of pattern matching on natural numbers *}
    10.8 +section \<open>Avoidance of pattern matching on natural numbers\<close>
    10.9  
   10.10  theory Code_Abstract_Nat
   10.11  imports Main
   10.12  begin
   10.13  
   10.14 -text {*
   10.15 +text \<open>
   10.16    When natural numbers are implemented in another than the
   10.17    conventional inductive @{term "0::nat"}/@{term Suc} representation,
   10.18    it is necessary to avoid all pattern matching on natural numbers
   10.19    altogether.  This is accomplished by this theory (up to a certain
   10.20    extent).
   10.21 -*}
   10.22 +\<close>
   10.23  
   10.24 -subsection {* Case analysis *}
   10.25 +subsection \<open>Case analysis\<close>
   10.26  
   10.27 -text {*
   10.28 +text \<open>
   10.29    Case analysis on natural numbers is rephrased using a conditional
   10.30    expression:
   10.31 -*}
   10.32 +\<close>
   10.33  
   10.34  lemma [code, code_unfold]:
   10.35    "case_nat = (\<lambda>f g n. if n = 0 then f else g (n - 1))"
   10.36    by (auto simp add: fun_eq_iff dest!: gr0_implies_Suc)
   10.37  
   10.38  
   10.39 -subsection {* Preprocessors *}
   10.40 +subsection \<open>Preprocessors\<close>
   10.41  
   10.42 -text {*
   10.43 +text \<open>
   10.44    The term @{term "Suc n"} is no longer a valid pattern.  Therefore,
   10.45    all occurrences of this term in a position where a pattern is
   10.46    expected (i.e.~on the left-hand side of a code equation) must be
   10.47    eliminated.  This can be accomplished -- as far as possible -- by
   10.48    applying the following transformation rule:
   10.49 -*}
   10.50 +\<close>
   10.51  
   10.52  lemma Suc_if_eq:
   10.53    assumes "\<And>n. f (Suc n) \<equiv> h n"
   10.54 @@ -44,12 +44,12 @@
   10.55    shows "f n \<equiv> if n = 0 then g else h (n - 1)"
   10.56    by (rule eq_reflection) (cases n, insert assms, simp_all)
   10.57  
   10.58 -text {*
   10.59 +text \<open>
   10.60    The rule above is built into a preprocessor that is plugged into
   10.61    the code generator.
   10.62 -*}
   10.63 +\<close>
   10.64  
   10.65 -setup {*
   10.66 +setup \<open>
   10.67  let
   10.68  
   10.69  val Suc_if_eq = Thm.incr_indexes 1 @{thm Suc_if_eq};
   10.70 @@ -111,6 +111,6 @@
   10.71    Code_Preproc.add_functrans ("eqn_Suc", eqn_suc_preproc)
   10.72  
   10.73  end;
   10.74 -*}
   10.75 +\<close>
   10.76  
   10.77  end
    11.1 --- a/src/HOL/Library/Code_Binary_Nat.thy	Wed Jun 17 10:57:11 2015 +0200
    11.2 +++ b/src/HOL/Library/Code_Binary_Nat.thy	Wed Jun 17 11:03:05 2015 +0200
    11.3 @@ -2,22 +2,22 @@
    11.4      Author:     Florian Haftmann, TU Muenchen
    11.5  *)
    11.6  
    11.7 -section {* Implementation of natural numbers as binary numerals *}
    11.8 +section \<open>Implementation of natural numbers as binary numerals\<close>
    11.9  
   11.10  theory Code_Binary_Nat
   11.11  imports Code_Abstract_Nat
   11.12  begin
   11.13  
   11.14 -text {*
   11.15 +text \<open>
   11.16    When generating code for functions on natural numbers, the
   11.17    canonical representation using @{term "0::nat"} and
   11.18    @{term Suc} is unsuitable for computations involving large
   11.19    numbers.  This theory refines the representation of
   11.20    natural numbers for code generation to use binary
   11.21    numerals, which do not grow linear in size but logarithmic.
   11.22 -*}
   11.23 +\<close>
   11.24  
   11.25 -subsection {* Representation *}
   11.26 +subsection \<open>Representation\<close>
   11.27  
   11.28  code_datatype "0::nat" nat_of_num
   11.29  
   11.30 @@ -38,7 +38,7 @@
   11.31    by simp
   11.32  
   11.33  
   11.34 -subsection {* Basic arithmetic *}
   11.35 +subsection \<open>Basic arithmetic\<close>
   11.36  
   11.37  lemma [code, code del]:
   11.38    "(plus :: nat \<Rightarrow> _) = plus" ..
   11.39 @@ -49,7 +49,7 @@
   11.40    "0 + n = (n::nat)"
   11.41    by (simp_all add: nat_of_num_numeral)
   11.42  
   11.43 -text {* Bounded subtraction needs some auxiliary *}
   11.44 +text \<open>Bounded subtraction needs some auxiliary\<close>
   11.45  
   11.46  definition dup :: "nat \<Rightarrow> nat" where
   11.47    "dup n = n + n"
   11.48 @@ -140,7 +140,7 @@
   11.49    by (simp_all add: prod_eq_iff nat_of_num_numeral del: div_nat_numeral mod_nat_numeral)
   11.50  
   11.51  
   11.52 -subsection {* Conversions *}
   11.53 +subsection \<open>Conversions\<close>
   11.54  
   11.55  lemma [code, code del]:
   11.56    "of_nat = of_nat" ..
    12.1 --- a/src/HOL/Library/Code_Char.thy	Wed Jun 17 10:57:11 2015 +0200
    12.2 +++ b/src/HOL/Library/Code_Char.thy	Wed Jun 17 11:03:05 2015 +0200
    12.3 @@ -2,7 +2,7 @@
    12.4      Author:     Florian Haftmann
    12.5  *)
    12.6  
    12.7 -section {* Code generation of pretty characters (and strings) *}
    12.8 +section \<open>Code generation of pretty characters (and strings)\<close>
    12.9  
   12.10  theory Code_Char
   12.11  imports Main Char_ord
   12.12 @@ -15,10 +15,10 @@
   12.13      and (Haskell) "Prelude.Char"
   12.14      and (Scala) "Char"
   12.15  
   12.16 -setup {*
   12.17 +setup \<open>
   12.18    fold String_Code.add_literal_char ["SML", "OCaml", "Haskell", "Scala"] 
   12.19    #> String_Code.add_literal_list_string "Haskell"
   12.20 -*}
   12.21 +\<close>
   12.22  
   12.23  code_printing
   12.24    class_instance char :: equal \<rightharpoonup>
   12.25 @@ -107,9 +107,9 @@
   12.26  |  constant "Orderings.less_eq :: String.literal \<Rightarrow> String.literal \<Rightarrow> bool" \<rightharpoonup>
   12.27      (SML) "!((_ : string) <= _)"
   12.28      and (OCaml) "!((_ : string) <= _)"
   12.29 -    -- {* Order operations for @{typ String.literal} work in Haskell only 
   12.30 +    -- \<open>Order operations for @{typ String.literal} work in Haskell only 
   12.31            if no type class instance needs to be generated, because String = [Char] in Haskell
   12.32 -          and @{typ "char list"} need not have the same order as @{typ String.literal}. *}
   12.33 +          and @{typ "char list"} need not have the same order as @{typ String.literal}.\<close>
   12.34      and (Haskell) infix 4 "<="
   12.35      and (Scala) infixl 4 "<="
   12.36      and (Eval) infixl 6 "<="
    13.1 --- a/src/HOL/Library/Code_Prolog.thy	Wed Jun 17 10:57:11 2015 +0200
    13.2 +++ b/src/HOL/Library/Code_Prolog.thy	Wed Jun 17 11:03:05 2015 +0200
    13.3 @@ -2,7 +2,7 @@
    13.4      Author:     Lukas Bulwahn, TUM 2010
    13.5  *)
    13.6  
    13.7 -section {* Code generation of prolog programs *}
    13.8 +section \<open>Code generation of prolog programs\<close>
    13.9  
   13.10  theory Code_Prolog
   13.11  imports Main
   13.12 @@ -11,10 +11,10 @@
   13.13  
   13.14  ML_file "~~/src/HOL/Tools/Predicate_Compile/code_prolog.ML"
   13.15  
   13.16 -section {* Setup for Numerals *}
   13.17 +section \<open>Setup for Numerals\<close>
   13.18  
   13.19 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name numeral}] *}
   13.20 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name numeral}]\<close>
   13.21  
   13.22 -setup {* Predicate_Compile_Data.keep_functions [@{const_name numeral}] *}
   13.23 +setup \<open>Predicate_Compile_Data.keep_functions [@{const_name numeral}]\<close>
   13.24  
   13.25  end
    14.1 --- a/src/HOL/Library/Code_Real_Approx_By_Float.thy	Wed Jun 17 10:57:11 2015 +0200
    14.2 +++ b/src/HOL/Library/Code_Real_Approx_By_Float.thy	Wed Jun 17 11:03:05 2015 +0200
    14.3 @@ -4,7 +4,7 @@
    14.4  imports Complex_Main Code_Target_Int
    14.5  begin
    14.6  
    14.7 -text{* \textbf{WARNING} This theory implements mathematical reals by machine
    14.8 +text\<open>\textbf{WARNING} This theory implements mathematical reals by machine
    14.9  reals (floats). This is inconsistent. See the proof of False at the end of
   14.10  the theory, where an equality on mathematical reals is (incorrectly)
   14.11  disproved by mapping it to machine reals.
   14.12 @@ -12,7 +12,7 @@
   14.13  The value command cannot display real results yet.
   14.14  
   14.15  The only legitimate use of this theory is as a tool for code generation
   14.16 -purposes. *}
   14.17 +purposes.\<close>
   14.18  
   14.19  code_printing
   14.20    type_constructor real \<rightharpoonup>
    15.1 --- a/src/HOL/Library/Code_Target_Int.thy	Wed Jun 17 10:57:11 2015 +0200
    15.2 +++ b/src/HOL/Library/Code_Target_Int.thy	Wed Jun 17 11:03:05 2015 +0200
    15.3 @@ -2,7 +2,7 @@
    15.4      Author:     Florian Haftmann, TU Muenchen
    15.5  *)
    15.6  
    15.7 -section {* Implementation of integer numbers by target-language integers *}
    15.8 +section \<open>Implementation of integer numbers by target-language integers\<close>
    15.9  
   15.10  theory Code_Target_Int
   15.11  imports Main
    16.1 --- a/src/HOL/Library/Code_Target_Nat.thy	Wed Jun 17 10:57:11 2015 +0200
    16.2 +++ b/src/HOL/Library/Code_Target_Nat.thy	Wed Jun 17 11:03:05 2015 +0200
    16.3 @@ -2,13 +2,13 @@
    16.4      Author:     Florian Haftmann, TU Muenchen
    16.5  *)
    16.6  
    16.7 -section {* Implementation of natural numbers by target-language integers *}
    16.8 +section \<open>Implementation of natural numbers by target-language integers\<close>
    16.9  
   16.10  theory Code_Target_Nat
   16.11  imports Code_Abstract_Nat
   16.12  begin
   16.13  
   16.14 -subsection {* Implementation for @{typ nat} *}
   16.15 +subsection \<open>Implementation for @{typ nat}\<close>
   16.16  
   16.17  context
   16.18  includes natural.lifting integer.lifting
   16.19 @@ -129,9 +129,9 @@
   16.20    including integer.lifting by transfer auto
   16.21  
   16.22  lemma term_of_nat_code [code]:
   16.23 -  -- {* Use @{term Code_Numeral.nat_of_integer} in term reconstruction
   16.24 +  -- \<open>Use @{term Code_Numeral.nat_of_integer} in term reconstruction
   16.25          instead of @{term Code_Target_Nat.Nat} such that reconstructed
   16.26 -        terms can be fed back to the code generator *}
   16.27 +        terms can be fed back to the code generator\<close>
   16.28    "term_of_class.term_of n =
   16.29     Code_Evaluation.App
   16.30       (Code_Evaluation.Const (STR ''Code_Numeral.nat_of_integer'')
    17.1 --- a/src/HOL/Library/Code_Target_Numeral.thy	Wed Jun 17 10:57:11 2015 +0200
    17.2 +++ b/src/HOL/Library/Code_Target_Numeral.thy	Wed Jun 17 11:03:05 2015 +0200
    17.3 @@ -2,7 +2,7 @@
    17.4      Author:     Florian Haftmann, TU Muenchen
    17.5  *)
    17.6  
    17.7 -section {* Implementation of natural and integer numbers by target-language integers *}
    17.8 +section \<open>Implementation of natural and integer numbers by target-language integers\<close>
    17.9  
   17.10  theory Code_Target_Numeral
   17.11  imports Code_Target_Int Code_Target_Nat
    18.1 --- a/src/HOL/Library/Code_Test.thy	Wed Jun 17 10:57:11 2015 +0200
    18.2 +++ b/src/HOL/Library/Code_Test.thy	Wed Jun 17 11:03:05 2015 +0200
    18.3 @@ -9,7 +9,7 @@
    18.4  keywords "test_code" :: diag
    18.5  begin
    18.6  
    18.7 -subsection {* YXML encoding for @{typ Code_Evaluation.term} *}
    18.8 +subsection \<open>YXML encoding for @{typ Code_Evaluation.term}\<close>
    18.9  
   18.10  datatype (plugins del: code size "quickcheck") yxml_of_term = YXML
   18.11  
   18.12 @@ -24,7 +24,7 @@
   18.13  definition yot_concat :: "yxml_of_term list \<Rightarrow> yxml_of_term"
   18.14    where [code del]: "yot_concat _ = YXML"
   18.15  
   18.16 -text {* Serialise @{typ yxml_of_term} to native string of target language *}
   18.17 +text \<open>Serialise @{typ yxml_of_term} to native string of target language\<close>
   18.18  
   18.19  code_printing type_constructor yxml_of_term
   18.20    \<rightharpoonup>  (SML) "string"
   18.21 @@ -52,11 +52,11 @@
   18.22    and (Haskell) "Prelude.concat"
   18.23    and (Scala) "_.mkString(\"\")"
   18.24  
   18.25 -text {*
   18.26 +text \<open>
   18.27    Stripped-down implementations of Isabelle's XML tree with YXML encoding
   18.28    as defined in @{file "~~/src/Pure/PIDE/xml.ML"}, @{file "~~/src/Pure/PIDE/yxml.ML"}
   18.29    sufficient to encode @{typ "Code_Evaluation.term"} as in @{file "~~/src/Pure/term_xml.ML"}.
   18.30 -*}
   18.31 +\<close>
   18.32  
   18.33  datatype (plugins del: code size "quickcheck") xml_tree = XML_Tree
   18.34  
   18.35 @@ -64,7 +64,7 @@
   18.36  by(cases x y rule: xml_tree.exhaust[case_product xml_tree.exhaust])(simp)
   18.37  
   18.38  context begin
   18.39 -local_setup {* Local_Theory.map_background_naming (Name_Space.mandatory_path "xml") *}
   18.40 +local_setup \<open>Local_Theory.map_background_naming (Name_Space.mandatory_path "xml")\<close>
   18.41  
   18.42  type_synonym attributes = "(String.literal \<times> String.literal) list"
   18.43  type_synonym body = "xml_tree list"
   18.44 @@ -112,10 +112,10 @@
   18.45  definition yxml_string_of_body :: "xml.body \<Rightarrow> yxml_of_term"
   18.46  where "yxml_string_of_body ts = foldr yxml_string_of_xml_tree ts yot_empty"
   18.47  
   18.48 -text {*
   18.49 +text \<open>
   18.50    Encoding @{typ Code_Evaluation.term} into XML trees
   18.51    as defined in @{file "~~/src/Pure/term_xml.ML"}
   18.52 -*}
   18.53 +\<close>
   18.54  
   18.55  definition xml_of_typ :: "Typerep.typerep \<Rightarrow> xml.body"
   18.56  where [code del]: "xml_of_typ _ = [XML_Tree]"
   18.57 @@ -131,17 +131,17 @@
   18.58    "xml_of_term (Code_Evaluation.Const x ty) = [xml.tagged (STR ''0'') (Some x) (xml_of_typ ty)]"
   18.59    "xml_of_term (Code_Evaluation.App t1 t2)  = [xml.tagged (STR ''5'') None [xml.node (xml_of_term t1), xml.node (xml_of_term t2)]]"
   18.60    "xml_of_term (Code_Evaluation.Abs x ty t) = [xml.tagged (STR ''4'') (Some x) [xml.node (xml_of_typ ty), xml.node (xml_of_term t)]]"
   18.61 -  -- {*
   18.62 +  -- \<open>
   18.63      FIXME: @{const Code_Evaluation.Free} is used only in @{theory Quickcheck_Narrowing} to represent
   18.64      uninstantiated parameters in constructors. Here, we always translate them to @{ML Free} variables.
   18.65 -  *}
   18.66 +\<close>
   18.67    "xml_of_term (Code_Evaluation.Free x ty)  = [xml.tagged (STR ''1'') (Some x) (xml_of_typ ty)]"
   18.68  by(simp_all add: xml_of_term_def xml_tree_anything)
   18.69  
   18.70  definition yxml_string_of_term :: "Code_Evaluation.term \<Rightarrow> yxml_of_term"
   18.71  where "yxml_string_of_term = yxml_string_of_body \<circ> xml_of_term"
   18.72  
   18.73 -subsection {* Test engine and drivers *}
   18.74 +subsection \<open>Test engine and drivers\<close>
   18.75  
   18.76  ML_file "code_test.ML"
   18.77  
    19.1 --- a/src/HOL/Library/ContNotDenum.thy	Wed Jun 17 10:57:11 2015 +0200
    19.2 +++ b/src/HOL/Library/ContNotDenum.thy	Wed Jun 17 11:03:05 2015 +0200
    19.3 @@ -3,15 +3,15 @@
    19.4      Author:     Johannes Hölzl, TU München
    19.5  *)
    19.6  
    19.7 -section {* Non-denumerability of the Continuum. *}
    19.8 +section \<open>Non-denumerability of the Continuum.\<close>
    19.9  
   19.10  theory ContNotDenum
   19.11  imports Complex_Main Countable_Set
   19.12  begin
   19.13  
   19.14 -subsection {* Abstract *}
   19.15 +subsection \<open>Abstract\<close>
   19.16  
   19.17 -text {* The following document presents a proof that the Continuum is
   19.18 +text \<open>The following document presents a proof that the Continuum is
   19.19  uncountable. It is formalised in the Isabelle/Isar theorem proving
   19.20  system.
   19.21  
   19.22 @@ -28,14 +28,14 @@
   19.23  closed intervals (where each successive interval is a subset of the
   19.24  last) is non-empty. We then assume a surjective function @{text
   19.25  "f: \<nat> \<Rightarrow> \<real>"} exists and find a real x such that x is not in the range of f
   19.26 -by generating a sequence of closed intervals then using the NIP. *}
   19.27 +by generating a sequence of closed intervals then using the NIP.\<close>
   19.28  
   19.29  theorem real_non_denum: "\<not> (\<exists>f :: nat \<Rightarrow> real. surj f)"
   19.30  proof
   19.31    assume "\<exists>f::nat \<Rightarrow> real. surj f"
   19.32    then obtain f :: "nat \<Rightarrow> real" where "surj f" ..
   19.33  
   19.34 -  txt {* First we construct a sequence of nested intervals, ignoring @{term "range f"}. *}
   19.35 +  txt \<open>First we construct a sequence of nested intervals, ignoring @{term "range f"}.\<close>
   19.36  
   19.37    have "\<forall>a b c::real. a < b \<longrightarrow> (\<exists>ka kb. ka < kb \<and> {ka..kb} \<subseteq> {a..b} \<and> c \<notin> {ka..kb})"
   19.38      using assms
   19.39 @@ -55,7 +55,7 @@
   19.40      "\<And>n. ivl (Suc n) = (i (fst (ivl n)) (snd (ivl n)) (f n), j (fst (ivl n)) (snd (ivl n)) (f n))"
   19.41      unfolding ivl_def by simp_all
   19.42  
   19.43 -  txt {* This is a decreasing sequence of non-empty intervals. *}
   19.44 +  txt \<open>This is a decreasing sequence of non-empty intervals.\<close>
   19.45  
   19.46    { fix n have "fst (ivl n) < snd (ivl n)"
   19.47        by (induct n) (auto intro!: ij) }
   19.48 @@ -64,7 +64,7 @@
   19.49    have "decseq I"
   19.50      unfolding I_def decseq_Suc_iff ivl fst_conv snd_conv by (intro ij allI less)
   19.51  
   19.52 -  txt {* Now we apply the finite intersection property of compact sets. *}
   19.53 +  txt \<open>Now we apply the finite intersection property of compact sets.\<close>
   19.54  
   19.55    have "I 0 \<inter> (\<Inter>i. I i) \<noteq> {}"
   19.56    proof (rule compact_imp_fip_image)
   19.57 @@ -72,7 +72,7 @@
   19.58      have "{} \<subset> I (Max (insert 0 S))"
   19.59        unfolding I_def using less[of "Max (insert 0 S)"] by auto
   19.60      also have "I (Max (insert 0 S)) \<subseteq> (\<Inter>i\<in>insert 0 S. I i)"
   19.61 -      using fin decseqD[OF `decseq I`, of _ "Max (insert 0 S)"] by (auto simp: Max_ge_iff)
   19.62 +      using fin decseqD[OF \<open>decseq I\<close>, of _ "Max (insert 0 S)"] by (auto simp: Max_ge_iff)
   19.63      also have "(\<Inter>i\<in>insert 0 S. I i) = I 0 \<inter> (\<Inter>i\<in>S. I i)"
   19.64        by auto
   19.65      finally show "I 0 \<inter> (\<Inter>i\<in>S. I i) \<noteq> {}"
   19.66 @@ -80,7 +80,7 @@
   19.67    qed (auto simp: I_def)
   19.68    then obtain x where "\<And>n. x \<in> I n"
   19.69      by blast
   19.70 -  moreover from `surj f` obtain j where "x = f j"
   19.71 +  moreover from \<open>surj f\<close> obtain j where "x = f j"
   19.72      by blast
   19.73    ultimately have "f j \<in> I (Suc j)"
   19.74      by blast
   19.75 @@ -124,7 +124,7 @@
   19.76    show "uncountable {a<..<b}"
   19.77    proof -
   19.78      obtain f where "bij_betw f {a <..< b} {-pi/2<..<pi/2}"
   19.79 -      using bij_betw_open_intervals[OF `a < b`, of "-pi/2" "pi/2"] by auto
   19.80 +      using bij_betw_open_intervals[OF \<open>a < b\<close>, of "-pi/2" "pi/2"] by auto
   19.81      then show ?thesis
   19.82        by (metis bij_betw_tan uncountable_bij_betw uncountable_UNIV_real)
   19.83    qed
    20.1 --- a/src/HOL/Library/Countable.thy	Wed Jun 17 10:57:11 2015 +0200
    20.2 +++ b/src/HOL/Library/Countable.thy	Wed Jun 17 11:03:05 2015 +0200
    20.3 @@ -4,13 +4,13 @@
    20.4      Author:     Jasmin Blanchette, TU Muenchen
    20.5  *)
    20.6  
    20.7 -section {* Encoding (almost) everything into natural numbers *}
    20.8 +section \<open>Encoding (almost) everything into natural numbers\<close>
    20.9  
   20.10  theory Countable
   20.11  imports Old_Datatype Rat Nat_Bijection
   20.12  begin
   20.13  
   20.14 -subsection {* The class of countable types *}
   20.15 +subsection \<open>The class of countable types\<close>
   20.16  
   20.17  class countable =
   20.18    assumes ex_inj: "\<exists>to_nat \<Colon> 'a \<Rightarrow> nat. inj to_nat"
   20.19 @@ -25,7 +25,7 @@
   20.20  qed
   20.21  
   20.22  
   20.23 -subsection {* Conversion functions *}
   20.24 +subsection \<open>Conversion functions\<close>
   20.25  
   20.26  definition to_nat :: "'a\<Colon>countable \<Rightarrow> nat" where
   20.27    "to_nat = (SOME f. inj f)"
   20.28 @@ -50,7 +50,7 @@
   20.29    by (simp add: from_nat_def)
   20.30  
   20.31  
   20.32 -subsection {* Finite types are countable *}
   20.33 +subsection \<open>Finite types are countable\<close>
   20.34  
   20.35  subclass (in finite) countable
   20.36  proof
   20.37 @@ -64,7 +64,7 @@
   20.38  qed
   20.39  
   20.40  
   20.41 -subsection {* Automatically proving countability of old-style datatypes *}
   20.42 +subsection \<open>Automatically proving countability of old-style datatypes\<close>
   20.43  
   20.44  inductive finite_item :: "'a Old_Datatype.item \<Rightarrow> bool" where
   20.45    undefined: "finite_item undefined"
   20.46 @@ -160,7 +160,7 @@
   20.47      by - (rule exI)
   20.48  qed
   20.49  
   20.50 -ML {*
   20.51 +ML \<open>
   20.52    fun old_countable_datatype_tac ctxt =
   20.53      SUBGOAL (fn (goal, _) =>
   20.54        let
   20.55 @@ -191,16 +191,16 @@
   20.56             etac induct_thm' i,
   20.57             REPEAT (resolve_tac ctxt rules i ORELSE atac i)]) 1
   20.58        end)
   20.59 -*}
   20.60 +\<close>
   20.61  
   20.62  hide_const (open) finite_item nth_item
   20.63  
   20.64  
   20.65 -subsection {* Automatically proving countability of datatypes *}
   20.66 +subsection \<open>Automatically proving countability of datatypes\<close>
   20.67  
   20.68  ML_file "bnf_lfp_countable.ML"
   20.69  
   20.70 -ML {*
   20.71 +ML \<open>
   20.72  fun countable_datatype_tac ctxt st =
   20.73    (case try (fn () => HEADGOAL (old_countable_datatype_tac ctxt) st) () of
   20.74      SOME res => res
   20.75 @@ -209,54 +209,54 @@
   20.76  (* compatibility *)
   20.77  fun countable_tac ctxt =
   20.78    SELECT_GOAL (countable_datatype_tac ctxt);
   20.79 -*}
   20.80 +\<close>
   20.81  
   20.82 -method_setup countable_datatype = {*
   20.83 +method_setup countable_datatype = \<open>
   20.84    Scan.succeed (SIMPLE_METHOD o countable_datatype_tac)
   20.85 -*} "prove countable class instances for datatypes"
   20.86 +\<close> "prove countable class instances for datatypes"
   20.87  
   20.88  
   20.89 -subsection {* More Countable types *}
   20.90 +subsection \<open>More Countable types\<close>
   20.91  
   20.92 -text {* Naturals *}
   20.93 +text \<open>Naturals\<close>
   20.94  
   20.95  instance nat :: countable
   20.96    by (rule countable_classI [of "id"]) simp
   20.97  
   20.98 -text {* Pairs *}
   20.99 +text \<open>Pairs\<close>
  20.100  
  20.101  instance prod :: (countable, countable) countable
  20.102    by (rule countable_classI [of "\<lambda>(x, y). prod_encode (to_nat x, to_nat y)"])
  20.103      (auto simp add: prod_encode_eq)
  20.104  
  20.105 -text {* Sums *}
  20.106 +text \<open>Sums\<close>
  20.107  
  20.108  instance sum :: (countable, countable) countable
  20.109    by (rule countable_classI [of "(\<lambda>x. case x of Inl a \<Rightarrow> to_nat (False, to_nat a)
  20.110                                       | Inr b \<Rightarrow> to_nat (True, to_nat b))"])
  20.111      (simp split: sum.split_asm)
  20.112  
  20.113 -text {* Integers *}
  20.114 +text \<open>Integers\<close>
  20.115  
  20.116  instance int :: countable
  20.117    by (rule countable_classI [of int_encode]) (simp add: int_encode_eq)
  20.118  
  20.119 -text {* Options *}
  20.120 +text \<open>Options\<close>
  20.121  
  20.122  instance option :: (countable) countable
  20.123    by countable_datatype
  20.124  
  20.125 -text {* Lists *}
  20.126 +text \<open>Lists\<close>
  20.127  
  20.128  instance list :: (countable) countable
  20.129    by countable_datatype
  20.130  
  20.131 -text {* String literals *}
  20.132 +text \<open>String literals\<close>
  20.133  
  20.134  instance String.literal :: countable
  20.135    by (rule countable_classI [of "to_nat \<circ> String.explode"]) (auto simp add: explode_inject)
  20.136  
  20.137 -text {* Functions *}
  20.138 +text \<open>Functions\<close>
  20.139  
  20.140  instance "fun" :: (finite, countable) countable
  20.141  proof
  20.142 @@ -269,13 +269,13 @@
  20.143    qed
  20.144  qed
  20.145  
  20.146 -text {* Typereps *}
  20.147 +text \<open>Typereps\<close>
  20.148  
  20.149  instance typerep :: countable
  20.150    by countable_datatype
  20.151  
  20.152  
  20.153 -subsection {* The rationals are countably infinite *}
  20.154 +subsection \<open>The rationals are countably infinite\<close>
  20.155  
  20.156  definition nat_to_rat_surj :: "nat \<Rightarrow> rat" where
  20.157    "nat_to_rat_surj n = (let (a, b) = prod_decode n in Fract (int_decode a) (int_decode b))"
    21.1 --- a/src/HOL/Library/Countable_Set.thy	Wed Jun 17 10:57:11 2015 +0200
    21.2 +++ b/src/HOL/Library/Countable_Set.thy	Wed Jun 17 11:03:05 2015 +0200
    21.3 @@ -3,13 +3,13 @@
    21.4      Author:     Andrei Popescu
    21.5  *)
    21.6  
    21.7 -section {* Countable sets *}
    21.8 +section \<open>Countable sets\<close>
    21.9  
   21.10  theory Countable_Set
   21.11  imports Countable Infinite_Set
   21.12  begin
   21.13  
   21.14 -subsection {* Predicate for countable sets *}
   21.15 +subsection \<open>Predicate for countable sets\<close>
   21.16  
   21.17  definition countable :: "'a set \<Rightarrow> bool" where
   21.18    "countable S \<longleftrightarrow> (\<exists>f::'a \<Rightarrow> nat. inj_on f S)"
   21.19 @@ -49,18 +49,18 @@
   21.20  lemma countableI_type[intro, simp]: "countable (A:: 'a :: countable set)"
   21.21    using countableI[of to_nat A] by auto
   21.22  
   21.23 -subsection {* Enumerate a countable set *}
   21.24 +subsection \<open>Enumerate a countable set\<close>
   21.25  
   21.26  lemma countableE_infinite:
   21.27    assumes "countable S" "infinite S"
   21.28    obtains e :: "'a \<Rightarrow> nat" where "bij_betw e S UNIV"
   21.29  proof -
   21.30    obtain f :: "'a \<Rightarrow> nat" where "inj_on f S"
   21.31 -    using `countable S` by (rule countableE)
   21.32 +    using \<open>countable S\<close> by (rule countableE)
   21.33    then have "bij_betw f S (f`S)"
   21.34      unfolding bij_betw_def by simp
   21.35    moreover
   21.36 -  from `inj_on f S` `infinite S` have inf_fS: "infinite (f`S)"
   21.37 +  from \<open>inj_on f S\<close> \<open>infinite S\<close> have inf_fS: "infinite (f`S)"
   21.38      by (auto dest: finite_imageD)
   21.39    then have "bij_betw (the_inv_into UNIV (enumerate (f`S))) (f`S) UNIV"
   21.40      by (intro bij_betw_the_inv_into bij_enumerate)
   21.41 @@ -73,7 +73,7 @@
   21.42    assumes "countable S"
   21.43    obtains (finite) f :: "'a \<Rightarrow> nat" where "finite S" "bij_betw f S {..<card S}"
   21.44          | (infinite) f :: "'a \<Rightarrow> nat" where "infinite S" "bij_betw f S UNIV"
   21.45 -  using ex_bij_betw_finite_nat[of S] countableE_infinite `countable S`
   21.46 +  using ex_bij_betw_finite_nat[of S] countableE_infinite \<open>countable S\<close>
   21.47    by (cases "finite S") (auto simp add: atLeast0LessThan)
   21.48  
   21.49  definition to_nat_on :: "'a set \<Rightarrow> 'a \<Rightarrow> nat" where
   21.50 @@ -164,7 +164,7 @@
   21.51  lemma inj_on_from_nat_into: "inj_on from_nat_into ({A. A \<noteq> {} \<and> countable A})"
   21.52    unfolding inj_on_def by auto
   21.53  
   21.54 -subsection {* Closure properties of countability *}
   21.55 +subsection \<open>Closure properties of countability\<close>
   21.56  
   21.57  lemma countable_SIGMA[intro, simp]:
   21.58    "countable I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> countable (A i)) \<Longrightarrow> countable (SIGMA i : I. A i)"
   21.59 @@ -292,7 +292,7 @@
   21.60  lemma countable_set_option [simp]: "countable (set_option x)"
   21.61  by(cases x) auto
   21.62  
   21.63 -subsection {* Misc lemmas *}
   21.64 +subsection \<open>Misc lemmas\<close>
   21.65  
   21.66  lemma countable_all:
   21.67    assumes S: "countable S"
   21.68 @@ -306,13 +306,13 @@
   21.69      apply (auto simp: image_iff Ball_def intro: from_nat_into split: split_if_asm)
   21.70    proof -
   21.71      fix x n assume "x \<in> X" "\<forall>i m. m \<le> i \<longrightarrow> x \<noteq> from_nat_into X m"
   21.72 -    with from_nat_into_surj[OF `countable X` `x \<in> X`]
   21.73 +    with from_nat_into_surj[OF \<open>countable X\<close> \<open>x \<in> X\<close>]
   21.74      show False
   21.75        by auto
   21.76    qed
   21.77  qed
   21.78  
   21.79 -subsection {* Uncountable *}
   21.80 +subsection \<open>Uncountable\<close>
   21.81  
   21.82  abbreviation uncountable where
   21.83    "uncountable A \<equiv> \<not> countable A"
    22.1 --- a/src/HOL/Library/Countable_Set_Type.thy	Wed Jun 17 10:57:11 2015 +0200
    22.2 +++ b/src/HOL/Library/Countable_Set_Type.thy	Wed Jun 17 11:03:05 2015 +0200
    22.3 @@ -6,14 +6,14 @@
    22.4  Type of (at most) countable sets.
    22.5  *)
    22.6  
    22.7 -section {* Type of (at Most) Countable Sets *}
    22.8 +section \<open>Type of (at Most) Countable Sets\<close>
    22.9  
   22.10  theory Countable_Set_Type
   22.11  imports Countable_Set Cardinal_Notations Conditionally_Complete_Lattices
   22.12  begin
   22.13  
   22.14  
   22.15 -subsection{* Cardinal stuff *}
   22.16 +subsection\<open>Cardinal stuff\<close>
   22.17  
   22.18  lemma countable_card_of_nat: "countable A \<longleftrightarrow> |A| \<le>o |UNIV::nat set|"
   22.19    unfolding countable_def card_of_ordLeq[symmetric] by auto
   22.20 @@ -54,7 +54,7 @@
   22.21  shows "countable A"
   22.22  using countable_ordLeq[OF ordLess_imp_ordLeq[OF AB] B] .
   22.23  
   22.24 -subsection {* The type of countable sets *}
   22.25 +subsection \<open>The type of countable sets\<close>
   22.26  
   22.27  typedef 'a cset = "{A :: 'a set. countable A}" morphisms rcset acset
   22.28    by (rule exI[of _ "{}"]) simp
   22.29 @@ -366,13 +366,13 @@
   22.30  lemmas cimage_cUN = image_UN[Transfer.transferred]
   22.31  lemmas cUN_csingleton [simp] = UN_singleton[Transfer.transferred]
   22.32  
   22.33 -subsection {* Additional lemmas*}
   22.34 +subsection \<open>Additional lemmas\<close>
   22.35  
   22.36 -subsubsection {* @{text cempty} *}
   22.37 +subsubsection \<open>@{text cempty}\<close>
   22.38  
   22.39  lemma cemptyE [elim!]: "cin a cempty \<Longrightarrow> P" by simp
   22.40  
   22.41 -subsubsection {* @{text cinsert} *}
   22.42 +subsubsection \<open>@{text cinsert}\<close>
   22.43  
   22.44  lemma countable_insert_iff: "countable (insert x A) \<longleftrightarrow> countable A"
   22.45  by (metis Diff_eq_empty_iff countable_empty countable_insert subset_insertI uncountable_minus_countable)
   22.46 @@ -385,12 +385,12 @@
   22.47  lemma mk_disjoint_cinsert: "cin a A \<Longrightarrow> \<exists>B. A = cinsert a B \<and> \<not> cin a B"
   22.48    by (rule exI[where x = "cDiff A (csingle a)"]) blast
   22.49  
   22.50 -subsubsection {* @{text cimage} *}
   22.51 +subsubsection \<open>@{text cimage}\<close>
   22.52  
   22.53  lemma subset_cimage_iff: "csubset_eq B (cimage f A) \<longleftrightarrow> (\<exists>AA. csubset_eq AA A \<and> B = cimage f AA)"
   22.54  by transfer (metis countable_subset image_mono mem_Collect_eq subset_imageE) 
   22.55  
   22.56 -subsubsection {* bounded quantification *}
   22.57 +subsubsection \<open>bounded quantification\<close>
   22.58  
   22.59  lemma cBex_simps [simp, no_atp]:
   22.60    "\<And>A P Q. cBex A (\<lambda>x. P x \<and> Q) = (cBex A P \<and> Q)" 
   22.61 @@ -418,15 +418,15 @@
   22.62  apply (rule equal_intr_rule)
   22.63  by (transfer, simp)+
   22.64  
   22.65 -subsubsection {* @{const cUnion} *}
   22.66 +subsubsection \<open>@{const cUnion}\<close>
   22.67  
   22.68  lemma cUNION_cimage: "cUNION (cimage f A) g = cUNION A (g \<circ> f)"
   22.69  including cset.lifting by transfer auto
   22.70  
   22.71  
   22.72 -subsection {* Setup for Lifting/Transfer *}
   22.73 +subsection \<open>Setup for Lifting/Transfer\<close>
   22.74  
   22.75 -subsubsection {* Relator and predicator properties *}
   22.76 +subsubsection \<open>Relator and predicator properties\<close>
   22.77  
   22.78  lift_definition rel_cset :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a cset \<Rightarrow> 'b cset \<Rightarrow> bool"
   22.79    is rel_set parametric rel_set_transfer .
   22.80 @@ -451,9 +451,9 @@
   22.81  lemma rel_cset_csingle_iff [simp]: "rel_cset R (csingle x) (csingle y) \<longleftrightarrow> R x y"
   22.82  by transfer(auto simp add: rel_set_def)
   22.83  
   22.84 -subsubsection {* Transfer rules for the Transfer package *}
   22.85 +subsubsection \<open>Transfer rules for the Transfer package\<close>
   22.86  
   22.87 -text {* Unconditional transfer rules *}
   22.88 +text \<open>Unconditional transfer rules\<close>
   22.89  
   22.90  context begin interpretation lifting_syntax .
   22.91  
   22.92 @@ -489,7 +489,7 @@
   22.93    using rel_set_transfer[unfolded rel_fun_def, rule_format, Transfer.transferred, where A = A and B = B]
   22.94    by simp
   22.95  
   22.96 -text {* Rules requiring bi-unique, bi-total or right-total relations *}
   22.97 +text \<open>Rules requiring bi-unique, bi-total or right-total relations\<close>
   22.98  
   22.99  lemma cin_parametric [transfer_rule]:
  22.100    "bi_unique A \<Longrightarrow> (A ===> rel_cset A ===> op =) cin cin"
  22.101 @@ -516,7 +516,7 @@
  22.102  lifting_update cset.lifting
  22.103  lifting_forget cset.lifting
  22.104  
  22.105 -subsection {* Registration as BNF *}
  22.106 +subsection \<open>Registration as BNF\<close>
  22.107  
  22.108  lemma card_of_countable_sets_range:
  22.109  fixes A :: "'a set"
  22.110 @@ -568,8 +568,8 @@
  22.111    hence *: "rcset R' = ?L'" unfolding R'_def by (intro rcset_to_rcset)
  22.112    thus ?R unfolding Grp_def relcompp.simps conversep.simps including cset.lifting
  22.113    proof (intro CollectI case_prodI exI[of _ a] exI[of _ b] exI[of _ R'] conjI refl)
  22.114 -    from * `?L` show "a = cimage fst R'" by transfer (auto simp: image_def Collect_Int_Times)
  22.115 -    from * `?L` show "b = cimage snd R'" by transfer (auto simp: image_def Collect_Int_Times)
  22.116 +    from * \<open>?L\<close> show "a = cimage fst R'" by transfer (auto simp: image_def Collect_Int_Times)
  22.117 +    from * \<open>?L\<close> show "b = cimage snd R'" by transfer (auto simp: image_def Collect_Int_Times)
  22.118    qed simp_all
  22.119  next
  22.120    assume ?R thus ?L unfolding Grp_def relcompp.simps conversep.simps
    23.1 --- a/src/HOL/Library/Debug.thy	Wed Jun 17 10:57:11 2015 +0200
    23.2 +++ b/src/HOL/Library/Debug.thy	Wed Jun 17 11:03:05 2015 +0200
    23.3 @@ -1,6 +1,6 @@
    23.4  (* Author: Florian Haftmann, TU Muenchen *)
    23.5  
    23.6 -section {* Debugging facilities for code generated towards Isabelle/ML *}
    23.7 +section \<open>Debugging facilities for code generated towards Isabelle/ML\<close>
    23.8  
    23.9  theory Debug
   23.10  imports Main
   23.11 @@ -31,7 +31,7 @@
   23.12  
   23.13  code_printing
   23.14    constant trace \<rightharpoonup> (Eval) "Output.tracing"
   23.15 -| constant flush \<rightharpoonup> (Eval) "Output.tracing/ (@{make'_string} _)" -- {* note indirection via antiquotation *}
   23.16 +| constant flush \<rightharpoonup> (Eval) "Output.tracing/ (@{make'_string} _)" -- \<open>note indirection via antiquotation\<close>
   23.17  | constant timing \<rightharpoonup> (Eval) "Timing.timeap'_msg"
   23.18  
   23.19  code_reserved Eval Output Timing
    24.1 --- a/src/HOL/Library/Diagonal_Subsequence.thy	Wed Jun 17 10:57:11 2015 +0200
    24.2 +++ b/src/HOL/Library/Diagonal_Subsequence.thy	Wed Jun 17 11:03:05 2015 +0200
    24.3 @@ -1,6 +1,6 @@
    24.4  (* Author: Fabian Immler, TUM *)
    24.5  
    24.6 -section {* Sequence of Properties on Subsequences *}
    24.7 +section \<open>Sequence of Properties on Subsequences\<close>
    24.8  
    24.9  theory Diagonal_Subsequence
   24.10  imports Complex_Main
    25.1 --- a/src/HOL/Library/Discrete.thy	Wed Jun 17 10:57:11 2015 +0200
    25.2 +++ b/src/HOL/Library/Discrete.thy	Wed Jun 17 11:03:05 2015 +0200
    25.3 @@ -1,12 +1,12 @@
    25.4  (* Author: Florian Haftmann, TU Muenchen *)
    25.5  
    25.6 -section {* Common discrete functions *}
    25.7 +section \<open>Common discrete functions\<close>
    25.8  
    25.9  theory Discrete
   25.10  imports Main
   25.11  begin
   25.12  
   25.13 -subsection {* Discrete logarithm *}
   25.14 +subsection \<open>Discrete logarithm\<close>
   25.15  
   25.16  fun log :: "nat \<Rightarrow> nat"
   25.17    where [simp del]: "log n = (if n < 2 then 0 else Suc (log (n div 2)))"
   25.18 @@ -59,13 +59,13 @@
   25.19        with mn2 have n2_0: "n div 2 \<noteq> 0" by arith
   25.20        from False "1.hyps" mn2 have "log (m div 2) \<le> log (n div 2)" by blast
   25.21        with m2_0 n2_0 have "log (2 * (m div 2)) \<le> log (2 * (n div 2))" by simp
   25.22 -      with m2_0 n2_0 `m \<ge> 2` `n \<ge> 2` show ?thesis by (simp only: log_rec [of m] log_rec [of n]) simp
   25.23 +      with m2_0 n2_0 \<open>m \<ge> 2\<close> \<open>n \<ge> 2\<close> show ?thesis by (simp only: log_rec [of m] log_rec [of n]) simp
   25.24      qed
   25.25    qed
   25.26  qed
   25.27  
   25.28  
   25.29 -subsection {* Discrete square root *}
   25.30 +subsection \<open>Discrete square root\<close>
   25.31  
   25.32  definition sqrt :: "nat \<Rightarrow> nat"
   25.33    where "sqrt n = Max {m. m\<^sup>2 \<le> n}"
   25.34 @@ -111,7 +111,7 @@
   25.35    have *: "0 * 0 \<le> m" by simp
   25.36    assume "m \<le> n"
   25.37    then show "sqrt m \<le> sqrt n"
   25.38 -    by (auto intro!: Max_mono `0 * 0 \<le> m` finite_less_ub simp add: power2_eq_square sqrt_def)
   25.39 +    by (auto intro!: Max_mono \<open>0 * 0 \<le> m\<close> finite_less_ub simp add: power2_eq_square sqrt_def)
   25.40  qed
   25.41  
   25.42  lemma sqrt_greater_zero_iff [simp]: "sqrt n > 0 \<longleftrightarrow> n > 0"
   25.43 @@ -162,8 +162,8 @@
   25.44            apply (subst Max_le_iff)
   25.45            apply auto
   25.46            apply (metis (mono_tags) finite_imageI finite_less_ub le_square)
   25.47 -          apply (metis `q * q \<le> n`)
   25.48 -          apply (metis `q * q \<le> n` le_cases mult_le_mono1 mult_le_mono2 order_trans)
   25.49 +          apply (metis \<open>q * q \<le> n\<close>)
   25.50 +          apply (metis \<open>q * q \<le> n\<close> le_cases mult_le_mono1 mult_le_mono2 order_trans)
   25.51            done
   25.52        qed
   25.53      qed
    26.1 --- a/src/HOL/Library/Dlist.thy	Wed Jun 17 10:57:11 2015 +0200
    26.2 +++ b/src/HOL/Library/Dlist.thy	Wed Jun 17 11:03:05 2015 +0200
    26.3 @@ -1,12 +1,12 @@
    26.4  (* Author: Florian Haftmann, TU Muenchen *)
    26.5  
    26.6 -section {* Lists with elements distinct as canonical example for datatype invariants *}
    26.7 +section \<open>Lists with elements distinct as canonical example for datatype invariants\<close>
    26.8  
    26.9  theory Dlist
   26.10  imports Main
   26.11  begin
   26.12  
   26.13 -subsection {* The type of distinct lists *}
   26.14 +subsection \<open>The type of distinct lists\<close>
   26.15  
   26.16  typedef 'a dlist = "{xs::'a list. distinct xs}"
   26.17    morphisms list_of_dlist Abs_dlist
   26.18 @@ -22,7 +22,7 @@
   26.19    "list_of_dlist dxs = list_of_dlist dys \<Longrightarrow> dxs = dys"
   26.20    by (simp add: dlist_eq_iff)
   26.21  
   26.22 -text {* Formal, totalized constructor for @{typ "'a dlist"}: *}
   26.23 +text \<open>Formal, totalized constructor for @{typ "'a dlist"}:\<close>
   26.24  
   26.25  definition Dlist :: "'a list \<Rightarrow> 'a dlist" where
   26.26    "Dlist xs = Abs_dlist (remdups xs)"
   26.27 @@ -44,7 +44,7 @@
   26.28    by (simp add: Dlist_def list_of_dlist_inverse distinct_remdups_id)
   26.29  
   26.30  
   26.31 -text {* Fundamental operations: *}
   26.32 +text \<open>Fundamental operations:\<close>
   26.33  
   26.34  definition empty :: "'a dlist" where
   26.35    "empty = Dlist []"
   26.36 @@ -62,7 +62,7 @@
   26.37    "filter P dxs = Dlist (List.filter P (list_of_dlist dxs))"
   26.38  
   26.39  
   26.40 -text {* Derived operations: *}
   26.41 +text \<open>Derived operations:\<close>
   26.42  
   26.43  definition null :: "'a dlist \<Rightarrow> bool" where
   26.44    "null dxs = List.null (list_of_dlist dxs)"
   26.45 @@ -80,7 +80,7 @@
   26.46    "foldr f dxs = List.foldr f (list_of_dlist dxs)"
   26.47  
   26.48  
   26.49 -subsection {* Executable version obeying invariant *}
   26.50 +subsection \<open>Executable version obeying invariant\<close>
   26.51  
   26.52  lemma list_of_dlist_empty [simp, code abstract]:
   26.53    "list_of_dlist empty = []"
   26.54 @@ -103,7 +103,7 @@
   26.55    by (simp add: filter_def)
   26.56  
   26.57  
   26.58 -text {* Explicit executable conversion *}
   26.59 +text \<open>Explicit executable conversion\<close>
   26.60  
   26.61  definition dlist_of_list [simp]:
   26.62    "dlist_of_list = Dlist"
   26.63 @@ -113,7 +113,7 @@
   26.64    by simp
   26.65  
   26.66  
   26.67 -text {* Equality *}
   26.68 +text \<open>Equality\<close>
   26.69  
   26.70  instantiation dlist :: (equal) equal
   26.71  begin
   26.72 @@ -132,7 +132,7 @@
   26.73    by (fact equal_refl)
   26.74  
   26.75  
   26.76 -subsection {* Induction principle and case distinction *}
   26.77 +subsection \<open>Induction principle and case distinction\<close>
   26.78  
   26.79  lemma dlist_induct [case_names empty insert, induct type: dlist]:
   26.80    assumes empty: "P empty"
   26.81 @@ -141,7 +141,7 @@
   26.82  proof (cases dxs)
   26.83    case (Abs_dlist xs)
   26.84    then have "distinct xs" and dxs: "dxs = Dlist xs" by (simp_all add: Dlist_def distinct_remdups_id)
   26.85 -  from `distinct xs` have "P (Dlist xs)"
   26.86 +  from \<open>distinct xs\<close> have "P (Dlist xs)"
   26.87    proof (induct xs)
   26.88      case Nil from empty show ?case by (simp add: empty_def)
   26.89    next
   26.90 @@ -176,13 +176,13 @@
   26.91  qed
   26.92  
   26.93  
   26.94 -subsection {* Functorial structure *}
   26.95 +subsection \<open>Functorial structure\<close>
   26.96  
   26.97  functor map: map
   26.98    by (simp_all add: List.map.id remdups_map_remdups fun_eq_iff dlist_eq_iff)
   26.99  
  26.100  
  26.101 -subsection {* Quickcheck generators *}
  26.102 +subsection \<open>Quickcheck generators\<close>
  26.103  
  26.104  quickcheck_generator dlist predicate: distinct constructors: empty, insert
  26.105  
    27.1 --- a/src/HOL/Library/Extended.thy	Wed Jun 17 10:57:11 2015 +0200
    27.2 +++ b/src/HOL/Library/Extended.thy	Wed Jun 17 11:03:05 2015 +0200
    27.3 @@ -90,8 +90,8 @@
    27.4  instantiation extended :: (plus)plus
    27.5  begin
    27.6  
    27.7 -text {* The following definition of of addition is totalized
    27.8 -to make it asociative and commutative. Normally the sum of plus and minus infinity is undefined. *}
    27.9 +text \<open>The following definition of of addition is totalized
   27.10 +to make it asociative and commutative. Normally the sum of plus and minus infinity is undefined.\<close>
   27.11  
   27.12  fun plus_extended where
   27.13  "Fin x + Fin y = Fin(x+y)" |
   27.14 @@ -155,7 +155,7 @@
   27.15  by (simp_all add: minus_extended_def)
   27.16  
   27.17  
   27.18 -text{* Numerals: *}
   27.19 +text\<open>Numerals:\<close>
   27.20  
   27.21  instance extended :: ("{ab_semigroup_add,one}")numeral ..
   27.22  
    28.1 --- a/src/HOL/Library/Extended_Nat.thy	Wed Jun 17 10:57:11 2015 +0200
    28.2 +++ b/src/HOL/Library/Extended_Nat.thy	Wed Jun 17 11:03:05 2015 +0200
    28.3 @@ -3,7 +3,7 @@
    28.4      Contributions: David Trachtenherz, TU Muenchen
    28.5  *)
    28.6  
    28.7 -section {* Extended natural numbers (i.e. with infinity) *}
    28.8 +section \<open>Extended natural numbers (i.e. with infinity)\<close>
    28.9  
   28.10  theory Extended_Nat
   28.11  imports Main Countable
   28.12 @@ -18,16 +18,16 @@
   28.13  notation (HTML output)
   28.14    infinity  ("\<infinity>")
   28.15  
   28.16 -subsection {* Type definition *}
   28.17 +subsection \<open>Type definition\<close>
   28.18  
   28.19 -text {*
   28.20 +text \<open>
   28.21    We extend the standard natural numbers by a special value indicating
   28.22    infinity.
   28.23 -*}
   28.24 +\<close>
   28.25  
   28.26  typedef enat = "UNIV :: nat option set" ..
   28.27  
   28.28 -text {* TODO: introduce enat as coinductive datatype, enat is just @{const of_nat} *}
   28.29 +text \<open>TODO: introduce enat as coinductive datatype, enat is just @{const of_nat}\<close>
   28.30  
   28.31  definition enat :: "nat \<Rightarrow> enat" where
   28.32    "enat n = Abs_enat (Some n)"
   28.33 @@ -70,7 +70,7 @@
   28.34    where "the_enat (enat n) = n"
   28.35  
   28.36  
   28.37 -subsection {* Constructors and numbers *}
   28.38 +subsection \<open>Constructors and numbers\<close>
   28.39  
   28.40  instantiation enat :: "{zero, one}"
   28.41  begin
   28.42 @@ -141,7 +141,7 @@
   28.43  lemma enat_eSuc_iff: "enat y = eSuc x \<longleftrightarrow> (\<exists>n. y = Suc n \<and> enat n = x)"
   28.44    by (cases y) (auto simp: enat_0 eSuc_enat[symmetric])
   28.45  
   28.46 -subsection {* Addition *}
   28.47 +subsection \<open>Addition\<close>
   28.48  
   28.49  instantiation enat :: comm_monoid_add
   28.50  begin
   28.51 @@ -186,7 +186,7 @@
   28.52  lemma iadd_is_0: "(m + n = (0::enat)) = (m = 0 \<and> n = 0)"
   28.53    by (cases m, cases n, simp_all add: zero_enat_def)
   28.54  
   28.55 -subsection {* Multiplication *}
   28.56 +subsection \<open>Multiplication\<close>
   28.57  
   28.58  instantiation enat :: comm_semiring_1
   28.59  begin
   28.60 @@ -254,7 +254,7 @@
   28.61    by (auto simp add: times_enat_def zero_enat_def split: enat.split)
   28.62  
   28.63  
   28.64 -subsection {* Numerals *}
   28.65 +subsection \<open>Numerals\<close>
   28.66  
   28.67  lemma numeral_eq_enat:
   28.68    "numeral k = enat (numeral k)"
   28.69 @@ -273,7 +273,7 @@
   28.70  lemma eSuc_numeral [simp]: "eSuc (numeral k) = numeral (k + Num.One)"
   28.71    by (simp only: eSuc_plus_1 numeral_plus_one)
   28.72  
   28.73 -subsection {* Subtraction *}
   28.74 +subsection \<open>Subtraction\<close>
   28.75  
   28.76  instantiation enat :: minus
   28.77  begin
   28.78 @@ -316,7 +316,7 @@
   28.79  
   28.80  (*lemmas idiff_self_eq_0_enat = idiff_self_eq_0[unfolded zero_enat_def]*)
   28.81  
   28.82 -subsection {* Ordering *}
   28.83 +subsection \<open>Ordering\<close>
   28.84  
   28.85  instantiation enat :: linordered_ab_semigroup_add
   28.86  begin
   28.87 @@ -499,7 +499,7 @@
   28.88  qed
   28.89  
   28.90  
   28.91 -subsection {* Cancellation simprocs *}
   28.92 +subsection \<open>Cancellation simprocs\<close>
   28.93  
   28.94  lemma enat_add_left_cancel: "a + b = a + c \<longleftrightarrow> a = (\<infinity>::enat) \<or> b = c"
   28.95    unfolding plus_enat_def by (simp split: enat.split)
   28.96 @@ -510,7 +510,7 @@
   28.97  lemma enat_add_left_cancel_less: "a + b < a + c \<longleftrightarrow> a \<noteq> (\<infinity>::enat) \<and> b < c"
   28.98    unfolding plus_enat_def by (simp split: enat.split)
   28.99  
  28.100 -ML {*
  28.101 +ML \<open>
  28.102  structure Cancel_Enat_Common =
  28.103  struct
  28.104    (* copied from src/HOL/Tools/nat_numeral_simprocs.ML *)
  28.105 @@ -557,25 +557,25 @@
  28.106    val dest_bal = HOLogic.dest_bin @{const_name Orderings.less} @{typ enat}
  28.107    fun simp_conv _ _ = SOME @{thm enat_add_left_cancel_less}
  28.108  )
  28.109 -*}
  28.110 +\<close>
  28.111  
  28.112  simproc_setup enat_eq_cancel
  28.113    ("(l::enat) + m = n" | "(l::enat) = m + n") =
  28.114 -  {* fn phi => fn ctxt => fn ct => Eq_Enat_Cancel.proc ctxt (Thm.term_of ct) *}
  28.115 +  \<open>fn phi => fn ctxt => fn ct => Eq_Enat_Cancel.proc ctxt (Thm.term_of ct)\<close>
  28.116  
  28.117  simproc_setup enat_le_cancel
  28.118    ("(l::enat) + m \<le> n" | "(l::enat) \<le> m + n") =
  28.119 -  {* fn phi => fn ctxt => fn ct => Le_Enat_Cancel.proc ctxt (Thm.term_of ct) *}
  28.120 +  \<open>fn phi => fn ctxt => fn ct => Le_Enat_Cancel.proc ctxt (Thm.term_of ct)\<close>
  28.121  
  28.122  simproc_setup enat_less_cancel
  28.123    ("(l::enat) + m < n" | "(l::enat) < m + n") =
  28.124 -  {* fn phi => fn ctxt => fn ct => Less_Enat_Cancel.proc ctxt (Thm.term_of ct) *}
  28.125 +  \<open>fn phi => fn ctxt => fn ct => Less_Enat_Cancel.proc ctxt (Thm.term_of ct)\<close>
  28.126  
  28.127 -text {* TODO: add regression tests for these simprocs *}
  28.128 +text \<open>TODO: add regression tests for these simprocs\<close>
  28.129  
  28.130 -text {* TODO: add simprocs for combining and cancelling numerals *}
  28.131 +text \<open>TODO: add simprocs for combining and cancelling numerals\<close>
  28.132  
  28.133 -subsection {* Well-ordering *}
  28.134 +subsection \<open>Well-ordering\<close>
  28.135  
  28.136  lemma less_enatE:
  28.137    "[| n < enat m; !!k. n = enat k ==> k < m ==> P |] ==> P"
  28.138 @@ -613,7 +613,7 @@
  28.139    show "P n" by (blast intro: enat_less_induct hyp)
  28.140  qed
  28.141  
  28.142 -subsection {* Complete Lattice *}
  28.143 +subsection \<open>Complete Lattice\<close>
  28.144  
  28.145  instantiation enat :: complete_lattice
  28.146  begin
  28.147 @@ -647,7 +647,7 @@
  28.148  
  28.149  instance enat :: complete_linorder ..
  28.150  
  28.151 -subsection {* Traditional theorem names *}
  28.152 +subsection \<open>Traditional theorem names\<close>
  28.153  
  28.154  lemmas enat_defs = zero_enat_def one_enat_def eSuc_def
  28.155    plus_enat_def less_eq_enat_def less_enat_def
    29.1 --- a/src/HOL/Library/Extended_Real.thy	Wed Jun 17 10:57:11 2015 +0200
    29.2 +++ b/src/HOL/Library/Extended_Real.thy	Wed Jun 17 11:03:05 2015 +0200
    29.3 @@ -5,18 +5,18 @@
    29.4      Author:     Bogdan Grechuk, University of Edinburgh
    29.5  *)
    29.6  
    29.7 -section {* Extended real number line *}
    29.8 +section \<open>Extended real number line\<close>
    29.9  
   29.10  theory Extended_Real
   29.11  imports Complex_Main Extended_Nat Liminf_Limsup Order_Continuity
   29.12  begin
   29.13  
   29.14 -text {*
   29.15 +text \<open>
   29.16  
   29.17  This should be part of @{theory Extended_Nat} or @{theory Order_Continuity}, but then the
   29.18  AFP-entry @{text "Jinja_Thread"} fails, as it does overload certain named from @{theory Complex_Main}.
   29.19  
   29.20 -*}
   29.21 +\<close>
   29.22  
   29.23  lemma continuous_at_left_imp_sup_continuous:
   29.24    fixes f :: "'a \<Rightarrow> 'a::{complete_linorder, linorder_topology}"
   29.25 @@ -169,14 +169,14 @@
   29.26  qed
   29.27  
   29.28  
   29.29 -text {*
   29.30 +text \<open>
   29.31  
   29.32  For more lemmas about the extended real numbers go to
   29.33    @{file "~~/src/HOL/Multivariate_Analysis/Extended_Real_Limits.thy"}
   29.34  
   29.35 -*}
   29.36 -
   29.37 -subsection {* Definition and basic properties *}
   29.38 +\<close>
   29.39 +
   29.40 +subsection \<open>Definition and basic properties\<close>
   29.41  
   29.42  datatype ereal = ereal real | PInfty | MInfty
   29.43  
   29.44 @@ -760,7 +760,7 @@
   29.45      assume "\<not> ?thesis"
   29.46      then have "\<And>i. i \<in> P \<Longrightarrow> f i \<noteq> \<infinity>"
   29.47        by auto
   29.48 -    with `finite P` have "setsum f P \<noteq> \<infinity>"
   29.49 +    with \<open>finite P\<close> have "setsum f P \<noteq> \<infinity>"
   29.50        by induct auto
   29.51      with * show False
   29.52        by auto
   29.53 @@ -1121,9 +1121,9 @@
   29.54      {
   29.55        assume "e \<noteq> \<infinity>"
   29.56        then obtain r where "e = ereal r"
   29.57 -        using `e > 0` by (cases e) auto
   29.58 +        using \<open>e > 0\<close> by (cases e) auto
   29.59        then have "x \<le> y + e"
   29.60 -        using assms[rule_format, of r] `e>0` by auto
   29.61 +        using assms[rule_format, of r] \<open>e>0\<close> by auto
   29.62      }
   29.63      ultimately have "x \<le> y + e"
   29.64        by blast
   29.65 @@ -1199,7 +1199,7 @@
   29.66  qed
   29.67  
   29.68  
   29.69 -subsubsection {* Power *}
   29.70 +subsubsection \<open>Power\<close>
   29.71  
   29.72  lemma ereal_power[simp]: "(ereal x) ^ n = ereal (x^n)"
   29.73    by (induct n) (auto simp: one_ereal_def)
   29.74 @@ -1223,7 +1223,7 @@
   29.75    using assms by (induct n) (auto simp: ereal_zero_le_0_iff)
   29.76  
   29.77  
   29.78 -subsubsection {* Subtraction *}
   29.79 +subsubsection \<open>Subtraction\<close>
   29.80  
   29.81  lemma ereal_minus_minus_image[simp]:
   29.82    fixes S :: "ereal set"
   29.83 @@ -1391,7 +1391,7 @@
   29.84    by (cases x y rule: ereal2_cases) simp_all
   29.85  
   29.86  
   29.87 -subsubsection {* Division *}
   29.88 +subsubsection \<open>Division\<close>
   29.89  
   29.90  instantiation ereal :: inverse
   29.91  begin
   29.92 @@ -1627,7 +1627,7 @@
   29.93    show ?thesis
   29.94    proof (cases "S \<noteq> {-\<infinity>} \<and> S \<noteq> {}")
   29.95      case True
   29.96 -    with `\<infinity> \<notin> S` obtain x where x: "x \<in> S" "\<bar>x\<bar> \<noteq> \<infinity>"
   29.97 +    with \<open>\<infinity> \<notin> S\<close> obtain x where x: "x \<in> S" "\<bar>x\<bar> \<noteq> \<infinity>"
   29.98        by auto
   29.99      obtain s where s: "\<forall>x\<in>ereal -` S. x \<le> s" "\<And>z. (\<forall>x\<in>ereal -` S. x \<le> z) \<Longrightarrow> s \<le> z"
  29.100      proof (atomize_elim, rule complete_real)
  29.101 @@ -1640,12 +1640,12 @@
  29.102      proof (safe intro!: exI[of _ "ereal s"])
  29.103        fix y
  29.104        assume "y \<in> S"
  29.105 -      with s `\<infinity> \<notin> S` show "y \<le> ereal s"
  29.106 +      with s \<open>\<infinity> \<notin> S\<close> show "y \<le> ereal s"
  29.107          by (cases y) auto
  29.108      next
  29.109        fix z
  29.110        assume "\<forall>y\<in>S. y \<le> z"
  29.111 -      with `S \<noteq> {-\<infinity>} \<and> S \<noteq> {}` show "ereal s \<le> z"
  29.112 +      with \<open>S \<noteq> {-\<infinity>} \<and> S \<noteq> {}\<close> show "ereal s \<le> z"
  29.113          by (cases z) (auto intro!: s)
  29.114      qed
  29.115    next
  29.116 @@ -1773,14 +1773,14 @@
  29.117    show ?thesis
  29.118    proof (rule filterlim_cong[THEN iffD1, OF refl refl _ tendsto_const])
  29.119      have "0 < x \<or> x < 0"
  29.120 -      using `x \<noteq> 0` by (auto simp add: neq_iff)
  29.121 +      using \<open>x \<noteq> 0\<close> by (auto simp add: neq_iff)
  29.122      then show "eventually (\<lambda>x'. c * x = c * f x') F"
  29.123      proof
  29.124        assume "0 < x" from order_tendstoD(1)[OF f this] show ?thesis
  29.125 -        by eventually_elim (insert `0<x` `\<bar>c\<bar> = \<infinity>`, auto)
  29.126 +        by eventually_elim (insert \<open>0<x\<close> \<open>\<bar>c\<bar> = \<infinity>\<close>, auto)
  29.127      next
  29.128        assume "x < 0" from order_tendstoD(2)[OF f this] show ?thesis
  29.129 -        by eventually_elim (insert `x<0` `\<bar>c\<bar> = \<infinity>`, auto)
  29.130 +        by eventually_elim (insert \<open>x<0\<close> \<open>\<bar>c\<bar> = \<infinity>\<close>, auto)
  29.131      qed
  29.132    qed
  29.133  qed (rule tendsto_cmult_ereal[OF _ f])
  29.134 @@ -1941,12 +1941,12 @@
  29.135    moreover then have "\<And>i. i \<in> I \<Longrightarrow> f i = -\<infinity>"
  29.136      unfolding Sup_eq_MInfty Sup_image_eq[symmetric] by auto
  29.137    ultimately show ?thesis
  29.138 -    by (cases c) (auto simp: `I \<noteq> {}`)
  29.139 +    by (cases c) (auto simp: \<open>I \<noteq> {}\<close>)
  29.140  next
  29.141    assume "(SUP i:I. f i) \<noteq> - \<infinity>" then show ?thesis
  29.142      unfolding Sup_image_eq[symmetric]
  29.143      by (subst continuous_at_Sup_mono[where f="\<lambda>x. x + c"])
  29.144 -       (auto simp: continuous_at_within continuous_at mono_def ereal_add_mono `I \<noteq> {}` `c \<noteq> -\<infinity>`)
  29.145 +       (auto simp: continuous_at_within continuous_at mono_def ereal_add_mono \<open>I \<noteq> {}\<close> \<open>c \<noteq> -\<infinity>\<close>)
  29.146  qed
  29.147  
  29.148  lemma SUP_ereal_add_right:
  29.149 @@ -1963,17 +1963,17 @@
  29.150  lemma SUP_ereal_minus_left:
  29.151    assumes "I \<noteq> {}" "c \<noteq> \<infinity>"
  29.152    shows "(SUP i:I. f i - c:: ereal) = (SUP i:I. f i) - c"
  29.153 -  using SUP_ereal_add_left[OF `I \<noteq> {}`, of "-c" f] by (simp add: `c \<noteq> \<infinity>` minus_ereal_def)
  29.154 +  using SUP_ereal_add_left[OF \<open>I \<noteq> {}\<close>, of "-c" f] by (simp add: \<open>c \<noteq> \<infinity>\<close> minus_ereal_def)
  29.155  
  29.156  lemma INF_ereal_minus_right:
  29.157    assumes "I \<noteq> {}" and "\<bar>c\<bar> \<noteq> \<infinity>"
  29.158    shows "(INF i:I. c - f i) = c - (SUP i:I. f i::ereal)"
  29.159  proof -
  29.160    { fix b have "(-c) + b = - (c - b)"
  29.161 -      using `\<bar>c\<bar> \<noteq> \<infinity>` by (cases c b rule: ereal2_cases) auto }
  29.162 +      using \<open>\<bar>c\<bar> \<noteq> \<infinity>\<close> by (cases c b rule: ereal2_cases) auto }
  29.163    note * = this
  29.164    show ?thesis
  29.165 -    using SUP_ereal_add_right[OF `I \<noteq> {}`, of "-c" f] `\<bar>c\<bar> \<noteq> \<infinity>`
  29.166 +    using SUP_ereal_add_right[OF \<open>I \<noteq> {}\<close>, of "-c" f] \<open>\<bar>c\<bar> \<noteq> \<infinity>\<close>
  29.167      by (auto simp add: * ereal_SUP_uminus_eq)
  29.168  qed
  29.169  
  29.170 @@ -1981,7 +1981,7 @@
  29.171    fixes f :: "'i \<Rightarrow> ereal"
  29.172    assumes "\<And>i. f i + y \<le> z" and "y \<noteq> -\<infinity>"
  29.173    shows "SUPREMUM UNIV f + y \<le> z"
  29.174 -  unfolding SUP_ereal_add_left[OF UNIV_not_empty `y \<noteq> -\<infinity>`, symmetric]
  29.175 +  unfolding SUP_ereal_add_left[OF UNIV_not_empty \<open>y \<noteq> -\<infinity>\<close>, symmetric]
  29.176    by (rule SUP_least assms)+
  29.177  
  29.178  lemma SUP_combine:
  29.179 @@ -2069,7 +2069,7 @@
  29.180    assume "(SUP i:I. f i) \<noteq> 0" then show ?thesis
  29.181      unfolding SUP_def
  29.182      by (subst continuous_at_Sup_mono[where f="\<lambda>x. c * x"])
  29.183 -       (auto simp: mono_def continuous_at continuous_at_within `I \<noteq> {}`
  29.184 +       (auto simp: mono_def continuous_at continuous_at_within \<open>I \<noteq> {}\<close>
  29.185               intro!: ereal_mult_left_mono c)
  29.186  qed
  29.187  
  29.188 @@ -2093,7 +2093,7 @@
  29.189    shows "\<exists>f::nat \<Rightarrow> ereal. incseq f \<and> range f \<subseteq> A \<and> Sup A = (SUP i. f i)"
  29.190  proof cases
  29.191    assume "Sup A = -\<infinity>"
  29.192 -  with `A \<noteq> {}` have "A = {-\<infinity>}"
  29.193 +  with \<open>A \<noteq> {}\<close> have "A = {-\<infinity>}"
  29.194      by (auto simp: Sup_eq_MInfty)
  29.195    then show ?thesis
  29.196      by (auto intro!: exI[of _ "\<lambda>_. -\<infinity>"] simp: bot_ereal_def)
  29.197 @@ -2120,7 +2120,7 @@
  29.198    have "(SUP i. f i) = Sup A"
  29.199    proof (rule tendsto_unique)
  29.200      show "f ----> (SUP i. f i)"
  29.201 -      by (rule LIMSEQ_SUP `incseq f`)+
  29.202 +      by (rule LIMSEQ_SUP \<open>incseq f\<close>)+
  29.203      show "f ----> Sup A"
  29.204        using l f
  29.205        by (intro tendsto_sandwich[OF _ _ l_Sup tendsto_const])
  29.206 @@ -2322,7 +2322,7 @@
  29.207      and "\<bar>x\<bar> \<noteq> \<infinity>"
  29.208    obtains e where "e > 0" and "{x-e <..< x+e} \<subseteq> S"
  29.209  proof -
  29.210 -  from `open S`
  29.211 +  from \<open>open S\<close>
  29.212    have "open (ereal -` S)"
  29.213      by (rule ereal_openE)
  29.214    then obtain e where "e > 0" and e: "\<And>y. dist y (real x) < e \<Longrightarrow> ereal y \<in> S"
  29.215 @@ -2330,7 +2330,7 @@
  29.216    show thesis
  29.217    proof (intro that subsetI)
  29.218      show "0 < ereal e"
  29.219 -      using `0 < e` by auto
  29.220 +      using \<open>0 < e\<close> by auto
  29.221      fix y
  29.222      assume "y \<in> {x - ereal e<..<x + ereal e}"
  29.223      with assms obtain t where "y = ereal t" "dist t (real x) < e"
  29.224 @@ -2354,7 +2354,7 @@
  29.225      by auto
  29.226  qed
  29.227  
  29.228 -subsubsection {* Convergent sequences *}
  29.229 +subsubsection \<open>Convergent sequences\<close>
  29.230  
  29.231  lemma lim_real_of_ereal[simp]:
  29.232    assumes lim: "(f ---> ereal x) net"
  29.233 @@ -2477,7 +2477,7 @@
  29.234  proof (intro topological_tendstoI)
  29.235    fix S
  29.236    assume S: "open S" "x \<in> S"
  29.237 -  with `x \<noteq> 0` have "open (S - {0})" "x \<in> S - {0}"
  29.238 +  with \<open>x \<noteq> 0\<close> have "open (S - {0})" "x \<in> S - {0}"
  29.239      by auto
  29.240    from tendsto[THEN topological_tendstoD, OF this]
  29.241    show "eventually (\<lambda>x. f x \<in> S) net"
  29.242 @@ -2618,7 +2618,7 @@
  29.243    assume "open S" and "x \<in> S"
  29.244    then have "open (ereal -` S)"
  29.245      unfolding open_ereal_def by auto
  29.246 -  with `x \<in> S` obtain r where "0 < r" and dist: "\<And>y. dist y rx < r \<Longrightarrow> ereal y \<in> S"
  29.247 +  with \<open>x \<in> S\<close> obtain r where "0 < r" and dist: "\<And>y. dist y rx < r \<Longrightarrow> ereal y \<in> S"
  29.248      unfolding open_real_def rx by auto
  29.249    then obtain n where
  29.250      upper: "\<And>N. n \<le> N \<Longrightarrow> u N < x + ereal r" and
  29.251 @@ -2628,19 +2628,19 @@
  29.252    proof (safe intro!: exI[of _ n])
  29.253      fix N
  29.254      assume "n \<le> N"
  29.255 -    from upper[OF this] lower[OF this] assms `0 < r`
  29.256 +    from upper[OF this] lower[OF this] assms \<open>0 < r\<close>
  29.257      have "u N \<notin> {\<infinity>,(-\<infinity>)}"
  29.258        by auto
  29.259      then obtain ra where ra_def: "(u N) = ereal ra"
  29.260        by (cases "u N") auto
  29.261      then have "rx < ra + r" and "ra < rx + r"
  29.262 -      using rx assms `0 < r` lower[OF `n \<le> N`] upper[OF `n \<le> N`]
  29.263 +      using rx assms \<open>0 < r\<close> lower[OF \<open>n \<le> N\<close>] upper[OF \<open>n \<le> N\<close>]
  29.264        by auto
  29.265      then have "dist (real (u N)) rx < r"
  29.266        using rx ra_def
  29.267        by (auto simp: dist_real_def abs_diff_less_iff field_simps)
  29.268      from dist[OF this] show "u N \<in> S"
  29.269 -      using `u N  \<notin> {\<infinity>, -\<infinity>}`
  29.270 +      using \<open>u N  \<notin> {\<infinity>, -\<infinity>}\<close>
  29.271        by (auto simp: ereal_real split: split_if_asm)
  29.272    qed
  29.273  qed
  29.274 @@ -2665,7 +2665,7 @@
  29.275      assume "r > 0"
  29.276      then obtain N where "\<forall>n\<ge>N. u n \<in> {x - r <..< x + r}"
  29.277         apply (subst tendsto_obtains_N[of u x "{x - r <..< x + r}"])
  29.278 -       using lim ereal_between[of x r] assms `r > 0`
  29.279 +       using lim ereal_between[of x r] assms \<open>r > 0\<close>
  29.280         apply auto
  29.281         done
  29.282      then have "\<exists>N. \<forall>n\<ge>N. u n < x + r \<and> x < u n + r"
  29.283 @@ -2768,7 +2768,7 @@
  29.284    qed
  29.285  qed
  29.286  
  29.287 -subsubsection {* Tests for code generator *}
  29.288 +subsubsection \<open>Tests for code generator\<close>
  29.289  
  29.290  (* A small list of simple arithmetic expressions *)
  29.291  
    30.1 --- a/src/HOL/Library/FSet.thy	Wed Jun 17 10:57:11 2015 +0200
    30.2 +++ b/src/HOL/Library/FSet.thy	Wed Jun 17 11:03:05 2015 +0200
    30.3 @@ -4,13 +4,13 @@
    30.4      Author:     Andrei Popescu, TU Muenchen
    30.5  *)
    30.6  
    30.7 -section {* Type of finite sets defined as a subtype of sets *}
    30.8 +section \<open>Type of finite sets defined as a subtype of sets\<close>
    30.9  
   30.10  theory FSet
   30.11  imports Conditionally_Complete_Lattices
   30.12  begin
   30.13  
   30.14 -subsection {* Definition of the type *}
   30.15 +subsection \<open>Definition of the type\<close>
   30.16  
   30.17  typedef 'a fset = "{A :: 'a set. finite A}"  morphisms fset Abs_fset
   30.18  by auto
   30.19 @@ -18,7 +18,7 @@
   30.20  setup_lifting type_definition_fset
   30.21  
   30.22  
   30.23 -subsection {* Basic operations and type class instantiations *}
   30.24 +subsection \<open>Basic operations and type class instantiations\<close>
   30.25  
   30.26  (* FIXME transfer and right_total vs. bi_total *)
   30.27  instantiation fset :: (finite) finite
   30.28 @@ -153,7 +153,7 @@
   30.29  declare top_fset.rep_eq[simp]
   30.30  
   30.31  
   30.32 -subsection {* Other operations *}
   30.33 +subsection \<open>Other operations\<close>
   30.34  
   30.35  lift_definition finsert :: "'a \<Rightarrow> 'a fset \<Rightarrow> 'a fset" is insert parametric Lifting_Set.insert_transfer
   30.36    by simp
   30.37 @@ -199,7 +199,7 @@
   30.38  lift_definition ffold :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a fset \<Rightarrow> 'b" is Finite_Set.fold .
   30.39  
   30.40  
   30.41 -subsection {* Transferred lemmas from Set.thy *}
   30.42 +subsection \<open>Transferred lemmas from Set.thy\<close>
   30.43  
   30.44  lemmas fset_eqI = set_eqI[Transfer.transferred]
   30.45  lemmas fset_eq_iff[no_atp] = set_eq_iff[Transfer.transferred]
   30.46 @@ -439,14 +439,14 @@
   30.47  lemmas fequalityI = equalityI[Transfer.transferred]
   30.48  
   30.49  
   30.50 -subsection {* Additional lemmas*}
   30.51 +subsection \<open>Additional lemmas\<close>
   30.52  
   30.53 -subsubsection {* @{text fsingleton} *}
   30.54 +subsubsection \<open>@{text fsingleton}\<close>
   30.55  
   30.56  lemmas fsingletonE = fsingletonD [elim_format]
   30.57  
   30.58  
   30.59 -subsubsection {* @{text femepty} *}
   30.60 +subsubsection \<open>@{text femepty}\<close>
   30.61  
   30.62  lemma fempty_ffilter[simp]: "ffilter (\<lambda>_. False) A = {||}"
   30.63  by transfer auto
   30.64 @@ -456,7 +456,7 @@
   30.65    by simp
   30.66  
   30.67  
   30.68 -subsubsection {* @{text fset} *}
   30.69 +subsubsection \<open>@{text fset}\<close>
   30.70  
   30.71  lemmas fset_simps[simp] = bot_fset.rep_eq finsert.rep_eq
   30.72  
   30.73 @@ -479,7 +479,7 @@
   30.74  lemmas minus_fset[simp] = minus_fset.rep_eq
   30.75  
   30.76  
   30.77 -subsubsection {* @{text filter_fset} *}
   30.78 +subsubsection \<open>@{text filter_fset}\<close>
   30.79  
   30.80  lemma subset_ffilter: 
   30.81    "ffilter P A |\<subseteq>| ffilter Q A = (\<forall> x. x |\<in>| A \<longrightarrow> P x \<longrightarrow> Q x)"
   30.82 @@ -495,7 +495,7 @@
   30.83    unfolding less_fset_def by (auto simp add: subset_ffilter eq_ffilter)
   30.84  
   30.85  
   30.86 -subsubsection {* @{text finsert} *}
   30.87 +subsubsection \<open>@{text finsert}\<close>
   30.88  
   30.89  (* FIXME, transferred doesn't work here *)
   30.90  lemma set_finsert:
   30.91 @@ -507,13 +507,13 @@
   30.92    by (rule_tac x = "A |-| {|a|}" in exI, blast)
   30.93  
   30.94  
   30.95 -subsubsection {* @{text fimage} *}
   30.96 +subsubsection \<open>@{text fimage}\<close>
   30.97  
   30.98  lemma subset_fimage_iff: "(B |\<subseteq>| f|`|A) = (\<exists> AA. AA |\<subseteq>| A \<and> B = f|`|AA)"
   30.99  by transfer (metis mem_Collect_eq rev_finite_subset subset_image_iff)
  30.100  
  30.101  
  30.102 -subsubsection {* bounded quantification *}
  30.103 +subsubsection \<open>bounded quantification\<close>
  30.104  
  30.105  lemma bex_simps [simp, no_atp]:
  30.106    "\<And>A P Q. fBex A (\<lambda>x. P x \<and> Q) = (fBex A P \<and> Q)" 
  30.107 @@ -544,7 +544,7 @@
  30.108  end
  30.109  
  30.110  
  30.111 -subsubsection {* @{text fcard} *}
  30.112 +subsubsection \<open>@{text fcard}\<close>
  30.113  
  30.114  (* FIXME: improve transferred to handle bounded meta quantification *)
  30.115  
  30.116 @@ -627,7 +627,7 @@
  30.117  by transfer (rule card_psubset)
  30.118  
  30.119  
  30.120 -subsubsection {* @{text ffold} *}
  30.121 +subsubsection \<open>@{text ffold}\<close>
  30.122  
  30.123  (* FIXME: improve transferred to handle bounded meta quantification *)
  30.124  
  30.125 @@ -686,7 +686,7 @@
  30.126  end
  30.127  
  30.128  
  30.129 -subsection {* Choice in fsets *}
  30.130 +subsection \<open>Choice in fsets\<close>
  30.131  
  30.132  lemma fset_choice: 
  30.133    assumes "\<forall>x. x |\<in>| A \<longrightarrow> (\<exists>y. P x y)"
  30.134 @@ -694,7 +694,7 @@
  30.135    using assms by transfer metis
  30.136  
  30.137  
  30.138 -subsection {* Induction and Cases rules for fsets *}
  30.139 +subsection \<open>Induction and Cases rules for fsets\<close>
  30.140  
  30.141  lemma fset_exhaust [case_names empty insert, cases type: fset]:
  30.142    assumes fempty_case: "S = {||} \<Longrightarrow> P" 
  30.143 @@ -760,9 +760,9 @@
  30.144    done
  30.145  
  30.146  
  30.147 -subsection {* Setup for Lifting/Transfer *}
  30.148 +subsection \<open>Setup for Lifting/Transfer\<close>
  30.149  
  30.150 -subsubsection {* Relator and predicator properties *}
  30.151 +subsubsection \<open>Relator and predicator properties\<close>
  30.152  
  30.153  lift_definition rel_fset :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a fset \<Rightarrow> 'b fset \<Rightarrow> bool" is rel_set
  30.154  parametric rel_set_transfer .
  30.155 @@ -800,9 +800,9 @@
  30.156    ultimately show ?thesis by metis
  30.157  qed
  30.158  
  30.159 -subsubsection {* Transfer rules for the Transfer package *}
  30.160 +subsubsection \<open>Transfer rules for the Transfer package\<close>
  30.161  
  30.162 -text {* Unconditional transfer rules *}
  30.163 +text \<open>Unconditional transfer rules\<close>
  30.164  
  30.165  context
  30.166  begin
  30.167 @@ -854,7 +854,7 @@
  30.168    using assms unfolding rel_fun_def
  30.169    using bind_transfer[unfolded rel_fun_def, rule_format, Transfer.transferred] by blast
  30.170  
  30.171 -text {* Rules requiring bi-unique, bi-total or right-total relations *}
  30.172 +text \<open>Rules requiring bi-unique, bi-total or right-total relations\<close>
  30.173  
  30.174  lemma fmember_transfer [transfer_rule]:
  30.175    assumes "bi_unique A"
  30.176 @@ -913,7 +913,7 @@
  30.177  lifting_forget fset.lifting
  30.178  
  30.179  
  30.180 -subsection {* BNF setup *}
  30.181 +subsection \<open>BNF setup\<close>
  30.182  
  30.183  context
  30.184  includes fset.lifting
  30.185 @@ -940,9 +940,9 @@
  30.186    hence *: "fset R' = ?L'" unfolding R'_def by (intro fset_to_fset)
  30.187    show ?R unfolding Grp_def relcompp.simps conversep.simps
  30.188    proof (intro CollectI case_prodI exI[of _ a] exI[of _ b] exI[of _ R'] conjI refl)
  30.189 -    from * show "a = fimage fst R'" using conjunct1[OF `?L`]
  30.190 +    from * show "a = fimage fst R'" using conjunct1[OF \<open>?L\<close>]
  30.191        by (transfer, auto simp add: image_def Int_def split: prod.splits)
  30.192 -    from * show "b = fimage snd R'" using conjunct2[OF `?L`]
  30.193 +    from * show "b = fimage snd R'" using conjunct2[OF \<open>?L\<close>]
  30.194        by (transfer, auto simp add: image_def Int_def split: prod.splits)
  30.195    qed (auto simp add: *)
  30.196  next
  30.197 @@ -980,7 +980,7 @@
  30.198  lemmas [simp] = fset.map_comp fset.map_id fset.set_map
  30.199  
  30.200  
  30.201 -subsection {* Size setup *}
  30.202 +subsection \<open>Size setup\<close>
  30.203  
  30.204  context includes fset.lifting begin
  30.205  lift_definition size_fset :: "('a \<Rightarrow> nat) \<Rightarrow> 'a fset \<Rightarrow> nat" is "\<lambda>f. setsum (Suc \<circ> f)" .
  30.206 @@ -1004,15 +1004,15 @@
  30.207    apply (subst fun_eq_iff)
  30.208    including fset.lifting by transfer (auto intro: setsum.reindex_cong subset_inj_on)
  30.209    
  30.210 -setup {*
  30.211 +setup \<open>
  30.212  BNF_LFP_Size.register_size_global @{type_name fset} @{const_name size_fset}
  30.213    @{thms size_fset_simps size_fset_overloaded_simps} @{thms fset_size_o_map}
  30.214 -*}
  30.215 +\<close>
  30.216  
  30.217  lifting_update fset.lifting
  30.218  lifting_forget fset.lifting
  30.219  
  30.220 -subsection {* Advanced relator customization *}
  30.221 +subsection \<open>Advanced relator customization\<close>
  30.222  
  30.223  (* Set vs. sum relators: *)
  30.224  
    31.1 --- a/src/HOL/Library/FinFun.thy	Wed Jun 17 10:57:11 2015 +0200
    31.2 +++ b/src/HOL/Library/FinFun.thy	Wed Jun 17 11:03:05 2015 +0200
    31.3 @@ -1,12 +1,12 @@
    31.4  (* Author: Andreas Lochbihler, Uni Karlsruhe *)
    31.5  
    31.6 -section {* Almost everywhere constant functions *}
    31.7 +section \<open>Almost everywhere constant functions\<close>
    31.8  
    31.9  theory FinFun
   31.10  imports Cardinality
   31.11  begin
   31.12  
   31.13 -text {*
   31.14 +text \<open>
   31.15    This theory defines functions which are constant except for finitely
   31.16    many points (FinFun) and introduces a type finfin along with a
   31.17    number of operators for them. The code generator is set up such that
   31.18 @@ -14,10 +14,10 @@
   31.19    all operators are executable.
   31.20  
   31.21    For details, see Formalising FinFuns - Generating Code for Functions as Data by A. Lochbihler in TPHOLs 2009.
   31.22 -*}
   31.23 +\<close>
   31.24  
   31.25  
   31.26 -subsection {* The @{text "map_default"} operation *}
   31.27 +subsection \<open>The @{text "map_default"} operation\<close>
   31.28  
   31.29  definition map_default :: "'b \<Rightarrow> ('a \<rightharpoonup> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"
   31.30  where "map_default b f a \<equiv> case f a of None \<Rightarrow> b | Some b' \<Rightarrow> b'"
   31.31 @@ -72,7 +72,7 @@
   31.32    qed
   31.33  qed
   31.34  
   31.35 -subsection {* The finfun type *}
   31.36 +subsection \<open>The finfun type\<close>
   31.37  
   31.38  definition "finfun = {f::'a\<Rightarrow>'b. \<exists>b. finite {a. f a \<noteq> b}}"
   31.39  
   31.40 @@ -122,8 +122,8 @@
   31.41      thus ?case by(simp)
   31.42    next
   31.43      case (insert x F)
   31.44 -    note IH = `\<And>y. F = {a. y a \<noteq> b} \<Longrightarrow> finite {c. g (y c) \<noteq> g b}`
   31.45 -    from `insert x F = {a. y a \<noteq> b}` `x \<notin> F`
   31.46 +    note IH = \<open>\<And>y. F = {a. y a \<noteq> b} \<Longrightarrow> finite {c. g (y c) \<noteq> g b}\<close>
   31.47 +    from \<open>insert x F = {a. y a \<noteq> b}\<close> \<open>x \<notin> F\<close>
   31.48      have F: "F = {a. (y(x := b)) a \<noteq> b}" by(auto)
   31.49      show ?case
   31.50      proof(cases "g (y x) = g b")
   31.51 @@ -269,7 +269,7 @@
   31.52  qed
   31.53  
   31.54  
   31.55 -subsection {* Kernel functions for type @{typ "'a \<Rightarrow>f 'b"} *}
   31.56 +subsection \<open>Kernel functions for type @{typ "'a \<Rightarrow>f 'b"}\<close>
   31.57  
   31.58  lift_definition finfun_const :: "'b \<Rightarrow> 'a \<Rightarrow>f 'b" ("K$/ _" [0] 1)
   31.59  is "\<lambda> b x. b" by (rule const_finfun)
   31.60 @@ -287,7 +287,7 @@
   31.61  lemma finfun_update_const_same: "(K$ b)(a $:= b) = (K$ b)"
   31.62  by transfer (simp add: fun_eq_iff)
   31.63  
   31.64 -subsection {* Code generator setup *}
   31.65 +subsection \<open>Code generator setup\<close>
   31.66  
   31.67  definition finfun_update_code :: "'a \<Rightarrow>f 'b \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow>f 'b"
   31.68  where [simp, code del]: "finfun_update_code = finfun_update"
   31.69 @@ -303,11 +303,11 @@
   31.70  by(simp add: finfun_update_twist)
   31.71  
   31.72  
   31.73 -subsection {* Setup for quickcheck *}
   31.74 +subsection \<open>Setup for quickcheck\<close>
   31.75  
   31.76  quickcheck_generator finfun constructors: finfun_update_code, "finfun_const :: 'b \<Rightarrow> 'a \<Rightarrow>f 'b"
   31.77  
   31.78 -subsection {* @{text "finfun_update"} as instance of @{text "comp_fun_commute"} *}
   31.79 +subsection \<open>@{text "finfun_update"} as instance of @{text "comp_fun_commute"}\<close>
   31.80  
   31.81  interpretation finfun_update: comp_fun_commute "\<lambda>a f. f(a :: 'a $:= b')"
   31.82    including finfun
   31.83 @@ -343,7 +343,7 @@
   31.84  qed
   31.85  
   31.86  
   31.87 -subsection {* Default value for FinFuns *}
   31.88 +subsection \<open>Default value for FinFuns\<close>
   31.89  
   31.90  definition finfun_default_aux :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b"
   31.91  where [code del]: "finfun_default_aux f = (if finite (UNIV :: 'a set) then undefined else THE b. finite {a. f a \<noteq> b})"
   31.92 @@ -431,7 +431,7 @@
   31.93    "finfun_default (finfun_update_code f a b) = finfun_default f"
   31.94  by(simp add: finfun_default_update_const)
   31.95  
   31.96 -subsection {* Recursion combinator and well-formedness conditions *}
   31.97 +subsection \<open>Recursion combinator and well-formedness conditions\<close>
   31.98  
   31.99  definition finfun_rec :: "('b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> 'c \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow>f 'b) \<Rightarrow> 'c"
  31.100  where [code del]:
  31.101 @@ -469,13 +469,13 @@
  31.102    from fin anf fg show ?thesis
  31.103    proof(induct "dom f" arbitrary: f)
  31.104      case empty
  31.105 -    from `{} = dom f` have "f = empty" by(auto simp add: dom_def)
  31.106 +    from \<open>{} = dom f\<close> have "f = empty" by(auto simp add: dom_def)
  31.107      thus ?case by(simp add: finfun_const_def upd_const_same)
  31.108    next
  31.109      case (insert a' A)
  31.110 -    note IH = `\<And>f.  \<lbrakk> A = dom f; a \<notin> dom f; f \<subseteq>\<^sub>m g \<rbrakk> \<Longrightarrow> upd a d (?fr (dom f)) = ?fr (dom f)`
  31.111 -    note fin = `finite A` note anf = `a \<notin> dom f` note a'nA = `a' \<notin> A`
  31.112 -    note domf = `insert a' A = dom f` note fg = `f \<subseteq>\<^sub>m g`
  31.113 +    note IH = \<open>\<And>f.  \<lbrakk> A = dom f; a \<notin> dom f; f \<subseteq>\<^sub>m g \<rbrakk> \<Longrightarrow> upd a d (?fr (dom f)) = ?fr (dom f)\<close>
  31.114 +    note fin = \<open>finite A\<close> note anf = \<open>a \<notin> dom f\<close> note a'nA = \<open>a' \<notin> A\<close>
  31.115 +    note domf = \<open>insert a' A = dom f\<close> note fg = \<open>f \<subseteq>\<^sub>m g\<close>
  31.116      
  31.117      from domf obtain b where b: "f a' = Some b" by auto
  31.118      let ?f' = "f(a' := None)"
  31.119 @@ -485,7 +485,7 @@
  31.120      hence ga': "map_default d g a' = map_default d f a'" by(simp add: map_default_def)
  31.121      also from anf domf have "a \<noteq> a'" by auto note upd_commute[OF this]
  31.122      also from domf a'nA anf fg have "a \<notin> dom ?f'" "?f' \<subseteq>\<^sub>m g" and A: "A = dom ?f'" by(auto simp add: ran_def map_le_def)
  31.123 -    note A also note IH[OF A `a \<notin> dom ?f'` `?f' \<subseteq>\<^sub>m g`]
  31.124 +    note A also note IH[OF A \<open>a \<notin> dom ?f'\<close> \<open>?f' \<subseteq>\<^sub>m g\<close>]
  31.125      also have "upd a' (map_default d f a') (?fr (dom (f(a' := None)))) = ?fr (dom f)"
  31.126        unfolding domf[symmetric] gwf.fold_insert[OF fin a'nA] ga' unfolding A ..
  31.127      also have "insert a' (dom ?f') = dom f" using domf by auto
  31.128 @@ -507,13 +507,13 @@
  31.129    from fin anf fg show ?thesis
  31.130    proof(induct "dom f" arbitrary: f)
  31.131      case empty
  31.132 -    from `{} = dom f` have "f = empty" by(auto simp add: dom_def)
  31.133 +    from \<open>{} = dom f\<close> have "f = empty" by(auto simp add: dom_def)
  31.134      thus ?case by(auto simp add: finfun_const_def finfun_update_def upd_upd_twice)
  31.135    next
  31.136      case (insert a' A)
  31.137 -    note IH = `\<And>f. \<lbrakk>A = dom f; a \<notin> dom f; f \<subseteq>\<^sub>m g\<rbrakk> \<Longrightarrow> upd a d'' (upd a d' (?fr (dom f))) = upd a d'' (?fr (dom f))`
  31.138 -    note fin = `finite A` note anf = `a \<notin> dom f` note a'nA = `a' \<notin> A`
  31.139 -    note domf = `insert a' A = dom f` note fg = `f \<subseteq>\<^sub>m g`
  31.140 +    note IH = \<open>\<And>f. \<lbrakk>A = dom f; a \<notin> dom f; f \<subseteq>\<^sub>m g\<rbrakk> \<Longrightarrow> upd a d'' (upd a d' (?fr (dom f))) = upd a d'' (?fr (dom f))\<close>
  31.141 +    note fin = \<open>finite A\<close> note anf = \<open>a \<notin> dom f\<close> note a'nA = \<open>a' \<notin> A\<close>
  31.142 +    note domf = \<open>insert a' A = dom f\<close> note fg = \<open>f \<subseteq>\<^sub>m g\<close>
  31.143      
  31.144      from domf obtain b where b: "f a' = Some b" by auto
  31.145      let ?f' = "f(a' := None)"
  31.146 @@ -525,7 +525,7 @@
  31.147      also from anf domf have ana': "a \<noteq> a'" by auto note upd_commute[OF this]
  31.148      also note upd_commute[OF ana']
  31.149      also from domf a'nA anf fg have "a \<notin> dom ?f'" "?f' \<subseteq>\<^sub>m g" and A: "A = dom ?f'" by(auto simp add: ran_def map_le_def)
  31.150 -    note A also note IH[OF A `a \<notin> dom ?f'` `?f' \<subseteq>\<^sub>m g`]
  31.151 +    note A also note IH[OF A \<open>a \<notin> dom ?f'\<close> \<open>?f' \<subseteq>\<^sub>m g\<close>]
  31.152      also note upd_commute[OF ana'[symmetric]] also note ga'[symmetric] also note A[symmetric]
  31.153      also note gwf.fold_insert[symmetric, OF fin a'nA] also note domf
  31.154      finally show ?case .
  31.155 @@ -551,8 +551,8 @@
  31.156        case empty thus ?case by simp
  31.157      next
  31.158        case (insert a B)
  31.159 -      note finB = `finite B` note anB = `a \<notin> B` note sub = `insert a B \<subseteq> A`
  31.160 -      note IH = `B \<subseteq> A \<Longrightarrow> Finite_Set.fold f z B = Finite_Set.fold g z B`
  31.161 +      note finB = \<open>finite B\<close> note anB = \<open>a \<notin> B\<close> note sub = \<open>insert a B \<subseteq> A\<close>
  31.162 +      note IH = \<open>B \<subseteq> A \<Longrightarrow> Finite_Set.fold f z B = Finite_Set.fold g z B\<close>
  31.163        from sub anB have BpsubA: "B \<subset> A" and BsubA: "B \<subseteq> A" and aA: "a \<in> A" by auto
  31.164        from IH[OF BsubA] eq[OF aA] finB anB
  31.165        show ?case by(auto)
  31.166 @@ -770,7 +770,7 @@
  31.167        with True show "g' = empty"
  31.168          by -(rule map_default_inject(2)[OF _ fin g], auto)
  31.169      qed
  31.170 -    show ?thesis unfolding finfun_rec_def using `finite UNIV` True
  31.171 +    show ?thesis unfolding finfun_rec_def using \<open>finite UNIV\<close> True
  31.172        unfolding Let_def the default by(simp)
  31.173    next
  31.174      case False
  31.175 @@ -797,7 +797,7 @@
  31.176  
  31.177  end
  31.178  
  31.179 -subsection {* Weak induction rule and case analysis for FinFuns *}
  31.180 +subsection \<open>Weak induction rule and case analysis for FinFuns\<close>
  31.181  
  31.182  lemma finfun_weak_induct [consumes 0, case_names const update]:
  31.183    assumes const: "\<And>b. P (K$ b)"
  31.184 @@ -807,7 +807,7 @@
  31.185  proof(induct x rule: Abs_finfun_induct)
  31.186    case (Abs_finfun y)
  31.187    then obtain b where "finite {a. y a \<noteq> b}" unfolding finfun_def by blast
  31.188 -  thus ?case using `y \<in> finfun`
  31.189 +  thus ?case using \<open>y \<in> finfun\<close>
  31.190    proof(induct "{a. y a \<noteq> b}" arbitrary: y rule: finite_induct)
  31.191      case empty
  31.192      hence "\<And>a. y a = b" by blast
  31.193 @@ -816,9 +816,9 @@
  31.194      thus ?case by(simp add: const)
  31.195    next
  31.196      case (insert a A)
  31.197 -    note IH = `\<And>y. \<lbrakk> A = {a. y a \<noteq> b}; y \<in> finfun  \<rbrakk> \<Longrightarrow> P (Abs_finfun y)`
  31.198 -    note y = `y \<in> finfun`
  31.199 -    with `insert a A = {a. y a \<noteq> b}` `a \<notin> A`
  31.200 +    note IH = \<open>\<And>y. \<lbrakk> A = {a. y a \<noteq> b}; y \<in> finfun  \<rbrakk> \<Longrightarrow> P (Abs_finfun y)\<close>
  31.201 +    note y = \<open>y \<in> finfun\<close>
  31.202 +    with \<open>insert a A = {a. y a \<noteq> b}\<close> \<open>a \<notin> A\<close>
  31.203      have "A = {a'. (y(a := b)) a' \<noteq> b}" "y(a := b) \<in> finfun" by auto
  31.204      from IH[OF this] have "P (finfun_update (Abs_finfun (y(a := b))) a (y a))" by(rule update)
  31.205      thus ?case using y unfolding finfun_update_def by simp
  31.206 @@ -847,7 +847,7 @@
  31.207  qed
  31.208  
  31.209  
  31.210 -subsection {* Function application *}
  31.211 +subsection \<open>Function application\<close>
  31.212  
  31.213  notation finfun_apply (infixl "$" 999)
  31.214  
  31.215 @@ -905,7 +905,7 @@
  31.216    "((K$ b) = f(a $:= b')) = (b = b' \<and> (\<forall>a'. a \<noteq> a' \<longrightarrow> f $ a' = b))"
  31.217  by(auto simp add: expand_finfun_eq fun_eq_iff finfun_upd_apply)
  31.218  
  31.219 -subsection {* Function composition *}
  31.220 +subsection \<open>Function composition\<close>
  31.221  
  31.222  definition finfun_comp :: "('a \<Rightarrow> 'b) \<Rightarrow> 'c \<Rightarrow>f 'a \<Rightarrow> 'c \<Rightarrow>f 'b" (infixr "o$" 55)
  31.223  where [code del]: "g o$ f  = finfun_rec (\<lambda>b. (K$ g b)) (\<lambda>a b c. c(a $:= g b)) f"
  31.224 @@ -991,7 +991,7 @@
  31.225    with False show ?thesis by(auto simp add: finfun_comp2_def finfun_update_def)
  31.226  qed
  31.227  
  31.228 -subsection {* Universal quantification *}
  31.229 +subsection \<open>Universal quantification\<close>
  31.230  
  31.231  definition finfun_All_except :: "'a list \<Rightarrow> 'a \<Rightarrow>f bool \<Rightarrow> bool"
  31.232  where [code del]: "finfun_All_except A P \<equiv> \<forall>a. a \<in> set A \<or> P $ a"
  31.233 @@ -1035,7 +1035,7 @@
  31.234  by(simp add: finfun_Ex_def)
  31.235  
  31.236  
  31.237 -subsection {* A diagonal operator for FinFuns *}
  31.238 +subsection \<open>A diagonal operator for FinFuns\<close>
  31.239  
  31.240  definition finfun_Diag :: "'a \<Rightarrow>f 'b \<Rightarrow> 'a \<Rightarrow>f 'c \<Rightarrow> 'a \<Rightarrow>f ('b \<times> 'c)" ("(1'($_,/ _$'))" [0, 0] 1000)
  31.241  where [code del]: "($f, g$) = finfun_rec (\<lambda>b. Pair b \<circ>$ g) (\<lambda>a b c. c(a $:= (b, g $ a))) f"
  31.242 @@ -1061,9 +1061,9 @@
  31.243  lemma finfun_Diag_const1: "($K$ b, g$) = Pair b \<circ>$ g"
  31.244  by(simp add: finfun_Diag_def)
  31.245  
  31.246 -text {*
  31.247 +text \<open>
  31.248    Do not use @{thm finfun_Diag_const1} for the code generator because @{term "Pair b"} is injective, i.e. if @{term g} is free of redundant updates, there is no need to check for redundant updates as is done for @{term "op \<circ>$"}.
  31.249 -*}
  31.250 +\<close>
  31.251  
  31.252  lemma finfun_Diag_const_code [code]:
  31.253    "($K$ b, K$ c$) = (K$ (b, c))"
  31.254 @@ -1161,7 +1161,7 @@
  31.255  lemma finfun_Diag_collapse [simp]: "($finfun_fst f, finfun_snd f$) = f"
  31.256  by(induct f rule: finfun_weak_induct)(simp_all add: finfun_fst_const finfun_snd_const finfun_fst_update finfun_snd_update finfun_Diag_update_update)
  31.257  
  31.258 -subsection {* Currying for FinFuns *}
  31.259 +subsection \<open>Currying for FinFuns\<close>
  31.260  
  31.261  definition finfun_curry :: "('a \<times> 'b) \<Rightarrow>f 'c \<Rightarrow> 'a \<Rightarrow>f 'b \<Rightarrow>f 'c"
  31.262  where [code del]: "finfun_curry = finfun_rec (finfun_const \<circ> finfun_const) (\<lambda>(a, b) c f. f(a $:= (f $ a)(b $:= c)))"
  31.263 @@ -1234,7 +1234,7 @@
  31.264    thus ?thesis by(auto simp add: fun_eq_iff)
  31.265  qed
  31.266  
  31.267 -subsection {* Executable equality for FinFuns *}
  31.268 +subsection \<open>Executable equality for FinFuns\<close>
  31.269  
  31.270  lemma eq_finfun_All_ext: "(f = g) \<longleftrightarrow> finfun_All ((\<lambda>(x, y). x = y) \<circ>$ ($f, g$))"
  31.271  by(simp add: expand_finfun_eq fun_eq_iff finfun_All_All o_def)
  31.272 @@ -1248,7 +1248,7 @@
  31.273    "HOL.equal (f :: _ \<Rightarrow>f _) f \<longleftrightarrow> True"
  31.274    by (fact equal_refl)
  31.275  
  31.276 -subsection {* An operator that explicitly removes all redundant updates in the generated representations *}
  31.277 +subsection \<open>An operator that explicitly removes all redundant updates in the generated representations\<close>
  31.278  
  31.279  definition finfun_clearjunk :: "'a \<Rightarrow>f 'b \<Rightarrow> 'a \<Rightarrow>f 'b"
  31.280  where [simp, code del]: "finfun_clearjunk = id"
  31.281 @@ -1260,7 +1260,7 @@
  31.282    "finfun_clearjunk (finfun_update_code f a b) = f(a $:= b)"
  31.283  by simp
  31.284  
  31.285 -subsection {* The domain of a FinFun as a FinFun *}
  31.286 +subsection \<open>The domain of a FinFun as a FinFun\<close>
  31.287  
  31.288  definition finfun_dom :: "('a \<Rightarrow>f 'b) \<Rightarrow> ('a \<Rightarrow>f bool)"
  31.289  where [code del]: "finfun_dom f = Abs_finfun (\<lambda>a. f $ a \<noteq> finfun_default f)"
  31.290 @@ -1270,10 +1270,10 @@
  31.291  unfolding finfun_dom_def finfun_default_const
  31.292  by(auto)(simp_all add: finfun_const_def)
  31.293  
  31.294 -text {*
  31.295 +text \<open>
  31.296    @{term "finfun_dom" } raises an exception when called on a FinFun whose domain is a finite type. 
  31.297    For such FinFuns, the default value (and as such the domain) is undefined.
  31.298 -*}
  31.299 +\<close>
  31.300  
  31.301  lemma finfun_dom_const_code [code]:
  31.302    "finfun_dom ((K$ c) :: ('a :: card_UNIV) \<Rightarrow>f 'b) = 
  31.303 @@ -1311,7 +1311,7 @@
  31.304  qed
  31.305  
  31.306  
  31.307 -subsection {* The domain of a FinFun as a sorted list *}
  31.308 +subsection \<open>The domain of a FinFun as a sorted list\<close>
  31.309  
  31.310  definition finfun_to_list :: "('a :: linorder) \<Rightarrow>f 'b \<Rightarrow> 'a list"
  31.311  where
  31.312 @@ -1422,7 +1422,7 @@
  31.313          assume "set xs' = {x. finfun_dom f $ x} \<and> sorted xs' \<and> distinct xs'"
  31.314          thus "xs' = remove1 a xs" using 1 by(blast intro: sorted_distinct_set_unique)
  31.315        qed
  31.316 -      thus ?thesis using False eq `b \<noteq> finfun_default f` 
  31.317 +      thus ?thesis using False eq \<open>b \<noteq> finfun_default f\<close> 
  31.318          by (simp add: insort_insert_insort insort_remove1)
  31.319      qed
  31.320    qed
  31.321 @@ -1433,7 +1433,7 @@
  31.322    (if b = finfun_default f then List.remove1 a (finfun_to_list f) else List.insort_insert a (finfun_to_list f))"
  31.323  by(simp add: finfun_to_list_update)
  31.324  
  31.325 -text {* More type class instantiations *}
  31.326 +text \<open>More type class instantiations\<close>
  31.327  
  31.328  lemma card_eq_1_iff: "card A = 1 \<longleftrightarrow> A \<noteq> {} \<and> (\<forall>x\<in>A. \<forall>y\<in>A. x = y)"
  31.329    (is "?lhs \<longleftrightarrow> ?rhs")
  31.330 @@ -1442,11 +1442,11 @@
  31.331    moreover {
  31.332      fix x y
  31.333      assume A: "x \<in> A" "y \<in> A" and neq: "x \<noteq> y"
  31.334 -    have "finite A" using `?lhs` by(simp add: card_ge_0_finite)
  31.335 +    have "finite A" using \<open>?lhs\<close> by(simp add: card_ge_0_finite)
  31.336      from neq have "2 = card {x, y}" by simp
  31.337 -    also have "\<dots> \<le> card A" using A `finite A`
  31.338 +    also have "\<dots> \<le> card A" using A \<open>finite A\<close>
  31.339        by(auto intro: card_mono)
  31.340 -    finally have False using `?lhs` by simp }
  31.341 +    finally have False using \<open>?lhs\<close> by simp }
  31.342    ultimately show ?rhs by auto
  31.343  next
  31.344    assume ?rhs
  31.345 @@ -1486,9 +1486,9 @@
  31.346        unfolding type_definition.Abs_image[OF type_definition_finfun, symmetric] F_def
  31.347        by(rule finite_imageD)(auto intro: inj_onI simp add: Abs_finfun_inject)
  31.348      hence "finite (range ?f)" 
  31.349 -      by(rule finite_subset[rotated 1])(auto simp add: F_def finfun_def `b1 \<noteq> b2` intro!: exI[where x=b2])
  31.350 +      by(rule finite_subset[rotated 1])(auto simp add: F_def finfun_def \<open>b1 \<noteq> b2\<close> intro!: exI[where x=b2])
  31.351      thus "finite (UNIV :: 'a set)"
  31.352 -      by(rule finite_imageD)(auto intro: inj_onI simp add: fun_eq_iff `b1 \<noteq> b2` split: split_if_asm)
  31.353 +      by(rule finite_imageD)(auto intro: inj_onI simp add: fun_eq_iff \<open>b1 \<noteq> b2\<close> split: split_if_asm)
  31.354      
  31.355      from finite have "finite (range (\<lambda>b. ((K$ b) :: 'a \<Rightarrow>f 'b)))"
  31.356        by(rule finite_subset[rotated 1]) simp
  31.357 @@ -1526,7 +1526,7 @@
  31.358  instance by intro_classes (simp add: card_UNIV_finfun_def card_UNIV Let_def card_UNIV_finfun)
  31.359  end
  31.360  
  31.361 -text {* Deactivate syntax again. Import theory @{text FinFun_Syntax} to reactivate it again *}
  31.362 +text \<open>Deactivate syntax again. Import theory @{text FinFun_Syntax} to reactivate it again\<close>
  31.363  
  31.364  no_type_notation
  31.365    finfun ("(_ =>f /_)" [22, 21] 21)
    32.1 --- a/src/HOL/Library/FinFun_Syntax.thy	Wed Jun 17 10:57:11 2015 +0200
    32.2 +++ b/src/HOL/Library/FinFun_Syntax.thy	Wed Jun 17 11:03:05 2015 +0200
    32.3 @@ -1,6 +1,6 @@
    32.4  (* Author: Andreas Lochbihler, KIT *)
    32.5  
    32.6 -section {* Pretty syntax for almost everywhere constant functions *}
    32.7 +section \<open>Pretty syntax for almost everywhere constant functions\<close>
    32.8  
    32.9  theory FinFun_Syntax
   32.10  imports FinFun
    33.1 --- a/src/HOL/Library/Finite_Lattice.thy	Wed Jun 17 10:57:11 2015 +0200
    33.2 +++ b/src/HOL/Library/Finite_Lattice.thy	Wed Jun 17 11:03:05 2015 +0200
    33.3 @@ -6,7 +6,7 @@
    33.4  imports Product_Order
    33.5  begin
    33.6  
    33.7 -text {* A non-empty finite lattice is a complete lattice.
    33.8 +text \<open>A non-empty finite lattice is a complete lattice.
    33.9  Since types are never empty in Isabelle/HOL,
   33.10  a type of classes @{class finite} and @{class lattice}
   33.11  should also have class @{class complete_lattice}.
   33.12 @@ -15,7 +15,7 @@
   33.13  with the operators @{const bot}, @{const top}, @{const Inf}, and @{const Sup},
   33.14  along with assumptions that define these operators
   33.15  in terms of the ones of classes @{class finite} and @{class lattice}.
   33.16 -The resulting class is a subclass of @{class complete_lattice}. *}
   33.17 +The resulting class is a subclass of @{class complete_lattice}.\<close>
   33.18  
   33.19  class finite_lattice_complete = finite + lattice + bot + top + Inf + Sup +
   33.20    assumes bot_def: "bot = Inf_fin UNIV"
   33.21 @@ -23,10 +23,10 @@
   33.22    assumes Inf_def: "Inf A = Finite_Set.fold inf top A"
   33.23    assumes Sup_def: "Sup A = Finite_Set.fold sup bot A"
   33.24  
   33.25 -text {* The definitional assumptions
   33.26 +text \<open>The definitional assumptions
   33.27  on the operators @{const bot} and @{const top}
   33.28  of class @{class finite_lattice_complete}
   33.29 -ensure that they yield bottom and top. *}
   33.30 +ensure that they yield bottom and top.\<close>
   33.31  
   33.32  lemma finite_lattice_complete_bot_least: "(bot::'a::finite_lattice_complete) \<le> x"
   33.33    by (auto simp: bot_def intro: Inf_fin.coboundedI)
   33.34 @@ -42,10 +42,10 @@
   33.35  
   33.36  instance finite_lattice_complete \<subseteq> bounded_lattice ..
   33.37  
   33.38 -text {* The definitional assumptions
   33.39 +text \<open>The definitional assumptions
   33.40  on the operators @{const Inf} and @{const Sup}
   33.41  of class @{class finite_lattice_complete}
   33.42 -ensure that they yield infimum and supremum. *}
   33.43 +ensure that they yield infimum and supremum.\<close>
   33.44  
   33.45  lemma finite_lattice_complete_Inf_empty: "Inf {} = (top :: 'a::finite_lattice_complete)"
   33.46    by (simp add: Inf_def)
   33.47 @@ -101,7 +101,7 @@
   33.48    finite_lattice_complete_Inf_empty
   33.49    finite_lattice_complete_Sup_empty)
   33.50  
   33.51 -text {* The product of two finite lattices is already a finite lattice. *}
   33.52 +text \<open>The product of two finite lattices is already a finite lattice.\<close>
   33.53  
   33.54  lemma finite_bot_prod:
   33.55    "(bot :: ('a::finite_lattice_complete \<times> 'b::finite_lattice_complete)) =
   33.56 @@ -126,8 +126,8 @@
   33.57  instance prod :: (finite_lattice_complete, finite_lattice_complete) finite_lattice_complete
   33.58    by default (auto simp: finite_bot_prod finite_top_prod finite_Inf_prod finite_Sup_prod)
   33.59  
   33.60 -text {* Functions with a finite domain and with a finite lattice as codomain
   33.61 -already form a finite lattice. *}
   33.62 +text \<open>Functions with a finite domain and with a finite lattice as codomain
   33.63 +already form a finite lattice.\<close>
   33.64  
   33.65  lemma finite_bot_fun: "(bot :: ('a::finite \<Rightarrow> 'b::finite_lattice_complete)) = Inf_fin UNIV"
   33.66    by (metis Inf_UNIV Inf_fin_Inf empty_not_UNIV finite_code)
   33.67 @@ -149,11 +149,11 @@
   33.68    by default (auto simp: finite_bot_fun finite_top_fun finite_Inf_fun finite_Sup_fun)
   33.69  
   33.70  
   33.71 -subsection {* Finite Distributive Lattices *}
   33.72 +subsection \<open>Finite Distributive Lattices\<close>
   33.73  
   33.74 -text {* A finite distributive lattice is a complete lattice
   33.75 +text \<open>A finite distributive lattice is a complete lattice
   33.76  whose @{const inf} and @{const sup} operators
   33.77 -distribute over @{const Sup} and @{const Inf}. *}
   33.78 +distribute over @{const Sup} and @{const Inf}.\<close>
   33.79  
   33.80  class finite_distrib_lattice_complete =
   33.81    distrib_lattice + finite_lattice_complete
   33.82 @@ -177,42 +177,42 @@
   33.83    finite_distrib_lattice_complete_sup_Inf
   33.84    finite_distrib_lattice_complete_inf_Sup)
   33.85  
   33.86 -text {* The product of two finite distributive lattices
   33.87 -is already a finite distributive lattice. *}
   33.88 +text \<open>The product of two finite distributive lattices
   33.89 +is already a finite distributive lattice.\<close>
   33.90  
   33.91  instance prod ::
   33.92    (finite_distrib_lattice_complete, finite_distrib_lattice_complete)
   33.93    finite_distrib_lattice_complete
   33.94    ..
   33.95  
   33.96 -text {* Functions with a finite domain
   33.97 +text \<open>Functions with a finite domain
   33.98  and with a finite distributive lattice as codomain
   33.99 -already form a finite distributive lattice. *}
  33.100 +already form a finite distributive lattice.\<close>
  33.101  
  33.102  instance "fun" ::
  33.103    (finite, finite_distrib_lattice_complete) finite_distrib_lattice_complete
  33.104    ..
  33.105  
  33.106  
  33.107 -subsection {* Linear Orders *}
  33.108 +subsection \<open>Linear Orders\<close>
  33.109  
  33.110 -text {* A linear order is a distributive lattice.
  33.111 +text \<open>A linear order is a distributive lattice.
  33.112  A type class is defined
  33.113  that extends class @{class linorder}
  33.114  with the operators @{const inf} and @{const sup},
  33.115  along with assumptions that define these operators
  33.116  in terms of the ones of class @{class linorder}.
  33.117 -The resulting class is a subclass of @{class distrib_lattice}. *}
  33.118 +The resulting class is a subclass of @{class distrib_lattice}.\<close>
  33.119  
  33.120  class linorder_lattice = linorder + inf + sup +
  33.121    assumes inf_def: "inf x y = (if x \<le> y then x else y)"
  33.122    assumes sup_def: "sup x y = (if x \<ge> y then x else y)"
  33.123  
  33.124 -text {* The definitional assumptions
  33.125 +text \<open>The definitional assumptions
  33.126  on the operators @{const inf} and @{const sup}
  33.127  of class @{class linorder_lattice}
  33.128  ensure that they yield infimum and supremum
  33.129 -and that they distribute over each other. *}
  33.130 +and that they distribute over each other.\<close>
  33.131  
  33.132  lemma linorder_lattice_inf_le1: "inf (x::'a::linorder_lattice) y \<le> x"
  33.133    unfolding inf_def by (metis (full_types) linorder_linear)
  33.134 @@ -250,17 +250,17 @@
  33.135    linorder_lattice_sup_inf_distrib1)
  33.136  
  33.137  
  33.138 -subsection {* Finite Linear Orders *}
  33.139 +subsection \<open>Finite Linear Orders\<close>
  33.140  
  33.141 -text {* A (non-empty) finite linear order is a complete linear order. *}
  33.142 +text \<open>A (non-empty) finite linear order is a complete linear order.\<close>
  33.143  
  33.144  class finite_linorder_complete = linorder_lattice + finite_lattice_complete
  33.145  
  33.146  instance finite_linorder_complete \<subseteq> complete_linorder ..
  33.147  
  33.148 -text {* A (non-empty) finite linear order is a complete lattice
  33.149 +text \<open>A (non-empty) finite linear order is a complete lattice
  33.150  whose @{const inf} and @{const sup} operators
  33.151 -distribute over @{const Sup} and @{const Inf}. *}
  33.152 +distribute over @{const Sup} and @{const Inf}.\<close>
  33.153  
  33.154  instance finite_linorder_complete \<subseteq> finite_distrib_lattice_complete ..
  33.155  
    34.1 --- a/src/HOL/Library/Float.thy	Wed Jun 17 10:57:11 2015 +0200
    34.2 +++ b/src/HOL/Library/Float.thy	Wed Jun 17 11:03:05 2015 +0200
    34.3 @@ -3,7 +3,7 @@
    34.4      Copyright   2012  TU München
    34.5  *)
    34.6  
    34.7 -section {* Floating-Point Numbers *}
    34.8 +section \<open>Floating-Point Numbers\<close>
    34.9  
   34.10  theory Float
   34.11  imports Complex_Main Lattice_Algebras
   34.12 @@ -43,7 +43,7 @@
   34.13  lemma real_float[simp]: "x \<in> float \<Longrightarrow> real (float_of x) = x"
   34.14    unfolding real_of_float_def by (rule float_of_inverse)
   34.15  
   34.16 -subsection {* Real operations preserving the representation as floating point number *}
   34.17 +subsection \<open>Real operations preserving the representation as floating point number\<close>
   34.18  
   34.19  lemma floatI: fixes m e :: int shows "m * 2 powr e = x \<Longrightarrow> x \<in> float"
   34.20    by (auto simp: float_def)
   34.21 @@ -161,7 +161,7 @@
   34.22  
   34.23  code_datatype Float
   34.24  
   34.25 -subsection {* Arithmetic operations on floating point numbers *}
   34.26 +subsection \<open>Arithmetic operations on floating point numbers\<close>
   34.27  
   34.28  instantiation float :: "{ring_1, linorder, linordered_ring, linordered_idom, numeral, equal}"
   34.29  begin
   34.30 @@ -264,7 +264,7 @@
   34.31      and float_of_neg_numeral[simp]: "- numeral k = float_of (- numeral k)"
   34.32    unfolding real_of_float_eq by simp_all
   34.33  
   34.34 -subsection {* Quickcheck *}
   34.35 +subsection \<open>Quickcheck\<close>
   34.36  
   34.37  instantiation float :: exhaustive
   34.38  begin
   34.39 @@ -304,7 +304,7 @@
   34.40  end
   34.41  
   34.42  
   34.43 -subsection {* Represent floats as unique mantissa and exponent *}
   34.44 +subsection \<open>Represent floats as unique mantissa and exponent\<close>
   34.45  
   34.46  lemma int_induct_abs[case_names less]:
   34.47    fixes j :: int
   34.48 @@ -320,7 +320,7 @@
   34.49    case (less n)
   34.50    { fix m assume n: "n \<noteq> 0" "n = m * r"
   34.51      then have "\<bar>m \<bar> < \<bar>n\<bar>"
   34.52 -      using `1 < r` by (simp add: abs_mult)
   34.53 +      using \<open>1 < r\<close> by (simp add: abs_mult)
   34.54      from less[OF this] n have "\<exists>k i. n = k * r ^ Suc i \<and> \<not> r dvd k" by auto }
   34.55    then show ?case
   34.56      by (metis dvd_def monoid_mult_class.mult.right_neutral mult.commute power_0)
   34.57 @@ -333,7 +333,7 @@
   34.58  proof
   34.59    have "m1 \<noteq> 0" using m1 unfolding dvd_def by auto
   34.60    assume eq: "m1 * 2 powr e1 = m2 * 2 powr e2"
   34.61 -  with `e1 \<le> e2` have "m1 = m2 * 2 powr nat (e2 - e1)"
   34.62 +  with \<open>e1 \<le> e2\<close> have "m1 = m2 * 2 powr nat (e2 - e1)"
   34.63      by (simp add: powr_divide2[symmetric] field_simps)
   34.64    also have "\<dots> = m2 * 2^nat (e2 - e1)"
   34.65      by (simp add: powr_realpow)
   34.66 @@ -342,7 +342,7 @@
   34.67    with m1 have "m1 = m2"
   34.68      by (cases "nat (e2 - e1)") (auto simp add: dvd_def)
   34.69    then show "m1 = m2 \<and> e1 = e2"
   34.70 -    using eq `m1 \<noteq> 0` by (simp add: powr_inj)
   34.71 +    using eq \<open>m1 \<noteq> 0\<close> by (simp add: powr_inj)
   34.72  qed simp
   34.73  
   34.74  lemma mult_powr_eq_mult_powr_iff:
   34.75 @@ -359,9 +359,9 @@
   34.76  proof atomize_elim
   34.77    { assume "x \<noteq> 0"
   34.78      from x obtain m e :: int where x: "x = m * 2 powr e" by (auto simp: float_def)
   34.79 -    with `x \<noteq> 0` int_cancel_factors[of 2 m] obtain k i where "m = k * 2 ^ i" "\<not> 2 dvd k"
   34.80 +    with \<open>x \<noteq> 0\<close> int_cancel_factors[of 2 m] obtain k i where "m = k * 2 ^ i" "\<not> 2 dvd k"
   34.81        by auto
   34.82 -    with `\<not> 2 dvd k` x have "\<exists>(m::int) (e::int). x = m * 2 powr e \<and> \<not> (2::int) dvd m"
   34.83 +    with \<open>\<not> 2 dvd k\<close> x have "\<exists>(m::int) (e::int). x = m * 2 powr e \<and> \<not> (2::int) dvd m"
   34.84        by (rule_tac exI[of _ "k"], rule_tac exI[of _ "e + int i"])
   34.85           (simp add: powr_add powr_realpow) }
   34.86    then show "x = 0 \<or> (\<exists>(m::int) (e::int). x = m * 2 powr e \<and> \<not> (2::int) dvd m \<and> x \<noteq> 0)"
   34.87 @@ -434,7 +434,7 @@
   34.88      by (auto simp: mult_powr_eq_mult_powr_iff)
   34.89  qed
   34.90  
   34.91 -subsection {* Compute arithmetic operations *}
   34.92 +subsection \<open>Compute arithmetic operations\<close>
   34.93  
   34.94  lemma Float_mantissa_exponent: "Float (mantissa f) (exponent f) = f"
   34.95    unfolding real_of_float_eq mantissa_exponent[of f] by simp
   34.96 @@ -467,7 +467,7 @@
   34.97        using eq by simp
   34.98      then have "mantissa f = m * 2^nat (e - exponent f)"
   34.99        unfolding real_of_int_inject by simp
  34.100 -    with `exponent f < e` have "2 dvd mantissa f"
  34.101 +    with \<open>exponent f < e\<close> have "2 dvd mantissa f"
  34.102        apply (intro dvdI[where k="m * 2^(nat (e-exponent f)) div 2"])
  34.103        apply (cases "nat (e - exponent f)")
  34.104        apply auto
  34.105 @@ -476,7 +476,7 @@
  34.106    qed
  34.107    ultimately have "real m = mantissa f * 2^nat (exponent f - e)"
  34.108      by (simp add: powr_realpow[symmetric])
  34.109 -  with `e \<le> exponent f`
  34.110 +  with \<open>e \<le> exponent f\<close>
  34.111    show "m = mantissa f * 2 ^ nat (exponent f - e)" "e = exponent f - nat (exponent f - e)"
  34.112      unfolding real_of_int_inject by auto
  34.113  qed
  34.114 @@ -564,7 +564,7 @@
  34.115  hide_fact (open) compute_float_eq
  34.116  
  34.117  
  34.118 -subsection {* Lemmas for types @{typ real}, @{typ nat}, @{typ int}*}
  34.119 +subsection \<open>Lemmas for types @{typ real}, @{typ nat}, @{typ int}\<close>
  34.120  
  34.121  lemmas real_of_ints =
  34.122    real_of_int_zero
  34.123 @@ -588,7 +588,7 @@
  34.124  lemmas nat_of_reals = real_of_nats[symmetric]
  34.125  
  34.126  
  34.127 -subsection {* Rounding Real Numbers *}
  34.128 +subsection \<open>Rounding Real Numbers\<close>
  34.129  
  34.130  definition round_down :: "int \<Rightarrow> real \<Rightarrow> real" where
  34.131    "round_down prec x = floor (x * 2 powr prec) * 2 powr -prec"
  34.132 @@ -663,9 +663,9 @@
  34.133  proof -
  34.134    have "x * 2 powr p < 1 / 2 * 2 powr p"
  34.135      using assms by simp
  34.136 -  also have "\<dots> \<le> 2 powr p - 1" using `p > 0`
  34.137 +  also have "\<dots> \<le> 2 powr p - 1" using \<open>p > 0\<close>
  34.138      by (auto simp: powr_divide2[symmetric] powr_int field_simps self_le_power)
  34.139 -  finally show ?thesis using `p > 0`
  34.140 +  finally show ?thesis using \<open>p > 0\<close>
  34.141      by (simp add: round_up_def field_simps powr_minus powr_int ceiling_less_eq)
  34.142  qed
  34.143  
  34.144 @@ -705,7 +705,7 @@
  34.145    by (auto simp: field_simps mult_le_0_iff zero_le_mult_iff)
  34.146  
  34.147  
  34.148 -subsection {* Rounding Floats *}
  34.149 +subsection \<open>Rounding Floats\<close>
  34.150  
  34.151  definition div_twopow::"int \<Rightarrow> nat \<Rightarrow> int" where [simp]: "div_twopow x n = x div (2 ^ n)"
  34.152  
  34.153 @@ -763,7 +763,7 @@
  34.154    also have "... = 1 / 2 powr p / 2 powr e"
  34.155      unfolding powr_minus_divide real_of_int_minus by (simp add: powr_add)
  34.156    finally show ?thesis
  34.157 -    using `p + e < 0`
  34.158 +    using \<open>p + e < 0\<close>
  34.159      by transfer (simp add: ac_simps round_down_def floor_divide_eq_div[symmetric])
  34.160  next
  34.161    assume "\<not> p + e < 0"
  34.162 @@ -771,7 +771,7 @@
  34.163    have r: "\<lfloor>(m * 2 powr e) * 2 powr real p\<rfloor> = (m * 2 powr e) * 2 powr real p"
  34.164      by (auto intro: exI[where x="m*2^nat (e+p)"]
  34.165               simp add: ac_simps powr_add[symmetric] r powr_realpow)
  34.166 -  with `\<not> p + e < 0` show ?thesis
  34.167 +  with \<open>\<not> p + e < 0\<close> show ?thesis
  34.168      by transfer (auto simp add: round_down_def field_simps powr_add powr_minus)
  34.169  qed
  34.170  hide_fact (open) compute_float_down
  34.171 @@ -791,16 +791,16 @@
  34.172  proof cases
  34.173    assume "\<not> b dvd a"
  34.174    hence "a mod b \<noteq> 0" by auto
  34.175 -  hence ne: "real (a mod b) / real b \<noteq> 0" using `b \<noteq> 0` by auto
  34.176 +  hence ne: "real (a mod b) / real b \<noteq> 0" using \<open>b \<noteq> 0\<close> by auto
  34.177    have "\<lceil>real a / real b\<rceil> = \<lfloor>real a / real b\<rfloor> + 1"
  34.178    apply (rule ceiling_eq) apply (auto simp: floor_divide_eq_div[symmetric])
  34.179    proof -
  34.180      have "real \<lfloor>real a / real b\<rfloor> \<le> real a / real b" by simp
  34.181      moreover have "real \<lfloor>real a / real b\<rfloor> \<noteq> real a / real b"
  34.182 -    apply (subst (2) real_of_int_div_aux) unfolding floor_divide_eq_div using ne `b \<noteq> 0` by auto
  34.183 +    apply (subst (2) real_of_int_div_aux) unfolding floor_divide_eq_div using ne \<open>b \<noteq> 0\<close> by auto
  34.184      ultimately show "real \<lfloor>real a / real b\<rfloor> < real a / real b" by arith
  34.185    qed
  34.186 -  thus ?thesis using `\<not> b dvd a` by simp
  34.187 +  thus ?thesis using \<open>\<not> b dvd a\<close> by simp
  34.188  qed (simp add: ceiling_def real_of_int_minus[symmetric] divide_minus_left[symmetric]
  34.189    floor_divide_eq_div dvd_neg_div del: divide_minus_left real_of_int_minus)
  34.190  
  34.191 @@ -810,7 +810,7 @@
  34.192  hide_fact (open) compute_float_up
  34.193  
  34.194  
  34.195 -subsection {* Compute bitlen of integers *}
  34.196 +subsection \<open>Compute bitlen of integers\<close>
  34.197  
  34.198  definition bitlen :: "int \<Rightarrow> int" where
  34.199    "bitlen a = (if a > 0 then \<lfloor>log 2 a\<rfloor> + 1 else 0)"
  34.200 @@ -820,7 +820,7 @@
  34.201    {
  34.202      assume "0 > x"
  34.203      have "-1 = log 2 (inverse 2)" by (subst log_inverse) simp_all
  34.204 -    also have "... < log 2 (-x)" using `0 > x` by auto
  34.205 +    also have "... < log 2 (-x)" using \<open>0 > x\<close> by auto
  34.206      finally have "-1 < log 2 (-x)" .
  34.207    } thus "0 \<le> bitlen x" unfolding bitlen_def by (auto intro!: add_nonneg_nonneg)
  34.208  qed
  34.209 @@ -830,22 +830,22 @@
  34.210    shows "2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)"
  34.211  proof
  34.212    have "(2::real) ^ nat \<lfloor>log 2 (real x)\<rfloor> = 2 powr real (floor (log 2 (real x)))"
  34.213 -    using powr_realpow[symmetric, of 2 "nat \<lfloor>log 2 (real x)\<rfloor>"] `x > 0`
  34.214 +    using powr_realpow[symmetric, of 2 "nat \<lfloor>log 2 (real x)\<rfloor>"] \<open>x > 0\<close>
  34.215      using real_nat_eq_real[of "floor (log 2 (real x))"]
  34.216      by simp
  34.217    also have "... \<le> 2 powr log 2 (real x)"
  34.218      by simp
  34.219    also have "... = real x"
  34.220 -    using `0 < x` by simp
  34.221 +    using \<open>0 < x\<close> by simp
  34.222    finally have "2 ^ nat \<lfloor>log 2 (real x)\<rfloor> \<le> real x" by simp
  34.223 -  thus "2 ^ nat (bitlen x - 1) \<le> x" using `x > 0`
  34.224 +  thus "2 ^ nat (bitlen x - 1) \<le> x" using \<open>x > 0\<close>
  34.225      by (simp add: bitlen_def)
  34.226  next
  34.227 -  have "x \<le> 2 powr (log 2 x)" using `x > 0` by simp
  34.228 +  have "x \<le> 2 powr (log 2 x)" using \<open>x > 0\<close> by simp
  34.229    also have "... < 2 ^ nat (\<lfloor>log 2 (real x)\<rfloor> + 1)"
  34.230      apply (simp add: powr_realpow[symmetric])
  34.231 -    using `x > 0` by simp
  34.232 -  finally show "x < 2 ^ nat (bitlen x)" using `x > 0`
  34.233 +    using \<open>x > 0\<close> by simp
  34.234 +  finally show "x < 2 ^ nat (bitlen x)" using \<open>x > 0\<close>
  34.235      by (simp add: bitlen_def ac_simps)
  34.236  qed
  34.237  
  34.238 @@ -874,7 +874,7 @@
  34.239      by (simp add: mantissa_noteq_0)
  34.240    moreover
  34.241    obtain i where "m = mantissa f * 2 ^ i" "e = exponent f - int i"
  34.242 -    by (rule f_def[THEN denormalize_shift, OF `f \<noteq> float_of 0`])
  34.243 +    by (rule f_def[THEN denormalize_shift, OF \<open>f \<noteq> float_of 0\<close>])
  34.244    ultimately show ?thesis by (simp add: abs_mult)
  34.245  qed
  34.246  
  34.247 @@ -890,28 +890,28 @@
  34.248      next
  34.249        def n \<equiv> "\<lfloor>log 2 (real x)\<rfloor>"
  34.250        then have "0 \<le> n"
  34.251 -        using `2 \<le> x` by simp
  34.252 +        using \<open>2 \<le> x\<close> by simp
  34.253        assume "x mod 2 \<noteq> 0"
  34.254 -      with `2 \<le> x` have "x mod 2 = 1" "\<not> 2 dvd x" by (auto simp add: dvd_eq_mod_eq_0)
  34.255 -      with `2 \<le> x` have "x \<noteq> 2^nat n" by (cases "nat n") auto
  34.256 +      with \<open>2 \<le> x\<close> have "x mod 2 = 1" "\<not> 2 dvd x" by (auto simp add: dvd_eq_mod_eq_0)
  34.257 +      with \<open>2 \<le> x\<close> have "x \<noteq> 2^nat n" by (cases "nat n") auto
  34.258        moreover
  34.259        { have "real (2^nat n :: int) = 2 powr (nat n)"
  34.260            by (simp add: powr_realpow)
  34.261          also have "\<dots> \<le> 2 powr (log 2 x)"
  34.262 -          using `2 \<le> x` by (simp add: n_def del: powr_log_cancel)
  34.263 -        finally have "2^nat n \<le> x" using `2 \<le> x` by simp }
  34.264 +          using \<open>2 \<le> x\<close> by (simp add: n_def del: powr_log_cancel)
  34.265 +        finally have "2^nat n \<le> x" using \<open>2 \<le> x\<close> by simp }
  34.266        ultimately have "2^nat n \<le> x - 1" by simp
  34.267        then have "2^nat n \<le> real (x - 1)"
  34.268          unfolding real_of_int_le_iff[symmetric] by simp
  34.269        { have "n = \<lfloor>log 2 (2^nat n)\<rfloor>"
  34.270 -          using `0 \<le> n` by (simp add: log_nat_power)
  34.271 +          using \<open>0 \<le> n\<close> by (simp add: log_nat_power)
  34.272          also have "\<dots> \<le> \<lfloor>log 2 (x - 1)\<rfloor>"
  34.273 -          using `2^nat n \<le> real (x - 1)` `0 \<le> n` `2 \<le> x` by (auto intro: floor_mono)
  34.274 +          using \<open>2^nat n \<le> real (x - 1)\<close> \<open>0 \<le> n\<close> \<open>2 \<le> x\<close> by (auto intro: floor_mono)
  34.275          finally have "n \<le> \<lfloor>log 2 (x - 1)\<rfloor>" . }
  34.276        moreover have "\<lfloor>log 2 (x - 1)\<rfloor> \<le> n"
  34.277 -        using `2 \<le> x` by (auto simp add: n_def intro!: floor_mono)
  34.278 +        using \<open>2 \<le> x\<close> by (auto simp add: n_def intro!: floor_mono)
  34.279        ultimately show "\<lfloor>log 2 (x - x mod 2)\<rfloor> = \<lfloor>log 2 x\<rfloor>"
  34.280 -        unfolding n_def `x mod 2 = 1` by auto
  34.281 +        unfolding n_def \<open>x mod 2 = 1\<close> by auto
  34.282      qed
  34.283      finally have "\<lfloor>log 2 (x div 2)\<rfloor> + 1 = \<lfloor>log 2 x\<rfloor>" . }
  34.284    moreover
  34.285 @@ -934,7 +934,7 @@
  34.286    hence "m \<noteq> 0" by auto
  34.287    show ?thesis
  34.288    proof (cases "0 \<le> e")
  34.289 -    case True thus ?thesis using `0 < m`  by (simp add: bitlen_def)
  34.290 +    case True thus ?thesis using \<open>0 < m\<close>  by (simp add: bitlen_def)
  34.291    next
  34.292      have "(1::int) < 2" by simp
  34.293      case False let ?S = "2^(nat (-e))"
  34.294 @@ -945,8 +945,8 @@
  34.295      hence "1 * ?S \<le> real m * inverse ?S * ?S" by (rule mult_right_mono, auto)
  34.296      hence "?S \<le> real m" unfolding mult.assoc by auto
  34.297      hence "?S \<le> m" unfolding real_of_int_le_iff[symmetric] by auto
  34.298 -    from this bitlen_bounds[OF `0 < m`, THEN conjunct2]
  34.299 -    have "nat (-e) < (nat (bitlen m))" unfolding power_strict_increasing_iff[OF `1 < 2`, symmetric]
  34.300 +    from this bitlen_bounds[OF \<open>0 < m\<close>, THEN conjunct2]
  34.301 +    have "nat (-e) < (nat (bitlen m))" unfolding power_strict_increasing_iff[OF \<open>1 < 2\<close>, symmetric]
  34.302        by (rule order_le_less_trans)
  34.303      hence "-e < bitlen m" using False by auto
  34.304      thus ?thesis by auto
  34.305 @@ -959,22 +959,22 @@
  34.306  proof -
  34.307    let ?B = "2^nat(bitlen m - 1)"
  34.308  
  34.309 -  have "?B \<le> m" using bitlen_bounds[OF `0 <m`] ..
  34.310 +  have "?B \<le> m" using bitlen_bounds[OF \<open>0 <m\<close>] ..
  34.311    hence "1 * ?B \<le> real m" unfolding real_of_int_le_iff[symmetric] by auto
  34.312    thus "1 \<le> real m / ?B" by auto
  34.313  
  34.314    have "m \<noteq> 0" using assms by auto
  34.315 -  have "0 \<le> bitlen m - 1" using `0 < m` by (auto simp: bitlen_def)
  34.316 +  have "0 \<le> bitlen m - 1" using \<open>0 < m\<close> by (auto simp: bitlen_def)
  34.317  
  34.318 -  have "m < 2^nat(bitlen m)" using bitlen_bounds[OF `0 <m`] ..
  34.319 -  also have "\<dots> = 2^nat(bitlen m - 1 + 1)" using `0 < m` by (auto simp: bitlen_def)
  34.320 -  also have "\<dots> = ?B * 2" unfolding nat_add_distrib[OF `0 \<le> bitlen m - 1` zero_le_one] by auto
  34.321 +  have "m < 2^nat(bitlen m)" using bitlen_bounds[OF \<open>0 <m\<close>] ..
  34.322 +  also have "\<dots> = 2^nat(bitlen m - 1 + 1)" using \<open>0 < m\<close> by (auto simp: bitlen_def)
  34.323 +  also have "\<dots> = ?B * 2" unfolding nat_add_distrib[OF \<open>0 \<le> bitlen m - 1\<close> zero_le_one] by auto
  34.324    finally have "real m < 2 * ?B" unfolding real_of_int_less_iff[symmetric] by auto
  34.325    hence "real m / ?B < 2 * ?B / ?B" by (rule divide_strict_right_mono, auto)
  34.326    thus "real m / ?B < 2" by auto
  34.327  qed
  34.328  
  34.329 -subsection {* Truncating Real Numbers*}
  34.330 +subsection \<open>Truncating Real Numbers\<close>
  34.331  
  34.332  definition truncate_down::"nat \<Rightarrow> real \<Rightarrow> real" where
  34.333    "truncate_down prec x = round_down (prec - \<lfloor>log 2 \<bar>x\<bar>\<rfloor> - 1) x"
  34.334 @@ -1051,7 +1051,7 @@
  34.335    } ultimately show ?thesis by arith
  34.336  qed
  34.337  
  34.338 -subsection {* Truncating Floats*}
  34.339 +subsection \<open>Truncating Floats\<close>
  34.340  
  34.341  lift_definition float_round_up :: "nat \<Rightarrow> float \<Rightarrow> float" is truncate_up
  34.342    by (simp add: truncate_up_def)
  34.343 @@ -1093,7 +1093,7 @@
  34.344  hide_fact (open) compute_float_round_up
  34.345  
  34.346  
  34.347 -subsection {* Approximation of positive rationals *}
  34.348 +subsection \<open>Approximation of positive rationals\<close>
  34.349  
  34.350  lemma div_mult_twopow_eq: fixes a b::nat shows "a div ((2::nat) ^ n) div b = a div (b * 2 ^ n)"
  34.351    by (cases "b=0") (simp_all add: div_mult2_eq[symmetric] ac_simps)
  34.352 @@ -1146,21 +1146,21 @@
  34.353      def x' \<equiv> "x * 2 ^ nat l"
  34.354      have "int x * 2 ^ nat l = x'" by (simp add: x'_def int_mult int_power)
  34.355      moreover have "real x * 2 powr real l = real x'"
  34.356 -      by (simp add: powr_realpow[symmetric] `0 \<le> l` x'_def)
  34.357 +      by (simp add: powr_realpow[symmetric] \<open>0 \<le> l\<close> x'_def)
  34.358      ultimately show ?thesis
  34.359 -      using ceil_divide_floor_conv[of y x'] powr_realpow[of 2 "nat l"] `0 \<le> l` `y \<noteq> 0`
  34.360 +      using ceil_divide_floor_conv[of y x'] powr_realpow[of 2 "nat l"] \<open>0 \<le> l\<close> \<open>y \<noteq> 0\<close>
  34.361          l_def[symmetric, THEN meta_eq_to_obj_eq]
  34.362        by transfer (auto simp add: floor_divide_eq_div [symmetric] round_up_def)
  34.363     next
  34.364      assume "\<not> 0 \<le> l"
  34.365      def y' \<equiv> "y * 2 ^ nat (- l)"
  34.366 -    from `y \<noteq> 0` have "y' \<noteq> 0" by (simp add: y'_def)
  34.367 +    from \<open>y \<noteq> 0\<close> have "y' \<noteq> 0" by (simp add: y'_def)
  34.368      have "int y * 2 ^ nat (- l) = y'" by (simp add: y'_def int_mult int_power)
  34.369      moreover have "real x * real (2::int) powr real l / real y = x / real y'"
  34.370 -      using `\<not> 0 \<le> l`
  34.371 +      using \<open>\<not> 0 \<le> l\<close>
  34.372        by (simp add: powr_realpow[symmetric] powr_minus y'_def field_simps)
  34.373      ultimately show ?thesis
  34.374 -      using ceil_divide_floor_conv[of y' x] `\<not> 0 \<le> l` `y' \<noteq> 0` `y \<noteq> 0`
  34.375 +      using ceil_divide_floor_conv[of y' x] \<open>\<not> 0 \<le> l\<close> \<open>y' \<noteq> 0\<close> \<open>y \<noteq> 0\<close>
  34.376          l_def[symmetric, THEN meta_eq_to_obj_eq]
  34.377        by transfer
  34.378           (auto simp add: round_up_def ceil_divide_floor_conv floor_divide_eq_div [symmetric])
  34.379 @@ -1214,7 +1214,7 @@
  34.380    by transfer (simp add: round_down_uminus_eq)
  34.381  hide_fact (open) compute_rapprox_rat
  34.382  
  34.383 -subsection {* Division *}
  34.384 +subsection \<open>Division\<close>
  34.385  
  34.386  definition "real_divl prec a b = round_down (int prec + \<lfloor> log 2 \<bar>b\<bar> \<rfloor> - \<lfloor> log 2 \<bar>a\<bar> \<rfloor>) (a / b)"
  34.387  
  34.388 @@ -1250,7 +1250,7 @@
  34.389  hide_fact (open) compute_float_divr
  34.390  
  34.391  
  34.392 -subsection {* Approximate Power *}
  34.393 +subsection \<open>Approximate Power\<close>
  34.394  
  34.395  lemma div2_less_self[termination_simp]: fixes n::nat shows "odd n \<Longrightarrow> n div 2 < n"
  34.396    by (simp add: odd_pos)
  34.397 @@ -1306,9 +1306,9 @@
  34.398      also have "\<dots> = x ^ (Suc n div 2 * 2)"
  34.399        by (simp add: power_mult[symmetric])
  34.400      also have "Suc n div 2 * 2 = Suc n"
  34.401 -      using `odd n` by presburger
  34.402 +      using \<open>odd n\<close> by presburger
  34.403      finally have ?case
  34.404 -      using `odd n`
  34.405 +      using \<open>odd n\<close>
  34.406        by (auto intro!: truncate_down_le simp del: odd_Suc_div_two)
  34.407    } thus ?case
  34.408      by (auto intro!: truncate_down_le mult_left_mono 2 mult_nonneg_nonneg power_down_nonneg)
  34.409 @@ -1320,14 +1320,14 @@
  34.410    {
  34.411      assume "odd n"
  34.412      hence "Suc n = Suc n div 2 * 2"
  34.413 -      using `odd n` even_Suc by presburger
  34.414 +      using \<open>odd n\<close> even_Suc by presburger
  34.415      hence "x ^ Suc n \<le> (x ^ (Suc n div 2))\<^sup>2"
  34.416        by (simp add: power_mult[symmetric])
  34.417      also have "\<dots> \<le> (power_up p x (Suc n div 2))\<^sup>2"
  34.418 -      using 2 `odd n`
  34.419 +      using 2 \<open>odd n\<close>
  34.420        by (auto intro: power_mono simp del: odd_Suc_div_two )
  34.421      finally have ?case
  34.422 -      using `odd n`
  34.423 +      using \<open>odd n\<close>
  34.424        by (auto intro!: truncate_up_le simp del: odd_Suc_div_two )
  34.425    } thus ?case
  34.426      by (auto intro!: truncate_up_le mult_left_mono 2)
  34.427 @@ -1350,7 +1350,7 @@
  34.428    by transfer simp
  34.429  
  34.430  
  34.431 -subsection {* Approximate Addition *}
  34.432 +subsection \<open>Approximate Addition\<close>
  34.433  
  34.434  definition "plus_down prec x y = truncate_down prec (x + y)"
  34.435  
  34.436 @@ -1432,7 +1432,7 @@
  34.437      also note b_le_1
  34.438      finally have b_less_1: "b * 2 powr real p < 1" .
  34.439  
  34.440 -    from b_less_1 `b > 0` have floor_eq: "\<lfloor>b * 2 powr real p\<rfloor> = 0" "\<lfloor>sgn b / 2\<rfloor> = 0"
  34.441 +    from b_less_1 \<open>b > 0\<close> have floor_eq: "\<lfloor>b * 2 powr real p\<rfloor> = 0" "\<lfloor>sgn b / 2\<rfloor> = 0"
  34.442        by (simp_all add: floor_eq_iff)
  34.443  
  34.444      have "\<lfloor>(a + b) * 2 powr q\<rfloor> = \<lfloor>(a + b) * 2 powr p * 2 powr (q - p)\<rfloor>"
  34.445 @@ -1474,12 +1474,12 @@
  34.446      also have "\<dots> = \<lfloor>(2 * ai + b * 2 powr (p + 1)) / real ((2::int) ^ nat (p - q + 1))\<rfloor>"
  34.447        using assms by (simp add: algebra_simps powr_realpow[symmetric])
  34.448      also have "\<dots> = \<lfloor>(2 * ai - 1) / real ((2::int) ^ nat (p - q + 1))\<rfloor>"
  34.449 -      using `b < 0` assms
  34.450 +      using \<open>b < 0\<close> assms
  34.451        by (simp add: floor_divide_eq_div floor_eq floor_divide_real_eq_div
  34.452          del: real_of_int_mult real_of_int_power real_of_int_diff)
  34.453      also have "\<dots> = \<lfloor>(2 * ai - 1) * 2 powr (q - p - 1)\<rfloor>"
  34.454        using assms by (simp add: algebra_simps divide_powr_uminus powr_realpow[symmetric])
  34.455 -    finally have ?thesis using `b < 0` by simp
  34.456 +    finally have ?thesis using \<open>b < 0\<close> by simp
  34.457    } ultimately show ?thesis by arith
  34.458  qed
  34.459  
  34.460 @@ -1495,37 +1495,37 @@
  34.461    def k \<equiv> "\<lfloor>log 2 \<bar>ai\<bar>\<rfloor>"
  34.462    hence "\<lfloor>log 2 \<bar>ai\<bar>\<rfloor> = k" by simp
  34.463    hence k: "2 powr k \<le> \<bar>ai\<bar>" "\<bar>ai\<bar> < 2 powr (k + 1)"
  34.464 -    by (simp_all add: floor_log_eq_powr_iff `ai \<noteq> 0`)
  34.465 +    by (simp_all add: floor_log_eq_powr_iff \<open>ai \<noteq> 0\<close>)
  34.466    have "k \<ge> 0"
  34.467      using assms by (auto simp: k_def)
  34.468    def r \<equiv> "\<bar>ai\<bar> - 2 ^ nat k"
  34.469    have r: "0 \<le> r" "r < 2 powr k"
  34.470 -    using `k \<ge> 0` k
  34.471 +    using \<open>k \<ge> 0\<close> k
  34.472      by (auto simp: r_def k_def algebra_simps powr_add abs_if powr_int)
  34.473    hence "r \<le> (2::int) ^ nat k - 1"
  34.474 -    using `k \<ge> 0` by (auto simp: powr_int)
  34.475 -  from this[simplified real_of_int_le_iff[symmetric]] `0 \<le> k`
  34.476 +    using \<open>k \<ge> 0\<close> by (auto simp: powr_int)
  34.477 +  from this[simplified real_of_int_le_iff[symmetric]] \<open>0 \<le> k\<close>
  34.478    have r_le: "r \<le> 2 powr k - 1"
  34.479      by (auto simp: algebra_simps powr_int simp del: real_of_int_le_iff)
  34.480  
  34.481    have "\<bar>ai\<bar> = 2 powr k + r"
  34.482 -    using `k \<ge> 0` by (auto simp: k_def r_def powr_realpow[symmetric])
  34.483 +    using \<open>k \<ge> 0\<close> by (auto simp: k_def r_def powr_realpow[symmetric])
  34.484  
  34.485    have pos: "\<And>b::real. abs b < 1 \<Longrightarrow> 0 < 2 powr k + (r + b)"
  34.486 -    using `0 \<le> k` `ai \<noteq> 0`
  34.487 +    using \<open>0 \<le> k\<close> \<open>ai \<noteq> 0\<close>
  34.488      by (auto simp add: r_def powr_realpow[symmetric] abs_if sgn_if algebra_simps
  34.489        split: split_if_asm)
  34.490    have less: "\<bar>sgn ai * b\<bar> < 1"
  34.491      and less': "\<bar>sgn (sgn ai * b) / 2\<bar> < 1"
  34.492 -    using `abs b \<le> _` by (auto simp: abs_if sgn_if split: split_if_asm)
  34.493 +    using \<open>abs b \<le> _\<close> by (auto simp: abs_if sgn_if split: split_if_asm)
  34.494  
  34.495    have floor_eq: "\<And>b::real. abs b \<le> 1 / 2 \<Longrightarrow>
  34.496        \<lfloor>log 2 (1 + (r + b) / 2 powr k)\<rfloor> = (if r = 0 \<and> b < 0 then -1 else 0)"
  34.497 -    using `k \<ge> 0` r r_le
  34.498 +    using \<open>k \<ge> 0\<close> r r_le
  34.499      by (auto simp: floor_log_eq_powr_iff powr_minus_divide field_simps sgn_if)
  34.500  
  34.501 -  from `real \<bar>ai\<bar> = _` have "\<bar>ai + b\<bar> = 2 powr k + (r + sgn ai * b)"
  34.502 -    using `abs b <= _` `0 \<le> k` r
  34.503 +  from \<open>real \<bar>ai\<bar> = _\<close> have "\<bar>ai + b\<bar> = 2 powr k + (r + sgn ai * b)"
  34.504 +    using \<open>abs b <= _\<close> \<open>0 \<le> k\<close> r
  34.505      by (auto simp add: sgn_if abs_if)
  34.506    also have "\<lfloor>log 2 \<dots>\<rfloor> = \<lfloor>log 2 (2 powr k + r + sgn (sgn ai * b) / 2)\<rfloor>"
  34.507    proof -
  34.508 @@ -1537,14 +1537,14 @@
  34.509      also
  34.510      let ?if = "if r = 0 \<and> sgn ai * b < 0 then -1 else 0"
  34.511      have "\<lfloor>log 2 (1 + (r + sgn ai * b) / 2 powr k)\<rfloor> = ?if"
  34.512 -      using `abs b <= _`
  34.513 +      using \<open>abs b <= _\<close>
  34.514        by (intro floor_eq) (auto simp: abs_mult sgn_if)
  34.515      also
  34.516      have "\<dots> = \<lfloor>log 2 (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k)\<rfloor>"
  34.517        by (subst floor_eq) (auto simp: sgn_if)
  34.518      also have "k + \<dots> = \<lfloor>log 2 (2 powr k * (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k))\<rfloor>"
  34.519        unfolding floor_add2[symmetric]
  34.520 -      using pos[OF less'] `abs b \<le> _`
  34.521 +      using pos[OF less'] \<open>abs b \<le> _\<close>
  34.522        by (simp add: field_simps add_log_eq_powr)
  34.523      also have "2 powr k * (1 + (r + sgn (sgn ai * b) / 2) / 2 powr k) =
  34.524          2 powr k + r + sgn (sgn ai * b) / 2"
  34.525 @@ -1552,7 +1552,7 @@
  34.526      finally show ?thesis .
  34.527    qed
  34.528    also have "2 powr k + r + sgn (sgn ai * b) / 2 = \<bar>ai + sgn b / 2\<bar>"
  34.529 -    unfolding `real \<bar>ai\<bar> = _`[symmetric] using `ai \<noteq> 0`
  34.530 +    unfolding \<open>real \<bar>ai\<bar> = _\<close>[symmetric] using \<open>ai \<noteq> 0\<close>
  34.531      by (auto simp: abs_if sgn_if algebra_simps)
  34.532    finally show ?thesis .
  34.533  qed
  34.534 @@ -1590,7 +1590,7 @@
  34.535      by simp
  34.536    finally have b_less_quarter: "\<bar>?b\<bar> < 1/4 * 2 powr real e1"
  34.537      by (simp add: powr_add field_simps powr_divide2[symmetric] powr_numeral abs_mult)
  34.538 -  also have "1/4 < \<bar>real m1\<bar> / 2" using `m1 \<noteq> 0` by simp
  34.539 +  also have "1/4 < \<bar>real m1\<bar> / 2" using \<open>m1 \<noteq> 0\<close> by simp
  34.540    finally have b_less_half_a: "\<bar>?b\<bar> < 1/2 * \<bar>?a\<bar>"
  34.541      by (simp add: algebra_simps powr_mult_base abs_mult)
  34.542    hence a_half_less_sum: "\<bar>?a\<bar> / 2 < \<bar>?sum\<bar>"
  34.543 @@ -1600,7 +1600,7 @@
  34.544      by simp_all
  34.545  
  34.546    have "\<bar>real (Float m1 e1)\<bar> \<ge> 1/4 * 2 powr real e1"
  34.547 -    using `m1 \<noteq> 0`
  34.548 +    using \<open>m1 \<noteq> 0\<close>
  34.549      by (auto simp: powr_add powr_int bitlen_nonneg divide_right_mono abs_mult)
  34.550    hence "?sum \<noteq> 0" using b_less_quarter
  34.551      by (rule sum_neq_zeroI)
  34.552 @@ -1608,16 +1608,16 @@
  34.553      unfolding sum_eq by (simp add: abs_mult zero_less_mult_iff)
  34.554  
  34.555    have "\<bar>real ?m1\<bar> \<ge> 2 ^ Suc k1" "\<bar>?m2'\<bar> < 2 ^ Suc k1"
  34.556 -    using `m1 \<noteq> 0` `m2 \<noteq> 0` by (auto simp: sgn_if less_1_mult abs_mult simp del: power.simps)
  34.557 +    using \<open>m1 \<noteq> 0\<close> \<open>m2 \<noteq> 0\<close> by (auto simp: sgn_if less_1_mult abs_mult simp del: power.simps)
  34.558    hence sum'_nz: "?m1 + ?m2' \<noteq> 0"
  34.559      by (intro sum_neq_zeroI)
  34.560  
  34.561    have "\<lfloor>log 2 \<bar>real (Float m1 e1) + real (Float m2 e2)\<bar>\<rfloor> = \<lfloor>log 2 \<bar>?m1 + ?m2\<bar>\<rfloor> + ?e"
  34.562 -    using `?m1 + ?m2 \<noteq> 0`
  34.563 +    using \<open>?m1 + ?m2 \<noteq> 0\<close>
  34.564      unfolding floor_add[symmetric] sum_eq
  34.565      by (simp add: abs_mult log_mult)
  34.566    also have "\<lfloor>log 2 \<bar>?m1 + ?m2\<bar>\<rfloor> = \<lfloor>log 2 \<bar>?m1 + sgn (real m2 * 2 powr ?shift) / 2\<bar>\<rfloor>"
  34.567 -    using abs_m2_less_half `m1 \<noteq> 0`
  34.568 +    using abs_m2_less_half \<open>m1 \<noteq> 0\<close>
  34.569      by (intro log2_abs_int_add_less_half_sgn_eq) (auto simp: abs_mult)
  34.570    also have "sgn (real m2 * 2 powr ?shift) = sgn m2"
  34.571      by (auto simp: sgn_if zero_less_mult_iff less_not_sym)
  34.572 @@ -1625,7 +1625,7 @@
  34.573    have "\<bar>?m1 + ?m2'\<bar> * 2 powr ?e = \<bar>?m1 * 2 + sgn m2\<bar> * 2 powr (?e - 1)"
  34.574      by (auto simp: field_simps powr_minus[symmetric] powr_divide2[symmetric] powr_mult_base)
  34.575    hence "\<lfloor>log 2 \<bar>?m1 + ?m2'\<bar>\<rfloor> + ?e = \<lfloor>log 2 \<bar>real (Float (?m1 * 2 + sgn m2) (?e - 1))\<bar>\<rfloor>"
  34.576 -    using `?m1 + ?m2' \<noteq> 0`
  34.577 +    using \<open>?m1 + ?m2' \<noteq> 0\<close>
  34.578      unfolding floor_add[symmetric]
  34.579      by (simp add: log_add_eq_powr abs_mult_pos)
  34.580    finally
  34.581 @@ -1645,16 +1645,16 @@
  34.582          by (simp add: abs_mult powr_add[symmetric] algebra_simps powr_mult_base)
  34.583      next
  34.584        have "e1 + \<lfloor>log 2 \<bar>real m1\<bar>\<rfloor> - 1 = \<lfloor>log 2 \<bar>?a\<bar>\<rfloor> - 1"
  34.585 -        using `m1 \<noteq> 0`
  34.586 +        using \<open>m1 \<noteq> 0\<close>
  34.587          by (simp add: floor_add2[symmetric] algebra_simps log_mult abs_mult del: floor_add2)
  34.588        also have "\<dots> \<le> \<lfloor>log 2 \<bar>?a + ?b\<bar>\<rfloor>"
  34.589 -        using a_half_less_sum `m1 \<noteq> 0` `?sum \<noteq> 0`
  34.590 +        using a_half_less_sum \<open>m1 \<noteq> 0\<close> \<open>?sum \<noteq> 0\<close>
  34.591          unfolding floor_subtract[symmetric]
  34.592          by (auto simp add: log_minus_eq_powr powr_minus_divide
  34.593            intro!: floor_mono)
  34.594        finally
  34.595        have "int p - \<lfloor>log 2 \<bar>?a + ?b\<bar>\<rfloor> \<le> p - (bitlen \<bar>m1\<bar>) - e1 + 2"
  34.596 -        by (auto simp: algebra_simps bitlen_def `m1 \<noteq> 0`)
  34.597 +        by (auto simp: algebra_simps bitlen_def \<open>m1 \<noteq> 0\<close>)
  34.598        also have "\<dots> \<le> 1 - ?e"
  34.599          using bitlen_nonneg[of "\<bar>m1\<bar>"] by (simp add: k1_def)
  34.600        finally show "?f \<le> - ?e" by simp
  34.601 @@ -1707,7 +1707,7 @@
  34.602  by (metis mantissa_0 zero_float.abs_eq)
  34.603  
  34.604  
  34.605 -subsection {* Lemmas needed by Approximate *}
  34.606 +subsection \<open>Lemmas needed by Approximate\<close>
  34.607  
  34.608  lemma Float_num[simp]: shows
  34.609     "real (Float 1 0) = 1" and "real (Float 1 1) = 2" and "real (Float 1 2) = 4" and
  34.610 @@ -1804,7 +1804,7 @@
  34.611    have "x = mantissa x * 2 powr (exponent x)" by (rule mantissa_exponent)
  34.612    also have "mantissa x \<le> \<bar>mantissa x\<bar>" by simp
  34.613    also have "... \<le> 2 powr (bitlen \<bar>mantissa x\<bar>)"
  34.614 -    using bitlen_bounds[of "\<bar>mantissa x\<bar>"] bitlen_nonneg `mantissa x \<noteq> 0`
  34.615 +    using bitlen_bounds[of "\<bar>mantissa x\<bar>"] bitlen_nonneg \<open>mantissa x \<noteq> 0\<close>
  34.616      by (auto simp del: real_of_int_abs simp add: powr_int)
  34.617    finally show ?thesis by (simp add: powr_add)
  34.618  qed
  34.619 @@ -1813,7 +1813,7 @@
  34.620    assumes "0 < x" "x \<le> 1" "prec \<ge> 1"
  34.621    shows "1 \<le> real_divl prec 1 x"
  34.622  proof -
  34.623 -  have "log 2 x \<le> real prec + real \<lfloor>log 2 x\<rfloor>" using `prec \<ge> 1` by arith
  34.624 +  have "log 2 x \<le> real prec + real \<lfloor>log 2 x\<rfloor>" using \<open>prec \<ge> 1\<close> by arith
  34.625    from this assms show ?thesis
  34.626      by (simp add: real_divl_def log_divide round_down_ge1)
  34.627  qed
  34.628 @@ -1827,7 +1827,7 @@
  34.629  
  34.630  lemma real_divr_pos_less1_lower_bound: assumes "0 < x" and "x \<le> 1" shows "1 \<le> real_divr prec 1 x"
  34.631  proof -
  34.632 -  have "1 \<le> 1 / x" using `0 < x` and `x <= 1` by auto
  34.633 +  have "1 \<le> 1 / x" using \<open>0 < x\<close> and \<open>x <= 1\<close> by auto
  34.634    also have "\<dots> \<le> real_divr prec 1 x" using real_divr[where x=1 and y=x] by auto
  34.635    finally show ?thesis by auto
  34.636  qed
  34.637 @@ -1877,7 +1877,7 @@
  34.638          using real_of_int_floor_add_one_ge[of "log 2 x"] assms
  34.639          by (auto simp add: algebra_simps powr_divide2 intro!: mult_left_mono)
  34.640        thus "x * 2 powr real (int prec - \<lfloor>log 2 x\<rfloor> - 1) \<le> real ((2::int) ^ prec)"
  34.641 -        using `0 < x` by (simp add: powr_realpow)
  34.642 +        using \<open>0 < x\<close> by (simp add: powr_realpow)
  34.643      qed
  34.644      hence "real \<lceil>x * 2 powr real (int prec - \<lfloor>log 2 x\<rfloor> - 1)\<rceil> \<le> 2 powr int prec"
  34.645        by (auto simp: powr_realpow)
  34.646 @@ -1885,14 +1885,14 @@
  34.647      have "2 powr - real (int prec - \<lfloor>log 2 x\<rfloor> - 1) \<le> 2 powr - real (int prec - \<lfloor>log 2 y\<rfloor>)"
  34.648        using logless flogless by (auto intro!: floor_mono)
  34.649      also have "2 powr real (int prec) \<le> 2 powr (log 2 y + real (int prec - \<lfloor>log 2 y\<rfloor>))"
  34.650 -      using assms `0 < x`
  34.651 +      using assms \<open>0 < x\<close>
  34.652        by (auto simp: algebra_simps)
  34.653      finally have "truncate_up prec x \<le> 2 powr (log 2 y + real (int prec - \<lfloor>log 2 y\<rfloor>)) * 2 powr - real (int prec - \<lfloor>log 2 y\<rfloor>)"
  34.654        by simp
  34.655      also have "\<dots> = 2 powr (log 2 y + real (int prec - \<lfloor>log 2 y\<rfloor>) - real (int prec - \<lfloor>log 2 y\<rfloor>))"
  34.656        by (subst powr_add[symmetric]) simp
  34.657      also have "\<dots> = y"
  34.658 -      using `0 < x` assms
  34.659 +      using \<open>0 < x\<close> assms
  34.660        by (simp add: powr_add)
  34.661      also have "\<dots> \<le> truncate_up prec y"
  34.662        by (rule truncate_up)
  34.663 @@ -1910,8 +1910,8 @@
  34.664    assumes "x \<le> 0" "0 \<le> y"
  34.665    shows "truncate_up prec x \<le> truncate_up prec y"
  34.666  proof -
  34.667 -  note truncate_up_nonpos[OF `x \<le> 0`]
  34.668 -  also note truncate_up_le[OF `0 \<le> y`]
  34.669 +  note truncate_up_nonpos[OF \<open>x \<le> 0\<close>]
  34.670 +  also note truncate_up_le[OF \<open>0 \<le> y\<close>]
  34.671    finally show ?thesis .
  34.672  qed
  34.673  
  34.674 @@ -1922,7 +1922,7 @@
  34.675    have "x * 2 powr (- real \<lfloor>log 2 x\<rfloor> - 1) = x * inverse (2 powr ((real \<lfloor>log 2 x\<rfloor> + 1)))"
  34.676      by (simp add: powr_divide2[symmetric] powr_add powr_minus inverse_eq_divide)
  34.677    also have "\<dots> = 2 powr (log 2 x - (real \<lfloor>log 2 x\<rfloor>) - 1)"
  34.678 -    using `0 < x`
  34.679 +    using \<open>0 < x\<close>
  34.680      by (auto simp: field_simps powr_add powr_divide2[symmetric])
  34.681    also have "\<dots> < 2 powr 0"
  34.682      using real_of_int_floor_add_one_gt
  34.683 @@ -1933,7 +1933,7 @@
  34.684      by simp
  34.685    moreover
  34.686    have "0 \<le> \<lfloor>x * 2 powr (- real \<lfloor>log 2 x\<rfloor> - 1)\<rfloor>"
  34.687 -    using `x > 0` by auto
  34.688 +    using \<open>x > 0\<close> by auto
  34.689    ultimately have "\<lfloor>x * 2 powr (- real \<lfloor>log 2 x\<rfloor> - 1)\<rfloor> \<in> {0 ..< 1}"
  34.690      by simp
  34.691    also have "\<dots> \<subseteq> {0}" by auto
  34.692 @@ -1947,8 +1947,8 @@
  34.693    assumes "x \<le> y"
  34.694    shows "truncate_down prec x \<le> truncate_down prec y"
  34.695  proof -
  34.696 -  note truncate_down_le[OF `x \<le> 0`]
  34.697 -  also note truncate_down_nonneg[OF `0 \<le> y`]
  34.698 +  note truncate_down_le[OF \<open>x \<le> 0\<close>]
  34.699 +  also note truncate_down_nonneg[OF \<open>0 \<le> y\<close>]
  34.700    finally show ?thesis .
  34.701  qed
  34.702  
  34.703 @@ -1976,33 +1976,33 @@
  34.704      moreover
  34.705      assume "\<lfloor>log 2 \<bar>x\<bar>\<rfloor> \<noteq> \<lfloor>log 2 \<bar>y\<bar>\<rfloor>"
  34.706      ultimately have logless: "log 2 x < log 2 y" and flogless: "\<lfloor>log 2 x\<rfloor> < \<lfloor>log 2 y\<rfloor>"
  34.707 -      unfolding atomize_conj abs_of_pos[OF `0 < x`] abs_of_pos[OF `0 < y`]
  34.708 +      unfolding atomize_conj abs_of_pos[OF \<open>0 < x\<close>] abs_of_pos[OF \<open>0 < y\<close>]
  34.709        by (metis floor_less_cancel linorder_cases not_le)
  34.710      assume "prec \<noteq> 0" hence [simp]: "prec \<ge> Suc 0" by auto
  34.711      have "2 powr (prec - 1) \<le> y * 2 powr real (prec - 1) / (2 powr log 2 y)"
  34.712 -      using `0 < y`
  34.713 +      using \<open>0 < y\<close>
  34.714        by simp
  34.715      also have "\<dots> \<le> y * 2 powr real prec / (2 powr (real \<lfloor>log 2 y\<rfloor> + 1))"
  34.716 -      using `0 \<le> y` `0 \<le> x` assms(2)
  34.717 +      using \<open>0 \<le> y\<close> \<open>0 \<le> x\<close> assms(2)
  34.718        by (auto intro!: powr_mono divide_left_mono
  34.719          simp: real_of_nat_diff powr_add
  34.720          powr_divide2[symmetric])
  34.721      also have "\<dots> = y * 2 powr real prec / (2 powr real \<lfloor>log 2 y\<rfloor> * 2)"
  34.722        by (auto simp: powr_add)
  34.723      finally have "(2 ^ (prec - 1)) \<le> \<lfloor>y * 2 powr real (int prec - \<lfloor>log 2 \<bar>y\<bar>\<rfloor> - 1)\<rfloor>"
  34.724 -      using `0 \<le> y`
  34.725 +      using \<open>0 \<le> y\<close>
  34.726        by (auto simp: powr_divide2[symmetric] le_floor_eq powr_realpow)
  34.727      hence "(2 ^ (prec - 1)) * 2 powr - real (int prec - \<lfloor>log 2 \<bar>y\<bar>\<rfloor> - 1) \<le> truncate_down prec y"
  34.728        by (auto simp: truncate_down_def round_down_def)
  34.729      moreover
  34.730      {
  34.731 -      have "x = 2 powr (log 2 \<bar>x\<bar>)" using `0 < x` by simp
  34.732 +      have "x = 2 powr (log 2 \<bar>x\<bar>)" using \<open>0 < x\<close> by simp
  34.733        also have "\<dots> \<le> (2 ^ (prec )) * 2 powr - real (int prec - \<lfloor>log 2 \<bar>x\<bar>\<rfloor> - 1)"
  34.734          using real_of_int_floor_add_one_ge[of "log 2 \<bar>x\<bar>"]
  34.735          by (auto simp: powr_realpow[symmetric] powr_add[symmetric] algebra_simps)
  34.736        also
  34.737        have "2 powr - real (int prec - \<lfloor>log 2 \<bar>x\<bar>\<rfloor> - 1) \<le> 2 powr - real (int prec - \<lfloor>log 2 \<bar>y\<bar>\<rfloor>)"
  34.738 -        using logless flogless `x > 0` `y > 0`
  34.739 +        using logless flogless \<open>x > 0\<close> \<open>y > 0\<close>
  34.740          by (auto intro!: floor_mono)
  34.741        finally have "x \<le> (2 ^ (prec - 1)) * 2 powr - real (int prec - \<lfloor>log 2 \<bar>y\<bar>\<rfloor> - 1)"
  34.742          by (auto simp: powr_realpow[symmetric] powr_divide2[symmetric] assms real_of_nat_diff)
    35.1 --- a/src/HOL/Library/Formal_Power_Series.thy	Wed Jun 17 10:57:11 2015 +0200
    35.2 +++ b/src/HOL/Library/Formal_Power_Series.thy	Wed Jun 17 11:03:05 2015 +0200
    35.3 @@ -2,13 +2,13 @@
    35.4      Author:     Amine Chaieb, University of Cambridge
    35.5  *)
    35.6  
    35.7 -section{* A formalization of formal power series *}
    35.8 +section\<open>A formalization of formal power series\<close>
    35.9  
   35.10  theory Formal_Power_Series
   35.11  imports Complex_Main
   35.12  begin
   35.13  
   35.14 -subsection {* The type of formal power series*}
   35.15 +subsection \<open>The type of formal power series\<close>
   35.16  
   35.17  typedef 'a fps = "{f :: nat \<Rightarrow> 'a. True}"
   35.18    morphisms fps_nth Abs_fps
   35.19 @@ -25,8 +25,8 @@
   35.20  lemma fps_nth_Abs_fps [simp]: "Abs_fps f $ n = f n"
   35.21    by (simp add: Abs_fps_inverse)
   35.22  
   35.23 -text{* Definition of the basic elements 0 and 1 and the basic operations of addition,
   35.24 -  negation and multiplication *}
   35.25 +text\<open>Definition of the basic elements 0 and 1 and the basic operations of addition,
   35.26 +  negation and multiplication\<close>
   35.27  
   35.28  instantiation fps :: (zero) zero
   35.29  begin
   35.30 @@ -120,8 +120,8 @@
   35.31  lemma cond_application_beta: "(if b then f else g) x = (if b then f x else g x)"
   35.32    by auto
   35.33  
   35.34 -subsection{* Formal power series form a commutative ring with unity, if the range of sequences
   35.35 -  they represent is a commutative ring with unity*}
   35.36 +subsection\<open>Formal power series form a commutative ring with unity, if the range of sequences
   35.37 +  they represent is a commutative ring with unity\<close>
   35.38  
   35.39  instance fps :: (semigroup_add) semigroup_add
   35.40  proof
   35.41 @@ -248,7 +248,7 @@
   35.42  
   35.43  instance fps :: (semiring_0_cancel) semiring_0_cancel ..
   35.44  
   35.45 -subsection {* Selection of the nth power of the implicit variable in the infinite sum*}
   35.46 +subsection \<open>Selection of the nth power of the implicit variable in the infinite sum\<close>
   35.47  
   35.48  lemma fps_nonzero_nth: "f \<noteq> 0 \<longleftrightarrow> (\<exists> n. f $n \<noteq> 0)"
   35.49    by (simp add: expand_fps_eq)
   35.50 @@ -282,7 +282,7 @@
   35.51    then show ?thesis by simp
   35.52  qed
   35.53  
   35.54 -subsection{* Injection of the basic ring elements and multiplication by scalars *}
   35.55 +subsection\<open>Injection of the basic ring elements and multiplication by scalars\<close>
   35.56  
   35.57  definition "fps_const c = Abs_fps (\<lambda>n. if n = 0 then c else 0)"
   35.58  
   35.59 @@ -329,7 +329,7 @@
   35.60  lemma fps_mult_right_const_nth [simp]: "(f * fps_const (c::'a::semiring_1))$n = f$n * c"
   35.61    by (simp add: fps_mult_nth mult_delta_right setsum.delta')
   35.62  
   35.63 -subsection {* Formal power series form an integral domain*}
   35.64 +subsection \<open>Formal power series form an integral domain\<close>
   35.65  
   35.66  instance fps :: (ring) ring ..
   35.67  
   35.68 @@ -373,7 +373,7 @@
   35.69  lemma neg_numeral_fps_const: "- numeral k = fps_const (- numeral k)"
   35.70    by (simp only: numeral_fps_const fps_const_neg)
   35.71  
   35.72 -subsection{* The eXtractor series X*}
   35.73 +subsection\<open>The eXtractor series X\<close>
   35.74  
   35.75  lemma minus_one_power_iff: "(- (1::'a::comm_ring_1)) ^ n = (if even n then 1 else - 1)"
   35.76    by (induct n) auto
   35.77 @@ -428,7 +428,7 @@
   35.78    by (metis X_power_mult_nth mult.commute)
   35.79  
   35.80  
   35.81 -subsection{* Formal Power series form a metric space *}
   35.82 +subsection\<open>Formal Power series form a metric space\<close>
   35.83  
   35.84  definition (in dist) "ball x r = {y. dist y x < r}"
   35.85  
   35.86 @@ -533,7 +533,7 @@
   35.87  
   35.88  end
   35.89  
   35.90 -text{* The infinite sums and justification of the notation in textbooks*}
   35.91 +text\<open>The infinite sums and justification of the notation in textbooks\<close>
   35.92  
   35.93  lemma reals_power_lt_ex:
   35.94    fixes x y :: real
   35.95 @@ -628,7 +628,7 @@
   35.96  qed
   35.97  
   35.98  
   35.99 -subsection{* Inverses of formal power series *}
  35.100 +subsection\<open>Inverses of formal power series\<close>
  35.101  
  35.102  declare setsum.cong[fundef_cong]
  35.103  
  35.104 @@ -778,7 +778,7 @@
  35.105    done
  35.106  
  35.107  
  35.108 -subsection {* Formal Derivatives, and the MacLaurin theorem around 0 *}
  35.109 +subsection \<open>Formal Derivatives, and the MacLaurin theorem around 0\<close>
  35.110  
  35.111  definition "fps_deriv f = Abs_fps (\<lambda>n. of_nat (n + 1) * f $ (n + 1))"
  35.112  
  35.113 @@ -966,7 +966,7 @@
  35.114    by (induct k arbitrary: f) (auto simp add: field_simps of_nat_mult)
  35.115  
  35.116  
  35.117 -subsection {* Powers *}
  35.118 +subsection \<open>Powers\<close>
  35.119  
  35.120  lemma fps_power_zeroth_eq_one: "a$0 =1 \<Longrightarrow> a^n $ 0 = (1::'a::semiring_1)"
  35.121    by (induct n) (auto simp add: expand_fps_eq fps_mult_nth)
  35.122 @@ -977,9 +977,9 @@
  35.123    then show ?case by simp
  35.124  next
  35.125    case (Suc n)
  35.126 -  note h = Suc.hyps[OF `a$0 = 1`]
  35.127 +  note h = Suc.hyps[OF \<open>a$0 = 1\<close>]
  35.128    show ?case unfolding power_Suc fps_mult_nth
  35.129 -    using h `a$0 = 1` fps_power_zeroth_eq_one[OF `a$0=1`]
  35.130 +    using h \<open>a$0 = 1\<close> fps_power_zeroth_eq_one[OF \<open>a$0=1\<close>]
  35.131      by (simp add: field_simps)
  35.132  qed
  35.133  
  35.134 @@ -1224,7 +1224,7 @@
  35.135  qed
  35.136  
  35.137  
  35.138 -subsection{* Integration *}
  35.139 +subsection\<open>Integration\<close>
  35.140  
  35.141  definition fps_integral :: "'a::field_char_0 fps \<Rightarrow> 'a \<Rightarrow> 'a fps"
  35.142    where "fps_integral a a0 = Abs_fps (\<lambda>n. if n = 0 then a0 else (a$(n - 1) / of_nat n))"
  35.143 @@ -1247,7 +1247,7 @@
  35.144  qed
  35.145  
  35.146  
  35.147 -subsection {* Composition of FPSs *}
  35.148 +subsection \<open>Composition of FPSs\<close>
  35.149  
  35.150  definition fps_compose :: "'a::semiring_1 fps \<Rightarrow> 'a fps \<Rightarrow> 'a fps" (infixl "oo" 55)
  35.151    where "a oo b = Abs_fps (\<lambda>n. setsum (\<lambda>i. a$i * (b^i$n)) {0..n})"
  35.152 @@ -1272,9 +1272,9 @@
  35.153    by (simp add: fps_eq_iff fps_compose_def mult_delta_left setsum.delta not_le)
  35.154  
  35.155  
  35.156 -subsection {* Rules from Herbert Wilf's Generatingfunctionology*}
  35.157 -
  35.158 -subsubsection {* Rule 1 *}
  35.159 +subsection \<open>Rules from Herbert Wilf's Generatingfunctionology\<close>
  35.160 +
  35.161 +subsubsection \<open>Rule 1\<close>
  35.162    (* {a_{n+k}}_0^infty Corresponds to (f - setsum (\<lambda>i. a_i * x^i))/x^h, for h>0*)
  35.163  
  35.164  lemma fps_power_mult_eq_shift:
  35.165 @@ -1312,7 +1312,7 @@
  35.166  qed
  35.167  
  35.168  
  35.169 -subsubsection {* Rule 2*}
  35.170 +subsubsection \<open>Rule 2\<close>
  35.171  
  35.172    (* We can not reach the form of Wilf, but still near to it using rewrite rules*)
  35.173    (* If f reprents {a_n} and P is a polynomial, then
  35.174 @@ -1344,9 +1344,9 @@
  35.175    by (induct k arbitrary: a) (simp_all add: XD_def fps_eq_iff field_simps del: One_nat_def)
  35.176  
  35.177  
  35.178 -subsubsection {* Rule 3 is trivial and is given by @{text fps_times_def} *}
  35.179 -
  35.180 -subsubsection {* Rule 5 --- summation and "division" by (1 - X) *}
  35.181 +subsubsection \<open>Rule 3 is trivial and is given by @{text fps_times_def}\<close>
  35.182 +
  35.183 +subsubsection \<open>Rule 5 --- summation and "division" by (1 - X)\<close>
  35.184  
  35.185  lemma fps_divide_X_minus1_setsum_lemma:
  35.186    "a = ((1::'a::comm_ring_1 fps) - X) * Abs_fps (\<lambda>n. setsum (\<lambda>i. a $ i) {0..n})"
  35.187 @@ -1407,8 +1407,8 @@
  35.188  qed
  35.189  
  35.190  
  35.191 -subsubsection{* Rule 4 in its more general form: generalizes Rule 3 for an arbitrary
  35.192 -  finite product of FPS, also the relvant instance of powers of a FPS*}
  35.193 +subsubsection\<open>Rule 4 in its more general form: generalizes Rule 3 for an arbitrary
  35.194 +  finite product of FPS, also the relvant instance of powers of a FPS\<close>
  35.195  
  35.196  definition "natpermute n k = {l :: nat list. length l = k \<and> listsum l = n}"
  35.197  
  35.198 @@ -1576,7 +1576,7 @@
  35.199    ultimately show ?thesis by auto
  35.200  qed
  35.201  
  35.202 -text {* The general form *}
  35.203 +text \<open>The general form\<close>
  35.204  lemma fps_setprod_nth:
  35.205    fixes m :: nat
  35.206      and a :: "nat \<Rightarrow> 'a::comm_ring_1 fps"
  35.207 @@ -1631,7 +1631,7 @@
  35.208    qed
  35.209  qed
  35.210  
  35.211 -text{* The special form for powers *}
  35.212 +text\<open>The special form for powers\<close>
  35.213  lemma fps_power_nth_Suc:
  35.214    fixes m :: nat
  35.215      and a :: "'a::comm_ring_1 fps"
  35.216 @@ -1715,7 +1715,7 @@
  35.217  qed
  35.218  
  35.219  
  35.220 -subsection {* Radicals *}
  35.221 +subsection \<open>Radicals\<close>
  35.222  
  35.223  declare setprod.cong [fundef_cong]
  35.224  
  35.225 @@ -2267,7 +2267,7 @@
  35.226    using radical_divide[where k=k and r=r and a=1 and b=a, OF k ] ra0 r1 a0
  35.227    by (simp add: divide_inverse fps_divide_def)
  35.228  
  35.229 -subsection{* Derivative of composition *}
  35.230 +subsection\<open>Derivative of composition\<close>
  35.231  
  35.232  lemma fps_compose_deriv:
  35.233    fixes a :: "'a::idom fps"
  35.234 @@ -2338,7 +2338,7 @@
  35.235  qed
  35.236  
  35.237  
  35.238 -subsection {* Finite FPS (i.e. polynomials) and X *}
  35.239 +subsection \<open>Finite FPS (i.e. polynomials) and X\<close>
  35.240  
  35.241  lemma fps_poly_sum_X:
  35.242    assumes z: "\<forall>i > n. a$i = (0::'a::comm_ring_1)"
  35.243 @@ -2354,7 +2354,7 @@
  35.244  qed
  35.245  
  35.246  
  35.247 -subsection{* Compositional inverses *}
  35.248 +subsection\<open>Compositional inverses\<close>
  35.249  
  35.250  fun compinv :: "'a fps \<Rightarrow> nat \<Rightarrow> 'a::field"
  35.251  where
  35.252 @@ -2853,9 +2853,9 @@
  35.253      unfolding fps_inv_right[OF a0 a1] by simp
  35.254  qed
  35.255  
  35.256 -subsection{* Elementary series *}
  35.257 -
  35.258 -subsubsection{* Exponential series *}
  35.259 +subsection\<open>Elementary series\<close>
  35.260 +
  35.261 +subsubsection\<open>Exponential series\<close>
  35.262  
  35.263  definition "E x = Abs_fps (\<lambda>n. x^n / of_nat (fact n))"
  35.264  
  35.265 @@ -2970,7 +2970,7 @@
  35.266    done
  35.267  
  35.268  
  35.269 -subsubsection{* Logarithmic series *}
  35.270 +subsubsection\<open>Logarithmic series\<close>
  35.271  
  35.272  lemma Abs_fps_if_0:
  35.273    "Abs_fps(\<lambda>n. if n=0 then (v::'a::ring_1) else f n) = fps_const v + X * Abs_fps (\<lambda>n. f (Suc n))"
  35.274 @@ -3032,7 +3032,7 @@
  35.275  qed
  35.276  
  35.277  
  35.278 -subsubsection{* Binomial series *}
  35.279 +subsubsection\<open>Binomial series\<close>
  35.280  
  35.281  definition "fps_binomial a = Abs_fps (\<lambda>n. a gchoose n)"
  35.282  
  35.283 @@ -3145,7 +3145,7 @@
  35.284    show ?thesis by (simp add: fps_inverse_def)
  35.285  qed
  35.286  
  35.287 -text{* Vandermonde's Identity as a consequence *}
  35.288 +text\<open>Vandermonde's Identity as a consequence\<close>
  35.289  lemma gbinomial_Vandermonde:
  35.290    "setsum (\<lambda>k. (a gchoose k) * (b gchoose (n - k))) {0..n} = (a + b) gchoose n"
  35.291  proof -
  35.292 @@ -3354,7 +3354,7 @@
  35.293  qed
  35.294  
  35.295  
  35.296 -subsubsection{* Formal trigonometric functions  *}
  35.297 +subsubsection\<open>Formal trigonometric functions\<close>
  35.298  
  35.299  definition "fps_sin (c::'a::field_char_0) =
  35.300    Abs_fps (\<lambda>n. if even n then 0 else (- 1) ^((n - 1) div 2) * c^n /(of_nat (fact n)))"
  35.301 @@ -3544,7 +3544,7 @@
  35.302      done
  35.303  qed
  35.304  
  35.305 -text {* Connection to E c over the complex numbers --- Euler and De Moivre*}
  35.306 +text \<open>Connection to E c over the complex numbers --- Euler and De Moivre\<close>
  35.307  lemma Eii_sin_cos: "E (ii * c) = fps_cos c + fps_const ii * fps_sin c "
  35.308    (is "?l = ?r")
  35.309  proof -
  35.310 @@ -3607,7 +3607,7 @@
  35.311    by (simp add: ac_simps)
  35.312  
  35.313  
  35.314 -subsection {* Hypergeometric series *}
  35.315 +subsection \<open>Hypergeometric series\<close>
  35.316  
  35.317  definition "F as bs (c::'a::{field_char_0,field}) =
  35.318    Abs_fps (\<lambda>n. (foldl (\<lambda>r a. r* pochhammer a n) 1 as * c^n) /
  35.319 @@ -3731,8 +3731,8 @@
  35.320    with assms have "i < (LEAST n. f $ n \<noteq> g $ n)"
  35.321      by (simp add: split_if_asm dist_fps_def)
  35.322    also have "\<dots> \<le> j"
  35.323 -    using `f $ j \<noteq> g $ j` by (auto intro: Least_le)
  35.324 -  finally show False using `j \<le> i` by simp
  35.325 +    using \<open>f $ j \<noteq> g $ j\<close> by (auto intro: Least_le)
  35.326 +  finally show False using \<open>j \<le> i\<close> by simp
  35.327  qed
  35.328  
  35.329  lemma nth_equal_imp_dist_less:
  35.330 @@ -3744,7 +3744,7 @@
  35.331    with assms have "dist f g = inverse (2 ^ (LEAST n. f $ n \<noteq> g $ n))"
  35.332      by (simp add: split_if_asm dist_fps_def)
  35.333    moreover
  35.334 -  from assms `\<exists>n. f $ n \<noteq> g $ n` have "i < (LEAST n. f $ n \<noteq> g $ n)"
  35.335 +  from assms \<open>\<exists>n. f $ n \<noteq> g $ n\<close> have "i < (LEAST n. f $ n \<noteq> g $ n)"
  35.336      by (metis (mono_tags) LeastI not_less)
  35.337    ultimately show ?thesis by simp
  35.338  qed simp
  35.339 @@ -3759,7 +3759,7 @@
  35.340    {
  35.341      fix i
  35.342      have "0 < inverse ((2::real)^i)" by simp
  35.343 -    from metric_CauchyD[OF `Cauchy X` this] dist_less_imp_nth_equal
  35.344 +    from metric_CauchyD[OF \<open>Cauchy X\<close> this] dist_less_imp_nth_equal
  35.345      have "\<exists>M. \<forall>m \<ge> M. \<forall>j\<le>i. X M $ j = X m $ j" by blast
  35.346    }
  35.347    then obtain M where M: "\<forall>i. \<forall>m \<ge> M i. \<forall>j \<le> i. X (M i) $ j = X m $ j" by metis
  35.348 @@ -3776,7 +3776,7 @@
  35.349          unfolding eventually_nhds
  35.350          apply clarsimp
  35.351          apply (rule FalseE)
  35.352 -        apply auto --{*slow*}
  35.353 +        apply auto --\<open>slow\<close>
  35.354          done
  35.355        then obtain i where "inverse (2 ^ i) < e" by (auto simp: eventually_sequentially)
  35.356        have "eventually (\<lambda>x. M i \<le> x) sequentially" by (auto simp: eventually_sequentially)
  35.357 @@ -3789,7 +3789,7 @@
  35.358            using M by (metis nat_le_linear)
  35.359          ultimately have "dist (X x) (Abs_fps (\<lambda>j. X (M j) $ j)) < inverse (2 ^ i)"
  35.360            using M by (force simp: dist_less_eq_nth_equal)
  35.361 -        also note `inverse (2 ^ i) < e`
  35.362 +        also note \<open>inverse (2 ^ i) < e\<close>
  35.363          finally show "dist (X x) (Abs_fps (\<lambda>j. X (M j) $ j)) < e" .
  35.364        qed
  35.365      qed
    36.1 --- a/src/HOL/Library/Fraction_Field.thy	Wed Jun 17 10:57:11 2015 +0200
    36.2 +++ b/src/HOL/Library/Fraction_Field.thy	Wed Jun 17 11:03:05 2015 +0200
    36.3 @@ -2,16 +2,16 @@
    36.4      Author:     Amine Chaieb, University of Cambridge
    36.5  *)
    36.6  
    36.7 -section{* A formalization of the fraction field of any integral domain;
    36.8 -         generalization of theory Rat from int to any integral domain *}
    36.9 +section\<open>A formalization of the fraction field of any integral domain;
   36.10 +         generalization of theory Rat from int to any integral domain\<close>
   36.11  
   36.12  theory Fraction_Field
   36.13  imports Main
   36.14  begin
   36.15  
   36.16 -subsection {* General fractions construction *}
   36.17 +subsection \<open>General fractions construction\<close>
   36.18  
   36.19 -subsubsection {* Construction of the type of fractions *}
   36.20 +subsubsection \<open>Construction of the type of fractions\<close>
   36.21  
   36.22  definition fractrel :: "(('a::idom * 'a ) * ('a * 'a)) set" where
   36.23    "fractrel = {(x, y). snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x}"
   36.24 @@ -69,7 +69,7 @@
   36.25  declare Abs_fract_inject [simp] Abs_fract_inverse [simp]
   36.26  
   36.27  
   36.28 -subsubsection {* Representation and basic operations *}
   36.29 +subsubsection \<open>Representation and basic operations\<close>
   36.30  
   36.31  definition Fract :: "'a::idom \<Rightarrow> 'a \<Rightarrow> 'a fract"
   36.32    where "Fract a b = Abs_fract (fractrel `` {if b = 0 then (0, 1) else (a, b)})"
   36.33 @@ -210,12 +210,12 @@
   36.34    case False
   36.35    then obtain a b where "q = Fract a b" and "b \<noteq> 0" by (cases q) auto
   36.36    with False have "0 \<noteq> Fract a b" by simp
   36.37 -  with `b \<noteq> 0` have "a \<noteq> 0" by (simp add: Zero_fract_def eq_fract)
   36.38 -  with Fract `q = Fract a b` `b \<noteq> 0` show thesis by auto
   36.39 +  with \<open>b \<noteq> 0\<close> have "a \<noteq> 0" by (simp add: Zero_fract_def eq_fract)
   36.40 +  with Fract \<open>q = Fract a b\<close> \<open>b \<noteq> 0\<close> show thesis by auto
   36.41  qed
   36.42  
   36.43  
   36.44 -subsubsection {* The field of rational numbers *}
   36.45 +subsubsection \<open>The field of rational numbers\<close>
   36.46  
   36.47  context idom
   36.48  begin
   36.49 @@ -264,7 +264,7 @@
   36.50  end
   36.51  
   36.52  
   36.53 -subsubsection {* The ordered field of fractions over an ordered idom *}
   36.54 +subsubsection \<open>The ordered field of fractions over an ordered idom\<close>
   36.55  
   36.56  lemma le_congruent2:
   36.57    "(\<lambda>x y::'a \<times> 'a::linordered_idom.
    37.1 --- a/src/HOL/Library/Fun_Lexorder.thy	Wed Jun 17 10:57:11 2015 +0200
    37.2 +++ b/src/HOL/Library/Fun_Lexorder.thy	Wed Jun 17 11:03:05 2015 +0200
    37.3 @@ -52,9 +52,9 @@
    37.4    assumes "less_fun f g" and "less_fun g h"
    37.5    shows "less_fun f h"
    37.6  proof (rule less_funI)
    37.7 -  from `less_fun f g` obtain k1 where k1: "f k1 < g k1" "\<And>k'. k' < k1 \<Longrightarrow> f k' = g k'"
    37.8 +  from \<open>less_fun f g\<close> obtain k1 where k1: "f k1 < g k1" "\<And>k'. k' < k1 \<Longrightarrow> f k' = g k'"
    37.9      by (blast elim!: less_funE) 
   37.10 -  from `less_fun g h` obtain k2 where k2: "g k2 < h k2" "\<And>k'. k' < k2 \<Longrightarrow> g k' = h k'"
   37.11 +  from \<open>less_fun g h\<close> obtain k2 where k2: "g k2 < h k2" "\<And>k'. k' < k2 \<Longrightarrow> g k' = h k'"
   37.12      by (blast elim!: less_funE) 
   37.13    show "\<exists>k. f k < h k \<and> (\<forall>k'<k. f k' = h k')"
   37.14    proof (cases k1 k2 rule: linorder_cases)
   37.15 @@ -85,7 +85,7 @@
   37.16      then have "q \<in> K" and "\<And>k. k \<in> K \<Longrightarrow> k \<ge> q" by auto
   37.17      then have "\<And>k. \<not> k \<ge> q \<Longrightarrow> k \<notin> K" by blast
   37.18      then have *: "\<And>k. k < q \<Longrightarrow> f k = g k" by (simp add: K_def)
   37.19 -    from `q \<in> K` have "f q \<noteq> g q" by (simp add: K_def)
   37.20 +    from \<open>q \<in> K\<close> have "f q \<noteq> g q" by (simp add: K_def)
   37.21      then have "f q < g q \<or> f q > g q" by auto
   37.22      with * have "less_fun f g \<or> less_fun g f"
   37.23        by (auto intro!: less_funI)
    38.1 --- a/src/HOL/Library/Function_Algebras.thy	Wed Jun 17 10:57:11 2015 +0200
    38.2 +++ b/src/HOL/Library/Function_Algebras.thy	Wed Jun 17 11:03:05 2015 +0200
    38.3 @@ -2,13 +2,13 @@
    38.4      Author:     Jeremy Avigad and Kevin Donnelly; Florian Haftmann, TUM
    38.5  *)
    38.6  
    38.7 -section {* Pointwise instantiation of functions to algebra type classes *}
    38.8 +section \<open>Pointwise instantiation of functions to algebra type classes\<close>
    38.9  
   38.10  theory Function_Algebras
   38.11  imports Main
   38.12  begin
   38.13  
   38.14 -text {* Pointwise operations *}
   38.15 +text \<open>Pointwise operations\<close>
   38.16  
   38.17  instantiation "fun" :: (type, plus) plus
   38.18  begin
   38.19 @@ -59,7 +59,7 @@
   38.20    by (simp add: one_fun_def)
   38.21  
   38.22  
   38.23 -text {* Additive structures *}
   38.24 +text \<open>Additive structures\<close>
   38.25  
   38.26  instance "fun" :: (type, semigroup_add) semigroup_add
   38.27    by default (simp add: fun_eq_iff add.assoc)
   38.28 @@ -89,7 +89,7 @@
   38.29    by default simp_all
   38.30  
   38.31  
   38.32 -text {* Multiplicative structures *}
   38.33 +text \<open>Multiplicative structures\<close>
   38.34  
   38.35  instance "fun" :: (type, semigroup_mult) semigroup_mult
   38.36    by default (simp add: fun_eq_iff mult.assoc)
   38.37 @@ -104,7 +104,7 @@
   38.38    by default simp
   38.39  
   38.40  
   38.41 -text {* Misc *}
   38.42 +text \<open>Misc\<close>
   38.43  
   38.44  instance "fun" :: (type, "Rings.dvd") "Rings.dvd" ..
   38.45  
   38.46 @@ -115,7 +115,7 @@
   38.47    by default (simp add: fun_eq_iff)
   38.48  
   38.49  
   38.50 -text {* Ring structures *}
   38.51 +text \<open>Ring structures\<close>
   38.52  
   38.53  instance "fun" :: (type, semiring) semiring
   38.54    by default (simp_all add: fun_eq_iff algebra_simps)
   38.55 @@ -176,7 +176,7 @@
   38.56  instance "fun" :: (type, ring_char_0) ring_char_0 ..
   38.57  
   38.58  
   38.59 -text {* Ordered structures *}
   38.60 +text \<open>Ordered structures\<close>
   38.61  
   38.62  instance "fun" :: (type, ordered_ab_semigroup_add) ordered_ab_semigroup_add
   38.63    by default (auto simp add: le_fun_def intro: add_left_mono)
    39.1 --- a/src/HOL/Library/Function_Division.thy	Wed Jun 17 10:57:11 2015 +0200
    39.2 +++ b/src/HOL/Library/Function_Division.thy	Wed Jun 17 11:03:05 2015 +0200
    39.3 @@ -2,13 +2,13 @@
    39.4      Author:     Florian Haftmann, TUM
    39.5  *)
    39.6  
    39.7 -section {* Pointwise instantiation of functions to division *}
    39.8 +section \<open>Pointwise instantiation of functions to division\<close>
    39.9  
   39.10  theory Function_Division
   39.11  imports Function_Algebras
   39.12  begin
   39.13  
   39.14 -subsection {* Syntactic with division *}
   39.15 +subsection \<open>Syntactic with division\<close>
   39.16  
   39.17  instantiation "fun" :: (type, inverse) inverse
   39.18  begin
   39.19 @@ -29,12 +29,12 @@
   39.20    "(f / g) x = f x / g x"
   39.21    by (simp add: divide_fun_def)
   39.22  
   39.23 -text {*
   39.24 +text \<open>
   39.25    Unfortunately, we cannot lift this operations to algebraic type
   39.26    classes for division: being different from the constant
   39.27    zero function @{term "f \<noteq> 0"} is too weak as precondition.
   39.28    So we must introduce our own set of lemmas.
   39.29 -*}
   39.30 +\<close>
   39.31  
   39.32  abbreviation zero_free :: "('b \<Rightarrow> 'a::field) \<Rightarrow> bool" where
   39.33    "zero_free f \<equiv> \<not> (\<exists>x. f x = 0)"
   39.34 @@ -54,12 +54,12 @@
   39.35    shows "f / g = f * inverse g"
   39.36    by (simp add: fun_eq_iff divide_inverse)
   39.37  
   39.38 -text {* Feel free to extend this. *}
   39.39 +text \<open>Feel free to extend this.\<close>
   39.40  
   39.41 -text {*
   39.42 +text \<open>
   39.43    Another possibility would be a reformulation of the division type
   39.44    classes to user a @{term zero_free} predicate rather than
   39.45    a direct @{term "a \<noteq> 0"} condition.
   39.46 -*}
   39.47 +\<close>
   39.48  
   39.49  end
    40.1 --- a/src/HOL/Library/Function_Growth.thy	Wed Jun 17 10:57:11 2015 +0200
    40.2 +++ b/src/HOL/Library/Function_Growth.thy	Wed Jun 17 11:03:05 2015 +0200
    40.3 @@ -1,15 +1,15 @@
    40.4  
    40.5  (* Author: Florian Haftmann, TU Muenchen *)
    40.6  
    40.7 -section {* Comparing growth of functions on natural numbers by a preorder relation *}
    40.8 +section \<open>Comparing growth of functions on natural numbers by a preorder relation\<close>
    40.9  
   40.10  theory Function_Growth
   40.11  imports Main Preorder Discrete
   40.12  begin
   40.13  
   40.14 -subsection {* Motivation *}
   40.15 +subsection \<open>Motivation\<close>
   40.16  
   40.17 -text {*
   40.18 +text \<open>
   40.19    When comparing growth of functions in computer science, it is common to adhere
   40.20    on Landau Symbols (``O-Notation'').  However these come at the cost of notational
   40.21    oddities, particularly writing @{text "f = O(g)"} for @{text "f \<in> O(g)"} etc.
   40.22 @@ -21,11 +21,11 @@
   40.23    avoid the notational oddities mentioned above but also emphasizes the key insight
   40.24    of a growth hierarchy of functions:
   40.25    @{text "(\<lambda>n. 0) \<lesssim> (\<lambda>n. k) \<lesssim> Discrete.log \<lesssim> Discrete.sqrt \<lesssim> id \<lesssim> \<dots>"}.
   40.26 -*}
   40.27 +\<close>
   40.28  
   40.29 -subsection {* Model *}
   40.30 +subsection \<open>Model\<close>
   40.31  
   40.32 -text {*
   40.33 +text \<open>
   40.34    Our growth functions are of type @{text "\<nat> \<Rightarrow> \<nat>"}.  This is different
   40.35    to the usual conventions for Landau symbols for which @{text "\<real> \<Rightarrow> \<real>"}
   40.36    would be appropriate, but we argue that @{text "\<real> \<Rightarrow> \<real>"} is more
   40.37 @@ -33,19 +33,19 @@
   40.38  
   40.39    Note that we also restrict the additional coefficients to @{text \<nat>}, something
   40.40    we discuss at the particular definitions.
   40.41 -*}
   40.42 +\<close>
   40.43  
   40.44 -subsection {* The @{text "\<lesssim>"} relation *}
   40.45 +subsection \<open>The @{text "\<lesssim>"} relation\<close>
   40.46  
   40.47  definition less_eq_fun :: "(nat \<Rightarrow> nat) \<Rightarrow> (nat \<Rightarrow> nat) \<Rightarrow> bool" (infix "\<lesssim>" 50)
   40.48  where
   40.49    "f \<lesssim> g \<longleftrightarrow> (\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m)"
   40.50  
   40.51 -text {*
   40.52 +text \<open>
   40.53    This yields @{text "f \<lesssim> g \<longleftrightarrow> f \<in> O(g)"}.  Note that @{text c} is restricted to
   40.54    @{text \<nat>}.  This does not pose any problems since if @{text "f \<in> O(g)"} holds for
   40.55    a @{text "c \<in> \<real>"}, it also holds for @{text "\<lceil>c\<rceil> \<in> \<nat>"} by transitivity.
   40.56 -*}
   40.57 +\<close>
   40.58  
   40.59  lemma less_eq_funI [intro?]:
   40.60    assumes "\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m"
   40.61 @@ -68,17 +68,17 @@
   40.62    using assms unfolding less_eq_fun_def linorder_not_le [symmetric] by blast
   40.63  
   40.64  
   40.65 -subsection {* The @{text "\<approx>"} relation, the equivalence relation induced by @{text "\<lesssim>"} *}
   40.66 +subsection \<open>The @{text "\<approx>"} relation, the equivalence relation induced by @{text "\<lesssim>"}\<close>
   40.67  
   40.68  definition equiv_fun :: "(nat \<Rightarrow> nat) \<Rightarrow> (nat \<Rightarrow> nat) \<Rightarrow> bool" (infix "\<cong>" 50)
   40.69  where
   40.70    "f \<cong> g \<longleftrightarrow>
   40.71      (\<exists>c\<^sub>1>0. \<exists>c\<^sub>2>0. \<exists>n. \<forall>m>n. f m \<le> c\<^sub>1 * g m \<and> g m \<le> c\<^sub>2 * f m)"
   40.72  
   40.73 -text {*
   40.74 +text \<open>
   40.75    This yields @{text "f \<cong> g \<longleftrightarrow> f \<in> \<Theta>(g)"}.  Concerning @{text "c\<^sub>1"} and @{text "c\<^sub>2"}
   40.76    restricted to @{typ nat}, see note above on @{text "(\<lesssim>)"}.
   40.77 -*}
   40.78 +\<close>
   40.79  
   40.80  lemma equiv_funI [intro?]:
   40.81    assumes "\<exists>c\<^sub>1>0. \<exists>c\<^sub>2>0. \<exists>n. \<forall>m>n. f m \<le> c\<^sub>1 * g m \<and> g m \<le> c\<^sub>2 * f m"
   40.82 @@ -105,7 +105,7 @@
   40.83    using assms unfolding equiv_fun_def linorder_not_le [symmetric] by blast
   40.84  
   40.85  
   40.86 -subsection {* The @{text "\<prec>"} relation, the strict part of @{text "\<lesssim>"} *}
   40.87 +subsection \<open>The @{text "\<prec>"} relation, the strict part of @{text "\<lesssim>"}\<close>
   40.88  
   40.89  definition less_fun :: "(nat \<Rightarrow> nat) \<Rightarrow> (nat \<Rightarrow> nat) \<Rightarrow> bool" (infix "\<prec>" 50)
   40.90  where
   40.91 @@ -129,11 +129,11 @@
   40.92      and "\<And>c n. c > 0 \<Longrightarrow> \<exists>m>n. c * f m < g m"
   40.93  proof -
   40.94    from assms have "f \<lesssim> g" and "\<not> g \<lesssim> f" by (simp_all add: less_fun_def)
   40.95 -  from `f \<lesssim> g` obtain n c where *:"c > 0" "\<And>m. m > n \<Longrightarrow> f m \<le> c * g m"
   40.96 +  from \<open>f \<lesssim> g\<close> obtain n c where *:"c > 0" "\<And>m. m > n \<Longrightarrow> f m \<le> c * g m"
   40.97      by (rule less_eq_funE) blast
   40.98    { fix c n :: nat
   40.99      assume "c > 0"
  40.100 -    with `\<not> g \<lesssim> f` obtain m where "m > n" "c * f m < g m"
  40.101 +    with \<open>\<not> g \<lesssim> f\<close> obtain m where "m > n" "c * f m < g m"
  40.102        by (rule not_less_eq_funE) blast
  40.103      then have **: "\<exists>m>n. c * f m < g m" by blast
  40.104    } note ** = this
  40.105 @@ -146,7 +146,7 @@
  40.106      | d q where "\<And>m. d > 0 \<Longrightarrow> m > q \<Longrightarrow> g q \<le> d * f q"
  40.107    using assms unfolding less_fun_def linorder_not_less [symmetric] by blast
  40.108  
  40.109 -text {*
  40.110 +text \<open>
  40.111    I did not find a proof for @{text "f \<prec> g \<longleftrightarrow> f \<in> o(g)"}.  Maybe this only
  40.112    holds if @{text f} and/or @{text g} are of a certain class of functions.
  40.113    However @{text "f \<in> o(g) \<longrightarrow> f \<prec> g"} is provable, and this yields a
  40.114 @@ -161,14 +161,14 @@
  40.115    works since @{text c} may become arbitrary small.  Since this is not possible
  40.116    within @{term \<nat>}, we push the coefficient to the left hand side instead such
  40.117    that it become arbitrary big instead.
  40.118 -*}
  40.119 +\<close>
  40.120  
  40.121  lemma less_fun_strongI:
  40.122    assumes "\<And>c. c > 0 \<Longrightarrow> \<exists>n. \<forall>m>n. c * f m < g m"
  40.123    shows "f \<prec> g"
  40.124  proof (rule less_funI)
  40.125    have "1 > (0::nat)" by simp
  40.126 -  from assms `1 > 0` have "\<exists>n. \<forall>m>n. 1 * f m < g m" .
  40.127 +  from assms \<open>1 > 0\<close> have "\<exists>n. \<forall>m>n. 1 * f m < g m" .
  40.128    then obtain n where *: "\<And>m. m > n \<Longrightarrow> 1 * f m < g m" by blast
  40.129    have "\<forall>m>n. f m \<le> 1 * g m"
  40.130    proof (rule allI, rule impI)
  40.131 @@ -177,7 +177,7 @@
  40.132      with * have "1 * f m < g m" by simp
  40.133      then show "f m \<le> 1 * g m" by simp
  40.134    qed
  40.135 -  with `1 > 0` show "\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m" by blast
  40.136 +  with \<open>1 > 0\<close> show "\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m" by blast
  40.137    fix c n :: nat
  40.138    assume "c > 0"
  40.139    with assms obtain q where "\<And>m. m > q \<Longrightarrow> c * f m < g m" by blast
  40.140 @@ -187,9 +187,9 @@
  40.141  qed
  40.142  
  40.143  
  40.144 -subsection {* @{text "\<lesssim>"} is a preorder *}
  40.145 +subsection \<open>@{text "\<lesssim>"} is a preorder\<close>
  40.146  
  40.147 -text {* This yields all lemmas relating @{text "\<lesssim>"}, @{text "\<prec>"} and @{text "\<cong>"}. *}
  40.148 +text \<open>This yields all lemmas relating @{text "\<lesssim>"}, @{text "\<prec>"} and @{text "\<cong>"}.\<close>
  40.149  
  40.150  interpretation fun_order: preorder_equiv less_eq_fun less_fun
  40.151    where "preorder_equiv.equiv less_eq_fun = equiv_fun"
  40.152 @@ -207,10 +207,10 @@
  40.153      assume "f \<lesssim> g" and "g \<lesssim> h"
  40.154      show "f \<lesssim> h"
  40.155      proof
  40.156 -      from `f \<lesssim> g` obtain n\<^sub>1 c\<^sub>1
  40.157 +      from \<open>f \<lesssim> g\<close> obtain n\<^sub>1 c\<^sub>1
  40.158          where "c\<^sub>1 > 0" and P\<^sub>1: "\<And>m. m > n\<^sub>1 \<Longrightarrow> f m \<le> c\<^sub>1 * g m"
  40.159          by rule blast
  40.160 -      from `g \<lesssim> h` obtain n\<^sub>2 c\<^sub>2
  40.161 +      from \<open>g \<lesssim> h\<close> obtain n\<^sub>2 c\<^sub>2
  40.162          where "c\<^sub>2 > 0" and P\<^sub>2: "\<And>m. m > n\<^sub>2 \<Longrightarrow> g m \<le> c\<^sub>2 * h m"
  40.163          by rule blast
  40.164        have "\<forall>m>max n\<^sub>1 n\<^sub>2. f m \<le> (c\<^sub>1 * c\<^sub>2) * h m"
  40.165 @@ -219,11 +219,11 @@
  40.166          assume Q: "m > max n\<^sub>1 n\<^sub>2"
  40.167          from P\<^sub>1 Q have *: "f m \<le> c\<^sub>1 * g m" by simp
  40.168          from P\<^sub>2 Q have "g m \<le> c\<^sub>2 * h m" by simp
  40.169 -        with `c\<^sub>1 > 0` have "c\<^sub>1 * g m \<le> (c\<^sub>1 * c\<^sub>2) * h m" by simp
  40.170 +        with \<open>c\<^sub>1 > 0\<close> have "c\<^sub>1 * g m \<le> (c\<^sub>1 * c\<^sub>2) * h m" by simp
  40.171          with * show "f m \<le> (c\<^sub>1 * c\<^sub>2) * h m" by (rule order_trans)
  40.172        qed
  40.173        then have "\<exists>n. \<forall>m>n. f m \<le> (c\<^sub>1 * c\<^sub>2) * h m" by rule
  40.174 -      moreover from `c\<^sub>1 > 0` `c\<^sub>2 > 0` have "c\<^sub>1 * c\<^sub>2 > 0" by simp
  40.175 +      moreover from \<open>c\<^sub>1 > 0\<close> \<open>c\<^sub>2 > 0\<close> have "c\<^sub>1 * c\<^sub>2 > 0" by simp
  40.176        ultimately show "\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * h m" by blast
  40.177      qed
  40.178    qed
  40.179 @@ -243,7 +243,7 @@
  40.180          assume "m > n"
  40.181          with * show "f m \<le> c\<^sub>1 * g m" by simp
  40.182        qed
  40.183 -      with `c\<^sub>1 > 0` have "\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m" by blast
  40.184 +      with \<open>c\<^sub>1 > 0\<close> have "\<exists>c>0. \<exists>n. \<forall>m>n. f m \<le> c * g m" by blast
  40.185        then have "f \<lesssim> g" ..
  40.186        have "\<forall>m>n. g m \<le> c\<^sub>2 * f m"
  40.187        proof (rule allI, rule impI)
  40.188 @@ -251,15 +251,15 @@
  40.189          assume "m > n"
  40.190          with * show "g m \<le> c\<^sub>2 * f m" by simp
  40.191        qed
  40.192 -      with `c\<^sub>2 > 0` have "\<exists>c>0. \<exists>n. \<forall>m>n. g m \<le> c * f m" by blast
  40.193 +      with \<open>c\<^sub>2 > 0\<close> have "\<exists>c>0. \<exists>n. \<forall>m>n. g m \<le> c * f m" by blast
  40.194        then have "g \<lesssim> f" ..
  40.195 -      from `f \<lesssim> g` and `g \<lesssim> f` show "f \<lesssim> g \<and> g \<lesssim> f" ..
  40.196 +      from \<open>f \<lesssim> g\<close> and \<open>g \<lesssim> f\<close> show "f \<lesssim> g \<and> g \<lesssim> f" ..
  40.197      next
  40.198        assume "f \<lesssim> g \<and> g \<lesssim> f"
  40.199        then have "f \<lesssim> g" and "g \<lesssim> f" by auto
  40.200 -      from `f \<lesssim> g` obtain n\<^sub>1 c\<^sub>1 where "c\<^sub>1 > 0"
  40.201 +      from \<open>f \<lesssim> g\<close> obtain n\<^sub>1 c\<^sub>1 where "c\<^sub>1 > 0"
  40.202          and P\<^sub>1: "\<And>m. m > n\<^sub>1 \<Longrightarrow> f m \<le> c\<^sub>1 * g m" by rule blast
  40.203 -      from `g \<lesssim> f` obtain n\<^sub>2 c\<^sub>2 where "c\<^sub>2 > 0"
  40.204 +      from \<open>g \<lesssim> f\<close> obtain n\<^sub>2 c\<^sub>2 where "c\<^sub>2 > 0"
  40.205          and P\<^sub>2: "\<And>m. m > n\<^sub>2 \<Longrightarrow> g m \<le> c\<^sub>2 * f m" by rule blast
  40.206        have "\<forall>m>max n\<^sub>1 n\<^sub>2. f m \<le> c\<^sub>1 * g m \<and> g m \<le> c\<^sub>2 * f m"
  40.207        proof (rule allI, rule impI)
  40.208 @@ -269,7 +269,7 @@
  40.209          moreover from P\<^sub>2 Q have "g m \<le> c\<^sub>2 * f m" by simp
  40.210          ultimately show "f m \<le> c\<^sub>1 * g m \<and> g m \<le> c\<^sub>2 * f m" ..
  40.211        qed
  40.212 -      with `c\<^sub>1 > 0` `c\<^sub>2 > 0` have "\<exists>c\<^sub>1>0. \<exists>c\<^sub>2>0. \<exists>n.
  40.213 +      with \<open>c\<^sub>1 > 0\<close> \<open>c\<^sub>2 > 0\<close> have "\<exists>c\<^sub>1>0. \<exists>c\<^sub>2>0. \<exists>n.
  40.214          \<forall>m>n. f m \<le> c\<^sub>1 * g m \<and> g m \<le> c\<^sub>2 * f m" by blast
  40.215        then show "f \<cong> g" ..
  40.216      qed
  40.217 @@ -277,18 +277,18 @@
  40.218  qed
  40.219  
  40.220  
  40.221 -subsection {* Simple examples *}
  40.222 +subsection \<open>Simple examples\<close>
  40.223  
  40.224 -text {*
  40.225 +text \<open>
  40.226    Most of these are left as constructive exercises for the reader.  Note that additional
  40.227    preconditions to the functions may be necessary.  The list here is by no means to be
  40.228    intended as complete construction set for typical functions, here surely something
  40.229    has to be added yet.
  40.230 -*}
  40.231 +\<close>
  40.232  
  40.233 -text {* @{prop "(\<lambda>n. f n + k) \<cong> f"} *}
  40.234 +text \<open>@{prop "(\<lambda>n. f n + k) \<cong> f"}\<close>
  40.235  
  40.236 -text {* @{prop "(\<lambda>n. Suc k * f n) \<cong> f"} *}
  40.237 +text \<open>@{prop "(\<lambda>n. Suc k * f n) \<cong> f"}\<close>
  40.238  
  40.239  lemma "f \<lesssim> (\<lambda>n. f n + g n)"
  40.240    by rule auto
  40.241 @@ -312,7 +312,7 @@
  40.242    then show "\<exists>n. \<forall>m>n. c * k < Discrete.log m" ..
  40.243  qed
  40.244    
  40.245 -text {* @{prop "Discrete.log \<prec> Discrete.sqrt"} *}
  40.246 +text \<open>@{prop "Discrete.log \<prec> Discrete.sqrt"}\<close>
  40.247  
  40.248  lemma "Discrete.sqrt \<prec> id"
  40.249  proof (rule less_fun_strongI)
  40.250 @@ -326,7 +326,7 @@
  40.251      with mono_sqrt have "Discrete.sqrt ((Suc c)\<^sup>2) \<le> Discrete.sqrt m" by (rule monoE)
  40.252      then have "Suc c \<le> Discrete.sqrt m" by simp
  40.253      then have "c < Discrete.sqrt m" by simp
  40.254 -    moreover from `(Suc c)\<^sup>2 < m` have "Discrete.sqrt m > 0" by simp
  40.255 +    moreover from \<open>(Suc c)\<^sup>2 < m\<close> have "Discrete.sqrt m > 0" by simp
  40.256      ultimately have "c * Discrete.sqrt m < Discrete.sqrt m * Discrete.sqrt m" by simp
  40.257      also have "\<dots> \<le> m" by (simp add: power2_eq_square [symmetric])
  40.258      finally show "c * Discrete.sqrt m < id m" by simp
  40.259 @@ -340,7 +340,7 @@
  40.260  lemma "(\<lambda>n. n ^ k) \<prec> (\<lambda>n. n ^ Suc k)"
  40.261    by (rule less_fun_strongI) auto
  40.262  
  40.263 -text {* @{prop "(\<lambda>n. n ^ k) \<prec> (\<lambda>n. 2 ^ n)"} *}
  40.264 +text \<open>@{prop "(\<lambda>n. n ^ k) \<prec> (\<lambda>n. 2 ^ n)"}\<close>
  40.265  
  40.266  end
  40.267  
    41.1 --- a/src/HOL/Library/Groups_Big_Fun.thy	Wed Jun 17 10:57:11 2015 +0200
    41.2 +++ b/src/HOL/Library/Groups_Big_Fun.thy	Wed Jun 17 11:03:05 2015 +0200
    41.3 @@ -49,17 +49,17 @@
    41.4    assumes "g a = 1"
    41.5    shows "G (g(a := b)) = b * G g"
    41.6  proof (cases "b = 1")
    41.7 -  case True with `g a = 1` show ?thesis
    41.8 +  case True with \<open>g a = 1\<close> show ?thesis
    41.9      by (simp add: expand_set) (rule F.cong, auto)
   41.10  next
   41.11    case False
   41.12    moreover have "{a'. a' \<noteq> a \<longrightarrow> g a' \<noteq> 1} = insert a {a. g a \<noteq> 1}"
   41.13      by auto
   41.14 -  moreover from `g a = 1` have "a \<notin> {a. g a \<noteq> 1}"
   41.15 +  moreover from \<open>g a = 1\<close> have "a \<notin> {a. g a \<noteq> 1}"
   41.16      by simp
   41.17    moreover have "F.F (\<lambda>a'. if a' = a then b else g a') {a. g a \<noteq> 1} = F.F g {a. g a \<noteq> 1}"
   41.18 -    by (rule F.cong) (auto simp add: `g a = 1`)
   41.19 -  ultimately show ?thesis using `finite {a. g a \<noteq> 1}` by (simp add: expand_set)
   41.20 +    by (rule F.cong) (auto simp add: \<open>g a = 1\<close>)
   41.21 +  ultimately show ?thesis using \<open>finite {a. g a \<noteq> 1}\<close> by (simp add: expand_set)
   41.22  qed
   41.23  
   41.24  lemma infinite [simp]:
   41.25 @@ -87,9 +87,9 @@
   41.26    shows "G g = G h"
   41.27  proof -
   41.28    from assms have unfold: "h = g \<circ> l" by simp
   41.29 -  from `bij l` have "inj l" by (rule bij_is_inj)
   41.30 +  from \<open>bij l\<close> have "inj l" by (rule bij_is_inj)
   41.31    then have "inj_on l {a. h a \<noteq> 1}" by (rule subset_inj_on) simp
   41.32 -  moreover from `bij l` have "{a. g a \<noteq> 1} = l ` {a. h a \<noteq> 1}"
   41.33 +  moreover from \<open>bij l\<close> have "{a. g a \<noteq> 1} = l ` {a. h a \<noteq> 1}"
   41.34      by (auto simp add: image_Collect unfold elim: bij_pointE)
   41.35    moreover have "\<And>x. x \<in> {a. h a \<noteq> 1} \<Longrightarrow> g (l x) = h x"
   41.36      by (simp add: unfold)
   41.37 @@ -115,7 +115,7 @@
   41.38    assumes subset: "{a. \<exists>b. g a b \<noteq> 1} \<times> {b. \<exists>a. g a b \<noteq> 1} \<subseteq> C" (is "?A \<times> ?B \<subseteq> C")
   41.39    shows "G (\<lambda>a. G (g a)) = G (\<lambda>b. G (\<lambda>a. g a b))"
   41.40  proof -
   41.41 -  from `finite C` subset
   41.42 +  from \<open>finite C\<close> subset
   41.43      have "finite ({a. \<exists>b. g a b \<noteq> 1} \<times> {b. \<exists>a. g a b \<noteq> 1})"
   41.44      by (rule rev_finite_subset)
   41.45    then have fins:
   41.46 @@ -143,17 +143,17 @@
   41.47    assumes subset: "{a. \<exists>b. g a b \<noteq> 1} \<times> {b. \<exists>a. g a b \<noteq> 1} \<subseteq> C" (is "?A \<times> ?B \<subseteq> C")
   41.48    shows "G (\<lambda>a. G (g a)) = G (\<lambda>(a, b). g a b)"
   41.49  proof -
   41.50 -  from subset `finite C` have fin_prod: "finite (?A \<times> ?B)"
   41.51 +  from subset \<open>finite C\<close> have fin_prod: "finite (?A \<times> ?B)"
   41.52      by (rule finite_subset)
   41.53    from fin_prod have "finite ?A" and "finite ?B"
   41.54      by (auto simp add: finite_cartesian_product_iff)
   41.55    have *: "G (\<lambda>a. G (g a)) =
   41.56      (F.F (\<lambda>a. F.F (g a) {b. \<exists>a. g a b \<noteq> 1}) {a. \<exists>b. g a b \<noteq> 1})"
   41.57      apply (subst expand_superset [of "?B"])
   41.58 -    apply (rule `finite ?B`)
   41.59 +    apply (rule \<open>finite ?B\<close>)
   41.60      apply auto
   41.61      apply (subst expand_superset [of "?A"])
   41.62 -    apply (rule `finite ?A`)
   41.63 +    apply (rule \<open>finite ?A\<close>)
   41.64      apply auto
   41.65      apply (erule F.not_neutral_contains_not_neutral)
   41.66      apply auto
   41.67 @@ -166,10 +166,10 @@
   41.68      apply (simp add: *)
   41.69      apply (simp add: F.cartesian_product)
   41.70      apply (subst expand_superset [of C])
   41.71 -    apply (rule `finite C`)
   41.72 +    apply (rule \<open>finite C\<close>)
   41.73      apply (simp_all add: **)
   41.74      apply (rule F.same_carrierI [of C])
   41.75 -    apply (rule `finite C`)
   41.76 +    apply (rule \<open>finite C\<close>)
   41.77      apply (simp_all add: subset)
   41.78      apply auto
   41.79      done
   41.80 @@ -330,9 +330,9 @@
   41.81    assumes "f a = 0"
   41.82    shows "(\<Prod>a. f a) = 0"
   41.83  proof -
   41.84 -  from `f a = 0` have "f a \<noteq> 1" by simp
   41.85 -  with `f a = 0` have "\<exists>a. f a \<noteq> 1 \<and> f a = 0" by blast
   41.86 -  with `finite {a. f a \<noteq> 1}` show ?thesis
   41.87 +  from \<open>f a = 0\<close> have "f a \<noteq> 1" by simp
   41.88 +  with \<open>f a = 0\<close> have "\<exists>a. f a \<noteq> 1 \<and> f a = 0" by blast
   41.89 +  with \<open>finite {a. f a \<noteq> 1}\<close> show ?thesis
   41.90      by (simp add: Prod_any.expand_set setprod_zero)
   41.91  qed
   41.92  
    42.1 --- a/src/HOL/Library/IArray.thy	Wed Jun 17 10:57:11 2015 +0200
    42.2 +++ b/src/HOL/Library/IArray.thy	Wed Jun 17 11:03:05 2015 +0200
    42.3 @@ -4,14 +4,14 @@
    42.4  imports Main
    42.5  begin
    42.6  
    42.7 -text{* Immutable arrays are lists wrapped up in an additional constructor.
    42.8 +text\<open>Immutable arrays are lists wrapped up in an additional constructor.
    42.9  There are no update operations. Hence code generation can safely implement
   42.10  this type by efficient target language arrays.  Currently only SML is
   42.11  provided. Should be extended to other target languages and more operations.
   42.12  
   42.13  Note that arrays cannot be printed directly but only by turning them into
   42.14  lists first. Arrays could be converted back into lists for printing if they
   42.15 -were wrapped up in an additional constructor. *}
   42.16 +were wrapped up in an additional constructor.\<close>
   42.17  
   42.18  datatype 'a iarray = IArray "'a list"
   42.19  
    43.1 --- a/src/HOL/Library/Indicator_Function.thy	Wed Jun 17 10:57:11 2015 +0200
    43.2 +++ b/src/HOL/Library/Indicator_Function.thy	Wed Jun 17 11:03:05 2015 +0200
    43.3 @@ -2,7 +2,7 @@
    43.4      Author:     Johannes Hoelzl (TU Muenchen)
    43.5  *)
    43.6  
    43.7 -section {* Indicator Function *}
    43.8 +section \<open>Indicator Function\<close>
    43.9  
   43.10  theory Indicator_Function
   43.11  imports Complex_Main
   43.12 @@ -88,7 +88,7 @@
   43.13    then have 
   43.14      "\<And>n. (indicator (A (n + i)) x :: 'a) = 1"
   43.15      "(indicator (\<Union> i. A i) x :: 'a) = 1"
   43.16 -    using incseqD[OF `incseq A`, of i "n + i" for n] `x \<in> A i` by (auto simp: indicator_def)
   43.17 +    using incseqD[OF \<open>incseq A\<close>, of i "n + i" for n] \<open>x \<in> A i\<close> by (auto simp: indicator_def)
   43.18    then show ?thesis
   43.19      by (rule_tac LIMSEQ_offset[of _ i]) simp
   43.20  qed (auto simp: indicator_def)
   43.21 @@ -113,7 +113,7 @@
   43.22    then have 
   43.23      "\<And>n. (indicator (A (n + i)) x :: 'a) = 0"
   43.24      "(indicator (\<Inter>i. A i) x :: 'a) = 0"
   43.25 -    using decseqD[OF `decseq A`, of i "n + i" for n] `x \<notin> A i` by (auto simp: indicator_def)
   43.26 +    using decseqD[OF \<open>decseq A\<close>, of i "n + i" for n] \<open>x \<notin> A i\<close> by (auto simp: indicator_def)
   43.27    then show ?thesis
   43.28      by (rule_tac LIMSEQ_offset[of _ i]) simp
   43.29  qed (auto simp: indicator_def)
    44.1 --- a/src/HOL/Library/Infinite_Set.thy	Wed Jun 17 10:57:11 2015 +0200
    44.2 +++ b/src/HOL/Library/Infinite_Set.thy	Wed Jun 17 11:03:05 2015 +0200
    44.3 @@ -2,7 +2,7 @@
    44.4      Author:     Stephan Merz
    44.5  *)
    44.6  
    44.7 -section {* Infinite Sets and Related Concepts *}
    44.8 +section \<open>Infinite Sets and Related Concepts\<close>
    44.9  
   44.10  theory Infinite_Set
   44.11  imports Main
   44.12 @@ -10,19 +10,19 @@
   44.13  
   44.14  subsection "Infinite Sets"
   44.15  
   44.16 -text {*
   44.17 +text \<open>
   44.18    Some elementary facts about infinite sets, mostly by Stephan Merz.
   44.19    Beware! Because "infinite" merely abbreviates a negation, these
   44.20    lemmas may not work well with @{text "blast"}.
   44.21 -*}
   44.22 +\<close>
   44.23  
   44.24  abbreviation infinite :: "'a set \<Rightarrow> bool"
   44.25    where "infinite S \<equiv> \<not> finite S"
   44.26  
   44.27 -text {*
   44.28 +text \<open>
   44.29    Infinite sets are non-empty, and if we remove some elements from an
   44.30    infinite set, the result is still infinite.
   44.31 -*}
   44.32 +\<close>
   44.33  
   44.34  lemma infinite_imp_nonempty: "infinite S \<Longrightarrow> S \<noteq> {}"
   44.35    by auto
   44.36 @@ -62,10 +62,10 @@
   44.37    with S show False by simp
   44.38  qed
   44.39  
   44.40 -text {*
   44.41 +text \<open>
   44.42    As a concrete example, we prove that the set of natural numbers is
   44.43    infinite.
   44.44 -*}
   44.45 +\<close>
   44.46  
   44.47  lemma infinite_nat_iff_unbounded_le: "infinite (S::nat set) \<longleftrightarrow> (\<forall>m. \<exists>n\<ge>m. n \<in> S)"
   44.48    using frequently_cofinite[of "\<lambda>x. x \<in> S"]
   44.49 @@ -84,11 +84,11 @@
   44.50  lemma finite_nat_bounded: "finite (S::nat set) \<Longrightarrow> \<exists>k. S \<subseteq> {..<k}"
   44.51    by (simp add: finite_nat_iff_bounded)
   44.52  
   44.53 -text {*
   44.54 +text \<open>
   44.55    For a set of natural numbers to be infinite, it is enough to know
   44.56    that for any number larger than some @{text k}, there is some larger
   44.57    number that is an element of the set.
   44.58 -*}
   44.59 +\<close>
   44.60  
   44.61  lemma unbounded_k_infinite: "\<forall>m>k. \<exists>n>m. n \<in> S \<Longrightarrow> infinite (S::nat set)"
   44.62    by (metis (full_types) infinite_nat_iff_unbounded_le le_imp_less_Suc not_less
   44.63 @@ -106,12 +106,12 @@
   44.64    then show False by simp
   44.65  qed
   44.66  
   44.67 -text {*
   44.68 +text \<open>
   44.69    For any function with infinite domain and finite range there is some
   44.70    element that is the image of infinitely many domain elements.  In
   44.71    particular, any infinite sequence of elements from a finite set
   44.72    contains some element that occurs infinitely often.
   44.73 -*}
   44.74 +\<close>
   44.75  
   44.76  lemma inf_img_fin_dom':
   44.77    assumes img: "finite (f ` A)" and dom: "infinite A"
   44.78 @@ -142,11 +142,11 @@
   44.79  
   44.80  subsection "Infinitely Many and Almost All"
   44.81  
   44.82 -text {*
   44.83 +text \<open>
   44.84    We often need to reason about the existence of infinitely many
   44.85    (resp., all but finitely many) objects satisfying some predicate, so
   44.86    we introduce corresponding binders and their proof rules.
   44.87 -*}
   44.88 +\<close>
   44.89  
   44.90  (* The following two lemmas are available as filter-rules, but not in the simp-set *)
   44.91  lemma not_INFM [simp]: "\<not> (INFM x. P x) \<longleftrightarrow> (MOST x. \<not> P x)" by (fact not_frequently)
   44.92 @@ -167,7 +167,7 @@
   44.93  lemma INFM_conjI: "INFM x. P x \<Longrightarrow> MOST x. Q x \<Longrightarrow> INFM x. P x \<and> Q x"
   44.94    by (rule frequently_rev_mp[of P]) (auto elim: eventually_elim1)
   44.95  
   44.96 -text {* Properties of quantifiers with injective functions. *}
   44.97 +text \<open>Properties of quantifiers with injective functions.\<close>
   44.98  
   44.99  lemma INFM_inj: "INFM x. P (f x) \<Longrightarrow> inj f \<Longrightarrow> INFM x. P x"
  44.100    using finite_vimageI[of "{x. P x}" f] by (auto simp: frequently_cofinite)
  44.101 @@ -175,7 +175,7 @@
  44.102  lemma MOST_inj: "MOST x. P x \<Longrightarrow> inj f \<Longrightarrow> MOST x. P (f x)"
  44.103    using finite_vimageI[of "{x. \<not> P x}" f] by (auto simp: eventually_cofinite)
  44.104  
  44.105 -text {* Properties of quantifiers with singletons. *}
  44.106 +text \<open>Properties of quantifiers with singletons.\<close>
  44.107  
  44.108  lemma not_INFM_eq [simp]:
  44.109    "\<not> (INFM x. x = a)"
  44.110 @@ -202,7 +202,7 @@
  44.111    "MOST x. a = x \<longrightarrow> P x"
  44.112    unfolding eventually_cofinite by simp_all
  44.113  
  44.114 -text {* Properties of quantifiers over the naturals. *}
  44.115 +text \<open>Properties of quantifiers over the naturals.\<close>
  44.116  
  44.117  lemma MOST_nat: "(\<forall>\<^sub>\<infinity>n. P (n::nat)) \<longleftrightarrow> (\<exists>m. \<forall>n>m. P n)"
  44.118    by (auto simp add: eventually_cofinite finite_nat_iff_bounded_le subset_eq not_le[symmetric])
  44.119 @@ -251,9 +251,9 @@
  44.120  
  44.121  subsection "Enumeration of an Infinite Set"
  44.122  
  44.123 -text {*
  44.124 +text \<open>
  44.125    The set's element type must be wellordered (e.g. the natural numbers).
  44.126 -*}
  44.127 +\<close>
  44.128  
  44.129  text \<open>
  44.130    Could be generalized to
  44.131 @@ -304,7 +304,7 @@
  44.132  next
  44.133    case (Suc n)
  44.134    then have "n \<le> enumerate S n" by simp
  44.135 -  also note enumerate_mono[of n "Suc n", OF _ `infinite S`]
  44.136 +  also note enumerate_mono[of n "Suc n", OF _ \<open>infinite S\<close>]
  44.137    finally show ?case by simp
  44.138  qed
  44.139  
  44.140 @@ -323,10 +323,10 @@
  44.141  next
  44.142    case (Suc n S)
  44.143    show ?case
  44.144 -    using enumerate_mono[OF zero_less_Suc `infinite S`, of n] `infinite S`
  44.145 +    using enumerate_mono[OF zero_less_Suc \<open>infinite S\<close>, of n] \<open>infinite S\<close>
  44.146      apply (subst (1 2) enumerate_Suc')
  44.147      apply (subst Suc)
  44.148 -    using `infinite S`
  44.149 +    using \<open>infinite S\<close>
  44.150      apply simp
  44.151      apply (intro arg_cong[where f = Least] ext)
  44.152      apply (auto simp: enumerate_Suc'[symmetric])
  44.153 @@ -354,7 +354,7 @@
  44.154    next
  44.155      assume *: "\<not> (\<exists>y\<in>S. y < s)"
  44.156      then have "\<forall>t\<in>S. s \<le> t" by auto
  44.157 -    with `s \<in> S` show ?thesis
  44.158 +    with \<open>s \<in> S\<close> show ?thesis
  44.159        by (auto intro!: exI[of _ 0] Least_equality simp: enumerate_0)
  44.160    qed
  44.161  qed
  44.162 @@ -365,22 +365,22 @@
  44.163    shows "bij_betw (enumerate S) UNIV S"
  44.164  proof -
  44.165    have "\<And>n m. n \<noteq> m \<Longrightarrow> enumerate S n \<noteq> enumerate S m"
  44.166 -    using enumerate_mono[OF _ `infinite S`] by (auto simp: neq_iff)
  44.167 +    using enumerate_mono[OF _ \<open>infinite S\<close>] by (auto simp: neq_iff)
  44.168    then have "inj (enumerate S)"
  44.169      by (auto simp: inj_on_def)
  44.170    moreover have "\<forall>s \<in> S. \<exists>i. enumerate S i = s"
  44.171      using enumerate_Ex[OF S] by auto
  44.172 -  moreover note `infinite S`
  44.173 +  moreover note \<open>infinite S\<close>
  44.174    ultimately show ?thesis
  44.175      unfolding bij_betw_def by (auto intro: enumerate_in_set)
  44.176  qed
  44.177  
  44.178  subsection "Miscellaneous"
  44.179  
  44.180 -text {*
  44.181 +text \<open>
  44.182    A few trivial lemmas about sets that contain at most one element.
  44.183    These simplify the reasoning about deterministic automata.
  44.184 -*}
  44.185 +\<close>
  44.186  
  44.187  definition atmost_one :: "'a set \<Rightarrow> bool"
  44.188    where "atmost_one S \<longleftrightarrow> (\<forall>x y. x\<in>S \<and> y\<in>S \<longrightarrow> x = y)"
    45.1 --- a/src/HOL/Library/Inner_Product.thy	Wed Jun 17 10:57:11 2015 +0200
    45.2 +++ b/src/HOL/Library/Inner_Product.thy	Wed Jun 17 11:03:05 2015 +0200
    45.3 @@ -2,27 +2,27 @@
    45.4      Author:     Brian Huffman
    45.5  *)
    45.6  
    45.7 -section {* Inner Product Spaces and the Gradient Derivative *}
    45.8 +section \<open>Inner Product Spaces and the Gradient Derivative\<close>
    45.9  
   45.10  theory Inner_Product
   45.11  imports "~~/src/HOL/Complex_Main"
   45.12  begin
   45.13  
   45.14 -subsection {* Real inner product spaces *}
   45.15 +subsection \<open>Real inner product spaces\<close>
   45.16  
   45.17 -text {*
   45.18 +text \<open>
   45.19    Temporarily relax type constraints for @{term "open"},
   45.20    @{term dist}, and @{term norm}.
   45.21 -*}
   45.22 +\<close>
   45.23  
   45.24 -setup {* Sign.add_const_constraint
   45.25 -  (@{const_name "open"}, SOME @{typ "'a::open set \<Rightarrow> bool"}) *}
   45.26 +setup \<open>Sign.add_const_constraint
   45.27 +  (@{const_name "open"}, SOME @{typ "'a::open set \<Rightarrow> bool"})\<close>
   45.28  
   45.29 -setup {* Sign.add_const_constraint
   45.30 -  (@{const_name dist}, SOME @{typ "'a::dist \<Rightarrow> 'a \<Rightarrow> real"}) *}
   45.31 +setup \<open>Sign.add_const_constraint
   45.32 +  (@{const_name dist}, SOME @{typ "'a::dist \<Rightarrow> 'a \<Rightarrow> real"})\<close>
   45.33  
   45.34 -setup {* Sign.add_const_constraint
   45.35 -  (@{const_name norm}, SOME @{typ "'a::norm \<Rightarrow> real"}) *}
   45.36 +setup \<open>Sign.add_const_constraint
   45.37 +  (@{const_name norm}, SOME @{typ "'a::norm \<Rightarrow> real"})\<close>
   45.38  
   45.39  class real_inner = real_vector + sgn_div_norm + dist_norm + open_dist +
   45.40    fixes inner :: "'a \<Rightarrow> 'a \<Rightarrow> real"
   45.41 @@ -46,7 +46,7 @@
   45.42  lemma inner_setsum_left: "inner (\<Sum>x\<in>A. f x) y = (\<Sum>x\<in>A. inner (f x) y)"
   45.43    by (cases "finite A", induct set: finite, simp_all add: inner_add_left)
   45.44  
   45.45 -text {* Transfer distributivity rules to right argument. *}
   45.46 +text \<open>Transfer distributivity rules to right argument.\<close>
   45.47  
   45.48  lemma inner_add_right: "inner x (y + z) = inner x y + inner x z"
   45.49    using inner_add_left [of y z x] by (simp only: inner_commute)
   45.50 @@ -70,7 +70,7 @@
   45.51  lemmas inner_diff [algebra_simps]  = inner_diff_left inner_diff_right
   45.52  lemmas inner_scaleR = inner_scaleR_left inner_scaleR_right
   45.53  
   45.54 -text {* Legacy theorem names *}
   45.55 +text \<open>Legacy theorem names\<close>
   45.56  lemmas inner_left_distrib = inner_add_left
   45.57  lemmas inner_right_distrib = inner_add_right
   45.58  lemmas inner_distrib = inner_left_distrib inner_right_distrib
   45.59 @@ -141,19 +141,19 @@
   45.60  
   45.61  end
   45.62  
   45.63 -text {*
   45.64 +text \<open>
   45.65    Re-enable constraints for @{term "open"},
   45.66    @{term dist}, and @{term norm}.
   45.67 -*}
   45.68 +\<close>
   45.69  
   45.70 -setup {* Sign.add_const_constraint
   45.71 -  (@{const_name "open"}, SOME @{typ "'a::topological_space set \<Rightarrow> bool"}) *}
   45.72 +setup \<open>Sign.add_const_constraint
   45.73 +  (@{const_name "open"}, SOME @{typ "'a::topological_space set \<Rightarrow> bool"})\<close>
   45.74  
   45.75 -setup {* Sign.add_const_constraint
   45.76 -  (@{const_name dist}, SOME @{typ "'a::metric_space \<Rightarrow> 'a \<Rightarrow> real"}) *}
   45.77 +setup \<open>Sign.add_const_constraint
   45.78 +  (@{const_name dist}, SOME @{typ "'a::metric_space \<Rightarrow> 'a \<Rightarrow> real"})\<close>
   45.79  
   45.80 -setup {* Sign.add_const_constraint
   45.81 -  (@{const_name norm}, SOME @{typ "'a::real_normed_vector \<Rightarrow> real"}) *}
   45.82 +setup \<open>Sign.add_const_constraint
   45.83 +  (@{const_name norm}, SOME @{typ "'a::real_normed_vector \<Rightarrow> real"})\<close>
   45.84  
   45.85  lemma bounded_bilinear_inner:
   45.86    "bounded_bilinear (inner::'a::real_inner \<Rightarrow> 'a \<Rightarrow> real)"
   45.87 @@ -199,7 +199,7 @@
   45.88    "f differentiable (at x within s) \<Longrightarrow> g differentiable at x within s \<Longrightarrow> (\<lambda>x. inner (f x) (g x)) differentiable at x within s"
   45.89    unfolding differentiable_def by (blast intro: has_derivative_inner)
   45.90  
   45.91 -subsection {* Class instances *}
   45.92 +subsection \<open>Class instances\<close>
   45.93  
   45.94  instantiation real :: real_inner
   45.95  begin
   45.96 @@ -263,7 +263,7 @@
   45.97    unfolding inner_complex_def by simp
   45.98  
   45.99  
  45.100 -subsection {* Gradient derivative *}
  45.101 +subsection \<open>Gradient derivative\<close>
  45.102  
  45.103  definition
  45.104    gderiv ::
  45.105 @@ -339,7 +339,7 @@
  45.106      by (intro has_derivative_inner has_derivative_ident)
  45.107    have 2: "(\<lambda>h. inner x h + inner h x) = (\<lambda>h. inner h (scaleR 2 x))"
  45.108      by (simp add: fun_eq_iff inner_commute)
  45.109 -  have "0 < inner x x" using `x \<noteq> 0` by simp
  45.110 +  have "0 < inner x x" using \<open>x \<noteq> 0\<close> by simp
  45.111    then have 3: "DERIV sqrt (inner x x) :> (inverse (sqrt (inner x x)) / 2)"
  45.112      by (rule DERIV_real_sqrt)
  45.113    have 4: "(inverse (sqrt (inner x x)) / 2) *\<^sub>R 2 *\<^sub>R x = sgn x"
    46.1 --- a/src/HOL/Library/LaTeXsugar.thy	Wed Jun 17 10:57:11 2015 +0200
    46.2 +++ b/src/HOL/Library/LaTeXsugar.thy	Wed Jun 17 11:03:05 2015 +0200
    46.3 @@ -101,7 +101,7 @@
    46.4    "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
    46.5    "_asm" :: "prop \<Rightarrow> asms" ("_")
    46.6  
    46.7 -setup{*
    46.8 +setup\<open>
    46.9    let
   46.10      fun pretty ctxt c =
   46.11        let val tc = Proof_Context.read_const {proper = true, strict = false} ctxt c
   46.12 @@ -115,7 +115,7 @@
   46.13            Thy_Output.output ctxt
   46.14              (Thy_Output.maybe_pretty_source pretty ctxt src [arg]))
   46.15    end;
   46.16 -*}
   46.17 +\<close>
   46.18  
   46.19  end
   46.20  (*>*)
    47.1 --- a/src/HOL/Library/Lattice_Algebras.thy	Wed Jun 17 10:57:11 2015 +0200
    47.2 +++ b/src/HOL/Library/Lattice_Algebras.thy	Wed Jun 17 11:03:05 2015 +0200
    47.3 @@ -1,6 +1,6 @@
    47.4  (* Author: Steven Obua, TU Muenchen *)
    47.5  
    47.6 -section {* Various algebraic structures combined with a lattice *}
    47.7 +section \<open>Various algebraic structures combined with a lattice\<close>
    47.8  
    47.9  theory Lattice_Algebras
   47.10  imports Complex_Main
   47.11 @@ -110,7 +110,7 @@
   47.12  qed
   47.13  
   47.14  
   47.15 -subsection {* Positive Part, Negative Part, Absolute Value *}
   47.16 +subsection \<open>Positive Part, Negative Part, Absolute Value\<close>
   47.17  
   47.18  definition nprt :: "'a \<Rightarrow> 'a"
   47.19    where "nprt x = inf x 0"
   47.20 @@ -444,7 +444,7 @@
   47.21      by (rule abs_ge_minus_self)
   47.22    then have "c + (- b) \<le> c + \<bar>b\<bar>"
   47.23      by (rule add_left_mono)
   47.24 -  with `a \<le> c + (- b)` show ?thesis
   47.25 +  with \<open>a \<le> c + (- b)\<close> show ?thesis
   47.26      by (rule order_trans)
   47.27  qed
   47.28  
    48.1 --- a/src/HOL/Library/Lattice_Constructions.thy	Wed Jun 17 10:57:11 2015 +0200
    48.2 +++ b/src/HOL/Library/Lattice_Constructions.thy	Wed Jun 17 11:03:05 2015 +0200
    48.3 @@ -7,7 +7,7 @@
    48.4  imports Main
    48.5  begin
    48.6  
    48.7 -subsection {* Values extended by a bottom element *}
    48.8 +subsection \<open>Values extended by a bottom element\<close>
    48.9  
   48.10  datatype 'a bot = Value 'a | Bot
   48.11  
   48.12 @@ -106,7 +106,7 @@
   48.13  instance bot :: (lattice) bounded_lattice_bot
   48.14  by(intro_classes)(simp add: bot_bot_def)
   48.15  
   48.16 -section {* Values extended by a top element *}
   48.17 +section \<open>Values extended by a top element\<close>
   48.18  
   48.19  datatype 'a top = Value 'a | Top
   48.20  
   48.21 @@ -205,7 +205,7 @@
   48.22  instance top :: (lattice) bounded_lattice_top
   48.23  by(intro_classes)(simp add: top_top_def)
   48.24  
   48.25 -subsection {* Values extended by a top and a bottom element *}
   48.26 +subsection \<open>Values extended by a top and a bottom element\<close>
   48.27  
   48.28  datatype 'a flat_complete_lattice = Value 'a | Bot | Top
   48.29  
   48.30 @@ -296,12 +296,12 @@
   48.31      from this have "(THE v. A - {Top} = {Value v}) = v"
   48.32        by (auto intro!: the1_equality)
   48.33      moreover
   48.34 -    from `x : A` `A - {Top} = {Value v}` have "x = Top \<or> x = Value v"
   48.35 +    from \<open>x : A\<close> \<open>A - {Top} = {Value v}\<close> have "x = Top \<or> x = Value v"
   48.36        by auto
   48.37      ultimately have "Value (THE v. A - {Top} = {Value v}) <= x"
   48.38        by auto
   48.39    }
   48.40 -  from `x : A` this show "Inf A <= x"
   48.41 +  from \<open>x : A\<close> this show "Inf A <= x"
   48.42      unfolding Inf_flat_complete_lattice_def
   48.43      by fastforce
   48.44  next
   48.45 @@ -355,12 +355,12 @@
   48.46      from this have "(THE v. A - {Bot} = {Value v}) = v"
   48.47        by (auto intro!: the1_equality)
   48.48      moreover
   48.49 -    from `x : A` `A - {Bot} = {Value v}` have "x = Bot \<or> x = Value v"
   48.50 +    from \<open>x : A\<close> \<open>A - {Bot} = {Value v}\<close> have "x = Bot \<or> x = Value v"
   48.51        by auto
   48.52      ultimately have "x <= Value (THE v. A - {Bot} = {Value v})"
   48.53        by auto
   48.54    }
   48.55 -  from `x : A` this show "x <= Sup A"
   48.56 +  from \<open>x : A\<close> this show "x <= Sup A"
   48.57      unfolding Sup_flat_complete_lattice_def
   48.58      by fastforce
   48.59  next
    49.1 --- a/src/HOL/Library/Lattice_Syntax.thy	Wed Jun 17 10:57:11 2015 +0200
    49.2 +++ b/src/HOL/Library/Lattice_Syntax.thy	Wed Jun 17 11:03:05 2015 +0200
    49.3 @@ -1,6 +1,6 @@
    49.4  (* Author: Florian Haftmann, TU Muenchen *)
    49.5  
    49.6 -section {* Pretty syntax for lattice operations *}
    49.7 +section \<open>Pretty syntax for lattice operations\<close>
    49.8  
    49.9  theory Lattice_Syntax
   49.10  imports Complete_Lattices
    50.1 --- a/src/HOL/Library/Liminf_Limsup.thy	Wed Jun 17 10:57:11 2015 +0200
    50.2 +++ b/src/HOL/Library/Liminf_Limsup.thy	Wed Jun 17 11:03:05 2015 +0200
    50.3 @@ -2,7 +2,7 @@
    50.4      Author:     Johannes Hölzl, TU München
    50.5  *)
    50.6  
    50.7 -section {* Liminf and Limsup on complete lattices *}
    50.8 +section \<open>Liminf and Limsup on complete lattices\<close>
    50.9  
   50.10  theory Liminf_Limsup
   50.11  imports Complex_Main
   50.12 @@ -30,7 +30,7 @@
   50.13    shows "(INF i : A. INF j : B. f i j) = (INF p : A \<times> B. f (fst p) (snd p))"
   50.14    by (rule antisym) (auto intro!: INF_greatest INF_lower2)
   50.15  
   50.16 -subsubsection {* @{text Liminf} and @{text Limsup} *}
   50.17 +subsubsection \<open>@{text Liminf} and @{text Limsup}\<close>
   50.18  
   50.19  definition Liminf :: "'a filter \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b :: complete_lattice" where
   50.20    "Liminf F f = (SUP P:{P. eventually P F}. INF x:{x. P x}. f x)"
   50.21 @@ -171,7 +171,7 @@
   50.22        case False
   50.23        then have "C \<le> INFIMUM {x. y < X x} X"
   50.24          by (intro INF_greatest) auto
   50.25 -      with `y < C` show ?thesis
   50.26 +      with \<open>y < C\<close> show ?thesis
   50.27          using y by (intro exI[of _ "\<lambda>x. y < X x"]) auto
   50.28      qed }
   50.29    ultimately show ?thesis
   50.30 @@ -290,7 +290,7 @@
   50.31    have "\<And>n. (INF m:{n..}. X m) \<le> (INF m:{n..}. (X \<circ> r) m)"
   50.32    proof (safe intro!: INF_mono)
   50.33      fix n m :: nat assume "n \<le> m" then show "\<exists>ma\<in>{n..}. X ma \<le> (X \<circ> r) m"
   50.34 -      using seq_suble[OF `subseq r`, of m] by (intro bexI[of _ "r m"]) auto
   50.35 +      using seq_suble[OF \<open>subseq r\<close>, of m] by (intro bexI[of _ "r m"]) auto
   50.36    qed
   50.37    then show ?thesis by (auto intro!: SUP_mono simp: liminf_SUP_INF comp_def)
   50.38  qed
   50.39 @@ -303,7 +303,7 @@
   50.40    have "\<And>n. (SUP m:{n..}. (X \<circ> r) m) \<le> (SUP m:{n..}. X m)"
   50.41    proof (safe intro!: SUP_mono)
   50.42      fix n m :: nat assume "n \<le> m" then show "\<exists>ma\<in>{n..}. (X \<circ> r) m \<le> X ma"
   50.43 -      using seq_suble[OF `subseq r`, of m] by (intro bexI[of _ "r m"]) auto
   50.44 +      using seq_suble[OF \<open>subseq r\<close>, of m] by (intro bexI[of _ "r m"]) auto
   50.45    qed
   50.46    then show ?thesis by (auto intro!: INF_mono simp: limsup_INF_SUP comp_def)
   50.47  qed
    51.1 --- a/src/HOL/Library/Linear_Temporal_Logic_on_Streams.thy	Wed Jun 17 10:57:11 2015 +0200
    51.2 +++ b/src/HOL/Library/Linear_Temporal_Logic_on_Streams.thy	Wed Jun 17 11:03:05 2015 +0200
    51.3 @@ -3,13 +3,13 @@
    51.4      Author:     Dmitriy Traytel, TU Muenchen
    51.5  *)
    51.6  
    51.7 -section {* Linear Temporal Logic on Streams *}
    51.8 +section \<open>Linear Temporal Logic on Streams\<close>
    51.9  
   51.10  theory Linear_Temporal_Logic_on_Streams
   51.11    imports Stream Sublist Extended_Nat Infinite_Set
   51.12  begin
   51.13  
   51.14 -section{* Preliminaries *}
   51.15 +section\<open>Preliminaries\<close>
   51.16  
   51.17  lemma shift_prefix:
   51.18  assumes "xl @- xs = yl @- ys" and "length xl \<le> length yl"
   51.19 @@ -26,7 +26,7 @@
   51.20  by (metis, metis assms nat_le_linear shift_prefix)
   51.21  
   51.22  
   51.23 -section{* Linear temporal logic *}
   51.24 +section\<open>Linear temporal logic\<close>
   51.25  
   51.26  (* Propositional connectives: *)
   51.27  abbreviation (input) IMPL (infix "impl" 60)
   51.28 @@ -587,7 +587,7 @@
   51.29  lemma not_holds_eq[simp]: "holds (- op = x) = not (HLD {x})"
   51.30    by rule (auto simp: HLD_iff)
   51.31  
   51.32 -text {* Strong until *}
   51.33 +text \<open>Strong until\<close>
   51.34  
   51.35  inductive suntil (infix "suntil" 60) for \<phi> \<psi> where
   51.36    base: "\<psi> \<omega> \<Longrightarrow> (\<phi> suntil \<psi>) \<omega>"
    52.1 --- a/src/HOL/Library/ListVector.thy	Wed Jun 17 10:57:11 2015 +0200
    52.2 +++ b/src/HOL/Library/ListVector.thy	Wed Jun 17 11:03:05 2015 +0200
    52.3 @@ -1,16 +1,16 @@
    52.4  (*  Author: Tobias Nipkow, 2007 *)
    52.5  
    52.6 -section {* Lists as vectors *}
    52.7 +section \<open>Lists as vectors\<close>
    52.8  
    52.9  theory ListVector
   52.10  imports List Main
   52.11  begin
   52.12  
   52.13 -text{* \noindent
   52.14 +text\<open>\noindent
   52.15  A vector-space like structure of lists and arithmetic operations on them.
   52.16 -Is only a vector space if restricted to lists of the same length. *}
   52.17 +Is only a vector space if restricted to lists of the same length.\<close>
   52.18  
   52.19 -text{* Multiplication with a scalar: *}
   52.20 +text\<open>Multiplication with a scalar:\<close>
   52.21  
   52.22  abbreviation scale :: "('a::times) \<Rightarrow> 'a list \<Rightarrow> 'a list" (infix "*\<^sub>s" 70)
   52.23  where "x *\<^sub>s xs \<equiv> map (op * x) xs"
   52.24 @@ -18,7 +18,7 @@
   52.25  lemma scale1[simp]: "(1::'a::monoid_mult) *\<^sub>s xs = xs"
   52.26  by (induct xs) simp_all
   52.27  
   52.28 -subsection {* @{text"+"} and @{text"-"} *}
   52.29 +subsection \<open>@{text"+"} and @{text"-"}\<close>
   52.30  
   52.31  fun zipwith0 :: "('a::zero \<Rightarrow> 'b::zero \<Rightarrow> 'c) \<Rightarrow> 'a list \<Rightarrow> 'b list \<Rightarrow> 'c list"
   52.32  where
    53.1 --- a/src/HOL/Library/List_lexord.thy	Wed Jun 17 10:57:11 2015 +0200
    53.2 +++ b/src/HOL/Library/List_lexord.thy	Wed Jun 17 11:03:05 2015 +0200
    53.3 @@ -2,7 +2,7 @@
    53.4      Author:     Norbert Voelker
    53.5  *)
    53.6  
    53.7 -section {* Lexicographic order on lists *}
    53.8 +section \<open>Lexicographic order on lists\<close>
    53.9  
   53.10  theory List_lexord
   53.11  imports Main
    54.1 --- a/src/HOL/Library/Lub_Glb.thy	Wed Jun 17 10:57:11 2015 +0200
    54.2 +++ b/src/HOL/Library/Lub_Glb.thy	Wed Jun 17 11:03:05 2015 +0200
    54.3 @@ -2,13 +2,13 @@
    54.4      Author:     Jacques D. Fleuriot, University of Cambridge
    54.5      Author:     Amine Chaieb, University of Cambridge *)
    54.6  
    54.7 -section {* Definitions of Least Upper Bounds and Greatest Lower Bounds *}
    54.8 +section \<open>Definitions of Least Upper Bounds and Greatest Lower Bounds\<close>
    54.9  
   54.10  theory Lub_Glb
   54.11  imports Complex_Main
   54.12  begin
   54.13  
   54.14 -text {* Thanks to suggestions by James Margetson *}
   54.15 +text \<open>Thanks to suggestions by James Margetson\<close>
   54.16  
   54.17  definition setle :: "'a set \<Rightarrow> 'a::ord \<Rightarrow> bool"  (infixl "*<=" 70)
   54.18    where "S *<= x = (ALL y: S. y \<le> x)"
   54.19 @@ -17,7 +17,7 @@
   54.20    where "x <=* S = (ALL y: S. x \<le> y)"
   54.21  
   54.22  
   54.23 -subsection {* Rules for the Relations @{text "*<="} and @{text "<=*"} *}
   54.24 +subsection \<open>Rules for the Relations @{text "*<="} and @{text "<=*"}\<close>
   54.25  
   54.26  lemma setleI: "ALL y: S. y \<le> x \<Longrightarrow> S *<= x"
   54.27    by (simp add: setle_def)
   54.28 @@ -45,7 +45,7 @@
   54.29    where "ubs R S = Collect (isUb R S)"
   54.30  
   54.31  
   54.32 -subsection {* Rules about the Operators @{term leastP}, @{term ub} and @{term lub} *}
   54.33 +subsection \<open>Rules about the Operators @{term leastP}, @{term ub} and @{term lub}\<close>
   54.34  
   54.35  lemma leastPD1: "leastP P x \<Longrightarrow> P x"
   54.36    by (simp add: leastP_def)
   54.37 @@ -118,7 +118,7 @@
   54.38    where "lbs R S = Collect (isLb R S)"
   54.39  
   54.40  
   54.41 -subsection {* Rules about the Operators @{term greatestP}, @{term isLb} and @{term isGlb} *}
   54.42 +subsection \<open>Rules about the Operators @{term greatestP}, @{term isLb} and @{term isGlb}\<close>
   54.43  
   54.44  lemma greatestPD1: "greatestP P x \<Longrightarrow> P x"
   54.45    by (simp add: greatestP_def)
   54.46 @@ -208,7 +208,7 @@
   54.47  lemma cInf_unique: "b <=* (S::'a :: {conditionally_complete_linorder, no_top} set) \<Longrightarrow> (\<forall>b'>b. \<exists>x\<in>S. b' > x) \<Longrightarrow> Inf S = b"
   54.48    by (rule cInf_eq) (auto simp: not_le[symmetric] setge_def)
   54.49  
   54.50 -text{* Use completeness of reals (supremum property) to show that any bounded sequence has a least upper bound*}
   54.51 +text\<open>Use completeness of reals (supremum property) to show that any bounded sequence has a least upper bound\<close>
   54.52  
   54.53  lemma reals_complete: "\<exists>X. X \<in> S \<Longrightarrow> \<exists>Y. isUb (UNIV::real set) S Y \<Longrightarrow> \<exists>t. isLub (UNIV :: real set) S t"
   54.54    by (intro exI[of _ "Sup S"] isLub_cSup) (auto simp: setle_def isUb_def intro!: cSup_upper)
    55.1 --- a/src/HOL/Library/Mapping.thy	Wed Jun 17 10:57:11 2015 +0200
    55.2 +++ b/src/HOL/Library/Mapping.thy	Wed Jun 17 11:03:05 2015 +0200
    55.3 @@ -2,15 +2,15 @@
    55.4      Author:     Florian Haftmann and Ondrej Kuncar
    55.5  *)
    55.6  
    55.7 -section {* An abstract view on maps for code generation. *}
    55.8 +section \<open>An abstract view on maps for code generation.\<close>
    55.9  
   55.10  theory Mapping
   55.11  imports Main
   55.12  begin
   55.13  
   55.14 -subsection {* Parametricity transfer rules *}
   55.15 +subsection \<open>Parametricity transfer rules\<close>
   55.16  
   55.17 -lemma map_of_foldr: -- {* FIXME move *}
   55.18 +lemma map_of_foldr: -- \<open>FIXME move\<close>
   55.19    "map_of xs = foldr (\<lambda>(k, v) m. m(k \<mapsto> v)) xs Map.empty"
   55.20    using map_add_map_of_foldr [of Map.empty] by auto
   55.21  
   55.22 @@ -92,7 +92,7 @@
   55.23  end
   55.24  
   55.25  
   55.26 -subsection {* Type definition and primitive operations *}
   55.27 +subsection \<open>Type definition and primitive operations\<close>
   55.28  
   55.29  typedef ('a, 'b) mapping = "UNIV :: ('a \<rightharpoonup> 'b) set"
   55.30    morphisms rep Mapping
   55.31 @@ -130,13 +130,13 @@
   55.32  declare [[code drop: map]]
   55.33  
   55.34  
   55.35 -subsection {* Functorial structure *}
   55.36 +subsection \<open>Functorial structure\<close>
   55.37  
   55.38  functor map: map
   55.39    by (transfer, auto simp add: fun_eq_iff option.map_comp option.map_id)+
   55.40  
   55.41  
   55.42 -subsection {* Derived operations *}
   55.43 +subsection \<open>Derived operations\<close>
   55.44  
   55.45  definition ordered_keys :: "('a\<Colon>linorder, 'b) mapping \<Rightarrow> 'a list"
   55.46  where
   55.47 @@ -158,7 +158,7 @@
   55.48  where
   55.49    "default k v m = (if k \<in> keys m then m else update k v m)"
   55.50  
   55.51 -text {* Manual derivation of transfer rule is non-trivial *}
   55.52 +text \<open>Manual derivation of transfer rule is non-trivial\<close>
   55.53  
   55.54  lift_definition map_entry :: "'a \<Rightarrow> ('b \<Rightarrow> 'b) \<Rightarrow> ('a, 'b) mapping \<Rightarrow> ('a, 'b) mapping" is
   55.55    "\<lambda>k f m. (case m k of None \<Rightarrow> m
   55.56 @@ -207,7 +207,7 @@
   55.57  end
   55.58  
   55.59  
   55.60 -subsection {* Properties *}
   55.61 +subsection \<open>Properties\<close>
   55.62  
   55.63  lemma lookup_update:
   55.64    "lookup (update k v m) k = Some v" 
   55.65 @@ -408,7 +408,7 @@
   55.66  qed
   55.67  
   55.68  
   55.69 -subsection {* Code generator setup *}
   55.70 +subsection \<open>Code generator setup\<close>
   55.71  
   55.72  hide_const (open) empty is_empty rep lookup update delete ordered_keys keys size
   55.73    replace default map_entry map_default tabulate bulkload map of_alist
    56.1 --- a/src/HOL/Library/Monad_Syntax.thy	Wed Jun 17 10:57:11 2015 +0200
    56.2 +++ b/src/HOL/Library/Monad_Syntax.thy	Wed Jun 17 11:03:05 2015 +0200
    56.3 @@ -2,17 +2,17 @@
    56.4     Author: Christian Sternagel, University of Innsbruck
    56.5  *)
    56.6  
    56.7 -section {* Monad notation for arbitrary types *}
    56.8 +section \<open>Monad notation for arbitrary types\<close>
    56.9  
   56.10  theory Monad_Syntax
   56.11  imports Main "~~/src/Tools/Adhoc_Overloading"
   56.12  begin
   56.13  
   56.14 -text {*
   56.15 +text \<open>
   56.16    We provide a convenient do-notation for monadic expressions
   56.17    well-known from Haskell.  @{const Let} is printed
   56.18    specially in do-expressions.
   56.19 -*}
   56.20 +\<close>
   56.21  
   56.22  consts
   56.23    bind :: "['a, 'b \<Rightarrow> 'c] \<Rightarrow> 'd" (infixr ">>=" 54)
    57.1 --- a/src/HOL/Library/More_List.thy	Wed Jun 17 10:57:11 2015 +0200
    57.2 +++ b/src/HOL/Library/More_List.thy	Wed Jun 17 11:03:05 2015 +0200
    57.3 @@ -304,7 +304,7 @@
    57.4        with last_conv_nth_default [of ?ys dflt]
    57.5        have "last ?ys = nth_default dflt ?ys (length ?ys - 1)"
    57.6          by auto
    57.7 -      moreover from `?ys \<noteq> []` no_trailing_strip_while [of "HOL.eq dflt" ys]
    57.8 +      moreover from \<open>?ys \<noteq> []\<close> no_trailing_strip_while [of "HOL.eq dflt" ys]
    57.9          have "last ?ys \<noteq> dflt" by (simp add: no_trailing_unfold)
   57.10        ultimately have "nth_default dflt ?xs (length ?ys - 1) \<noteq> dflt"
   57.11          using eq by simp
    58.1 --- a/src/HOL/Library/Multiset.thy	Wed Jun 17 10:57:11 2015 +0200
    58.2 +++ b/src/HOL/Library/Multiset.thy	Wed Jun 17 11:03:05 2015 +0200
    58.3 @@ -6,13 +6,13 @@
    58.4      Author:     Mathias Fleury, MPII
    58.5  *)
    58.6  
    58.7 -section {* (Finite) multisets *}
    58.8 +section \<open>(Finite) multisets\<close>
    58.9  
   58.10  theory Multiset
   58.11  imports Main
   58.12  begin
   58.13  
   58.14 -subsection {* The type of multisets *}
   58.15 +subsection \<open>The type of multisets\<close>
   58.16  
   58.17  definition "multiset = {f :: 'a => nat. finite {x. f x > 0}}"
   58.18  
   58.19 @@ -39,9 +39,9 @@
   58.20    "(\<And>x. count A x = count B x) \<Longrightarrow> A = B"
   58.21    using multiset_eq_iff by auto
   58.22  
   58.23 -text {*
   58.24 +text \<open>
   58.25   \medskip Preservation of the representing set @{term multiset}.
   58.26 -*}
   58.27 +\<close>
   58.28  
   58.29  lemma const0_in_multiset:
   58.30    "(\<lambda>a. 0) \<in> multiset"
   58.31 @@ -79,9 +79,9 @@
   58.32    union_preserves_multiset diff_preserves_multiset filter_preserves_multiset
   58.33  
   58.34  
   58.35 -subsection {* Representing multisets *}
   58.36 -
   58.37 -text {* Multiset enumeration *}
   58.38 +subsection \<open>Representing multisets\<close>
   58.39 +
   58.40 +text \<open>Multiset enumeration\<close>
   58.41  
   58.42  instantiation multiset :: (type) cancel_comm_monoid_add
   58.43  begin
   58.44 @@ -119,15 +119,15 @@
   58.45    by (simp add: single.rep_eq)
   58.46  
   58.47  
   58.48 -subsection {* Basic operations *}
   58.49 -
   58.50 -subsubsection {* Union *}
   58.51 +subsection \<open>Basic operations\<close>
   58.52 +
   58.53 +subsubsection \<open>Union\<close>
   58.54  
   58.55  lemma count_union [simp]: "count (M + N) a = count M a + count N a"
   58.56    by (simp add: plus_multiset.rep_eq)
   58.57  
   58.58  
   58.59 -subsubsection {* Difference *}
   58.60 +subsubsection \<open>Difference\<close>
   58.61  
   58.62  instantiation multiset :: (type) comm_monoid_diff
   58.63  begin
   58.64 @@ -177,7 +177,7 @@
   58.65    by (simp add: multiset_eq_iff)
   58.66  
   58.67  
   58.68 -subsubsection {* Equality of multisets *}
   58.69 +subsubsection \<open>Equality of multisets\<close>
   58.70  
   58.71  lemma single_not_empty [simp]: "{#a#} \<noteq> {#} \<and> {#} \<noteq> {#a#}"
   58.72    by (simp add: multiset_eq_iff)
   58.73 @@ -234,12 +234,12 @@
   58.74    assume ?lhs
   58.75    show ?rhs
   58.76    proof (cases "a = b")
   58.77 -    case True with `?lhs` show ?thesis by simp
   58.78 +    case True with \<open>?lhs\<close> show ?thesis by simp
   58.79    next
   58.80      case False
   58.81 -    from `?lhs` have "a \<in># N + {#b#}" by (rule union_single_eq_member)
   58.82 +    from \<open>?lhs\<close> have "a \<in># N + {#b#}" by (rule union_single_eq_member)
   58.83      with False have "a \<in># N" by auto
   58.84 -    moreover from `?lhs` have "M = N + {#b#} - {#a#}" by (rule union_single_eq_diff)
   58.85 +    moreover from \<open>?lhs\<close> have "M = N + {#b#} - {#a#}" by (rule union_single_eq_diff)
   58.86      moreover note False
   58.87      ultimately show ?thesis by (auto simp add: diff_right_commute [of _ "{#a#}"] diff_union_swap)
   58.88    qed
   58.89 @@ -269,7 +269,7 @@
   58.90    assumes "c \<in># B" and "b \<noteq> c"
   58.91    shows "B - {#c#} + {#b#} = B + {#b#} - {#c#}"
   58.92  proof -
   58.93 -  from `c \<in># B` obtain A where B: "B = A + {#c#}"
   58.94 +  from \<open>c \<in># B\<close> obtain A where B: "B = A + {#c#}"
   58.95      by (blast dest: multi_member_split)
   58.96    have "A + {#b#} = A + {#b#} + {#c#} - {#c#}" by simp
   58.97    then have "A + {#b#} = A + {#c#} + {#b#} - {#c#}"
   58.98 @@ -278,7 +278,7 @@
   58.99  qed
  58.100  
  58.101  
  58.102 -subsubsection {* Pointwise ordering induced by count *}
  58.103 +subsubsection \<open>Pointwise ordering induced by count\<close>
  58.104  
  58.105  definition subseteq_mset :: "'a multiset \<Rightarrow> 'a multiset \<Rightarrow> bool" (infix "<=#" 50) where
  58.106  "subseteq_mset A B = (\<forall>a. count A a \<le> count B a)"
  58.107 @@ -396,7 +396,7 @@
  58.108    by (auto simp: subset_mset_def subseteq_mset_def multiset_eq_iff)
  58.109  
  58.110  
  58.111 -subsubsection {* Intersection *}
  58.112 +subsubsection \<open>Intersection\<close>
  58.113  
  58.114  definition inf_subset_mset :: "'a multiset \<Rightarrow> 'a multiset \<Rightarrow> 'a multiset" (infixl "#\<inter>" 70) where
  58.115    multiset_inter_def: "inf_subset_mset A B = A - (A - B)"
  58.116 @@ -454,7 +454,7 @@
  58.117    by (simp add: multiset_eq_iff)
  58.118  
  58.119  
  58.120 -subsubsection {* Bounded union *}
  58.121 +subsubsection \<open>Bounded union\<close>
  58.122  definition sup_subset_mset :: "'a multiset \<Rightarrow> 'a multiset \<Rightarrow> 'a multiset"(infixl "#\<union>" 70)  where
  58.123    "sup_subset_mset A B = A + (B - A)"
  58.124  
  58.125 @@ -493,12 +493,12 @@
  58.126    "x \<in># N \<Longrightarrow> N #\<union> (M + {#x#}) = ((N - {#x#}) #\<union> M) + {#x#}"
  58.127    by (simp add: multiset_eq_iff)
  58.128  
  58.129 -subsubsection {*Subset is an order*}
  58.130 +subsubsection \<open>Subset is an order\<close>
  58.131  interpretation subset_mset: order "op \<le>#" "op <#" by unfold_locales auto
  58.132  
  58.133 -subsubsection {* Filter (with comprehension syntax) *}
  58.134 -
  58.135 -text {* Multiset comprehension *}
  58.136 +subsubsection \<open>Filter (with comprehension syntax)\<close>
  58.137 +
  58.138 +text \<open>Multiset comprehension\<close>
  58.139  
  58.140  lift_definition filter_mset :: "('a \<Rightarrow> bool) \<Rightarrow> 'a multiset \<Rightarrow> 'a multiset"
  58.141  is "\<lambda>P M. \<lambda>x. if P x then M x else 0"
  58.142 @@ -547,7 +547,7 @@
  58.143    "{#x \<in># M. P#}" == "CONST filter_mset (\<lambda>x. P) M"
  58.144  
  58.145  
  58.146 -subsubsection {* Set of elements *}
  58.147 +subsubsection \<open>Set of elements\<close>
  58.148  
  58.149  definition set_of :: "'a multiset => 'a set" where
  58.150    "set_of M = {x. x :# M}"
  58.151 @@ -583,7 +583,7 @@
  58.152    by auto
  58.153  
  58.154  
  58.155 -subsubsection {* Size *}
  58.156 +subsubsection \<open>Size\<close>
  58.157  
  58.158  definition wcount where "wcount f M = (\<lambda>x. count M x * Suc (f x))"
  58.159  
  58.160 @@ -673,7 +673,7 @@
  58.161    "M \<le># M' \<Longrightarrow> size (M' - M) = size M' - size(M::'a multiset)"
  58.162  by (metis add_diff_cancel_left' size_union mset_le_exists_conv)
  58.163  
  58.164 -subsection {* Induction and case splits *}
  58.165 +subsection \<open>Induction and case splits\<close>
  58.166  
  58.167  theorem multiset_induct [case_names empty add, induct type: multiset]:
  58.168    assumes empty: "P {#}"
  58.169 @@ -684,7 +684,7 @@
  58.170  next
  58.171    case (Suc k)
  58.172    obtain N x where "M = N + {#x#}"
  58.173 -    using `Suc k = size M` [symmetric]
  58.174 +    using \<open>Suc k = size M\<close> [symmetric]
  58.175      using size_eq_Suc_imp_eq_union by fast
  58.176    with Suc add show "P M" by simp
  58.177  qed
  58.178 @@ -729,9 +729,9 @@
  58.179  lemma size_1_singleton_mset: "size M = 1 \<Longrightarrow> \<exists>a. M = {#a#}"
  58.180  by (cases M) auto
  58.181  
  58.182 -subsubsection {* Strong induction and subset induction for multisets *}
  58.183 -
  58.184 -text {* Well-foundedness of strict subset relation *}
  58.185 +subsubsection \<open>Strong induction and subset induction for multisets\<close>
  58.186 +
  58.187 +text \<open>Well-foundedness of strict subset relation\<close>
  58.188  
  58.189  lemma wf_less_mset_rel: "wf {(M, N :: 'a multiset). M <# N}"
  58.190  apply (rule wf_measure [THEN wf_subset, where f1=size])
  58.191 @@ -751,7 +751,7 @@
  58.192    and insert: "\<And>a F. a \<in># A \<Longrightarrow> P F \<Longrightarrow> P (F + {#a#})"
  58.193  shows "P F"
  58.194  proof -
  58.195 -  from `F \<le># A`
  58.196 +  from \<open>F \<le># A\<close>
  58.197    show ?thesis
  58.198    proof (induct F)
  58.199      show "P {#}" by fact
  58.200 @@ -768,7 +768,7 @@
  58.201  qed
  58.202  
  58.203  
  58.204 -subsection {* The fold combinator *}
  58.205 +subsection \<open>The fold combinator\<close>
  58.206  
  58.207  definition fold_mset :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a multiset \<Rightarrow> 'b"
  58.208  where
  58.209 @@ -840,7 +840,7 @@
  58.210  
  58.211  end
  58.212  
  58.213 -text {*
  58.214 +text \<open>
  58.215    A note on code generation: When defining some function containing a
  58.216    subterm @{term "fold_mset F"}, code generation is not automatic. When
  58.217    interpreting locale @{text left_commutative} with @{text F}, the
  58.218 @@ -849,10 +849,10 @@
  58.219    contains defined symbols, i.e.\ is not a code thm. Hence a separate
  58.220    constant with its own code thms needs to be introduced for @{text
  58.221    F}. See the image operator below.
  58.222 -*}
  58.223 -
  58.224 -
  58.225 -subsection {* Image *}
  58.226 +\<close>
  58.227 +
  58.228 +
  58.229 +subsection \<open>Image\<close>
  58.230  
  58.231  definition image_mset :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a multiset \<Rightarrow> 'b multiset" where
  58.232    "image_mset f = fold_mset (plus o single o f) {#}"
  58.233 @@ -920,12 +920,12 @@
  58.234  translations
  58.235    "{#e | x\<in>#M. P#}" => "{#e. x \<in># {# x\<in>#M. P#}#}"
  58.236  
  58.237 -text {*
  58.238 +text \<open>
  58.239    This allows to write not just filters like @{term "{#x:#M. x<c#}"}
  58.240    but also images like @{term "{#x+x. x:#M #}"} and @{term [source]
  58.241    "{#x+x|x:#M. x<c#}"}, where the latter is currently displayed as
  58.242    @{term "{#x+x|x:#M. x<c#}"}.
  58.243 -*}
  58.244 +\<close>
  58.245  
  58.246  lemma in_image_mset: "y \<in># {#f x. x \<in># M#} \<longleftrightarrow> y \<in> f ` set_of M"
  58.247    by (metis mem_set_of_iff set_of_image_mset)
  58.248 @@ -961,7 +961,7 @@
  58.249    by (metis image_mset_cong split_cong)
  58.250  
  58.251  
  58.252 -subsection {* Further conversions *}
  58.253 +subsection \<open>Further conversions\<close>
  58.254  
  58.255  primrec multiset_of :: "'a list \<Rightarrow> 'a multiset" where
  58.256    "multiset_of [] = {#}" |
  58.257 @@ -1121,12 +1121,12 @@
  58.258      proof (cases "finite A")
  58.259        case False then show ?thesis by simp
  58.260      next
  58.261 -      case True from True `x \<notin> A` show ?thesis by (induct A) auto
  58.262 +      case True from True \<open>x \<notin> A\<close> show ?thesis by (induct A) auto
  58.263      qed
  58.264    } note * = this
  58.265    then show "PROP ?P" "PROP ?Q" "PROP ?R"
  58.266    by (auto elim!: Set.set_insert)
  58.267 -qed -- {* TODO: maybe define @{const multiset_of_set} also in terms of @{const Abs_multiset} *}
  58.268 +qed -- \<open>TODO: maybe define @{const multiset_of_set} also in terms of @{const Abs_multiset}\<close>
  58.269  
  58.270  lemma elem_multiset_of_set[simp, intro]: "finite A \<Longrightarrow> x \<in># multiset_of_set A \<longleftrightarrow> x \<in> A"
  58.271    by (induct A rule: finite_induct) simp_all
  58.272 @@ -1185,7 +1185,7 @@
  58.273    by (cases "finite A") (induct A rule: finite_induct, simp_all add: ac_simps)
  58.274  
  58.275  
  58.276 -subsection {* Big operators *}
  58.277 +subsection \<open>Big operators\<close>
  58.278  
  58.279  no_notation times (infixl "*" 70)
  58.280  no_notation Groups.one ("1")
  58.281 @@ -1354,7 +1354,7 @@
  58.282  qed
  58.283  
  58.284  
  58.285 -subsection {* Replicate operation *}
  58.286 +subsection \<open>Replicate operation\<close>
  58.287  
  58.288  definition replicate_mset :: "nat \<Rightarrow> 'a \<Rightarrow> 'a multiset" where
  58.289    "replicate_mset n x = ((op + {#x#}) ^^ n) {#}"
  58.290 @@ -1385,9 +1385,9 @@
  58.291    by (induct D) simp_all
  58.292  
  58.293  
  58.294 -subsection {* Alternative representations *}
  58.295 -
  58.296 -subsubsection {* Lists *}
  58.297 +subsection \<open>Alternative representations\<close>
  58.298 +
  58.299 +subsubsection \<open>Lists\<close>
  58.300  
  58.301  context linorder
  58.302  begin
  58.303 @@ -1400,10 +1400,10 @@
  58.304    "multiset_of (sort_key k xs) = multiset_of xs"
  58.305    by (induct xs) (simp_all add: ac_simps)
  58.306  
  58.307 -text {*
  58.308 +text \<open>
  58.309    This lemma shows which properties suffice to show that a function
  58.310    @{text "f"} with @{text "f xs = ys"} behaves like sort.
  58.311 -*}
  58.312 +\<close>
  58.313  
  58.314  lemma properties_for_sort_key:
  58.315    assumes "multiset_of ys = multiset_of xs"
  58.316 @@ -1431,7 +1431,7 @@
  58.317    shows "sort xs = ys"
  58.318  proof (rule properties_for_sort_key)
  58.319    from multiset show "multiset_of ys = multiset_of xs" .
  58.320 -  from `sorted ys` show "sorted (map (\<lambda>x. x) ys)" by simp
  58.321 +  from \<open>sorted ys\<close> show "sorted (map (\<lambda>x. x) ys)" by simp
  58.322    from multiset have "\<And>k. length (filter (\<lambda>y. k = y) ys) = length (filter (\<lambda>x. k = x) xs)"
  58.323      by (rule multiset_of_eq_length_filter)
  58.324    then have "\<And>k. replicate (length (filter (\<lambda>y. k = y) ys)) k = replicate (length (filter (\<lambda>x. k = x) xs)) k"
  58.325 @@ -1485,7 +1485,7 @@
  58.326      @ sort [x\<leftarrow>xs. x > xs ! (length xs div 2)]" (is "sort ?lhs = ?rhs")
  58.327    using sort_key_by_quicksort [of "\<lambda>x. x", symmetric] by simp
  58.328  
  58.329 -text {* A stable parametrized quicksort *}
  58.330 +text \<open>A stable parametrized quicksort\<close>
  58.331  
  58.332  definition part :: "('b \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'b list \<Rightarrow> 'b list \<times> 'b list \<times> 'b list" where
  58.333    "part f pivot xs = ([x \<leftarrow> xs. f x < pivot], [x \<leftarrow> xs. f x = pivot], [x \<leftarrow> xs. pivot < f x])"
  58.334 @@ -1561,9 +1561,9 @@
  58.335    by (cases "i = j") (simp_all add: multiset_of_update nth_mem_multiset_of)
  58.336  
  58.337  
  58.338 -subsection {* The multiset order *}
  58.339 -
  58.340 -subsubsection {* Well-foundedness *}
  58.341 +subsection \<open>The multiset order\<close>
  58.342 +
  58.343 +subsubsection \<open>Well-foundedness\<close>
  58.344  
  58.345  definition mult1 :: "('a \<times> 'a) set => ('a multiset \<times> 'a multiset) set" where
  58.346    "mult1 r = {(N, M). \<exists>a M0 K. M = M0 + {#a#} \<and> N = M0 + K \<and>
  58.347 @@ -1632,7 +1632,7 @@
  58.348        proof (elim exE disjE conjE)
  58.349          fix M assume "(M, M0) \<in> ?R" and N: "N = M + {#a#}"
  58.350          from acc_hyp have "(M, M0) \<in> ?R --> M + {#a#} \<in> ?W" ..
  58.351 -        from this and `(M, M0) \<in> ?R` have "M + {#a#} \<in> ?W" ..
  58.352 +        from this and \<open>(M, M0) \<in> ?R\<close> have "M + {#a#} \<in> ?W" ..
  58.353          then show "N \<in> ?W" by (simp only: N)
  58.354        next
  58.355          fix K
  58.356 @@ -1677,7 +1677,7 @@
  58.357            by (rule acc_induct) (rule tedious_reasoning [OF _ r])
  58.358        qed
  58.359      qed
  58.360 -    from this and `M \<in> ?W` show "M + {#a#} \<in> ?W" ..
  58.361 +    from this and \<open>M \<in> ?W\<close> show "M + {#a#} \<in> ?W" ..
  58.362    qed
  58.363  qed
  58.364  
  58.365 @@ -1688,9 +1688,9 @@
  58.366  unfolding mult_def by (rule wf_trancl) (rule wf_mult1)
  58.367  
  58.368  
  58.369 -subsubsection {* Closure-free presentation *}
  58.370 -
  58.371 -text {* One direction. *}
  58.372 +subsubsection \<open>Closure-free presentation\<close>
  58.373 +
  58.374 +text \<open>One direction.\<close>
  58.375  
  58.376  lemma mult_implies_one_step:
  58.377    "trans r ==> (M, N) \<in> mult r ==>
  58.378 @@ -1736,7 +1736,7 @@
  58.379   apply (simp add: mult_def)
  58.380   apply (rule r_into_trancl)
  58.381   apply (simp add: mult1_def set_of_def, blast)
  58.382 -txt {* Now we know @{term "J' \<noteq> {#}"}. *}
  58.383 +txt \<open>Now we know @{term "J' \<noteq> {#}"}.\<close>
  58.384  apply (cut_tac M = K and P = "\<lambda>x. (x, a) \<in> r" in multiset_partition)
  58.385  apply (erule_tac P = "\<forall>k \<in> set_of K. P k" for P in rev_mp)
  58.386  apply (erule ssubst)
  58.387 @@ -1761,7 +1761,7 @@
  58.388  using one_step_implies_mult_aux by blast
  58.389  
  58.390  
  58.391 -subsubsection {* Partial-order properties *}
  58.392 +subsubsection \<open>Partial-order properties\<close>
  58.393  
  58.394  definition less_multiset :: "'a\<Colon>order multiset \<Rightarrow> 'a multiset \<Rightarrow> bool" (infix "#<#" 50) where
  58.395    "M' #<# M \<longleftrightarrow> (M', M) \<in> mult {(x', x). x' < x}"
  58.396 @@ -1804,7 +1804,7 @@
  58.397    by simp
  58.398  
  58.399  
  58.400 -subsubsection {* Monotonicity of multiset union *}
  58.401 +subsubsection \<open>Monotonicity of multiset union\<close>
  58.402  
  58.403  lemma mult1_union: "(B, D) \<in> mult1 r ==> (C + B, C + D) \<in> mult1 r"
  58.404  apply (unfold mult1_def)
  58.405 @@ -1836,7 +1836,7 @@
  58.406  qed (auto simp add: le_multiset_def intro: union_less_mono2)
  58.407  
  58.408  
  58.409 -subsubsection {* Termination proofs with multiset orders *}
  58.410 +subsubsection \<open>Termination proofs with multiset orders\<close>
  58.411  
  58.412  lemma multi_member_skip: "x \<in># XS \<Longrightarrow> x \<in># {# y #} + XS"
  58.413    and multi_member_this: "x \<in># {# x #} + XS"
  58.414 @@ -1944,7 +1944,7 @@
  58.415  and nonempty_single: "{# x #} \<noteq> {#}"
  58.416  by auto
  58.417  
  58.418 -setup {*
  58.419 +setup \<open>
  58.420  let
  58.421    fun msetT T = Type (@{type_name multiset}, [T]);
  58.422  
  58.423 @@ -1984,10 +1984,10 @@
  58.424      reduction_pair= @{thm ms_reduction_pair}
  58.425    })
  58.426  end
  58.427 -*}
  58.428 -
  58.429 -
  58.430 -subsection {* Legacy theorem bindings *}
  58.431 +\<close>
  58.432 +
  58.433 +
  58.434 +subsection \<open>Legacy theorem bindings\<close>
  58.435  
  58.436  lemmas multi_count_eq = multiset_eq_iff [symmetric]
  58.437  
  58.438 @@ -2044,7 +2044,7 @@
  58.439    "M #\<subset># N ==> (\<not> P ==> N #\<subset># (M::'a::order multiset)) ==> P"
  58.440    by (fact multiset_order.less_asym)
  58.441  
  58.442 -ML {*
  58.443 +ML \<open>
  58.444  fun multiset_postproc _ maybe_name all_values (T as Type (_, [elem_T]))
  58.445                        (Const _ $ t') =
  58.446      let
  58.447 @@ -2067,15 +2067,15 @@
  58.448                                                  elem_T --> T))) ts)
  58.449      end
  58.450    | multiset_postproc _ _ _ _ t = t
  58.451 -*}
  58.452 -
  58.453 -declaration {*
  58.454 +\<close>
  58.455 +
  58.456 +declaration \<open>
  58.457  Nitpick_Model.register_term_postprocessor @{typ "'a multiset"}
  58.458      multiset_postproc
  58.459 -*}
  58.460 -
  58.461 -
  58.462 -subsection {* Naive implementation using lists *}
  58.463 +\<close>
  58.464 +
  58.465 +
  58.466 +subsection \<open>Naive implementation using lists\<close>
  58.467  
  58.468  code_datatype multiset_of
  58.469  
  58.470 @@ -2140,7 +2140,7 @@
  58.471  
  58.472  declare sorted_list_of_multiset_multiset_of [code]
  58.473  
  58.474 -lemma [code]: -- {* not very efficient, but representation-ignorant! *}
  58.475 +lemma [code]: -- \<open>not very efficient, but representation-ignorant!\<close>
  58.476    "multiset_of_set A = multiset_of (sorted_list_of_set A)"
  58.477    apply (cases "finite A")
  58.478    apply simp_all
  58.479 @@ -2225,12 +2225,12 @@
  58.480    then show ?thesis by simp
  58.481  qed
  58.482  
  58.483 -text {*
  58.484 +text \<open>
  58.485    Exercise for the casual reader: add implementations for @{const le_multiset}
  58.486    and @{const less_multiset} (multiset order).
  58.487 -*}
  58.488 -
  58.489 -text {* Quickcheck generators *}
  58.490 +\<close>
  58.491 +
  58.492 +text \<open>Quickcheck generators\<close>
  58.493  
  58.494  definition (in term_syntax)
  58.495    msetify :: "'a\<Colon>typerep list \<times> (unit \<Rightarrow> Code_Evaluation.term)
  58.496 @@ -2267,7 +2267,7 @@
  58.497  hide_const (open) msetify
  58.498  
  58.499  
  58.500 -subsection {* BNF setup *}
  58.501 +subsection \<open>BNF setup\<close>
  58.502  
  58.503  definition rel_mset where
  58.504    "rel_mset R X Y \<longleftrightarrow> (\<exists>xs ys. multiset_of xs = X \<and> multiset_of ys = Y \<and> list_all2 R xs ys)"
  58.505 @@ -2580,17 +2580,17 @@
  58.506           rel_mset'.induct[unfolded rel_mset_rel_mset'[symmetric]]
  58.507  
  58.508  
  58.509 -subsection {* Size setup *}
  58.510 +subsection \<open>Size setup\<close>
  58.511  
  58.512  lemma multiset_size_o_map: "size_multiset g \<circ> image_mset f = size_multiset (g \<circ> f)"
  58.513    unfolding o_apply by (rule ext) (induct_tac, auto)
  58.514  
  58.515 -setup {*
  58.516 +setup \<open>
  58.517  BNF_LFP_Size.register_size_global @{type_name multiset} @{const_name size_multiset}
  58.518    @{thms size_multiset_empty size_multiset_single size_multiset_union size_empty size_single
  58.519      size_union}
  58.520    @{thms multiset_size_o_map}
  58.521 -*}
  58.522 +\<close>
  58.523  
  58.524  hide_const (open) wcount
  58.525  
    59.1 --- a/src/HOL/Library/Multiset_Order.thy	Wed Jun 17 10:57:11 2015 +0200
    59.2 +++ b/src/HOL/Library/Multiset_Order.thy	Wed Jun 17 11:03:05 2015 +0200
    59.3 @@ -3,13 +3,13 @@
    59.4      Author:     Jasmin Blanchette, Inria, LORIA, MPII
    59.5  *)
    59.6  
    59.7 -section {* More Theorems about the Multiset Order *}
    59.8 +section \<open>More Theorems about the Multiset Order\<close>
    59.9  
   59.10  theory Multiset_Order
   59.11  imports Multiset
   59.12  begin
   59.13  
   59.14 -subsubsection {* Alternative characterizations *}
   59.15 +subsubsection \<open>Alternative characterizations\<close>
   59.16  
   59.17  context order
   59.18  begin
   59.19 @@ -65,14 +65,14 @@
   59.20      by default (auto simp add: le_multiset_def irrefl dest: trans)
   59.21  qed
   59.22  
   59.23 -text {* The Dershowitz--Manna ordering: *}
   59.24 +text \<open>The Dershowitz--Manna ordering:\<close>
   59.25  
   59.26  definition less_multiset\<^sub>D\<^sub>M where
   59.27    "less_multiset\<^sub>D\<^sub>M M N \<longleftrightarrow>
   59.28     (\<exists>X Y. X \<noteq> {#} \<and> X \<le># N \<and> M = (N - X) + Y \<and> (\<forall>k. k \<in># Y \<longrightarrow> (\<exists>a. a \<in># X \<and> k < a)))"
   59.29  
   59.30  
   59.31 -text {* The Huet--Oppen ordering: *}
   59.32 +text \<open>The Huet--Oppen ordering:\<close>
   59.33  
   59.34  definition less_multiset\<^sub>H\<^sub>O where
   59.35    "less_multiset\<^sub>H\<^sub>O M N \<longleftrightarrow> M \<noteq> N \<and> (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x. y < x \<and> count M x < count N x))"
   59.36 @@ -110,7 +110,7 @@
   59.37          then show ?thesis by (cases "count P a \<le> count M a") (auto dest: count_a intro: less_trans)
   59.38        next
   59.39          case False
   59.40 -        with `y \<noteq> a` have "count P y = count N y" unfolding *(1,2) by simp
   59.41 +        with \<open>y \<noteq> a\<close> have "count P y = count N y" unfolding *(1,2) by simp
   59.42          with count_y step(3) obtain z where z: "z > y" "count M z < count N z" by auto
   59.43          show ?thesis
   59.44          proof (cases "z \<in># K")
   59.45 @@ -138,7 +138,7 @@
   59.46      unfolding less_multiset\<^sub>D\<^sub>M_def by blast
   59.47    then have "(N - X + Y, N - X + X) \<in> mult {(x, y). x < y}"
   59.48      by (intro one_step_implies_mult) (auto simp: Bex_def trans_def)
   59.49 -  with `M = N - X + Y` `X \<le># N` show "(M, N) \<in> mult {(x, y). x < y}"
   59.50 +  with \<open>M = N - X + Y\<close> \<open>X \<le># N\<close> show "(M, N) \<in> mult {(x, y). x < y}"
   59.51      by (metis subset_mset.diff_add)
   59.52  qed
   59.53  
   59.54 @@ -158,7 +158,7 @@
   59.55      fix k
   59.56      assume "k \<in># Y"
   59.57      then have "count N k < count M k" unfolding Y_def by auto
   59.58 -    with `less_multiset\<^sub>H\<^sub>O M N` obtain a where "k < a" and "count M a < count N a"
   59.59 +    with \<open>less_multiset\<^sub>H\<^sub>O M N\<close> obtain a where "k < a" and "count M a < count N a"
   59.60        unfolding less_multiset\<^sub>H\<^sub>O_def by blast
   59.61      then show "\<exists>a. a \<in># X \<and> k < a" unfolding X_def by auto
   59.62    qed
    60.1 --- a/src/HOL/Library/Nat_Bijection.thy	Wed Jun 17 10:57:11 2015 +0200
    60.2 +++ b/src/HOL/Library/Nat_Bijection.thy	Wed Jun 17 11:03:05 2015 +0200
    60.3 @@ -6,13 +6,13 @@
    60.4      Author:     Alexander Krauss
    60.5  *)
    60.6  
    60.7 -section {* Bijections between natural numbers and other types *}
    60.8 +section \<open>Bijections between natural numbers and other types\<close>
    60.9  
   60.10  theory Nat_Bijection
   60.11  imports Main
   60.12  begin
   60.13  
   60.14 -subsection {* Type @{typ "nat \<times> nat"} *}
   60.15 +subsection \<open>Type @{typ "nat \<times> nat"}\<close>
   60.16  
   60.17  text "Triangle numbers: 0, 1, 3, 6, 10, 15, ..."
   60.18  
   60.19 @@ -32,7 +32,7 @@
   60.20  where
   60.21    "prod_encode = (\<lambda>(m, n). triangle (m + n) + m)"
   60.22  
   60.23 -text {* In this auxiliary function, @{term "triangle k + m"} is an invariant. *}
   60.24 +text \<open>In this auxiliary function, @{term "triangle k + m"} is an invariant.\<close>
   60.25  
   60.26  fun
   60.27    prod_decode_aux :: "nat \<Rightarrow> nat \<Rightarrow> nat \<times> nat"
   60.28 @@ -96,7 +96,7 @@
   60.29  lemma prod_decode_eq: "prod_decode x = prod_decode y \<longleftrightarrow> x = y"
   60.30  by (rule inj_prod_decode [THEN inj_eq])
   60.31  
   60.32 -text {* Ordering properties *}
   60.33 +text \<open>Ordering properties\<close>
   60.34  
   60.35  lemma le_prod_encode_1: "a \<le> prod_encode (a, b)"
   60.36  unfolding prod_encode_def by simp
   60.37 @@ -105,7 +105,7 @@
   60.38  unfolding prod_encode_def by (induct b, simp_all)
   60.39  
   60.40  
   60.41 -subsection {* Type @{typ "nat + nat"} *}
   60.42 +subsection \<open>Type @{typ "nat + nat"}\<close>
   60.43  
   60.44  definition
   60.45    sum_encode  :: "nat + nat \<Rightarrow> nat"
   60.46 @@ -149,7 +149,7 @@
   60.47  by (rule inj_sum_decode [THEN inj_eq])
   60.48  
   60.49  
   60.50 -subsection {* Type @{typ "int"} *}
   60.51 +subsection \<open>Type @{typ "int"}\<close>
   60.52  
   60.53  definition
   60.54    int_encode :: "int \<Rightarrow> nat"
   60.55 @@ -193,7 +193,7 @@
   60.56  by (rule inj_int_decode [THEN inj_eq])
   60.57  
   60.58  
   60.59 -subsection {* Type @{typ "nat list"} *}
   60.60 +subsection \<open>Type @{typ "nat list"}\<close>
   60.61  
   60.62  fun
   60.63    list_encode :: "nat list \<Rightarrow> nat"
   60.64 @@ -249,9 +249,9 @@
   60.65  by (rule inj_list_decode [THEN inj_eq])
   60.66  
   60.67  
   60.68 -subsection {* Finite sets of naturals *}
   60.69 +subsection \<open>Finite sets of naturals\<close>
   60.70  
   60.71 -subsubsection {* Preliminaries *}
   60.72 +subsubsection \<open>Preliminaries\<close>
   60.73  
   60.74  lemma finite_vimage_Suc_iff: "finite (Suc -` F) \<longleftrightarrow> finite F"
   60.75  apply (safe intro!: finite_vimageI inj_Suc)
   60.76 @@ -274,7 +274,7 @@
   60.77    and "even x \<longleftrightarrow> even y"
   60.78    shows "x = y"
   60.79  proof -
   60.80 -  from `even x \<longleftrightarrow> even y` have "x mod 2 = y mod 2"
   60.81 +  from \<open>even x \<longleftrightarrow> even y\<close> have "x mod 2 = y mod 2"
   60.82      by (simp only: even_iff_mod_2_eq_zero) auto
   60.83    with assms have "x div 2 * 2 + x mod 2 = y div 2 * 2 + y mod 2"
   60.84      by simp
   60.85 @@ -283,7 +283,7 @@
   60.86  qed
   60.87  
   60.88  
   60.89 -subsubsection {* From sets to naturals *}
   60.90 +subsubsection \<open>From sets to naturals\<close>
   60.91  
   60.92  definition
   60.93    set_encode :: "nat set \<Rightarrow> nat"
   60.94 @@ -314,7 +314,7 @@
   60.95  
   60.96  lemmas set_encode_div_2 = set_encode_vimage_Suc [symmetric]
   60.97  
   60.98 -subsubsection {* From naturals to sets *}
   60.99 +subsubsection \<open>From naturals to sets\<close>
  60.100  
  60.101  definition
  60.102    set_decode :: "nat \<Rightarrow> nat set"
  60.103 @@ -358,7 +358,7 @@
  60.104  apply (simp add: finite_vimage_Suc_iff)
  60.105  done
  60.106  
  60.107 -subsubsection {* Proof of isomorphism *}
  60.108 +subsubsection \<open>Proof of isomorphism\<close>
  60.109  
  60.110  lemma set_decode_inverse [simp]: "set_encode (set_decode n) = n"
  60.111  apply (induct n rule: nat_less_induct)
    61.1 --- a/src/HOL/Library/Numeral_Type.thy	Wed Jun 17 10:57:11 2015 +0200
    61.2 +++ b/src/HOL/Library/Numeral_Type.thy	Wed Jun 17 11:03:05 2015 +0200
    61.3 @@ -2,13 +2,13 @@
    61.4      Author:     Brian Huffman
    61.5  *)
    61.6  
    61.7 -section {* Numeral Syntax for Types *}
    61.8 +section \<open>Numeral Syntax for Types\<close>
    61.9  
   61.10  theory Numeral_Type
   61.11  imports Cardinality
   61.12  begin
   61.13  
   61.14 -subsection {* Numeral Types *}
   61.15 +subsection \<open>Numeral Types\<close>
   61.16  
   61.17  typedef num0 = "UNIV :: nat set" ..
   61.18  typedef num1 = "UNIV :: unit set" ..
   61.19 @@ -70,7 +70,7 @@
   61.20      by simp
   61.21  qed
   61.22  
   61.23 -subsection {* Locales for for modular arithmetic subtypes *}
   61.24 +subsection \<open>Locales for for modular arithmetic subtypes\<close>
   61.25  
   61.26  locale mod_type =
   61.27    fixes n :: int
   61.28 @@ -179,12 +179,12 @@
   61.29  end
   61.30  
   61.31  
   61.32 -subsection {* Ring class instances *}
   61.33 +subsection \<open>Ring class instances\<close>
   61.34  
   61.35 -text {*
   61.36 +text \<open>
   61.37    Unfortunately @{text ring_1} instance is not possible for
   61.38    @{typ num1}, since 0 and 1 are not distinct.
   61.39 -*}
   61.40 +\<close>
   61.41  
   61.42  instantiation num1 :: "{comm_ring,comm_monoid_mult,numeral}"
   61.43  begin
   61.44 @@ -273,7 +273,7 @@
   61.45             "Abs_bit1 :: int \<Rightarrow> 'a::finite bit1"
   61.46    ..
   61.47  
   61.48 -text {* Set up cases, induction, and arithmetic *}
   61.49 +text \<open>Set up cases, induction, and arithmetic\<close>
   61.50  
   61.51  lemmas bit0_cases [case_names of_int, cases type: bit0] = bit0.cases
   61.52  lemmas bit1_cases [case_names of_int, cases type: bit1] = bit1.cases
   61.53 @@ -287,7 +287,7 @@
   61.54  lemmas [simp] = eq_numeral_iff_iszero [where 'a="'a bit0"] for dummy :: "'a::finite"
   61.55  lemmas [simp] = eq_numeral_iff_iszero [where 'a="'a bit1"] for dummy :: "'a::finite"
   61.56  
   61.57 -subsection {* Order instances *}
   61.58 +subsection \<open>Order instances\<close>
   61.59  
   61.60  instantiation bit0 and bit1 :: (finite) linorder begin
   61.61  definition "a < b \<longleftrightarrow> Rep_bit0 a < Rep_bit0 b"
   61.62 @@ -316,9 +316,9 @@
   61.63      by(rule wf_wellorderI) intro_classes
   61.64  qed
   61.65  
   61.66 -subsection {* Code setup and type classes for code generation *}
   61.67 +subsection \<open>Code setup and type classes for code generation\<close>
   61.68  
   61.69 -text {* Code setup for @{typ num0} and @{typ num1} *}
   61.70 +text \<open>Code setup for @{typ num0} and @{typ num1}\<close>
   61.71  
   61.72  definition Num0 :: num0 where "Num0 = Abs_num0 0"
   61.73  code_datatype Num0
   61.74 @@ -366,7 +366,7 @@
   61.75  end
   61.76  
   61.77  
   61.78 -text {* Code setup for @{typ "'a bit0"} and @{typ "'a bit1"} *}
   61.79 +text \<open>Code setup for @{typ "'a bit0"} and @{typ "'a bit1"}\<close>
   61.80  
   61.81  declare
   61.82    bit0.Rep_inverse[code abstype]
   61.83 @@ -465,7 +465,7 @@
   61.84  instance by intro_classes (simp_all add: card_UNIV_bit0_def card_UNIV_bit1_def card_UNIV)
   61.85  end
   61.86  
   61.87 -subsection {* Syntax *}
   61.88 +subsection \<open>Syntax\<close>
   61.89  
   61.90  syntax
   61.91    "_NumeralType" :: "num_token => type"  ("_")
   61.92 @@ -476,7 +476,7 @@
   61.93    (type) "1" == (type) "num1"
   61.94    (type) "0" == (type) "num0"
   61.95  
   61.96 -parse_translation {*
   61.97 +parse_translation \<open>
   61.98    let
   61.99      fun mk_bintype n =
  61.100        let
  61.101 @@ -495,9 +495,9 @@
  61.102        | numeral_tr ts = raise TERM ("numeral_tr", ts);
  61.103  
  61.104    in [(@{syntax_const "_NumeralType"}, K numeral_tr)] end;
  61.105 -*}
  61.106 +\<close>
  61.107  
  61.108 -print_translation {*
  61.109 +print_translation \<open>
  61.110    let
  61.111      fun int_of [] = 0
  61.112        | int_of (b :: bs) = b + 2 * int_of bs;
  61.113 @@ -521,9 +521,9 @@
  61.114     [(@{type_syntax bit0}, K (bit_tr' 0)),
  61.115      (@{type_syntax bit1}, K (bit_tr' 1))]
  61.116    end;
  61.117 -*}
  61.118 +\<close>
  61.119  
  61.120 -subsection {* Examples *}
  61.121 +subsection \<open>Examples\<close>
  61.122  
  61.123  lemma "CARD(0) = 0" by simp
  61.124  lemma "CARD(17) = 17" by simp
    62.1 --- a/src/HOL/Library/Old_Datatype.thy	Wed Jun 17 10:57:11 2015 +0200
    62.2 +++ b/src/HOL/Library/Old_Datatype.thy	Wed Jun 17 11:03:05 2015 +0200
    62.3 @@ -3,7 +3,7 @@
    62.4      Author:     Stefan Berghofer and Markus Wenzel, TU Muenchen
    62.5  *)
    62.6  
    62.7 -section {* Old Datatype package: constructing datatypes from Cartesian Products and Disjoint Sums *}
    62.8 +section \<open>Old Datatype package: constructing datatypes from Cartesian Products and Disjoint Sums\<close>
    62.9  
   62.10  theory Old_Datatype
   62.11  imports "../Main"
   62.12 @@ -13,7 +13,7 @@
   62.13  ML_file "~~/src/HOL/Tools/datatype_realizer.ML"
   62.14  
   62.15  
   62.16 -subsection {* The datatype universe *}
   62.17 +subsection \<open>The datatype universe\<close>
   62.18  
   62.19  definition "Node = {p. EX f x k. p = (f :: nat => 'b + nat, x ::'a + nat) & f k = Inr 0}"
   62.20  
   62.21 @@ -21,7 +21,7 @@
   62.22    morphisms Rep_Node Abs_Node
   62.23    unfolding Node_def by auto
   62.24  
   62.25 -text{*Datatypes will be represented by sets of type @{text node}*}
   62.26 +text\<open>Datatypes will be represented by sets of type @{text node}\<close>
   62.27  
   62.28  type_synonym 'a item        = "('a, unit) node set"
   62.29  type_synonym ('a, 'b) dtree = "('a, 'b) node set"
   62.30 @@ -140,7 +140,7 @@
   62.31  done
   62.32  
   62.33  
   62.34 -subsection{*Freeness: Distinctness of Constructors*}
   62.35 +subsection\<open>Freeness: Distinctness of Constructors\<close>
   62.36  
   62.37  (** Scons vs Atom **)
   62.38  
   62.39 @@ -310,7 +310,7 @@
   62.40  by (simp add: In1_def)
   62.41  
   62.42  
   62.43 -subsection{*Set Constructions*}
   62.44 +subsection\<open>Set Constructions\<close>
   62.45  
   62.46  
   62.47  (*** Cartesian Product ***)
   62.48 @@ -520,7 +520,7 @@
   62.49    by auto
   62.50  
   62.51  
   62.52 -text {* hides popular names *}
   62.53 +text \<open>hides popular names\<close>
   62.54  hide_type (open) node item
   62.55  hide_const (open) Push Node Atom Leaf Numb Lim Split Case
   62.56  
    63.1 --- a/src/HOL/Library/Old_Recdef.thy	Wed Jun 17 10:57:11 2015 +0200
    63.2 +++ b/src/HOL/Library/Old_Recdef.thy	Wed Jun 17 11:03:05 2015 +0200
    63.3 @@ -2,7 +2,7 @@
    63.4      Author:     Konrad Slind and Markus Wenzel, TU Muenchen
    63.5  *)
    63.6  
    63.7 -section {* TFL: recursive function definitions *}
    63.8 +section \<open>TFL: recursive function definitions\<close>
    63.9  
   63.10  theory Old_Recdef
   63.11  imports Main
   63.12 @@ -12,7 +12,7 @@
   63.13    "permissive" "congs" "hints"
   63.14  begin
   63.15  
   63.16 -subsection {* Lemmas for TFL *}
   63.17 +subsection \<open>Lemmas for TFL\<close>
   63.18  
   63.19  lemma tfl_wf_induct: "ALL R. wf R -->  
   63.20         (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
   63.21 @@ -70,7 +70,7 @@
   63.22  ML_file "~~/src/HOL/Tools/recdef.ML"
   63.23  
   63.24  
   63.25 -subsection {* Rule setup *}
   63.26 +subsection \<open>Rule setup\<close>
   63.27  
   63.28  lemmas [recdef_simp] =
   63.29    inv_image_def
    64.1 --- a/src/HOL/Library/Old_SMT.thy	Wed Jun 17 10:57:11 2015 +0200
    64.2 +++ b/src/HOL/Library/Old_SMT.thy	Wed Jun 17 11:03:05 2015 +0200
    64.3 @@ -2,7 +2,7 @@
    64.4      Author:     Sascha Boehme, TU Muenchen
    64.5  *)
    64.6  
    64.7 -section {* Old Version of Bindings to Satisfiability Modulo Theories (SMT) solvers *}
    64.8 +section \<open>Old Version of Bindings to Satisfiability Modulo Theories (SMT) solvers\<close>
    64.9  
   64.10  theory Old_SMT
   64.11  imports "../Real" "../Word/Word"
   64.12 @@ -14,9 +14,9 @@
   64.13  ML_file "Old_SMT/old_smt_config.ML"
   64.14  
   64.15  
   64.16 -subsection {* Triggers for quantifier instantiation *}
   64.17 +subsection \<open>Triggers for quantifier instantiation\<close>
   64.18  
   64.19 -text {*
   64.20 +text \<open>
   64.21  Some SMT solvers support patterns as a quantifier instantiation
   64.22  heuristics.  Patterns may either be positive terms (tagged by "pat")
   64.23  triggering quantifier instantiations -- when the solver finds a
   64.24 @@ -29,7 +29,7 @@
   64.25  act disjunctively during quantifier instantiation.  Each multipattern
   64.26  should mention at least all quantified variables of the preceding
   64.27  quantifier block.
   64.28 -*}
   64.29 +\<close>
   64.30  
   64.31  typedecl pattern
   64.32  
   64.33 @@ -40,17 +40,17 @@
   64.34  definition trigger :: "pattern list list \<Rightarrow> bool \<Rightarrow> bool" where "trigger _ P = P"
   64.35  
   64.36  
   64.37 -subsection {* Quantifier weights *}
   64.38 +subsection \<open>Quantifier weights\<close>
   64.39  
   64.40 -text {*
   64.41 +text \<open>
   64.42  Weight annotations to quantifiers influence the priority of quantifier
   64.43  instantiations.  They should be handled with care for solvers, which support
   64.44  them, because incorrect choices of weights might render a problem unsolvable.
   64.45 -*}
   64.46 +\<close>
   64.47  
   64.48  definition weight :: "int \<Rightarrow> bool \<Rightarrow> bool" where "weight _ P = P"
   64.49  
   64.50 -text {*
   64.51 +text \<open>
   64.52  Weights must be non-negative.  The value @{text 0} is equivalent to providing
   64.53  no weight at all.
   64.54  
   64.55 @@ -63,32 +63,32 @@
   64.56  \item
   64.57  @{term "\<forall>x. weight 3 (P x)"}
   64.58  \end{itemize}
   64.59 -*}
   64.60 +\<close>
   64.61  
   64.62  
   64.63 -subsection {* Higher-order encoding *}
   64.64 +subsection \<open>Higher-order encoding\<close>
   64.65  
   64.66 -text {*
   64.67 +text \<open>
   64.68  Application is made explicit for constants occurring with varying
   64.69  numbers of arguments.  This is achieved by the introduction of the
   64.70  following constant.
   64.71 -*}
   64.72 +\<close>
   64.73  
   64.74  definition fun_app where "fun_app f = f"
   64.75  
   64.76 -text {*
   64.77 +text \<open>
   64.78  Some solvers support a theory of arrays which can be used to encode
   64.79  higher-order functions.  The following set of lemmas specifies the
   64.80  properties of such (extensional) arrays.
   64.81 -*}
   64.82 +\<close>
   64.83  
   64.84  lemmas array_rules = ext fun_upd_apply fun_upd_same fun_upd_other
   64.85    fun_upd_upd fun_app_def
   64.86  
   64.87  
   64.88 -subsection {* First-order logic *}
   64.89 +subsection \<open>First-order logic\<close>
   64.90  
   64.91 -text {*
   64.92 +text \<open>
   64.93  Some SMT solvers only accept problems in first-order logic, i.e.,
   64.94  where formulas and terms are syntactically separated. When
   64.95  translating higher-order into first-order problems, all
   64.96 @@ -98,13 +98,13 @@
   64.97  turned into terms by logically equating such atoms with @{term True}.
   64.98  For technical reasons, @{term True} and @{term False} occurring inside
   64.99  terms are replaced by the following constants.
  64.100 -*}
  64.101 +\<close>
  64.102  
  64.103  definition term_true where "term_true = True"
  64.104  definition term_false where "term_false = False"
  64.105  
  64.106  
  64.107 -subsection {* Integer division and modulo for Z3 *}
  64.108 +subsection \<open>Integer division and modulo for Z3\<close>
  64.109  
  64.110  definition z3div :: "int \<Rightarrow> int \<Rightarrow> int" where
  64.111    "z3div k l = (if 0 \<le> l then k div l else -(k div (-l)))"
  64.112 @@ -113,7 +113,7 @@
  64.113    "z3mod k l = (if 0 \<le> l then k mod l else k mod (-l))"
  64.114  
  64.115  
  64.116 -subsection {* Setup *}
  64.117 +subsection \<open>Setup\<close>
  64.118  
  64.119  ML_file "Old_SMT/old_smt_builtin.ML"
  64.120  ML_file "Old_SMT/old_smt_datatypes.ML"
  64.121 @@ -131,33 +131,33 @@
  64.122  ML_file "Old_SMT/old_z3_model.ML"
  64.123  ML_file "Old_SMT/old_smt_setup_solvers.ML"
  64.124  
  64.125 -setup {*
  64.126 +setup \<open>
  64.127    Old_SMT_Config.setup #>
  64.128    Old_SMT_Normalize.setup #>
  64.129    Old_SMTLIB_Interface.setup #>
  64.130    Old_Z3_Interface.setup #>
  64.131    Old_SMT_Setup_Solvers.setup
  64.132 -*}
  64.133 +\<close>
  64.134  
  64.135 -method_setup old_smt = {*
  64.136 +method_setup old_smt = \<open>
  64.137    Scan.optional Attrib.thms [] >>
  64.138      (fn thms => fn ctxt =>
  64.139        METHOD (fn facts => HEADGOAL (Old_SMT_Solver.smt_tac ctxt (thms @ facts))))
  64.140 -*} "apply an SMT solver to the current goal"
  64.141 +\<close> "apply an SMT solver to the current goal"
  64.142  
  64.143  
  64.144 -subsection {* Configuration *}
  64.145 +subsection \<open>Configuration\<close>
  64.146  
  64.147 -text {*
  64.148 +text \<open>
  64.149  The current configuration can be printed by the command
  64.150  @{text old_smt_status}, which shows the values of most options.
  64.151 -*}
  64.152 +\<close>
  64.153  
  64.154  
  64.155  
  64.156 -subsection {* General configuration options *}
  64.157 +subsection \<open>General configuration options\<close>
  64.158  
  64.159 -text {*
  64.160 +text \<open>
  64.161  The option @{text old_smt_solver} can be used to change the target SMT
  64.162  solver.  The possible values can be obtained from the @{text old_smt_status}
  64.163  command.
  64.164 @@ -166,82 +166,82 @@
  64.165  by default.  Z3 is free for non-commercial applications and can be enabled
  64.166  by setting the @{text OLD_Z3_NON_COMMERCIAL} environment variable to
  64.167  @{text yes}.
  64.168 -*}
  64.169 +\<close>
  64.170  
  64.171  declare [[ old_smt_solver = z3 ]]
  64.172  
  64.173 -text {*
  64.174 +text \<open>
  64.175  Since SMT solvers are potentially non-terminating, there is a timeout
  64.176  (given in seconds) to restrict their runtime.  A value greater than
  64.177  120 (seconds) is in most cases not advisable.
  64.178 -*}
  64.179 +\<close>
  64.180  
  64.181  declare [[ old_smt_timeout = 20 ]]
  64.182  
  64.183 -text {*
  64.184 +text \<open>
  64.185  SMT solvers apply randomized heuristics.  In case a problem is not
  64.186  solvable by an SMT solver, changing the following option might help.
  64.187 -*}
  64.188 +\<close>
  64.189  
  64.190  declare [[ old_smt_random_seed = 1 ]]
  64.191  
  64.192 -text {*
  64.193 +text \<open>
  64.194  In general, the binding to SMT solvers runs as an oracle, i.e, the SMT
  64.195  solvers are fully trusted without additional checks.  The following
  64.196  option can cause the SMT solver to run in proof-producing mode, giving
  64.197  a checkable certificate.  This is currently only implemented for Z3.
  64.198 -*}
  64.199 +\<close>
  64.200  
  64.201  declare [[ old_smt_oracle = false ]]
  64.202  
  64.203 -text {*
  64.204 +text \<open>
  64.205  Each SMT solver provides several commandline options to tweak its
  64.206  behaviour.  They can be passed to the solver by setting the following
  64.207  options.
  64.208 -*}
  64.209 +\<close>
  64.210  
  64.211  declare [[ old_cvc3_options = "" ]]
  64.212  declare [[ old_yices_options = "" ]]
  64.213  declare [[ old_z3_options = "" ]]
  64.214  
  64.215 -text {*
  64.216 +text \<open>
  64.217  Enable the following option to use built-in support for datatypes and
  64.218  records.  Currently, this is only implemented for Z3 running in oracle
  64.219  mode.
  64.220 -*}
  64.221 +\<close>
  64.222  
  64.223  declare [[ old_smt_datatypes = false ]]
  64.224  
  64.225 -text {*
  64.226 +text \<open>
  64.227  The SMT method provides an inference mechanism to detect simple triggers
  64.228  in quantified formulas, which might increase the number of problems
  64.229  solvable by SMT solvers (note: triggers guide quantifier instantiations
  64.230  in the SMT solver).  To turn it on, set the following option.
  64.231 -*}
  64.232 +\<close>
  64.233  
  64.234  declare [[ old_smt_infer_triggers = false ]]
  64.235  
  64.236 -text {*
  64.237 +text \<open>
  64.238  The SMT method monomorphizes the given facts, that is, it tries to
  64.239  instantiate all schematic type variables with fixed types occurring
  64.240  in the problem.  This is a (possibly nonterminating) fixed-point
  64.241  construction whose cycles are limited by the following option.
  64.242 -*}
  64.243 +\<close>
  64.244  
  64.245  declare [[ monomorph_max_rounds = 5 ]]
  64.246  
  64.247 -text {*
  64.248 +text \<open>
  64.249  In addition, the number of generated monomorphic instances is limited
  64.250  by the following option.
  64.251 -*}
  64.252 +\<close>
  64.253  
  64.254  declare [[ monomorph_max_new_instances = 500 ]]
  64.255  
  64.256  
  64.257  
  64.258 -subsection {* Certificates *}
  64.259 +subsection \<open>Certificates\<close>
  64.260  
  64.261 -text {*
  64.262 +text \<open>
  64.263  By setting the option @{text old_smt_certificates} to the name of a file,
  64.264  all following applications of an SMT solver a cached in that file.
  64.265  Any further application of the same SMT solver (using the very same
  64.266 @@ -253,11 +253,11 @@
  64.267  @{text ".certs"} instead of @{text ".thy"}) as the certificates file.
  64.268  Certificate files should be used at most once in a certain theory context,
  64.269  to avoid race conditions with other concurrent accesses.
  64.270 -*}
  64.271 +\<close>
  64.272  
  64.273  declare [[ old_smt_certificates = "" ]]
  64.274  
  64.275 -text {*
  64.276 +text \<open>
  64.277  The option @{text old_smt_read_only_certificates} controls whether only
  64.278  stored certificates are should be used or invocation of an SMT solver
  64.279  is allowed.  When set to @{text true}, no SMT solver will ever be
  64.280 @@ -265,50 +265,50 @@
  64.281  cache are used;  when set to @{text false} and there is no cached
  64.282  certificate for some proposition, then the configured SMT solver is
  64.283  invoked.
  64.284 -*}
  64.285 +\<close>
  64.286  
  64.287  declare [[ old_smt_read_only_certificates = false ]]
  64.288  
  64.289  
  64.290  
  64.291 -subsection {* Tracing *}
  64.292 +subsection \<open>Tracing\<close>
  64.293  
  64.294 -text {*
  64.295 +text \<open>
  64.296  The SMT method, when applied, traces important information.  To
  64.297  make it entirely silent, set the following option to @{text false}.
  64.298 -*}
  64.299 +\<close>
  64.300  
  64.301  declare [[ old_smt_verbose = true ]]
  64.302  
  64.303 -text {*
  64.304 +text \<open>
  64.305  For tracing the generated problem file given to the SMT solver as
  64.306  well as the returned result of the solver, the option
  64.307  @{text old_smt_trace} should be set to @{text true}.
  64.308 -*}
  64.309 +\<close>
  64.310  
  64.311  declare [[ old_smt_trace = false ]]
  64.312  
  64.313 -text {*
  64.314 +text \<open>
  64.315  From the set of assumptions given to the SMT solver, those assumptions
  64.316  used in the proof are traced when the following option is set to
  64.317  @{term true}.  This only works for Z3 when it runs in non-oracle mode
  64.318  (see options @{text old_smt_solver} and @{text old_smt_oracle} above).
  64.319 -*}
  64.320 +\<close>
  64.321  
  64.322  declare [[ old_smt_trace_used_facts = false ]]
  64.323  
  64.324  
  64.325  
  64.326 -subsection {* Schematic rules for Z3 proof reconstruction *}
  64.327 +subsection \<open>Schematic rules for Z3 proof reconstruction\<close>
  64.328  
  64.329 -text {*
  64.330 +text \<open>
  64.331  Several prof rules of Z3 are not very well documented.  There are two
  64.332  lemma groups which can turn failing Z3 proof reconstruction attempts
  64.333  into succeeding ones: the facts in @{text z3_rule} are tried prior to
  64.334  any implemented reconstruction procedure for all uncertain Z3 proof
  64.335  rules;  the facts in @{text z3_simp} are only fed to invocations of
  64.336  the simplifier when reconstructing theory-specific proof steps.
  64.337 -*}
  64.338 +\<close>
  64.339  
  64.340  lemmas [old_z3_rule] =
  64.341    refl eq_commute conj_commute disj_commute simp_thms nnf_simps
    65.1 --- a/src/HOL/Library/Option_ord.thy	Wed Jun 17 10:57:11 2015 +0200
    65.2 +++ b/src/HOL/Library/Option_ord.thy	Wed Jun 17 11:03:05 2015 +0200
    65.3 @@ -2,7 +2,7 @@
    65.4      Author:     Florian Haftmann, TU Muenchen
    65.5  *)
    65.6  
    65.7 -section {* Canonical order on option type *}
    65.8 +section \<open>Canonical order on option type\<close>
    65.9  
   65.10  theory Option_ord
   65.11  imports Option Main
   65.12 @@ -104,7 +104,7 @@
   65.13    proof -
   65.14      fix z
   65.15      assume "\<And>x. z = Some x \<Longrightarrow> (P o Some) x"
   65.16 -    with `P None` show "P z" by (cases z) simp_all
   65.17 +    with \<open>P None\<close> show "P z" by (cases z) simp_all
   65.18    qed
   65.19    show "P z" proof (cases z rule: P_Some)
   65.20      case (Some w)
   65.21 @@ -114,7 +114,7 @@
   65.22          fix y :: "'a option"
   65.23          assume "y < Some x"
   65.24          show "P y" proof (cases y rule: P_Some)
   65.25 -          case (Some v) with `y < Some x` have "v < x" by simp
   65.26 +          case (Some v) with \<open>y < Some x\<close> have "v < x" by simp
   65.27            with less show "(P o Some) v" .
   65.28          qed
   65.29        qed
    66.1 --- a/src/HOL/Library/Order_Continuity.thy	Wed Jun 17 10:57:11 2015 +0200
    66.2 +++ b/src/HOL/Library/Order_Continuity.thy	Wed Jun 17 11:03:05 2015 +0200
    66.3 @@ -2,7 +2,7 @@
    66.4      Author:     David von Oheimb, TU Muenchen
    66.5  *)
    66.6  
    66.7 -section {* Continuity and iterations (of set transformers) *}
    66.8 +section \<open>Continuity and iterations (of set transformers)\<close>
    66.9  
   66.10  theory Order_Continuity
   66.11  imports Main
   66.12 @@ -34,7 +34,7 @@
   66.13    and have the advantage that these names are duals.
   66.14  \<close>
   66.15  
   66.16 -subsection {* Continuity for complete lattices *}
   66.17 +subsection \<open>Continuity for complete lattices\<close>
   66.18  
   66.19  definition
   66.20    sup_continuous :: "('a::complete_lattice \<Rightarrow> 'a::complete_lattice) \<Rightarrow> bool" where
   66.21 @@ -59,7 +59,7 @@
   66.22  lemma sup_continuous_lfp:
   66.23    assumes "sup_continuous F" shows "lfp F = (SUP i. (F ^^ i) bot)" (is "lfp F = ?U")
   66.24  proof (rule antisym)
   66.25 -  note mono = sup_continuous_mono[OF `sup_continuous F`]
   66.26 +  note mono = sup_continuous_mono[OF \<open>sup_continuous F\<close>]
   66.27    show "?U \<le> lfp F"
   66.28    proof (rule SUP_least)
   66.29      fix i show "(F ^^ i) bot \<le> lfp F"
   66.30 @@ -84,7 +84,7 @@
   66.31        thus ?thesis by (auto simp add: mono_iff_le_Suc)
   66.32      qed
   66.33      hence "F ?U = (SUP i. (F ^^ Suc i) bot)"
   66.34 -      using `sup_continuous F` by (simp add: sup_continuous_def)
   66.35 +      using \<open>sup_continuous F\<close> by (simp add: sup_continuous_def)
   66.36      also have "\<dots> \<le> ?U"
   66.37        by (fast intro: SUP_least SUP_upper)
   66.38      finally show "F ?U \<le> ?U" .
   66.39 @@ -127,7 +127,7 @@
   66.40  lemma inf_continuous_gfp:
   66.41    assumes "inf_continuous F" shows "gfp F = (INF i. (F ^^ i) top)" (is "gfp F = ?U")
   66.42  proof (rule antisym)
   66.43 -  note mono = inf_continuous_mono[OF `inf_continuous F`]
   66.44 +  note mono = inf_continuous_mono[OF \<open>inf_continuous F\<close>]
   66.45    show "gfp F \<le> ?U"
   66.46    proof (rule INF_greatest)
   66.47      fix i show "gfp F \<le> (F ^^ i) top"
   66.48 @@ -154,7 +154,7 @@
   66.49      have "?U \<le> (INF i. (F ^^ Suc i) top)"
   66.50        by (fast intro: INF_greatest INF_lower)
   66.51      also have "\<dots> \<le> F ?U"
   66.52 -      by (simp add: inf_continuousD `inf_continuous F` *)
   66.53 +      by (simp add: inf_continuousD \<open>inf_continuous F\<close> *)
   66.54      finally show "?U \<le> F ?U" .
   66.55    qed
   66.56  qed
    67.1 --- a/src/HOL/Library/Parallel.thy	Wed Jun 17 10:57:11 2015 +0200
    67.2 +++ b/src/HOL/Library/Parallel.thy	Wed Jun 17 11:03:05 2015 +0200
    67.3 @@ -1,12 +1,12 @@
    67.4  (* Author: Florian Haftmann, TU Muenchen *)
    67.5  
    67.6 -section {* Futures and parallel lists for code generated towards Isabelle/ML *}
    67.7 +section \<open>Futures and parallel lists for code generated towards Isabelle/ML\<close>
    67.8  
    67.9  theory Parallel
   67.10  imports Main
   67.11  begin
   67.12  
   67.13 -subsection {* Futures *}
   67.14 +subsection \<open>Futures\<close>
   67.15  
   67.16  datatype 'a future = fork "unit \<Rightarrow> 'a"
   67.17  
   67.18 @@ -26,7 +26,7 @@
   67.19  code_reserved Eval Future future
   67.20  
   67.21  
   67.22 -subsection {* Parallel lists *}
   67.23 +subsection \<open>Parallel lists\<close>
   67.24  
   67.25  definition map :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a list \<Rightarrow> 'b list" where
   67.26    [simp]: "map = List.map"
    68.1 --- a/src/HOL/Library/Permutation.thy	Wed Jun 17 10:57:11 2015 +0200
    68.2 +++ b/src/HOL/Library/Permutation.thy	Wed Jun 17 11:03:05 2015 +0200
    68.3 @@ -2,7 +2,7 @@
    68.4      Author:     Lawrence C Paulson and Thomas M Rasmussen and Norbert Voelker
    68.5  *)
    68.6  
    68.7 -section {* Permutations *}
    68.8 +section \<open>Permutations\<close>
    68.9  
   68.10  theory Permutation
   68.11  imports Multiset
   68.12 @@ -19,13 +19,13 @@
   68.13    by (induct l) auto
   68.14  
   68.15  
   68.16 -subsection {* Some examples of rule induction on permutations *}
   68.17 +subsection \<open>Some examples of rule induction on permutations\<close>
   68.18  
   68.19  lemma xperm_empty_imp: "[] <~~> ys \<Longrightarrow> ys = []"
   68.20    by (induct xs == "[] :: 'a list" ys pred: perm) simp_all
   68.21  
   68.22  
   68.23 -text {* \medskip This more general theorem is easier to understand! *}
   68.24 +text \<open>\medskip This more general theorem is easier to understand!\<close>
   68.25  
   68.26  lemma perm_length: "xs <~~> ys \<Longrightarrow> length xs = length ys"
   68.27    by (induct pred: perm) simp_all
   68.28 @@ -37,9 +37,9 @@
   68.29    by (induct pred: perm) auto
   68.30  
   68.31  
   68.32 -subsection {* Ways of making new permutations *}
   68.33 +subsection \<open>Ways of making new permutations\<close>
   68.34  
   68.35 -text {* We can insert the head anywhere in the list. *}
   68.36 +text \<open>We can insert the head anywhere in the list.\<close>
   68.37  
   68.38  lemma perm_append_Cons: "a # xs @ ys <~~> xs @ a # ys"
   68.39    by (induct xs) auto
   68.40 @@ -66,7 +66,7 @@
   68.41    by (blast intro!: perm_append_swap perm_append1)
   68.42  
   68.43  
   68.44 -subsection {* Further results *}
   68.45 +subsection \<open>Further results\<close>
   68.46  
   68.47  lemma perm_empty [iff]: "[] <~~> xs \<longleftrightarrow> xs = []"
   68.48    by (blast intro: perm_empty_imp)
   68.49 @@ -86,13 +86,13 @@
   68.50    by (blast dest: perm_sym)
   68.51  
   68.52  
   68.53 -subsection {* Removing elements *}
   68.54 +subsection \<open>Removing elements\<close>
   68.55  
   68.56  lemma perm_remove: "x \<in> set ys \<Longrightarrow> ys <~~> x # remove1 x ys"
   68.57    by (induct ys) auto
   68.58  
   68.59  
   68.60 -text {* \medskip Congruence rule *}
   68.61 +text \<open>\medskip Congruence rule\<close>
   68.62  
   68.63  lemma perm_remove_perm: "xs <~~> ys \<Longrightarrow> remove1 z xs <~~> remove1 z ys"
   68.64    by (induct pred: perm) auto
   68.65 @@ -116,7 +116,7 @@
   68.66    apply (safe intro!: perm_append2)
   68.67    apply (rule append_perm_imp_perm)
   68.68    apply (rule perm_append_swap [THEN perm.trans])
   68.69 -    -- {* the previous step helps this @{text blast} call succeed quickly *}
   68.70 +    -- \<open>the previous step helps this @{text blast} call succeed quickly\<close>
   68.71    apply (blast intro: perm_append_swap)
   68.72    done
   68.73  
   68.74 @@ -241,7 +241,7 @@
   68.75      assume "i < length xs"
   68.76      with bij have "f i < length ys"
   68.77        unfolding bij_betw_def by force
   68.78 -    with `i < length xs` show "xs ! i = zs ! (g \<circ> f) i"
   68.79 +    with \<open>i < length xs\<close> show "xs ! i = zs ! (g \<circ> f) i"
   68.80        using trans(1,3)[THEN perm_length] perm by auto
   68.81    qed
   68.82  qed
    69.1 --- a/src/HOL/Library/Permutations.thy	Wed Jun 17 10:57:11 2015 +0200
    69.2 +++ b/src/HOL/Library/Permutations.thy	Wed Jun 17 11:03:05 2015 +0200
    69.3 @@ -2,13 +2,13 @@
    69.4      Author:     Amine Chaieb, University of Cambridge
    69.5  *)
    69.6  
    69.7 -section {* Permutations, both general and specifically on finite sets.*}
    69.8 +section \<open>Permutations, both general and specifically on finite sets.\<close>
    69.9  
   69.10  theory Permutations
   69.11  imports Binomial
   69.12  begin
   69.13  
   69.14 -subsection {* Transpositions *}
   69.15 +subsection \<open>Transpositions\<close>
   69.16  
   69.17  lemma swap_id_idempotent [simp]:
   69.18    "Fun.swap a b id \<circ> Fun.swap a b id = id"
   69.19 @@ -23,7 +23,7 @@
   69.20    by (simp add: Fun.swap_def)
   69.21  
   69.22  
   69.23 -subsection {* Basic consequences of the definition *}
   69.24 +subsection \<open>Basic consequences of the definition\<close>
   69.25  
   69.26  definition permutes  (infixr "permutes" 41)
   69.27    where "(p permutes S) \<longleftrightarrow> (\<forall>x. x \<notin> S \<longrightarrow> p x = x) \<and> (\<forall>y. \<exists>!x. p x = y)"
   69.28 @@ -96,7 +96,7 @@
   69.29    by (simp add: Ball_def permutes_def) metis
   69.30  
   69.31  
   69.32 -subsection {* Group properties *}
   69.33 +subsection \<open>Group properties\<close>
   69.34  
   69.35  lemma permutes_id: "id permutes S"
   69.36    unfolding permutes_def by simp
   69.37 @@ -116,7 +116,7 @@
   69.38    by blast
   69.39  
   69.40  
   69.41 -subsection {* The number of permutations on a finite set *}
   69.42 +subsection \<open>The number of permutations on a finite set\<close>
   69.43  
   69.44  lemma permutes_insert_lemma:
   69.45    assumes pS: "p permutes (insert a S)"
   69.46 @@ -186,13 +186,13 @@
   69.47      from permutes_insert[of x F]
   69.48      have xfgpF': "?xF = ?g ` ?pF'" .
   69.49      have Fs: "card F = n - 1"
   69.50 -      using `x \<notin> F` H0 `finite F` by auto
   69.51 +      using \<open>x \<notin> F\<close> H0 \<open>finite F\<close> by auto
   69.52      from insert.hyps Fs have pFs: "card ?pF = fact (n - 1)"
   69.53 -      using `finite F` by auto
   69.54 +      using \<open>finite F\<close> by auto
   69.55      then have "finite ?pF"
   69.56        by (auto intro: card_ge_0_finite)
   69.57      then have pF'f: "finite ?pF'"
   69.58 -      using H0 `finite F`
   69.59 +      using H0 \<open>finite F\<close>
   69.60        apply (simp only: Collect_split Collect_mem_eq)
   69.61        apply (rule finite_cartesian_product)
   69.62        apply simp_all
   69.63 @@ -208,14 +208,14 @@
   69.64          from bp cq have ths: "b \<in> insert x F" "c \<in> insert x F" "x \<in> insert x F"
   69.65            "p permutes F" "q permutes F"
   69.66            by auto
   69.67 -        from ths(4) `x \<notin> F` eq have "b = ?g (b,p) x"
   69.68 +        from ths(4) \<open>x \<notin> F\<close> eq have "b = ?g (b,p) x"
   69.69            unfolding permutes_def
   69.70            by (auto simp add: Fun.swap_def fun_upd_def fun_eq_iff)
   69.71          also have "\<dots> = ?g (c,q) x"
   69.72 -          using ths(5) `x \<notin> F` eq
   69.73 +          using ths(5) \<open>x \<notin> F\<close> eq
   69.74            by (auto simp add: swap_def fun_upd_def fun_eq_iff)
   69.75          also have "\<dots> = c"
   69.76 -          using ths(5) `x \<notin> F`
   69.77 +          using ths(5) \<open>x \<notin> F\<close>
   69.78            unfolding permutes_def
   69.79            by (auto simp add: Fun.swap_def fun_upd_def fun_eq_iff)
   69.80          finally have bc: "b = c" .
   69.81 @@ -234,15 +234,15 @@
   69.82        then show ?thesis
   69.83          unfolding inj_on_def by blast
   69.84      qed
   69.85 -    from `x \<notin> F` H0 have n0: "n \<noteq> 0"
   69.86 -      using `finite F` by auto
   69.87 +    from \<open>x \<notin> F\<close> H0 have n0: "n \<noteq> 0"
   69.88 +      using \<open>finite F\<close> by auto
   69.89      then have "\<exists>m. n = Suc m"
   69.90        by presburger
   69.91      then obtain m where n[simp]: "n = Suc m"
   69.92        by blast
   69.93      from pFs H0 have xFc: "card ?xF = fact n"
   69.94        unfolding xfgpF' card_image[OF ginj]
   69.95 -      using `finite F` `finite ?pF`
   69.96 +      using \<open>finite F\<close> \<open>finite ?pF\<close>
   69.97        apply (simp only: Collect_split Collect_mem_eq card_cartesian_product)
   69.98        apply simp
   69.99        done
  69.100 @@ -262,26 +262,26 @@
  69.101    by (auto intro: card_ge_0_finite)
  69.102  
  69.103  
  69.104 -subsection {* Permutations of index set for iterated operations *}
  69.105 +subsection \<open>Permutations of index set for iterated operations\<close>
  69.106  
  69.107  lemma (in comm_monoid_set) permute:
  69.108    assumes "p permutes S"
  69.109    shows "F g S = F (g \<circ> p) S"
  69.110  proof -
  69.111 -  from `p permutes S` have "inj p"
  69.112 +  from \<open>p permutes S\<close> have "inj p"
  69.113      by (rule permutes_inj)
  69.114    then have "inj_on p S"
  69.115      by (auto intro: subset_inj_on)
  69.116    then have "F g (p ` S) = F (g \<circ> p) S"
  69.117      by (rule reindex)
  69.118 -  moreover from `p permutes S` have "p ` S = S"
  69.119 +  moreover from \<open>p permutes S\<close> have "p ` S = S"
  69.120      by (rule permutes_image)
  69.121    ultimately show ?thesis
  69.122      by simp
  69.123  qed
  69.124  
  69.125  
  69.126 -subsection {* Various combinations of transpositions with 2, 1 and 0 common elements *}
  69.127 +subsection \<open>Various combinations of transpositions with 2, 1 and 0 common elements\<close>
  69.128  
  69.129  lemma swap_id_common:" a \<noteq> c \<Longrightarrow> b \<noteq> c \<Longrightarrow>
  69.130    Fun.swap a b id \<circ> Fun.swap a c id = Fun.swap b c id \<circ> Fun.swap a b id"
  69.131 @@ -296,7 +296,7 @@
  69.132    by (simp add: fun_eq_iff Fun.swap_def)
  69.133  
  69.134  
  69.135 -subsection {* Permutations as transposition sequences *}
  69.136 +subsection \<open>Permutations as transposition sequences\<close>
  69.137  
  69.138  inductive swapidseq :: "nat \<Rightarrow> ('a \<Rightarrow> 'a) \<Rightarrow> bool"
  69.139  where
  69.140 @@ -308,7 +308,7 @@
  69.141  definition "permutation p \<longleftrightarrow> (\<exists>n. swapidseq n p)"
  69.142  
  69.143  
  69.144 -subsection {* Some closure properties of the set of permutations, with lengths *}
  69.145 +subsection \<open>Some closure properties of the set of permutations, with lengths\<close>
  69.146  
  69.147  lemma permutation_id[simp]: "permutation id"
  69.148    unfolding permutation_def by (rule exI[where x=0]) simp
  69.149 @@ -391,7 +391,7 @@
  69.150    using permutation_def swapidseq_inverse by blast
  69.151  
  69.152  
  69.153 -subsection {* The identity map only has even transposition sequences *}
  69.154 +subsection \<open>The identity map only has even transposition sequences\<close>
  69.155  
  69.156  lemma symmetry_lemma:
  69.157    assumes "\<And>a b c d. P a b c d \<Longrightarrow> P a b d c"
  69.158 @@ -519,7 +519,7 @@
  69.159  lemma swapidseq_identity_even:
  69.160    assumes "swapidseq n (id :: 'a \<Rightarrow> 'a)"
  69.161    shows "even n"
  69.162 -  using `swapidseq n id`
  69.163 +  using \<open>swapidseq n id\<close>
  69.164  proof (induct n rule: nat_less_induct)
  69.165    fix n
  69.166    assume H: "\<forall>m<n. swapidseq m (id::'a \<Rightarrow> 'a) \<longrightarrow> even m" "swapidseq n (id :: 'a \<Rightarrow> 'a)"
  69.167 @@ -544,7 +544,7 @@
  69.168  qed
  69.169  
  69.170  
  69.171 -subsection {* Therefore we have a welldefined notion of parity *}
  69.172 +subsection \<open>Therefore we have a welldefined notion of parity\<close>
  69.173  
  69.174  definition "evenperm p = even (SOME n. swapidseq n p)"
  69.175  
  69.176 @@ -573,7 +573,7 @@
  69.177    done
  69.178  
  69.179  
  69.180 -subsection {* And it has the expected composition properties *}
  69.181 +subsection \<open>And it has the expected composition properties\<close>
  69.182  
  69.183  lemma evenperm_id[simp]: "evenperm id = True"
  69.184    by (rule evenperm_unique[where n = 0]) simp_all
  69.185 @@ -608,7 +608,7 @@
  69.186  qed
  69.187  
  69.188  
  69.189 -subsection {* A more abstract characterization of permutations *}
  69.190 +subsection \<open>A more abstract characterization of permutations\<close>
  69.191  
  69.192  lemma bij_iff: "bij f \<longleftrightarrow> (\<forall>x. \<exists>!y. f y = x)"
  69.193    unfolding bij_def inj_on_def surj_def
  69.194 @@ -647,7 +647,7 @@
  69.195      let ?S = "insert a (insert b {x. p x \<noteq> x})"
  69.196      from comp_Suc.hyps(2) have fS: "finite ?S"
  69.197        by simp
  69.198 -    from `a \<noteq> b` have th: "{x. (Fun.swap a b id \<circ> p) x \<noteq> x} \<subseteq> ?S"
  69.199 +    from \<open>a \<noteq> b\<close> have th: "{x. (Fun.swap a b id \<circ> p) x \<noteq> x} \<subseteq> ?S"
  69.200        by (auto simp add: Fun.swap_def)
  69.201      from finite_subset[OF th fS] show ?case  .
  69.202    qed
  69.203 @@ -744,7 +744,7 @@
  69.204  qed
  69.205  
  69.206  
  69.207 -subsection {* Relation to "permutes" *}
  69.208 +subsection \<open>Relation to "permutes"\<close>
  69.209  
  69.210  lemma permutation_permutes: "permutation p \<longleftrightarrow> (\<exists>S. finite S \<and> p permutes S)"
  69.211    unfolding permutation permutes_def bij_iff[symmetric]
  69.212 @@ -757,7 +757,7 @@
  69.213    done
  69.214  
  69.215  
  69.216 -subsection {* Hence a sort of induction principle composing by swaps *}
  69.217 +subsection \<open>Hence a sort of induction principle composing by swaps\<close>
  69.218  
  69.219  lemma permutes_induct: "finite S \<Longrightarrow> P id \<Longrightarrow>
  69.220    (\<And> a b p. a \<in> S \<Longrightarrow> b \<in> S \<Longrightarrow> P p \<Longrightarrow> P p \<Longrightarrow> permutation p \<Longrightarrow> P (Fun.swap a b id \<circ> p)) \<Longrightarrow>
  69.221 @@ -788,7 +788,7 @@
  69.222  qed
  69.223  
  69.224  
  69.225 -subsection {* Sign of a permutation as a real number *}
  69.226 +subsection \<open>Sign of a permutation as a real number\<close>
  69.227  
  69.228  definition "sign p = (if evenperm p then (1::int) else -1)"
  69.229  
  69.230 @@ -811,7 +811,7 @@
  69.231    by (simp add: sign_def)
  69.232  
  69.233  
  69.234 -subsection {* More lemmas about permutations *}
  69.235 +subsection \<open>More lemmas about permutations\<close>
  69.236  
  69.237  lemma permutes_natset_le:
  69.238    fixes S :: "'a::wellorder set"
  69.239 @@ -995,7 +995,7 @@
  69.240  qed
  69.241  
  69.242  
  69.243 -subsection {* Sum over a set of permutations (could generalize to iteration) *}
  69.244 +subsection \<open>Sum over a set of permutations (could generalize to iteration)\<close>
  69.245  
  69.246  lemma setsum_over_permutations_insert:
  69.247    assumes fS: "finite S"
    70.1 --- a/src/HOL/Library/Phantom_Type.thy	Wed Jun 17 10:57:11 2015 +0200
    70.2 +++ b/src/HOL/Library/Phantom_Type.thy	Wed Jun 17 11:03:05 2015 +0200
    70.3 @@ -2,7 +2,7 @@
    70.4      Author:     Andreas Lochbihler
    70.5  *)
    70.6  
    70.7 -section {* A generic phantom type *}
    70.8 +section \<open>A generic phantom type\<close>
    70.9  
   70.10  theory Phantom_Type
   70.11  imports Main
   70.12 @@ -21,14 +21,14 @@
   70.13  translations
   70.14    "Phantom('t)" => "CONST phantom :: _ \<Rightarrow> ('t, _) phantom"
   70.15  
   70.16 -typed_print_translation {*
   70.17 +typed_print_translation \<open>
   70.18    let
   70.19      fun phantom_tr' ctxt (Type (@{type_name fun}, [_, Type (@{type_name phantom}, [T, _])])) ts =
   70.20            list_comb
   70.21              (Syntax.const @{syntax_const "_Phantom"} $ Syntax_Phases.term_of_typ ctxt T, ts)
   70.22        | phantom_tr' _ _ _ = raise Match;
   70.23    in [(@{const_syntax phantom}, phantom_tr')] end
   70.24 -*}
   70.25 +\<close>
   70.26  
   70.27  lemma of_phantom_inject [simp]:
   70.28    "of_phantom x = of_phantom y \<longleftrightarrow> x = y"
    71.1 --- a/src/HOL/Library/Poly_Deriv.thy	Wed Jun 17 10:57:11 2015 +0200
    71.2 +++ b/src/HOL/Library/Poly_Deriv.thy	Wed Jun 17 11:03:05 2015 +0200
    71.3 @@ -3,13 +3,13 @@
    71.4      Author:     Brian Huffman
    71.5  *)
    71.6  
    71.7 -section{* Polynomials and Differentiation *}
    71.8 +section\<open>Polynomials and Differentiation\<close>
    71.9  
   71.10  theory Poly_Deriv
   71.11  imports Deriv Polynomial
   71.12  begin
   71.13  
   71.14 -subsection {* Derivatives of univariate polynomials *}
   71.15 +subsection \<open>Derivatives of univariate polynomials\<close>
   71.16  
   71.17  function pderiv :: "'a::real_normed_field poly \<Rightarrow> 'a poly"
   71.18  where
   71.19 @@ -95,7 +95,7 @@
   71.20  lemma poly_DERIV[simp]: "DERIV (%x. poly p x) x :> poly (pderiv p) x"
   71.21    by (induct p, auto intro!: derivative_eq_intros simp add: pderiv_pCons)
   71.22  
   71.23 -text{* Consequences of the derivative theorem above*}
   71.24 +text\<open>Consequences of the derivative theorem above\<close>
   71.25  
   71.26  lemma poly_differentiable[simp]: "(%x. poly p x) differentiable (at x::real filter)"
   71.27  apply (simp add: real_differentiable_def)
   71.28 @@ -122,7 +122,7 @@
   71.29  apply (auto simp add: mult_left_cancel poly_DERIV [THEN DERIV_unique])
   71.30  done
   71.31  
   71.32 -text{*Lemmas for Derivatives*}
   71.33 +text\<open>Lemmas for Derivatives\<close>
   71.34  
   71.35  lemma order_unique_lemma:
   71.36    fixes p :: "'a::idom poly"
   71.37 @@ -178,7 +178,7 @@
   71.38       by (metis * nd dvd_mult_cancel_right field_power_not_zero pCons_eq_0_iff power_Suc zero_neq_one)
   71.39    qed
   71.40    then show ?thesis
   71.41 -    by (metis `n = Suc n'` pe)
   71.42 +    by (metis \<open>n = Suc n'\<close> pe)
   71.43  qed
   71.44  
   71.45  lemma order_decomp:
   71.46 @@ -215,7 +215,7 @@
   71.47      done
   71.48  qed
   71.49  
   71.50 -text{*Now justify the standard squarefree decomposition, i.e. f / gcd(f,f'). *}
   71.51 +text\<open>Now justify the standard squarefree decomposition, i.e. f / gcd(f,f').\<close>
   71.52  
   71.53  lemma order_divides: "[:-a, 1:] ^ n dvd p \<longleftrightarrow> p = 0 \<or> n \<le> order a p"
   71.54  apply (cases "p = 0", auto)
   71.55 @@ -232,31 +232,31 @@
   71.56    shows "order a q = (if order a p = 0 then 0 else 1)"
   71.57  proof (rule classical)
   71.58    assume 1: "order a q \<noteq> (if order a p = 0 then 0 else 1)"
   71.59 -  from `pderiv p \<noteq> 0` have "p \<noteq> 0" by auto
   71.60 +  from \<open>pderiv p \<noteq> 0\<close> have "p \<noteq> 0" by auto
   71.61    with p have "order a p = order a q + order a d"
   71.62      by (simp add: order_mult)
   71.63    with 1 have "order a p \<noteq> 0" by (auto split: if_splits)
   71.64    have "order a (pderiv p) = order a e + order a d"
   71.65 -    using `pderiv p \<noteq> 0` `pderiv p = e * d` by (simp add: order_mult)
   71.66 +    using \<open>pderiv p \<noteq> 0\<close> \<open>pderiv p = e * d\<close> by (simp add: order_mult)
   71.67    have "order a p = Suc (order a (pderiv p))"
   71.68 -    using `pderiv p \<noteq> 0` `order a p \<noteq> 0` by (rule order_pderiv)
   71.69 -  have "d \<noteq> 0" using `p \<noteq> 0` `p = q * d` by simp
   71.70 +    using \<open>pderiv p \<noteq> 0\<close> \<open>order a p \<noteq> 0\<close> by (rule order_pderiv)
   71.71 +  have "d \<noteq> 0" using \<open>p \<noteq> 0\<close> \<open>p = q * d\<close> by simp
   71.72    have "([:-a, 1:] ^ (order a (pderiv p))) dvd d"
   71.73      apply (simp add: d)
   71.74      apply (rule dvd_add)
   71.75      apply (rule dvd_mult)
   71.76 -    apply (simp add: order_divides `p \<noteq> 0`
   71.77 -           `order a p = Suc (order a (pderiv p))`)
   71.78 +    apply (simp add: order_divides \<open>p \<noteq> 0\<close>
   71.79 +           \<open>order a p = Suc (order a (pderiv p))\<close>)
   71.80      apply (rule dvd_mult)
   71.81      apply (simp add: order_divides)
   71.82      done
   71.83    then have "order a (pderiv p) \<le> order a d"
   71.84 -    using `d \<noteq> 0` by (simp add: order_divides)
   71.85 +    using \<open>d \<noteq> 0\<close> by (simp add: order_divides)
   71.86    show ?thesis
   71.87 -    using `order a p = order a q + order a d`
   71.88 -    using `order a (pderiv p) = order a e + order a d`
   71.89 -    using `order a p = Suc (order a (pderiv p))`
   71.90 -    using `order a (pderiv p) \<le> order a d`
   71.91 +    using \<open>order a p = order a q + order a d\<close>
   71.92 +    using \<open>order a (pderiv p) = order a e + order a d\<close>
   71.93 +    using \<open>order a p = Suc (order a (pderiv p))\<close>
   71.94 +    using \<open>order a (pderiv p) \<le> order a d\<close>
   71.95      by auto
   71.96  qed
   71.97  
   71.98 @@ -298,11 +298,11 @@
   71.99      and "d = r * p + s * pderiv p"
  71.100    shows "rsquarefree q & (\<forall>a. (poly q a = 0) = (poly p a = 0))"
  71.101  proof -
  71.102 -  from `pderiv p \<noteq> 0` have "p \<noteq> 0" by auto
  71.103 -  with `p = q * d` have "q \<noteq> 0" by simp
  71.104 +  from \<open>pderiv p \<noteq> 0\<close> have "p \<noteq> 0" by auto
  71.105 +  with \<open>p = q * d\<close> have "q \<noteq> 0" by simp
  71.106    have "\<forall>a. order a q = (if order a p = 0 then 0 else 1)"
  71.107      using assms by (rule poly_squarefree_decomp_order2)
  71.108 -  with `p \<noteq> 0` `q \<noteq> 0` show ?thesis
  71.109 +  with \<open>p \<noteq> 0\<close> \<open>q \<noteq> 0\<close> show ?thesis
  71.110      by (simp add: rsquarefree_def order_root)
  71.111  qed
  71.112  
    72.1 --- a/src/HOL/Library/Polynomial.thy	Wed Jun 17 10:57:11 2015 +0200
    72.2 +++ b/src/HOL/Library/Polynomial.thy	Wed Jun 17 11:03:05 2015 +0200
    72.3 @@ -4,13 +4,13 @@
    72.4      Author:     Florian Haftmann
    72.5  *)
    72.6  
    72.7 -section {* Polynomials as type over a ring structure *}
    72.8 +section \<open>Polynomials as type over a ring structure\<close>
    72.9  
   72.10  theory Polynomial
   72.11  imports Main GCD "~~/src/HOL/Library/More_List" "~~/src/HOL/Library/Infinite_Set"
   72.12  begin
   72.13  
   72.14 -subsection {* Auxiliary: operations for lists (later) representing coefficients *}
   72.15 +subsection \<open>Auxiliary: operations for lists (later) representing coefficients\<close>
   72.16  
   72.17  definition cCons :: "'a::zero \<Rightarrow> 'a list \<Rightarrow> 'a list"  (infixr "##" 65)
   72.18  where
   72.19 @@ -50,7 +50,7 @@
   72.20    "tl (x ## xs) = xs"
   72.21    by (simp add: cCons_def)
   72.22  
   72.23 -subsection {* Definition of type @{text poly} *}
   72.24 +subsection \<open>Definition of type @{text poly}\<close>
   72.25  
   72.26  typedef 'a poly = "{f :: nat \<Rightarrow> 'a::zero. \<forall>\<^sub>\<infinity> n. f n = 0}"
   72.27    morphisms coeff Abs_poly by (auto intro!: ALL_MOST)
   72.28 @@ -67,7 +67,7 @@
   72.29    using coeff [of p] by simp
   72.30  
   72.31  
   72.32 -subsection {* Degree of a polynomial *}
   72.33 +subsection \<open>Degree of a polynomial\<close>
   72.34  
   72.35  definition degree :: "'a::zero poly \<Rightarrow> nat"
   72.36  where
   72.37 @@ -94,7 +94,7 @@
   72.38    unfolding degree_def by (drule not_less_Least, simp)
   72.39  
   72.40  
   72.41 -subsection {* The zero polynomial *}
   72.42 +subsection \<open>The zero polynomial\<close>
   72.43  
   72.44  instantiation poly :: (zero) zero
   72.45  begin
   72.46 @@ -119,21 +119,21 @@
   72.47    shows "coeff p (degree p) \<noteq> 0"
   72.48  proof (cases "degree p")
   72.49    case 0
   72.50 -  from `p \<noteq> 0` have "\<exists>n. coeff p n \<noteq> 0"
   72.51 +  from \<open>p \<noteq> 0\<close> have "\<exists>n. coeff p n \<noteq> 0"
   72.52      by (simp add: poly_eq_iff)
   72.53    then obtain n where "coeff p n \<noteq> 0" ..
   72.54    hence "n \<le> degree p" by (rule le_degree)
   72.55 -  with `coeff p n \<noteq> 0` and `degree p = 0`
   72.56 +  with \<open>coeff p n \<noteq> 0\<close> and \<open>degree p = 0\<close>
   72.57    show "coeff p (degree p) \<noteq> 0" by simp
   72.58  next
   72.59    case (Suc n)
   72.60 -  from `degree p = Suc n` have "n < degree p" by simp
   72.61 +  from \<open>degree p = Suc n\<close> have "n < degree p" by simp
   72.62    hence "\<exists>i>n. coeff p i \<noteq> 0" by (rule less_degree_imp)
   72.63    then obtain i where "n < i" and "coeff p i \<noteq> 0" by fast
   72.64 -  from `degree p = Suc n` and `n < i` have "degree p \<le> i" by simp
   72.65 -  also from `coeff p i \<noteq> 0` have "i \<le> degree p" by (rule le_degree)
   72.66 +  from \<open>degree p = Suc n\<close> and \<open>n < i\<close> have "degree p \<le> i" by simp
   72.67 +  also from \<open>coeff p i \<noteq> 0\<close> have "i \<le> degree p" by (rule le_degree)
   72.68    finally have "degree p = i" .
   72.69 -  with `coeff p i \<noteq> 0` show "coeff p (degree p) \<noteq> 0" by simp
   72.70 +  with \<open>coeff p i \<noteq> 0\<close> show "coeff p (degree p) \<noteq> 0" by simp
   72.71  qed
   72.72  
   72.73  lemma leading_coeff_0_iff [simp]:
   72.74 @@ -141,7 +141,7 @@
   72.75    by (cases "p = 0", simp, simp add: leading_coeff_neq_0)
   72.76  
   72.77  
   72.78 -subsection {* List-style constructor for polynomials *}
   72.79 +subsection \<open>List-style constructor for polynomials\<close>
   72.80  
   72.81  lift_definition pCons :: "'a::zero \<Rightarrow> 'a poly \<Rightarrow> 'a poly"
   72.82    is "\<lambda>a p. case_nat a (coeff p)"
   72.83 @@ -228,24 +228,24 @@
   72.84      then have "degree (pCons a q) = Suc (degree q)"
   72.85        by (rule degree_pCons_eq)
   72.86      then have "degree q < degree p"
   72.87 -      using `p = pCons a q` by simp
   72.88 +      using \<open>p = pCons a q\<close> by simp
   72.89      then show "P q"
   72.90        by (rule less.hyps)
   72.91    qed
   72.92    have "P (pCons a q)"
   72.93    proof (cases "a \<noteq> 0 \<or> q \<noteq> 0")
   72.94      case True
   72.95 -    with `P q` show ?thesis by (auto intro: pCons)
   72.96 +    with \<open>P q\<close> show ?thesis by (auto intro: pCons)
   72.97    next
   72.98      case False
   72.99      with zero show ?thesis by simp
  72.100    qed
  72.101    then show ?case
  72.102 -    using `p = pCons a q` by simp
  72.103 +    using \<open>p = pCons a q\<close> by simp
  72.104  qed
  72.105  
  72.106  
  72.107 -subsection {* List-style syntax for polynomials *}
  72.108 +subsection \<open>List-style syntax for polynomials\<close>
  72.109  
  72.110  syntax
  72.111    "_poly" :: "args \<Rightarrow> 'a poly"  ("[:(_):]")
  72.112 @@ -256,7 +256,7 @@
  72.113    "[:x:]" <= "CONST pCons x (_constrain 0 t)"
  72.114  
  72.115  
  72.116 -subsection {* Representation of polynomials by lists of coefficients *}
  72.117 +subsection \<open>Representation of polynomials by lists of coefficients\<close>
  72.118  
  72.119  primrec Poly :: "'a::zero list \<Rightarrow> 'a poly"
  72.120  where
  72.121 @@ -399,7 +399,7 @@
  72.122    by (simp add: is_zero_def null_def)
  72.123  
  72.124  
  72.125 -subsection {* Fold combinator for polynomials *}
  72.126 +subsection \<open>Fold combinator for polynomials\<close>
  72.127  
  72.128  definition fold_coeffs :: "('a::zero \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'a poly \<Rightarrow> 'b \<Rightarrow> 'b"
  72.129  where
  72.130 @@ -426,11 +426,11 @@
  72.131    by (simp add: fold_coeffs_def)
  72.132  
  72.133  
  72.134 -subsection {* Canonical morphism on polynomials -- evaluation *}
  72.135 +subsection \<open>Canonical morphism on polynomials -- evaluation\<close>
  72.136  
  72.137  definition poly :: "'a::comm_semiring_0 poly \<Rightarrow> 'a \<Rightarrow> 'a"
  72.138  where
  72.139 -  "poly p = fold_coeffs (\<lambda>a f x. a + x * f x) p (\<lambda>x. 0)" -- {* The Horner Schema *}
  72.140 +  "poly p = fold_coeffs (\<lambda>a f x. a + x * f x) p (\<lambda>x. 0)" -- \<open>The Horner Schema\<close>
  72.141  
  72.142  lemma poly_0 [simp]:
  72.143    "poly 0 x = 0"
  72.144 @@ -441,7 +441,7 @@
  72.145    by (cases "p = 0 \<and> a = 0") (auto simp add: poly_def)
  72.146  
  72.147  
  72.148 -subsection {* Monomials *}
  72.149 +subsection \<open>Monomials\<close>
  72.150  
  72.151  lift_definition monom :: "'a \<Rightarrow> nat \<Rightarrow> 'a::zero poly"
  72.152    is "\<lambda>a m n. if m = n then a else 0"
  72.153 @@ -491,7 +491,7 @@
  72.154      (induct n, simp_all add: mult.left_commute poly_def)
  72.155  
  72.156  
  72.157 -subsection {* Addition and subtraction *}
  72.158 +subsection \<open>Addition and subtraction\<close>
  72.159  
  72.160  instantiation poly :: (comm_monoid_add) comm_monoid_add
  72.161  begin
  72.162 @@ -700,7 +700,7 @@
  72.163    by (induct A rule: infinite_finite_induct) simp_all
  72.164  
  72.165  
  72.166 -subsection {* Multiplication by a constant, polynomial multiplication and the unit polynomial *}
  72.167 +subsection \<open>Multiplication by a constant, polynomial multiplication and the unit polynomial\<close>
  72.168  
  72.169  lift_definition smult :: "'a::comm_semiring_0 \<Rightarrow> 'a poly \<Rightarrow> 'a poly"
  72.170    is "\<lambda>a p n. a * coeff p n"
  72.171 @@ -908,7 +908,7 @@
  72.172    by (induct n) simp_all
  72.173  
  72.174  
  72.175 -subsection {* Lemmas about divisibility *}
  72.176 +subsection \<open>Lemmas about divisibility\<close>
  72.177  
  72.178  lemma dvd_smult: "p dvd q \<Longrightarrow> p dvd smult a q"
  72.179  proof -
  72.180 @@ -948,7 +948,7 @@
  72.181    by (auto elim: smult_dvd smult_dvd_cancel)
  72.182  
  72.183  
  72.184 -subsection {* Polynomials form an integral domain *}
  72.185 +subsection \<open>Polynomials form an integral domain\<close>
  72.186  
  72.187  lemma coeff_mult_degree_sum:
  72.188    "coeff (p * q) (degree p + degree q) =
  72.189 @@ -963,7 +963,7 @@
  72.190          coeff p (degree p) * coeff q (degree q)"
  72.191      by (rule coeff_mult_degree_sum)
  72.192    also have "coeff p (degree p) * coeff q (degree q) \<noteq> 0"
  72.193 -    using `p \<noteq> 0` and `q \<noteq> 0` by simp
  72.194 +    using \<open>p \<noteq> 0\<close> and \<open>q \<noteq> 0\<close> by simp
  72.195    finally have "\<exists>n. coeff (p * q) n \<noteq> 0" ..
  72.196    thus "p * q \<noteq> 0" by (simp add: poly_eq_iff)
  72.197  qed
  72.198 @@ -981,7 +981,7 @@
  72.199    by (erule dvdE, simp add: degree_mult_eq)
  72.200  
  72.201  
  72.202 -subsection {* Polynomials form an ordered integral domain *}
  72.203 +subsection \<open>Polynomials form an ordered integral domain\<close>
  72.204  
  72.205  definition pos_poly :: "'a::linordered_idom poly \<Rightarrow> bool"
  72.206  where
  72.207 @@ -1097,14 +1097,14 @@
  72.208  
  72.209  end
  72.210  
  72.211 -text {* TODO: Simplification rules for comparisons *}
  72.212 +text \<open>TODO: Simplification rules for comparisons\<close>
  72.213  
  72.214  
  72.215 -subsection {* Synthetic division and polynomial roots *}
  72.216 +subsection \<open>Synthetic division and polynomial roots\<close>
  72.217  
  72.218 -text {*
  72.219 +text \<open>
  72.220    Synthetic division is simply division by the linear polynomial @{term "x - c"}.
  72.221 -*}
  72.222 +\<close>
  72.223  
  72.224  definition synthetic_divmod :: "'a::comm_semiring_0 poly \<Rightarrow> 'a \<Rightarrow> 'a poly \<times> 'a"
  72.225  where
  72.226 @@ -1201,11 +1201,11 @@
  72.227      then obtain a where "poly p a = 0" ..
  72.228      then have "[:-a, 1:] dvd p" by (simp only: poly_eq_0_iff_dvd)
  72.229      then obtain k where k: "p = [:-a, 1:] * k" ..
  72.230 -    with `p \<noteq> 0` have "k \<noteq> 0" by auto
  72.231 +    with \<open>p \<noteq> 0\<close> have "k \<noteq> 0" by auto
  72.232      with k have "degree p = Suc (degree k)"
  72.233        by (simp add: degree_mult_eq del: mult_pCons_left)
  72.234 -    with `Suc n = degree p` have "n = degree k" by simp
  72.235 -    then have "finite {x. poly k x = 0}" using `k \<noteq> 0` by (rule Suc.hyps)
  72.236 +    with \<open>Suc n = degree p\<close> have "n = degree k" by simp
  72.237 +    then have "finite {x. poly k x = 0}" using \<open>k \<noteq> 0\<close> by (rule Suc.hyps)
  72.238      then have "finite (insert a {x. poly k x = 0})" by simp
  72.239      then show "finite {x. poly p x = 0}"
  72.240        by (simp add: k Collect_disj_eq del: mult_pCons_left)
  72.241 @@ -1235,7 +1235,7 @@
  72.242    by (auto simp add: poly_eq_poly_eq_iff [symmetric])
  72.243  
  72.244  
  72.245 -subsection {* Long division of polynomials *}
  72.246 +subsection \<open>Long division of polynomials\<close>
  72.247  
  72.248  definition pdivmod_rel :: "'a::field poly \<Rightarrow> 'a poly \<Rightarrow> 'a poly \<Rightarrow> 'a poly \<Rightarrow> bool"
  72.249  where
  72.250 @@ -1255,22 +1255,22 @@
  72.251    shows "p = 0 \<or> degree p < n"
  72.252  proof (cases n)
  72.253    case 0
  72.254 -  with `degree p \<le> n` and `coeff p n = 0`
  72.255 +  with \<open>degree p \<le> n\<close> and \<open>coeff p n = 0\<close>
  72.256    have "coeff p (degree p) = 0" by simp
  72.257    then have "p = 0" by simp
  72.258    then show ?thesis ..
  72.259  next
  72.260    case (Suc m)
  72.261    have "\<forall>i>n. coeff p i = 0"
  72.262 -    using `degree p \<le> n` by (simp add: coeff_eq_0)
  72.263 +    using \<open>degree p \<le> n\<close> by (simp add: coeff_eq_0)
  72.264    then have "\<forall>i\<ge>n. coeff p i = 0"
  72.265 -    using `coeff p n = 0` by (simp add: le_less)
  72.266 +    using \<open>coeff p n = 0\<close> by (simp add: le_less)
  72.267    then have "\<forall>i>m. coeff p i = 0"
  72.268 -    using `n = Suc m` by (simp add: less_eq_Suc_le)
  72.269 +    using \<open>n = Suc m\<close> by (simp add: less_eq_Suc_le)
  72.270    then have "degree p \<le> m"
  72.271      by (rule degree_le)
  72.272    then have "degree p < n"
  72.273 -    using `n = Suc m` by (simp add: less_Suc_eq_le)
  72.274 +    using \<open>n = Suc m\<close> by (simp add: less_Suc_eq_le)
  72.275    then show ?thesis ..
  72.276  qed
  72.277  
  72.278 @@ -1298,12 +1298,12 @@
  72.279      qed
  72.280    next
  72.281      show "coeff ?r (degree y) = 0"
  72.282 -      using `y \<noteq> 0` unfolding b by simp
  72.283 +      using \<open>y \<noteq> 0\<close> unfolding b by simp
  72.284    qed
  72.285  
  72.286    from 1 2 show ?thesis
  72.287      unfolding pdivmod_rel_def
  72.288 -    using `y \<noteq> 0` by simp
  72.289 +    using \<open>y \<noteq> 0\<close> by simp
  72.290  qed
  72.291  
  72.292  lemma pdivmod_rel_exists: "\<exists>q r. pdivmod_rel x y q r"
  72.293 @@ -1339,7 +1339,7 @@
  72.294      with r3 have "degree (r2 - r1) < degree y" by simp
  72.295      also have "degree y \<le> degree (q1 - q2) + degree y" by simp
  72.296      also have "\<dots> = degree ((q1 - q2) * y)"
  72.297 -      using `q1 \<noteq> q2` by (simp add: degree_mult_eq)
  72.298 +      using \<open>q1 \<noteq> q2\<close> by (simp add: degree_mult_eq)
  72.299      also have "\<dots> = degree (r2 - r1)"
  72.300        using q3 by simp
  72.301      finally have "degree (r2 - r1) < degree (r2 - r1)" .
  72.302 @@ -1426,7 +1426,7 @@
  72.303      case False then show ?thesis by auto
  72.304    next
  72.305      case True then have "y \<noteq> 0" and "z \<noteq> 0" by auto
  72.306 -    with `x \<noteq> 0`
  72.307 +    with \<open>x \<noteq> 0\<close>
  72.308      have "\<And>q r. pdivmod_rel y z q r \<Longrightarrow> pdivmod_rel (x * y) (x * z) q (x * r)"
  72.309        by (auto simp add: pdivmod_rel_def algebra_simps)
  72.310          (rule classical, simp add: degree_mult_eq)
  72.311 @@ -1611,7 +1611,7 @@
  72.312    done
  72.313  
  72.314  
  72.315 -subsection {* Order of polynomial roots *}
  72.316 +subsection \<open>Order of polynomial roots\<close>
  72.317  
  72.318  definition order :: "'a::idom \<Rightarrow> 'a poly \<Rightarrow> nat"
  72.319  where
  72.320 @@ -1674,7 +1674,7 @@
  72.321  done
  72.322  
  72.323  
  72.324 -subsection {* GCD of polynomials *}
  72.325 +subsection \<open>GCD of polynomials\<close>
  72.326  
  72.327  instantiation poly :: (field) gcd
  72.328  begin
  72.329 @@ -1745,12 +1745,12 @@
  72.330  next
  72.331    case False with coeff have "q \<noteq> 0" by auto
  72.332    have degree: "degree p = degree q"
  72.333 -    using `p dvd q` `q dvd p` `p \<noteq> 0` `q \<noteq> 0`
  72.334 +    using \<open>p dvd q\<close> \<open>q dvd p\<close> \<open>p \<noteq> 0\<close> \<open>q \<noteq> 0\<close>
  72.335      by (intro order_antisym dvd_imp_degree_le)
  72.336  
  72.337 -  from `p dvd q` obtain a where a: "q = p * a" ..
  72.338 -  with `q \<noteq> 0` have "a \<noteq> 0" by auto
  72.339 -  with degree a `p \<noteq> 0` have "degree a = 0"
  72.340 +  from \<open>p dvd q\<close> obtain a where a: "q = p * a" ..
  72.341 +  with \<open>q \<noteq> 0\<close> have "a \<noteq> 0" by auto
  72.342 +  with degree a \<open>p \<noteq> 0\<close> have "degree a = 0"
  72.343      by (simp add: degree_mult_eq)
  72.344    with coeff a show "p = q"
  72.345      by (cases a, auto split: if_splits)
  72.346 @@ -1805,7 +1805,7 @@
  72.347    by (simp add: gcd_poly.simps)
  72.348  
  72.349  
  72.350 -subsection {* Composition of polynomials *}
  72.351 +subsection \<open>Composition of polynomials\<close>
  72.352  
  72.353  definition pcompose :: "'a::comm_semiring_0 poly \<Rightarrow> 'a poly \<Rightarrow> 'a poly"
  72.354  where
    73.1 --- a/src/HOL/Library/Predicate_Compile_Alternative_Defs.thy	Wed Jun 17 10:57:11 2015 +0200
    73.2 +++ b/src/HOL/Library/Predicate_Compile_Alternative_Defs.thy	Wed Jun 17 11:03:05 2015 +0200
    73.3 @@ -2,7 +2,7 @@
    73.4  imports Main
    73.5  begin
    73.6  
    73.7 -section {* Common constants *}
    73.8 +section \<open>Common constants\<close>
    73.9  
   73.10  declare HOL.if_bool_eq_disj[code_pred_inline]
   73.11  
   73.12 @@ -18,23 +18,23 @@
   73.13    "((A::bool) ~= (B::bool)) = ((A & ~ B) | (B & ~ A))"
   73.14  by fast
   73.15  
   73.16 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name Let}] *}
   73.17 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name Let}]\<close>
   73.18  
   73.19 -section {* Pairs *}
   73.20 +section \<open>Pairs\<close>
   73.21  
   73.22 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name fst}, @{const_name snd}, @{const_name case_prod}] *}
   73.23 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name fst}, @{const_name snd}, @{const_name case_prod}]\<close>
   73.24  
   73.25 -section {* Filters *}
   73.26 +section \<open>Filters\<close>
   73.27  
   73.28  (*TODO: shouldn't this be done by typedef? *)
   73.29 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name Abs_filter}, @{const_name Rep_filter}] *}
   73.30 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name Abs_filter}, @{const_name Rep_filter}]\<close>
   73.31  
   73.32 -section {* Bounded quantifiers *}
   73.33 +section \<open>Bounded quantifiers\<close>
   73.34  
   73.35  declare Ball_def[code_pred_inline]
   73.36  declare Bex_def[code_pred_inline]
   73.37  
   73.38 -section {* Operations on Predicates *}
   73.39 +section \<open>Operations on Predicates\<close>
   73.40  
   73.41  lemma Diff[code_pred_inline]:
   73.42    "(A - B) = (%x. A x \<and> \<not> B x)"
   73.43 @@ -48,16 +48,16 @@
   73.44    "A = B \<longleftrightarrow> (\<forall>x. A x \<longrightarrow> B x) \<and> (\<forall>x. B x \<longrightarrow> A x)"
   73.45    by (auto simp add: fun_eq_iff)
   73.46  
   73.47 -section {* Setup for Numerals *}
   73.48 +section \<open>Setup for Numerals\<close>
   73.49  
   73.50 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name numeral}] *}
   73.51 -setup {* Predicate_Compile_Data.keep_functions [@{const_name numeral}] *}
   73.52 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name numeral}]\<close>
   73.53 +setup \<open>Predicate_Compile_Data.keep_functions [@{const_name numeral}]\<close>
   73.54  
   73.55 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name divide}, @{const_name mod}, @{const_name times}] *}
   73.56 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name divide}, @{const_name mod}, @{const_name times}]\<close>
   73.57  
   73.58 -section {* Arithmetic operations *}
   73.59 +section \<open>Arithmetic operations\<close>
   73.60  
   73.61 -subsection {* Arithmetic on naturals and integers *}
   73.62 +subsection \<open>Arithmetic on naturals and integers\<close>
   73.63  
   73.64  definition plus_eq_nat :: "nat => nat => nat => bool"
   73.65  where
   73.66 @@ -79,7 +79,7 @@
   73.67  where
   73.68    [code_unfold]: "subtract x y = y - x"
   73.69  
   73.70 -setup {*
   73.71 +setup \<open>
   73.72  let
   73.73    val Fun = Predicate_Compile_Aux.Fun
   73.74    val Input = Predicate_Compile_Aux.Input
   73.75 @@ -141,9 +141,9 @@
   73.76    #> Predicate_Compile_Fun.add_function_predicate_translation
   73.77        (@{term "minus :: int => int => int"}, @{term "minus_eq_int"})
   73.78  end
   73.79 -*}
   73.80 +\<close>
   73.81  
   73.82 -subsection {* Inductive definitions for ordering on naturals *}
   73.83 +subsection \<open>Inductive definitions for ordering on naturals\<close>
   73.84  
   73.85  inductive less_nat
   73.86  where
   73.87 @@ -175,9 +175,9 @@
   73.88  apply (induct rule: less_eq_nat.induct)
   73.89  apply auto done
   73.90  
   73.91 -section {* Alternative list definitions *}
   73.92 +section \<open>Alternative list definitions\<close>
   73.93  
   73.94 -subsection {* Alternative rules for @{text length} *}
   73.95 +subsection \<open>Alternative rules for @{text length}\<close>
   73.96  
   73.97  definition size_list' :: "'a list => nat"
   73.98  where "size_list' = size"
   73.99 @@ -191,7 +191,7 @@
  73.100  declare size_list'_def[symmetric, code_pred_inline]
  73.101  
  73.102  
  73.103 -subsection {* Alternative rules for @{text list_all2} *}
  73.104 +subsection \<open>Alternative rules for @{text list_all2}\<close>
  73.105  
  73.106  lemma list_all2_NilI [code_pred_intro]: "list_all2 P [] []"
  73.107  by auto
  73.108 @@ -212,11 +212,11 @@
  73.109      done
  73.110  qed
  73.111  
  73.112 -section {* Setup for String.literal *}
  73.113 +section \<open>Setup for String.literal\<close>
  73.114  
  73.115 -setup {* Predicate_Compile_Data.ignore_consts [@{const_name "STR"}] *}
  73.116 +setup \<open>Predicate_Compile_Data.ignore_consts [@{const_name "STR"}]\<close>
  73.117  
  73.118 -section {* Simplification rules for optimisation *}
  73.119 +section \<open>Simplification rules for optimisation\<close>
  73.120  
  73.121  lemma [code_pred_simp]: "\<not> False == True"
  73.122  by auto
    74.1 --- a/src/HOL/Library/Predicate_Compile_Quickcheck.thy	Wed Jun 17 10:57:11 2015 +0200
    74.2 +++ b/src/HOL/Library/Predicate_Compile_Quickcheck.thy	Wed Jun 17 11:03:05 2015 +0200
    74.3 @@ -1,6 +1,6 @@
    74.4  (* Author: Lukas Bulwahn, TU Muenchen *)
    74.5  
    74.6 -section {* A Prototype of Quickcheck based on the Predicate Compiler *}
    74.7 +section \<open>A Prototype of Quickcheck based on the Predicate Compiler\<close>
    74.8  
    74.9  theory Predicate_Compile_Quickcheck
   74.10  imports Main Predicate_Compile_Alternative_Defs
    75.1 --- a/src/HOL/Library/Prefix_Order.thy	Wed Jun 17 10:57:11 2015 +0200
    75.2 +++ b/src/HOL/Library/Prefix_Order.thy	Wed Jun 17 11:03:05 2015 +0200
    75.3 @@ -2,7 +2,7 @@
    75.4      Author:     Tobias Nipkow and Markus Wenzel, TU Muenchen
    75.5  *)
    75.6  
    75.7 -section {* Prefix order on lists as order class instance *}
    75.8 +section \<open>Prefix order on lists as order class instance\<close>
    75.9  
   75.10  theory Prefix_Order
   75.11  imports Sublist
    76.1 --- a/src/HOL/Library/Preorder.thy	Wed Jun 17 10:57:11 2015 +0200
    76.2 +++ b/src/HOL/Library/Preorder.thy	Wed Jun 17 11:03:05 2015 +0200
    76.3 @@ -1,6 +1,6 @@
    76.4  (* Author: Florian Haftmann, TU Muenchen *)
    76.5  
    76.6 -section {* Preorders with explicit equivalence relation *}
    76.7 +section \<open>Preorders with explicit equivalence relation\<close>
    76.8  
    76.9  theory Preorder
   76.10  imports Orderings
    77.1 --- a/src/HOL/Library/Product_Lexorder.thy	Wed Jun 17 10:57:11 2015 +0200
    77.2 +++ b/src/HOL/Library/Product_Lexorder.thy	Wed Jun 17 11:03:05 2015 +0200
    77.3 @@ -2,7 +2,7 @@
    77.4      Author:     Norbert Voelker
    77.5  *)
    77.6  
    77.7 -section {* Lexicographic order on product types *}
    77.8 +section \<open>Lexicographic order on product types\<close>
    77.9  
   77.10  theory Product_Lexorder
   77.11  imports Main
   77.12 @@ -29,7 +29,7 @@
   77.13    "(x1, y1) < (x2, y2) \<longleftrightarrow> x1 < x2 \<or> x1 \<le> x2 \<and> y1 < y2"
   77.14    by (simp add: less_prod_def)
   77.15  
   77.16 -text {* A stronger version for partial orders. *}
   77.17 +text \<open>A stronger version for partial orders.\<close>
   77.18  
   77.19  lemma less_prod_def':
   77.20    fixes x y :: "'a::order \<times> 'b::ord"
   77.21 @@ -119,7 +119,7 @@
   77.22    qed
   77.23  qed
   77.24  
   77.25 -text {* Legacy lemma bindings *}
   77.26 +text \<open>Legacy lemma bindings\<close>
   77.27  
   77.28  lemmas prod_le_def = less_eq_prod_def
   77.29  lemmas prod_less_def = less_prod_def
    78.1 --- a/src/HOL/Library/Product_Order.thy	Wed Jun 17 10:57:11 2015 +0200
    78.2 +++ b/src/HOL/Library/Product_Order.thy	Wed Jun 17 11:03:05 2015 +0200
    78.3 @@ -2,13 +2,13 @@
    78.4      Author:     Brian Huffman
    78.5  *)
    78.6  
    78.7 -section {* Pointwise order on product types *}
    78.8 +section \<open>Pointwise order on product types\<close>
    78.9  
   78.10  theory Product_Order
   78.11  imports Product_plus Conditionally_Complete_Lattices
   78.12  begin
   78.13  
   78.14 -subsection {* Pointwise ordering *}
   78.15 +subsection \<open>Pointwise ordering\<close>
   78.16  
   78.17  instantiation prod :: (ord, ord) ord
   78.18  begin
   78.19 @@ -52,7 +52,7 @@
   78.20    by default auto
   78.21  
   78.22  
   78.23 -subsection {* Binary infimum and supremum *}
   78.24 +subsection \<open>Binary infimum and supremum\<close>
   78.25  
   78.26  instantiation prod :: (inf, inf) inf
   78.27  begin
   78.28 @@ -103,7 +103,7 @@
   78.29    by default (auto simp add: sup_inf_distrib1)
   78.30  
   78.31  
   78.32 -subsection {* Top and bottom elements *}
   78.33 +subsection \<open>Top and bottom elements\<close>
   78.34  
   78.35  instantiation prod :: (top, top) top
   78.36  begin
   78.37 @@ -155,7 +155,7 @@
   78.38    by default (auto simp add: prod_eqI inf_compl_bot sup_compl_top diff_eq)
   78.39  
   78.40  
   78.41 -subsection {* Complete lattice operations *}
   78.42 +subsection \<open>Complete lattice operations\<close>
   78.43  
   78.44  instantiation prod :: (Inf, Inf) Inf
   78.45  begin
   78.46 @@ -215,8 +215,8 @@
   78.47    unfolding INF_def Inf_prod_def by (simp add: comp_def)
   78.48  
   78.49  
   78.50 -text {* Alternative formulations for set infima and suprema over the product
   78.51 -of two complete lattices: *}
   78.52 +text \<open>Alternative formulations for set infima and suprema over the product
   78.53 +of two complete lattices:\<close>
   78.54  
   78.55  lemma INF_prod_alt_def:
   78.56    "INFIMUM A f = (INFIMUM A (fst o f), INFIMUM A (snd o f))"
   78.57 @@ -227,7 +227,7 @@
   78.58    unfolding SUP_def Sup_prod_def by simp
   78.59  
   78.60  
   78.61 -subsection {* Complete distributive lattices *}
   78.62 +subsection \<open>Complete distributive lattices\<close>
   78.63  
   78.64  (* Contribution: Alessandro Coglio *)
   78.65  
    79.1 --- a/src/HOL/Library/Product_Vector.thy	Wed Jun 17 10:57:11 2015 +0200
    79.2 +++ b/src/HOL/Library/Product_Vector.thy	Wed Jun 17 11:03:05 2015 +0200
    79.3 @@ -2,13 +2,13 @@
    79.4      Author:     Brian Huffman
    79.5  *)
    79.6  
    79.7 -section {* Cartesian Products as Vector Spaces *}
    79.8 +section \<open>Cartesian Products as Vector Spaces\<close>
    79.9  
   79.10  theory Product_Vector
   79.11  imports Inner_Product Product_plus
   79.12  begin
   79.13  
   79.14 -subsection {* Product is a real vector space *}
   79.15 +subsection \<open>Product is a real vector space\<close>
   79.16  
   79.17  instantiation prod :: (real_vector, real_vector) real_vector
   79.18  begin
   79.19 @@ -39,7 +39,7 @@
   79.20  
   79.21  end
   79.22  
   79.23 -subsection {* Product is a topological space *}
   79.24 +subsection \<open>Product is a topological space\<close>
   79.25  
   79.26  instantiation prod :: (topological_space, topological_space) topological_space
   79.27  begin
   79.28 @@ -69,10 +69,10 @@
   79.29      fix x assume x: "x \<in> S \<inter> T"
   79.30      from x have "x \<in> S" by simp
   79.31      obtain Sa Sb where A: "open Sa" "open Sb" "x \<in> Sa \<times> Sb" "Sa \<times> Sb \<subseteq> S"
   79.32 -      using `open S` and `x \<in> S` by (rule open_prod_elim)
   79.33 +      using \<open>open S\<close> and \<open>x \<in> S\<close> by (rule open_prod_elim)
   79.34      from x have "x \<in> T" by simp
   79.35      obtain Ta Tb where B: "open Ta" "open Tb" "x \<in> Ta \<times> Tb" "Ta \<times> Tb \<subseteq> T"
   79.36 -      using `open T` and `x \<in> T` by (rule open_prod_elim)
   79.37 +      using \<open>open T\<close> and \<open>x \<in> T\<close> by (rule open_prod_elim)
   79.38      let ?A = "Sa \<inter> Ta" and ?B = "Sb \<inter> Tb"
   79.39      have "open ?A \<and> open ?B \<and> x \<in> ?A \<times> ?B \<and> ?A \<times> ?B \<subseteq> S \<inter> T"
   79.40        using A B by (auto simp add: open_Int)
   79.41 @@ -130,9 +130,9 @@
   79.42    fix x assume "x \<in> fst ` S"
   79.43    then obtain y where "(x, y) \<in> S" by auto
   79.44    then obtain A B where "open A" "open B" "x \<in> A" "y \<in> B" "A \<times> B \<subseteq> S"
   79.45 -    using `open S` unfolding open_prod_def by auto
   79.46 -  from `A \<times> B \<subseteq> S` `y \<in> B` have "A \<subseteq> fst ` S" by (rule subset_fst_imageI)
   79.47 -  with `open A` `x \<in> A` have "open A \<and> x \<in> A \<and> A \<subseteq> fst ` S" by simp
   79.48 +    using \<open>open S\<close> unfolding open_prod_def by auto
   79.49 +  from \<open>A \<times> B \<subseteq> S\<close> \<open>y \<in> B\<close> have "A \<subseteq> fst ` S" by (rule subset_fst_imageI)
   79.50 +  with \<open>open A\<close> \<open>x \<in> A\<close> have "open A \<and> x \<in> A \<and> A \<subseteq> fst ` S" by simp
   79.51    then show "\<exists>T. open T \<and> x \<in> T \<and> T \<subseteq> fst ` S" by - (rule exI)
   79.52  qed
   79.53  
   79.54 @@ -141,13 +141,13 @@
   79.55    fix y assume "y \<in> snd ` S"
   79.56    then obtain x where "(x, y) \<in> S" by auto
   79.57    then obtain A B where "open A" "open B" "x \<in> A" "y \<in> B" "A \<times> B \<subseteq> S"
   79.58 -    using `open S` unfolding open_prod_def by auto
   79.59 -  from `A \<times> B \<subseteq> S` `x \<in> A` have "B \<subseteq> snd ` S" by (rule subset_snd_imageI)
   79.60 -  with `open B` `y \<in> B` have "open B \<and> y \<in> B \<and> B \<subseteq> snd ` S" by simp
   79.61 +    using \<open>open S\<close> unfolding open_prod_def by auto
   79.62 +  from \<open>A \<times> B \<subseteq> S\<close> \<open>x \<in> A\<close> have "B \<subseteq> snd ` S" by (rule subset_snd_imageI)
   79.63 +  with \<open>open B\<close> \<open>y \<in> B\<close> have "open B \<and> y \<in> B \<and> B \<subseteq> snd ` S" by simp
   79.64    then show "\<exists>T. open T \<and> y \<in> T \<and> T \<subseteq> snd ` S" by - (rule exI)
   79.65  qed
   79.66  
   79.67 -subsubsection {* Continuity of operations *}
   79.68 +subsubsection \<open>Continuity of operations\<close>
   79.69  
   79.70  lemma tendsto_fst [tendsto_intros]:
   79.71    assumes "(f ---> a) F"
   79.72 @@ -183,16 +183,16 @@
   79.73    then obtain A B where "open A" "open B" "a \<in> A" "b \<in> B" "A \<times> B \<subseteq> S"
   79.74      unfolding open_prod_def by fast
   79.75    have "eventually (\<lambda>x. f x \<in> A) F"
   79.76 -    using `(f ---> a) F` `open A` `a \<in> A`
   79.77 +    using \<open>(f ---> a) F\<close> \<open>open A\<close> \<open>a \<in> A\<close>
   79.78      by (rule topological_tendstoD)
   79.79    moreover
   79.80    have "eventually (\<lambda>x. g x \<in> B) F"
   79.81 -    using `(g ---> b) F` `open B` `b \<in> B`
   79.82 +    using \<open>(g ---> b) F\<close> \<open>open B\<close> \<open>b \<in> B\<close>
   79.83      by (rule topological_tendstoD)
   79.84    ultimately
   79.85    show "eventually (\<lambda>x. (f x, g x) \<in> S) F"
   79.86      by (rule eventually_elim2)
   79.87 -       (simp add: subsetD [OF `A \<times> B \<subseteq> S`])
   79.88 +       (simp add: subsetD [OF \<open>A \<times> B \<subseteq> S\<close>])
   79.89  qed
   79.90  
   79.91  lemma continuous_fst[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. fst (f x))"
   79.92 @@ -222,7 +222,7 @@
   79.93  lemma isCont_Pair [simp]: "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. (f x, g x)) a"
   79.94    by (fact continuous_Pair)
   79.95  
   79.96 -subsubsection {* Separation axioms *}
   79.97 +subsubsection \<open>Separation axioms\<close>
   79.98  
   79.99  lemma mem_Times_iff: "x \<in> A \<times> B \<longleftrightarrow> fst x \<in> A \<and> snd x \<in> B"
  79.100    by (induct x) simp (* TODO: move elsewhere *)
  79.101 @@ -254,7 +254,7 @@
  79.102      by (fast dest: hausdorff elim: open_vimage_fst open_vimage_snd)
  79.103  qed
  79.104  
  79.105 -subsection {* Product is a metric space *}
  79.106 +subsection \<open>Product is a metric space\<close>
  79.107  
  79.108  instantiation prod :: (metric_space, metric_space) metric_space
  79.109  begin
  79.110 @@ -289,11 +289,11 @@
  79.111      proof
  79.112        fix x assume "x \<in> S"
  79.113        obtain A B where "open A" "open B" "x \<in> A \<times> B" "A \<times> B \<subseteq> S"
  79.114 -        using `open S` and `x \<in> S` by (rule open_prod_elim)
  79.115 +        using \<open>open S\<close> and \<open>x \<in> S\<close> by (rule open_prod_elim)
  79.116        obtain r where r: "0 < r" "\<forall>y. dist y (fst x) < r \<longrightarrow> y \<in> A"
  79.117 -        using `open A` and `x \<in> A \<times> B` unfolding open_dist by auto
  79.118 +        using \<open>open A\<close> and \<open>x \<in> A \<times> B\<close> unfolding open_dist by auto
  79.119        obtain s where s: "0 < s" "\<forall>y. dist y (snd x) < s \<longrightarrow> y \<in> B"
  79.120 -        using `open B` and `x \<in> A \<times> B` unfolding open_dist by auto
  79.121 +        using \<open>open B\<close> and \<open>x \<in> A \<times> B\<close> unfolding open_dist by auto
  79.122        let ?e = "min r s"
  79.123        have "0 < ?e \<and> (\<forall>y. dist y x < ?e \<longrightarrow> y \<in> S)"
  79.124        proof (intro allI impI conjI)
  79.125 @@ -307,7 +307,7 @@
  79.126          hence "fst y \<in> A" and "snd y \<in> B"
  79.127            by (simp_all add: r(2) s(2))
  79.128          hence "y \<in> A \<times> B" by (induct y, simp)
  79.129 -        with `A \<times> B \<subseteq> S` show "y \<in> S" ..
  79.130 +        with \<open>A \<times> B \<subseteq> S\<close> show "y \<in> S" ..
  79.131        qed
  79.132        thus "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S" ..
  79.133      qed
  79.134 @@ -318,23 +318,23 @@
  79.135        then obtain e where "0 < e" and S: "\<forall>y. dist y x < e \<longrightarrow> y \<in> S"
  79.136          using * by fast
  79.137        def r \<equiv> "e / sqrt 2" and s \<equiv> "e / sqrt 2"
  79.138 -      from `0 < e` have "0 < r" and "0 < s"
  79.139 +      from \<open>0 < e\<close> have "0 < r" and "0 < s"
  79.140          unfolding r_def s_def by simp_all
  79.141 -      from `0 < e` have "e = sqrt (r\<^sup>2 + s\<^sup>2)"
  79.142 +      from \<open>0 < e\<close> have "e = sqrt (r\<^sup>2 + s\<^sup>2)"
  79.143          unfolding r_def s_def by (simp add: power_divide)
  79.144        def A \<equiv> "{y. dist (fst x) y < r}" and B \<equiv> "{y. dist (snd x) y < s}"
  79.145        have "open A" and "open B"
  79.146          unfolding A_def B_def by (simp_all add: open_ball)
  79.147        moreover have "x \<in> A \<times> B"
  79.148          unfolding A_def B_def mem_Times_iff
  79.149 -        using `0 < r` and `0 < s` by simp
  79.150 +        using \<open>0 < r\<close> and \<open>0 < s\<close> by simp
  79.151        moreover have "A \<times> B \<subseteq> S"
  79.152        proof (clarify)
  79.153          fix a b assume "a \<in> A" and "b \<in> B"
  79.154          hence "dist a (fst x) < r" and "dist b (snd x) < s"
  79.155            unfolding A_def B_def by (simp_all add: dist_commute)
  79.156          hence "dist (a, b) x < e"
  79.157 -          unfolding dist_prod_def `e = sqrt (r\<^sup>2 + s\<^sup>2)`
  79.158 +          unfolding dist_prod_def \<open>e = sqrt (r\<^sup>2 + s\<^sup>2)\<close>
  79.159            by (simp add: add_strict_mono power_strict_mono)
  79.160          thus "(a, b) \<in> S"
  79.161            by (simp add: S)
  79.162 @@ -361,24 +361,24 @@
  79.163    fix r :: real assume "0 < r"
  79.164    hence "0 < r / sqrt 2" (is "0 < ?s") by simp
  79.165    obtain M where M: "\<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < ?s"
  79.166 -    using metric_CauchyD [OF `Cauchy X` `0 < ?s`] ..
  79.167 +    using metric_CauchyD [OF \<open>Cauchy X\<close> \<open>0 < ?s\<close>] ..
  79.168    obtain N where N: "\<forall>m\<ge>N. \<forall>n\<ge>N. dist (Y m) (Y n) < ?s"
  79.169 -    using metric_CauchyD [OF `Cauchy Y` `0 < ?s`] ..
  79.170 +    using metric_CauchyD [OF \<open>Cauchy Y\<close> \<open>0 < ?s\<close>] ..
  79.171    have "\<forall>m\<ge>max M N. \<forall>n\<ge>max M N. dist (X m, Y m) (X n, Y n) < r"
  79.172      using M N by (simp add: real_sqrt_sum_squares_less dist_Pair_Pair)
  79.173    then show "\<exists>n0. \<forall>m\<ge>n0. \<forall>n\<ge>n0. dist (X m, Y m) (X n, Y n) < r" ..
  79.174  qed
  79.175  
  79.176 -subsection {* Product is a complete metric space *}
  79.177 +subsection \<open>Product is a complete metric space\<close>
  79.178  
  79.179  instance prod :: (complete_space, complete_space) complete_space
  79.180  proof
  79.181    fix X :: "nat \<Rightarrow> 'a \<times> 'b" assume "Cauchy X"
  79.182    have 1: "(\<lambda>n. fst (X n)) ----> lim (\<lambda>n. fst (X n))"
  79.183 -    using Cauchy_fst [OF `Cauchy X`]
  79.184 +    using Cauchy_fst [OF \<open>Cauchy X\<close>]
  79.185      by (simp add: Cauchy_convergent_iff convergent_LIMSEQ_iff)
  79.186    have 2: "(\<lambda>n. snd (X n)) ----> lim (\<lambda>n. snd (X n))"
  79.187 -    using Cauchy_snd [OF `Cauchy X`]
  79.188 +    using Cauchy_snd [OF \<open>Cauchy X\<close>]
  79.189      by (simp add: Cauchy_convergent_iff convergent_LIMSEQ_iff)
  79.190    have "X ----> (lim (\<lambda>n. fst (X n)), lim (\<lambda>n. snd (X n)))"
  79.191      using tendsto_Pair [OF 1 2] by simp
  79.192 @@ -386,7 +386,7 @@
  79.193      by (rule convergentI)
  79.194  qed
  79.195  
  79.196 -subsection {* Product is a normed vector space *}
  79.197 +subsection \<open>Product is a normed vector space\<close>
  79.198  
  79.199  instantiation prod :: (real_normed_vector, real_normed_vector) real_normed_vector
  79.200  begin
  79.201 @@ -429,7 +429,7 @@
  79.202  
  79.203  instance prod :: (banach, banach) banach ..
  79.204  
  79.205 -subsubsection {* Pair operations are linear *}
  79.206 +subsubsection \<open>Pair operations are linear\<close>
  79.207  
  79.208  lemma bounded_linear_fst: "bounded_linear fst"
  79.209    using fst_add fst_scaleR
  79.210 @@ -439,7 +439,7 @@
  79.211    using snd_add snd_scaleR
  79.212    by (rule bounded_linear_intro [where K=1], simp add: norm_prod_def)
  79.213  
  79.214 -text {* TODO: move to NthRoot *}
  79.215 +text \<open>TODO: move to NthRoot\<close>
  79.216  lemma sqrt_add_le_add_sqrt:
  79.217    assumes x: "0 \<le> x" and y: "0 \<le> y"
  79.218    shows "sqrt (x + y) \<le> sqrt x + sqrt y"
  79.219 @@ -474,7 +474,7 @@
  79.220    then show "\<exists>K. \<forall>x. norm (f x, g x) \<le> norm x * K" ..
  79.221  qed
  79.222  
  79.223 -subsubsection {* Frechet derivatives involving pairs *}
  79.224 +subsubsection \<open>Frechet derivatives involving pairs\<close>
  79.225  
  79.226  lemma has_derivative_Pair [derivative_intros]:
  79.227    assumes f: "(f has_derivative f') (at x within s)" and g: "(g has_derivative g') (at x within s)"
  79.228 @@ -502,7 +502,7 @@
  79.229    "((\<lambda>p. f (fst p) (snd p)) has_derivative f') F \<Longrightarrow> ((\<lambda>(a, b). f a b) has_derivative f') F"
  79.230    unfolding split_beta' .
  79.231  
  79.232 -subsection {* Product is an inner product space *}
  79.233 +subsection \<open>Product is an inner product space\<close>
  79.234  
  79.235  instantiation prod :: (real_inner, real_inner) real_inner
  79.236  begin
    80.1 --- a/src/HOL/Library/Product_plus.thy	Wed Jun 17 10:57:11 2015 +0200
    80.2 +++ b/src/HOL/Library/Product_plus.thy	Wed Jun 17 11:03:05 2015 +0200
    80.3 @@ -2,13 +2,13 @@
    80.4      Author:     Brian Huffman
    80.5  *)
    80.6  
    80.7 -section {* Additive group operations on product types *}
    80.8 +section \<open>Additive group operations on product types\<close>
    80.9  
   80.10  theory Product_plus
   80.11  imports Main
   80.12  begin
   80.13  
   80.14 -subsection {* Operations *}
   80.15 +subsection \<open>Operations\<close>
   80.16  
   80.17  instantiation prod :: (zero, zero) zero
   80.18  begin
   80.19 @@ -78,7 +78,7 @@
   80.20  lemma uminus_Pair [simp, code]: "- (a, b) = (- a, - b)"
   80.21    unfolding uminus_prod_def by simp
   80.22  
   80.23 -subsection {* Class instances *}
   80.24 +subsection \<open>Class instances\<close>
   80.25  
   80.26  instance prod :: (semigroup_add, semigroup_add) semigroup_add
   80.27    by default (simp add: prod_eq_iff add.assoc)
    81.1 --- a/src/HOL/Library/Quadratic_Discriminant.thy	Wed Jun 17 10:57:11 2015 +0200
    81.2 +++ b/src/HOL/Library/Quadratic_Discriminant.thy	Wed Jun 17 11:03:05 2015 +0200
    81.3 @@ -20,7 +20,7 @@
    81.4  proof -
    81.5    have "4 * a\<^sup>2 * x\<^sup>2 + 4 * a * b * x + 4 * a * c = 4 * a * (a * x\<^sup>2 + b * x + c)"
    81.6      by (simp add: algebra_simps power2_eq_square)
    81.7 -  with `a \<noteq> 0`
    81.8 +  with \<open>a \<noteq> 0\<close>
    81.9    have "a * x\<^sup>2 + b * x + c = 0 \<longleftrightarrow> 4 * a\<^sup>2 * x\<^sup>2 + 4 * a * b * x + 4 * a * c = 0"
   81.10      by simp
   81.11    thus "a * x\<^sup>2 + b * x + c = 0 \<longleftrightarrow> (2 * a * x + b)\<^sup>2 = discrim a b c"
   81.12 @@ -35,8 +35,8 @@
   81.13    shows "a * x\<^sup>2 + b * x + c \<noteq> 0"
   81.14  proof -
   81.15    have "(2 * a * x + b)\<^sup>2 \<ge> 0" by simp
   81.16 -  with `discrim a b c < 0` have "(2 * a * x + b)\<^sup>2 \<noteq> discrim a b c" by arith
   81.17 -  with complete_square and `a \<noteq> 0` show "a * x\<^sup>2 + b * x + c \<noteq> 0" by simp
   81.18 +  with \<open>discrim a b c < 0\<close> have "(2 * a * x + b)\<^sup>2 \<noteq> discrim a b c" by arith
   81.19 +  with complete_square and \<open>a \<noteq> 0\<close> show "a * x\<^sup>2 + b * x + c \<noteq> 0" by simp
   81.20  qed
   81.21  
   81.22  lemma plus_or_minus_sqrt:
   81.23 @@ -51,7 +51,7 @@
   81.24  next
   81.25    assume "x = sqrt y \<or> x = - sqrt y"
   81.26    hence "x\<^sup>2 = (sqrt y)\<^sup>2 \<or> x\<^sup>2 = (- sqrt y)\<^sup>2" by auto
   81.27 -  with `y \<ge> 0` show "x\<^sup>2 = y" by simp
   81.28 +  with \<open>y \<ge> 0\<close> show "x\<^sup>2 = y" by simp
   81.29  qed
   81.30  
   81.31  lemma divide_non_zero:
   81.32 @@ -60,10 +60,10 @@
   81.33    shows "x * y = z \<longleftrightarrow> y = z / x"
   81.34  proof
   81.35    assume "x * y = z"
   81.36 -  with `x \<noteq> 0` show "y = z / x" by (simp add: field_simps)
   81.37 +  with \<open>x \<noteq> 0\<close> show "y = z / x" by (simp add: field_simps)
   81.38  next
   81.39    assume "y = z / x"
   81.40 -  with `x \<noteq> 0` show "x * y = z" by simp
   81.41 +  with \<open>x \<noteq> 0\<close> show "x * y = z" by simp
   81.42  qed
   81.43  
   81.44  lemma discriminant_nonneg:
   81.45 @@ -82,7 +82,7 @@
   81.46    also have "\<dots> \<longleftrightarrow> (2 * a) * x = (-b + sqrt (discrim a b c)) \<or>
   81.47      (2 * a) * x = (-b - sqrt (discrim a b c))"
   81.48      by auto
   81.49 -  also from `a \<noteq> 0` and divide_non_zero [of "2 * a" x]
   81.50 +  also from \<open>a \<noteq> 0\<close> and divide_non_zero [of "2 * a" x]
   81.51    have "\<dots> \<longleftrightarrow> x = (-b + sqrt (discrim a b c)) / (2 * a) \<or>
   81.52      x = (-b - sqrt (discrim a b c)) / (2 * a)"
   81.53      by simp
   81.54 @@ -108,13 +108,13 @@
   81.55    x = (-b - sqrt (discrim a b c)) / (2 * a))"
   81.56  proof
   81.57    assume "a * x\<^sup>2 + b * x + c = 0"
   81.58 -  with discriminant_negative and `a \<noteq> 0` have "\<not>(discrim a b c < 0)" by auto
   81.59 +  with discriminant_negative and \<open>a \<noteq> 0\<close> have "\<not>(discrim a b c < 0)" by auto
   81.60    hence "discrim a b c \<ge> 0" by simp
   81.61 -  with discriminant_nonneg and `a * x\<^sup>2 + b * x + c = 0` and `a \<noteq> 0`
   81.62 +  with discriminant_nonneg and \<open>a * x\<^sup>2 + b * x + c = 0\<close> and \<open>a \<noteq> 0\<close>
   81.63    have "x = (-b + sqrt (discrim a b c)) / (2 * a) \<or>
   81.64      x = (-b - sqrt (discrim a b c)) / (2 * a)"
   81.65      by simp
   81.66 -  with `discrim a b c \<ge> 0`
   81.67 +  with \<open>discrim a b c \<ge> 0\<close>
   81.68    show "discrim a b c \<ge> 0 \<and>
   81.69      (x = (-b + sqrt (discrim a b c)) / (2 * a) \<or>
   81.70      x = (-b - sqrt (discrim a b c)) / (2 * a))" ..
   81.71 @@ -126,7 +126,7 @@
   81.72      "x = (-b + sqrt (discrim a b c)) / (2 * a) \<or>
   81.73      x = (-b - sqrt (discrim a b c)) / (2 * a)"
   81.74      by simp_all
   81.75 -  with discriminant_nonneg and `a \<noteq> 0` show "a * x\<^sup>2 + b * x + c = 0" by simp
   81.76 +  with discriminant_nonneg and \<open>a \<noteq> 0\<close> show "a * x\<^sup>2 + b * x + c = 0" by simp
   81.77  qed
   81.78  
   81.79  lemma discriminant_nonneg_ex:
   81.80 @@ -145,9 +145,9 @@
   81.81  proof -
   81.82    let ?x = "(-b + sqrt (discrim a b c)) / (2 * a)"
   81.83    let ?y = "(-b - sqrt (discrim a b c)) / (2 * a)"
   81.84 -  from `discrim a b c > 0` have "sqrt (discrim a b c) \<noteq> 0" by simp
   81.85 +  from \<open>discrim a b c > 0\<close> have "sqrt (discrim a b c) \<noteq> 0" by simp
   81.86    hence "sqrt (discrim a b c) \<noteq> - sqrt (discrim a b c)" by arith
   81.87 -  with `a \<noteq> 0` have "?x \<noteq> ?y" by simp
   81.88 +  with \<open>a \<noteq> 0\<close> have "?x \<noteq> ?y" by simp
   81.89    moreover
   81.90    from discriminant_nonneg [of a b c ?x]
   81.91      and discriminant_nonneg [of a b c ?y]
   81.92 @@ -162,19 +162,19 @@
   81.93    assumes "a \<noteq> 0" and "discrim a b c > 0"
   81.94    shows "\<exists> y. x \<noteq> y \<and> a * y\<^sup>2 + b * y + c = 0"
   81.95  proof -
   81.96 -  from discriminant_pos_ex and `a \<noteq> 0` and `discrim a b c > 0`
   81.97 +  from discriminant_pos_ex and \<open>a \<noteq> 0\<close> and \<open>discrim a b c > 0\<close>
   81.98    obtain w and z where "w \<noteq> z"
   81.99      and "a * w\<^sup>2 + b * w + c = 0" and "a * z\<^sup>2 + b * z + c = 0"
  81.100      by blast
  81.101    show "\<exists> y. x \<noteq> y \<and> a * y\<^sup>2 + b * y + c = 0"
  81.102    proof cases
  81.103      assume "x = w"
  81.104 -    with `w \<noteq> z` have "x \<noteq> z" by simp
  81.105 -    with `a * z\<^sup>2 + b * z + c = 0`
  81.106 +    with \<open>w \<noteq> z\<close> have "x \<noteq> z" by simp
  81.107 +    with \<open>a * z\<^sup>2 + b * z + c = 0\<close>
  81.108      show "\<exists> y. x \<noteq> y \<and> a * y\<^sup>2 + b * y + c = 0" by auto
  81.109    next
  81.110      assume "x \<noteq> w"
  81.111 -    with `a * w\<^sup>2 + b * w + c = 0`
  81.112 +    with \<open>a * w\<^sup>2 + b * w + c = 0\<close>
  81.113      show "\<exists> y. x \<noteq> y \<and> a * y\<^sup>2 + b * y + c = 0" by auto
  81.114    qed
  81.115  qed
    82.1 --- a/src/HOL/Library/Quotient_List.thy	Wed Jun 17 10:57:11 2015 +0200
    82.2 +++ b/src/HOL/Library/Quotient_List.thy	Wed Jun 17 11:03:05 2015 +0200
    82.3 @@ -2,13 +2,13 @@
    82.4      Author:     Cezary Kaliszyk and Christian Urban
    82.5  *)
    82.6  
    82.7 -section {* Quotient infrastructure for the list type *}
    82.8 +section \<open>Quotient infrastructure for the list type\<close>
    82.9  
   82.10  theory Quotient_List
   82.11  imports Main Quotient_Set Quotient_Product Quotient_Option
   82.12  begin
   82.13  
   82.14 -subsection {* Rules for the Quotient package *}
   82.15 +subsection \<open>Rules for the Quotient package\<close>
   82.16  
   82.17  lemma map_id [id_simps]:
   82.18    "map id = id"
    83.1 --- a/src/HOL/Library/Quotient_Option.thy	Wed Jun 17 10:57:11 2015 +0200
    83.2 +++ b/src/HOL/Library/Quotient_Option.thy	Wed Jun 17 11:03:05 2015 +0200
    83.3 @@ -2,13 +2,13 @@
    83.4      Author:     Cezary Kaliszyk and Christian Urban
    83.5  *)
    83.6  
    83.7 -section {* Quotient infrastructure for the option type *}
    83.8 +section \<open>Quotient infrastructure for the option type\<close>
    83.9  
   83.10  theory Quotient_Option
   83.11  imports Main Quotient_Syntax
   83.12  begin
   83.13  
   83.14 -subsection {* Rules for the Quotient package *}
   83.15 +subsection \<open>Rules for the Quotient package\<close>
   83.16  
   83.17  lemma rel_option_map1:
   83.18    "rel_option R (map_option f x) y \<longleftrightarrow> rel_option (\<lambda>x. R (f x)) x y"
    84.1 --- a/src/HOL/Library/Quotient_Product.thy	Wed Jun 17 10:57:11 2015 +0200
    84.2 +++ b/src/HOL/Library/Quotient_Product.thy	Wed Jun 17 11:03:05 2015 +0200
    84.3 @@ -2,13 +2,13 @@
    84.4      Author:     Cezary Kaliszyk and Christian Urban
    84.5  *)
    84.6  
    84.7 -section {* Quotient infrastructure for the product type *}
    84.8 +section \<open>Quotient infrastructure for the product type\<close>
    84.9  
   84.10  theory Quotient_Product
   84.11  imports Main Quotient_Syntax
   84.12  begin
   84.13  
   84.14 -subsection {* Rules for the Quotient package *}
   84.15 +subsection \<open>Rules for the Quotient package\<close>
   84.16  
   84.17  lemma map_prod_id [id_simps]:
   84.18    shows "map_prod id id = id"
    85.1 --- a/src/HOL/Library/Quotient_Set.thy	Wed Jun 17 10:57:11 2015 +0200