# HG changeset patch # User ballarin # Date 1229361172 -3600 # Node ID 60f7fb56f8cd64081be199e5aa098d6d68a294f3 # Parent ce6d35a0bed644fce70241b11ddc7a2df0f063e6 More porting to new locales. diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/NSA/StarDef.thy --- a/src/HOL/NSA/StarDef.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/NSA/StarDef.thy Mon Dec 15 18:12:52 2008 +0100 @@ -23,7 +23,7 @@ apply (rule nat_infinite) done -interpretation FreeUltrafilterNat: freeultrafilter [FreeUltrafilterNat] +interpretation FreeUltrafilterNat!: freeultrafilter FreeUltrafilterNat by (rule freeultrafilter_FreeUltrafilterNat) text {* This rule takes the place of the old ultra tactic *} diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/Bounds.thy --- a/src/HOL/Real/HahnBanach/Bounds.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/Bounds.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/Bounds.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -27,7 +26,7 @@ assumes "lub A x" shows "\A = (x::'a::order)" proof - - interpret lub [A x] by fact + interpret lub A x by fact show ?thesis proof (unfold the_lub_def) from `lub A x` show "The (lub A) = x" diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/FunctionNorm.thy --- a/src/HOL/Real/HahnBanach/FunctionNorm.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/FunctionNorm.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/FunctionNorm.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -22,7 +21,7 @@ linear forms: *} -locale continuous = var V + norm_syntax + linearform + +locale continuous = var_V + norm_syntax + linearform + assumes bounded: "\c. \x \ V. \f x\ \ c * \x\" declare continuous.intro [intro?] continuous_axioms.intro [intro?] @@ -91,7 +90,7 @@ assumes "continuous V norm f" shows "lub (B V f) (\f\\V)" proof - - interpret continuous [V norm f] by fact + interpret continuous V norm f by fact txt {* The existence of the supremum is shown using the completeness of the reals. Completeness means, that every non-empty bounded set of reals has a supremum. *} @@ -159,7 +158,7 @@ assumes b: "b \ B V f" shows "b \ \f\\V" proof - - interpret continuous [V norm f] by fact + interpret continuous V norm f by fact have "lub (B V f) (\f\\V)" using `continuous V norm f` by (rule fn_norm_works) from this and b show ?thesis .. @@ -170,7 +169,7 @@ assumes b: "\b. b \ B V f \ b \ y" shows "\f\\V \ y" proof - - interpret continuous [V norm f] by fact + interpret continuous V norm f by fact have "lub (B V f) (\f\\V)" using `continuous V norm f` by (rule fn_norm_works) from this and b show ?thesis .. @@ -182,7 +181,7 @@ assumes "continuous V norm f" shows "0 \ \f\\V" proof - - interpret continuous [V norm f] by fact + interpret continuous V norm f by fact txt {* The function norm is defined as the supremum of @{text B}. So it is @{text "\ 0"} if all elements in @{text B} are @{text "\ 0"}, provided the supremum exists and @{text B} is not empty. *} @@ -204,8 +203,8 @@ assumes x: "x \ V" shows "\f x\ \ \f\\V * \x\" proof - - interpret continuous [V norm f] by fact - interpret linearform [V f] . + interpret continuous V norm f by fact + interpret linearform V f . show ?thesis proof cases assume "x = 0" @@ -246,7 +245,7 @@ assumes ineq: "\x \ V. \f x\ \ c * \x\" and ge: "0 \ c" shows "\f\\V \ c" proof - - interpret continuous [V norm f] by fact + interpret continuous V norm f by fact show ?thesis proof (rule fn_norm_leastB [folded B_def fn_norm_def]) fix b assume b: "b \ B V f" diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/HahnBanach.thy --- a/src/HOL/Real/HahnBanach/HahnBanach.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/HahnBanach.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/HahnBanach.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -63,10 +62,10 @@ -- {* and @{text f} a linear form on @{text F} such that @{text f} is bounded by @{text p}, *} -- {* then @{text f} can be extended to a linear form @{text h} on @{text E} in a norm-preserving way. \skp *} proof - - interpret vectorspace [E] by fact - interpret subspace [F E] by fact - interpret seminorm [E p] by fact - interpret linearform [F f] by fact + interpret vectorspace E by fact + interpret subspace F E by fact + interpret seminorm E p by fact + interpret linearform F f by fact def M \ "norm_pres_extensions E p F f" then have M: "M = \" by (simp only:) from E have F: "vectorspace F" .. @@ -322,10 +321,10 @@ \ (\x \ F. g x = f x) \ (\x \ E. \g x\ \ p x)" proof - - interpret vectorspace [E] by fact - interpret subspace [F E] by fact - interpret linearform [F f] by fact - interpret seminorm [E p] by fact + interpret vectorspace E by fact + interpret subspace F E by fact + interpret linearform F f by fact + interpret seminorm E p by fact have "\g. linearform E g \ (\x \ F. g x = f x) \ (\x \ E. g x \ p x)" using E FE sn lf proof (rule HahnBanach) @@ -363,12 +362,12 @@ \ (\x \ F. g x = f x) \ \g\\E = \f\\F" proof - - interpret normed_vectorspace [E norm] by fact - interpret normed_vectorspace_with_fn_norm [E norm B fn_norm] + interpret normed_vectorspace E norm by fact + interpret normed_vectorspace_with_fn_norm E norm B fn_norm by (auto simp: B_def fn_norm_def) intro_locales - interpret subspace [F E] by fact - interpret linearform [F f] by fact - interpret continuous [F norm f] by fact + interpret subspace F E by fact + interpret linearform F f by fact + interpret continuous F norm f by fact have E: "vectorspace E" by intro_locales have F: "vectorspace F" by rule intro_locales have F_norm: "normed_vectorspace F norm" diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy --- a/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/HahnBanachExtLemmas.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -46,7 +45,7 @@ assumes r: "\u v. u \ F \ v \ F \ a u \ b v" shows "\xi::real. \y \ F. a y \ xi \ xi \ b y" proof - - interpret vectorspace [F] by fact + interpret vectorspace F by fact txt {* From the completeness of the reals follows: The set @{text "S = {a u. u \ F}"} has a supremum, if it is non-empty and has an upper bound. *} @@ -98,8 +97,8 @@ assumes E: "vectorspace E" shows "linearform H' h'" proof - - interpret linearform [H h] by fact - interpret vectorspace [E] by fact + interpret linearform H h by fact + interpret vectorspace E by fact show ?thesis proof note E = `vectorspace E` @@ -203,10 +202,10 @@ and a': "\y \ H. - p (y + x0) - h y \ xi \ xi \ p (y + x0) - h y" shows "\x \ H'. h' x \ p x" proof - - interpret vectorspace [E] by fact - interpret subspace [H E] by fact - interpret seminorm [E p] by fact - interpret linearform [H h] by fact + interpret vectorspace E by fact + interpret subspace H E by fact + interpret seminorm E p by fact + interpret linearform H h by fact show ?thesis proof fix x assume x': "x \ H'" diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/HahnBanachSupLemmas.thy --- a/src/HOL/Real/HahnBanach/HahnBanachSupLemmas.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/HahnBanachSupLemmas.thy Mon Dec 15 18:12:52 2008 +0100 @@ -405,10 +405,10 @@ and "linearform H h" shows "(\x \ H. \h x\ \ p x) = (\x \ H. h x \ p x)" (is "?L = ?R") proof - interpret subspace [H E] by fact - interpret vectorspace [E] by fact - interpret seminorm [E p] by fact - interpret linearform [H h] by fact + interpret subspace H E by fact + interpret vectorspace E by fact + interpret seminorm E p by fact + interpret linearform H h by fact have H: "vectorspace H" using `vectorspace E` .. { assume l: ?L diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/Linearform.thy --- a/src/HOL/Real/HahnBanach/Linearform.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/Linearform.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/Linearform.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -14,8 +13,8 @@ that is additive and multiplicative. *} -locale linearform = var V + var f + - constrains V :: "'a\{minus, plus, zero, uminus} set" +locale linearform = + fixes V :: "'a\{minus, plus, zero, uminus} set" and f assumes add [iff]: "x \ V \ y \ V \ f (x + y) = f x + f y" and mult [iff]: "x \ V \ f (a \ x) = a * f x" @@ -25,7 +24,7 @@ assumes "vectorspace V" shows "x \ V \ f (- x) = - f x" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact assume x: "x \ V" then have "f (- x) = f ((- 1) \ x)" by (simp add: negate_eq1) also from x have "\ = (- 1) * (f x)" by (rule mult) @@ -37,7 +36,7 @@ assumes "vectorspace V" shows "x \ V \ y \ V \ f (x - y) = f x - f y" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact assume x: "x \ V" and y: "y \ V" then have "x - y = x + - y" by (rule diff_eq1) also have "f \ = f x + f (- y)" by (rule add) (simp_all add: x y) @@ -51,7 +50,7 @@ assumes "vectorspace V" shows "f 0 = 0" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact have "f 0 = f (0 - 0)" by simp also have "\ = f 0 - f 0" using `vectorspace V` by (rule diff) simp_all also have "\ = 0" by simp diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/NormedSpace.thy --- a/src/HOL/Real/HahnBanach/NormedSpace.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/NormedSpace.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/NormedSpace.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -20,7 +19,7 @@ locale norm_syntax = fixes norm :: "'a \ real" ("\_\") -locale seminorm = var V + norm_syntax + +locale seminorm = var_V + norm_syntax + constrains V :: "'a\{minus, plus, zero, uminus} set" assumes ge_zero [iff?]: "x \ V \ 0 \ \x\" and abs_homogenous [iff?]: "x \ V \ \a \ x\ = \a\ * \x\" @@ -32,7 +31,7 @@ assumes "vectorspace V" shows "x \ V \ y \ V \ \x - y\ \ \x\ + \y\" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact assume x: "x \ V" and y: "y \ V" then have "x - y = x + - 1 \ y" by (simp add: diff_eq2 negate_eq2a) @@ -48,7 +47,7 @@ assumes "vectorspace V" shows "x \ V \ \- x\ = \x\" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact assume x: "x \ V" then have "- x = - 1 \ x" by (simp only: negate_eq1) also from x have "\\\ = \- 1\ * \x\" @@ -103,8 +102,8 @@ assumes "subspace F E" "normed_vectorspace E norm" shows "normed_vectorspace F norm" proof - - interpret subspace [F E] by fact - interpret normed_vectorspace [E norm] by fact + interpret subspace F E by fact + interpret normed_vectorspace E norm by fact show ?thesis proof show "vectorspace F" by (rule vectorspace) unfold_locales diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/Subspace.thy --- a/src/HOL/Real/HahnBanach/Subspace.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/Subspace.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/Subspace.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) @@ -17,8 +16,8 @@ and scalar multiplication. *} -locale subspace = var U + var V + - constrains U :: "'a\{minus, plus, zero, uminus} set" +locale subspace = + fixes U :: "'a\{minus, plus, zero, uminus} set" and V assumes non_empty [iff, intro]: "U \ {}" and subset [iff]: "U \ V" and add_closed [iff]: "x \ U \ y \ U \ x + y \ U" @@ -46,7 +45,7 @@ assumes x: "x \ U" and y: "y \ U" shows "x - y \ U" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact from x y show ?thesis by (simp add: diff_eq1 negate_eq1) qed @@ -60,11 +59,11 @@ assumes "vectorspace V" shows "0 \ U" proof - - interpret vectorspace [V] by fact - have "U \ {}" by (rule U_V.non_empty) + interpret V!: vectorspace V by fact + have "U \ {}" by (rule non_empty) then obtain x where x: "x \ U" by blast then have "x \ V" .. then have "0 = x - x" by simp - also from `vectorspace V` x x have "\ \ U" by (rule U_V.diff_closed) + also from `vectorspace V` x x have "\ \ U" by (rule diff_closed) finally show ?thesis . qed @@ -73,7 +72,7 @@ assumes x: "x \ U" shows "- x \ U" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact from x show ?thesis by (simp add: negate_eq1) qed @@ -83,7 +82,7 @@ assumes "vectorspace V" shows "vectorspace U" proof - - interpret vectorspace [V] by fact + interpret vectorspace V by fact show ?thesis proof show "U \ {}" .. @@ -255,8 +254,8 @@ assumes "vectorspace U" "vectorspace V" shows "U \ U + V" proof - - interpret vectorspace [U] by fact - interpret vectorspace [V] by fact + interpret vectorspace U by fact + interpret vectorspace V by fact show ?thesis proof show "U \ {}" .. @@ -279,9 +278,9 @@ assumes "subspace U E" "vectorspace E" "subspace V E" shows "U + V \ E" proof - - interpret subspace [U E] by fact - interpret vectorspace [E] by fact - interpret subspace [V E] by fact + interpret subspace U E by fact + interpret vectorspace E by fact + interpret subspace V E by fact show ?thesis proof have "0 \ U + V" @@ -346,9 +345,9 @@ and sum: "u1 + v1 = u2 + v2" shows "u1 = u2 \ v1 = v2" proof - - interpret vectorspace [E] by fact - interpret subspace [U E] by fact - interpret subspace [V E] by fact + interpret vectorspace E by fact + interpret subspace U E by fact + interpret subspace V E by fact show ?thesis proof have U: "vectorspace U" (* FIXME: use interpret *) @@ -395,8 +394,8 @@ and eq: "y1 + a1 \ x' = y2 + a2 \ x'" shows "y1 = y2 \ a1 = a2" proof - - interpret vectorspace [E] by fact - interpret subspace [H E] by fact + interpret vectorspace E by fact + interpret subspace H E by fact show ?thesis proof have c: "y1 = y2 \ a1 \ x' = a2 \ x'" @@ -451,8 +450,8 @@ and x': "x' \ H" "x' \ E" "x' \ 0" shows "(SOME (y, a). t = y + a \ x' \ y \ H) = (t, 0)" proof - - interpret vectorspace [E] by fact - interpret subspace [H E] by fact + interpret vectorspace E by fact + interpret subspace H E by fact show ?thesis proof (rule, simp_all only: split_paired_all split_conv) from t x' show "t = t + 0 \ x' \ t \ H" by simp @@ -483,8 +482,8 @@ and x': "x' \ H" "x' \ E" "x' \ 0" shows "h' x = h y + a * xi" proof - - interpret vectorspace [E] by fact - interpret subspace [H E] by fact + interpret vectorspace E by fact + interpret subspace H E by fact from x y x' have "x \ H + lin x'" by auto have "\!p. (\(y, a). x = y + a \ x' \ y \ H) p" (is "\!p. ?P p") proof (rule ex_ex1I) diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/VectorSpace.thy --- a/src/HOL/Real/HahnBanach/VectorSpace.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/VectorSpace.thy Mon Dec 15 18:12:52 2008 +0100 @@ -39,7 +39,9 @@ the neutral element of scalar multiplication. *} -locale vectorspace = var V + +locale var_V = fixes V + +locale vectorspace = var_V + assumes non_empty [iff, intro?]: "V \ {}" and add_closed [iff]: "x \ V \ y \ V \ x + y \ V" and mult_closed [iff]: "x \ V \ a \ x \ V" diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Real/HahnBanach/ZornLemma.thy --- a/src/HOL/Real/HahnBanach/ZornLemma.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Real/HahnBanach/ZornLemma.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* Title: HOL/Real/HahnBanach/ZornLemma.thy - ID: $Id$ Author: Gertrud Bauer, TU Munich *) diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Word/TdThs.thy --- a/src/HOL/Word/TdThs.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Word/TdThs.thy Mon Dec 15 18:12:52 2008 +0100 @@ -90,7 +90,7 @@ end -interpretation nat_int: type_definition [int nat "Collect (op <= 0)"] +interpretation nat_int!: type_definition int nat "Collect (op <= 0)" by (rule td_nat_int) declare diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/Word/WordDefinition.thy --- a/src/HOL/Word/WordDefinition.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/Word/WordDefinition.thy Mon Dec 15 18:12:52 2008 +0100 @@ -356,11 +356,11 @@ lemmas int_word_uint = td_ext_uint [THEN td_ext.eq_norm, standard] -interpretation word_uint: - td_ext ["uint::'a::len0 word \ int" - word_of_int - "uints (len_of TYPE('a::len0))" - "\w. w mod 2 ^ len_of TYPE('a::len0)"] +interpretation word_uint!: + td_ext "uint::'a::len0 word \ int" + word_of_int + "uints (len_of TYPE('a::len0))" + "\w. w mod 2 ^ len_of TYPE('a::len0)" by (rule td_ext_uint) lemmas td_uint = word_uint.td_thm @@ -368,11 +368,11 @@ lemmas td_ext_ubin = td_ext_uint [simplified len_gt_0 no_bintr_alt1 [symmetric]] -interpretation word_ubin: - td_ext ["uint::'a::len0 word \ int" - word_of_int - "uints (len_of TYPE('a::len0))" - "bintrunc (len_of TYPE('a::len0))"] +interpretation word_ubin!: + td_ext "uint::'a::len0 word \ int" + word_of_int + "uints (len_of TYPE('a::len0))" + "bintrunc (len_of TYPE('a::len0))" by (rule td_ext_ubin) lemma sint_sbintrunc': diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/ex/Abstract_NAT.thy --- a/src/HOL/ex/Abstract_NAT.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/ex/Abstract_NAT.thy Mon Dec 15 18:12:52 2008 +0100 @@ -1,5 +1,4 @@ (* - ID: $Id$ Author: Makarius *) @@ -131,7 +130,7 @@ text {* \medskip Just see that our abstract specification makes sense \dots *} -interpretation NAT [0 Suc] +interpretation NAT 0 Suc proof (rule NAT.intro) fix m n show "(Suc m = Suc n) = (m = n)" by simp diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/ex/Tarski.thy --- a/src/HOL/ex/Tarski.thy Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/ex/Tarski.thy Mon Dec 15 18:12:52 2008 +0100 @@ -120,7 +120,7 @@ locale CL = S + assumes cl_co: "cl : CompleteLattice" -interpretation CL < PO +sublocale CL < PO apply (simp_all add: A_def r_def) apply unfold_locales using cl_co unfolding CompleteLattice_def by auto @@ -131,7 +131,7 @@ assumes f_cl: "(cl,f) : CLF_set" (*was the equivalent "f : CLF_set``{cl}"*) defines P_def: "P == fix f A" -interpretation CLF < CL +sublocale CLF < CL apply (simp_all add: A_def r_def) apply unfold_locales using f_cl unfolding CLF_set_def by auto diff -r ce6d35a0bed6 -r 60f7fb56f8cd src/HOL/plain.ML --- a/src/HOL/plain.ML Sun Dec 14 18:45:51 2008 +0100 +++ b/src/HOL/plain.ML Mon Dec 15 18:12:52 2008 +0100 @@ -1,7 +1,7 @@ (* Title: HOL/plain.ML - ID: $Id$ Classical Higher-order Logic -- plain Tool bootstrap. *) +set new_locales; use_thy "Plain";