# HG changeset patch # User hoelzl # Date 1467743398 -7200 # Node ID c22928719e198a58fd796f6b0aee6262119d9ed4 # Parent 786074d8d61bd13eedaedad7b0c782a1641cafc2 Probability: simplified Levy's uniqueness theorem diff -r 786074d8d61b -r c22928719e19 src/HOL/Probability/Levy.thy --- a/src/HOL/Probability/Levy.thy Tue Jul 05 18:00:21 2016 +0200 +++ b/src/HOL/Probability/Levy.thy Tue Jul 05 20:29:58 2016 +0200 @@ -219,64 +219,46 @@ have "cdf M1 = cdf M2" proof (rule ext) fix x - from M1.cdf_is_right_cont [of x] have "(cdf M1 \ cdf M1 x) (at_right x)" - by (simp add: continuous_within) - from M2.cdf_is_right_cont [of x] have "(cdf M2 \ cdf M2 x) (at_right x)" - by (simp add: continuous_within) + let ?D = "\x. \cdf M1 x - cdf M2 x\" { fix \ :: real assume "\ > 0" - from \\ > 0\ \(cdf M1 \ 0) at_bot\ \(cdf M2 \ 0) at_bot\ - have "eventually (\y. \cdf M1 y\ < \ / 4 \ \cdf M2 y\ < \ / 4 \ y \ x) at_bot" - by (simp only: tendsto_iff dist_real_def diff_0_right eventually_conj eventually_le_at_bot) - then obtain M where "\y. y \ M \ \cdf M1 y\ < \ / 4" "\y. y \ M \ \cdf M2 y\ < \ / 4" "M \ x" + have "(?D \ 0) at_bot" + using \(cdf M1 \ 0) at_bot\ \(cdf M2 \ 0) at_bot\ by (intro tendsto_eq_intros) auto + then have "eventually (\y. ?D y < \ / 2 \ y \ x) at_bot" + using \\ > 0\ by (simp only: tendsto_iff dist_real_def diff_0_right eventually_conj eventually_le_at_bot abs_idempotent) + then obtain M where "\y. y \ M \ ?D y < \ / 2" "M \ x" unfolding eventually_at_bot_linorder by auto with open_minus_countable[OF count, of "{..< M}"] obtain a where - "measure M1 {a} = 0" "measure M2 {a} = 0" "a < M" "a \ x" "\cdf M1 a\ < \ / 4" "\cdf M2 a\ < \ / 4" + "measure M1 {a} = 0" "measure M2 {a} = 0" "a < M" "a \ x" and 1: "?D a < \ / 2" by auto - from \\ > 0\ \(cdf M1 \ cdf M1 x) (at_right x)\ \(cdf M2 \ cdf M2 x) (at_right x)\ - have "eventually (\y. \cdf M1 y - cdf M1 x\ < \ / 4 \ \cdf M2 y - cdf M2 x\ < \ / 4 \ x < y) (at_right x)" - by (simp only: tendsto_iff dist_real_def eventually_conj eventually_at_right_less) - then obtain N where "N > x" "\y. x < y \ y < N \ \cdf M1 y - cdf M1 x\ < \ / 4" - "\y. x < y \ y < N \ \cdf M2 y - cdf M2 x\ < \ / 4" "\y. x < y \ y < N \ x < y" + have "(?D \ ?D x) (at_right x)" + using M1.cdf_is_right_cont [of x] M2.cdf_is_right_cont [of x] + by (intro tendsto_intros) (auto simp add: continuous_within) + then have "eventually (\y. \?D y - ?D x\ < \ / 2) (at_right x)" + using \\ > 0\ by (simp only: tendsto_iff dist_real_def eventually_conj eventually_at_right_less) + then obtain N where "N > x" "\y. x < y \ y < N \ \?D y - ?D x\ < \ / 2" by (auto simp add: eventually_at_right[OF less_add_one]) with open_minus_countable[OF count, of "{x <..< N}"] obtain b where "x < b" "b < N" - "measure M1 {b} = 0" "measure M2 {b} = 0" "\cdf M2 x - cdf M2 b\ < \ / 4" "\cdf M1 x - cdf M1 b\ < \ / 4" + "measure M1 {b} = 0" "measure M2 {b} = 0" and 2: "\?D b - ?D x\ < \ / 2" by (auto simp: abs_minus_commute) from \a \ x\ \x < b\ have "a < b" "a \ b" by auto from \char M1 = char M2\ - M1.Levy_Inversion [OF \a \ b\ \measure M1 {a} = 0\ \measure M1 {b} = 0\] + M1.Levy_Inversion [OF \a \ b\ \measure M1 {a} = 0\ \measure M1 {b} = 0\] M2.Levy_Inversion [OF \a \ b\ \measure M2 {a} = 0\ \measure M2 {b} = 0\] have "complex_of_real (measure M1 {a<..b}) = complex_of_real (measure M2 {a<..b})" by (intro LIMSEQ_unique) auto - then have "measure M1 {a<..b} = measure M2 {a<..b}" by auto - then have *: "cdf M1 b - cdf M1 a = cdf M2 b - cdf M2 a" - unfolding M1.cdf_diff_eq [OF \a < b\] M2.cdf_diff_eq [OF \a < b\] . - - have "abs (cdf M1 x - (cdf M1 b - cdf M1 a)) = abs (cdf M1 x - cdf M1 b + cdf M1 a)" + then have "?D a = ?D b" + unfolding of_real_eq_iff M1.cdf_diff_eq [OF \a < b\, symmetric] M2.cdf_diff_eq [OF \a < b\, symmetric] by simp + then have "?D x = \(?D b - ?D x) - ?D a\" by simp - also have "\ \ abs (cdf M1 x - cdf M1 b) + abs (cdf M1 a)" - by (rule abs_triangle_ineq) - also have "\ \ \ / 4 + \ / 4" - by (intro add_mono less_imp_le \\cdf M1 a\ < \ / 4\ \\cdf M1 x - cdf M1 b\ < \ / 4\) - finally have 1: "abs (cdf M1 x - (cdf M1 b - cdf M1 a)) \ \ / 2" by simp - - have "abs (cdf M2 x - (cdf M2 b - cdf M2 a)) = abs (cdf M2 x - cdf M2 b + cdf M2 a)" - by simp - also have "\ \ abs (cdf M2 x - cdf M2 b) + abs (cdf M2 a)" - by (rule abs_triangle_ineq) - also have "\ \ \ / 4 + \ / 4" - by (intro add_mono less_imp_le \\cdf M2 x - cdf M2 b\ < \ / 4\ \\cdf M2 a\ < \ / 4\) - finally have 2: "abs (cdf M2 x - (cdf M2 b - cdf M2 a)) \ \ / 2" by simp - - have "abs (cdf M1 x - cdf M2 x) = abs ((cdf M1 x - (cdf M1 b - cdf M1 a)) - - (cdf M2 x - (cdf M2 b - cdf M2 a)))" by (subst *, simp) - also have "\ \ abs (cdf M1 x - (cdf M1 b - cdf M1 a)) + - abs (cdf M2 x - (cdf M2 b - cdf M2 a))" by (rule abs_triangle_ineq4) - also have "\ \ \ / 2 + \ / 2" by (rule add_mono [OF 1 2]) - finally have "abs (cdf M1 x - cdf M2 x) \ \" by simp } + also have "\ \ \?D b - ?D x\ + \?D a\" + by (rule abs_triangle_ineq4) + also have "\ \ \ / 2 + \ / 2" + using 1 2 by (intro add_mono) auto + finally have "?D x \ \" by simp } then show "cdf M1 x = cdf M2 x" by (metis abs_le_zero_iff dense_ge eq_iff_diff_eq_0) qed