more robust syntax for definition/abbreviation/notation;
authorwenzelm
Fri Nov 17 02:20:03 2006 +0100 (2006-11-17)
changeset 21404eb85850d3eb7
parent 21403 dd58f13a8eb4
child 21405 26b51f724fe6
more robust syntax for definition/abbreviation/notation;
src/CCL/Gfp.thy
src/CCL/Lfp.thy
src/CTT/Arith.thy
src/CTT/Bool.thy
src/CTT/CTT.thy
src/FOL/IFOL.thy
src/FOL/ex/NatClass.thy
src/HOL/Accessible_Part.thy
src/HOL/Algebra/Coset.thy
src/HOL/Algebra/Lattice.thy
src/HOL/Auth/CertifiedEmail.thy
src/HOL/Auth/Event.thy
src/HOL/Auth/Guard/Extensions.thy
src/HOL/Auth/Guard/Guard.thy
src/HOL/Auth/Guard/GuardK.thy
src/HOL/Auth/Guard/Guard_NS_Public.thy
src/HOL/Auth/Guard/Guard_OtwayRees.thy
src/HOL/Auth/Guard/Guard_Shared.thy
src/HOL/Auth/Guard/Guard_Yahalom.thy
src/HOL/Auth/Guard/List_Msg.thy
src/HOL/Auth/Guard/Proto.thy
src/HOL/Auth/KerberosIV.thy
src/HOL/Auth/KerberosIV_Gets.thy
src/HOL/Auth/KerberosV.thy
src/HOL/Auth/Kerberos_BAN.thy
src/HOL/Auth/Kerberos_BAN_Gets.thy
src/HOL/Auth/Public.thy
src/HOL/Auth/Recur.thy
src/HOL/Auth/Smartcard/EventSC.thy
src/HOL/Auth/TLS.thy
src/HOL/Auth/ZhouGollmann.thy
src/HOL/Bali/Example.thy
src/HOL/Code_Generator.thy
src/HOL/Complex/CLim.thy
src/HOL/Complex/Complex.thy
src/HOL/Complex/NSCA.thy
src/HOL/Complex/NSComplex.thy
src/HOL/Complex/ex/NSPrimes.thy
src/HOL/Complex/ex/Sqrt.thy
src/HOL/Complex/ex/Sqrt_Script.thy
src/HOL/Datatype.thy
src/HOL/Equiv_Relations.thy
src/HOL/Extraction/Pigeonhole.thy
src/HOL/Finite_Set.thy
src/HOL/FixedPoint.thy
src/HOL/FunDef.thy
src/HOL/HOL.thy
src/HOL/Hyperreal/Deriv.thy
src/HOL/Hyperreal/HLog.thy
src/HOL/Hyperreal/HSeries.thy
src/HOL/Hyperreal/HTranscendental.thy
src/HOL/Hyperreal/HyperArith.thy
src/HOL/Hyperreal/HyperDef.thy
src/HOL/Hyperreal/HyperNat.thy
src/HOL/Hyperreal/HyperPow.thy
src/HOL/Hyperreal/Integration.thy
src/HOL/Hyperreal/Lim.thy
src/HOL/Hyperreal/Log.thy
src/HOL/Hyperreal/NSA.thy
src/HOL/Hyperreal/NatStar.thy
src/HOL/Hyperreal/NthRoot.thy
src/HOL/Hyperreal/Poly.thy
src/HOL/Hyperreal/SEQ.thy
src/HOL/Hyperreal/Series.thy
src/HOL/Hyperreal/Star.thy
src/HOL/Hyperreal/StarDef.thy
src/HOL/Hyperreal/Transcendental.thy
src/HOL/Induct/Comb.thy
src/HOL/Induct/LFilter.thy
src/HOL/Induct/LList.thy
src/HOL/Induct/Mutil.thy
src/HOL/Induct/Ordinals.thy
src/HOL/Induct/PropLog.thy
src/HOL/Induct/QuoDataType.thy
src/HOL/Induct/QuoNestedDataType.thy
src/HOL/Induct/SList.thy
src/HOL/Induct/Sexp.thy
src/HOL/Induct/Tree.thy
src/HOL/Integ/IntDef.thy
src/HOL/Integ/NatBin.thy
src/HOL/Integ/Numeral.thy
src/HOL/Isar_examples/Hoare.thy
src/HOL/Lambda/Commutation.thy
src/HOL/Lambda/Eta.thy
src/HOL/Lambda/Lambda.thy
src/HOL/Lambda/ListApplication.thy
src/HOL/Lambda/ListBeta.thy
src/HOL/Lambda/ListOrder.thy
src/HOL/Lambda/ParRed.thy
src/HOL/Lambda/StrongNorm.thy
src/HOL/Lambda/Type.thy
src/HOL/Lambda/WeakNorm.thy
src/HOL/Lattice/Bounds.thy
src/HOL/Lattice/CompleteLattice.thy
src/HOL/Lattice/Lattice.thy
src/HOL/Library/AssocList.thy
src/HOL/Library/BigO.thy
src/HOL/Library/Char_ord.thy
src/HOL/Library/Coinductive_List.thy
src/HOL/Library/Commutative_Ring.thy
src/HOL/Library/Continuity.thy
src/HOL/Library/EfficientNat.thy
src/HOL/Library/ExecutableRat.thy
src/HOL/Library/ExecutableSet.thy
src/HOL/Library/FuncSet.thy
src/HOL/Library/GCD.thy
src/HOL/Library/Infinite_Set.thy
src/HOL/Library/List_Prefix.thy
src/HOL/Library/Multiset.thy
src/HOL/Library/NatPair.thy
src/HOL/Library/Nat_Infinity.thy
src/HOL/Library/OptionalSugar.thy
src/HOL/Library/Parity.thy
src/HOL/Library/Permutation.thy
src/HOL/Library/Primes.thy
src/HOL/Library/Quotient.thy
src/HOL/Library/SetsAndFunctions.thy
src/HOL/Library/State_Monad.thy
src/HOL/Library/While_Combinator.thy
src/HOL/Library/Word.thy
src/HOL/Library/Zorn.thy
src/HOL/List.thy
src/HOL/Map.thy
src/HOL/MicroJava/J/Example.thy
src/HOL/MicroJava/JVM/JVMListExample.thy
src/HOL/Nominal/Examples/Lam_Funs.thy
src/HOL/Nominal/Examples/SN.thy
src/HOL/Nominal/Examples/Weakening.thy
src/HOL/NumberTheory/BijectionRel.thy
src/HOL/NumberTheory/Chinese.thy
src/HOL/NumberTheory/Euler.thy
src/HOL/NumberTheory/EulerFermat.thy
src/HOL/NumberTheory/EvenOdd.thy
src/HOL/NumberTheory/Factorization.thy
src/HOL/NumberTheory/Gauss.thy
src/HOL/NumberTheory/Int2.thy
src/HOL/NumberTheory/IntPrimes.thy
src/HOL/NumberTheory/Quadratic_Reciprocity.thy
src/HOL/NumberTheory/Residues.thy
src/HOL/NumberTheory/WilsonBij.thy
src/HOL/NumberTheory/WilsonRuss.thy
src/HOL/Orderings.thy
src/HOL/Product_Type.thy
src/HOL/Real/ContNotDenum.thy
src/HOL/Real/Float.thy
src/HOL/Real/HahnBanach/Bounds.thy
src/HOL/Real/HahnBanach/FunctionOrder.thy
src/HOL/Real/HahnBanach/Subspace.thy
src/HOL/Real/Lubs.thy
src/HOL/Real/PReal.thy
src/HOL/Real/RComplete.thy
src/HOL/Real/Rational.thy
src/HOL/Real/RealDef.thy
src/HOL/Real/RealVector.thy
src/HOL/Relation.thy
src/HOL/Set.thy
src/HOL/Transitive_Closure.thy
src/HOL/Unix/Unix.thy
src/HOL/W0/W0.thy
src/HOL/ex/Abstract_NAT.thy
src/HOL/ex/Adder.thy
src/HOL/ex/CTL.thy
src/HOL/ex/Classpackage.thy
src/HOL/ex/CodeCollections.thy
src/HOL/ex/CodeEmbed.thy
src/HOL/ex/CodeRandom.thy
src/HOL/ex/Codegenerator.thy
src/HOL/ex/Higher_Order_Logic.thy
src/HOL/ex/InductiveInvariant.thy
src/HOL/ex/Lagrange.thy
src/HOL/ex/MonoidGroup.thy
src/HOL/ex/PER.thy
src/HOL/ex/Primrec.thy
src/HOL/ex/Records.thy
src/HOL/ex/Reflected_Presburger.thy
src/HOL/ex/Sorting.thy
src/HOL/ex/Tarski.thy
src/HOL/ex/ThreeDivides.thy
src/HOLCF/FOCUS/Buffer.thy
src/HOLCF/FOCUS/Fstream.thy
src/HOLCF/FOCUS/Fstreams.thy
src/HOLCF/FOCUS/Stream_adm.thy
src/HOLCF/IMP/Denotational.thy
src/HOLCF/IMP/HoareEx.thy
src/HOLCF/ex/Dagstuhl.thy
src/HOLCF/ex/Dnat.thy
src/HOLCF/ex/Focus_ex.thy
src/HOLCF/ex/Hoare.thy
src/HOLCF/ex/Loop.thy
src/HOLCF/ex/Stream.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/Rec_Separation.thy
src/ZF/Constructible/Relative.thy
src/ZF/Constructible/Satisfies_absolute.thy
src/ZF/Constructible/WF_absolute.thy
src/ZF/Constructible/WFrec.thy
src/ZF/Constructible/Wellorderings.thy
src/ZF/IMP/Denotation.thy
src/ZF/ex/Commutation.thy
src/ZF/ex/Group.thy
src/ZF/ex/Ramsey.thy
src/ZF/ex/Ring.thy
     1.1 --- a/src/CCL/Gfp.thy	Fri Nov 17 02:19:55 2006 +0100
     1.2 +++ b/src/CCL/Gfp.thy	Fri Nov 17 02:20:03 2006 +0100
     1.3 @@ -11,7 +11,7 @@
     1.4  begin
     1.5  
     1.6  definition
     1.7 -  gfp :: "['a set=>'a set] => 'a set"    (*greatest fixed point*)
     1.8 +  gfp :: "['a set=>'a set] => 'a set" where -- "greatest fixed point"
     1.9    "gfp(f) == Union({u. u <= f(u)})"
    1.10  
    1.11  (* gfp(f) is the least upper bound of {u. u <= f(u)} *)
     2.1 --- a/src/CCL/Lfp.thy	Fri Nov 17 02:19:55 2006 +0100
     2.2 +++ b/src/CCL/Lfp.thy	Fri Nov 17 02:20:03 2006 +0100
     2.3 @@ -11,7 +11,7 @@
     2.4  begin
     2.5  
     2.6  definition
     2.7 -  lfp :: "['a set=>'a set] => 'a set"     (*least fixed point*)
     2.8 +  lfp :: "['a set=>'a set] => 'a set" where -- "least fixed point"
     2.9    "lfp(f) == Inter({u. f(u) <= u})"
    2.10  
    2.11  (* lfp(f) is the greatest lower bound of {u. f(u) <= u} *)
     3.1 --- a/src/CTT/Arith.thy	Fri Nov 17 02:19:55 2006 +0100
     3.2 +++ b/src/CTT/Arith.thy	Fri Nov 17 02:20:03 2006 +0100
     3.3 @@ -13,22 +13,27 @@
     3.4  subsection {* Arithmetic operators and their definitions *}
     3.5  
     3.6  definition
     3.7 -  add :: "[i,i]=>i"   (infixr "#+" 65)
     3.8 +  add :: "[i,i]=>i"   (infixr "#+" 65) where
     3.9    "a#+b == rec(a, b, %u v. succ(v))"
    3.10  
    3.11 -  diff :: "[i,i]=>i"   (infixr "-" 65)
    3.12 +definition
    3.13 +  diff :: "[i,i]=>i"   (infixr "-" 65) where
    3.14    "a-b == rec(b, a, %u v. rec(v, 0, %x y. x))"
    3.15  
    3.16 -  absdiff :: "[i,i]=>i"   (infixr "|-|" 65)
    3.17 +definition
    3.18 +  absdiff :: "[i,i]=>i"   (infixr "|-|" 65) where
    3.19    "a|-|b == (a-b) #+ (b-a)"
    3.20  
    3.21 -  mult :: "[i,i]=>i"   (infixr "#*" 70)
    3.22 +definition
    3.23 +  mult :: "[i,i]=>i"   (infixr "#*" 70) where
    3.24    "a#*b == rec(a, 0, %u v. b #+ v)"
    3.25  
    3.26 -  mod :: "[i,i]=>i"   (infixr "mod" 70)
    3.27 +definition
    3.28 +  mod :: "[i,i]=>i"   (infixr "mod" 70) where
    3.29    "a mod b == rec(a, 0, %u v. rec(succ(v) |-| b, 0, %x y. succ(v)))"
    3.30  
    3.31 -  div :: "[i,i]=>i"   (infixr "div" 70)
    3.32 +definition
    3.33 +  div :: "[i,i]=>i"   (infixr "div" 70) where
    3.34    "a div b == rec(a, 0, %u v. rec(succ(u) mod b, succ(v), %x y. v))"
    3.35  
    3.36  
     4.1 --- a/src/CTT/Bool.thy	Fri Nov 17 02:19:55 2006 +0100
     4.2 +++ b/src/CTT/Bool.thy	Fri Nov 17 02:20:03 2006 +0100
     4.3 @@ -11,16 +11,19 @@
     4.4  begin
     4.5  
     4.6  definition
     4.7 -  Bool :: "t"
     4.8 +  Bool :: "t" where
     4.9    "Bool == T+T"
    4.10  
    4.11 -  true :: "i"
    4.12 +definition
    4.13 +  true :: "i" where
    4.14    "true == inl(tt)"
    4.15  
    4.16 -  false :: "i"
    4.17 +definition
    4.18 +  false :: "i" where
    4.19    "false == inr(tt)"
    4.20  
    4.21 -  cond :: "[i,i,i]=>i"
    4.22 +definition
    4.23 +  cond :: "[i,i,i]=>i" where
    4.24    "cond(a,b,c) == when(a, %u. b, %u. c)"
    4.25  
    4.26  lemmas bool_defs = Bool_def true_def false_def cond_def
     5.1 --- a/src/CTT/CTT.thy	Fri Nov 17 02:19:55 2006 +0100
     5.2 +++ b/src/CTT/CTT.thy	Fri Nov 17 02:20:03 2006 +0100
     5.3 @@ -65,20 +65,21 @@
     5.4    "SUM x:A. B"  == "Sum(A, %x. B)"
     5.5  
     5.6  abbreviation
     5.7 -  Arrow     :: "[t,t]=>t"           (infixr "-->" 30)
     5.8 +  Arrow     :: "[t,t]=>t"  (infixr "-->" 30) where
     5.9    "A --> B == PROD _:A. B"
    5.10 -  Times     :: "[t,t]=>t"           (infixr "*" 50)
    5.11 +abbreviation
    5.12 +  Times     :: "[t,t]=>t"  (infixr "*" 50) where
    5.13    "A * B == SUM _:A. B"
    5.14  
    5.15  notation (xsymbols)
    5.16 -  Elem  ("(_ /\<in> _)" [10,10] 5)
    5.17 -  Eqelem  ("(2_ =/ _ \<in>/ _)" [10,10,10] 5)
    5.18 -  Arrow  (infixr "\<longrightarrow>" 30)
    5.19 +  Elem  ("(_ /\<in> _)" [10,10] 5) and
    5.20 +  Eqelem  ("(2_ =/ _ \<in>/ _)" [10,10,10] 5) and
    5.21 +  Arrow  (infixr "\<longrightarrow>" 30) and
    5.22    Times  (infixr "\<times>" 50)
    5.23  
    5.24  notation (HTML output)
    5.25 -  Elem  ("(_ /\<in> _)" [10,10] 5)
    5.26 -  Eqelem  ("(2_ =/ _ \<in>/ _)" [10,10,10] 5)
    5.27 +  Elem  ("(_ /\<in> _)" [10,10] 5) and
    5.28 +  Eqelem  ("(2_ =/ _ \<in>/ _)" [10,10,10] 5) and
    5.29    Times  (infixr "\<times>" 50)
    5.30  
    5.31  syntax (xsymbols)
     6.1 --- a/src/FOL/IFOL.thy	Fri Nov 17 02:19:55 2006 +0100
     6.2 +++ b/src/FOL/IFOL.thy	Fri Nov 17 02:20:03 2006 +0100
     6.3 @@ -45,7 +45,7 @@
     6.4  
     6.5  
     6.6  abbreviation
     6.7 -  not_equal     :: "['a, 'a] => o"              (infixl "~=" 50)
     6.8 +  not_equal :: "['a, 'a] => o"  (infixl "~=" 50) where
     6.9    "x ~= y == ~ (x = y)"
    6.10  
    6.11  notation (xsymbols)
     7.1 --- a/src/FOL/ex/NatClass.thy	Fri Nov 17 02:19:55 2006 +0100
     7.2 +++ b/src/FOL/ex/NatClass.thy	Fri Nov 17 02:20:03 2006 +0100
     7.3 @@ -30,7 +30,7 @@
     7.4    rec_Suc:       "rec(Suc(m), a, f) = f(m, rec(m, a, f))"
     7.5  
     7.6  definition
     7.7 -  add :: "['a::nat, 'a] => 'a"    (infixl "+" 60)
     7.8 +  add :: "['a::nat, 'a] => 'a"  (infixl "+" 60) where
     7.9    "m + n = rec(m, n, %x y. Suc(y))"
    7.10  
    7.11  lemma Suc_n_not_n: "Suc(k) ~= (k::'a::nat)"
     8.1 --- a/src/HOL/Accessible_Part.thy	Fri Nov 17 02:19:55 2006 +0100
     8.2 +++ b/src/HOL/Accessible_Part.thy	Fri Nov 17 02:20:03 2006 +0100
     8.3 @@ -24,7 +24,7 @@
     8.4      accI: "(!!y. (y, x) \<in> r ==> y \<in> acc r) ==> x \<in> acc r"
     8.5  
     8.6  abbreviation
     8.7 -  termi :: "('a \<times> 'a) set => 'a set"
     8.8 +  termi :: "('a \<times> 'a) set => 'a set" where
     8.9    "termi r == acc (r\<inverse>)"
    8.10  
    8.11  
     9.1 --- a/src/HOL/Algebra/Coset.thy	Fri Nov 17 02:19:55 2006 +0100
     9.2 +++ b/src/HOL/Algebra/Coset.thy	Fri Nov 17 02:20:03 2006 +0100
     9.3 @@ -30,7 +30,7 @@
     9.4    assumes coset_eq: "(\<forall>x \<in> carrier G. H #> x = x <# H)"
     9.5  
     9.6  abbreviation
     9.7 -  normal_rel :: "['a set, ('a, 'b) monoid_scheme] \<Rightarrow> bool"  (infixl "\<lhd>" 60)
     9.8 +  normal_rel :: "['a set, ('a, 'b) monoid_scheme] \<Rightarrow> bool"  (infixl "\<lhd>" 60) where
     9.9    "H \<lhd> G \<equiv> normal H G"
    9.10  
    9.11  
    10.1 --- a/src/HOL/Algebra/Lattice.thy	Fri Nov 17 02:19:55 2006 +0100
    10.2 +++ b/src/HOL/Algebra/Lattice.thy	Fri Nov 17 02:20:03 2006 +0100
    10.3 @@ -29,7 +29,7 @@
    10.4    definition command cannot specialise the types. *}
    10.5  
    10.6  definition (in order_syntax)
    10.7 -  less (infixl "\<sqsubset>" 50) "x \<sqsubset> y == x \<sqsubseteq> y & x ~= y"
    10.8 +  less (infixl "\<sqsubset>" 50) where "x \<sqsubset> y == x \<sqsubseteq> y & x ~= y"
    10.9  
   10.10  text {* Upper and lower bounds of a set. *}
   10.11  
   10.12 @@ -38,35 +38,35 @@
   10.13    "Upper A == {u. (ALL x. x \<in> A \<inter> L --> x \<sqsubseteq> u)} \<inter> L"
   10.14  
   10.15  definition (in order_syntax)
   10.16 -  Lower :: "'a set => 'a set"
   10.17 +  Lower :: "'a set => 'a set" where
   10.18    "Lower A == {l. (ALL x. x \<in> A \<inter> L --> l \<sqsubseteq> x)} \<inter> L"
   10.19  
   10.20  text {* Least and greatest, as predicate. *}
   10.21  
   10.22  definition (in order_syntax)
   10.23 -  least :: "['a, 'a set] => bool"
   10.24 +  least :: "['a, 'a set] => bool" where
   10.25    "least l A == A \<subseteq> L & l \<in> A & (ALL x : A. l \<sqsubseteq> x)"
   10.26  
   10.27  definition (in order_syntax)
   10.28 -  greatest :: "['a, 'a set] => bool"
   10.29 +  greatest :: "['a, 'a set] => bool" where
   10.30    "greatest g A == A \<subseteq> L & g \<in> A & (ALL x : A. x \<sqsubseteq> g)"
   10.31  
   10.32  text {* Supremum and infimum *}
   10.33  
   10.34  definition (in order_syntax)
   10.35 -  sup :: "'a set => 'a" ("\<Squnion>_" [90] 90)
   10.36 +  sup :: "'a set => 'a" ("\<Squnion>_" [90] 90) where
   10.37    "\<Squnion>A == THE x. least x (Upper A)"
   10.38  
   10.39  definition (in order_syntax)
   10.40 -  inf :: "'a set => 'a" ("\<Sqinter>_" [90] 90)
   10.41 +  inf :: "'a set => 'a" ("\<Sqinter>_" [90] 90) where
   10.42    "\<Sqinter>A == THE x. greatest x (Lower A)"
   10.43  
   10.44  definition (in order_syntax)
   10.45 -  join :: "['a, 'a] => 'a" (infixl "\<squnion>" 65)
   10.46 +  join :: "['a, 'a] => 'a" (infixl "\<squnion>" 65) where
   10.47    "x \<squnion> y == sup {x, y}"
   10.48  
   10.49  definition (in order_syntax)
   10.50 -  meet :: "['a, 'a] => 'a" (infixl "\<sqinter>" 70)
   10.51 +  meet :: "['a, 'a] => 'a" (infixl "\<sqinter>" 70) where
   10.52    "x \<sqinter> y == inf {x, y}"
   10.53  
   10.54  locale partial_order = order_syntax +
   10.55 @@ -79,7 +79,7 @@
   10.56                     x \<in> L; y \<in> L; z \<in> L |] ==> x \<sqsubseteq> z"
   10.57  
   10.58  abbreviation (in partial_order)
   10.59 -  less (infixl "\<sqsubset>" 50) "less == order_syntax.less le"
   10.60 +  less (infixl "\<sqsubset>" 50) where "less == order_syntax.less le"
   10.61  abbreviation (in partial_order)
   10.62    Upper where "Upper == order_syntax.Upper L le"
   10.63  abbreviation (in partial_order)
   10.64 @@ -89,13 +89,13 @@
   10.65  abbreviation (in partial_order)
   10.66    greatest where "greatest == order_syntax.greatest L le"
   10.67  abbreviation (in partial_order)
   10.68 -  sup ("\<Squnion>_" [90] 90) "sup == order_syntax.sup L le"
   10.69 +  sup ("\<Squnion>_" [90] 90) where "sup == order_syntax.sup L le"
   10.70  abbreviation (in partial_order)
   10.71 -  inf ("\<Sqinter>_" [90] 90) "inf == order_syntax.inf L le"
   10.72 +  inf ("\<Sqinter>_" [90] 90) where "inf == order_syntax.inf L le"
   10.73  abbreviation (in partial_order)
   10.74 -  join (infixl "\<squnion>" 65) "join == order_syntax.join L le"
   10.75 +  join (infixl "\<squnion>" 65) where "join == order_syntax.join L le"
   10.76  abbreviation (in partial_order)
   10.77 -  meet (infixl "\<sqinter>" 70) "meet == order_syntax.meet L le"
   10.78 +  meet (infixl "\<sqinter>" 70) where "meet == order_syntax.meet L le"
   10.79  
   10.80  
   10.81  subsubsection {* Upper *}
   10.82 @@ -207,7 +207,7 @@
   10.83      "[| x \<in> L; y \<in> L |] ==> EX s. order_syntax.greatest L le s (order_syntax.Lower L le {x, y})"
   10.84  
   10.85  abbreviation (in lattice)
   10.86 -  less (infixl "\<sqsubset>" 50) "less == order_syntax.less le"
   10.87 +  less (infixl "\<sqsubset>" 50) where "less == order_syntax.less le"
   10.88  abbreviation (in lattice)
   10.89    Upper where "Upper == order_syntax.Upper L le"
   10.90  abbreviation (in lattice)
   10.91 @@ -217,13 +217,13 @@
   10.92  abbreviation (in lattice)
   10.93    greatest where "greatest == order_syntax.greatest L le"
   10.94  abbreviation (in lattice)
   10.95 -  sup ("\<Squnion>_" [90] 90) "sup == order_syntax.sup L le"
   10.96 +  sup ("\<Squnion>_" [90] 90) where "sup == order_syntax.sup L le"
   10.97  abbreviation (in lattice)
   10.98 -  inf ("\<Sqinter>_" [90] 90) "inf == order_syntax.inf L le"
   10.99 +  inf ("\<Sqinter>_" [90] 90) where "inf == order_syntax.inf L le"
  10.100  abbreviation (in lattice)
  10.101 -  join (infixl "\<squnion>" 65) "join == order_syntax.join L le"
  10.102 +  join (infixl "\<squnion>" 65) where "join == order_syntax.join L le"
  10.103  abbreviation (in lattice)
  10.104 -  meet (infixl "\<sqinter>" 70) "meet == order_syntax.meet L le"
  10.105 +  meet (infixl "\<sqinter>" 70) where "meet == order_syntax.meet L le"
  10.106  
  10.107  lemma (in order_syntax) least_Upper_above:
  10.108    "[| least s (Upper A); x \<in> A; A \<subseteq> L |] ==> x \<sqsubseteq> s"
  10.109 @@ -690,7 +690,7 @@
  10.110    assumes total: "[| x \<in> L; y \<in> L |] ==> x \<sqsubseteq> y | y \<sqsubseteq> x"
  10.111  
  10.112  abbreviation (in total_order)
  10.113 -  less (infixl "\<sqsubset>" 50) "less == order_syntax.less le"
  10.114 +  less (infixl "\<sqsubset>" 50) where "less == order_syntax.less le"
  10.115  abbreviation (in total_order)
  10.116    Upper where "Upper == order_syntax.Upper L le"
  10.117  abbreviation (in total_order)
  10.118 @@ -700,13 +700,13 @@
  10.119  abbreviation (in total_order)
  10.120    greatest where "greatest == order_syntax.greatest L le"
  10.121  abbreviation (in total_order)
  10.122 -  sup ("\<Squnion>_" [90] 90) "sup == order_syntax.sup L le"
  10.123 +  sup ("\<Squnion>_" [90] 90) where "sup == order_syntax.sup L le"
  10.124  abbreviation (in total_order)
  10.125 -  inf ("\<Sqinter>_" [90] 90) "inf == order_syntax.inf L le"
  10.126 +  inf ("\<Sqinter>_" [90] 90) where "inf == order_syntax.inf L le"
  10.127  abbreviation (in total_order)
  10.128 -  join (infixl "\<squnion>" 65) "join == order_syntax.join L le"
  10.129 +  join (infixl "\<squnion>" 65) where "join == order_syntax.join L le"
  10.130  abbreviation (in total_order)
  10.131 -  meet (infixl "\<sqinter>" 70) "meet == order_syntax.meet L le"
  10.132 +  meet (infixl "\<sqinter>" 70) where "meet == order_syntax.meet L le"
  10.133  
  10.134  text {* Introduction rule: the usual definition of total order *}
  10.135  
  10.136 @@ -768,7 +768,7 @@
  10.137      "[| A \<subseteq> L |] ==> EX i. order_syntax.greatest L le i (order_syntax.Lower L le A)"
  10.138  
  10.139  abbreviation (in complete_lattice)
  10.140 -  less (infixl "\<sqsubset>" 50) "less == order_syntax.less le"
  10.141 +  less (infixl "\<sqsubset>" 50) where "less == order_syntax.less le"
  10.142  abbreviation (in complete_lattice)
  10.143    Upper where "Upper == order_syntax.Upper L le"
  10.144  abbreviation (in complete_lattice)
  10.145 @@ -778,13 +778,13 @@
  10.146  abbreviation (in complete_lattice)
  10.147    greatest where "greatest == order_syntax.greatest L le"
  10.148  abbreviation (in complete_lattice)
  10.149 -  sup ("\<Squnion>_" [90] 90) "sup == order_syntax.sup L le"
  10.150 +  sup ("\<Squnion>_" [90] 90) where "sup == order_syntax.sup L le"
  10.151  abbreviation (in complete_lattice)
  10.152 -  inf ("\<Sqinter>_" [90] 90) "inf == order_syntax.inf L le"
  10.153 +  inf ("\<Sqinter>_" [90] 90) where "inf == order_syntax.inf L le"
  10.154  abbreviation (in complete_lattice)
  10.155 -  join (infixl "\<squnion>" 65) "join == order_syntax.join L le"
  10.156 +  join (infixl "\<squnion>" 65) where "join == order_syntax.join L le"
  10.157  abbreviation (in complete_lattice)
  10.158 -  meet (infixl "\<sqinter>" 70) "meet == order_syntax.meet L le"
  10.159 +  meet (infixl "\<sqinter>" 70) where "meet == order_syntax.meet L le"
  10.160  
  10.161  text {* Introduction rule: the usual definition of complete lattice *}
  10.162  
  10.163 @@ -800,29 +800,29 @@
  10.164  qed (assumption | rule complete_lattice_axioms.intro)+
  10.165  
  10.166  definition (in order_syntax)
  10.167 -  top ("\<top>")
  10.168 +  top ("\<top>") where
  10.169    "\<top> == sup L"
  10.170  
  10.171  definition (in order_syntax)
  10.172 -  bottom ("\<bottom>")
  10.173 +  bottom ("\<bottom>") where
  10.174    "\<bottom> == inf L"
  10.175  
  10.176  abbreviation (in partial_order)
  10.177 -  top ("\<top>") "top == order_syntax.top L le"
  10.178 +  top ("\<top>") where "top == order_syntax.top L le"
  10.179  abbreviation (in partial_order)
  10.180 -  bottom ("\<bottom>") "bottom == order_syntax.bottom L le"
  10.181 +  bottom ("\<bottom>") where "bottom == order_syntax.bottom L le"
  10.182  abbreviation (in lattice)
  10.183 -  top ("\<top>") "top == order_syntax.top L le"
  10.184 +  top ("\<top>") where "top == order_syntax.top L le"
  10.185  abbreviation (in lattice)
  10.186 -  bottom ("\<bottom>") "bottom == order_syntax.bottom L le"
  10.187 +  bottom ("\<bottom>") where "bottom == order_syntax.bottom L le"
  10.188  abbreviation (in total_order)
  10.189 -  top ("\<top>") "top == order_syntax.top L le"
  10.190 +  top ("\<top>") where "top == order_syntax.top L le"
  10.191  abbreviation (in total_order)
  10.192 -  bottom ("\<bottom>") "bottom == order_syntax.bottom L le"
  10.193 +  bottom ("\<bottom>") where "bottom == order_syntax.bottom L le"
  10.194  abbreviation (in complete_lattice)
  10.195 -  top ("\<top>") "top == order_syntax.top L le"
  10.196 +  top ("\<top>") where "top == order_syntax.top L le"
  10.197  abbreviation (in complete_lattice)
  10.198 -  bottom ("\<bottom>") "bottom == order_syntax.bottom L le"
  10.199 +  bottom ("\<bottom>") where "bottom == order_syntax.bottom L le"
  10.200  
  10.201  
  10.202  lemma (in complete_lattice) supI:
    11.1 --- a/src/HOL/Auth/CertifiedEmail.thy	Fri Nov 17 02:19:55 2006 +0100
    11.2 +++ b/src/HOL/Auth/CertifiedEmail.thy	Fri Nov 17 02:20:03 2006 +0100
    11.3 @@ -8,10 +8,11 @@
    11.4  theory CertifiedEmail imports Public begin
    11.5  
    11.6  abbreviation
    11.7 -  TTP :: agent
    11.8 +  TTP :: agent where
    11.9    "TTP == Server"
   11.10  
   11.11 -  RPwd :: "agent => key"
   11.12 +abbreviation
   11.13 +  RPwd :: "agent => key" where
   11.14    "RPwd == shrK"
   11.15  
   11.16   
    12.1 --- a/src/HOL/Auth/Event.thy	Fri Nov 17 02:19:55 2006 +0100
    12.2 +++ b/src/HOL/Auth/Event.thy	Fri Nov 17 02:20:03 2006 +0100
    12.3 @@ -29,7 +29,7 @@
    12.4  text{*The constant "spies" is retained for compatibility's sake*}
    12.5  
    12.6  abbreviation (input)
    12.7 -  spies  :: "event list => msg set"
    12.8 +  spies  :: "event list => msg set" where
    12.9    "spies == knows Spy"
   12.10  
   12.11  text{*Spy has access to his own key for spoof messages, but Server is secure*}
    13.1 --- a/src/HOL/Auth/Guard/Extensions.thy	Fri Nov 17 02:19:55 2006 +0100
    13.2 +++ b/src/HOL/Auth/Guard/Extensions.thy	Fri Nov 17 02:20:03 2006 +0100
    13.3 @@ -86,7 +86,7 @@
    13.4  by simp
    13.5  
    13.6  abbreviation
    13.7 -  not_MPair :: "msg => bool"
    13.8 +  not_MPair :: "msg => bool" where
    13.9    "not_MPair X == ~ is_MPair X"
   13.10  
   13.11  lemma is_MPairE: "[| is_MPair X ==> P; not_MPair X ==> P |] ==> P"
   13.12 @@ -370,7 +370,7 @@
   13.13     ))"
   13.14  
   13.15  abbreviation
   13.16 -  spies' :: "event list => msg set"
   13.17 +  spies' :: "event list => msg set" where
   13.18    "spies' == knows' Spy"
   13.19  
   13.20  subsubsection{*decomposition of knows into knows' and initState*}
   13.21 @@ -452,7 +452,7 @@
   13.22  "knows_max A evs == knows_max' A evs Un initState A"
   13.23  
   13.24  abbreviation
   13.25 -  spies_max :: "event list => msg set"
   13.26 +  spies_max :: "event list => msg set" where
   13.27    "spies_max evs == knows_max Spy evs"
   13.28  
   13.29  subsubsection{*basic facts about @{term knows_max}*}
    14.1 --- a/src/HOL/Auth/Guard/Guard.thy	Fri Nov 17 02:19:55 2006 +0100
    14.2 +++ b/src/HOL/Auth/Guard/Guard.thy	Fri Nov 17 02:20:03 2006 +0100
    14.3 @@ -163,7 +163,7 @@
    14.4  subsection{*set obtained by decrypting a message*}
    14.5  
    14.6  abbreviation (input)
    14.7 -  decrypt :: "msg set => key => msg => msg set"
    14.8 +  decrypt :: "msg set => key => msg => msg set" where
    14.9    "decrypt H K Y == insert Y (H - {Crypt K Y})"
   14.10  
   14.11  lemma analz_decrypt: "[| Crypt K Y:H; Key (invKey K):H; Nonce n:analz H |]
    15.1 --- a/src/HOL/Auth/Guard/GuardK.thy	Fri Nov 17 02:19:55 2006 +0100
    15.2 +++ b/src/HOL/Auth/Guard/GuardK.thy	Fri Nov 17 02:20:03 2006 +0100
    15.3 @@ -159,7 +159,7 @@
    15.4  subsection{*set obtained by decrypting a message*}
    15.5  
    15.6  abbreviation (input)
    15.7 -  decrypt :: "msg set => key => msg => msg set"
    15.8 +  decrypt :: "msg set => key => msg => msg set" where
    15.9    "decrypt H K Y == insert Y (H - {Crypt K Y})"
   15.10  
   15.11  lemma analz_decrypt: "[| Crypt K Y:H; Key (invKey K):H; Key n:analz H |]
    16.1 --- a/src/HOL/Auth/Guard/Guard_NS_Public.thy	Fri Nov 17 02:19:55 2006 +0100
    16.2 +++ b/src/HOL/Auth/Guard/Guard_NS_Public.thy	Fri Nov 17 02:20:03 2006 +0100
    16.3 @@ -18,19 +18,23 @@
    16.4  subsection{*messages used in the protocol*}
    16.5  
    16.6  abbreviation (input)
    16.7 -  ns1 :: "agent => agent => nat => event"
    16.8 +  ns1 :: "agent => agent => nat => event" where
    16.9    "ns1 A B NA == Says A B (Crypt (pubK B) {|Nonce NA, Agent A|})"
   16.10  
   16.11 -  ns1' :: "agent => agent => agent => nat => event"
   16.12 +abbreviation (input)
   16.13 +  ns1' :: "agent => agent => agent => nat => event" where
   16.14    "ns1' A' A B NA == Says A' B (Crypt (pubK B) {|Nonce NA, Agent A|})"
   16.15  
   16.16 -  ns2 :: "agent => agent => nat => nat => event"
   16.17 +abbreviation (input)
   16.18 +  ns2 :: "agent => agent => nat => nat => event" where
   16.19    "ns2 B A NA NB == Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|})"
   16.20  
   16.21 -  ns2' :: "agent => agent => agent => nat => nat => event"
   16.22 +abbreviation (input)
   16.23 +  ns2' :: "agent => agent => agent => nat => nat => event" where
   16.24    "ns2' B' B A NA NB == Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|})"
   16.25  
   16.26 -  ns3 :: "agent => agent => nat => event"
   16.27 +abbreviation (input)
   16.28 +  ns3 :: "agent => agent => nat => event" where
   16.29    "ns3 A B NB == Says A B (Crypt (pubK B) (Nonce NB))"
   16.30  
   16.31  
    17.1 --- a/src/HOL/Auth/Guard/Guard_OtwayRees.thy	Fri Nov 17 02:19:55 2006 +0100
    17.2 +++ b/src/HOL/Auth/Guard/Guard_OtwayRees.thy	Fri Nov 17 02:20:03 2006 +0100
    17.3 @@ -16,40 +16,48 @@
    17.4  subsection{*messages used in the protocol*}
    17.5  
    17.6  abbreviation
    17.7 -  nil :: "msg"
    17.8 +  nil :: "msg" where
    17.9    "nil == Number 0"
   17.10  
   17.11 -  or1 :: "agent => agent => nat => event"
   17.12 +abbreviation
   17.13 +  or1 :: "agent => agent => nat => event" where
   17.14    "or1 A B NA ==
   17.15      Says A B {|Nonce NA, Agent A, Agent B, Ciph A {|Nonce NA, Agent A, Agent B|}|}"
   17.16  
   17.17 -  or1' :: "agent => agent => agent => nat => msg => event"
   17.18 +abbreviation
   17.19 +  or1' :: "agent => agent => agent => nat => msg => event" where
   17.20    "or1' A' A B NA X == Says A' B {|Nonce NA, Agent A, Agent B, X|}"
   17.21  
   17.22 -  or2 :: "agent => agent => nat => nat => msg => event"
   17.23 +abbreviation
   17.24 +  or2 :: "agent => agent => nat => nat => msg => event" where
   17.25    "or2 A B NA NB X ==
   17.26      Says B Server {|Nonce NA, Agent A, Agent B, X,
   17.27                      Ciph B {|Nonce NA, Nonce NB, Agent A, Agent B|}|}"
   17.28  
   17.29 -  or2' :: "agent => agent => agent => nat => nat => event"
   17.30 +abbreviation
   17.31 +  or2' :: "agent => agent => agent => nat => nat => event" where
   17.32    "or2' B' A B NA NB ==
   17.33      Says B' Server {|Nonce NA, Agent A, Agent B,
   17.34                       Ciph A {|Nonce NA, Agent A, Agent B|},
   17.35                       Ciph B {|Nonce NA, Nonce NB, Agent A, Agent B|}|}"
   17.36  
   17.37 -  or3 :: "agent => agent => nat => nat => key => event"
   17.38 +abbreviation
   17.39 +  or3 :: "agent => agent => nat => nat => key => event" where
   17.40    "or3 A B NA NB K ==
   17.41      Says Server B {|Nonce NA, Ciph A {|Nonce NA, Key K|},
   17.42                      Ciph B {|Nonce NB, Key K|}|}"
   17.43  
   17.44 -  or3':: "agent => msg => agent => agent => nat => nat => key => event"
   17.45 +abbreviation
   17.46 +  or3':: "agent => msg => agent => agent => nat => nat => key => event" where
   17.47    "or3' S Y A B NA NB K ==
   17.48      Says S B {|Nonce NA, Y, Ciph B {|Nonce NB, Key K|}|}"
   17.49  
   17.50 -  or4 :: "agent => agent => nat => msg => event"
   17.51 +abbreviation
   17.52 +  or4 :: "agent => agent => nat => msg => event" where
   17.53    "or4 A B NA X == Says B A {|Nonce NA, X, nil|}"
   17.54  
   17.55 -  or4' :: "agent => agent => nat => key => event"
   17.56 +abbreviation
   17.57 +  or4' :: "agent => agent => nat => key => event" where
   17.58    "or4' B' A NA K == Says B' A {|Nonce NA, Ciph A {|Nonce NA, Key K|}, nil|}"
   17.59  
   17.60  subsection{*definition of the protocol*}
    18.1 --- a/src/HOL/Auth/Guard/Guard_Shared.thy	Fri Nov 17 02:19:55 2006 +0100
    18.2 +++ b/src/HOL/Auth/Guard/Guard_Shared.thy	Fri Nov 17 02:20:03 2006 +0100
    18.3 @@ -20,7 +20,7 @@
    18.4  subsubsection{*a little abbreviation*}
    18.5  
    18.6  abbreviation
    18.7 -  Ciph :: "agent => msg => msg"
    18.8 +  Ciph :: "agent => msg => msg" where
    18.9    "Ciph A X == Crypt (shrK A) X"
   18.10  
   18.11  subsubsection{*agent associated to a key*}
    19.1 --- a/src/HOL/Auth/Guard/Guard_Yahalom.thy	Fri Nov 17 02:19:55 2006 +0100
    19.2 +++ b/src/HOL/Auth/Guard/Guard_Yahalom.thy	Fri Nov 17 02:20:03 2006 +0100
    19.3 @@ -16,31 +16,38 @@
    19.4  subsection{*messages used in the protocol*}
    19.5  
    19.6  abbreviation (input)
    19.7 -  ya1 :: "agent => agent => nat => event"
    19.8 +  ya1 :: "agent => agent => nat => event" where
    19.9    "ya1 A B NA == Says A B {|Agent A, Nonce NA|}"
   19.10  
   19.11 -  ya1' :: "agent => agent => agent => nat => event"
   19.12 +abbreviation (input)
   19.13 +  ya1' :: "agent => agent => agent => nat => event" where
   19.14    "ya1' A' A B NA == Says A' B {|Agent A, Nonce NA|}"
   19.15  
   19.16 -  ya2 :: "agent => agent => nat => nat => event"
   19.17 +abbreviation (input)
   19.18 +  ya2 :: "agent => agent => nat => nat => event" where
   19.19    "ya2 A B NA NB == Says B Server {|Agent B, Ciph B {|Agent A, Nonce NA, Nonce NB|}|}"
   19.20  
   19.21 -  ya2' :: "agent => agent => agent => nat => nat => event"
   19.22 +abbreviation (input)
   19.23 +  ya2' :: "agent => agent => agent => nat => nat => event" where
   19.24    "ya2' B' A B NA NB == Says B' Server {|Agent B, Ciph B {|Agent A, Nonce NA, Nonce NB|}|}"
   19.25  
   19.26 -  ya3 :: "agent => agent => nat => nat => key => event"
   19.27 +abbreviation (input)
   19.28 +  ya3 :: "agent => agent => nat => nat => key => event" where
   19.29    "ya3 A B NA NB K ==
   19.30      Says Server A {|Ciph A {|Agent B, Key K, Nonce NA, Nonce NB|},
   19.31                      Ciph B {|Agent A, Key K|}|}"
   19.32  
   19.33 -  ya3':: "agent => msg => agent => agent => nat => nat => key => event"
   19.34 +abbreviation (input)
   19.35 +  ya3':: "agent => msg => agent => agent => nat => nat => key => event" where
   19.36    "ya3' S Y A B NA NB K ==
   19.37      Says S A {|Ciph A {|Agent B, Key K, Nonce NA, Nonce NB|}, Y|}"
   19.38  
   19.39 -  ya4 :: "agent => agent => nat => nat => msg => event"
   19.40 +abbreviation (input)
   19.41 +  ya4 :: "agent => agent => nat => nat => msg => event" where
   19.42    "ya4 A B K NB Y == Says A B {|Y, Crypt K (Nonce NB)|}"
   19.43  
   19.44 -  ya4' :: "agent => agent => nat => nat => msg => event"
   19.45 +abbreviation (input)
   19.46 +  ya4' :: "agent => agent => nat => nat => msg => event" where
   19.47    "ya4' A' B K NB Y == Says A' B {|Y, Crypt K (Nonce NB)|}"
   19.48  
   19.49  
    20.1 --- a/src/HOL/Auth/Guard/List_Msg.thy	Fri Nov 17 02:19:55 2006 +0100
    20.2 +++ b/src/HOL/Auth/Guard/List_Msg.thy	Fri Nov 17 02:20:03 2006 +0100
    20.3 @@ -18,7 +18,7 @@
    20.4  subsubsection{*nil is represented by any message which is not a pair*}
    20.5  
    20.6  abbreviation (input)
    20.7 -  cons :: "msg => msg => msg"
    20.8 +  cons :: "msg => msg => msg" where
    20.9    "cons x l == {|x,l|}"
   20.10  
   20.11  subsubsection{*induction principle*}
   20.12 @@ -134,7 +134,7 @@
   20.13  subsubsection{*set of well-formed agent-list messages*}
   20.14  
   20.15  abbreviation
   20.16 -  nil :: msg
   20.17 +  nil :: msg where
   20.18    "nil == Number 0"
   20.19  
   20.20  consts agl :: "msg set"
    21.1 --- a/src/HOL/Auth/Guard/Proto.thy	Fri Nov 17 02:19:55 2006 +0100
    21.2 +++ b/src/HOL/Auth/Guard/Proto.thy	Fri Nov 17 02:20:03 2006 +0100
    21.3 @@ -18,7 +18,7 @@
    21.4  types rule = "event set * event"
    21.5  
    21.6  abbreviation
    21.7 -  msg' :: "rule => msg"
    21.8 +  msg' :: "rule => msg" where
    21.9    "msg' R == msg (snd R)"
   21.10  
   21.11  types proto = "rule set"
   21.12 @@ -77,16 +77,19 @@
   21.13  "ap s (Notes A X) = Notes (agent s A) (apm s X)"
   21.14  
   21.15  abbreviation
   21.16 -  ap' :: "subs => rule => event"
   21.17 +  ap' :: "subs => rule => event" where
   21.18    "ap' s R == ap s (snd R)"
   21.19  
   21.20 -  apm' :: "subs => rule => msg"
   21.21 +abbreviation
   21.22 +  apm' :: "subs => rule => msg" where
   21.23    "apm' s R == apm s (msg' R)"
   21.24  
   21.25 -  priK' :: "subs => agent => key"
   21.26 +abbreviation
   21.27 +  priK' :: "subs => agent => key" where
   21.28    "priK' s A == priK (agent s A)"
   21.29  
   21.30 -  pubK' :: "subs => agent => key"
   21.31 +abbreviation
   21.32 +  pubK' :: "subs => agent => key" where
   21.33    "pubK' s A == pubK (agent s A)"
   21.34  
   21.35  subsection{*nonces generated by a rule*}
   21.36 @@ -380,14 +383,16 @@
   21.37  ns :: proto
   21.38  
   21.39  abbreviation
   21.40 -  ns1 :: rule
   21.41 +  ns1 :: rule where
   21.42    "ns1 == ({}, Says a b (Crypt (pubK b) {|Nonce Na, Agent a|}))"
   21.43  
   21.44 -  ns2 :: rule
   21.45 +abbreviation
   21.46 +  ns2 :: rule where
   21.47    "ns2 == ({Says a' b (Crypt (pubK b) {|Nonce Na, Agent a|})},
   21.48      Says b a (Crypt (pubK a) {|Nonce Na, Nonce Nb, Agent b|}))"
   21.49  
   21.50 -  ns3 :: rule
   21.51 +abbreviation
   21.52 +  ns3 :: rule where
   21.53    "ns3 == ({Says a b (Crypt (pubK b) {|Nonce Na, Agent a|}),
   21.54      Says b' a (Crypt (pubK a) {|Nonce Na, Nonce Nb, Agent b|})},
   21.55      Says a b (Crypt (pubK b) (Nonce Nb)))"
   21.56 @@ -398,10 +403,11 @@
   21.57  [iff]: "ns3:ns"
   21.58  
   21.59  abbreviation (input)
   21.60 -  ns3a :: event
   21.61 +  ns3a :: event where
   21.62    "ns3a == Says a b (Crypt (pubK b) {|Nonce Na, Agent a|})"
   21.63  
   21.64 -  ns3b :: event
   21.65 +abbreviation (input)
   21.66 +  ns3b :: event where
   21.67    "ns3b == Says b' a (Crypt (pubK a) {|Nonce Na, Nonce Nb, Agent b|})"
   21.68  
   21.69  constdefs keys :: "keyfun"
    22.1 --- a/src/HOL/Auth/KerberosIV.thy	Fri Nov 17 02:19:55 2006 +0100
    22.2 +++ b/src/HOL/Auth/KerberosIV.thy	Fri Nov 17 02:20:03 2006 +0100
    22.3 @@ -11,11 +11,10 @@
    22.4  text{*The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*}
    22.5  
    22.6  abbreviation
    22.7 -  Kas :: agent
    22.8 -  "Kas == Server"
    22.9 +  Kas :: agent where "Kas == Server"
   22.10  
   22.11 -  Tgs :: agent
   22.12 -  "Tgs == Friend 0"
   22.13 +abbreviation
   22.14 +  Tgs :: agent where "Tgs == Friend 0"
   22.15  
   22.16  
   22.17  axioms
   22.18 @@ -79,19 +78,23 @@
   22.19  
   22.20  abbreviation
   22.21    (*The current time is the length of the trace*)
   22.22 -  CT :: "event list=>nat"
   22.23 +  CT :: "event list=>nat" where
   22.24    "CT == length"
   22.25  
   22.26 -  expiredAK :: "[nat, event list] => bool"
   22.27 +abbreviation
   22.28 +  expiredAK :: "[nat, event list] => bool" where
   22.29    "expiredAK Ta evs == authKlife + Ta < CT evs"
   22.30  
   22.31 -  expiredSK :: "[nat, event list] => bool"
   22.32 +abbreviation
   22.33 +  expiredSK :: "[nat, event list] => bool" where
   22.34    "expiredSK Ts evs == servKlife + Ts < CT evs"
   22.35  
   22.36 -  expiredA :: "[nat, event list] => bool"
   22.37 +abbreviation
   22.38 +  expiredA :: "[nat, event list] => bool" where
   22.39    "expiredA T evs == authlife + T < CT evs"
   22.40  
   22.41 -  valid :: "[nat, nat] => bool" ("valid _ wrt _")
   22.42 +abbreviation
   22.43 +  valid :: "[nat, nat] => bool" ("valid _ wrt _") where
   22.44    "valid T1 wrt T2 == T1 <= replylife + T2"
   22.45  
   22.46  (*---------------------------------------------------------------------*)
    23.1 --- a/src/HOL/Auth/KerberosIV_Gets.thy	Fri Nov 17 02:19:55 2006 +0100
    23.2 +++ b/src/HOL/Auth/KerberosIV_Gets.thy	Fri Nov 17 02:20:03 2006 +0100
    23.3 @@ -11,11 +11,10 @@
    23.4  text{*The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*}
    23.5  
    23.6  abbreviation
    23.7 -  Kas :: agent
    23.8 -  "Kas == Server"
    23.9 +  Kas :: agent where "Kas == Server"
   23.10  
   23.11 -  Tgs :: agent
   23.12 -  "Tgs == Friend 0"
   23.13 +abbreviation
   23.14 +  Tgs :: agent where "Tgs == Friend 0"
   23.15  
   23.16  
   23.17  axioms
   23.18 @@ -67,19 +66,23 @@
   23.19  
   23.20  abbreviation
   23.21    (*The current time is just the length of the trace!*)
   23.22 -  CT :: "event list=>nat"
   23.23 +  CT :: "event list=>nat" where
   23.24    "CT == length"
   23.25  
   23.26 -  expiredAK :: "[nat, event list] => bool"
   23.27 +abbreviation
   23.28 +  expiredAK :: "[nat, event list] => bool" where
   23.29    "expiredAK Ta evs == authKlife + Ta < CT evs"
   23.30  
   23.31 -  expiredSK :: "[nat, event list] => bool"
   23.32 +abbreviation
   23.33 +  expiredSK :: "[nat, event list] => bool" where
   23.34    "expiredSK Ts evs == servKlife + Ts < CT evs"
   23.35  
   23.36 -  expiredA :: "[nat, event list] => bool"
   23.37 +abbreviation
   23.38 +  expiredA :: "[nat, event list] => bool" where
   23.39    "expiredA T evs == authlife + T < CT evs"
   23.40  
   23.41 -  valid :: "[nat, nat] => bool" ("valid _ wrt _")
   23.42 +abbreviation
   23.43 +  valid :: "[nat, nat] => bool" ("valid _ wrt _") where
   23.44    "valid T1 wrt T2 == T1 <= replylife + T2"
   23.45  
   23.46  (*---------------------------------------------------------------------*)
    24.1 --- a/src/HOL/Auth/KerberosV.thy	Fri Nov 17 02:19:55 2006 +0100
    24.2 +++ b/src/HOL/Auth/KerberosV.thy	Fri Nov 17 02:20:03 2006 +0100
    24.3 @@ -9,10 +9,11 @@
    24.4  text{*The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*}
    24.5  
    24.6  abbreviation
    24.7 -  Kas :: agent
    24.8 +  Kas :: agent where
    24.9    "Kas == Server"
   24.10  
   24.11 -  Tgs :: agent
   24.12 +abbreviation
   24.13 +  Tgs :: agent where
   24.14    "Tgs == Friend 0"
   24.15  
   24.16  
   24.17 @@ -68,19 +69,23 @@
   24.18  
   24.19  abbreviation
   24.20    (*The current time is just the length of the trace!*)
   24.21 -  CT :: "event list=>nat"
   24.22 +  CT :: "event list=>nat" where
   24.23    "CT == length"
   24.24  
   24.25 -  expiredAK :: "[nat, event list] => bool"
   24.26 +abbreviation
   24.27 +  expiredAK :: "[nat, event list] => bool" where
   24.28    "expiredAK T evs == authKlife + T < CT evs"
   24.29  
   24.30 -  expiredSK :: "[nat, event list] => bool"
   24.31 +abbreviation
   24.32 +  expiredSK :: "[nat, event list] => bool" where
   24.33    "expiredSK T evs == servKlife + T < CT evs"
   24.34  
   24.35 -  expiredA :: "[nat, event list] => bool"
   24.36 +abbreviation
   24.37 +  expiredA :: "[nat, event list] => bool" where
   24.38    "expiredA T evs == authlife + T < CT evs"
   24.39  
   24.40 -  valid :: "[nat, nat] => bool"  ("valid _ wrt _")
   24.41 +abbreviation
   24.42 +  valid :: "[nat, nat] => bool"  ("valid _ wrt _") where
   24.43    "valid T1 wrt T2 == T1 <= replylife + T2"
   24.44  
   24.45  (*---------------------------------------------------------------------*)
    25.1 --- a/src/HOL/Auth/Kerberos_BAN.thy	Fri Nov 17 02:19:55 2006 +0100
    25.2 +++ b/src/HOL/Auth/Kerberos_BAN.thy	Fri Nov 17 02:20:03 2006 +0100
    25.3 @@ -39,13 +39,15 @@
    25.4      by blast
    25.5  
    25.6  abbreviation
    25.7 -  CT :: "event list=>nat"
    25.8 +  CT :: "event list=>nat" where
    25.9    "CT == length "
   25.10  
   25.11 -  expiredK :: "[nat, event list] => bool"
   25.12 +abbreviation
   25.13 +  expiredK :: "[nat, event list] => bool" where
   25.14    "expiredK T evs == sesKlife + T < CT evs"
   25.15  
   25.16 -  expiredA :: "[nat, event list] => bool"
   25.17 +abbreviation
   25.18 +  expiredA :: "[nat, event list] => bool" where
   25.19    "expiredA T evs == authlife + T < CT evs"
   25.20  
   25.21  
    26.1 --- a/src/HOL/Auth/Kerberos_BAN_Gets.thy	Fri Nov 17 02:19:55 2006 +0100
    26.2 +++ b/src/HOL/Auth/Kerberos_BAN_Gets.thy	Fri Nov 17 02:20:03 2006 +0100
    26.3 @@ -40,13 +40,15 @@
    26.4  
    26.5  
    26.6  abbreviation
    26.7 -  CT :: "event list=>nat"
    26.8 +  CT :: "event list=>nat" where
    26.9    "CT == length"
   26.10  
   26.11 -  expiredK :: "[nat, event list] => bool"
   26.12 +abbreviation
   26.13 +  expiredK :: "[nat, event list] => bool" where
   26.14    "expiredK T evs == sesKlife + T < CT evs"
   26.15  
   26.16 -  expiredA :: "[nat, event list] => bool"
   26.17 +abbreviation
   26.18 +  expiredA :: "[nat, event list] => bool" where
   26.19    "expiredA T evs == authlife + T < CT evs"
   26.20  
   26.21  
    27.1 --- a/src/HOL/Auth/Public.thy	Fri Nov 17 02:19:55 2006 +0100
    27.2 +++ b/src/HOL/Auth/Public.thy	Fri Nov 17 02:20:03 2006 +0100
    27.3 @@ -21,19 +21,24 @@
    27.4    publicKey :: "[keymode,agent] => key"
    27.5  
    27.6  abbreviation
    27.7 -  pubEK :: "agent => key"
    27.8 +  pubEK :: "agent => key" where
    27.9    "pubEK == publicKey Encryption"
   27.10  
   27.11 -  pubSK :: "agent => key"
   27.12 +abbreviation
   27.13 +  pubSK :: "agent => key" where
   27.14    "pubSK == publicKey Signature"
   27.15  
   27.16 -  privateKey :: "[keymode, agent] => key"
   27.17 +abbreviation
   27.18 +  privateKey :: "[keymode, agent] => key" where
   27.19    "privateKey b A == invKey (publicKey b A)"
   27.20  
   27.21 +abbreviation
   27.22    (*BEWARE!! priEK, priSK DON'T WORK with inj, range, image, etc.*)
   27.23 -  priEK :: "agent => key"
   27.24 +  priEK :: "agent => key" where
   27.25    "priEK A == privateKey Encryption A"
   27.26 -  priSK :: "agent => key"
   27.27 +
   27.28 +abbreviation
   27.29 +  priSK :: "agent => key" where
   27.30    "priSK A == privateKey Signature A"
   27.31  
   27.32  
   27.33 @@ -41,10 +46,11 @@
   27.34  simple situation where the signature and encryption keys are the same.*}
   27.35  
   27.36  abbreviation
   27.37 -  pubK :: "agent => key"
   27.38 +  pubK :: "agent => key" where
   27.39    "pubK A == pubEK A"
   27.40  
   27.41 -  priK :: "agent => key"
   27.42 +abbreviation
   27.43 +  priK :: "agent => key" where
   27.44    "priK A == invKey (pubEK A)"
   27.45  
   27.46  
    28.1 --- a/src/HOL/Auth/Recur.thy	Fri Nov 17 02:19:55 2006 +0100
    28.2 +++ b/src/HOL/Auth/Recur.thy	Fri Nov 17 02:20:03 2006 +0100
    28.3 @@ -10,7 +10,7 @@
    28.4  
    28.5  text{*End marker for message bundles*}
    28.6  abbreviation
    28.7 -  END :: "msg"
    28.8 +  END :: "msg" where
    28.9    "END == Number 0"
   28.10  
   28.11  (*Two session keys are distributed to each agent except for the initiator,
    29.1 --- a/src/HOL/Auth/Smartcard/EventSC.thy	Fri Nov 17 02:19:55 2006 +0100
    29.2 +++ b/src/HOL/Auth/Smartcard/EventSC.thy	Fri Nov 17 02:20:03 2006 +0100
    29.3 @@ -25,7 +25,7 @@
    29.4   secureM :: "bool"(*assumption of secure means between agents and their cards*)
    29.5  
    29.6  abbreviation
    29.7 -  insecureM :: bool (*certain protocols make no assumption of secure means*)
    29.8 +  insecureM :: bool where (*certain protocols make no assumption of secure means*)
    29.9    "insecureM == \<not>secureM"
   29.10  
   29.11  
    30.1 --- a/src/HOL/Auth/TLS.thy	Fri Nov 17 02:19:55 2006 +0100
    30.2 +++ b/src/HOL/Auth/TLS.thy	Fri Nov 17 02:20:03 2006 +0100
    30.3 @@ -64,10 +64,11 @@
    30.4    sessionK :: "(nat*nat*nat) * role => key"
    30.5  
    30.6  abbreviation
    30.7 -  clientK :: "nat*nat*nat => key"
    30.8 +  clientK :: "nat*nat*nat => key" where
    30.9    "clientK X == sessionK(X, ClientRole)"
   30.10  
   30.11 -  serverK :: "nat*nat*nat => key"
   30.12 +abbreviation
   30.13 +  serverK :: "nat*nat*nat => key" where
   30.14    "serverK X == sessionK(X, ServerRole)"
   30.15  
   30.16  
    31.1 --- a/src/HOL/Auth/ZhouGollmann.thy	Fri Nov 17 02:19:55 2006 +0100
    31.2 +++ b/src/HOL/Auth/ZhouGollmann.thy	Fri Nov 17 02:20:03 2006 +0100
    31.3 @@ -13,17 +13,12 @@
    31.4  theory ZhouGollmann imports Public begin
    31.5  
    31.6  abbreviation
    31.7 -  TTP :: agent
    31.8 -  "TTP == Server"
    31.9 +  TTP :: agent where "TTP == Server"
   31.10  
   31.11 -  f_sub :: nat
   31.12 -  "f_sub == 5"
   31.13 -  f_nro :: nat
   31.14 -  "f_nro == 2"
   31.15 -  f_nrr :: nat
   31.16 -  "f_nrr == 3"
   31.17 -  f_con :: nat
   31.18 -  "f_con == 4"
   31.19 +abbreviation f_sub :: nat where "f_sub == 5"
   31.20 +abbreviation f_nro :: nat where "f_nro == 2"
   31.21 +abbreviation f_nrr :: nat where "f_nrr == 3"
   31.22 +abbreviation f_con :: nat where "f_con == 4"
   31.23  
   31.24  
   31.25  constdefs
    32.1 --- a/src/HOL/Bali/Example.thy	Fri Nov 17 02:19:55 2006 +0100
    32.2 +++ b/src/HOL/Bali/Example.thy	Fri Nov 17 02:20:03 2006 +0100
    32.3 @@ -87,31 +87,39 @@
    32.4    surj_label_:" \<exists>m. n = label_ m"
    32.5  
    32.6  abbreviation
    32.7 -  HasFoo :: qtname
    32.8 +  HasFoo :: qtname where
    32.9    "HasFoo == \<lparr>pid=java_lang,tid=TName (tnam_ HasFoo_)\<rparr>"
   32.10  
   32.11 -  Base :: qtname
   32.12 +abbreviation
   32.13 +  Base :: qtname where
   32.14    "Base == \<lparr>pid=java_lang,tid=TName (tnam_ Base_)\<rparr>"
   32.15  
   32.16 -  Ext :: qtname
   32.17 +abbreviation
   32.18 +  Ext :: qtname where
   32.19    "Ext == \<lparr>pid=java_lang,tid=TName (tnam_ Ext_)\<rparr>"
   32.20  
   32.21 -  Main :: qtname
   32.22 +abbreviation
   32.23 +  Main :: qtname where
   32.24    "Main == \<lparr>pid=java_lang,tid=TName (tnam_ Main_)\<rparr>"
   32.25  
   32.26 -  arr :: vname
   32.27 +abbreviation
   32.28 +  arr :: vname where
   32.29    "arr == (vnam_ arr_)"
   32.30  
   32.31 -  vee :: vname
   32.32 +abbreviation
   32.33 +  vee :: vname where
   32.34    "vee == (vnam_ vee_)"
   32.35  
   32.36 -  z :: vname
   32.37 +abbreviation
   32.38 +  z :: vname where
   32.39    "z == (vnam_ z_)"
   32.40  
   32.41 -  e :: vname
   32.42 +abbreviation
   32.43 +  e :: vname where
   32.44    "e == (vnam_ e_)"
   32.45  
   32.46 -  lab1:: label
   32.47 +abbreviation
   32.48 +  lab1:: label where
   32.49    "lab1 == label_ lab1_"
   32.50  
   32.51  
   32.52 @@ -261,7 +269,7 @@
   32.53  section "program"
   32.54  
   32.55  abbreviation
   32.56 -  tprg :: prog
   32.57 +  tprg :: prog where
   32.58    "tprg == \<lparr>ifaces=Ifaces,classes=Classes\<rparr>"
   32.59  
   32.60  constdefs
   32.61 @@ -1195,11 +1203,10 @@
   32.62    b :: loc
   32.63    c :: loc
   32.64  
   32.65 -abbreviation
   32.66 -  "one == Suc 0"
   32.67 -  "two == Suc one"
   32.68 -  "tree == Suc two"
   32.69 -  "four == Suc tree"
   32.70 +abbreviation "one == Suc 0"
   32.71 +abbreviation "two == Suc one"
   32.72 +abbreviation "tree == Suc two"
   32.73 +abbreviation "four == Suc tree"
   32.74  
   32.75  syntax
   32.76    obj_a :: obj
    33.1 --- a/src/HOL/Code_Generator.thy	Fri Nov 17 02:19:55 2006 +0100
    33.2 +++ b/src/HOL/Code_Generator.thy	Fri Nov 17 02:20:03 2006 +0100
    33.3 @@ -175,7 +175,7 @@
    33.4  text {* lazy @{const If} *}
    33.5  
    33.6  definition
    33.7 -  if_delayed :: "bool \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> 'a"
    33.8 +  if_delayed :: "bool \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> (bool \<Rightarrow> 'a) \<Rightarrow> 'a" where
    33.9    "if_delayed b f g = (if b then f True else g False)"
   33.10  
   33.11  lemma [code func]:
    34.1 --- a/src/HOL/Complex/CLim.thy	Fri Nov 17 02:19:55 2006 +0100
    34.2 +++ b/src/HOL/Complex/CLim.thy	Fri Nov 17 02:20:03 2006 +0100
    34.3 @@ -34,43 +34,50 @@
    34.4  done
    34.5  
    34.6  abbreviation
    34.7 -
    34.8    CLIM :: "[complex=>complex,complex,complex] => bool"
    34.9 -				("((_)/ -- (_)/ --C> (_))" [60, 0, 60] 60)
   34.10 +				("((_)/ -- (_)/ --C> (_))" [60, 0, 60] 60) where
   34.11    "CLIM == LIM"
   34.12  
   34.13 +abbreviation
   34.14    NSCLIM :: "[complex=>complex,complex,complex] => bool"
   34.15 -			      ("((_)/ -- (_)/ --NSC> (_))" [60, 0, 60] 60)
   34.16 +			      ("((_)/ -- (_)/ --NSC> (_))" [60, 0, 60] 60) where
   34.17    "NSCLIM == NSLIM"
   34.18  
   34.19 +abbreviation
   34.20    (* f: C --> R *)
   34.21    CRLIM :: "[complex=>real,complex,real] => bool"
   34.22 -				("((_)/ -- (_)/ --CR> (_))" [60, 0, 60] 60)
   34.23 +				("((_)/ -- (_)/ --CR> (_))" [60, 0, 60] 60) where
   34.24    "CRLIM == LIM"
   34.25  
   34.26 +abbreviation
   34.27    NSCRLIM :: "[complex=>real,complex,real] => bool"
   34.28 -			      ("((_)/ -- (_)/ --NSCR> (_))" [60, 0, 60] 60)
   34.29 +			      ("((_)/ -- (_)/ --NSCR> (_))" [60, 0, 60] 60) where
   34.30    "NSCRLIM == NSLIM"
   34.31  
   34.32 -
   34.33 -  isContc :: "[complex=>complex,complex] => bool"
   34.34 +abbreviation
   34.35 +  isContc :: "[complex=>complex,complex] => bool" where
   34.36    "isContc == isCont"
   34.37  
   34.38 +abbreviation
   34.39    (* NS definition dispenses with limit notions *)
   34.40 -  isNSContc :: "[complex=>complex,complex] => bool"
   34.41 +  isNSContc :: "[complex=>complex,complex] => bool" where
   34.42    "isNSContc == isNSCont"
   34.43  
   34.44 -  isContCR :: "[complex=>real,complex] => bool"
   34.45 +abbreviation
   34.46 +  isContCR :: "[complex=>real,complex] => bool" where
   34.47    "isContCR == isCont"
   34.48  
   34.49 +abbreviation
   34.50    (* NS definition dispenses with limit notions *)
   34.51 -  isNSContCR :: "[complex=>real,complex] => bool"
   34.52 +  isNSContCR :: "[complex=>real,complex] => bool" where
   34.53    "isNSContCR == isNSCont"
   34.54  
   34.55 -  isUContc :: "(complex=>complex) => bool"
   34.56 +abbreviation
   34.57 +  isUContc :: "(complex=>complex) => bool" where
   34.58    "isUContc == isUCont"
   34.59  
   34.60 -  isNSUContc :: "(complex=>complex) => bool"
   34.61 +abbreviation
   34.62 +  isNSUContc :: "(complex=>complex) => bool" where
   34.63    "isNSUContc == isNSUCont"
   34.64  
   34.65  
   34.66 @@ -129,25 +136,27 @@
   34.67  by (rule isNSUCont_def)
   34.68  
   34.69  
   34.70 +  (* differentiation: D is derivative of function f at x *)
   34.71  definition
   34.72 -
   34.73 -  (* differentiation: D is derivative of function f at x *)
   34.74    cderiv:: "[complex=>complex,complex,complex] => bool"
   34.75 -			    ("(CDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
   34.76 +			    ("(CDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60) where
   34.77    "CDERIV f x :> D = ((%h. (f(x + h) - f(x))/h) -- 0 --C> D)"
   34.78  
   34.79 +definition
   34.80    nscderiv :: "[complex=>complex,complex,complex] => bool"
   34.81 -			    ("(NSCDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
   34.82 +			    ("(NSCDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60) where
   34.83    "NSCDERIV f x :> D = (\<forall>h \<in> Infinitesimal - {0}.
   34.84  			      (( *f* f)(hcomplex_of_complex x + h)
   34.85          			 - hcomplex_of_complex (f x))/h @= hcomplex_of_complex D)"
   34.86  
   34.87 +definition
   34.88    cdifferentiable :: "[complex=>complex,complex] => bool"
   34.89 -                     (infixl "cdifferentiable" 60)
   34.90 +                     (infixl "cdifferentiable" 60) where
   34.91    "f cdifferentiable x = (\<exists>D. CDERIV f x :> D)"
   34.92  
   34.93 +definition
   34.94    NSCdifferentiable :: "[complex=>complex,complex] => bool"
   34.95 -                        (infixl "NSCdifferentiable" 60)
   34.96 +                        (infixl "NSCdifferentiable" 60) where
   34.97    "f NSCdifferentiable x = (\<exists>D. NSCDERIV f x :> D)"
   34.98  
   34.99  
    35.1 --- a/src/HOL/Complex/Complex.thy	Fri Nov 17 02:19:55 2006 +0100
    35.2 +++ b/src/HOL/Complex/Complex.thy	Fri Nov 17 02:20:03 2006 +0100
    35.3 @@ -235,7 +235,7 @@
    35.4  subsection{*Embedding Properties for @{term complex_of_real} Map*}
    35.5  
    35.6  abbreviation
    35.7 -  complex_of_real :: "real => complex"
    35.8 +  complex_of_real :: "real => complex" where
    35.9    "complex_of_real == of_real"
   35.10  
   35.11  lemma complex_of_real_def: "complex_of_real r = Complex r 0"
   35.12 @@ -321,7 +321,7 @@
   35.13  subsection{*Conjugation is an Automorphism*}
   35.14  
   35.15  definition
   35.16 -  cnj :: "complex => complex"
   35.17 +  cnj :: "complex => complex" where
   35.18    "cnj z = Complex (Re z) (-Im z)"
   35.19  
   35.20  lemma complex_cnj: "cnj (Complex x y) = Complex x (-y)"
   35.21 @@ -385,7 +385,7 @@
   35.22    complex_norm_def: "norm z == sqrt(Re(z) ^ 2 + Im(z) ^ 2)"
   35.23  
   35.24  abbreviation
   35.25 -  cmod :: "complex => real"
   35.26 +  cmod :: "complex => real" where
   35.27    "cmod == norm"
   35.28  
   35.29  lemmas cmod_def = complex_norm_def
   35.30 @@ -575,10 +575,11 @@
   35.31  definition
   35.32    (*------------ Argand -------------*)
   35.33  
   35.34 -  sgn :: "complex => complex"
   35.35 +  sgn :: "complex => complex" where
   35.36    "sgn z = z / complex_of_real(cmod z)"
   35.37  
   35.38 -  arg :: "complex => real"
   35.39 +definition
   35.40 +  arg :: "complex => real" where
   35.41    "arg z = (SOME a. Re(sgn z) = cos a & Im(sgn z) = sin a & -pi < a & a \<le> pi)"
   35.42  
   35.43  lemma sgn_zero [simp]: "sgn 0 = 0"
   35.44 @@ -671,15 +672,17 @@
   35.45  definition
   35.46  
   35.47    (* abbreviation for (cos a + i sin a) *)
   35.48 -  cis :: "real => complex"
   35.49 +  cis :: "real => complex" where
   35.50    "cis a = Complex (cos a) (sin a)"
   35.51  
   35.52 +definition
   35.53    (* abbreviation for r*(cos a + i sin a) *)
   35.54 -  rcis :: "[real, real] => complex"
   35.55 +  rcis :: "[real, real] => complex" where
   35.56    "rcis r a = complex_of_real r * cis a"
   35.57  
   35.58 +definition
   35.59    (* e ^ (x + iy) *)
   35.60 -  expi :: "complex => complex"
   35.61 +  expi :: "complex => complex" where
   35.62    "expi z = complex_of_real(exp (Re z)) * cis (Im z)"
   35.63  
   35.64  lemma complex_split_polar:
    36.1 --- a/src/HOL/Complex/NSCA.thy	Fri Nov 17 02:19:55 2006 +0100
    36.2 +++ b/src/HOL/Complex/NSCA.thy	Fri Nov 17 02:20:03 2006 +0100
    36.3 @@ -11,10 +11,11 @@
    36.4  
    36.5  definition
    36.6     (* standard complex numbers reagarded as an embedded subset of NS complex *)
    36.7 -   SComplex  :: "hcomplex set"
    36.8 +   SComplex  :: "hcomplex set" where
    36.9     "SComplex = {x. \<exists>r. x = hcomplex_of_complex r}"
   36.10  
   36.11 -   stc :: "hcomplex => hcomplex"
   36.12 +definition
   36.13 +   stc :: "hcomplex => hcomplex" where
   36.14      --{* standard part map*}
   36.15     "stc x = (SOME r. x \<in> HFinite & r:SComplex & r @= x)"
   36.16  
    37.1 --- a/src/HOL/Complex/NSComplex.thy	Fri Nov 17 02:19:55 2006 +0100
    37.2 +++ b/src/HOL/Complex/NSComplex.thy	Fri Nov 17 02:20:03 2006 +0100
    37.3 @@ -14,63 +14,74 @@
    37.4  types hcomplex = "complex star"
    37.5  
    37.6  abbreviation
    37.7 -  hcomplex_of_complex :: "complex => complex star"
    37.8 +  hcomplex_of_complex :: "complex => complex star" where
    37.9    "hcomplex_of_complex == star_of"
   37.10  
   37.11 -  hcmod :: "complex star => real star"
   37.12 +abbreviation
   37.13 +  hcmod :: "complex star => real star" where
   37.14    "hcmod == hnorm"
   37.15  
   37.16 -definition
   37.17  
   37.18    (*--- real and Imaginary parts ---*)
   37.19  
   37.20 -  hRe :: "hcomplex => hypreal"
   37.21 +definition
   37.22 +  hRe :: "hcomplex => hypreal" where
   37.23    "hRe = *f* Re"
   37.24  
   37.25 -  hIm :: "hcomplex => hypreal"
   37.26 +definition
   37.27 +  hIm :: "hcomplex => hypreal" where
   37.28    "hIm = *f* Im"
   37.29  
   37.30  
   37.31    (*------ imaginary unit ----------*)
   37.32  
   37.33 -  iii :: hcomplex
   37.34 +definition
   37.35 +  iii :: hcomplex where
   37.36    "iii = star_of ii"
   37.37  
   37.38    (*------- complex conjugate ------*)
   37.39  
   37.40 -  hcnj :: "hcomplex => hcomplex"
   37.41 +definition
   37.42 +  hcnj :: "hcomplex => hcomplex" where
   37.43    "hcnj = *f* cnj"
   37.44  
   37.45    (*------------ Argand -------------*)
   37.46  
   37.47 -  hsgn :: "hcomplex => hcomplex"
   37.48 +definition
   37.49 +  hsgn :: "hcomplex => hcomplex" where
   37.50    "hsgn = *f* sgn"
   37.51  
   37.52 -  harg :: "hcomplex => hypreal"
   37.53 +definition
   37.54 +  harg :: "hcomplex => hypreal" where
   37.55    "harg = *f* arg"
   37.56  
   37.57 +definition
   37.58    (* abbreviation for (cos a + i sin a) *)
   37.59 -  hcis :: "hypreal => hcomplex"
   37.60 +  hcis :: "hypreal => hcomplex" where
   37.61    "hcis = *f* cis"
   37.62  
   37.63    (*----- injection from hyperreals -----*)
   37.64  
   37.65 -  hcomplex_of_hypreal :: "hypreal => hcomplex"
   37.66 +definition
   37.67 +  hcomplex_of_hypreal :: "hypreal => hcomplex" where
   37.68    "hcomplex_of_hypreal = *f* complex_of_real"
   37.69  
   37.70 +definition
   37.71    (* abbreviation for r*(cos a + i sin a) *)
   37.72 -  hrcis :: "[hypreal, hypreal] => hcomplex"
   37.73 +  hrcis :: "[hypreal, hypreal] => hcomplex" where
   37.74    "hrcis = *f2* rcis"
   37.75  
   37.76    (*------------ e ^ (x + iy) ------------*)
   37.77 -
   37.78 -  hexpi :: "hcomplex => hcomplex"
   37.79 +definition
   37.80 +  hexpi :: "hcomplex => hcomplex" where
   37.81    "hexpi = *f* expi"
   37.82  
   37.83 -  HComplex :: "[hypreal,hypreal] => hcomplex"
   37.84 +definition
   37.85 +  HComplex :: "[hypreal,hypreal] => hcomplex" where
   37.86    "HComplex = *f2* Complex"
   37.87  
   37.88 -  hcpow :: "[hcomplex,hypnat] => hcomplex"  (infixr "hcpow" 80)
   37.89 +definition
   37.90 +  hcpow :: "[hcomplex,hypnat] => hcomplex"  (infixr "hcpow" 80) where
   37.91    "(z::hcomplex) hcpow (n::hypnat) = ( *f2* op ^) z n"
   37.92  
   37.93  lemmas hcomplex_defs [transfer_unfold] =
    38.1 --- a/src/HOL/Complex/ex/NSPrimes.thy	Fri Nov 17 02:19:55 2006 +0100
    38.2 +++ b/src/HOL/Complex/ex/NSPrimes.thy	Fri Nov 17 02:20:03 2006 +0100
    38.3 @@ -14,13 +14,15 @@
    38.4  primes by considering a property of nonstandard sets.*}
    38.5  
    38.6  definition
    38.7 -  hdvd  :: "[hypnat, hypnat] => bool"       (infixl "hdvd" 50)
    38.8 +  hdvd  :: "[hypnat, hypnat] => bool"       (infixl "hdvd" 50) where
    38.9    [transfer_unfold]: "(M::hypnat) hdvd N = ( *p2* (op dvd)) M N"
   38.10  
   38.11 -  starprime :: "hypnat set"
   38.12 +definition
   38.13 +  starprime :: "hypnat set" where
   38.14    [transfer_unfold]: "starprime = ( *s* {p. prime p})"
   38.15  
   38.16 -  choicefun :: "'a set => 'a"
   38.17 +definition
   38.18 +  choicefun :: "'a set => 'a" where
   38.19    "choicefun E = (@x. \<exists>X \<in> Pow(E) -{{}}. x : X)"
   38.20  
   38.21  consts injf_max :: "nat => ('a::{order} set) => 'a"
    39.1 --- a/src/HOL/Complex/ex/Sqrt.thy	Fri Nov 17 02:19:55 2006 +0100
    39.2 +++ b/src/HOL/Complex/ex/Sqrt.thy	Fri Nov 17 02:20:03 2006 +0100
    39.3 @@ -18,7 +18,7 @@
    39.4  *}
    39.5  
    39.6  definition
    39.7 -  rationals  ("\<rat>")
    39.8 +  rationals  ("\<rat>") where
    39.9    "\<rat> = {x. \<exists>m n. n \<noteq> 0 \<and> \<bar>x\<bar> = real (m::nat) / real (n::nat)}"
   39.10  
   39.11  theorem rationals_rep [elim?]:
    40.1 --- a/src/HOL/Complex/ex/Sqrt_Script.thy	Fri Nov 17 02:19:55 2006 +0100
    40.2 +++ b/src/HOL/Complex/ex/Sqrt_Script.thy	Fri Nov 17 02:20:03 2006 +0100
    40.3 @@ -53,7 +53,7 @@
    40.4  subsection {* The set of rational numbers *}
    40.5  
    40.6  definition
    40.7 -  rationals :: "real set"    ("\<rat>")
    40.8 +  rationals :: "real set"    ("\<rat>") where
    40.9    "\<rat> = {x. \<exists>m n. n \<noteq> 0 \<and> \<bar>x\<bar> = real (m::nat) / real (n::nat)}"
   40.10  
   40.11  
    41.1 --- a/src/HOL/Datatype.thy	Fri Nov 17 02:19:55 2006 +0100
    41.2 +++ b/src/HOL/Datatype.thy	Fri Nov 17 02:20:03 2006 +0100
    41.3 @@ -726,7 +726,7 @@
    41.4  subsubsection {* Code generator setup *}
    41.5  
    41.6  definition
    41.7 -  is_none :: "'a option \<Rightarrow> bool"
    41.8 +  is_none :: "'a option \<Rightarrow> bool" where
    41.9    is_none_none [normal post, symmetric, code inline]: "is_none x \<longleftrightarrow> x = None"
   41.10  
   41.11  lemma is_none_code [code]:
    42.1 --- a/src/HOL/Equiv_Relations.thy	Fri Nov 17 02:19:55 2006 +0100
    42.2 +++ b/src/HOL/Equiv_Relations.thy	Fri Nov 17 02:20:03 2006 +0100
    42.3 @@ -164,7 +164,8 @@
    42.4    assumes congruent: "(y,z) \<in> r ==> f y = f z"
    42.5  
    42.6  abbreviation
    42.7 -  RESPECTS :: "('a => 'b) => ('a * 'a) set => bool"  (infixr "respects" 80)
    42.8 +  RESPECTS :: "('a => 'b) => ('a * 'a) set => bool"
    42.9 +    (infixr "respects" 80) where
   42.10    "f respects r == congruent r f"
   42.11  
   42.12  
   42.13 @@ -222,7 +223,8 @@
   42.14  
   42.15  text{*Abbreviation for the common case where the relations are identical*}
   42.16  abbreviation
   42.17 -  RESPECTS2:: "['a => 'a => 'b, ('a * 'a)set] => bool" (infixr "respects2 " 80)
   42.18 +  RESPECTS2:: "['a => 'a => 'b, ('a * 'a) set] => bool"
   42.19 +    (infixr "respects2 " 80) where
   42.20    "f respects2 r == congruent2 r r f"
   42.21  
   42.22  
    43.1 --- a/src/HOL/Extraction/Pigeonhole.thy	Fri Nov 17 02:19:55 2006 +0100
    43.2 +++ b/src/HOL/Extraction/Pigeonhole.thy	Fri Nov 17 02:20:03 2006 +0100
    43.3 @@ -302,9 +302,10 @@
    43.4  ML "PH.pigeonhole 8 (PH.sel [0,1,2,3,4,5,6,3,7,8])"
    43.5  
    43.6  definition
    43.7 -  arbitrary_nat :: "nat \<times> nat"
    43.8 +  arbitrary_nat :: "nat \<times> nat" where
    43.9    [symmetric, code inline]: "arbitrary_nat = arbitrary"
   43.10 -  arbitrary_nat_subst :: "nat \<times> nat"
   43.11 +definition
   43.12 +  arbitrary_nat_subst :: "nat \<times> nat" where
   43.13    "arbitrary_nat_subst = (0, 0)"
   43.14  
   43.15  code_axioms
   43.16 @@ -312,6 +313,7 @@
   43.17  
   43.18  definition
   43.19    "test n = pigeonhole n (\<lambda>m. m - 1)"
   43.20 +definition
   43.21    "test' n = pigeonhole_slow n (\<lambda>m. m - 1)"
   43.22  
   43.23  code_gen test test' "op !" (SML *)
    44.1 --- a/src/HOL/Finite_Set.thy	Fri Nov 17 02:19:55 2006 +0100
    44.2 +++ b/src/HOL/Finite_Set.thy	Fri Nov 17 02:20:03 2006 +0100
    44.3 @@ -803,7 +803,7 @@
    44.4    "setsum f A == if finite A then fold (op +) f 0 A else 0"
    44.5  
    44.6  abbreviation
    44.7 -  Setsum  ("\<Sum>_" [1000] 999)
    44.8 +  Setsum  ("\<Sum>_" [1000] 999) where
    44.9    "\<Sum>A == setsum (%x. x) A"
   44.10  
   44.11  text{* Now: lot's of fancy syntax. First, @{term "setsum (%x. e) A"} is
   44.12 @@ -1275,7 +1275,7 @@
   44.13    "setprod f A == if finite A then fold (op *) f 1 A else 1"
   44.14  
   44.15  abbreviation
   44.16 -  Setprod  ("\<Prod>_" [1000] 999)
   44.17 +  Setprod  ("\<Prod>_" [1000] 999) where
   44.18    "\<Prod>A == setprod (%x. x) A"
   44.19  
   44.20  syntax
    45.1 --- a/src/HOL/FixedPoint.thy	Fri Nov 17 02:19:55 2006 +0100
    45.2 +++ b/src/HOL/FixedPoint.thy	Fri Nov 17 02:20:03 2006 +0100
    45.3 @@ -20,12 +20,13 @@
    45.4  defs Sup_def: "Sup A == Meet {b. \<forall>a \<in> A. a <= b}"
    45.5  
    45.6  definition
    45.7 - SUP :: "('a \<Rightarrow> 'b::order) \<Rightarrow> 'b" (binder "SUP " 10)
    45.8 -"SUP x. f x == Sup (f ` UNIV)"
    45.9 +  SUP :: "('a \<Rightarrow> 'b::order) \<Rightarrow> 'b"  (binder "SUP " 10) where
   45.10 +  "SUP x. f x == Sup (f ` UNIV)"
   45.11 +
   45.12  (*
   45.13  abbreviation
   45.14 - bot :: "'a::order"
   45.15 -"bot == Sup {}"
   45.16 +  bot :: "'a::order" where
   45.17 +  "bot == Sup {}"
   45.18  *)
   45.19  axclass comp_lat < order
   45.20    Meet_lower: "x \<in> A \<Longrightarrow> Meet A <= x"
    46.1 --- a/src/HOL/FunDef.thy	Fri Nov 17 02:19:55 2006 +0100
    46.2 +++ b/src/HOL/FunDef.thy	Fri Nov 17 02:20:03 2006 +0100
    46.3 @@ -108,7 +108,7 @@
    46.4  section {* Definitions with default value *}
    46.5  
    46.6  definition
    46.7 -  THE_default :: "'a \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> 'a"
    46.8 +  THE_default :: "'a \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> 'a" where
    46.9    "THE_default d P = (if (\<exists>!x. P x) then (THE x. P x) else d)"
   46.10  
   46.11  lemma THE_defaultI': "\<exists>!x. P x \<Longrightarrow> P (THE_default d P)"
   46.12 @@ -178,9 +178,9 @@
   46.13  inductive rpg
   46.14  intros
   46.15    "(Inr y, y) : rpg"
   46.16 -definition
   46.17 -  "lproj x = (THE y. (x,y) : lpg)"
   46.18 -  "rproj x = (THE y. (x,y) : rpg)"
   46.19 +
   46.20 +definition "lproj x = (THE y. (x,y) : lpg)"
   46.21 +definition "rproj x = (THE y. (x,y) : rpg)"
   46.22  
   46.23  lemma lproj_inl:
   46.24    "lproj (Inl x) = x"
    47.1 --- a/src/HOL/HOL.thy	Fri Nov 17 02:19:55 2006 +0100
    47.2 +++ b/src/HOL/HOL.thy	Fri Nov 17 02:20:03 2006 +0100
    47.3 @@ -58,27 +58,27 @@
    47.4    "op ="  (infix "=" 50)
    47.5  
    47.6  abbreviation
    47.7 -  not_equal     :: "['a, 'a] => bool"               (infixl "~=" 50)
    47.8 +  not_equal :: "['a, 'a] => bool"  (infixl "~=" 50) where
    47.9    "x ~= y == ~ (x = y)"
   47.10  
   47.11  notation (output)
   47.12    not_equal  (infix "~=" 50)
   47.13  
   47.14  notation (xsymbols)
   47.15 -  Not  ("\<not> _" [40] 40)
   47.16 -  "op &"  (infixr "\<and>" 35)
   47.17 -  "op |"  (infixr "\<or>" 30)
   47.18 -  "op -->"  (infixr "\<longrightarrow>" 25)
   47.19 +  Not  ("\<not> _" [40] 40) and
   47.20 +  "op &"  (infixr "\<and>" 35) and
   47.21 +  "op |"  (infixr "\<or>" 30) and
   47.22 +  "op -->"  (infixr "\<longrightarrow>" 25) and
   47.23    not_equal  (infix "\<noteq>" 50)
   47.24  
   47.25  notation (HTML output)
   47.26 -  Not  ("\<not> _" [40] 40)
   47.27 -  "op &"  (infixr "\<and>" 35)
   47.28 -  "op |"  (infixr "\<or>" 30)
   47.29 +  Not  ("\<not> _" [40] 40) and
   47.30 +  "op &"  (infixr "\<and>" 35) and
   47.31 +  "op |"  (infixr "\<or>" 30) and
   47.32    not_equal  (infix "\<noteq>" 50)
   47.33  
   47.34  abbreviation (iff)
   47.35 -  iff :: "[bool, bool] => bool"  (infixr "<->" 25)
   47.36 +  iff :: "[bool, bool] => bool"  (infixr "<->" 25) where
   47.37    "A <-> B == A = B"
   47.38  
   47.39  notation (xsymbols)
    48.1 --- a/src/HOL/Hyperreal/Deriv.thy	Fri Nov 17 02:19:55 2006 +0100
    48.2 +++ b/src/HOL/Hyperreal/Deriv.thy	Fri Nov 17 02:20:03 2006 +0100
    48.3 @@ -15,26 +15,29 @@
    48.4  text{*Standard and Nonstandard Definitions*}
    48.5  
    48.6  definition
    48.7 -
    48.8    deriv :: "[real \<Rightarrow> 'a::real_normed_vector, real, 'a] \<Rightarrow> bool"
    48.9      --{*Differentiation: D is derivative of function f at x*}
   48.10 -          ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
   48.11 +          ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) where
   48.12    "DERIV f x :> D = ((%h. (f(x + h) - f x) /# h) -- 0 --> D)"
   48.13  
   48.14 +definition
   48.15    nsderiv :: "[real=>real,real,real] => bool"
   48.16 -          ("(NSDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
   48.17 +          ("(NSDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) where
   48.18    "NSDERIV f x :> D = (\<forall>h \<in> Infinitesimal - {0}.
   48.19        (( *f* f)(hypreal_of_real x + h)
   48.20         - hypreal_of_real (f x))/h @= hypreal_of_real D)"
   48.21  
   48.22 -  differentiable :: "[real=>real,real] => bool"   (infixl "differentiable" 60)
   48.23 +definition
   48.24 +  differentiable :: "[real=>real,real] => bool"   (infixl "differentiable" 60) where
   48.25    "f differentiable x = (\<exists>D. DERIV f x :> D)"
   48.26  
   48.27 +definition
   48.28    NSdifferentiable :: "[real=>real,real] => bool"
   48.29 -                       (infixl "NSdifferentiable" 60)
   48.30 +                       (infixl "NSdifferentiable" 60) where
   48.31    "f NSdifferentiable x = (\<exists>D. NSDERIV f x :> D)"
   48.32  
   48.33 -  increment :: "[real=>real,real,hypreal] => hypreal"
   48.34 +definition
   48.35 +  increment :: "[real=>real,real,hypreal] => hypreal" where
   48.36    "increment f x h = (@inc. f NSdifferentiable x &
   48.37             inc = ( *f* f)(hypreal_of_real x + h) - hypreal_of_real (f x))"
   48.38  
    49.1 --- a/src/HOL/Hyperreal/HLog.thy	Fri Nov 17 02:19:55 2006 +0100
    49.2 +++ b/src/HOL/Hyperreal/HLog.thy	Fri Nov 17 02:20:03 2006 +0100
    49.3 @@ -19,10 +19,11 @@
    49.4  
    49.5  
    49.6  definition
    49.7 -  powhr  :: "[hypreal,hypreal] => hypreal"     (infixr "powhr" 80)
    49.8 +  powhr  :: "[hypreal,hypreal] => hypreal"     (infixr "powhr" 80) where
    49.9    "x powhr a = starfun2 (op powr) x a"
   49.10    
   49.11 -  hlog :: "[hypreal,hypreal] => hypreal"
   49.12 +definition
   49.13 +  hlog :: "[hypreal,hypreal] => hypreal" where
   49.14    "hlog a x = starfun2 log a x"
   49.15  
   49.16  declare powhr_def [transfer_unfold]
    50.1 --- a/src/HOL/Hyperreal/HSeries.thy	Fri Nov 17 02:19:55 2006 +0100
    50.2 +++ b/src/HOL/Hyperreal/HSeries.thy	Fri Nov 17 02:20:03 2006 +0100
    50.3 @@ -12,17 +12,20 @@
    50.4  begin
    50.5  
    50.6  definition
    50.7 -  sumhr :: "(hypnat * hypnat * (nat=>real)) => hypreal"
    50.8 +  sumhr :: "(hypnat * hypnat * (nat=>real)) => hypreal" where
    50.9    "sumhr = 
   50.10        (%(M,N,f). starfun2 (%m n. setsum f {m..<n}) M N)"
   50.11  
   50.12 -  NSsums  :: "[nat=>real,real] => bool"     (infixr "NSsums" 80)
   50.13 +definition
   50.14 +  NSsums  :: "[nat=>real,real] => bool"     (infixr "NSsums" 80) where
   50.15    "f NSsums s = (%n. setsum f {0..<n}) ----NS> s"
   50.16  
   50.17 -  NSsummable :: "(nat=>real) => bool"
   50.18 +definition
   50.19 +  NSsummable :: "(nat=>real) => bool" where
   50.20    "NSsummable f = (\<exists>s. f NSsums s)"
   50.21  
   50.22 -  NSsuminf   :: "(nat=>real) => real"
   50.23 +definition
   50.24 +  NSsuminf   :: "(nat=>real) => real" where
   50.25    "NSsuminf f = (THE s. f NSsums s)"
   50.26  
   50.27  
    51.1 --- a/src/HOL/Hyperreal/HTranscendental.thy	Fri Nov 17 02:19:55 2006 +0100
    51.2 +++ b/src/HOL/Hyperreal/HTranscendental.thy	Fri Nov 17 02:20:03 2006 +0100
    51.3 @@ -31,15 +31,17 @@
    51.4  
    51.5  
    51.6  definition
    51.7 -  exphr :: "real => hypreal"
    51.8 +  exphr :: "real => hypreal" where
    51.9      --{*define exponential function using standard part *}
   51.10    "exphr x =  st(sumhr (0, whn, %n. inverse(real (fact n)) * (x ^ n)))"
   51.11  
   51.12 -  sinhr :: "real => hypreal"
   51.13 +definition
   51.14 +  sinhr :: "real => hypreal" where
   51.15    "sinhr x = st(sumhr (0, whn, %n. (if even(n) then 0 else
   51.16               ((-1) ^ ((n - 1) div 2))/(real (fact n))) * (x ^ n)))"
   51.17    
   51.18 -  coshr :: "real => hypreal"
   51.19 +definition
   51.20 +  coshr :: "real => hypreal" where
   51.21    "coshr x = st(sumhr (0, whn, %n. (if even(n) then
   51.22              ((-1) ^ (n div 2))/(real (fact n)) else 0) * x ^ n))"
   51.23  
    52.1 --- a/src/HOL/Hyperreal/HyperArith.thy	Fri Nov 17 02:19:55 2006 +0100
    52.2 +++ b/src/HOL/Hyperreal/HyperArith.thy	Fri Nov 17 02:20:03 2006 +0100
    52.3 @@ -34,7 +34,7 @@
    52.4  subsection{*Embedding the Naturals into the Hyperreals*}
    52.5  
    52.6  abbreviation
    52.7 -  hypreal_of_nat   :: "nat => hypreal"
    52.8 +  hypreal_of_nat :: "nat => hypreal" where
    52.9    "hypreal_of_nat == of_nat"
   52.10  
   52.11  lemma SNat_eq: "Nats = {n. \<exists>N. n = hypreal_of_nat N}"
    53.1 --- a/src/HOL/Hyperreal/HyperDef.thy	Fri Nov 17 02:19:55 2006 +0100
    53.2 +++ b/src/HOL/Hyperreal/HyperDef.thy	Fri Nov 17 02:20:03 2006 +0100
    53.3 @@ -15,22 +15,23 @@
    53.4  types hypreal = "real star"
    53.5  
    53.6  abbreviation
    53.7 -  hypreal_of_real :: "real => real star"
    53.8 +  hypreal_of_real :: "real => real star" where
    53.9    "hypreal_of_real == star_of"
   53.10  
   53.11  definition
   53.12 -  omega   :: hypreal   -- {*an infinite number @{text "= [<1,2,3,...>]"} *}
   53.13 +  omega :: hypreal where   -- {*an infinite number @{text "= [<1,2,3,...>]"} *}
   53.14    "omega = star_n (%n. real (Suc n))"
   53.15  
   53.16 -  epsilon :: hypreal   -- {*an infinitesimal number @{text "= [<1,1/2,1/3,...>]"} *}
   53.17 +definition
   53.18 +  epsilon :: hypreal where   -- {*an infinitesimal number @{text "= [<1,1/2,1/3,...>]"} *}
   53.19    "epsilon = star_n (%n. inverse (real (Suc n)))"
   53.20  
   53.21  notation (xsymbols)
   53.22 -  omega  ("\<omega>")
   53.23 +  omega  ("\<omega>") and
   53.24    epsilon  ("\<epsilon>")
   53.25  
   53.26  notation (HTML output)
   53.27 -  omega  ("\<omega>")
   53.28 +  omega  ("\<omega>") and
   53.29    epsilon  ("\<epsilon>")
   53.30  
   53.31  
    54.1 --- a/src/HOL/Hyperreal/HyperNat.thy	Fri Nov 17 02:19:55 2006 +0100
    54.2 +++ b/src/HOL/Hyperreal/HyperNat.thy	Fri Nov 17 02:20:03 2006 +0100
    54.3 @@ -14,7 +14,7 @@
    54.4  types hypnat = "nat star"
    54.5  
    54.6  abbreviation
    54.7 -  hypnat_of_nat :: "nat => nat star"
    54.8 +  hypnat_of_nat :: "nat => nat star" where
    54.9    "hypnat_of_nat == star_of"
   54.10  
   54.11  subsection{*Properties Transferred from Naturals*}
   54.12 @@ -161,7 +161,7 @@
   54.13  
   54.14  definition
   54.15    (* the set of infinite hypernatural numbers *)
   54.16 -  HNatInfinite :: "hypnat set"
   54.17 +  HNatInfinite :: "hypnat set" where
   54.18    "HNatInfinite = {n. n \<notin> Nats}"
   54.19  
   54.20  lemma Nats_not_HNatInfinite_iff: "(x \<in> Nats) = (x \<notin> HNatInfinite)"
   54.21 @@ -254,7 +254,7 @@
   54.22  
   54.23  definition
   54.24    (* omega is in fact an infinite hypernatural number = [<1,2,3,...>] *)
   54.25 -  whn :: hypnat
   54.26 +  whn :: hypnat where
   54.27    hypnat_omega_def: "whn = star_n (%n::nat. n)"
   54.28  
   54.29  lemma hypnat_of_nat_neq_whn: "hypnat_of_nat n \<noteq> whn"
   54.30 @@ -362,7 +362,7 @@
   54.31  text{*Obtained using the nonstandard extension of the naturals*}
   54.32  
   54.33  definition
   54.34 -  hypreal_of_hypnat :: "hypnat => hypreal"
   54.35 +  hypreal_of_hypnat :: "hypnat => hypreal" where
   54.36    "hypreal_of_hypnat = *f* real"
   54.37  
   54.38  declare hypreal_of_hypnat_def [transfer_unfold]
    55.1 --- a/src/HOL/Hyperreal/HyperPow.thy	Fri Nov 17 02:19:55 2006 +0100
    55.2 +++ b/src/HOL/Hyperreal/HyperPow.thy	Fri Nov 17 02:20:03 2006 +0100
    55.3 @@ -20,7 +20,7 @@
    55.4  
    55.5  definition
    55.6    (* hypernatural powers of hyperreals *)
    55.7 -  pow :: "[hypreal,hypnat] => hypreal"     (infixr "pow" 80)
    55.8 +  pow :: "[hypreal,hypnat] => hypreal"     (infixr "pow" 80) where
    55.9    hyperpow_def [transfer_unfold]:
   55.10    "(R::hypreal) pow (N::hypnat) = ( *f2* op ^) R N"
   55.11  
    56.1 --- a/src/HOL/Hyperreal/Integration.thy	Fri Nov 17 02:19:55 2006 +0100
    56.2 +++ b/src/HOL/Hyperreal/Integration.thy	Fri Nov 17 02:20:03 2006 +0100
    56.3 @@ -13,38 +13,43 @@
    56.4  text{*We follow John Harrison in formalizing the Gauge integral.*}
    56.5  
    56.6  definition
    56.7 -
    56.8    --{*Partitions and tagged partitions etc.*}
    56.9  
   56.10 -  partition :: "[(real*real),nat => real] => bool"
   56.11 +  partition :: "[(real*real),nat => real] => bool" where
   56.12    "partition = (%(a,b) D. D 0 = a &
   56.13                           (\<exists>N. (\<forall>n < N. D(n) < D(Suc n)) &
   56.14                                (\<forall>n \<ge> N. D(n) = b)))"
   56.15  
   56.16 -  psize :: "(nat => real) => nat"
   56.17 +definition
   56.18 +  psize :: "(nat => real) => nat" where
   56.19    "psize D = (SOME N. (\<forall>n < N. D(n) < D(Suc n)) &
   56.20                        (\<forall>n \<ge> N. D(n) = D(N)))"
   56.21  
   56.22 -  tpart :: "[(real*real),((nat => real)*(nat =>real))] => bool"
   56.23 +definition
   56.24 +  tpart :: "[(real*real),((nat => real)*(nat =>real))] => bool" where
   56.25    "tpart = (%(a,b) (D,p). partition(a,b) D &
   56.26                            (\<forall>n. D(n) \<le> p(n) & p(n) \<le> D(Suc n)))"
   56.27  
   56.28    --{*Gauges and gauge-fine divisions*}
   56.29  
   56.30 -  gauge :: "[real => bool, real => real] => bool"
   56.31 +definition
   56.32 +  gauge :: "[real => bool, real => real] => bool" where
   56.33    "gauge E g = (\<forall>x. E x --> 0 < g(x))"
   56.34  
   56.35 -  fine :: "[real => real, ((nat => real)*(nat => real))] => bool"
   56.36 +definition
   56.37 +  fine :: "[real => real, ((nat => real)*(nat => real))] => bool" where
   56.38    "fine = (%g (D,p). \<forall>n. n < (psize D) --> D(Suc n) - D(n) < g(p n))"
   56.39  
   56.40    --{*Riemann sum*}
   56.41  
   56.42 -  rsum :: "[((nat=>real)*(nat=>real)),real=>real] => real"
   56.43 +definition
   56.44 +  rsum :: "[((nat=>real)*(nat=>real)),real=>real] => real" where
   56.45    "rsum = (%(D,p) f. \<Sum>n=0..<psize(D). f(p n) * (D(Suc n) - D(n)))"
   56.46  
   56.47    --{*Gauge integrability (definite)*}
   56.48  
   56.49 -  Integral :: "[(real*real),real=>real,real] => bool"
   56.50 +definition
   56.51 +  Integral :: "[(real*real),real=>real,real] => bool" where
   56.52    "Integral = (%(a,b) f k. \<forall>e > 0.
   56.53                                 (\<exists>g. gauge(%x. a \<le> x & x \<le> b) g &
   56.54                                 (\<forall>D p. tpart(a,b) (D,p) & fine(g)(D,p) -->
    57.1 --- a/src/HOL/Hyperreal/Lim.thy	Fri Nov 17 02:19:55 2006 +0100
    57.2 +++ b/src/HOL/Hyperreal/Lim.thy	Fri Nov 17 02:20:03 2006 +0100
    57.3 @@ -15,28 +15,33 @@
    57.4  
    57.5  definition
    57.6    LIM :: "['a::real_normed_vector => 'b::real_normed_vector, 'a, 'b] => bool"
    57.7 -        ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60)
    57.8 +        ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60) where
    57.9    "f -- a --> L =
   57.10       (\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & norm (x - a) < s
   57.11          --> norm (f x - L) < r)"
   57.12  
   57.13 +definition
   57.14    NSLIM :: "['a::real_normed_vector => 'b::real_normed_vector, 'a, 'b] => bool"
   57.15 -            ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60)
   57.16 +            ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60) where
   57.17    "f -- a --NS> L =
   57.18      (\<forall>x. (x \<noteq> star_of a & x @= star_of a --> ( *f* f) x @= star_of L))"
   57.19  
   57.20 -  isCont :: "['a::real_normed_vector => 'b::real_normed_vector, 'a] => bool"
   57.21 +definition
   57.22 +  isCont :: "['a::real_normed_vector => 'b::real_normed_vector, 'a] => bool" where
   57.23    "isCont f a = (f -- a --> (f a))"
   57.24  
   57.25 -  isNSCont :: "['a::real_normed_vector => 'b::real_normed_vector, 'a] => bool"
   57.26 +definition
   57.27 +  isNSCont :: "['a::real_normed_vector => 'b::real_normed_vector, 'a] => bool" where
   57.28      --{*NS definition dispenses with limit notions*}
   57.29    "isNSCont f a = (\<forall>y. y @= star_of a -->
   57.30           ( *f* f) y @= star_of (f a))"
   57.31  
   57.32 -  isUCont :: "['a::real_normed_vector => 'b::real_normed_vector] => bool"
   57.33 +definition
   57.34 +  isUCont :: "['a::real_normed_vector => 'b::real_normed_vector] => bool" where
   57.35    "isUCont f = (\<forall>r>0. \<exists>s>0. \<forall>x y. norm (x - y) < s \<longrightarrow> norm (f x - f y) < r)"
   57.36  
   57.37 -  isNSUCont :: "['a::real_normed_vector => 'b::real_normed_vector] => bool"
   57.38 +definition
   57.39 +  isNSUCont :: "['a::real_normed_vector => 'b::real_normed_vector] => bool" where
   57.40    "isNSUCont f = (\<forall>x y. x @= y --> ( *f* f) x @= ( *f* f) y)"
   57.41  
   57.42  
    58.1 --- a/src/HOL/Hyperreal/Log.thy	Fri Nov 17 02:19:55 2006 +0100
    58.2 +++ b/src/HOL/Hyperreal/Log.thy	Fri Nov 17 02:20:03 2006 +0100
    58.3 @@ -11,11 +11,12 @@
    58.4  begin
    58.5  
    58.6  definition
    58.7 -  powr  :: "[real,real] => real"     (infixr "powr" 80)
    58.8 +  powr  :: "[real,real] => real"     (infixr "powr" 80) where
    58.9      --{*exponentation with real exponent*}
   58.10    "x powr a = exp(a * ln x)"
   58.11  
   58.12 -  log :: "[real,real] => real"
   58.13 +definition
   58.14 +  log :: "[real,real] => real" where
   58.15      --{*logarithm of @{term x} to base @{term a}*}
   58.16    "log a x = ln x / ln a"
   58.17  
    59.1 --- a/src/HOL/Hyperreal/NSA.thy	Fri Nov 17 02:19:55 2006 +0100
    59.2 +++ b/src/HOL/Hyperreal/NSA.thy	Fri Nov 17 02:20:03 2006 +0100
    59.3 @@ -12,32 +12,37 @@
    59.4  begin
    59.5  
    59.6  definition
    59.7 -
    59.8 -  hnorm :: "'a::norm star \<Rightarrow> real star"
    59.9 +  hnorm :: "'a::norm star \<Rightarrow> real star" where
   59.10    "hnorm = *f* norm"
   59.11  
   59.12 -  Infinitesimal  :: "('a::real_normed_vector) star set"
   59.13 +definition
   59.14 +  Infinitesimal  :: "('a::real_normed_vector) star set" where
   59.15    "Infinitesimal = {x. \<forall>r \<in> Reals. 0 < r --> hnorm x < r}"
   59.16  
   59.17 -  HFinite :: "('a::real_normed_vector) star set"
   59.18 +definition
   59.19 +  HFinite :: "('a::real_normed_vector) star set" where
   59.20    "HFinite = {x. \<exists>r \<in> Reals. hnorm x < r}"
   59.21  
   59.22 -  HInfinite :: "('a::real_normed_vector) star set"
   59.23 +definition
   59.24 +  HInfinite :: "('a::real_normed_vector) star set" where
   59.25    "HInfinite = {x. \<forall>r \<in> Reals. r < hnorm x}"
   59.26  
   59.27 -  approx :: "['a::real_normed_vector star, 'a star] => bool"
   59.28 -    (infixl "@=" 50)
   59.29 +definition
   59.30 +  approx :: "['a::real_normed_vector star, 'a star] => bool"  (infixl "@=" 50) where
   59.31      --{*the `infinitely close' relation*}
   59.32    "(x @= y) = ((x - y) \<in> Infinitesimal)"
   59.33  
   59.34 -  st        :: "hypreal => hypreal"
   59.35 +definition
   59.36 +  st        :: "hypreal => hypreal" where
   59.37      --{*the standard part of a hyperreal*}
   59.38    "st = (%x. @r. x \<in> HFinite & r \<in> Reals & r @= x)"
   59.39  
   59.40 -  monad     :: "'a::real_normed_vector star => 'a star set"
   59.41 +definition
   59.42 +  monad     :: "'a::real_normed_vector star => 'a star set" where
   59.43    "monad x = {y. x @= y}"
   59.44  
   59.45 -  galaxy    :: "'a::real_normed_vector star => 'a star set"
   59.46 +definition
   59.47 +  galaxy    :: "'a::real_normed_vector star => 'a star set" where
   59.48    "galaxy x = {y. (x + -y) \<in> HFinite}"
   59.49  
   59.50  notation (xsymbols)
   59.51 @@ -52,7 +57,7 @@
   59.52  subsection {* Nonstandard Extension of the Norm Function *}
   59.53  
   59.54  definition
   59.55 -  scaleHR :: "real star \<Rightarrow> 'a star \<Rightarrow> 'a::real_normed_vector star"
   59.56 +  scaleHR :: "real star \<Rightarrow> 'a star \<Rightarrow> 'a::real_normed_vector star" where
   59.57    "scaleHR = starfun2 scaleR"
   59.58  
   59.59  declare hnorm_def [transfer_unfold]
    60.1 --- a/src/HOL/Hyperreal/NatStar.thy	Fri Nov 17 02:19:55 2006 +0100
    60.2 +++ b/src/HOL/Hyperreal/NatStar.thy	Fri Nov 17 02:20:03 2006 +0100
    60.3 @@ -186,7 +186,7 @@
    60.4  subsection{*Nonstandard Characterization of Induction*}
    60.5  
    60.6  definition
    60.7 -  hSuc :: "hypnat => hypnat"
    60.8 +  hSuc :: "hypnat => hypnat" where
    60.9    "hSuc n = n + 1"
   60.10  
   60.11  lemma starP: "(( *p* P) (star_n X)) = ({n. P (X n)} \<in> FreeUltrafilterNat)"
    61.1 --- a/src/HOL/Hyperreal/NthRoot.thy	Fri Nov 17 02:19:55 2006 +0100
    61.2 +++ b/src/HOL/Hyperreal/NthRoot.thy	Fri Nov 17 02:20:03 2006 +0100
    61.3 @@ -11,11 +11,11 @@
    61.4  begin
    61.5  
    61.6  definition
    61.7 -
    61.8 -  root :: "[nat, real] \<Rightarrow> real"
    61.9 +  root :: "[nat, real] \<Rightarrow> real" where
   61.10    "root n x = (THE u. (0 < x \<longrightarrow> 0 < u) \<and> (u ^ n = x))"
   61.11  
   61.12 -  sqrt :: "real \<Rightarrow> real"
   61.13 +definition
   61.14 +  sqrt :: "real \<Rightarrow> real" where
   61.15    "sqrt x = root 2 x"
   61.16  
   61.17  
    62.1 --- a/src/HOL/Hyperreal/Poly.thy	Fri Nov 17 02:19:55 2006 +0100
    62.2 +++ b/src/HOL/Hyperreal/Poly.thy	Fri Nov 17 02:20:03 2006 +0100
    62.3 @@ -82,25 +82,30 @@
    62.4  text{*Other definitions*}
    62.5  
    62.6  definition
    62.7 -  poly_minus :: "real list => real list"      ("-- _" [80] 80)
    62.8 +  poly_minus :: "real list => real list"      ("-- _" [80] 80) where
    62.9    "-- p = (- 1) %* p"
   62.10  
   62.11 -  pderiv :: "real list => real list"
   62.12 +definition
   62.13 +  pderiv :: "real list => real list" where
   62.14    "pderiv p = (if p = [] then [] else pderiv_aux 1 (tl p))"
   62.15  
   62.16 -  divides :: "[real list,real list] => bool"  (infixl "divides" 70)
   62.17 +definition
   62.18 +  divides :: "[real list,real list] => bool"  (infixl "divides" 70) where
   62.19    "p1 divides p2 = (\<exists>q. poly p2 = poly(p1 *** q))"
   62.20  
   62.21 -  order :: "real => real list => nat"
   62.22 +definition
   62.23 +  order :: "real => real list => nat" where
   62.24      --{*order of a polynomial*}
   62.25    "order a p = (SOME n. ([-a, 1] %^ n) divides p &
   62.26                        ~ (([-a, 1] %^ (Suc n)) divides p))"
   62.27  
   62.28 -  degree :: "real list => nat"
   62.29 +definition
   62.30 +  degree :: "real list => nat" where
   62.31       --{*degree of a polynomial*}
   62.32    "degree p = length (pnormalize p)"
   62.33  
   62.34 -  rsquarefree :: "real list => bool"
   62.35 +definition
   62.36 +  rsquarefree :: "real list => bool" where
   62.37       --{*squarefree polynomials --- NB with respect to real roots only.*}
   62.38    "rsquarefree p = (poly p \<noteq> poly [] &
   62.39                       (\<forall>a. (order a p = 0) | (order a p = 1)))"
   62.40 @@ -108,7 +113,7 @@
   62.41  
   62.42  
   62.43  lemma padd_Nil2: "p +++ [] = p"
   62.44 -by (induct "p", auto)
   62.45 +by (induct p) auto
   62.46  declare padd_Nil2 [simp]
   62.47  
   62.48  lemma padd_Cons_Cons: "(h1 # p1) +++ (h2 # p2) = (h1 + h2) # (p1 +++ p2)"
    63.1 --- a/src/HOL/Hyperreal/SEQ.thy	Fri Nov 17 02:19:55 2006 +0100
    63.2 +++ b/src/HOL/Hyperreal/SEQ.thy	Fri Nov 17 02:20:03 2006 +0100
    63.3 @@ -13,54 +13,64 @@
    63.4  begin
    63.5  
    63.6  definition
    63.7 -
    63.8    LIMSEQ :: "[nat => 'a::real_normed_vector, 'a] => bool"
    63.9 -    ("((_)/ ----> (_))" [60, 60] 60)
   63.10 +    ("((_)/ ----> (_))" [60, 60] 60) where
   63.11      --{*Standard definition of convergence of sequence*}
   63.12    "X ----> L = (\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> norm (X n - L) < r))"
   63.13  
   63.14 +definition
   63.15    NSLIMSEQ :: "[nat => 'a::real_normed_vector, 'a] => bool"
   63.16 -    ("((_)/ ----NS> (_))" [60, 60] 60)
   63.17 +    ("((_)/ ----NS> (_))" [60, 60] 60) where
   63.18      --{*Nonstandard definition of convergence of sequence*}
   63.19    "X ----NS> L = (\<forall>N \<in> HNatInfinite. ( *f* X) N \<approx> star_of L)"
   63.20  
   63.21 -  lim :: "(nat => 'a::real_normed_vector) => 'a"
   63.22 +definition
   63.23 +  lim :: "(nat => 'a::real_normed_vector) => 'a" where
   63.24      --{*Standard definition of limit using choice operator*}
   63.25    "lim X = (THE L. X ----> L)"
   63.26  
   63.27 -  nslim :: "(nat => 'a::real_normed_vector) => 'a"
   63.28 +definition
   63.29 +  nslim :: "(nat => 'a::real_normed_vector) => 'a" where
   63.30      --{*Nonstandard definition of limit using choice operator*}
   63.31    "nslim X = (THE L. X ----NS> L)"
   63.32  
   63.33 -  convergent :: "(nat => 'a::real_normed_vector) => bool"
   63.34 +definition
   63.35 +  convergent :: "(nat => 'a::real_normed_vector) => bool" where
   63.36      --{*Standard definition of convergence*}
   63.37    "convergent X = (\<exists>L. X ----> L)"
   63.38  
   63.39 -  NSconvergent :: "(nat => 'a::real_normed_vector) => bool"
   63.40 +definition
   63.41 +  NSconvergent :: "(nat => 'a::real_normed_vector) => bool" where
   63.42      --{*Nonstandard definition of convergence*}
   63.43    "NSconvergent X = (\<exists>L. X ----NS> L)"
   63.44  
   63.45 -  Bseq :: "(nat => 'a::real_normed_vector) => bool"
   63.46 +definition
   63.47 +  Bseq :: "(nat => 'a::real_normed_vector) => bool" where
   63.48      --{*Standard definition for bounded sequence*}
   63.49    "Bseq X = (\<exists>K>0.\<forall>n. norm (X n) \<le> K)"
   63.50  
   63.51 -  NSBseq :: "(nat => 'a::real_normed_vector) => bool"
   63.52 +definition
   63.53 +  NSBseq :: "(nat => 'a::real_normed_vector) => bool" where
   63.54      --{*Nonstandard definition for bounded sequence*}
   63.55    "NSBseq X = (\<forall>N \<in> HNatInfinite. ( *f* X) N : HFinite)"
   63.56  
   63.57 -  monoseq :: "(nat=>real)=>bool"
   63.58 +definition
   63.59 +  monoseq :: "(nat=>real)=>bool" where
   63.60      --{*Definition for monotonicity*}
   63.61    "monoseq X = ((\<forall>m. \<forall>n\<ge>m. X m \<le> X n) | (\<forall>m. \<forall>n\<ge>m. X n \<le> X m))"
   63.62  
   63.63 -  subseq :: "(nat => nat) => bool"
   63.64 +definition
   63.65 +  subseq :: "(nat => nat) => bool" where
   63.66      --{*Definition of subsequence*}
   63.67    "subseq f = (\<forall>m. \<forall>n>m. (f m) < (f n))"
   63.68  
   63.69 -  Cauchy :: "(nat => 'a::real_normed_vector) => bool"
   63.70 +definition
   63.71 +  Cauchy :: "(nat => 'a::real_normed_vector) => bool" where
   63.72      --{*Standard definition of the Cauchy condition*}
   63.73    "Cauchy X = (\<forall>e>0. \<exists>M. \<forall>m \<ge> M. \<forall>n \<ge> M. norm (X m - X n) < e)"
   63.74  
   63.75 -  NSCauchy :: "(nat => 'a::real_normed_vector) => bool"
   63.76 +definition
   63.77 +  NSCauchy :: "(nat => 'a::real_normed_vector) => bool" where
   63.78      --{*Nonstandard definition*}
   63.79    "NSCauchy X = (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. ( *f* X) M \<approx> ( *f* X) N)"
   63.80  
    64.1 --- a/src/HOL/Hyperreal/Series.thy	Fri Nov 17 02:19:55 2006 +0100
    64.2 +++ b/src/HOL/Hyperreal/Series.thy	Fri Nov 17 02:20:03 2006 +0100
    64.3 @@ -15,13 +15,15 @@
    64.4  
    64.5  definition
    64.6     sums  :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> 'a \<Rightarrow> bool"
    64.7 -     (infixr "sums" 80)
    64.8 +     (infixr "sums" 80) where
    64.9     "f sums s = (%n. setsum f {0..<n}) ----> s"
   64.10  
   64.11 -   summable :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> bool"
   64.12 +definition
   64.13 +   summable :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> bool" where
   64.14     "summable f = (\<exists>s. f sums s)"
   64.15  
   64.16 -   suminf   :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> 'a"
   64.17 +definition
   64.18 +   suminf   :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> 'a" where
   64.19     "suminf f = (THE s. f sums s)"
   64.20  
   64.21  syntax
    65.1 --- a/src/HOL/Hyperreal/Star.thy	Fri Nov 17 02:19:55 2006 +0100
    65.2 +++ b/src/HOL/Hyperreal/Star.thy	Fri Nov 17 02:20:03 2006 +0100
    65.3 @@ -12,21 +12,26 @@
    65.4  
    65.5  definition
    65.6      (* internal sets *)
    65.7 -  starset_n :: "(nat => 'a set) => 'a star set"        ("*sn* _" [80] 80)
    65.8 +  starset_n :: "(nat => 'a set) => 'a star set" ("*sn* _" [80] 80) where
    65.9    "*sn* As = Iset (star_n As)"
   65.10  
   65.11 -  InternalSets :: "'a star set set"
   65.12 +definition
   65.13 +  InternalSets :: "'a star set set" where
   65.14    "InternalSets = {X. \<exists>As. X = *sn* As}"
   65.15  
   65.16 +definition
   65.17    (* nonstandard extension of function *)
   65.18 -  is_starext  :: "['a star => 'a star, 'a => 'a] => bool"
   65.19 +  is_starext  :: "['a star => 'a star, 'a => 'a] => bool" where
   65.20    "is_starext F f = (\<forall>x y. \<exists>X \<in> Rep_star(x). \<exists>Y \<in> Rep_star(y).
   65.21                          ((y = (F x)) = ({n. Y n = f(X n)} : FreeUltrafilterNat)))"
   65.22 +
   65.23 +definition
   65.24    (* internal functions *)
   65.25 -  starfun_n :: "(nat => ('a => 'b)) => 'a star => 'b star"   ("*fn* _" [80] 80)
   65.26 +  starfun_n :: "(nat => ('a => 'b)) => 'a star => 'b star"   ("*fn* _" [80] 80) where
   65.27    "*fn* F = Ifun (star_n F)"
   65.28  
   65.29 -  InternalFuns :: "('a star => 'b star) set"
   65.30 +definition
   65.31 +  InternalFuns :: "('a star => 'b star) set" where
   65.32    "InternalFuns = {X. \<exists>F. X = *fn* F}"
   65.33  
   65.34  
    66.1 --- a/src/HOL/Hyperreal/StarDef.thy	Fri Nov 17 02:19:55 2006 +0100
    66.2 +++ b/src/HOL/Hyperreal/StarDef.thy	Fri Nov 17 02:20:03 2006 +0100
    66.3 @@ -13,7 +13,7 @@
    66.4  subsection {* A Free Ultrafilter over the Naturals *}
    66.5  
    66.6  definition
    66.7 -  FreeUltrafilterNat :: "nat set set"  ("\<U>")
    66.8 +  FreeUltrafilterNat :: "nat set set"  ("\<U>") where
    66.9    "\<U> = (SOME U. freeultrafilter U)"
   66.10  
   66.11  lemma freeultrafilter_FUFNat: "freeultrafilter \<U>"
   66.12 @@ -36,14 +36,14 @@
   66.13  subsection {* Definition of @{text star} type constructor *}
   66.14  
   66.15  definition
   66.16 -  starrel :: "((nat \<Rightarrow> 'a) \<times> (nat \<Rightarrow> 'a)) set"
   66.17 +  starrel :: "((nat \<Rightarrow> 'a) \<times> (nat \<Rightarrow> 'a)) set" where
   66.18    "starrel = {(X,Y). {n. X n = Y n} \<in> \<U>}"
   66.19  
   66.20  typedef 'a star = "(UNIV :: (nat \<Rightarrow> 'a) set) // starrel"
   66.21  by (auto intro: quotientI)
   66.22  
   66.23  definition
   66.24 -  star_n :: "(nat \<Rightarrow> 'a) \<Rightarrow> 'a star"
   66.25 +  star_n :: "(nat \<Rightarrow> 'a) \<Rightarrow> 'a star" where
   66.26    "star_n X = Abs_star (starrel `` {X})"
   66.27  
   66.28  theorem star_cases [case_names star_n, cases type: star]:
   66.29 @@ -157,10 +157,11 @@
   66.30  subsection {* Standard elements *}
   66.31  
   66.32  definition
   66.33 -  star_of :: "'a \<Rightarrow> 'a star"
   66.34 +  star_of :: "'a \<Rightarrow> 'a star" where
   66.35    "star_of x == star_n (\<lambda>n. x)"
   66.36  
   66.37 -  Standard :: "'a star set"
   66.38 +definition
   66.39 +  Standard :: "'a star set" where
   66.40    "Standard = range star_of"
   66.41  
   66.42  text {* Transfer tactic should remove occurrences of @{term star_of} *}
   66.43 @@ -178,7 +179,7 @@
   66.44  subsection {* Internal functions *}
   66.45  
   66.46  definition
   66.47 -  Ifun :: "('a \<Rightarrow> 'b) star \<Rightarrow> 'a star \<Rightarrow> 'b star" ("_ \<star> _" [300,301] 300)
   66.48 +  Ifun :: "('a \<Rightarrow> 'b) star \<Rightarrow> 'a star \<Rightarrow> 'b star" ("_ \<star> _" [300,301] 300) where
   66.49    "Ifun f \<equiv> \<lambda>x. Abs_star
   66.50         (\<Union>F\<in>Rep_star f. \<Union>X\<in>Rep_star x. starrel``{\<lambda>n. F n (X n)})"
   66.51  
   66.52 @@ -207,12 +208,12 @@
   66.53  text {* Nonstandard extensions of functions *}
   66.54  
   66.55  definition
   66.56 -  starfun :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a star \<Rightarrow> 'b star)"
   66.57 -    ("*f* _" [80] 80)
   66.58 +  starfun :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a star \<Rightarrow> 'b star)"  ("*f* _" [80] 80) where
   66.59    "starfun f == \<lambda>x. star_of f \<star> x"
   66.60  
   66.61 +definition
   66.62    starfun2 :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> ('a star \<Rightarrow> 'b star \<Rightarrow> 'c star)"
   66.63 -    ("*f2* _" [80] 80)
   66.64 +    ("*f2* _" [80] 80) where
   66.65    "starfun2 f == \<lambda>x y. star_of f \<star> x \<star> y"
   66.66  
   66.67  declare starfun_def [transfer_unfold]
   66.68 @@ -242,7 +243,7 @@
   66.69  subsection {* Internal predicates *}
   66.70  
   66.71  definition
   66.72 -  unstar :: "bool star \<Rightarrow> bool"
   66.73 +  unstar :: "bool star \<Rightarrow> bool" where
   66.74    "unstar b = (b = star_of True)"
   66.75  
   66.76  lemma unstar_star_n: "unstar (star_n P) = ({n. P n} \<in> \<U>)"
   66.77 @@ -259,12 +260,11 @@
   66.78  by (simp only: unstar_star_n)
   66.79  
   66.80  definition
   66.81 -  starP :: "('a \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> bool"
   66.82 -    ("*p* _" [80] 80)
   66.83 +  starP :: "('a \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> bool"  ("*p* _" [80] 80) where
   66.84    "*p* P = (\<lambda>x. unstar (star_of P \<star> x))"
   66.85  
   66.86 -  starP2 :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> 'b star \<Rightarrow> bool"
   66.87 -    ("*p2* _" [80] 80)
   66.88 +definition
   66.89 +  starP2 :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a star \<Rightarrow> 'b star \<Rightarrow> bool"  ("*p2* _" [80] 80) where
   66.90    "*p2* P = (\<lambda>x y. unstar (star_of P \<star> x \<star> y))"
   66.91  
   66.92  declare starP_def [transfer_unfold]
   66.93 @@ -287,7 +287,7 @@
   66.94  subsection {* Internal sets *}
   66.95  
   66.96  definition
   66.97 -  Iset :: "'a set star \<Rightarrow> 'a star set"
   66.98 +  Iset :: "'a set star \<Rightarrow> 'a star set" where
   66.99    "Iset A = {x. ( *p2* op \<in>) x A}"
  66.100  
  66.101  lemma Iset_star_n:
  66.102 @@ -329,7 +329,7 @@
  66.103  text {* Nonstandard extensions of sets. *}
  66.104  
  66.105  definition
  66.106 -  starset :: "'a set \<Rightarrow> 'a star set" ("*s* _" [80] 80)
  66.107 +  starset :: "'a set \<Rightarrow> 'a star set" ("*s* _" [80] 80) where
  66.108    "starset A = Iset (star_of A)"
  66.109  
  66.110  declare starset_def [transfer_unfold]
    67.1 --- a/src/HOL/Hyperreal/Transcendental.thy	Fri Nov 17 02:19:55 2006 +0100
    67.2 +++ b/src/HOL/Hyperreal/Transcendental.thy	Fri Nov 17 02:20:03 2006 +0100
    67.3 @@ -12,37 +12,45 @@
    67.4  begin
    67.5  
    67.6  definition
    67.7 -
    67.8 -  exp :: "real => real"
    67.9 +  exp :: "real => real" where
   67.10    "exp x = (\<Sum>n. inverse(real (fact n)) * (x ^ n))"
   67.11  
   67.12 -  sin :: "real => real"
   67.13 +definition
   67.14 +  sin :: "real => real" where
   67.15    "sin x = (\<Sum>n. (if even(n) then 0 else
   67.16               ((- 1) ^ ((n - Suc 0) div 2))/(real (fact n))) * x ^ n)"
   67.17   
   67.18 -  diffs :: "(nat => real) => nat => real"
   67.19 +definition
   67.20 +  diffs :: "(nat => real) => nat => real" where
   67.21    "diffs c = (%n. real (Suc n) * c(Suc n))"
   67.22  
   67.23 -  cos :: "real => real"
   67.24 +definition
   67.25 +  cos :: "real => real" where
   67.26    "cos x = (\<Sum>n. (if even(n) then ((- 1) ^ (n div 2))/(real (fact n)) 
   67.27                              else 0) * x ^ n)"
   67.28    
   67.29 -  ln :: "real => real"
   67.30 +definition
   67.31 +  ln :: "real => real" where
   67.32    "ln x = (SOME u. exp u = x)"
   67.33  
   67.34 -  pi :: "real"
   67.35 +definition
   67.36 +  pi :: "real" where
   67.37    "pi = 2 * (@x. 0 \<le> (x::real) & x \<le> 2 & cos x = 0)"
   67.38  
   67.39 -  tan :: "real => real"
   67.40 +definition
   67.41 +  tan :: "real => real" where
   67.42    "tan x = (sin x)/(cos x)"
   67.43  
   67.44 -  arcsin :: "real => real"
   67.45 +definition
   67.46 +  arcsin :: "real => real" where
   67.47    "arcsin y = (SOME x. -(pi/2) \<le> x & x \<le> pi/2 & sin x = y)"
   67.48  
   67.49 -  arcos :: "real => real"
   67.50 +definition
   67.51 +  arcos :: "real => real" where
   67.52    "arcos y = (SOME x. 0 \<le> x & x \<le> pi & cos x = y)"
   67.53 -     
   67.54 -  arctan :: "real => real"
   67.55 +
   67.56 +definition     
   67.57 +  arctan :: "real => real" where
   67.58    "arctan y = (SOME x. -(pi/2) < x & x < pi/2 & tan x = y)"
   67.59  
   67.60  
    68.1 --- a/src/HOL/Induct/Comb.thy	Fri Nov 17 02:19:55 2006 +0100
    68.2 +++ b/src/HOL/Induct/Comb.thy	Fri Nov 17 02:20:03 2006 +0100
    68.3 @@ -38,9 +38,11 @@
    68.4    contract  :: "(comb*comb) set"
    68.5  
    68.6  abbreviation
    68.7 -  contract_rel1 :: "[comb,comb] => bool"   (infixl "-1->" 50)
    68.8 +  contract_rel1 :: "[comb,comb] => bool"   (infixl "-1->" 50) where
    68.9    "x -1-> y == (x,y) \<in> contract"
   68.10 -  contract_rel :: "[comb,comb] => bool"   (infixl "--->" 50)
   68.11 +
   68.12 +abbreviation
   68.13 +  contract_rel :: "[comb,comb] => bool"   (infixl "--->" 50) where
   68.14    "x ---> y == (x,y) \<in> contract^*"
   68.15  
   68.16  inductive contract
   68.17 @@ -59,9 +61,11 @@
   68.18    parcontract :: "(comb*comb) set"
   68.19  
   68.20  abbreviation
   68.21 -  parcontract_rel1 :: "[comb,comb] => bool"   (infixl "=1=>" 50)
   68.22 +  parcontract_rel1 :: "[comb,comb] => bool"   (infixl "=1=>" 50) where
   68.23    "x =1=> y == (x,y) \<in> parcontract"
   68.24 -  parcontract_rel :: "[comb,comb] => bool"   (infixl "===>" 50)
   68.25 +
   68.26 +abbreviation
   68.27 +  parcontract_rel :: "[comb,comb] => bool"   (infixl "===>" 50) where
   68.28    "x ===> y == (x,y) \<in> parcontract^*"
   68.29  
   68.30  inductive parcontract
   68.31 @@ -76,10 +80,11 @@
   68.32  *}
   68.33  
   68.34  definition
   68.35 -  I :: comb
   68.36 +  I :: comb where
   68.37    "I = S##K##K"
   68.38  
   68.39 -  diamond   :: "('a * 'a)set => bool"	
   68.40 +definition
   68.41 +  diamond   :: "('a * 'a)set => bool" where
   68.42      --{*confluence; Lambda/Commutation treats this more abstractly*}
   68.43    "diamond(r) = (\<forall>x y. (x,y) \<in> r --> 
   68.44                    (\<forall>y'. (x,y') \<in> r --> 
    69.1 --- a/src/HOL/Induct/LFilter.thy	Fri Nov 17 02:19:55 2006 +0100
    69.2 +++ b/src/HOL/Induct/LFilter.thy	Fri Nov 17 02:20:03 2006 +0100
    69.3 @@ -20,10 +20,11 @@
    69.4  declare findRel.intros [intro]
    69.5  
    69.6  definition
    69.7 -  find    :: "['a => bool, 'a llist] => 'a llist"
    69.8 +  find    :: "['a => bool, 'a llist] => 'a llist" where
    69.9    "find p l = (SOME l'. (l,l'): findRel p | (l' = LNil & l ~: Domain(findRel p)))"
   69.10  
   69.11 -  lfilter :: "['a => bool, 'a llist] => 'a llist"
   69.12 +definition
   69.13 +  lfilter :: "['a => bool, 'a llist] => 'a llist" where
   69.14    "lfilter p l = llist_corec l (%l. case find p l of
   69.15                                              LNil => None
   69.16                                            | LCons y z => Some(y,z))"
    70.1 --- a/src/HOL/Induct/LList.thy	Fri Nov 17 02:19:55 2006 +0100
    70.2 +++ b/src/HOL/Induct/LList.thy	Fri Nov 17 02:20:03 2006 +0100
    70.3 @@ -47,46 +47,54 @@
    70.4    by (blast intro: llist.NIL_I)
    70.5  
    70.6  definition
    70.7 -  list_Fun   :: "['a item set, 'a item set] => 'a item set"
    70.8 +  list_Fun   :: "['a item set, 'a item set] => 'a item set" where
    70.9      --{*Now used exclusively for abbreviating the coinduction rule*}
   70.10       "list_Fun A X = {z. z = NIL | (\<exists>M a. z = CONS a M & a \<in> A & M \<in> X)}"
   70.11  
   70.12 +definition
   70.13    LListD_Fun :: 
   70.14        "[('a item * 'a item)set, ('a item * 'a item)set] => 
   70.15 -       ('a item * 'a item)set"
   70.16 +       ('a item * 'a item)set" where
   70.17      "LListD_Fun r X =   
   70.18         {z. z = (NIL, NIL) |   
   70.19             (\<exists>M N a b. z = (CONS a M, CONS b N) & (a, b) \<in> r & (M, N) \<in> X)}"
   70.20  
   70.21 -  LNil :: "'a llist"
   70.22 +definition
   70.23 +  LNil :: "'a llist" where
   70.24       --{*abstract constructor*}
   70.25      "LNil = Abs_LList NIL"
   70.26  
   70.27 -  LCons :: "['a, 'a llist] => 'a llist"
   70.28 +definition
   70.29 +  LCons :: "['a, 'a llist] => 'a llist" where
   70.30       --{*abstract constructor*}
   70.31      "LCons x xs = Abs_LList(CONS (Leaf x) (Rep_LList xs))"
   70.32  
   70.33 -  llist_case :: "['b, ['a, 'a llist]=>'b, 'a llist] => 'b"
   70.34 +definition
   70.35 +  llist_case :: "['b, ['a, 'a llist]=>'b, 'a llist] => 'b" where
   70.36      "llist_case c d l =
   70.37         List_case c (%x y. d (inv Leaf x) (Abs_LList y)) (Rep_LList l)"
   70.38  
   70.39 -  LList_corec_fun :: "[nat, 'a=> ('b item * 'a) option, 'a] => 'b item"
   70.40 +definition
   70.41 +  LList_corec_fun :: "[nat, 'a=> ('b item * 'a) option, 'a] => 'b item" where
   70.42      "LList_corec_fun k f ==
   70.43       nat_rec (%x. {})                         
   70.44               (%j r x. case f x of None    => NIL
   70.45                                  | Some(z,w) => CONS z (r w)) 
   70.46               k"
   70.47  
   70.48 -  LList_corec     :: "['a, 'a => ('b item * 'a) option] => 'b item"
   70.49 +definition
   70.50 +  LList_corec     :: "['a, 'a => ('b item * 'a) option] => 'b item" where
   70.51      "LList_corec a f = (\<Union>k. LList_corec_fun k f a)"
   70.52  
   70.53 -  llist_corec     :: "['a, 'a => ('b * 'a) option] => 'b llist"
   70.54 +definition
   70.55 +  llist_corec     :: "['a, 'a => ('b * 'a) option] => 'b llist" where
   70.56      "llist_corec a f =
   70.57         Abs_LList(LList_corec a 
   70.58                   (%z. case f z of None      => None
   70.59                                  | Some(v,w) => Some(Leaf(v), w)))"
   70.60  
   70.61 -  llistD_Fun :: "('a llist * 'a llist)set => ('a llist * 'a llist)set"
   70.62 +definition
   70.63 +  llistD_Fun :: "('a llist * 'a llist)set => ('a llist * 'a llist)set" where
   70.64      "llistD_Fun(r) =   
   70.65          prod_fun Abs_LList Abs_LList `         
   70.66                  LListD_Fun (diag(range Leaf))   
   70.67 @@ -105,25 +113,30 @@
   70.68  subsubsection{* Sample function definitions.  Item-based ones start with @{text L} *}
   70.69  
   70.70  definition
   70.71 -  Lmap       :: "('a item => 'b item) => ('a item => 'b item)"
   70.72 +  Lmap       :: "('a item => 'b item) => ('a item => 'b item)" where
   70.73      "Lmap f M = LList_corec M (List_case None (%x M'. Some((f(x), M'))))"
   70.74  
   70.75 -  lmap       :: "('a=>'b) => ('a llist => 'b llist)"
   70.76 +definition
   70.77 +  lmap       :: "('a=>'b) => ('a llist => 'b llist)" where
   70.78      "lmap f l = llist_corec l (%z. case z of LNil => None 
   70.79                                             | LCons y z => Some(f(y), z))"
   70.80  
   70.81 -  iterates   :: "['a => 'a, 'a] => 'a llist"
   70.82 +definition
   70.83 +  iterates   :: "['a => 'a, 'a] => 'a llist" where
   70.84      "iterates f a = llist_corec a (%x. Some((x, f(x))))"     
   70.85  
   70.86 -  Lconst     :: "'a item => 'a item"
   70.87 +definition
   70.88 +  Lconst     :: "'a item => 'a item" where
   70.89      "Lconst(M) == lfp(%N. CONS M N)"
   70.90  
   70.91 -  Lappend    :: "['a item, 'a item] => 'a item"
   70.92 +definition
   70.93 +  Lappend    :: "['a item, 'a item] => 'a item" where
   70.94     "Lappend M N = LList_corec (M,N)                                         
   70.95       (split(List_case (List_case None (%N1 N2. Some((N1, (NIL,N2))))) 
   70.96                        (%M1 M2 N. Some((M1, (M2,N))))))"
   70.97  
   70.98 -  lappend    :: "['a llist, 'a llist] => 'a llist"
   70.99 +definition
  70.100 +  lappend    :: "['a llist, 'a llist] => 'a llist" where
  70.101      "lappend l n = llist_corec (l,n)                                         
  70.102         (split(llist_case (llist_case None (%n1 n2. Some((n1, (LNil,n2))))) 
  70.103                           (%l1 l2 n. Some((l1, (l2,n))))))"
    71.1 --- a/src/HOL/Induct/Mutil.thy	Fri Nov 17 02:19:55 2006 +0100
    71.2 +++ b/src/HOL/Induct/Mutil.thy	Fri Nov 17 02:20:03 2006 +0100
    71.3 @@ -31,13 +31,15 @@
    71.4  text {* \medskip Sets of squares of the given colour*}
    71.5  
    71.6  definition
    71.7 -  coloured :: "nat => (nat \<times> nat) set"
    71.8 +  coloured :: "nat => (nat \<times> nat) set" where
    71.9    "coloured b = {(i, j). (i + j) mod 2 = b}"
   71.10  
   71.11  abbreviation
   71.12 -  whites  :: "(nat \<times> nat) set"
   71.13 +  whites  :: "(nat \<times> nat) set" where
   71.14    "whites == coloured 0"
   71.15 -  blacks  :: "(nat \<times> nat) set"
   71.16 +
   71.17 +abbreviation
   71.18 +  blacks  :: "(nat \<times> nat) set" where
   71.19    "blacks == coloured (Suc 0)"
   71.20  
   71.21  
    72.1 --- a/src/HOL/Induct/Ordinals.thy	Fri Nov 17 02:19:55 2006 +0100
    72.2 +++ b/src/HOL/Induct/Ordinals.thy	Fri Nov 17 02:20:03 2006 +0100
    72.3 @@ -32,9 +32,11 @@
    72.4    "iter f (Suc n) = f \<circ> (iter f n)"
    72.5  
    72.6  definition
    72.7 -  OpLim :: "(nat => (ordinal => ordinal)) => (ordinal => ordinal)"
    72.8 +  OpLim :: "(nat => (ordinal => ordinal)) => (ordinal => ordinal)" where
    72.9    "OpLim F a = Limit (\<lambda>n. F n a)"
   72.10 -  OpItw :: "(ordinal => ordinal) => (ordinal => ordinal)"    ("\<Squnion>")
   72.11 +
   72.12 +definition
   72.13 +  OpItw :: "(ordinal => ordinal) => (ordinal => ordinal)"    ("\<Squnion>") where
   72.14    "\<Squnion>f = OpLim (iter f)"
   72.15  
   72.16  consts
   72.17 @@ -52,7 +54,7 @@
   72.18    "\<nabla>f (Limit h) = Limit (\<lambda>n. \<nabla>f (h n))"
   72.19  
   72.20  definition
   72.21 -  deriv :: "(ordinal => ordinal) => (ordinal => ordinal)"
   72.22 +  deriv :: "(ordinal => ordinal) => (ordinal => ordinal)" where
   72.23    "deriv f = \<nabla>(\<Squnion>f)"
   72.24  
   72.25  consts
   72.26 @@ -62,9 +64,8 @@
   72.27    "veblen (Succ a) = \<nabla>(OpLim (iter (veblen a)))"
   72.28    "veblen (Limit f) = \<nabla>(OpLim (\<lambda>n. veblen (f n)))"
   72.29  
   72.30 -definition
   72.31 -  "veb a = veblen a Zero"
   72.32 -  "\<epsilon>\<^isub>0 = veb Zero"
   72.33 -  "\<Gamma>\<^isub>0 = Limit (\<lambda>n. iter veb n Zero)"
   72.34 +definition "veb a = veblen a Zero"
   72.35 +definition "\<epsilon>\<^isub>0 = veb Zero"
   72.36 +definition "\<Gamma>\<^isub>0 = Limit (\<lambda>n. iter veb n Zero)"
   72.37  
   72.38  end
    73.1 --- a/src/HOL/Induct/PropLog.thy	Fri Nov 17 02:19:55 2006 +0100
    73.2 +++ b/src/HOL/Induct/PropLog.thy	Fri Nov 17 02:20:03 2006 +0100
    73.3 @@ -30,7 +30,7 @@
    73.4    thms  :: "'a pl set => 'a pl set"
    73.5  
    73.6  abbreviation
    73.7 -  thm_rel :: "['a pl set, 'a pl] => bool"   (infixl "|-" 50)
    73.8 +  thm_rel :: "['a pl set, 'a pl] => bool"   (infixl "|-" 50) where
    73.9    "H |- p == p \<in> thms H"
   73.10  
   73.11  inductive "thms(H)"
   73.12 @@ -73,7 +73,7 @@
   73.13  *}
   73.14  
   73.15  definition
   73.16 -  sat :: "['a pl set, 'a pl] => bool"   (infixl "|=" 50)
   73.17 +  sat :: "['a pl set, 'a pl] => bool"   (infixl "|=" 50) where
   73.18      "H |= p  =  (\<forall>tt. (\<forall>q\<in>H. tt[[q]]) --> tt[[p]])"
   73.19  
   73.20  
    74.1 --- a/src/HOL/Induct/QuoDataType.thy	Fri Nov 17 02:19:55 2006 +0100
    74.2 +++ b/src/HOL/Induct/QuoDataType.thy	Fri Nov 17 02:20:03 2006 +0100
    74.3 @@ -23,7 +23,7 @@
    74.4  consts  msgrel :: "(freemsg * freemsg) set"
    74.5  
    74.6  abbreviation
    74.7 -  msg_rel :: "[freemsg, freemsg] => bool"  (infixl "~~" 50)
    74.8 +  msg_rel :: "[freemsg, freemsg] => bool"  (infixl "~~" 50) where
    74.9    "X ~~ Y == (X,Y) \<in> msgrel"
   74.10  
   74.11  notation (xsymbols)
   74.12 @@ -143,18 +143,21 @@
   74.13  
   74.14  text{*The abstract message constructors*}
   74.15  definition
   74.16 -  Nonce :: "nat \<Rightarrow> msg"
   74.17 +  Nonce :: "nat \<Rightarrow> msg" where
   74.18    "Nonce N = Abs_Msg(msgrel``{NONCE N})"
   74.19  
   74.20 -  MPair :: "[msg,msg] \<Rightarrow> msg"
   74.21 +definition
   74.22 +  MPair :: "[msg,msg] \<Rightarrow> msg" where
   74.23     "MPair X Y =
   74.24         Abs_Msg (\<Union>U \<in> Rep_Msg X. \<Union>V \<in> Rep_Msg Y. msgrel``{MPAIR U V})"
   74.25  
   74.26 -  Crypt :: "[nat,msg] \<Rightarrow> msg"
   74.27 +definition
   74.28 +  Crypt :: "[nat,msg] \<Rightarrow> msg" where
   74.29     "Crypt K X =
   74.30         Abs_Msg (\<Union>U \<in> Rep_Msg X. msgrel``{CRYPT K U})"
   74.31  
   74.32 -  Decrypt :: "[nat,msg] \<Rightarrow> msg"
   74.33 +definition
   74.34 +  Decrypt :: "[nat,msg] \<Rightarrow> msg" where
   74.35     "Decrypt K X =
   74.36         Abs_Msg (\<Union>U \<in> Rep_Msg X. msgrel``{DECRYPT K U})"
   74.37  
   74.38 @@ -228,7 +231,7 @@
   74.39  subsection{*The Abstract Function to Return the Set of Nonces*}
   74.40  
   74.41  definition
   74.42 -  nonces :: "msg \<Rightarrow> nat set"
   74.43 +  nonces :: "msg \<Rightarrow> nat set" where
   74.44     "nonces X = (\<Union>U \<in> Rep_Msg X. freenonces U)"
   74.45  
   74.46  lemma nonces_congruent: "freenonces respects msgrel"
   74.47 @@ -263,7 +266,7 @@
   74.48  subsection{*The Abstract Function to Return the Left Part*}
   74.49  
   74.50  definition
   74.51 -  left :: "msg \<Rightarrow> msg"
   74.52 +  left :: "msg \<Rightarrow> msg" where
   74.53     "left X = Abs_Msg (\<Union>U \<in> Rep_Msg X. msgrel``{freeleft U})"
   74.54  
   74.55  lemma left_congruent: "(\<lambda>U. msgrel `` {freeleft U}) respects msgrel"
   74.56 @@ -297,7 +300,7 @@
   74.57  subsection{*The Abstract Function to Return the Right Part*}
   74.58  
   74.59  definition
   74.60 -  right :: "msg \<Rightarrow> msg"
   74.61 +  right :: "msg \<Rightarrow> msg" where
   74.62     "right X = Abs_Msg (\<Union>U \<in> Rep_Msg X. msgrel``{freeright U})"
   74.63  
   74.64  lemma right_congruent: "(\<lambda>U. msgrel `` {freeright U}) respects msgrel"
   74.65 @@ -432,7 +435,7 @@
   74.66  need this function in order to prove discrimination theorems.*}
   74.67  
   74.68  definition
   74.69 -  discrim :: "msg \<Rightarrow> int"
   74.70 +  discrim :: "msg \<Rightarrow> int" where
   74.71     "discrim X = contents (\<Union>U \<in> Rep_Msg X. {freediscrim U})"
   74.72  
   74.73  lemma discrim_congruent: "(\<lambda>U. {freediscrim U}) respects msgrel"
    75.1 --- a/src/HOL/Induct/QuoNestedDataType.thy	Fri Nov 17 02:19:55 2006 +0100
    75.2 +++ b/src/HOL/Induct/QuoNestedDataType.thy	Fri Nov 17 02:20:03 2006 +0100
    75.3 @@ -21,7 +21,7 @@
    75.4  consts  exprel :: "(freeExp * freeExp) set"
    75.5  
    75.6  abbreviation
    75.7 -  exp_rel :: "[freeExp, freeExp] => bool"  (infixl "~~" 50)
    75.8 +  exp_rel :: "[freeExp, freeExp] => bool"  (infixl "~~" 50) where
    75.9    "X ~~ Y == (X,Y) \<in> exprel"
   75.10  
   75.11  notation (xsymbols)
   75.12 @@ -160,14 +160,16 @@
   75.13  text{*The abstract message constructors*}
   75.14  
   75.15  definition
   75.16 -  Var :: "nat \<Rightarrow> exp"
   75.17 +  Var :: "nat \<Rightarrow> exp" where
   75.18    "Var N = Abs_Exp(exprel``{VAR N})"
   75.19  
   75.20 -  Plus :: "[exp,exp] \<Rightarrow> exp"
   75.21 +definition
   75.22 +  Plus :: "[exp,exp] \<Rightarrow> exp" where
   75.23     "Plus X Y =
   75.24         Abs_Exp (\<Union>U \<in> Rep_Exp X. \<Union>V \<in> Rep_Exp Y. exprel``{PLUS U V})"
   75.25  
   75.26 -  FnCall :: "[nat, exp list] \<Rightarrow> exp"
   75.27 +definition
   75.28 +  FnCall :: "[nat, exp list] \<Rightarrow> exp" where
   75.29     "FnCall F Xs =
   75.30         Abs_Exp (\<Union>Us \<in> listset (map Rep_Exp Xs). exprel `` {FNCALL F Us})"
   75.31  
   75.32 @@ -207,7 +209,7 @@
   75.33    list of concrete expressions*}
   75.34  
   75.35  definition
   75.36 -  Abs_ExpList :: "freeExp list => exp list"
   75.37 +  Abs_ExpList :: "freeExp list => exp list" where
   75.38    "Abs_ExpList Xs = map (%U. Abs_Exp(exprel``{U})) Xs"
   75.39  
   75.40  lemma Abs_ExpList_Nil [simp]: "Abs_ExpList [] == []"
   75.41 @@ -285,7 +287,7 @@
   75.42  subsection{*The Abstract Function to Return the Set of Variables*}
   75.43  
   75.44  definition
   75.45 -  vars :: "exp \<Rightarrow> nat set"
   75.46 +  vars :: "exp \<Rightarrow> nat set" where
   75.47    "vars X = (\<Union>U \<in> Rep_Exp X. freevars U)"
   75.48  
   75.49  lemma vars_respects: "freevars respects exprel"
   75.50 @@ -351,7 +353,7 @@
   75.51  subsection{*Injectivity of @{term FnCall}*}
   75.52  
   75.53  definition
   75.54 -  "fun" :: "exp \<Rightarrow> nat"
   75.55 +  "fun" :: "exp \<Rightarrow> nat" where
   75.56    "fun X = contents (\<Union>U \<in> Rep_Exp X. {freefun U})"
   75.57  
   75.58  lemma fun_respects: "(%U. {freefun U}) respects exprel"
   75.59 @@ -363,7 +365,7 @@
   75.60  done
   75.61  
   75.62  definition
   75.63 -  args :: "exp \<Rightarrow> exp list"
   75.64 +  args :: "exp \<Rightarrow> exp list" where
   75.65    "args X = contents (\<Union>U \<in> Rep_Exp X. {Abs_ExpList (freeargs U)})"
   75.66  
   75.67  text{*This result can probably be generalized to arbitrary equivalence
   75.68 @@ -398,7 +400,7 @@
   75.69  function in order to prove discrimination theorems.*}
   75.70  
   75.71  definition
   75.72 -  discrim :: "exp \<Rightarrow> int"
   75.73 +  discrim :: "exp \<Rightarrow> int" where
   75.74    "discrim X = contents (\<Union>U \<in> Rep_Exp X. {freediscrim U})"
   75.75  
   75.76  lemma discrim_respects: "(\<lambda>U. {freediscrim U}) respects exprel"
    76.1 --- a/src/HOL/Induct/SList.thy	Fri Nov 17 02:19:55 2006 +0100
    76.2 +++ b/src/HOL/Induct/SList.thy	Fri Nov 17 02:20:03 2006 +0100
    76.3 @@ -37,10 +37,11 @@
    76.4  
    76.5  (* Defining the Concrete Constructors *)
    76.6  definition
    76.7 -  NIL  :: "'a item"
    76.8 +  NIL  :: "'a item" where
    76.9    "NIL = In0(Numb(0))"
   76.10  
   76.11 -  CONS :: "['a item, 'a item] => 'a item"
   76.12 +definition
   76.13 +  CONS :: "['a item, 'a item] => 'a item" where
   76.14    "CONS M N = In1(Scons M N)"
   76.15  
   76.16  consts
   76.17 @@ -55,15 +56,15 @@
   76.18      'a list = "list(range Leaf) :: 'a item set" 
   76.19    by (blast intro: list.NIL_I)
   76.20  
   76.21 -abbreviation
   76.22 -  "Case == Datatype.Case"
   76.23 -  "Split == Datatype.Split"
   76.24 +abbreviation "Case == Datatype.Case"
   76.25 +abbreviation "Split == Datatype.Split"
   76.26  
   76.27  definition
   76.28 -  List_case :: "['b, ['a item, 'a item]=>'b, 'a item] => 'b"
   76.29 +  List_case :: "['b, ['a item, 'a item]=>'b, 'a item] => 'b" where
   76.30    "List_case c d = Case(%x. c)(Split(d))"
   76.31    
   76.32 -  List_rec  :: "['a item, 'b, ['a item, 'a item, 'b]=>'b] => 'b"
   76.33 +definition
   76.34 +  List_rec  :: "['a item, 'b, ['a item, 'a item, 'b]=>'b] => 'b" where
   76.35    "List_rec M c d = wfrec (trancl pred_sexp)
   76.36                             (%g. List_case c (%x y. d x y (g y))) M"
   76.37  
   76.38 @@ -84,18 +85,21 @@
   76.39    Cons :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list"  (infixr "#" 65)
   76.40  
   76.41  definition
   76.42 -  Nil       :: "'a list"                               ("[]")
   76.43 +  Nil       :: "'a list"                               ("[]") where
   76.44     "Nil  = Abs_List(NIL)"
   76.45  
   76.46 -  "Cons"       :: "['a, 'a list] => 'a list"           (infixr "#" 65)
   76.47 +definition
   76.48 +  "Cons"       :: "['a, 'a list] => 'a list"           (infixr "#" 65) where
   76.49     "x#xs = Abs_List(CONS (Leaf x)(Rep_List xs))"
   76.50  
   76.51 +definition
   76.52    (* list Recursion -- the trancl is Essential; see list.ML *)
   76.53 -  list_rec  :: "['a list, 'b, ['a, 'a list, 'b]=>'b] => 'b"
   76.54 +  list_rec  :: "['a list, 'b, ['a, 'a list, 'b]=>'b] => 'b" where
   76.55     "list_rec l c d =
   76.56        List_rec(Rep_List l) c (%x y r. d(inv Leaf x)(Abs_List y) r)"
   76.57  
   76.58 -  list_case :: "['b, ['a, 'a list]=>'b, 'a list] => 'b"
   76.59 +definition
   76.60 +  list_case :: "['b, ['a, 'a list]=>'b, 'a list] => 'b" where
   76.61     "list_case a f xs = list_rec xs a (%x xs r. f x xs)"
   76.62  
   76.63  (* list Enumeration *)
   76.64 @@ -116,80 +120,98 @@
   76.65  (* Generalized Map Functionals *)
   76.66  
   76.67  definition
   76.68 -  Rep_map   :: "('b => 'a item) => ('b list => 'a item)"
   76.69 +  Rep_map   :: "('b => 'a item) => ('b list => 'a item)" where
   76.70     "Rep_map f xs = list_rec xs  NIL(%x l r. CONS(f x) r)"
   76.71  
   76.72 -  Abs_map   :: "('a item => 'b) => 'a item => 'b list"
   76.73 +definition
   76.74 +  Abs_map   :: "('a item => 'b) => 'a item => 'b list" where
   76.75     "Abs_map g M  = List_rec M Nil (%N L r. g(N)#r)"
   76.76  
   76.77  
   76.78  (**** Function definitions ****)
   76.79  
   76.80  definition
   76.81 -
   76.82 -  null      :: "'a list => bool"
   76.83 +  null      :: "'a list => bool" where
   76.84    "null xs  = list_rec xs True (%x xs r. False)"
   76.85  
   76.86 -  hd        :: "'a list => 'a"
   76.87 +definition
   76.88 +  hd        :: "'a list => 'a" where
   76.89    "hd xs    = list_rec xs (@x. True) (%x xs r. x)"
   76.90  
   76.91 -  tl        :: "'a list => 'a list"
   76.92 +definition
   76.93 +  tl        :: "'a list => 'a list" where
   76.94    "tl xs    = list_rec xs (@xs. True) (%x xs r. xs)"
   76.95  
   76.96 +definition
   76.97    (* a total version of tl: *)
   76.98 -  ttl       :: "'a list => 'a list"
   76.99 +  ttl       :: "'a list => 'a list" where
  76.100    "ttl xs   = list_rec xs [] (%x xs r. xs)"
  76.101  
  76.102 -  member :: "['a, 'a list] => bool"    (infixl "mem" 55)
  76.103 +definition
  76.104 +  member :: "['a, 'a list] => bool"    (infixl "mem" 55) where
  76.105    "x mem xs = list_rec xs False (%y ys r. if y=x then True else r)"
  76.106  
  76.107 -  list_all  :: "('a => bool) => ('a list => bool)"
  76.108 +definition
  76.109 +  list_all  :: "('a => bool) => ('a list => bool)" where
  76.110    "list_all P xs = list_rec xs True(%x l r. P(x) & r)"
  76.111  
  76.112 -  map       :: "('a=>'b) => ('a list => 'b list)"
  76.113 +definition
  76.114 +  map       :: "('a=>'b) => ('a list => 'b list)" where
  76.115    "map f xs = list_rec xs [] (%x l r. f(x)#r)"
  76.116  
  76.117 -
  76.118 -  append    :: "['a list, 'a list] => 'a list"   (infixr "@" 65)
  76.119 +definition
  76.120 +  append    :: "['a list, 'a list] => 'a list"   (infixr "@" 65) where
  76.121    "xs@ys = list_rec xs ys (%x l r. x#r)"
  76.122  
  76.123 -  filter    :: "['a => bool, 'a list] => 'a list"
  76.124 +definition
  76.125 +  filter    :: "['a => bool, 'a list] => 'a list" where
  76.126    "filter P xs = list_rec xs []  (%x xs r. if P(x)then x#r else r)"
  76.127  
  76.128 -  foldl     :: "[['b,'a] => 'b, 'b, 'a list] => 'b"
  76.129 +definition
  76.130 +  foldl     :: "[['b,'a] => 'b, 'b, 'a list] => 'b" where
  76.131    "foldl f a xs = list_rec xs (%a. a)(%x xs r.%a. r(f a x))(a)"
  76.132  
  76.133 -  foldr     :: "[['a,'b] => 'b, 'b, 'a list] => 'b"
  76.134 +definition
  76.135 +  foldr     :: "[['a,'b] => 'b, 'b, 'a list] => 'b" where
  76.136    "foldr f a xs     = list_rec xs a (%x xs r. (f x r))"
  76.137  
  76.138 -  length    :: "'a list => nat"
  76.139 +definition
  76.140 +  length    :: "'a list => nat" where
  76.141    "length xs = list_rec xs 0 (%x xs r. Suc r)"
  76.142  
  76.143 -  drop      :: "['a list,nat] => 'a list"
  76.144 +definition
  76.145 +  drop      :: "['a list,nat] => 'a list" where
  76.146    "drop t n = (nat_rec(%x. x)(%m r xs. r(ttl xs)))(n)(t)"
  76.147  
  76.148 -  copy      :: "['a, nat] => 'a list"      (* make list of n copies of x *)
  76.149 +definition
  76.150 +  copy      :: "['a, nat] => 'a list"  where     (* make list of n copies of x *)
  76.151    "copy t   = nat_rec [] (%m xs. t # xs)"
  76.152  
  76.153 -  flat      :: "'a list list => 'a list"
  76.154 +definition
  76.155 +  flat      :: "'a list list => 'a list" where
  76.156    "flat     = foldr (op @) []"
  76.157  
  76.158 -  nth       :: "[nat, 'a list] => 'a"
  76.159 +definition
  76.160 +  nth       :: "[nat, 'a list] => 'a" where
  76.161    "nth      = nat_rec hd (%m r xs. r(tl xs))"
  76.162  
  76.163 -  rev       :: "'a list => 'a list"
  76.164 +definition
  76.165 +  rev       :: "'a list => 'a list" where
  76.166    "rev xs   = list_rec xs [] (%x xs xsa. xsa @ [x])"
  76.167  
  76.168  (* miscellaneous definitions *)
  76.169 -  zipWith   :: "['a * 'b => 'c, 'a list * 'b list] => 'c list"
  76.170 +definition
  76.171 +  zipWith   :: "['a * 'b => 'c, 'a list * 'b list] => 'c list" where
  76.172    "zipWith f S = (list_rec (fst S)  (%T.[])
  76.173                              (%x xs r. %T. if null T then [] 
  76.174                                            else f(x,hd T) # r(tl T)))(snd(S))"
  76.175  
  76.176 -  zip       :: "'a list * 'b list => ('a*'b) list"
  76.177 +definition
  76.178 +  zip       :: "'a list * 'b list => ('a*'b) list" where
  76.179    "zip      = zipWith  (%s. s)"
  76.180  
  76.181 -  unzip     :: "('a*'b) list => ('a list * 'b list)"
  76.182 +definition
  76.183 +  unzip     :: "('a*'b) list => ('a list * 'b list)" where
  76.184    "unzip    = foldr(% (a,b)(c,d).(a#c,b#d))([],[])"
  76.185  
  76.186  
    77.1 --- a/src/HOL/Induct/Sexp.thy	Fri Nov 17 02:19:55 2006 +0100
    77.2 +++ b/src/HOL/Induct/Sexp.thy	Fri Nov 17 02:20:03 2006 +0100
    77.3 @@ -11,9 +11,8 @@
    77.4  
    77.5  types
    77.6    'a item = "'a Datatype.item"
    77.7 -abbreviation
    77.8 -  "Leaf == Datatype.Leaf"
    77.9 -  "Numb == Datatype.Numb"
   77.10 +abbreviation "Leaf == Datatype.Leaf"
   77.11 +abbreviation "Numb == Datatype.Numb"
   77.12  
   77.13  consts
   77.14    sexp      :: "'a item set"
   77.15 @@ -26,16 +25,18 @@
   77.16  
   77.17  definition
   77.18    sexp_case :: "['a=>'b, nat=>'b, ['a item, 'a item]=>'b, 
   77.19 -                'a item] => 'b"
   77.20 +                'a item] => 'b" where
   77.21    "sexp_case c d e M = (THE z. (EX x.   M=Leaf(x) & z=c(x))  
   77.22                               | (EX k.   M=Numb(k) & z=d(k))  
   77.23                               | (EX N1 N2. M = Scons N1 N2  & z=e N1 N2))"
   77.24  
   77.25 -  pred_sexp :: "('a item * 'a item)set"
   77.26 +definition
   77.27 +  pred_sexp :: "('a item * 'a item)set" where
   77.28       "pred_sexp = (\<Union>M \<in> sexp. \<Union>N \<in> sexp. {(M, Scons M N), (N, Scons M N)})"
   77.29  
   77.30 +definition
   77.31    sexp_rec  :: "['a item, 'a=>'b, nat=>'b,      
   77.32 -                ['a item, 'a item, 'b, 'b]=>'b] => 'b"
   77.33 +                ['a item, 'a item, 'b, 'b]=>'b] => 'b" where
   77.34     "sexp_rec M c d e = wfrec pred_sexp
   77.35               (%g. sexp_case c d (%N1 N2. e N1 N2 (g N1) (g N2))) M"
   77.36  
    78.1 --- a/src/HOL/Induct/Tree.thy	Fri Nov 17 02:19:55 2006 +0100
    78.2 +++ b/src/HOL/Induct/Tree.thy	Fri Nov 17 02:20:03 2006 +0100
    78.3 @@ -72,10 +72,11 @@
    78.4    closure. *} 
    78.5  
    78.6  definition
    78.7 -  brouwer_pred :: "(brouwer * brouwer) set"
    78.8 +  brouwer_pred :: "(brouwer * brouwer) set" where
    78.9    "brouwer_pred = (\<Union>i. {(m,n). n = Succ m \<or> (EX f. n = Lim f & m = f i)})"
   78.10  
   78.11 -  brouwer_order :: "(brouwer * brouwer) set"
   78.12 +definition
   78.13 +  brouwer_order :: "(brouwer * brouwer) set" where
   78.14    "brouwer_order = brouwer_pred^+"
   78.15  
   78.16  lemma wf_brouwer_pred: "wf brouwer_pred"
    79.1 --- a/src/HOL/Integ/IntDef.thy	Fri Nov 17 02:19:55 2006 +0100
    79.2 +++ b/src/HOL/Integ/IntDef.thy	Fri Nov 17 02:20:03 2006 +0100
    79.3 @@ -870,9 +870,11 @@
    79.4  *}
    79.5  
    79.6  definition
    79.7 -  int_aux :: "int \<Rightarrow> nat \<Rightarrow> int"
    79.8 +  int_aux :: "int \<Rightarrow> nat \<Rightarrow> int" where
    79.9    "int_aux i n = (i + int n)"
   79.10 -  nat_aux :: "nat \<Rightarrow> int \<Rightarrow> nat"
   79.11 +
   79.12 +definition
   79.13 +  nat_aux :: "nat \<Rightarrow> int \<Rightarrow> nat" where
   79.14    "nat_aux n i = (n + nat i)"
   79.15  
   79.16  lemma [code]:
    80.1 --- a/src/HOL/Integ/NatBin.thy	Fri Nov 17 02:19:55 2006 +0100
    80.2 +++ b/src/HOL/Integ/NatBin.thy	Fri Nov 17 02:20:03 2006 +0100
    80.3 @@ -20,7 +20,7 @@
    80.4    nat_number_of_def: "number_of v == nat (number_of (v\<Colon>int))"
    80.5  
    80.6  abbreviation (xsymbols)
    80.7 -  square :: "'a::power => 'a"  ("(_\<twosuperior>)" [1000] 999)
    80.8 +  square :: "'a::power => 'a"  ("(_\<twosuperior>)" [1000] 999) where
    80.9    "x\<twosuperior> == x^2"
   80.10  
   80.11  notation (latex output)
    81.1 --- a/src/HOL/Integ/Numeral.thy	Fri Nov 17 02:19:55 2006 +0100
    81.2 +++ b/src/HOL/Integ/Numeral.thy	Fri Nov 17 02:20:03 2006 +0100
    81.3 @@ -51,6 +51,8 @@
    81.4  
    81.5  abbreviation
    81.6    "Numeral0 \<equiv> number_of Pls"
    81.7 +
    81.8 +abbreviation
    81.9    "Numeral1 \<equiv> number_of (Pls BIT B1)"
   81.10  
   81.11  lemma Let_number_of [simp]: "Let (number_of v) f = f (number_of v)"
   81.12 @@ -64,9 +66,11 @@
   81.13    unfolding Let_def ..
   81.14  
   81.15  definition
   81.16 -  succ :: "int \<Rightarrow> int"
   81.17 +  succ :: "int \<Rightarrow> int" where
   81.18    "succ k = k + 1"
   81.19 -  pred :: "int \<Rightarrow> int"
   81.20 +
   81.21 +definition
   81.22 +  pred :: "int \<Rightarrow> int" where
   81.23    "pred k = k - 1"
   81.24  
   81.25  lemmas numeral_simps = 
    82.1 --- a/src/HOL/Isar_examples/Hoare.thy	Fri Nov 17 02:19:55 2006 +0100
    82.2 +++ b/src/HOL/Isar_examples/Hoare.thy	Fri Nov 17 02:20:03 2006 +0100
    82.3 @@ -32,7 +32,7 @@
    82.4    | While "'a bexp" "'a assn" "'a com"
    82.5  
    82.6  abbreviation
    82.7 -  Skip  ("SKIP")
    82.8 +  Skip  ("SKIP") where
    82.9    "SKIP == Basic id"
   82.10  
   82.11  types
    83.1 --- a/src/HOL/Lambda/Commutation.thy	Fri Nov 17 02:19:55 2006 +0100
    83.2 +++ b/src/HOL/Lambda/Commutation.thy	Fri Nov 17 02:20:03 2006 +0100
    83.3 @@ -11,22 +11,25 @@
    83.4  subsection {* Basic definitions *}
    83.5  
    83.6  definition
    83.7 -  square :: "[('a \<times> 'a) set, ('a \<times> 'a) set, ('a \<times> 'a) set, ('a \<times> 'a) set] => bool"
    83.8 +  square :: "[('a \<times> 'a) set, ('a \<times> 'a) set, ('a \<times> 'a) set, ('a \<times> 'a) set] => bool" where
    83.9    "square R S T U =
   83.10      (\<forall>x y. (x, y) \<in> R --> (\<forall>z. (x, z) \<in> S --> (\<exists>u. (y, u) \<in> T \<and> (z, u) \<in> U)))"
   83.11  
   83.12 -  commute :: "[('a \<times> 'a) set, ('a \<times> 'a) set] => bool"
   83.13 +definition
   83.14 +  commute :: "[('a \<times> 'a) set, ('a \<times> 'a) set] => bool" where
   83.15    "commute R S = square R S S R"
   83.16  
   83.17 -  diamond :: "('a \<times> 'a) set => bool"
   83.18 +definition
   83.19 +  diamond :: "('a \<times> 'a) set => bool" where
   83.20    "diamond R = commute R R"
   83.21  
   83.22 -  Church_Rosser :: "('a \<times> 'a) set => bool"
   83.23 +definition
   83.24 +  Church_Rosser :: "('a \<times> 'a) set => bool" where
   83.25    "Church_Rosser R =
   83.26      (\<forall>x y. (x, y) \<in> (R \<union> R^-1)^* --> (\<exists>z. (x, z) \<in> R^* \<and> (y, z) \<in> R^*))"
   83.27  
   83.28  abbreviation
   83.29 -  confluent :: "('a \<times> 'a) set => bool"
   83.30 +  confluent :: "('a \<times> 'a) set => bool" where
   83.31    "confluent R == diamond (R^*)"
   83.32  
   83.33  
    84.1 --- a/src/HOL/Lambda/Eta.thy	Fri Nov 17 02:19:55 2006 +0100
    84.2 +++ b/src/HOL/Lambda/Eta.thy	Fri Nov 17 02:20:03 2006 +0100
    84.3 @@ -22,11 +22,15 @@
    84.4    eta :: "(dB \<times> dB) set"
    84.5  
    84.6  abbreviation
    84.7 -  eta_red :: "[dB, dB] => bool"   (infixl "-e>" 50)
    84.8 +  eta_red :: "[dB, dB] => bool"   (infixl "-e>" 50) where
    84.9    "s -e> t == (s, t) \<in> eta"
   84.10 -  eta_reds :: "[dB, dB] => bool"   (infixl "-e>>" 50)
   84.11 +
   84.12 +abbreviation
   84.13 +  eta_reds :: "[dB, dB] => bool"   (infixl "-e>>" 50) where
   84.14    "s -e>> t == (s, t) \<in> eta^*"
   84.15 -  eta_red0 :: "[dB, dB] => bool"   (infixl "-e>=" 50)
   84.16 +
   84.17 +abbreviation
   84.18 +  eta_red0 :: "[dB, dB] => bool"   (infixl "-e>=" 50) where
   84.19    "s -e>= t == (s, t) \<in> eta^="
   84.20  
   84.21  inductive eta
   84.22 @@ -224,7 +228,7 @@
   84.23    par_eta :: "(dB \<times> dB) set"
   84.24  
   84.25  abbreviation
   84.26 -  par_eta_red :: "[dB, dB] => bool"   (infixl "=e>" 50)
   84.27 +  par_eta_red :: "[dB, dB] => bool"   (infixl "=e>" 50) where
   84.28    "s =e> t == (s, t) \<in> par_eta"
   84.29  
   84.30  notation (xsymbols)
    85.1 --- a/src/HOL/Lambda/Lambda.thy	Fri Nov 17 02:19:55 2006 +0100
    85.2 +++ b/src/HOL/Lambda/Lambda.thy	Fri Nov 17 02:20:03 2006 +0100
    85.3 @@ -57,13 +57,15 @@
    85.4    beta :: "(dB \<times> dB) set"
    85.5  
    85.6  abbreviation
    85.7 -  beta_red :: "[dB, dB] => bool"  (infixl "->" 50)
    85.8 +  beta_red :: "[dB, dB] => bool"  (infixl "->" 50) where
    85.9    "s -> t == (s, t) \<in> beta"
   85.10 -  beta_reds :: "[dB, dB] => bool"  (infixl "->>" 50)
   85.11 +
   85.12 +abbreviation
   85.13 +  beta_reds :: "[dB, dB] => bool"  (infixl "->>" 50) where
   85.14    "s ->> t == (s, t) \<in> beta^*"
   85.15  
   85.16  notation (latex)
   85.17 -  beta_red  (infixl "\<rightarrow>\<^sub>\<beta>" 50)
   85.18 +  beta_red  (infixl "\<rightarrow>\<^sub>\<beta>" 50) and
   85.19    beta_reds  (infixl "\<rightarrow>\<^sub>\<beta>\<^sup>*" 50)
   85.20  
   85.21  inductive beta
    86.1 --- a/src/HOL/Lambda/ListApplication.thy	Fri Nov 17 02:19:55 2006 +0100
    86.2 +++ b/src/HOL/Lambda/ListApplication.thy	Fri Nov 17 02:20:03 2006 +0100
    86.3 @@ -9,7 +9,7 @@
    86.4  theory ListApplication imports Lambda begin
    86.5  
    86.6  abbreviation
    86.7 -  list_application :: "dB => dB list => dB"    (infixl "\<degree>\<degree>" 150)
    86.8 +  list_application :: "dB => dB list => dB"  (infixl "\<degree>\<degree>" 150) where
    86.9    "t \<degree>\<degree> ts == foldl (op \<degree>) t ts"
   86.10  
   86.11  lemma apps_eq_tail_conv [iff]: "(r \<degree>\<degree> ts = s \<degree>\<degree> ts) = (r = s)"
    87.1 --- a/src/HOL/Lambda/ListBeta.thy	Fri Nov 17 02:19:55 2006 +0100
    87.2 +++ b/src/HOL/Lambda/ListBeta.thy	Fri Nov 17 02:20:03 2006 +0100
    87.3 @@ -13,7 +13,7 @@
    87.4  *}
    87.5  
    87.6  abbreviation
    87.7 -  list_beta :: "dB list => dB list => bool"   (infixl "=>" 50)
    87.8 +  list_beta :: "dB list => dB list => bool"  (infixl "=>" 50) where
    87.9    "rs => ss == (rs, ss) : step1 beta"
   87.10  
   87.11  lemma head_Var_reduction:
    88.1 --- a/src/HOL/Lambda/ListOrder.thy	Fri Nov 17 02:19:55 2006 +0100
    88.2 +++ b/src/HOL/Lambda/ListOrder.thy	Fri Nov 17 02:20:03 2006 +0100
    88.3 @@ -14,7 +14,7 @@
    88.4  *}
    88.5  
    88.6  definition
    88.7 -  step1 :: "('a \<times> 'a) set => ('a list \<times> 'a list) set"
    88.8 +  step1 :: "('a \<times> 'a) set => ('a list \<times> 'a list) set" where
    88.9    "step1 r =
   88.10      {(ys, xs). \<exists>us z z' vs. xs = us @ z # vs \<and> (z', z) \<in> r \<and> ys =
   88.11        us @ z' # vs}"
    89.1 --- a/src/HOL/Lambda/ParRed.thy	Fri Nov 17 02:19:55 2006 +0100
    89.2 +++ b/src/HOL/Lambda/ParRed.thy	Fri Nov 17 02:20:03 2006 +0100
    89.3 @@ -18,7 +18,7 @@
    89.4    par_beta :: "(dB \<times> dB) set"
    89.5  
    89.6  abbreviation
    89.7 -  par_beta_red :: "[dB, dB] => bool"  (infixl "=>" 50)
    89.8 +  par_beta_red :: "[dB, dB] => bool"  (infixl "=>" 50) where
    89.9    "s => t == (s, t) \<in> par_beta"
   89.10  
   89.11  inductive par_beta
    90.1 --- a/src/HOL/Lambda/StrongNorm.thy	Fri Nov 17 02:19:55 2006 +0100
    90.2 +++ b/src/HOL/Lambda/StrongNorm.thy	Fri Nov 17 02:20:03 2006 +0100
    90.3 @@ -190,7 +190,7 @@
    90.4                by (rule typing.App)
    90.5            qed
    90.6            with Cons True show ?thesis
    90.7 -            by (simp add: map_compose [symmetric] o_def)
    90.8 +            by (simp add: map_compose [symmetric] comp_def)
    90.9          qed
   90.10        next
   90.11          case False
    91.1 --- a/src/HOL/Lambda/Type.thy	Fri Nov 17 02:19:55 2006 +0100
    91.2 +++ b/src/HOL/Lambda/Type.thy	Fri Nov 17 02:20:03 2006 +0100
    91.3 @@ -12,7 +12,7 @@
    91.4  subsection {* Environments *}
    91.5  
    91.6  definition
    91.7 -  shift :: "(nat \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> nat \<Rightarrow> 'a"    ("_<_:_>" [90, 0, 0] 91)
    91.8 +  shift :: "(nat \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> nat \<Rightarrow> 'a"  ("_<_:_>" [90, 0, 0] 91) where
    91.9    "e<i:a> = (\<lambda>j. if j < i then e j else if j = i then a else e (j - 1))"
   91.10  
   91.11  notation (xsymbols)
   91.12 @@ -50,21 +50,23 @@
   91.13    typings :: "(nat \<Rightarrow> type) \<Rightarrow> dB list \<Rightarrow> type list \<Rightarrow> bool"
   91.14  
   91.15  abbreviation
   91.16 -  funs :: "type list \<Rightarrow> type \<Rightarrow> type"    (infixr "=>>" 200)
   91.17 +  funs :: "type list \<Rightarrow> type \<Rightarrow> type"  (infixr "=>>" 200) where
   91.18    "Ts =>> T == foldr Fun Ts T"
   91.19  
   91.20 -  typing_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool"    ("_ |- _ : _" [50, 50, 50] 50)
   91.21 +abbreviation
   91.22 +  typing_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool"  ("_ |- _ : _" [50, 50, 50] 50) where
   91.23    "env |- t : T == (env, t, T) \<in> typing"
   91.24  
   91.25 +abbreviation
   91.26    typings_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB list \<Rightarrow> type list \<Rightarrow> bool"
   91.27 -    ("_ ||- _ : _" [50, 50, 50] 50)
   91.28 +    ("_ ||- _ : _" [50, 50, 50] 50) where
   91.29    "env ||- ts : Ts == typings env ts Ts"
   91.30  
   91.31  notation (xsymbols)
   91.32    typing_rel  ("_ \<turnstile> _ : _" [50, 50, 50] 50)
   91.33  
   91.34  notation (latex)
   91.35 -  funs  (infixr "\<Rrightarrow>" 200)
   91.36 +  funs  (infixr "\<Rrightarrow>" 200) and
   91.37    typings_rel  ("_ \<tturnstile> _ : _" [50, 50, 50] 50)
   91.38  
   91.39  inductive typing
    92.1 --- a/src/HOL/Lambda/WeakNorm.thy	Fri Nov 17 02:19:55 2006 +0100
    92.2 +++ b/src/HOL/Lambda/WeakNorm.thy	Fri Nov 17 02:20:03 2006 +0100
    92.3 @@ -17,7 +17,7 @@
    92.4  subsection {* Terms in normal form *}
    92.5  
    92.6  definition
    92.7 -  listall :: "('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool"
    92.8 +  listall :: "('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool" where
    92.9    "listall P xs == (\<forall>i. i < length xs \<longrightarrow> P (xs ! i))"
   92.10  
   92.11  declare listall_def [extraction_expand]
   92.12 @@ -362,7 +362,7 @@
   92.13    rtyping :: "((nat \<Rightarrow> type) \<times> dB \<times> type) set"
   92.14  
   92.15  abbreviation
   92.16 -  rtyping_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool"    ("_ |-\<^sub>R _ : _" [50, 50, 50] 50)
   92.17 +  rtyping_rel :: "(nat \<Rightarrow> type) \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool"  ("_ |-\<^sub>R _ : _" [50, 50, 50] 50) where
   92.18    "e |-\<^sub>R t : T == (e, t, T) \<in> rtyping"
   92.19  
   92.20  notation (xsymbols)
    93.1 --- a/src/HOL/Lattice/Bounds.thy	Fri Nov 17 02:19:55 2006 +0100
    93.2 +++ b/src/HOL/Lattice/Bounds.thy	Fri Nov 17 02:20:03 2006 +0100
    93.3 @@ -16,16 +16,19 @@
    93.4  *}
    93.5  
    93.6  definition
    93.7 -  is_inf :: "'a::partial_order \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
    93.8 +  is_inf :: "'a::partial_order \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool" where
    93.9    "is_inf x y inf = (inf \<sqsubseteq> x \<and> inf \<sqsubseteq> y \<and> (\<forall>z. z \<sqsubseteq> x \<and> z \<sqsubseteq> y \<longrightarrow> z \<sqsubseteq> inf))"
   93.10  
   93.11 -  is_sup :: "'a::partial_order \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool"
   93.12 +definition
   93.13 +  is_sup :: "'a::partial_order \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool" where
   93.14    "is_sup x y sup = (x \<sqsubseteq> sup \<and> y \<sqsubseteq> sup \<and> (\<forall>z. x \<sqsubseteq> z \<and> y \<sqsubseteq> z \<longrightarrow> sup \<sqsubseteq> z))"
   93.15  
   93.16 -  is_Inf :: "'a::partial_order set \<Rightarrow> 'a \<Rightarrow> bool"
   93.17 +definition
   93.18 +  is_Inf :: "'a::partial_order set \<Rightarrow> 'a \<Rightarrow> bool" where
   93.19    "is_Inf A inf = ((\<forall>x \<in> A. inf \<sqsubseteq> x) \<and> (\<forall>z. (\<forall>x \<in> A. z \<sqsubseteq> x) \<longrightarrow> z \<sqsubseteq> inf))"
   93.20  
   93.21 -  is_Sup :: "'a::partial_order set \<Rightarrow> 'a \<Rightarrow> bool"
   93.22 +definition
   93.23 +  is_Sup :: "'a::partial_order set \<Rightarrow> 'a \<Rightarrow> bool" where
   93.24    "is_Sup A sup = ((\<forall>x \<in> A. x \<sqsubseteq> sup) \<and> (\<forall>z. (\<forall>x \<in> A. x \<sqsubseteq> z) \<longrightarrow> sup \<sqsubseteq> z))"
   93.25  
   93.26  text {*
    94.1 --- a/src/HOL/Lattice/CompleteLattice.thy	Fri Nov 17 02:19:55 2006 +0100
    94.2 +++ b/src/HOL/Lattice/CompleteLattice.thy	Fri Nov 17 02:20:03 2006 +0100
    94.3 @@ -32,13 +32,14 @@
    94.4  *}
    94.5  
    94.6  definition
    94.7 -  Meet :: "'a::complete_lattice set \<Rightarrow> 'a"
    94.8 +  Meet :: "'a::complete_lattice set \<Rightarrow> 'a" where
    94.9    "Meet A = (THE inf. is_Inf A inf)"
   94.10 -  Join :: "'a::complete_lattice set \<Rightarrow> 'a"
   94.11 +definition
   94.12 +  Join :: "'a::complete_lattice set \<Rightarrow> 'a" where
   94.13    "Join A = (THE sup. is_Sup A sup)"
   94.14  
   94.15  notation (xsymbols)
   94.16 -  Meet  ("\<Sqinter>_" [90] 90)
   94.17 +  Meet  ("\<Sqinter>_" [90] 90) and
   94.18    Join  ("\<Squnion>_" [90] 90)
   94.19  
   94.20  text {*
   94.21 @@ -143,9 +144,10 @@
   94.22  *}
   94.23  
   94.24  definition
   94.25 -  bottom :: "'a::complete_lattice"    ("\<bottom>")
   94.26 +  bottom :: "'a::complete_lattice"    ("\<bottom>") where
   94.27    "\<bottom> = \<Sqinter>UNIV"
   94.28 -  top :: "'a::complete_lattice"    ("\<top>")
   94.29 +definition
   94.30 +  top :: "'a::complete_lattice"    ("\<top>") where
   94.31    "\<top> = \<Squnion>UNIV"
   94.32  
   94.33  lemma bottom_least [intro?]: "\<bottom> \<sqsubseteq> x"
    95.1 --- a/src/HOL/Lattice/Lattice.thy	Fri Nov 17 02:19:55 2006 +0100
    95.2 +++ b/src/HOL/Lattice/Lattice.thy	Fri Nov 17 02:20:03 2006 +0100
    95.3 @@ -25,13 +25,14 @@
    95.4  *}
    95.5  
    95.6  definition
    95.7 -  meet :: "'a::lattice \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "&&" 70)
    95.8 +  meet :: "'a::lattice \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "&&" 70) where
    95.9    "x && y = (THE inf. is_inf x y inf)"
   95.10 -  join :: "'a::lattice \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "||" 65)
   95.11 +definition
   95.12 +  join :: "'a::lattice \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "||" 65) where
   95.13    "x || y = (THE sup. is_sup x y sup)"
   95.14  
   95.15  notation (xsymbols)
   95.16 -  meet  (infixl "\<sqinter>" 70)
   95.17 +  meet  (infixl "\<sqinter>" 70) and
   95.18    join  (infixl "\<squnion>" 65)
   95.19  
   95.20  text {*
   95.21 @@ -337,9 +338,10 @@
   95.22  *}
   95.23  
   95.24  definition
   95.25 -  minimum :: "'a::linear_order \<Rightarrow> 'a \<Rightarrow> 'a"
   95.26 +  minimum :: "'a::linear_order \<Rightarrow> 'a \<Rightarrow> 'a" where
   95.27    "minimum x y = (if x \<sqsubseteq> y then x else y)"
   95.28 -  maximum :: "'a::linear_order \<Rightarrow> 'a \<Rightarrow> 'a"
   95.29 +definition
   95.30 +  maximum :: "'a::linear_order \<Rightarrow> 'a \<Rightarrow> 'a" where
   95.31    "maximum x y = (if x \<sqsubseteq> y then y else x)"
   95.32  
   95.33  lemma is_inf_minimum: "is_inf x y (minimum x y)"
    96.1 --- a/src/HOL/Library/AssocList.thy	Fri Nov 17 02:19:55 2006 +0100
    96.2 +++ b/src/HOL/Library/AssocList.thy	Fri Nov 17 02:20:03 2006 +0100
    96.3 @@ -96,12 +96,12 @@
    96.4  (* ******************************************************************************** *)
    96.5  
    96.6  lemma delete_simps [simp]:
    96.7 -"delete k [] = []"
    96.8 -"delete k (p#ps) = (if fst p = k then delete k ps else p # delete k ps)"
    96.9 +    "delete k [] = []"
   96.10 +    "delete k (p#ps) = (if fst p = k then delete k ps else p # delete k ps)"
   96.11    by (simp_all add: delete_def)
   96.12  
   96.13  lemma delete_id[simp]: "k \<notin> fst ` set al \<Longrightarrow> delete k al = al"
   96.14 -by(induct al, auto)
   96.15 +  by (induct al) auto
   96.16  
   96.17  lemma delete_conv: "map_of (delete k al) k' = ((map_of al)(k := None)) k'"
   96.18    by (induct al) auto
   96.19 @@ -112,9 +112,9 @@
   96.20  lemma delete_idem: "delete k (delete k al) = delete k al"
   96.21    by (induct al) auto
   96.22  
   96.23 -lemma map_of_delete[simp]:
   96.24 - "k' \<noteq> k \<Longrightarrow> map_of (delete k al) k' = map_of al k'"
   96.25 -by(induct al, auto)
   96.26 +lemma map_of_delete [simp]:
   96.27 +    "k' \<noteq> k \<Longrightarrow> map_of (delete k al) k' = map_of al k'"
   96.28 +  by (induct al) auto
   96.29  
   96.30  lemma delete_notin_dom: "k \<notin> fst ` set (delete k al)"
   96.31    by (induct al) auto
   96.32 @@ -547,7 +547,7 @@
   96.33  
   96.34  lemma compose_conv: 
   96.35    shows "map_of (compose xs ys) k = (map_of ys \<circ>\<^sub>m map_of xs) k"
   96.36 -proof (induct xs ys rule: compose_induct )
   96.37 +proof (induct xs ys rule: compose_induct)
   96.38    case Nil thus ?case by simp
   96.39  next
   96.40    case (Cons x xs)
   96.41 @@ -595,7 +595,7 @@
   96.42  using prems by (simp add: compose_conv)
   96.43  
   96.44  lemma dom_compose: "fst ` set (compose xs ys) \<subseteq> fst ` set xs"
   96.45 -proof (induct xs ys rule: compose_induct )
   96.46 +proof (induct xs ys rule: compose_induct)
   96.47    case Nil thus ?case by simp
   96.48  next
   96.49    case (Cons x xs)
   96.50 @@ -799,12 +799,12 @@
   96.51   "map_of (update x y (restrict D al)) = map_of (update x y (restrict (D-{x}) al))"
   96.52    by (simp add: update_conv' restr_conv') (rule fun_upd_restrict)
   96.53  
   96.54 -lemma upate_restr_conv[simp]:
   96.55 +lemma upate_restr_conv [simp]:
   96.56   "x \<in> D \<Longrightarrow> 
   96.57   map_of (update x y (restrict D al)) = map_of (update x y (restrict (D-{x}) al))"
   96.58    by (simp add: update_conv' restr_conv')
   96.59  
   96.60 -lemma restr_updates[simp]: "
   96.61 +lemma restr_updates [simp]: "
   96.62   \<lbrakk> length xs = length ys; set xs \<subseteq> D \<rbrakk>
   96.63   \<Longrightarrow> map_of (restrict D (updates xs ys al)) = 
   96.64       map_of (updates xs ys (restrict (D - set xs) al))"
    97.1 --- a/src/HOL/Library/BigO.thy	Fri Nov 17 02:19:55 2006 +0100
    97.2 +++ b/src/HOL/Library/BigO.thy	Fri Nov 17 02:20:03 2006 +0100
    97.3 @@ -39,7 +39,7 @@
    97.4  subsection {* Definitions *}
    97.5  
    97.6  definition
    97.7 -  bigo :: "('a => 'b::ordered_idom) => ('a => 'b) set"    ("(1O'(_'))")
    97.8 +  bigo :: "('a => 'b::ordered_idom) => ('a => 'b) set"  ("(1O'(_'))") where
    97.9    "O(f::('a => 'b)) =
   97.10        {h. EX c. ALL x. abs (h x) <= c * abs (f x)}"
   97.11  
   97.12 @@ -736,7 +736,7 @@
   97.13  
   97.14  definition
   97.15    lesso :: "('a => 'b::ordered_idom) => ('a => 'b) => ('a => 'b)"
   97.16 -      (infixl "<o" 70)
   97.17 +    (infixl "<o" 70) where
   97.18    "f <o g = (%x. max (f x - g x) 0)"
   97.19  
   97.20  lemma bigo_lesseq1: "f =o O(h) ==> ALL x. abs (g x) <= abs (f x) ==>
    98.1 --- a/src/HOL/Library/Char_ord.thy	Fri Nov 17 02:19:55 2006 +0100
    98.2 +++ b/src/HOL/Library/Char_ord.thy	Fri Nov 17 02:20:03 2006 +0100
    98.3 @@ -32,8 +32,8 @@
    98.4    "nibble_to_int NibbleF = 15"
    98.5  
    98.6  definition
    98.7 -  int_to_nibble :: "int \<Rightarrow> nibble"
    98.8 -  "int_to_nibble x \<equiv> (let y = x mod 16 in
    98.9 +  int_to_nibble :: "int \<Rightarrow> nibble" where
   98.10 +  "int_to_nibble x = (let y = x mod 16 in
   98.11      if y = 0 then Nibble0 else
   98.12      if y = 1 then Nibble1 else
   98.13      if y = 2 then Nibble2 else
    99.1 --- a/src/HOL/Library/Coinductive_List.thy	Fri Nov 17 02:19:55 2006 +0100
    99.2 +++ b/src/HOL/Library/Coinductive_List.thy	Fri Nov 17 02:20:03 2006 +0100
    99.3 @@ -13,6 +13,7 @@
    99.4  
    99.5  definition
    99.6    "NIL = Datatype.In0 (Datatype.Numb 0)"
    99.7 +definition
    99.8    "CONS M N = Datatype.In1 (Datatype.Scons M N)"
    99.9  
   99.10  lemma CONS_not_NIL [iff]: "CONS M N \<noteq> NIL"
   99.11 @@ -146,6 +147,7 @@
   99.12  
   99.13  definition
   99.14    "LNil = Abs_llist NIL"
   99.15 +definition
   99.16    "LCons x xs = Abs_llist (CONS (Datatype.Leaf x) (Rep_llist xs))"
   99.17  
   99.18  lemma LCons_not_LNil [iff]: "LCons x xs \<noteq> LNil"
   99.19 @@ -573,6 +575,7 @@
   99.20  
   99.21  definition
   99.22    "Lmap f M = LList_corec M (List_case None (\<lambda>x M'. Some (f x, M')))"
   99.23 +definition
   99.24    "lmap f l = llist_corec l
   99.25      (\<lambda>z.
   99.26        case z of LNil \<Rightarrow> None
   99.27 @@ -671,6 +674,7 @@
   99.28      (split (List_case
   99.29          (List_case None (\<lambda>N1 N2. Some (N1, (NIL, N2))))
   99.30          (\<lambda>M1 M2 N. Some (M1, (M2, N)))))"
   99.31 +definition
   99.32    "lappend l n = llist_corec (l, n)
   99.33      (split (llist_case
   99.34          (llist_case None (\<lambda>n1 n2. Some (n1, (LNil, n2))))
   99.35 @@ -746,7 +750,7 @@
   99.36  text {* @{text llist_fun_equalityI} cannot be used here! *}
   99.37  
   99.38  definition
   99.39 -  iterates :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a llist"
   99.40 +  iterates :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a llist" where
   99.41    "iterates f a = llist_corec a (\<lambda>x. Some (x, f x))"
   99.42  
   99.43  lemma iterates: "iterates f x = LCons x (iterates f (f x))"
   100.1 --- a/src/HOL/Library/Commutative_Ring.thy	Fri Nov 17 02:19:55 2006 +0100
   100.2 +++ b/src/HOL/Library/Commutative_Ring.thy	Fri Nov 17 02:20:03 2006 +0100
   100.3 @@ -48,14 +48,14 @@
   100.4  text {* Create polynomial normalized polynomials given normalized inputs. *}
   100.5  
   100.6  definition
   100.7 -  mkPinj :: "nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
   100.8 +  mkPinj :: "nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol" where
   100.9    "mkPinj x P = (case P of
  100.10      Pc c \<Rightarrow> Pc c |
  100.11      Pinj y P \<Rightarrow> Pinj (x + y) P |
  100.12      PX p1 y p2 \<Rightarrow> Pinj x P)"
  100.13  
  100.14  definition
  100.15 -  mkPX :: "'a::{comm_ring,recpower} pol \<Rightarrow> nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
  100.16 +  mkPX :: "'a::{comm_ring,recpower} pol \<Rightarrow> nat \<Rightarrow> 'a pol \<Rightarrow> 'a pol" where
  100.17    "mkPX P i Q = (case P of
  100.18      Pc c \<Rightarrow> (if (c = 0) then (mkPinj 1 Q) else (PX P i Q)) |
  100.19      Pinj j R \<Rightarrow> PX P i Q |
  100.20 @@ -128,7 +128,7 @@
  100.21  
  100.22  text {* Substraction *}
  100.23  definition
  100.24 -  sub :: "'a::{comm_ring,recpower} pol \<Rightarrow> 'a pol \<Rightarrow> 'a pol"
  100.25 +  sub :: "'a::{comm_ring,recpower} pol \<Rightarrow> 'a pol \<Rightarrow> 'a pol" where
  100.26    "sub p q = add (p, neg q)"
  100.27  
  100.28  text {* Square for Fast Exponentation *}
   101.1 --- a/src/HOL/Library/Continuity.thy	Fri Nov 17 02:19:55 2006 +0100
   101.2 +++ b/src/HOL/Library/Continuity.thy	Fri Nov 17 02:20:03 2006 +0100
   101.3 @@ -18,8 +18,8 @@
   101.4  "continuous F == !M. chain M \<longrightarrow> F(SUP i. M i) = (SUP i. F(M i))"
   101.5  
   101.6  abbreviation
   101.7 - bot :: "'a::order"
   101.8 -"bot == Sup {}"
   101.9 +  bot :: "'a::order" where
  101.10 +  "bot == Sup {}"
  101.11  
  101.12  lemma SUP_nat_conv:
  101.13   "(SUP n::nat. M n::'a::comp_lat) = join (M 0) (SUP n. M(Suc n))"
  101.14 @@ -91,7 +91,7 @@
  101.15  subsection "Chains"
  101.16  
  101.17  definition
  101.18 -  up_chain :: "(nat => 'a set) => bool"
  101.19 +  up_chain :: "(nat => 'a set) => bool" where
  101.20    "up_chain F = (\<forall>i. F i \<subseteq> F (Suc i))"
  101.21  
  101.22  lemma up_chainI: "(!!i. F i \<subseteq> F (Suc i)) ==> up_chain F"
  101.23 @@ -113,7 +113,7 @@
  101.24  
  101.25  
  101.26  definition
  101.27 -  down_chain :: "(nat => 'a set) => bool"
  101.28 +  down_chain :: "(nat => 'a set) => bool" where
  101.29    "down_chain F = (\<forall>i. F (Suc i) \<subseteq> F i)"
  101.30  
  101.31  lemma down_chainI: "(!!i. F (Suc i) \<subseteq> F i) ==> down_chain F"
  101.32 @@ -137,7 +137,7 @@
  101.33  subsection "Continuity"
  101.34  
  101.35  definition
  101.36 -  up_cont :: "('a set => 'a set) => bool"
  101.37 +  up_cont :: "('a set => 'a set) => bool" where
  101.38    "up_cont f = (\<forall>F. up_chain F --> f (\<Union>(range F)) = \<Union>(f ` range F))"
  101.39  
  101.40  lemma up_contI:
  101.41 @@ -164,7 +164,7 @@
  101.42  
  101.43  
  101.44  definition
  101.45 -  down_cont :: "('a set => 'a set) => bool"
  101.46 +  down_cont :: "('a set => 'a set) => bool" where
  101.47    "down_cont f =
  101.48      (\<forall>F. down_chain F --> f (Inter (range F)) = Inter (f ` range F))"
  101.49  
  101.50 @@ -194,7 +194,7 @@
  101.51  subsection "Iteration"
  101.52  
  101.53  definition
  101.54 -  up_iterate :: "('a set => 'a set) => nat => 'a set"
  101.55 +  up_iterate :: "('a set => 'a set) => nat => 'a set" where
  101.56    "up_iterate f n = (f^n) {}"
  101.57  
  101.58  lemma up_iterate_0 [simp]: "up_iterate f 0 = {}"
  101.59 @@ -246,7 +246,7 @@
  101.60  
  101.61  
  101.62  definition
  101.63 -  down_iterate :: "('a set => 'a set) => nat => 'a set"
  101.64 +  down_iterate :: "('a set => 'a set) => nat => 'a set" where
  101.65    "down_iterate f n = (f^n) UNIV"
  101.66  
  101.67  lemma down_iterate_0 [simp]: "down_iterate f 0 = UNIV"
   102.1 --- a/src/HOL/Library/EfficientNat.thy	Fri Nov 17 02:19:55 2006 +0100
   102.2 +++ b/src/HOL/Library/EfficientNat.thy	Fri Nov 17 02:20:03 2006 +0100
   102.3 @@ -25,7 +25,7 @@
   102.4  *}
   102.5  
   102.6  definition
   102.7 -  nat_of_int :: "int \<Rightarrow> nat"
   102.8 +  nat_of_int :: "int \<Rightarrow> nat" where
   102.9    "k \<ge> 0 \<Longrightarrow> nat_of_int k = nat k"
  102.10  
  102.11  lemma nat_of_int_int:
   103.1 --- a/src/HOL/Library/ExecutableRat.thy	Fri Nov 17 02:19:55 2006 +0100
   103.2 +++ b/src/HOL/Library/ExecutableRat.thy	Fri Nov 17 02:20:03 2006 +0100
   103.3 @@ -27,8 +27,8 @@
   103.4  instance erat :: ord ..
   103.5  
   103.6  definition
   103.7 -  norm :: "erat \<Rightarrow> erat"
   103.8 -  norm_def: "norm r = (case r of (Rat a p q) \<Rightarrow>
   103.9 +  norm :: "erat \<Rightarrow> erat" where
  103.10 +  "norm r = (case r of (Rat a p q) \<Rightarrow>
  103.11       if p = 0 then Rat True 0 1
  103.12       else
  103.13         let
  103.14 @@ -36,19 +36,28 @@
  103.15         in let
  103.16           m = zgcd (absp, q)
  103.17         in Rat (a = (0 <= p)) (absp div m) (q div m))"
  103.18 -  common :: "(int * int) * (int * int) \<Rightarrow> (int * int) * int"
  103.19 -  common_def: "common r = (case r of ((p1, q1), (p2, q2)) \<Rightarrow>
  103.20 +
  103.21 +definition
  103.22 +  common :: "(int * int) * (int * int) \<Rightarrow> (int * int) * int" where
  103.23 +  "common r = (case r of ((p1, q1), (p2, q2)) \<Rightarrow>
  103.24         let q' = q1 * q2 div int (gcd (nat q1, nat q2))
  103.25         in ((p1 * (q' div q1), p2 * (q' div q2)), q'))"
  103.26 -  of_quotient :: "int \<Rightarrow> int \<Rightarrow> erat"
  103.27 -  of_quotient_def: "of_quotient a b =
  103.28 -       norm (Rat True a b)"
  103.29 -  of_rat :: "rat \<Rightarrow> erat"
  103.30 -  of_rat_def: "of_rat r = split of_quotient (SOME s. s : Rep_Rat r)"
  103.31 -  to_rat :: "erat \<Rightarrow> rat"
  103.32 -  to_rat_def: "to_rat r = (case r of (Rat a p q) \<Rightarrow>
  103.33 +
  103.34 +definition
  103.35 +  of_quotient :: "int \<Rightarrow> int \<Rightarrow> erat" where
  103.36 +  "of_quotient a b = norm (Rat True a b)"
  103.37 +
  103.38 +definition
  103.39 +  of_rat :: "rat \<Rightarrow> erat" where
  103.40 +  "of_rat r = split of_quotient (SOME s. s : Rep_Rat r)"
  103.41 +
  103.42 +definition
  103.43 +  to_rat :: "erat \<Rightarrow> rat" where
  103.44 +  "to_rat r = (case r of (Rat a p q) \<Rightarrow>
  103.45         if a then Fract p q else Fract (uminus p) q)"
  103.46 -  eq_erat :: "erat \<Rightarrow> erat \<Rightarrow> bool"
  103.47 +
  103.48 +definition
  103.49 +  eq_erat :: "erat \<Rightarrow> erat \<Rightarrow> bool" where
  103.50    "eq_erat r s = (norm r = norm s)"
  103.51  
  103.52  axiomatization
   104.1 --- a/src/HOL/Library/ExecutableSet.thy	Fri Nov 17 02:19:55 2006 +0100
   104.2 +++ b/src/HOL/Library/ExecutableSet.thy	Fri Nov 17 02:20:03 2006 +0100
   104.3 @@ -14,7 +14,7 @@
   104.4  instance set :: (eq) eq ..
   104.5  
   104.6  definition
   104.7 -  minus_set :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set"
   104.8 +  minus_set :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" where
   104.9    "minus_set xs ys = ys - xs"
  104.10  
  104.11  lemma [code inline]:
  104.12 @@ -22,8 +22,8 @@
  104.13    unfolding minus_set_def ..
  104.14  
  104.15  definition
  104.16 -  subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
  104.17 -  subset_def: "subset = op \<subseteq>"
  104.18 +  subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where
  104.19 +  "subset = op \<subseteq>"
  104.20  
  104.21  lemmas [symmetric, code inline] = subset_def
  104.22  
  104.23 @@ -44,8 +44,8 @@
  104.24    unfolding bex_triv_one_point1 ..
  104.25  
  104.26  definition
  104.27 -  filter_set :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set"
  104.28 -  filter_set_def: "filter_set P xs = {x\<in>xs. P x}"
  104.29 +  filter_set :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set" where
  104.30 +  "filter_set P xs = {x\<in>xs. P x}"
  104.31  
  104.32  lemmas [symmetric, code inline] = filter_set_def
  104.33  
  104.34 @@ -55,11 +55,15 @@
  104.35  subsection {* Basic definitions *}
  104.36  
  104.37  definition
  104.38 -  flip :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c"
  104.39 +  flip :: "('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'b \<Rightarrow> 'a \<Rightarrow> 'c" where
  104.40    "flip f a b = f b a"
  104.41 -  member :: "'a list \<Rightarrow> 'a \<Rightarrow> bool"
  104.42 +
  104.43 +definition
  104.44 +  member :: "'a list \<Rightarrow> 'a \<Rightarrow> bool" where
  104.45    "member xs x = (x \<in> set xs)"
  104.46 -  insertl :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list"
  104.47 +
  104.48 +definition
  104.49 +  insertl :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list" where
  104.50    "insertl x xs = (if member xs x then xs else x#xs)"
  104.51  
  104.52  lemma
  104.53 @@ -174,9 +178,11 @@
  104.54    "intersects (x#xs) = foldr intersect xs x"
  104.55  
  104.56  definition
  104.57 -  map_union :: "'a list \<Rightarrow> ('a \<Rightarrow> 'b list) \<Rightarrow> 'b list"
  104.58 +  map_union :: "'a list \<Rightarrow> ('a \<Rightarrow> 'b list) \<Rightarrow> 'b list" where
  104.59    "map_union xs f = unions (map f xs)"
  104.60 -  map_inter :: "'a list \<Rightarrow> ('a \<Rightarrow> 'b list) \<Rightarrow> 'b list"
  104.61 +
  104.62 +definition
  104.63 +  map_inter :: "'a list \<Rightarrow> ('a \<Rightarrow> 'b list) \<Rightarrow> 'b list" where
  104.64    "map_inter xs f = intersects (map f xs)"
  104.65  
  104.66  
  104.67 @@ -237,9 +243,10 @@
  104.68    unfolding map_inter_def iso_intersects by (induct xs) (simp_all add: iso_member, auto)
  104.69  
  104.70  definition
  104.71 -  Blall :: "'a list \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
  104.72 +  Blall :: "'a list \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where
  104.73    "Blall = flip list_all"
  104.74 -  Blex :: "'a list \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
  104.75 +definition
  104.76 +  Blex :: "'a list \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where
  104.77    "Blex = flip list_ex"
  104.78  
  104.79  lemma iso_Ball:
   105.1 --- a/src/HOL/Library/FuncSet.thy	Fri Nov 17 02:19:55 2006 +0100
   105.2 +++ b/src/HOL/Library/FuncSet.thy	Fri Nov 17 02:20:03 2006 +0100
   105.3 @@ -10,17 +10,20 @@
   105.4  begin
   105.5  
   105.6  definition
   105.7 -  Pi :: "['a set, 'a => 'b set] => ('a => 'b) set"
   105.8 +  Pi :: "['a set, 'a => 'b set] => ('a => 'b) set" where
   105.9    "Pi A B = {f. \<forall>x. x \<in> A --> f x \<in> B x}"
  105.10  
  105.11 -  extensional :: "'a set => ('a => 'b) set"
  105.12 +definition
  105.13 +  extensional :: "'a set => ('a => 'b) set" where
  105.14    "extensional A = {f. \<forall>x. x~:A --> f x = arbitrary}"
  105.15  
  105.16 -  "restrict" :: "['a => 'b, 'a set] => ('a => 'b)"
  105.17 +definition
  105.18 +  "restrict" :: "['a => 'b, 'a set] => ('a => 'b)" where
  105.19    "restrict f A = (%x. if x \<in> A then f x else arbitrary)"
  105.20  
  105.21  abbreviation
  105.22 -  funcset :: "['a set, 'b set] => ('a => 'b) set"      (infixr "->" 60)
  105.23 +  funcset :: "['a set, 'b set] => ('a => 'b) set"
  105.24 +    (infixr "->" 60) where
  105.25    "A -> B == Pi A (%_. B)"
  105.26  
  105.27  notation (xsymbols)
  105.28 @@ -43,7 +46,7 @@
  105.29    "%x:A. f" == "CONST restrict (%x. f) A"
  105.30  
  105.31  definition
  105.32 -  "compose" :: "['a set, 'b => 'c, 'a => 'b] => ('a => 'c)"
  105.33 +  "compose" :: "['a set, 'b => 'c, 'a => 'b] => ('a => 'c)" where
  105.34    "compose A g f = (\<lambda>x\<in>A. g (f x))"
  105.35  
  105.36  
  105.37 @@ -142,7 +145,7 @@
  105.38  the theorems belong here, or need at least @{term Hilbert_Choice}.*}
  105.39  
  105.40  definition
  105.41 -  bij_betw :: "['a => 'b, 'a set, 'b set] => bool"         -- {* bijective *}
  105.42 +  bij_betw :: "['a => 'b, 'a set, 'b set] => bool" where -- {* bijective *}
  105.43    "bij_betw f A B = (inj_on f A & f ` A = B)"
  105.44  
  105.45  lemma bij_betw_imp_inj_on: "bij_betw f A B \<Longrightarrow> inj_on f A"
   106.1 --- a/src/HOL/Library/GCD.thy	Fri Nov 17 02:19:55 2006 +0100
   106.2 +++ b/src/HOL/Library/GCD.thy	Fri Nov 17 02:20:03 2006 +0100
   106.3 @@ -22,7 +22,7 @@
   106.4    "gcd (m, n) = (if n = 0 then m else gcd (n, m mod n))"
   106.5  
   106.6  definition
   106.7 -  is_gcd :: "nat => nat => nat => bool"  -- {* @{term gcd} as a relation *}
   106.8 +  is_gcd :: "nat => nat => nat => bool" where -- {* @{term gcd} as a relation *}
   106.9    "is_gcd p m n = (p dvd m \<and> p dvd n \<and>
  106.10      (\<forall>d. d dvd m \<and> d dvd n --> d dvd p))"
  106.11  
   107.1 --- a/src/HOL/Library/Infinite_Set.thy	Fri Nov 17 02:19:55 2006 +0100
   107.2 +++ b/src/HOL/Library/Infinite_Set.thy	Fri Nov 17 02:20:03 2006 +0100
   107.3 @@ -18,7 +18,7 @@
   107.4  *}
   107.5  
   107.6  abbreviation
   107.7 -  infinite :: "'a set \<Rightarrow> bool"
   107.8 +  infinite :: "'a set \<Rightarrow> bool" where
   107.9    "infinite S == \<not> finite S"
  107.10  
  107.11  text {*
  107.12 @@ -349,17 +349,19 @@
  107.13  *}
  107.14  
  107.15  definition
  107.16 -  Inf_many :: "('a \<Rightarrow> bool) \<Rightarrow> bool"      (binder "INF " 10)
  107.17 +  Inf_many :: "('a \<Rightarrow> bool) \<Rightarrow> bool"  (binder "INF " 10) where
  107.18    "Inf_many P = infinite {x. P x}"
  107.19 -  Alm_all  :: "('a \<Rightarrow> bool) \<Rightarrow> bool"      (binder "MOST " 10)
  107.20 +
  107.21 +definition
  107.22 +  Alm_all :: "('a \<Rightarrow> bool) \<Rightarrow> bool"  (binder "MOST " 10) where
  107.23    "Alm_all P = (\<not> (INF x. \<not> P x))"
  107.24  
  107.25  notation (xsymbols)
  107.26 -  Inf_many  (binder "\<exists>\<^sub>\<infinity>" 10)
  107.27 +  Inf_many  (binder "\<exists>\<^sub>\<infinity>" 10) and
  107.28    Alm_all  (binder "\<forall>\<^sub>\<infinity>" 10)
  107.29  
  107.30  notation (HTML output)
  107.31 -  Inf_many  (binder "\<exists>\<^sub>\<infinity>" 10)
  107.32 +  Inf_many  (binder "\<exists>\<^sub>\<infinity>" 10) and
  107.33    Alm_all  (binder "\<forall>\<^sub>\<infinity>" 10)
  107.34  
  107.35  lemma INF_EX:
  107.36 @@ -453,7 +455,7 @@
  107.37  *}
  107.38  
  107.39  definition
  107.40 -  atmost_one :: "'a set \<Rightarrow> bool"
  107.41 +  atmost_one :: "'a set \<Rightarrow> bool" where
  107.42    "atmost_one S = (\<forall>x y. x\<in>S \<and> y\<in>S \<longrightarrow> x=y)"
  107.43  
  107.44  lemma atmost_one_empty: "S = {} \<Longrightarrow> atmost_one S"
   108.1 --- a/src/HOL/Library/List_Prefix.thy	Fri Nov 17 02:19:55 2006 +0100
   108.2 +++ b/src/HOL/Library/List_Prefix.thy	Fri Nov 17 02:20:03 2006 +0100
   108.3 @@ -159,7 +159,7 @@
   108.4  subsection {* Parallel lists *}
   108.5  
   108.6  definition
   108.7 -  parallel :: "'a list => 'a list => bool"    (infixl "\<parallel>" 50)
   108.8 +  parallel :: "'a list => 'a list => bool"  (infixl "\<parallel>" 50) where
   108.9    "(xs \<parallel> ys) = (\<not> xs \<le> ys \<and> \<not> ys \<le> xs)"
  108.10  
  108.11  lemma parallelI [intro]: "\<not> xs \<le> ys ==> \<not> ys \<le> xs ==> xs \<parallel> ys"
  108.12 @@ -218,7 +218,7 @@
  108.13  subsection {* Postfix order on lists *}
  108.14  
  108.15  definition
  108.16 -  postfix :: "'a list => 'a list => bool"  ("(_/ >>= _)" [51, 50] 50)
  108.17 +  postfix :: "'a list => 'a list => bool"  ("(_/ >>= _)" [51, 50] 50) where
  108.18    "(xs >>= ys) = (\<exists>zs. xs = zs @ ys)"
  108.19  
  108.20  lemma postfixI [intro?]: "xs = zs @ ys ==> xs >>= ys"
   109.1 --- a/src/HOL/Library/Multiset.thy	Fri Nov 17 02:19:55 2006 +0100
   109.2 +++ b/src/HOL/Library/Multiset.thy	Fri Nov 17 02:20:03 2006 +0100
   109.3 @@ -21,20 +21,23 @@
   109.4    and [simp] = Rep_multiset_inject [symmetric]
   109.5  
   109.6  definition
   109.7 -  Mempty :: "'a multiset"    ("{#}")
   109.8 +  Mempty :: "'a multiset"  ("{#}") where
   109.9    "{#} = Abs_multiset (\<lambda>a. 0)"
  109.10  
  109.11 -  single :: "'a => 'a multiset"    ("{#_#}")
  109.12 +definition
  109.13 +  single :: "'a => 'a multiset"  ("{#_#}") where
  109.14    "{#a#} = Abs_multiset (\<lambda>b. if b = a then 1 else 0)"
  109.15  
  109.16 -  count :: "'a multiset => 'a => nat"
  109.17 +definition
  109.18 +  count :: "'a multiset => 'a => nat" where
  109.19    "count = Rep_multiset"
  109.20  
  109.21 -  MCollect :: "'a multiset => ('a => bool) => 'a multiset"
  109.22 +definition
  109.23 +  MCollect :: "'a multiset => ('a => bool) => 'a multiset" where
  109.24    "MCollect M P = Abs_multiset (\<lambda>x. if P x then Rep_multiset M x else 0)"
  109.25  
  109.26  abbreviation
  109.27 -  Melem :: "'a => 'a multiset => bool"    ("(_/ :# _)" [50, 51] 50)
  109.28 +  Melem :: "'a => 'a multiset => bool"  ("(_/ :# _)" [50, 51] 50) where
  109.29    "a :# M == 0 < count M a"
  109.30  
  109.31  syntax
  109.32 @@ -43,7 +46,7 @@
  109.33    "{#x:M. P#}" == "CONST MCollect M (\<lambda>x. P)"
  109.34  
  109.35  definition
  109.36 -  set_of :: "'a multiset => 'a set"
  109.37 +  set_of :: "'a multiset => 'a set" where
  109.38    "set_of M = {x. x :# M}"
  109.39  
  109.40  instance multiset :: (type) "{plus, minus, zero}" ..
  109.41 @@ -55,7 +58,7 @@
  109.42    size_def: "size M == setsum (count M) (set_of M)"
  109.43  
  109.44  definition
  109.45 -  multiset_inter :: "'a multiset \<Rightarrow> 'a multiset \<Rightarrow> 'a multiset" (infixl "#\<inter>" 70)
  109.46 +  multiset_inter :: "'a multiset \<Rightarrow> 'a multiset \<Rightarrow> 'a multiset"  (infixl "#\<inter>" 70) where
  109.47    "multiset_inter A B = A - (A - B)"
  109.48  
  109.49  
  109.50 @@ -380,12 +383,13 @@
  109.51  subsubsection {* Well-foundedness *}
  109.52  
  109.53  definition
  109.54 -  mult1 :: "('a \<times> 'a) set => ('a multiset \<times> 'a multiset) set"
  109.55 +  mult1 :: "('a \<times> 'a) set => ('a multiset \<times> 'a multiset) set" where
  109.56    "mult1 r =
  109.57      {(N, M). \<exists>a M0 K. M = M0 + {#a#} \<and> N = M0 + K \<and>
  109.58        (\<forall>b. b :# K --> (b, a) \<in> r)}"
  109.59  
  109.60 -  mult :: "('a \<times> 'a) set => ('a multiset \<times> 'a multiset) set"
  109.61 +definition
  109.62 +  mult :: "('a \<times> 'a) set => ('a multiset \<times> 'a multiset) set" where
  109.63    "mult r = (mult1 r)\<^sup>+"
  109.64  
  109.65  lemma not_less_empty [iff]: "(M, {#}) \<notin> mult1 r"
  109.66 @@ -796,7 +800,7 @@
  109.67  subsection {* Pointwise ordering induced by count *}
  109.68  
  109.69  definition
  109.70 -  mset_le :: "['a multiset, 'a multiset] \<Rightarrow> bool"   ("_ \<le># _"  [50,51] 50)
  109.71 +  mset_le :: "['a multiset, 'a multiset] \<Rightarrow> bool"  ("_ \<le># _"  [50,51] 50) where
  109.72    "(xs \<le># ys) = (\<forall>a. count xs a \<le> count ys a)"
  109.73  
  109.74  lemma mset_le_refl[simp]: "xs \<le># xs"
   110.1 --- a/src/HOL/Library/NatPair.thy	Fri Nov 17 02:19:55 2006 +0100
   110.2 +++ b/src/HOL/Library/NatPair.thy	Fri Nov 17 02:20:03 2006 +0100
   110.3 @@ -16,7 +16,7 @@
   110.4  *}
   110.5  
   110.6  definition
   110.7 -  nat2_to_nat:: "(nat * nat) \<Rightarrow> nat"
   110.8 +  nat2_to_nat:: "(nat * nat) \<Rightarrow> nat" where
   110.9    "nat2_to_nat pair = (let (n,m) = pair in (n+m) * Suc (n+m) div 2 + n)"
  110.10  
  110.11  lemma dvd2_a_x_suc_a: "2 dvd a * (Suc a)"
   111.1 --- a/src/HOL/Library/Nat_Infinity.thy	Fri Nov 17 02:19:55 2006 +0100
   111.2 +++ b/src/HOL/Library/Nat_Infinity.thy	Fri Nov 17 02:20:03 2006 +0100
   111.3 @@ -28,7 +28,7 @@
   111.4  instance inat :: "{ord, zero}" ..
   111.5  
   111.6  definition
   111.7 -  iSuc :: "inat => inat"
   111.8 +  iSuc :: "inat => inat" where
   111.9    "iSuc i = (case i of Fin n => Fin (Suc n) | \<infinity> => \<infinity>)"
  111.10  
  111.11  defs (overloaded)
   112.1 --- a/src/HOL/Library/OptionalSugar.thy	Fri Nov 17 02:19:55 2006 +0100
   112.2 +++ b/src/HOL/Library/OptionalSugar.thy	Fri Nov 17 02:20:03 2006 +0100
   112.3 @@ -18,7 +18,7 @@
   112.4  
   112.5  (* aligning equations *)
   112.6  notation (tab output)
   112.7 -  "op ="  ("(_) \<^raw:}\putisatab\isa{\ >=\<^raw:}\putisatab\isa{> (_)" [50,49] 50)
   112.8 +  "op ="  ("(_) \<^raw:}\putisatab\isa{\ >=\<^raw:}\putisatab\isa{> (_)" [50,49] 50) and
   112.9    "=="  ("(_) \<^raw:}\putisatab\isa{\ >\<equiv>\<^raw:}\putisatab\isa{> (_)")
  112.10  
  112.11  (* Let *)
   113.1 --- a/src/HOL/Library/Parity.thy	Fri Nov 17 02:19:55 2006 +0100
   113.2 +++ b/src/HOL/Library/Parity.thy	Fri Nov 17 02:20:03 2006 +0100
   113.3 @@ -22,7 +22,7 @@
   113.4    even_nat_def: "even (x::nat) == even (int x)"
   113.5  
   113.6  abbreviation
   113.7 -  odd :: "'a::even_odd => bool"
   113.8 +  odd :: "'a::even_odd => bool" where
   113.9    "odd x == \<not> even x"
  113.10  
  113.11  
   114.1 --- a/src/HOL/Library/Permutation.thy	Fri Nov 17 02:19:55 2006 +0100
   114.2 +++ b/src/HOL/Library/Permutation.thy	Fri Nov 17 02:20:03 2006 +0100
   114.3 @@ -12,7 +12,7 @@
   114.4    perm :: "('a list * 'a list) set"
   114.5  
   114.6  abbreviation
   114.7 -  perm_rel :: "'a list => 'a list => bool"    ("_ <~~> _"  [50, 50] 50)
   114.8 +  perm_rel :: "'a list => 'a list => bool"  ("_ <~~> _"  [50, 50] 50) where
   114.9    "x <~~> y == (x, y) \<in> perm"
  114.10  
  114.11  inductive perm
   115.1 --- a/src/HOL/Library/Primes.thy	Fri Nov 17 02:19:55 2006 +0100
   115.2 +++ b/src/HOL/Library/Primes.thy	Fri Nov 17 02:20:03 2006 +0100
   115.3 @@ -11,10 +11,11 @@
   115.4  begin
   115.5  
   115.6  definition
   115.7 -  coprime :: "nat => nat => bool"
   115.8 +  coprime :: "nat => nat => bool" where
   115.9    "coprime m n = (gcd (m, n) = 1)"
  115.10  
  115.11 -  prime :: "nat \<Rightarrow> bool"
  115.12 +definition
  115.13 +  prime :: "nat \<Rightarrow> bool" where
  115.14    "prime p = (1 < p \<and> (\<forall>m. m dvd p --> m = 1 \<or> m = p))"
  115.15  
  115.16  
   116.1 --- a/src/HOL/Library/Quotient.thy	Fri Nov 17 02:19:55 2006 +0100
   116.2 +++ b/src/HOL/Library/Quotient.thy	Fri Nov 17 02:20:03 2006 +0100
   116.3 @@ -75,7 +75,7 @@
   116.4  *}
   116.5  
   116.6  definition
   116.7 -  "class" :: "'a::equiv => 'a quot"    ("\<lfloor>_\<rfloor>")
   116.8 +  "class" :: "'a::equiv => 'a quot"  ("\<lfloor>_\<rfloor>") where
   116.9    "\<lfloor>a\<rfloor> = Abs_quot {x. a \<sim> x}"
  116.10  
  116.11  theorem quot_exhaust: "\<exists>a. A = \<lfloor>a\<rfloor>"
  116.12 @@ -134,7 +134,7 @@
  116.13  subsection {* Picking representing elements *}
  116.14  
  116.15  definition
  116.16 -  pick :: "'a::equiv quot => 'a"
  116.17 +  pick :: "'a::equiv quot => 'a" where
  116.18    "pick A = (SOME a. A = \<lfloor>a\<rfloor>)"
  116.19  
  116.20  theorem pick_equiv [intro]: "pick \<lfloor>a\<rfloor> \<sim> a"
   117.1 --- a/src/HOL/Library/SetsAndFunctions.thy	Fri Nov 17 02:19:55 2006 +0100
   117.2 +++ b/src/HOL/Library/SetsAndFunctions.thy	Fri Nov 17 02:20:03 2006 +0100
   117.3 @@ -52,14 +52,15 @@
   117.4    set_one: "1::('a::one)set == {1}"
   117.5  
   117.6  definition
   117.7 -  elt_set_plus :: "'a::plus => 'a set => 'a set"    (infixl "+o" 70)
   117.8 +  elt_set_plus :: "'a::plus => 'a set => 'a set"  (infixl "+o" 70) where
   117.9    "a +o B = {c. EX b:B. c = a + b}"
  117.10  
  117.11 -  elt_set_times :: "'a::times => 'a set => 'a set"  (infixl "*o" 80)
  117.12 +definition
  117.13 +  elt_set_times :: "'a::times => 'a set => 'a set"  (infixl "*o" 80) where
  117.14    "a *o B = {c. EX b:B. c = a * b}"
  117.15  
  117.16  abbreviation (input)
  117.17 -  elt_set_eq :: "'a => 'a set => bool"      (infix "=o" 50)
  117.18 +  elt_set_eq :: "'a => 'a set => bool"  (infix "=o" 50) where
  117.19    "x =o A == x : A"
  117.20  
  117.21  instance "fun" :: (type,semigroup_add)semigroup_add
   118.1 --- a/src/HOL/Library/State_Monad.thy	Fri Nov 17 02:19:55 2006 +0100
   118.2 +++ b/src/HOL/Library/State_Monad.thy	Fri Nov 17 02:20:03 2006 +0100
   118.3 @@ -68,12 +68,16 @@
   118.4  
   118.5  definition
   118.6    mbind :: "('a \<Rightarrow> 'b \<times> 'c) \<Rightarrow> ('b \<Rightarrow> 'c \<Rightarrow> 'd) \<Rightarrow> 'a \<Rightarrow> 'd"
   118.7 -    (infixl ">>=" 60)
   118.8 +    (infixl ">>=" 60) where
   118.9    "f >>= g = split g \<circ> f"
  118.10 +
  118.11 +definition
  118.12    fcomp :: "('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'c) \<Rightarrow> 'a \<Rightarrow> 'c"
  118.13 -    (infixl ">>" 60)
  118.14 +    (infixl ">>" 60) where
  118.15    "f >> g = g \<circ> f"
  118.16 -  run :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b"
  118.17 +
  118.18 +definition
  118.19 +  run :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b" where
  118.20    "run f = f"
  118.21  
  118.22  print_ast_translation {*[
   119.1 --- a/src/HOL/Library/While_Combinator.thy	Fri Nov 17 02:19:55 2006 +0100
   119.2 +++ b/src/HOL/Library/While_Combinator.thy	Fri Nov 17 02:20:03 2006 +0100
   119.3 @@ -36,7 +36,7 @@
   119.4    done
   119.5  
   119.6  definition
   119.7 -  while :: "('a => bool) => ('a => 'a) => 'a => 'a"
   119.8 +  while :: "('a => bool) => ('a => 'a) => 'a => 'a" where
   119.9    "while b c s = while_aux (b, c, s)"
  119.10  
  119.11  lemma while_aux_unfold:
   120.1 --- a/src/HOL/Library/Word.thy	Fri Nov 17 02:19:55 2006 +0100
   120.2 +++ b/src/HOL/Library/Word.thy	Fri Nov 17 02:20:03 2006 +0100
   120.3 @@ -57,15 +57,15 @@
   120.4    bitxor :: "bit => bit => bit" (infixr "bitxor" 30)
   120.5  
   120.6  notation (xsymbols)
   120.7 -  bitnot ("\<not>\<^sub>b _" [40] 40)
   120.8 -  bitand (infixr "\<and>\<^sub>b" 35)
   120.9 -  bitor  (infixr "\<or>\<^sub>b" 30)
  120.10 +  bitnot ("\<not>\<^sub>b _" [40] 40) and
  120.11 +  bitand (infixr "\<and>\<^sub>b" 35) and
  120.12 +  bitor  (infixr "\<or>\<^sub>b" 30) and
  120.13    bitxor (infixr "\<oplus>\<^sub>b" 30)
  120.14  
  120.15  notation (HTML output)
  120.16 -  bitnot ("\<not>\<^sub>b _" [40] 40)
  120.17 -  bitand (infixr "\<and>\<^sub>b" 35)
  120.18 -  bitor  (infixr "\<or>\<^sub>b" 30)
  120.19 +  bitnot ("\<not>\<^sub>b _" [40] 40) and
  120.20 +  bitand (infixr "\<and>\<^sub>b" 35) and
  120.21 +  bitor  (infixr "\<or>\<^sub>b" 30) and
  120.22    bitxor (infixr "\<oplus>\<^sub>b" 30)
  120.23  
  120.24  primrec
  120.25 @@ -142,11 +142,15 @@
  120.26  qed
  120.27  
  120.28  definition
  120.29 -  bv_msb :: "bit list => bit"
  120.30 +  bv_msb :: "bit list => bit" where
  120.31    "bv_msb w = (if w = [] then \<zero> else hd w)"
  120.32 -  bv_extend :: "[nat,bit,bit list]=>bit list"
  120.33 +
  120.34 +definition
  120.35 +  bv_extend :: "[nat,bit,bit list]=>bit list" where
  120.36    "bv_extend i b w = (replicate (i - length w) b) @ w"
  120.37 -  bv_not :: "bit list => bit list"
  120.38 +
  120.39 +definition
  120.40 +  bv_not :: "bit list => bit list" where
  120.41    "bv_not w = map bitnot w"
  120.42  
  120.43  lemma bv_length_extend [simp]: "length w \<le> i ==> length (bv_extend i b w) = i"
  120.44 @@ -177,7 +181,7 @@
  120.45    by (induct w,simp_all)
  120.46  
  120.47  definition
  120.48 -  bv_to_nat :: "bit list => nat"
  120.49 +  bv_to_nat :: "bit list => nat" where
  120.50    "bv_to_nat = foldl (%bn b. 2 * bn + bitval b) 0"
  120.51  
  120.52  lemma bv_to_nat_Nil [simp]: "bv_to_nat [] = 0"
  120.53 @@ -327,7 +331,7 @@
  120.54  qed
  120.55  
  120.56  definition
  120.57 -  norm_unsigned :: "bit list => bit list"
  120.58 +  norm_unsigned :: "bit list => bit list" where
  120.59    "norm_unsigned = rem_initial \<zero>"
  120.60  
  120.61  lemma norm_unsigned_Nil [simp]: "norm_unsigned [] = []"
  120.62 @@ -350,7 +354,7 @@
  120.63                                 else nat_to_bv_helper (n div 2) ((if n mod 2 = 0 then \<zero> else \<one>)#bs)))"
  120.64  
  120.65  definition
  120.66 -  nat_to_bv :: "nat => bit list"
  120.67 +  nat_to_bv :: "nat => bit list" where
  120.68    "nat_to_bv n = nat_to_bv_helper n []"
  120.69  
  120.70  lemma nat_to_bv0 [simp]: "nat_to_bv 0 = []"
  120.71 @@ -857,7 +861,7 @@
  120.72  subsection {* Unsigned Arithmetic Operations *}
  120.73  
  120.74  definition
  120.75 -  bv_add :: "[bit list, bit list ] => bit list"
  120.76 +  bv_add :: "[bit list, bit list ] => bit list" where
  120.77    "bv_add w1 w2 = nat_to_bv (bv_to_nat w1 + bv_to_nat w2)"
  120.78  
  120.79  lemma bv_add_type1 [simp]: "bv_add (norm_unsigned w1) w2 = bv_add w1 w2"
  120.80 @@ -909,7 +913,7 @@
  120.81  qed
  120.82  
  120.83  definition
  120.84 -  bv_mult :: "[bit list, bit list ] => bit list"
  120.85 +  bv_mult :: "[bit list, bit list ] => bit list" where
  120.86    "bv_mult w1 w2 = nat_to_bv (bv_to_nat w1 * bv_to_nat w2)"
  120.87  
  120.88  lemma bv_mult_type1 [simp]: "bv_mult (norm_unsigned w1) w2 = bv_mult w1 w2"
  120.89 @@ -969,7 +973,7 @@
  120.90  lemmas [simp del] = norm_signed_Cons
  120.91  
  120.92  definition
  120.93 -  int_to_bv :: "int => bit list"
  120.94 +  int_to_bv :: "int => bit list" where
  120.95    "int_to_bv n = (if 0 \<le> n
  120.96                   then norm_signed (\<zero>#nat_to_bv (nat n))
  120.97                   else norm_signed (bv_not (\<zero>#nat_to_bv (nat (-n- 1)))))"
  120.98 @@ -1004,7 +1008,7 @@
  120.99  qed
 120.100  
 120.101  definition
 120.102 -  bv_to_int :: "bit list => int"
 120.103 +  bv_to_int :: "bit list => int" where
 120.104    "bv_to_int w =
 120.105      (case bv_msb w of \<zero> => int (bv_to_nat w)
 120.106      | \<one> => - int (bv_to_nat (bv_not w) + 1))"
 120.107 @@ -1589,7 +1593,7 @@
 120.108  subsubsection {* Conversion from unsigned to signed *}
 120.109  
 120.110  definition
 120.111 -  utos :: "bit list => bit list"
 120.112 +  utos :: "bit list => bit list" where
 120.113    "utos w = norm_signed (\<zero> # w)"
 120.114  
 120.115  lemma utos_type [simp]: "utos (norm_unsigned w) = utos w"
 120.116 @@ -1613,7 +1617,7 @@
 120.117  subsubsection {* Unary minus *}
 120.118  
 120.119  definition
 120.120 -  bv_uminus :: "bit list => bit list"
 120.121 +  bv_uminus :: "bit list => bit list" where
 120.122    "bv_uminus w = int_to_bv (- bv_to_int w)"
 120.123  
 120.124  lemma bv_uminus_type [simp]: "bv_uminus (norm_signed w) = bv_uminus w"
 120.125 @@ -1712,7 +1716,7 @@
 120.126  qed
 120.127  
 120.128  definition
 120.129 -  bv_sadd :: "[bit list, bit list ] => bit list"
 120.130 +  bv_sadd :: "[bit list, bit list ] => bit list" where
 120.131    "bv_sadd w1 w2 = int_to_bv (bv_to_int w1 + bv_to_int w2)"
 120.132  
 120.133  lemma bv_sadd_type1 [simp]: "bv_sadd (norm_signed w1) w2 = bv_sadd w1 w2"
 120.134 @@ -1823,7 +1827,7 @@
 120.135  qed
 120.136  
 120.137  definition
 120.138 -  bv_sub :: "[bit list, bit list] => bit list"
 120.139 +  bv_sub :: "[bit list, bit list] => bit list" where
 120.140    "bv_sub w1 w2 = bv_sadd w1 (bv_uminus w2)"
 120.141  
 120.142  lemma bv_sub_type1 [simp]: "bv_sub (norm_signed w1) w2 = bv_sub w1 w2"
 120.143 @@ -1917,7 +1921,7 @@
 120.144  qed
 120.145  
 120.146  definition
 120.147 -  bv_smult :: "[bit list, bit list] => bit list"
 120.148 +  bv_smult :: "[bit list, bit list] => bit list" where
 120.149    "bv_smult w1 w2 = int_to_bv (bv_to_int w1 * bv_to_int w2)"
 120.150  
 120.151  lemma bv_smult_type1 [simp]: "bv_smult (norm_signed w1) w2 = bv_smult w1 w2"
 120.152 @@ -2203,11 +2207,15 @@
 120.153  subsection {* Structural operations *}
 120.154  
 120.155  definition
 120.156 -  bv_select :: "[bit list,nat] => bit"
 120.157 +  bv_select :: "[bit list,nat] => bit" where
 120.158    "bv_select w i = w ! (length w - 1 - i)"
 120.159 -  bv_chop :: "[bit list,nat] => bit list * bit list"
 120.160 +
 120.161 +definition
 120.162 +  bv_chop :: "[bit list,nat] => bit list * bit list" where
 120.163    "bv_chop w i = (let len = length w in (take (len - i) w,drop (len - i) w))"
 120.164 -  bv_slice :: "[bit list,nat*nat] => bit list"
 120.165 +
 120.166 +definition
 120.167 +  bv_slice :: "[bit list,nat*nat] => bit list" where
 120.168    "bv_slice w = (\<lambda>(b,e). fst (bv_chop (snd (bv_chop w (b+1))) e))"
 120.169  
 120.170  lemma bv_select_rev:
 120.171 @@ -2280,7 +2288,7 @@
 120.172    by (auto simp add: bv_slice_def)
 120.173  
 120.174  definition
 120.175 -  length_nat :: "nat => nat"
 120.176 +  length_nat :: "nat => nat" where
 120.177    "length_nat x = (LEAST n. x < 2 ^ n)"
 120.178  
 120.179  lemma length_nat: "length (nat_to_bv n) = length_nat n"
 120.180 @@ -2312,7 +2320,7 @@
 120.181    done
 120.182  
 120.183  definition
 120.184 -  length_int :: "int => nat"
 120.185 +  length_int :: "int => nat" where
 120.186    "length_int x =
 120.187      (if 0 < x then Suc (length_nat (nat x))
 120.188      else if x = 0 then 0
 120.189 @@ -2546,7 +2554,7 @@
 120.190  declare bv_to_nat_helper [simp del]
 120.191  
 120.192  definition
 120.193 -  bv_mapzip :: "[bit => bit => bit,bit list, bit list] => bit list"
 120.194 +  bv_mapzip :: "[bit => bit => bit,bit list, bit list] => bit list" where
 120.195    "bv_mapzip f w1 w2 =
 120.196      (let g = bv_extend (max (length w1) (length w2)) \<zero>
 120.197       in map (split f) (zip (g w1) (g w2)))"
   121.1 --- a/src/HOL/Library/Zorn.thy	Fri Nov 17 02:19:55 2006 +0100
   121.2 +++ b/src/HOL/Library/Zorn.thy	Fri Nov 17 02:20:03 2006 +0100
   121.3 @@ -16,16 +16,19 @@
   121.4  *}
   121.5  
   121.6  definition
   121.7 -  chain     ::  "'a set set => 'a set set set"
   121.8 +  chain     ::  "'a set set => 'a set set set" where
   121.9    "chain S  = {F. F \<subseteq> S & (\<forall>x \<in> F. \<forall>y \<in> F. x \<subseteq> y | y \<subseteq> x)}"
  121.10  
  121.11 -  super     ::  "['a set set,'a set set] => 'a set set set"
  121.12 +definition
  121.13 +  super     ::  "['a set set,'a set set] => 'a set set set" where
  121.14    "super S c = {d. d \<in> chain S & c \<subset> d}"
  121.15  
  121.16 -  maxchain  ::  "'a set set => 'a set set set"
  121.17 +definition
  121.18 +  maxchain  ::  "'a set set => 'a set set set" where
  121.19    "maxchain S = {c. c \<in> chain S & super S c = {}}"
  121.20  
  121.21 -  succ      ::  "['a set set,'a set set] => 'a set set"
  121.22 +definition
  121.23 +  succ      ::  "['a set set,'a set set] => 'a set set" where
  121.24    "succ S c =
  121.25      (if c \<notin> chain S | c \<in> maxchain S
  121.26      then c else SOME c'. c' \<in> super S c)"
   122.1 --- a/src/HOL/List.thy	Fri Nov 17 02:19:55 2006 +0100
   122.2 +++ b/src/HOL/List.thy	Fri Nov 17 02:20:03 2006 +0100
   122.3 @@ -43,7 +43,7 @@
   122.4    splice :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list"
   122.5  
   122.6  abbreviation
   122.7 -  upto:: "nat => nat => nat list"    ("(1[_../_])")
   122.8 +  upto:: "nat => nat => nat list"  ("(1[_../_])") where
   122.9    "[i..j] == [i..<(Suc j)]"
  122.10  
  122.11  
  122.12 @@ -82,7 +82,7 @@
  122.13    refer to the list version as @{text length}. *}
  122.14  
  122.15  abbreviation
  122.16 -  length :: "'a list => nat"
  122.17 +  length :: "'a list => nat" where
  122.18    "length == size"
  122.19  
  122.20  primrec
  122.21 @@ -187,16 +187,21 @@
  122.22    replicate_Suc: "replicate (Suc n) x = x # replicate n x"
  122.23  
  122.24  definition
  122.25 -  rotate1 :: "'a list \<Rightarrow> 'a list"
  122.26 -  rotate1_def: "rotate1 xs = (case xs of [] \<Rightarrow> [] | x#xs \<Rightarrow> xs @ [x])"
  122.27 -  rotate :: "nat \<Rightarrow> 'a list \<Rightarrow> 'a list"
  122.28 -  rotate_def:  "rotate n = rotate1 ^ n"
  122.29 -  list_all2 :: "('a => 'b => bool) => 'a list => 'b list => bool"
  122.30 -  list_all2_def: "list_all2 P xs ys =
  122.31 +  rotate1 :: "'a list \<Rightarrow> 'a list" where
  122.32 +  "rotate1 xs = (case xs of [] \<Rightarrow> [] | x#xs \<Rightarrow> xs @ [x])"
  122.33 +
  122.34 +definition
  122.35 +  rotate :: "nat \<Rightarrow> 'a list \<Rightarrow> 'a list" where
  122.36 +  "rotate n = rotate1 ^ n"
  122.37 +
  122.38 +definition
  122.39 +  list_all2 :: "('a => 'b => bool) => 'a list => 'b list => bool" where
  122.40 +  "list_all2 P xs ys =
  122.41      (length xs = length ys \<and> (\<forall>(x, y) \<in> set (zip xs ys). P x y))"
  122.42 -  sublist :: "'a list => nat set => 'a list"
  122.43 -  sublist_def: "sublist xs A =
  122.44 -    map fst (filter (\<lambda>p. snd p \<in> A) (zip xs [0..<size xs]))"
  122.45 +
  122.46 +definition
  122.47 +  sublist :: "'a list => nat set => 'a list" where
  122.48 +  "sublist xs A = map fst (filter (\<lambda>p. snd p \<in> A) (zip xs [0..<size xs]))"
  122.49  
  122.50  primrec
  122.51    "splice [] ys = ys"
   123.1 --- a/src/HOL/Map.thy	Fri Nov 17 02:19:55 2006 +0100
   123.2 +++ b/src/HOL/Map.thy	Fri Nov 17 02:20:03 2006 +0100
   123.3 @@ -19,34 +19,37 @@
   123.4    "~=>" :: "[type, type] => type"  (infixr "\<rightharpoonup>" 0)
   123.5  
   123.6  abbreviation
   123.7 -  empty :: "'a ~=> 'b"
   123.8 +  empty :: "'a ~=> 'b" where
   123.9    "empty == %x. None"
  123.10  
  123.11  definition
  123.12 -  map_comp :: "('b ~=> 'c)  => ('a ~=> 'b) => ('a ~=> 'c)"  (infixl "o'_m" 55)
  123.13 +  map_comp :: "('b ~=> 'c)  => ('a ~=> 'b) => ('a ~=> 'c)"  (infixl "o'_m" 55) where
  123.14    "f o_m g = (\<lambda>k. case g k of None \<Rightarrow> None | Some v \<Rightarrow> f v)"
  123.15  
  123.16  notation (xsymbols)
  123.17    map_comp  (infixl "\<circ>\<^sub>m" 55)
  123.18  
  123.19  definition
  123.20 -  map_add :: "('a ~=> 'b) => ('a ~=> 'b) => ('a ~=> 'b)"  (infixl "++" 100)
  123.21 +  map_add :: "('a ~=> 'b) => ('a ~=> 'b) => ('a ~=> 'b)"  (infixl "++" 100) where
  123.22    "m1 ++ m2 = (\<lambda>x. case m2 x of None => m1 x | Some y => Some y)"
  123.23  
  123.24 -  restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)"  (infixl "|`"  110)
  123.25 +definition
  123.26 +  restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)"  (infixl "|`"  110) where
  123.27    "m|`A = (\<lambda>x. if x : A then m x else None)"
  123.28  
  123.29  notation (latex output)
  123.30    restrict_map  ("_\<restriction>\<^bsub>_\<^esub>" [111,110] 110)
  123.31  
  123.32  definition
  123.33 -  dom :: "('a ~=> 'b) => 'a set"
  123.34 +  dom :: "('a ~=> 'b) => 'a set" where
  123.35    "dom m = {a. m a ~= None}"
  123.36  
  123.37 -  ran :: "('a ~=> 'b) => 'b set"
  123.38 +definition
  123.39 +  ran :: "('a ~=> 'b) => 'b set" where
  123.40    "ran m = {b. EX a. m a = Some b}"
  123.41  
  123.42 -  map_le :: "('a ~=> 'b) => ('a ~=> 'b) => bool"  (infix "\<subseteq>\<^sub>m" 50)
  123.43 +definition
  123.44 +  map_le :: "('a ~=> 'b) => ('a ~=> 'b) => bool"  (infix "\<subseteq>\<^sub>m" 50) where
  123.45    "(m\<^isub>1 \<subseteq>\<^sub>m m\<^isub>2) = (\<forall>a \<in> dom m\<^isub>1. m\<^isub>1 a = m\<^isub>2 a)"
  123.46  
  123.47  consts
   124.1 --- a/src/HOL/MicroJava/J/Example.thy	Fri Nov 17 02:19:55 2006 +0100
   124.2 +++ b/src/HOL/MicroJava/J/Example.thy	Fri Nov 17 02:20:03 2006 +0100
   124.3 @@ -111,19 +111,21 @@
   124.4  
   124.5  
   124.6  abbreviation
   124.7 -  NP  :: xcpt
   124.8 +  NP  :: xcpt where
   124.9    "NP == NullPointer"
  124.10  
  124.11 -  tprg  ::"java_mb prog"
  124.12 +abbreviation
  124.13 +  tprg  ::"java_mb prog" where
  124.14    "tprg == [ObjectC, BaseC, ExtC, ClassCastC, NullPointerC, OutOfMemoryC]"
  124.15  
  124.16 -  obj1  :: obj
  124.17 +abbreviation
  124.18 +  obj1  :: obj where
  124.19    "obj1 == (Ext, empty((vee, Base)\<mapsto>Bool False) ((vee, Ext )\<mapsto>Intg 0))"
  124.20  
  124.21 -  "s0 == Norm    (empty, empty)"
  124.22 -  "s1 == Norm    (empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
  124.23 -  "s2 == Norm    (empty(a\<mapsto>obj1),empty(x\<mapsto>Null)(This\<mapsto>Addr a))"
  124.24 -  "s3 == (Some NP, empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
  124.25 +abbreviation "s0 == Norm    (empty, empty)"
  124.26 +abbreviation "s1 == Norm    (empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
  124.27 +abbreviation "s2 == Norm    (empty(a\<mapsto>obj1),empty(x\<mapsto>Null)(This\<mapsto>Addr a))"
  124.28 +abbreviation "s3 == (Some NP, empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
  124.29  
  124.30  ML {* bind_thm ("map_of_Cons", hd (tl (thms "map_of.simps"))) *}
  124.31  lemma map_of_Cons1 [simp]: "map_of ((aa,bb)#ps) aa = Some bb"
   125.1 --- a/src/HOL/MicroJava/JVM/JVMListExample.thy	Fri Nov 17 02:19:55 2006 +0100
   125.2 +++ b/src/HOL/MicroJava/JVM/JVMListExample.thy	Fri Nov 17 02:20:03 2006 +0100
   125.3 @@ -124,14 +124,14 @@
   125.4    and instr :: eq ..
   125.5  
   125.6  definition
   125.7 -  arbitrary_val :: val
   125.8 +  arbitrary_val :: val where
   125.9    [symmetric, code inline]: "arbitrary_val = arbitrary"
  125.10 -  arbitrary_cname :: cname
  125.11 +definition
  125.12 +  arbitrary_cname :: cname where
  125.13    [symmetric, code inline]: "arbitrary_cname = arbitrary"
  125.14  
  125.15 -definition
  125.16 -  "unit' = Unit"
  125.17 -  "object' = Object"
  125.18 +definition "unit' = Unit"
  125.19 +definition "object' = Object"
  125.20  
  125.21  code_axioms
  125.22    arbitrary_val \<equiv> unit'
  125.23 @@ -153,7 +153,7 @@
  125.24    "test_loc p v l = (if p l then v l else test_loc p v (incr l))"
  125.25  
  125.26  definition
  125.27 -  new_addr' :: "(loc \<Rightarrow> (cname \<times> (vname \<times> cname \<Rightarrow> val option)) option) \<Rightarrow> loc \<times> val option"
  125.28 +  new_addr' :: "(loc \<Rightarrow> (cname \<times> (vname \<times> cname \<Rightarrow> val option)) option) \<Rightarrow> loc \<times> val option" where
  125.29    "new_addr' hp =
  125.30      test_loc (\<lambda>i. hp (Loc i) = None) (\<lambda>i. (Loc i, None)) zero_loc"
  125.31  
   126.1 --- a/src/HOL/Nominal/Examples/Lam_Funs.thy	Fri Nov 17 02:19:55 2006 +0100
   126.2 +++ b/src/HOL/Nominal/Examples/Lam_Funs.thy	Fri Nov 17 02:20:03 2006 +0100
   126.3 @@ -1,4 +1,4 @@
   126.4 -(* $Id: *)
   126.5 +(* $Id$ *)
   126.6  
   126.7  theory Lam_Funs
   126.8  imports Nominal
   126.9 @@ -73,7 +73,7 @@
  126.10    "subst_Lam b t \<equiv> \<lambda>a _ r. Lam [a].r"
  126.11  
  126.12  abbreviation
  126.13 -  subst_syn  :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam" ("_[_::=_]" [100,100,100] 900) 
  126.14 +  subst_syn  :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam" ("_[_::=_]" [100,100,100] 900) where
  126.15    "t'[b::=t] \<equiv> (lam_rec (subst_Var b t) (subst_App b t) (subst_Lam b t)) t'"
  126.16  
  126.17  (* FIXME: this lemma needs to be in Nominal.thy *)
  126.18 @@ -200,7 +200,7 @@
  126.19    "psubst_Lam \<theta> \<equiv> \<lambda>a _ r. Lam [a].r"
  126.20  
  126.21  abbreviation
  126.22 -  psubst_lam :: "lam \<Rightarrow> (name\<times>lam) list \<Rightarrow> lam" ("_[<_>]" [100,100] 900)
  126.23 +  psubst_lam :: "lam \<Rightarrow> (name\<times>lam) list \<Rightarrow> lam" ("_[<_>]" [100,100] 900) where
  126.24    "t[<\<theta>>] \<equiv> (lam_rec (psubst_Var \<theta>) (psubst_App \<theta>) (psubst_Lam \<theta>)) t"
  126.25  
  126.26  lemma fin_supp_psubst:
  126.27 @@ -241,4 +241,4 @@
  126.28    apply(simp add: psubst_Lam_def)
  126.29  done
  126.30  
  126.31 -end
  126.32 \ No newline at end of file
  126.33 +end
   127.1 --- a/src/HOL/Nominal/Examples/SN.thy	Fri Nov 17 02:19:55 2006 +0100
   127.2 +++ b/src/HOL/Nominal/Examples/SN.thy	Fri Nov 17 02:20:03 2006 +0100
   127.3 @@ -344,7 +344,7 @@
   127.4  qed
   127.5  
   127.6  abbreviation
   127.7 -  "sub" :: "(name\<times>ty) list \<Rightarrow> (name\<times>ty) list \<Rightarrow> bool" (" _ \<lless> _ " [80,80] 80)
   127.8 +  "sub" :: "(name\<times>ty) list \<Rightarrow> (name\<times>ty) list \<Rightarrow> bool" (" _ \<lless> _ " [80,80] 80) where
   127.9    "\<Gamma>1 \<lless> \<Gamma>2 \<equiv> \<forall>a \<sigma>. (a,\<sigma>)\<in>set \<Gamma>1 \<longrightarrow>  (a,\<sigma>)\<in>set \<Gamma>2"
  127.10  
  127.11  lemma weakening: 
   128.1 --- a/src/HOL/Nominal/Examples/Weakening.thy	Fri Nov 17 02:19:55 2006 +0100
   128.2 +++ b/src/HOL/Nominal/Examples/Weakening.thy	Fri Nov 17 02:20:03 2006 +0100
   128.3 @@ -193,7 +193,7 @@
   128.4  text {* definition of a subcontext *}
   128.5  
   128.6  abbreviation
   128.7 -  "sub" :: "(name\<times>ty) list \<Rightarrow> (name\<times>ty) list \<Rightarrow> bool" (" _ \<lless> _ " [80,80] 80)
   128.8 +  "sub" :: "(name\<times>ty) list \<Rightarrow> (name\<times>ty) list \<Rightarrow> bool" (" _ \<lless> _ " [80,80] 80) where
   128.9    "\<Gamma>1 \<lless> \<Gamma>2 \<equiv> \<forall>a \<sigma>. (a,\<sigma>)\<in>set \<Gamma>1 \<longrightarrow> (a,\<sigma>)\<in>set \<Gamma>2"
  128.10  
  128.11  text {* Now it comes: The Weakening Lemma *}
   129.1 --- a/src/HOL/NumberTheory/BijectionRel.thy	Fri Nov 17 02:19:55 2006 +0100
   129.2 +++ b/src/HOL/NumberTheory/BijectionRel.thy	Fri Nov 17 02:20:03 2006 +0100
   129.3 @@ -30,13 +30,15 @@
   129.4  *}
   129.5  
   129.6  definition
   129.7 -  bijP :: "('a => 'a => bool) => 'a set => bool"
   129.8 +  bijP :: "('a => 'a => bool) => 'a set => bool" where
   129.9    "bijP P F = (\<forall>a b. a \<in> F \<and> P a b --> b \<in> F)"
  129.10  
  129.11 -  uniqP :: "('a => 'a => bool) => bool"
  129.12 +definition
  129.13 +  uniqP :: "('a => 'a => bool) => bool" where
  129.14    "uniqP P = (\<forall>a b c d. P a b \<and> P c d --> (a = c) = (b = d))"
  129.15  
  129.16 -  symP :: "('a => 'a => bool) => bool"
  129.17 +definition
  129.18 +  symP :: "('a => 'a => bool) => bool" where
  129.19    "symP P = (\<forall>a b. P a b = P b a)"
  129.20  
  129.21  consts
   130.1 --- a/src/HOL/NumberTheory/Chinese.thy	Fri Nov 17 02:19:55 2006 +0100
   130.2 +++ b/src/HOL/NumberTheory/Chinese.thy	Fri Nov 17 02:20:03 2006 +0100
   130.3 @@ -32,32 +32,37 @@
   130.4    "funsum f i (Suc n) = f (Suc (i + n)) + funsum f i n"
   130.5  
   130.6  definition
   130.7 -  m_cond :: "nat => (nat => int) => bool"
   130.8 +  m_cond :: "nat => (nat => int) => bool" where
   130.9    "m_cond n mf =
  130.10      ((\<forall>i. i \<le> n --> 0 < mf i) \<and>
  130.11        (\<forall>i j. i \<le> n \<and> j \<le> n \<and> i \<noteq> j --> zgcd (mf i, mf j) = 1))"
  130.12  
  130.13 -  km_cond :: "nat => (nat => int) => (nat => int) => bool"
  130.14 +definition
  130.15 +  km_cond :: "nat => (nat => int) => (nat => int) => bool" where
  130.16    "km_cond n kf mf = (\<forall>i. i \<le> n --> zgcd (kf i, mf i) = 1)"
  130.17  
  130.18 +definition
  130.19    lincong_sol ::
  130.20 -    "nat => (nat => int) => (nat => int) => (nat => int) => int => bool"
  130.21 +    "nat => (nat => int) => (nat => int) => (nat => int) => int => bool" where
  130.22    "lincong_sol n kf bf mf x = (\<forall>i. i \<le> n --> zcong (kf i * x) (bf i) (mf i))"
  130.23  
  130.24 -  mhf :: "(nat => int) => nat => nat => int"
  130.25 +definition
  130.26 +  mhf :: "(nat => int) => nat => nat => int" where
  130.27    "mhf mf n i =
  130.28      (if i = 0 then funprod mf (Suc 0) (n - Suc 0)
  130.29       else if i = n then funprod mf 0 (n - Suc 0)
  130.30       else funprod mf 0 (i - Suc 0) * funprod mf (Suc i) (n - Suc 0 - i))"
  130.31  
  130.32 +definition
  130.33    xilin_sol ::
  130.34 -    "nat => nat => (nat => int) => (nat => int) => (nat => int) => int"
  130.35 +    "nat => nat => (nat => int) => (nat => int) => (nat => int) => int" where
  130.36    "xilin_sol i n kf bf mf =
  130.37      (if 0 < n \<and> i \<le> n \<and> m_cond n mf \<and> km_cond n kf mf then
  130.38          (SOME x. 0 \<le> x \<and> x < mf i \<and> zcong (kf i * mhf mf n i * x) (bf i) (mf i))
  130.39       else 0)"
  130.40  
  130.41 -  x_sol :: "nat => (nat => int) => (nat => int) => (nat => int) => int"
  130.42 +definition
  130.43 +  x_sol :: "nat => (nat => int) => (nat => int) => (nat => int) => int" where
  130.44    "x_sol n kf bf mf = funsum (\<lambda>i. xilin_sol i n kf bf mf * mhf mf n i) 0 n"
  130.45  
  130.46  
   131.1 --- a/src/HOL/NumberTheory/Euler.thy	Fri Nov 17 02:19:55 2006 +0100
   131.2 +++ b/src/HOL/NumberTheory/Euler.thy	Fri Nov 17 02:20:03 2006 +0100
   131.3 @@ -8,10 +8,11 @@
   131.4  theory Euler imports Residues EvenOdd begin
   131.5  
   131.6  definition
   131.7 -  MultInvPair :: "int => int => int => int set"
   131.8 +  MultInvPair :: "int => int => int => int set" where
   131.9    "MultInvPair a p j = {StandardRes p j, StandardRes p (a * (MultInv p j))}"
  131.10  
  131.11 -  SetS        :: "int => int => int set set"
  131.12 +definition
  131.13 +  SetS        :: "int => int => int set set" where
  131.14    "SetS        a p   =  (MultInvPair a p ` SRStar p)"
  131.15  
  131.16  
   132.1 --- a/src/HOL/NumberTheory/EulerFermat.thy	Fri Nov 17 02:19:55 2006 +0100
   132.2 +++ b/src/HOL/NumberTheory/EulerFermat.thy	Fri Nov 17 02:20:03 2006 +0100
   132.3 @@ -38,25 +38,30 @@
   132.4      else {})"
   132.5  
   132.6  definition
   132.7 -  norRRset :: "int => int set"
   132.8 +  norRRset :: "int => int set" where
   132.9    "norRRset m = BnorRset (m - 1, m)"
  132.10  
  132.11 -  noXRRset :: "int => int => int set"
  132.12 +definition
  132.13 +  noXRRset :: "int => int => int set" where
  132.14    "noXRRset m x = (\<lambda>a. a * x) ` norRRset m"
  132.15  
  132.16 -  phi :: "int => nat"
  132.17 +definition
  132.18 +  phi :: "int => nat" where
  132.19    "phi m = card (norRRset m)"
  132.20  
  132.21 -  is_RRset :: "int set => int => bool"
  132.22 +definition
  132.23 +  is_RRset :: "int set => int => bool" where
  132.24    "is_RRset A m = (A \<in> RsetR m \<and> card A = phi m)"
  132.25  
  132.26 -  RRset2norRR :: "int set => int => int => int"
  132.27 +definition
  132.28 +  RRset2norRR :: "int set => int => int => int" where
  132.29    "RRset2norRR A m a =
  132.30       (if 1 < m \<and> is_RRset A m \<and> a \<in> A then
  132.31          SOME b. zcong a b m \<and> b \<in> norRRset m
  132.32        else 0)"
  132.33  
  132.34 -  zcongm :: "int => int => int => bool"
  132.35 +definition
  132.36 +  zcongm :: "int => int => int => bool" where
  132.37    "zcongm m = (\<lambda>a b. zcong a b m)"
  132.38  
  132.39  lemma abs_eq_1_iff [iff]: "(abs z = (1::int)) = (z = 1 \<or> z = -1)"
   133.1 --- a/src/HOL/NumberTheory/EvenOdd.thy	Fri Nov 17 02:19:55 2006 +0100
   133.2 +++ b/src/HOL/NumberTheory/EvenOdd.thy	Fri Nov 17 02:20:03 2006 +0100
   133.3 @@ -8,9 +8,11 @@
   133.4  theory EvenOdd imports Int2 begin
   133.5  
   133.6  definition
   133.7 -  zOdd    :: "int set"
   133.8 +  zOdd    :: "int set" where
   133.9    "zOdd = {x. \<exists>k. x = 2 * k + 1}"
  133.10 -  zEven   :: "int set"
  133.11 +
  133.12 +definition
  133.13 +  zEven   :: "int set" where
  133.14    "zEven = {x. \<exists>k. x = 2 * k}"
  133.15  
  133.16  subsection {* Some useful properties about even and odd *}
   134.1 --- a/src/HOL/NumberTheory/Factorization.thy	Fri Nov 17 02:19:55 2006 +0100
   134.2 +++ b/src/HOL/NumberTheory/Factorization.thy	Fri Nov 17 02:20:03 2006 +0100
   134.3 @@ -12,7 +12,7 @@
   134.4  subsection {* Definitions *}
   134.5  
   134.6  definition
   134.7 -  primel :: "nat list => bool "
   134.8 +  primel :: "nat list => bool" where
   134.9    "primel xs = (\<forall>p \<in> set xs. prime p)"
  134.10  
  134.11  consts
   135.1 --- a/src/HOL/NumberTheory/Gauss.thy	Fri Nov 17 02:19:55 2006 +0100
   135.2 +++ b/src/HOL/NumberTheory/Gauss.thy	Fri Nov 17 02:20:03 2006 +0100
   135.3 @@ -18,22 +18,27 @@
   135.4  begin
   135.5  
   135.6  definition
   135.7 -  A :: "int set"
   135.8 +  A :: "int set" where
   135.9    "A = {(x::int). 0 < x & x \<le> ((p - 1) div 2)}"
  135.10  
  135.11 -  B :: "int set"
  135.12 +definition
  135.13 +  B :: "int set" where
  135.14    "B = (%x. x * a) ` A"
  135.15  
  135.16 -  C :: "int set"
  135.17 +definition
  135.18 +  C :: "int set" where
  135.19    "C = StandardRes p ` B"
  135.20  
  135.21 -  D :: "int set"
  135.22 +definition
  135.23 +  D :: "int set" where
  135.24    "D = C \<inter> {x. x \<le> ((p - 1) div 2)}"
  135.25  
  135.26 -  E :: "int set"
  135.27 +definition
  135.28 +  E :: "int set" where
  135.29    "E = C \<inter> {x. ((p - 1) div 2) < x}"
  135.30  
  135.31 -  F :: "int set"
  135.32 +definition
  135.33 +  F :: "int set" where
  135.34    "F = (%x. (p - x)) ` E"
  135.35  
  135.36  
   136.1 --- a/src/HOL/NumberTheory/Int2.thy	Fri Nov 17 02:19:55 2006 +0100
   136.2 +++ b/src/HOL/NumberTheory/Int2.thy	Fri Nov 17 02:20:03 2006 +0100
   136.3 @@ -8,7 +8,7 @@
   136.4  theory Int2 imports Finite2 WilsonRuss begin
   136.5  
   136.6  definition
   136.7 -  MultInv :: "int => int => int"
   136.8 +  MultInv :: "int => int => int" where
   136.9    "MultInv p x = x ^ nat (p - 2)"
  136.10  
  136.11  
   137.1 --- a/src/HOL/NumberTheory/IntPrimes.thy	Fri Nov 17 02:19:55 2006 +0100
   137.2 +++ b/src/HOL/NumberTheory/IntPrimes.thy	Fri Nov 17 02:20:03 2006 +0100
   137.3 @@ -32,16 +32,19 @@
   137.4  		      t, t' - (r' div r) * t))"
   137.5  
   137.6  definition
   137.7 -  zgcd :: "int * int => int"
   137.8 +  zgcd :: "int * int => int" where
   137.9    "zgcd = (\<lambda>(x,y). int (gcd (nat (abs x), nat (abs y))))"
  137.10  
  137.11 -  zprime :: "int \<Rightarrow> bool"
  137.12 +definition
  137.13 +  zprime :: "int \<Rightarrow> bool" where
  137.14    "zprime p = (1 < p \<and> (\<forall>m. 0 <= m & m dvd p --> m = 1 \<or> m = p))"
  137.15  
  137.16 -  xzgcd :: "int => int => int * int * int"
  137.17 +definition
  137.18 +  xzgcd :: "int => int => int * int * int" where
  137.19    "xzgcd m n = xzgcda (m, n, m, n, 1, 0, 0, 1)"
  137.20  
  137.21 -  zcong :: "int => int => int => bool"    ("(1[_ = _] '(mod _'))")
  137.22 +definition
  137.23 +  zcong :: "int => int => int => bool"  ("(1[_ = _] '(mod _'))") where
  137.24    "[a = b] (mod m) = (m dvd (a - b))"
  137.25  
  137.26  
   138.1 --- a/src/HOL/NumberTheory/Quadratic_Reciprocity.thy	Fri Nov 17 02:19:55 2006 +0100
   138.2 +++ b/src/HOL/NumberTheory/Quadratic_Reciprocity.thy	Fri Nov 17 02:20:03 2006 +0100
   138.3 @@ -168,25 +168,31 @@
   138.4  begin
   138.5  
   138.6  definition
   138.7 -  P_set :: "int set"
   138.8 +  P_set :: "int set" where
   138.9    "P_set = {x. 0 < x & x \<le> ((p - 1) div 2) }"
  138.10  
  138.11 -  Q_set :: "int set"
  138.12 +definition
  138.13 +  Q_set :: "int set" where
  138.14    "Q_set = {x. 0 < x & x \<le> ((q - 1) div 2) }"
  138.15    
  138.16 -  S :: "(int * int) set"
  138.17 +definition
  138.18 +  S :: "(int * int) set" where
  138.19    "S = P_set <*> Q_set"
  138.20  
  138.21 -  S1 :: "(int * int) set"
  138.22 +definition
  138.23 +  S1 :: "(int * int) set" where
  138.24    "S1 = { (x, y). (x, y):S & ((p * y) < (q * x)) }"
  138.25  
  138.26 -  S2 :: "(int * int) set"
  138.27 +definition
  138.28 +  S2 :: "(int * int) set" where
  138.29    "S2 = { (x, y). (x, y):S & ((q * x) < (p * y)) }"
  138.30  
  138.31 -  f1 :: "int => (int * int) set"
  138.32 +definition
  138.33 +  f1 :: "int => (int * int) set" where
  138.34    "f1 j = { (j1, y). (j1, y):S & j1 = j & (y \<le> (q * j) div p) }"
  138.35  
  138.36 -  f2 :: "int => (int * int) set"
  138.37 +definition
  138.38 +  f2 :: "int => (int * int) set" where
  138.39    "f2 j = { (x, j1). (x, j1):S & j1 = j & (x \<le> (p * j) div q) }"
  138.40  
  138.41  lemma p_fact: "0 < (p - 1) div 2"
   139.1 --- a/src/HOL/NumberTheory/Residues.thy	Fri Nov 17 02:19:55 2006 +0100
   139.2 +++ b/src/HOL/NumberTheory/Residues.thy	Fri Nov 17 02:20:03 2006 +0100
   139.3 @@ -12,24 +12,29 @@
   139.4    quadratic residues, and prove some basic properties. *}
   139.5  
   139.6  definition
   139.7 -  ResSet      :: "int => int set => bool"
   139.8 +  ResSet      :: "int => int set => bool" where
   139.9    "ResSet m X = (\<forall>y1 y2. (y1 \<in> X & y2 \<in> X & [y1 = y2] (mod m) --> y1 = y2))"
  139.10  
  139.11 -  StandardRes :: "int => int => int"
  139.12 +definition
  139.13 +  StandardRes :: "int => int => int" where
  139.14    "StandardRes m x = x mod m"
  139.15  
  139.16 -  QuadRes     :: "int => int => bool"
  139.17 +definition
  139.18 +  QuadRes     :: "int => int => bool" where
  139.19    "QuadRes m x = (\<exists>y. ([(y ^ 2) = x] (mod m)))"
  139.20  
  139.21 -  Legendre    :: "int => int => int"      
  139.22 +definition
  139.23 +  Legendre    :: "int => int => int" where
  139.24    "Legendre a p = (if ([a = 0] (mod p)) then 0
  139.25                       else if (QuadRes p a) then 1
  139.26                       else -1)"
  139.27  
  139.28 -  SR          :: "int => int set"
  139.29 +definition
  139.30 +  SR          :: "int => int set" where
  139.31    "SR p = {x. (0 \<le> x) & (x < p)}"
  139.32  
  139.33 -  SRStar      :: "int => int set"
  139.34 +definition
  139.35 +  SRStar      :: "int => int set" where
  139.36    "SRStar p = {x. (0 < x) & (x < p)}"
  139.37  
  139.38  
   140.1 --- a/src/HOL/NumberTheory/WilsonBij.thy	Fri Nov 17 02:19:55 2006 +0100
   140.2 +++ b/src/HOL/NumberTheory/WilsonBij.thy	Fri Nov 17 02:20:03 2006 +0100
   140.3 @@ -18,9 +18,11 @@
   140.4  subsection {* Definitions and lemmas *}
   140.5  
   140.6  definition
   140.7 -  reciR :: "int => int => int => bool"
   140.8 +  reciR :: "int => int => int => bool" where
   140.9    "reciR p = (\<lambda>a b. zcong (a * b) 1 p \<and> 1 < a \<and> a < p - 1 \<and> 1 < b \<and> b < p - 1)"
  140.10 -  inv :: "int => int => int"
  140.11 +
  140.12 +definition
  140.13 +  inv :: "int => int => int" where
  140.14    "inv p a =
  140.15      (if zprime p \<and> 0 < a \<and> a < p then
  140.16        (SOME x. 0 \<le> x \<and> x < p \<and> zcong (a * x) 1 p)
   141.1 --- a/src/HOL/NumberTheory/WilsonRuss.thy	Fri Nov 17 02:19:55 2006 +0100
   141.2 +++ b/src/HOL/NumberTheory/WilsonRuss.thy	Fri Nov 17 02:20:03 2006 +0100
   141.3 @@ -16,7 +16,7 @@
   141.4  subsection {* Definitions and lemmas *}
   141.5  
   141.6  definition
   141.7 -  inv :: "int => int => int"
   141.8 +  inv :: "int => int => int" where
   141.9    "inv p a = (a^(nat (p - 2))) mod p"
  141.10  
  141.11  consts
   142.1 --- a/src/HOL/Orderings.thy	Fri Nov 17 02:19:55 2006 +0100
   142.2 +++ b/src/HOL/Orderings.thy	Fri Nov 17 02:20:03 2006 +0100
   142.3 @@ -19,23 +19,25 @@
   142.4  begin
   142.5  
   142.6  notation
   142.7 -  less_eq  ("op \<^loc><=")
   142.8 -  less_eq  ("(_/ \<^loc><= _)" [51, 51] 50)
   142.9 -  less  ("op \<^loc><")
  142.10 +  less_eq  ("op \<^loc><=") and
  142.11 +  less_eq  ("(_/ \<^loc><= _)" [51, 51] 50) and
  142.12 +  less  ("op \<^loc><") and
  142.13    less  ("(_/ \<^loc>< _)"  [51, 51] 50)
  142.14  
  142.15  notation (xsymbols)
  142.16 -  less_eq  ("op \<^loc>\<le>")
  142.17 +  less_eq  ("op \<^loc>\<le>") and
  142.18    less_eq  ("(_/ \<^loc>\<le> _)"  [51, 51] 50)
  142.19  
  142.20  notation (HTML output)
  142.21 -  less_eq  ("op \<^loc>\<le>")
  142.22 +  less_eq  ("op \<^loc>\<le>") and
  142.23    less_eq  ("(_/ \<^loc>\<le> _)"  [51, 51] 50)
  142.24  
  142.25  abbreviation (input)
  142.26 -  greater  (infix "\<^loc>>" 50)
  142.27 +  greater  (infix "\<^loc>>" 50) where
  142.28    "x \<^loc>> y \<equiv> y \<^loc>< x"
  142.29 -  greater_eq  (infix "\<^loc>>=" 50)
  142.30 +
  142.31 +abbreviation (input)
  142.32 +  greater_eq  (infix "\<^loc>>=" 50) where
  142.33    "x \<^loc>>= y \<equiv> y \<^loc><= x"
  142.34  
  142.35  notation (xsymbols)
  142.36 @@ -44,23 +46,25 @@
  142.37  end
  142.38  
  142.39  notation
  142.40 -  less_eq  ("op <=")
  142.41 -  less_eq  ("(_/ <= _)" [51, 51] 50)
  142.42 -  less  ("op <")
  142.43 +  less_eq  ("op <=") and
  142.44 +  less_eq  ("(_/ <= _)" [51, 51] 50) and
  142.45 +  less  ("op <") and
  142.46    less  ("(_/ < _)"  [51, 51] 50)
  142.47    
  142.48  notation (xsymbols)
  142.49 -  less_eq  ("op \<le>")
  142.50 +  less_eq  ("op \<le>") and
  142.51    less_eq  ("(_/ \<le> _)"  [51, 51] 50)
  142.52  
  142.53  notation (HTML output)
  142.54 -  less_eq  ("op \<le>")
  142.55 +  less_eq  ("op \<le>") and
  142.56    less_eq  ("(_/ \<le> _)"  [51, 51] 50)
  142.57  
  142.58  abbreviation (input)
  142.59 -  greater  (infix ">" 50)
  142.60 +  greater  (infix ">" 50) where
  142.61    "x > y \<equiv> y < x"
  142.62 -  greater_eq  (infix ">=" 50)
  142.63 +
  142.64 +abbreviation (input)
  142.65 +  greater_eq  (infix ">=" 50) where
  142.66    "x >= y \<equiv> y <= x"
  142.67    
  142.68  notation (xsymbols)
  142.69 @@ -78,11 +82,11 @@
  142.70  begin
  142.71  
  142.72  abbreviation (input)
  142.73 -  greater_eq (infixl "\<sqsupseteq>" 50)
  142.74 +  greater_eq  (infixl "\<sqsupseteq>" 50) where
  142.75    "x \<sqsupseteq> y \<equiv> y \<sqsubseteq> x"
  142.76  
  142.77  abbreviation (input)
  142.78 -  greater (infixl "\<sqsupset>" 50)
  142.79 +  greater (infixl "\<sqsupset>" 50) where
  142.80    "x \<sqsupset> y \<equiv> y \<sqsubset> x"
  142.81  
  142.82  text {* Reflexivity. *}
  142.83 @@ -202,8 +206,6 @@
  142.84  
  142.85  locale linorder = partial_order +
  142.86    assumes linear: "x \<sqsubseteq> y \<or> y \<sqsubseteq> x"
  142.87 -
  142.88 -context linorder
  142.89  begin
  142.90  
  142.91  lemma trichotomy: "x \<sqsubset> y \<or> x = y \<or> y \<sqsubset> x"
  142.92 @@ -259,9 +261,11 @@
  142.93  (* min/max *)
  142.94  
  142.95  definition
  142.96 -  min :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
  142.97 +  min :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" where
  142.98    "min a b = (if a \<sqsubseteq> b then a else b)"
  142.99 -  max :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
 142.100 +
 142.101 +definition
 142.102 +  max :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" where
 142.103    "max a b = (if a \<sqsubseteq> b then b else a)"
 142.104  
 142.105  lemma min_le_iff_disj:
   143.1 --- a/src/HOL/Product_Type.thy	Fri Nov 17 02:19:55 2006 +0100
   143.2 +++ b/src/HOL/Product_Type.thy	Fri Nov 17 02:20:03 2006 +0100
   143.3 @@ -110,7 +110,8 @@
   143.4    Sigma_def:    "Sigma A B == UN x:A. UN y:B x. {Pair x y}"
   143.5  
   143.6  abbreviation
   143.7 -  Times :: "['a set, 'b set] => ('a * 'b) set"  (infixr "<*>" 80)
   143.8 +  Times :: "['a set, 'b set] => ('a * 'b) set"
   143.9 +    (infixr "<*>" 80) where
  143.10    "A <*> B == Sigma A (%_. B)"
  143.11  
  143.12  notation (xsymbols)
   144.1 --- a/src/HOL/Real/ContNotDenum.thy	Fri Nov 17 02:19:55 2006 +0100
   144.2 +++ b/src/HOL/Real/ContNotDenum.thy	Fri Nov 17 02:20:03 2006 +0100
   144.3 @@ -37,7 +37,7 @@
   144.4  subsubsection {* Definition *}
   144.5  
   144.6  definition
   144.7 -  closed_int :: "real \<Rightarrow> real \<Rightarrow> real set"
   144.8 +  closed_int :: "real \<Rightarrow> real \<Rightarrow> real set" where
   144.9    "closed_int x y = {z. x \<le> z \<and> z \<le> y}"
  144.10  
  144.11  subsubsection {* Properties *}
   145.1 --- a/src/HOL/Real/Float.thy	Fri Nov 17 02:19:55 2006 +0100
   145.2 +++ b/src/HOL/Real/Float.thy	Fri Nov 17 02:20:03 2006 +0100
   145.3 @@ -11,9 +11,11 @@
   145.4  begin
   145.5  
   145.6  definition
   145.7 -  pow2 :: "int \<Rightarrow> real"
   145.8 +  pow2 :: "int \<Rightarrow> real" where
   145.9    "pow2 a = (if (0 <= a) then (2^(nat a)) else (inverse (2^(nat (-a)))))"
  145.10 -  float :: "int * int \<Rightarrow> real"
  145.11 +
  145.12 +definition
  145.13 +  float :: "int * int \<Rightarrow> real" where
  145.14    "float x = real (fst x) * pow2 (snd x)"
  145.15  
  145.16  lemma pow2_0[simp]: "pow2 0 = 1"
  145.17 @@ -99,9 +101,11 @@
  145.18  by (simp add: float_def ring_eq_simps)
  145.19  
  145.20  definition
  145.21 -  int_of_real :: "real \<Rightarrow> int"
  145.22 +  int_of_real :: "real \<Rightarrow> int" where
  145.23    "int_of_real x = (SOME y. real y = x)"
  145.24 -  real_is_int :: "real \<Rightarrow> bool"
  145.25 +
  145.26 +definition
  145.27 +  real_is_int :: "real \<Rightarrow> bool" where
  145.28    "real_is_int x = (EX (u::int). x = real u)"
  145.29  
  145.30  lemma real_is_int_def2: "real_is_int x = (x = real (int_of_real x))"
   146.1 --- a/src/HOL/Real/HahnBanach/Bounds.thy	Fri Nov 17 02:19:55 2006 +0100
   146.2 +++ b/src/HOL/Real/HahnBanach/Bounds.thy	Fri Nov 17 02:20:03 2006 +0100
   146.3 @@ -15,7 +15,7 @@
   146.4  lemmas [elim?] = lub.least lub.upper
   146.5  
   146.6  definition
   146.7 -  the_lub :: "'a::order set \<Rightarrow> 'a"
   146.8 +  the_lub :: "'a::order set \<Rightarrow> 'a" where
   146.9    "the_lub A = The (lub A)"
  146.10  
  146.11  notation (xsymbols)
   147.1 --- a/src/HOL/Real/HahnBanach/FunctionOrder.thy	Fri Nov 17 02:19:55 2006 +0100
   147.2 +++ b/src/HOL/Real/HahnBanach/FunctionOrder.thy	Fri Nov 17 02:20:03 2006 +0100
   147.3 @@ -23,7 +23,7 @@
   147.4  types 'a graph = "('a \<times> real) set"
   147.5  
   147.6  definition
   147.7 -  graph :: "'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> 'a graph"
   147.8 +  graph :: "'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> 'a graph" where
   147.9    "graph F f = {(x, f x) | x. x \<in> F}"
  147.10  
  147.11  lemma graphI [intro]: "x \<in> F \<Longrightarrow> (x, f x) \<in> graph F f"
  147.12 @@ -66,10 +66,11 @@
  147.13  *}
  147.14  
  147.15  definition
  147.16 -  "domain" :: "'a graph \<Rightarrow> 'a set"
  147.17 +  "domain" :: "'a graph \<Rightarrow> 'a set" where
  147.18    "domain g = {x. \<exists>y. (x, y) \<in> g}"
  147.19  
  147.20 -  funct :: "'a graph \<Rightarrow> ('a \<Rightarrow> real)"
  147.21 +definition
  147.22 +  funct :: "'a graph \<Rightarrow> ('a \<Rightarrow> real)" where
  147.23    "funct g = (\<lambda>x. (SOME y. (x, y) \<in> g))"
  147.24  
  147.25  text {*
  147.26 @@ -104,7 +105,7 @@
  147.27  definition
  147.28    norm_pres_extensions ::
  147.29      "'a::{plus, minus, zero} set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> 'a set \<Rightarrow> ('a \<Rightarrow> real)
  147.30 -      \<Rightarrow> 'a graph set"
  147.31 +      \<Rightarrow> 'a graph set" where
  147.32      "norm_pres_extensions E p F f
  147.33        = {g. \<exists>H h. g = graph H h
  147.34            \<and> linearform H h
   148.1 --- a/src/HOL/Real/HahnBanach/Subspace.thy	Fri Nov 17 02:19:55 2006 +0100
   148.2 +++ b/src/HOL/Real/HahnBanach/Subspace.thy	Fri Nov 17 02:20:03 2006 +0100
   148.3 @@ -131,7 +131,7 @@
   148.4  *}
   148.5  
   148.6  definition
   148.7 -  lin :: "('a::{minus, plus, zero}) \<Rightarrow> 'a set"
   148.8 +  lin :: "('a::{minus, plus, zero}) \<Rightarrow> 'a set" where
   148.9    "lin x = {a \<cdot> x | a. True}"
  148.10  
  148.11  lemma linI [intro]: "y = a \<cdot> x \<Longrightarrow> y \<in> lin x"
   149.1 --- a/src/HOL/Real/Lubs.thy	Fri Nov 17 02:19:55 2006 +0100
   149.2 +++ b/src/HOL/Real/Lubs.thy	Fri Nov 17 02:20:03 2006 +0100
   149.3 @@ -13,23 +13,27 @@
   149.4  text{*Thanks to suggestions by James Margetson*}
   149.5  
   149.6  definition
   149.7 -
   149.8 -  setle :: "['a set, 'a::ord] => bool"     (infixl "*<=" 70)
   149.9 +  setle :: "['a set, 'a::ord] => bool"  (infixl "*<=" 70) where
  149.10    "S *<= x = (ALL y: S. y <= x)"
  149.11  
  149.12 -  setge :: "['a::ord, 'a set] => bool"     (infixl "<=*" 70)
  149.13 +definition
  149.14 +  setge :: "['a::ord, 'a set] => bool"  (infixl "<=*" 70) where
  149.15    "x <=* S = (ALL y: S. x <= y)"
  149.16  
  149.17 -  leastP      :: "['a =>bool,'a::ord] => bool"
  149.18 +definition
  149.19 +  leastP      :: "['a =>bool,'a::ord] => bool" where
  149.20    "leastP P x = (P x & x <=* Collect P)"
  149.21  
  149.22 -  isUb        :: "['a set, 'a set, 'a::ord] => bool"
  149.23 +definition
  149.24 +  isUb        :: "['a set, 'a set, 'a::ord] => bool" where
  149.25    "isUb R S x = (S *<= x & x: R)"
  149.26  
  149.27 -  isLub       :: "['a set, 'a set, 'a::ord] => bool"
  149.28 +definition
  149.29 +  isLub       :: "['a set, 'a set, 'a::ord] => bool" where
  149.30    "isLub R S x = leastP (isUb R S) x"
  149.31  
  149.32 -  ubs         :: "['a set, 'a::ord set] => 'a set"
  149.33 +definition
  149.34 +  ubs         :: "['a set, 'a::ord set] => 'a set" where
  149.35    "ubs R S = Collect (isUb R S)"
  149.36  
  149.37  
   150.1 --- a/src/HOL/Real/PReal.thy	Fri Nov 17 02:19:55 2006 +0100
   150.2 +++ b/src/HOL/Real/PReal.thy	Fri Nov 17 02:20:03 2006 +0100
   150.3 @@ -28,7 +28,7 @@
   150.4  
   150.5  
   150.6  definition
   150.7 -  cut :: "rat set => bool"
   150.8 +  cut :: "rat set => bool" where
   150.9    "cut A = ({} \<subset> A &
  150.10              A < {r. 0 < r} &
  150.11              (\<forall>y \<in> A. ((\<forall>z. 0<z & z < y --> z \<in> A) & (\<exists>u \<in> A. y < u))))"
  150.12 @@ -56,22 +56,27 @@
  150.13  instance preal :: "{ord, plus, minus, times, inverse}" ..
  150.14  
  150.15  definition
  150.16 -  preal_of_rat :: "rat => preal"
  150.17 +  preal_of_rat :: "rat => preal" where
  150.18    "preal_of_rat q = Abs_preal {x::rat. 0 < x & x < q}"
  150.19  
  150.20 -  psup :: "preal set => preal"
  150.21 +definition
  150.22 +  psup :: "preal set => preal" where
  150.23    "psup P = Abs_preal (\<Union>X \<in> P. Rep_preal X)"
  150.24  
  150.25 -  add_set :: "[rat set,rat set] => rat set"
  150.26 +definition
  150.27 +  add_set :: "[rat set,rat set] => rat set" where
  150.28    "add_set A B = {w. \<exists>x \<in> A. \<exists>y \<in> B. w = x + y}"
  150.29  
  150.30 -  diff_set :: "[rat set,rat set] => rat set"
  150.31 +definition
  150.32 +  diff_set :: "[rat set,rat set] => rat set" where
  150.33    "diff_set A B = {w. \<exists>x. 0 < w & 0 < x & x \<notin> B & x + w \<in> A}"
  150.34  
  150.35 -  mult_set :: "[rat set,rat set] => rat set"
  150.36 +definition
  150.37 +  mult_set :: "[rat set,rat set] => rat set" where
  150.38    "mult_set A B = {w. \<exists>x \<in> A. \<exists>y \<in> B. w = x * y}"
  150.39  
  150.40 -  inverse_set :: "rat set => rat set"
  150.41 +definition
  150.42 +  inverse_set :: "rat set => rat set" where
  150.43    "inverse_set A = {x. \<exists>y. 0 < x & x < y & inverse y \<notin> A}"
  150.44  
  150.45  
   151.1 --- a/src/HOL/Real/RComplete.thy	Fri Nov 17 02:19:55 2006 +0100
   151.2 +++ b/src/HOL/Real/RComplete.thy	Fri Nov 17 02:20:03 2006 +0100
   151.3 @@ -432,18 +432,19 @@
   151.4  subsection{*Floor and Ceiling Functions from the Reals to the Integers*}
   151.5  
   151.6  definition
   151.7 -  floor :: "real => int"
   151.8 +  floor :: "real => int" where
   151.9    "floor r = (LEAST n::int. r < real (n+1))"
  151.10  
  151.11 -  ceiling :: "real => int"
  151.12 +definition
  151.13 +  ceiling :: "real => int" where
  151.14    "ceiling r = - floor (- r)"
  151.15  
  151.16  notation (xsymbols)
  151.17 -  floor  ("\<lfloor>_\<rfloor>")
  151.18 +  floor  ("\<lfloor>_\<rfloor>") and
  151.19    ceiling  ("\<lceil>_\<rceil>")
  151.20  
  151.21  notation (HTML output)
  151.22 -  floor  ("\<lfloor>_\<rfloor>")
  151.23 +  floor  ("\<lfloor>_\<rfloor>") and
  151.24    ceiling  ("\<lceil>_\<rceil>")
  151.25  
  151.26  
  151.27 @@ -933,9 +934,11 @@
  151.28  subsection {* Versions for the natural numbers *}
  151.29  
  151.30  definition
  151.31 -  natfloor :: "real => nat"
  151.32 +  natfloor :: "real => nat" where
  151.33    "natfloor x = nat(floor x)"
  151.34 -  natceiling :: "real => nat"
  151.35 +
  151.36 +definition
  151.37 +  natceiling :: "real => nat" where
  151.38    "natceiling x = nat(ceiling x)"
  151.39  
  151.40  lemma natfloor_zero [simp]: "natfloor 0 = 0"
   152.1 --- a/src/HOL/Real/Rational.thy	Fri Nov 17 02:19:55 2006 +0100
   152.2 +++ b/src/HOL/Real/Rational.thy	Fri Nov 17 02:20:03 2006 +0100
   152.3 @@ -15,10 +15,11 @@
   152.4  subsubsection {* Equivalence of fractions *}
   152.5  
   152.6  definition
   152.7 -  fraction :: "(int \<times> int) set"
   152.8 +  fraction :: "(int \<times> int) set" where
   152.9    "fraction = {x. snd x \<noteq> 0}"
  152.10  
  152.11 -  ratrel :: "((int \<times> int) \<times> (int \<times> int)) set"
  152.12 +definition
  152.13 +  ratrel :: "((int \<times> int) \<times> (int \<times> int)) set" where
  152.14    "ratrel = {(x,y). snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x}"
  152.15  
  152.16  lemma fraction_iff [simp]: "(x \<in> fraction) = (snd x \<noteq> 0)"
  152.17 @@ -79,12 +80,12 @@
  152.18  
  152.19  
  152.20  definition
  152.21 -  Fract :: "int \<Rightarrow> int \<Rightarrow> rat"
  152.22 +  Fract :: "int \<Rightarrow> int \<Rightarrow> rat" where
  152.23    "Fract a b = Abs_Rat (ratrel``{(a,b)})"
  152.24  
  152.25  theorem Rat_cases [case_names Fract, cases type: rat]:
  152.26 -  "(!!a b. q = Fract a b ==> b \<noteq> 0 ==> C) ==> C"
  152.27 -by (cases q, clarsimp simp add: Fract_def Rat_def fraction_def quotient_def)
  152.28 +    "(!!a b. q = Fract a b ==> b \<noteq> 0 ==> C) ==> C"
  152.29 +  by (cases q) (clarsimp simp add: Fract_def Rat_def fraction_def quotient_def)
  152.30  
  152.31  theorem Rat_induct [case_names Fract, induct type: rat]:
  152.32      "(!!a b. b \<noteq> 0 ==> P (Fract a b)) ==> P q"
   153.1 --- a/src/HOL/Real/RealDef.thy	Fri Nov 17 02:19:55 2006 +0100
   153.2 +++ b/src/HOL/Real/RealDef.thy	Fri Nov 17 02:20:03 2006 +0100
   153.3 @@ -14,7 +14,7 @@
   153.4  begin
   153.5  
   153.6  definition
   153.7 -  realrel   ::  "((preal * preal) * (preal * preal)) set"
   153.8 +  realrel   ::  "((preal * preal) * (preal * preal)) set" where
   153.9    "realrel = {p. \<exists>x1 y1 x2 y2. p = ((x1,y1),(x2,y2)) & x1+y2 = x2+y1}"
  153.10  
  153.11  typedef (Real)  real = "UNIV//realrel"
  153.12 @@ -26,7 +26,7 @@
  153.13  
  153.14    (** these don't use the overloaded "real" function: users don't see them **)
  153.15  
  153.16 -  real_of_preal :: "preal => real"
  153.17 +  real_of_preal :: "preal => real" where
  153.18    "real_of_preal m = Abs_Real(realrel``{(m + preal_of_rat 1, preal_of_rat 1)})"
  153.19  
  153.20  consts
   154.1 --- a/src/HOL/Real/RealVector.thy	Fri Nov 17 02:19:55 2006 +0100
   154.2 +++ b/src/HOL/Real/RealVector.thy	Fri Nov 17 02:20:03 2006 +0100
   154.3 @@ -41,11 +41,11 @@
   154.4    scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a::scaleR" (infixr "*#" 75)
   154.5  
   154.6  abbreviation
   154.7 -  divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a::scaleR" (infixl "'/#" 70)
   154.8 +  divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a::scaleR" (infixl "'/#" 70) where
   154.9    "x /# r == inverse r *# x"
  154.10  
  154.11  notation (xsymbols)
  154.12 -  scaleR (infixr "*\<^sub>R" 75)
  154.13 +  scaleR (infixr "*\<^sub>R" 75) and
  154.14    divideR (infixl "'/\<^sub>R" 70)
  154.15  
  154.16  instance real :: scaleR ..
  154.17 @@ -175,7 +175,7 @@
  154.18  @{term of_real} *}
  154.19  
  154.20  definition
  154.21 -  of_real :: "real \<Rightarrow> 'a::real_algebra_1"
  154.22 +  of_real :: "real \<Rightarrow> 'a::real_algebra_1" where
  154.23    "of_real r = r *# 1"
  154.24  
  154.25  lemma scaleR_conv_of_real: "r *# x = of_real r * x"
  154.26 @@ -250,7 +250,7 @@
  154.27  subsection {* The Set of Real Numbers *}
  154.28  
  154.29  definition
  154.30 -  Reals :: "'a::real_algebra_1 set"
  154.31 +  Reals :: "'a::real_algebra_1 set" where
  154.32    "Reals \<equiv> range of_real"
  154.33  
  154.34  notation (xsymbols)
   155.1 --- a/src/HOL/Relation.thy	Fri Nov 17 02:19:55 2006 +0100
   155.2 +++ b/src/HOL/Relation.thy	Fri Nov 17 02:20:03 2006 +0100
   155.3 @@ -13,54 +13,69 @@
   155.4  subsection {* Definitions *}
   155.5  
   155.6  definition
   155.7 -  converse :: "('a * 'b) set => ('b * 'a) set"    ("(_^-1)" [1000] 999)
   155.8 +  converse :: "('a * 'b) set => ('b * 'a) set"
   155.9 +    ("(_^-1)" [1000] 999) where
  155.10    "r^-1 == {(y, x). (x, y) : r}"
  155.11  
  155.12  notation (xsymbols)
  155.13    converse  ("(_\<inverse>)" [1000] 999)
  155.14  
  155.15  definition
  155.16 -  rel_comp  :: "[('b * 'c) set, ('a * 'b) set] => ('a * 'c) set"  (infixr "O" 75)
  155.17 +  rel_comp  :: "[('b * 'c) set, ('a * 'b) set] => ('a * 'c) set"
  155.18 +    (infixr "O" 75) where
  155.19    "r O s == {(x,z). EX y. (x, y) : s & (y, z) : r}"
  155.20  
  155.21 -  Image :: "[('a * 'b) set, 'a set] => 'b set"                (infixl "``" 90)
  155.22 +definition
  155.23 +  Image :: "[('a * 'b) set, 'a set] => 'b set"
  155.24 +    (infixl "``" 90) where
  155.25    "r `` s == {y. EX x:s. (x,y):r}"
  155.26  
  155.27 -  Id    :: "('a * 'a) set"  -- {* the identity relation *}
  155.28 +definition
  155.29 +  Id :: "('a * 'a) set" where -- {* the identity relation *}
  155.30    "Id == {p. EX x. p = (x,x)}"
  155.31  
  155.32 -  diag  :: "'a set => ('a * 'a) set"  -- {* diagonal: identity over a set *}
  155.33 +definition
  155.34 +  diag  :: "'a set => ('a * 'a) set" where -- {* diagonal: identity over a set *}
  155.35    "diag A == \<Union>x\<in>A. {(x,x)}"
  155.36  
  155.37 -  Domain :: "('a * 'b) set => 'a set"
  155.38 +definition
  155.39 +  Domain :: "('a * 'b) set => 'a set" where
  155.40    "Domain r == {x. EX y. (x,y):r}"
  155.41  
  155.42 -  Range  :: "('a * 'b) set => 'b set"
  155.43 +definition
  155.44 +  Range  :: "('a * 'b) set => 'b set" where
  155.45    "Range r == Domain(r^-1)"
  155.46  
  155.47 -  Field :: "('a * 'a) set => 'a set"
  155.48 +definition
  155.49 +  Field :: "('a * 'a) set => 'a set" where
  155.50    "Field r == Domain r \<union> Range r"
  155.51  
  155.52 -  refl   :: "['a set, ('a * 'a) set] => bool"  -- {* reflexivity over a set *}
  155.53 +definition
  155.54 +  refl :: "['a set, ('a * 'a) set] => bool" where -- {* reflexivity over a set *}
  155.55    "refl A r == r \<subseteq> A \<times> A & (ALL x: A. (x,x) : r)"
  155.56  
  155.57 -  sym    :: "('a * 'a) set => bool"  -- {* symmetry predicate *}
  155.58 +definition
  155.59 +  sym :: "('a * 'a) set => bool" where -- {* symmetry predicate *}
  155.60    "sym r == ALL x y. (x,y): r --> (y,x): r"
  155.61  
  155.62 -  antisym:: "('a * 'a) set => bool"  -- {* antisymmetry predicate *}
  155.63 +definition
  155.64 +  antisym :: "('a * 'a) set => bool" where -- {* antisymmetry predicate *}
  155.65    "antisym r == ALL x y. (x,y):r --> (y,x):r --> x=y"
  155.66  
  155.67 -  trans  :: "('a * 'a) set => bool"  -- {* transitivity predicate *}
  155.68 +definition
  155.69 +  trans :: "('a * 'a) set => bool" where -- {* transitivity predicate *}
  155.70    "trans r == (ALL x y z. (x,y):r --> (y,z):r --> (x,z):r)"
  155.71  
  155.72 -  single_valued :: "('a * 'b) set => bool"
  155.73 +definition
  155.74 +  single_valued :: "('a * 'b) set => bool" where
  155.75    "single_valued r == ALL x y. (x,y):r --> (ALL z. (x,z):r --> y=z)"
  155.76  
  155.77 -  inv_image :: "('b * 'b) set => ('a => 'b) => ('a * 'a) set"
  155.78 +definition
  155.79 +  inv_image :: "('b * 'b) set => ('a => 'b) => ('a * 'a) set" where
  155.80    "inv_image r f == {(x, y). (f x, f y) : r}"
  155.81  
  155.82  abbreviation
  155.83 -  reflexive :: "('a * 'a) set => bool"  -- {* reflexivity over a type *}
  155.84 +  reflexive :: "('a * 'a) set => bool" where -- {* reflexivity over a type *}
  155.85    "reflexive == refl UNIV"
  155.86  
  155.87  
   156.1 --- a/src/HOL/Set.thy	Fri Nov 17 02:19:55 2006 +0100
   156.2 +++ b/src/HOL/Set.thy	Fri Nov 17 02:20:03 2006 +0100
   156.3 @@ -38,7 +38,7 @@
   156.4    "op :"        :: "'a => 'a set => bool"                -- "membership"
   156.5  
   156.6  notation
   156.7 -  "op :"  ("op :")
   156.8 +  "op :"  ("op :") and
   156.9    "op :"  ("(_/ : _)" [50, 51] 50)
  156.10  
  156.11  local
  156.12 @@ -47,32 +47,32 @@
  156.13  subsection {* Additional concrete syntax *}
  156.14  
  156.15  abbreviation
  156.16 -  range :: "('a => 'b) => 'b set"             -- "of function"
  156.17 +  range :: "('a => 'b) => 'b set" where -- "of function"
  156.18    "range f == f ` UNIV"
  156.19  
  156.20  abbreviation
  156.21 -  "not_mem x A == ~ (x : A)"                  -- "non-membership"
  156.22 +  "not_mem x A == ~ (x : A)" -- "non-membership"
  156.23  
  156.24  notation
  156.25 -  not_mem  ("op ~:")
  156.26 +  not_mem  ("op ~:") and
  156.27    not_mem  ("(_/ ~: _)" [50, 51] 50)
  156.28  
  156.29  notation (xsymbols)
  156.30 -  "op Int"  (infixl "\<inter>" 70)
  156.31 -  "op Un"  (infixl "\<union>" 65)
  156.32 -  "op :"  ("op \<in>")
  156.33 -  "op :"  ("(_/ \<in> _)" [50, 51] 50)
  156.34 -  not_mem  ("op \<notin>")
  156.35 -  not_mem  ("(_/ \<notin> _)" [50, 51] 50)
  156.36 -  Union  ("\<Union>_" [90] 90)
  156.37 +  "op Int"  (infixl "\<inter>" 70) and
  156.38 +  "op Un"  (infixl "\<union>" 65) and
  156.39 +  "op :"  ("op \<in>") and
  156.40 +  "op :"  ("(_/ \<in> _)" [50, 51] 50) and
  156.41 +  not_mem  ("op \<notin>") and
  156.42 +  not_mem  ("(_/ \<notin> _)" [50, 51] 50) and
  156.43 +  Union  ("\<Union>_" [90] 90) and
  156.44    Inter  ("\<Inter>_" [90] 90)
  156.45  
  156.46  notation (HTML output)
  156.47 -  "op Int"  (infixl "\<inter>" 70)
  156.48 -  "op Un"  (infixl "\<union>" 65)
  156.49 -  "op :"  ("op \<in>")
  156.50 -  "op :"  ("(_/ \<in> _)" [50, 51] 50)
  156.51 -  not_mem  ("op \<notin>")
  156.52 +  "op Int"  (infixl "\<inter>" 70) and
  156.53 +  "op Un"  (infixl "\<union>" 65) and
  156.54 +  "op :"  ("op \<in>") and
  156.55 +  "op :"  ("(_/ \<in> _)" [50, 51] 50) and
  156.56 +  not_mem  ("op \<notin>") and
  156.57    not_mem  ("(_/ \<notin> _)" [50, 51] 50)
  156.58  
  156.59  syntax
  156.60 @@ -149,33 +149,37 @@
  156.61    psubset_def:  "A < B          == (A::'a set) <= B & ~ A=B" ..
  156.62  
  156.63  abbreviation
  156.64 -  subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
  156.65 +  subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where
  156.66    "subset == less"
  156.67 -  subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
  156.68 +
  156.69 +abbreviation
  156.70 +  subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where
  156.71    "subset_eq == less_eq"
  156.72  
  156.73  notation (output)
  156.74 -  subset  ("op <")
  156.75 -  subset  ("(_/ < _)" [50, 51] 50)
  156.76 -  subset_eq  ("op <=")
  156.77 +  subset  ("op <") and
  156.78 +  subset  ("(_/ < _)" [50, 51] 50) and
  156.79 +  subset_eq  ("op <=") and
  156.80    subset_eq  ("(_/ <= _)" [50, 51] 50)
  156.81  
  156.82  notation (xsymbols)
  156.83 -  subset  ("op \<subset>")
  156.84 -  subset  ("(_/ \<subset> _)" [50, 51] 50)
  156.85 -  subset_eq  ("op \<subseteq>")
  156.86 +  subset  ("op \<subset>") and
  156.87 +  subset  ("(_/ \<subset> _)" [50, 51] 50) and
  156.88 +  subset_eq  ("op \<subseteq>") and
  156.89    subset_eq  ("(_/ \<subseteq> _)" [50, 51] 50)
  156.90  
  156.91  notation (HTML output)
  156.92 -  subset  ("op \<subset>")
  156.93 -  subset  ("(_/ \<subset> _)" [50, 51] 50)
  156.94 -  subset_eq  ("op \<subseteq>")
  156.95 +  subset  ("op \<subset>") and
  156.96 +  subset  ("(_/ \<subset> _)" [50, 51] 50) and
  156.97 +  subset_eq  ("op \<subseteq>") and
  156.98    subset_eq  ("(_/ \<subseteq> _)" [50, 51] 50)
  156.99  
 156.100  abbreviation (input)
 156.101 -  supset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"    (infixl "\<supset>" 50)
 156.102 +  supset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"  (infixl "\<supset>" 50) where
 156.103    "supset == greater"
 156.104 -  supset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"  (infixl "\<supseteq>" 50)
 156.105 +
 156.106 +abbreviation (input)
 156.107 +  supset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"  (infixl "\<supseteq>" 50) where
 156.108    "supset_eq == greater_eq"
 156.109  
 156.110  
 156.111 @@ -216,6 +220,7 @@
 156.112   "\<exists>A\<subseteq>B. P"   =>  "EX A. A \<subseteq> B & P"
 156.113   "\<exists>!A\<subseteq>B. P"  =>  "EX! A. A \<subseteq> B & P"
 156.114  
 156.115 +(* FIXME re-use version in Orderings.thy *)
 156.116  print_translation {*
 156.117  let
 156.118    fun
   157.1 --- a/src/HOL/Transitive_Closure.thy	Fri Nov 17 02:19:55 2006 +0100
   157.2 +++ b/src/HOL/Transitive_Closure.thy	Fri Nov 17 02:20:03 2006 +0100
   157.3 @@ -37,17 +37,17 @@
   157.4      trancl_into_trancl [Pure.intro]: "(a, b) : r^+ ==> (b, c) : r ==> (a,c) : r^+"
   157.5  
   157.6  abbreviation
   157.7 -  reflcl :: "('a \<times> 'a) set => ('a \<times> 'a) set"    ("(_^=)" [1000] 999)
   157.8 +  reflcl :: "('a \<times> 'a) set => ('a \<times> 'a) set"  ("(_^=)" [1000] 999) where
   157.9    "r^= == r \<union> Id"
  157.10  
  157.11  notation (xsymbols)
  157.12 -  rtrancl  ("(_\<^sup>*)" [1000] 999)
  157.13 -  trancl  ("(_\<^sup>+)" [1000] 999)
  157.14 +  rtrancl  ("(_\<^sup>*)" [1000] 999) and
  157.15 +  trancl  ("(_\<^sup>+)" [1000] 999) and
  157.16    reflcl  ("(_\<^sup>=)" [1000] 999)
  157.17  
  157.18  notation (HTML output)
  157.19 -  rtrancl  ("(_\<^sup>*)" [1000] 999)
  157.20 -  trancl  ("(_\<^sup>+)" [1000] 999)
  157.21 +  rtrancl  ("(_\<^sup>*)" [1000] 999) and
  157.22 +  trancl  ("(_\<^sup>+)" [1000] 999) and
  157.23    reflcl  ("(_\<^sup>=)" [1000] 999)
  157.24  
  157.25  
   158.1 --- a/src/HOL/Unix/Unix.thy	Fri Nov 17 02:19:55 2006 +0100
   158.2 +++ b/src/HOL/Unix/Unix.thy	Fri Nov 17 02:20:03 2006 +0100
   158.3 @@ -166,6 +166,7 @@
   158.4        Val (att, text) \<Rightarrow> att
   158.5      | Env att dir \<Rightarrow> att)"
   158.6  
   158.7 +definition
   158.8    "map_attributes f file =
   158.9      (case file of
  158.10        Val (att, text) \<Rightarrow> Val (f att, text)
  158.11 @@ -830,6 +831,7 @@
  158.12       [Mkdir user\<^isub>1 perms\<^isub>1 [user\<^isub>1, name\<^isub>1],
  158.13        Mkdir user\<^isub>2 perms\<^isub>2 [user\<^isub>1, name\<^isub>1, name\<^isub>2],
  158.14        Creat user\<^isub>2 perms\<^isub>2 [user\<^isub>1, name\<^isub>1, name\<^isub>2, name\<^isub>3]]"
  158.15 +definition
  158.16    "bogus_path = [user\<^isub>1, name\<^isub>1, name\<^isub>2]"
  158.17  
  158.18  text {*
   159.1 --- a/src/HOL/W0/W0.thy	Fri Nov 17 02:19:55 2006 +0100
   159.2 +++ b/src/HOL/W0/W0.thy	Fri Nov 17 02:20:03 2006 +0100
   159.3 @@ -12,7 +12,7 @@
   159.4  datatype 'a maybe = Ok 'a | Fail
   159.5  
   159.6  definition
   159.7 -  bind :: "'a maybe \<Rightarrow> ('a \<Rightarrow> 'b maybe) \<Rightarrow> 'b maybe"    (infixl "\<bind>" 60)
   159.8 +  bind :: "'a maybe \<Rightarrow> ('a \<Rightarrow> 'b maybe) \<Rightarrow> 'b maybe"    (infixl "\<bind>" 60) where
   159.9    "m \<bind> f = (case m of Ok r \<Rightarrow> f r | Fail \<Rightarrow> Fail)"
  159.10  
  159.11  syntax
  159.12 @@ -85,11 +85,12 @@
  159.13    "free_tv (x # xs) = free_tv x \<union> free_tv xs"
  159.14  
  159.15  definition
  159.16 -  dom :: "subst \<Rightarrow> nat set"
  159.17 +  dom :: "subst \<Rightarrow> nat set" where
  159.18    "dom s = {n. s n \<noteq> TVar n}"
  159.19    -- {* domain of a substitution *}
  159.20  
  159.21 -  cod :: "subst \<Rightarrow> nat set"
  159.22 +definition
  159.23 +  cod :: "subst \<Rightarrow> nat set" where
  159.24    "cod s = (\<Union>m \<in> dom s. free_tv (s m))"
  159.25    -- {* codomain of a substitutions: the introduced variables *}
  159.26  
  159.27 @@ -103,14 +104,14 @@
  159.28  *}
  159.29  
  159.30  definition
  159.31 -  new_tv :: "nat \<Rightarrow> 'a::type_struct \<Rightarrow> bool"
  159.32 +  new_tv :: "nat \<Rightarrow> 'a::type_struct \<Rightarrow> bool" where
  159.33    "new_tv n ts = (\<forall>m. m \<in> free_tv ts \<longrightarrow> m < n)"
  159.34  
  159.35  
  159.36  subsubsection {* Identity substitution *}
  159.37  
  159.38  definition
  159.39 -  id_subst :: subst
  159.40 +  id_subst :: subst where
  159.41    "id_subst = (\<lambda>n. TVar n)"
  159.42  
  159.43  lemma app_subst_id_te [simp]:
  159.44 @@ -384,7 +385,7 @@
  159.45    has_type :: "(typ list \<times> expr \<times> typ) set"
  159.46  
  159.47  abbreviation
  159.48 -  has_type_rel  ("((_) |-/ (_) :: (_))" [60, 0, 60] 60)
  159.49 +  has_type_rel  ("((_) |-/ (_) :: (_))" [60, 0, 60] 60) where
  159.50    "a |- e :: t == (a, e, t) \<in> has_type"
  159.51  
  159.52  inductive has_type
   160.1 --- a/src/HOL/ex/Abstract_NAT.thy	Fri Nov 17 02:19:55 2006 +0100
   160.2 +++ b/src/HOL/ex/Abstract_NAT.thy	Fri Nov 17 02:20:03 2006 +0100
   160.3 @@ -66,7 +66,7 @@
   160.4  text {* \medskip The recursion operator -- polymorphic! *}
   160.5  
   160.6  definition
   160.7 -  rec :: "'a \<Rightarrow> ('n \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'n \<Rightarrow> 'a"
   160.8 +  rec :: "'a \<Rightarrow> ('n \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'n \<Rightarrow> 'a" where
   160.9    "rec e r x = (THE y. Rec e r x y)"
  160.10  
  160.11  lemma rec_eval:
  160.12 @@ -92,7 +92,7 @@
  160.13  text {* \medskip Example: addition (monomorphic) *}
  160.14  
  160.15  definition
  160.16 -  add :: "'n \<Rightarrow> 'n \<Rightarrow> 'n"
  160.17 +  add :: "'n \<Rightarrow> 'n \<Rightarrow> 'n" where
  160.18    "add m n = rec n (\<lambda>_ k. succ k) m"
  160.19  
  160.20  lemma add_zero [simp]: "add zero n = n"
  160.21 @@ -116,7 +116,7 @@
  160.22  text {* \medskip Example: replication (polymorphic) *}
  160.23  
  160.24  definition
  160.25 -  repl :: "'n \<Rightarrow> 'a \<Rightarrow> 'a list"
  160.26 +  repl :: "'n \<Rightarrow> 'a \<Rightarrow> 'a list" where
  160.27    "repl n x = rec [] (\<lambda>_ xs. x # xs) n"
  160.28  
  160.29  lemma repl_zero [simp]: "repl zero x = []"
   161.1 --- a/src/HOL/ex/Adder.thy	Fri Nov 17 02:19:55 2006 +0100
   161.2 +++ b/src/HOL/ex/Adder.thy	Fri Nov 17 02:20:03 2006 +0100
   161.3 @@ -15,7 +15,7 @@
   161.4    by (cases bv) (simp_all add: bv_to_nat_helper)
   161.5  
   161.6  definition
   161.7 -  half_adder :: "[bit, bit] => bit list"
   161.8 +  half_adder :: "[bit, bit] => bit list" where
   161.9    "half_adder a b = [a bitand b, a bitxor b]"
  161.10  
  161.11  lemma half_adder_correct: "bv_to_nat (half_adder a b) = bitval a + bitval b"
  161.12 @@ -28,7 +28,7 @@
  161.13    by (simp add: half_adder_def)
  161.14  
  161.15  definition
  161.16 -  full_adder :: "[bit, bit, bit] => bit list"
  161.17 +  full_adder :: "[bit, bit, bit] => bit list" where
  161.18    "full_adder a b c =
  161.19        (let x = a bitxor b in [a bitand b bitor c bitand x, x bitxor c])"
  161.20  
   162.1 --- a/src/HOL/ex/CTL.thy	Fri Nov 17 02:19:55 2006 +0100
   162.2 +++ b/src/HOL/ex/CTL.thy	Fri Nov 17 02:20:03 2006 +0100
   162.3 @@ -25,7 +25,7 @@
   162.4  types 'a ctl = "'a set"
   162.5  
   162.6  definition
   162.7 -  imp :: "'a ctl \<Rightarrow> 'a ctl \<Rightarrow> 'a ctl"    (infixr "\<rightarrow>" 75)
   162.8 +  imp :: "'a ctl \<Rightarrow> 'a ctl \<Rightarrow> 'a ctl"    (infixr "\<rightarrow>" 75) where
   162.9    "p \<rightarrow> q = - p \<union> q"
  162.10  
  162.11  lemma [intro!]: "p \<inter> p \<rightarrow> q \<subseteq> q" unfolding imp_def by auto
  162.12 @@ -58,9 +58,11 @@
  162.13  *}
  162.14  
  162.15  definition
  162.16 -  EX :: "'a ctl \<Rightarrow> 'a ctl"    ("\<EX> _" [80] 90)    "\<EX> p = {s. \<exists>s'. (s, s') \<in> \<M> \<and> s' \<in> p}"
  162.17 -  EF :: "'a ctl \<Rightarrow> 'a ctl"    ("\<EF> _" [80] 90)    "\<EF> p = lfp (\<lambda>s. p \<union> \<EX> s)"
  162.18 -  EG :: "'a ctl \<Rightarrow> 'a ctl"    ("\<EG> _" [80] 90)    "\<EG> p = gfp (\<lambda>s. p \<inter> \<EX> s)"
  162.19 +  EX  ("\<EX> _" [80] 90) where "\<EX> p = {s. \<exists>s'. (s, s') \<in> \<M> \<and> s' \<in> p}"
  162.20 +definition
  162.21 +  EF ("\<EF> _" [80] 90)  where "\<EF> p = lfp (\<lambda>s. p \<union> \<EX> s)"
  162.22 +definition
  162.23 +  EG ("\<EG> _" [80] 90)  where "\<EG> p = gfp (\<lambda>s. p \<inter> \<EX> s)"
  162.24  
  162.25  text {*
  162.26    @{text "\<AX>"}, @{text "\<AF>"} and @{text "\<AG>"} are now defined
  162.27 @@ -69,9 +71,11 @@
  162.28  *}
  162.29  
  162.30  definition
  162.31 -  AX :: "'a ctl \<Rightarrow> 'a ctl"    ("\<AX> _" [80] 90)    "\<AX> p = - \<EX> - p"
  162.32 -  AF :: "'a ctl \<Rightarrow> 'a ctl"    ("\<AF> _" [80] 90)    "\<AF> p = - \<EG> - p"
  162.33 -  AG :: "'a ctl \<Rightarrow> 'a ctl"    ("\<AG> _" [80] 90)    "\<AG> p = - \<EF> - p"
  162.34 +  AX  ("\<AX> _" [80] 90) where "\<AX> p = - \<EX> - p"
  162.35 +definition
  162.36 +  AF  ("\<AF> _" [80] 90) where "\<AF> p = - \<EG> - p"
  162.37 +definition
  162.38 +  AG  ("\<AG> _" [80] 90) where "\<AG> p = - \<EF> - p"
  162.39  
  162.40  lemmas [simp] = EX_def EG_def AX_def EF_def AF_def AG_def
  162.41  
   163.1 --- a/src/HOL/ex/Classpackage.thy	Fri Nov 17 02:19:55 2006 +0100
   163.2 +++ b/src/HOL/ex/Classpackage.thy	Fri Nov 17 02:20:03 2006 +0100
   163.3 @@ -97,8 +97,8 @@
   163.4  qed
   163.5  
   163.6  definition (in monoid)
   163.7 -  units :: "'a set"
   163.8 -  units_def: "units = { y. \<exists>x. x \<^loc>\<otimes> y = \<^loc>\<one> \<and> y \<^loc>\<otimes> x = \<^loc>\<one> }"
   163.9 +  units :: "'a set" where
  163.10 +  "units = { y. \<exists>x. x \<^loc>\<otimes> y = \<^loc>\<one> \<and> y \<^loc>\<otimes> x = \<^loc>\<one> }"
  163.11  
  163.12  lemma (in monoid) inv_obtain:
  163.13    assumes ass: "x \<in> units"
  163.14 @@ -139,11 +139,11 @@
  163.15    "reduce f g (Suc n) x = f x (reduce f g n x)"
  163.16  
  163.17  definition (in monoid)
  163.18 -  npow :: "nat \<Rightarrow> 'a \<Rightarrow> 'a"
  163.19 +  npow :: "nat \<Rightarrow> 'a \<Rightarrow> 'a" where
  163.20    npow_def_prim: "npow n x = reduce (op \<^loc>\<otimes>) \<^loc>\<one> n x"
  163.21  
  163.22  abbreviation (in monoid)
  163.23 -  abbrev_npow :: "'a \<Rightarrow> nat \<Rightarrow> 'a" (infix "\<^loc>\<up>" 75)
  163.24 +  abbrev_npow :: "'a \<Rightarrow> nat \<Rightarrow> 'a" (infix "\<^loc>\<up>" 75) where
  163.25    "x \<^loc>\<up> n \<equiv> npow n x"
  163.26  
  163.27  lemma (in monoid) npow_def:
  163.28 @@ -272,12 +272,12 @@
  163.29  using invr invl by simp
  163.30  
  163.31  definition (in group)
  163.32 -  pow :: "int \<Rightarrow> 'a \<Rightarrow> 'a"
  163.33 -  pow_def: "pow k x = (if k < 0 then \<^loc>\<div> (monoid.npow (op \<^loc>\<otimes>) \<^loc>\<one> (nat (-k)) x)
  163.34 +  pow :: "int \<Rightarrow> 'a \<Rightarrow> 'a" where
  163.35 +  "pow k x = (if k < 0 then \<^loc>\<div> (monoid.npow (op \<^loc>\<otimes>) \<^loc>\<one> (nat (-k)) x)
  163.36      else (monoid.npow (op \<^loc>\<otimes>) \<^loc>\<one> (nat k) x))"
  163.37  
  163.38  abbreviation (in group)
  163.39 -  abbrev_pow :: "'a \<Rightarrow> int \<Rightarrow> 'a" (infix "\<^loc>\<up>" 75)
  163.40 +  abbrev_pow :: "'a \<Rightarrow> int \<Rightarrow> 'a" (infix "\<^loc>\<up>" 75) where
  163.41    "x \<^loc>\<up> k \<equiv> pow k x"
  163.42  
  163.43  lemma (in group) int_pow_zero:
  163.44 @@ -312,12 +312,12 @@
  163.45  
  163.46  definition
  163.47    "X a b c = (a \<otimes> \<one> \<otimes> b, a \<otimes> \<one> \<otimes> b, [a, b] \<otimes> \<one> \<otimes> [a, b, c])"
  163.48 +definition
  163.49    "Y a b c = (a, \<div> a) \<otimes> \<one> \<otimes> \<div> (b, \<div> c)"
  163.50  
  163.51 -definition
  163.52 -  "x1 = X (1::nat) 2 3"
  163.53 -  "x2 = X (1::int) 2 3"
  163.54 -  "y2 = Y (1::int) 2 3"
  163.55 +definition "x1 = X (1::nat) 2 3"
  163.56 +definition "x2 = X (1::int) 2 3"
  163.57 +definition "y2 = Y (1::int) 2 3"
  163.58  
  163.59  code_gen "op \<otimes>" \<one> inv
  163.60  code_gen X Y (SML) (Haskell)
   164.1 --- a/src/HOL/ex/CodeCollections.thy	Fri Nov 17 02:19:55 2006 +0100
   164.2 +++ b/src/HOL/ex/CodeCollections.thy	Fri Nov 17 02:20:03 2006 +0100
   164.3 @@ -55,15 +55,19 @@
   164.4  qed
   164.5  
   164.6  definition (in ordered)
   164.7 -  min :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
   164.8 +  min :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" where
   164.9    "min x y = (if x \<^loc><<= y then x else y)"
  164.10 -  max :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
  164.11 +
  164.12 +definition (in ordered)
  164.13 +  max :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" where
  164.14    "max x y = (if x \<^loc><<= y then y else x)"
  164.15  
  164.16  definition
  164.17 -  min :: "'a::ordered \<Rightarrow> 'a \<Rightarrow> 'a"
  164.18 +  min :: "'a::ordered \<Rightarrow> 'a \<Rightarrow> 'a" where
  164.19    "min x y = (if x <<= y then x else y)"
  164.20 -  max :: "'a::ordered \<Rightarrow> 'a \<Rightarrow> 'a"
  164.21 +
  164.22 +definition
  164.23 +  max :: "'a::ordered \<Rightarrow> 'a \<Rightarrow> 'a" where
  164.24    "max x y = (if x <<= y then y else x)"
  164.25  
  164.26  fun abs_sorted :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool"
  164.27 @@ -366,15 +370,15 @@
  164.28    "get_index p n (x#xs) = (if p x then Some n else get_index p (Suc n) xs)"
  164.29  
  164.30  definition
  164.31 -  between :: "'a::enum \<Rightarrow> 'a \<Rightarrow> 'a option"
  164.32 +  between :: "'a::enum \<Rightarrow> 'a \<Rightarrow> 'a option" where
  164.33    "between x y = get_first (\<lambda>z. x << z & z << y) enum"
  164.34  
  164.35  definition
  164.36 -  index :: "'a::enum \<Rightarrow> nat"
  164.37 +  index :: "'a::enum \<Rightarrow> nat" where
  164.38    "index x = the (get_index (\<lambda>y. y = x) 0 enum)"
  164.39  
  164.40  definition
  164.41 -  add :: "'a::enum \<Rightarrow> 'a \<Rightarrow> 'a"
  164.42 +  add :: "'a::enum \<Rightarrow> 'a \<Rightarrow> 'a" where
  164.43    "add x y =
  164.44      (let
  164.45        enm = enum
  164.46 @@ -387,9 +391,8 @@
  164.47    "sum [] = inf"
  164.48    "sum (x#xs) = add x (sum xs)"
  164.49  
  164.50 -definition
  164.51 -  "test1 = sum [None, Some True, None, Some False]"
  164.52 -  "test2 = (inf :: nat \<times> unit)"
  164.53 +definition "test1 = sum [None, Some True, None, Some False]"
  164.54 +definition "test2 = (inf :: nat \<times> unit)"
  164.55  
  164.56  code_gen "op <<="
  164.57  code_gen "op <<"
   165.1 --- a/src/HOL/ex/CodeEmbed.thy	Fri Nov 17 02:19:55 2006 +0100
   165.2 +++ b/src/HOL/ex/CodeEmbed.thy	Fri Nov 17 02:20:03 2006 +0100
   165.3 @@ -22,9 +22,10 @@
   165.4    | TFix vname sort (infix "\<Colon>\<epsilon>" 117)
   165.5  
   165.6  abbreviation
   165.7 -  Fun :: "typ \<Rightarrow> typ \<Rightarrow> typ" (infixr "\<rightarrow>" 115)
   165.8 +  Fun :: "typ \<Rightarrow> typ \<Rightarrow> typ" (infixr "\<rightarrow>" 115) where
   165.9    "ty1 \<rightarrow> ty2 \<equiv> Type (STR ''fun'') [ty1, ty2]"
  165.10 -  Funs :: "typ list \<Rightarrow> typ \<Rightarrow> typ" (infixr "{\<rightarrow>}" 115)
  165.11 +abbreviation
  165.12 +  Funs :: "typ list \<Rightarrow> typ \<Rightarrow> typ" (infixr "{\<rightarrow>}" 115) where
  165.13    "tys {\<rightarrow>} ty \<equiv> foldr (op \<rightarrow>) tys ty"
  165.14  
  165.15  datatype "term" =
  165.16 @@ -33,7 +34,7 @@
  165.17    | App   "term" "term" (infixl "\<bullet>" 110)
  165.18  
  165.19  abbreviation
  165.20 -  Apps :: "term \<Rightarrow> term list \<Rightarrow> term"  (infixl "{\<bullet>}" 110)
  165.21 +  Apps :: "term \<Rightarrow> term list \<Rightarrow> term"  (infixl "{\<bullet>}" 110) where
  165.22    "t {\<bullet>} ts \<equiv> foldl (op \<bullet>) t ts"
  165.23  
  165.24  
   166.1 --- a/src/HOL/ex/CodeRandom.thy	Fri Nov 17 02:19:55 2006 +0100
   166.2 +++ b/src/HOL/ex/CodeRandom.thy	Fri Nov 17 02:20:03 2006 +0100
   166.3 @@ -30,7 +30,7 @@
   166.4    random_seed :: "randseed \<Rightarrow> nat"
   166.5  
   166.6  definition
   166.7 -  random :: "nat \<Rightarrow> randseed \<Rightarrow> nat \<times> randseed"
   166.8 +  random :: "nat \<Rightarrow> randseed \<Rightarrow> nat \<times> randseed" where
   166.9    "random n s = (random_seed s mod n, random_shift s)"
  166.10  
  166.11  lemma random_bound:
  166.12 @@ -45,12 +45,13 @@
  166.13    "snd (random n s) = random_shift s" unfolding random_def by simp
  166.14  
  166.15  definition
  166.16 -  select :: "'a list \<Rightarrow> randseed \<Rightarrow> 'a \<times> randseed"
  166.17 +  select :: "'a list \<Rightarrow> randseed \<Rightarrow> 'a \<times> randseed" where
  166.18    [simp]: "select xs = (do
  166.19        n \<leftarrow> random (length xs);
  166.20        return (nth xs n)
  166.21      done)"
  166.22 -  select_weight :: "(nat \<times> 'a) list \<Rightarrow> randseed \<Rightarrow> 'a \<times> randseed"
  166.23 +definition
  166.24 +  select_weight :: "(nat \<times> 'a) list \<Rightarrow> randseed \<Rightarrow> 'a \<times> randseed" where
  166.25    [simp]: "select_weight xs = (do
  166.26        n \<leftarrow> random (foldl (op +) 0 (map fst xs));
  166.27        return (pick xs n)
  166.28 @@ -123,7 +124,7 @@
  166.29  qed
  166.30  
  166.31  definition
  166.32 -  random_int :: "int \<Rightarrow> randseed \<Rightarrow> int * randseed"
  166.33 +  random_int :: "int \<Rightarrow> randseed \<Rightarrow> int * randseed" where
  166.34    "random_int k = (do n \<leftarrow> random (nat k); return (int n) done)"
  166.35  
  166.36  lemma random_nat [code]:
   167.1 --- a/src/HOL/ex/Codegenerator.thy	Fri Nov 17 02:19:55 2006 +0100
   167.2 +++ b/src/HOL/ex/Codegenerator.thy	Fri Nov 17 02:20:03 2006 +0100
   167.3 @@ -11,23 +11,27 @@
   167.4  subsection {* booleans *}
   167.5  
   167.6  definition
   167.7 -  xor :: "bool \<Rightarrow> bool \<Rightarrow> bool"
   167.8 +  xor :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
   167.9    "xor p q = ((p | q) & \<not> (p & q))"
  167.10  
  167.11  subsection {* natural numbers *}
  167.12  
  167.13  definition
  167.14 -  n :: nat
  167.15 +  n :: nat where
  167.16    "n = 42"
  167.17  
  167.18  subsection {* pairs *}
  167.19  
  167.20  definition
  167.21 -  swap :: "'a * 'b \<Rightarrow> 'b * 'a"
  167.22 +  swap :: "'a * 'b \<Rightarrow> 'b * 'a" where
  167.23    "swap p = (let (x, y) = p in (y, x))"
  167.24 -  appl :: "('a \<Rightarrow> 'b) * 'a \<Rightarrow> 'b"
  167.25 +
  167.26 +definition
  167.27 +  appl :: "('a \<Rightarrow> 'b) * 'a \<Rightarrow> 'b" where
  167.28    "appl p = (let (f, x) = p in f x)"
  167.29 -  snd_three :: "'a * 'b * 'c => 'b"
  167.30 +
  167.31 +definition
  167.32 +  snd_three :: "'a * 'b * 'c => 'b" where
  167.33    "snd_three a = id (\<lambda>(a, b, c). b) a"
  167.34  
  167.35  lemma [code]:
  167.36 @@ -41,7 +45,7 @@
  167.37  subsection {* integers *}
  167.38  
  167.39  definition
  167.40 -  k :: "int"
  167.41 +  k :: "int" where
  167.42    "k = -42"
  167.43  
  167.44  function
  167.45 @@ -59,9 +63,11 @@
  167.46  subsection {* lists *}
  167.47  
  167.48  definition
  167.49 -  ps :: "nat list"
  167.50 +  ps :: "nat list" where
  167.51    "ps = [2, 3, 5, 7, 11]"
  167.52 -  qs :: "nat list"
  167.53 +
  167.54 +definition
  167.55 +  qs :: "nat list" where
  167.56    "qs == rev ps"
  167.57  
  167.58  subsection {* mutual datatypes *}
   168.1 --- a/src/HOL/ex/Higher_Order_Logic.thy	Fri Nov 17 02:19:55 2006 +0100
   168.2 +++ b/src/HOL/ex/Higher_Order_Logic.thy	Fri Nov 17 02:20:03 2006 +0100
   168.3 @@ -80,21 +80,31 @@
   168.4  subsubsection {* Derived connectives *}
   168.5  
   168.6  definition
   168.7 -  false :: o    ("\<bottom>")
   168.8 +  false :: o  ("\<bottom>") where
   168.9    "\<bottom> \<equiv> \<forall>A. A"
  168.10 -  true :: o    ("\<top>")
  168.11 +
  168.12 +definition
  168.13 +  true :: o  ("\<top>") where
  168.14    "\<top> \<equiv> \<bottom> \<longrightarrow> \<bottom>"
  168.15 -  not :: "o \<Rightarrow> o"     ("\<not> _" [40] 40)
  168.16 +
  168.17 +definition
  168.18 +  not :: "o \<Rightarrow> o"  ("\<not> _" [40] 40) where
  168.19    "not \<equiv> \<lambda>A. A \<longrightarrow> \<bottom>"
  168.20 -  conj :: "o \<Rightarrow> o \<Rightarrow> o"    (infixr "\<and>" 35)
  168.21 +
  168.22 +definition
  168.23 +  conj :: "o \<Rightarrow> o \<Rightarrow> o"  (infixr "\<and>" 35) where
  168.24    "conj \<equiv> \<lambda>A B. \<forall>C. (A \<longrightarrow> B \<longrightarrow> C) \<longrightarrow> C"
  168.25 -  disj :: "o \<Rightarrow> o \<Rightarrow> o"    (infixr "\<or>" 30)
  168.26 +
  168.27 +definition
  168.28 +  disj :: "o \<Rightarrow> o \<Rightarrow> o"  (infixr "\<or>" 30) where
  168.29    "disj \<equiv> \<lambda>A B. \<forall>C. (A \<longrightarrow> C) \<longrightarrow> (B \<longrightarrow> C) \<longrightarrow> C"
  168.30 -  Ex :: "('a \<Rightarrow> o) \<Rightarrow> o"    (binder "\<exists>" 10)
  168.31 +
  168.32 +definition
  168.33 +  Ex :: "('a \<Rightarrow> o) \<Rightarrow> o"  (binder "\<exists>" 10) where
  168.34    "Ex \<equiv> \<lambda>P. \<forall>C. (\<forall>x. P x \<longrightarrow> C) \<longrightarrow> C"
  168.35  
  168.36  abbreviation
  168.37 -  not_equal :: "'a \<Rightarrow> 'a \<Rightarrow> o"    (infixl "\<noteq>" 50)
  168.38 +  not_equal :: "'a \<Rightarrow> 'a \<Rightarrow> o"  (infixl "\<noteq>" 50) where
  168.39    "x \<noteq> y \<equiv> \<not> (x = y)"
  168.40  
  168.41  theorem falseE [elim]: "\<bottom> \<Longrightarrow> A"
   169.1 --- a/src/HOL/ex/InductiveInvariant.thy	Fri Nov 17 02:19:55 2006 +0100
   169.2 +++ b/src/HOL/ex/InductiveInvariant.thy	Fri Nov 17 02:20:03 2006 +0100
   169.3 @@ -15,14 +15,14 @@
   169.4  text "S is an inductive invariant of the functional F with respect to the wellfounded relation r."
   169.5  
   169.6  definition
   169.7 -  indinv :: "('a * 'a) set => ('a => 'b => bool) => (('a => 'b) => ('a => 'b)) => bool"
   169.8 +  indinv :: "('a * 'a) set => ('a => 'b => bool) => (('a => 'b) => ('a => 'b)) => bool" where
   169.9    "indinv r S F = (\<forall>f x. (\<forall>y. (y,x) : r --> S y (f y)) --> S x (F f x))"
  169.10  
  169.11  
  169.12  text "S is an inductive invariant of the functional F on set D with respect to the wellfounded relation r."
  169.13  
  169.14  definition
  169.15 -  indinv_on :: "('a * 'a) set => 'a set => ('a => 'b => bool) => (('a => 'b) => ('a => 'b)) => bool"
  169.16 +  indinv_on :: "('a * 'a) set => 'a set => ('a => 'b => bool) => (('a => 'b) => ('a => 'b)) => bool" where
  169.17    "indinv_on r D S F = (\<forall>f. \<forall>x\<in>D. (\<forall>y\<in>D. (y,x) \<in> r --> S y (f y)) --> S x (F f x))"
  169.18  
  169.19  
   170.1 --- a/src/HOL/ex/Lagrange.thy	Fri Nov 17 02:19:55 2006 +0100
   170.2 +++ b/src/HOL/ex/Lagrange.thy	Fri Nov 17 02:20:03 2006 +0100
   170.3 @@ -17,7 +17,7 @@
   170.4  theorem.  *}
   170.5  
   170.6  definition
   170.7 -  sq :: "'a::times => 'a"
   170.8 +  sq :: "'a::times => 'a" where
   170.9    "sq x == x*x"
  170.10  
  170.11  text {* The following lemma essentially shows that every natural
   171.1 --- a/src/HOL/ex/MonoidGroup.thy	Fri Nov 17 02:19:55 2006 +0100
   171.2 +++ b/src/HOL/ex/MonoidGroup.thy	Fri Nov 17 02:20:03 2006 +0100
   171.3 @@ -15,16 +15,18 @@
   171.4    inv :: "'a => 'a"
   171.5  
   171.6  definition
   171.7 -  monoid :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) => bool"
   171.8 +  monoid :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) => bool" where
   171.9    "monoid M = (\<forall>x y z.
  171.10      times M (times M x y) z = times M x (times M y z) \<and>
  171.11      times M (one M) x = x \<and> times M x (one M) = x)"
  171.12  
  171.13 -  group :: "(| times :: 'a => 'a => 'a, one :: 'a, inv :: 'a => 'a, ... :: 'b |) => bool"
  171.14 +definition
  171.15 +  group :: "(| times :: 'a => 'a => 'a, one :: 'a, inv :: 'a => 'a, ... :: 'b |) => bool" where
  171.16    "group G = (monoid G \<and> (\<forall>x. times G (inv G x) x = one G))"
  171.17  
  171.18 +definition
  171.19    reverse :: "(| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |) =>
  171.20 -    (| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |)"
  171.21 +    (| times :: 'a => 'a => 'a, one :: 'a, ... :: 'b |)" where
  171.22    "reverse M = M (| times := \<lambda>x y. times M y x |)"
  171.23  
  171.24  end
   172.1 --- a/src/HOL/ex/PER.thy	Fri Nov 17 02:19:55 2006 +0100
   172.2 +++ b/src/HOL/ex/PER.thy	Fri Nov 17 02:20:03 2006 +0100
   172.3 @@ -45,7 +45,7 @@
   172.4  *}
   172.5  
   172.6  definition
   172.7 -  "domain" :: "'a::partial_equiv set"
   172.8 +  "domain" :: "'a::partial_equiv set" where
   172.9    "domain = {x. x \<sim> x}"
  172.10  
  172.11  lemma domainI [intro]: "x \<sim> x ==> x \<in> domain"
  172.12 @@ -165,7 +165,7 @@
  172.13  *}
  172.14  
  172.15  definition
  172.16 -  eqv_class :: "('a::partial_equiv) => 'a quot"    ("\<lfloor>_\<rfloor>")
  172.17 +  eqv_class :: "('a::partial_equiv) => 'a quot"    ("\<lfloor>_\<rfloor>") where
  172.18    "\<lfloor>a\<rfloor> = Abs_quot {x. a \<sim> x}"
  172.19  
  172.20  theorem quot_rep: "\<exists>a. A = \<lfloor>a\<rfloor>"
  172.21 @@ -232,7 +232,7 @@
  172.22  subsection {* Picking representing elements *}
  172.23  
  172.24  definition
  172.25 -  pick :: "'a::partial_equiv quot => 'a"
  172.26 +  pick :: "'a::partial_equiv quot => 'a" where
  172.27    "pick A = (SOME a. A = \<lfloor>a\<rfloor>)"
  172.28  
  172.29  theorem pick_eqv' [intro?, simp]: "a \<in> domain ==> pick \<lfloor>a\<rfloor> \<sim> a"
   173.1 --- a/src/HOL/ex/Primrec.thy	Fri Nov 17 02:19:55 2006 +0100
   173.2 +++ b/src/HOL/ex/Primrec.thy	Fri Nov 17 02:20:03 2006 +0100
   173.3 @@ -43,19 +43,23 @@
   173.4  text {* The set of primitive recursive functions of type @{typ "nat list => nat"}. *}
   173.5  
   173.6  definition
   173.7 -  SC :: "nat list => nat"
   173.8 +  SC :: "nat list => nat" where
   173.9    "SC l = Suc (zeroHd l)"
  173.10  
  173.11 -  CONSTANT :: "nat => nat list => nat"
  173.12 +definition
  173.13 +  CONSTANT :: "nat => nat list => nat" where
  173.14    "CONSTANT k l = k"
  173.15  
  173.16 -  PROJ :: "nat => nat list => nat"
  173.17 +definition
  173.18 +  PROJ :: "nat => nat list => nat" where
  173.19    "PROJ i l = zeroHd (drop i l)"
  173.20  
  173.21 -  COMP :: "(nat list => nat) => (nat list => nat) list => nat list => nat"
  173.22 +definition
  173.23 +  COMP :: "(nat list => nat) => (nat list => nat) list => nat list => nat" where
  173.24    "COMP g fs l = g (map (\<lambda>f. f l) fs)"
  173.25  
  173.26 -  PREC :: "(nat list => nat) => (nat list => nat) => nat list => nat"
  173.27 +definition
  173.28 +  PREC :: "(nat list => nat) => (nat list => nat) => nat list => nat" where
  173.29    "PREC f g l =
  173.30      (case l of
  173.31        [] => 0
   174.1 --- a/src/HOL/ex/Records.thy	Fri Nov 17 02:19:55 2006 +0100
   174.2 +++ b/src/HOL/ex/Records.thy	Fri Nov 17 02:20:03 2006 +0100
   174.3 @@ -51,9 +51,11 @@
   174.4  subsubsection {* Record selection and record update *}
   174.5  
   174.6  definition
   174.7 -  getX :: "'a point_scheme => nat"
   174.8 +  getX :: "'a point_scheme => nat" where
   174.9    "getX r = xpos r"
  174.10 -  setX :: "'a point_scheme => nat => 'a point_scheme"
  174.11 +
  174.12 +definition
  174.13 +  setX :: "'a point_scheme => nat => 'a point_scheme" where
  174.14    "setX r n = r (| xpos := n |)"
  174.15  
  174.16  
  174.17 @@ -145,14 +147,14 @@
  174.18  *}
  174.19  
  174.20  definition
  174.21 -  foo5 :: nat
  174.22 +  foo5 :: nat where
  174.23    "foo5 = getX (| xpos = 1, ypos = 0 |)"
  174.24  
  174.25  
  174.26  text {* \medskip Manipulating the ``@{text "..."}'' (more) part. *}
  174.27  
  174.28  definition
  174.29 -  incX :: "'a point_scheme => 'a point_scheme"
  174.30 +  incX :: "'a point_scheme => 'a point_scheme" where
  174.31    "incX r = (| xpos = xpos r + 1, ypos = ypos r, ... = point.more r |)"
  174.32  
  174.33  lemma "incX r = setX r (Suc (getX r))"
  174.34 @@ -162,7 +164,7 @@
  174.35  text {* An alternative definition. *}
  174.36  
  174.37  definition
  174.38 -  incX' :: "'a point_scheme => 'a point_scheme"
  174.39 +  incX' :: "'a point_scheme => 'a point_scheme" where
  174.40    "incX' r = r (| xpos := xpos r + 1 |)"
  174.41  
  174.42  
  174.43 @@ -194,7 +196,7 @@
  174.44  *}
  174.45  
  174.46  definition
  174.47 -  foo10 :: nat
  174.48 +  foo10 :: nat where
  174.49    "foo10 = getX (| xpos = 2, ypos = 0, colour = Blue |)"
  174.50  
  174.51  
  174.52 @@ -206,7 +208,7 @@
  174.53  *}
  174.54  
  174.55  definition
  174.56 -  foo11 :: cpoint
  174.57 +  foo11 :: cpoint where
  174.58    "foo11 = setX (| xpos = 2, ypos = 0, colour = Blue |) 0"
  174.59  
  174.60  
   175.1 --- a/src/HOL/ex/Reflected_Presburger.thy	Fri Nov 17 02:19:55 2006 +0100
   175.2 +++ b/src/HOL/ex/Reflected_Presburger.thy	Fri Nov 17 02:20:03 2006 +0100
   175.3 @@ -530,7 +530,7 @@
   175.4  "islintn (n0, t) = False"
   175.5  
   175.6  definition
   175.7 -  islint :: "intterm \<Rightarrow> bool"
   175.8 +  islint :: "intterm \<Rightarrow> bool" where
   175.9    "islint t = islintn(0,t)"
  175.10  
  175.11  (* And the equivalence to the first definition *)
  175.12 @@ -730,7 +730,7 @@
  175.13  
  175.14  (* lin_neg neagtes a linear term *)
  175.15  definition
  175.16 -  lin_neg :: "intterm \<Rightarrow> intterm"
  175.17 +  lin_neg :: "intterm \<Rightarrow> intterm" where
  175.18    "lin_neg i = lin_mul ((-1::int),i)"
  175.19  
  175.20  (* lin_neg has the semantics of Neg *)
  175.21 @@ -1625,11 +1625,11 @@
  175.22  
  175.23  (* Definitions and lemmas about gcd and lcm *)
  175.24  definition
  175.25 -  lcm :: "nat \<times> nat \<Rightarrow> nat"
  175.26 +  lcm :: "nat \<times> nat \<Rightarrow> nat" where
  175.27    "lcm = (\<lambda>(m,n). m*n div gcd(m,n))"
  175.28  
  175.29  definition
  175.30 -  ilcm :: "int \<Rightarrow> int \<Rightarrow> int"
  175.31 +  ilcm :: "int \<Rightarrow> int \<Rightarrow> int" where
  175.32    "ilcm = (\<lambda>i.\<lambda>j. int (lcm(nat(abs i),nat(abs j))))"
  175.33  
  175.34  (* ilcm_dvd12 are needed later *)
  175.35 @@ -1879,7 +1879,7 @@
  175.36  
  175.37  (* unitycoeff expects a quantifier free formula an transforms it to an equivalent formula where the bound variable occurs only with coeffitient 1  or -1 *)
  175.38  definition
  175.39 -  unitycoeff :: "QF \<Rightarrow> QF"
  175.40 +  unitycoeff :: "QF \<Rightarrow> QF" where
  175.41    "unitycoeff p =
  175.42    (let l = formlcm p;
  175.43         p' = adjustcoeff (l,p)
  175.44 @@ -5091,7 +5091,7 @@
  175.45  
  175.46  (* An implementation of sets trough lists *)
  175.47  definition
  175.48 -  list_insert :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list"
  175.49 +  list_insert :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list" where
  175.50    "list_insert x xs = (if x mem xs then xs else x#xs)"
  175.51  
  175.52  lemma list_insert_set: "set (list_insert x xs) = set (x#xs)"
  175.53 @@ -5368,7 +5368,7 @@
  175.54  (* An implementation of cooper's method for both plus/minus/infinity *)
  175.55  
  175.56  (* unify the formula *)
  175.57 -definition unify:: "QF \<Rightarrow> (QF \<times> intterm list)"
  175.58 +definition unify:: "QF \<Rightarrow> (QF \<times> intterm list)" where
  175.59    "unify p =
  175.60    (let q = unitycoeff p;
  175.61         B = list_set(bset q);
  175.62 @@ -5484,7 +5484,7 @@
  175.63  qed
  175.64  (* An implementation of cooper's method *)
  175.65  definition
  175.66 -  cooper:: "QF \<Rightarrow> QF option"
  175.67 +  cooper:: "QF \<Rightarrow> QF option" where
  175.68    "cooper p = lift_un (\<lambda>q. decrvars(explode_minf (unify q))) (linform (nnf p))"
  175.69  
  175.70  (* cooper eliminates quantifiers *)
  175.71 @@ -5538,7 +5538,7 @@
  175.72  
  175.73  (* A decision procedure for Presburger Arithmetics *)
  175.74  definition
  175.75 -  pa:: "QF \<Rightarrow> QF option"
  175.76 +  pa:: "QF \<Rightarrow> QF option" where
  175.77    "pa p \<equiv> lift_un psimpl (qelim(cooper, p))"
  175.78  
  175.79  lemma psimpl_qfree: "isqfree p \<Longrightarrow> isqfree (psimpl p)"
   176.1 --- a/src/HOL/ex/Sorting.thy	Fri Nov 17 02:19:55 2006 +0100
   176.2 +++ b/src/HOL/ex/Sorting.thy	Fri Nov 17 02:20:03 2006 +0100
   176.3 @@ -25,10 +25,11 @@
   176.4  
   176.5  
   176.6  definition
   176.7 -  total  :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool"
   176.8 +  total  :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool" where
   176.9     "total r = (\<forall>x y. r x y | r y x)"
  176.10    
  176.11 -  transf :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool"
  176.12 +definition
  176.13 +  transf :: "('a \<Rightarrow> 'a \<Rightarrow> bool) => bool" where
  176.14     "transf f = (\<forall>x y z. f x y & f y z --> f x z)"
  176.15  
  176.16  
   177.1 --- a/src/HOL/ex/Tarski.thy	Fri Nov 17 02:19:55 2006 +0100
   177.2 +++ b/src/HOL/ex/Tarski.thy	Fri Nov 17 02:20:03 2006 +0100
   177.3 @@ -21,75 +21,88 @@
   177.4    order :: "('a * 'a) set"
   177.5  
   177.6  definition
   177.7 -  monotone :: "['a => 'a, 'a set, ('a *'a)set] => bool"
   177.8 +  monotone :: "['a => 'a, 'a set, ('a *'a)set] => bool" where
   177.9    "monotone f A r = (\<forall>x\<in>A. \<forall>y\<in>A. (x, y): r --> ((f x), (f y)) : r)"
  177.10  
  177.11 -  least :: "['a => bool, 'a potype] => 'a"
  177.12 +definition
  177.13 +  least :: "['a => bool, 'a potype] => 'a" where
  177.14    "least P po = (SOME x. x: pset po & P x &
  177.15                         (\<forall>y \<in> pset po. P y --> (x,y): order po))"
  177.16  
  177.17 -  greatest :: "['a => bool, 'a potype] => 'a"
  177.18 +definition
  177.19 +  greatest :: "['a => bool, 'a potype] => 'a" where
  177.20    "greatest P po = (SOME x. x: pset po & P x &
  177.21                            (\<forall>y \<in> pset po. P y --> (y,x): order po))"
  177.22  
  177.23 -  lub  :: "['a set, 'a potype] => 'a"
  177.24 +definition
  177.25 +  lub  :: "['a set, 'a potype] => 'a" where
  177.26    "lub S po = least (%x. \<forall>y\<in>S. (y,x): order po) po"
  177.27  
  177.28 -  glb  :: "['a set, 'a potype] => 'a"
  177.29 +definition
  177.30 +  glb  :: "['a set, 'a potype] => 'a" where
  177.31    "glb S po = greatest (%x. \<forall>y\<in>S. (x,y): order po) po"
  177.32  
  177.33 -  isLub :: "['a set, 'a potype, 'a] => bool"
  177.34 +definition
  177.35 +  isLub :: "['a set, 'a potype, 'a] => bool" where
  177.36    "isLub S po = (%L. (L: pset po & (\<forall>y\<in>S. (y,L): order po) &
  177.37                     (\<forall>z\<in>pset po. (\<forall>y\<in>S. (y,z): order po) --> (L,z): order po)))"
  177.38  
  177.39 -  isGlb :: "['a set, 'a potype, 'a] => bool"
  177.40 +definition
  177.41 +  isGlb :: "['a set, 'a potype, 'a] => bool" where
  177.42    "isGlb S po = (%G. (G: pset po & (\<forall>y\<in>S. (G,y): order po) &
  177.43                   (\<forall>z \<in> pset po. (\<forall>y\<in>S. (z,y): order po) --> (z,G): order po)))"
  177.44  
  177.45 -  "fix"    :: "[('a => 'a), 'a set] => 'a set"
  177.46 +definition
  177.47 +  "fix"    :: "[('a => 'a), 'a set] => 'a set" where
  177.48    "fix f A  = {x. x: A & f x = x}"
  177.49  
  177.50 -  interval :: "[('a*'a) set,'a, 'a ] => 'a set"
  177.51 +definition
  177.52 +  interval :: "[('a*'a) set,'a, 'a ] => 'a set" where
  177.53    "interval r a b = {x. (a,x): r & (x,b): r}"
  177.54  
  177.55  
  177.56  definition
  177.57 -  Bot :: "'a potype => 'a"
  177.58 +  Bot :: "'a potype => 'a" where
  177.59    "Bot po = least (%x. True) po"
  177.60  
  177.61 -  Top :: "'a potype => 'a"
  177.62 +definition
  177.63 +  Top :: "'a potype => 'a" where
  177.64    "Top po = greatest (%x. True) po"
  177.65  
  177.66 -  PartialOrder :: "('a potype) set"
  177.67 +definition
  177.68 +  PartialOrder :: "('a potype) set" where
  177.69    "PartialOrder = {P. refl (pset P) (order P) & antisym (order P) &
  177.70                         trans (order P)}"
  177.71  
  177.72 -  CompleteLattice :: "('a potype) set"
  177.73 +definition
  177.74 +  CompleteLattice :: "('a potype) set" where
  177.75    "CompleteLattice = {cl. cl: PartialOrder &
  177.76                          (\<forall>S. S \<subseteq> pset cl --> (\<exists>L. isLub S cl L)) &
  177.77                          (\<forall>S. S \<subseteq> pset cl --> (\<exists>G. isGlb S cl G))}"
  177.78  
  177.79 -  CLF :: "('a potype * ('a => 'a)) set"
  177.80 +definition
  177.81 +  CLF :: "('a potype * ('a => 'a)) set" where
  177.82    "CLF = (SIGMA cl: CompleteLattice.
  177.83              {f. f: pset cl -> pset cl & monotone f (pset cl) (order cl)})"
  177.84  
  177.85 -  induced :: "['a set, ('a * 'a) set] => ('a *'a)set"
  177.86 +definition
  177.87 +  induced :: "['a set, ('a * 'a) set] => ('a *'a)set" where
  177.88    "induced A r = {(a,b). a : A & b: A & (a,b): r}"
  177.89  
  177.90  
  177.91  definition
  177.92 -  sublattice :: "('a potype * 'a set)set"
  177.93 +  sublattice :: "('a potype * 'a set)set" where
  177.94    "sublattice =
  177.95        (SIGMA cl: CompleteLattice.
  177.96            {S. S \<subseteq> pset cl &
  177.97             (| pset = S, order = induced S (order cl) |): CompleteLattice})"
  177.98  
  177.99  abbreviation
 177.100 -  sublat :: "['a set, 'a potype] => bool"  ("_ <<= _" [51,50]50)
 177.101 +  sublat :: "['a set, 'a potype] => bool"  ("_ <<= _" [51,50]50) where
 177.102    "S <<= cl == S : sublattice `` {cl}"
 177.103  
 177.104  definition
 177.105 -  dual :: "'a potype => 'a potype"
 177.106 +  dual :: "'a potype => 'a potype" where
 177.107    "dual po = (| pset = pset po, order = converse (order po) |)"
 177.108  
 177.109  locale (open) PO =
   178.1 --- a/src/HOL/ex/ThreeDivides.thy	Fri Nov 17 02:19:55 2006 +0100
   178.2 +++ b/src/HOL/ex/ThreeDivides.thy	Fri Nov 17 02:20:03 2006 +0100
   178.3 @@ -156,7 +156,7 @@
   178.4  some number n. *}
   178.5  
   178.6  definition
   178.7 -  sumdig :: "nat \<Rightarrow> nat"
   178.8 +  sumdig :: "nat \<Rightarrow> nat" where
   178.9    "sumdig n = (\<Sum>x < nlen n. n div 10^x mod 10)"
  178.10  
  178.11  text {* Some properties of these functions follow. *}
   179.1 --- a/src/HOLCF/FOCUS/Buffer.thy	Fri Nov 17 02:19:55 2006 +0100
   179.2 +++ b/src/HOLCF/FOCUS/Buffer.thy	Fri Nov 17 02:20:03 2006 +0100
   179.3 @@ -42,47 +42,56 @@
   179.4    SPECS11       = "SPSF11 set"
   179.5  
   179.6  definition
   179.7 -
   179.8 -  BufEq_F       :: "SPEC11 \<Rightarrow> SPEC11"
   179.9 +  BufEq_F       :: "SPEC11 \<Rightarrow> SPEC11" where
  179.10    "BufEq_F B = {f. \<forall>d. f\<cdot>(Md d\<leadsto><>) = <> \<and>
  179.11                  (\<forall>x. \<exists>ff\<in>B. f\<cdot>(Md d\<leadsto>\<bullet>\<leadsto>x) = d\<leadsto>ff\<cdot>x)}"
  179.12  
  179.13 -  BufEq         :: "SPEC11"
  179.14 +definition
  179.15 +  BufEq         :: "SPEC11" where
  179.16    "BufEq = gfp BufEq_F"
  179.17  
  179.18 -  BufEq_alt     :: "SPEC11"
  179.19 +definition
  179.20 +  BufEq_alt     :: "SPEC11" where
  179.21    "BufEq_alt = gfp (\<lambda>B. {f. \<forall>d. f\<cdot>(Md d\<leadsto><> ) = <> \<and>
  179.22                           (\<exists>ff\<in>B. (\<forall>x. f\<cdot>(Md d\<leadsto>\<bullet>\<leadsto>x) = d\<leadsto>ff\<cdot>x))})"
  179.23  
  179.24 -  BufAC_Asm_F   :: " (M fstream set) \<Rightarrow> (M fstream set)"
  179.25 +definition
  179.26 +  BufAC_Asm_F   :: " (M fstream set) \<Rightarrow> (M fstream set)" where
  179.27    "BufAC_Asm_F A = {s. s = <> \<or>
  179.28                    (\<exists>d x. s = Md d\<leadsto>x \<and> (x = <> \<or> (ft\<cdot>x = Def \<bullet> \<and> (rt\<cdot>x)\<in>A)))}"
  179.29  
  179.30 -  BufAC_Asm     :: " (M fstream set)"
  179.31 +definition
  179.32 +  BufAC_Asm     :: " (M fstream set)" where
  179.33    "BufAC_Asm = gfp BufAC_Asm_F"
  179.34  
  179.35 +definition
  179.36    BufAC_Cmt_F   :: "((M fstream * D fstream) set) \<Rightarrow>
  179.37 -                    ((M fstream * D fstream) set)"
  179.38 +                    ((M fstream * D fstream) set)" where
  179.39    "BufAC_Cmt_F C = {(s,t). \<forall>d x.
  179.40                             (s = <>         \<longrightarrow>     t = <>                 ) \<and>
  179.41                             (s = Md d\<leadsto><>   \<longrightarrow>     t = <>                 ) \<and>
  179.42                             (s = Md d\<leadsto>\<bullet>\<leadsto>x \<longrightarrow> (ft\<cdot>t = Def d \<and> (x,rt\<cdot>t)\<in>C))}"
  179.43  
  179.44 -  BufAC_Cmt     :: "((M fstream * D fstream) set)"
  179.45 +definition
  179.46 +  BufAC_Cmt     :: "((M fstream * D fstream) set)" where
  179.47    "BufAC_Cmt = gfp BufAC_Cmt_F"
  179.48  
  179.49 -  BufAC         :: "SPEC11"
  179.50 +definition
  179.51 +  BufAC         :: "SPEC11" where
  179.52    "BufAC = {f. \<forall>x. x\<in>BufAC_Asm \<longrightarrow> (x,f\<cdot>x)\<in>BufAC_Cmt}"
  179.53  
  179.54 -  BufSt_F       :: "SPECS11 \<Rightarrow> SPECS11"
  179.55 +definition
  179.56 +  BufSt_F       :: "SPECS11 \<Rightarrow> SPECS11" where
  179.57    "BufSt_F H = {h. \<forall>s  . h s      \<cdot><>        = <>         \<and>
  179.58                                   (\<forall>d x. h \<currency>     \<cdot>(Md d\<leadsto>x) = h (Sd d)\<cdot>x \<and>
  179.59                                  (\<exists>hh\<in>H. h (Sd d)\<cdot>(\<bullet>   \<leadsto>x) = d\<leadsto>(hh \<currency>\<cdot>x)))}"
  179.60  
  179.61 -  BufSt_P       :: "SPECS11"
  179.62 +definition
  179.63 +  BufSt_P       :: "SPECS11" where
  179.64    "BufSt_P = gfp BufSt_F"
  179.65  
  179.66 -  BufSt         :: "SPEC11"
  179.67 +definition
  179.68 +  BufSt         :: "SPEC11" where
  179.69    "BufSt = {f. \<exists>h\<in>BufSt_P. f = h \<currency>}"
  179.70  
  179.71  
   180.1 --- a/src/HOLCF/FOCUS/Fstream.thy	Fri Nov 17 02:19:55 2006 +0100
   180.2 +++ b/src/HOLCF/FOCUS/Fstream.thy	Fri Nov 17 02:20:03 2006 +0100
   180.3 @@ -17,24 +17,27 @@
   180.4  types 'a fstream = "'a lift stream"
   180.5  
   180.6  definition
   180.7 -  fscons        :: "'a     \<Rightarrow> 'a fstream \<rightarrow> 'a fstream"
   180.8 +  fscons        :: "'a     \<Rightarrow> 'a fstream \<rightarrow> 'a fstream" where
   180.9    "fscons a = (\<Lambda> s. Def a && s)"
  180.10  
  180.11 -  fsfilter      :: "'a set \<Rightarrow> 'a fstream \<rightarrow> 'a fstream"
  180.12 +definition
  180.13 +  fsfilter      :: "'a set \<Rightarrow> 'a fstream \<rightarrow> 'a fstream" where
  180.14    "fsfilter A = (sfilter\<cdot>(flift2 (\<lambda>x. x\<in>A)))"
  180.15  
  180.16  abbreviation
  180.17 -  emptystream   :: "'a fstream"                          ("<>")
  180.18 +  emptystream   :: "'a fstream"                          ("<>") where
  180.19    "<> == \<bottom>"
  180.20  
  180.21 -  fscons'       :: "'a \<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"       ("(_~>_)"    [66,65] 65)
  180.22 +abbreviation
  180.23 +  fscons'       :: "'a \<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"       ("(_~>_)"    [66,65] 65) where
  180.24    "a~>s == fscons a\<cdot>s"
  180.25  
  180.26 -  fsfilter'     :: "'a set \<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"   ("(_'(C')_)" [64,63] 63)
  180.27 +abbreviation
  180.28 +  fsfilter'     :: "'a set \<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"   ("(_'(C')_)" [64,63] 63) where
  180.29    "A(C)s == fsfilter A\<cdot>s"
  180.30  
  180.31  notation (xsymbols)
  180.32 -  fscons'  ("(_\<leadsto>_)"                                                 [66,65] 65)
  180.33 +  fscons'  ("(_\<leadsto>_)"                                                 [66,65] 65) and
  180.34    fsfilter'  ("(_\<copyright>_)"                                               [64,63] 63)
  180.35  
  180.36  
   181.1 --- a/src/HOLCF/FOCUS/Fstreams.thy	Fri Nov 17 02:19:55 2006 +0100
   181.2 +++ b/src/HOLCF/FOCUS/Fstreams.thy	Fri Nov 17 02:20:03 2006 +0100
   181.3 @@ -13,30 +13,37 @@
   181.4  types 'a fstream = "('a lift) stream"
   181.5  
   181.6  definition
   181.7 -  fsingleton    :: "'a => 'a fstream"  ("<_>" [1000] 999)
   181.8 +  fsingleton    :: "'a => 'a fstream"  ("<_>" [1000] 999) where
   181.9    fsingleton_def2: "fsingleton = (%a. Def a && UU)"
  181.10  
  181.11 -  fsfilter      :: "'a set \<Rightarrow> 'a fstream \<rightarrow> 'a fstream"
  181.12 +definition
  181.13 +  fsfilter      :: "'a set \<Rightarrow> 'a fstream \<rightarrow> 'a fstream" where
  181.14    "fsfilter A = sfilter\<cdot>(flift2 (\<lambda>x. x\<in>A))"
  181.15  
  181.16 -  fsmap		:: "('a => 'b) => 'a fstream -> 'b fstream"
  181.17 +definition
  181.18 +  fsmap		:: "('a => 'b) => 'a fstream -> 'b fstream" where
  181.19    "fsmap f = smap$(flift2 f)"
  181.20  
  181.21 -  jth           :: "nat => 'a fstream => 'a"
  181.22 +definition
  181.23 +  jth           :: "nat => 'a fstream => 'a" where
  181.24    "jth = (%n s. if Fin n < #s then THE a. i_th n s = Def a else arbitrary)"
  181.25  
  181.26 -  first         :: "'a fstream => 'a"
  181.27 +definition
  181.28 +  first         :: "'a fstream => 'a" where
  181.29    "first = (%s. jth 0 s)"
  181.30  
  181.31 -  last          :: "'a fstream => 'a"
  181.32 +definition
  181.33 +  last          :: "'a fstream => 'a" where
  181.34    "last = (%s. case #s of Fin n => (if n~=0 then jth (THE k. Suc k = n) s else arbitrary)
  181.35                | Infty => arbitrary)"
  181.36  
  181.37  
  181.38  abbreviation
  181.39 -  emptystream :: "'a fstream" 			("<>")
  181.40 +  emptystream :: "'a fstream"  ("<>") where
  181.41    "<> == \<bottom>"
  181.42 -  fsfilter' :: "'a set \<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"	("(_'(C')_)" [64,63] 63)
  181.43 +
  181.44 +abbreviation
  181.45 +  fsfilter' :: "'a set \<Rightarrow> 'a fstream \<Rightarrow> 'a fstream"	("(_'(C')_)" [64,63] 63) where
  181.46    "A(C)s == fsfilter A\<cdot>s"
  181.47  
  181.48  notation (xsymbols)
   182.1 --- a/src/HOLCF/FOCUS/Stream_adm.thy	Fri Nov 17 02:19:55 2006 +0100
   182.2 +++ b/src/HOLCF/FOCUS/Stream_adm.thy	Fri Nov 17 02:20:03 2006 +0100
   182.3 @@ -10,18 +10,19 @@
   182.4  begin
   182.5  
   182.6  definition
   182.7 -
   182.8 -  stream_monoP  :: "(('a stream) set \<Rightarrow> ('a stream) set) \<Rightarrow> bool"
   182.9 +  stream_monoP  :: "(('a stream) set \<Rightarrow> ('a stream) set) \<Rightarrow> bool" where
  182.10    "stream_monoP F = (\<exists>Q i. \<forall>P s. Fin i \<le> #s \<longrightarrow>
  182.11                      (s \<in> F P) = (stream_take i\<cdot>s \<in> Q \<and> iterate i\<cdot>rt\<cdot>s \<in> P))"
  182.12  
  182.13 -  stream_antiP  :: "(('a stream) set \<Rightarrow> ('a stream) set) \<Rightarrow> bool"
  182.14 +definition
  182.15 +  stream_antiP  :: "(('a stream) set \<Rightarrow> ('a stream) set) \<Rightarrow> bool" where
  182.16    "stream_antiP F = (\<forall>P x. \<exists>Q i.
  182.17                  (#x  < Fin i \<longrightarrow> (\<forall>y. x \<sqsubseteq> y \<longrightarrow> y \<in> F P \<longrightarrow> x \<in> F P)) \<and>
  182.18                  (Fin i <= #x \<longrightarrow> (\<forall>y. x \<sqsubseteq> y \<longrightarrow>
  182.19                  (y \<in> F P) = (stream_take i\<cdot>y \<in> Q \<and> iterate i\<cdot>rt\<cdot>y \<in> P))))"
  182.20  
  182.21 -  antitonP :: "'a set => bool"
  182.22 +definition
  182.23 +  antitonP :: "'a set => bool" where
  182.24    "antitonP P = (\<forall>x y. x \<sqsubseteq> y \<longrightarrow> y\<in>P \<longrightarrow> x\<in>P)"
  182.25  
  182.26  
   183.1 --- a/src/HOLCF/IMP/Denotational.thy	Fri Nov 17 02:19:55 2006 +0100
   183.2 +++ b/src/HOLCF/IMP/Denotational.thy	Fri Nov 17 02:20:03 2006 +0100
   183.3 @@ -11,7 +11,7 @@
   183.4  subsection "Definition"
   183.5  
   183.6  definition
   183.7 -  dlift :: "(('a::type) discr -> 'b::pcpo) => ('a lift -> 'b)"
   183.8 +  dlift :: "(('a::type) discr -> 'b::pcpo) => ('a lift -> 'b)" where
   183.9    "dlift f = (LAM x. case x of UU => UU | Def y => f\<cdot>(Discr y))"
  183.10  
  183.11  consts D :: "com => state discr -> state lift"
   184.1 --- a/src/HOLCF/IMP/HoareEx.thy	Fri Nov 17 02:19:55 2006 +0100
   184.2 +++ b/src/HOLCF/IMP/HoareEx.thy	Fri Nov 17 02:20:03 2006 +0100
   184.3 @@ -17,7 +17,7 @@
   184.4  types assn = "state => bool"
   184.5  
   184.6  definition
   184.7 -  hoare_valid :: "[assn, com, assn] => bool"    ("|= {(1_)}/ (_)/ {(1_)}" 50)
   184.8 +  hoare_valid :: "[assn, com, assn] => bool"  ("|= {(1_)}/ (_)/ {(1_)}" 50) where
   184.9    "|= {A} c {B} = (\<forall>s t. A s \<and> D c $(Discr s) = Def t --> B t)"
  184.10  
  184.11  lemma WHILE_rule_sound:
   185.1 --- a/src/HOLCF/ex/Dagstuhl.thy	Fri Nov 17 02:19:55 2006 +0100
   185.2 +++ b/src/HOLCF/ex/Dagstuhl.thy	Fri Nov 17 02:20:03 2006 +0100
   185.3 @@ -8,9 +8,11 @@
   185.4    y  :: "'a"
   185.5  
   185.6  definition
   185.7 -  YS :: "'a stream"
   185.8 +  YS :: "'a stream" where
   185.9    "YS = fix$(LAM x. y && x)"
  185.10 -  YYS :: "'a stream"
  185.11 +
  185.12 +definition
  185.13 +  YYS :: "'a stream" where
  185.14    "YYS = fix$(LAM z. y && y && z)"
  185.15  
  185.16  lemma YS_def2: "YS = y && YS"
   186.1 --- a/src/HOLCF/ex/Dnat.thy	Fri Nov 17 02:19:55 2006 +0100
   186.2 +++ b/src/HOLCF/ex/Dnat.thy	Fri Nov 17 02:20:03 2006 +0100
   186.3 @@ -10,7 +10,7 @@
   186.4  domain dnat = dzero | dsucc (dpred :: dnat)
   186.5  
   186.6  definition
   186.7 -  iterator :: "dnat -> ('a -> 'a) -> 'a -> 'a"
   186.8 +  iterator :: "dnat -> ('a -> 'a) -> 'a -> 'a" where
   186.9    "iterator = fix $ (LAM h n f x.
  186.10      case n of dzero => x
  186.11        | dsucc $ m => f $ (h $ m $ f $ x))"
   187.1 --- a/src/HOLCF/ex/Focus_ex.thy	Fri Nov 17 02:19:55 2006 +0100
   187.2 +++ b/src/HOLCF/ex/Focus_ex.thy	Fri Nov 17 02:20:03 2006 +0100
   187.3 @@ -111,19 +111,22 @@
   187.4    Rf :: "('b stream * ('b,'c) tc stream * 'c stream * ('b,'c) tc stream) => bool"
   187.5  
   187.6  definition
   187.7 -  is_f :: "('b stream * ('b,'c) tc stream -> 'c stream * ('b,'c) tc stream) => bool"
   187.8 +  is_f :: "('b stream * ('b,'c) tc stream -> 'c stream * ('b,'c) tc stream) => bool" where
   187.9    "is_f f = (!i1 i2 o1 o2. f$<i1,i2> = <o1,o2> --> Rf(i1,i2,o1,o2))"
  187.10  
  187.11 +definition
  187.12    is_net_g :: "('b stream *('b,'c) tc stream -> 'c stream * ('b,'c) tc stream) =>
  187.13 -    'b stream => 'c stream => bool"
  187.14 +    'b stream => 'c stream => bool" where
  187.15    "is_net_g f x y == (? z.
  187.16                          <y,z> = f$<x,z> &
  187.17                          (!oy hz. <oy,hz> = f$<x,hz> --> z << hz))"
  187.18  
  187.19 -  is_g :: "('b stream -> 'c stream) => bool"
  187.20 +definition
  187.21 +  is_g :: "('b stream -> 'c stream) => bool" where
  187.22    "is_g g  == (? f. is_f f  & (!x y. g$x = y --> is_net_g f x y))"
  187.23  
  187.24 -  def_g :: "('b stream -> 'c stream) => bool"
  187.25 +definition
  187.26 +  def_g :: "('b stream -> 'c stream) => bool" where
  187.27    "def_g g == (? f. is_f f  & g = (LAM x. cfst$(f$<x,fix$(LAM  k. csnd$(f$<x,k>))>)))"
  187.28  
  187.29  
   188.1 --- a/src/HOLCF/ex/Hoare.thy	Fri Nov 17 02:19:55 2006 +0100
   188.2 +++ b/src/HOLCF/ex/Hoare.thy	Fri Nov 17 02:20:03 2006 +0100
   188.3 @@ -30,10 +30,11 @@
   188.4    g :: "'a -> 'a"
   188.5  
   188.6  definition
   188.7 -  p :: "'a -> 'a"
   188.8 +  p :: "'a -> 'a" where
   188.9    "p = fix$(LAM f. LAM x. If b1$x then f$(g$x) else x fi)"
  188.10  
  188.11 -  q :: "'a -> 'a"
  188.12 +definition
  188.13 +  q :: "'a -> 'a" where
  188.14    "q = fix$(LAM f. LAM x. If b1$x orelse b2$x then f$(g$x) else x fi)"
  188.15  
  188.16  
   189.1 --- a/src/HOLCF/ex/Loop.thy	Fri Nov 17 02:19:55 2006 +0100
   189.2 +++ b/src/HOLCF/ex/Loop.thy	Fri Nov 17 02:20:03 2006 +0100
   189.3 @@ -10,10 +10,11 @@
   189.4  begin
   189.5  
   189.6  definition
   189.7 -  step  :: "('a -> tr)->('a -> 'a)->'a->'a"
   189.8 +  step  :: "('a -> tr)->('a -> 'a)->'a->'a" where
   189.9    "step = (LAM b g x. If b$x then g$x else x fi)"
  189.10  
  189.11 -  while :: "('a -> tr)->('a -> 'a)->'a->'a"
  189.12 +definition
  189.13 +  while :: "('a -> tr)->('a -> 'a)->'a->'a" where
  189.14    "while = (LAM b g. fix$(LAM f x. If b$x then f$(g$x) else x fi))"
  189.15  
  189.16  (* ------------------------------------------------------------------------- *)
   190.1 --- a/src/HOLCF/ex/Stream.thy	Fri Nov 17 02:19:55 2006 +0100
   190.2 +++ b/src/HOLCF/ex/Stream.thy	Fri Nov 17 02:20:03 2006 +0100
   190.3 @@ -12,27 +12,31 @@
   190.4  domain 'a stream = "&&" (ft::'a) (lazy rt::"'a stream") (infixr 65)
   190.5  
   190.6  definition
   190.7 -  smap          :: "('a \<rightarrow> 'b) \<rightarrow> 'a stream \<rightarrow> 'b stream"
   190.8 +  smap :: "('a \<rightarrow> 'b) \<rightarrow> 'a stream \<rightarrow> 'b stream" where
   190.9    "smap = fix\<cdot>(\<Lambda> h f s. case s of x && xs \<Rightarrow> f\<cdot>x && h\<cdot>f\<cdot>xs)"
  190.10  
  190.11 -  sfilter       :: "('a \<rightarrow> tr) \<rightarrow> 'a stream \<rightarrow> 'a stream"
  190.12 +definition
  190.13 +  sfilter :: "('a \<rightarrow> tr) \<rightarrow> 'a stream \<rightarrow> 'a stream" where
  190.14    "sfilter = fix\<cdot>(\<Lambda> h p s. case s of x && xs \<Rightarrow>
  190.15                                       If p\<cdot>x then x && h\<cdot>p\<cdot>xs else h\<cdot>p\<cdot>xs fi)"
  190.16  
  190.17 -  slen          :: "'a stream \<Rightarrow> inat"                   ("#_" [1000] 1000)
  190.18 +definition
  190.19 +  slen :: "'a stream \<Rightarrow> inat"  ("#_" [1000] 1000) where
  190.20    "#s = (if stream_finite s then Fin (LEAST n. stream_take n\<cdot>s = s) else \<infinity>)"
  190.21  
  190.22  
  190.23  (* concatenation *)
  190.24  
  190.25  definition
  190.26 -  i_rt :: "nat => 'a stream => 'a stream" (* chops the first i elements *)
  190.27 +  i_rt :: "nat => 'a stream => 'a stream" where (* chops the first i elements *)
  190.28    "i_rt = (%i s. iterate i$rt$s)"
  190.29  
  190.30 -  i_th :: "nat => 'a stream => 'a"        (* the i-th element *)
  190.31 +definition
  190.32 +  i_th :: "nat => 'a stream => 'a" where (* the i-th element *)
  190.33    "i_th = (%i s. ft$(i_rt i s))"
  190.34  
  190.35 -  sconc         :: "'a stream => 'a stream => 'a stream" (infixr "ooo" 65)
  190.36 +definition
  190.37 +  sconc :: "'a stream => 'a stream => 'a stream"  (infixr "ooo" 65) where
  190.38    "s1 ooo s2 = (case #s1 of
  190.39                    Fin n \<Rightarrow> (SOME s. (stream_take n$s=s1) & (i_rt n s = s2))
  190.40                 | \<infinity>     \<Rightarrow> s1)"
  190.41 @@ -45,7 +49,7 @@
  190.42                                                      constr_sconc' n (rt$s1) s2"
  190.43  
  190.44  definition
  190.45 -  constr_sconc  :: "'a stream => 'a stream => 'a stream" (* constructive *)
  190.46 +  constr_sconc  :: "'a stream => 'a stream => 'a stream" where (* constructive *)
  190.47    "constr_sconc s1 s2 = (case #s1 of
  190.48                            Fin n \<Rightarrow> constr_sconc' n s1 s2
  190.49                          | \<infinity>    \<Rightarrow> s1)"
   191.1 --- a/src/ZF/Constructible/AC_in_L.thy	Fri Nov 17 02:19:55 2006 +0100
   191.2 +++ b/src/ZF/Constructible/AC_in_L.thy	Fri Nov 17 02:20:03 2006 +0100
   191.3 @@ -223,18 +223,20 @@
   191.4  "DPow(A)"}, we take the minimum such ordinal.*}
   191.5  
   191.6  definition
   191.7 -  env_form_r :: "[i,i,i]=>i"
   191.8 +  env_form_r :: "[i,i,i]=>i" where
   191.9      --{*wellordering on (environment, formula) pairs*}
  191.10     "env_form_r(f,r,A) ==
  191.11        rmult(list(A), rlist(A, r),
  191.12  	    formula, measure(formula, enum(f)))"
  191.13  
  191.14 -  env_form_map :: "[i,i,i,i]=>i"
  191.15 +definition
  191.16 +  env_form_map :: "[i,i,i,i]=>i" where
  191.17      --{*map from (environment, formula) pairs to ordinals*}
  191.18     "env_form_map(f,r,A,z)
  191.19        == ordermap(list(A) * formula, env_form_r(f,r,A)) ` z"
  191.20  
  191.21 -  DPow_ord :: "[i,i,i,i,i]=>o"
  191.22 +definition
  191.23 +  DPow_ord :: "[i,i,i,i,i]=>o" where
  191.24      --{*predicate that holds if @{term k} is a valid index for @{term X}*}
  191.25     "DPow_ord(f,r,A,X,k) ==
  191.26             \<exists>env \<in> list(A). \<exists>p \<in> formula.
  191.27 @@ -242,11 +244,13 @@
  191.28               X = {x\<in>A. sats(A, p, Cons(x,env))} &
  191.29               env_form_map(f,r,A,<env,p>) = k"
  191.30  
  191.31 -  DPow_least :: "[i,i,i,i]=>i"
  191.32 +definition
  191.33 +  DPow_least :: "[i,i,i,i]=>i" where
  191.34      --{*function yielding the smallest index for @{term X}*}
  191.35     "DPow_least(f,r,A,X) == \<mu> k. DPow_ord(f,r,A,X,k)"
  191.36  
  191.37 -  DPow_r :: "[i,i,i]=>i"
  191.38 +definition
  191.39 +  DPow_r :: "[i,i,i]=>i" where
  191.40      --{*a wellordering on @{term "DPow(A)"}*}
  191.41     "DPow_r(f,r,A) == measure(DPow(A), DPow_least(f,r,A))"
  191.42  
  191.43 @@ -318,7 +322,7 @@
  191.44  of wellorderings for smaller ordinals.*}
  191.45  
  191.46  definition
  191.47 -  rlimit :: "[i,i=>i]=>i"
  191.48 +  rlimit :: "[i,i=>i]=>i" where
  191.49    --{*Expresses the wellordering at limit ordinals.  The conditional
  191.50        lets us remove the premise @{term "Limit(i)"} from some theorems.*}
  191.51      "rlimit(i,r) ==
  191.52 @@ -329,7 +333,8 @@
  191.53  		  (lrank(x') = lrank(x) & <x',x> \<in> r(succ(lrank(x)))))}
  191.54         else 0"
  191.55  
  191.56 -  Lset_new :: "i=>i"
  191.57 +definition
  191.58 +  Lset_new :: "i=>i" where
  191.59    --{*This constant denotes the set of elements introduced at level
  191.60        @{term "succ(i)"}*}
  191.61      "Lset_new(i) == {x \<in> Lset(succ(i)). lrank(x) = i}"
  191.62 @@ -401,7 +406,7 @@
  191.63  subsection{*Transfinite Definition of the Wellordering on @{term "L"}*}
  191.64  
  191.65  definition
  191.66 - L_r :: "[i, i] => i"
  191.67 +  L_r :: "[i, i] => i" where
  191.68    "L_r(f) == %i.
  191.69        transrec3(i, 0, \<lambda>x r. DPow_r(f, r, Lset(x)), 
  191.70                  \<lambda>x r. rlimit(x, \<lambda>y. r`y))"
   192.1 --- a/src/ZF/Constructible/DPow_absolute.thy	Fri Nov 17 02:19:55 2006 +0100
   192.2 +++ b/src/ZF/Constructible/DPow_absolute.thy	Fri Nov 17 02:20:03 2006 +0100
   192.3 @@ -23,7 +23,8 @@
   192.4               successor(M,dp,i) & fun_apply(M,f,p,z) & is_transrec(M,MH,i,f)"
   192.5  *)
   192.6  
   192.7 -definition formula_rec_fm :: "[i, i, i]=>i"
   192.8 +definition
   192.9 +  formula_rec_fm :: "[i, i, i]=>i" where
  192.10   "formula_rec_fm(mh,p,z) == 
  192.11      Exists(Exists(Exists(
  192.12        And(finite_ordinal_fm(2),
  192.13 @@ -80,7 +81,8 @@
  192.14  subsubsection{*The Operator @{term is_satisfies}*}
  192.15  
  192.16  (* is_satisfies(M,A,p,z) == is_formula_rec (M, satisfies_MH(M,A), p, z) *)
  192.17 -definition satisfies_fm :: "[i,i,i]=>i"
  192.18 +definition
  192.19 +  satisfies_fm :: "[i,i,i]=>i" where
  192.20      "satisfies_fm(x) == formula_rec_fm (satisfies_MH_fm(x#+5#+6, 2, 1, 0))"
  192.21  
  192.22  lemma is_satisfies_type [TC]:
  192.23 @@ -120,7 +122,7 @@
  192.24  text{*Relativize the use of @{term sats} within @{term DPow'}
  192.25  (the comprehension).*}
  192.26  definition
  192.27 -  is_DPow_sats :: "[i=>o,i,i,i,i] => o"
  192.28 +  is_DPow_sats :: "[i=>o,i,i,i,i] => o" where
  192.29     "is_DPow_sats(M,A,env,p,x) ==
  192.30        \<forall>n1[M]. \<forall>e[M]. \<forall>sp[M]. 
  192.31               is_satisfies(M,A,p,sp) --> is_Cons(M,x,env,e) --> 
  192.32 @@ -148,8 +150,9 @@
  192.33               is_satisfies(M,A,p,sp) --> is_Cons(M,x,env,e) --> 
  192.34               fun_apply(M, sp, e, n1) --> number1(M, n1) *)
  192.35  
  192.36 -definition DPow_sats_fm :: "[i,i,i,i]=>i"
  192.37 - "DPow_sats_fm(A,env,p,x) ==
  192.38 +definition
  192.39 +  DPow_sats_fm :: "[i,i,i,i]=>i" where
  192.40 +  "DPow_sats_fm(A,env,p,x) ==
  192.41     Forall(Forall(Forall(
  192.42       Implies(satisfies_fm(A#+3,p#+3,0), 
  192.43         Implies(Cons_fm(x#+3,env#+3,1), 
  192.44 @@ -219,7 +222,7 @@
  192.45  
  192.46  text{*Relativization of the Operator @{term DPow'}*}
  192.47  definition 
  192.48 -  is_DPow' :: "[i=>o,i,i] => o"
  192.49 +  is_DPow' :: "[i=>o,i,i] => o" where
  192.50      "is_DPow'(M,A,Z) == 
  192.51         \<forall>X[M]. X \<in> Z <-> 
  192.52           subset(M,X,A) & 
  192.53 @@ -310,7 +313,8 @@
  192.54  (* is_Collect :: "[i=>o,i,i=>o,i] => o"
  192.55      "is_Collect(M,A,P,z) == \<forall>x[M]. x \<in> z <-> x \<in> A & P(x)" *)
  192.56  
  192.57 -definition Collect_fm :: "[i, i, i]=>i"
  192.58 +definition
  192.59 +  Collect_fm :: "[i, i, i]=>i" where
  192.60   "Collect_fm(A,is_P,z) == 
  192.61          Forall(Iff(Member(0,succ(z)),
  192.62                     And(Member(0,succ(A)), is_P)))"
  192.63 @@ -360,8 +364,9 @@
  192.64  (*  is_Replace :: "[i=>o,i,[i,i]=>o,i] => o"
  192.65      "is_Replace(M,A,P,z) == \<forall>u[M]. u \<in> z <-> (\<exists>x[M]. x\<in>A & P(x,u))" *)
  192.66  
  192.67 -definition Replace_fm :: "[i, i, i]=>i"
  192.68 - "Replace_fm(A,is_P,z) == 
  192.69 +definition
  192.70 +  Replace_fm :: "[i, i, i]=>i" where
  192.71 +  "Replace_fm(A,is_P,z) == 
  192.72          Forall(Iff(Member(0,succ(z)),
  192.73                     Exists(And(Member(0,A#+2), is_P))))"
  192.74  
  192.75 @@ -413,7 +418,8 @@
  192.76             (\<exists>env[M]. \<exists>p[M]. mem_formula(M,p) & mem_list(M,A,env) &
  192.77                      is_Collect(M, A, is_DPow_sats(M,A,env,p), X))" *)
  192.78  
  192.79 -definition DPow'_fm :: "[i,i]=>i"
  192.80 +definition
  192.81 +  DPow'_fm :: "[i,i]=>i" where
  192.82      "DPow'_fm(A,Z) == 
  192.83        Forall(
  192.84         Iff(Member(0,succ(Z)),
  192.85 @@ -452,7 +458,7 @@
  192.86  subsection{*A Locale for Relativizing the Operator @{term Lset}*}
  192.87  
  192.88  definition
  192.89 -  transrec_body :: "[i=>o,i,i,i,i] => o"
  192.90 +  transrec_body :: "[i=>o,i,i,i,i] => o" where
  192.91      "transrec_body(M,g,x) ==
  192.92        \<lambda>y z. \<exists>gy[M]. y \<in> x & fun_apply(M,g,y,gy) & is_DPow'(M,gy,z)"
  192.93  
  192.94 @@ -504,7 +510,7 @@
  192.95  text{*Relativization of the Operator @{term Lset}*}
  192.96  
  192.97  definition
  192.98 -  is_Lset :: "[i=>o, i, i] => o"
  192.99 +  is_Lset :: "[i=>o, i, i] => o" where
 192.100     --{*We can use the term language below because @{term is_Lset} will
 192.101         not have to be internalized: it isn't used in any instance of
 192.102         separation.*}
 192.103 @@ -610,7 +616,7 @@
 192.104  
 192.105  
 192.106  definition
 192.107 -  constructible :: "[i=>o,i] => o"
 192.108 +  constructible :: "[i=>o,i] => o" where
 192.109      "constructible(M,x) ==
 192.110         \<exists>i[M]. \<exists>Li[M]. ordinal(M,i) & is_Lset(M,i,Li) & x \<in> Li"
 192.111  
   193.1 --- a/src/ZF/Constructible/Datatype_absolute.thy	Fri Nov 17 02:19:55 2006 +0100
   193.2 +++ b/src/ZF/Constructible/Datatype_absolute.thy	Fri Nov 17 02:20:03 2006 +0100
   193.3 @@ -11,10 +11,11 @@
   193.4  subsection{*The lfp of a continuous function can be expressed as a union*}
   193.5  
   193.6  definition
   193.7 -  directed :: "i=>o"
   193.8 +  directed :: "i=>o" where
   193.9     "directed(A) == A\<noteq>0 & (\<forall>x\<in>A. \<forall>y\<in>A. x \<union> y \<in> A)"
  193.10  
  193.11 -  contin :: "(i=>i) => o"
  193.12 +definition
  193.13 +  contin :: "(i=>i) => o" where
  193.14     "contin(h) == (\<forall>A. directed(A) --> h(\<Union>A) = (\<Union>X\<in>A. h(X)))"
  193.15  
  193.16  lemma bnd_mono_iterates_subset: "[|bnd_mono(D, h); n \<in> nat|] ==> h^n (0) <= D"
  193.17 @@ -114,18 +115,19 @@
  193.18  subsection {*Absoluteness for "Iterates"*}
  193.19  
  193.20  definition
  193.21 -
  193.22 -  iterates_MH :: "[i=>o, [i,i]=>o, i, i, i, i] => o"
  193.23 +  iterates_MH :: "[i=>o, [i,i]=>o, i, i, i, i] => o" where
  193.24     "iterates_MH(M,isF,v,n,g,z) ==
  193.25          is_nat_case(M, v, \<lambda>m u. \<exists>gm[M]. fun_apply(M,g,m,gm) & isF(gm,u),
  193.26                      n, z)"
  193.27  
  193.28 -  is_iterates :: "[i=>o, [i,i]=>o, i, i, i] => o"
  193.29 +definition
  193.30 +  is_iterates :: "[i=>o, [i,i]=>o, i, i, i] => o" where
  193.31      "is_iterates(M,isF,v,n,Z) == 
  193.32        \<exists>sn[M]. \<exists>msn[M]. successor(M,n,sn) & membership(M,sn,msn) &
  193.33                         is_wfrec(M, iterates_MH(M,isF,v), msn, n, Z)"
  193.34  
  193.35 -  iterates_replacement :: "[i=>o, [i,i]=>o, i] => o"
  193.36 +definition
  193.37 +  iterates_replacement :: "[i=>o, [i,i]=>o, i] => o" where
  193.38     "iterates_replacement(M,isF,v) ==
  193.39        \<forall>n[M]. n\<in>nat --> 
  193.40           wfrec_replacement(M, iterates_MH(M,isF,v), Memrel(succ(n)))"
  193.41 @@ -208,7 +210,7 @@
  193.42  
  193.43  
  193.44  definition
  193.45 -  is_list_functor :: "[i=>o,i,i,i] => o"
  193.46 +  is_list_functor :: "[i=>o,i,i,i] => o" where
  193.47      "is_list_functor(M,A,X,Z) == 
  193.48          \<exists>n1[M]. \<exists>AX[M]. 
  193.49           number1(M,n1) & cartprod(M,A,X,AX) & is_sum(M,n1,AX,Z)"
  193.50 @@ -261,7 +263,7 @@
  193.51  
  193.52  
  193.53  definition
  193.54 -  is_formula_functor :: "[i=>o,i,i] => o"
  193.55 +  is_formula_functor :: "[i=>o,i,i] => o" where
  193.56      "is_formula_functor(M,X,Z) == 
  193.57          \<exists>nat'[M]. \<exists>natnat[M]. \<exists>natnatsum[M]. \<exists>XX[M]. \<exists>X3[M]. 
  193.58            omega(M,nat') & cartprod(M,nat',nat',natnat) & 
  193.59 @@ -279,7 +281,7 @@
  193.60  subsection{*@{term M} Contains the List and Formula Datatypes*}
  193.61  
  193.62  definition
  193.63 -  list_N :: "[i,i] => i"
  193.64 +  list_N :: "[i,i] => i" where
  193.65      "list_N(A,n) == (\<lambda>X. {0} + A * X)^n (0)"
  193.66  
  193.67  lemma Nil_in_list_N [simp]: "[] \<in> list_N(A,succ(n))"
  193.68 @@ -340,17 +342,19 @@
  193.69  done
  193.70  
  193.71  definition
  193.72 -  is_list_N :: "[i=>o,i,i,i] => o"
  193.73 +  is_list_N :: "[i=>o,i,i,i] => o" where
  193.74      "is_list_N(M,A,n,Z) == 
  193.75        \<exists>zero[M]. empty(M,zero) & 
  193.76                  is_iterates(M, is_list_functor(M,A), zero, n, Z)"
  193.77 -  
  193.78 -  mem_list :: "[i=>o,i,i] => o"
  193.79 +
  193.80 +definition  
  193.81 +  mem_list :: "[i=>o,i,i] => o" where
  193.82      "mem_list(M,A,l) == 
  193.83        \<exists>n[M]. \<exists>listn[M]. 
  193.84         finite_ordinal(M,n) & is_list_N(M,A,n,listn) & l \<in> listn"
  193.85  
  193.86 -  is_list :: "[i=>o,i,i] => o"
  193.87 +definition
  193.88 +  is_list :: "[i=>o,i,i] => o" where
  193.89      "is_list(M,A,Z) == \<forall>l[M]. l \<in> Z <-> mem_list(M,A,l)"
  193.90  
  193.91  subsubsection{*Towards Absoluteness of @{term formula_rec}*}
  193.92 @@ -367,7 +371,7 @@
  193.93  
  193.94  
  193.95  definition
  193.96 -  formula_N :: "i => i"
  193.97 +  formula_N :: "i => i" where
  193.98      "formula_N(n) == (\<lambda>X. ((nat*nat) + (nat*nat)) + (X*X + X)) ^ n (0)"
  193.99  
 193.100  lemma Member_in_formula_N [simp]:
 193.101 @@ -442,20 +446,20 @@
 193.102  done
 193.103  
 193.104  definition
 193.105 -  is_formula_N :: "[i=>o,i,i] => o"
 193.106 +  is_formula_N :: "[i=>o,i,i] => o" where
 193.107      "is_formula_N(M,n,Z) == 
 193.108        \<exists>zero[M]. empty(M,zero) & 
 193.109                  is_iterates(M, is_formula_functor(M), zero, n, Z)"
 193.110  
 193.111  
 193.112 -definition
 193.113 -  
 193.114 -  mem_formula :: "[i=>o,i] => o"
 193.115 +definition  
 193.116 +  mem_formula :: "[i=>o,i] => o" where
 193.117      "mem_formula(M,p) == 
 193.118        \<exists>n[M]. \<exists>formn[M]. 
 193.119         finite_ordinal(M,n) & is_formula_N(M,n,formn) & p \<in> formn"
 193.120  
 193.121 -  is_formula :: "[i=>o,i] => o"
 193.122 +definition
 193.123 +  is_formula :: "[i=>o,i] => o" where
 193.124      "is_formula(M,Z) == \<forall>p[M]. p \<in> Z <-> mem_formula(M,p)"
 193.125  
 193.126  locale M_datatypes = M_trancl +
 193.127 @@ -585,15 +589,17 @@
 193.128  done
 193.129  
 193.130  definition
 193.131 -  is_eclose_n :: "[i=>o,i,i,i] => o"
 193.132 +  is_eclose_n :: "[i=>o,i,i,i] => o" where
 193.133      "is_eclose_n(M,A,n,Z) == is_iterates(M, big_union(M), A, n, Z)"
 193.134  
 193.135 -  mem_eclose :: "[i=>o,i,i] => o"
 193.136 +definition
 193.137 +  mem_eclose :: "[i=>o,i,i] => o" where
 193.138      "mem_eclose(M,A,l) ==
 193.139        \<exists>n[M]. \<exists>eclosen[M].
 193.140         finite_ordinal(M,n) & is_eclose_n(M,A,n,eclosen) & l \<in> eclosen"
 193.141  
 193.142 -  is_eclose :: "[i=>o,i,i] => o"
 193.143 +definition
 193.144 +  is_eclose :: "[i=>o,i,i] => o" where
 193.145      "is_eclose(M,A,Z) == \<forall>u[M]. u \<in> Z <-> mem_eclose(M,A,u)"
 193.146  
 193.147  
 193.148 @@ -643,15 +649,16 @@
 193.149  subsection {*Absoluteness for @{term transrec}*}
 193.150  
 193.151  text{* @{term "transrec(a,H) \<equiv> wfrec(Memrel(eclose({a})), a, H)"} *}
 193.152 +
 193.153  definition
 193.154 -
 193.155 -  is_transrec :: "[i=>o, [i,i,i]=>o, i, i] => o"
 193.156 +  is_transrec :: "[i=>o, [i,i,i]=>o, i, i] => o" where
 193.157     "is_transrec(M,MH,a,z) ==
 193.158        \<exists>sa[M]. \<exists>esa[M]. \<exists>mesa[M].
 193.159         upair(M,a,a,sa) & is_eclose(M,sa,esa) & membership(M,esa,mesa) &
 193.160         is_wfrec(M,MH,mesa,a,z)"
 193.161  
 193.162 -  transrec_replacement :: "[i=>o, [i,i,i]=>o, i] => o"
 193.163 +definition
 193.164 +  transrec_replacement :: "[i=>o, [i,i,i]=>o, i] => o" where
 193.165     "transrec_replacement(M,MH,a) ==
 193.166        \<exists>sa[M]. \<exists>esa[M]. \<exists>mesa[M].
 193.167         upair(M,a,a,sa) & is_eclose(M,sa,esa) & membership(M,esa,mesa) &
 193.168 @@ -692,7 +699,7 @@
 193.169  text{*But it is never used.*}
 193.170  
 193.171  definition
 193.172 -  is_length :: "[i=>o,i,i,i] => o"
 193.173 +  is_length :: "[i=>o,i,i,i] => o" where
 193.174      "is_length(M,A,l,n) ==
 193.175         \<exists>sn[M]. \<exists>list_n[M]. \<exists>list_sn[M].
 193.176          is_list_N(M,A,n,list_n) & l \<notin> list_n &
 193.177 @@ -740,7 +747,7 @@
 193.178  done
 193.179  
 193.180  definition
 193.181 -  is_nth :: "[i=>o,i,i,i] => o"
 193.182 +  is_nth :: "[i=>o,i,i,i] => o" where
 193.183      "is_nth(M,n,l,Z) ==
 193.184        \<exists>X[M]. is_iterates(M, is_tl(M), l, n, X) & is_hd(M,X,Z)"
 193.185  
 193.186 @@ -758,7 +765,7 @@
 193.187  subsection{*Relativization and Absoluteness for the @{term formula} Constructors*}
 193.188  
 193.189  definition
 193.190 -  is_Member :: "[i=>o,i,i,i] => o"
 193.191 +  is_Member :: "[i=>o,i,i,i] => o" where
 193.192       --{* because @{term "Member(x,y) \<equiv> Inl(Inl(\<langle>x,y\<rangle>))"}*}
 193.193      "is_Member(M,x,y,Z) ==
 193.194  	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inl(M,u,Z)"
 193.195 @@ -772,7 +779,7 @@
 193.196  by (simp add: Member_def)
 193.197  
 193.198  definition
 193.199 -  is_Equal :: "[i=>o,i,i,i] => o"
 193.200 +  is_Equal :: "[i=>o,i,i,i] => o" where
 193.201       --{* because @{term "Equal(x,y) \<equiv> Inl(Inr(\<langle>x,y\<rangle>))"}*}
 193.202      "is_Equal(M,x,y,Z) ==
 193.203  	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inr(M,p,u) & is_Inl(M,u,Z)"
 193.204 @@ -785,7 +792,7 @@
 193.205  by (simp add: Equal_def)
 193.206  
 193.207  definition
 193.208 -  is_Nand :: "[i=>o,i,i,i] => o"
 193.209 +  is_Nand :: "[i=>o,i,i,i] => o" where
 193.210       --{* because @{term "Nand(x,y) \<equiv> Inr(Inl(\<langle>x,y\<rangle>))"}*}
 193.211      "is_Nand(M,x,y,Z) ==
 193.212  	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inr(M,u,Z)"
 193.213 @@ -798,7 +805,7 @@
 193.214  by (simp add: Nand_def)
 193.215  
 193.216  definition
 193.217 -  is_Forall :: "[i=>o,i,i] => o"
 193.218 +  is_Forall :: "[i=>o,i,i] => o" where
 193.219       --{* because @{term "Forall(x) \<equiv> Inr(Inr(p))"}*}
 193.220      "is_Forall(M,p,Z) == \<exists>u[M]. is_Inr(M,p,u) & is_Inr(M,u,Z)"
 193.221  
 193.222 @@ -814,8 +821,7 @@
 193.223  subsection {*Absoluteness for @{term formula_rec}*}
 193.224  
 193.225  definition
 193.226 -
 193.227 -  formula_rec_case :: "[[i,i]=>i, [i,i]=>i, [i,i,i,i]=>i, [i,i]=>i, i, i] => i"
 193.228 +  formula_rec_case :: "[[i,i]=>i, [i,i]=>i, [i,i,i,i]=>i, [i,i]=>i, i, i] => i" where
 193.229      --{* the instance of @{term formula_case} in @{term formula_rec}*}
 193.230     "formula_rec_case(a,b,c,d,h) ==
 193.231          formula_case (a, b,
 193.232 @@ -847,9 +853,9 @@
 193.233  
 193.234  
 193.235  subsubsection{*Absoluteness for the Formula Operator @{term depth}*}
 193.236 +
 193.237  definition
 193.238 -
 193.239 -  is_depth :: "[i=>o,i,i] => o"
 193.240 +  is_depth :: "[i=>o,i,i] => o" where
 193.241      "is_depth(M,p,n) ==
 193.242         \<exists>sn[M]. \<exists>formula_n[M]. \<exists>formula_sn[M].
 193.243          is_formula_N(M,n,formula_n) & p \<notin> formula_n &
 193.244 @@ -874,9 +880,8 @@
 193.245  subsubsection{*@{term is_formula_case}: relativization of @{term formula_case}*}
 193.246  
 193.247  definition
 193.248 -
 193.249   is_formula_case ::
 193.250 -    "[i=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i]=>o, i, i] => o"
 193.251 +    "[i=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i]=>o, i, i] => o" where
 193.252    --{*no constraint on non-formulas*}
 193.253    "is_formula_case(M, is_a, is_b, is_c, is_d, p, z) ==
 193.254        (\<forall>x[M]. \<forall>y[M]. finite_ordinal(M,x) --> finite_ordinal(M,y) -->
 193.255 @@ -910,7 +915,7 @@
 193.256  subsubsection {*Absoluteness for @{term formula_rec}: Final Results*}
 193.257  
 193.258  definition
 193.259 -  is_formula_rec :: "[i=>o, [i,i,i]=>o, i, i] => o"
 193.260 +  is_formula_rec :: "[i=>o, [i,i,i]=>o, i, i] => o" where
 193.261      --{* predicate to relativize the functional @{term formula_rec}*}
 193.262     "is_formula_rec(M,MH,p,z)  ==
 193.263        \<exists>dp[M]. \<exists>i[M]. \<exists>f[M]. finite_ordinal(M,dp) & is_depth(M,p,dp) &
   194.1 --- a/src/ZF/Constructible/Formula.thy	Fri Nov 17 02:19:55 2006 +0100
   194.2 +++ b/src/ZF/Constructible/Formula.thy	Fri Nov 17 02:20:03 2006 +0100
   194.3 @@ -21,23 +21,29 @@
   194.4  
   194.5  declare formula.intros [TC]
   194.6  
   194.7 -definition Neg :: "i=>i"
   194.8 -    "Neg(p) == Nand(p,p)"
   194.9 +definition
  194.10 +  Neg :: "i=>i" where
  194.11 +  "Neg(p) == Nand(p,p)"
  194.12  
  194.13 -definition And :: "[i,i]=>i"
  194.14 -    "And(p,q) == Neg(Nand(p,q))"
  194.15 +definition
  194.16 +  And :: "[i,i]=>i" where
  194.17 +  "And(p,q) == Neg(Nand(p,q))"
  194.18  
  194.19 -definition Or :: "[i,i]=>i"
  194.20 -    "Or(p,q) == Nand(Neg(p),Neg(q))"
  194.21 +definition
  194.22 +  Or :: "[i,i]=>i" where
  194.23 +  "Or(p,q) == Nand(Neg(p),Neg(q))"
  194.24  
  194.25 -definition Implies :: "[i,i]=>i"
  194.26 -    "Implies(p,q) == Nand(p,Neg(q))"
  194.27 +definition
  194.28 +  Implies :: "[i,i]=>i" where
  194.29 +  "Implies(p,q) == Nand(p,Neg(q))"
  194.30  
  194.31 -definition Iff :: "[i,i]=>i"
  194.32 -    "Iff(p,q) == And(Implies(p,q), Implies(q,p))"
  194.33 +definition
  194.34 +  Iff :: "[i,i]=>i" where
  194.35 +  "Iff(p,q) == And(Implies(p,q), Implies(q,p))"
  194.36  
  194.37 -definition Exists :: "i=>i"
  194.38 -    "Exists(p) == Neg(Forall(Neg(p)))";
  194.39 +definition
  194.40 +  Exists :: "i=>i" where
  194.41 +  "Exists(p) == Neg(Forall(Neg(p)))";
  194.42  
  194.43  lemma Neg_type [TC]: "p \<in> formula ==> Neg(p) \<in> formula"
  194.44  by (simp add: Neg_def) 
  194.45 @@ -79,7 +85,7 @@
  194.46  by (induct set: formula) simp_all
  194.47  
  194.48  abbreviation
  194.49 -  sats :: "[i,i,i] => o"
  194.50 +  sats :: "[i,i,i] => o" where
  194.51    "sats(A,p,env) == satisfies(A,p)`env = 1"
  194.52  
  194.53  lemma [simp]:
  194.54 @@ -246,8 +252,9 @@
  194.55  
  194.56  subsection{*Renaming Some de Bruijn Variables*}
  194.57  
  194.58 -definition incr_var :: "[i,i]=>i"
  194.59 -    "incr_var(x,nq) == if x<nq then x else succ(x)"
  194.60 +definition
  194.61 +  incr_var :: "[i,i]=>i" where
  194.62 +  "incr_var(x,nq) == if x<nq then x else succ(x)"
  194.63  
  194.64  lemma incr_var_lt: "x<nq ==> incr_var(x,nq) = x"
  194.65  by (simp add: incr_var_def)
  194.66 @@ -334,8 +341,9 @@
  194.67  
  194.68  subsection{*Renaming all but the First de Bruijn Variable*}
  194.69  
  194.70 -definition incr_bv1 :: "i => i"
  194.71 -    "incr_bv1(p) == incr_bv(p)`1"
  194.72 +definition
  194.73 +  incr_bv1 :: "i => i" where
  194.74 +  "incr_bv1(p) == incr_bv(p)`1"
  194.75  
  194.76  
  194.77  lemma incr_bv1_type [TC]: "p \<in> formula ==> incr_bv1(p) \<in> formula"
  194.78 @@ -385,7 +393,8 @@
  194.79  subsection{*Definable Powerset*}
  194.80  
  194.81  text{*The definable powerset operation: Kunen's definition VI 1.1, page 165.*}
  194.82 -definition DPow :: "i => i"
  194.83 +definition
  194.84 +  DPow :: "i => i" where
  194.85    "DPow(A) == {X \<in> Pow(A). 
  194.86                 \<exists>env \<in> list(A). \<exists>p \<in> formula. 
  194.87                   arity(p) \<le> succ(length(env)) & 
  194.88 @@ -507,8 +516,9 @@
  194.89  
  194.90  subsubsection{*The subset relation*}
  194.91  
  194.92 -definition subset_fm :: "[i,i]=>i"
  194.93 -    "subset_fm(x,y) == Forall(Implies(Member(0,succ(x)), Member(0,succ(y))))"
  194.94 +definition
  194.95 +  subset_fm :: "[i,i]=>i" where
  194.96 +  "subset_fm(x,y) == Forall(Implies(Member(0,succ(x)), Member(0,succ(y))))"
  194.97  
  194.98  lemma subset_type [TC]: "[| x \<in> nat; y \<in> nat |] ==> subset_fm(x,y) \<in> formula"
  194.99  by (simp add: subset_fm_def) 
 194.100 @@ -527,8 +537,9 @@
 194.101  
 194.102  subsubsection{*Transitive sets*}
 194.103  
 194.104 -definition transset_fm :: "i=>i"
 194.105 -   "transset_fm(x) == Forall(Implies(Member(0,succ(x)), subset_fm(0,succ(x))))"
 194.106 +definition
 194.107 +  transset_fm :: "i=>i" where
 194.108 +  "transset_fm(x) == Forall(Implies(Member(0,succ(x)), subset_fm(0,succ(x))))"
 194.109  
 194.110  lemma transset_type [TC]: "x \<in> nat ==> transset_fm(x) \<in> formula"
 194.111  by (simp add: transset_fm_def) 
 194.112 @@ -547,9 +558,10 @@
 194.113  
 194.114  subsubsection{*Ordinals*}
 194.115  
 194.116 -definition ordinal_fm :: "i=>i"
 194.117 -   "ordinal_fm(x) == 
 194.118 -      And(transset_fm(x), Forall(Implies(Member(0,succ(x)), transset_fm(0))))"
 194.119 +definition
 194.120 +  ordinal_fm :: "i=>i" where
 194.121 +  "ordinal_fm(x) == 
 194.122 +    And(transset_fm(x), Forall(Implies(Member(0,succ(x)), transset_fm(0))))"
 194.123  
 194.124  lemma ordinal_type [TC]: "x \<in> nat ==> ordinal_fm(x) \<in> formula"
 194.125  by (simp add: ordinal_fm_def) 
 194.126 @@ -579,11 +591,12 @@
 194.127  subsection{* Constant Lset: Levels of the Constructible Universe *}
 194.128  
 194.129  definition
 194.130 -  Lset :: "i=>i"
 194.131 -    "Lset(i) == transrec(i, %x f. \<Union>y\<in>x. DPow(f`y))"
 194.132 +  Lset :: "i=>i" where
 194.133 +  "Lset(i) == transrec(i, %x f. \<Union>y\<in>x. DPow(f`y))"
 194.134  
 194.135 -  L :: "i=>o" --{*Kunen's definition VI 1.5, page 167*}
 194.136 -    "L(x) == \<exists>i. Ord(i) & x \<in> Lset(i)"
 194.137 +definition
 194.138 +  L :: "i=>o" where --{*Kunen's definition VI 1.5, page 167*}
 194.139 +  "L(x) == \<exists>i. Ord(i) & x \<in> Lset(i)"
 194.140    
 194.141  text{*NOT SUITABLE FOR REWRITING -- RECURSIVE!*}
 194.142  lemma Lset: "Lset(i) = (UN j:i. DPow(Lset(j)))"
 194.143 @@ -825,8 +838,8 @@
 194.144  
 194.145  text{*The rank function for the constructible universe*}
 194.146  definition
 194.147 -  lrank :: "i=>i" --{*Kunen's definition VI 1.7*}
 194.148 -    "lrank(x) == \<mu> i. x \<in> Lset(succ(i))"
 194.149 +  lrank :: "i=>i" where --{*Kunen's definition VI 1.7*}
 194.150 +  "lrank(x) == \<mu> i. x \<in> Lset(succ(i))"
 194.151  
 194.152  lemma L_I: "[|x \<in> Lset(i); Ord(i)|] ==> L(x)"
 194.153  by (simp add: L_def, blast)
 194.154 @@ -984,7 +997,8 @@
 194.155  
 194.156  
 194.157  text{*A simpler version of @{term DPow}: no arity check!*}
 194.158 -definition DPow' :: "i => i"
 194.159 +definition
 194.160 +  DPow' :: "i => i" where
 194.161    "DPow'(A) == {X \<in> Pow(A). 
 194.162                  \<exists>env \<in> list(A). \<exists>p \<in> formula. 
 194.163                      X = {x\<in>A. sats(A, p, Cons(x,env))}}"
   195.1 --- a/src/ZF/Constructible/Internalize.thy	Fri Nov 17 02:19:55 2006 +0100
   195.2 +++ b/src/ZF/Constructible/Internalize.thy	Fri Nov 17 02:20:03 2006 +0100
   195.3 @@ -10,7 +10,8 @@
   195.4  subsubsection{*The Formula @{term is_Inl}, Internalized*}
   195.5  
   195.6  (*  is_Inl(M,a,z) == \<exists>zero[M]. empty(M,zero) & pair(M,zero,a,z) *)
   195.7 -definition Inl_fm :: "[i,i]=>i"
   195.8 +definition
   195.9 +  Inl_fm :: "[i,i]=>i" where
  195.10      "Inl_fm(a,z) == Exists(And(empty_fm(0), pair_fm(0,succ(a),succ(z))))"
  195.11  
  195.12  lemma Inl_type [TC]:
  195.13 @@ -39,7 +40,8 @@
  195.14  subsubsection{*The Formula @{term is_Inr}, Internalized*}
  195.15  
  195.16  (*  is_Inr(M,a,z) == \<exists>n1[M]. number1(M,n1) & pair(M,n1,a,z) *)
  195.17 -definition Inr_fm :: "[i,i]=>i"
  195.18 +definition
  195.19 +  Inr_fm :: "[i,i]=>i" where
  195.20      "Inr_fm(a,z) == Exists(And(number1_fm(0), pair_fm(0,succ(a),succ(z))))"
  195.21  
  195.22  lemma Inr_type [TC]:
  195.23 @@ -69,7 +71,8 @@
  195.24  
  195.25  (* is_Nil(M,xs) == \<exists>zero[M]. empty(M,zero) & is_Inl(M,zero,xs) *)
  195.26  
  195.27 -definition Nil_fm :: "i=>i"
  195.28 +definition
  195.29 +  Nil_fm :: "i=>i" where
  195.30      "Nil_fm(x) == Exists(And(empty_fm(0), Inl_fm(0,succ(x))))"
  195.31  
  195.32  lemma Nil_type [TC]: "x \<in> nat ==> Nil_fm(x) \<in> formula"
  195.33 @@ -97,7 +100,8 @@
  195.34  
  195.35  
  195.36  (*  "is_Cons(M,a,l,Z) == \<exists>p[M]. pair(M,a,l,p) & is_Inr(M,p,Z)" *)
  195.37 -definition Cons_fm :: "[i,i,i]=>i"
  195.38 +definition
  195.39 +  Cons_fm :: "[i,i,i]=>i" where
  195.40      "Cons_fm(a,l,Z) ==
  195.41         Exists(And(pair_fm(succ(a),succ(l),0), Inr_fm(0,succ(Z))))"
  195.42  
  195.43 @@ -128,7 +132,8 @@
  195.44  
  195.45  (* is_quasilist(M,xs) == is_Nil(M,z) | (\<exists>x[M]. \<exists>l[M]. is_Cons(M,x,l,z))" *)
  195.46  
  195.47 -definition quasilist_fm :: "i=>i"
  195.48 +definition
  195.49 +  quasilist_fm :: "i=>i" where
  195.50      "quasilist_fm(x) ==
  195.51         Or(Nil_fm(x), Exists(Exists(Cons_fm(1,0,succ(succ(x))))))"
  195.52  
  195.53 @@ -162,7 +167,8 @@
  195.54         (is_Nil(M,xs) --> empty(M,H)) &
  195.55         (\<forall>x[M]. \<forall>l[M]. ~ is_Cons(M,x,l,xs) | H=x) &
  195.56         (is_quasilist(M,xs) | empty(M,H))" *)
  195.57 -definition hd_fm :: "[i,i]=>i"
  195.58 +definition
  195.59 +  hd_fm :: "[i,i]=>i" where
  195.60      "hd_fm(xs,H) == 
  195.61         And(Implies(Nil_fm(xs), empty_fm(H)),
  195.62             And(Forall(Forall(Or(Neg(Cons_fm(1,0,xs#+2)), Equal(H#+2,1)))),
  195.63 @@ -198,7 +204,8 @@
  195.64         (is_Nil(M,xs) --> T=xs) &
  195.65         (\<forall>x[M]. \<forall>l[M]. ~ is_Cons(M,x,l,xs) | T=l) &
  195.66         (is_quasilist(M,xs) | empty(M,T))" *)
  195.67 -definition tl_fm :: "[i,i]=>i"
  195.68 +definition
  195.69 +  tl_fm :: "[i,i]=>i" where
  195.70      "tl_fm(xs,T) ==
  195.71         And(Implies(Nil_fm(xs), Equal(T,xs)),
  195.72             And(Forall(Forall(Or(Neg(Cons_fm(1,0,xs#+2)), Equal(T#+2,0)))),
  195.73 @@ -234,8 +241,9 @@
  195.74     "is_bool_of_o(M,P,z) == (P & number1(M,z)) | (~P & empty(M,z))" *)
  195.75  
  195.76  text{*The formula @{term p} has no free variables.*}
  195.77 -definition bool_of_o_fm :: "[i, i]=>i"
  195.78 - "bool_of_o_fm(p,z) == 
  195.79 +definition
  195.80 +  bool_of_o_fm :: "[i, i]=>i" where
  195.81 +  "bool_of_o_fm(p,z) == 
  195.82      Or(And(p,number1_fm(z)),
  195.83         And(Neg(p),empty_fm(z)))"
  195.84  
  195.85 @@ -276,8 +284,9 @@
  195.86      "is_lambda(M, A, is_b, z) == 
  195.87         \<forall>p[M]. p \<in> z <->
  195.88          (\<exists>u[M]. \<exists>v[M]. u\<in>A & pair(M,u,v,p) & is_b(u,v))" *)
  195.89 -definition lambda_fm :: "[i, i, i]=>i"
  195.90 - "lambda_fm(p,A,z) == 
  195.91 +definition
  195.92 +  lambda_fm :: "[i, i, i]=>i" where
  195.93 +  "lambda_fm(p,A,z) == 
  195.94      Forall(Iff(Member(0,succ(z)),
  195.95              Exists(Exists(And(Member(1,A#+3),
  195.96                             And(pair_fm(1,0,2), p))))))"
  195.97 @@ -315,7 +324,8 @@
  195.98  
  195.99  (*    "is_Member(M,x,y,Z) ==
 195.100  	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inl(M,u,Z)" *)
 195.101 -definition Member_fm :: "[i,i,i]=>i"
 195.102 +definition
 195.103 +  Member_fm :: "[i,i,i]=>i" where
 195.104      "Member_fm(x,y,Z) ==
 195.105         Exists(Exists(And(pair_fm(x#+2,y#+2,1), 
 195.106                        And(Inl_fm(1,0), Inl_fm(0,Z#+2)))))"
 195.107 @@ -347,7 +357,8 @@
 195.108  
 195.109  (*    "is_Equal(M,x,y,Z) ==
 195.110  	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inr(M,p,u) & is_Inl(M,u,Z)" *)
 195.111 -definition Equal_fm :: "[i,i,i]=>i"
 195.112 +definition
 195.113 +  Equal_fm :: "[i,i,i]=>i" where
 195.114      "Equal_fm(x,y,Z) ==
 195.115         Exists(Exists(And(pair_fm(x#+2,y#+2,1), 
 195.116                        And(Inr_fm(1,0), Inl_fm(0,Z#+2)))))"
 195.117 @@ -379,7 +390,8 @@
 195.118  
 195.119  (*    "is_Nand(M,x,y,Z) ==
 195.120  	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inr(M,u,Z)" *)
 195.121 -definition Nand_fm :: "[i,i,i]=>i"
 195.122 +definition
 195.123 +  Nand_fm :: "[i,i,i]=>i" where
 195.124      "Nand_fm(x,y,Z) ==
 195.125         Exists(Exists(And(pair_fm(x#+2,y#+2,1), 
 195.126                        And(Inl_fm(1,0), Inr_fm(0,Z#+2)))))"
 195.127 @@ -410,7 +422,8 @@
 195.128  subsubsection{*The Operator @{term is_Forall}, Internalized*}
 195.129  
 195.130  (* "is_Forall(M,p,Z) == \<exists>u[M]. is_Inr(M,p,u) & is_Inr(M,u,Z)" *)
 195.131 -definition Forall_fm :: "[i,i]=>i"
 195.132 +definition
 195.133 +  Forall_fm :: "[i,i]=>i" where
 195.134      "Forall_fm(x,Z) ==
 195.135         Exists(And(Inr_fm(succ(x),0), Inr_fm(0,succ(Z))))"
 195.136  
 195.137 @@ -442,7 +455,8 @@
 195.138  
 195.139  (* is_and(M,a,b,z) == (number1(M,a)  & z=b) | 
 195.140                         (~number1(M,a) & empty(M,z)) *)
 195.141 -definition and_fm :: "[i,i,i]=>i"
 195.142 +definition
 195.143 +  and_fm :: "[i,i,i]=>i" where
 195.144      "and_fm(a,b,z) ==
 195.145         Or(And(number1_fm(a), Equal(z,b)),
 195.146            And(Neg(number1_fm(a)),empty_fm(z)))"
 195.147 @@ -476,7 +490,8 @@
 195.148  (* is_or(M,a,b,z) == (number1(M,a)  & number1(M,z)) | 
 195.149                       (~number1(M,a) & z=b) *)
 195.150  
 195.151 -definition or_fm :: "[i,i,i]=>i"
 195.152 +definition
 195.153 +  or_fm :: "[i,i,i]=>i" where
 195.154      "or_fm(a,b,z) ==
 195.155         Or(And(number1_fm(a), number1_fm(z)),
 195.156            And(Neg(number1_fm(a)), Equal(z,b)))"
 195.157 @@ -510,7 +525,8 @@
 195.158  
 195.159  (* is_not(M,a,z) == (number1(M,a)  & empty(M,z)) | 
 195.160                       (~number1(M,a) & number1(M,z)) *)
 195.161 -definition not_fm :: "[i,i]=>i"
 195.162 +definition
 195.163 +  not_fm :: "[i,i]=>i" where
 195.164      "not_fm(a,z) ==
 195.165         Or(And(number1_fm(a), empty_fm(z)),
 195.166            And(Neg(number1_fm(a)), number1_fm(z)))"
 195.167 @@ -576,8 +592,9 @@
 195.168  *)
 195.169  
 195.170  text{*The three arguments of @{term p} are always 2, 1, 0 and z*}
 195.171 -definition is_recfun_fm :: "[i, i, i, i]=>i"
 195.172 - "is_recfun_fm(p,r,a,f) == 
 195.173 +definition
 195.174 +  is_recfun_fm :: "[i, i, i, i]=>i" where
 195.175 +  "is_recfun_fm(p,r,a,f) == 
 195.176     Forall(Iff(Member(0,succ(f)),
 195.177      Exists(Exists(Exists(
 195.178       And(p, 
 195.179 @@ -638,8 +655,9 @@
 195.180  (* is_wfrec :: "[i=>o, i, [i,i,i]=>o, i, i] => o"
 195.181      "is_wfrec(M,MH,r,a,z) == 
 195.182        \<exists>f[M]. M_is_recfun(M,MH,r,a,f) & MH(a,f,z)" *)
 195.183 -definition is_wfrec_fm :: "[i, i, i, i]=>i"
 195.184 - "is_wfrec_fm(p,r,a,z) == 
 195.185 +definition
 195.186 +  is_wfrec_fm :: "[i, i, i, i]=>i" where
 195.187 +  "is_wfrec_fm(p,r,a,z) == 
 195.188      Exists(And(is_recfun_fm(p, succ(r), succ(a), 0),
 195.189             Exists(Exists(Exists(Exists(
 195.190               And(Equal(2,a#+5), And(Equal(1,4), And(Equal(0,z#+5), p)))))))))"
 195.191 @@ -696,7 +714,8 @@
 195.192  
 195.193  subsubsection{*Binary Products, Internalized*}
 195.194  
 195.195 -definition cartprod_fm :: "[i,i,i]=>i"
 195.196 +definition
 195.197 +  cartprod_fm :: "[i,i,i]=>i" where
 195.198  (* "cartprod(M,A,B,z) ==
 195.199          \<forall>u[M]. u \<in> z <-> (\<exists>x[M]. x\<in>A & (\<exists>y[M]. y\<in>B & pair(M,x,y,u)))" *)
 195.200      "cartprod_fm(A,B,z) ==
 195.201 @@ -736,7 +755,8 @@
 195.202           3      2       1        0
 195.203         number1(M,n1) & cartprod(M,n1,A,A0) & upair(M,n1,n1,s1) &
 195.204         cartprod(M,s1,B,B1) & union(M,A0,B1,Z)"  *)
 195.205 -definition sum_fm :: "[i,i,i]=>i"
 195.206 +definition
 195.207 +  sum_fm :: "[i,i,i]=>i" where
 195.208      "sum_fm(A,B,Z) ==
 195.209         Exists(Exists(Exists(Exists(
 195.210          And(number1_fm(2),
 195.211 @@ -771,7 +791,8 @@
 195.212  subsubsection{*The Operator @{term quasinat}*}
 195.213  
 195.214  (* "is_quasinat(M,z) == empty(M,z) | (\<exists>m[M]. successor(M,m,z))" *)
 195.215 -definition quasinat_fm :: "i=>i"
 195.216 +definition
 195.217 +  quasinat_fm :: "i=>i" where
 195.218      "quasinat_fm(z) == Or(empty_fm(z), Exists(succ_fm(0,succ(z))))"
 195.219  
 195.220  lemma quasinat_type [TC]:
 195.221 @@ -808,7 +829,8 @@
 195.222         (\<forall>m[M]. successor(M,m,k) --> is_b(m,z)) &
 195.223         (is_quasinat(M,k) | empty(M,z))" *)
 195.224  text{*The formula @{term is_b} has free variables 1 and 0.*}
 195.225 -definition is_nat_case_fm :: "[i, i, i, i]=>i"
 195.226 +definition
 195.227 +  is_nat_case_fm :: "[i, i, i, i]=>i" where
 195.228   "is_nat_case_fm(a,is_b,k,z) == 
 195.229      And(Implies(empty_fm(k), Equal(z,a)),
 195.230          And(Forall(Implies(succ_fm(0,succ(k)), 
 195.231 @@ -863,7 +885,8 @@
 195.232     "iterates_MH(M,isF,v,n,g,z) ==
 195.233          is_nat_case(M, v, \<lambda>m u. \<exists>gm[M]. fun_apply(M,g,m,gm) & isF(gm,u),
 195.234                      n, z)" *)
 195.235 -definition iterates_MH_fm :: "[i, i, i, i, i]=>i"
 195.236 +definition
 195.237 +  iterates_MH_fm :: "[i, i, i, i, i]=>i" where
 195.238   "iterates_MH_fm(isF,v,n,g,z) == 
 195.239      is_nat_case_fm(v, 
 195.240        Exists(And(fun_apply_fm(succ(succ(succ(g))),2,0), 
 195.241 @@ -928,8 +951,9 @@
 195.242        \<exists>sn[M]. \<exists>msn[M]. successor(M,n,sn) & membership(M,sn,msn) &
 195.243         1       0       is_wfrec(M, iterates_MH(M,isF,v), msn, n, Z)"*)
 195.244  
 195.245 -definition is_iterates_fm :: "[i, i, i, i]=>i"
 195.246 - "is_iterates_fm(p,v,n,Z) == 
 195.247 +definition
 195.248 +  is_iterates_fm :: "[i, i, i, i]=>i" where
 195.249 +  "is_iterates_fm(p,v,n,Z) == 
 195.250       Exists(Exists(
 195.251        And(succ_fm(n#+2,1),
 195.252         And(Memrel_fm(1,0),
 195.253 @@ -998,7 +1022,8 @@
 195.254  
 195.255  (* is_eclose_n(M,A,n,Z) == is_iterates(M, big_union(M), A, n, Z) *)
 195.256  
 195.257 -definition eclose_n_fm :: "[i,i,i]=>i"
 195.258 +definition
 195.259 +  eclose_n_fm :: "[i,i,i]=>i" where
 195.260    "eclose_n_fm(A,n,Z) == is_iterates_fm(big_union_fm(1,0), A, n, Z)"
 195.261  
 195.262  lemma eclose_n_fm_type [TC]:
 195.263 @@ -1034,7 +1059,8 @@
 195.264  (* mem_eclose(M,A,l) == 
 195.265        \<exists>n[M]. \<exists>eclosen[M]. 
 195.266         finite_ordinal(M,n) & is_eclose_n(M,A,n,eclosen) & l \<in> eclosen *)
 195.267 -definition mem_eclose_fm :: "[i,i]=>i"
 195.268 +definition
 195.269 +  mem_eclose_fm :: "[i,i]=>i" where
 195.270      "mem_eclose_fm(x,y) ==
 195.271         Exists(Exists(
 195.272           And(finite_ordinal_fm(1),
 195.273 @@ -1066,7 +1092,8 @@
 195.274  subsubsection{*The Predicate ``Is @{term "eclose(A)"}''*}
 195.275  
 195.276  (* is_eclose(M,A,Z) == \<forall>l[M]. l \<in> Z <-> mem_eclose(M,A,l) *)
 195.277 -definition is_eclose_fm :: "[i,i]=>i"
 195.278 +definition
 195.279 +  is_eclose_fm :: "[i,i]=>i" where
 195.280      "is_eclose_fm(A,Z) ==
 195.281         Forall(Iff(Member(0,succ(Z)), mem_eclose_fm(succ(A),0)))"
 195.282  
 195.283 @@ -1095,7 +1122,8 @@
 195.284  
 195.285  subsubsection{*The List Functor, Internalized*}