isabelle update_cartouches;
authorwenzelm
Thu Jul 23 14:25:05 2015 +0200 (2015-07-23)
changeset 60770240563fbf41d
parent 60769 cf7f3465eaf1
child 60771 8558e4a37b48
isabelle update_cartouches;
src/CCL/CCL.thy
src/CCL/Fix.thy
src/CCL/Gfp.thy
src/CCL/Hered.thy
src/CCL/Lfp.thy
src/CCL/Set.thy
src/CCL/Term.thy
src/CCL/Trancl.thy
src/CCL/Type.thy
src/CCL/Wfd.thy
src/CCL/ex/Flag.thy
src/CCL/ex/List.thy
src/CCL/ex/Nat.thy
src/CCL/ex/Stream.thy
src/CTT/Arith.thy
src/CTT/Bool.thy
src/CTT/CTT.thy
src/CTT/Main.thy
src/CTT/ex/Elimination.thy
src/CTT/ex/Equality.thy
src/CTT/ex/Typechecking.thy
src/FOL/FOL.thy
src/FOL/IFOL.thy
src/FOL/ex/Classical.thy
src/FOL/ex/First_Order_Logic.thy
src/FOL/ex/Foundation.thy
src/FOL/ex/If.thy
src/FOL/ex/Intro.thy
src/FOL/ex/Intuitionistic.thy
src/FOL/ex/Locale_Test/Locale_Test.thy
src/FOL/ex/Locale_Test/Locale_Test1.thy
src/FOL/ex/Miniscope.thy
src/FOL/ex/Nat.thy
src/FOL/ex/Nat_Class.thy
src/FOL/ex/Natural_Numbers.thy
src/FOL/ex/Prolog.thy
src/FOL/ex/Propositional_Cla.thy
src/FOL/ex/Propositional_Int.thy
src/FOL/ex/Quantifiers_Cla.thy
src/FOL/ex/Quantifiers_Int.thy
src/FOLP/FOLP.thy
src/FOLP/IFOLP.thy
src/FOLP/ex/Classical.thy
src/FOLP/ex/Foundation.thy
src/FOLP/ex/If.thy
src/FOLP/ex/Intro.thy
src/FOLP/ex/Intuitionistic.thy
src/FOLP/ex/Nat.thy
src/FOLP/ex/Propositional_Cla.thy
src/FOLP/ex/Propositional_Int.thy
src/FOLP/ex/Quantifiers_Cla.thy
src/FOLP/ex/Quantifiers_Int.thy
src/LCF/LCF.thy
src/LCF/ex/Ex1.thy
src/LCF/ex/Ex2.thy
src/LCF/ex/Ex3.thy
src/LCF/ex/Ex4.thy
src/Sequents/ILL.thy
src/Sequents/LK.thy
src/Sequents/LK/Nat.thy
src/Sequents/LK/Propositional.thy
src/Sequents/LK0.thy
src/Sequents/Modal0.thy
src/Sequents/S4.thy
src/Sequents/S43.thy
src/Sequents/Sequents.thy
src/Sequents/T.thy
src/Sequents/Washing.thy
src/ZF/AC.thy
src/ZF/AC/Cardinal_aux.thy
src/ZF/AC/DC.thy
src/ZF/AC/HH.thy
src/ZF/Arith.thy
src/ZF/ArithSimp.thy
src/ZF/Bin.thy
src/ZF/Bool.thy
src/ZF/Cardinal.thy
src/ZF/CardinalArith.thy
src/ZF/Cardinal_AC.thy
src/ZF/Coind/Language.thy
src/ZF/Constructible/AC_in_L.thy
src/ZF/Constructible/DPow_absolute.thy
src/ZF/Constructible/Datatype_absolute.thy
src/ZF/Constructible/Formula.thy
src/ZF/Constructible/Internalize.thy
src/ZF/Constructible/L_axioms.thy
src/ZF/Constructible/MetaExists.thy
src/ZF/Constructible/Normal.thy
src/ZF/Constructible/Rank.thy
src/ZF/Constructible/Rank_Separation.thy
src/ZF/Constructible/Rec_Separation.thy
src/ZF/Constructible/Reflection.thy
src/ZF/Constructible/Relative.thy
src/ZF/Constructible/Satisfies_absolute.thy
src/ZF/Constructible/Separation.thy
src/ZF/Constructible/WF_absolute.thy
src/ZF/Constructible/WFrec.thy
src/ZF/Constructible/Wellorderings.thy
src/ZF/Datatype_ZF.thy
src/ZF/Epsilon.thy
src/ZF/EquivClass.thy
src/ZF/Finite.thy
src/ZF/Fixedpt.thy
src/ZF/IMP/Com.thy
src/ZF/IMP/Denotation.thy
src/ZF/IMP/Equiv.thy
src/ZF/Induct/Acc.thy
src/ZF/Induct/Binary_Trees.thy
src/ZF/Induct/Brouwer.thy
src/ZF/Induct/Comb.thy
src/ZF/Induct/Datatypes.thy
src/ZF/Induct/FoldSet.thy
src/ZF/Induct/ListN.thy
src/ZF/Induct/Multiset.thy
src/ZF/Induct/Mutil.thy
src/ZF/Induct/Ntree.thy
src/ZF/Induct/Primrec.thy
src/ZF/Induct/PropLog.thy
src/ZF/Induct/Rmap.thy
src/ZF/Induct/Term.thy
src/ZF/Induct/Tree_Forest.thy
src/ZF/Inductive_ZF.thy
src/ZF/InfDatatype.thy
src/ZF/IntDiv_ZF.thy
src/ZF/Int_ZF.thy
src/ZF/List_ZF.thy
src/ZF/Main_ZF.thy
src/ZF/Nat_ZF.thy
src/ZF/OrdQuant.thy
src/ZF/Order.thy
src/ZF/OrderArith.thy
src/ZF/OrderType.thy
src/ZF/Ordinal.thy
src/ZF/Perm.thy
src/ZF/QPair.thy
src/ZF/QUniv.thy
src/ZF/Resid/Residuals.thy
src/ZF/Sum.thy
src/ZF/Trancl.thy
src/ZF/UNITY/AllocBase.thy
src/ZF/UNITY/AllocImpl.thy
src/ZF/UNITY/Comp.thy
src/ZF/UNITY/Constrains.thy
src/ZF/UNITY/Distributor.thy
src/ZF/UNITY/FP.thy
src/ZF/UNITY/Follows.thy
src/ZF/UNITY/GenPrefix.thy
src/ZF/UNITY/Guar.thy
src/ZF/UNITY/Increasing.thy
src/ZF/UNITY/Merge.thy
src/ZF/UNITY/Monotonicity.thy
src/ZF/UNITY/MultisetSum.thy
src/ZF/UNITY/Mutex.thy
src/ZF/UNITY/State.thy
src/ZF/UNITY/SubstAx.thy
src/ZF/UNITY/UNITY.thy
src/ZF/UNITY/Union.thy
src/ZF/UNITY/WFair.thy
src/ZF/Univ.thy
src/ZF/WF.thy
src/ZF/ZF.thy
src/ZF/Zorn.thy
src/ZF/equalities.thy
src/ZF/ex/CoUnit.thy
src/ZF/ex/Group.thy
src/ZF/ex/LList.thy
src/ZF/ex/Limit.thy
src/ZF/ex/Primes.thy
src/ZF/ex/Ring.thy
src/ZF/ex/misc.thy
src/ZF/func.thy
src/ZF/pair.thy
src/ZF/upair.thy
     1.1 --- a/src/CCL/CCL.thy	Thu Jul 23 14:20:51 2015 +0200
     1.2 +++ b/src/CCL/CCL.thy	Thu Jul 23 14:25:05 2015 +0200
     1.3 @@ -3,18 +3,18 @@
     1.4      Copyright   1993  University of Cambridge
     1.5  *)
     1.6  
     1.7 -section {* Classical Computational Logic for Untyped Lambda Calculus
     1.8 -  with reduction to weak head-normal form *}
     1.9 +section \<open>Classical Computational Logic for Untyped Lambda Calculus
    1.10 +  with reduction to weak head-normal form\<close>
    1.11  
    1.12  theory CCL
    1.13  imports Gfp
    1.14  begin
    1.15  
    1.16 -text {*
    1.17 +text \<open>
    1.18    Based on FOL extended with set collection, a primitive higher-order
    1.19    logic.  HOL is too strong - descriptions prevent a type of programs
    1.20    being defined which contains only executable terms.
    1.21 -*}
    1.22 +\<close>
    1.23  
    1.24  class prog = "term"
    1.25  default_sort prog
    1.26 @@ -150,7 +150,7 @@
    1.27  definition Trm :: "i \<Rightarrow> o"
    1.28    where "Trm(t) == \<not> Dvg(t)"
    1.29  
    1.30 -text {*
    1.31 +text \<open>
    1.32  Would be interesting to build a similar theory for a typed programming language:
    1.33      ie.     true :: bool,      fix :: ('a\<Rightarrow>'a)\<Rightarrow>'a  etc......
    1.34  
    1.35 @@ -158,7 +158,7 @@
    1.36  What are the advantages of this approach?
    1.37          - less axiomatic
    1.38          - wfd induction / coinduction and fixed point induction available
    1.39 -*}
    1.40 +\<close>
    1.41  
    1.42  
    1.43  lemmas ccl_data_defs = apply_def fix_def
    1.44 @@ -166,7 +166,7 @@
    1.45  declare po_refl [simp]
    1.46  
    1.47  
    1.48 -subsection {* Congruence Rules *}
    1.49 +subsection \<open>Congruence Rules\<close>
    1.50  
    1.51  (*similar to AP_THM in Gordon's HOL*)
    1.52  lemma fun_cong: "(f::'a\<Rightarrow>'b) = g \<Longrightarrow> f(x)=g(x)"
    1.53 @@ -184,7 +184,7 @@
    1.54  lemmas caseBs = caseBtrue caseBfalse caseBpair caseBlam caseBbot
    1.55  
    1.56  
    1.57 -subsection {* Termination and Divergence *}
    1.58 +subsection \<open>Termination and Divergence\<close>
    1.59  
    1.60  lemma Trm_iff: "Trm(t) \<longleftrightarrow> \<not> t = bot"
    1.61    by (simp add: Trm_def Dvg_def)
    1.62 @@ -193,12 +193,12 @@
    1.63    by (simp add: Trm_def Dvg_def)
    1.64  
    1.65  
    1.66 -subsection {* Constructors are injective *}
    1.67 +subsection \<open>Constructors are injective\<close>
    1.68  
    1.69  lemma eq_lemma: "\<lbrakk>x=a; y=b; x=y\<rbrakk> \<Longrightarrow> a=b"
    1.70    by simp
    1.71  
    1.72 -ML {*
    1.73 +ML \<open>
    1.74    fun inj_rl_tac ctxt rews i =
    1.75      let
    1.76        fun mk_inj_lemmas r = [@{thm arg_cong}] RL [r RS (r RS @{thm eq_lemma})]
    1.77 @@ -209,11 +209,11 @@
    1.78          eresolve_tac ctxt inj_lemmas i ORELSE
    1.79          asm_simp_tac (ctxt addsimps rews) i))
    1.80      end;
    1.81 -*}
    1.82 +\<close>
    1.83  
    1.84 -method_setup inj_rl = {*
    1.85 +method_setup inj_rl = \<open>
    1.86    Attrib.thms >> (fn rews => fn ctxt => SIMPLE_METHOD' (inj_rl_tac ctxt rews))
    1.87 -*}
    1.88 +\<close>
    1.89  
    1.90  lemma ccl_injs:
    1.91    "<a,b> = <a',b'> \<longleftrightarrow> (a=a' \<and> b=b')"
    1.92 @@ -225,12 +225,12 @@
    1.93    by (simp add: ccl_injs)
    1.94  
    1.95  
    1.96 -subsection {* Constructors are distinct *}
    1.97 +subsection \<open>Constructors are distinct\<close>
    1.98  
    1.99  lemma lem: "t=t' \<Longrightarrow> case(t,b,c,d,e) = case(t',b,c,d,e)"
   1.100    by simp
   1.101  
   1.102 -ML {*
   1.103 +ML \<open>
   1.104  local
   1.105    fun pairs_of f x [] = []
   1.106      | pairs_of f x (y::ys) = (f x y) :: (f y x) :: (pairs_of f x ys)
   1.107 @@ -259,9 +259,9 @@
   1.108    fun mk_lemmas rls = maps mk_lemma (mk_combs pair rls)
   1.109    fun mk_dstnct_rls thy xs = mk_combs (mk_thm_str thy) xs
   1.110  end
   1.111 -*}
   1.112 +\<close>
   1.113  
   1.114 -ML {*
   1.115 +ML \<open>
   1.116  val caseB_lemmas = mk_lemmas @{thms caseBs}
   1.117  
   1.118  val ccl_dstncts =
   1.119 @@ -296,14 +296,14 @@
   1.120  ML_Thms.bind_thms ("ccl_rews", @{thms caseBs} @ @{thms ccl_injs} @ ccl_dstncts);
   1.121  ML_Thms.bind_thms ("ccl_dstnctsEs", ccl_dstncts RL [@{thm notE}]);
   1.122  ML_Thms.bind_thms ("ccl_injDs", XH_to_Ds @{thms ccl_injs});
   1.123 -*}
   1.124 +\<close>
   1.125  
   1.126  lemmas [simp] = ccl_rews
   1.127    and [elim!] = pair_inject ccl_dstnctsEs
   1.128    and [dest!] = ccl_injDs
   1.129  
   1.130  
   1.131 -subsection {* Facts from gfp Definition of @{text "[="} and @{text "="} *}
   1.132 +subsection \<open>Facts from gfp Definition of @{text "[="} and @{text "="}\<close>
   1.133  
   1.134  lemma XHlemma1: "\<lbrakk>A=B; a:B \<longleftrightarrow> P\<rbrakk> \<Longrightarrow> a:A \<longleftrightarrow> P"
   1.135    by simp
   1.136 @@ -312,7 +312,7 @@
   1.137    by blast
   1.138  
   1.139  
   1.140 -subsection {* Pre-Order *}
   1.141 +subsection \<open>Pre-Order\<close>
   1.142  
   1.143  lemma POgen_mono: "mono(\<lambda>X. POgen(X))"
   1.144    apply (unfold POgen_def SIM_def)
   1.145 @@ -422,7 +422,7 @@
   1.146  lemmas npo_rls = npo_pair_lam npo_lam_pair npo_rls1
   1.147  
   1.148  
   1.149 -subsection {* Coinduction for @{text "[="} *}
   1.150 +subsection \<open>Coinduction for @{text "[="}\<close>
   1.151  
   1.152  lemma po_coinduct: "\<lbrakk><t,u> : R; R <= POgen(R)\<rbrakk> \<Longrightarrow> t [= u"
   1.153    apply (rule PO_def [THEN def_coinduct, THEN PO_iff [THEN iffD2]])
   1.154 @@ -430,7 +430,7 @@
   1.155    done
   1.156  
   1.157  
   1.158 -subsection {* Equality *}
   1.159 +subsection \<open>Equality\<close>
   1.160  
   1.161  lemma EQgen_mono: "mono(\<lambda>X. EQgen(X))"
   1.162    apply (unfold EQgen_def SIM_def)
   1.163 @@ -473,14 +473,14 @@
   1.164    apply (rule EQgen_mono | assumption)+
   1.165    done
   1.166  
   1.167 -method_setup eq_coinduct3 = {*
   1.168 +method_setup eq_coinduct3 = \<open>
   1.169    Scan.lift Args.name_inner_syntax >> (fn s => fn ctxt =>
   1.170      SIMPLE_METHOD'
   1.171        (Rule_Insts.res_inst_tac ctxt [((("R", 0), Position.none), s)] [] @{thm eq_coinduct3}))
   1.172 -*}
   1.173 +\<close>
   1.174  
   1.175  
   1.176 -subsection {* Untyped Case Analysis and Other Facts *}
   1.177 +subsection \<open>Untyped Case Analysis and Other Facts\<close>
   1.178  
   1.179  lemma cond_eta: "(EX f. t=lam x. f(x)) \<Longrightarrow> t = lam x.(t ` x)"
   1.180    by (auto simp: apply_def)
     2.1 --- a/src/CCL/Fix.thy	Thu Jul 23 14:20:51 2015 +0200
     2.2 +++ b/src/CCL/Fix.thy	Thu Jul 23 14:25:05 2015 +0200
     2.3 @@ -3,7 +3,7 @@
     2.4      Copyright   1993  University of Cambridge
     2.5  *)
     2.6  
     2.7 -section {* Tentative attempt at including fixed point induction; justified by Smith *}
     2.8 +section \<open>Tentative attempt at including fixed point induction; justified by Smith\<close>
     2.9  
    2.10  theory Fix
    2.11  imports Type
    2.12 @@ -18,7 +18,7 @@
    2.13    INCL_subst: "INCL(P) \<Longrightarrow> INCL(\<lambda>x. P((g::i\<Rightarrow>i)(x)))"
    2.14  
    2.15  
    2.16 -subsection {* Fixed Point Induction *}
    2.17 +subsection \<open>Fixed Point Induction\<close>
    2.18  
    2.19  lemma fix_ind:
    2.20    assumes base: "P(bot)"
    2.21 @@ -33,7 +33,7 @@
    2.22    done
    2.23  
    2.24  
    2.25 -subsection {* Inclusive Predicates *}
    2.26 +subsection \<open>Inclusive Predicates\<close>
    2.27  
    2.28  lemma inclXH: "INCL(P) \<longleftrightarrow> (ALL f. (ALL n:Nat. P(f ^ n ` bot)) \<longrightarrow> P(fix(f)))"
    2.29    by (simp add: INCL_def)
    2.30 @@ -48,7 +48,7 @@
    2.31    by (blast dest: inclD)
    2.32  
    2.33  
    2.34 -subsection {* Lemmas for Inclusive Predicates *}
    2.35 +subsection \<open>Lemmas for Inclusive Predicates\<close>
    2.36  
    2.37  lemma npo_INCL: "INCL(\<lambda>x. \<not> a(x) [= t)"
    2.38    apply (rule inclI)
    2.39 @@ -77,7 +77,7 @@
    2.40    done
    2.41  
    2.42  
    2.43 -subsection {* Derivation of Reachability Condition *}
    2.44 +subsection \<open>Derivation of Reachability Condition\<close>
    2.45  
    2.46  (* Fixed points of idgen *)
    2.47  
     3.1 --- a/src/CCL/Gfp.thy	Thu Jul 23 14:20:51 2015 +0200
     3.2 +++ b/src/CCL/Gfp.thy	Thu Jul 23 14:25:05 2015 +0200
     3.3 @@ -3,7 +3,7 @@
     3.4      Copyright   1992  University of Cambridge
     3.5  *)
     3.6  
     3.7 -section {* Greatest fixed points *}
     3.8 +section \<open>Greatest fixed points\<close>
     3.9  
    3.10  theory Gfp
    3.11  imports Lfp
    3.12 @@ -90,7 +90,7 @@
    3.13    done
    3.14  
    3.15  
    3.16 -subsection {* Definition forms of @{text "gfp_Tarski"}, to control unfolding *}
    3.17 +subsection \<open>Definition forms of @{text "gfp_Tarski"}, to control unfolding\<close>
    3.18  
    3.19  lemma def_gfp_Tarski: "\<lbrakk>h == gfp(f); mono(f)\<rbrakk> \<Longrightarrow> h = f(h)"
    3.20    apply unfold
     4.1 --- a/src/CCL/Hered.thy	Thu Jul 23 14:20:51 2015 +0200
     4.2 +++ b/src/CCL/Hered.thy	Thu Jul 23 14:25:05 2015 +0200
     4.3 @@ -3,17 +3,17 @@
     4.4      Copyright   1993  University of Cambridge
     4.5  *)
     4.6  
     4.7 -section {* Hereditary Termination -- cf. Martin Lo\"f *}
     4.8 +section \<open>Hereditary Termination -- cf. Martin Lo\"f\<close>
     4.9  
    4.10  theory Hered
    4.11  imports Type
    4.12  begin
    4.13  
    4.14 -text {*
    4.15 +text \<open>
    4.16    Note that this is based on an untyped equality and so @{text "lam
    4.17    x. b(x)"} is only hereditarily terminating if @{text "ALL x. b(x)"}
    4.18    is.  Not so useful for functions!
    4.19 -*}
    4.20 +\<close>
    4.21  
    4.22  definition HTTgen :: "i set \<Rightarrow> i set" where
    4.23    "HTTgen(R) ==
    4.24 @@ -24,7 +24,7 @@
    4.25    where "HTT == gfp(HTTgen)"
    4.26  
    4.27  
    4.28 -subsection {* Hereditary Termination *}
    4.29 +subsection \<open>Hereditary Termination\<close>
    4.30  
    4.31  lemma HTTgen_mono: "mono(\<lambda>X. HTTgen(X))"
    4.32    apply (unfold HTTgen_def)
    4.33 @@ -47,7 +47,7 @@
    4.34    done
    4.35  
    4.36  
    4.37 -subsection {* Introduction Rules for HTT *}
    4.38 +subsection \<open>Introduction Rules for HTT\<close>
    4.39  
    4.40  lemma HTT_bot: "\<not> bot : HTT"
    4.41    by (blast dest: HTTXH [THEN iffD1])
    4.42 @@ -83,7 +83,7 @@
    4.43  lemmas HTT_rews = HTT_rews1 HTT_rews2
    4.44  
    4.45  
    4.46 -subsection {* Coinduction for HTT *}
    4.47 +subsection \<open>Coinduction for HTT\<close>
    4.48  
    4.49  lemma HTT_coinduct: "\<lbrakk>t : R; R <= HTTgen(R)\<rbrakk> \<Longrightarrow> t : HTT"
    4.50    apply (erule HTT_def [THEN def_coinduct])
    4.51 @@ -111,7 +111,7 @@
    4.52    unfolding data_defs by (genIs HTTgenXH HTTgen_mono)+
    4.53  
    4.54  
    4.55 -subsection {* Formation Rules for Types *}
    4.56 +subsection \<open>Formation Rules for Types\<close>
    4.57  
    4.58  lemma UnitF: "Unit <= HTT"
    4.59    by (simp add: subsetXH UnitXH HTT_rews)
     5.1 --- a/src/CCL/Lfp.thy	Thu Jul 23 14:20:51 2015 +0200
     5.2 +++ b/src/CCL/Lfp.thy	Thu Jul 23 14:25:05 2015 +0200
     5.3 @@ -3,7 +3,7 @@
     5.4      Copyright   1992  University of Cambridge
     5.5  *)
     5.6  
     5.7 -section {* The Knaster-Tarski Theorem *}
     5.8 +section \<open>The Knaster-Tarski Theorem\<close>
     5.9  
    5.10  theory Lfp
    5.11  imports Set
     6.1 --- a/src/CCL/Set.thy	Thu Jul 23 14:20:51 2015 +0200
     6.2 +++ b/src/CCL/Set.thy	Thu Jul 23 14:25:05 2015 +0200
     6.3 @@ -1,4 +1,4 @@
     6.4 -section {* Extending FOL by a modified version of HOL set theory *}
     6.5 +section \<open>Extending FOL by a modified version of HOL set theory\<close>
     6.6  
     6.7  theory Set
     6.8  imports "~~/src/FOL/FOL"
     6.9 @@ -83,7 +83,7 @@
    6.10    done
    6.11  
    6.12  
    6.13 -subsection {* Bounded quantifiers *}
    6.14 +subsection \<open>Bounded quantifiers\<close>
    6.15  
    6.16  lemma ballI: "(\<And>x. x:A \<Longrightarrow> P(x)) \<Longrightarrow> ALL x:A. P(x)"
    6.17    by (simp add: Ball_def)
    6.18 @@ -108,7 +108,7 @@
    6.19    by (blast intro: ballI)
    6.20  
    6.21  
    6.22 -subsection {* Congruence rules *}
    6.23 +subsection \<open>Congruence rules\<close>
    6.24  
    6.25  lemma ball_cong:
    6.26    "\<lbrakk>A = A'; \<And>x. x:A' \<Longrightarrow> P(x) \<longleftrightarrow> P'(x)\<rbrakk> \<Longrightarrow>
    6.27 @@ -121,7 +121,7 @@
    6.28    by (blast intro: bexI elim: bexE)
    6.29  
    6.30  
    6.31 -subsection {* Rules for subsets *}
    6.32 +subsection \<open>Rules for subsets\<close>
    6.33  
    6.34  lemma subsetI: "(\<And>x. x:A \<Longrightarrow> x:B) \<Longrightarrow> A <= B"
    6.35    unfolding subset_def by (blast intro: ballI)
    6.36 @@ -141,7 +141,7 @@
    6.37    by (blast intro: subsetI dest: subsetD)
    6.38  
    6.39  
    6.40 -subsection {* Rules for equality *}
    6.41 +subsection \<open>Rules for equality\<close>
    6.42  
    6.43  (*Anti-symmetry of the subset relation*)
    6.44  lemma subset_antisym: "\<lbrakk>A <= B; B <= A\<rbrakk> \<Longrightarrow> A = B"
    6.45 @@ -164,7 +164,7 @@
    6.46    by (blast intro: equalityI subsetI CollectI dest: CollectD)
    6.47  
    6.48  
    6.49 -subsection {* Rules for binary union *}
    6.50 +subsection \<open>Rules for binary union\<close>
    6.51  
    6.52  lemma UnI1: "c:A \<Longrightarrow> c : A Un B"
    6.53    and UnI2: "c:B \<Longrightarrow> c : A Un B"
    6.54 @@ -178,7 +178,7 @@
    6.55    unfolding Un_def by (blast dest: CollectD)
    6.56  
    6.57  
    6.58 -subsection {* Rules for small intersection *}
    6.59 +subsection \<open>Rules for small intersection\<close>
    6.60  
    6.61  lemma IntI: "\<lbrakk>c:A; c:B\<rbrakk> \<Longrightarrow> c : A Int B"
    6.62    unfolding Int_def by (blast intro: CollectI)
    6.63 @@ -191,7 +191,7 @@
    6.64    by (blast dest: IntD1 IntD2)
    6.65  
    6.66  
    6.67 -subsection {* Rules for set complement *}
    6.68 +subsection \<open>Rules for set complement\<close>
    6.69  
    6.70  lemma ComplI: "(c:A \<Longrightarrow> False) \<Longrightarrow> c : Compl(A)"
    6.71    unfolding Compl_def by (blast intro: CollectI)
    6.72 @@ -205,7 +205,7 @@
    6.73  lemmas ComplE = ComplD [elim_format]
    6.74  
    6.75  
    6.76 -subsection {* Empty sets *}
    6.77 +subsection \<open>Empty sets\<close>
    6.78  
    6.79  lemma empty_eq: "{x. False} = {}"
    6.80    by (simp add: empty_def)
    6.81 @@ -225,7 +225,7 @@
    6.82  qed
    6.83  
    6.84  
    6.85 -subsection {* Singleton sets *}
    6.86 +subsection \<open>Singleton sets\<close>
    6.87  
    6.88  lemma singletonI: "a : {a}"
    6.89    unfolding singleton_def by (blast intro: CollectI)
    6.90 @@ -236,7 +236,7 @@
    6.91  lemmas singletonE = singletonD [elim_format]
    6.92  
    6.93  
    6.94 -subsection {* Unions of families *}
    6.95 +subsection \<open>Unions of families\<close>
    6.96  
    6.97  (*The order of the premises presupposes that A is rigid; b may be flexible*)
    6.98  lemma UN_I: "\<lbrakk>a:A; b: B(a)\<rbrakk> \<Longrightarrow> b: (UN x:A. B(x))"
    6.99 @@ -249,7 +249,7 @@
   6.100    by (simp add: UNION_def cong: bex_cong)
   6.101  
   6.102  
   6.103 -subsection {* Intersections of families *}
   6.104 +subsection \<open>Intersections of families\<close>
   6.105  
   6.106  lemma INT_I: "(\<And>x. x:A \<Longrightarrow> b: B(x)) \<Longrightarrow> b : (INT x:A. B(x))"
   6.107    unfolding INTER_def by (blast intro: CollectI ballI)
   6.108 @@ -265,7 +265,7 @@
   6.109    by (simp add: INTER_def cong: ball_cong)
   6.110  
   6.111  
   6.112 -subsection {* Rules for Unions *}
   6.113 +subsection \<open>Rules for Unions\<close>
   6.114  
   6.115  (*The order of the premises presupposes that C is rigid; A may be flexible*)
   6.116  lemma UnionI: "\<lbrakk>X:C; A:X\<rbrakk> \<Longrightarrow> A : Union(C)"
   6.117 @@ -275,7 +275,7 @@
   6.118    unfolding Union_def by (blast elim: UN_E)
   6.119  
   6.120  
   6.121 -subsection {* Rules for Inter *}
   6.122 +subsection \<open>Rules for Inter\<close>
   6.123  
   6.124  lemma InterI: "(\<And>X. X:C \<Longrightarrow> A:X) \<Longrightarrow> A : Inter(C)"
   6.125    unfolding Inter_def by (blast intro: INT_I)
   6.126 @@ -290,9 +290,9 @@
   6.127    unfolding Inter_def by (blast elim: INT_E)
   6.128  
   6.129  
   6.130 -section {* Derived rules involving subsets; Union and Intersection as lattice operations *}
   6.131 +section \<open>Derived rules involving subsets; Union and Intersection as lattice operations\<close>
   6.132  
   6.133 -subsection {* Big Union -- least upper bound of a set *}
   6.134 +subsection \<open>Big Union -- least upper bound of a set\<close>
   6.135  
   6.136  lemma Union_upper: "B:A \<Longrightarrow> B <= Union(A)"
   6.137    by (blast intro: subsetI UnionI)
   6.138 @@ -301,7 +301,7 @@
   6.139    by (blast intro: subsetI dest: subsetD elim: UnionE)
   6.140  
   6.141  
   6.142 -subsection {* Big Intersection -- greatest lower bound of a set *}
   6.143 +subsection \<open>Big Intersection -- greatest lower bound of a set\<close>
   6.144  
   6.145  lemma Inter_lower: "B:A \<Longrightarrow> Inter(A) <= B"
   6.146    by (blast intro: subsetI dest: InterD)
   6.147 @@ -310,7 +310,7 @@
   6.148    by (blast intro: subsetI InterI dest: subsetD)
   6.149  
   6.150  
   6.151 -subsection {* Finite Union -- the least upper bound of 2 sets *}
   6.152 +subsection \<open>Finite Union -- the least upper bound of 2 sets\<close>
   6.153  
   6.154  lemma Un_upper1: "A <= A Un B"
   6.155    by (blast intro: subsetI UnI1)
   6.156 @@ -322,7 +322,7 @@
   6.157    by (blast intro: subsetI elim: UnE dest: subsetD)
   6.158  
   6.159  
   6.160 -subsection {* Finite Intersection -- the greatest lower bound of 2 sets *}
   6.161 +subsection \<open>Finite Intersection -- the greatest lower bound of 2 sets\<close>
   6.162  
   6.163  lemma Int_lower1: "A Int B <= A"
   6.164    by (blast intro: subsetI elim: IntE)
   6.165 @@ -334,7 +334,7 @@
   6.166    by (blast intro: subsetI IntI dest: subsetD)
   6.167  
   6.168  
   6.169 -subsection {* Monotonicity *}
   6.170 +subsection \<open>Monotonicity\<close>
   6.171  
   6.172  lemma monoI: "(\<And>A B. A <= B \<Longrightarrow> f(A) <= f(B)) \<Longrightarrow> mono(f)"
   6.173    unfolding mono_def by blast
   6.174 @@ -349,7 +349,7 @@
   6.175    by (blast intro: Int_greatest dest: monoD intro: Int_lower1 Int_lower2)
   6.176  
   6.177  
   6.178 -subsection {* Automated reasoning setup *}
   6.179 +subsection \<open>Automated reasoning setup\<close>
   6.180  
   6.181  lemmas [intro!] = ballI subsetI InterI INT_I CollectI ComplI IntI UnCI singletonI
   6.182    and [intro] = bexI UnionI UN_I
   6.183 @@ -369,9 +369,9 @@
   6.184    and [cong] = ball_cong bex_cong INT_cong UN_cong
   6.185  
   6.186  
   6.187 -section {* Equalities involving union, intersection, inclusion, etc. *}
   6.188 +section \<open>Equalities involving union, intersection, inclusion, etc.\<close>
   6.189  
   6.190 -subsection {* Binary Intersection *}
   6.191 +subsection \<open>Binary Intersection\<close>
   6.192  
   6.193  lemma Int_absorb: "A Int A = A"
   6.194    by (blast intro: equalityI)
   6.195 @@ -389,7 +389,7 @@
   6.196    by (blast intro: equalityI elim: equalityE)
   6.197  
   6.198  
   6.199 -subsection {* Binary Union *}
   6.200 +subsection \<open>Binary Union\<close>
   6.201  
   6.202  lemma Un_absorb: "A Un A = A"
   6.203    by (blast intro: equalityI)
   6.204 @@ -411,7 +411,7 @@
   6.205    by (blast intro: equalityI elim: equalityE)
   6.206  
   6.207  
   6.208 -subsection {* Simple properties of @{text "Compl"} -- complement of a set *}
   6.209 +subsection \<open>Simple properties of @{text "Compl"} -- complement of a set\<close>
   6.210  
   6.211  lemma Compl_disjoint: "A Int Compl(A) = {x. False}"
   6.212    by (blast intro: equalityI)
   6.213 @@ -439,7 +439,7 @@
   6.214    by (blast intro: equalityI elim: equalityE)
   6.215  
   6.216  
   6.217 -subsection {* Big Union and Intersection *}
   6.218 +subsection \<open>Big Union and Intersection\<close>
   6.219  
   6.220  lemma Union_Un_distrib: "Union(A Un B) = Union(A) Un Union(B)"
   6.221    by (blast intro: equalityI)
   6.222 @@ -452,7 +452,7 @@
   6.223    by (blast intro: equalityI)
   6.224  
   6.225  
   6.226 -subsection {* Unions and Intersections of Families *}
   6.227 +subsection \<open>Unions and Intersections of Families\<close>
   6.228  
   6.229  lemma UN_eq: "(UN x:A. B(x)) = Union({Y. EX x:A. Y=B(x)})"
   6.230    by (blast intro: equalityI)
   6.231 @@ -468,7 +468,7 @@
   6.232    by (blast intro: equalityI)
   6.233  
   6.234  
   6.235 -section {* Monotonicity of various operations *}
   6.236 +section \<open>Monotonicity of various operations\<close>
   6.237  
   6.238  lemma Union_mono: "A<=B \<Longrightarrow> Union(A) <= Union(B)"
   6.239    by blast
     7.1 --- a/src/CCL/Term.thy	Thu Jul 23 14:20:51 2015 +0200
     7.2 +++ b/src/CCL/Term.thy	Thu Jul 23 14:25:05 2015 +0200
     7.3 @@ -3,7 +3,7 @@
     7.4      Copyright   1993  University of Cambridge
     7.5  *)
     7.6  
     7.7 -section {* Definitions of usual program constructs in CCL *}
     7.8 +section \<open>Definitions of usual program constructs in CCL\<close>
     7.9  
    7.10  theory Term
    7.11  imports CCL
    7.12 @@ -52,7 +52,7 @@
    7.13    "_letrec3" :: "[id,id,id,id,i,i]\<Rightarrow>i" ("(3letrec _ _ _ _ be _/ in _)"
    7.14                          [0,0,0,0,0,60] 60)
    7.15  
    7.16 -ML {*
    7.17 +ML \<open>
    7.18  (** Quantifier translations: variable binding **)
    7.19  
    7.20  (* FIXME does not handle "_idtdummy" *)
    7.21 @@ -91,21 +91,21 @@
    7.22           val (x',a') = Syntax_Trans.variant_abs(x,T,a3)
    7.23       in Const(@{syntax_const "_letrec3"},dummyT) $ Free(f',SS) $ Free(x',T) $ Free(y',U) $ Free(z',V) $ a' $ b'
    7.24        end;
    7.25 -*}
    7.26 +\<close>
    7.27  
    7.28 -parse_translation {*
    7.29 +parse_translation \<open>
    7.30   [(@{syntax_const "_let"}, K let_tr),
    7.31    (@{syntax_const "_letrec"}, K letrec_tr),
    7.32    (@{syntax_const "_letrec2"}, K letrec2_tr),
    7.33    (@{syntax_const "_letrec3"}, K letrec3_tr)]
    7.34 -*}
    7.35 +\<close>
    7.36  
    7.37 -print_translation {*
    7.38 +print_translation \<open>
    7.39   [(@{const_syntax let}, K let_tr'),
    7.40    (@{const_syntax letrec}, K letrec_tr'),
    7.41    (@{const_syntax letrec2}, K letrec2_tr'),
    7.42    (@{const_syntax letrec3}, K letrec3_tr')]
    7.43 -*}
    7.44 +\<close>
    7.45  
    7.46  consts
    7.47    napply     :: "[i\<Rightarrow>i,i,i]\<Rightarrow>i"            ("(_ ^ _ ` _)" [56,56,56] 56)
    7.48 @@ -156,7 +156,7 @@
    7.49    and genrec_defs = letrec_def letrec2_def letrec3_def
    7.50  
    7.51  
    7.52 -subsection {* Beta Rules, including strictness *}
    7.53 +subsection \<open>Beta Rules, including strictness\<close>
    7.54  
    7.55  lemma letB: "\<not> t=bot \<Longrightarrow> let x be t in f(x) = f(t)"
    7.56    apply (unfold let_def)
    7.57 @@ -200,11 +200,11 @@
    7.58  
    7.59  lemmas rawBs = caseBs applyB applyBbot
    7.60  
    7.61 -method_setup beta_rl = {*
    7.62 +method_setup beta_rl = \<open>
    7.63    Scan.succeed (fn ctxt =>
    7.64      SIMPLE_METHOD' (CHANGED o
    7.65        simp_tac (ctxt addsimps @{thms rawBs} setloop (fn _ => stac ctxt @{thm letrecB}))))
    7.66 -*}
    7.67 +\<close>
    7.68  
    7.69  lemma ifBtrue: "if true then t else u = t"
    7.70    and ifBfalse: "if false then t else u = u"
    7.71 @@ -272,7 +272,7 @@
    7.72    napplyBzero napplyBsucc
    7.73  
    7.74  
    7.75 -subsection {* Constructors are injective *}
    7.76 +subsection \<open>Constructors are injective\<close>
    7.77  
    7.78  lemma term_injs:
    7.79    "(inl(a) = inl(a')) \<longleftrightarrow> (a=a')"
    7.80 @@ -282,16 +282,16 @@
    7.81    by (inj_rl applyB splitB whenBinl whenBinr ncaseBsucc lcaseBcons)
    7.82  
    7.83  
    7.84 -subsection {* Constructors are distinct *}
    7.85 +subsection \<open>Constructors are distinct\<close>
    7.86  
    7.87 -ML {*
    7.88 +ML \<open>
    7.89  ML_Thms.bind_thms ("term_dstncts",
    7.90    mkall_dstnct_thms @{context} @{thms data_defs} (@{thms ccl_injs} @ @{thms term_injs})
    7.91      [["bot","inl","inr"], ["bot","zero","succ"], ["bot","nil","cons"]]);
    7.92 -*}
    7.93 +\<close>
    7.94  
    7.95  
    7.96 -subsection {* Rules for pre-order @{text "[="} *}
    7.97 +subsection \<open>Rules for pre-order @{text "[="}\<close>
    7.98  
    7.99  lemma term_porews:
   7.100    "inl(a) [= inl(a') \<longleftrightarrow> a [= a'"
   7.101 @@ -301,11 +301,11 @@
   7.102    by (simp_all add: data_defs ccl_porews)
   7.103  
   7.104  
   7.105 -subsection {* Rewriting and Proving *}
   7.106 +subsection \<open>Rewriting and Proving\<close>
   7.107  
   7.108 -ML {*
   7.109 +ML \<open>
   7.110    ML_Thms.bind_thms ("term_injDs", XH_to_Ds @{thms term_injs});
   7.111 -*}
   7.112 +\<close>
   7.113  
   7.114  lemmas term_rews = termBs term_injs term_dstncts ccl_porews term_porews
   7.115  
     8.1 --- a/src/CCL/Trancl.thy	Thu Jul 23 14:20:51 2015 +0200
     8.2 +++ b/src/CCL/Trancl.thy	Thu Jul 23 14:25:05 2015 +0200
     8.3 @@ -3,7 +3,7 @@
     8.4      Copyright   1993  University of Cambridge
     8.5  *)
     8.6  
     8.7 -section {* Transitive closure of a relation *}
     8.8 +section \<open>Transitive closure of a relation\<close>
     8.9  
    8.10  theory Trancl
    8.11  imports CCL
    8.12 @@ -25,7 +25,7 @@
    8.13    where "r^+ == r O rtrancl(r)"
    8.14  
    8.15  
    8.16 -subsection {* Natural deduction for @{text "trans(r)"} *}
    8.17 +subsection \<open>Natural deduction for @{text "trans(r)"}\<close>
    8.18  
    8.19  lemma transI: "(\<And>x y z. \<lbrakk><x,y>:r; <y,z>:r\<rbrakk> \<Longrightarrow> <x,z>:r) \<Longrightarrow> trans(r)"
    8.20    unfolding trans_def by blast
    8.21 @@ -34,7 +34,7 @@
    8.22    unfolding trans_def by blast
    8.23  
    8.24  
    8.25 -subsection {* Identity relation *}
    8.26 +subsection \<open>Identity relation\<close>
    8.27  
    8.28  lemma idI: "<a,a> : id"
    8.29    apply (unfold id_def)
    8.30 @@ -50,7 +50,7 @@
    8.31    done
    8.32  
    8.33  
    8.34 -subsection {* Composition of two relations *}
    8.35 +subsection \<open>Composition of two relations\<close>
    8.36  
    8.37  lemma compI: "\<lbrakk><a,b>:s; <b,c>:r\<rbrakk> \<Longrightarrow> <a,c> : r O s"
    8.38    unfolding relcomp_def by blast
    8.39 @@ -72,7 +72,7 @@
    8.40    by blast
    8.41  
    8.42  
    8.43 -subsection {* The relation rtrancl *}
    8.44 +subsection \<open>The relation rtrancl\<close>
    8.45  
    8.46  lemma rtrancl_fun_mono: "mono(\<lambda>s. id Un (r O s))"
    8.47    apply (rule monoI)
    8.48 @@ -102,7 +102,7 @@
    8.49    done
    8.50  
    8.51  
    8.52 -subsection {* standard induction rule *}
    8.53 +subsection \<open>standard induction rule\<close>
    8.54  
    8.55  lemma rtrancl_full_induct:
    8.56    "\<lbrakk><a,b> : r^*;
    8.57 @@ -149,9 +149,9 @@
    8.58    done
    8.59  
    8.60  
    8.61 -subsection {* The relation trancl *}
    8.62 +subsection \<open>The relation trancl\<close>
    8.63  
    8.64 -subsubsection {* Conversions between trancl and rtrancl *}
    8.65 +subsubsection \<open>Conversions between trancl and rtrancl\<close>
    8.66  
    8.67  lemma trancl_into_rtrancl: "<a,b> : r^+ \<Longrightarrow> <a,b> : r^*"
    8.68    apply (unfold trancl_def)
     9.1 --- a/src/CCL/Type.thy	Thu Jul 23 14:20:51 2015 +0200
     9.2 +++ b/src/CCL/Type.thy	Thu Jul 23 14:25:05 2015 +0200
     9.3 @@ -3,7 +3,7 @@
     9.4      Copyright   1993  University of Cambridge
     9.5  *)
     9.6  
     9.7 -section {* Types in CCL are defined as sets of terms *}
     9.8 +section \<open>Types in CCL are defined as sets of terms\<close>
     9.9  
    9.10  theory Type
    9.11  imports Term
    9.12 @@ -45,12 +45,12 @@
    9.13    "A * B"       => "CONST Sigma(A, \<lambda>_. B)"
    9.14    "{x: A. B}"   == "CONST Subtype(A, \<lambda>x. B)"
    9.15  
    9.16 -print_translation {*
    9.17 +print_translation \<open>
    9.18   [(@{const_syntax Pi},
    9.19      fn _ => Syntax_Trans.dependent_tr' (@{syntax_const "_Pi"}, @{syntax_const "_arrow"})),
    9.20    (@{const_syntax Sigma},
    9.21      fn _ => Syntax_Trans.dependent_tr' (@{syntax_const "_Sigma"}, @{syntax_const "_star"}))]
    9.22 -*}
    9.23 +\<close>
    9.24  
    9.25  defs
    9.26    Subtype_def: "{x:A. P(x)} == {x. x:A \<and> P(x)}"
    9.27 @@ -82,7 +82,7 @@
    9.28    by blast
    9.29  
    9.30  
    9.31 -subsection {* Exhaustion Rules *}
    9.32 +subsection \<open>Exhaustion Rules\<close>
    9.33  
    9.34  lemma EmptyXH: "\<And>a. a : {} \<longleftrightarrow> False"
    9.35    and SubtypeXH: "\<And>a A P. a : {x:A. P(x)} \<longleftrightarrow> (a:A \<and> P(a))"
    9.36 @@ -100,10 +100,10 @@
    9.37    and TexXH: "a : TEX X. B(X) \<longleftrightarrow> (EX X. a:B(X))"
    9.38    unfolding simp_type_defs by blast+
    9.39  
    9.40 -ML {* ML_Thms.bind_thms ("case_rls", XH_to_Es @{thms XHs}) *}
    9.41 +ML \<open>ML_Thms.bind_thms ("case_rls", XH_to_Es @{thms XHs})\<close>
    9.42  
    9.43  
    9.44 -subsection {* Canonical Type Rules *}
    9.45 +subsection \<open>Canonical Type Rules\<close>
    9.46  
    9.47  lemma oneT: "one : Unit"
    9.48    and trueT: "true : Bool"
    9.49 @@ -117,13 +117,13 @@
    9.50  lemmas canTs = oneT trueT falseT pairT lamT inlT inrT
    9.51  
    9.52  
    9.53 -subsection {* Non-Canonical Type Rules *}
    9.54 +subsection \<open>Non-Canonical Type Rules\<close>
    9.55  
    9.56  lemma lem: "\<lbrakk>a:B(u); u = v\<rbrakk> \<Longrightarrow> a : B(v)"
    9.57    by blast
    9.58  
    9.59  
    9.60 -ML {*
    9.61 +ML \<open>
    9.62  fun mk_ncanT_tac top_crls crls =
    9.63    SUBPROOF (fn {context = ctxt, prems = major :: prems, ...} =>
    9.64      resolve_tac ctxt ([major] RL top_crls) 1 THEN
    9.65 @@ -132,11 +132,11 @@
    9.66      ALLGOALS (assume_tac ctxt ORELSE' resolve_tac ctxt (prems RL [@{thm lem}])
    9.67        ORELSE' eresolve_tac ctxt @{thms bspec}) THEN
    9.68      safe_tac (ctxt addSIs prems))
    9.69 -*}
    9.70 +\<close>
    9.71  
    9.72 -method_setup ncanT = {*
    9.73 +method_setup ncanT = \<open>
    9.74    Scan.succeed (SIMPLE_METHOD' o mk_ncanT_tac @{thms case_rls} @{thms case_rls})
    9.75 -*}
    9.76 +\<close>
    9.77  
    9.78  lemma ifT: "\<lbrakk>b:Bool; b=true \<Longrightarrow> t:A(true); b=false \<Longrightarrow> u:A(false)\<rbrakk> \<Longrightarrow> if b then t else u : A(b)"
    9.79    by ncanT
    9.80 @@ -156,7 +156,7 @@
    9.81  lemmas ncanTs = ifT applyT splitT whenT
    9.82  
    9.83  
    9.84 -subsection {* Subtypes *}
    9.85 +subsection \<open>Subtypes\<close>
    9.86  
    9.87  lemma SubtypeD1: "a : Subtype(A, P) \<Longrightarrow> a : A"
    9.88    and SubtypeD2: "a : Subtype(A, P) \<Longrightarrow> P(a)"
    9.89 @@ -169,7 +169,7 @@
    9.90    by (simp add: SubtypeXH)
    9.91  
    9.92  
    9.93 -subsection {* Monotonicity *}
    9.94 +subsection \<open>Monotonicity\<close>
    9.95  
    9.96  lemma idM: "mono (\<lambda>X. X)"
    9.97    apply (rule monoI)
    9.98 @@ -206,9 +206,9 @@
    9.99      dest!: monoD [THEN subsetD])
   9.100  
   9.101  
   9.102 -subsection {* Recursive types *}
   9.103 +subsection \<open>Recursive types\<close>
   9.104  
   9.105 -subsubsection {* Conversion Rules for Fixed Points via monotonicity and Tarski *}
   9.106 +subsubsection \<open>Conversion Rules for Fixed Points via monotonicity and Tarski\<close>
   9.107  
   9.108  lemma NatM: "mono(\<lambda>X. Unit+X)"
   9.109    apply (rule PlusM constM idM)+
   9.110 @@ -245,7 +245,7 @@
   9.111  lemmas ind_type_eqs = def_NatB def_ListB def_ListsB def_IListsB
   9.112  
   9.113  
   9.114 -subsection {* Exhaustion Rules *}
   9.115 +subsection \<open>Exhaustion Rules\<close>
   9.116  
   9.117  lemma NatXH: "a : Nat \<longleftrightarrow> (a=zero | (EX x:Nat. a=succ(x)))"
   9.118    and ListXH: "a : List(A) \<longleftrightarrow> (a=[] | (EX x:A. EX xs:List(A).a=x$xs))"
   9.119 @@ -256,10 +256,10 @@
   9.120  
   9.121  lemmas iXHs = NatXH ListXH
   9.122  
   9.123 -ML {* ML_Thms.bind_thms ("icase_rls", XH_to_Es @{thms iXHs}) *}
   9.124 +ML \<open>ML_Thms.bind_thms ("icase_rls", XH_to_Es @{thms iXHs})\<close>
   9.125  
   9.126  
   9.127 -subsection {* Type Rules *}
   9.128 +subsection \<open>Type Rules\<close>
   9.129  
   9.130  lemma zeroT: "zero : Nat"
   9.131    and succT: "n:Nat \<Longrightarrow> succ(n) : Nat"
   9.132 @@ -270,9 +270,9 @@
   9.133  lemmas icanTs = zeroT succT nilT consT
   9.134  
   9.135  
   9.136 -method_setup incanT = {*
   9.137 +method_setup incanT = \<open>
   9.138    Scan.succeed (SIMPLE_METHOD' o mk_ncanT_tac @{thms icase_rls} @{thms case_rls})
   9.139 -*}
   9.140 +\<close>
   9.141  
   9.142  lemma ncaseT: "\<lbrakk>n:Nat; n=zero \<Longrightarrow> b:C(zero); \<And>x. \<lbrakk>x:Nat; n=succ(x)\<rbrakk> \<Longrightarrow> c(x):C(succ(x))\<rbrakk>
   9.143      \<Longrightarrow> ncase(n,b,c) : C(n)"
   9.144 @@ -285,7 +285,7 @@
   9.145  lemmas incanTs = ncaseT lcaseT
   9.146  
   9.147  
   9.148 -subsection {* Induction Rules *}
   9.149 +subsection \<open>Induction Rules\<close>
   9.150  
   9.151  lemmas ind_Ms = NatM ListM
   9.152  
   9.153 @@ -304,7 +304,7 @@
   9.154  lemmas inds = Nat_ind List_ind
   9.155  
   9.156  
   9.157 -subsection {* Primitive Recursive Rules *}
   9.158 +subsection \<open>Primitive Recursive Rules\<close>
   9.159  
   9.160  lemma nrecT: "\<lbrakk>n:Nat; b:C(zero); \<And>x g. \<lbrakk>x:Nat; g:C(x)\<rbrakk> \<Longrightarrow> c(x,g):C(succ(x))\<rbrakk>
   9.161      \<Longrightarrow> nrec(n,b,c) : C(n)"
   9.162 @@ -317,7 +317,7 @@
   9.163  lemmas precTs = nrecT lrecT
   9.164  
   9.165  
   9.166 -subsection {* Theorem proving *}
   9.167 +subsection \<open>Theorem proving\<close>
   9.168  
   9.169  lemma SgE2: "\<lbrakk><a,b> : Sigma(A,B); \<lbrakk>a:A; b:B(a)\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
   9.170    unfolding SgXH by blast
   9.171 @@ -326,13 +326,13 @@
   9.172  (*         - intro rules are type rules for canonical terms                *)
   9.173  (*         - elim rules are case rules (no non-canonical terms appear)     *)
   9.174  
   9.175 -ML {* ML_Thms.bind_thms ("XHEs", XH_to_Es @{thms XHs}) *}
   9.176 +ML \<open>ML_Thms.bind_thms ("XHEs", XH_to_Es @{thms XHs})\<close>
   9.177  
   9.178  lemmas [intro!] = SubtypeI canTs icanTs
   9.179    and [elim!] = SubtypeE XHEs
   9.180  
   9.181  
   9.182 -subsection {* Infinite Data Types *}
   9.183 +subsection \<open>Infinite Data Types\<close>
   9.184  
   9.185  lemma lfp_subset_gfp: "mono(f) \<Longrightarrow> lfp(f) <= gfp(f)"
   9.186    apply (rule lfp_lowerbound [THEN subset_trans])
   9.187 @@ -364,8 +364,8 @@
   9.188    done
   9.189  
   9.190  
   9.191 -subsection {* Lemmas and tactics for using the rule @{text
   9.192 -  "coinduct3"} on @{text "[="} and @{text "="} *}
   9.193 +subsection \<open>Lemmas and tactics for using the rule @{text
   9.194 +  "coinduct3"} on @{text "[="} and @{text "="}\<close>
   9.195  
   9.196  lemma lfpI: "\<lbrakk>mono(f); a : f(lfp(f))\<rbrakk> \<Longrightarrow> a : lfp(f)"
   9.197    apply (erule lfp_Tarski [THEN ssubst])
   9.198 @@ -379,12 +379,12 @@
   9.199    by simp
   9.200  
   9.201  
   9.202 -ML {*
   9.203 +ML \<open>
   9.204    val coinduct3_tac = SUBPROOF (fn {context = ctxt, prems = mono :: prems, ...} =>
   9.205      fast_tac (ctxt addIs (mono RS @{thm coinduct3_mono_lemma} RS @{thm lfpI}) :: prems) 1);
   9.206 -*}
   9.207 +\<close>
   9.208  
   9.209 -method_setup coinduct3 = {* Scan.succeed (SIMPLE_METHOD' o coinduct3_tac) *}
   9.210 +method_setup coinduct3 = \<open>Scan.succeed (SIMPLE_METHOD' o coinduct3_tac)\<close>
   9.211  
   9.212  lemma ci3_RI: "\<lbrakk>mono(Agen); a : R\<rbrakk> \<Longrightarrow> a : lfp(\<lambda>x. Agen(x) Un R Un A)"
   9.213    by coinduct3
   9.214 @@ -396,21 +396,21 @@
   9.215  lemma ci3_AI: "\<lbrakk>mono(Agen); a : A\<rbrakk> \<Longrightarrow> a : lfp(\<lambda>x. Agen(x) Un R Un A)"
   9.216    by coinduct3
   9.217  
   9.218 -ML {*
   9.219 +ML \<open>
   9.220  fun genIs_tac ctxt genXH gen_mono =
   9.221    resolve_tac ctxt [genXH RS @{thm iffD2}] THEN'
   9.222    simp_tac ctxt THEN'
   9.223    TRY o fast_tac
   9.224      (ctxt addIs [genXH RS @{thm iffD2}, gen_mono RS @{thm coinduct3_mono_lemma} RS @{thm lfpI}])
   9.225 -*}
   9.226 +\<close>
   9.227  
   9.228 -method_setup genIs = {*
   9.229 +method_setup genIs = \<open>
   9.230    Attrib.thm -- Attrib.thm >>
   9.231      (fn (genXH, gen_mono) => fn ctxt => SIMPLE_METHOD' (genIs_tac ctxt genXH gen_mono))
   9.232 -*}
   9.233 +\<close>
   9.234  
   9.235  
   9.236 -subsection {* POgen *}
   9.237 +subsection \<open>POgen\<close>
   9.238  
   9.239  lemma PO_refl: "<a,a> : PO"
   9.240    by (rule po_refl [THEN PO_iff [THEN iffD1]])
   9.241 @@ -433,7 +433,7 @@
   9.242      \<Longrightarrow> <h$t,h'$t'> : POgen(lfp(\<lambda>x. POgen(x) Un R Un PO))"
   9.243    unfolding data_defs by (genIs POgenXH POgen_mono)+
   9.244  
   9.245 -ML {*
   9.246 +ML \<open>
   9.247  fun POgen_tac ctxt (rla, rlb) i =
   9.248    SELECT_GOAL (safe_tac ctxt) i THEN
   9.249    resolve_tac ctxt [rlb RS (rla RS @{thm ssubst_pair})] i THEN
   9.250 @@ -441,10 +441,10 @@
   9.251        (@{thms POgenIs} @ [@{thm PO_refl} RS (@{thm POgen_mono} RS @{thm ci3_AI})] @
   9.252          (@{thms POgenIs} RL [@{thm POgen_mono} RS @{thm ci3_AgenI}]) @
   9.253          [@{thm POgen_mono} RS @{thm ci3_RI}]) i))
   9.254 -*}
   9.255 +\<close>
   9.256  
   9.257  
   9.258 -subsection {* EQgen *}
   9.259 +subsection \<open>EQgen\<close>
   9.260  
   9.261  lemma EQ_refl: "<a,a> : EQ"
   9.262    by (rule refl [THEN EQ_iff [THEN iffD1]])
   9.263 @@ -467,7 +467,7 @@
   9.264      \<Longrightarrow> <h$t,h'$t'> : EQgen(lfp(\<lambda>x. EQgen(x) Un R Un EQ))"
   9.265    unfolding data_defs by (genIs EQgenXH EQgen_mono)+
   9.266  
   9.267 -ML {*
   9.268 +ML \<open>
   9.269  fun EQgen_raw_tac ctxt i =
   9.270    (REPEAT (resolve_tac ctxt (@{thms EQgenIs} @
   9.271          [@{thm EQ_refl} RS (@{thm EQgen_mono} RS @{thm ci3_AI})] @
   9.272 @@ -484,10 +484,10 @@
   9.273      resolve_tac ctxt ((rews @ [@{thm refl}]) RL ((rews @ [@{thm refl}]) RL [@{thm ssubst_pair}])) i THEN
   9.274      ALLGOALS (simp_tac ctxt) THEN
   9.275      ALLGOALS (EQgen_raw_tac ctxt)) i
   9.276 -*}
   9.277 +\<close>
   9.278  
   9.279 -method_setup EQgen = {*
   9.280 +method_setup EQgen = \<open>
   9.281    Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (EQgen_tac ctxt ths))
   9.282 -*}
   9.283 +\<close>
   9.284  
   9.285  end
    10.1 --- a/src/CCL/Wfd.thy	Thu Jul 23 14:20:51 2015 +0200
    10.2 +++ b/src/CCL/Wfd.thy	Thu Jul 23 14:25:05 2015 +0200
    10.3 @@ -3,7 +3,7 @@
    10.4      Copyright   1993  University of Cambridge
    10.5  *)
    10.6  
    10.7 -section {* Well-founded relations in CCL *}
    10.8 +section \<open>Well-founded relations in CCL\<close>
    10.9  
   10.10  theory Wfd
   10.11  imports Trancl Type Hered
   10.12 @@ -46,12 +46,12 @@
   10.13    apply blast
   10.14    done
   10.15  
   10.16 -method_setup wfd_strengthen = {*
   10.17 +method_setup wfd_strengthen = \<open>
   10.18    Scan.lift Args.name_inner_syntax >> (fn s => fn ctxt =>
   10.19      SIMPLE_METHOD' (fn i =>
   10.20        Rule_Insts.res_inst_tac ctxt [((("Q", 0), Position.none), s)] [] @{thm wfd_strengthen_lemma} i
   10.21          THEN assume_tac ctxt (i + 1)))
   10.22 -*}
   10.23 +\<close>
   10.24  
   10.25  lemma wf_anti_sym: "\<lbrakk>Wfd(r); <a,x>:r; <x,a>:r\<rbrakk> \<Longrightarrow> P"
   10.26    apply (subgoal_tac "ALL x. <a,x>:r \<longrightarrow> <x,a>:r \<longrightarrow> P")
   10.27 @@ -66,7 +66,7 @@
   10.28    done
   10.29  
   10.30  
   10.31 -subsection {* Irreflexive transitive closure *}
   10.32 +subsection \<open>Irreflexive transitive closure\<close>
   10.33  
   10.34  lemma trancl_wf:
   10.35    assumes 1: "Wfd(R)"
   10.36 @@ -85,7 +85,7 @@
   10.37    done
   10.38  
   10.39  
   10.40 -subsection {* Lexicographic Ordering *}
   10.41 +subsection \<open>Lexicographic Ordering\<close>
   10.42  
   10.43  lemma lexXH:
   10.44    "p : ra**rb \<longleftrightarrow> (EX a a' b b'. p = <<a,b>,<a',b'>> \<and> (<a,a'> : ra | a=a' \<and> <b,b'> : rb))"
   10.45 @@ -128,7 +128,7 @@
   10.46    done
   10.47  
   10.48  
   10.49 -subsection {* Mapping *}
   10.50 +subsection \<open>Mapping\<close>
   10.51  
   10.52  lemma wmapXH: "p : wmap(f,r) \<longleftrightarrow> (EX x y. p=<x,y> \<and> <f(x),f(y)> : r)"
   10.53    unfolding wmap_def by blast
   10.54 @@ -156,7 +156,7 @@
   10.55    done
   10.56  
   10.57  
   10.58 -subsection {* Projections *}
   10.59 +subsection \<open>Projections\<close>
   10.60  
   10.61  lemma wfstI: "<xa,ya> : r \<Longrightarrow> <<xa,xb>,<ya,yb>> : wmap(fst,r)"
   10.62    apply (rule wmapI)
   10.63 @@ -174,7 +174,7 @@
   10.64    done
   10.65  
   10.66  
   10.67 -subsection {* Ground well-founded relations *}
   10.68 +subsection \<open>Ground well-founded relations\<close>
   10.69  
   10.70  lemma wfI: "\<lbrakk>Wfd(r);  a : r\<rbrakk> \<Longrightarrow> a : wf(r)"
   10.71    unfolding wf_def by blast
   10.72 @@ -220,7 +220,7 @@
   10.73    done
   10.74  
   10.75  
   10.76 -subsection {* General Recursive Functions *}
   10.77 +subsection \<open>General Recursive Functions\<close>
   10.78  
   10.79  lemma letrecT:
   10.80    assumes 1: "a : A"
   10.81 @@ -282,7 +282,7 @@
   10.82  lemmas letrecTs = letrecT letrec2T letrec3T
   10.83  
   10.84  
   10.85 -subsection {* Type Checking for Recursive Calls *}
   10.86 +subsection \<open>Type Checking for Recursive Calls\<close>
   10.87  
   10.88  lemma rcallT:
   10.89    "\<lbrakk>ALL x:{x:A.<x,p>:wf(R)}.g(x):D(x);  
   10.90 @@ -303,7 +303,7 @@
   10.91  lemmas rcallTs = rcallT rcall2T rcall3T
   10.92  
   10.93  
   10.94 -subsection {* Instantiating an induction hypothesis with an equality assumption *}
   10.95 +subsection \<open>Instantiating an induction hypothesis with an equality assumption\<close>
   10.96  
   10.97  lemma hyprcallT:
   10.98    assumes 1: "g(a) = b"
   10.99 @@ -360,7 +360,7 @@
  10.100  lemmas hyprcallTs = hyprcallT hyprcall2T hyprcall3T
  10.101  
  10.102  
  10.103 -subsection {* Rules to Remove Induction Hypotheses after Type Checking *}
  10.104 +subsection \<open>Rules to Remove Induction Hypotheses after Type Checking\<close>
  10.105  
  10.106  lemma rmIH1: "\<lbrakk>ALL x:{x:A.<x,p>:wf(R)}.g(x):D(x); P\<rbrakk> \<Longrightarrow> P" .
  10.107  
  10.108 @@ -372,7 +372,7 @@
  10.109  lemmas rmIHs = rmIH1 rmIH2 rmIH3
  10.110  
  10.111  
  10.112 -subsection {* Lemmas for constructors and subtypes *}
  10.113 +subsection \<open>Lemmas for constructors and subtypes\<close>
  10.114  
  10.115  (* 0-ary constructors do not need additional rules as they are handled *)
  10.116  (*                                      correctly by applying SubtypeI *)
  10.117 @@ -404,9 +404,9 @@
  10.118  lemmas rcall_lemmas = asm_rl rcall_lemma1 SubtypeD1 rcall_lemma2
  10.119  
  10.120  
  10.121 -subsection {* Typechecking *}
  10.122 +subsection \<open>Typechecking\<close>
  10.123  
  10.124 -ML {*
  10.125 +ML \<open>
  10.126  local
  10.127  
  10.128  val type_rls =
  10.129 @@ -478,35 +478,35 @@
  10.130    SELECT_GOAL (REPEAT_FIRST (tc_step_tac ctxt rls) THEN clean_ccs_tac ctxt) i
  10.131  
  10.132  end
  10.133 -*}
  10.134 +\<close>
  10.135  
  10.136 -method_setup typechk = {*
  10.137 +method_setup typechk = \<open>
  10.138    Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (typechk_tac ctxt ths))
  10.139 -*}
  10.140 +\<close>
  10.141  
  10.142 -method_setup clean_ccs = {*
  10.143 +method_setup clean_ccs = \<open>
  10.144    Scan.succeed (SIMPLE_METHOD o clean_ccs_tac)
  10.145 -*}
  10.146 +\<close>
  10.147  
  10.148 -method_setup gen_ccs = {*
  10.149 +method_setup gen_ccs = \<open>
  10.150    Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (gen_ccs_tac ctxt ths))
  10.151 -*}
  10.152 +\<close>
  10.153  
  10.154  
  10.155 -subsection {* Evaluation *}
  10.156 +subsection \<open>Evaluation\<close>
  10.157  
  10.158  named_theorems eval "evaluation rules"
  10.159  
  10.160 -ML {*
  10.161 +ML \<open>
  10.162  fun eval_tac ths =
  10.163    Subgoal.FOCUS_PREMS (fn {context = ctxt, prems, ...} =>
  10.164      let val eval_rules = Named_Theorems.get ctxt @{named_theorems eval}
  10.165      in DEPTH_SOLVE_1 (resolve_tac ctxt (ths @ prems @ rev eval_rules) 1) end)
  10.166 -*}
  10.167 +\<close>
  10.168  
  10.169 -method_setup eval = {*
  10.170 +method_setup eval = \<open>
  10.171    Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (CHANGED o eval_tac ths ctxt))
  10.172 -*}
  10.173 +\<close>
  10.174  
  10.175  
  10.176  lemmas eval_rls [eval] = trueV falseV pairV lamV caseVtrue caseVfalse caseVpair caseVlam
  10.177 @@ -523,9 +523,9 @@
  10.178    shows "let x be t in f(x) ---> c"
  10.179    apply (unfold let_def)
  10.180    apply (rule 1 [THEN canonical])
  10.181 -  apply (tactic {*
  10.182 +  apply (tactic \<open>
  10.183      REPEAT (DEPTH_SOLVE_1 (resolve_tac @{context} (@{thms assms} @ @{thms eval_rls}) 1 ORELSE
  10.184 -      eresolve_tac @{context} @{thms substitute} 1)) *})
  10.185 +      eresolve_tac @{context} @{thms substitute} 1))\<close>)
  10.186    done
  10.187  
  10.188  lemma fixV: "f(fix(f)) ---> c \<Longrightarrow> fix(f) ---> c"
  10.189 @@ -566,7 +566,7 @@
  10.190    unfolding data_defs by eval+
  10.191  
  10.192  
  10.193 -subsection {* Factorial *}
  10.194 +subsection \<open>Factorial\<close>
  10.195  
  10.196  schematic_lemma
  10.197    "letrec f n be ncase(n,succ(zero),\<lambda>x. nrec(n,zero,\<lambda>y g. nrec(f(x),g,\<lambda>z h. succ(h))))  
  10.198 @@ -578,7 +578,7 @@
  10.199     in f(succ(succ(succ(zero)))) ---> ?a"
  10.200    by eval
  10.201  
  10.202 -subsection {* Less Than Or Equal *}
  10.203 +subsection \<open>Less Than Or Equal\<close>
  10.204  
  10.205  schematic_lemma
  10.206    "letrec f p be split(p,\<lambda>m n. ncase(m,true,\<lambda>x. ncase(n,false,\<lambda>y. f(<x,y>))))
  10.207 @@ -596,7 +596,7 @@
  10.208    by eval
  10.209  
  10.210  
  10.211 -subsection {* Reverse *}
  10.212 +subsection \<open>Reverse\<close>
  10.213  
  10.214  schematic_lemma
  10.215    "letrec id l be lcase(l,[],\<lambda>x xs. x$id(xs))  
    11.1 --- a/src/CCL/ex/Flag.thy	Thu Jul 23 14:20:51 2015 +0200
    11.2 +++ b/src/CCL/ex/Flag.thy	Thu Jul 23 14:25:05 2015 +0200
    11.3 @@ -3,8 +3,8 @@
    11.4      Copyright   1993  University of Cambridge
    11.5  *)
    11.6  
    11.7 -section {* Dutch national flag program -- except that the point of Dijkstra's example was to use
    11.8 -  arrays and this uses lists. *}
    11.9 +section \<open>Dutch national flag program -- except that the point of Dijkstra's example was to use
   11.10 +  arrays and this uses lists.\<close>
   11.11  
   11.12  theory Flag
   11.13  imports List
    12.1 --- a/src/CCL/ex/List.thy	Thu Jul 23 14:20:51 2015 +0200
    12.2 +++ b/src/CCL/ex/List.thy	Thu Jul 23 14:25:05 2015 +0200
    12.3 @@ -3,7 +3,7 @@
    12.4      Copyright   1993  University of Cambridge
    12.5  *)
    12.6  
    12.7 -section {* Programs defined over lists *}
    12.8 +section \<open>Programs defined over lists\<close>
    12.9  
   12.10  theory List
   12.11  imports Nat
    13.1 --- a/src/CCL/ex/Nat.thy	Thu Jul 23 14:20:51 2015 +0200
    13.2 +++ b/src/CCL/ex/Nat.thy	Thu Jul 23 14:25:05 2015 +0200
    13.3 @@ -3,7 +3,7 @@
    13.4      Copyright   1993  University of Cambridge
    13.5  *)
    13.6  
    13.7 -section {* Programs defined over the natural numbers *}
    13.8 +section \<open>Programs defined over the natural numbers\<close>
    13.9  
   13.10  theory Nat
   13.11  imports "../Wfd"
   13.12 @@ -96,7 +96,7 @@
   13.13    done
   13.14  
   13.15  
   13.16 -subsection {* Termination Conditions for Ackermann's Function *}
   13.17 +subsection \<open>Termination Conditions for Ackermann's Function\<close>
   13.18  
   13.19  lemmas relI = NatPR_wf [THEN NatPR_wf [THEN lex_wf, THEN wfI]]
   13.20  
    14.1 --- a/src/CCL/ex/Stream.thy	Thu Jul 23 14:20:51 2015 +0200
    14.2 +++ b/src/CCL/ex/Stream.thy	Thu Jul 23 14:25:05 2015 +0200
    14.3 @@ -3,7 +3,7 @@
    14.4      Copyright   1993  University of Cambridge
    14.5  *)
    14.6  
    14.7 -section {* Programs defined over streams *}
    14.8 +section \<open>Programs defined over streams\<close>
    14.9  
   14.10  theory Stream
   14.11  imports List
   14.12 @@ -22,7 +22,7 @@
   14.13  *)
   14.14  
   14.15  
   14.16 -subsection {* Map of composition is composition of maps *}
   14.17 +subsection \<open>Map of composition is composition of maps\<close>
   14.18  
   14.19  lemma map_comp:
   14.20    assumes 1: "l:Lists(A)"
   14.21 @@ -49,7 +49,7 @@
   14.22    done
   14.23  
   14.24  
   14.25 -subsection {* Mapping distributes over append *}
   14.26 +subsection \<open>Mapping distributes over append\<close>
   14.27  
   14.28  lemma map_append:
   14.29    assumes "l:Lists(A)"
   14.30 @@ -67,7 +67,7 @@
   14.31    done
   14.32  
   14.33  
   14.34 -subsection {* Append is associative *}
   14.35 +subsection \<open>Append is associative\<close>
   14.36  
   14.37  lemma append_assoc:
   14.38    assumes "k:Lists(A)"
   14.39 @@ -82,12 +82,12 @@
   14.40    apply EQgen
   14.41     prefer 2
   14.42     apply blast
   14.43 -  apply (tactic {* DEPTH_SOLVE (eresolve_tac @{context} [XH_to_E @{thm ListsXH}] 1
   14.44 -    THEN EQgen_tac @{context} [] 1) *})
   14.45 +  apply (tactic \<open>DEPTH_SOLVE (eresolve_tac @{context} [XH_to_E @{thm ListsXH}] 1
   14.46 +    THEN EQgen_tac @{context} [] 1)\<close>)
   14.47    done
   14.48  
   14.49  
   14.50 -subsection {* Appending anything to an infinite list doesn't alter it *}
   14.51 +subsection \<open>Appending anything to an infinite list doesn't alter it\<close>
   14.52  
   14.53  lemma ilist_append:
   14.54    assumes "l:ILists(A)"
    15.1 --- a/src/CTT/Arith.thy	Thu Jul 23 14:20:51 2015 +0200
    15.2 +++ b/src/CTT/Arith.thy	Thu Jul 23 14:25:05 2015 +0200
    15.3 @@ -3,13 +3,13 @@
    15.4      Copyright   1991  University of Cambridge
    15.5  *)
    15.6  
    15.7 -section {* Elementary arithmetic *}
    15.8 +section \<open>Elementary arithmetic\<close>
    15.9  
   15.10  theory Arith
   15.11  imports Bool
   15.12  begin
   15.13  
   15.14 -subsection {* Arithmetic operators and their definitions *}
   15.15 +subsection \<open>Arithmetic operators and their definitions\<close>
   15.16  
   15.17  definition
   15.18    add :: "[i,i]\<Rightarrow>i"   (infixr "#+" 65) where
   15.19 @@ -46,7 +46,7 @@
   15.20  lemmas arith_defs = add_def diff_def absdiff_def mult_def mod_def div_def
   15.21  
   15.22  
   15.23 -subsection {* Proofs about elementary arithmetic: addition, multiplication, etc. *}
   15.24 +subsection \<open>Proofs about elementary arithmetic: addition, multiplication, etc.\<close>
   15.25  
   15.26  (** Addition *)
   15.27  
   15.28 @@ -144,7 +144,7 @@
   15.29  done
   15.30  
   15.31  
   15.32 -subsection {* Simplification *}
   15.33 +subsection \<open>Simplification\<close>
   15.34  
   15.35  lemmas arith_typing_rls = add_typing mult_typing diff_typing
   15.36    and arith_congr_rls = add_typingL mult_typingL diff_typingL
   15.37 @@ -155,7 +155,7 @@
   15.38    multC0 multC_succ
   15.39    diffC0 diff_0_eq_0 diff_succ_succ
   15.40  
   15.41 -ML {*
   15.42 +ML \<open>
   15.43  
   15.44  structure Arith_simp_data: TSIMP_DATA =
   15.45    struct
   15.46 @@ -180,18 +180,18 @@
   15.47    (Arith_simp.cond_norm_tac ctxt (prove_cond_tac ctxt, congr_rls, prems))
   15.48  
   15.49  end
   15.50 -*}
   15.51 +\<close>
   15.52  
   15.53 -method_setup arith_rew = {*
   15.54 +method_setup arith_rew = \<open>
   15.55    Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (arith_rew_tac ctxt ths))
   15.56 -*}
   15.57 +\<close>
   15.58  
   15.59 -method_setup hyp_arith_rew = {*
   15.60 +method_setup hyp_arith_rew = \<open>
   15.61    Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (hyp_arith_rew_tac ctxt ths))
   15.62 -*}
   15.63 +\<close>
   15.64  
   15.65  
   15.66 -subsection {* Addition *}
   15.67 +subsection \<open>Addition\<close>
   15.68  
   15.69  (*Associative law for addition*)
   15.70  lemma add_assoc: "\<lbrakk>a:N; b:N; c:N\<rbrakk> \<Longrightarrow> (a #+ b) #+ c = a #+ (b #+ c) : N"
   15.71 @@ -214,7 +214,7 @@
   15.72  done
   15.73  
   15.74  
   15.75 -subsection {* Multiplication *}
   15.76 +subsection \<open>Multiplication\<close>
   15.77  
   15.78  (*right annihilation in product*)
   15.79  lemma mult_0_right: "a:N \<Longrightarrow> a #* 0 = 0 : N"
   15.80 @@ -248,11 +248,11 @@
   15.81  done
   15.82  
   15.83  
   15.84 -subsection {* Difference *}
   15.85 +subsection \<open>Difference\<close>
   15.86  
   15.87 -text {*
   15.88 +text \<open>
   15.89  Difference on natural numbers, without negative numbers
   15.90 -  a - b = 0  iff  a<=b    a - b = succ(c) iff a>b   *}
   15.91 +  a - b = 0  iff  a<=b    a - b = succ(c) iff a>b\<close>
   15.92  
   15.93  lemma diff_self_eq_0: "a:N \<Longrightarrow> a - a = 0 : N"
   15.94  apply (NE a)
   15.95 @@ -299,7 +299,7 @@
   15.96  done
   15.97  
   15.98  
   15.99 -subsection {* Absolute difference *}
  15.100 +subsection \<open>Absolute difference\<close>
  15.101  
  15.102  (*typing of absolute difference: short and long versions*)
  15.103  
  15.104 @@ -380,7 +380,7 @@
  15.105  done
  15.106  
  15.107  
  15.108 -subsection {* Remainder and Quotient *}
  15.109 +subsection \<open>Remainder and Quotient\<close>
  15.110  
  15.111  (*typing of remainder: short and long versions*)
  15.112  
    16.1 --- a/src/CTT/Bool.thy	Thu Jul 23 14:20:51 2015 +0200
    16.2 +++ b/src/CTT/Bool.thy	Thu Jul 23 14:25:05 2015 +0200
    16.3 @@ -3,7 +3,7 @@
    16.4      Copyright   1991  University of Cambridge
    16.5  *)
    16.6  
    16.7 -section {* The two-element type (booleans and conditionals) *}
    16.8 +section \<open>The two-element type (booleans and conditionals)\<close>
    16.9  
   16.10  theory Bool
   16.11  imports CTT
   16.12 @@ -28,7 +28,7 @@
   16.13  lemmas bool_defs = Bool_def true_def false_def cond_def
   16.14  
   16.15  
   16.16 -subsection {* Derivation of rules for the type Bool *}
   16.17 +subsection \<open>Derivation of rules for the type Bool\<close>
   16.18  
   16.19  (*formation rule*)
   16.20  lemma boolF: "Bool type"
    17.1 --- a/src/CTT/CTT.thy	Thu Jul 23 14:20:51 2015 +0200
    17.2 +++ b/src/CTT/CTT.thy	Thu Jul 23 14:25:05 2015 +0200
    17.3 @@ -3,7 +3,7 @@
    17.4      Copyright   1993  University of Cambridge
    17.5  *)
    17.6  
    17.7 -section {* Constructive Type Theory *}
    17.8 +section \<open>Constructive Type Theory\<close>
    17.9  
   17.10  theory CTT
   17.11  imports Pure
   17.12 @@ -314,9 +314,9 @@
   17.13  done
   17.14  
   17.15  
   17.16 -subsection {* Tactics for type checking *}
   17.17 +subsection \<open>Tactics for type checking\<close>
   17.18  
   17.19 -ML {*
   17.20 +ML \<open>
   17.21  
   17.22  local
   17.23  
   17.24 @@ -336,13 +336,13 @@
   17.25  
   17.26  end;
   17.27  
   17.28 -*}
   17.29 +\<close>
   17.30  
   17.31  (*For simplification: type formation and checking,
   17.32    but no equalities between terms*)
   17.33  lemmas routine_rls = form_rls formL_rls refl_type element_rls
   17.34  
   17.35 -ML {*
   17.36 +ML \<open>
   17.37  local
   17.38    val equal_rls = @{thms form_rls} @ @{thms element_rls} @ @{thms intrL_rls} @
   17.39      @{thms elimL_rls} @ @{thms refl_elem}
   17.40 @@ -378,15 +378,15 @@
   17.41      (ASSUME ctxt (filt_resolve_from_net_tac ctxt 3 (Tactic.build_net (thms @ equal_rls))))
   17.42  
   17.43  end
   17.44 -*}
   17.45 +\<close>
   17.46  
   17.47 -method_setup form = {* Scan.succeed (fn ctxt => SIMPLE_METHOD (form_tac ctxt)) *}
   17.48 -method_setup typechk = {* Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (typechk_tac ctxt ths)) *}
   17.49 -method_setup intr = {* Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (intr_tac ctxt ths)) *}
   17.50 -method_setup equal = {* Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (equal_tac ctxt ths)) *}
   17.51 +method_setup form = \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD (form_tac ctxt))\<close>
   17.52 +method_setup typechk = \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (typechk_tac ctxt ths))\<close>
   17.53 +method_setup intr = \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (intr_tac ctxt ths))\<close>
   17.54 +method_setup equal = \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (equal_tac ctxt ths))\<close>
   17.55  
   17.56  
   17.57 -subsection {* Simplification *}
   17.58 +subsection \<open>Simplification\<close>
   17.59  
   17.60  (*To simplify the type in a goal*)
   17.61  lemma replace_type: "\<lbrakk>B = A; a : A\<rbrakk> \<Longrightarrow> a : B"
   17.62 @@ -409,7 +409,7 @@
   17.63  (*Simplification rules for Constructive Type Theory*)
   17.64  lemmas reduction_rls = comp_rls [THEN trans_elem]
   17.65  
   17.66 -ML {*
   17.67 +ML \<open>
   17.68  (*Converts each goal "e : Eq(A,a,b)" into "a=b:A" for simplification.
   17.69    Uses other intro rules to avoid changing flexible goals.*)
   17.70  val eqintr_net = Tactic.build_net @{thms EqI intr_rls}
   17.71 @@ -466,21 +466,21 @@
   17.72  
   17.73  (*Fails unless it solves the goal!*)
   17.74  fun pc_tac ctxt thms = DEPTH_SOLVE_1 o (step_tac ctxt thms)
   17.75 -*}
   17.76 +\<close>
   17.77  
   17.78 -method_setup eqintr = {* Scan.succeed (SIMPLE_METHOD o eqintr_tac) *}
   17.79 -method_setup NE = {*
   17.80 +method_setup eqintr = \<open>Scan.succeed (SIMPLE_METHOD o eqintr_tac)\<close>
   17.81 +method_setup NE = \<open>
   17.82    Scan.lift Args.name_inner_syntax >> (fn s => fn ctxt => SIMPLE_METHOD' (NE_tac ctxt s))
   17.83 -*}
   17.84 -method_setup pc = {* Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (pc_tac ctxt ths)) *}
   17.85 -method_setup add_mp = {* Scan.succeed (SIMPLE_METHOD' o add_mp_tac) *}
   17.86 +\<close>
   17.87 +method_setup pc = \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD' (pc_tac ctxt ths))\<close>
   17.88 +method_setup add_mp = \<open>Scan.succeed (SIMPLE_METHOD' o add_mp_tac)\<close>
   17.89  
   17.90  ML_file "rew.ML"
   17.91 -method_setup rew = {* Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (rew_tac ctxt ths)) *}
   17.92 -method_setup hyp_rew = {* Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (hyp_rew_tac ctxt ths)) *}
   17.93 +method_setup rew = \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (rew_tac ctxt ths))\<close>
   17.94 +method_setup hyp_rew = \<open>Attrib.thms >> (fn ths => fn ctxt => SIMPLE_METHOD (hyp_rew_tac ctxt ths))\<close>
   17.95  
   17.96  
   17.97 -subsection {* The elimination rules for fst/snd *}
   17.98 +subsection \<open>The elimination rules for fst/snd\<close>
   17.99  
  17.100  lemma SumE_fst: "p : Sum(A,B) \<Longrightarrow> fst(p) : A"
  17.101  apply (unfold basic_defs)
    18.1 --- a/src/CTT/Main.thy	Thu Jul 23 14:20:51 2015 +0200
    18.2 +++ b/src/CTT/Main.thy	Thu Jul 23 14:25:05 2015 +0200
    18.3 @@ -1,4 +1,4 @@
    18.4 -section {* Main includes everything *}
    18.5 +section \<open>Main includes everything\<close>
    18.6  
    18.7  theory Main
    18.8  imports CTT Arith Bool
    19.1 --- a/src/CTT/ex/Elimination.thy	Thu Jul 23 14:20:51 2015 +0200
    19.2 +++ b/src/CTT/ex/Elimination.thy	Thu Jul 23 14:25:05 2015 +0200
    19.3 @@ -182,7 +182,7 @@
    19.4      and "\<And>z. z:A*B \<Longrightarrow> C(z) type"
    19.5    shows "?a : (SUM z:A*B. C(z)) --> (SUM u:A. SUM v:B. C(<u,v>))"
    19.6  apply (rule intr_rls)
    19.7 -apply (tactic {* biresolve_tac @{context} safe_brls 2 *})
    19.8 +apply (tactic \<open>biresolve_tac @{context} safe_brls 2\<close>)
    19.9  (*Now must convert assumption C(z) into antecedent C(<kd,ke>) *)
   19.10  apply (rule_tac [2] a = "y" in ProdE)
   19.11  apply (typechk assms)
    20.1 --- a/src/CTT/ex/Equality.thy	Thu Jul 23 14:20:51 2015 +0200
    20.2 +++ b/src/CTT/ex/Equality.thy	Thu Jul 23 14:25:05 2015 +0200
    20.3 @@ -47,7 +47,7 @@
    20.4  lemma "p : Sum(A,B) \<Longrightarrow> <split(p,\<lambda>x y. x), split(p,\<lambda>x y. y)> = p : Sum(A,B)"
    20.5  apply (rule EqE)
    20.6  apply (rule elim_rls, assumption)
    20.7 -apply (tactic {* DEPTH_SOLVE_1 (rew_tac @{context} []) *}) (*!!!!!!!*)
    20.8 +apply (tactic \<open>DEPTH_SOLVE_1 (rew_tac @{context} [])\<close>) (*!!!!!!!*)
    20.9  done
   20.10  
   20.11  lemma "\<lbrakk>a : A; b : B\<rbrakk> \<Longrightarrow> (lam u. split(u, \<lambda>v w.<w,v>)) ` <a,b> = <b,a> : SUM x:B. A"
    21.1 --- a/src/CTT/ex/Typechecking.thy	Thu Jul 23 14:20:51 2015 +0200
    21.2 +++ b/src/CTT/ex/Typechecking.thy	Thu Jul 23 14:25:05 2015 +0200
    21.3 @@ -9,7 +9,7 @@
    21.4  imports "../CTT"
    21.5  begin
    21.6  
    21.7 -subsection {* Single-step proofs: verifying that a type is well-formed *}
    21.8 +subsection \<open>Single-step proofs: verifying that a type is well-formed\<close>
    21.9  
   21.10  schematic_lemma "?A type"
   21.11  apply (rule form_rls)
   21.12 @@ -31,7 +31,7 @@
   21.13  done
   21.14  
   21.15  
   21.16 -subsection {* Multi-step proofs: Type inference *}
   21.17 +subsection \<open>Multi-step proofs: Type inference\<close>
   21.18  
   21.19  lemma "PROD w:N. N + N type"
   21.20  apply form
   21.21 @@ -67,7 +67,7 @@
   21.22  (*Proofs involving arbitrary types.
   21.23    For concreteness, every type variable left over is forced to be N*)
   21.24  method_setup N =
   21.25 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD (TRYALL (resolve_tac ctxt @{thms NF}))) *}
   21.26 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD (TRYALL (resolve_tac ctxt @{thms NF})))\<close>
   21.27  
   21.28  schematic_lemma "lam w. <w,w> : ?A"
   21.29  apply typechk
    22.1 --- a/src/FOL/FOL.thy	Thu Jul 23 14:20:51 2015 +0200
    22.2 +++ b/src/FOL/FOL.thy	Thu Jul 23 14:25:05 2015 +0200
    22.3 @@ -2,7 +2,7 @@
    22.4      Author:     Lawrence C Paulson and Markus Wenzel
    22.5  *)
    22.6  
    22.7 -section {* Classical first-order logic *}
    22.8 +section \<open>Classical first-order logic\<close>
    22.9  
   22.10  theory FOL
   22.11  imports IFOL
   22.12 @@ -14,13 +14,13 @@
   22.13  ML_file "~~/src/Provers/clasimp.ML"
   22.14  
   22.15  
   22.16 -subsection {* The classical axiom *}
   22.17 +subsection \<open>The classical axiom\<close>
   22.18  
   22.19  axiomatization where
   22.20    classical: "(~P ==> P) ==> P"
   22.21  
   22.22  
   22.23 -subsection {* Lemmas and proof tools *}
   22.24 +subsection \<open>Lemmas and proof tools\<close>
   22.25  
   22.26  lemma ccontr: "(\<not> P \<Longrightarrow> False) \<Longrightarrow> P"
   22.27    by (erule FalseE [THEN classical])
   22.28 @@ -65,15 +65,15 @@
   22.29    apply (erule r1)
   22.30    done
   22.31  
   22.32 -ML {*
   22.33 +ML \<open>
   22.34    fun case_tac ctxt a fixes =
   22.35      Rule_Insts.res_inst_tac ctxt [((("P", 0), Position.none), a)] fixes @{thm case_split}
   22.36 -*}
   22.37 +\<close>
   22.38  
   22.39 -method_setup case_tac = {*
   22.40 +method_setup case_tac = \<open>
   22.41    Args.goal_spec -- Scan.lift (Args.name_inner_syntax -- Parse.for_fixes) >>
   22.42      (fn (quant, (s, fixes)) => fn ctxt => SIMPLE_METHOD'' quant (case_tac ctxt s fixes))
   22.43 -*} "case_tac emulation (dynamic instantiation!)"
   22.44 +\<close> "case_tac emulation (dynamic instantiation!)"
   22.45  
   22.46  
   22.47  (*** Special elimination rules *)
   22.48 @@ -163,9 +163,9 @@
   22.49    by (rule classical) iprover
   22.50  
   22.51  
   22.52 -section {* Classical Reasoner *}
   22.53 +section \<open>Classical Reasoner\<close>
   22.54  
   22.55 -ML {*
   22.56 +ML \<open>
   22.57  structure Cla = Classical
   22.58  (
   22.59    val imp_elim = @{thm imp_elim}
   22.60 @@ -178,21 +178,21 @@
   22.61  
   22.62  structure Basic_Classical: BASIC_CLASSICAL = Cla;
   22.63  open Basic_Classical;
   22.64 -*}
   22.65 +\<close>
   22.66  
   22.67  (*Propositional rules*)
   22.68  lemmas [intro!] = refl TrueI conjI disjCI impI notI iffI
   22.69    and [elim!] = conjE disjE impCE FalseE iffCE
   22.70 -ML {* val prop_cs = claset_of @{context} *}
   22.71 +ML \<open>val prop_cs = claset_of @{context}\<close>
   22.72  
   22.73  (*Quantifier rules*)
   22.74  lemmas [intro!] = allI ex_ex1I
   22.75    and [intro] = exI
   22.76    and [elim!] = exE alt_ex1E
   22.77    and [elim] = allE
   22.78 -ML {* val FOL_cs = claset_of @{context} *}
   22.79 +ML \<open>val FOL_cs = claset_of @{context}\<close>
   22.80  
   22.81 -ML {*
   22.82 +ML \<open>
   22.83    structure Blast = Blast
   22.84    (
   22.85      structure Classical = Cla
   22.86 @@ -204,7 +204,7 @@
   22.87      val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
   22.88    );
   22.89    val blast_tac = Blast.blast_tac;
   22.90 -*}
   22.91 +\<close>
   22.92  
   22.93  
   22.94  lemma ex1_functional: "[| EX! z. P(a,z);  P(a,b);  P(a,c) |] ==> b = c"
   22.95 @@ -320,10 +320,10 @@
   22.96  
   22.97  ML_file "simpdata.ML"
   22.98  
   22.99 -simproc_setup defined_Ex ("EX x. P(x)") = {* fn _ => Quantifier1.rearrange_ex *}
  22.100 -simproc_setup defined_All ("ALL x. P(x)") = {* fn _ => Quantifier1.rearrange_all *}
  22.101 +simproc_setup defined_Ex ("EX x. P(x)") = \<open>fn _ => Quantifier1.rearrange_ex\<close>
  22.102 +simproc_setup defined_All ("ALL x. P(x)") = \<open>fn _ => Quantifier1.rearrange_all\<close>
  22.103  
  22.104 -ML {*
  22.105 +ML \<open>
  22.106  (*intuitionistic simprules only*)
  22.107  val IFOL_ss =
  22.108    put_simpset FOL_basic_ss @{context}
  22.109 @@ -337,17 +337,17 @@
  22.110    put_simpset IFOL_ss @{context}
  22.111    addsimps @{thms cla_simps cla_ex_simps cla_all_simps}
  22.112    |> simpset_of;
  22.113 -*}
  22.114 +\<close>
  22.115  
  22.116 -setup {*
  22.117 +setup \<open>
  22.118    map_theory_simpset (put_simpset FOL_ss) #>
  22.119    Simplifier.method_setup Splitter.split_modifiers
  22.120 -*}
  22.121 +\<close>
  22.122  
  22.123  ML_file "~~/src/Tools/eqsubst.ML"
  22.124  
  22.125  
  22.126 -subsection {* Other simple lemmas *}
  22.127 +subsection \<open>Other simple lemmas\<close>
  22.128  
  22.129  lemma [simp]: "((P-->R) <-> (Q-->R)) <-> ((P<->Q) | R)"
  22.130  by blast
  22.131 @@ -380,9 +380,9 @@
  22.132  by blast
  22.133  
  22.134  
  22.135 -subsection {* Proof by cases and induction *}
  22.136 +subsection \<open>Proof by cases and induction\<close>
  22.137  
  22.138 -text {* Proper handling of non-atomic rule statements. *}
  22.139 +text \<open>Proper handling of non-atomic rule statements.\<close>
  22.140  
  22.141  context
  22.142  begin
  22.143 @@ -409,10 +409,10 @@
  22.144  lemmas induct_rulify_fallback =
  22.145    induct_forall_def induct_implies_def induct_equal_def induct_conj_def
  22.146  
  22.147 -text {* Method setup. *}
  22.148 +text \<open>Method setup.\<close>
  22.149  
  22.150  ML_file "~~/src/Tools/induct.ML"
  22.151 -ML {*
  22.152 +ML \<open>
  22.153    structure Induct = Induct
  22.154    (
  22.155      val cases_default = @{thm case_split}
  22.156 @@ -423,7 +423,7 @@
  22.157      fun dest_def _ = NONE
  22.158      fun trivial_tac _ _ = no_tac
  22.159    );
  22.160 -*}
  22.161 +\<close>
  22.162  
  22.163  declare case_split [cases type: o]
  22.164  
    23.1 --- a/src/FOL/IFOL.thy	Thu Jul 23 14:20:51 2015 +0200
    23.2 +++ b/src/FOL/IFOL.thy	Thu Jul 23 14:25:05 2015 +0200
    23.3 @@ -2,7 +2,7 @@
    23.4      Author:     Lawrence C Paulson and Markus Wenzel
    23.5  *)
    23.6  
    23.7 -section {* Intuitionistic first-order logic *}
    23.8 +section \<open>Intuitionistic first-order logic\<close>
    23.9  
   23.10  theory IFOL
   23.11  imports Pure
   23.12 @@ -20,7 +20,7 @@
   23.13  ML_file "~~/src/Tools/atomize_elim.ML"
   23.14  
   23.15  
   23.16 -subsection {* Syntax and axiomatic basis *}
   23.17 +subsection \<open>Syntax and axiomatic basis\<close>
   23.18  
   23.19  setup Pure_Thy.old_appl_syntax_setup
   23.20  
   23.21 @@ -33,7 +33,7 @@
   23.22    Trueprop      :: "o => prop"                  ("(_)" 5)
   23.23  
   23.24  
   23.25 -subsubsection {* Equality *}
   23.26 +subsubsection \<open>Equality\<close>
   23.27  
   23.28  axiomatization
   23.29    eq :: "['a, 'a] => o"  (infixl "=" 50)
   23.30 @@ -42,7 +42,7 @@
   23.31    subst:        "a=b \<Longrightarrow> P(a) \<Longrightarrow> P(b)"
   23.32  
   23.33  
   23.34 -subsubsection {* Propositional logic *}
   23.35 +subsubsection \<open>Propositional logic\<close>
   23.36  
   23.37  axiomatization
   23.38    False :: o and
   23.39 @@ -64,7 +64,7 @@
   23.40    FalseE: "False ==> P"
   23.41  
   23.42  
   23.43 -subsubsection {* Quantifiers *}
   23.44 +subsubsection \<open>Quantifiers\<close>
   23.45  
   23.46  axiomatization
   23.47    All :: "('a => o) => o"  (binder "ALL " 10) and
   23.48 @@ -76,7 +76,7 @@
   23.49    exE: "[| EX x. P(x);  !!x. P(x) ==> R |] ==> R"
   23.50  
   23.51  
   23.52 -subsubsection {* Definitions *}
   23.53 +subsubsection \<open>Definitions\<close>
   23.54  
   23.55  definition "True == False-->False"
   23.56  definition Not ("~ _" [40] 40) where not_def: "~P == P-->False"
   23.57 @@ -85,12 +85,12 @@
   23.58  definition Ex1 :: "('a => o) => o"  (binder "EX! " 10)
   23.59    where ex1_def: "EX! x. P(x) == EX x. P(x) & (ALL y. P(y) --> y=x)"
   23.60  
   23.61 -axiomatization where  -- {* Reflection, admissible *}
   23.62 +axiomatization where  -- \<open>Reflection, admissible\<close>
   23.63    eq_reflection: "(x=y) ==> (x==y)" and
   23.64    iff_reflection: "(P<->Q) ==> (P==Q)"
   23.65  
   23.66  
   23.67 -subsubsection {* Additional notation *}
   23.68 +subsubsection \<open>Additional notation\<close>
   23.69  
   23.70  abbreviation not_equal :: "['a, 'a] => o"  (infixl "~=" 50)
   23.71    where "x ~= y == ~ (x = y)"
   23.72 @@ -120,7 +120,7 @@
   23.73    Ex1  (binder "\<exists>!" 10)
   23.74  
   23.75  
   23.76 -subsection {* Lemmas and proof tools *}
   23.77 +subsection \<open>Lemmas and proof tools\<close>
   23.78  
   23.79  lemmas strip = impI allI
   23.80  
   23.81 @@ -146,7 +146,7 @@
   23.82    shows R
   23.83    apply (rule r)
   23.84    apply (rule major [THEN mp])
   23.85 -  apply (rule `P`)
   23.86 +  apply (rule \<open>P\<close>)
   23.87    done
   23.88  
   23.89  lemma allE:
   23.90 @@ -186,7 +186,7 @@
   23.91    shows Q
   23.92    apply (rule r)
   23.93    apply (rule impI)
   23.94 -  apply (erule notE [OF `~P`])
   23.95 +  apply (erule notE [OF \<open>~P\<close>])
   23.96    done
   23.97  
   23.98  (* For substitution into an assumption P, reduce Q to P-->Q, substitute into
   23.99 @@ -207,10 +207,10 @@
  23.100  (*** Modus Ponens Tactics ***)
  23.101  
  23.102  (*Finds P-->Q and P in the assumptions, replaces implication by Q *)
  23.103 -ML {*
  23.104 +ML \<open>
  23.105    fun mp_tac ctxt i = eresolve_tac ctxt @{thms notE impE} i THEN assume_tac ctxt i
  23.106    fun eq_mp_tac ctxt i = eresolve_tac ctxt @{thms notE impE} i THEN eq_assume_tac i
  23.107 -*}
  23.108 +\<close>
  23.109  
  23.110  
  23.111  (*** If-and-only-if ***)
  23.112 @@ -303,11 +303,11 @@
  23.113  (*** <-> congruence rules for simplification ***)
  23.114  
  23.115  (*Use iffE on a premise.  For conj_cong, imp_cong, all_cong, ex_cong*)
  23.116 -ML {*
  23.117 +ML \<open>
  23.118    fun iff_tac ctxt prems i =
  23.119      resolve_tac ctxt (prems RL @{thms iffE}) i THEN
  23.120      REPEAT1 (eresolve_tac ctxt @{thms asm_rl mp} i)
  23.121 -*}
  23.122 +\<close>
  23.123  
  23.124  method_setup iff =
  23.125    \<open>Attrib.thms >> (fn prems => fn ctxt => SIMPLE_METHOD' (iff_tac ctxt prems))\<close>
  23.126 @@ -558,20 +558,20 @@
  23.127    apply (rule disjI2) apply assumption
  23.128    done
  23.129  
  23.130 -ML {*
  23.131 +ML \<open>
  23.132  structure Project_Rule = Project_Rule
  23.133  (
  23.134    val conjunct1 = @{thm conjunct1}
  23.135    val conjunct2 = @{thm conjunct2}
  23.136    val mp = @{thm mp}
  23.137  )
  23.138 -*}
  23.139 +\<close>
  23.140  
  23.141  ML_file "fologic.ML"
  23.142  
  23.143  lemma thin_refl: "[|x=x; PROP W|] ==> PROP W" .
  23.144  
  23.145 -ML {*
  23.146 +ML \<open>
  23.147  structure Hypsubst = Hypsubst
  23.148  (
  23.149    val dest_eq = FOLogic.dest_eq
  23.150 @@ -586,14 +586,14 @@
  23.151    val thin_refl = @{thm thin_refl}
  23.152  );
  23.153  open Hypsubst;
  23.154 -*}
  23.155 +\<close>
  23.156  
  23.157  ML_file "intprover.ML"
  23.158  
  23.159  
  23.160 -subsection {* Intuitionistic Reasoning *}
  23.161 +subsection \<open>Intuitionistic Reasoning\<close>
  23.162  
  23.163 -setup {* Intuitionistic.method_setup @{binding iprover} *}
  23.164 +setup \<open>Intuitionistic.method_setup @{binding iprover}\<close>
  23.165  
  23.166  lemma impE':
  23.167    assumes 1: "P --> Q"
  23.168 @@ -629,7 +629,7 @@
  23.169    and [Pure.elim 2] = allE notE' impE'
  23.170    and [Pure.intro] = exI disjI2 disjI1
  23.171  
  23.172 -setup {* Context_Rules.addSWrapper (fn ctxt => fn tac => hyp_subst_tac ctxt ORELSE' tac) *}
  23.173 +setup \<open>Context_Rules.addSWrapper (fn ctxt => fn tac => hyp_subst_tac ctxt ORELSE' tac)\<close>
  23.174  
  23.175  
  23.176  lemma iff_not_sym: "~ (Q <-> P) ==> ~ (P <-> Q)"
  23.177 @@ -645,7 +645,7 @@
  23.178  done
  23.179  
  23.180  
  23.181 -subsection {* Atomizing meta-level rules *}
  23.182 +subsection \<open>Atomizing meta-level rules\<close>
  23.183  
  23.184  lemma atomize_all [atomize]: "(!!x. P(x)) == Trueprop (ALL x. P(x))"
  23.185  proof
  23.186 @@ -668,7 +668,7 @@
  23.187  lemma atomize_eq [atomize]: "(x == y) == Trueprop (x = y)"
  23.188  proof
  23.189    assume "x == y"
  23.190 -  show "x = y" unfolding `x == y` by (rule refl)
  23.191 +  show "x = y" unfolding \<open>x == y\<close> by (rule refl)
  23.192  next
  23.193    assume "x = y"
  23.194    then show "x == y" by (rule eq_reflection)
  23.195 @@ -677,7 +677,7 @@
  23.196  lemma atomize_iff [atomize]: "(A == B) == Trueprop (A <-> B)"
  23.197  proof
  23.198    assume "A == B"
  23.199 -  show "A <-> B" unfolding `A == B` by (rule iff_refl)
  23.200 +  show "A <-> B" unfolding \<open>A == B\<close> by (rule iff_refl)
  23.201  next
  23.202    assume "A <-> B"
  23.203    then show "A == B" by (rule iff_reflection)
  23.204 @@ -704,7 +704,7 @@
  23.205    and [symmetric, defn] = atomize_all atomize_imp atomize_eq atomize_iff
  23.206  
  23.207  
  23.208 -subsection {* Atomizing elimination rules *}
  23.209 +subsection \<open>Atomizing elimination rules\<close>
  23.210  
  23.211  lemma atomize_exL[atomize_elim]: "(!!x. P(x) ==> Q) == ((EX x. P(x)) ==> Q)"
  23.212    by rule iprover+
  23.213 @@ -718,7 +718,7 @@
  23.214  lemma atomize_elimL[atomize_elim]: "(!!B. (A ==> B) ==> B) == Trueprop(A)" ..
  23.215  
  23.216  
  23.217 -subsection {* Calculational rules *}
  23.218 +subsection \<open>Calculational rules\<close>
  23.219  
  23.220  lemma forw_subst: "a = b ==> P(b) ==> P(a)"
  23.221    by (rule ssubst)
  23.222 @@ -726,9 +726,9 @@
  23.223  lemma back_subst: "P(a) ==> a = b ==> P(b)"
  23.224    by (rule subst)
  23.225  
  23.226 -text {*
  23.227 +text \<open>
  23.228    Note that this list of rules is in reverse order of priorities.
  23.229 -*}
  23.230 +\<close>
  23.231  
  23.232  lemmas basic_trans_rules [trans] =
  23.233    forw_subst
  23.234 @@ -737,7 +737,7 @@
  23.235    mp
  23.236    trans
  23.237  
  23.238 -subsection {* ``Let'' declarations *}
  23.239 +subsection \<open>``Let'' declarations\<close>
  23.240  
  23.241  nonterminal letbinds and letbind
  23.242  
  23.243 @@ -763,7 +763,7 @@
  23.244    done
  23.245  
  23.246  
  23.247 -subsection {* Intuitionistic simplification rules *}
  23.248 +subsection \<open>Intuitionistic simplification rules\<close>
  23.249  
  23.250  lemma conj_simps:
  23.251    "P & True <-> P"
  23.252 @@ -830,7 +830,7 @@
  23.253    by iprover+
  23.254  
  23.255  
  23.256 -text {* Conversion into rewrite rules *}
  23.257 +text \<open>Conversion into rewrite rules\<close>
  23.258  
  23.259  lemma P_iff_F: "~P ==> (P <-> False)" by iprover
  23.260  lemma iff_reflection_F: "~P ==> (P == False)" by (rule P_iff_F [THEN iff_reflection])
  23.261 @@ -839,7 +839,7 @@
  23.262  lemma iff_reflection_T: "P ==> (P == True)" by (rule P_iff_T [THEN iff_reflection])
  23.263  
  23.264  
  23.265 -text {* More rewrite rules *}
  23.266 +text \<open>More rewrite rules\<close>
  23.267  
  23.268  lemma conj_commute: "P&Q <-> Q&P" by iprover
  23.269  lemma conj_left_commute: "P&(Q&R) <-> Q&(P&R)" by iprover
    24.1 --- a/src/FOL/ex/Classical.thy	Thu Jul 23 14:20:51 2015 +0200
    24.2 +++ b/src/FOL/ex/Classical.thy	Thu Jul 23 14:25:05 2015 +0200
    24.3 @@ -3,14 +3,14 @@
    24.4      Copyright   1994  University of Cambridge
    24.5  *)
    24.6  
    24.7 -section{*Classical Predicate Calculus Problems*}
    24.8 +section\<open>Classical Predicate Calculus Problems\<close>
    24.9  
   24.10  theory Classical imports FOL begin
   24.11  
   24.12  lemma "(P --> Q | R) --> (P-->Q) | (P-->R)"
   24.13  by blast
   24.14  
   24.15 -text{*If and only if*}
   24.16 +text\<open>If and only if\<close>
   24.17  
   24.18  lemma "(P<->Q) <-> (Q<->P)"
   24.19  by blast
   24.20 @@ -19,7 +19,7 @@
   24.21  by blast
   24.22  
   24.23  
   24.24 -text{*Sample problems from 
   24.25 +text\<open>Sample problems from 
   24.26    F. J. Pelletier, 
   24.27    Seventy-Five Problems for Testing Automatic Theorem Provers,
   24.28    J. Automated Reasoning 2 (1986), 191-216.
   24.29 @@ -27,79 +27,79 @@
   24.30  
   24.31  The hardest problems -- judging by experience with several theorem provers,
   24.32  including matrix ones -- are 34 and 43.
   24.33 -*}
   24.34 +\<close>
   24.35  
   24.36 -subsection{*Pelletier's examples*}
   24.37 +subsection\<open>Pelletier's examples\<close>
   24.38  
   24.39 -text{*1*}
   24.40 +text\<open>1\<close>
   24.41  lemma "(P-->Q)  <->  (~Q --> ~P)"
   24.42  by blast
   24.43  
   24.44 -text{*2*}
   24.45 +text\<open>2\<close>
   24.46  lemma "~ ~ P  <->  P"
   24.47  by blast
   24.48  
   24.49 -text{*3*}
   24.50 +text\<open>3\<close>
   24.51  lemma "~(P-->Q) --> (Q-->P)"
   24.52  by blast
   24.53  
   24.54 -text{*4*}
   24.55 +text\<open>4\<close>
   24.56  lemma "(~P-->Q)  <->  (~Q --> P)"
   24.57  by blast
   24.58  
   24.59 -text{*5*}
   24.60 +text\<open>5\<close>
   24.61  lemma "((P|Q)-->(P|R)) --> (P|(Q-->R))"
   24.62  by blast
   24.63  
   24.64 -text{*6*}
   24.65 +text\<open>6\<close>
   24.66  lemma "P | ~ P"
   24.67  by blast
   24.68  
   24.69 -text{*7*}
   24.70 +text\<open>7\<close>
   24.71  lemma "P | ~ ~ ~ P"
   24.72  by blast
   24.73  
   24.74 -text{*8.  Peirce's law*}
   24.75 +text\<open>8.  Peirce's law\<close>
   24.76  lemma "((P-->Q) --> P)  -->  P"
   24.77  by blast
   24.78  
   24.79 -text{*9*}
   24.80 +text\<open>9\<close>
   24.81  lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
   24.82  by blast
   24.83  
   24.84 -text{*10*}
   24.85 +text\<open>10\<close>
   24.86  lemma "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)"
   24.87  by blast
   24.88  
   24.89 -text{*11.  Proved in each direction (incorrectly, says Pelletier!!)  *}
   24.90 +text\<open>11.  Proved in each direction (incorrectly, says Pelletier!!)\<close>
   24.91  lemma "P<->P"
   24.92  by blast
   24.93  
   24.94 -text{*12.  "Dijkstra's law"*}
   24.95 +text\<open>12.  "Dijkstra's law"\<close>
   24.96  lemma "((P <-> Q) <-> R)  <->  (P <-> (Q <-> R))"
   24.97  by blast
   24.98  
   24.99 -text{*13.  Distributive law*}
  24.100 +text\<open>13.  Distributive law\<close>
  24.101  lemma "P | (Q & R)  <-> (P | Q) & (P | R)"
  24.102  by blast
  24.103  
  24.104 -text{*14*}
  24.105 +text\<open>14\<close>
  24.106  lemma "(P <-> Q) <-> ((Q | ~P) & (~Q|P))"
  24.107  by blast
  24.108  
  24.109 -text{*15*}
  24.110 +text\<open>15\<close>
  24.111  lemma "(P --> Q) <-> (~P | Q)"
  24.112  by blast
  24.113  
  24.114 -text{*16*}
  24.115 +text\<open>16\<close>
  24.116  lemma "(P-->Q) | (Q-->P)"
  24.117  by blast
  24.118  
  24.119 -text{*17*}
  24.120 +text\<open>17\<close>
  24.121  lemma "((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))"
  24.122  by blast
  24.123  
  24.124 -subsection{*Classical Logic: examples with quantifiers*}
  24.125 +subsection\<open>Classical Logic: examples with quantifiers\<close>
  24.126  
  24.127  lemma "(\<forall>x. P(x) & Q(x)) <-> (\<forall>x. P(x))  &  (\<forall>x. Q(x))"
  24.128  by blast
  24.129 @@ -113,23 +113,23 @@
  24.130  lemma "(\<forall>x. P(x)) | Q  <->  (\<forall>x. P(x) | Q)"
  24.131  by blast
  24.132  
  24.133 -text{*Discussed in Avron, Gentzen-Type Systems, Resolution and Tableaux,
  24.134 -  JAR 10 (265-281), 1993.  Proof is trivial!*}
  24.135 +text\<open>Discussed in Avron, Gentzen-Type Systems, Resolution and Tableaux,
  24.136 +  JAR 10 (265-281), 1993.  Proof is trivial!\<close>
  24.137  lemma "~((\<exists>x.~P(x)) & ((\<exists>x. P(x)) | (\<exists>x. P(x) & Q(x))) & ~ (\<exists>x. P(x)))"
  24.138  by blast
  24.139  
  24.140 -subsection{*Problems requiring quantifier duplication*}
  24.141 +subsection\<open>Problems requiring quantifier duplication\<close>
  24.142  
  24.143 -text{*Theorem B of Peter Andrews, Theorem Proving via General Matings, 
  24.144 -  JACM 28 (1981).*}
  24.145 +text\<open>Theorem B of Peter Andrews, Theorem Proving via General Matings, 
  24.146 +  JACM 28 (1981).\<close>
  24.147  lemma "(\<exists>x. \<forall>y. P(x) <-> P(y)) --> ((\<exists>x. P(x)) <-> (\<forall>y. P(y)))"
  24.148  by blast
  24.149  
  24.150 -text{*Needs multiple instantiation of ALL.*}
  24.151 +text\<open>Needs multiple instantiation of ALL.\<close>
  24.152  lemma "(\<forall>x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))"
  24.153  by blast
  24.154  
  24.155 -text{*Needs double instantiation of the quantifier*}
  24.156 +text\<open>Needs double instantiation of the quantifier\<close>
  24.157  lemma "\<exists>x. P(x) --> P(a) & P(b)"
  24.158  by blast
  24.159  
  24.160 @@ -139,7 +139,7 @@
  24.161  lemma "\<exists>x. (\<exists>y. P(y)) --> P(x)"
  24.162  by blast
  24.163  
  24.164 -text{*V. Lifschitz, What Is the Inverse Method?, JAR 5 (1989), 1--23.  NOT PROVED*}
  24.165 +text\<open>V. Lifschitz, What Is the Inverse Method?, JAR 5 (1989), 1--23.  NOT PROVED\<close>
  24.166  lemma "\<exists>x x'. \<forall>y. \<exists>z z'.  
  24.167                  (~P(y,y) | P(x,x) | ~S(z,x)) &  
  24.168                  (S(x,y) | ~S(y,z) | Q(z',z'))  &  
  24.169 @@ -148,40 +148,40 @@
  24.170  
  24.171  
  24.172  
  24.173 -subsection{*Hard examples with quantifiers*}
  24.174 +subsection\<open>Hard examples with quantifiers\<close>
  24.175  
  24.176 -text{*18*}
  24.177 +text\<open>18\<close>
  24.178  lemma "\<exists>y. \<forall>x. P(y)-->P(x)"
  24.179  by blast
  24.180  
  24.181 -text{*19*}
  24.182 +text\<open>19\<close>
  24.183  lemma "\<exists>x. \<forall>y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))"
  24.184  by blast
  24.185  
  24.186 -text{*20*}
  24.187 +text\<open>20\<close>
  24.188  lemma "(\<forall>x y. \<exists>z. \<forall>w. (P(x)&Q(y)-->R(z)&S(w)))      
  24.189      --> (\<exists>x y. P(x) & Q(y)) --> (\<exists>z. R(z))"
  24.190  by blast
  24.191  
  24.192 -text{*21*}
  24.193 +text\<open>21\<close>
  24.194  lemma "(\<exists>x. P-->Q(x)) & (\<exists>x. Q(x)-->P) --> (\<exists>x. P<->Q(x))"
  24.195  by blast
  24.196  
  24.197 -text{*22*}
  24.198 +text\<open>22\<close>
  24.199  lemma "(\<forall>x. P <-> Q(x))  -->  (P <-> (\<forall>x. Q(x)))"
  24.200  by blast
  24.201  
  24.202 -text{*23*}
  24.203 +text\<open>23\<close>
  24.204  lemma "(\<forall>x. P | Q(x))  <->  (P | (\<forall>x. Q(x)))"
  24.205  by blast
  24.206  
  24.207 -text{*24*}
  24.208 +text\<open>24\<close>
  24.209  lemma "~(\<exists>x. S(x)&Q(x)) & (\<forall>x. P(x) --> Q(x)|R(x)) &   
  24.210        (~(\<exists>x. P(x)) --> (\<exists>x. Q(x))) & (\<forall>x. Q(x)|R(x) --> S(x))   
  24.211      --> (\<exists>x. P(x)&R(x))"
  24.212  by blast
  24.213  
  24.214 -text{*25*}
  24.215 +text\<open>25\<close>
  24.216  lemma "(\<exists>x. P(x)) &   
  24.217        (\<forall>x. L(x) --> ~ (M(x) & R(x))) &   
  24.218        (\<forall>x. P(x) --> (M(x) & L(x))) &    
  24.219 @@ -189,13 +189,13 @@
  24.220      --> (\<exists>x. Q(x)&P(x))"
  24.221  by blast
  24.222  
  24.223 -text{*26*}
  24.224 +text\<open>26\<close>
  24.225  lemma "((\<exists>x. p(x)) <-> (\<exists>x. q(x))) &  
  24.226        (\<forall>x. \<forall>y. p(x) & q(y) --> (r(x) <-> s(y)))    
  24.227    --> ((\<forall>x. p(x)-->r(x)) <-> (\<forall>x. q(x)-->s(x)))"
  24.228  by blast
  24.229  
  24.230 -text{*27*}
  24.231 +text\<open>27\<close>
  24.232  lemma "(\<exists>x. P(x) & ~Q(x)) &    
  24.233        (\<forall>x. P(x) --> R(x)) &    
  24.234        (\<forall>x. M(x) & L(x) --> P(x)) &    
  24.235 @@ -203,63 +203,63 @@
  24.236    --> (\<forall>x. M(x) --> ~L(x))"
  24.237  by blast
  24.238  
  24.239 -text{*28.  AMENDED*}
  24.240 +text\<open>28.  AMENDED\<close>
  24.241  lemma "(\<forall>x. P(x) --> (\<forall>x. Q(x))) &    
  24.242          ((\<forall>x. Q(x)|R(x)) --> (\<exists>x. Q(x)&S(x))) &   
  24.243          ((\<exists>x. S(x)) --> (\<forall>x. L(x) --> M(x)))   
  24.244      --> (\<forall>x. P(x) & L(x) --> M(x))"
  24.245  by blast
  24.246  
  24.247 -text{*29.  Essentially the same as Principia Mathematica *11.71*}
  24.248 +text\<open>29.  Essentially the same as Principia Mathematica *11.71\<close>
  24.249  lemma "(\<exists>x. P(x)) & (\<exists>y. Q(y))   
  24.250      --> ((\<forall>x. P(x)-->R(x)) & (\<forall>y. Q(y)-->S(y))   <->      
  24.251           (\<forall>x y. P(x) & Q(y) --> R(x) & S(y)))"
  24.252  by blast
  24.253  
  24.254 -text{*30*}
  24.255 +text\<open>30\<close>
  24.256  lemma "(\<forall>x. P(x) | Q(x) --> ~ R(x)) &  
  24.257        (\<forall>x. (Q(x) --> ~ S(x)) --> P(x) & R(x))   
  24.258      --> (\<forall>x. S(x))"
  24.259  by blast
  24.260  
  24.261 -text{*31*}
  24.262 +text\<open>31\<close>
  24.263  lemma "~(\<exists>x. P(x) & (Q(x) | R(x))) &  
  24.264          (\<exists>x. L(x) & P(x)) &  
  24.265          (\<forall>x. ~ R(x) --> M(x))   
  24.266      --> (\<exists>x. L(x) & M(x))"
  24.267  by blast
  24.268  
  24.269 -text{*32*}
  24.270 +text\<open>32\<close>
  24.271  lemma "(\<forall>x. P(x) & (Q(x)|R(x))-->S(x)) &  
  24.272        (\<forall>x. S(x) & R(x) --> L(x)) &  
  24.273        (\<forall>x. M(x) --> R(x))   
  24.274        --> (\<forall>x. P(x) & M(x) --> L(x))"
  24.275  by blast
  24.276  
  24.277 -text{*33*}
  24.278 +text\<open>33\<close>
  24.279  lemma "(\<forall>x. P(a) & (P(x)-->P(b))-->P(c))  <->     
  24.280        (\<forall>x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))"
  24.281  by blast
  24.282  
  24.283 -text{*34  AMENDED (TWICE!!).  Andrews's challenge*}
  24.284 +text\<open>34  AMENDED (TWICE!!).  Andrews's challenge\<close>
  24.285  lemma "((\<exists>x. \<forall>y. p(x) <-> p(y))  <->                 
  24.286         ((\<exists>x. q(x)) <-> (\<forall>y. p(y))))     <->         
  24.287        ((\<exists>x. \<forall>y. q(x) <-> q(y))  <->                 
  24.288         ((\<exists>x. p(x)) <-> (\<forall>y. q(y))))"
  24.289  by blast
  24.290  
  24.291 -text{*35*}
  24.292 +text\<open>35\<close>
  24.293  lemma "\<exists>x y. P(x,y) -->  (\<forall>u v. P(u,v))"
  24.294  by blast
  24.295  
  24.296 -text{*36*}
  24.297 +text\<open>36\<close>
  24.298  lemma "(\<forall>x. \<exists>y. J(x,y)) &  
  24.299        (\<forall>x. \<exists>y. G(x,y)) &  
  24.300        (\<forall>x y. J(x,y) | G(x,y) --> (\<forall>z. J(y,z) | G(y,z) --> H(x,z)))    
  24.301    --> (\<forall>x. \<exists>y. H(x,y))"
  24.302  by blast
  24.303  
  24.304 -text{*37*}
  24.305 +text\<open>37\<close>
  24.306  lemma "(\<forall>z. \<exists>w. \<forall>x. \<exists>y.  
  24.307             (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (\<exists>u. Q(u,w)))) &  
  24.308        (\<forall>x z. ~P(x,z) --> (\<exists>y. Q(y,z))) &  
  24.309 @@ -267,7 +267,7 @@
  24.310        --> (\<forall>x. \<exists>y. R(x,y))"
  24.311  by blast
  24.312  
  24.313 -text{*38*}
  24.314 +text\<open>38\<close>
  24.315  lemma "(\<forall>x. p(a) & (p(x) --> (\<exists>y. p(y) & r(x,y))) -->         
  24.316               (\<exists>z. \<exists>w. p(z) & r(x,w) & r(w,z)))  <->          
  24.317        (\<forall>x. (~p(a) | p(x) | (\<exists>z. \<exists>w. p(z) & r(x,w) & r(w,z))) &     
  24.318 @@ -275,25 +275,25 @@
  24.319                (\<exists>z. \<exists>w. p(z) & r(x,w) & r(w,z))))"
  24.320  by blast
  24.321  
  24.322 -text{*39*}
  24.323 +text\<open>39\<close>
  24.324  lemma "~ (\<exists>x. \<forall>y. F(y,x) <-> ~F(y,y))"
  24.325  by blast
  24.326  
  24.327 -text{*40.  AMENDED*}
  24.328 +text\<open>40.  AMENDED\<close>
  24.329  lemma "(\<exists>y. \<forall>x. F(x,y) <-> F(x,x)) -->   
  24.330                ~(\<forall>x. \<exists>y. \<forall>z. F(z,y) <-> ~ F(z,x))"
  24.331  by blast
  24.332  
  24.333 -text{*41*}
  24.334 +text\<open>41\<close>
  24.335  lemma "(\<forall>z. \<exists>y. \<forall>x. f(x,y) <-> f(x,z) & ~ f(x,x))         
  24.336            --> ~ (\<exists>z. \<forall>x. f(x,z))"
  24.337  by blast
  24.338  
  24.339 -text{*42*}
  24.340 +text\<open>42\<close>
  24.341  lemma "~ (\<exists>y. \<forall>x. p(x,y) <-> ~ (\<exists>z. p(x,z) & p(z,x)))"
  24.342  by blast
  24.343  
  24.344 -text{*43*}
  24.345 +text\<open>43\<close>
  24.346  lemma "(\<forall>x. \<forall>y. q(x,y) <-> (\<forall>z. p(z,x) <-> p(z,y)))      
  24.347            --> (\<forall>x. \<forall>y. q(x,y) <-> q(y,x))"
  24.348  by blast
  24.349 @@ -302,13 +302,13 @@
  24.350    Deepen_tac alone requires 253 secs.  Or
  24.351    by (mini_tac @{context} 1 THEN Deepen_tac 5 1) *)
  24.352  
  24.353 -text{*44*}
  24.354 +text\<open>44\<close>
  24.355  lemma "(\<forall>x. f(x) --> (\<exists>y. g(y) & h(x,y) & (\<exists>y. g(y) & ~ h(x,y)))) &  
  24.356        (\<exists>x. j(x) & (\<forall>y. g(y) --> h(x,y)))                    
  24.357        --> (\<exists>x. j(x) & ~f(x))"
  24.358  by blast
  24.359  
  24.360 -text{*45*}
  24.361 +text\<open>45\<close>
  24.362  lemma "(\<forall>x. f(x) & (\<forall>y. g(y) & h(x,y) --> j(x,y))   
  24.363                        --> (\<forall>y. g(y) & h(x,y) --> k(y))) &     
  24.364        ~ (\<exists>y. l(y) & k(y)) &                                    
  24.365 @@ -318,7 +318,7 @@
  24.366  by blast
  24.367  
  24.368  
  24.369 -text{*46*}
  24.370 +text\<open>46\<close>
  24.371  lemma "(\<forall>x. f(x) & (\<forall>y. f(y) & h(y,x) --> g(y)) --> g(x)) &       
  24.372        ((\<exists>x. f(x) & ~g(x)) -->                                     
  24.373         (\<exists>x. f(x) & ~g(x) & (\<forall>y. f(y) & ~g(y) --> j(x,y)))) &     
  24.374 @@ -327,42 +327,42 @@
  24.375  by blast
  24.376  
  24.377  
  24.378 -subsection{*Problems (mainly) involving equality or functions*}
  24.379 +subsection\<open>Problems (mainly) involving equality or functions\<close>
  24.380  
  24.381 -text{*48*}
  24.382 +text\<open>48\<close>
  24.383  lemma "(a=b | c=d) & (a=c | b=d) --> a=d | b=c"
  24.384  by blast
  24.385  
  24.386 -text{*49  NOT PROVED AUTOMATICALLY.  Hard because it involves substitution
  24.387 +text\<open>49  NOT PROVED AUTOMATICALLY.  Hard because it involves substitution
  24.388    for Vars
  24.389 -  the type constraint ensures that x,y,z have the same type as a,b,u. *}
  24.390 +  the type constraint ensures that x,y,z have the same type as a,b,u.\<close>
  24.391  lemma "(\<exists>x y::'a. \<forall>z. z=x | z=y) & P(a) & P(b) & a~=b  
  24.392                  --> (\<forall>u::'a. P(u))"
  24.393  apply safe
  24.394  apply (rule_tac x = a in allE, assumption)
  24.395  apply (rule_tac x = b in allE, assumption, fast)
  24.396 -       --{*blast's treatment of equality can't do it*}
  24.397 +       --\<open>blast's treatment of equality can't do it\<close>
  24.398  done
  24.399  
  24.400 -text{*50.  (What has this to do with equality?) *}
  24.401 +text\<open>50.  (What has this to do with equality?)\<close>
  24.402  lemma "(\<forall>x. P(a,x) | (\<forall>y. P(x,y))) --> (\<exists>x. \<forall>y. P(x,y))"
  24.403  by blast
  24.404  
  24.405 -text{*51*}
  24.406 +text\<open>51\<close>
  24.407  lemma "(\<exists>z w. \<forall>x y. P(x,y) <->  (x=z & y=w)) -->   
  24.408        (\<exists>z. \<forall>x. \<exists>w. (\<forall>y. P(x,y) <-> y=w) <-> x=z)"
  24.409  by blast
  24.410  
  24.411 -text{*52*}
  24.412 -text{*Almost the same as 51. *}
  24.413 +text\<open>52\<close>
  24.414 +text\<open>Almost the same as 51.\<close>
  24.415  lemma "(\<exists>z w. \<forall>x y. P(x,y) <->  (x=z & y=w)) -->   
  24.416        (\<exists>w. \<forall>y. \<exists>z. (\<forall>x. P(x,y) <-> x=z) <-> y=w)"
  24.417  by blast
  24.418  
  24.419 -text{*55*}
  24.420 +text\<open>55\<close>
  24.421  
  24.422 -text{*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
  24.423 -  fast DISCOVERS who killed Agatha. *}
  24.424 +text\<open>Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
  24.425 +  fast DISCOVERS who killed Agatha.\<close>
  24.426  schematic_lemma "lives(agatha) & lives(butler) & lives(charles) &  
  24.427     (killed(agatha,agatha) | killed(butler,agatha) | killed(charles,agatha)) &  
  24.428     (\<forall>x y. killed(x,y) --> hates(x,y) & ~richer(x,y)) &  
  24.429 @@ -372,53 +372,53 @@
  24.430     (\<forall>x. hates(agatha,x) --> hates(butler,x)) &  
  24.431     (\<forall>x. ~hates(x,agatha) | ~hates(x,butler) | ~hates(x,charles)) -->  
  24.432      killed(?who,agatha)"
  24.433 -by fast --{*MUCH faster than blast*}
  24.434 +by fast --\<open>MUCH faster than blast\<close>
  24.435  
  24.436  
  24.437 -text{*56*}
  24.438 +text\<open>56\<close>
  24.439  lemma "(\<forall>x. (\<exists>y. P(y) & x=f(y)) --> P(x)) <-> (\<forall>x. P(x) --> P(f(x)))"
  24.440  by blast
  24.441  
  24.442 -text{*57*}
  24.443 +text\<open>57\<close>
  24.444  lemma "P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &  
  24.445       (\<forall>x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
  24.446  by blast
  24.447  
  24.448 -text{*58  NOT PROVED AUTOMATICALLY*}
  24.449 +text\<open>58  NOT PROVED AUTOMATICALLY\<close>
  24.450  lemma "(\<forall>x y. f(x)=g(y)) --> (\<forall>x y. f(f(x))=f(g(y)))"
  24.451  by (slow elim: subst_context)
  24.452  
  24.453  
  24.454 -text{*59*}
  24.455 +text\<open>59\<close>
  24.456  lemma "(\<forall>x. P(x) <-> ~P(f(x))) --> (\<exists>x. P(x) & ~P(f(x)))"
  24.457  by blast
  24.458  
  24.459 -text{*60*}
  24.460 +text\<open>60\<close>
  24.461  lemma "\<forall>x. P(x,f(x)) <-> (\<exists>y. (\<forall>z. P(z,y) --> P(z,f(x))) & P(x,y))"
  24.462  by blast
  24.463  
  24.464 -text{*62 as corrected in JAR 18 (1997), page 135*}
  24.465 +text\<open>62 as corrected in JAR 18 (1997), page 135\<close>
  24.466  lemma "(\<forall>x. p(a) & (p(x) --> p(f(x))) --> p(f(f(x))))  <->      
  24.467        (\<forall>x. (~p(a) | p(x) | p(f(f(x)))) &                       
  24.468                (~p(a) | ~p(f(x)) | p(f(f(x)))))"
  24.469  by blast
  24.470  
  24.471 -text{*From Davis, Obvious Logical Inferences, IJCAI-81, 530-531
  24.472 -  fast indeed copes!*}
  24.473 +text\<open>From Davis, Obvious Logical Inferences, IJCAI-81, 530-531
  24.474 +  fast indeed copes!\<close>
  24.475  lemma "(\<forall>x. F(x) & ~G(x) --> (\<exists>y. H(x,y) & J(y))) &  
  24.476                (\<exists>x. K(x) & F(x) & (\<forall>y. H(x,y) --> K(y))) &    
  24.477                (\<forall>x. K(x) --> ~G(x))  -->  (\<exists>x. K(x) & J(x))"
  24.478  by fast
  24.479  
  24.480 -text{*From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.  
  24.481 -  It does seem obvious!*}
  24.482 +text\<open>From Rudnicki, Obvious Inferences, JAR 3 (1987), 383-393.  
  24.483 +  It does seem obvious!\<close>
  24.484  lemma "(\<forall>x. F(x) & ~G(x) --> (\<exists>y. H(x,y) & J(y))) &         
  24.485        (\<exists>x. K(x) & F(x) & (\<forall>y. H(x,y) --> K(y)))  &         
  24.486        (\<forall>x. K(x) --> ~G(x))   -->   (\<exists>x. K(x) --> ~G(x))"
  24.487  by fast
  24.488  
  24.489 -text{*Halting problem: Formulation of Li Dafa (AAR Newsletter 27, Oct 1994.)
  24.490 -  author U. Egly*}
  24.491 +text\<open>Halting problem: Formulation of Li Dafa (AAR Newsletter 27, Oct 1994.)
  24.492 +  author U. Egly\<close>
  24.493  lemma "((\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z)))) -->                
  24.494     (\<exists>w. C(w) & (\<forall>y. C(y) --> (\<forall>z. D(w,y,z)))))                   
  24.495    &                                                                      
  24.496 @@ -437,10 +437,10 @@
  24.497     -->                   
  24.498     ~ (\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z))))"
  24.499  by (blast 12)
  24.500 -   --{*Needed because the search for depths below 12 is very slow*}
  24.501 +   --\<open>Needed because the search for depths below 12 is very slow\<close>
  24.502  
  24.503  
  24.504 -text{*Halting problem II: credited to M. Bruschi by Li Dafa in JAR 18(1), p.105*}
  24.505 +text\<open>Halting problem II: credited to M. Bruschi by Li Dafa in JAR 18(1), p.105\<close>
  24.506  lemma "((\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z)))) -->        
  24.507     (\<exists>w. C(w) & (\<forall>y. C(y) --> (\<forall>z. D(w,y,z)))))           
  24.508    &                                                              
  24.509 @@ -464,12 +464,12 @@
  24.510     ~ (\<exists>x. A(x) & (\<forall>y. C(y) --> (\<forall>z. D(x,y,z))))"
  24.511  by blast
  24.512  
  24.513 -text{* Challenge found on info-hol *}
  24.514 +text\<open>Challenge found on info-hol\<close>
  24.515  lemma "\<forall>x. \<exists>v w. \<forall>y z. P(x) & Q(y) --> (P(v) | R(w)) & (R(z) --> Q(v))"
  24.516  by blast
  24.517  
  24.518 -text{*Attributed to Lewis Carroll by S. G. Pulman.  The first or last assumption
  24.519 -can be deleted.*}
  24.520 +text\<open>Attributed to Lewis Carroll by S. G. Pulman.  The first or last assumption
  24.521 +can be deleted.\<close>
  24.522  lemma "(\<forall>x. honest(x) & industrious(x) --> healthy(x)) &  
  24.523        ~ (\<exists>x. grocer(x) & healthy(x)) &  
  24.524        (\<forall>x. industrious(x) & grocer(x) --> honest(x)) &  
    25.1 --- a/src/FOL/ex/First_Order_Logic.thy	Thu Jul 23 14:20:51 2015 +0200
    25.2 +++ b/src/FOL/ex/First_Order_Logic.thy	Thu Jul 23 14:25:05 2015 +0200
    25.3 @@ -2,18 +2,18 @@
    25.4      Author:     Markus Wenzel, TU Munich
    25.5  *)
    25.6  
    25.7 -section {* A simple formulation of First-Order Logic *}
    25.8 +section \<open>A simple formulation of First-Order Logic\<close>
    25.9  
   25.10  theory First_Order_Logic imports Pure begin
   25.11  
   25.12 -text {*
   25.13 +text \<open>
   25.14    The subsequent theory development illustrates single-sorted
   25.15    intuitionistic first-order logic with equality, formulated within
   25.16    the Pure framework.  Actually this is not an example of
   25.17    Isabelle/FOL, but of Isabelle/Pure.
   25.18 -*}
   25.19 +\<close>
   25.20  
   25.21 -subsection {* Syntax *}
   25.22 +subsection \<open>Syntax\<close>
   25.23  
   25.24  typedecl i
   25.25  typedecl o
   25.26 @@ -22,7 +22,7 @@
   25.27    Trueprop :: "o \<Rightarrow> prop"    ("_" 5)
   25.28  
   25.29  
   25.30 -subsection {* Propositional logic *}
   25.31 +subsection \<open>Propositional logic\<close>
   25.32  
   25.33  axiomatization
   25.34    false :: o  ("\<bottom>") and
   25.35 @@ -47,8 +47,8 @@
   25.36    assumes "A \<and> B"
   25.37    obtains A and B
   25.38  proof
   25.39 -  from `A \<and> B` show A by (rule conjD1)
   25.40 -  from `A \<and> B` show B by (rule conjD2)
   25.41 +  from \<open>A \<and> B\<close> show A by (rule conjD1)
   25.42 +  from \<open>A \<and> B\<close> show B by (rule conjD2)
   25.43  qed
   25.44  
   25.45  definition true :: o  ("\<top>")
   25.46 @@ -101,7 +101,7 @@
   25.47  qed
   25.48  
   25.49  
   25.50 -subsection {* Equality *}
   25.51 +subsection \<open>Equality\<close>
   25.52  
   25.53  axiomatization
   25.54    equal :: "i \<Rightarrow> i \<Rightarrow> o"  (infixl "=" 50)
   25.55 @@ -119,7 +119,7 @@
   25.56  qed
   25.57  
   25.58  
   25.59 -subsection {* Quantifiers *}
   25.60 +subsection \<open>Quantifiers\<close>
   25.61  
   25.62  axiomatization
   25.63    All :: "(i \<Rightarrow> o) \<Rightarrow> o"  (binder "\<forall>" 10) and
    26.1 --- a/src/FOL/ex/Foundation.thy	Thu Jul 23 14:20:51 2015 +0200
    26.2 +++ b/src/FOL/ex/Foundation.thy	Thu Jul 23 14:25:05 2015 +0200
    26.3 @@ -18,7 +18,7 @@
    26.4  apply assumption
    26.5  done
    26.6  
    26.7 -text {*A form of conj-elimination*}
    26.8 +text \<open>A form of conj-elimination\<close>
    26.9  lemma
   26.10    assumes "A & B"
   26.11      and "A ==> B ==> C"
   26.12 @@ -99,7 +99,7 @@
   26.13  apply (rule refl)?
   26.14  oops
   26.15  
   26.16 -text {* Parallel lifting example. *}
   26.17 +text \<open>Parallel lifting example.\<close>
   26.18  lemma "EX u. ALL x. EX v. ALL y. EX w. P(u,x,v,y,w)"
   26.19  apply (rule exI allI)
   26.20  apply (rule exI allI)
   26.21 @@ -121,7 +121,7 @@
   26.22  apply assumption
   26.23  done
   26.24  
   26.25 -text {* A bigger demonstration of quantifiers -- not in the paper. *}
   26.26 +text \<open>A bigger demonstration of quantifiers -- not in the paper.\<close>
   26.27  lemma "(EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
   26.28  apply (rule impI)
   26.29  apply (rule allI)
    27.1 --- a/src/FOL/ex/If.thy	Thu Jul 23 14:20:51 2015 +0200
    27.2 +++ b/src/FOL/ex/If.thy	Thu Jul 23 14:25:05 2015 +0200
    27.3 @@ -3,7 +3,7 @@
    27.4      Copyright   1991  University of Cambridge
    27.5  *)
    27.6  
    27.7 -section {* First-Order Logic: the 'if' example *}
    27.8 +section \<open>First-Order Logic: the 'if' example\<close>
    27.9  
   27.10  theory If imports FOL begin
   27.11  
   27.12 @@ -28,7 +28,7 @@
   27.13  apply (rule ifI)
   27.14  oops
   27.15  
   27.16 -text{*Trying again from the beginning in order to use @{text blast}*}
   27.17 +text\<open>Trying again from the beginning in order to use @{text blast}\<close>
   27.18  declare ifI [intro!]
   27.19  declare ifE [elim!]
   27.20  
   27.21 @@ -39,22 +39,22 @@
   27.22  lemma "if(if(P,Q,R), A, B) <-> if(P, if(Q,A,B), if(R,A,B))"
   27.23  by blast
   27.24  
   27.25 -text{*Trying again from the beginning in order to prove from the definitions*}
   27.26 +text\<open>Trying again from the beginning in order to prove from the definitions\<close>
   27.27  lemma "if(if(P,Q,R), A, B) <-> if(P, if(Q,A,B), if(R,A,B))"
   27.28  by (simp add: if_def, blast)
   27.29  
   27.30  
   27.31 -text{*An invalid formula.  High-level rules permit a simpler diagnosis*}
   27.32 +text\<open>An invalid formula.  High-level rules permit a simpler diagnosis\<close>
   27.33  lemma "if(if(P,Q,R), A, B) <-> if(P, if(Q,A,B), if(R,B,A))"
   27.34  apply auto
   27.35 -  -- {*The next step will fail unless subgoals remain*}
   27.36 +  -- \<open>The next step will fail unless subgoals remain\<close>
   27.37  apply (tactic all_tac)
   27.38  oops
   27.39  
   27.40 -text{*Trying again from the beginning in order to prove from the definitions*}
   27.41 +text\<open>Trying again from the beginning in order to prove from the definitions\<close>
   27.42  lemma "if(if(P,Q,R), A, B) <-> if(P, if(Q,A,B), if(R,B,A))"
   27.43  apply (simp add: if_def, auto) 
   27.44 -  -- {*The next step will fail unless subgoals remain*}
   27.45 +  -- \<open>The next step will fail unless subgoals remain\<close>
   27.46  apply (tactic all_tac)
   27.47  oops
   27.48  
    28.1 --- a/src/FOL/ex/Intro.thy	Thu Jul 23 14:20:51 2015 +0200
    28.2 +++ b/src/FOL/ex/Intro.thy	Thu Jul 23 14:25:05 2015 +0200
    28.3 @@ -5,13 +5,13 @@
    28.4  Derives some inference rules, illustrating the use of definitions.
    28.5  *)
    28.6  
    28.7 -section {* Examples for the manual ``Introduction to Isabelle'' *}
    28.8 +section \<open>Examples for the manual ``Introduction to Isabelle''\<close>
    28.9  
   28.10  theory Intro
   28.11  imports FOL
   28.12  begin
   28.13  
   28.14 -subsubsection {* Some simple backward proofs *}
   28.15 +subsubsection \<open>Some simple backward proofs\<close>
   28.16  
   28.17  lemma mythm: "P|P --> P"
   28.18  apply (rule impI)
   28.19 @@ -41,7 +41,7 @@
   28.20  done
   28.21  
   28.22  
   28.23 -subsubsection {* Demonstration of @{text "fast"} *}
   28.24 +subsubsection \<open>Demonstration of @{text "fast"}\<close>
   28.25  
   28.26  lemma "(EX y. ALL x. J(y,x) <-> ~J(x,x))
   28.27          -->  ~ (ALL x. EX y. ALL z. J(z,y) <-> ~ J(z,x))"
   28.28 @@ -55,7 +55,7 @@
   28.29  done
   28.30  
   28.31  
   28.32 -subsubsection {* Derivation of conjunction elimination rule *}
   28.33 +subsubsection \<open>Derivation of conjunction elimination rule\<close>
   28.34  
   28.35  lemma
   28.36    assumes major: "P&Q"
   28.37 @@ -67,9 +67,9 @@
   28.38  done
   28.39  
   28.40  
   28.41 -subsection {* Derived rules involving definitions *}
   28.42 +subsection \<open>Derived rules involving definitions\<close>
   28.43  
   28.44 -text {* Derivation of negation introduction *}
   28.45 +text \<open>Derivation of negation introduction\<close>
   28.46  
   28.47  lemma
   28.48    assumes "P ==> False"
   28.49 @@ -90,7 +90,7 @@
   28.50  apply (rule minor)
   28.51  done
   28.52  
   28.53 -text {* Alternative proof of the result above *}
   28.54 +text \<open>Alternative proof of the result above\<close>
   28.55  lemma
   28.56    assumes major: "~P"
   28.57      and minor: P
    29.1 --- a/src/FOL/ex/Intuitionistic.thy	Thu Jul 23 14:20:51 2015 +0200
    29.2 +++ b/src/FOL/ex/Intuitionistic.thy	Thu Jul 23 14:25:05 2015 +0200
    29.3 @@ -3,7 +3,7 @@
    29.4      Copyright   1991  University of Cambridge
    29.5  *)
    29.6  
    29.7 -section {* Intuitionistic First-Order Logic *}
    29.8 +section \<open>Intuitionistic First-Order Logic\<close>
    29.9  
   29.10  theory Intuitionistic
   29.11  imports IFOL
   29.12 @@ -21,7 +21,7 @@
   29.13  *)
   29.14  
   29.15  
   29.16 -text{*Metatheorem (for \emph{propositional} formulae):
   29.17 +text\<open>Metatheorem (for \emph{propositional} formulae):
   29.18    $P$ is classically provable iff $\neg\neg P$ is intuitionistically provable.
   29.19    Therefore $\neg P$ is classically provable iff it is intuitionistically
   29.20    provable.
   29.21 @@ -34,78 +34,78 @@
   29.22  intuitionistically.  The latter is intuitionistically equivalent to $\neg\neg
   29.23  Q\rightarrow\neg\neg P$, hence to $\neg\neg P$, since $\neg\neg Q$ is
   29.24  intuitionistically provable.  Finally, if $P$ is a negation then $\neg\neg P$
   29.25 -is intuitionstically equivalent to $P$.  [Andy Pitts] *}
   29.26 +is intuitionstically equivalent to $P$.  [Andy Pitts]\<close>
   29.27  
   29.28  lemma "~~(P&Q) <-> ~~P & ~~Q"
   29.29 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.30 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.31  
   29.32  lemma "~~ ((~P --> Q) --> (~P --> ~Q) --> P)"
   29.33 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.34 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.35  
   29.36 -text{*Double-negation does NOT distribute over disjunction*}
   29.37 +text\<open>Double-negation does NOT distribute over disjunction\<close>
   29.38  
   29.39  lemma "~~(P-->Q)  <-> (~~P --> ~~Q)"
   29.40 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.41 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.42  
   29.43  lemma "~~~P <-> ~P"
   29.44 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.45 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.46  
   29.47  lemma "~~((P --> Q | R)  -->  (P-->Q) | (P-->R))"
   29.48 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.49 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.50  
   29.51  lemma "(P<->Q) <-> (Q<->P)"
   29.52 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.53 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.54  
   29.55  lemma "((P --> (Q | (Q-->R))) --> R) --> R"
   29.56 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.57 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.58  
   29.59  lemma "(((G-->A) --> J) --> D --> E) --> (((H-->B)-->I)-->C-->J)
   29.60        --> (A-->H) --> F --> G --> (((C-->B)-->I)-->D)-->(A-->C)
   29.61        --> (((F-->A)-->B) --> I) --> E"
   29.62 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.63 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.64  
   29.65  
   29.66 -text{*Lemmas for the propositional double-negation translation*}
   29.67 +text\<open>Lemmas for the propositional double-negation translation\<close>
   29.68  
   29.69  lemma "P --> ~~P"
   29.70 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.71 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.72  
   29.73  lemma "~~(~~P --> P)"
   29.74 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.75 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.76  
   29.77  lemma "~~P & ~~(P --> Q) --> ~~Q"
   29.78 -by (tactic{*IntPr.fast_tac @{context} 1*})
   29.79 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
   29.80  
   29.81  
   29.82 -text{*The following are classically but not constructively valid.
   29.83 -      The attempt to prove them terminates quickly!*}
   29.84 +text\<open>The following are classically but not constructively valid.
   29.85 +      The attempt to prove them terminates quickly!\<close>
   29.86  lemma "((P-->Q) --> P)  -->  P"
   29.87 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
   29.88 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
   29.89 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
   29.90 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
   29.91  oops
   29.92  
   29.93  lemma "(P&Q-->R)  -->  (P-->R) | (Q-->R)"
   29.94 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
   29.95 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
   29.96 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
   29.97 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
   29.98  oops
   29.99  
  29.100  
  29.101 -subsection{*de Bruijn formulae*}
  29.102 +subsection\<open>de Bruijn formulae\<close>
  29.103  
  29.104 -text{*de Bruijn formula with three predicates*}
  29.105 +text\<open>de Bruijn formula with three predicates\<close>
  29.106  lemma "((P<->Q) --> P&Q&R) &
  29.107                 ((Q<->R) --> P&Q&R) &
  29.108                 ((R<->P) --> P&Q&R) --> P&Q&R"
  29.109 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.110 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.111  
  29.112  
  29.113 -text{*de Bruijn formula with five predicates*}
  29.114 +text\<open>de Bruijn formula with five predicates\<close>
  29.115  lemma "((P<->Q) --> P&Q&R&S&T) &
  29.116                 ((Q<->R) --> P&Q&R&S&T) &
  29.117                 ((R<->S) --> P&Q&R&S&T) &
  29.118                 ((S<->T) --> P&Q&R&S&T) &
  29.119                 ((T<->P) --> P&Q&R&S&T) --> P&Q&R&S&T"
  29.120 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.121 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.122  
  29.123  
  29.124  (*** Problems from of Sahlin, Franzen and Haridi,
  29.125 @@ -113,313 +113,313 @@
  29.126       J. Logic and Comp. 2 (5), October 1992, 619-656.
  29.127  ***)
  29.128  
  29.129 -text{*Problem 1.1*}
  29.130 +text\<open>Problem 1.1\<close>
  29.131  lemma "(ALL x. EX y. ALL z. p(x) & q(y) & r(z)) <->
  29.132        (ALL z. EX y. ALL x. p(x) & q(y) & r(z))"
  29.133 -by (tactic{*IntPr.best_dup_tac @{context} 1*})  --{*SLOW*}
  29.134 +by (tactic\<open>IntPr.best_dup_tac @{context} 1\<close>)  --\<open>SLOW\<close>
  29.135  
  29.136 -text{*Problem 3.1*}
  29.137 +text\<open>Problem 3.1\<close>
  29.138  lemma "~ (EX x. ALL y. mem(y,x) <-> ~ mem(x,x))"
  29.139 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.140 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.141  
  29.142 -text{*Problem 4.1: hopeless!*}
  29.143 +text\<open>Problem 4.1: hopeless!\<close>
  29.144  lemma "(ALL x. p(x) --> p(h(x)) | p(g(x))) & (EX x. p(x)) & (ALL x. ~p(h(x)))
  29.145        --> (EX x. p(g(g(g(g(g(x)))))))"
  29.146  oops
  29.147  
  29.148  
  29.149 -subsection{*Intuitionistic FOL: propositional problems based on Pelletier.*}
  29.150 +subsection\<open>Intuitionistic FOL: propositional problems based on Pelletier.\<close>
  29.151  
  29.152 -text{*~~1*}
  29.153 +text\<open>~~1\<close>
  29.154  lemma "~~((P-->Q)  <->  (~Q --> ~P))"
  29.155 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.156 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.157  
  29.158 -text{*~~2*}
  29.159 +text\<open>~~2\<close>
  29.160  lemma "~~(~~P  <->  P)"
  29.161 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.162 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.163  
  29.164 -text{*3*}
  29.165 +text\<open>3\<close>
  29.166  lemma "~(P-->Q) --> (Q-->P)"
  29.167 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.168 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.169  
  29.170 -text{*~~4*}
  29.171 +text\<open>~~4\<close>
  29.172  lemma "~~((~P-->Q)  <->  (~Q --> P))"
  29.173 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.174 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.175  
  29.176 -text{*~~5*}
  29.177 +text\<open>~~5\<close>
  29.178  lemma "~~((P|Q-->P|R) --> P|(Q-->R))"
  29.179 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.180 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.181  
  29.182 -text{*~~6*}
  29.183 +text\<open>~~6\<close>
  29.184  lemma "~~(P | ~P)"
  29.185 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.186 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.187  
  29.188 -text{*~~7*}
  29.189 +text\<open>~~7\<close>
  29.190  lemma "~~(P | ~~~P)"
  29.191 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.192 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.193  
  29.194 -text{*~~8.  Peirce's law*}
  29.195 +text\<open>~~8.  Peirce's law\<close>
  29.196  lemma "~~(((P-->Q) --> P)  -->  P)"
  29.197 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.198 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.199  
  29.200 -text{*9*}
  29.201 +text\<open>9\<close>
  29.202  lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
  29.203 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.204 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.205  
  29.206 -text{*10*}
  29.207 +text\<open>10\<close>
  29.208  lemma "(Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)"
  29.209 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.210 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.211  
  29.212 -subsection{*11.  Proved in each direction (incorrectly, says Pelletier!!) *}
  29.213 +subsection\<open>11.  Proved in each direction (incorrectly, says Pelletier!!)\<close>
  29.214  lemma "P<->P"
  29.215 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.216 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.217  
  29.218 -text{*~~12.  Dijkstra's law  *}
  29.219 +text\<open>~~12.  Dijkstra's law\<close>
  29.220  lemma "~~(((P <-> Q) <-> R)  <->  (P <-> (Q <-> R)))"
  29.221 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.222 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.223  
  29.224  lemma "((P <-> Q) <-> R)  -->  ~~(P <-> (Q <-> R))"
  29.225 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.226 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.227  
  29.228 -text{*13.  Distributive law*}
  29.229 +text\<open>13.  Distributive law\<close>
  29.230  lemma "P | (Q & R)  <-> (P | Q) & (P | R)"
  29.231 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.232 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.233  
  29.234 -text{*~~14*}
  29.235 +text\<open>~~14\<close>
  29.236  lemma "~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))"
  29.237 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.238 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.239  
  29.240 -text{*~~15*}
  29.241 +text\<open>~~15\<close>
  29.242  lemma "~~((P --> Q) <-> (~P | Q))"
  29.243 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.244 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.245  
  29.246 -text{*~~16*}
  29.247 +text\<open>~~16\<close>
  29.248  lemma "~~((P-->Q) | (Q-->P))"
  29.249 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.250 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.251  
  29.252 -text{*~~17*}
  29.253 +text\<open>~~17\<close>
  29.254  lemma "~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))"
  29.255 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.256 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.257  
  29.258 -text{*Dijkstra's "Golden Rule"*}
  29.259 +text\<open>Dijkstra's "Golden Rule"\<close>
  29.260  lemma "(P&Q) <-> P <-> Q <-> (P|Q)"
  29.261 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.262 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.263  
  29.264  
  29.265 -subsection{*****Examples with quantifiers*****}
  29.266 +subsection\<open>****Examples with quantifiers****\<close>
  29.267  
  29.268  
  29.269 -subsection{*The converse is classical in the following implications...*}
  29.270 +subsection\<open>The converse is classical in the following implications...\<close>
  29.271  
  29.272  lemma "(EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q"
  29.273 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.274 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.275  
  29.276  lemma "((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"
  29.277 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.278 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.279  
  29.280  lemma "((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))"
  29.281 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.282 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.283  
  29.284  lemma "(ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)"
  29.285 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.286 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.287  
  29.288  lemma "(EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"
  29.289 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.290 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.291  
  29.292  
  29.293  
  29.294  
  29.295 -subsection{*The following are not constructively valid!*}
  29.296 -text{*The attempt to prove them terminates quickly!*}
  29.297 +subsection\<open>The following are not constructively valid!\<close>
  29.298 +text\<open>The attempt to prove them terminates quickly!\<close>
  29.299  
  29.300  lemma "((ALL x. P(x))-->Q) --> (EX x. P(x)-->Q)"
  29.301 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
  29.302 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
  29.303 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
  29.304 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
  29.305  oops
  29.306  
  29.307  lemma "(P --> (EX x. Q(x))) --> (EX x. P-->Q(x))"
  29.308 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
  29.309 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
  29.310 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
  29.311 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
  29.312  oops
  29.313  
  29.314  lemma "(ALL x. P(x) | Q) --> ((ALL x. P(x)) | Q)"
  29.315 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
  29.316 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
  29.317 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
  29.318 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
  29.319  oops
  29.320  
  29.321  lemma "(ALL x. ~~P(x)) --> ~~(ALL x. P(x))"
  29.322 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
  29.323 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
  29.324 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
  29.325 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
  29.326  oops
  29.327  
  29.328 -text{*Classically but not intuitionistically valid.  Proved by a bug in 1986!*}
  29.329 +text\<open>Classically but not intuitionistically valid.  Proved by a bug in 1986!\<close>
  29.330  lemma "EX x. Q(x) --> (ALL x. Q(x))"
  29.331 -apply (tactic{*IntPr.fast_tac @{context} 1*} | -)
  29.332 -apply (rule asm_rl) --{*Checks that subgoals remain: proof failed.*}
  29.333 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close> | -)
  29.334 +apply (rule asm_rl) --\<open>Checks that subgoals remain: proof failed.\<close>
  29.335  oops
  29.336  
  29.337  
  29.338 -subsection{*Hard examples with quantifiers*}
  29.339 +subsection\<open>Hard examples with quantifiers\<close>
  29.340  
  29.341 -text{*The ones that have not been proved are not known to be valid!
  29.342 -  Some will require quantifier duplication -- not currently available*}
  29.343 +text\<open>The ones that have not been proved are not known to be valid!
  29.344 +  Some will require quantifier duplication -- not currently available\<close>
  29.345  
  29.346 -text{*~~18*}
  29.347 +text\<open>~~18\<close>
  29.348  lemma "~~(EX y. ALL x. P(y)-->P(x))"
  29.349 -oops  --{*NOT PROVED*}
  29.350 +oops  --\<open>NOT PROVED\<close>
  29.351  
  29.352 -text{*~~19*}
  29.353 +text\<open>~~19\<close>
  29.354  lemma "~~(EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x)))"
  29.355 -oops  --{*NOT PROVED*}
  29.356 +oops  --\<open>NOT PROVED\<close>
  29.357  
  29.358 -text{*20*}
  29.359 +text\<open>20\<close>
  29.360  lemma "(ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))
  29.361      --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
  29.362 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.363 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.364  
  29.365 -text{*21*}
  29.366 +text\<open>21\<close>
  29.367  lemma "(EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P<->Q(x))"
  29.368 -oops --{*NOT PROVED; needs quantifier duplication*}
  29.369 +oops --\<open>NOT PROVED; needs quantifier duplication\<close>
  29.370  
  29.371 -text{*22*}
  29.372 +text\<open>22\<close>
  29.373  lemma "(ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
  29.374 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.375 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.376  
  29.377 -text{*~~23*}
  29.378 +text\<open>~~23\<close>
  29.379  lemma "~~ ((ALL x. P | Q(x))  <->  (P | (ALL x. Q(x))))"
  29.380 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.381 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.382  
  29.383 -text{*24*}
  29.384 +text\<open>24\<close>
  29.385  lemma "~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &
  29.386       (~(EX x. P(x)) --> (EX x. Q(x))) & (ALL x. Q(x)|R(x) --> S(x))
  29.387      --> ~~(EX x. P(x)&R(x))"
  29.388 -txt{*Not clear why @{text fast_tac}, @{text best_tac}, @{text ASTAR} and 
  29.389 -    @{text ITER_DEEPEN} all take forever*}
  29.390 -apply (tactic{* IntPr.safe_tac @{context}*})
  29.391 +txt\<open>Not clear why @{text fast_tac}, @{text best_tac}, @{text ASTAR} and 
  29.392 +    @{text ITER_DEEPEN} all take forever\<close>
  29.393 +apply (tactic\<open>IntPr.safe_tac @{context}\<close>)
  29.394  apply (erule impE)
  29.395 -apply (tactic{*IntPr.fast_tac @{context} 1*})
  29.396 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.397 +apply (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.398 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.399  
  29.400 -text{*25*}
  29.401 +text\<open>25\<close>
  29.402  lemma "(EX x. P(x)) &
  29.403          (ALL x. L(x) --> ~ (M(x) & R(x))) &
  29.404          (ALL x. P(x) --> (M(x) & L(x))) &
  29.405          ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))
  29.406      --> (EX x. Q(x)&P(x))"
  29.407 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.408 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.409  
  29.410 -text{*~~26*}
  29.411 +text\<open>~~26\<close>
  29.412  lemma "(~~(EX x. p(x)) <-> ~~(EX x. q(x))) &
  29.413        (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))
  29.414    --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))"
  29.415 -oops  --{*NOT PROVED*}
  29.416 +oops  --\<open>NOT PROVED\<close>
  29.417  
  29.418 -text{*27*}
  29.419 +text\<open>27\<close>
  29.420  lemma "(EX x. P(x) & ~Q(x)) &
  29.421                (ALL x. P(x) --> R(x)) &
  29.422                (ALL x. M(x) & L(x) --> P(x)) &
  29.423                ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))
  29.424            --> (ALL x. M(x) --> ~L(x))"
  29.425 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.426 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.427  
  29.428 -text{*~~28.  AMENDED*}
  29.429 +text\<open>~~28.  AMENDED\<close>
  29.430  lemma "(ALL x. P(x) --> (ALL x. Q(x))) &
  29.431          (~~(ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &
  29.432          (~~(EX x. S(x)) --> (ALL x. L(x) --> M(x)))
  29.433      --> (ALL x. P(x) & L(x) --> M(x))"
  29.434 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.435 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.436  
  29.437 -text{*29.  Essentially the same as Principia Mathematica *11.71*}
  29.438 +text\<open>29.  Essentially the same as Principia Mathematica *11.71\<close>
  29.439  lemma "(EX x. P(x)) & (EX y. Q(y))
  29.440      --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->
  29.441           (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"
  29.442 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.443 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.444  
  29.445 -text{*~~30*}
  29.446 +text\<open>~~30\<close>
  29.447  lemma "(ALL x. (P(x) | Q(x)) --> ~ R(x)) &
  29.448          (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))
  29.449      --> (ALL x. ~~S(x))"
  29.450 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.451 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.452  
  29.453 -text{*31*}
  29.454 +text\<open>31\<close>
  29.455  lemma "~(EX x. P(x) & (Q(x) | R(x))) &
  29.456          (EX x. L(x) & P(x)) &
  29.457          (ALL x. ~ R(x) --> M(x))
  29.458      --> (EX x. L(x) & M(x))"
  29.459 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.460 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.461  
  29.462 -text{*32*}
  29.463 +text\<open>32\<close>
  29.464  lemma "(ALL x. P(x) & (Q(x)|R(x))-->S(x)) &
  29.465          (ALL x. S(x) & R(x) --> L(x)) &
  29.466          (ALL x. M(x) --> R(x))
  29.467      --> (ALL x. P(x) & M(x) --> L(x))"
  29.468 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.469 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.470  
  29.471 -text{*~~33*}
  29.472 +text\<open>~~33\<close>
  29.473  lemma "(ALL x. ~~(P(a) & (P(x)-->P(b))-->P(c)))  <->
  29.474        (ALL x. ~~((~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c))))"
  29.475 -apply (tactic{*IntPr.best_tac @{context} 1*})
  29.476 +apply (tactic\<open>IntPr.best_tac @{context} 1\<close>)
  29.477  done
  29.478  
  29.479  
  29.480 -text{*36*}
  29.481 +text\<open>36\<close>
  29.482  lemma "(ALL x. EX y. J(x,y)) &
  29.483        (ALL x. EX y. G(x,y)) &
  29.484        (ALL x y. J(x,y) | G(x,y) --> (ALL z. J(y,z) | G(y,z) --> H(x,z)))
  29.485    --> (ALL x. EX y. H(x,y))"
  29.486 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.487 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.488  
  29.489 -text{*37*}
  29.490 +text\<open>37\<close>
  29.491  lemma "(ALL z. EX w. ALL x. EX y.
  29.492             ~~(P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u. Q(u,w)))) &
  29.493          (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) &
  29.494          (~~(EX x y. Q(x,y)) --> (ALL x. R(x,x)))
  29.495      --> ~~(ALL x. EX y. R(x,y))"
  29.496 -oops  --{*NOT PROVED*}
  29.497 +oops  --\<open>NOT PROVED\<close>
  29.498  
  29.499 -text{*39*}
  29.500 +text\<open>39\<close>
  29.501  lemma "~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"
  29.502 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.503 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.504  
  29.505 -text{*40.  AMENDED*}
  29.506 +text\<open>40.  AMENDED\<close>
  29.507  lemma "(EX y. ALL x. F(x,y) <-> F(x,x)) -->
  29.508                ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"
  29.509 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.510 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.511  
  29.512 -text{*44*}
  29.513 +text\<open>44\<close>
  29.514  lemma "(ALL x. f(x) -->
  29.515                (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &
  29.516                (EX x. j(x) & (ALL y. g(y) --> h(x,y)))
  29.517                --> (EX x. j(x) & ~f(x))"
  29.518 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.519 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.520  
  29.521 -text{*48*}
  29.522 +text\<open>48\<close>
  29.523  lemma "(a=b | c=d) & (a=c | b=d) --> a=d | b=c"
  29.524 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.525 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.526  
  29.527 -text{*51*}
  29.528 +text\<open>51\<close>
  29.529  lemma "(EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->
  29.530       (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)"
  29.531 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.532 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.533  
  29.534 -text{*52*}
  29.535 -text{*Almost the same as 51. *}
  29.536 +text\<open>52\<close>
  29.537 +text\<open>Almost the same as 51.\<close>
  29.538  lemma "(EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->
  29.539       (EX w. ALL y. EX z. (ALL x. P(x,y) <-> x=z) <-> y=w)"
  29.540 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.541 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.542  
  29.543 -text{*56*}
  29.544 +text\<open>56\<close>
  29.545  lemma "(ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
  29.546 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.547 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.548  
  29.549 -text{*57*}
  29.550 +text\<open>57\<close>
  29.551  lemma "P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) &
  29.552       (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))"
  29.553 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.554 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.555  
  29.556 -text{*60*}
  29.557 +text\<open>60\<close>
  29.558  lemma "ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
  29.559 -by (tactic{*IntPr.fast_tac @{context} 1*})
  29.560 +by (tactic\<open>IntPr.fast_tac @{context} 1\<close>)
  29.561  
  29.562  end
  29.563  
    30.1 --- a/src/FOL/ex/Locale_Test/Locale_Test.thy	Thu Jul 23 14:20:51 2015 +0200
    30.2 +++ b/src/FOL/ex/Locale_Test/Locale_Test.thy	Thu Jul 23 14:25:05 2015 +0200
    30.3 @@ -8,7 +8,7 @@
    30.4  imports Locale_Test1 Locale_Test2 Locale_Test3
    30.5  begin
    30.6  
    30.7 -text {* Result of theory merge with distinct but identical interpretations *}
    30.8 +text \<open>Result of theory merge with distinct but identical interpretations\<close>
    30.9  
   30.10  context mixin_thy_merge
   30.11  begin
    31.1 --- a/src/FOL/ex/Locale_Test/Locale_Test1.thy	Thu Jul 23 14:20:51 2015 +0200
    31.2 +++ b/src/FOL/ex/Locale_Test/Locale_Test1.thy	Thu Jul 23 14:25:05 2015 +0200
    31.3 @@ -21,7 +21,7 @@
    31.4    int_minus: "(-x) + x = 0" and
    31.5    int_minus2: "-(-x) = x"
    31.6  
    31.7 -section {* Inference of parameter types *}
    31.8 +section \<open>Inference of parameter types\<close>
    31.9  
   31.10  locale param1 = fixes p
   31.11  print_locale! param1
   31.12 @@ -41,7 +41,7 @@
   31.13  print_locale! param4
   31.14  
   31.15  
   31.16 -subsection {* Incremental type constraints *}
   31.17 +subsection \<open>Incremental type constraints\<close>
   31.18  
   31.19  locale constraint1 =
   31.20    fixes  prod (infixl "**" 65)
   31.21 @@ -55,7 +55,7 @@
   31.22  print_locale! constraint2
   31.23  
   31.24  
   31.25 -section {* Inheritance *}
   31.26 +section \<open>Inheritance\<close>
   31.27  
   31.28  locale semi =
   31.29    fixes prod (infixl "**" 65)
   31.30 @@ -86,12 +86,12 @@
   31.31  locale pert_hom = d1: perturbation f d1 + d2: perturbation f d2 for f d1 d2
   31.32  print_locale! pert_hom thm pert_hom_def
   31.33  
   31.34 -text {* Alternative expression, obtaining nicer names in @{text "semi f"}. *}
   31.35 +text \<open>Alternative expression, obtaining nicer names in @{text "semi f"}.\<close>
   31.36  locale pert_hom' = semi f + d1: perturbation f d1 + d2: perturbation f d2 for f d1 d2
   31.37  print_locale! pert_hom' thm pert_hom'_def
   31.38  
   31.39  
   31.40 -section {* Syntax declarations *}
   31.41 +section \<open>Syntax declarations\<close>
   31.42  
   31.43  locale logic =
   31.44    fixes land (infixl "&&" 55)
   31.45 @@ -126,7 +126,7 @@
   31.46  thm var.test_def
   31.47  
   31.48  
   31.49 -text {* Under which circumstances term syntax remains active. *}
   31.50 +text \<open>Under which circumstances term syntax remains active.\<close>
   31.51  
   31.52  locale "syntax" =
   31.53    fixes p1 :: "'a => 'b"
   31.54 @@ -147,7 +147,7 @@
   31.55  
   31.56  thm d1_def d2_def  (* should print as "d1(?x) <-> ..." and "d2(?x) <-> ..." *)
   31.57  
   31.58 -ML {*
   31.59 +ML \<open>
   31.60    fun check_syntax ctxt thm expected =
   31.61      let
   31.62        val obtained =
   31.63 @@ -157,14 +157,14 @@
   31.64        then error ("Theorem syntax '" ^ obtained ^ "' obtained, but '" ^ expected ^ "' expected.")
   31.65        else ()
   31.66      end;
   31.67 -*}
   31.68 +\<close>
   31.69  
   31.70  declare [[show_hyps]]
   31.71  
   31.72 -ML {*
   31.73 +ML \<open>
   31.74    check_syntax @{context} @{thm d1_def} "d1(?x) <-> ~ p2(p1(?x))";
   31.75    check_syntax @{context} @{thm d2_def} "d2(?x) <-> ~ p2(?x)";
   31.76 -*}
   31.77 +\<close>
   31.78  
   31.79  end
   31.80  
   31.81 @@ -174,21 +174,21 @@
   31.82  thm d1_def d2_def
   31.83    (* should print as "syntax.d1(p3, p2, ?x) <-> ..." and "d2(?x) <-> ..." *)
   31.84  
   31.85 -ML {*
   31.86 +ML \<open>
   31.87    check_syntax @{context} @{thm d1_def} "syntax.d1(p3, p2, ?x) <-> ~ p2(p3(?x))";
   31.88    check_syntax @{context} @{thm d2_def} "d2(?x) <-> ~ p2(?x)";
   31.89 -*}
   31.90 +\<close>
   31.91  
   31.92  end
   31.93  
   31.94  
   31.95 -section {* Foundational versions of theorems *}
   31.96 +section \<open>Foundational versions of theorems\<close>
   31.97  
   31.98  thm logic.assoc
   31.99  thm logic.lor_def
  31.100  
  31.101  
  31.102 -section {* Defines *}
  31.103 +section \<open>Defines\<close>
  31.104  
  31.105  locale logic_def =
  31.106    fixes land (infixl "&&" 55)
  31.107 @@ -217,7 +217,7 @@
  31.108  end
  31.109  
  31.110  
  31.111 -section {* Notes *}
  31.112 +section \<open>Notes\<close>
  31.113  
  31.114  (* A somewhat arcane homomorphism example *)
  31.115  
  31.116 @@ -247,7 +247,7 @@
  31.117    shows True ..
  31.118  
  31.119  
  31.120 -section {* Theorem statements *}
  31.121 +section \<open>Theorem statements\<close>
  31.122  
  31.123  lemma (in lgrp) lcancel:
  31.124    "x ** y = x ** z <-> y = z"
  31.125 @@ -278,13 +278,13 @@
  31.126  print_locale! rgrp
  31.127  
  31.128  
  31.129 -subsection {* Patterns *}
  31.130 +subsection \<open>Patterns\<close>
  31.131  
  31.132  lemma (in rgrp)
  31.133    assumes "y ** x = z ** x" (is ?a)
  31.134    shows "y = z" (is ?t)
  31.135  proof -
  31.136 -  txt {* Weird proof involving patterns from context element and conclusion. *}
  31.137 +  txt \<open>Weird proof involving patterns from context element and conclusion.\<close>
  31.138    {
  31.139      assume ?a
  31.140      then have "y ** (x ** inv(x)) = z ** (x ** inv(x))"
  31.141 @@ -292,11 +292,11 @@
  31.142      then have ?t by (simp add: rone rinv)
  31.143    }
  31.144    note x = this
  31.145 -  show ?t by (rule x [OF `?a`])
  31.146 +  show ?t by (rule x [OF \<open>?a\<close>])
  31.147  qed
  31.148  
  31.149  
  31.150 -section {* Interpretation between locales: sublocales *}
  31.151 +section \<open>Interpretation between locales: sublocales\<close>
  31.152  
  31.153  sublocale lgrp < right: rgrp
  31.154  print_facts
  31.155 @@ -436,7 +436,7 @@
  31.156  print_locale! trivial  (* No instance for y created (subsumed). *)
  31.157  
  31.158  
  31.159 -subsection {* Sublocale, then interpretation in theory *}
  31.160 +subsection \<open>Sublocale, then interpretation in theory\<close>
  31.161  
  31.162  interpretation int?: lgrp "op +" "0" "minus"
  31.163  proof unfold_locales
  31.164 @@ -447,15 +447,15 @@
  31.165  interpretation int2?: semi "op +"
  31.166    by unfold_locales  (* subsumed, thm int2.assoc not generated *)
  31.167  
  31.168 -ML {* (Global_Theory.get_thms @{theory} "int2.assoc";
  31.169 +ML \<open>(Global_Theory.get_thms @{theory} "int2.assoc";
  31.170      raise Fail "thm int2.assoc was generated")
  31.171 -  handle ERROR _ => ([]:thm list); *}
  31.172 +  handle ERROR _ => ([]:thm list);\<close>
  31.173  
  31.174  thm int.lone int.right.rone
  31.175    (* the latter comes through the sublocale relation *)
  31.176  
  31.177  
  31.178 -subsection {* Interpretation in theory, then sublocale *}
  31.179 +subsection \<open>Interpretation in theory, then sublocale\<close>
  31.180  
  31.181  interpretation fol: logic "op +" "minus"
  31.182    by unfold_locales (rule int_assoc int_minus2)+
  31.183 @@ -478,7 +478,7 @@
  31.184  thm fol.two.assoc
  31.185  
  31.186  
  31.187 -subsection {* Declarations and sublocale *}
  31.188 +subsection \<open>Declarations and sublocale\<close>
  31.189  
  31.190  locale logic_a = logic
  31.191  locale logic_b = logic
  31.192 @@ -487,9 +487,9 @@
  31.193    by unfold_locales
  31.194  
  31.195  
  31.196 -subsection {* Interpretation *}
  31.197 +subsection \<open>Interpretation\<close>
  31.198  
  31.199 -subsection {* Rewrite morphism *}
  31.200 +subsection \<open>Rewrite morphism\<close>
  31.201  
  31.202  locale logic_o =
  31.203    fixes land (infixl "&&" 55)
  31.204 @@ -521,7 +521,7 @@
  31.205    x.lor_triv
  31.206  
  31.207  
  31.208 -subsection {* Inheritance of rewrite morphisms *}
  31.209 +subsection \<open>Inheritance of rewrite morphisms\<close>
  31.210  
  31.211  locale reflexive =
  31.212    fixes le :: "'a => 'a => o" (infix "\<sqsubseteq>" 50)
  31.213 @@ -539,7 +539,7 @@
  31.214    grefl: "gle(x, x)" and gless_def: "gless(x, y) <-> gle(x, y) & x ~= y" and
  31.215    grefl': "gle'(x, x)" and gless'_def: "gless'(x, y) <-> gle'(x, y) & x ~= y"
  31.216  
  31.217 -text {* Setup *}
  31.218 +text \<open>Setup\<close>
  31.219  
  31.220  locale mixin = reflexive
  31.221  begin
  31.222 @@ -554,7 +554,7 @@
  31.223      by (simp add: reflexive.less_def[OF reflexive] gless_def)
  31.224  qed
  31.225  
  31.226 -text {* Rewrite morphism propagated along the locale hierarchy *}
  31.227 +text \<open>Rewrite morphism propagated along the locale hierarchy\<close>
  31.228  
  31.229  locale mixin2 = mixin
  31.230  begin
  31.231 @@ -568,7 +568,7 @@
  31.232  lemma "gless(x, y) <-> gle(x, y) & x ~= y"
  31.233    by (rule le.less_thm2)
  31.234  
  31.235 -text {* Rewrite morphism does not leak to a side branch. *}
  31.236 +text \<open>Rewrite morphism does not leak to a side branch.\<close>
  31.237  
  31.238  locale mixin3 = reflexive
  31.239  begin
  31.240 @@ -581,7 +581,7 @@
  31.241  thm le.less_thm3  (* rewrite morphism not applied *)
  31.242  lemma "reflexive.less(gle, x, y) <-> gle(x, y) & x ~= y" by (rule le.less_thm3)
  31.243  
  31.244 -text {* Rewrite morphism only available in original context *}
  31.245 +text \<open>Rewrite morphism only available in original context\<close>
  31.246  
  31.247  locale mixin4_base = reflexive
  31.248  
  31.249 @@ -613,7 +613,7 @@
  31.250  lemma "reflexive.less(gle, x, y) <-> gle(x, y) & x ~= y"
  31.251    by (rule le4.less_thm4')
  31.252  
  31.253 -text {* Inherited rewrite morphism applied to new theorem *}
  31.254 +text \<open>Inherited rewrite morphism applied to new theorem\<close>
  31.255  
  31.256  locale mixin5_base = reflexive
  31.257  
  31.258 @@ -637,7 +637,7 @@
  31.259  lemma "gless(x, y) <-> gle(x, y) & x ~= y"
  31.260    by (rule le5.less_thm5)
  31.261  
  31.262 -text {* Rewrite morphism pushed down to existing inherited locale *}
  31.263 +text \<open>Rewrite morphism pushed down to existing inherited locale\<close>
  31.264  
  31.265  locale mixin6_base = reflexive
  31.266  
  31.267 @@ -662,7 +662,7 @@
  31.268  lemma "gless(x, y) <-> gle(x, y) & x ~= y"
  31.269    by (rule le6.less_thm6)
  31.270  
  31.271 -text {* Existing rewrite morphism inherited through sublocale relation *}
  31.272 +text \<open>Existing rewrite morphism inherited through sublocale relation\<close>
  31.273  
  31.274  locale mixin7_base = reflexive
  31.275  
  31.276 @@ -696,16 +696,16 @@
  31.277    by (rule le7.less_thm7b)
  31.278  
  31.279  
  31.280 -text {* This locale will be interpreted in later theories. *}
  31.281 +text \<open>This locale will be interpreted in later theories.\<close>
  31.282  
  31.283  locale mixin_thy_merge = le: reflexive le + le': reflexive le' for le le'
  31.284  
  31.285  
  31.286 -subsection {* Rewrite morphisms in sublocale *}
  31.287 +subsection \<open>Rewrite morphisms in sublocale\<close>
  31.288  
  31.289 -text {* Simulate a specification of left groups where unit and inverse are defined
  31.290 +text \<open>Simulate a specification of left groups where unit and inverse are defined
  31.291    rather than specified.  This is possible, but not in FOL, due to the lack of a
  31.292 -  selection operator. *}
  31.293 +  selection operator.\<close>
  31.294  
  31.295  axiomatization glob_one and glob_inv
  31.296    where glob_lone: "prod(glob_one(prod), x) = x"
  31.297 @@ -745,24 +745,24 @@
  31.298  
  31.299  context lgrp begin
  31.300  
  31.301 -text {* Equations stored in target *}
  31.302 +text \<open>Equations stored in target\<close>
  31.303  
  31.304  lemma "dgrp.one(prod) = one" by (rule one_equation)
  31.305  lemma "dgrp.inv(prod, x) = inv(x)" by (rule inv_equation)
  31.306  
  31.307 -text {* Rewrite morphisms applied *}
  31.308 +text \<open>Rewrite morphisms applied\<close>
  31.309  
  31.310  lemma "one = glob_one(prod)" by (rule one_def)
  31.311  lemma "inv(x) = glob_inv(prod, x)" by (rule inv_def)
  31.312  
  31.313  end
  31.314  
  31.315 -text {* Interpreted versions *}
  31.316 +text \<open>Interpreted versions\<close>
  31.317  
  31.318  lemma "0 = glob_one (op +)" by (rule int.def.one_def)
  31.319  lemma "- x = glob_inv(op +, x)" by (rule int.def.inv_def)
  31.320  
  31.321 -text {* Roundup applies rewrite morphisms at declaration level in DFS tree *}
  31.322 +text \<open>Roundup applies rewrite morphisms at declaration level in DFS tree\<close>
  31.323  
  31.324  locale roundup = fixes x assumes true: "x <-> True"
  31.325  
  31.326 @@ -771,7 +771,7 @@
  31.327  lemma (in roundup) "True & True <-> True" by (rule sub.true)
  31.328  
  31.329  
  31.330 -section {* Interpretation in named contexts *}
  31.331 +section \<open>Interpretation in named contexts\<close>
  31.332  
  31.333  locale container
  31.334  begin
  31.335 @@ -780,15 +780,15 @@
  31.336  end
  31.337  
  31.338  context container begin
  31.339 -ML {* (Context.>> (fn generic => let val context = Context.proof_of generic
  31.340 +ML \<open>(Context.>> (fn generic => let val context = Context.proof_of generic
  31.341    val _ = Proof_Context.get_thms context "private.true" in generic end);
  31.342    raise Fail "thm private.true was persisted")
  31.343 -  handle ERROR _ => ([]:thm list); *}
  31.344 +  handle ERROR _ => ([]:thm list);\<close>
  31.345  thm true_copy
  31.346  end
  31.347  
  31.348  
  31.349 -section {* Interpretation in proofs *}
  31.350 +section \<open>Interpretation in proofs\<close>
  31.351  
  31.352  lemma True
  31.353  proof
    32.1 --- a/src/FOL/ex/Miniscope.thy	Thu Jul 23 14:20:51 2015 +0200
    32.2 +++ b/src/FOL/ex/Miniscope.thy	Thu Jul 23 14:25:05 2015 +0200
    32.3 @@ -14,9 +14,9 @@
    32.4  
    32.5  lemmas ccontr = FalseE [THEN classical]
    32.6  
    32.7 -subsection {* Negation Normal Form *}
    32.8 +subsection \<open>Negation Normal Form\<close>
    32.9  
   32.10 -subsubsection {* de Morgan laws *}
   32.11 +subsubsection \<open>de Morgan laws\<close>
   32.12  
   32.13  lemma demorgans:
   32.14    "~(P&Q) <-> ~P | ~Q"
   32.15 @@ -38,7 +38,7 @@
   32.16  
   32.17  (* BEWARE: rewrite rules for <-> can confuse the simplifier!! *)
   32.18  
   32.19 -subsubsection {* Pushing in the existential quantifiers *}
   32.20 +subsubsection \<open>Pushing in the existential quantifiers\<close>
   32.21  
   32.22  lemma ex_simps:
   32.23    "(EX x. P) <-> P"
   32.24 @@ -50,7 +50,7 @@
   32.25    by blast+
   32.26  
   32.27  
   32.28 -subsubsection {* Pushing in the universal quantifiers *}
   32.29 +subsubsection \<open>Pushing in the universal quantifiers\<close>
   32.30  
   32.31  lemma all_simps:
   32.32    "(ALL x. P) <-> P"
   32.33 @@ -63,10 +63,10 @@
   32.34  
   32.35  lemmas mini_simps = demorgans nnf_simps ex_simps all_simps
   32.36  
   32.37 -ML {*
   32.38 +ML \<open>
   32.39  val mini_ss = simpset_of (@{context} addsimps @{thms mini_simps});
   32.40  fun mini_tac ctxt =
   32.41    resolve_tac ctxt @{thms ccontr} THEN' asm_full_simp_tac (put_simpset mini_ss ctxt);
   32.42 -*}
   32.43 +\<close>
   32.44  
   32.45  end
    33.1 --- a/src/FOL/ex/Nat.thy	Thu Jul 23 14:20:51 2015 +0200
    33.2 +++ b/src/FOL/ex/Nat.thy	Thu Jul 23 14:25:05 2015 +0200
    33.3 @@ -3,7 +3,7 @@
    33.4      Copyright   1992  University of Cambridge
    33.5  *)
    33.6  
    33.7 -section {* Theory of the natural numbers: Peano's axioms, primitive recursion *}
    33.8 +section \<open>Theory of the natural numbers: Peano's axioms, primitive recursion\<close>
    33.9  
   33.10  theory Nat
   33.11  imports FOL
   33.12 @@ -27,7 +27,7 @@
   33.13    where "m + n == rec(m, n, %x y. Suc(y))"
   33.14  
   33.15  
   33.16 -subsection {* Proofs about the natural numbers *}
   33.17 +subsection \<open>Proofs about the natural numbers\<close>
   33.18  
   33.19  lemma Suc_n_not_n: "Suc(k) ~= k"
   33.20  apply (rule_tac n = k in induct)
    34.1 --- a/src/FOL/ex/Nat_Class.thy	Thu Jul 23 14:20:51 2015 +0200
    34.2 +++ b/src/FOL/ex/Nat_Class.thy	Thu Jul 23 14:25:05 2015 +0200
    34.3 @@ -6,14 +6,14 @@
    34.4  imports FOL
    34.5  begin
    34.6  
    34.7 -text {*
    34.8 +text \<open>
    34.9    This is an abstract version of theory @{text Nat}. Instead of
   34.10    axiomatizing a single type @{text nat} we define the class of all
   34.11    these types (up to isomorphism).
   34.12  
   34.13    Note: The @{text rec} operator had to be made \emph{monomorphic},
   34.14    because class axioms may not contain more than one type variable.
   34.15 -*}
   34.16 +\<close>
   34.17  
   34.18  class nat =
   34.19    fixes Zero :: 'a  ("0")
    35.1 --- a/src/FOL/ex/Natural_Numbers.thy	Thu Jul 23 14:20:51 2015 +0200
    35.2 +++ b/src/FOL/ex/Natural_Numbers.thy	Thu Jul 23 14:25:05 2015 +0200
    35.3 @@ -2,16 +2,16 @@
    35.4      Author:     Markus Wenzel, TU Munich
    35.5  *)
    35.6  
    35.7 -section {* Natural numbers *}
    35.8 +section \<open>Natural numbers\<close>
    35.9  
   35.10  theory Natural_Numbers
   35.11  imports FOL
   35.12  begin
   35.13  
   35.14 -text {*
   35.15 +text \<open>
   35.16    Theory of the natural numbers: Peano's axioms, primitive recursion.
   35.17    (Modernized version of Larry Paulson's theory "Nat".)  \medskip
   35.18 -*}
   35.19 +\<close>
   35.20  
   35.21  typedecl nat
   35.22  instance nat :: "term" ..
    36.1 --- a/src/FOL/ex/Prolog.thy	Thu Jul 23 14:20:51 2015 +0200
    36.2 +++ b/src/FOL/ex/Prolog.thy	Thu Jul 23 14:25:05 2015 +0200
    36.3 @@ -3,7 +3,7 @@
    36.4      Copyright   1992  University of Cambridge
    36.5  *)
    36.6  
    36.7 -section {* First-Order Logic: PROLOG examples *}
    36.8 +section \<open>First-Order Logic: PROLOG examples\<close>
    36.9  
   36.10  theory Prolog
   36.11  imports FOL
   36.12 @@ -56,16 +56,16 @@
   36.13  done
   36.14  
   36.15  schematic_lemma "rev(?x, a:b:c:Nil)"
   36.16 -apply (rule rules)+  -- {* does not solve it directly! *}
   36.17 +apply (rule rules)+  -- \<open>does not solve it directly!\<close>
   36.18  back
   36.19  back
   36.20  done
   36.21  
   36.22  (*backtracking version*)
   36.23 -ML {*
   36.24 +ML \<open>
   36.25  fun prolog_tac ctxt =
   36.26    DEPTH_FIRST (has_fewer_prems 1) (resolve_tac ctxt @{thms rules} 1)
   36.27 -*}
   36.28 +\<close>
   36.29  
   36.30  schematic_lemma "rev(?x, a:b:c:Nil)"
   36.31  apply (tactic \<open>prolog_tac @{context}\<close>)
   36.32 @@ -77,15 +77,15 @@
   36.33  
   36.34  (*rev([a..p], ?w) requires 153 inferences *)
   36.35  schematic_lemma "rev(a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:Nil, ?w)"
   36.36 -apply (tactic {*
   36.37 -  DEPTH_SOLVE (resolve_tac @{context} ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1) *})
   36.38 +apply (tactic \<open>
   36.39 +  DEPTH_SOLVE (resolve_tac @{context} ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1)\<close>)
   36.40  done
   36.41  
   36.42  (*?x has 16, ?y has 32;  rev(?y,?w) requires 561 (rather large) inferences
   36.43    total inferences = 2 + 1 + 17 + 561 = 581*)
   36.44  schematic_lemma "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:Nil = ?x & app(?x,?x,?y) & rev(?y,?w)"
   36.45 -apply (tactic {*
   36.46 -  DEPTH_SOLVE (resolve_tac @{context} ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1) *})
   36.47 +apply (tactic \<open>
   36.48 +  DEPTH_SOLVE (resolve_tac @{context} ([@{thm refl}, @{thm conjI}] @ @{thms rules}) 1)\<close>)
   36.49  done
   36.50  
   36.51  end
    37.1 --- a/src/FOL/ex/Propositional_Cla.thy	Thu Jul 23 14:20:51 2015 +0200
    37.2 +++ b/src/FOL/ex/Propositional_Cla.thy	Thu Jul 23 14:25:05 2015 +0200
    37.3 @@ -3,13 +3,13 @@
    37.4      Copyright   1991  University of Cambridge
    37.5  *)
    37.6  
    37.7 -section {* First-Order Logic: propositional examples (classical version) *}
    37.8 +section \<open>First-Order Logic: propositional examples (classical version)\<close>
    37.9  
   37.10  theory Propositional_Cla
   37.11  imports FOL
   37.12  begin
   37.13  
   37.14 -text {* commutative laws of @{text "&"} and @{text "|"} *}
   37.15 +text \<open>commutative laws of @{text "&"} and @{text "|"}\<close>
   37.16  
   37.17  lemma "P & Q  -->  Q & P"
   37.18    by (tactic "IntPr.fast_tac @{context} 1")
   37.19 @@ -18,7 +18,7 @@
   37.20    by fast
   37.21  
   37.22  
   37.23 -text {* associative laws of @{text "&"} and @{text "|"} *}
   37.24 +text \<open>associative laws of @{text "&"} and @{text "|"}\<close>
   37.25  lemma "(P & Q) & R  -->  P & (Q & R)"
   37.26    by fast
   37.27  
   37.28 @@ -26,7 +26,7 @@
   37.29    by fast
   37.30  
   37.31  
   37.32 -text {* distributive laws of @{text "&"} and @{text "|"} *}
   37.33 +text \<open>distributive laws of @{text "&"} and @{text "|"}\<close>
   37.34  lemma "(P & Q) | R  --> (P | R) & (Q | R)"
   37.35    by fast
   37.36  
   37.37 @@ -40,7 +40,7 @@
   37.38    by fast
   37.39  
   37.40  
   37.41 -text {* Laws involving implication *}
   37.42 +text \<open>Laws involving implication\<close>
   37.43  
   37.44  lemma "(P-->R) & (Q-->R) <-> (P|Q --> R)"
   37.45    by fast
   37.46 @@ -58,18 +58,18 @@
   37.47    by fast
   37.48  
   37.49  
   37.50 -text {* Propositions-as-types *}
   37.51 +text \<open>Propositions-as-types\<close>
   37.52  
   37.53 --- {* The combinator K *}
   37.54 +-- \<open>The combinator K\<close>
   37.55  lemma "P --> (Q --> P)"
   37.56    by fast
   37.57  
   37.58 --- {* The combinator S *}
   37.59 +-- \<open>The combinator S\<close>
   37.60  lemma "(P-->Q-->R)  --> (P-->Q) --> (P-->R)"
   37.61    by fast
   37.62  
   37.63  
   37.64 --- {* Converse is classical *}
   37.65 +-- \<open>Converse is classical\<close>
   37.66  lemma "(P-->Q) | (P-->R)  -->  (P --> Q | R)"
   37.67    by fast
   37.68  
   37.69 @@ -77,7 +77,7 @@
   37.70    by fast
   37.71  
   37.72  
   37.73 -text {* Schwichtenberg's examples (via T. Nipkow) *}
   37.74 +text \<open>Schwichtenberg's examples (via T. Nipkow)\<close>
   37.75  
   37.76  lemma stab_imp: "(((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
   37.77    by fast
    38.1 --- a/src/FOL/ex/Propositional_Int.thy	Thu Jul 23 14:20:51 2015 +0200
    38.2 +++ b/src/FOL/ex/Propositional_Int.thy	Thu Jul 23 14:25:05 2015 +0200
    38.3 @@ -3,13 +3,13 @@
    38.4      Copyright   1991  University of Cambridge
    38.5  *)
    38.6  
    38.7 -section {* First-Order Logic: propositional examples (intuitionistic version) *}
    38.8 +section \<open>First-Order Logic: propositional examples (intuitionistic version)\<close>
    38.9  
   38.10  theory Propositional_Int
   38.11  imports IFOL
   38.12  begin
   38.13  
   38.14 -text {* commutative laws of @{text "&"} and @{text "|"} *}
   38.15 +text \<open>commutative laws of @{text "&"} and @{text "|"}\<close>
   38.16  
   38.17  lemma "P & Q  -->  Q & P"
   38.18    by (tactic "IntPr.fast_tac @{context} 1")
   38.19 @@ -18,7 +18,7 @@
   38.20    by (tactic "IntPr.fast_tac @{context} 1")
   38.21  
   38.22  
   38.23 -text {* associative laws of @{text "&"} and @{text "|"} *}
   38.24 +text \<open>associative laws of @{text "&"} and @{text "|"}\<close>
   38.25  lemma "(P & Q) & R  -->  P & (Q & R)"
   38.26    by (tactic "IntPr.fast_tac @{context} 1")
   38.27  
   38.28 @@ -26,7 +26,7 @@
   38.29    by (tactic "IntPr.fast_tac @{context} 1")
   38.30  
   38.31  
   38.32 -text {* distributive laws of @{text "&"} and @{text "|"} *}
   38.33 +text \<open>distributive laws of @{text "&"} and @{text "|"}\<close>
   38.34  lemma "(P & Q) | R  --> (P | R) & (Q | R)"
   38.35    by (tactic "IntPr.fast_tac @{context} 1")
   38.36  
   38.37 @@ -40,7 +40,7 @@
   38.38    by (tactic "IntPr.fast_tac @{context} 1")
   38.39  
   38.40  
   38.41 -text {* Laws involving implication *}
   38.42 +text \<open>Laws involving implication\<close>
   38.43  
   38.44  lemma "(P-->R) & (Q-->R) <-> (P|Q --> R)"
   38.45    by (tactic "IntPr.fast_tac @{context} 1")
   38.46 @@ -58,18 +58,18 @@
   38.47    by (tactic "IntPr.fast_tac @{context} 1")
   38.48  
   38.49  
   38.50 -text {* Propositions-as-types *}
   38.51 +text \<open>Propositions-as-types\<close>
   38.52  
   38.53 --- {* The combinator K *}
   38.54 +-- \<open>The combinator K\<close>
   38.55  lemma "P --> (Q --> P)"
   38.56    by (tactic "IntPr.fast_tac @{context} 1")
   38.57  
   38.58 --- {* The combinator S *}
   38.59 +-- \<open>The combinator S\<close>
   38.60  lemma "(P-->Q-->R)  --> (P-->Q) --> (P-->R)"
   38.61    by (tactic "IntPr.fast_tac @{context} 1")
   38.62  
   38.63  
   38.64 --- {* Converse is classical *}
   38.65 +-- \<open>Converse is classical\<close>
   38.66  lemma "(P-->Q) | (P-->R)  -->  (P --> Q | R)"
   38.67    by (tactic "IntPr.fast_tac @{context} 1")
   38.68  
   38.69 @@ -77,7 +77,7 @@
   38.70    by (tactic "IntPr.fast_tac @{context} 1")
   38.71  
   38.72  
   38.73 -text {* Schwichtenberg's examples (via T. Nipkow) *}
   38.74 +text \<open>Schwichtenberg's examples (via T. Nipkow)\<close>
   38.75  
   38.76  lemma stab_imp: "(((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
   38.77    by (tactic "IntPr.fast_tac @{context} 1")
    39.1 --- a/src/FOL/ex/Quantifiers_Cla.thy	Thu Jul 23 14:20:51 2015 +0200
    39.2 +++ b/src/FOL/ex/Quantifiers_Cla.thy	Thu Jul 23 14:25:05 2015 +0200
    39.3 @@ -3,7 +3,7 @@
    39.4      Copyright   1991  University of Cambridge
    39.5  *)
    39.6  
    39.7 -section {* First-Order Logic: quantifier examples (classical version) *}
    39.8 +section \<open>First-Order Logic: quantifier examples (classical version)\<close>
    39.9  
   39.10  theory Quantifiers_Cla
   39.11  imports FOL
   39.12 @@ -16,7 +16,7 @@
   39.13    by fast
   39.14  
   39.15  
   39.16 --- {* Converse is false *}
   39.17 +-- \<open>Converse is false\<close>
   39.18  lemma "(ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
   39.19    by fast
   39.20  
   39.21 @@ -28,19 +28,19 @@
   39.22    by fast
   39.23  
   39.24  
   39.25 -text {* Some harder ones *}
   39.26 +text \<open>Some harder ones\<close>
   39.27  
   39.28  lemma "(EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
   39.29    by fast
   39.30  
   39.31 --- {* Converse is false *}
   39.32 +-- \<open>Converse is false\<close>
   39.33  lemma "(EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
   39.34    by fast
   39.35  
   39.36  
   39.37 -text {* Basic test of quantifier reasoning *}
   39.38 +text \<open>Basic test of quantifier reasoning\<close>
   39.39  
   39.40 --- {* TRUE *}
   39.41 +-- \<open>TRUE\<close>
   39.42  lemma "(EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
   39.43    by fast
   39.44  
   39.45 @@ -48,7 +48,7 @@
   39.46    by fast
   39.47  
   39.48  
   39.49 -text {* The following should fail, as they are false! *}
   39.50 +text \<open>The following should fail, as they are false!\<close>
   39.51  
   39.52  lemma "(ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
   39.53    apply fast?
   39.54 @@ -67,12 +67,12 @@
   39.55    oops
   39.56  
   39.57  
   39.58 -text {* Back to things that are provable \dots *}
   39.59 +text \<open>Back to things that are provable \dots\<close>
   39.60  
   39.61  lemma "(ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
   39.62    by fast
   39.63  
   39.64 --- {* An example of why exI should be delayed as long as possible *}
   39.65 +-- \<open>An example of why exI should be delayed as long as possible\<close>
   39.66  lemma "(P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
   39.67    by fast
   39.68  
   39.69 @@ -83,9 +83,9 @@
   39.70    by fast
   39.71  
   39.72  
   39.73 -text {* Some slow ones *}
   39.74 +text \<open>Some slow ones\<close>
   39.75  
   39.76 --- {* Principia Mathematica *11.53 *}
   39.77 +-- \<open>Principia Mathematica *11.53\<close>
   39.78  lemma "(ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
   39.79    by fast
   39.80  
    40.1 --- a/src/FOL/ex/Quantifiers_Int.thy	Thu Jul 23 14:20:51 2015 +0200
    40.2 +++ b/src/FOL/ex/Quantifiers_Int.thy	Thu Jul 23 14:25:05 2015 +0200
    40.3 @@ -3,7 +3,7 @@
    40.4      Copyright   1991  University of Cambridge
    40.5  *)
    40.6  
    40.7 -section {* First-Order Logic: quantifier examples (intuitionistic version) *}
    40.8 +section \<open>First-Order Logic: quantifier examples (intuitionistic version)\<close>
    40.9  
   40.10  theory Quantifiers_Int
   40.11  imports IFOL
   40.12 @@ -16,7 +16,7 @@
   40.13    by (tactic "IntPr.fast_tac @{context} 1")
   40.14  
   40.15  
   40.16 --- {* Converse is false *}
   40.17 +-- \<open>Converse is false\<close>
   40.18  lemma "(ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
   40.19    by (tactic "IntPr.fast_tac @{context} 1")
   40.20  
   40.21 @@ -28,19 +28,19 @@
   40.22    by (tactic "IntPr.fast_tac @{context} 1")
   40.23  
   40.24  
   40.25 -text {* Some harder ones *}
   40.26 +text \<open>Some harder ones\<close>
   40.27  
   40.28  lemma "(EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
   40.29    by (tactic "IntPr.fast_tac @{context} 1")
   40.30  
   40.31 --- {* Converse is false *}
   40.32 +-- \<open>Converse is false\<close>
   40.33  lemma "(EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
   40.34    by (tactic "IntPr.fast_tac @{context} 1")
   40.35  
   40.36  
   40.37 -text {* Basic test of quantifier reasoning *}
   40.38 +text \<open>Basic test of quantifier reasoning\<close>
   40.39  
   40.40 --- {* TRUE *}
   40.41 +-- \<open>TRUE\<close>
   40.42  lemma "(EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
   40.43    by (tactic "IntPr.fast_tac @{context} 1")
   40.44  
   40.45 @@ -48,7 +48,7 @@
   40.46    by (tactic "IntPr.fast_tac @{context} 1")
   40.47  
   40.48  
   40.49 -text {* The following should fail, as they are false! *}
   40.50 +text \<open>The following should fail, as they are false!\<close>
   40.51  
   40.52  lemma "(ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
   40.53    apply (tactic "IntPr.fast_tac @{context} 1")?
   40.54 @@ -67,12 +67,12 @@
   40.55    oops
   40.56  
   40.57  
   40.58 -text {* Back to things that are provable \dots *}
   40.59 +text \<open>Back to things that are provable \dots\<close>
   40.60  
   40.61  lemma "(ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
   40.62    by (tactic "IntPr.fast_tac @{context} 1")
   40.63  
   40.64 --- {* An example of why exI should be delayed as long as possible *}
   40.65 +-- \<open>An example of why exI should be delayed as long as possible\<close>
   40.66  lemma "(P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
   40.67    by (tactic "IntPr.fast_tac @{context} 1")
   40.68  
   40.69 @@ -83,9 +83,9 @@
   40.70    by (tactic "IntPr.fast_tac @{context} 1")
   40.71  
   40.72  
   40.73 -text {* Some slow ones *}
   40.74 +text \<open>Some slow ones\<close>
   40.75  
   40.76 --- {* Principia Mathematica *11.53 *}
   40.77 +-- \<open>Principia Mathematica *11.53\<close>
   40.78  lemma "(ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
   40.79    by (tactic "IntPr.fast_tac @{context} 1")
   40.80  
    41.1 --- a/src/FOLP/FOLP.thy	Thu Jul 23 14:20:51 2015 +0200
    41.2 +++ b/src/FOLP/FOLP.thy	Thu Jul 23 14:25:05 2015 +0200
    41.3 @@ -3,7 +3,7 @@
    41.4      Copyright   1992  University of Cambridge
    41.5  *)
    41.6  
    41.7 -section {* Classical First-Order Logic with Proofs *}
    41.8 +section \<open>Classical First-Order Logic with Proofs\<close>
    41.9  
   41.10  theory FOLP
   41.11  imports IFOLP
   41.12 @@ -56,8 +56,8 @@
   41.13      and r2: "!!y. y:Q ==> g(y):R"
   41.14    shows "?p : R"
   41.15    apply (rule excluded_middle [THEN disjE])
   41.16 -   apply (tactic {* DEPTH_SOLVE (assume_tac @{context} 1 ORELSE
   41.17 -       resolve_tac @{context} [@{thm r1}, @{thm r2}, @{thm major} RS @{thm mp}] 1) *})
   41.18 +   apply (tactic \<open>DEPTH_SOLVE (assume_tac @{context} 1 ORELSE
   41.19 +       resolve_tac @{context} [@{thm r1}, @{thm r2}, @{thm major} RS @{thm mp}] 1)\<close>)
   41.20    done
   41.21  
   41.22  (*Double negation law*)
   41.23 @@ -80,10 +80,10 @@
   41.24    apply (insert major)
   41.25    apply (unfold iff_def)
   41.26    apply (rule conjE)
   41.27 -  apply (tactic {* DEPTH_SOLVE_1 (eresolve_tac @{context} @{thms impCE} 1 ORELSE
   41.28 +  apply (tactic \<open>DEPTH_SOLVE_1 (eresolve_tac @{context} @{thms impCE} 1 ORELSE
   41.29        eresolve_tac @{context} [@{thm notE}, @{thm impE}] 1 THEN assume_tac @{context} 1 ORELSE
   41.30        assume_tac @{context} 1 ORELSE
   41.31 -      resolve_tac @{context} [@{thm r1}, @{thm r2}] 1) *})+
   41.32 +      resolve_tac @{context} [@{thm r1}, @{thm r2}] 1)\<close>)+
   41.33    done
   41.34  
   41.35  
   41.36 @@ -101,7 +101,7 @@
   41.37  ML_file "classical.ML"      (* Patched because matching won't instantiate proof *)
   41.38  ML_file "simp.ML"           (* Patched because matching won't instantiate proof *)
   41.39  
   41.40 -ML {*
   41.41 +ML \<open>
   41.42  structure Cla = Classical
   41.43  (
   41.44    val sizef = size_of_thm
   41.45 @@ -128,14 +128,14 @@
   41.46  val FOLP_dup_cs =
   41.47    prop_cs addSIs [@{thm allI}] addIs [@{thm exCI}, @{thm ex1I}]
   41.48      addSEs [@{thm exE}, @{thm ex1E}] addEs [@{thm all_dupE}];
   41.49 -*}
   41.50 +\<close>
   41.51  
   41.52  schematic_lemma cla_rews:
   41.53    "?p1 : P | ~P"
   41.54    "?p2 : ~P | P"
   41.55    "?p3 : ~ ~ P <-> P"
   41.56    "?p4 : (~P --> P) <-> P"
   41.57 -  apply (tactic {* ALLGOALS (Cla.fast_tac @{context} FOLP_cs) *})
   41.58 +  apply (tactic \<open>ALLGOALS (Cla.fast_tac @{context} FOLP_cs)\<close>)
   41.59    done
   41.60  
   41.61  ML_file "simpdata.ML"
    42.1 --- a/src/FOLP/IFOLP.thy	Thu Jul 23 14:20:51 2015 +0200
    42.2 +++ b/src/FOLP/IFOLP.thy	Thu Jul 23 14:25:05 2015 +0200
    42.3 @@ -3,7 +3,7 @@
    42.4      Copyright   1992  University of Cambridge
    42.5  *)
    42.6  
    42.7 -section {* Intuitionistic First-Order Logic with Proofs *}
    42.8 +section \<open>Intuitionistic First-Order Logic with Proofs\<close>
    42.9  
   42.10  theory IFOLP
   42.11  imports Pure
   42.12 @@ -64,21 +64,21 @@
   42.13  
   42.14  syntax "_Proof" :: "[p,o]=>prop"    ("(_ /: _)" [51, 10] 5)
   42.15  
   42.16 -parse_translation {*
   42.17 +parse_translation \<open>
   42.18    let fun proof_tr [p, P] = Const (@{const_syntax Proof}, dummyT) $ P $ p
   42.19    in [(@{syntax_const "_Proof"}, K proof_tr)] end
   42.20 -*}
   42.21 +\<close>
   42.22  
   42.23  (*show_proofs = true displays the proof terms -- they are ENORMOUS*)
   42.24 -ML {* val show_proofs = Attrib.setup_config_bool @{binding show_proofs} (K false) *}
   42.25 +ML \<open>val show_proofs = Attrib.setup_config_bool @{binding show_proofs} (K false)\<close>
   42.26  
   42.27 -print_translation {*
   42.28 +print_translation \<open>
   42.29    let
   42.30      fun proof_tr' ctxt [P, p] =
   42.31        if Config.get ctxt show_proofs then Const (@{syntax_const "_Proof"}, dummyT) $ p $ P
   42.32        else P
   42.33    in [(@{const_syntax Proof}, proof_tr')] end
   42.34 -*}
   42.35 +\<close>
   42.36  
   42.37  
   42.38  (**** Propositional logic ****)
   42.39 @@ -248,7 +248,7 @@
   42.40      Fails unless one assumption is equal and exactly one is unifiable
   42.41  **)
   42.42  
   42.43 -ML {*
   42.44 +ML \<open>
   42.45  local
   42.46    fun discard_proof (Const (@{const_name Proof}, _) $ P $ _) = P;
   42.47  in
   42.48 @@ -265,23 +265,23 @@
   42.49            else no_tac
   42.50        end);
   42.51  end;
   42.52 -*}
   42.53 +\<close>
   42.54  
   42.55  
   42.56  (*** Modus Ponens Tactics ***)
   42.57  
   42.58  (*Finds P-->Q and P in the assumptions, replaces implication by Q *)
   42.59 -ML {*
   42.60 +ML \<open>
   42.61    fun mp_tac ctxt i =
   42.62      eresolve_tac ctxt [@{thm notE}, make_elim @{thm mp}] i  THEN  assume_tac ctxt i
   42.63 -*}
   42.64 +\<close>
   42.65  method_setup mp = \<open>Scan.succeed (SIMPLE_METHOD' o mp_tac)\<close>
   42.66  
   42.67  (*Like mp_tac but instantiates no variables*)
   42.68 -ML {*
   42.69 +ML \<open>
   42.70    fun int_uniq_mp_tac ctxt i =
   42.71      eresolve_tac ctxt [@{thm notE}, @{thm impE}] i  THEN  uniq_assume_tac ctxt i
   42.72 -*}
   42.73 +\<close>
   42.74  
   42.75  
   42.76  (*** If-and-only-if ***)
   42.77 @@ -360,11 +360,11 @@
   42.78  (*** <-> congruence rules for simplification ***)
   42.79  
   42.80  (*Use iffE on a premise.  For conj_cong, imp_cong, all_cong, ex_cong*)
   42.81 -ML {*
   42.82 +ML \<open>
   42.83  fun iff_tac ctxt prems i =
   42.84      resolve_tac ctxt (prems RL [@{thm iffE}]) i THEN
   42.85      REPEAT1 (eresolve_tac ctxt [asm_rl, @{thm mp}] i)
   42.86 -*}
   42.87 +\<close>
   42.88  
   42.89  method_setup iff =
   42.90    \<open>Attrib.thms >> (fn prems => fn ctxt => SIMPLE_METHOD' (iff_tac ctxt prems))\<close>
   42.91 @@ -503,20 +503,20 @@
   42.92  
   42.93  schematic_lemma pred1_cong: "p:a=a' ==> ?p:P(a) <-> P(a')"
   42.94    apply (rule iffI)
   42.95 -   apply (tactic {*
   42.96 -     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1) *})
   42.97 +   apply (tactic \<open>
   42.98 +     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1)\<close>)
   42.99    done
  42.100  
  42.101  schematic_lemma pred2_cong: "[| p:a=a';  q:b=b' |] ==> ?p:P(a,b) <-> P(a',b')"
  42.102    apply (rule iffI)
  42.103 -   apply (tactic {*
  42.104 -     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1) *})
  42.105 +   apply (tactic \<open>
  42.106 +     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1)\<close>)
  42.107    done
  42.108  
  42.109  schematic_lemma pred3_cong: "[| p:a=a';  q:b=b';  r:c=c' |] ==> ?p:P(a,b,c) <-> P(a',b',c')"
  42.110    apply (rule iffI)
  42.111 -   apply (tactic {*
  42.112 -     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1) *})
  42.113 +   apply (tactic \<open>
  42.114 +     DEPTH_SOLVE (assume_tac @{context} 1 ORELSE eresolve_tac @{context} [@{thm subst}, @{thm ssubst}] 1)\<close>)
  42.115    done
  42.116  
  42.117  lemmas pred_congs = pred1_cong pred2_cong pred3_cong
  42.118 @@ -543,9 +543,9 @@
  42.119    assumes major: "p:(P|Q)-->S"
  42.120      and minor: "!!x y.[| x:P-->S; y:Q-->S |] ==> q(x,y):R"
  42.121    shows "?p:R"
  42.122 -  apply (tactic {* DEPTH_SOLVE (assume_tac @{context} 1 ORELSE
  42.123 +  apply (tactic \<open>DEPTH_SOLVE (assume_tac @{context} 1 ORELSE
  42.124        resolve_tac @{context} [@{thm disjI1}, @{thm disjI2}, @{thm impI},
  42.125 -        @{thm major} RS @{thm mp}, @{thm minor}] 1) *})
  42.126 +        @{thm major} RS @{thm mp}, @{thm minor}] 1)\<close>)
  42.127    done
  42.128  
  42.129  (*Simplifies the implication.  Classical version is stronger.
  42.130 @@ -607,7 +607,7 @@
  42.131  
  42.132  ML_file "hypsubst.ML"
  42.133  
  42.134 -ML {*
  42.135 +ML \<open>
  42.136  structure Hypsubst = Hypsubst
  42.137  (
  42.138    (*Take apart an equality judgement; otherwise raise Match!*)
  42.139 @@ -625,7 +625,7 @@
  42.140    val thin_refl = @{thm thin_refl}
  42.141  );
  42.142  open Hypsubst;
  42.143 -*}
  42.144 +\<close>
  42.145  
  42.146  ML_file "intprover.ML"
  42.147  
  42.148 @@ -641,7 +641,7 @@
  42.149    "?p6 : P & ~P <-> False"
  42.150    "?p7 : ~P & P <-> False"
  42.151    "?p8 : (P & Q) & R <-> P & (Q & R)"
  42.152 -  apply (tactic {* fn st => IntPr.fast_tac @{context} 1 st *})+
  42.153 +  apply (tactic \<open>fn st => IntPr.fast_tac @{context} 1 st\<close>)+
  42.154    done
  42.155  
  42.156  schematic_lemma disj_rews:
  42.157 @@ -651,13 +651,13 @@
  42.158    "?p4 : False | P <-> P"
  42.159    "?p5 : P | P <-> P"
  42.160    "?p6 : (P | Q) | R <-> P | (Q | R)"
  42.161 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.162 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.163    done
  42.164  
  42.165  schematic_lemma not_rews:
  42.166    "?p1 : ~ False <-> True"
  42.167    "?p2 : ~ True <-> False"
  42.168 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.169 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.170    done
  42.171  
  42.172  schematic_lemma imp_rews:
  42.173 @@ -667,7 +667,7 @@
  42.174    "?p4 : (True --> P) <-> P"
  42.175    "?p5 : (P --> P) <-> True"
  42.176    "?p6 : (P --> ~P) <-> ~P"
  42.177 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.178 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.179    done
  42.180  
  42.181  schematic_lemma iff_rews:
  42.182 @@ -676,13 +676,13 @@
  42.183    "?p3 : (P <-> P) <-> True"
  42.184    "?p4 : (False <-> P) <-> ~P"
  42.185    "?p5 : (P <-> False) <-> ~P"
  42.186 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.187 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.188    done
  42.189  
  42.190  schematic_lemma quant_rews:
  42.191    "?p1 : (ALL x. P) <-> P"
  42.192    "?p2 : (EX x. P) <-> P"
  42.193 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.194 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.195    done
  42.196  
  42.197  (*These are NOT supplied by default!*)
  42.198 @@ -691,7 +691,7 @@
  42.199    "?p2 : P & (Q | R) <-> P&Q | P&R"
  42.200    "?p3 : (Q | R) & P <-> Q&P | R&P"
  42.201    "?p4 : (P | Q --> R) <-> (P --> R) & (Q --> R)"
  42.202 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.203 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.204    done
  42.205  
  42.206  schematic_lemma distrib_rews2:
  42.207 @@ -699,17 +699,17 @@
  42.208    "?p2 : ((EX x. NORM(P(x))) --> Q) <-> (ALL x. NORM(P(x)) --> Q)"
  42.209    "?p3 : (EX x. NORM(P(x))) & NORM(Q) <-> (EX x. NORM(P(x)) & NORM(Q))"
  42.210    "?p4 : NORM(Q) & (EX x. NORM(P(x))) <-> (EX x. NORM(Q) & NORM(P(x)))"
  42.211 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})+
  42.212 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)+
  42.213    done
  42.214  
  42.215  lemmas distrib_rews = distrib_rews1 distrib_rews2
  42.216  
  42.217  schematic_lemma P_Imp_P_iff_T: "p:P ==> ?p:(P <-> True)"
  42.218 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})
  42.219 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  42.220    done
  42.221  
  42.222  schematic_lemma not_P_imp_P_iff_F: "p:~P ==> ?p:(P <-> False)"
  42.223 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})
  42.224 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  42.225    done
  42.226  
  42.227  end
    43.1 --- a/src/FOLP/ex/Classical.thy	Thu Jul 23 14:20:51 2015 +0200
    43.2 +++ b/src/FOLP/ex/Classical.thy	Thu Jul 23 14:25:05 2015 +0200
    43.3 @@ -288,7 +288,7 @@
    43.4  text "Problem 58  NOT PROVED AUTOMATICALLY"
    43.5  schematic_lemma "?p : (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))"
    43.6    supply f_cong = subst_context [where t = f]
    43.7 -  by (tactic {* fast_tac @{context} (FOLP_cs addSIs [@{thm f_cong}]) 1 *})
    43.8 +  by (tactic \<open>fast_tac @{context} (FOLP_cs addSIs [@{thm f_cong}]) 1\<close>)
    43.9  
   43.10  text "Problem 59"
   43.11  schematic_lemma "?p : (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))"
    44.1 --- a/src/FOLP/ex/Foundation.thy	Thu Jul 23 14:20:51 2015 +0200
    44.2 +++ b/src/FOLP/ex/Foundation.thy	Thu Jul 23 14:25:05 2015 +0200
    44.3 @@ -18,7 +18,7 @@
    44.4  apply assumption
    44.5  done
    44.6  
    44.7 -text {*A form of conj-elimination*}
    44.8 +text \<open>A form of conj-elimination\<close>
    44.9  schematic_lemma
   44.10    assumes "p : A & B"
   44.11      and "!!x y. x : A ==> y : B ==> f(x, y) : C"
   44.12 @@ -99,7 +99,7 @@
   44.13  apply (rule refl)?
   44.14  oops
   44.15  
   44.16 -text {* Parallel lifting example. *}
   44.17 +text \<open>Parallel lifting example.\<close>
   44.18  schematic_lemma "?p : EX u. ALL x. EX v. ALL y. EX w. P(u,x,v,y,w)"
   44.19  apply (rule exI allI)
   44.20  apply (rule exI allI)
   44.21 @@ -121,7 +121,7 @@
   44.22  apply assumption
   44.23  done
   44.24  
   44.25 -text {* A bigger demonstration of quantifiers -- not in the paper. *}
   44.26 +text \<open>A bigger demonstration of quantifiers -- not in the paper.\<close>
   44.27  schematic_lemma "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
   44.28  apply (rule impI)
   44.29  apply (rule allI)
    45.1 --- a/src/FOLP/ex/If.thy	Thu Jul 23 14:20:51 2015 +0200
    45.2 +++ b/src/FOLP/ex/If.thy	Thu Jul 23 14:25:05 2015 +0200
    45.3 @@ -9,7 +9,7 @@
    45.4    assumes "!!x. x : P ==> f(x) : Q"  "!!x. x : ~P ==> g(x) : R"
    45.5    shows "?p : if(P,Q,R)"
    45.6  apply (unfold if_def)
    45.7 -apply (tactic {* fast_tac @{context} (FOLP_cs addIs @{thms assms}) 1 *})
    45.8 +apply (tactic \<open>fast_tac @{context} (FOLP_cs addIs @{thms assms}) 1\<close>)
    45.9  done
   45.10  
   45.11  schematic_lemma ifE:
   45.12 @@ -19,7 +19,7 @@
   45.13    shows "?p : S"
   45.14  apply (insert 1)
   45.15  apply (unfold if_def)
   45.16 -apply (tactic {* fast_tac @{context} (FOLP_cs addIs [@{thm 2}, @{thm 3}]) 1 *})
   45.17 +apply (tactic \<open>fast_tac @{context} (FOLP_cs addIs [@{thm 2}, @{thm 3}]) 1\<close>)
   45.18  done
   45.19  
   45.20  schematic_lemma if_commute: "?p : if(P, if(Q,A,B), if(Q,C,D)) <-> if(Q, if(P,A,C), if(P,B,D))"
   45.21 @@ -30,14 +30,14 @@
   45.22  apply (rule ifI)
   45.23  oops
   45.24  
   45.25 -ML {* val if_cs = FOLP_cs addSIs [@{thm ifI}] addSEs [@{thm ifE}] *}
   45.26 +ML \<open>val if_cs = FOLP_cs addSIs [@{thm ifI}] addSEs [@{thm ifE}]\<close>
   45.27  
   45.28  schematic_lemma if_commute: "?p : if(P, if(Q,A,B), if(Q,C,D)) <-> if(Q, if(P,A,C), if(P,B,D))"
   45.29 -apply (tactic {* fast_tac @{context} if_cs 1 *})
   45.30 +apply (tactic \<open>fast_tac @{context} if_cs 1\<close>)
   45.31  done
   45.32  
   45.33  schematic_lemma nested_ifs: "?p : if(if(P,Q,R), A, B) <-> if(P, if(Q,A,B), if(R,A,B))"
   45.34 -apply (tactic {* fast_tac @{context} if_cs 1 *})
   45.35 +apply (tactic \<open>fast_tac @{context} if_cs 1\<close>)
   45.36  done
   45.37  
   45.38  end
    46.1 --- a/src/FOLP/ex/Intro.thy	Thu Jul 23 14:20:51 2015 +0200
    46.2 +++ b/src/FOLP/ex/Intro.thy	Thu Jul 23 14:25:05 2015 +0200
    46.3 @@ -5,13 +5,13 @@
    46.4  Derives some inference rules, illustrating the use of definitions.
    46.5  *)
    46.6  
    46.7 -section {* Examples for the manual ``Introduction to Isabelle'' *}
    46.8 +section \<open>Examples for the manual ``Introduction to Isabelle''\<close>
    46.9  
   46.10  theory Intro
   46.11  imports FOLP
   46.12  begin
   46.13  
   46.14 -subsubsection {* Some simple backward proofs *}
   46.15 +subsubsection \<open>Some simple backward proofs\<close>
   46.16  
   46.17  schematic_lemma mythm: "?p : P|P --> P"
   46.18  apply (rule impI)
   46.19 @@ -41,21 +41,21 @@
   46.20  done
   46.21  
   46.22  
   46.23 -subsubsection {* Demonstration of @{text "fast"} *}
   46.24 +subsubsection \<open>Demonstration of @{text "fast"}\<close>
   46.25  
   46.26  schematic_lemma "?p : (EX y. ALL x. J(y,x) <-> ~J(x,x))
   46.27          -->  ~ (ALL x. EX y. ALL z. J(z,y) <-> ~ J(z,x))"
   46.28 -apply (tactic {* fast_tac @{context} FOLP_cs 1 *})
   46.29 +apply (tactic \<open>fast_tac @{context} FOLP_cs 1\<close>)
   46.30  done
   46.31  
   46.32  
   46.33  schematic_lemma "?p : ALL x. P(x,f(x)) <->
   46.34          (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"
   46.35 -apply (tactic {* fast_tac @{context} FOLP_cs 1 *})
   46.36 +apply (tactic \<open>fast_tac @{context} FOLP_cs 1\<close>)
   46.37  done
   46.38  
   46.39  
   46.40 -subsubsection {* Derivation of conjunction elimination rule *}
   46.41 +subsubsection \<open>Derivation of conjunction elimination rule\<close>
   46.42  
   46.43  schematic_lemma
   46.44    assumes major: "p : P&Q"
   46.45 @@ -67,9 +67,9 @@
   46.46  done
   46.47  
   46.48  
   46.49 -subsection {* Derived rules involving definitions *}
   46.50 +subsection \<open>Derived rules involving definitions\<close>
   46.51  
   46.52 -text {* Derivation of negation introduction *}
   46.53 +text \<open>Derivation of negation introduction\<close>
   46.54  
   46.55  schematic_lemma
   46.56    assumes "!!x. x : P ==> f(x) : False"
   46.57 @@ -90,7 +90,7 @@
   46.58  apply (rule minor)
   46.59  done
   46.60  
   46.61 -text {* Alternative proof of the result above *}
   46.62 +text \<open>Alternative proof of the result above\<close>
   46.63  schematic_lemma
   46.64    assumes major: "p : ~P"
   46.65      and minor: "q : P"
    47.1 --- a/src/FOLP/ex/Intuitionistic.thy	Thu Jul 23 14:20:51 2015 +0200
    47.2 +++ b/src/FOLP/ex/Intuitionistic.thy	Thu Jul 23 14:25:05 2015 +0200
    47.3 @@ -31,167 +31,167 @@
    47.4  begin
    47.5  
    47.6  schematic_lemma "?p : ~~(P&Q) <-> ~~P & ~~Q"
    47.7 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
    47.8 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
    47.9  
   47.10  schematic_lemma "?p : ~~~P <-> ~P"
   47.11 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.12 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.13  
   47.14  schematic_lemma "?p : ~~((P --> Q | R)  -->  (P-->Q) | (P-->R))"
   47.15 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.16 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.17  
   47.18  schematic_lemma "?p : (P<->Q) <-> (Q<->P)"
   47.19 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.20 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.21  
   47.22  
   47.23 -subsection {* Lemmas for the propositional double-negation translation *}
   47.24 +subsection \<open>Lemmas for the propositional double-negation translation\<close>
   47.25  
   47.26  schematic_lemma "?p : P --> ~~P"
   47.27 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.28 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.29  
   47.30  schematic_lemma "?p : ~~(~~P --> P)"
   47.31 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.32 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.33  
   47.34  schematic_lemma "?p : ~~P & ~~(P --> Q) --> ~~Q"
   47.35 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.36 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.37  
   47.38  
   47.39 -subsection {* The following are classically but not constructively valid *}
   47.40 +subsection \<open>The following are classically but not constructively valid\<close>
   47.41  
   47.42  (*The attempt to prove them terminates quickly!*)
   47.43  schematic_lemma "?p : ((P-->Q) --> P)  -->  P"
   47.44 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
   47.45 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
   47.46    oops
   47.47  
   47.48  schematic_lemma "?p : (P&Q-->R)  -->  (P-->R) | (Q-->R)"
   47.49 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
   47.50 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
   47.51    oops
   47.52  
   47.53  
   47.54 -subsection {* Intuitionistic FOL: propositional problems based on Pelletier *}
   47.55 +subsection \<open>Intuitionistic FOL: propositional problems based on Pelletier\<close>
   47.56  
   47.57  text "Problem ~~1"
   47.58  schematic_lemma "?p : ~~((P-->Q)  <->  (~Q --> ~P))"
   47.59 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.60 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.61  
   47.62  text "Problem ~~2"
   47.63  schematic_lemma "?p : ~~(~~P  <->  P)"
   47.64 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.65 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.66  
   47.67  text "Problem 3"
   47.68  schematic_lemma "?p : ~(P-->Q) --> (Q-->P)"
   47.69 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.70 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.71  
   47.72  text "Problem ~~4"
   47.73  schematic_lemma "?p : ~~((~P-->Q)  <->  (~Q --> P))"
   47.74 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.75 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.76  
   47.77  text "Problem ~~5"
   47.78  schematic_lemma "?p : ~~((P|Q-->P|R) --> P|(Q-->R))"
   47.79 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.80 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.81  
   47.82  text "Problem ~~6"
   47.83  schematic_lemma "?p : ~~(P | ~P)"
   47.84 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.85 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.86  
   47.87  text "Problem ~~7"
   47.88  schematic_lemma "?p : ~~(P | ~~~P)"
   47.89 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.90 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.91  
   47.92  text "Problem ~~8.  Peirce's law"
   47.93  schematic_lemma "?p : ~~(((P-->Q) --> P)  -->  P)"
   47.94 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   47.95 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   47.96  
   47.97  text "Problem 9"
   47.98  schematic_lemma "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
   47.99 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.100 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.101  
  47.102  text "Problem 10"
  47.103  schematic_lemma "?p : (Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)"
  47.104 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.105 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.106  
  47.107  text "11.  Proved in each direction (incorrectly, says Pelletier!!) "
  47.108  schematic_lemma "?p : P<->P"
  47.109 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.110 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.111  
  47.112  text "Problem ~~12.  Dijkstra's law  "
  47.113  schematic_lemma "?p : ~~(((P <-> Q) <-> R)  <->  (P <-> (Q <-> R)))"
  47.114 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.115 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.116  
  47.117  schematic_lemma "?p : ((P <-> Q) <-> R)  -->  ~~(P <-> (Q <-> R))"
  47.118 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.119 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.120  
  47.121  text "Problem 13.  Distributive law"
  47.122  schematic_lemma "?p : P | (Q & R)  <-> (P | Q) & (P | R)"
  47.123 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.124 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.125  
  47.126  text "Problem ~~14"
  47.127  schematic_lemma "?p : ~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))"
  47.128 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.129 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.130  
  47.131  text "Problem ~~15"
  47.132  schematic_lemma "?p : ~~((P --> Q) <-> (~P | Q))"
  47.133 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.134 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.135  
  47.136  text "Problem ~~16"
  47.137  schematic_lemma "?p : ~~((P-->Q) | (Q-->P))"
  47.138 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.139 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.140  
  47.141  text "Problem ~~17"
  47.142  schematic_lemma "?p : ~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))"
  47.143 -  by (tactic {* IntPr.fast_tac @{context} 1 *})  -- slow
  47.144 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)  -- slow
  47.145  
  47.146  
  47.147 -subsection {* Examples with quantifiers *}
  47.148 +subsection \<open>Examples with quantifiers\<close>
  47.149  
  47.150  text "The converse is classical in the following implications..."
  47.151  
  47.152  schematic_lemma "?p : (EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q"
  47.153 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.154 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.155  
  47.156  schematic_lemma "?p : ((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"
  47.157 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.158 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.159  
  47.160  schematic_lemma "?p : ((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))"
  47.161 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.162 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.163  
  47.164  schematic_lemma "?p : (ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)"
  47.165 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.166 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.167  
  47.168  schematic_lemma "?p : (EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"
  47.169 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.170 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.171  
  47.172  
  47.173  text "The following are not constructively valid!"
  47.174  text "The attempt to prove them terminates quickly!"
  47.175  
  47.176  schematic_lemma "?p : ((ALL x. P(x))-->Q) --> (EX x. P(x)-->Q)"
  47.177 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
  47.178 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
  47.179    oops
  47.180  
  47.181  schematic_lemma "?p : (P --> (EX x. Q(x))) --> (EX x. P-->Q(x))"
  47.182 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
  47.183 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
  47.184    oops
  47.185  
  47.186  schematic_lemma "?p : (ALL x. P(x) | Q) --> ((ALL x. P(x)) | Q)"
  47.187 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
  47.188 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
  47.189    oops
  47.190  
  47.191  schematic_lemma "?p : (ALL x. ~~P(x)) --> ~~(ALL x. P(x))"
  47.192 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
  47.193 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
  47.194    oops
  47.195  
  47.196  (*Classically but not intuitionistically valid.  Proved by a bug in 1986!*)
  47.197  schematic_lemma "?p : EX x. Q(x) --> (ALL x. Q(x))"
  47.198 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
  47.199 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
  47.200    oops
  47.201  
  47.202  
  47.203  subsection "Hard examples with quantifiers"
  47.204  
  47.205 -text {*
  47.206 +text \<open>
  47.207    The ones that have not been proved are not known to be valid!
  47.208    Some will require quantifier duplication -- not currently available.
  47.209 -*}
  47.210 +\<close>
  47.211  
  47.212  text "Problem ~~18"
  47.213  schematic_lemma "?p : ~~(EX y. ALL x. P(y)-->P(x))" oops
  47.214 @@ -204,7 +204,7 @@
  47.215  text "Problem 20"
  47.216  schematic_lemma "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))      
  47.217      --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"
  47.218 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.219 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.220  
  47.221  text "Problem 21"
  47.222  schematic_lemma "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P<->Q(x))" oops
  47.223 @@ -212,11 +212,11 @@
  47.224  
  47.225  text "Problem 22"
  47.226  schematic_lemma "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))"
  47.227 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.228 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.229  
  47.230  text "Problem ~~23"
  47.231  schematic_lemma "?p : ~~ ((ALL x. P | Q(x))  <->  (P | (ALL x. Q(x))))"
  47.232 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  47.233 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  47.234  
  47.235  text "Problem 24"
  47.236  schematic_lemma "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &   
  47.237 @@ -287,7 +287,7 @@
  47.238  schematic_lemma
  47.239      "?p : (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->   
  47.240       (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)"
  47.241 -  by (tactic "IntPr.best_tac @{context} 1") -- {*60 seconds*}
  47.242 +  by (tactic "IntPr.best_tac @{context} 1") -- \<open>60 seconds\<close>
  47.243  
  47.244  text "Problem 56"
  47.245  schematic_lemma "?p : (ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"
    48.1 --- a/src/FOLP/ex/Nat.thy	Thu Jul 23 14:20:51 2015 +0200
    48.2 +++ b/src/FOLP/ex/Nat.thy	Thu Jul 23 14:25:05 2015 +0200
    48.3 @@ -3,7 +3,7 @@
    48.4      Copyright   1992  University of Cambridge
    48.5  *)
    48.6  
    48.7 -section {* Theory of the natural numbers: Peano's axioms, primitive recursion *}
    48.8 +section \<open>Theory of the natural numbers: Peano's axioms, primitive recursion\<close>
    48.9  
   48.10  theory Nat
   48.11  imports FOLP
   48.12 @@ -38,7 +38,7 @@
   48.13    where "m + n == rec(m, n, %x y. Suc(y))"
   48.14  
   48.15  
   48.16 -subsection {* Proofs about the natural numbers *}
   48.17 +subsection \<open>Proofs about the natural numbers\<close>
   48.18  
   48.19  schematic_lemma Suc_n_not_n: "?p : ~ (Suc(k) = k)"
   48.20  apply (rule_tac n = k in induct)
   48.21 @@ -81,27 +81,27 @@
   48.22  
   48.23  lemmas nat_congs = Suc_cong Plus_cong
   48.24  
   48.25 -ML {*
   48.26 +ML \<open>
   48.27    val add_ss =
   48.28      FOLP_ss addcongs @{thms nat_congs}
   48.29      |> fold (addrew @{context}) @{thms add_0 add_Suc}
   48.30 -*}
   48.31 +\<close>
   48.32  
   48.33  schematic_lemma add_assoc: "?p : (k+m)+n = k+(m+n)"
   48.34  apply (rule_tac n = k in induct)
   48.35 -apply (tactic {* SIMP_TAC @{context} add_ss 1 *})
   48.36 -apply (tactic {* ASM_SIMP_TAC @{context} add_ss 1 *})
   48.37 +apply (tactic \<open>SIMP_TAC @{context} add_ss 1\<close>)
   48.38 +apply (tactic \<open>ASM_SIMP_TAC @{context} add_ss 1\<close>)
   48.39  done
   48.40  
   48.41  schematic_lemma add_0_right: "?p : m+0 = m"
   48.42  apply (rule_tac n = m in induct)
   48.43 -apply (tactic {* SIMP_TAC @{context} add_ss 1 *})
   48.44 -apply (tactic {* ASM_SIMP_TAC @{context} add_ss 1 *})
   48.45 +apply (tactic \<open>SIMP_TAC @{context} add_ss 1\<close>)
   48.46 +apply (tactic \<open>ASM_SIMP_TAC @{context} add_ss 1\<close>)
   48.47  done
   48.48  
   48.49  schematic_lemma add_Suc_right: "?p : m+Suc(n) = Suc(m+n)"
   48.50  apply (rule_tac n = m in induct)
   48.51 -apply (tactic {* ALLGOALS (ASM_SIMP_TAC @{context} add_ss) *})
   48.52 +apply (tactic \<open>ALLGOALS (ASM_SIMP_TAC @{context} add_ss)\<close>)
   48.53  done
   48.54  
   48.55  (*mk_typed_congs appears not to work with FOLP's version of subst*)
    49.1 --- a/src/FOLP/ex/Propositional_Cla.thy	Thu Jul 23 14:20:51 2015 +0200
    49.2 +++ b/src/FOLP/ex/Propositional_Cla.thy	Thu Jul 23 14:25:05 2015 +0200
    49.3 @@ -3,7 +3,7 @@
    49.4      Copyright   1991  University of Cambridge
    49.5  *)
    49.6  
    49.7 -section {* First-Order Logic: propositional examples *}
    49.8 +section \<open>First-Order Logic: propositional examples\<close>
    49.9  
   49.10  theory Propositional_Cla
   49.11  imports FOLP
   49.12 @@ -12,106 +12,106 @@
   49.13  
   49.14  text "commutative laws of & and | "
   49.15  schematic_lemma "?p : P & Q  -->  Q & P"
   49.16 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.17 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.18  
   49.19  schematic_lemma "?p : P | Q  -->  Q | P"
   49.20 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.21 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.22  
   49.23  
   49.24  text "associative laws of & and | "
   49.25  schematic_lemma "?p : (P & Q) & R  -->  P & (Q & R)"
   49.26 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.27 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.28  
   49.29  schematic_lemma "?p : (P | Q) | R  -->  P | (Q | R)"
   49.30 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.31 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.32  
   49.33  
   49.34  text "distributive laws of & and | "
   49.35  schematic_lemma "?p : (P & Q) | R  --> (P | R) & (Q | R)"
   49.36 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.37 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.38  
   49.39  schematic_lemma "?p : (P | R) & (Q | R)  --> (P & Q) | R"
   49.40 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.41 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.42  
   49.43  schematic_lemma "?p : (P | Q) & R  --> (P & R) | (Q & R)"
   49.44 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.45 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.46  
   49.47  
   49.48  schematic_lemma "?p : (P & R) | (Q & R)  --> (P | Q) & R"
   49.49 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.50 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.51  
   49.52  
   49.53  text "Laws involving implication"
   49.54  
   49.55  schematic_lemma "?p : (P-->R) & (Q-->R) <-> (P|Q --> R)"
   49.56 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.57 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.58  
   49.59  schematic_lemma "?p : (P & Q --> R) <-> (P--> (Q-->R))"
   49.60 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.61 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.62  
   49.63  schematic_lemma "?p : ((P-->R)-->R) --> ((Q-->R)-->R) --> (P&Q-->R) --> R"
   49.64 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.65 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.66  
   49.67  schematic_lemma "?p : ~(P-->R) --> ~(Q-->R) --> ~(P&Q-->R)"
   49.68 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.69 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.70  
   49.71  schematic_lemma "?p : (P --> Q & R) <-> (P-->Q)  &  (P-->R)"
   49.72 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.73 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.74  
   49.75  
   49.76  text "Propositions-as-types"
   49.77  
   49.78  (*The combinator K*)
   49.79  schematic_lemma "?p : P --> (Q --> P)"
   49.80 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.81 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.82  
   49.83  (*The combinator S*)
   49.84  schematic_lemma "?p : (P-->Q-->R)  --> (P-->Q) --> (P-->R)"
   49.85 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.86 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.87  
   49.88  
   49.89  (*Converse is classical*)
   49.90  schematic_lemma "?p : (P-->Q) | (P-->R)  -->  (P --> Q | R)"
   49.91 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.92 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.93  
   49.94  schematic_lemma "?p : (P-->Q)  -->  (~Q --> ~P)"
   49.95 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   49.96 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   49.97  
   49.98  
   49.99  text "Schwichtenberg's examples (via T. Nipkow)"
  49.100  
  49.101  schematic_lemma stab_imp: "?p : (((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
  49.102 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.103 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.104  
  49.105  schematic_lemma stab_to_peirce: "?p : (((P --> R) --> R) --> P) --> (((Q --> R) --> R) --> Q)  
  49.106                --> ((P --> Q) --> P) --> P"
  49.107 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.108 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.109  
  49.110  schematic_lemma peirce_imp1: "?p : (((Q --> R) --> Q) --> Q)  
  49.111                 --> (((P --> Q) --> R) --> P --> Q) --> P --> Q"
  49.112 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.113 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.114    
  49.115  schematic_lemma peirce_imp2: "?p : (((P --> R) --> P) --> P) --> ((P --> Q --> R) --> P) --> P"
  49.116 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.117 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.118  
  49.119  schematic_lemma mints: "?p : ((((P --> Q) --> P) --> P) --> Q) --> Q"
  49.120 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.121 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.122  
  49.123  schematic_lemma mints_solovev: "?p : (P --> (Q --> R) --> Q) --> ((P --> Q) --> R) --> R"
  49.124 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.125 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.126  
  49.127  schematic_lemma tatsuta: "?p : (((P7 --> P1) --> P10) --> P4 --> P5)  
  49.128            --> (((P8 --> P2) --> P9) --> P3 --> P10)  
  49.129            --> (P1 --> P8) --> P6 --> P7  
  49.130            --> (((P3 --> P2) --> P9) --> P4)  
  49.131            --> (P1 --> P3) --> (((P6 --> P1) --> P2) --> P9) --> P5"
  49.132 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.133 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.134  
  49.135  schematic_lemma tatsuta1: "?p : (((P8 --> P2) --> P9) --> P3 --> P10)  
  49.136       --> (((P3 --> P2) --> P9) --> P4)  
  49.137       --> (((P6 --> P1) --> P2) --> P9)  
  49.138       --> (((P7 --> P1) --> P10) --> P4 --> P5)  
  49.139       --> (P1 --> P3) --> (P1 --> P8) --> P6 --> P7 --> P5"
  49.140 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  49.141 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  49.142  
  49.143  end
    50.1 --- a/src/FOLP/ex/Propositional_Int.thy	Thu Jul 23 14:20:51 2015 +0200
    50.2 +++ b/src/FOLP/ex/Propositional_Int.thy	Thu Jul 23 14:25:05 2015 +0200
    50.3 @@ -3,7 +3,7 @@
    50.4      Copyright   1991  University of Cambridge
    50.5  *)
    50.6  
    50.7 -section {* First-Order Logic: propositional examples *}
    50.8 +section \<open>First-Order Logic: propositional examples\<close>
    50.9  
   50.10  theory Propositional_Int
   50.11  imports IFOLP
   50.12 @@ -12,106 +12,106 @@
   50.13  
   50.14  text "commutative laws of & and | "
   50.15  schematic_lemma "?p : P & Q  -->  Q & P"
   50.16 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.17 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.18  
   50.19  schematic_lemma "?p : P | Q  -->  Q | P"
   50.20 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.21 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.22  
   50.23  
   50.24  text "associative laws of & and | "
   50.25  schematic_lemma "?p : (P & Q) & R  -->  P & (Q & R)"
   50.26 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.27 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.28  
   50.29  schematic_lemma "?p : (P | Q) | R  -->  P | (Q | R)"
   50.30 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.31 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.32  
   50.33  
   50.34  text "distributive laws of & and | "
   50.35  schematic_lemma "?p : (P & Q) | R  --> (P | R) & (Q | R)"
   50.36 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.37 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.38  
   50.39  schematic_lemma "?p : (P | R) & (Q | R)  --> (P & Q) | R"
   50.40 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.41 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.42  
   50.43  schematic_lemma "?p : (P | Q) & R  --> (P & R) | (Q & R)"
   50.44 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.45 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.46  
   50.47  
   50.48  schematic_lemma "?p : (P & R) | (Q & R)  --> (P | Q) & R"
   50.49 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.50 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.51  
   50.52  
   50.53  text "Laws involving implication"
   50.54  
   50.55  schematic_lemma "?p : (P-->R) & (Q-->R) <-> (P|Q --> R)"
   50.56 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.57 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.58  
   50.59  schematic_lemma "?p : (P & Q --> R) <-> (P--> (Q-->R))"
   50.60 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.61 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.62  
   50.63  schematic_lemma "?p : ((P-->R)-->R) --> ((Q-->R)-->R) --> (P&Q-->R) --> R"
   50.64 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.65 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.66  
   50.67  schematic_lemma "?p : ~(P-->R) --> ~(Q-->R) --> ~(P&Q-->R)"
   50.68 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.69 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.70  
   50.71  schematic_lemma "?p : (P --> Q & R) <-> (P-->Q)  &  (P-->R)"
   50.72 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.73 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.74  
   50.75  
   50.76  text "Propositions-as-types"
   50.77  
   50.78  (*The combinator K*)
   50.79  schematic_lemma "?p : P --> (Q --> P)"
   50.80 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.81 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.82  
   50.83  (*The combinator S*)
   50.84  schematic_lemma "?p : (P-->Q-->R)  --> (P-->Q) --> (P-->R)"
   50.85 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.86 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.87  
   50.88  
   50.89  (*Converse is classical*)
   50.90  schematic_lemma "?p : (P-->Q) | (P-->R)  -->  (P --> Q | R)"
   50.91 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.92 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.93  
   50.94  schematic_lemma "?p : (P-->Q)  -->  (~Q --> ~P)"
   50.95 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   50.96 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   50.97  
   50.98  
   50.99  text "Schwichtenberg's examples (via T. Nipkow)"
  50.100  
  50.101  schematic_lemma stab_imp: "?p : (((Q-->R)-->R)-->Q) --> (((P-->Q)-->R)-->R)-->P-->Q"
  50.102 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.103 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.104  
  50.105  schematic_lemma stab_to_peirce: "?p : (((P --> R) --> R) --> P) --> (((Q --> R) --> R) --> Q)  
  50.106                --> ((P --> Q) --> P) --> P"
  50.107 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.108 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.109  
  50.110  schematic_lemma peirce_imp1: "?p : (((Q --> R) --> Q) --> Q)  
  50.111                 --> (((P --> Q) --> R) --> P --> Q) --> P --> Q"
  50.112 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.113 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.114    
  50.115  schematic_lemma peirce_imp2: "?p : (((P --> R) --> P) --> P) --> ((P --> Q --> R) --> P) --> P"
  50.116 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.117 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.118  
  50.119  schematic_lemma mints: "?p : ((((P --> Q) --> P) --> P) --> Q) --> Q"
  50.120 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.121 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.122  
  50.123  schematic_lemma mints_solovev: "?p : (P --> (Q --> R) --> Q) --> ((P --> Q) --> R) --> R"
  50.124 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.125 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.126  
  50.127  schematic_lemma tatsuta: "?p : (((P7 --> P1) --> P10) --> P4 --> P5)  
  50.128            --> (((P8 --> P2) --> P9) --> P3 --> P10)  
  50.129            --> (P1 --> P8) --> P6 --> P7  
  50.130            --> (((P3 --> P2) --> P9) --> P4)  
  50.131            --> (P1 --> P3) --> (((P6 --> P1) --> P2) --> P9) --> P5"
  50.132 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.133 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.134  
  50.135  schematic_lemma tatsuta1: "?p : (((P8 --> P2) --> P9) --> P3 --> P10)  
  50.136       --> (((P3 --> P2) --> P9) --> P4)  
  50.137       --> (((P6 --> P1) --> P2) --> P9)  
  50.138       --> (((P7 --> P1) --> P10) --> P4 --> P5)  
  50.139       --> (P1 --> P3) --> (P1 --> P8) --> P6 --> P7 --> P5"
  50.140 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  50.141 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  50.142  
  50.143  end
    51.1 --- a/src/FOLP/ex/Quantifiers_Cla.thy	Thu Jul 23 14:20:51 2015 +0200
    51.2 +++ b/src/FOLP/ex/Quantifiers_Cla.thy	Thu Jul 23 14:25:05 2015 +0200
    51.3 @@ -11,91 +11,91 @@
    51.4  begin
    51.5  
    51.6  schematic_lemma "?p : (ALL x y. P(x,y))  -->  (ALL y x. P(x,y))"
    51.7 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
    51.8 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
    51.9  
   51.10  schematic_lemma "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"
   51.11 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.12 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.13  
   51.14  
   51.15  (*Converse is false*)
   51.16  schematic_lemma "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
   51.17 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.18 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.19  
   51.20  schematic_lemma "?p : (ALL x. P-->Q(x))  <->  (P--> (ALL x. Q(x)))"
   51.21 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.22 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.23  
   51.24  
   51.25  schematic_lemma "?p : (ALL x. P(x)-->Q)  <->  ((EX x. P(x)) --> Q)"
   51.26 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.27 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.28  
   51.29  
   51.30  text "Some harder ones"
   51.31  
   51.32  schematic_lemma "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
   51.33 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.34 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.35  
   51.36  (*Converse is false*)
   51.37  schematic_lemma "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
   51.38 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.39 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.40  
   51.41  
   51.42  text "Basic test of quantifier reasoning"
   51.43  (*TRUE*)
   51.44  schematic_lemma "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
   51.45 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.46 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.47  
   51.48  schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
   51.49 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.50 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.51  
   51.52  
   51.53  text "The following should fail, as they are false!"
   51.54  
   51.55  schematic_lemma "?p : (ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
   51.56 -  apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
   51.57 +  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
   51.58    oops
   51.59  
   51.60  schematic_lemma "?p : (EX x. Q(x))  -->  (ALL x. Q(x))"
   51.61 -  apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
   51.62 +  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
   51.63    oops
   51.64  
   51.65  schematic_lemma "?p : P(?a) --> (ALL x. P(x))"
   51.66 -  apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
   51.67 +  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
   51.68    oops
   51.69  
   51.70  schematic_lemma "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
   51.71 -  apply (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})?
   51.72 +  apply (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)?
   51.73    oops
   51.74  
   51.75  
   51.76  text "Back to things that are provable..."
   51.77  
   51.78  schematic_lemma "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
   51.79 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.80 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.81  
   51.82  
   51.83  (*An example of why exI should be delayed as long as possible*)
   51.84  schematic_lemma "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
   51.85 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.86 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.87  
   51.88  schematic_lemma "?p : (ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"
   51.89 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.90 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.91  
   51.92  schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
   51.93 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
   51.94 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
   51.95  
   51.96  
   51.97  text "Some slow ones"
   51.98  
   51.99  (*Principia Mathematica *11.53  *)
  51.100  schematic_lemma "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
  51.101 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  51.102 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  51.103  
  51.104  (*Principia Mathematica *11.55  *)
  51.105  schematic_lemma "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
  51.106 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  51.107 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  51.108  
  51.109  (*Principia Mathematica *11.61  *)
  51.110  schematic_lemma "?p : (EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"
  51.111 -  by (tactic {* Cla.fast_tac @{context} FOLP_cs 1 *})
  51.112 +  by (tactic \<open>Cla.fast_tac @{context} FOLP_cs 1\<close>)
  51.113  
  51.114  end
    52.1 --- a/src/FOLP/ex/Quantifiers_Int.thy	Thu Jul 23 14:20:51 2015 +0200
    52.2 +++ b/src/FOLP/ex/Quantifiers_Int.thy	Thu Jul 23 14:25:05 2015 +0200
    52.3 @@ -11,91 +11,91 @@
    52.4  begin
    52.5  
    52.6  schematic_lemma "?p : (ALL x y. P(x,y))  -->  (ALL y x. P(x,y))"
    52.7 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
    52.8 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
    52.9  
   52.10  schematic_lemma "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"
   52.11 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.12 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.13  
   52.14  
   52.15  (*Converse is false*)
   52.16  schematic_lemma "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"
   52.17 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.18 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.19  
   52.20  schematic_lemma "?p : (ALL x. P-->Q(x))  <->  (P--> (ALL x. Q(x)))"
   52.21 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.22 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.23  
   52.24  
   52.25  schematic_lemma "?p : (ALL x. P(x)-->Q)  <->  ((EX x. P(x)) --> Q)"
   52.26 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.27 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.28  
   52.29  
   52.30  text "Some harder ones"
   52.31  
   52.32  schematic_lemma "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"
   52.33 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.34 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.35  
   52.36  (*Converse is false*)
   52.37  schematic_lemma "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x))  &  (EX x. Q(x))"
   52.38 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.39 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.40  
   52.41  
   52.42  text "Basic test of quantifier reasoning"
   52.43  (*TRUE*)
   52.44  schematic_lemma "?p : (EX y. ALL x. Q(x,y)) -->  (ALL x. EX y. Q(x,y))"
   52.45 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.46 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.47  
   52.48  schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
   52.49 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.50 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.51  
   52.52  
   52.53  text "The following should fail, as they are false!"
   52.54  
   52.55  schematic_lemma "?p : (ALL x. EX y. Q(x,y))  -->  (EX y. ALL x. Q(x,y))"
   52.56 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
   52.57 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
   52.58    oops
   52.59  
   52.60  schematic_lemma "?p : (EX x. Q(x))  -->  (ALL x. Q(x))"
   52.61 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
   52.62 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
   52.63    oops
   52.64  
   52.65  schematic_lemma "?p : P(?a) --> (ALL x. P(x))"
   52.66 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
   52.67 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
   52.68    oops
   52.69  
   52.70  schematic_lemma "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"
   52.71 -  apply (tactic {* IntPr.fast_tac @{context} 1 *})?
   52.72 +  apply (tactic \<open>IntPr.fast_tac @{context} 1\<close>)?
   52.73    oops
   52.74  
   52.75  
   52.76  text "Back to things that are provable..."
   52.77  
   52.78  schematic_lemma "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"
   52.79 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.80 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.81  
   52.82  
   52.83  (*An example of why exI should be delayed as long as possible*)
   52.84  schematic_lemma "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"
   52.85 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.86 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.87  
   52.88  schematic_lemma "?p : (ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"
   52.89 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.90 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.91  
   52.92  schematic_lemma "?p : (ALL x. Q(x))  -->  (EX x. Q(x))"
   52.93 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
   52.94 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
   52.95  
   52.96  
   52.97  text "Some slow ones"
   52.98  
   52.99  (*Principia Mathematica *11.53  *)
  52.100  schematic_lemma "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"
  52.101 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  52.102 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  52.103  
  52.104  (*Principia Mathematica *11.55  *)
  52.105  schematic_lemma "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"
  52.106 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  52.107 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  52.108  
  52.109  (*Principia Mathematica *11.61  *)
  52.110  schematic_lemma "?p : (EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"
  52.111 -  by (tactic {* IntPr.fast_tac @{context} 1 *})
  52.112 +  by (tactic \<open>IntPr.fast_tac @{context} 1\<close>)
  52.113  
  52.114  end
    53.1 --- a/src/LCF/LCF.thy	Thu Jul 23 14:20:51 2015 +0200
    53.2 +++ b/src/LCF/LCF.thy	Thu Jul 23 14:25:05 2015 +0200
    53.3 @@ -3,15 +3,15 @@
    53.4      Copyright   1992  University of Cambridge
    53.5  *)
    53.6  
    53.7 -section {* LCF on top of First-Order Logic *}
    53.8 +section \<open>LCF on top of First-Order Logic\<close>
    53.9  
   53.10  theory LCF
   53.11  imports "~~/src/FOL/FOL"
   53.12  begin
   53.13  
   53.14 -text {* This theory is based on Lawrence Paulson's book Logic and Computation. *}
   53.15 +text \<open>This theory is based on Lawrence Paulson's book Logic and Computation.\<close>
   53.16  
   53.17 -subsection {* Natural Deduction Rules for LCF *}
   53.18 +subsection \<open>Natural Deduction Rules for LCF\<close>
   53.19  
   53.20  class cpo = "term"
   53.21  default_sort cpo
   53.22 @@ -245,7 +245,7 @@
   53.23    surj_pairing FST SND
   53.24  
   53.25  
   53.26 -subsection {* Ordered pairs and products *}
   53.27 +subsection \<open>Ordered pairs and products\<close>
   53.28  
   53.29  lemma expand_all_PROD: "(\<forall>p. P(p)) \<longleftrightarrow> (\<forall>x y. P(<x,y>))"
   53.30    apply (rule iffI)
   53.31 @@ -293,7 +293,7 @@
   53.32    done
   53.33  
   53.34  
   53.35 -subsection {* Fixedpoint theory *}
   53.36 +subsection \<open>Fixedpoint theory\<close>
   53.37  
   53.38  lemma adm_eq: "adm(\<lambda>x. t(x)=(u(x)::'a::cpo))"
   53.39    apply (unfold eq_def)
   53.40 @@ -318,12 +318,12 @@
   53.41    adm_not_free adm_eq adm_less adm_not_less
   53.42    adm_not_eq_tr adm_conj adm_disj adm_imp adm_all
   53.43  
   53.44 -method_setup induct = {*
   53.45 +method_setup induct = \<open>
   53.46    Scan.lift Args.name_inner_syntax >> (fn v => fn ctxt =>
   53.47      SIMPLE_METHOD' (fn i =>
   53.48        Rule_Insts.res_inst_tac ctxt [((("f", 0), Position.none), v)] [] @{thm induct} i THEN
   53.49        REPEAT (resolve_tac ctxt @{thms adm_lemmas} i)))
   53.50 -*}
   53.51 +\<close>
   53.52  
   53.53  lemma least_FIX: "f(p) = p \<Longrightarrow> FIX(f) << p"
   53.54    apply (induct f)
   53.55 @@ -378,11 +378,11 @@
   53.56    apply (rule 3)
   53.57    done
   53.58  
   53.59 -ML {*
   53.60 +ML \<open>
   53.61  fun induct2_tac ctxt (f, g) i =
   53.62    Rule_Insts.res_inst_tac ctxt
   53.63      [((("f", 0), Position.none), f), ((("g", 0), Position.none), g)] [] @{thm induct2} i THEN
   53.64    REPEAT(resolve_tac ctxt @{thms adm_lemmas} i)
   53.65 -*}
   53.66 +\<close>
   53.67  
   53.68  end
    54.1 --- a/src/LCF/ex/Ex1.thy	Thu Jul 23 14:20:51 2015 +0200
    54.2 +++ b/src/LCF/ex/Ex1.thy	Thu Jul 23 14:25:05 2015 +0200
    54.3 @@ -1,4 +1,4 @@
    54.4 -section {*  Section 10.4 *}
    54.5 +section \<open>Section 10.4\<close>
    54.6  
    54.7  theory Ex1
    54.8  imports "../LCF"
    55.1 --- a/src/LCF/ex/Ex2.thy	Thu Jul 23 14:20:51 2015 +0200
    55.2 +++ b/src/LCF/ex/Ex2.thy	Thu Jul 23 14:25:05 2015 +0200
    55.3 @@ -1,4 +1,4 @@
    55.4 -section {* Example 3.8 *}
    55.5 +section \<open>Example 3.8\<close>
    55.6  
    55.7  theory Ex2
    55.8  imports "../LCF"
    56.1 --- a/src/LCF/ex/Ex3.thy	Thu Jul 23 14:20:51 2015 +0200
    56.2 +++ b/src/LCF/ex/Ex3.thy	Thu Jul 23 14:25:05 2015 +0200
    56.3 @@ -1,4 +1,4 @@
    56.4 -section {* Addition with fixpoint of successor *}
    56.5 +section \<open>Addition with fixpoint of successor\<close>
    56.6  
    56.7  theory Ex3
    56.8  imports "../LCF"
    57.1 --- a/src/LCF/ex/Ex4.thy	Thu Jul 23 14:20:51 2015 +0200
    57.2 +++ b/src/LCF/ex/Ex4.thy	Thu Jul 23 14:25:05 2015 +0200
    57.3 @@ -1,5 +1,5 @@
    57.4  
    57.5 -section {* Prefixpoints *}
    57.6 +section \<open>Prefixpoints\<close>
    57.7  
    57.8  theory Ex4
    57.9  imports "../LCF"
    58.1 --- a/src/Sequents/ILL.thy	Thu Jul 23 14:20:51 2015 +0200
    58.2 +++ b/src/Sequents/ILL.thy	Thu Jul 23 14:25:05 2015 +0200
    58.3 @@ -35,17 +35,17 @@
    58.4    "_Context"  :: "two_seqe"   ("((_)/ :=: (_))" [6,6] 5)
    58.5    "_PromAux"  :: "three_seqe" ("promaux {_||_||_}")
    58.6  
    58.7 -parse_translation {*
    58.8 +parse_translation \<open>
    58.9    [(@{syntax_const "_Trueprop"}, K (single_tr @{const_syntax Trueprop})),
   58.10     (@{syntax_const "_Context"}, K (two_seq_tr @{const_syntax Context})),
   58.11     (@{syntax_const "_PromAux"}, K (three_seq_tr @{const_syntax PromAux}))]
   58.12 -*}
   58.13 +\<close>
   58.14  
   58.15 -print_translation {*
   58.16 +print_translation \<open>
   58.17    [(@{const_syntax Trueprop}, K (single_tr' @{syntax_const "_Trueprop"})),
   58.18     (@{const_syntax Context}, K (two_seq_tr' @{syntax_const "_Context"})),
   58.19     (@{const_syntax PromAux}, K (three_seq_tr' @{syntax_const "_PromAux"}))]
   58.20 -*}
   58.21 +\<close>
   58.22  
   58.23  defs
   58.24  
   58.25 @@ -271,7 +271,7 @@
   58.26    apply best
   58.27    done
   58.28  
   58.29 -ML {*
   58.30 +ML \<open>
   58.31    val safe_pack =
   58.32      @{context}
   58.33      |> fold_rev Cla.add_safe @{thms conj_lemma ll_mp contrad1
   58.34 @@ -283,13 +283,13 @@
   58.35      Cla.put_pack safe_pack @{context}
   58.36      |> Cla.add_unsafe @{thm impr_contr_der}
   58.37      |> Cla.get_pack;
   58.38 -*}
   58.39 +\<close>
   58.40  
   58.41  method_setup best_safe =
   58.42 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.best_tac (Cla.put_pack safe_pack ctxt))) *}
   58.43 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.best_tac (Cla.put_pack safe_pack ctxt)))\<close>
   58.44  
   58.45  method_setup best_power =
   58.46 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.best_tac (Cla.put_pack power_pack ctxt))) *}
   58.47 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.best_tac (Cla.put_pack power_pack ctxt)))\<close>
   58.48  
   58.49  
   58.50  (* Some examples from Troelstra and van Dalen *)
    59.1 --- a/src/Sequents/LK.thy	Thu Jul 23 14:20:51 2015 +0200
    59.2 +++ b/src/Sequents/LK.thy	Thu Jul 23 14:25:05 2015 +0200
    59.3 @@ -23,7 +23,7 @@
    59.4                 ==> (P, $H |- $F) == (P', $H' |- $F')"
    59.5  
    59.6  
    59.7 -subsection {* Rewrite rules *}
    59.8 +subsection \<open>Rewrite rules\<close>
    59.9  
   59.10  lemma conj_simps:
   59.11    "|- P & True <-> P"
   59.12 @@ -79,15 +79,15 @@
   59.13    by (fast add!: subst)+
   59.14  
   59.15  
   59.16 -subsection {* Miniscoping: pushing quantifiers in *}
   59.17 +subsection \<open>Miniscoping: pushing quantifiers in\<close>
   59.18  
   59.19 -text {*
   59.20 +text \<open>
   59.21    We do NOT distribute of ALL over &, or dually that of EX over |
   59.22    Baaz and Leitsch, On Skolemization and Proof Complexity (1994)
   59.23    show that this step can increase proof length!
   59.24 -*}
   59.25 +\<close>
   59.26  
   59.27 -text {*existential miniscoping*}
   59.28 +text \<open>existential miniscoping\<close>
   59.29  lemma ex_simps:
   59.30    "!!P Q. |- (EX x. P(x) & Q) <-> (EX x. P(x)) & Q"
   59.31    "!!P Q. |- (EX x. P & Q(x)) <-> P & (EX x. Q(x))"
   59.32 @@ -97,7 +97,7 @@
   59.33    "!!P Q. |- (EX x. P --> Q(x)) <-> P --> (EX x. Q(x))"
   59.34    by (fast add!: subst)+
   59.35  
   59.36 -text {*universal miniscoping*}
   59.37 +text \<open>universal miniscoping\<close>
   59.38  lemma all_simps:
   59.39    "!!P Q. |- (ALL x. P(x) & Q) <-> (ALL x. P(x)) & Q"
   59.40    "!!P Q. |- (ALL x. P & Q(x)) <-> P & (ALL x. Q(x))"
   59.41 @@ -107,7 +107,7 @@
   59.42    "!!P Q. |- (ALL x. P | Q(x)) <-> P | (ALL x. Q(x))"
   59.43    by (fast add!: subst)+
   59.44  
   59.45 -text {*These are NOT supplied by default!*}
   59.46 +text \<open>These are NOT supplied by default!\<close>
   59.47  lemma distrib_simps:
   59.48    "|- P & (Q | R) <-> P&Q | P&R"
   59.49    "|- (Q | R) & P <-> Q&P | R&P"
   59.50 @@ -138,7 +138,7 @@
   59.51    by (fast add!: subst)+
   59.52  
   59.53  
   59.54 -subsection {* Named rewrite rules *}
   59.55 +subsection \<open>Named rewrite rules\<close>
   59.56  
   59.57  lemma conj_commute: "|- P&Q <-> Q&P"
   59.58    and conj_left_commute: "|- P&(Q&R) <-> Q&(P&R)"
   59.59 @@ -177,11 +177,11 @@
   59.60    shows "|- (P-->Q) <-> (P'-->Q')"
   59.61    apply (lem p1)
   59.62    apply safe
   59.63 -   apply (tactic {*
   59.64 +   apply (tactic \<open>
   59.65       REPEAT (resolve_tac @{context} @{thms cut} 1 THEN
   59.66         DEPTH_SOLVE_1
   59.67           (resolve_tac @{context} [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN
   59.68 -           Cla.safe_tac @{context} 1) *})
   59.69 +           Cla.safe_tac @{context} 1)\<close>)
   59.70    done
   59.71  
   59.72  lemma conj_cong:
   59.73 @@ -190,22 +190,22 @@
   59.74    shows "|- (P&Q) <-> (P'&Q')"
   59.75    apply (lem p1)
   59.76    apply safe
   59.77 -   apply (tactic {*
   59.78 +   apply (tactic \<open>
   59.79       REPEAT (resolve_tac @{context} @{thms cut} 1 THEN
   59.80         DEPTH_SOLVE_1
   59.81           (resolve_tac @{context} [@{thm thinL}, @{thm thinR}, @{thm p2} COMP @{thm monotonic}] 1) THEN
   59.82 -           Cla.safe_tac @{context} 1) *})
   59.83 +           Cla.safe_tac @{context} 1)\<close>)
   59.84    done
   59.85  
   59.86  lemma eq_sym_conv: "|- (x=y) <-> (y=x)"
   59.87    by (fast add!: subst)
   59.88  
   59.89  ML_file "simpdata.ML"
   59.90 -setup {* map_theory_simpset (put_simpset LK_ss) *}
   59.91 -setup {* Simplifier.method_setup [] *}
   59.92 +setup \<open>map_theory_simpset (put_simpset LK_ss)\<close>
   59.93 +setup \<open>Simplifier.method_setup []\<close>
   59.94  
   59.95  
   59.96 -text {* To create substition rules *}
   59.97 +text \<open>To create substition rules\<close>
   59.98  
   59.99  lemma eq_imp_subst: "|- a=b ==> $H, A(a), $G |- $E, A(b), $F"
  59.100    by simp
    60.1 --- a/src/Sequents/LK/Nat.thy	Thu Jul 23 14:20:51 2015 +0200
    60.2 +++ b/src/Sequents/LK/Nat.thy	Thu Jul 23 14:25:05 2015 +0200
    60.3 @@ -3,7 +3,7 @@
    60.4      Copyright   1999  University of Cambridge
    60.5  *)
    60.6  
    60.7 -section {* Theory of the natural numbers: Peano's axioms, primitive recursion *}
    60.8 +section \<open>Theory of the natural numbers: Peano's axioms, primitive recursion\<close>
    60.9  
   60.10  theory Nat
   60.11  imports "../LK"
    61.1 --- a/src/Sequents/LK/Propositional.thy	Thu Jul 23 14:20:51 2015 +0200
    61.2 +++ b/src/Sequents/LK/Propositional.thy	Thu Jul 23 14:25:05 2015 +0200
    61.3 @@ -3,7 +3,7 @@
    61.4      Copyright   1992  University of Cambridge
    61.5  *)
    61.6  
    61.7 -section {* Classical sequent calculus: examples with propositional connectives *}
    61.8 +section \<open>Classical sequent calculus: examples with propositional connectives\<close>
    61.9  
   61.10  theory Propositional
   61.11  imports "../LK"
    62.1 --- a/src/Sequents/LK0.thy	Thu Jul 23 14:20:51 2015 +0200
    62.2 +++ b/src/Sequents/LK0.thy	Thu Jul 23 14:25:05 2015 +0200
    62.3 @@ -6,7 +6,7 @@
    62.4  (eta-expanded, beta-contracted).
    62.5  *)
    62.6  
    62.7 -section {* Classical First-Order Sequent Calculus *}
    62.8 +section \<open>Classical First-Order Sequent Calculus\<close>
    62.9  
   62.10  theory LK0
   62.11  imports Sequents
   62.12 @@ -34,8 +34,8 @@
   62.13  syntax
   62.14   "_Trueprop"    :: "two_seqe" ("((_)/ |- (_))" [6,6] 5)
   62.15  
   62.16 -parse_translation {* [(@{syntax_const "_Trueprop"}, K (two_seq_tr @{const_syntax Trueprop}))] *}
   62.17 -print_translation {* [(@{const_syntax Trueprop}, K (two_seq_tr' @{syntax_const "_Trueprop"}))] *}
   62.18 +parse_translation \<open>[(@{syntax_const "_Trueprop"}, K (two_seq_tr @{const_syntax Trueprop}))]\<close>
   62.19 +print_translation \<open>[(@{const_syntax Trueprop}, K (two_seq_tr' @{syntax_const "_Trueprop"}))]\<close>
   62.20  
   62.21  abbreviation
   62.22    not_equal  (infixl "~=" 50) where
   62.23 @@ -150,7 +150,7 @@
   62.24  lemma exchL: "$H, Q, P, $G |- $E ==> $H, P, Q, $G |- $E"
   62.25    by (rule exchLS)
   62.26  
   62.27 -ML {*
   62.28 +ML \<open>
   62.29  (*Cut and thin, replacing the right-side formula*)
   62.30  fun cutR_tac ctxt s i =
   62.31    Rule_Insts.res_inst_tac ctxt [((("P", 0), Position.none), s)] [] @{thm cut} i THEN
   62.32 @@ -160,7 +160,7 @@
   62.33  fun cutL_tac ctxt s i =
   62.34    Rule_Insts.res_inst_tac ctxt [((("P", 0), Position.none), s)] [] @{thm cut} i THEN
   62.35    resolve_tac ctxt @{thms thinL} (i + 1)
   62.36 -*}
   62.37 +\<close>
   62.38  
   62.39  
   62.40  (** If-and-only-if rules **)
   62.41 @@ -220,36 +220,36 @@
   62.42    conjR conjL
   62.43    FalseL TrueR
   62.44    refl basic
   62.45 -ML {* val prop_pack = Cla.get_pack @{context} *}
   62.46 +ML \<open>val prop_pack = Cla.get_pack @{context}\<close>
   62.47  
   62.48  lemmas [safe] = exL allR
   62.49  lemmas [unsafe] = the_equality exR_thin allL_thin
   62.50 -ML {* val LK_pack = Cla.get_pack @{context} *}
   62.51 +ML \<open>val LK_pack = Cla.get_pack @{context}\<close>
   62.52  
   62.53 -ML {*
   62.54 +ML \<open>
   62.55    val LK_dup_pack =
   62.56      Cla.put_pack prop_pack @{context}
   62.57      |> fold_rev Cla.add_safe @{thms allR exL}
   62.58      |> fold_rev Cla.add_unsafe @{thms allL exR the_equality}
   62.59      |> Cla.get_pack;
   62.60 -*}
   62.61 +\<close>
   62.62  
   62.63  method_setup fast_prop =
   62.64 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.fast_tac (Cla.put_pack prop_pack ctxt))) *}
   62.65 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.fast_tac (Cla.put_pack prop_pack ctxt)))\<close>
   62.66  
   62.67  method_setup fast_dup =
   62.68 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.fast_tac (Cla.put_pack LK_dup_pack ctxt))) *}
   62.69 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.fast_tac (Cla.put_pack LK_dup_pack ctxt)))\<close>
   62.70  
   62.71  method_setup best_dup =
   62.72 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.best_tac (Cla.put_pack LK_dup_pack ctxt))) *}
   62.73 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD' (Cla.best_tac (Cla.put_pack LK_dup_pack ctxt)))\<close>
   62.74  
   62.75 -method_setup lem = {*
   62.76 +method_setup lem = \<open>
   62.77    Attrib.thm >> (fn th => fn ctxt =>
   62.78      SIMPLE_METHOD' (fn i =>
   62.79        resolve_tac ctxt [@{thm thinR} RS @{thm cut}] i THEN
   62.80        REPEAT (resolve_tac ctxt @{thms thinL} i) THEN
   62.81        resolve_tac ctxt [th] i))
   62.82 -*}
   62.83 +\<close>
   62.84  
   62.85  
   62.86  lemma mp_R:
    63.1 --- a/src/Sequents/Modal0.thy	Thu Jul 23 14:20:51 2015 +0200
    63.2 +++ b/src/Sequents/Modal0.thy	Thu Jul 23 14:25:05 2015 +0200
    63.3 @@ -21,20 +21,20 @@
    63.4    "_Lstar"      :: "two_seqe"   ("(_)|L>(_)" [6,6] 5)
    63.5    "_Rstar"      :: "two_seqe"   ("(_)|R>(_)" [6,6] 5)
    63.6  
    63.7 -ML {*
    63.8 +ML \<open>
    63.9    fun star_tr c [s1, s2] = Const(c, dummyT) $ seq_tr s1 $ seq_tr s2;
   63.10    fun star_tr' c [s1, s2] = Const(c, dummyT) $ seq_tr' s1 $ seq_tr' s2;
   63.11 -*}
   63.12 +\<close>
   63.13  
   63.14 -parse_translation {*
   63.15 +parse_translation \<open>
   63.16   [(@{syntax_const "_Lstar"}, K (star_tr @{const_syntax Lstar})),
   63.17    (@{syntax_const "_Rstar"}, K (star_tr @{const_syntax Rstar}))]
   63.18 -*}
   63.19 +\<close>
   63.20  
   63.21 -print_translation {*
   63.22 +print_translation \<open>
   63.23   [(@{const_syntax Lstar}, K (star_tr' @{syntax_const "_Lstar"})),
   63.24    (@{const_syntax Rstar}, K (star_tr' @{syntax_const "_Rstar"}))]
   63.25 -*}
   63.26 +\<close>
   63.27  
   63.28  defs
   63.29    strimp_def:    "P --< Q == [](P --> Q)"
    64.1 --- a/src/Sequents/S4.thy	Thu Jul 23 14:20:51 2015 +0200
    64.2 +++ b/src/Sequents/S4.thy	Thu Jul 23 14:25:05 2015 +0200
    64.3 @@ -31,7 +31,7 @@
    64.4     "[| $E |L> $E';  $F |L> $F';  $G |R> $G';
    64.5             $E', P, $F' |-         $G'|] ==> $E, <>P, $F |- $G"
    64.6  
    64.7 -ML {*
    64.8 +ML \<open>
    64.9  structure S4_Prover = Modal_ProverFun
   64.10  (
   64.11    val rewrite_rls = @{thms rewrite_rls}
   64.12 @@ -41,10 +41,10 @@
   64.13    val aside_rls = [@{thm lstar0}, @{thm lstar1}, @{thm lstar2}, @{thm rstar0},
   64.14      @{thm rstar1}, @{thm rstar2}]
   64.15  )
   64.16 -*}
   64.17 +\<close>
   64.18  
   64.19  method_setup S4_solve =
   64.20 -  {* Scan.succeed (fn ctxt => SIMPLE_METHOD (S4_Prover.solve_tac ctxt 2)) *}
   64.21 +  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD (S4_Prover.solve_tac ctxt 2))\<close>
   64.22  
   64.23  
   64.24  (* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
    65.1 --- a/src/Sequents/S43.thy	Thu Jul 23 14:20:51 2015 +0200
    65.2 +++ b/src/Sequents/S43.thy	Thu Jul 23 14:25:05 2015 +0200
    65.3 @@ -16,21 +16,21 @@
    65.4    "_S43pi" :: "[seq, seq, seq, seq, seq, seq] => prop"
    65.5                           ("S43pi((_);(_);(_);(_);(_);(_))" [] 5)
    65.6  
    65.7 -parse_translation {*
    65.8 +parse_translation \<open>
    65.9    let
   65.10      val tr  = seq_tr;
   65.11      fun s43pi_tr [s1, s2, s3, s4, s5, s6] =
   65.12        Const (@{const_syntax S43pi}, dummyT) $ tr s1 $ tr s2 $ tr s3 $ tr s4 $ tr s5 $ tr s6;
   65.13    in [(@{syntax_const "_S43pi"}, K s43pi_tr)] end
   65.14 -*}
   65.15 +\<close>
   65.16  
   65.17 -print_translation {*
   65.18 +print_translation \<open>
   65.19  let
   65.20    val tr' = seq_tr';
   65.21    fun s43pi_tr' [s1, s2, s3, s4, s5, s6] =
   65.22      Const(@{syntax_const "_S43pi"}, dummyT) $ tr' s1 $ tr' s2 $ tr' s3 $ tr' s4 $ tr' s5 $ tr' s6;
   65.23  in [(@{const_syntax S43pi}, K s43pi_tr')] end
   65.24 -*}
   65.25 +\<close>
   65.26  
   65.27  axiomatization where
   65.28  (* Definition of the star operation using a set of Horn clauses  *)
   65.29 @@ -76,7 +76,7 @@
   65.30     $L |- $R1, []P, $R2"
   65.31  
   65.32  
   65.33 -ML {*
   65.34 +ML \<open>
   65.35  structure S43_Prover = Modal_ProverFun
   65.36  (
   65.37    val rewrite_rls = @{thms rewrite_rls}
   65.38 @@ -86,13 +86,13 @@
   65.39    val aside_rls = [@{thm lstar0}, @{thm lstar1}, @{thm lstar2}, @{thm rstar0},
   65.40      @{thm rstar1}, @{thm rstar2}, @{thm S43pi0}, @{thm S43pi1}, @{thm S43pi2}]
   65.41  )
   65.42 -*}
   65.43 +\<close>
   65.44  
   65.45  
   65.46 -method_setup S43_solve = {*
   65.47 +method_setup S43_solve = \<open>
   65.48    Scan.succeed (fn ctxt => SIMPLE_METHOD
   65.49      (S43_Prover.solve_tac ctxt 2 ORELSE S43_Prover.solve_tac ctxt 3))
   65.50 -*}
   65.51 +\<close>
   65.52  
   65.53  
   65.54  (* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
    66.1 --- a/src/Sequents/Sequents.thy	Thu Jul 23 14:20:51 2015 +0200
    66.2 +++ b/src/Sequents/Sequents.thy	Thu Jul 23 14:25:05 2015 +0200
    66.3 @@ -3,7 +3,7 @@
    66.4      Copyright   1993  University of Cambridge
    66.5  *)
    66.6  
    66.7 -section {* Parsing and pretty-printing of sequences *}
    66.8 +section \<open>Parsing and pretty-printing of sequences\<close>
    66.9  
   66.10  theory Sequents
   66.11  imports Pure
   66.12 @@ -17,7 +17,7 @@
   66.13  typedecl o
   66.14  
   66.15  
   66.16 -subsection {* Sequences *}
   66.17 +subsection \<open>Sequences\<close>
   66.18  
   66.19  typedecl
   66.20   seq'
   66.21 @@ -27,7 +27,7 @@
   66.22   Seq1'         :: "o=>seq'"
   66.23  
   66.24  
   66.25 -subsection {* Concrete syntax *}
   66.26 +subsection \<open>Concrete syntax\<close>
   66.27  
   66.28  nonterminal seq and seqobj and seqcont
   66.29  
   66.30 @@ -56,7 +56,7 @@
   66.31    (*Constant to allow definitions of SEQUENCES of formulas*)
   66.32    "_Side"        :: "seq=>(seq'=>seq')"     ("<<(_)>>")
   66.33  
   66.34 -ML {*
   66.35 +ML \<open>
   66.36  
   66.37  (* parse translation for sequences *)
   66.38  
   66.39 @@ -139,12 +139,12 @@
   66.40  (** for the <<...>> notation **)
   66.41  
   66.42  fun side_tr [s1] = seq_tr s1;
   66.43 -*}
   66.44 +\<close>
   66.45  
   66.46 -parse_translation {* [(@{syntax_const "_Side"}, K side_tr)] *}
   66.47 +parse_translation \<open>[(@{syntax_const "_Side"}, K side_tr)]\<close>
   66.48  
   66.49  
   66.50 -subsection {* Proof tools *}
   66.51 +subsection \<open>Proof tools\<close>
   66.52  
   66.53  ML_file "prover.ML"
   66.54  
    67.1 --- a/src/Sequents/T.thy	Thu Jul 23 14:20:51 2015 +0200
    67.2 +++ b/src/Sequents/T.thy	Thu Jul 23 14:25:05 2015 +0200
    67.3 @@ -30,7 +30,7 @@
    67.4     "[| $E |L> $E';  $F |L> $F';  $G |R> $G';
    67.5                 $E', P, $F'|-         $G'|] ==> $E, <>P, $F |-          $G"
    67.6  
    67.7 -ML {*
    67.8 +ML \<open>
    67.9  structure T_Prover = Modal_ProverFun
   67.10  (
   67.11    val rewrite_rls = @{thms rewrite_rls}
   67.12 @@ -40,9 +40,9 @@
   67.13    val aside_rls = [@{thm lstar0}, @{thm lstar1}, @{thm lstar2}, @{thm rstar0},
   67.14      @{thm rstar1}, @{thm rstar2}]
   67.15  )
   67.16 -*}
   67.17 +\<close>
   67.18  
   67.19 -method_setup T_solve = {* Scan.succeed (fn ctxt => SIMPLE_METHOD (T_Prover.solve_tac ctxt 2)) *}
   67.20 +method_setup T_solve = \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD (T_Prover.solve_tac ctxt 2))\<close>
   67.21  
   67.22  
   67.23  (* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
    68.1 --- a/src/Sequents/Washing.thy	Thu Jul 23 14:20:51 2015 +0200
    68.2 +++ b/src/Sequents/Washing.thy	Thu Jul 23 14:25:05 2015 +0200
    68.3 @@ -32,10 +32,10 @@
    68.4  
    68.5  (* "activate" definitions for use in proof *)
    68.6  
    68.7 -ML {* ML_Thms.bind_thms ("changeI", [@{thm context1}] RL ([@{thm change}] RLN (2,[@{thm cut}]))) *}
    68.8 -ML {* ML_Thms.bind_thms ("load1I", [@{thm context1}] RL ([@{thm load1}] RLN (2,[@{thm cut}]))) *}
    68.9 -ML {* ML_Thms.bind_thms ("washI", [@{thm context1}] RL ([@{thm wash}] RLN (2,[@{thm cut}]))) *}
   68.10 -ML {* ML_Thms.bind_thms ("dryI", [@{thm context1}] RL ([@{thm dry}] RLN (2,[@{thm cut}]))) *}
   68.11 +ML \<open>ML_Thms.bind_thms ("changeI", [@{thm context1}] RL ([@{thm change}] RLN (2,[@{thm cut}])))\<close>
   68.12 +ML \<open>ML_Thms.bind_thms ("load1I", [@{thm context1}] RL ([@{thm load1}] RLN (2,[@{thm cut}])))\<close>
   68.13 +ML \<open>ML_Thms.bind_thms ("washI", [@{thm context1}] RL ([@{thm wash}] RLN (2,[@{thm cut}])))\<close>
   68.14 +ML \<open>ML_Thms.bind_thms ("dryI", [@{thm context1}] RL ([@{thm dry}] RLN (2,[@{thm cut}])))\<close>
   68.15  
   68.16  (* a load of dirty clothes and two dollars gives you clean clothes *)
   68.17  
    69.1 --- a/src/ZF/AC.thy	Thu Jul 23 14:20:51 2015 +0200
    69.2 +++ b/src/ZF/AC.thy	Thu Jul 23 14:25:05 2015 +0200
    69.3 @@ -3,11 +3,11 @@
    69.4      Copyright   1994  University of Cambridge
    69.5  *)
    69.6  
    69.7 -section{*The Axiom of Choice*}
    69.8 +section\<open>The Axiom of Choice\<close>
    69.9  
   69.10  theory AC imports Main_ZF begin
   69.11  
   69.12 -text{*This definition comes from Halmos (1960), page 59.*}
   69.13 +text\<open>This definition comes from Halmos (1960), page 59.\<close>
   69.14  axiomatization where
   69.15    AC: "[| a \<in> A;  !!x. x \<in> A ==> (\<exists>y. y \<in> B(x)) |] ==> \<exists>z. z \<in> Pi(A,B)"
   69.16  
    70.1 --- a/src/ZF/AC/Cardinal_aux.thy	Thu Jul 23 14:20:51 2015 +0200
    70.2 +++ b/src/ZF/AC/Cardinal_aux.thy	Thu Jul 23 14:25:05 2015 +0200
    70.3 @@ -45,7 +45,7 @@
    70.4      by (simp add: Inf_Card_is_InfCard Finite_cardinal_iff NFI i) 
    70.5    have "A \<union> B \<lesssim> A + B" by (rule Un_lepoll_sum)
    70.6    also have "... \<lesssim> A \<times> B"
    70.7 -    by (rule lepoll_imp_sum_lepoll_prod [OF AB [THEN eqpoll_imp_lepoll] `2 \<lesssim> A`])
    70.8 +    by (rule lepoll_imp_sum_lepoll_prod [OF AB [THEN eqpoll_imp_lepoll] \<open>2 \<lesssim> A\<close>])
    70.9    also have "... \<approx> i \<times> i"
   70.10      by (blast intro: prod_eqpoll_cong eqpoll_imp_lepoll A B) 
   70.11    also have "... \<approx> i"
   70.12 @@ -172,11 +172,11 @@
   70.13  apply (drule eqpoll_imp_lepoll [THEN lepoll_trans],
   70.14         rule le_imp_lepoll, assumption)+
   70.15  apply (case_tac "Finite(x \<union> xa)")
   70.16 -txt{*finite case*}
   70.17 +txt\<open>finite case\<close>
   70.18   apply (drule Finite_Un [OF lepoll_Finite lepoll_Finite], assumption+)
   70.19   apply (drule subset_Un_Diff [THEN subset_imp_lepoll, THEN lepoll_Finite])
   70.20   apply (fast dest: eqpoll_sym [THEN eqpoll_imp_lepoll, THEN lepoll_Finite])
   70.21 -txt{*infinite case*}
   70.22 +txt\<open>infinite case\<close>
   70.23  apply (drule Un_lepoll_Inf_Ord, (assumption+))
   70.24  apply (blast intro: le_Ord2)
   70.25  apply (drule lesspoll_trans1
    71.1 --- a/src/ZF/AC/DC.thy	Thu Jul 23 14:20:51 2015 +0200
    71.2 +++ b/src/ZF/AC/DC.thy	Thu Jul 23 14:25:05 2015 +0200
    71.3 @@ -17,7 +17,7 @@
    71.4  apply (fast intro: LeastI Ord_in_Ord) 
    71.5  done
    71.6  
    71.7 -text{*Trivial in the presence of AC, but here we need a wellordering of X*}
    71.8 +text\<open>Trivial in the presence of AC, but here we need a wellordering of X\<close>
    71.9  lemma image_Ord_lepoll: "[| f \<in> X->Y; Ord(X) |] ==> f``X \<lesssim> X"
   71.10  apply (unfold lepoll_def)
   71.11  apply (rule_tac x = "\<lambda>x \<in> f``X. LEAST y. f`y = x" in exI)
    72.1 --- a/src/ZF/AC/HH.thy	Thu Jul 23 14:20:51 2015 +0200
    72.2 +++ b/src/ZF/AC/HH.thy	Thu Jul 23 14:25:05 2015 +0200
    72.3 @@ -16,7 +16,7 @@
    72.4      "HH(f,x,a) == transrec(a, %b r. let z = x - (\<Union>c \<in> b. r`c)
    72.5                                      in  if f`z \<in> Pow(z)-{0} then f`z else {x})"
    72.6  
    72.7 -subsection{*Lemmas useful in each of the three proofs*}
    72.8 +subsection\<open>Lemmas useful in each of the three proofs\<close>
    72.9  
   72.10  lemma HH_def_satisfies_eq:
   72.11       "HH(f,x,a) = (let z = x - (\<Union>b \<in> a. HH(f,x,b))   
   72.12 @@ -126,7 +126,7 @@
   72.13  apply (erule_tac [2] ltI [OF _ Ord_Least], assumption)
   72.14  done
   72.15  
   72.16 -subsection{*Lemmas used in the proofs of AC1 ==> WO2 and AC17 ==> AC1*}
   72.17 +subsection\<open>Lemmas used in the proofs of AC1 ==> WO2 and AC17 ==> AC1\<close>
   72.18  
   72.19  lemma lam_Least_HH_inj_Pow: 
   72.20          "(\<lambda>a \<in> (LEAST i. HH(f,x,i)={x}). HH(f,x,a))   
   72.21 @@ -213,7 +213,7 @@
   72.22                lam_sing_bij [THEN bij_converse_bij]]
   72.23  
   72.24  
   72.25 -subsection{*The proof of AC1 ==> WO2*}
   72.26 +subsection\<open>The proof of AC1 ==> WO2\<close>
   72.27  
   72.28  (*Establishing the existence of a bijection, namely
   72.29  converse
    73.1 --- a/src/ZF/Arith.thy	Thu Jul 23 14:20:51 2015 +0200
    73.2 +++ b/src/ZF/Arith.thy	Thu Jul 23 14:25:05 2015 +0200
    73.3 @@ -9,11 +9,11 @@
    73.4    Also, rec(m, 0, %z w.z) is pred(m).
    73.5  *)
    73.6  
    73.7 -section{*Arithmetic Operators and Their Definitions*}
    73.8 +section\<open>Arithmetic Operators and Their Definitions\<close>
    73.9  
   73.10  theory Arith imports Univ begin
   73.11  
   73.12 -text{*Proofs about elementary arithmetic: addition, multiplication, etc.*}
   73.13 +text\<open>Proofs about elementary arithmetic: addition, multiplication, etc.\<close>
   73.14  
   73.15  definition
   73.16    pred   :: "i=>i"    (*inverse of succ*)  where
   73.17 @@ -91,7 +91,7 @@
   73.18  lemmas zero_lt_natE = zero_lt_lemma [THEN bexE]
   73.19  
   73.20  
   73.21 -subsection{*@{text natify}, the Coercion to @{term nat}*}
   73.22 +subsection\<open>@{text natify}, the Coercion to @{term nat}\<close>
   73.23  
   73.24  lemma pred_succ_eq [simp]: "pred(succ(y)) = y"
   73.25  by (unfold pred_def, auto)
   73.26 @@ -167,7 +167,7 @@
   73.27  by (simp add: div_def)
   73.28  
   73.29  
   73.30 -subsection{*Typing rules*}
   73.31 +subsection\<open>Typing rules\<close>
   73.32  
   73.33  (** Addition **)
   73.34  
   73.35 @@ -222,7 +222,7 @@
   73.36  done
   73.37  
   73.38  
   73.39 -subsection{*Addition*}
   73.40 +subsection\<open>Addition\<close>
   73.41  
   73.42  (*Natify has weakened this law, compared with the older approach*)
   73.43  lemma add_0_natify [simp]: "0 #+ m = natify(m)"
   73.44 @@ -315,7 +315,7 @@
   73.45  by (induct_tac "n", auto)
   73.46  
   73.47  
   73.48 -subsection{*Monotonicity of Addition*}
   73.49 +subsection\<open>Monotonicity of Addition\<close>
   73.50  
   73.51  (*strict, in 1st argument; proof is by rule induction on 'less than'.
   73.52    Still need j\<in>nat, for consider j = omega.  Then we can have i<omega,
   73.53 @@ -326,11 +326,11 @@
   73.54  apply (simp_all add: leI)
   73.55  done
   73.56  
   73.57 -text{*strict, in second argument*}
   73.58 +text\<open>strict, in second argument\<close>
   73.59  lemma add_lt_mono2: "[| i<j; j\<in>nat |] ==> k#+i < k#+j"
   73.60  by (simp add: add_commute [of k] add_lt_mono1)
   73.61  
   73.62 -text{*A [clumsy] way of lifting < monotonicity to @{text "\<le>"} monotonicity*}
   73.63 +text\<open>A [clumsy] way of lifting < monotonicity to @{text "\<le>"} monotonicity\<close>
   73.64  lemma Ord_lt_mono_imp_le_mono:
   73.65    assumes lt_mono: "!!i j. [| i<j; j:k |] ==> f(i) < f(j)"
   73.66        and ford:    "!!i. i:k ==> Ord(f(i))"
   73.67 @@ -341,19 +341,19 @@
   73.68  apply (blast intro!: leCI lt_mono ford elim!: leE)
   73.69  done
   73.70  
   73.71 -text{*@{text "\<le>"} monotonicity, 1st argument*}
   73.72 +text\<open>@{text "\<le>"} monotonicity, 1st argument\<close>
   73.73  lemma add_le_mono1: "[| i \<le> j; j\<in>nat |] ==> i#+k \<le> j#+k"
   73.74  apply (rule_tac f = "%j. j#+k" in Ord_lt_mono_imp_le_mono, typecheck)
   73.75  apply (blast intro: add_lt_mono1 add_type [THEN nat_into_Ord])+
   73.76  done
   73.77  
   73.78 -text{*@{text "\<le>"} monotonicity, both arguments*}
   73.79 +text\<open>@{text "\<le>"} monotonicity, both arguments\<close>
   73.80  lemma add_le_mono: "[| i \<le> j; k \<le> l; j\<in>nat; l\<in>nat |] ==> i#+k \<le> j#+l"
   73.81  apply (rule add_le_mono1 [THEN le_trans], assumption+)
   73.82  apply (subst add_commute, subst add_commute, rule add_le_mono1, assumption+)
   73.83  done
   73.84  
   73.85 -text{*Combinations of less-than and less-than-or-equals*}
   73.86 +text\<open>Combinations of less-than and less-than-or-equals\<close>
   73.87  
   73.88  lemma add_lt_le_mono: "[| i<j; k\<le>l; j\<in>nat; l\<in>nat |] ==> i#+k < j#+l"
   73.89  apply (rule add_lt_mono1 [THEN lt_trans2], assumption+)
   73.90 @@ -363,7 +363,7 @@
   73.91  lemma add_le_lt_mono: "[| i\<le>j; k<l; j\<in>nat; l\<in>nat |] ==> i#+k < j#+l"
   73.92  by (subst add_commute, subst add_commute, erule add_lt_le_mono, assumption+)
   73.93  
   73.94 -text{*Less-than: in other words, strict in both arguments*}
   73.95 +text\<open>Less-than: in other words, strict in both arguments\<close>
   73.96  lemma add_lt_mono: "[| i<j; k<l; j\<in>nat; l\<in>nat |] ==> i#+k < j#+l"
   73.97  apply (rule add_lt_le_mono)
   73.98  apply (auto intro: leI)
   73.99 @@ -433,7 +433,7 @@
  73.100      "[|i\<in>nat; j\<in>nat|] ==> (i \<union> j) #- k = (i#-k) \<union> (j#-k)"
  73.101  by (insert nat_diff_Un_distrib [of i j "natify(k)"], simp)
  73.102  
  73.103 -text{*We actually prove @{term "i #- j #- k = i #- (j #+ k)"}*}
  73.104 +text\<open>We actually prove @{term "i #- j #- k = i #- (j #+ k)"}\<close>
  73.105  lemma diff_diff_left [simplified]:
  73.106       "natify(i)#-natify(j)#-k = natify(i) #- (natify(j)#+k)"
  73.107  by (rule_tac m="natify(i)" and n="natify(j)" in diff_induct, auto)
  73.108 @@ -464,7 +464,7 @@
  73.109  by auto
  73.110  
  73.111  
  73.112 -subsection{*Multiplication*}
  73.113 +subsection\<open>Multiplication\<close>
  73.114  
  73.115  lemma mult_0 [simp]: "0 #* m = 0"
  73.116  by (simp add: mult_def)
    74.1 --- a/src/ZF/ArithSimp.thy	Thu Jul 23 14:20:51 2015 +0200
    74.2 +++ b/src/ZF/ArithSimp.thy	Thu Jul 23 14:25:05 2015 +0200
    74.3 @@ -3,7 +3,7 @@
    74.4      Copyright   2000  University of Cambridge
    74.5  *)
    74.6  
    74.7 -section{*Arithmetic with simplification*}
    74.8 +section\<open>Arithmetic with simplification\<close>
    74.9  
   74.10  theory ArithSimp
   74.11  imports Arith
   74.12 @@ -14,7 +14,7 @@
   74.13  ML_file "arith_data.ML"
   74.14  
   74.15  
   74.16 -subsection{*Difference*}
   74.17 +subsection\<open>Difference\<close>
   74.18  
   74.19  lemma diff_self_eq_0 [simp]: "m #- m = 0"
   74.20  apply (subgoal_tac "natify (m) #- natify (m) = 0")
   74.21 @@ -64,7 +64,7 @@
   74.22  done
   74.23  
   74.24  
   74.25 -subsection{*Remainder*}
   74.26 +subsection\<open>Remainder\<close>
   74.27  
   74.28  (*We need m:nat even with natify*)
   74.29  lemma div_termination: "[| 0<n;  n \<le> m;  m:nat |] ==> m #- n < m"
   74.30 @@ -135,7 +135,7 @@
   74.31  done
   74.32  
   74.33  
   74.34 -subsection{*Division*}
   74.35 +subsection\<open>Division\<close>
   74.36  
   74.37  lemma raw_div_type: "[| m:nat;  n:nat |] ==> raw_div (m, n) \<in> nat"
   74.38  apply (unfold raw_div_def)
   74.39 @@ -183,9 +183,9 @@
   74.40  apply (simp add: nat_into_Ord [THEN Ord_0_lt_iff])
   74.41  apply (erule complete_induct)
   74.42  apply (case_tac "x<n")
   74.43 -txt{*case x<n*}
   74.44 +txt\<open>case x<n\<close>
   74.45  apply (simp (no_asm_simp))
   74.46 -txt{*case @{term"n \<le> x"}*}
   74.47 +txt\<open>case @{term"n \<le> x"}\<close>
   74.48  apply (simp add: not_lt_iff_le add_assoc mod_geq div_termination [THEN ltD] add_diff_inverse)
   74.49  done
   74.50  
   74.51 @@ -200,23 +200,23 @@
   74.52  done
   74.53  
   74.54  
   74.55 -subsection{*Further Facts about Remainder*}
   74.56 +subsection\<open>Further Facts about Remainder\<close>
   74.57  
   74.58 -text{*(mainly for mutilated chess board)*}
   74.59 +text\<open>(mainly for mutilated chess board)\<close>
   74.60  
   74.61  lemma mod_succ_lemma:
   74.62       "[| 0<n;  m:nat;  n:nat |]
   74.63        ==> succ(m) mod n = (if succ(m mod n) = n then 0 else succ(m mod n))"
   74.64  apply (erule complete_induct)
   74.65  apply (case_tac "succ (x) <n")
   74.66 -txt{* case succ(x) < n *}
   74.67 +txt\<open>case succ(x) < n\<close>
   74.68   apply (simp (no_asm_simp) add: nat_le_refl [THEN lt_trans] succ_neq_self)
   74.69   apply (simp add: ltD [THEN mem_imp_not_eq])
   74.70 -txt{* case @{term"n \<le> succ(x)"} *}
   74.71 +txt\<open>case @{term"n \<le> succ(x)"}\<close>
   74.72  apply (simp add: mod_geq not_lt_iff_le)
   74.73  apply (erule leE)
   74.74   apply (simp (no_asm_simp) add: mod_geq div_termination [THEN ltD] diff_succ)
   74.75 -txt{*equality case*}
   74.76 +txt\<open>equality case\<close>
   74.77  apply (simp add: diff_self_eq_0)
   74.78  done
   74.79  
   74.80 @@ -235,7 +235,7 @@
   74.81  apply (subgoal_tac "natify (m) mod n < n")
   74.82  apply (rule_tac [2] i = "natify (m) " in complete_induct)
   74.83  apply (case_tac [3] "x<n", auto)
   74.84 -txt{* case @{term"n \<le> x"}*}
   74.85 +txt\<open>case @{term"n \<le> x"}\<close>
   74.86  apply (simp add: mod_geq not_lt_iff_le div_termination [THEN ltD])
   74.87  done
   74.88  
   74.89 @@ -264,7 +264,7 @@
   74.90  by (cut_tac n = 0 in mod2_add_more, auto)
   74.91  
   74.92  
   74.93 -subsection{*Additional theorems about @{text "\<le>"}*}
   74.94 +subsection\<open>Additional theorems about @{text "\<le>"}\<close>
   74.95  
   74.96  lemma add_le_self: "m:nat ==> m \<le> (m #+ n)"
   74.97  apply (simp (no_asm_simp))
   74.98 @@ -339,7 +339,7 @@
   74.99  done
  74.100  
  74.101  
  74.102 -subsection{*Cancellation Laws for Common Factors in Comparisons*}
  74.103 +subsection\<open>Cancellation Laws for Common Factors in Comparisons\<close>
  74.104  
  74.105  lemma mult_less_cancel_lemma:
  74.106       "[| k: nat; m: nat; n: nat |] ==> (m#*k < n#*k) \<longleftrightarrow> (0<k & m<n)"
  74.107 @@ -414,7 +414,7 @@
  74.108  done
  74.109  
  74.110  
  74.111 -subsection{*More Lemmas about Remainder*}
  74.112 +subsection\<open>More Lemmas about Remainder\<close>
  74.113  
  74.114  lemma mult_mod_distrib_raw:
  74.115       "[| k:nat; m:nat; n:nat |] ==> (k#*m) mod (k#*n) = k #* (m mod n)"
  74.116 @@ -507,7 +507,7 @@
  74.117  by (drule less_imp_succ_add, auto)
  74.118  
  74.119  
  74.120 -subsubsection{*More Lemmas About Difference*}
  74.121 +subsubsection\<open>More Lemmas About Difference\<close>
  74.122  
  74.123  lemma diff_is_0_lemma:
  74.124       "[| m: nat; n: nat |] ==> m #- n = 0 \<longleftrightarrow> m \<le> n"
  74.125 @@ -538,7 +538,7 @@
  74.126  apply simp_all
  74.127  done
  74.128  
  74.129 -text{*Difference and less-than*}
  74.130 +text\<open>Difference and less-than\<close>
  74.131  
  74.132  lemma diff_lt_imp_lt: "[|(k#-i) < (k#-j); i\<in>nat; j\<in>nat; k\<in>nat|] ==> j<i"
  74.133  apply (erule rev_mp)
    75.1 --- a/src/ZF/Bin.thy	Thu Jul 23 14:20:51 2015 +0200
    75.2 +++ b/src/ZF/Bin.thy	Thu Jul 23 14:25:05 2015 +0200
    75.3 @@ -13,7 +13,7 @@
    75.4  For instance, ~5 div 2 = ~3 and ~5 mod 2 = 1; thus ~5 = (~3)*2 + 1
    75.5  *)
    75.6  
    75.7 -section{*Arithmetic on Binary Integers*}
    75.8 +section\<open>Arithmetic on Binary Integers\<close>
    75.9  
   75.10  theory Bin
   75.11  imports Int_ZF Datatype_ZF
   75.12 @@ -176,8 +176,8 @@
   75.13  by (induct_tac "v", auto)
   75.14  
   75.15  
   75.16 -subsubsection{*The Carry and Borrow Functions,
   75.17 -            @{term bin_succ} and @{term bin_pred}*}
   75.18 +subsubsection\<open>The Carry and Borrow Functions,
   75.19 +            @{term bin_succ} and @{term bin_pred}\<close>
   75.20  
   75.21  (*NCons preserves the integer value of its argument*)
   75.22  lemma integ_of_NCons [simp]:
   75.23 @@ -199,7 +199,7 @@
   75.24  done
   75.25  
   75.26  
   75.27 -subsubsection{*@{term bin_minus}: Unary Negation of Binary Integers*}
   75.28 +subsubsection\<open>@{term bin_minus}: Unary Negation of Binary Integers\<close>
   75.29  
   75.30  lemma integ_of_minus: "w \<in> bin ==> integ_of(bin_minus(w)) = $- integ_of(w)"
   75.31  apply (erule bin.induct)
   75.32 @@ -207,7 +207,7 @@
   75.33  done
   75.34  
   75.35  
   75.36 -subsubsection{*@{term bin_add}: Binary Addition*}
   75.37 +subsubsection\<open>@{term bin_add}: Binary Addition\<close>
   75.38  
   75.39  lemma bin_add_Pls [simp]: "w \<in> bin ==> bin_add(Pls,w) = w"
   75.40  by (unfold bin_add_def, simp)
   75.41 @@ -255,7 +255,7 @@
   75.42  done
   75.43  
   75.44  
   75.45 -subsubsection{*@{term bin_mult}: Binary Multiplication*}
   75.46 +subsubsection\<open>@{term bin_mult}: Binary Multiplication\<close>
   75.47  
   75.48  lemma integ_of_mult:
   75.49       "[| v \<in> bin;  w \<in> bin |]
   75.50 @@ -266,7 +266,7 @@
   75.51  done
   75.52  
   75.53  
   75.54 -subsection{*Computations*}
   75.55 +subsection\<open>Computations\<close>
   75.56  
   75.57  (** extra rules for bin_succ, bin_pred **)
   75.58  
   75.59 @@ -351,8 +351,8 @@
   75.60  done
   75.61  
   75.62  
   75.63 -subsection{*Simplification Rules for Comparison of Binary Numbers*}
   75.64 -text{*Thanks to Norbert Voelker*}
   75.65 +subsection\<open>Simplification Rules for Comparison of Binary Numbers\<close>
   75.66 +text\<open>Thanks to Norbert Voelker\<close>
   75.67  
   75.68  (** Equals (=) **)
   75.69  
   75.70 @@ -695,9 +695,9 @@
   75.71  
   75.72  ML_file "int_arith.ML"
   75.73  
   75.74 -subsection {* examples: *}
   75.75 +subsection \<open>examples:\<close>
   75.76  
   75.77 -text {* @{text combine_numerals_prod} (products of separate literals) *}
   75.78 +text \<open>@{text combine_numerals_prod} (products of separate literals)\<close>
   75.79  lemma "#5 $* x $* #3 = y" apply simp oops
   75.80  
   75.81  schematic_lemma "y2 $+ ?x42 = y $+ y2" apply simp oops
   75.82 @@ -741,7 +741,7 @@
   75.83  lemma "a $+ $-(b$+c) $+ b = d" apply simp oops
   75.84  lemma "a $+ $-(b$+c) $- b = d" apply simp oops
   75.85  
   75.86 -text {* negative numerals *}
   75.87 +text \<open>negative numerals\<close>
   75.88  lemma "(i $+ j $+ #-2 $+ k) $- (u $+ #5 $+ y) = zz" apply simp oops
   75.89  lemma "(i $+ j $+ #-3 $+ k) $< u $+ #5 $+ y" apply simp oops
   75.90  lemma "(i $+ j $+ #3 $+ k) $< u $+ #-6 $+ y" apply simp oops
   75.91 @@ -749,7 +749,7 @@
   75.92  lemma "(i $+ j $+ #12 $+ k) $- #-15 = y" apply simp oops
   75.93  lemma "(i $+ j $+ #-12 $+ k) $- #-15 = y" apply simp oops
   75.94  
   75.95 -text {* Multiplying separated numerals *}
   75.96 +text \<open>Multiplying separated numerals\<close>
   75.97  lemma "#6 $* ($# x $* #2) =  uu" apply simp oops
   75.98  lemma "#4 $* ($# x $* $# x) $* (#2 $* $# x) =  uu" apply simp oops
   75.99  
    76.1 --- a/src/ZF/Bool.thy	Thu Jul 23 14:20:51 2015 +0200
    76.2 +++ b/src/ZF/Bool.thy	Thu Jul 23 14:25:05 2015 +0200
    76.3 @@ -3,7 +3,7 @@
    76.4      Copyright   1992  University of Cambridge
    76.5  *)
    76.6  
    76.7 -section{*Booleans in Zermelo-Fraenkel Set Theory*}
    76.8 +section\<open>Booleans in Zermelo-Fraenkel Set Theory\<close>
    76.9  
   76.10  theory Bool imports pair begin
   76.11  
   76.12 @@ -15,7 +15,7 @@
   76.13    two  ("2") where
   76.14    "2 == succ(1)"
   76.15  
   76.16 -text{*2 is equal to bool, but is used as a number rather than a type.*}
   76.17 +text\<open>2 is equal to bool, but is used as a number rather than a type.\<close>
   76.18  
   76.19  definition "bool == {0,1}"
   76.20  
   76.21 @@ -109,7 +109,7 @@
   76.22  lemmas bool_typechecks = bool_1I bool_0I cond_type not_type and_type
   76.23                           or_type xor_type
   76.24  
   76.25 -subsection{*Laws About 'not' *}
   76.26 +subsection\<open>Laws About 'not'\<close>
   76.27  
   76.28  lemma not_not [simp]: "a:bool ==> not(not(a)) = a"
   76.29  by (elim boolE, auto)
   76.30 @@ -120,7 +120,7 @@
   76.31  lemma not_or [simp]: "a:bool ==> not(a or b) = not(a) and not(b)"
   76.32  by (elim boolE, auto)
   76.33  
   76.34 -subsection{*Laws About 'and' *}
   76.35 +subsection\<open>Laws About 'and'\<close>
   76.36  
   76.37  lemma and_absorb [simp]: "a: bool ==> a and a = a"
   76.38  by (elim boolE, auto)
   76.39 @@ -135,7 +135,7 @@
   76.40         (a or b) and c  =  (a and c) or (b and c)"
   76.41  by (elim boolE, auto)
   76.42  
   76.43 -subsection{*Laws About 'or' *}
   76.44 +subsection\<open>Laws About 'or'\<close>
   76.45  
   76.46  lemma or_absorb [simp]: "a: bool ==> a or a = a"
   76.47  by (elim boolE, auto)
    77.1 --- a/src/ZF/Cardinal.thy	Thu Jul 23 14:20:51 2015 +0200
    77.2 +++ b/src/ZF/Cardinal.thy	Thu Jul 23 14:25:05 2015 +0200
    77.3 @@ -3,7 +3,7 @@
    77.4      Copyright   1994  University of Cambridge
    77.5  *)
    77.6  
    77.7 -section{*Cardinal Numbers Without the Axiom of Choice*}
    77.8 +section\<open>Cardinal Numbers Without the Axiom of Choice\<close>
    77.9  
   77.10  theory Cardinal imports OrderType Finite Nat_ZF Sum begin
   77.11  
   77.12 @@ -47,8 +47,8 @@
   77.13    Least     (binder "\<mu>" 10)
   77.14  
   77.15  
   77.16 -subsection{*The Schroeder-Bernstein Theorem*}
   77.17 -text{*See Davey and Priestly, page 106*}
   77.18 +subsection\<open>The Schroeder-Bernstein Theorem\<close>
   77.19 +text\<open>See Davey and Priestly, page 106\<close>
   77.20  
   77.21  (** Lemma: Banach's Decomposition Theorem **)
   77.22  
   77.23 @@ -178,7 +178,7 @@
   77.24  done
   77.25  
   77.26  
   77.27 -subsection{*lesspoll: contributions by Krzysztof Grabczewski *}
   77.28 +subsection\<open>lesspoll: contributions by Krzysztof Grabczewski\<close>
   77.29  
   77.30  lemma lesspoll_not_refl: "~ (i \<prec> i)"
   77.31  by (simp add: lesspoll_def)
   77.32 @@ -276,7 +276,7 @@
   77.33    thus ?thesis using P .
   77.34  qed
   77.35  
   77.36 -text{*The proof is almost identical to the one above!*}
   77.37 +text\<open>The proof is almost identical to the one above!\<close>
   77.38  lemma Least_le: 
   77.39    assumes P: "P(i)" and i: "Ord(i)" shows "(\<mu> x. P(x)) \<le> i"
   77.40  proof -
   77.41 @@ -333,7 +333,7 @@
   77.42  qed
   77.43  
   77.44  
   77.45 -subsection{*Basic Properties of Cardinals*}
   77.46 +subsection\<open>Basic Properties of Cardinals\<close>
   77.47  
   77.48  (*Not needed for simplification, but helpful below*)
   77.49  lemma Least_cong: "(!!y. P(y) \<longleftrightarrow> Q(y)) ==> (\<mu> x. P(x)) = (\<mu> x. Q(x))"
   77.50 @@ -410,7 +410,7 @@
   77.51  apply (rule Ord_Least)
   77.52  done
   77.53  
   77.54 -text{*The cardinals are the initial ordinals.*}
   77.55 +text\<open>The cardinals are the initial ordinals.\<close>
   77.56  lemma Card_iff_initial: "Card(K) \<longleftrightarrow> Ord(K) & (\<forall>j. j<K \<longrightarrow> ~ j \<approx> K)"
   77.57  proof -
   77.58    { fix j
   77.59 @@ -449,10 +449,10 @@
   77.60  proof (unfold cardinal_def)
   77.61    show "Card(\<mu> i. i \<approx> A)"
   77.62      proof (cases "\<exists>i. Ord (i) & i \<approx> A")
   77.63 -      case False thus ?thesis           --{*degenerate case*}
   77.64 +      case False thus ?thesis           --\<open>degenerate case\<close>
   77.65          by (simp add: Least_0 Card_0)
   77.66      next
   77.67 -      case True                         --{*real case: @{term A} is isomorphic to some ordinal*}
   77.68 +      case True                         --\<open>real case: @{term A} is isomorphic to some ordinal\<close>
   77.69        then obtain i where i: "Ord(i)" "i \<approx> A" by blast
   77.70        show ?thesis
   77.71          proof (rule CardI [OF Ord_Least], rule notI)
   77.72 @@ -500,7 +500,7 @@
   77.73    thus ?thesis by simp
   77.74  qed
   77.75  
   77.76 -text{*Since we have @{term"|succ(nat)| \<le> |nat|"}, the converse of @{text cardinal_mono} fails!*}
   77.77 +text\<open>Since we have @{term"|succ(nat)| \<le> |nat|"}, the converse of @{text cardinal_mono} fails!\<close>
   77.78  lemma cardinal_lt_imp_lt: "[| |i| < |j|;  Ord(i);  Ord(j) |] ==> i < j"
   77.79  apply (rule Ord_linear2 [of i j], assumption+)
   77.80  apply (erule lt_trans2 [THEN lt_irrefl])
   77.81 @@ -556,7 +556,7 @@
   77.82  apply (blast intro: Ord_trans)
   77.83  done
   77.84  
   77.85 -subsection{*The finite cardinals *}
   77.86 +subsection\<open>The finite cardinals\<close>
   77.87  
   77.88  lemma cons_lepoll_consD:
   77.89   "[| cons(u,A) \<lesssim> cons(v,B);  u\<notin>A;  v\<notin>B |] ==> A \<lesssim> B"
   77.90 @@ -591,12 +591,12 @@
   77.91    case 0 thus ?case by (blast intro!: nat_0_le)
   77.92  next
   77.93    case (succ m)
   77.94 -  show ?case  using `n \<in> nat`
   77.95 +  show ?case  using \<open>n \<in> nat\<close>
   77.96      proof (cases rule: natE)
   77.97        case 0 thus ?thesis using succ
   77.98          by (simp add: lepoll_def inj_def)
   77.99      next
  77.100 -      case (succ n') thus ?thesis using succ.hyps ` succ(m) \<lesssim> n`
  77.101 +      case (succ n') thus ?thesis using succ.hyps \<open> succ(m) \<lesssim> n\<close>
  77.102          by (blast intro!: succ_leI dest!: succ_lepoll_succD)
  77.103      qed
  77.104  qed
  77.105 @@ -682,7 +682,7 @@
  77.106  done
  77.107  
  77.108  
  77.109 -subsection{*The first infinite cardinal: Omega, or nat *}
  77.110 +subsection\<open>The first infinite cardinal: Omega, or nat\<close>
  77.111  
  77.112  (*This implies Kunen's Lemma 10.6*)
  77.113  lemma lt_not_lepoll:
  77.114 @@ -697,7 +697,7 @@
  77.115    thus ?thesis by auto
  77.116  qed
  77.117  
  77.118 -text{*A slightly weaker version of @{text nat_eqpoll_iff}*}
  77.119 +text\<open>A slightly weaker version of @{text nat_eqpoll_iff}\<close>
  77.120  lemma Ord_nat_eqpoll_iff:
  77.121    assumes i: "Ord(i)" and n: "n \<in> nat" shows "i \<approx> n \<longleftrightarrow> i=n"
  77.122  using i nat_into_Ord [OF n]
  77.123 @@ -712,7 +712,7 @@
  77.124    case gt
  77.125    hence  "~ i \<lesssim> n" using n  by (rule lt_not_lepoll)
  77.126    hence  "~ i \<approx> n" using n  by (blast intro: eqpoll_imp_lepoll)
  77.127 -  moreover have "i \<noteq> n" using `n<i` by auto
  77.128 +  moreover have "i \<noteq> n" using \<open>n<i\<close> by auto
  77.129    ultimately show ?thesis by blast
  77.130  qed
  77.131  
  77.132 @@ -740,7 +740,7 @@
  77.133    by (blast intro: Ord_nat Card_nat ltI lt_Card_imp_lesspoll)
  77.134  
  77.135  
  77.136 -subsection{*Towards Cardinal Arithmetic *}
  77.137 +subsection\<open>Towards Cardinal Arithmetic\<close>
  77.138  (** Congruence laws for successor, cardinal addition and multiplication **)
  77.139  
  77.140  (*Congruence law for  cons  under equipollence*)
  77.141 @@ -817,12 +817,12 @@
  77.142  done
  77.143  
  77.144  
  77.145 -subsection{*Lemmas by Krzysztof Grabczewski*}
  77.146 +subsection\<open>Lemmas by Krzysztof Grabczewski\<close>
  77.147  
  77.148  (*New proofs using cons_lepoll_cons. Could generalise from succ to cons.*)
  77.149  
  77.150 -text{*If @{term A} has at most @{term"n+1"} elements and @{term"a \<in> A"}
  77.151 -      then @{term"A-{a}"} has at most @{term n}.*}
  77.152 +text\<open>If @{term A} has at most @{term"n+1"} elements and @{term"a \<in> A"}
  77.153 +      then @{term"A-{a}"} has at most @{term n}.\<close>
  77.154  lemma Diff_sing_lepoll:
  77.155        "[| a \<in> A;  A \<lesssim> succ(n) |] ==> A - {a} \<lesssim> n"
  77.156  apply (unfold succ_def)
  77.157 @@ -831,7 +831,7 @@
  77.158  apply (erule cons_Diff [THEN ssubst], safe)
  77.159  done
  77.160  
  77.161 -text{*If @{term A} has at least @{term"n+1"} elements then @{term"A-{a}"} has at least @{term n}.*}
  77.162 +text\<open>If @{term A} has at least @{term"n+1"} elements then @{term"A-{a}"} has at least @{term n}.\<close>
  77.163  lemma lepoll_Diff_sing:
  77.164    assumes A: "succ(n) \<lesssim> A" shows "n \<lesssim> A - {a}"
  77.165  proof -
  77.166 @@ -877,7 +877,7 @@
  77.167  done
  77.168  
  77.169  
  77.170 -subsection {*Finite and infinite sets*}
  77.171 +subsection \<open>Finite and infinite sets\<close>
  77.172  
  77.173  lemma eqpoll_imp_Finite_iff: "A \<approx> B ==> Finite(A) \<longleftrightarrow> Finite(B)"
  77.174  apply (unfold Finite_def)
  77.175 @@ -1027,7 +1027,7 @@
  77.176  lemma Finite_Un_iff [simp]: "Finite(A \<union> B) \<longleftrightarrow> (Finite(A) & Finite(B))"
  77.177  by (blast intro: subset_Finite Finite_Un)
  77.178  
  77.179 -text{*The converse must hold too.*}
  77.180 +text\<open>The converse must hold too.\<close>
  77.181  lemma Finite_Union: "[| \<forall>y\<in>X. Finite(y);  Finite(X) |] ==> Finite(\<Union>(X))"
  77.182  apply (simp add: Finite_Fin_iff)
  77.183  apply (rule Fin_UnionI)
  77.184 @@ -1085,8 +1085,8 @@
  77.185  apply (blast intro: elim: equalityCE)
  77.186  done
  77.187  
  77.188 -text{*I don't know why, but if the premise is expressed using meta-connectives
  77.189 -then  the simplifier cannot prove it automatically in conditional rewriting.*}
  77.190 +text\<open>I don't know why, but if the premise is expressed using meta-connectives
  77.191 +then  the simplifier cannot prove it automatically in conditional rewriting.\<close>
  77.192  lemma Finite_RepFun_iff:
  77.193       "(\<forall>x y. f(x)=f(y) \<longrightarrow> x=y) ==> Finite(RepFun(A,f)) \<longleftrightarrow> Finite(A)"
  77.194  by (blast intro: Finite_RepFun Finite_RepFun_iff_lemma [of _ f])
  77.195 @@ -1119,7 +1119,7 @@
  77.196  next
  77.197    case (succ x)
  77.198    hence wfx: "\<And>Z. Z = 0 \<or> (\<exists>z\<in>Z. \<forall>y. z \<in> y \<and> z \<in> x \<and> y \<in> x \<and> z \<in> x \<longrightarrow> y \<notin> Z)"
  77.199 -    by (simp add: wf_on_def wf_def)  --{*not easy to erase the duplicate @{term"z \<in> x"}!*}
  77.200 +    by (simp add: wf_on_def wf_def)  --\<open>not easy to erase the duplicate @{term"z \<in> x"}!\<close>
  77.201    show ?case
  77.202      proof (rule wf_onI)
  77.203        fix Z u
    78.1 --- a/src/ZF/CardinalArith.thy	Thu Jul 23 14:20:51 2015 +0200
    78.2 +++ b/src/ZF/CardinalArith.thy	Thu Jul 23 14:25:05 2015 +0200
    78.3 @@ -3,7 +3,7 @@
    78.4      Copyright   1994  University of Cambridge
    78.5  *)
    78.6  
    78.7 -section{*Cardinal Arithmetic Without the Axiom of Choice*}
    78.8 +section\<open>Cardinal Arithmetic Without the Axiom of Choice\<close>
    78.9  
   78.10  theory CardinalArith imports Cardinal OrderArith ArithSimp Finite begin
   78.11  
   78.12 @@ -28,15 +28,15 @@
   78.13  
   78.14  definition
   78.15    jump_cardinal :: "i=>i"  where
   78.16 -    --{*This def is more complex than Kunen's but it more easily proved to
   78.17 -        be a cardinal*}
   78.18 +    --\<open>This def is more complex than Kunen's but it more easily proved to
   78.19 +        be a cardinal\<close>
   78.20      "jump_cardinal(K) ==
   78.21           \<Union>X\<in>Pow(K). {z. r \<in> Pow(K*K), well_ord(X,r) & z = ordertype(X,r)}"
   78.22  
   78.23  definition
   78.24    csucc         :: "i=>i"  where
   78.25 -    --{*needed because @{term "jump_cardinal(K)"} might not be the successor
   78.26 -        of @{term K}*}
   78.27 +    --\<open>needed because @{term "jump_cardinal(K)"} might not be the successor
   78.28 +        of @{term K}\<close>
   78.29      "csucc(K) == LEAST L. Card(L) & K<L"
   78.30  
   78.31  notation (xsymbols)
   78.32 @@ -87,14 +87,14 @@
   78.33  done
   78.34  
   78.35  
   78.36 -subsection{*Cardinal addition*}
   78.37 +subsection\<open>Cardinal addition\<close>
   78.38  
   78.39 -text{*Note: Could omit proving the algebraic laws for cardinal addition and
   78.40 +text\<open>Note: Could omit proving the algebraic laws for cardinal addition and
   78.41  multiplication.  On finite cardinals these operations coincide with
   78.42  addition and multiplication of natural numbers; on infinite cardinals they
   78.43 -coincide with union (maximum).  Either way we get most laws for free.*}
   78.44 +coincide with union (maximum).  Either way we get most laws for free.\<close>
   78.45  
   78.46 -subsubsection{*Cardinal addition is commutative*}
   78.47 +subsubsection\<open>Cardinal addition is commutative\<close>
   78.48  
   78.49  lemma sum_commute_eqpoll: "A+B \<approx> B+A"
   78.50  proof (unfold eqpoll_def, rule exI)
   78.51 @@ -107,7 +107,7 @@
   78.52  apply (rule sum_commute_eqpoll [THEN cardinal_cong])
   78.53  done
   78.54  
   78.55 -subsubsection{*Cardinal addition is associative*}
   78.56 +subsubsection\<open>Cardinal addition is associative\<close>
   78.57  
   78.58  lemma sum_assoc_eqpoll: "(A+B)+C \<approx> A+(B+C)"
   78.59  apply (unfold eqpoll_def)
   78.60 @@ -115,7 +115,7 @@
   78.61  apply (rule sum_assoc_bij)
   78.62  done
   78.63  
   78.64 -text{*Unconditional version requires AC*}
   78.65 +text\<open>Unconditional version requires AC\<close>
   78.66  lemma well_ord_cadd_assoc:
   78.67    assumes i: "well_ord(i,ri)" and j: "well_ord(j,rj)" and k: "well_ord(k,rk)"
   78.68    shows "(i \<oplus> j) \<oplus> k = i \<oplus> (j \<oplus> k)"
   78.69 @@ -130,7 +130,7 @@
   78.70  qed
   78.71  
   78.72  
   78.73 -subsubsection{*0 is the identity for addition*}
   78.74 +subsubsection\<open>0 is the identity for addition\<close>
   78.75  
   78.76  lemma sum_0_eqpoll: "0+A \<approx> A"
   78.77  apply (unfold eqpoll_def)
   78.78 @@ -143,7 +143,7 @@
   78.79  apply (simp add: sum_0_eqpoll [THEN cardinal_cong] Card_cardinal_eq)
   78.80  done
   78.81  
   78.82 -subsubsection{*Addition by another cardinal*}
   78.83 +subsubsection\<open>Addition by another cardinal\<close>
   78.84  
   78.85  lemma sum_lepoll_self: "A \<lesssim> A+B"
   78.86  proof (unfold lepoll_def, rule exI)
   78.87 @@ -165,7 +165,7 @@
   78.88      by (blast intro: le_trans)
   78.89  qed
   78.90  
   78.91 -subsubsection{*Monotonicity of addition*}
   78.92 +subsubsection\<open>Monotonicity of addition\<close>
   78.93  
   78.94  lemma sum_lepoll_mono:
   78.95       "[| A \<lesssim> C;  B \<lesssim> D |] ==> A + B \<lesssim> C + D"
   78.96 @@ -186,7 +186,7 @@
   78.97  apply (blast intro: sum_lepoll_mono subset_imp_lepoll)
   78.98  done
   78.99  
  78.100 -subsubsection{*Addition of finite cardinals is "ordinary" addition*}
  78.101 +subsubsection\<open>Addition of finite cardinals is "ordinary" addition\<close>
  78.102  
  78.103  lemma sum_succ_eqpoll: "succ(A)+B \<approx> succ(A+B)"
  78.104  apply (unfold eqpoll_def)
  78.105 @@ -222,9 +222,9 @@
  78.106  qed
  78.107  
  78.108  
  78.109 -subsection{*Cardinal multiplication*}
  78.110 +subsection\<open>Cardinal multiplication\<close>
  78.111  
  78.112 -subsubsection{*Cardinal multiplication is commutative*}
  78.113 +subsubsection\<open>Cardinal multiplication is commutative\<close>
  78.114  
  78.115  lemma prod_commute_eqpoll: "A*B \<approx> B*A"
  78.116  apply (unfold eqpoll_def)
  78.117 @@ -238,7 +238,7 @@
  78.118  apply (rule prod_commute_eqpoll [THEN cardinal_cong])
  78.119  done
  78.120  
  78.121 -subsubsection{*Cardinal multiplication is associative*}
  78.122 +subsubsection\<open>Cardinal multiplication is associative\<close>
  78.123  
  78.124  lemma prod_assoc_eqpoll: "(A*B)*C \<approx> A*(B*C)"
  78.125  apply (unfold eqpoll_def)
  78.126 @@ -246,7 +246,7 @@
  78.127  apply (rule prod_assoc_bij)
  78.128  done
  78.129  
  78.130 -text{*Unconditional version requires AC*}
  78.131 +text\<open>Unconditional version requires AC\<close>
  78.132  lemma well_ord_cmult_assoc:
  78.133    assumes i: "well_ord(i,ri)" and j: "well_ord(j,rj)" and k: "well_ord(k,rk)"
  78.134    shows "(i \<otimes> j) \<otimes> k = i \<otimes> (j \<otimes> k)"
  78.135 @@ -260,7 +260,7 @@
  78.136    finally show "|i * j| * k \<approx> i * |j * k|" .
  78.137  qed
  78.138  
  78.139 -subsubsection{*Cardinal multiplication distributes over addition*}
  78.140 +subsubsection\<open>Cardinal multiplication distributes over addition\<close>
  78.141  
  78.142  lemma sum_prod_distrib_eqpoll: "(A+B)*C \<approx> (A*C)+(B*C)"
  78.143  apply (unfold eqpoll_def)
  78.144 @@ -281,7 +281,7 @@
  78.145    finally show "|i + j| * k \<approx> |i * k| + |j * k|" .
  78.146  qed
  78.147  
  78.148 -subsubsection{*Multiplication by 0 yields 0*}
  78.149 +subsubsection\<open>Multiplication by 0 yields 0\<close>
  78.150  
  78.151  lemma prod_0_eqpoll: "0*A \<approx> 0"
  78.152  apply (unfold eqpoll_def)
  78.153 @@ -292,7 +292,7 @@
  78.154  lemma cmult_0 [simp]: "0 \<otimes> i = 0"
  78.155  by (simp add: cmult_def prod_0_eqpoll [THEN cardinal_cong])
  78.156  
  78.157 -subsubsection{*1 is the identity for multiplication*}
  78.158 +subsubsection\<open>1 is the identity for multiplication\<close>
  78.159  
  78.160  lemma prod_singleton_eqpoll: "{x}*A \<approx> A"
  78.161  apply (unfold eqpoll_def)
  78.162 @@ -305,7 +305,7 @@
  78.163  apply (simp add: prod_singleton_eqpoll [THEN cardinal_cong] Card_cardinal_eq)
  78.164  done
  78.165  
  78.166 -subsection{*Some inequalities for multiplication*}
  78.167 +subsection\<open>Some inequalities for multiplication\<close>
  78.168  
  78.169  lemma prod_square_lepoll: "A \<lesssim> A*A"
  78.170  apply (unfold lepoll_def inj_def)
  78.171 @@ -322,7 +322,7 @@
  78.172  apply (blast intro: well_ord_rmult well_ord_Memrel Card_is_Ord)
  78.173  done
  78.174  
  78.175 -subsubsection{*Multiplication by a non-zero cardinal*}
  78.176 +subsubsection\<open>Multiplication by a non-zero cardinal\<close>
  78.177  
  78.178  lemma prod_lepoll_self: "b \<in> B ==> A \<lesssim> A*B"
  78.179  apply (unfold lepoll_def inj_def)
  78.180 @@ -339,7 +339,7 @@
  78.181  apply (blast intro: prod_lepoll_self ltD)
  78.182  done
  78.183  
  78.184 -subsubsection{*Monotonicity of multiplication*}
  78.185 +subsubsection\<open>Monotonicity of multiplication\<close>
  78.186  
  78.187  lemma prod_lepoll_mono:
  78.188       "[| A \<lesssim> C;  B \<lesssim> D |] ==> A * B  \<lesssim>  C * D"
  78.189 @@ -360,7 +360,7 @@
  78.190  apply (blast intro: prod_lepoll_mono subset_imp_lepoll)
  78.191  done
  78.192  
  78.193 -subsection{*Multiplication of finite cardinals is "ordinary" multiplication*}
  78.194 +subsection\<open>Multiplication of finite cardinals is "ordinary" multiplication\<close>
  78.195  
  78.196  lemma prod_succ_eqpoll: "succ(A)*B \<approx> B + A*B"
  78.197  apply (unfold eqpoll_def)
  78.198 @@ -403,7 +403,7 @@
  78.199  by (blast intro: sum_lepoll_mono sum_lepoll_prod lepoll_trans lepoll_refl)
  78.200  
  78.201  
  78.202 -subsection{*Infinite Cardinals are Limit Ordinals*}
  78.203 +subsection\<open>Infinite Cardinals are Limit Ordinals\<close>
  78.204  
  78.205  (*This proof is modelled upon one assuming nat<=A, with injection
  78.206    \<lambda>z\<in>cons(u,A). if z=u then 0 else if z \<in> nat then succ(z) else z
  78.207 @@ -484,7 +484,7 @@
  78.208  apply (rule pred_subset)
  78.209  done
  78.210  
  78.211 -subsubsection{*Establishing the well-ordering*}
  78.212 +subsubsection\<open>Establishing the well-ordering\<close>
  78.213  
  78.214  lemma well_ord_csquare:
  78.215    assumes K: "Ord(K)" shows "well_ord(K*K, csquare_rel(K))"
  78.216 @@ -496,7 +496,7 @@
  78.217      using K by (blast intro: well_ord_rmult well_ord_Memrel)
  78.218  qed
  78.219  
  78.220 -subsubsection{*Characterising initial segments of the well-ordering*}
  78.221 +subsubsection\<open>Characterising initial segments of the well-ordering\<close>
  78.222  
  78.223  lemma csquareD:
  78.224   "[| <<x,y>, <z,z>> \<in> csquare_rel(K);  x<K;  y<K;  z<K |] ==> x \<le> z & y \<le> z"
  78.225 @@ -537,7 +537,7 @@
  78.226                       subset_Un_iff2 [THEN iff_sym] OrdmemD)
  78.227  done
  78.228  
  78.229 -subsubsection{*The cardinality of initial segments*}
  78.230 +subsubsection\<open>The cardinality of initial segments\<close>
  78.231  
  78.232  lemma ordermap_z_lt:
  78.233        "[| Limit(K);  x<K;  y<K;  z=succ(x \<union> y) |] ==>
  78.234 @@ -551,7 +551,7 @@
  78.235  apply (blast intro!: Un_upper1_le Un_upper2_le Ord_ordermap elim!: ltE)+
  78.236  done
  78.237  
  78.238 -text{*Kunen: "each @{term"\<langle>x,y\<rangle> \<in> K \<times> K"} has no more than @{term"z \<times> z"} predecessors..." (page 29) *}
  78.239 +text\<open>Kunen: "each @{term"\<langle>x,y\<rangle> \<in> K \<times> K"} has no more than @{term"z \<times> z"} predecessors..." (page 29)\<close>
  78.240  lemma ordermap_csquare_le:
  78.241    assumes K: "Limit(K)" and x: "x<K" and y: " y<K"
  78.242    defines "z \<equiv> succ(x \<union> y)"
  78.243 @@ -582,7 +582,7 @@
  78.244    finally show "ordermap(K \<times> K, csquare_rel(K)) ` \<langle>x,y\<rangle> \<lesssim> |succ(z)| \<times> |succ(z)|" .
  78.245  qed
  78.246  
  78.247 -text{*Kunen: "... so the order type is @{text"\<le>"} K" *}
  78.248 +text\<open>Kunen: "... so the order type is @{text"\<le>"} K"\<close>
  78.249  lemma ordertype_csquare_le:
  78.250    assumes IK: "InfCard(K)" and eq: "\<And>y. y\<in>K \<Longrightarrow> InfCard(y) \<Longrightarrow> y \<otimes> y = y"
  78.251    shows "ordertype(K*K, csquare_rel(K)) \<le> K"
  78.252 @@ -685,7 +685,7 @@
  78.253  lemma Inf_Card_is_InfCard: "[| Card(i); ~ Finite(i) |] ==> InfCard(i)"
  78.254  by (simp add: InfCard_def Card_is_Ord [THEN nat_le_infinite_Ord])
  78.255  
  78.256 -subsubsection{*Toward's Kunen's Corollary 10.13 (1)*}
  78.257 +subsubsection\<open>Toward's Kunen's Corollary 10.13 (1)\<close>
  78.258  
  78.259  lemma InfCard_le_cmult_eq: "[| InfCard(K);  L \<le> K;  0<L |] ==> K \<otimes> L = K"
  78.260  apply (rule le_anti_sym)
  78.261 @@ -734,9 +734,9 @@
  78.262    might be  InfCard(K) ==> |list(K)| = K.
  78.263  *)
  78.264  
  78.265 -subsection{*For Every Cardinal Number There Exists A Greater One*}
  78.266 +subsection\<open>For Every Cardinal Number There Exists A Greater One\<close>
  78.267  
  78.268 -text{*This result is Kunen's Theorem 10.16, which would be trivial using AC*}
  78.269 +text\<open>This result is Kunen's Theorem 10.16, which would be trivial using AC\<close>
  78.270  
  78.271  lemma Ord_jump_cardinal: "Ord(jump_cardinal(K))"
  78.272  apply (unfold jump_cardinal_def)
  78.273 @@ -793,7 +793,7 @@
  78.274  apply (blast intro: Card_jump_cardinal_lemma [THEN mem_irrefl])
  78.275  done
  78.276  
  78.277 -subsection{*Basic Properties of Successor Cardinals*}
  78.278 +subsection\<open>Basic Properties of Successor Cardinals\<close>
  78.279  
  78.280  lemma csucc_basic: "Ord(K) ==> Card(csucc(K)) & K < csucc(K)"
  78.281  apply (unfold csucc_def)
  78.282 @@ -834,7 +834,7 @@
  78.283                lt_csucc [THEN leI, THEN [2] le_trans])
  78.284  
  78.285  
  78.286 -subsubsection{*Removing elements from a finite set decreases its cardinality*}
  78.287 +subsubsection\<open>Removing elements from a finite set decreases its cardinality\<close>
  78.288  
  78.289  lemma Finite_imp_cardinal_cons [simp]:
  78.290    assumes FA: "Finite(A)" and a: "a\<notin>A" shows "|cons(a,A)| = succ(|A|)"
  78.291 @@ -918,7 +918,7 @@
  78.292  qed
  78.293  
  78.294  
  78.295 -subsubsection{*Theorems by Krzysztof Grabczewski, proofs by lcp*}
  78.296 +subsubsection\<open>Theorems by Krzysztof Grabczewski, proofs by lcp\<close>
  78.297  
  78.298  lemmas nat_implies_well_ord = nat_into_Ord [THEN well_ord_Memrel]
  78.299  
    79.1 --- a/src/ZF/Cardinal_AC.thy	Thu Jul 23 14:20:51 2015 +0200
    79.2 +++ b/src/ZF/Cardinal_AC.thy	Thu Jul 23 14:25:05 2015 +0200
    79.3 @@ -5,18 +5,18 @@
    79.4  These results help justify infinite-branching datatypes
    79.5  *)
    79.6  
    79.7 -section{*Cardinal Arithmetic Using AC*}
    79.8 +section\<open>Cardinal Arithmetic Using AC\<close>
    79.9  
   79.10  theory Cardinal_AC imports CardinalArith Zorn begin
   79.11  
   79.12 -subsection{*Strengthened Forms of Existing Theorems on Cardinals*}
   79.13 +subsection\<open>Strengthened Forms of Existing Theorems on Cardinals\<close>
   79.14  
   79.15  lemma cardinal_eqpoll: "|A| \<approx> A"
   79.16  apply (rule AC_well_ord [THEN exE])
   79.17  apply (erule well_ord_cardinal_eqpoll)
   79.18  done
   79.19  
   79.20 -text{*The theorem @{term "||A|| = |A|"} *}
   79.21 +text\<open>The theorem @{term "||A|| = |A|"}\<close>
   79.22  lemmas cardinal_idem = cardinal_eqpoll [THEN cardinal_cong, simp]
   79.23  
   79.24  lemma cardinal_eqE: "|X| = |Y| ==> X \<approx> Y"
   79.25 @@ -65,7 +65,7 @@
   79.26  done
   79.27  
   79.28  
   79.29 -subsection {*The relationship between cardinality and le-pollence*}
   79.30 +subsection \<open>The relationship between cardinality and le-pollence\<close>
   79.31  
   79.32  lemma Card_le_imp_lepoll:
   79.33    assumes "|A| \<le> |B|" shows "A \<lesssim> B"
   79.34 @@ -113,7 +113,7 @@
   79.35    by (blast intro: lt_Ord Card_le_imp_lepoll Ord_cardinal_le le_trans)
   79.36  
   79.37  
   79.38 -subsection{*Other Applications of AC*}
   79.39 +subsection\<open>Other Applications of AC\<close>
   79.40  
   79.41  lemma surj_implies_inj:
   79.42    assumes f: "f \<in> surj(X,Y)" shows "\<exists>g. g \<in> inj(Y,X)"
   79.43 @@ -129,7 +129,7 @@
   79.44      qed
   79.45  qed
   79.46  
   79.47 -text{*Kunen's Lemma 10.20*}
   79.48 +text\<open>Kunen's Lemma 10.20\<close>
   79.49  lemma surj_implies_cardinal_le: 
   79.50    assumes f: "f \<in> surj(X,Y)" shows "|Y| \<le> |X|"
   79.51  proof (rule lepoll_imp_Card_le)
   79.52 @@ -138,7 +138,7 @@
   79.53      by (auto simp add: lepoll_def)
   79.54  qed
   79.55  
   79.56 -text{*Kunen's Lemma 10.21*}
   79.57 +text\<open>Kunen's Lemma 10.21\<close>
   79.58  lemma cardinal_UN_le:
   79.59    assumes K: "InfCard(K)" 
   79.60    shows "(!!i. i\<in>K ==> |X(i)| \<le> K) ==> |\<Union>i\<in>K. X(i)| \<le> K"
   79.61 @@ -171,14 +171,14 @@
   79.62    finally show "(\<Union>i\<in>K. X(i)) \<lesssim> K" .
   79.63  qed
   79.64  
   79.65 -text{*The same again, using @{term csucc}*}
   79.66 +text\<open>The same again, using @{term csucc}\<close>
   79.67  lemma cardinal_UN_lt_csucc:
   79.68       "[| InfCard(K);  \<And>i. i\<in>K \<Longrightarrow> |X(i)| < csucc(K) |]
   79.69        ==> |\<Union>i\<in>K. X(i)| < csucc(K)"
   79.70  by (simp add: Card_lt_csucc_iff cardinal_UN_le InfCard_is_Card Card_cardinal)
   79.71  
   79.72 -text{*The same again, for a union of ordinals.  In use, j(i) is a bit like rank(i),
   79.73 -  the least ordinal j such that i:Vfrom(A,j). *}
   79.74 +text\<open>The same again, for a union of ordinals.  In use, j(i) is a bit like rank(i),
   79.75 +  the least ordinal j such that i:Vfrom(A,j).\<close>
   79.76  lemma cardinal_UN_Ord_lt_csucc:
   79.77       "[| InfCard(K);  \<And>i. i\<in>K \<Longrightarrow> j(i) < csucc(K) |]
   79.78        ==> (\<Union>i\<in>K. j(i)) < csucc(K)"
   79.79 @@ -189,11 +189,11 @@
   79.80  done
   79.81  
   79.82  
   79.83 -subsection{*The Main Result for Infinite-Branching Datatypes*}
   79.84 +subsection\<open>The Main Result for Infinite-Branching Datatypes\<close>
   79.85  
   79.86 -text{*As above, but the index set need not be a cardinal. Work
   79.87 +text\<open>As above, but the index set need not be a cardinal. Work
   79.88  backwards along the injection from @{term W} into @{term K}, given
   79.89 -that @{term"W\<noteq>0"}.*}
   79.90 +that @{term"W\<noteq>0"}.\<close>
   79.91  
   79.92  lemma inj_UN_subset:
   79.93    assumes f: "f \<in> inj(A,B)" and a: "a \<in> A"
   79.94 @@ -222,7 +222,7 @@
   79.95    note lt_subset_trans [OF _ _ OU, trans]
   79.96    show ?thesis
   79.97      proof (cases "W=0")
   79.98 -      case True  --{*solve the easy 0 case*}
   79.99 +      case True  --\<open>solve the easy 0 case\<close>
  79.100        thus ?thesis by (simp add: CK Card_is_Ord Card_csucc Ord_0_lt_csucc)
  79.101      next
  79.102        case False
    80.1 --- a/src/ZF/Coind/Language.thy	Thu Jul 23 14:20:51 2015 +0200
    80.2 +++ b/src/ZF/Coind/Language.thy	Thu Jul 23 14:25:05 2015 +0200
    80.3 @@ -6,7 +6,7 @@
    80.4  theory Language imports Main begin
    80.5  
    80.6  
    80.7 -text{*these really can't be definitions without losing the abstraction*}
    80.8 +text\<open>these really can't be definitions without losing the abstraction\<close>
    80.9  
   80.10  axiomatization
   80.11    Const :: i  and               (* Abstract type of constants *)
    81.1 --- a/src/ZF/Constructible/AC_in_L.thy	Thu Jul 23 14:20:51 2015 +0200
    81.2 +++ b/src/ZF/Constructible/AC_in_L.thy	Thu Jul 23 14:25:05 2015 +0200
    81.3 @@ -2,13 +2,13 @@
    81.4      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    81.5  *)
    81.6  
    81.7 -section {* The Axiom of Choice Holds in L! *}
    81.8 +section \<open>The Axiom of Choice Holds in L!\<close>
    81.9  
   81.10  theory AC_in_L imports Formula Separation begin
   81.11  
   81.12 -subsection{*Extending a Wellordering over a List -- Lexicographic Power*}
   81.13 +subsection\<open>Extending a Wellordering over a List -- Lexicographic Power\<close>
   81.14  
   81.15 -text{*This could be moved into a library.*}
   81.16 +text\<open>This could be moved into a library.\<close>
   81.17  
   81.18  consts
   81.19    rlist   :: "[i,i]=>i"
   81.20 @@ -31,13 +31,13 @@
   81.21    type_intros list.intros
   81.22  
   81.23  
   81.24 -subsubsection{*Type checking*}
   81.25 +subsubsection\<open>Type checking\<close>
   81.26  
   81.27  lemmas rlist_type = rlist.dom_subset
   81.28  
   81.29  lemmas field_rlist = rlist_type [THEN field_rel_subset]
   81.30  
   81.31 -subsubsection{*Linearity*}
   81.32 +subsubsection\<open>Linearity\<close>
   81.33  
   81.34  lemma rlist_Nil_Cons [intro]:
   81.35      "[|a \<in> A; l \<in> list(A)|] ==> <[], Cons(a,l)> \<in> rlist(A, r)"
   81.36 @@ -64,7 +64,7 @@
   81.37            done
   81.38        }
   81.39        note yConsCase = this
   81.40 -      show ?case using `ys \<in> list(A)`
   81.41 +      show ?case using \<open>ys \<in> list(A)\<close>
   81.42          by (cases rule: list.cases) (simp_all add: Cons rlist_Nil_Cons yConsCase) 
   81.43      qed
   81.44    }
   81.45 @@ -72,9 +72,9 @@
   81.46  qed
   81.47  
   81.48  
   81.49 -subsubsection{*Well-foundedness*}
   81.50 +subsubsection\<open>Well-foundedness\<close>
   81.51  
   81.52 -text{*Nothing preceeds Nil in this ordering.*}
   81.53 +text\<open>Nothing preceeds Nil in this ordering.\<close>
   81.54  inductive_cases rlist_NilE: " <l,[]> \<in> rlist(A,r)"
   81.55  
   81.56  inductive_cases rlist_ConsE: " <l', Cons(x,l)> \<in> rlist(A,r)"
   81.57 @@ -139,9 +139,9 @@
   81.58  done
   81.59  
   81.60  
   81.61 -subsection{*An Injection from Formulas into the Natural Numbers*}
   81.62 +subsection\<open>An Injection from Formulas into the Natural Numbers\<close>
   81.63  
   81.64 -text{*There is a well-known bijection between @{term "nat*nat"} and @{term
   81.65 +text\<open>There is a well-known bijection between @{term "nat*nat"} and @{term
   81.66  nat} given by the expression f(m,n) = triangle(m+n) + m, where triangle(k)
   81.67  enumerates the triangular numbers and can be defined by triangle(0)=0,
   81.68  triangle(succ(k)) = succ(k + triangle(k)).  Some small amount of effort is
   81.69 @@ -151,10 +151,10 @@
   81.70  However, this result merely states that there is a bijection between the two
   81.71  sets.  It provides no means of naming a specific bijection.  Therefore, we
   81.72  conduct the proofs under the assumption that a bijection exists.  The simplest
   81.73 -way to organize this is to use a locale.*}
   81.74 +way to organize this is to use a locale.\<close>
   81.75  
   81.76 -text{*Locale for any arbitrary injection between @{term "nat*nat"}
   81.77 -      and @{term nat}*}
   81.78 +text\<open>Locale for any arbitrary injection between @{term "nat*nat"}
   81.79 +      and @{term nat}\<close>
   81.80  locale Nat_Times_Nat =
   81.81    fixes fn
   81.82    assumes fn_inj: "fn \<in> inj(nat*nat, nat)"
   81.83 @@ -214,7 +214,7 @@
   81.84      InfCard_nat [THEN InfCard_square_eqpoll, THEN eqpoll_imp_lepoll]
   81.85  
   81.86  
   81.87 -text{*Not needed--but interesting?*}
   81.88 +text\<open>Not needed--but interesting?\<close>
   81.89  theorem formula_lepoll_nat: "formula \<lesssim> nat"
   81.90  apply (insert nat_times_nat_lepoll_nat)
   81.91  apply (unfold lepoll_def)
   81.92 @@ -222,31 +222,31 @@
   81.93  done
   81.94  
   81.95  
   81.96 -subsection{*Defining the Wellordering on @{term "DPow(A)"}*}
   81.97 +subsection\<open>Defining the Wellordering on @{term "DPow(A)"}\<close>
   81.98  
   81.99 -text{*The objective is to build a wellordering on @{term "DPow(A)"} from a
  81.100 +text\<open>The objective is to build a wellordering on @{term "DPow(A)"} from a
  81.101  given one on @{term A}.  We first introduce wellorderings for environments,
  81.102  which are lists built over @{term "A"}.  We combine it with the enumeration of
  81.103  formulas.  The order type of the resulting wellordering gives us a map from
  81.104  (environment, formula) pairs into the ordinals.  For each member of @{term
  81.105 -"DPow(A)"}, we take the minimum such ordinal.*}
  81.106 +"DPow(A)"}, we take the minimum such ordinal.\<close>
  81.107  
  81.108  definition
  81.109    env_form_r :: "[i,i,i]=>i" where
  81.110 -    --{*wellordering on (environment, formula) pairs*}
  81.111 +    --\<open>wellordering on (environment, formula) pairs\<close>
  81.112     "env_form_r(f,r,A) ==
  81.113        rmult(list(A), rlist(A, r),
  81.114              formula, measure(formula, enum(f)))"
  81.115  
  81.116  definition
  81.117    env_form_map :: "[i,i,i,i]=>i" where
  81.118 -    --{*map from (environment, formula) pairs to ordinals*}
  81.119 +    --\<open>map from (environment, formula) pairs to ordinals\<close>
  81.120     "env_form_map(f,r,A,z)
  81.121        == ordermap(list(A) * formula, env_form_r(f,r,A)) ` z"
  81.122  
  81.123  definition
  81.124    DPow_ord :: "[i,i,i,i,i]=>o" where
  81.125 -    --{*predicate that holds if @{term k} is a valid index for @{term X}*}
  81.126 +    --\<open>predicate that holds if @{term k} is a valid index for @{term X}\<close>
  81.127     "DPow_ord(f,r,A,X,k) ==
  81.128             \<exists>env \<in> list(A). \<exists>p \<in> formula.
  81.129               arity(p) \<le> succ(length(env)) &
  81.130 @@ -255,12 +255,12 @@
  81.131  
  81.132  definition
  81.133    DPow_least :: "[i,i,i,i]=>i" where
  81.134 -    --{*function yielding the smallest index for @{term X}*}
  81.135 +    --\<open>function yielding the smallest index for @{term X}\<close>
  81.136     "DPow_least(f,r,A,X) == \<mu> k. DPow_ord(f,r,A,X,k)"
  81.137  
  81.138  definition
  81.139    DPow_r :: "[i,i,i]=>i" where
  81.140 -    --{*a wellordering on @{term "DPow(A)"}*}
  81.141 +    --\<open>a wellordering on @{term "DPow(A)"}\<close>
  81.142     "DPow_r(f,r,A) == measure(DPow(A), DPow_least(f,r,A))"
  81.143  
  81.144  
  81.145 @@ -324,16 +324,16 @@
  81.146  by (simp add: DPow_r_def measure_def, blast)
  81.147  
  81.148  
  81.149 -subsection{*Limit Construction for Well-Orderings*}
  81.150 +subsection\<open>Limit Construction for Well-Orderings\<close>
  81.151  
  81.152 -text{*Now we work towards the transfinite definition of wellorderings for
  81.153 +text\<open>Now we work towards the transfinite definition of wellorderings for
  81.154  @{term "Lset(i)"}.  We assume as an inductive hypothesis that there is a family
  81.155 -of wellorderings for smaller ordinals.*}
  81.156 +of wellorderings for smaller ordinals.\<close>
  81.157  
  81.158  definition
  81.159    rlimit :: "[i,i=>i]=>i" where
  81.160 -  --{*Expresses the wellordering at limit ordinals.  The conditional
  81.161 -      lets us remove the premise @{term "Limit(i)"} from some theorems.*}
  81.162 +  --\<open>Expresses the wellordering at limit ordinals.  The conditional
  81.163 +      lets us remove the premise @{term "Limit(i)"} from some theorems.\<close>
  81.164      "rlimit(i,r) ==
  81.165         if Limit(i) then 
  81.166           {z: Lset(i) * Lset(i).
  81.167 @@ -344,8 +344,8 @@
  81.168  
  81.169  definition
  81.170    Lset_new :: "i=>i" where
  81.171 -  --{*This constant denotes the set of elements introduced at level
  81.172 -      @{term "succ(i)"}*}
  81.173 +  --\<open>This constant denotes the set of elements introduced at level
  81.174 +      @{term "succ(i)"}\<close>
  81.175      "Lset_new(i) == {x \<in> Lset(succ(i)). lrank(x) = i}"
  81.176  
  81.177  lemma Limit_Lset_eq2:
  81.178 @@ -412,7 +412,7 @@
  81.179  done
  81.180  
  81.181  
  81.182 -subsection{*Transfinite Definition of the Wellordering on @{term "L"}*}
  81.183 +subsection\<open>Transfinite Definition of the Wellordering on @{term "L"}\<close>
  81.184  
  81.185  definition
  81.186    L_r :: "[i, i] => i" where
  81.187 @@ -420,15 +420,15 @@
  81.188        transrec3(i, 0, \<lambda>x r. DPow_r(f, r, Lset(x)), 
  81.189                  \<lambda>x r. rlimit(x, \<lambda>y. r`y))"
  81.190  
  81.191 -subsubsection{*The Corresponding Recursion Equations*}
  81.192 +subsubsection\<open>The Corresponding Recursion Equations\<close>
  81.193  lemma [simp]: "L_r(f,0) = 0"
  81.194  by (simp add: L_r_def)
  81.195  
  81.196  lemma [simp]: "L_r(f, succ(i)) = DPow_r(f, L_r(f,i), Lset(i))"
  81.197  by (simp add: L_r_def)
  81.198  
  81.199 -text{*The limit case is non-trivial because of the distinction between
  81.200 -object-level and meta-level abstraction.*}
  81.201 +text\<open>The limit case is non-trivial because of the distinction between
  81.202 +object-level and meta-level abstraction.\<close>
  81.203  lemma [simp]: "Limit(i) ==> L_r(f,i) = rlimit(i, L_r(f))"
  81.204  by (simp cong: rlimit_cong add: transrec3_Limit L_r_def ltD)
  81.205  
  81.206 @@ -454,8 +454,8 @@
  81.207  done
  81.208  
  81.209  
  81.210 -text{*Every constructible set is well-ordered! Therefore the Wellordering Theorem and
  81.211 -      the Axiom of Choice hold in @{term L}!!*}
  81.212 +text\<open>Every constructible set is well-ordered! Therefore the Wellordering Theorem and
  81.213 +      the Axiom of Choice hold in @{term L}!!\<close>
  81.214  theorem L_implies_AC: assumes x: "L(x)" shows "\<exists>r. well_ord(x,r)"
  81.215    using Transset_Lset x
  81.216  apply (simp add: Transset_def L_def)
  81.217 @@ -474,8 +474,8 @@
  81.218      by (blast intro: well_ord_imp_relativized)
  81.219  qed
  81.220  
  81.221 -text{*In order to prove @{term" \<exists>r[L]. wellordered(L,x,r)"}, it's necessary to know 
  81.222 +text\<open>In order to prove @{term" \<exists>r[L]. wellordered(L,x,r)"}, it's necessary to know 
  81.223  that @{term r} is actually constructible. It follows from the assumption ``@{term V} equals @{term L''}, 
  81.224 -but this reasoning doesn't appear to work in Isabelle.*}
  81.225 +but this reasoning doesn't appear to work in Isabelle.\<close>
  81.226  
  81.227  end
    82.1 --- a/src/ZF/Constructible/DPow_absolute.thy	Thu Jul 23 14:20:51 2015 +0200
    82.2 +++ b/src/ZF/Constructible/DPow_absolute.thy	Thu Jul 23 14:25:05 2015 +0200
    82.3 @@ -2,18 +2,18 @@
    82.4      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    82.5  *)
    82.6  
    82.7 -section {*Absoluteness for the Definable Powerset Function*}
    82.8 +section \<open>Absoluteness for the Definable Powerset Function\<close>
    82.9  
   82.10  
   82.11  theory DPow_absolute imports Satisfies_absolute begin
   82.12  
   82.13  
   82.14 -subsection{*Preliminary Internalizations*}
   82.15 +subsection\<open>Preliminary Internalizations\<close>
   82.16  
   82.17 -subsubsection{*The Operator @{term is_formula_rec}*}
   82.18 +subsubsection\<open>The Operator @{term is_formula_rec}\<close>
   82.19  
   82.20 -text{*The three arguments of @{term p} are always 2, 1, 0.  It is buried
   82.21 -   within 11 quantifiers!!*}
   82.22 +text\<open>The three arguments of @{term p} are always 2, 1, 0.  It is buried
   82.23 +   within 11 quantifiers!!\<close>
   82.24  
   82.25  (* is_formula_rec :: "[i=>o, [i,i,i]=>o, i, i] => o"
   82.26     "is_formula_rec(M,MH,p,z)  ==
   82.27 @@ -77,7 +77,7 @@
   82.28  done
   82.29  
   82.30  
   82.31 -subsubsection{*The Operator @{term is_satisfies}*}
   82.32 +subsubsection\<open>The Operator @{term is_satisfies}\<close>
   82.33  
   82.34  (* is_satisfies(M,A,p,z) == is_formula_rec (M, satisfies_MH(M,A), p, z) *)
   82.35  definition
   82.36 @@ -109,7 +109,7 @@
   82.37  done
   82.38  
   82.39  
   82.40 -subsection {*Relativization of the Operator @{term DPow'}*}
   82.41 +subsection \<open>Relativization of the Operator @{term DPow'}\<close>
   82.42  
   82.43  lemma DPow'_eq: 
   82.44    "DPow'(A) = {z . ep \<in> list(A) * formula, 
   82.45 @@ -118,8 +118,8 @@
   82.46  by (simp add: DPow'_def, blast) 
   82.47  
   82.48  
   82.49 -text{*Relativize the use of @{term sats} within @{term DPow'}
   82.50 -(the comprehension).*}
   82.51 +text\<open>Relativize the use of @{term sats} within @{term DPow'}
   82.52 +(the comprehension).\<close>
   82.53  definition
   82.54    is_DPow_sats :: "[i=>o,i,i,i,i] => o" where
   82.55     "is_DPow_sats(M,A,env,p,x) ==
   82.56 @@ -142,7 +142,7 @@
   82.57  by (simp add: DPow_sats_abs transM [of _ A])
   82.58  
   82.59  
   82.60 -subsubsection{*The Operator @{term is_DPow_sats}, Internalized*}
   82.61 +subsubsection\<open>The Operator @{term is_DPow_sats}, Internalized\<close>
   82.62  
   82.63  (* is_DPow_sats(M,A,env,p,x) ==
   82.64        \<forall>n1[M]. \<forall>e[M]. \<forall>sp[M]. 
   82.65 @@ -184,7 +184,7 @@
   82.66  done
   82.67  
   82.68  
   82.69 -subsection{*A Locale for Relativizing the Operator @{term DPow'}*}
   82.70 +subsection\<open>A Locale for Relativizing the Operator @{term DPow'}\<close>
   82.71  
   82.72  locale M_DPow = M_satisfies +
   82.73   assumes sep:
   82.74 @@ -219,7 +219,7 @@
   82.75  apply (fast intro: rep' sep' univalent_pair_eq)  
   82.76  done
   82.77  
   82.78 -text{*Relativization of the Operator @{term DPow'}*}
   82.79 +text\<open>Relativization of the Operator @{term DPow'}\<close>
   82.80  definition 
   82.81    is_DPow' :: "[i=>o,i,i] => o" where
   82.82      "is_DPow'(M,A,Z) == 
   82.83 @@ -238,9 +238,9 @@
   82.84  done
   82.85  
   82.86  
   82.87 -subsection{*Instantiating the Locale @{text M_DPow}*}
   82.88 +subsection\<open>Instantiating the Locale @{text M_DPow}\<close>
   82.89  
   82.90 -subsubsection{*The Instance of Separation*}
   82.91 +subsubsection\<open>The Instance of Separation\<close>
   82.92  
   82.93  lemma DPow_separation:
   82.94      "[| L(A); env \<in> list(A); p \<in> formula |]
   82.95 @@ -253,7 +253,7 @@
   82.96  
   82.97  
   82.98  
   82.99 -subsubsection{*The Instance of Replacement*}
  82.100 +subsubsection\<open>The Instance of Replacement\<close>
  82.101  
  82.102  lemma DPow_replacement_Reflects:
  82.103   "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B &
  82.104 @@ -287,7 +287,7 @@
  82.105  done
  82.106  
  82.107  
  82.108 -subsubsection{*Actually Instantiating the Locale*}
  82.109 +subsubsection\<open>Actually Instantiating the Locale\<close>
  82.110  
  82.111  lemma M_DPow_axioms_L: "M_DPow_axioms(L)"
  82.112    apply (rule M_DPow_axioms.intro)
  82.113 @@ -304,10 +304,10 @@
  82.114    and DPow'_abs [intro, simp] = M_DPow.DPow'_abs [OF M_DPow_L]
  82.115  
  82.116  
  82.117 -subsubsection{*The Operator @{term is_Collect}*}
  82.118 +subsubsection\<open>The Operator @{term is_Collect}\<close>
  82.119  
  82.120 -text{*The formula @{term is_P} has one free variable, 0, and it is
  82.121 -enclosed within a single quantifier.*}
  82.122 +text\<open>The formula @{term is_P} has one free variable, 0, and it is
  82.123 +enclosed within a single quantifier.\<close>
  82.124  
  82.125  (* is_Collect :: "[i=>o,i,i=>o,i] => o"
  82.126      "is_Collect(M,A,P,z) == \<forall>x[M]. x \<in> z \<longleftrightarrow> x \<in> A & P(x)" *)
  82.127 @@ -342,8 +342,8 @@
  82.128  by (simp add: sats_Collect_fm [OF is_P_iff_sats])
  82.129  
  82.130  
  82.131 -text{*The second argument of @{term is_P} gives it direct access to @{term x},
  82.132 -  which is essential for handling free variable references.*}
  82.133 +text\<open>The second argument of @{term is_P} gives it direct access to @{term x},
  82.134 +  which is essential for handling free variable references.\<close>
  82.135  theorem Collect_reflection:
  82.136    assumes is_P_reflection:
  82.137      "!!h f g. REFLECTS[\<lambda>x. is_P(L, f(x), g(x)),
  82.138 @@ -355,10 +355,10 @@
  82.139  done
  82.140  
  82.141  
  82.142 -subsubsection{*The Operator @{term is_Replace}*}
  82.143 +subsubsection\<open>The Operator @{term is_Replace}\<close>
  82.144  
  82.145 -text{*BEWARE!  The formula @{term is_P} has free variables 0, 1
  82.146 - and not the usual 1, 0!  It is enclosed within two quantifiers.*}
  82.147 +text\<open>BEWARE!  The formula @{term is_P} has free variables 0, 1
  82.148 + and not the usual 1, 0!  It is enclosed within two quantifiers.\<close>
  82.149  
  82.150  (*  is_Replace :: "[i=>o,i,[i,i]=>o,i] => o"
  82.151      "is_Replace(M,A,P,z) == \<forall>u[M]. u \<in> z \<longleftrightarrow> (\<exists>x[M]. x\<in>A & P(x,u))" *)
  82.152 @@ -395,8 +395,8 @@
  82.153  by (simp add: sats_Replace_fm [OF is_P_iff_sats])
  82.154  
  82.155  
  82.156 -text{*The second argument of @{term is_P} gives it direct access to @{term x},
  82.157 -  which is essential for handling free variable references.*}
  82.158 +text\<open>The second argument of @{term is_P} gives it direct access to @{term x},
  82.159 +  which is essential for handling free variable references.\<close>
  82.160  theorem Replace_reflection:
  82.161    assumes is_P_reflection:
  82.162      "!!h f g. REFLECTS[\<lambda>x. is_P(L, f(x), g(x), h(x)),
  82.163 @@ -409,7 +409,7 @@
  82.164  
  82.165  
  82.166  
  82.167 -subsubsection{*The Operator @{term is_DPow'}, Internalized*}
  82.168 +subsubsection\<open>The Operator @{term is_DPow'}, Internalized\<close>
  82.169  
  82.170  (*  "is_DPow'(M,A,Z) == 
  82.171         \<forall>X[M]. X \<in> Z \<longleftrightarrow> 
  82.172 @@ -454,7 +454,7 @@
  82.173  done
  82.174  
  82.175  
  82.176 -subsection{*A Locale for Relativizing the Operator @{term Lset}*}
  82.177 +subsection\<open>A Locale for Relativizing the Operator @{term Lset}\<close>
  82.178  
  82.179  definition
  82.180    transrec_body :: "[i=>o,i,i,i,i] => o" where
  82.181 @@ -506,13 +506,13 @@
  82.182  done
  82.183  
  82.184  
  82.185 -text{*Relativization of the Operator @{term Lset}*}
  82.186 +text\<open>Relativization of the Operator @{term Lset}\<close>
  82.187  
  82.188  definition
  82.189    is_Lset :: "[i=>o, i, i] => o" where
  82.190 -   --{*We can use the term language below because @{term is_Lset} will
  82.191 +   --\<open>We can use the term language below because @{term is_Lset} will
  82.192         not have to be internalized: it isn't used in any instance of
  82.193 -       separation.*}
  82.194 +       separation.\<close>
  82.195     "is_Lset(M,a,z) == is_transrec(M, %x f u. u = (\<Union>y\<in>x. DPow'(f`y)), a, z)"
  82.196  
  82.197  lemma (in M_Lset) Lset_abs:
  82.198 @@ -531,9 +531,9 @@
  82.199  done
  82.200  
  82.201  
  82.202 -subsection{*Instantiating the Locale @{text M_Lset}*}
  82.203 +subsection\<open>Instantiating the Locale @{text M_Lset}\<close>
  82.204  
  82.205 -subsubsection{*The First Instance of Replacement*}
  82.206 +subsubsection\<open>The First Instance of Replacement\<close>
  82.207  
  82.208  lemma strong_rep_Reflects:
  82.209   "REFLECTS [\<lambda>u. \<exists>v[L]. v \<in> B & (\<exists>gy[L].
  82.210 @@ -553,7 +553,7 @@
  82.211  done
  82.212  
  82.213  
  82.214 -subsubsection{*The Second Instance of Replacement*}
  82.215 +subsubsection\<open>The Second Instance of Replacement\<close>
  82.216  
  82.217  lemma transrec_rep_Reflects:
  82.218   "REFLECTS [\<lambda>x. \<exists>v[L]. v \<in> B &
  82.219 @@ -570,8 +570,8 @@
  82.220                        is_DPow'(##Lset(i),gy,z), r) & 
  82.221                        big_union(##Lset(i),r,u), mr, v, y))]" 
  82.222  apply (simp only: rex_setclass_is_bex [symmetric])
  82.223 -  --{*Convert @{text "\<exists>y\<in>Lset(i)"} to @{text "\<exists>y[##Lset(i)]"} within the body
  82.224 -       of the @{term is_wfrec} application. *}
  82.225 +  --\<open>Convert @{text "\<exists>y\<in>Lset(i)"} to @{text "\<exists>y[##Lset(i)]"} within the body
  82.226 +       of the @{term is_wfrec} application.\<close>
  82.227  apply (intro FOL_reflections function_reflections 
  82.228            is_wfrec_reflection Replace_reflection DPow'_reflection) 
  82.229  done
  82.230 @@ -593,7 +593,7 @@
  82.231  done
  82.232  
  82.233  
  82.234 -subsubsection{*Actually Instantiating @{text M_Lset}*}
  82.235 +subsubsection\<open>Actually Instantiating @{text M_Lset}\<close>
  82.236  
  82.237  lemma M_Lset_axioms_L: "M_Lset_axioms(L)"
  82.238    apply (rule M_Lset_axioms.intro)
  82.239 @@ -606,12 +606,12 @@
  82.240    apply (rule M_Lset_axioms_L) 
  82.241    done
  82.242  
  82.243 -text{*Finally: the point of the whole theory!*}
  82.244 +text\<open>Finally: the point of the whole theory!\<close>
  82.245  lemmas Lset_closed = M_Lset.Lset_closed [OF M_Lset_L]
  82.246     and Lset_abs = M_Lset.Lset_abs [OF M_Lset_L]
  82.247  
  82.248  
  82.249 -subsection{*The Notion of Constructible Set*}
  82.250 +subsection\<open>The Notion of Constructible Set\<close>
  82.251  
  82.252  definition
  82.253    constructible :: "[i=>o,i] => o" where
    83.1 --- a/src/ZF/Constructible/Datatype_absolute.thy	Thu Jul 23 14:20:51 2015 +0200
    83.2 +++ b/src/ZF/Constructible/Datatype_absolute.thy	Thu Jul 23 14:25:05 2015 +0200
    83.3 @@ -2,12 +2,12 @@
    83.4      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    83.5  *)
    83.6  
    83.7 -section {*Absoluteness Properties for Recursive Datatypes*}
    83.8 +section \<open>Absoluteness Properties for Recursive Datatypes\<close>
    83.9  
   83.10  theory Datatype_absolute imports Formula WF_absolute begin
   83.11  
   83.12  
   83.13 -subsection{*The lfp of a continuous function can be expressed as a union*}
   83.14 +subsection\<open>The lfp of a continuous function can be expressed as a union\<close>
   83.15  
   83.16  definition
   83.17    directed :: "i=>o" where
   83.18 @@ -78,7 +78,7 @@
   83.19            intro: lfp_subset_Union Union_subset_lfp)
   83.20  
   83.21  
   83.22 -subsubsection{*Some Standard Datatype Constructions Preserve Continuity*}
   83.23 +subsubsection\<open>Some Standard Datatype Constructions Preserve Continuity\<close>
   83.24  
   83.25  lemma contin_imp_mono: "[|X\<subseteq>Y; contin(F)|] ==> F(X) \<subseteq> F(Y)"
   83.26  apply (simp add: contin_def) 
   83.27 @@ -111,7 +111,7 @@
   83.28  
   83.29  
   83.30  
   83.31 -subsection {*Absoluteness for "Iterates"*}
   83.32 +subsection \<open>Absoluteness for "Iterates"\<close>
   83.33  
   83.34  definition
   83.35    iterates_MH :: "[i=>o, [i,i]=>o, i, i, i, i] => o" where
   83.36 @@ -169,7 +169,7 @@
   83.37  done
   83.38  
   83.39  
   83.40 -subsection {*lists without univ*}
   83.41 +subsection \<open>lists without univ\<close>
   83.42  
   83.43  lemmas datatype_univs = Inl_in_univ Inr_in_univ 
   83.44                          Pair_in_univ nat_into_univ A_into_univ 
   83.45 @@ -184,7 +184,7 @@
   83.46  lemma list_fun_contin: "contin(\<lambda>X. {0} + A*X)"
   83.47  by (intro sum_contin prod_contin id_contin const_contin) 
   83.48  
   83.49 -text{*Re-expresses lists using sum and product*}
   83.50 +text\<open>Re-expresses lists using sum and product\<close>
   83.51  lemma list_eq_lfp2: "list(A) = lfp(univ(A), \<lambda>X. {0} + A*X)"
   83.52  apply (simp add: list_def) 
   83.53  apply (rule equalityI) 
   83.54 @@ -193,7 +193,7 @@
   83.55   apply (clarify, subst lfp_unfold [OF list_fun_bnd_mono])
   83.56   apply (simp add: Nil_def Cons_def)
   83.57   apply blast 
   83.58 -txt{*Opposite inclusion*}
   83.59 +txt\<open>Opposite inclusion\<close>
   83.60  apply (rule lfp_lowerbound) 
   83.61   prefer 2 apply (rule lfp_subset) 
   83.62  apply (clarify, subst lfp_unfold [OF list.bnd_mono]) 
   83.63 @@ -202,7 +202,7 @@
   83.64               dest: lfp_subset [THEN subsetD])
   83.65  done
   83.66  
   83.67 -text{*Re-expresses lists using "iterates", no univ.*}
   83.68 +text\<open>Re-expresses lists using "iterates", no univ.\<close>
   83.69  lemma list_eq_Union:
   83.70       "list(A) = (\<Union>n\<in>nat. (\<lambda>X. {0} + A*X) ^ n (0))"
   83.71  by (simp add: list_eq_lfp2 lfp_eq_Union list_fun_bnd_mono list_fun_contin)
   83.72 @@ -219,7 +219,7 @@
   83.73  by (simp add: is_list_functor_def singleton_0 nat_into_M)
   83.74  
   83.75  
   83.76 -subsection {*formulas without univ*}
   83.77 +subsection \<open>formulas without univ\<close>
   83.78  
   83.79  lemma formula_fun_bnd_mono:
   83.80       "bnd_mono(univ(0), \<lambda>X. ((nat*nat) + (nat*nat)) + (X*X + X))"
   83.81 @@ -234,7 +234,7 @@
   83.82  by (intro sum_contin prod_contin id_contin const_contin) 
   83.83  
   83.84  
   83.85 -text{*Re-expresses formulas using sum and product*}
   83.86 +text\<open>Re-expresses formulas using sum and product\<close>
   83.87  lemma formula_eq_lfp2:
   83.88      "formula = lfp(univ(0), \<lambda>X. ((nat*nat) + (nat*nat)) + (X*X + X))"
   83.89  apply (simp add: formula_def) 
   83.90 @@ -244,7 +244,7 @@
   83.91   apply (clarify, subst lfp_unfold [OF formula_fun_bnd_mono])
   83.92   apply (simp add: Member_def Equal_def Nand_def Forall_def)
   83.93   apply blast 
   83.94 -txt{*Opposite inclusion*}
   83.95 +txt\<open>Opposite inclusion\<close>
   83.96  apply (rule lfp_lowerbound) 
   83.97   prefer 2 apply (rule lfp_subset, clarify) 
   83.98  apply (subst lfp_unfold [OF formula.bnd_mono, simplified]) 
   83.99 @@ -253,7 +253,7 @@
  83.100  apply (blast intro: datatype_univs dest: lfp_subset [THEN subsetD])+  
  83.101  done
  83.102  
  83.103 -text{*Re-expresses formulas using "iterates", no univ.*}
  83.104 +text\<open>Re-expresses formulas using "iterates", no univ.\<close>
  83.105  lemma formula_eq_Union:
  83.106       "formula = 
  83.107        (\<Union>n\<in>nat. (\<lambda>X. ((nat*nat) + (nat*nat)) + (X*X + X)) ^ n (0))"
  83.108 @@ -277,7 +277,7 @@
  83.109  by (simp add: is_formula_functor_def) 
  83.110  
  83.111  
  83.112 -subsection{*@{term M} Contains the List and Formula Datatypes*}
  83.113 +subsection\<open>@{term M} Contains the List and Formula Datatypes\<close>
  83.114  
  83.115  definition
  83.116    list_N :: "[i,i] => i" where
  83.117 @@ -290,8 +290,8 @@
  83.118       "Cons(a,l) \<in> list_N(A,succ(n)) \<longleftrightarrow> a\<in>A & l \<in> list_N(A,n)"
  83.119  by (simp add: list_N_def Cons_def) 
  83.120  
  83.121 -text{*These two aren't simprules because they reveal the underlying
  83.122 -list representation.*}
  83.123 +text\<open>These two aren't simprules because they reveal the underlying
  83.124 +list representation.\<close>
  83.125  lemma list_N_0: "list_N(A,0) = 0"
  83.126  by (simp add: list_N_def)
  83.127  
  83.128 @@ -325,8 +325,8 @@
  83.129  apply (blast intro: list_imp_list_N) 
  83.130  done
  83.131    
  83.132 -text{*Express @{term list_rec} without using @{term rank} or @{term Vset},
  83.133 -neither of which is absolute.*}
  83.134 +text\<open>Express @{term list_rec} without using @{term rank} or @{term Vset},
  83.135 +neither of which is absolute.\<close>
  83.136  lemma (in M_trivial) list_rec_eq:
  83.137    "l \<in> list(A) ==>
  83.138     list_rec(a,g,l) = 
  83.139 @@ -356,7 +356,7 @@
  83.140    is_list :: "[i=>o,i,i] => o" where
  83.141      "is_list(M,A,Z) == \<forall>l[M]. l \<in> Z \<longleftrightarrow> mem_list(M,A,l)"
  83.142  
  83.143 -subsubsection{*Towards Absoluteness of @{term formula_rec}*}
  83.144 +subsubsection\<open>Towards Absoluteness of @{term formula_rec}\<close>
  83.145  
  83.146  consts   depth :: "i=>i"
  83.147  primrec
  83.148 @@ -389,8 +389,8 @@
  83.149       "Forall(x) \<in> formula_N(succ(n)) \<longleftrightarrow> x \<in> formula_N(n)"
  83.150  by (simp add: formula_N_def Forall_def) 
  83.151  
  83.152 -text{*These two aren't simprules because they reveal the underlying
  83.153 -formula representation.*}
  83.154 +text\<open>These two aren't simprules because they reveal the underlying
  83.155 +formula representation.\<close>
  83.156  lemma formula_N_0: "formula_N(0) = 0"
  83.157  by (simp add: formula_N_def)
  83.158  
  83.159 @@ -430,7 +430,7 @@
  83.160  done
  83.161  
  83.162  
  83.163 -text{*This result and the next are unused.*}
  83.164 +text\<open>This result and the next are unused.\<close>
  83.165  lemma formula_N_mono [rule_format]:
  83.166    "[| m \<in> nat; n \<in> nat |] ==> m\<le>n \<longrightarrow> formula_N(m) \<subseteq> formula_N(n)"
  83.167  apply (rule_tac m = m and n = n in diff_induct)
  83.168 @@ -476,7 +476,7 @@
  83.169     "M(l) ==> iterates_replacement(M, %l t. is_tl(M,l,t), l)"
  83.170  
  83.171  
  83.172 -subsubsection{*Absoluteness of the List Construction*}
  83.173 +subsubsection\<open>Absoluteness of the List Construction\<close>
  83.174  
  83.175  lemma (in M_datatypes) list_replacement2':
  83.176    "M(A) ==> strong_replacement(M, \<lambda>n y. n\<in>nat & y = (\<lambda>X. {0} + A * X)^n (0))"
  83.177 @@ -493,7 +493,7 @@
  83.178                 list_replacement2' relation1_def
  83.179                 iterates_closed [of "is_list_functor(M,A)"])
  83.180  
  83.181 -text{*WARNING: use only with @{text "dest:"} or with variables fixed!*}
  83.182 +text\<open>WARNING: use only with @{text "dest:"} or with variables fixed!\<close>
  83.183  lemmas (in M_datatypes) list_into_M = transM [OF _ list_closed]
  83.184  
  83.185  lemma (in M_datatypes) list_N_abs [simp]:
  83.186 @@ -524,7 +524,7 @@
  83.187  apply (rule M_equalityI, simp_all)
  83.188  done
  83.189  
  83.190 -subsubsection{*Absoluteness of Formulas*}
  83.191 +subsubsection\<open>Absoluteness of Formulas\<close>
  83.192  
  83.193  lemma (in M_datatypes) formula_replacement2':
  83.194    "strong_replacement(M, \<lambda>n y. n\<in>nat & y = (\<lambda>X. ((nat*nat) + (nat*nat)) + (X*X + X))^n (0))"
  83.195 @@ -574,9 +574,9 @@
  83.196  done
  83.197  
  83.198  
  83.199 -subsection{*Absoluteness for @{text \<epsilon>}-Closure: the @{term eclose} Operator*}
  83.200 +subsection\<open>Absoluteness for @{text \<epsilon>}-Closure: the @{term eclose} Operator\<close>
  83.201  
  83.202 -text{*Re-expresses eclose using "iterates"*}
  83.203 +text\<open>Re-expresses eclose using "iterates"\<close>
  83.204  lemma eclose_eq_Union:
  83.205       "eclose(A) = (\<Union>n\<in>nat. Union^n (A))"
  83.206  apply (simp add: eclose_def)
  83.207 @@ -645,9 +645,9 @@
  83.208  done
  83.209  
  83.210  
  83.211 -subsection {*Absoluteness for @{term transrec}*}
  83.212 +subsection \<open>Absoluteness for @{term transrec}\<close>
  83.213  
  83.214 -text{* @{prop "transrec(a,H) \<equiv> wfrec(Memrel(eclose({a})), a, H)"} *}
  83.215 +text\<open>@{prop "transrec(a,H) \<equiv> wfrec(Memrel(eclose({a})), a, H)"}\<close>
  83.216  
  83.217  definition
  83.218    is_transrec :: "[i=>o, [i,i,i]=>o, i, i] => o" where
  83.219 @@ -663,9 +663,9 @@
  83.220         upair(M,a,a,sa) & is_eclose(M,sa,esa) & membership(M,esa,mesa) &
  83.221         wfrec_replacement(M,MH,mesa)"
  83.222  
  83.223 -text{*The condition @{term "Ord(i)"} lets us use the simpler
  83.224 +text\<open>The condition @{term "Ord(i)"} lets us use the simpler
  83.225    @{text "trans_wfrec_abs"} rather than @{text "trans_wfrec_abs"},
  83.226 -  which I haven't even proved yet. *}
  83.227 +  which I haven't even proved yet.\<close>
  83.228  theorem (in M_eclose) transrec_abs:
  83.229    "[|transrec_replacement(M,MH,i);  relation2(M,MH,H);
  83.230       Ord(i);  M(i);  M(z);
  83.231 @@ -684,7 +684,7 @@
  83.232          transrec_def eclose_sing_Ord_eq wf_Memrel trans_Memrel relation_Memrel)
  83.233  
  83.234  
  83.235 -text{*Helps to prove instances of @{term transrec_replacement}*}
  83.236 +text\<open>Helps to prove instances of @{term transrec_replacement}\<close>
  83.237  lemma (in M_eclose) transrec_replacementI:
  83.238     "[|M(a);
  83.239        strong_replacement (M,
  83.240 @@ -694,8 +694,8 @@
  83.241  by (simp add: transrec_replacement_def wfrec_replacement_def)
  83.242  
  83.243  
  83.244 -subsection{*Absoluteness for the List Operator @{term length}*}
  83.245 -text{*But it is never used.*}
  83.246 +subsection\<open>Absoluteness for the List Operator @{term length}\<close>
  83.247 +text\<open>But it is never used.\<close>
  83.248  
  83.249  definition
  83.250    is_length :: "[i=>o,i,i,i] => o" where
  83.251 @@ -714,13 +714,13 @@
  83.252               dest: list_N_imp_length_lt)
  83.253  done
  83.254  
  83.255 -text{*Proof is trivial since @{term length} returns natural numbers.*}
  83.256 +text\<open>Proof is trivial since @{term length} returns natural numbers.\<close>
  83.257  lemma (in M_trivial) length_closed [intro,simp]:
  83.258       "l \<in> list(A) ==> M(length(l))"
  83.259  by (simp add: nat_into_M)
  83.260  
  83.261  
  83.262 -subsection {*Absoluteness for the List Operator @{term nth}*}
  83.263 +subsection \<open>Absoluteness for the List Operator @{term nth}\<close>
  83.264  
  83.265  lemma nth_eq_hd_iterates_tl [rule_format]:
  83.266       "xs \<in> list(A) ==> \<forall>n \<in> nat. nth(n,xs) = hd' (tl'^n (xs))"
  83.267 @@ -737,7 +737,7 @@
  83.268  apply (simp add: tl'_Cons tl'_closed)
  83.269  done
  83.270  
  83.271 -text{*Immediate by type-checking*}
  83.272 +text\<open>Immediate by type-checking\<close>
  83.273  lemma (in M_datatypes) nth_closed [intro,simp]:
  83.274       "[|xs \<in> list(A); n \<in> nat; M(A)|] ==> M(nth(n,xs))"
  83.275  apply (case_tac "n < length(xs)")
  83.276 @@ -761,11 +761,11 @@
  83.277  done
  83.278  
  83.279  
  83.280 -subsection{*Relativization and Absoluteness for the @{term formula} Constructors*}
  83.281 +subsection\<open>Relativization and Absoluteness for the @{term formula} Constructors\<close>
  83.282  
  83.283  definition
  83.284    is_Member :: "[i=>o,i,i,i] => o" where
  83.285 -     --{* because @{term "Member(x,y) \<equiv> Inl(Inl(\<langle>x,y\<rangle>))"}*}
  83.286 +     --\<open>because @{term "Member(x,y) \<equiv> Inl(Inl(\<langle>x,y\<rangle>))"}\<close>
  83.287      "is_Member(M,x,y,Z) ==
  83.288          \<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inl(M,u,Z)"
  83.289  
  83.290 @@ -779,7 +779,7 @@
  83.291  
  83.292  definition
  83.293    is_Equal :: "[i=>o,i,i,i] => o" where
  83.294 -     --{* because @{term "Equal(x,y) \<equiv> Inl(Inr(\<langle>x,y\<rangle>))"}*}
  83.295 +     --\<open>because @{term "Equal(x,y) \<equiv> Inl(Inr(\<langle>x,y\<rangle>))"}\<close>
  83.296      "is_Equal(M,x,y,Z) ==
  83.297          \<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inr(M,p,u) & is_Inl(M,u,Z)"
  83.298  
  83.299 @@ -792,7 +792,7 @@
  83.300  
  83.301  definition
  83.302    is_Nand :: "[i=>o,i,i,i] => o" where
  83.303 -     --{* because @{term "Nand(x,y) \<equiv> Inr(Inl(\<langle>x,y\<rangle>))"}*}
  83.304 +     --\<open>because @{term "Nand(x,y) \<equiv> Inr(Inl(\<langle>x,y\<rangle>))"}\<close>
  83.305      "is_Nand(M,x,y,Z) ==
  83.306          \<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inr(M,u,Z)"
  83.307  
  83.308 @@ -805,7 +805,7 @@
  83.309  
  83.310  definition
  83.311    is_Forall :: "[i=>o,i,i] => o" where
  83.312 -     --{* because @{term "Forall(x) \<equiv> Inr(Inr(p))"}*}
  83.313 +     --\<open>because @{term "Forall(x) \<equiv> Inr(Inr(p))"}\<close>
  83.314      "is_Forall(M,p,Z) == \<exists>u[M]. is_Inr(M,p,u) & is_Inr(M,u,Z)"
  83.315  
  83.316  lemma (in M_trivial) Forall_abs [simp]:
  83.317 @@ -817,20 +817,20 @@
  83.318  
  83.319  
  83.320  
  83.321 -subsection {*Absoluteness for @{term formula_rec}*}
  83.322 +subsection \<open>Absoluteness for @{term formula_rec}\<close>
  83.323  
  83.324  definition
  83.325    formula_rec_case :: "[[i,i]=>i, [i,i]=>i, [i,i,i,i]=>i, [i,i]=>i, i, i] => i" where
  83.326 -    --{* the instance of @{term formula_case} in @{term formula_rec}*}
  83.327 +    --\<open>the instance of @{term formula_case} in @{term formula_rec}\<close>
  83.328     "formula_rec_case(a,b,c,d,h) ==
  83.329          formula_case (a, b,
  83.330                  \<lambda>u v. c(u, v, h ` succ(depth(u)) ` u,
  83.331                                h ` succ(depth(v)) ` v),
  83.332                  \<lambda>u. d(u, h ` succ(depth(u)) ` u))"
  83.333  
  83.334 -text{*Unfold @{term formula_rec} to @{term formula_rec_case}.
  83.335 +text\<open>Unfold @{term formula_rec} to @{term formula_rec_case}.
  83.336       Express @{term formula_rec} without using @{term rank} or @{term Vset},
  83.337 -neither of which is absolute.*}
  83.338 +neither of which is absolute.\<close>
  83.339  lemma (in M_trivial) formula_rec_eq:
  83.340    "p \<in> formula ==>
  83.341     formula_rec(a,b,c,d,p) =
  83.342 @@ -838,20 +838,20 @@
  83.343               \<lambda>x h. Lambda (formula, formula_rec_case(a,b,c,d,h))) ` p"
  83.344  apply (simp add: formula_rec_case_def)
  83.345  apply (induct_tac p)
  83.346 -   txt{*Base case for @{term Member}*}
  83.347 +   txt\<open>Base case for @{term Member}\<close>
  83.348     apply (subst transrec, simp add: formula.intros)
  83.349 -  txt{*Base case for @{term Equal}*}
  83.350 +  txt\<open>Base case for @{term Equal}\<close>
  83.351    apply (subst transrec, simp add: formula.intros)
  83.352 - txt{*Inductive step for @{term Nand}*}
  83.353 + txt\<open>Inductive step for @{term Nand}\<close>
  83.354   apply (subst transrec)
  83.355   apply (simp add: succ_Un_distrib formula.intros)
  83.356 -txt{*Inductive step for @{term Forall}*}
  83.357 +txt\<open>Inductive step for @{term Forall}\<close>
  83.358  apply (subst transrec)
  83.359  apply (simp add: formula_imp_formula_N formula.intros)
  83.360  done
  83.361  
  83.362  
  83.363 -subsubsection{*Absoluteness for the Formula Operator @{term depth}*}
  83.364 +subsubsection\<open>Absoluteness for the Formula Operator @{term depth}\<close>
  83.365  
  83.366  definition
  83.367    is_depth :: "[i=>o,i,i] => o" where
  83.368 @@ -870,18 +870,18 @@
  83.369               dest: formula_N_imp_depth_lt)
  83.370  done
  83.371  
  83.372 -text{*Proof is trivial since @{term depth} returns natural numbers.*}
  83.373 +text\<open>Proof is trivial since @{term depth} returns natural numbers.\<close>
  83.374  lemma (in M_trivial) depth_closed [intro,simp]:
  83.375       "p \<in> formula ==> M(depth(p))"
  83.376  by (simp add: nat_into_M)
  83.377  
  83.378  
  83.379 -subsubsection{*@{term is_formula_case}: relativization of @{term formula_case}*}
  83.380 +subsubsection\<open>@{term is_formula_case}: relativization of @{term formula_case}\<close>
  83.381  
  83.382  definition
  83.383   is_formula_case ::
  83.384      "[i=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i]=>o, i, i] => o" where
  83.385 -  --{*no constraint on non-formulas*}
  83.386 +  --\<open>no constraint on non-formulas\<close>
  83.387    "is_formula_case(M, is_a, is_b, is_c, is_d, p, z) ==
  83.388        (\<forall>x[M]. \<forall>y[M]. finite_ordinal(M,x) \<longrightarrow> finite_ordinal(M,y) \<longrightarrow>
  83.389                        is_Member(M,x,y,p) \<longrightarrow> is_a(x,y,z)) &
  83.390 @@ -911,18 +911,18 @@
  83.391  by (erule formula.cases, simp_all)
  83.392  
  83.393  
  83.394 -subsubsection {*Absoluteness for @{term formula_rec}: Final Results*}
  83.395 +subsubsection \<open>Absoluteness for @{term formula_rec}: Final Results\<close>
  83.396  
  83.397  definition
  83.398    is_formula_rec :: "[i=>o, [i,i,i]=>o, i, i] => o" where
  83.399 -    --{* predicate to relativize the functional @{term formula_rec}*}
  83.400 +    --\<open>predicate to relativize the functional @{term formula_rec}\<close>
  83.401     "is_formula_rec(M,MH,p,z)  ==
  83.402        \<exists>dp[M]. \<exists>i[M]. \<exists>f[M]. finite_ordinal(M,dp) & is_depth(M,p,dp) &
  83.403               successor(M,dp,i) & fun_apply(M,f,p,z) & is_transrec(M,MH,i,f)"
  83.404  
  83.405  
  83.406 -text{*Sufficient conditions to relativize the instance of @{term formula_case}
  83.407 -      in @{term formula_rec}*}
  83.408 +text\<open>Sufficient conditions to relativize the instance of @{term formula_case}
  83.409 +      in @{term formula_rec}\<close>
  83.410  lemma (in M_datatypes) Relation1_formula_rec_case:
  83.411       "[|Relation2(M, nat, nat, is_a, a);
  83.412          Relation2(M, nat, nat, is_b, b);
  83.413 @@ -939,9 +939,9 @@
  83.414  done
  83.415  
  83.416  
  83.417 -text{*This locale packages the premises of the following theorems,
  83.418 +text\<open>This locale packages the premises of the following theorems,
  83.419        which is the normal purpose of locales.  It doesn't accumulate
  83.420 -      constraints on the class @{term M}, as in most of this deveopment.*}
  83.421 +      constraints on the class @{term M}, as in most of this deveopment.\<close>
  83.422  locale Formula_Rec = M_eclose +
  83.423    fixes a and is_a and b and is_b and c and is_c and d and is_d and MH
  83.424    defines
  83.425 @@ -995,7 +995,7 @@
  83.426  by (simp add: transrec_closed [OF fr_replace MH_rel2]
  83.427                nat_into_M formula_rec_lam_closed)
  83.428  
  83.429 -text{*The main two results: @{term formula_rec} is absolute for @{term M}.*}
  83.430 +text\<open>The main two results: @{term formula_rec} is absolute for @{term M}.\<close>
  83.431  theorem (in Formula_Rec) formula_rec_closed:
  83.432      "p \<in> formula ==> M(formula_rec(a,b,c,d,p))"
  83.433  by (simp add: formula_rec_eq fr_transrec_closed
    84.1 --- a/src/ZF/Constructible/Formula.thy	Thu Jul 23 14:20:51 2015 +0200
    84.2 +++ b/src/ZF/Constructible/Formula.thy	Thu Jul 23 14:25:05 2015 +0200
    84.3 @@ -2,14 +2,14 @@
    84.4      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    84.5  *)
    84.6  
    84.7 -section {* First-Order Formulas and the Definition of the Class L *}
    84.8 +section \<open>First-Order Formulas and the Definition of the Class L\<close>
    84.9  
   84.10  theory Formula imports Main begin
   84.11  
   84.12 -subsection{*Internalized formulas of FOL*}
   84.13 +subsection\<open>Internalized formulas of FOL\<close>
   84.14  
   84.15 -text{*De Bruijn representation.
   84.16 -  Unbound variables get their denotations from an environment.*}
   84.17 +text\<open>De Bruijn representation.
   84.18 +  Unbound variables get their denotations from an environment.\<close>
   84.19  
   84.20  consts   formula :: i
   84.21  datatype
   84.22 @@ -109,7 +109,7 @@
   84.23  
   84.24  declare satisfies.simps [simp del]
   84.25  
   84.26 -subsection{*Dividing line between primitive and derived connectives*}
   84.27 +subsection\<open>Dividing line between primitive and derived connectives\<close>
   84.28  
   84.29  lemma sats_Neg_iff [simp]:
   84.30    "env \<in> list(A)
   84.31 @@ -142,7 +142,7 @@
   84.32  by (simp add: Exists_def)
   84.33  
   84.34  
   84.35 -subsubsection{*Derived rules to help build up formulas*}
   84.36 +subsubsection\<open>Derived rules to help build up formulas\<close>
   84.37  
   84.38  lemma mem_iff_sats:
   84.39        "[| nth(i,env) = x; nth(j,env) = y; env \<in> list(A)|]
   84.40 @@ -195,7 +195,7 @@
   84.41          bex_iff_sats
   84.42  
   84.43  
   84.44 -subsection{*Arity of a Formula: Maximum Free de Bruijn Index*}
   84.45 +subsection\<open>Arity of a Formula: Maximum Free de Bruijn Index\<close>
   84.46  
   84.47  consts   arity :: "i=>i"
   84.48  primrec
   84.49 @@ -249,7 +249,7 @@
   84.50  done
   84.51  
   84.52  
   84.53 -subsection{*Renaming Some de Bruijn Variables*}
   84.54 +subsection\<open>Renaming Some de Bruijn Variables\<close>
   84.55  
   84.56  definition
   84.57    incr_var :: "[i,i]=>i" where
   84.58 @@ -284,9 +284,9 @@
   84.59  lemma incr_bv_type [TC]: "p \<in> formula ==> incr_bv(p) \<in> nat -> formula"
   84.60  by (induct_tac p, simp_all)
   84.61  
   84.62 -text{*Obviously, @{term DPow} is closed under complements and finite
   84.63 +text\<open>Obviously, @{term DPow} is closed under complements and finite
   84.64  intersections and unions.  Needs an inductive lemma to allow two lists of
   84.65 -parameters to be combined.*}
   84.66 +parameters to be combined.\<close>
   84.67  
   84.68  lemma sats_incr_bv_iff [rule_format]:
   84.69    "[| p \<in> formula; env \<in> list(A); x \<in> A |]
   84.70 @@ -325,11 +325,11 @@
   84.71                       succ_Un_distrib [symmetric] incr_var_lt incr_var_le
   84.72                       Un_commute incr_var_lemma Arith.pred_def nat_imp_quasinat
   84.73              split: split_nat_case)
   84.74 - txt{*the Forall case reduces to linear arithmetic*}
   84.75 + txt\<open>the Forall case reduces to linear arithmetic\<close>
   84.76   prefer 2
   84.77   apply clarify
   84.78   apply (blast dest: lt_trans1)
   84.79 -txt{*left with the And case*}
   84.80 +txt\<open>left with the And case\<close>
   84.81  apply safe
   84.82   apply (blast intro: incr_And_lemma lt_trans1)
   84.83  apply (subst incr_And_lemma)
   84.84 @@ -338,7 +338,7 @@
   84.85  done
   84.86  
   84.87  
   84.88 -subsection{*Renaming all but the First de Bruijn Variable*}
   84.89 +subsection\<open>Renaming all but the First de Bruijn Variable\<close>
   84.90  
   84.91  definition
   84.92    incr_bv1 :: "i => i" where
   84.93 @@ -389,9 +389,9 @@
   84.94  
   84.95  
   84.96  
   84.97 -subsection{*Definable Powerset*}
   84.98 +subsection\<open>Definable Powerset\<close>
   84.99  
  84.100 -text{*The definable powerset operation: Kunen's definition VI 1.1, page 165.*}
  84.101 +text\<open>The definable powerset operation: Kunen's definition VI 1.1, page 165.\<close>
  84.102  definition
  84.103    DPow :: "i => i" where
  84.104    "DPow(A) == {X \<in> Pow(A).
  84.105 @@ -404,7 +404,7 @@
  84.106     ==> {x\<in>A. sats(A, p, Cons(x,env))} \<in> DPow(A)"
  84.107  by (simp add: DPow_def, blast)
  84.108  
  84.109 -text{*With this rule we can specify @{term p} later.*}
  84.110 +text\<open>With this rule we can specify @{term p} later.\<close>
  84.111  lemma DPowI2 [rule_format]:
  84.112    "[|\<forall>x\<in>A. P(x) \<longleftrightarrow> sats(A, p, Cons(x,env));
  84.113       env \<in> list(A);  p \<in> formula;  arity(p) \<le> succ(length(env))|]
  84.114 @@ -482,10 +482,10 @@
  84.115  apply (blast intro: cons_in_DPow)
  84.116  done
  84.117  
  84.118 -text{*@{term DPow} is not monotonic.  For example, let @{term A} be some
  84.119 +text\<open>@{term DPow} is not monotonic.  For example, let @{term A} be some
  84.120  non-constructible set of natural numbers, and let @{term B} be @{term nat}.
  84.121  Then @{term "A<=B"} and obviously @{term "A \<in> DPow(A)"} but @{term "A \<notin>
  84.122 -DPow(B)"}.*}
  84.123 +DPow(B)"}.\<close>
  84.124  
  84.125  (*This may be true but the proof looks difficult, requiring relativization
  84.126  lemma DPow_insert: "DPow (cons(a,A)) = DPow(A) \<union> {cons(a,X) . X \<in> DPow(A)}"
  84.127 @@ -503,17 +503,17 @@
  84.128  done
  84.129  
  84.130  
  84.131 -subsection{*Internalized Formulas for the Ordinals*}
  84.132 +subsection\<open>Internalized Formulas for the Ordinals\<close>
  84.133  
  84.134 -text{*The @{text sats} theorems below differ from