# HG changeset patch # User Lars Hupel # Date 1474216597 -7200 # Node ID 255294779d401332a9ee55df0c09d1a4692a82e7 # Parent 6b886cadba7cfed078fe58e2910415366cf389b3# Parent 9f8325206465ac59e7205372ca2230958109a8f7 merged diff -r 6b886cadba7c -r 255294779d40 NEWS --- a/NEWS Sun Sep 18 18:23:59 2016 +0200 +++ b/NEWS Sun Sep 18 18:36:37 2016 +0200 @@ -231,6 +231,14 @@ *** HOL *** +* The unique existence quantifier no longer provides 'binder' syntax, +but uses syntax translations (as for bounded unique existence). Thus +iterated quantification \!x y. P x y with its slightly confusing +sequential meaning \!x. \!y. P x y is no longer possible. Instead, +pattern abstraction admits simultaneous unique existence \!(x, y). P x y +(analogous existing notation \!(x, y)\A. P x y). Potential +INCOMPATIBILITY in rare situations. + * Renamed session HOL-Multivariate_Analysis to HOL-Analysis. * Moved measure theory from HOL-Probability to HOL-Analysis. When importing diff -r 6b886cadba7c -r 255294779d40 src/HOL/HOL.thy --- a/src/HOL/HOL.thy Sun Sep 18 18:23:59 2016 +0200 +++ b/src/HOL/HOL.thy Sun Sep 18 18:36:37 2016 +0200 @@ -99,17 +99,31 @@ definition disj :: "[bool, bool] \ bool" (infixr "\" 30) where or_def: "P \ Q \ \R. (P \ R) \ (Q \ R) \ R" -definition Ex1 :: "('a \ bool) \ bool" (binder "\!" 10) +definition Ex1 :: "('a \ bool) \ bool" where "Ex1 P \ \x. P x \ (\y. P y \ y = x)" subsubsection \Additional concrete syntax\ -abbreviation Not_Ex :: "('a \ bool) \ bool" (binder "\" 10) - where "\x. P x \ \ (\x. P x)" +syntax (ASCII) + "_Ex1" :: "pttrn \ bool \ bool" ("(3EX! _./ _)" [0, 10] 10) +syntax (input) + "_Ex1" :: "pttrn \ bool \ bool" ("(3?! _./ _)" [0, 10] 10) +syntax "_Ex1" :: "pttrn \ bool \ bool" ("(3\!_./ _)" [0, 10] 10) +translations "\!x. P" \ "CONST Ex1 (\x. P)" -abbreviation Not_Ex1 :: "('a \ bool) \ bool" (binder "\!" 10) - where "\!x. P x \ \ (\!x. P x)" +print_translation \ + [Syntax_Trans.preserve_binder_abs_tr' @{const_syntax Ex1} @{syntax_const "_Ex1"}] +\ \ \to avoid eta-contraction of body\ + + +syntax + "_Not_Ex" :: "idts \ bool \ bool" ("(3\_./ _)" [0, 10] 10) + "_Not_Ex1" :: "pttrn \ bool \ bool" ("(3\!_./ _)" [0, 10] 10) +translations + "\x. P" \ "\ (\x. P)" + "\!x. P" \ "\ (\!x. P)" + abbreviation not_equal :: "['a, 'a] \ bool" (infixl "\" 50) where "x \ y \ \ (x = y)" @@ -158,13 +172,11 @@ notation (ASCII) All (binder "ALL " 10) and - Ex (binder "EX " 10) and - Ex1 (binder "EX! " 10) + Ex (binder "EX " 10) notation (input) All (binder "! " 10) and - Ex (binder "? " 10) and - Ex1 (binder "?! " 10) + Ex (binder "? " 10) subsubsection \Axioms and basic definitions\ diff -r 6b886cadba7c -r 255294779d40 src/HOL/Hahn_Banach/Subspace.thy --- a/src/HOL/Hahn_Banach/Subspace.thy Sun Sep 18 18:23:59 2016 +0200 +++ b/src/HOL/Hahn_Banach/Subspace.thy Sun Sep 18 18:36:37 2016 +0200 @@ -479,7 +479,7 @@ 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") + have "\!(y, a). x = y + a \ x' \ y \ H" (is "\!p. ?P p") proof (rule ex_ex1I) from x y show "\p. ?P p" by blast fix p q assume p: "?P p" and q: "?P q" diff -r 6b886cadba7c -r 255294779d40 src/HOL/Rat.thy --- a/src/HOL/Rat.thy Sun Sep 18 18:23:59 2016 +0200 +++ b/src/HOL/Rat.thy Sun Sep 18 18:36:37 2016 +0200 @@ -339,12 +339,11 @@ then show ?thesis proof (rule ex1I) fix p - obtain c d :: int where p: "p = (c, d)" - by (cases p) - assume "r = Fract (fst p) (snd p) \ snd p > 0 \ coprime (fst p) (snd p)" - with p have Fract': "r = Fract c d" "d > 0" "coprime c d" + assume r: "r = Fract (fst p) (snd p) \ snd p > 0 \ coprime (fst p) (snd p)" + obtain c d where p: "p = (c, d)" by (cases p) + with r have Fract': "r = Fract c d" "d > 0" "coprime c d" by simp_all - have "c = a \ d = b" + have "(c, d) = (a, b)" proof (cases "a = 0") case True with Fract Fract' show ?thesis @@ -382,9 +381,9 @@ moreover have "coprime (fst (normalize (a, b))) (snd (normalize (a, b)))" (is ?coprime) by (rule normalize_coprime) simp ultimately have "?Fract \ ?denom_pos \ ?coprime" by blast - with quotient_of_unique - have "(THE p. Fract a b = Fract (fst p) (snd p) \ 0 < snd p \ - coprime (fst p) (snd p)) = normalize (a, b)" by (rule the1_equality) + then have "(THE p. Fract a b = Fract (fst p) (snd p) \ 0 < snd p \ + coprime (fst p) (snd p)) = normalize (a, b)" + by (rule the1_equality [OF quotient_of_unique]) then show ?thesis by (simp add: quotient_of_def) qed