# HG changeset patch # User wenzelm # Date 1330462416 -3600 # Node ID 5302e932d1e510811e96f157e0508281a26f3f40 # Parent e3b99d0231bc2773a73155a8f4118c186cc887a0 avoid undeclared variables in let bindings; tuned proofs; diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Binary_Product_Measure.thy --- a/src/HOL/Probability/Binary_Product_Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Binary_Product_Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -170,7 +170,7 @@ assumes Q: "Q \ sets P" shows "(\(x,y). (y, x)) -` Q \ sets (M2 \\<^isub>M M1)" (is "_ \ sets ?Q") proof - - let "?f Q" = "(\(x,y). (y, x)) -` Q \ space M2 \ space M1" + let ?f = "\Q. (\(x,y). (y, x)) -` Q \ space M2 \ space M1" have *: "(\(x,y). (y, x)) -` Q = ?f Q" using sets_into_space[OF Q] by (auto simp: space_pair_measure) have "sets (M2 \\<^isub>M M1) = sets (sigma (pair_measure_generator M2 M1))" @@ -325,7 +325,7 @@ have M1: "sigma_finite_measure M1" by default from M2.disjoint_sigma_finite guess F .. note F = this then have F_sets: "\i. F i \ sets M2" by auto - let "?C x i" = "F i \ Pair x -` Q" + let ?C = "\x i. F i \ Pair x -` Q" { fix i let ?R = "M2.restricted_space (F i)" have [simp]: "space M1 \ F i \ space M1 \ space M2 = space M1 \ F i" @@ -607,8 +607,8 @@ proof - have f_borel: "f \ borel_measurable P" using f(1) by (rule borel_measurable_simple_function) - let "?F z" = "f -` {z} \ space P" - let "?F' x z" = "Pair x -` ?F z" + let ?F = "\z. f -` {z} \ space P" + let ?F' = "\x z. Pair x -` ?F z" { fix x assume "x \ space M1" have [simp]: "\z y. indicator (?F z) (x, y) = indicator (?F' x z) y" by (auto simp: indicator_def) @@ -819,7 +819,7 @@ shows "M1.almost_everywhere (\x. integrable M2 (\ y. f (x, y)))" (is "?AE") and "(\x. (\y. f (x, y) \M2) \M1) = integral\<^isup>L P f" (is "?INT") proof - - let "?pf x" = "ereal (f x)" and "?nf x" = "ereal (- f x)" + let ?pf = "\x. ereal (f x)" and ?nf = "\x. ereal (- f x)" have borel: "?nf \ borel_measurable P""?pf \ borel_measurable P" and int: "integral\<^isup>P P ?nf \ \" "integral\<^isup>P P ?pf \ \" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Tue Feb 28 21:53:36 2012 +0100 @@ -521,7 +521,8 @@ finally show "{x. x$$i \ a} \ sets ?SIGMA" apply (simp only:) apply (safe intro!: countable_UN Diff) - by (auto simp: sets_sigma intro!: sigma_sets.Basic) + apply (auto simp: sets_sigma intro!: sigma_sets.Basic) + done next fix a i assume "\ i < DIM('a)" then show "{x. x$$i \ a} \ sets ?SIGMA" @@ -556,7 +557,8 @@ finally show "{x. a \ x$$i} \ sets ?SIGMA" apply (simp only:) apply (safe intro!: countable_UN Diff) - by (auto simp: sets_sigma intro!: sigma_sets.Basic) + apply (auto simp: sets_sigma intro!: sigma_sets.Basic) + done next fix a i assume "\ i < DIM('a)" then show "{x. a \ x$$i} \ sets ?SIGMA" @@ -653,7 +655,8 @@ have "M \ sets ?SIGMA" apply (subst open_UNION[OF `open M`]) apply (safe intro!: countable_UN) - by (auto simp add: sigma_def intro!: sigma_sets.Basic) } + apply (auto simp add: sigma_def intro!: sigma_sets.Basic) + done } then show ?thesis unfolding borel_def by (intro sets_sigma_subset) auto qed @@ -1156,7 +1159,7 @@ assume *: "(\x. real (f x)) \ borel_measurable M" "f -` {\} \ space M \ sets M" "f -` {-\} \ space M \ sets M" have "f -` {\} \ space M = {x\space M. f x = \}" "f -` {-\} \ space M = {x\space M. f x = -\}" by auto with * have **: "{x\space M. f x = \} \ sets M" "{x\space M. f x = -\} \ sets M" by simp_all - let "?f x" = "if f x = \ then \ else if f x = -\ then -\ else ereal (real (f x))" + let ?f = "\x. if f x = \ then \ else if f x = -\ then -\ else ereal (real (f x))" have "?f \ borel_measurable M" using * ** by (intro measurable_If) auto also have "?f = f" by (auto simp: fun_eq_iff ereal_real) finally show "f \ borel_measurable M" . @@ -1469,7 +1472,7 @@ shows "u' \ borel_measurable M" proof - have "\x. x \ space M \ liminf (\n. ereal (u n x)) = ereal (u' x)" - using u' by (simp add: lim_imp_Liminf trivial_limit_sequentially lim_ereal) + using u' by (simp add: lim_imp_Liminf) moreover from u have "(\x. liminf (\n. ereal (u n x))) \ borel_measurable M" by auto ultimately show ?thesis by (simp cong: measurable_cong add: borel_measurable_ereal_iff) diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Caratheodory.thy --- a/src/HOL/Probability/Caratheodory.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Caratheodory.thy Tue Feb 28 21:53:36 2012 +0100 @@ -223,7 +223,7 @@ by (metis Diff_Un Un compl_sets lambda_system_sets xl yl) moreover have "x \ y = space M - ((space M - x) \ (space M - y))" - by auto (metis subsetD lambda_system_sets sets_into_space xl yl)+ + by auto (metis subsetD lambda_system_sets sets_into_space xl yl)+ ultimately show ?thesis by (metis lambda_system_Compl lambda_system_Int xl yl) qed @@ -666,7 +666,7 @@ (\x. Inf (measure_set M f x))" proof (simp add: countably_subadditive_def, safe) fix A :: "nat \ 'a set" - let "?outer B" = "Inf (measure_set M f B)" + let ?outer = "\B. Inf (measure_set M f B)" assume A: "range A \ Pow (space M)" and disj: "disjoint_family A" and sb: "(\i. A i) \ space M" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Complete_Measure.thy --- a/src/HOL/Probability/Complete_Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Complete_Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -203,7 +203,7 @@ assumes f: "simple_function completion f" shows "\f'. simple_function M f' \ (AE x. f x = f' x)" proof - - let "?F x" = "f -` {x} \ space M" + let ?F = "\x. f -` {x} \ space M" have F: "\x. ?F x \ sets completion" and fin: "finite (f`space M)" using completion.simple_functionD[OF f] completion.simple_functionD[OF f] by simp_all @@ -211,7 +211,8 @@ using F null_part by auto from choice[OF this] obtain N where N: "\x. null_part (?F x) \ N x" "\x. N x \ null_sets" by auto - let ?N = "\x\f`space M. N x" let "?f' x" = "if x \ ?N then undefined else f x" + let ?N = "\x\f`space M. N x" + let ?f' = "\x. if x \ ?N then undefined else f x" have sets: "?N \ null_sets" using N fin by (intro nullsets.finite_UN) auto show ?thesis unfolding simple_function_def proof (safe intro!: exI[of _ ?f']) diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Conditional_Probability.thy --- a/src/HOL/Probability/Conditional_Probability.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Conditional_Probability.thy Tue Feb 28 21:53:36 2012 +0100 @@ -25,8 +25,8 @@ interpret P: prob_space N using prob_space_subalgebra[OF N] . - let "?f A" = "\x. X x * indicator A x" - let "?Q A" = "integral\<^isup>P M (?f A)" + let ?f = "\A x. X x * indicator A x" + let ?Q = "\A. integral\<^isup>P M (?f A)" from measure_space_density[OF borel] have Q: "measure_space (N\ measure := ?Q \)" @@ -146,7 +146,7 @@ by auto from factorize_measurable_function_pos[OF assms(1,2) this] guess n .. note n = this from factorize_measurable_function_pos[OF assms Z] guess p .. note p = this - let "?g x" = "p x - n x" + let ?g = "\x. p x - n x" show "\g\borel_measurable M'. \x\space M. Z x = g (Y x)" proof (intro bexI ballI) show "?g \ borel_measurable M'" using p n by auto diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Finite_Product_Measure.thy --- a/src/HOL/Probability/Finite_Product_Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Finite_Product_Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -627,7 +627,7 @@ by (intro P.measure_space_vimage[OF I']) (auto simp add: measure_preserving_def) show ?case proof (intro exI[of _ ?\] conjI ballI) - let "?m A" = "measure (Pi\<^isub>M I M\measure := \\ \\<^isub>M M i) (?h -` A \ space P.P)" + let ?m = "\A. measure (Pi\<^isub>M I M\measure := \\ \\<^isub>M M i) (?h -` A \ space P.P)" { fix A assume A: "A \ (\ i\insert i I. sets (M i))" then have *: "?h -` Pi\<^isub>E (insert i I) A \ space P.P = Pi\<^isub>E I A \ A i" using `i \ I` M.sets_into_space by (auto simp: space_pair_measure space_product_algebra) blast @@ -648,7 +648,7 @@ "(\k. \\<^isub>E j \ insert i I. F j k) = space I'.G" "\k. \j. j \ insert i I \ \ j (F j k) \ \" by blast+ - let "?F k" = "\\<^isub>E j \ insert i I. F j k" + let ?F = "\k. \\<^isub>E j \ insert i I. F j k" show "\F::nat \ ('i \ 'a) set. range F \ sets I'.P \ (\i. F i) = (\\<^isub>E i\insert i I. space (M i)) \ (\i. ?m (F i) \ \)" proof (intro exI[of _ ?F] conjI allI) @@ -727,7 +727,7 @@ interpret IJ: finite_product_sigma_finite M "I \ J" by default fact interpret P: pair_sigma_finite I.P J.P by default let ?g = "\(x,y). merge I x J y" - let "?X S" = "?g -` S \ space P.P" + let ?X = "\S. ?g -` S \ space P.P" from IJ.sigma_finite_pairs obtain F where F: "\i. i\ I \ J \ range (F i) \ sets (M i)" "incseq (\k. \\<^isub>E i\I \ J. F i k)" @@ -839,7 +839,7 @@ unfolding product_positive_integral_fold[OF IJ, unfolded insert, simplified, OF f] proof (rule I.positive_integral_cong, subst product_positive_integral_singleton) fix x assume x: "x \ space I.P" - let "?f y" = "f (restrict (x(i := y)) (insert i I))" + let ?f = "\y. f (restrict (x(i := y)) (insert i I))" have f'_eq: "\y. ?f y = f (x(i := y))" using x by (auto intro!: arg_cong[where f=f] simp: fun_eq_iff extensional_def) show "?f \ borel_measurable (M i)" unfolding f'_eq @@ -930,7 +930,7 @@ unfolding product_integral_fold[OF IJ, simplified, OF f] proof (rule I.integral_cong, subst product_integral_singleton) fix x assume x: "x \ space I.P" - let "?f y" = "f (restrict (x(i := y)) (insert i I))" + let ?f = "\y. f (restrict (x(i := y)) (insert i I))" have f'_eq: "\y. ?f y = f (x(i := y))" using x by (auto intro!: arg_cong[where f=f] simp: fun_eq_iff extensional_def) have f: "f \ borel_measurable I'.P" using f unfolding integrable_def by auto diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Independent_Family.thy --- a/src/HOL/Probability/Independent_Family.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Independent_Family.thy Tue Feb 28 21:53:36 2012 +0100 @@ -142,7 +142,7 @@ with indep have "indep_sets F J" by (subst (asm) indep_sets_finite_index_sets) auto { fix J K assume "indep_sets F K" - let "?G S i" = "if i \ S then ?F i else F i" + let ?G = "\S i. if i \ S then ?F i else F i" assume "finite J" "J \ K" then have "indep_sets (?G J) K" proof induct @@ -384,7 +384,7 @@ assumes disjoint: "disjoint_family_on I J" shows "indep_sets (\j. sigma_sets (space M) (\i\I j. E i)) J" proof - - let "?E j" = "{\k\K. E' k| E' K. finite K \ K \ {} \ K \ I j \ (\k\K. E' k \ E k) }" + let ?E = "\j. {\k\K. E' k| E' K. finite K \ K \ {} \ K \ I j \ (\k\K. E' k \ E k) }" from indep have E: "\j i. j \ J \ i \ I j \ E i \ events" unfolding indep_sets_def by auto @@ -447,7 +447,7 @@ with * L_inj show "k = j" by auto qed (insert *, simp) } note k_simp[simp] = this - let "?E' l" = "E' (k l) l" + let ?E' = "\l. E' (k l) l" have "prob (\j\K. A j) = prob (\l\(\k\K. L k). ?E' l)" by (auto simp: A intro!: arg_cong[where f=prob]) also have "\ = (\l\(\k\K. L k). prob (?E' l))" @@ -658,7 +658,7 @@ fix i show "Int_stable \space = space M, sets = {F i}\" unfolding Int_stable_def by simp qed - let "?Q n" = "\i\{n..}. F i" + let ?Q = "\n. \i\{n..}. F i" show "(\n. \m\{n..}. F m) \ terminal_events (\i. sigma_sets (space M) {F i})" unfolding terminal_events_def proof @@ -691,7 +691,7 @@ proof (rule indep_setsI[OF F(1)]) fix A J assume J: "J \ {}" "J \ I" "finite J" assume A: "\j\J. A j \ F j" - let "?A j" = "if j \ J then A j else space M" + let ?A = "\j. if j \ J then A j else space M" have "prob (\j\I. ?A j) = prob (\j\J. A j)" using subset_trans[OF F(1) space_closed] J A by (auto intro!: arg_cong[where f=prob] split: split_if_asm) blast diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Infinite_Product_Measure.thy --- a/src/HOL/Probability/Infinite_Product_Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -52,7 +52,7 @@ from J.sigma_finite_pairs guess F .. note F = this then have [simp,intro]: "\k i. k \ J \ F k i \ sets (M k)" by auto - let "?F i" = "\\<^isub>E k\J. F k i" + let ?F = "\i. \\<^isub>E k\J. F k i" let ?J = "product_algebra_generator J M \ measure := measure (Pi\<^isub>M J M) \" have "?R \ measure_preserving (\\<^isub>M i\K. M i) (sigma ?J)" proof (rule K.measure_preserving_Int_stable) @@ -448,7 +448,7 @@ "K - J \ {}" "K - J \ I" "\G Z = measure (Pi\<^isub>M K M) X" by (auto simp: subset_insertI) - let "?M y" = "merge J y (K - J) -` emb (J \ K) K X \ space (Pi\<^isub>M (K - J) M)" + let ?M = "\y. merge J y (K - J) -` emb (J \ K) K X \ space (Pi\<^isub>M (K - J) M)" { fix y assume y: "y \ space (Pi\<^isub>M J M)" note * = merge_emb[OF `K \ I` `J \ I` y, of X] moreover @@ -487,7 +487,7 @@ by (intro KmJ.measure_le_1 merge_in_G(2)[OF x]) } note le_1 = this - let "?q y" = "\G (merge J y (I - J) -` Z \ space (Pi\<^isub>M I M))" + let ?q = "\y. \G (merge J y (I - J) -` Z \ space (Pi\<^isub>M I M))" have "?q \ borel_measurable (Pi\<^isub>M J M)" unfolding `Z = emb I K X` using J K merge_in_G(3) by (simp add: merge_in_G \G_eq measure_fold_measurable @@ -536,15 +536,15 @@ using \G_spec[of "J 0" "A 0" "X 0"] J A_eq by (auto intro!: INF_lower2[of 0] J.measure_le_1) - let "?M K Z y" = "merge K y (I - K) -` Z \ space (Pi\<^isub>M I M)" + let ?M = "\K Z y. merge K y (I - K) -` Z \ space (Pi\<^isub>M I M)" { fix Z k assume Z: "range Z \ sets ?G" "decseq Z" "\n. ?a / 2^k \ \G (Z n)" then have Z_sets: "\n. Z n \ sets ?G" by auto fix J' assume J': "J' \ {}" "finite J'" "J' \ I" interpret J': finite_product_prob_space M J' by default fact+ - let "?q n y" = "\G (?M J' (Z n) y)" - let "?Q n" = "?q n -` {?a / 2^(k+1) ..} \ space (Pi\<^isub>M J' M)" + let ?q = "\n y. \G (?M J' (Z n) y)" + let ?Q = "\n. ?q n -` {?a / 2^(k+1) ..} \ space (Pi\<^isub>M J' M)" { fix n have "?q n \ borel_measurable (Pi\<^isub>M J' M)" using Z J' by (intro fold(1)) auto @@ -599,13 +599,14 @@ then have "\w\space (Pi\<^isub>M J' M). \n. ?a / 2 ^ (k + 1) \ ?q n w" by auto } note Ex_w = this - let "?q k n y" = "\G (?M (J k) (A n) y)" + let ?q = "\k n y. \G (?M (J k) (A n) y)" have "\n. ?a / 2 ^ 0 \ \G (A n)" by (auto intro: INF_lower) from Ex_w[OF A(1,2) this J(1-3), of 0] guess w0 .. note w0 = this - let "?P k wk w" = - "w \ space (Pi\<^isub>M (J (Suc k)) M) \ restrict w (J k) = wk \ (\n. ?a / 2 ^ (Suc k + 1) \ ?q (Suc k) n w)" + let ?P = + "\k wk w. w \ space (Pi\<^isub>M (J (Suc k)) M) \ restrict w (J k) = wk \ + (\n. ?a / 2 ^ (Suc k + 1) \ ?q (Suc k) n w)" def w \ "nat_rec w0 (\k wk. Eps (?P k wk))" { fix k have w: "w k \ space (Pi\<^isub>M (J k) M) \ @@ -1015,7 +1016,7 @@ fixes E :: "nat \ 'a set" assumes E: "\i. E i \ sets (M i)" shows "(\n. \i\n. M.\' i (E i)) ----> \' (Pi UNIV E)" proof - - let "?E n" = "emb UNIV {..n} (Pi\<^isub>E {.. n} E)" + let ?E = "\n. emb UNIV {..n} (Pi\<^isub>E {.. n} E)" { fix n :: nat interpret n: finite_product_prob_space M "{..n}" by default auto have "(\i\n. M.\' i (E i)) = n.\' (Pi\<^isub>E {.. n} E)" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Information.thy --- a/src/HOL/Probability/Information.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Information.thy Tue Feb 28 21:53:36 2012 +0100 @@ -748,8 +748,8 @@ proof - interpret MX: finite_prob_space "MX\measure := ereal\distribution X\" using MX by (rule distribution_finite_prob_space) - let "?X x" = "distribution X {x}" - let "?XX x y" = "joint_distribution X X {(x, y)}" + let ?X = "\x. distribution X {x}" + let ?XX = "\x y. joint_distribution X X {(x, y)}" { fix x y :: 'c { assume "x \ y" @@ -803,7 +803,7 @@ assumes X: "simple_function M X" shows "\(X) \ log b (card (X ` space M \ {x. distribution X {x} \ 0}))" proof - - let "?p x" = "distribution X {x}" + let ?p = "\x. distribution X {x}" have "\(X) = (\x\X`space M. ?p x * log b (1 / ?p x))" unfolding entropy_eq[OF X] setsum_negf[symmetric] by (auto intro!: setsum_cong simp: log_simps) @@ -1117,10 +1117,10 @@ proof - interpret MX: finite_sigma_algebra MX using MX by simp interpret MZ: finite_sigma_algebra MZ using MZ by simp - let "?XXZ x y z" = "joint_distribution X (\x. (X x, Z x)) {(x, y, z)}" - let "?XZ x z" = "joint_distribution X Z {(x, z)}" - let "?Z z" = "distribution Z {z}" - let "?f x y z" = "log b (?XXZ x y z * ?Z z / (?XZ x z * ?XZ y z))" + let ?XXZ = "\x y z. joint_distribution X (\x. (X x, Z x)) {(x, y, z)}" + let ?XZ = "\x z. joint_distribution X Z {(x, z)}" + let ?Z = "\z. distribution Z {z}" + let ?f = "\x y z. log b (?XXZ x y z * ?Z z / (?XZ x z * ?XZ y z))" { fix x z have "?XXZ x x z = ?XZ x z" unfolding distribution_def by (auto intro!: arg_cong[where f=\']) } note this[simp] @@ -1183,9 +1183,9 @@ assumes X: "simple_function M X" and Z: "simple_function M Z" shows "\(X ; Z) = \(X) - \(X | Z)" proof - - let "?XZ x z" = "joint_distribution X Z {(x, z)}" - let "?Z z" = "distribution Z {z}" - let "?X x" = "distribution X {x}" + let ?XZ = "\x z. joint_distribution X Z {(x, z)}" + let ?Z = "\z. distribution Z {z}" + let ?X = "\x. distribution X {x}" note fX = X[THEN simple_function_imp_finite_random_variable] note fZ = Z[THEN simple_function_imp_finite_random_variable] note finite_distribution_order[OF fX fZ, simp] @@ -1214,9 +1214,9 @@ assumes X: "simple_function M X" and Y: "simple_function M Y" shows "\(\x. (X x, Y x)) = \(X) + \(Y|X)" proof - - let "?XY x y" = "joint_distribution X Y {(x, y)}" - let "?Y y" = "distribution Y {y}" - let "?X x" = "distribution X {x}" + let ?XY = "\x y. joint_distribution X Y {(x, y)}" + let ?Y = "\y. distribution Y {y}" + let ?X = "\x. distribution X {x}" note fX = X[THEN simple_function_imp_finite_random_variable] note fY = Y[THEN simple_function_imp_finite_random_variable] note finite_distribution_order[OF fX fY, simp] @@ -1352,9 +1352,9 @@ assumes svi: "subvimage (space M) X P" shows "\(X) = \(P) + \(X|P)" proof - - let "?XP x p" = "joint_distribution X P {(x, p)}" - let "?X x" = "distribution X {x}" - let "?P p" = "distribution P {p}" + let ?XP = "\x p. joint_distribution X P {(x, p)}" + let ?X = "\x. distribution X {x}" + let ?P = "\p. distribution P {p}" note fX = sf(1)[THEN simple_function_imp_finite_random_variable] note fP = sf(2)[THEN simple_function_imp_finite_random_variable] note finite_distribution_order[OF fX fP, simp] diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Tue Feb 28 21:53:36 2012 +0100 @@ -331,7 +331,7 @@ "\i x. real (f x i) = (if real i \ u x then i * 2 ^ i else real (natfloor (real (u x) * 2 ^ i)))" unfolding f_def by auto - let "?g j x" = "real (f x j) / 2^j :: ereal" + let ?g = "\j x. real (f x j) / 2^j :: ereal" show ?thesis proof (intro exI[of _ ?g] conjI allI ballI) fix i @@ -567,7 +567,7 @@ shows "integral\<^isup>S M f = (\A\(\x. f -` {f x} \ g -` {g x} \ space M) ` space M. the_elem (f`A) * \ A)" (is "_ = setsum _ (?p ` space M)") proof- - let "?sub x" = "?p ` (f -` {x} \ space M)" + let ?sub = "\x. ?p ` (f -` {x} \ space M)" let ?SIGMA = "Sigma (f`space M) ?sub" have [intro]: @@ -659,7 +659,7 @@ and mono: "AE x. f x \ g x" shows "integral\<^isup>S M f \ integral\<^isup>S M g" proof - - let "?S x" = "(g -` {g x} \ space M) \ (f -` {f x} \ space M)" + let ?S = "\x. (g -` {g x} \ space M) \ (f -` {f x} \ space M)" have *: "\x. g -` {g x} \ f -` {f x} \ space M = ?S x" "\x. f -` {f x} \ g -` {g x} \ space M = ?S x" by auto show ?thesis @@ -899,7 +899,7 @@ let ?G = "{x \ space M. \ g x \ \}" note gM = g(1)[THEN borel_measurable_simple_function] have \G_pos: "0 \ \ ?G" using gM by auto - let "?g y x" = "if g x = \ then y else max 0 (g x)" + let ?g = "\y x. if g x = \ then y else max 0 (g x)" from g gM have g_in_A: "\y. 0 \ y \ y \ \ \ ?g y \ ?A" apply (safe intro!: simple_function_max simple_function_If) apply (force simp: max_def le_fun_def split: split_if_asm)+ @@ -941,7 +941,7 @@ fix n assume n: "simple_function M n" "n \ max 0 \ u" from ae[THEN AE_E] guess N . note N = this then have ae_N: "AE x. x \ N" by (auto intro: AE_not_in) - let "?n x" = "n x * indicator (space M - N) x" + let ?n = "\x. n x * indicator (space M - N) x" have "AE x. n x \ ?n x" "simple_function M ?n" using n N ae_N by auto moreover @@ -974,7 +974,7 @@ lemma (in measure_space) positive_integral_eq_simple_integral: assumes f: "simple_function M f" "\x. 0 \ f x" shows "integral\<^isup>P M f = integral\<^isup>S M f" proof - - let "?f x" = "f x * indicator (space M) x" + let ?f = "\x. f x * indicator (space M) x" have f': "simple_function M ?f" using f by auto with f(2) have [simp]: "max 0 \ ?f = ?f" by (auto simp: fun_eq_iff max_def split: split_indicator) @@ -1010,11 +1010,11 @@ using u(3) by auto fix a :: ereal assume "0 < a" "a < 1" hence "a \ 0" by auto - let "?B i" = "{x \ space M. a * u x \ f i x}" + let ?B = "\i. {x \ space M. a * u x \ f i x}" have B: "\i. ?B i \ sets M" using f `simple_function M u` by (auto simp: borel_measurable_simple_function) - let "?uB i x" = "u x * indicator (?B i) x" + let ?uB = "\i x. u x * indicator (?B i) x" { fix i have "?B i \ ?B (Suc i)" proof safe @@ -1027,7 +1027,7 @@ note B_u = Int[OF u(1)[THEN simple_functionD(2)] B] - let "?B' i n" = "(u -` {i} \ space M) \ ?B n" + let ?B' = "\i n. (u -` {i} \ space M) \ ?B n" have measure_conv: "\i. \ (u -` {i} \ space M) = (SUP n. \ (?B' i n))" proof - fix i @@ -1126,7 +1126,7 @@ from f have "AE x. \i. f i x \ f (Suc i) x \ 0 \ f i x" by (simp add: AE_all_countable) from this[THEN AE_E] guess N . note N = this - let "?f i x" = "if x \ space M - N then f i x else 0" + let ?f = "\i x. if x \ space M - N then f i x else 0" have f_eq: "AE x. \i. ?f i x = f i x" using N by (auto intro!: AE_I[of _ N]) then have "(\\<^isup>+ x. (SUP i. f i x) \M) = (\\<^isup>+ x. (SUP i. ?f i x) \M)" by (auto intro!: positive_integral_cong_AE) @@ -1202,7 +1202,7 @@ interpret T: measure_space M' by (rule measure_space_vimage[OF T]) from T.borel_measurable_implies_simple_function_sequence'[OF f] guess f' . note f' = this - let "?f i x" = "f' i (T x)" + let ?f = "\i x. f' i (T x)" have inc: "incseq ?f" using f' by (force simp: le_fun_def incseq_def) have sup: "\x. (SUP i. ?f i x) = max 0 (f (T x))" using f'(4) . @@ -1225,7 +1225,7 @@ note u = positive_integral_monotone_convergence_simple[OF this(2,5,1)] this from borel_measurable_implies_simple_function_sequence'[OF g(1)] guess v . note v = positive_integral_monotone_convergence_simple[OF this(2,5,1)] this - let "?L' i x" = "a * u i x + v i x" + let ?L' = "\i x. a * u i x + v i x" have "?L \ borel_measurable M" using assms by auto from borel_measurable_implies_simple_function_sequence'[OF this] guess l . @@ -1494,7 +1494,7 @@ from G(4) g(2) have G_M': "AE x in M'. (SUP i. G i x) = g x" by (auto intro!: ac split: split_max) { fix i - let "?I y x" = "indicator (G i -` {y} \ space M) x" + let ?I = "\y x. indicator (G i -` {y} \ space M) x" { fix x assume *: "x \ space M" "0 \ f x" "0 \ g x" then have [simp]: "G i ` space M \ {y. G i x = y \ x \ space M} = {G i x}" by auto from * G' G have "(\y\G i`space M. y * (f x * ?I y x)) = f x * (\y\G i`space M. (y * ?I y x))" @@ -1546,7 +1546,7 @@ then have "0 \ r" by (auto simp add: ereal_zero_less_0_iff) } note gt_1 = this assume *: "integral\<^isup>P M u = 0" - let "?M n" = "{x \ space M. 1 \ real (n::nat) * u x}" + let ?M = "\n. {x \ space M. 1 \ real (n::nat) * u x}" have "0 = (SUP n. \ (?M n \ ?A))" proof - { fix n :: nat @@ -1618,7 +1618,7 @@ proof - interpret R: measure_space ?R by (rule restricted_measure_space) fact - let "?I g x" = "g x * indicator A x :: ereal" + let ?I = "\g x. g x * indicator A x :: ereal" show ?thesis unfolding positive_integral_def unfolding simple_function_restricted[OF A] @@ -1846,10 +1846,10 @@ and f_def: "\x. f x = u x - v x" and pos: "\x. 0 \ u x" "\x. 0 \ v x" shows "integrable M f" and "integral\<^isup>L M f = integral\<^isup>L M u - integral\<^isup>L M v" proof - - let "?f x" = "max 0 (ereal (f x))" - let "?mf x" = "max 0 (ereal (- f x))" - let "?u x" = "max 0 (ereal (u x))" - let "?v x" = "max 0 (ereal (v x))" + let ?f = "\x. max 0 (ereal (f x))" + let ?mf = "\x. max 0 (ereal (- f x))" + let ?u = "\x. max 0 (ereal (u x))" + let ?v = "\x. max 0 (ereal (v x))" from borel_measurable_diff[of u v] integrable have f_borel: "?f \ borel_measurable M" and @@ -1886,12 +1886,12 @@ shows "integrable M (\t. a * f t + g t)" and "(\ t. a * f t + g t \M) = a * integral\<^isup>L M f + integral\<^isup>L M g" (is ?EQ) proof - - let "?f x" = "max 0 (ereal (f x))" - let "?g x" = "max 0 (ereal (g x))" - let "?mf x" = "max 0 (ereal (- f x))" - let "?mg x" = "max 0 (ereal (- g x))" - let "?p t" = "max 0 (a * f t) + max 0 (g t)" - let "?n t" = "max 0 (- (a * f t)) + max 0 (- g t)" + let ?f = "\x. max 0 (ereal (f x))" + let ?g = "\x. max 0 (ereal (g x))" + let ?mf = "\x. max 0 (ereal (- f x))" + let ?mg = "\x. max 0 (ereal (- g x))" + let ?p = "\t. max 0 (a * f t) + max 0 (g t)" + let ?n = "\t. max 0 (- (a * f t)) + max 0 (- g t)" from assms have linear: "(\\<^isup>+ x. ereal a * ?f x + ?g x \M) = ereal a * integral\<^isup>P M ?f + integral\<^isup>P M ?g" @@ -2353,7 +2353,7 @@ show "\u' x\ \ w x" using u'_bound[OF x] . qed - let "?diff n x" = "2 * w x - \u n x - u' x\" + let ?diff = "\n x. 2 * w x - \u n x - u' x\" have diff: "\n. integrable M (\x. \u n x - u' x\)" using w u `integrable M u'` by (auto intro!: integral_add integral_diff integral_cmult integrable_abs) @@ -2468,7 +2468,7 @@ from bchoice[OF this] obtain w where w: "\x. x \ space M \ (\i. \f i x\) sums w x" by auto - let "?w y" = "if y \ space M then w y else 0" + let ?w = "\y. if y \ space M then w y else 0" obtain x where abs_sum: "(\i. (\x. \f i x\ \M)) sums x" using sums unfolding summable_def .. @@ -2484,8 +2484,8 @@ have 3: "integrable M ?w" proof (rule integral_monotone_convergence(1)) - let "?F n y" = "(\i = 0..f i y\)" - let "?w' n y" = "if y \ space M then ?F n y else 0" + let ?F = "\n y. (\i = 0..f i y\)" + let ?w' = "\n y. if y \ space M then ?F n y else 0" have "\n. integrable M (?F n)" using borel by (auto intro!: integral_setsum integrable_abs) thus "\n. integrable M (?w' n)" by (simp cong: integrable_cong) @@ -2522,8 +2522,8 @@ shows "integrable M f" and "(\r. enum r * real (\ (f -` {enum r} \ space M))) sums integral\<^isup>L M f" (is ?sums) proof - - let "?A r" = "f -` {enum r} \ space M" - let "?F r x" = "enum r * indicator (?A r) x" + let ?A = "\r. f -` {enum r} \ space M" + let ?F = "\r x. enum r * indicator (?A r) x" have enum_eq: "\r. enum r * real (\ (?A r)) = integral\<^isup>L M (?F r)" using f fin by (simp add: borel_measurable_vimage integral_cmul_indicator) @@ -2579,8 +2579,8 @@ and "(\x. f x \M) = (\ r \ f`space M. r * real (\ (f -` {r} \ space M)))" (is "?integral") proof - - let "?A r" = "f -` {r} \ space M" - let "?S x" = "\r\f`space M. r * indicator (?A r) x" + let ?A = "\r. f -` {r} \ space M" + let ?S = "\x. \r\f`space M. r * indicator (?A r) x" { fix x assume "x \ space M" have "f x = (\r\f`space M. if x \ ?A r then r else 0)" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -133,8 +133,8 @@ fix A :: "nat \ 'b set" assume rA: "range A \ sets lebesgue" "disjoint_family A" then have A[simp, intro]: "\i n. (indicator (A i) :: _ \ real) integrable_on cube n" by (auto dest: lebesgueD) - let "?m n i" = "integral (cube n) (indicator (A i) :: _\real)" - let "?M n I" = "integral (cube n) (indicator (\i\I. A i) :: _\real)" + let ?m = "\n i. integral (cube n) (indicator (A i) :: _\real)" + let ?M = "\n I. integral (cube n) (indicator (\i\I. A i) :: _\real)" have nn[simp, intro]: "\i n. 0 \ ?m n i" by (auto intro!: integral_nonneg) assume "(\i. A i) \ sets lebesgue" then have UN_A[simp, intro]: "\i n. (indicator (\i. A i) :: _ \ real) integrable_on cube n" @@ -560,8 +560,8 @@ shows "((\x. real (f x)) has_integral (real (integral\<^isup>S lebesgue f))) UNIV" unfolding simple_integral_def space_lebesgue proof (subst lebesgue_simple_function_indicator) - let "?M x" = "lebesgue.\ (f -` {x} \ UNIV)" - let "?F x" = "indicator (f -` {x})" + let ?M = "\x. lebesgue.\ (f -` {x} \ UNIV)" + let ?F = "\x. indicator (f -` {x})" { fix x y assume "y \ range f" from subsetD[OF f' this] have "y * ?F y x = ereal (real y * ?F y x)" by (cases rule: ereal2_cases[of y "?F y x"]) @@ -637,7 +637,7 @@ guess u . note u = this have SUP_eq: "\x. (SUP i. u i x) = f x" using u(4) f(2)[THEN subsetD] by (auto split: split_max) - let "?u i x" = "real (u i x)" + let ?u = "\i x. real (u i x)" note u_eq = lebesgue.positive_integral_eq_simple_integral[OF u(1,5), symmetric] { fix i note u_eq @@ -986,7 +986,7 @@ (is "_ = ?\ X") proof - let ?E = "\space = UNIV, sets = range (\(a,b). {a::real .. b})\ :: real algebra" - let "?M \" = "\space = space ?E, sets = sets (sigma ?E), measure = \\ :: real measure_space" + let ?M = "\\. \space = space ?E, sets = sets (sigma ?E), measure = \\ :: real measure_space" have *: "?M (measure lebesgue) = lborel" unfolding borel_eq_atLeastAtMost[symmetric] by (simp add: lborel_def lebesgue_def) diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Measure.thy --- a/src/HOL/Probability/Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -439,7 +439,7 @@ shows "\ (\i\I. A i) \ (\i\I. \ (A i))" using assms proof induct case (insert i I) - then have "(\i\I. A i) \ sets M" by (auto intro: finite_UN) + then have "(\i\I. A i) \ sets M" by auto then have "\ (\i\insert i I. A i) \ \ (A i) + \ (\i\I. A i)" using insert by (simp add: measure_subadditive) also have "\ \ (\i\insert i I. \ (A i))" @@ -458,7 +458,7 @@ by (simp add: disjoint_family_disjointed comp_def) also have "\ \ (\i. \ (f i))" using range_disjointed_sets[OF assms] assms - by (auto intro!: suminf_le_pos measure_mono positive_measure disjointed_subset) + by (auto intro!: suminf_le_pos measure_mono disjointed_subset) finally show ?thesis . qed @@ -509,7 +509,7 @@ assumes "X \ sets (sigma E)" shows "\ X = \ X" proof - - let "?D F" = "{D. D \ sets (sigma E) \ \ (F \ D) = \ (F \ D)}" + let ?D = "\F. {D. D \ sets (sigma E) \ \ (F \ D) = \ (F \ D)}" interpret M: measure_space ?M where "space ?M = space E" and "sets ?M = sets (sigma E)" and "measure ?M = \" by (simp_all add: M) interpret N: measure_space ?N @@ -559,7 +559,7 @@ have "\D. D \ sets (sigma E) \ \ (F \ D) = \ (F \ D)" by (subst (asm) *) auto } note * = this - let "?A i" = "A i \ X" + let ?A = "\i. A i \ X" have A': "range ?A \ sets (sigma E)" "incseq ?A" using A(1,2) `X \ sets (sigma E)` by (auto simp: incseq_def) { fix i have "\ (?A i) = \ (?A i)" @@ -1015,7 +1015,7 @@ proof (rule measure_unique_Int_stable[OF E A(1,2,3) _ _ eq _ X]) interpret M: measure_space M by fact interpret N: measure_space N by fact - let "?T X" = "T -` X \ space N" + let ?T = "\X. T -` X \ space N" show "measure_space \space = space E, sets = sets (sigma E), measure = measure M\" by (rule M.measure_space_cong) (auto simp: M) show "measure_space \space = space E, sets = sets (sigma E), measure = \X. measure N (?T X)\" (is "measure_space ?E") @@ -1397,7 +1397,7 @@ lemma (in finite_measure_space) sum_over_space: "(\x\space M. \ {x}) = \ (space M)" using measure_setsum[of "space M" "\i. {i}"] - by (simp add: sets_eq_Pow disjoint_family_on_def finite_space) + by (simp add: disjoint_family_on_def finite_space) lemma (in finite_measure_space) finite_measure_singleton: assumes A: "A \ space M" shows "\' A = (\x\A. \' {x})" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Probability_Measure.thy --- a/src/HOL/Probability/Probability_Measure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Probability_Measure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -380,7 +380,7 @@ assumes q: "integrable M (\x. q (X x))" "convex_on I q" shows "q (expectation X) \ expectation (\x. q (X x))" proof - - let "?F x" = "Inf ((\t. (q x - q t) / (x - t)) ` ({x<..} \ I))" + let ?F = "\x. Inf ((\t. (q x - q t) / (x - t)) ` ({x<..} \ I))" from not_empty X(2) have "I \ {}" by auto from I have "open I" by auto @@ -741,7 +741,7 @@ proof (subst finite_measure_finite_Union[symmetric]) interpret MX: finite_sigma_algebra MX using X by auto show "finite (space MX)" using MX.finite_space . - let "?d i" = "(\x. (X x, Y x)) -` ({i} \ B) \ space M" + let ?d = "\i. (\x. (X x, Y x)) -` ({i} \ B) \ space M" { fix i assume "i \ space MX" moreover have "?d i = (X -` {i} \ space M) \ (Y -` B \ space M)" by auto ultimately show "?d i \ events" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Radon_Nikodym.thy --- a/src/HOL/Probability/Radon_Nikodym.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Radon_Nikodym.thy Tue Feb 28 21:53:36 2012 +0100 @@ -17,7 +17,7 @@ measure: "\i. \ (A i) \ \" and disjoint: "disjoint_family A" using disjoint_sigma_finite by auto - let "?B i" = "2^Suc i * \ (A i)" + let ?B = "\i. 2^Suc i * \ (A i)" have "\i. \x. 0 < x \ x < inverse (?B i)" proof fix i have Ai: "A i \ sets M" using range by auto @@ -28,7 +28,7 @@ from choice[OF this] obtain n where n: "\i. 0 < n i" "\i. n i < inverse (2^Suc i * \ (A i))" by auto { fix i have "0 \ n i" using n(1)[of i] by auto } note pos = this - let "?h x" = "\i. n i * indicator (A i) x" + let ?h = "\x. \i. n i * indicator (A i) x" show ?thesis proof (safe intro!: bexI[of _ ?h] del: notI) have "\i. A i \ sets M" @@ -132,8 +132,8 @@ (\B\sets M. B \ A \ - e < \' B - finite_measure.\' (M\measure := \\) B)" proof - interpret M': finite_measure "M\measure := \\" by fact - let "?d A" = "\' A - M'.\' A" - let "?A A" = "if (\B\sets M. B \ space M - A \ -e < ?d B) + let ?d = "\A. \' A - M'.\' A" + let ?A = "\A. if (\B\sets M. B \ space M - A \ -e < ?d B) then {} else (SOME B. B \ sets M \ B \ space M - A \ ?d B \ -e)" def A \ "\n. ((\B. B \ ?A B) ^^ n) {}" @@ -247,9 +247,9 @@ proof - interpret M': finite_measure ?M' where "space ?M' = space M" and "sets ?M' = sets M" and "measure ?M' = \" by fact auto - let "?d A" = "\' A - M'.\' A" - let "?P A B n" = "A \ sets M \ A \ B \ ?d B \ ?d A \ (\C\sets M. C \ A \ - 1 / real (Suc n) < ?d C)" - let "?r S" = "restricted_space S" + let ?d = "\A. \' A - M'.\' A" + let ?P = "\A B n. A \ sets M \ A \ B \ ?d B \ ?d A \ (\C\sets M. C \ A \ - 1 / real (Suc n) < ?d C)" + let ?r = "\S. restricted_space S" { fix S n assume S: "S \ sets M" note r = M'.restricted_finite_measure[of S] restricted_finite_measure[OF S] S then have "finite_measure (?r S)" "0 < 1 / real (Suc n)" @@ -342,7 +342,7 @@ (\\<^isup>+x. g x * indicator (?A \ A) x \M) + (\\<^isup>+x. f x * indicator ((space M - ?A) \ A) x \M)" using f g sets unfolding G_def - by (auto cong: positive_integral_cong intro!: positive_integral_add borel_measurable_indicator) + by (auto cong: positive_integral_cong intro!: positive_integral_add) also have "\ \ \ (?A \ A) + \ ((space M - ?A) \ A)" using f g sets unfolding G_def by (auto intro!: add_mono) also have "\ = \ A" @@ -388,9 +388,9 @@ qed from choice[OF this] obtain gs where "\i. gs i \ G" "\n. integral\<^isup>P M (gs n) = ys n" by auto hence y_eq: "?y = (SUP i. integral\<^isup>P M (gs i))" using ys by auto - let "?g i x" = "Max ((\n. gs n x) ` {..i})" + let ?g = "\i x. Max ((\n. gs n x) ` {..i})" def f \ "\x. SUP i. ?g i x" - let "?F A x" = "f x * indicator A x" + let ?F = "\A x. f x * indicator A x" have gs_not_empty: "\i x. (\n. gs n x) ` {..i} \ {}" by auto { fix i have "?g i \ G" proof (induct i) @@ -420,7 +420,7 @@ have "\x. 0 \ f x" unfolding f_def using `\i. gs i \ G` by (auto intro!: SUP_upper2 Max_ge_iff[THEN iffD2] simp: G_def) - let "?t A" = "\ A - (\\<^isup>+x. ?F A x \M)" + let ?t = "\A. \ A - (\\<^isup>+x. ?F A x \M)" let ?M = "M\ measure := ?t\" interpret M: sigma_algebra ?M by (intro sigma_algebra_cong) auto @@ -522,7 +522,7 @@ using M'.finite_measure b finite_measure M.positive_measure[OF B(1)] by (cases rule: ereal2_cases[of "?t B" "b * \ B"]) auto } note bM_le_t = this - let "?f0 x" = "f x + b * indicator A0 x" + let ?f0 = "\x. f x + b * indicator A0 x" { fix A assume A: "A \ sets M" hence "A \ A0 \ sets M" using `A0 \ sets M` by auto have "(\\<^isup>+x. ?f0 x * indicator A x \M) = @@ -550,8 +550,7 @@ by (cases "\\<^isup>+x. ?F A x \M", cases "\ A") auto finally have "(\\<^isup>+x. ?f0 x * indicator A x \M) \ \ A" . } hence "?f0 \ G" using `A0 \ sets M` b `f \ G` unfolding G_def - by (auto intro!: borel_measurable_indicator borel_measurable_ereal_add - borel_measurable_ereal_times ereal_add_nonneg_nonneg) + by (auto intro!: ereal_add_nonneg_nonneg) have real: "?t (space M) \ \" "?t A0 \ \" "b * \ (space M) \ \" "b * \ A0 \ \" using `A0 \ sets M` b @@ -633,7 +632,7 @@ have "{} \ ?Q" using v.empty_measure by auto then have Q_not_empty: "?Q \ {}" by blast have "?a \ \ (space M)" using sets_into_space - by (auto intro!: SUP_least measure_mono top) + by (auto intro!: SUP_least measure_mono) then have "?a \ \" using finite_measure_of_space by auto from SUPR_countable_SUPR[OF Q_not_empty, of \] @@ -643,7 +642,7 @@ from choice[OF this] obtain Q' where Q': "\i. Q'' i = \ (Q' i)" "\i. Q' i \ ?Q" by auto then have a_Lim: "?a = (SUP i::nat. \ (Q' i))" using a by simp - let "?O n" = "\i\n. Q' i" + let ?O = "\n. \i\n. Q' i" have Union: "(SUP i. \ (?O i)) = \ (\i. ?O i)" proof (rule continuity_from_below[of ?O]) show "range ?O \ sets M" using Q' by (auto intro!: finite_UN) @@ -675,7 +674,7 @@ using O_in_G[of i] by (auto intro!: exI[of _ "?O i"]) qed qed - let "?O_0" = "(\i. ?O i)" + let ?O_0 = "(\i. ?O i)" have "?O_0 \ sets M" using Q' by auto def Q \ "\i. case i of 0 \ Q' 0 | Suc n \ ?O (Suc n) - ?O n" { fix i have "Q i \ sets M" unfolding Q_def using Q'[of 0] by (cases i) (auto intro: O_sets) } @@ -710,10 +709,9 @@ fix i have "?O i \ A \ ?Q" proof (safe del: notI) show "?O i \ A \ sets M" using O_sets A by auto - from O_in_G[of i] - moreover have "\ (?O i \ A) \ \ (?O i) + \ A" + from O_in_G[of i] have "\ (?O i \ A) \ \ (?O i) + \ A" using v.measure_subadditive[of "?O i" A] A O_sets by auto - ultimately show "\ (?O i \ A) \ \" + with O_in_G[of i] show "\ (?O i \ A) \ \" using `\ A \ \` by auto qed then show "\ (?O i \ A) \ ?a" by (rule SUP_upper) @@ -800,7 +798,7 @@ and f: "\A i. A \ sets M \ \ (Q i \ A) = (\\<^isup>+x. f i x * indicator (Q i \ A) x \M)" by auto - let "?f x" = "(\i. f i x * indicator (Q i) x) + \ * indicator Q0 x" + let ?f = "\x. (\i. f i x * indicator (Q i) x) + \ * indicator Q0 x" show ?thesis proof (safe intro!: bexI[of _ ?f]) show "?f \ borel_measurable M" using Q0 borel Q_sets @@ -850,7 +848,7 @@ nn: "\x. 0 \ h x" and pos: "\x. x \ space M \ 0 < h x" and "\x. x \ space M \ h x < \" by auto - let "?T A" = "(\\<^isup>+x. h x * indicator A x \M)" + let ?T = "\A. (\\<^isup>+x. h x * indicator A x \M)" let ?MT = "M\ measure := ?T \" interpret T: finite_measure ?MT where "space ?MT = space M" and "sets ?MT = sets M" and "measure ?MT = ?T" @@ -872,7 +870,7 @@ show ?thesis proof (safe intro!: bexI[of _ "\x. h x * f x"]) show "(\x. h x * f x) \ borel_measurable M" - using borel f_borel by (auto intro: borel_measurable_ereal_times) + using borel f_borel by auto show "\x. 0 \ h x * f x" using nn f_borel by auto fix A assume "A \ sets M" then show "\ A = (\\<^isup>+x. h x * f x * indicator A x \M)" @@ -933,8 +931,8 @@ (is "\A. A \ sets M \ ?P f A = ?P f' A") shows "AE x. f x = f' x" proof - - let "?\ A" = "?P f A" and "?\' A" = "?P f' A" - let "?f A x" = "f x * indicator A x" and "?f' A x" = "f' x * indicator A x" + let ?\ = "\A. ?P f A" and ?\' = "\A. ?P f' A" + let ?f = "\A x. f x * indicator A x" and ?f' = "\A x. f' x * indicator A x" interpret M: measure_space "M\ measure := ?\\" using borel(1) pos(1) by (rule measure_space_density) simp have ac: "absolutely_continuous ?\" @@ -957,7 +955,7 @@ proof (rule AE_I') { fix f :: "'a \ ereal" assume borel: "f \ borel_measurable M" and eq: "\A. A \ sets M \ ?\ A = (\\<^isup>+x. f x * indicator A x \M)" - let "?A i" = "Q0 \ {x \ space M. f x < (i::nat)}" + let ?A = "\i. Q0 \ {x \ space M. f x < (i::nat)}" have "(\i. ?A i) \ null_sets" proof (rule null_sets_UN) fix i ::nat have "?A i \ sets M" @@ -1079,7 +1077,7 @@ apply (rule_tac Int) by (cases i) (auto intro: measurable_sets[OF f(1)]) } note A_in_sets = this - let "?A n" = "case prod_decode n of (i,j) \ A i \ Q j" + let ?A = "\n. case prod_decode n of (i,j) \ A i \ Q j" show "sigma_finite_measure ?N" proof (default, intro exI conjI subsetI allI) fix x assume "x \ range ?A" diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/Sigma_Algebra.thy --- a/src/HOL/Probability/Sigma_Algebra.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/Sigma_Algebra.thy Tue Feb 28 21:53:36 2012 +0100 @@ -214,7 +214,7 @@ then have "(\i. A i) = (\s\sets M \ range A. s)" by auto also have "(\s\sets M \ range A. s) \ sets M" - using `finite (sets M)` by (auto intro: finite_UN) + using `finite (sets M)` by auto finally show "(\i. A i) \ sets M" . qed @@ -243,7 +243,7 @@ assumes "A`X \ sets M" shows "(\x\X. A x) \ sets M" proof - - let "?A i" = "if i \ X then A i else {}" + let ?A = "\i. if i \ X then A i else {}" from assms have "range ?A \ sets M" by auto with countable_nat_UN[of "?A \ from_nat"] countable_UN_eq[of ?A M] have "(\x. ?A x) \ sets M" by auto @@ -1563,7 +1563,7 @@ unfolding sigma_algebra_eq_Int_stable Int_stable_def proof (intro ballI) fix A B assume "A \ sets (dynkin M)" "B \ sets (dynkin M)" - let "?D E" = "\ space = space M, + let ?D = "\E. \ space = space M, sets = {Q. Q \ space M \ Q \ E \ sets (dynkin M)} \" have "sets M \ sets (?D B)" proof @@ -1637,7 +1637,7 @@ next fix S assume "S \ space (image_space X)" then obtain S' where "S = X`S'" "S'\sets M" - by (auto simp: subset_image_iff sets_eq_Pow image_space_def) + by (auto simp: subset_image_iff image_space_def) then show "S \ sets (image_space X)" by (auto simp: image_space_def) qed diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/ex/Dining_Cryptographers.thy --- a/src/HOL/Probability/ex/Dining_Cryptographers.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/ex/Dining_Cryptographers.thy Tue Feb 28 21:53:36 2012 +0100 @@ -82,7 +82,7 @@ assumes "dc \ dining_cryptographers" shows "result dc \ (payer dc \ None)" proof - - let "?XOR f l" = "foldl (op \) False (map f [0.. ?XOR (\c. coin dc c \ coin dc (c + 1)) n" @@ -306,8 +306,8 @@ assumes "xs \ inversion ` dc_crypto" shows "card {dc \ dc_crypto. inversion dc = xs} = 2 * n" proof - - let "?set i" = "{dc \ dc_crypto. payer dc = Some i \ inversion dc = xs}" - let "?sets" = "{?set i | i. i < n}" + let ?set = "\i. {dc \ dc_crypto. payer dc = Some i \ inversion dc = xs}" + let ?sets = "{?set i | i. i < n}" have [simp]: "length xs = n" using assms by (auto simp: dc_crypto inversion_def_raw) diff -r e3b99d0231bc -r 5302e932d1e5 src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy --- a/src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy Tue Feb 28 20:20:09 2012 +0100 +++ b/src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy Tue Feb 28 21:53:36 2012 +0100 @@ -333,7 +333,7 @@ using `K k \ 0` by auto } note t_eq_imp = this - let "?S obs" = "t -`{t obs} \ OB`msgs" + let ?S = "\obs. t -`{t obs} \ OB`msgs" { fix k obs assume "k \ keys" "K k \ 0" and obs: "obs \ OB`msgs" have *: "((\x. (t (OB x), fst x)) -` {(t obs, k)} \ msgs) = (\obs'\?S obs. ((\x. (OB x, fst x)) -` {(obs', k)} \ msgs))" by auto @@ -378,8 +378,8 @@ finally have "\

(fst | t\OB) {(k, t obs)} = \

(fst | OB) {(k, obs)}" . } note CP_T_eq_CP_O = this - let "?H obs" = "(\k\keys. \

(fst|OB) {(k, obs)} * log b (\

(fst|OB) {(k, obs)})) :: real" - let "?Ht obs" = "(\k\keys. \

(fst|t\OB) {(k, obs)} * log b (\

(fst|t\OB) {(k, obs)})) :: real" + let ?H = "\obs. (\k\keys. \

(fst|OB) {(k, obs)} * log b (\

(fst|OB) {(k, obs)})) :: real" + let ?Ht = "\obs. (\k\keys. \

(fst|t\OB) {(k, obs)} * log b (\

(fst|t\OB) {(k, obs)})) :: real" { fix obs assume obs: "obs \ OB`msgs" have "?H obs = (\k\keys. \

(fst|t\OB) {(k, t obs)} * log b (\

(fst|t\OB) {(k, t obs)}))"