author | haftmann |
Fri, 14 Jun 2019 08:34:27 +0000 | |
changeset 70333 | 0f7edf0853df |
parent 70271 | f7630118814c |
child 70346 | 408e15cbd2a6 |
permissions | -rw-r--r-- |
62375 | 1 |
(* Title: HOL/Library/Extended_Nonnegative_Real.thy |
2 |
Author: Johannes Hölzl |
|
3 |
*) |
|
4 |
||
5 |
subsection \<open>The type of non-negative extended real numbers\<close> |
|
6 |
||
7 |
theory Extended_Nonnegative_Real |
|
62648 | 8 |
imports Extended_Real Indicator_Function |
62375 | 9 |
begin |
10 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
11 |
lemma ereal_ineq_diff_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
12 |
assumes "b \<noteq> (-\<infinity>::ereal)" "a \<ge> b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
13 |
shows "a = b + (a-b)" |
67691
db202a00a29c
fixing ennreal using add_mono1; shifting results from linordered_semidom to linordered_nonzero_semiring
paulson <lp15@cam.ac.uk>
parents:
67456
diff
changeset
|
14 |
by (metis add.commute assms ereal_eq_minus_iff ereal_minus_le_iff ereal_plus_eq_PInfty) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
15 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
16 |
lemma Limsup_const_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
17 |
fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
18 |
shows "F \<noteq> bot \<Longrightarrow> Limsup F (\<lambda>x. c + f x) = c + Limsup F f" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
19 |
by (rule Limsup_compose_continuous_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
20 |
(auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
21 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
22 |
lemma Liminf_const_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
23 |
fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
24 |
shows "F \<noteq> bot \<Longrightarrow> Liminf F (\<lambda>x. c + f x) = c + Liminf F f" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
25 |
by (rule Liminf_compose_continuous_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
26 |
(auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
27 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
28 |
lemma Liminf_add_const: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
29 |
fixes c :: "'a::{complete_linorder, linorder_topology, topological_monoid_add, ordered_ab_semigroup_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
30 |
shows "F \<noteq> bot \<Longrightarrow> Liminf F (\<lambda>x. f x + c) = Liminf F f + c" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
31 |
by (rule Liminf_compose_continuous_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
32 |
(auto intro!: monoI add_mono continuous_on_add continuous_on_id continuous_on_const) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
33 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
34 |
lemma sums_offset: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
35 |
fixes f g :: "nat \<Rightarrow> 'a :: {t2_space, topological_comm_monoid_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
36 |
assumes "(\<lambda>n. f (n + i)) sums l" shows "f sums (l + (\<Sum>j<i. f j))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
37 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
38 |
have "(\<lambda>k. (\<Sum>n<k. f (n + i)) + (\<Sum>j<i. f j)) \<longlonglongrightarrow> l + (\<Sum>j<i. f j)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
39 |
using assms by (auto intro!: tendsto_add simp: sums_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
40 |
moreover |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
41 |
{ fix k :: nat |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
42 |
have "(\<Sum>j<k + i. f j) = (\<Sum>j=i..<k + i. f j) + (\<Sum>j=0..<i. f j)" |
64267 | 43 |
by (subst sum.union_disjoint[symmetric]) (auto intro!: sum.cong) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
44 |
also have "(\<Sum>j=i..<k + i. f j) = (\<Sum>j\<in>(\<lambda>n. n + i)`{0..<k}. f j)" |
67411
3f4b0c84630f
restored naming of lemmas after corresponding constants
haftmann
parents:
67408
diff
changeset
|
45 |
unfolding image_add_atLeastLessThan by simp |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
46 |
finally have "(\<Sum>j<k + i. f j) = (\<Sum>n<k. f (n + i)) + (\<Sum>j<i. f j)" |
64267 | 47 |
by (auto simp: inj_on_def atLeast0LessThan sum.reindex) } |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
48 |
ultimately have "(\<lambda>k. (\<Sum>n<k + i. f n)) \<longlonglongrightarrow> l + (\<Sum>j<i. f j)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
49 |
by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
50 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
51 |
unfolding sums_def by (rule LIMSEQ_offset) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
52 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
53 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
54 |
lemma suminf_offset: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
55 |
fixes f g :: "nat \<Rightarrow> 'a :: {t2_space, topological_comm_monoid_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
56 |
shows "summable (\<lambda>j. f (j + i)) \<Longrightarrow> suminf f = (\<Sum>j. f (j + i)) + (\<Sum>j<i. f j)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
57 |
by (intro sums_unique[symmetric] sums_offset summable_sums) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
58 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
59 |
lemma eventually_at_left_1: "(\<And>z::real. 0 < z \<Longrightarrow> z < 1 \<Longrightarrow> P z) \<Longrightarrow> eventually P (at_left 1)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
60 |
by (subst eventually_at_left[of 0]) (auto intro: exI[of _ 0]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
61 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
62 |
lemma mult_eq_1: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
63 |
fixes a b :: "'a :: {ordered_semiring, comm_monoid_mult}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
64 |
shows "0 \<le> a \<Longrightarrow> a \<le> 1 \<Longrightarrow> b \<le> 1 \<Longrightarrow> a * b = 1 \<longleftrightarrow> (a = 1 \<and> b = 1)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
65 |
by (metis mult.left_neutral eq_iff mult.commute mult_right_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
66 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
67 |
lemma ereal_add_diff_cancel: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
68 |
fixes a b :: ereal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
69 |
shows "\<bar>b\<bar> \<noteq> \<infinity> \<Longrightarrow> (a + b) - b = a" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
70 |
by (cases a b rule: ereal2_cases) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
71 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
72 |
lemma add_top: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
73 |
fixes x :: "'a::{order_top, ordered_comm_monoid_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
74 |
shows "0 \<le> x \<Longrightarrow> x + top = top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
75 |
by (intro top_le add_increasing order_refl) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
76 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
77 |
lemma top_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
78 |
fixes x :: "'a::{order_top, ordered_comm_monoid_add}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
79 |
shows "0 \<le> x \<Longrightarrow> top + x = top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
80 |
by (intro top_le add_increasing2 order_refl) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
81 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
82 |
lemma le_lfp: "mono f \<Longrightarrow> x \<le> lfp f \<Longrightarrow> f x \<le> lfp f" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
83 |
by (subst lfp_unfold) (auto dest: monoD) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
84 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
85 |
lemma lfp_transfer: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
86 |
assumes \<alpha>: "sup_continuous \<alpha>" and f: "sup_continuous f" and mg: "mono g" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
87 |
assumes bot: "\<alpha> bot \<le> lfp g" and eq: "\<And>x. x \<le> lfp f \<Longrightarrow> \<alpha> (f x) = g (\<alpha> x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
88 |
shows "\<alpha> (lfp f) = lfp g" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
89 |
proof (rule antisym) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
90 |
note mf = sup_continuous_mono[OF f] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
91 |
have f_le_lfp: "(f ^^ i) bot \<le> lfp f" for i |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
92 |
by (induction i) (auto intro: le_lfp mf) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
93 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
94 |
have "\<alpha> ((f ^^ i) bot) \<le> lfp g" for i |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
95 |
by (induction i) (auto simp: bot eq f_le_lfp intro!: le_lfp mg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
96 |
then show "\<alpha> (lfp f) \<le> lfp g" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
97 |
unfolding sup_continuous_lfp[OF f] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
98 |
by (subst \<alpha>[THEN sup_continuousD]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
99 |
(auto intro!: mono_funpow sup_continuous_mono[OF f] SUP_least) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
100 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
101 |
show "lfp g \<le> \<alpha> (lfp f)" |
63979 | 102 |
by (rule lfp_lowerbound) (simp add: eq[symmetric] lfp_fixpoint[OF mf]) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
103 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
104 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
105 |
lemma sup_continuous_applyD: "sup_continuous f \<Longrightarrow> sup_continuous (\<lambda>x. f x h)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
106 |
using sup_continuous_apply[THEN sup_continuous_compose] . |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
107 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
108 |
lemma sup_continuous_SUP[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
109 |
fixes M :: "_ \<Rightarrow> _ \<Rightarrow> 'a::complete_lattice" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
110 |
assumes M: "\<And>i. i \<in> I \<Longrightarrow> sup_continuous (M i)" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
111 |
shows "sup_continuous (SUP i\<in>I. M i)" |
69861
62e47f06d22c
avoid context-sensitive simp rules whose context-free form (image_comp) is not simp by default
haftmann
parents:
69661
diff
changeset
|
112 |
unfolding sup_continuous_def by (auto simp add: sup_continuousD [OF M] image_comp intro: SUP_commute) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
113 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
114 |
lemma sup_continuous_apply_SUP[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
115 |
fixes M :: "_ \<Rightarrow> _ \<Rightarrow> 'a::complete_lattice" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
116 |
shows "(\<And>i. i \<in> I \<Longrightarrow> sup_continuous (M i)) \<Longrightarrow> sup_continuous (\<lambda>x. SUP i\<in>I. M i x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
117 |
unfolding SUP_apply[symmetric] by (rule sup_continuous_SUP) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
118 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
119 |
lemma sup_continuous_lfp'[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
120 |
assumes 1: "sup_continuous f" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
121 |
assumes 2: "\<And>g. sup_continuous g \<Longrightarrow> sup_continuous (f g)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
122 |
shows "sup_continuous (lfp f)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
123 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
124 |
have "sup_continuous ((f ^^ i) bot)" for i |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
125 |
proof (induction i) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
126 |
case (Suc i) then show ?case |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
127 |
by (auto intro!: 2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
128 |
qed (simp add: bot_fun_def sup_continuous_const) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
129 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
130 |
unfolding sup_continuous_lfp[OF 1] by (intro order_continuous_intros) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
131 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
132 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
133 |
lemma sup_continuous_lfp''[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
134 |
assumes 1: "\<And>s. sup_continuous (f s)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
135 |
assumes 2: "\<And>g. sup_continuous g \<Longrightarrow> sup_continuous (\<lambda>s. f s (g s))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
136 |
shows "sup_continuous (\<lambda>x. lfp (f x))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
137 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
138 |
have "sup_continuous (\<lambda>x. (f x ^^ i) bot)" for i |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
139 |
proof (induction i) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
140 |
case (Suc i) then show ?case |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
141 |
by (auto intro!: 2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
142 |
qed (simp add: bot_fun_def sup_continuous_const) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
143 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
144 |
unfolding sup_continuous_lfp[OF 1] by (intro order_continuous_intros) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
145 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
146 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
147 |
lemma mono_INF_fun: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
148 |
"(\<And>x y. mono (F x y)) \<Longrightarrow> mono (\<lambda>z x. INF y \<in> X x. F x y z :: 'a :: complete_lattice)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
149 |
by (auto intro!: INF_mono[OF bexI] simp: le_fun_def mono_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
150 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
151 |
lemma continuous_on_max: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
152 |
fixes f g :: "'a::topological_space \<Rightarrow> 'b::linorder_topology" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
153 |
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. max (f x) (g x))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
154 |
by (auto simp: continuous_on_def intro!: tendsto_max) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
155 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
156 |
lemma continuous_on_cmult_ereal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
157 |
"\<bar>c::ereal\<bar> \<noteq> \<infinity> \<Longrightarrow> continuous_on A f \<Longrightarrow> continuous_on A (\<lambda>x. c * f x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
158 |
using tendsto_cmult_ereal[of c f "f x" "at x within A" for x] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
159 |
by (auto simp: continuous_on_def simp del: tendsto_cmult_ereal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
160 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
161 |
lemma real_of_nat_Sup: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
162 |
assumes "A \<noteq> {}" "bdd_above A" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
163 |
shows "of_nat (Sup A) = (SUP a\<in>A. of_nat a :: real)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
164 |
proof (intro antisym) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
165 |
show "(SUP a\<in>A. of_nat a::real) \<le> of_nat (Sup A)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
166 |
using assms by (intro cSUP_least of_nat_mono) (auto intro: cSup_upper) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
167 |
have "Sup A \<in> A" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
168 |
unfolding Sup_nat_def using assms by (intro Max_in) (auto simp: bdd_above_nat) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
169 |
then show "of_nat (Sup A) \<le> (SUP a\<in>A. of_nat a::real)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
170 |
by (intro cSUP_upper bdd_above_image_mono assms) (auto simp: mono_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
171 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
172 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
173 |
lemma (in complete_lattice) SUP_sup_const1: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
174 |
"I \<noteq> {} \<Longrightarrow> (SUP i\<in>I. sup c (f i)) = sup c (SUP i\<in>I. f i)" |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
175 |
using SUP_sup_distrib[of "\<lambda>_. c" I f] by simp |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
176 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
177 |
lemma (in complete_lattice) SUP_sup_const2: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
178 |
"I \<noteq> {} \<Longrightarrow> (SUP i\<in>I. sup (f i) c) = sup (SUP i\<in>I. f i) c" |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
179 |
using SUP_sup_distrib[of f I "\<lambda>_. c"] by simp |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
180 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
181 |
lemma one_less_of_natD: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
182 |
"(1::'a::linordered_semidom) < of_nat n \<Longrightarrow> 1 < n" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
183 |
using zero_le_one[where 'a='a] |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
184 |
apply (cases n) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
185 |
apply simp |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
186 |
subgoal for n' |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
187 |
apply (cases n') |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
188 |
apply simp |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
189 |
apply simp |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
190 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
191 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
192 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
193 |
subsection \<open>Defining the extended non-negative reals\<close> |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
194 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
195 |
text \<open>Basic definitions and type class setup\<close> |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
196 |
|
62375 | 197 |
typedef ennreal = "{x :: ereal. 0 \<le> x}" |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
198 |
morphisms enn2ereal e2ennreal' |
62375 | 199 |
by auto |
200 |
||
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
201 |
definition "e2ennreal x = e2ennreal' (max 0 x)" |
62375 | 202 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
203 |
lemma enn2ereal_range: "e2ennreal ` {0..} = UNIV" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
204 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
205 |
have "\<exists>y\<ge>0. x = e2ennreal y" for x |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
206 |
by (cases x) (auto simp: e2ennreal_def max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
207 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
208 |
by (auto simp: image_iff Bex_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
209 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
210 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
211 |
lemma type_definition_ennreal': "type_definition enn2ereal e2ennreal {x. 0 \<le> x}" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
212 |
using type_definition_ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
213 |
by (auto simp: type_definition_def e2ennreal_def max_absorb2) |
62375 | 214 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
215 |
setup_lifting type_definition_ennreal' |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
216 |
|
62375 | 217 |
declare [[coercion e2ennreal]] |
218 |
||
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
219 |
instantiation ennreal :: complete_linorder |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
220 |
begin |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
221 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
222 |
lift_definition top_ennreal :: ennreal is top by (rule top_greatest) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
223 |
lift_definition bot_ennreal :: ennreal is 0 by (rule order_refl) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
224 |
lift_definition sup_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> ennreal" is sup by (rule le_supI1) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
225 |
lift_definition inf_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> ennreal" is inf by (rule le_infI) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
226 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
227 |
lift_definition Inf_ennreal :: "ennreal set \<Rightarrow> ennreal" is "Inf" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
228 |
by (rule Inf_greatest) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
229 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
230 |
lift_definition Sup_ennreal :: "ennreal set \<Rightarrow> ennreal" is "sup 0 \<circ> Sup" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
231 |
by auto |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
232 |
|
67399 | 233 |
lift_definition less_eq_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> bool" is "(\<le>)" . |
234 |
lift_definition less_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> bool" is "(<)" . |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
235 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
236 |
instance |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
237 |
by standard |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
238 |
(transfer ; auto simp: Inf_lower Inf_greatest Sup_upper Sup_least le_max_iff_disj max.absorb1)+ |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
239 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
240 |
end |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
241 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
242 |
lemma pcr_ennreal_enn2ereal[simp]: "pcr_ennreal (enn2ereal x) x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
243 |
by (simp add: ennreal.pcr_cr_eq cr_ennreal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
244 |
|
67399 | 245 |
lemma rel_fun_eq_pcr_ennreal: "rel_fun (=) pcr_ennreal f g \<longleftrightarrow> f = enn2ereal \<circ> g" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
246 |
by (auto simp: rel_fun_def ennreal.pcr_cr_eq cr_ennreal_def) |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
247 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
248 |
instantiation ennreal :: infinity |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
249 |
begin |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
250 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
251 |
definition infinity_ennreal :: ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
252 |
where |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
253 |
[simp]: "\<infinity> = (top::ennreal)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
254 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
255 |
instance .. |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
256 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
257 |
end |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
258 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
259 |
instantiation ennreal :: "{semiring_1_no_zero_divisors, comm_semiring_1}" |
62375 | 260 |
begin |
261 |
||
262 |
lift_definition one_ennreal :: ennreal is 1 by simp |
|
263 |
lift_definition zero_ennreal :: ennreal is 0 by simp |
|
67399 | 264 |
lift_definition plus_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> ennreal" is "(+)" by simp |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68752
diff
changeset
|
265 |
lift_definition times_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> ennreal" is "(*)" by simp |
62375 | 266 |
|
267 |
instance |
|
268 |
by standard (transfer; auto simp: field_simps ereal_right_distrib)+ |
|
269 |
||
270 |
end |
|
271 |
||
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
272 |
instantiation ennreal :: minus |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
273 |
begin |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
274 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
275 |
lift_definition minus_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> ennreal" is "\<lambda>a b. max 0 (a - b)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
276 |
by simp |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
277 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
278 |
instance .. |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
279 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
280 |
end |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
281 |
|
62375 | 282 |
instance ennreal :: numeral .. |
283 |
||
284 |
instantiation ennreal :: inverse |
|
285 |
begin |
|
286 |
||
287 |
lift_definition inverse_ennreal :: "ennreal \<Rightarrow> ennreal" is inverse |
|
288 |
by (rule inverse_ereal_ge0I) |
|
289 |
||
290 |
definition divide_ennreal :: "ennreal \<Rightarrow> ennreal \<Rightarrow> ennreal" |
|
291 |
where "x div y = x * inverse (y :: ennreal)" |
|
292 |
||
293 |
instance .. |
|
294 |
||
295 |
end |
|
296 |
||
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
67411
diff
changeset
|
297 |
lemma ennreal_zero_less_one: "0 < (1::ennreal)" \<comment> \<open>TODO: remove\<close> |
62375 | 298 |
by transfer auto |
299 |
||
62376
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents:
62375
diff
changeset
|
300 |
instance ennreal :: dioid |
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents:
62375
diff
changeset
|
301 |
proof (standard; transfer) |
67399 | 302 |
fix a b :: ereal assume "0 \<le> a" "0 \<le> b" then show "(a \<le> b) = (\<exists>c\<in>Collect ((\<le>) 0). b = a + c)" |
62376
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents:
62375
diff
changeset
|
303 |
unfolding ereal_ex_split Bex_def |
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents:
62375
diff
changeset
|
304 |
by (cases a b rule: ereal2_cases) (auto intro!: exI[of _ "real_of_ereal (b - a)"]) |
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents:
62375
diff
changeset
|
305 |
qed |
85f38d5f8807
Rename ordered_comm_monoid_add to ordered_cancel_comm_monoid_add. Introduce ordreed_comm_monoid_add, canonically_ordered_comm_monoid and dioid. Setup nat, entat and ennreal as dioids.
hoelzl
parents:
62375
diff
changeset
|
306 |
|
62375 | 307 |
instance ennreal :: ordered_comm_semiring |
308 |
by standard |
|
309 |
(transfer ; auto intro: add_mono mult_mono mult_ac ereal_left_distrib ereal_mult_left_mono)+ |
|
310 |
||
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
311 |
instance ennreal :: linordered_nonzero_semiring |
67691
db202a00a29c
fixing ennreal using add_mono1; shifting results from linordered_semidom to linordered_nonzero_semiring
paulson <lp15@cam.ac.uk>
parents:
67456
diff
changeset
|
312 |
proof |
db202a00a29c
fixing ennreal using add_mono1; shifting results from linordered_semidom to linordered_nonzero_semiring
paulson <lp15@cam.ac.uk>
parents:
67456
diff
changeset
|
313 |
fix a b::ennreal |
db202a00a29c
fixing ennreal using add_mono1; shifting results from linordered_semidom to linordered_nonzero_semiring
paulson <lp15@cam.ac.uk>
parents:
67456
diff
changeset
|
314 |
show "a < b \<Longrightarrow> a + 1 < b + 1" |
db202a00a29c
fixing ennreal using add_mono1; shifting results from linordered_semidom to linordered_nonzero_semiring
paulson <lp15@cam.ac.uk>
parents:
67456
diff
changeset
|
315 |
by transfer (simp add: add_right_mono ereal_add_cancel_right less_le) |
db202a00a29c
fixing ennreal using add_mono1; shifting results from linordered_semidom to linordered_nonzero_semiring
paulson <lp15@cam.ac.uk>
parents:
67456
diff
changeset
|
316 |
qed (transfer; simp) |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
317 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
318 |
instance ennreal :: strict_ordered_ab_semigroup_add |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
319 |
proof |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
320 |
fix a b c d :: ennreal show "a < b \<Longrightarrow> c < d \<Longrightarrow> a + c < b + d" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
321 |
by transfer (auto intro!: ereal_add_strict_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
322 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
323 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
324 |
declare [[coercion "of_nat :: nat \<Rightarrow> ennreal"]] |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
325 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
326 |
lemma e2ennreal_neg: "x \<le> 0 \<Longrightarrow> e2ennreal x = 0" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
327 |
unfolding zero_ennreal_def e2ennreal_def by (simp add: max_absorb1) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
328 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
329 |
lemma e2ennreal_mono: "x \<le> y \<Longrightarrow> e2ennreal x \<le> e2ennreal y" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
330 |
by (cases "0 \<le> x" "0 \<le> y" rule: bool.exhaust[case_product bool.exhaust]) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
331 |
(auto simp: e2ennreal_neg less_eq_ennreal.abs_eq eq_onp_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
332 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
333 |
lemma enn2ereal_nonneg[simp]: "0 \<le> enn2ereal x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
334 |
using ennreal.enn2ereal[of x] by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
335 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
336 |
lemma ereal_ennreal_cases: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
337 |
obtains b where "0 \<le> a" "a = enn2ereal b" | "a < 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
338 |
using e2ennreal'_inverse[of a, symmetric] by (cases "0 \<le> a") (auto intro: enn2ereal_nonneg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
339 |
|
67399 | 340 |
lemma rel_fun_liminf[transfer_rule]: "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal liminf liminf" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
341 |
proof - |
67399 | 342 |
have "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal (\<lambda>x. sup 0 (liminf x)) liminf" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
343 |
unfolding liminf_SUP_INF[abs_def] by (transfer_prover_start, transfer_step+; simp) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
344 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
345 |
apply (subst (asm) (2) rel_fun_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
346 |
apply (subst (2) rel_fun_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
347 |
apply (auto simp: comp_def max.absorb2 Liminf_bounded rel_fun_eq_pcr_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
348 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
349 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
350 |
|
67399 | 351 |
lemma rel_fun_limsup[transfer_rule]: "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal limsup limsup" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
352 |
proof - |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
353 |
have "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal (\<lambda>x. INF n. sup 0 (SUP i\<in>{n..}. x i)) limsup" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
354 |
unfolding limsup_INF_SUP[abs_def] by (transfer_prover_start, transfer_step+; simp) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
355 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
356 |
unfolding limsup_INF_SUP[abs_def] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
357 |
apply (subst (asm) (2) rel_fun_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
358 |
apply (subst (2) rel_fun_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
359 |
apply (auto simp: comp_def max.absorb2 Sup_upper2 rel_fun_eq_pcr_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
360 |
apply (subst (asm) max.absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
361 |
apply (rule SUP_upper2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
362 |
apply auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
363 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
364 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
365 |
|
64267 | 366 |
lemma sum_enn2ereal[simp]: "(\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i) \<Longrightarrow> (\<Sum>i\<in>I. enn2ereal (f i)) = enn2ereal (sum f I)" |
367 |
by (induction I rule: infinite_finite_induct) (auto simp: sum_nonneg zero_ennreal.rep_eq plus_ennreal.rep_eq) |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
368 |
|
64267 | 369 |
lemma transfer_e2ennreal_sum [transfer_rule]: |
67399 | 370 |
"rel_fun (rel_fun (=) pcr_ennreal) (rel_fun (=) pcr_ennreal) sum sum" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
371 |
by (auto intro!: rel_funI simp: rel_fun_eq_pcr_ennreal comp_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
372 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
373 |
lemma enn2ereal_of_nat[simp]: "enn2ereal (of_nat n) = ereal n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
374 |
by (induction n) (auto simp: zero_ennreal.rep_eq one_ennreal.rep_eq plus_ennreal.rep_eq) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
375 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
376 |
lemma enn2ereal_numeral[simp]: "enn2ereal (numeral a) = numeral a" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
377 |
apply (subst of_nat_numeral[of a, symmetric]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
378 |
apply (subst enn2ereal_of_nat) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
379 |
apply simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
380 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
381 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
382 |
lemma transfer_numeral[transfer_rule]: "pcr_ennreal (numeral a) (numeral a)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
383 |
unfolding cr_ennreal_def pcr_ennreal_def by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
384 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
385 |
subsection \<open>Cancellation simprocs\<close> |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
386 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
387 |
lemma ennreal_add_left_cancel: "a + b = a + c \<longleftrightarrow> a = (\<infinity>::ennreal) \<or> b = c" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
388 |
unfolding infinity_ennreal_def by transfer (simp add: top_ereal_def ereal_add_cancel_left) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
389 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
390 |
lemma ennreal_add_left_cancel_le: "a + b \<le> a + c \<longleftrightarrow> a = (\<infinity>::ennreal) \<or> b \<le> c" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
391 |
unfolding infinity_ennreal_def by transfer (simp add: ereal_add_le_add_iff top_ereal_def disj_commute) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
392 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
393 |
lemma ereal_add_left_cancel_less: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
394 |
fixes a b c :: ereal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
395 |
shows "0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> a + b < a + c \<longleftrightarrow> a \<noteq> \<infinity> \<and> b < c" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
396 |
by (cases a b c rule: ereal3_cases) auto |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
397 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
398 |
lemma ennreal_add_left_cancel_less: "a + b < a + c \<longleftrightarrow> a \<noteq> (\<infinity>::ennreal) \<and> b < c" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
399 |
unfolding infinity_ennreal_def |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
400 |
by transfer (simp add: top_ereal_def ereal_add_left_cancel_less) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
401 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
402 |
ML \<open> |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
403 |
structure Cancel_Ennreal_Common = |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
404 |
struct |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
405 |
(* copied from src/HOL/Tools/nat_numeral_simprocs.ML *) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
406 |
fun find_first_t _ _ [] = raise TERM("find_first_t", []) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
407 |
| find_first_t past u (t::terms) = |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
408 |
if u aconv t then (rev past @ terms) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
409 |
else find_first_t (t::past) u terms |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
410 |
|
69593 | 411 |
fun dest_summing (Const (\<^const_name>\<open>Groups.plus\<close>, _) $ t $ u, ts) = |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
412 |
dest_summing (t, dest_summing (u, ts)) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
413 |
| dest_summing (t, ts) = t :: ts |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
414 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
415 |
val mk_sum = Arith_Data.long_mk_sum |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
416 |
fun dest_sum t = dest_summing (t, []) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
417 |
val find_first = find_first_t [] |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
418 |
val trans_tac = Numeral_Simprocs.trans_tac |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
419 |
val norm_ss = |
69593 | 420 |
simpset_of (put_simpset HOL_basic_ss \<^context> |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
421 |
addsimps @{thms ac_simps add_0_left add_0_right}) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
422 |
fun norm_tac ctxt = ALLGOALS (simp_tac (put_simpset norm_ss ctxt)) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
423 |
fun simplify_meta_eq ctxt cancel_th th = |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
424 |
Arith_Data.simplify_meta_eq [] ctxt |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
425 |
([th, cancel_th] MRS trans) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
426 |
fun mk_eq (a, b) = HOLogic.mk_Trueprop (HOLogic.mk_eq (a, b)) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
427 |
end |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
428 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
429 |
structure Eq_Ennreal_Cancel = ExtractCommonTermFun |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
430 |
(open Cancel_Ennreal_Common |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
431 |
val mk_bal = HOLogic.mk_eq |
69593 | 432 |
val dest_bal = HOLogic.dest_bin \<^const_name>\<open>HOL.eq\<close> \<^typ>\<open>ennreal\<close> |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
433 |
fun simp_conv _ _ = SOME @{thm ennreal_add_left_cancel} |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
434 |
) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
435 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
436 |
structure Le_Ennreal_Cancel = ExtractCommonTermFun |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
437 |
(open Cancel_Ennreal_Common |
69593 | 438 |
val mk_bal = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less_eq\<close> |
439 |
val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less_eq\<close> \<^typ>\<open>ennreal\<close> |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
440 |
fun simp_conv _ _ = SOME @{thm ennreal_add_left_cancel_le} |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
441 |
) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
442 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
443 |
structure Less_Ennreal_Cancel = ExtractCommonTermFun |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
444 |
(open Cancel_Ennreal_Common |
69593 | 445 |
val mk_bal = HOLogic.mk_binrel \<^const_name>\<open>Orderings.less\<close> |
446 |
val dest_bal = HOLogic.dest_bin \<^const_name>\<open>Orderings.less\<close> \<^typ>\<open>ennreal\<close> |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
447 |
fun simp_conv _ _ = SOME @{thm ennreal_add_left_cancel_less} |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
448 |
) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
449 |
\<close> |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
450 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
451 |
simproc_setup ennreal_eq_cancel |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
452 |
("(l::ennreal) + m = n" | "(l::ennreal) = m + n") = |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
453 |
\<open>fn phi => fn ctxt => fn ct => Eq_Ennreal_Cancel.proc ctxt (Thm.term_of ct)\<close> |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
454 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
455 |
simproc_setup ennreal_le_cancel |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
456 |
("(l::ennreal) + m \<le> n" | "(l::ennreal) \<le> m + n") = |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
457 |
\<open>fn phi => fn ctxt => fn ct => Le_Ennreal_Cancel.proc ctxt (Thm.term_of ct)\<close> |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
458 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
459 |
simproc_setup ennreal_less_cancel |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
460 |
("(l::ennreal) + m < n" | "(l::ennreal) < m + n") = |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
461 |
\<open>fn phi => fn ctxt => fn ct => Less_Ennreal_Cancel.proc ctxt (Thm.term_of ct)\<close> |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
462 |
|
62375 | 463 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
464 |
subsection \<open>Order with top\<close> |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
465 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
466 |
lemma ennreal_zero_less_top[simp]: "0 < (top::ennreal)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
467 |
by transfer (simp add: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
468 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
469 |
lemma ennreal_one_less_top[simp]: "1 < (top::ennreal)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
470 |
by transfer (simp add: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
471 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
472 |
lemma ennreal_zero_neq_top[simp]: "0 \<noteq> (top::ennreal)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
473 |
by transfer (simp add: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
474 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
475 |
lemma ennreal_top_neq_zero[simp]: "(top::ennreal) \<noteq> 0" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
476 |
by transfer (simp add: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
477 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
478 |
lemma ennreal_top_neq_one[simp]: "top \<noteq> (1::ennreal)" |
68406 | 479 |
by transfer (simp add: top_ereal_def one_ereal_def flip: ereal_max) |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
480 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
481 |
lemma ennreal_one_neq_top[simp]: "1 \<noteq> (top::ennreal)" |
68406 | 482 |
by transfer (simp add: top_ereal_def one_ereal_def flip: ereal_max) |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
483 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
484 |
lemma ennreal_add_less_top[simp]: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
485 |
fixes a b :: ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
486 |
shows "a + b < top \<longleftrightarrow> a < top \<and> b < top" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
487 |
by transfer (auto simp: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
488 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
489 |
lemma ennreal_add_eq_top[simp]: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
490 |
fixes a b :: ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
491 |
shows "a + b = top \<longleftrightarrow> a = top \<or> b = top" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
492 |
by transfer (auto simp: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
493 |
|
64267 | 494 |
lemma ennreal_sum_less_top[simp]: |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
495 |
fixes f :: "'a \<Rightarrow> ennreal" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
496 |
shows "finite I \<Longrightarrow> (\<Sum>i\<in>I. f i) < top \<longleftrightarrow> (\<forall>i\<in>I. f i < top)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
497 |
by (induction I rule: finite_induct) auto |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
498 |
|
64267 | 499 |
lemma ennreal_sum_eq_top[simp]: |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
500 |
fixes f :: "'a \<Rightarrow> ennreal" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
501 |
shows "finite I \<Longrightarrow> (\<Sum>i\<in>I. f i) = top \<longleftrightarrow> (\<exists>i\<in>I. f i = top)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
502 |
by (induction I rule: finite_induct) auto |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
503 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
504 |
lemma ennreal_mult_eq_top_iff: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
505 |
fixes a b :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
506 |
shows "a * b = top \<longleftrightarrow> (a = top \<and> b \<noteq> 0) \<or> (b = top \<and> a \<noteq> 0)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
507 |
by transfer (auto simp: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
508 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
509 |
lemma ennreal_top_eq_mult_iff: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
510 |
fixes a b :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
511 |
shows "top = a * b \<longleftrightarrow> (a = top \<and> b \<noteq> 0) \<or> (b = top \<and> a \<noteq> 0)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
512 |
using ennreal_mult_eq_top_iff[of a b] by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
513 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
514 |
lemma ennreal_mult_less_top: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
515 |
fixes a b :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
516 |
shows "a * b < top \<longleftrightarrow> (a = 0 \<or> b = 0 \<or> (a < top \<and> b < top))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
517 |
by transfer (auto simp add: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
518 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
519 |
lemma top_power_ennreal: "top ^ n = (if n = 0 then 1 else top :: ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
520 |
by (induction n) (simp_all add: ennreal_mult_eq_top_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
521 |
|
64272 | 522 |
lemma ennreal_prod_eq_0[simp]: |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
523 |
fixes f :: "'a \<Rightarrow> ennreal" |
64272 | 524 |
shows "(prod f A = 0) = (finite A \<and> (\<exists>i\<in>A. f i = 0))" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
525 |
by (induction A rule: infinite_finite_induct) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
526 |
|
64272 | 527 |
lemma ennreal_prod_eq_top: |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
528 |
fixes f :: "'a \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
529 |
shows "(\<Prod>i\<in>I. f i) = top \<longleftrightarrow> (finite I \<and> ((\<forall>i\<in>I. f i \<noteq> 0) \<and> (\<exists>i\<in>I. f i = top)))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
530 |
by (induction I rule: infinite_finite_induct) (auto simp: ennreal_mult_eq_top_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
531 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
532 |
lemma ennreal_top_mult: "top * a = (if a = 0 then 0 else top :: ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
533 |
by (simp add: ennreal_mult_eq_top_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
534 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
535 |
lemma ennreal_mult_top: "a * top = (if a = 0 then 0 else top :: ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
536 |
by (simp add: ennreal_mult_eq_top_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
537 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
538 |
lemma enn2ereal_eq_top_iff[simp]: "enn2ereal x = \<infinity> \<longleftrightarrow> x = top" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
539 |
by transfer (simp add: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
540 |
|
67451 | 541 |
lemma enn2ereal_top[simp]: "enn2ereal top = \<infinity>" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
542 |
by transfer (simp add: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
543 |
|
67451 | 544 |
lemma e2ennreal_infty[simp]: "e2ennreal \<infinity> = top" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
545 |
by (simp add: top_ennreal.abs_eq top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
546 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
547 |
lemma ennreal_top_minus[simp]: "top - x = (top::ennreal)" |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
548 |
by transfer (auto simp: top_ereal_def max_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
549 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
550 |
lemma minus_top_ennreal: "x - top = (if x = top then top else 0:: ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
551 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
552 |
subgoal for x |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
553 |
by (cases x) (auto simp: top_ereal_def max_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
554 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
555 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
556 |
lemma bot_ennreal: "bot = (0::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
557 |
by transfer rule |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
558 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
559 |
lemma ennreal_of_nat_neq_top[simp]: "of_nat i \<noteq> (top::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
560 |
by (induction i) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
561 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
562 |
lemma numeral_eq_of_nat: "(numeral a::ennreal) = of_nat (numeral a)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
563 |
by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
564 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
565 |
lemma of_nat_less_top: "of_nat i < (top::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
566 |
using less_le_trans[of "of_nat i" "of_nat (Suc i)" "top::ennreal"] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
567 |
by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
568 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
569 |
lemma top_neq_numeral[simp]: "top \<noteq> (numeral i::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
570 |
using of_nat_less_top[of "numeral i"] by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
571 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
572 |
lemma ennreal_numeral_less_top[simp]: "numeral i < (top::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
573 |
using of_nat_less_top[of "numeral i"] by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
574 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
575 |
lemma ennreal_add_bot[simp]: "bot + x = (x::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
576 |
by transfer simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
577 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
578 |
instance ennreal :: semiring_char_0 |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
579 |
proof (standard, safe intro!: linorder_injI) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
580 |
have *: "1 + of_nat k \<noteq> (0::ennreal)" for k |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
581 |
using add_pos_nonneg[OF zero_less_one, of "of_nat k :: ennreal"] by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
582 |
fix x y :: nat assume "x < y" "of_nat x = (of_nat y::ennreal)" then show False |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
583 |
by (auto simp add: less_iff_Suc_add *) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
584 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
585 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
586 |
subsection \<open>Arithmetic\<close> |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
587 |
|
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
588 |
lemma ennreal_minus_zero[simp]: "a - (0::ennreal) = a" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
589 |
by transfer (auto simp: max_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
590 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
591 |
lemma ennreal_add_diff_cancel_right[simp]: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
592 |
fixes x y z :: ennreal shows "y \<noteq> top \<Longrightarrow> (x + y) - y = x" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
593 |
apply transfer |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
594 |
subgoal for x y |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
595 |
apply (cases x y rule: ereal2_cases) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
596 |
apply (auto split: split_max simp: top_ereal_def) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
597 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
598 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
599 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
600 |
lemma ennreal_add_diff_cancel_left[simp]: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
601 |
fixes x y z :: ennreal shows "y \<noteq> top \<Longrightarrow> (y + x) - y = x" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
602 |
by (simp add: add.commute) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
603 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
604 |
lemma |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
605 |
fixes a b :: ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
606 |
shows "a - b = 0 \<Longrightarrow> a \<le> b" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
607 |
apply transfer |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
608 |
subgoal for a b |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
609 |
apply (cases a b rule: ereal2_cases) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
610 |
apply (auto simp: not_le max_def split: if_splits) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
611 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
612 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
613 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
614 |
lemma ennreal_minus_cancel: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
615 |
fixes a b c :: ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
616 |
shows "c \<noteq> top \<Longrightarrow> a \<le> c \<Longrightarrow> b \<le> c \<Longrightarrow> c - a = c - b \<Longrightarrow> a = b" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
617 |
apply transfer |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
618 |
subgoal for a b c |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
619 |
by (cases a b c rule: ereal3_cases) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
620 |
(auto simp: top_ereal_def max_def split: if_splits) |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
621 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
622 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
623 |
lemma sup_const_add_ennreal: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
624 |
fixes a b c :: "ennreal" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
625 |
shows "sup (c + a) (c + b) = c + sup a b" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
626 |
apply transfer |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
627 |
subgoal for a b c |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
628 |
apply (cases a b c rule: ereal3_cases) |
68406 | 629 |
apply (auto simp flip: ereal_max) |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
630 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
631 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
632 |
|
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
633 |
lemma ennreal_diff_add_assoc: |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
634 |
fixes a b c :: ennreal |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
635 |
shows "a \<le> b \<Longrightarrow> c + b - a = c + (b - a)" |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
636 |
apply transfer |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
637 |
subgoal for a b c |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
638 |
by (cases a b c rule: ereal3_cases) (auto simp: field_simps max_absorb2) |
62378
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
639 |
done |
85ed00c1fe7c
generalize more theorems to support enat and ennreal
hoelzl
parents:
62376
diff
changeset
|
640 |
|
62648 | 641 |
lemma mult_divide_eq_ennreal: |
642 |
fixes a b :: ennreal |
|
643 |
shows "b \<noteq> 0 \<Longrightarrow> b \<noteq> top \<Longrightarrow> (a * b) / b = a" |
|
644 |
unfolding divide_ennreal_def |
|
645 |
apply transfer |
|
646 |
apply (subst mult.assoc) |
|
68406 | 647 |
apply (simp add: top_ereal_def flip: divide_ereal_def) |
62648 | 648 |
done |
649 |
||
650 |
lemma divide_mult_eq: "a \<noteq> 0 \<Longrightarrow> a \<noteq> \<infinity> \<Longrightarrow> x * a / (b * a) = x / (b::ennreal)" |
|
651 |
unfolding divide_ennreal_def infinity_ennreal_def |
|
652 |
apply transfer |
|
653 |
subgoal for a b c |
|
654 |
apply (cases a b c rule: ereal3_cases) |
|
655 |
apply (auto simp: top_ereal_def) |
|
656 |
done |
|
657 |
done |
|
658 |
||
659 |
lemma ennreal_mult_divide_eq: |
|
660 |
fixes a b :: ennreal |
|
661 |
shows "b \<noteq> 0 \<Longrightarrow> b \<noteq> top \<Longrightarrow> (a * b) / b = a" |
|
662 |
unfolding divide_ennreal_def |
|
663 |
apply transfer |
|
664 |
apply (subst mult.assoc) |
|
68406 | 665 |
apply (simp add: top_ereal_def flip: divide_ereal_def) |
62648 | 666 |
done |
667 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
668 |
lemma ennreal_add_diff_cancel: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
669 |
fixes a b :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
670 |
shows "b \<noteq> \<infinity> \<Longrightarrow> (a + b) - b = a" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
671 |
unfolding infinity_ennreal_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
672 |
by transfer (simp add: max_absorb2 top_ereal_def ereal_add_diff_cancel) |
62648 | 673 |
|
674 |
lemma ennreal_minus_eq_0: |
|
675 |
"a - b = 0 \<Longrightarrow> a \<le> (b::ennreal)" |
|
676 |
apply transfer |
|
677 |
subgoal for a b |
|
678 |
apply (cases a b rule: ereal2_cases) |
|
68406 | 679 |
apply (auto simp: zero_ereal_def max.absorb2 simp flip: ereal_max) |
62648 | 680 |
done |
681 |
done |
|
682 |
||
683 |
lemma ennreal_mono_minus_cancel: |
|
684 |
fixes a b c :: ennreal |
|
685 |
shows "a - b \<le> a - c \<Longrightarrow> a < top \<Longrightarrow> b \<le> a \<Longrightarrow> c \<le> a \<Longrightarrow> c \<le> b" |
|
686 |
by transfer |
|
687 |
(auto simp add: max.absorb2 ereal_diff_positive top_ereal_def dest: ereal_mono_minus_cancel) |
|
688 |
||
689 |
lemma ennreal_mono_minus: |
|
690 |
fixes a b c :: ennreal |
|
691 |
shows "c \<le> b \<Longrightarrow> a - b \<le> a - c" |
|
692 |
apply transfer |
|
693 |
apply (rule max.mono) |
|
694 |
apply simp |
|
695 |
subgoal for a b c |
|
696 |
by (cases a b c rule: ereal3_cases) auto |
|
697 |
done |
|
698 |
||
699 |
lemma ennreal_minus_pos_iff: |
|
700 |
fixes a b :: ennreal |
|
701 |
shows "a < top \<or> b < top \<Longrightarrow> 0 < a - b \<Longrightarrow> b < a" |
|
702 |
apply transfer |
|
703 |
subgoal for a b |
|
704 |
by (cases a b rule: ereal2_cases) (auto simp: less_max_iff_disj) |
|
705 |
done |
|
706 |
||
707 |
lemma ennreal_inverse_top[simp]: "inverse top = (0::ennreal)" |
|
708 |
by transfer (simp add: top_ereal_def ereal_inverse_eq_0) |
|
709 |
||
710 |
lemma ennreal_inverse_zero[simp]: "inverse 0 = (top::ennreal)" |
|
711 |
by transfer (simp add: top_ereal_def ereal_inverse_eq_0) |
|
712 |
||
713 |
lemma ennreal_top_divide: "top / (x::ennreal) = (if x = top then 0 else top)" |
|
714 |
unfolding divide_ennreal_def |
|
715 |
by transfer (simp add: top_ereal_def ereal_inverse_eq_0 ereal_0_gt_inverse) |
|
716 |
||
717 |
lemma ennreal_zero_divide[simp]: "0 / (x::ennreal) = 0" |
|
718 |
by (simp add: divide_ennreal_def) |
|
719 |
||
720 |
lemma ennreal_divide_zero[simp]: "x / (0::ennreal) = (if x = 0 then 0 else top)" |
|
721 |
by (simp add: divide_ennreal_def ennreal_mult_top) |
|
722 |
||
723 |
lemma ennreal_divide_top[simp]: "x / (top::ennreal) = 0" |
|
724 |
by (simp add: divide_ennreal_def ennreal_top_mult) |
|
725 |
||
726 |
lemma ennreal_times_divide: "a * (b / c) = a * b / (c::ennreal)" |
|
727 |
unfolding divide_ennreal_def |
|
728 |
by transfer (simp add: divide_ereal_def[symmetric] ereal_times_divide_eq) |
|
729 |
||
730 |
lemma ennreal_zero_less_divide: "0 < a / b \<longleftrightarrow> (0 < a \<and> b < (top::ennreal))" |
|
731 |
unfolding divide_ennreal_def |
|
732 |
by transfer (auto simp: ereal_zero_less_0_iff top_ereal_def ereal_0_gt_inverse) |
|
733 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
734 |
lemma divide_right_mono_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
735 |
fixes a b c :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
736 |
shows "a \<le> b \<Longrightarrow> a / c \<le> b / c" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
737 |
unfolding divide_ennreal_def by (intro mult_mono) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
738 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
739 |
lemma ennreal_mult_strict_right_mono: "(a::ennreal) < c \<Longrightarrow> 0 < b \<Longrightarrow> b < top \<Longrightarrow> a * b < c * b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
740 |
by transfer (auto intro!: ereal_mult_strict_right_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
741 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
742 |
lemma ennreal_indicator_less[simp]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
743 |
"indicator A x \<le> (indicator B x::ennreal) \<longleftrightarrow> (x \<in> A \<longrightarrow> x \<in> B)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
744 |
by (simp add: indicator_def not_le) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
745 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
746 |
lemma ennreal_inverse_positive: "0 < inverse x \<longleftrightarrow> (x::ennreal) \<noteq> top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
747 |
by transfer (simp add: ereal_0_gt_inverse top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
748 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
749 |
lemma ennreal_inverse_mult': "((0 < b \<or> a < top) \<and> (0 < a \<or> b < top)) \<Longrightarrow> inverse (a * b::ennreal) = inverse a * inverse b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
750 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
751 |
subgoal for a b |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
752 |
by (cases a b rule: ereal2_cases) (auto simp: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
753 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
754 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
755 |
lemma ennreal_inverse_mult: "a < top \<Longrightarrow> b < top \<Longrightarrow> inverse (a * b::ennreal) = inverse a * inverse b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
756 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
757 |
subgoal for a b |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
758 |
by (cases a b rule: ereal2_cases) (auto simp: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
759 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
760 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
761 |
lemma ennreal_inverse_1[simp]: "inverse (1::ennreal) = 1" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
762 |
by transfer simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
763 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
764 |
lemma ennreal_inverse_eq_0_iff[simp]: "inverse (a::ennreal) = 0 \<longleftrightarrow> a = top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
765 |
by transfer (simp add: ereal_inverse_eq_0 top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
766 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
767 |
lemma ennreal_inverse_eq_top_iff[simp]: "inverse (a::ennreal) = top \<longleftrightarrow> a = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
768 |
by transfer (simp add: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
769 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
770 |
lemma ennreal_divide_eq_0_iff[simp]: "(a::ennreal) / b = 0 \<longleftrightarrow> (a = 0 \<or> b = top)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
771 |
by (simp add: divide_ennreal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
772 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
773 |
lemma ennreal_divide_eq_top_iff: "(a::ennreal) / b = top \<longleftrightarrow> ((a \<noteq> 0 \<and> b = 0) \<or> (a = top \<and> b \<noteq> top))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
774 |
by (auto simp add: divide_ennreal_def ennreal_mult_eq_top_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
775 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
776 |
lemma one_divide_one_divide_ennreal[simp]: "1 / (1 / c) = (c::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
777 |
including ennreal.lifting |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
778 |
unfolding divide_ennreal_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
779 |
by transfer auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
780 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
781 |
lemma ennreal_mult_left_cong: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
782 |
"((a::ennreal) \<noteq> 0 \<Longrightarrow> b = c) \<Longrightarrow> a * b = a * c" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
783 |
by (cases "a = 0") simp_all |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
784 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
785 |
lemma ennreal_mult_right_cong: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
786 |
"((a::ennreal) \<noteq> 0 \<Longrightarrow> b = c) \<Longrightarrow> b * a = c * a" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
787 |
by (cases "a = 0") simp_all |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
788 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
789 |
lemma ennreal_zero_less_mult_iff: "0 < a * b \<longleftrightarrow> 0 < a \<and> 0 < (b::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
790 |
by transfer (auto simp add: ereal_zero_less_0_iff le_less) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
791 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
792 |
lemma less_diff_eq_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
793 |
fixes a b c :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
794 |
shows "b < top \<or> c < top \<Longrightarrow> a < b - c \<longleftrightarrow> a + c < b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
795 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
796 |
subgoal for a b c |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
797 |
by (cases a b c rule: ereal3_cases) (auto split: split_max) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
798 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
799 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
800 |
lemma diff_add_cancel_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
801 |
fixes a b :: ennreal shows "a \<le> b \<Longrightarrow> b - a + a = b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
802 |
unfolding infinity_ennreal_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
803 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
804 |
subgoal for a b |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
805 |
by (cases a b rule: ereal2_cases) (auto simp: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
806 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
807 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
808 |
lemma ennreal_diff_self[simp]: "a \<noteq> top \<Longrightarrow> a - a = (0::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
809 |
by transfer (simp add: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
810 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
811 |
lemma ennreal_minus_mono: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
812 |
fixes a b c :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
813 |
shows "a \<le> c \<Longrightarrow> d \<le> b \<Longrightarrow> a - b \<le> c - d" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
814 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
815 |
apply (rule max.mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
816 |
apply simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
817 |
subgoal for a b c d |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
818 |
by (cases a b c d rule: ereal3_cases[case_product ereal_cases]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
819 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
820 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
821 |
lemma ennreal_minus_eq_top[simp]: "a - (b::ennreal) = top \<longleftrightarrow> a = top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
822 |
by transfer (auto simp: top_ereal_def max.absorb2 ereal_minus_eq_PInfty_iff split: split_max) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
823 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
824 |
lemma ennreal_divide_self[simp]: "a \<noteq> 0 \<Longrightarrow> a < top \<Longrightarrow> a / a = (1::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
825 |
unfolding divide_ennreal_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
826 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
827 |
subgoal for a |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
828 |
by (cases a) (auto simp: top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
829 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
830 |
|
69593 | 831 |
subsection \<open>Coercion from \<^typ>\<open>real\<close> to \<^typ>\<open>ennreal\<close>\<close> |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
832 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
833 |
lift_definition ennreal :: "real \<Rightarrow> ennreal" is "sup 0 \<circ> ereal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
834 |
by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
835 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
836 |
declare [[coercion ennreal]] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
837 |
|
63099
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
838 |
lemma ennreal_cong: "x = y \<Longrightarrow> ennreal x = ennreal y" by simp |
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
839 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
840 |
lemma ennreal_cases[cases type: ennreal]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
841 |
fixes x :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
842 |
obtains (real) r :: real where "0 \<le> r" "x = ennreal r" | (top) "x = top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
843 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
844 |
subgoal for x thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
845 |
by (cases x) (auto simp: max.absorb2 top_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
846 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
847 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
848 |
lemmas ennreal2_cases = ennreal_cases[case_product ennreal_cases] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
849 |
lemmas ennreal3_cases = ennreal_cases[case_product ennreal2_cases] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
850 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
851 |
lemma ennreal_neq_top[simp]: "ennreal r \<noteq> top" |
68406 | 852 |
by transfer (simp add: top_ereal_def zero_ereal_def flip: ereal_max) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
853 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
854 |
lemma top_neq_ennreal[simp]: "top \<noteq> ennreal r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
855 |
using ennreal_neq_top[of r] by (auto simp del: ennreal_neq_top) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
856 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
857 |
lemma ennreal_less_top[simp]: "ennreal x < top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
858 |
by transfer (simp add: top_ereal_def max_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
859 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
860 |
lemma ennreal_neg: "x \<le> 0 \<Longrightarrow> ennreal x = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
861 |
by transfer (simp add: max.absorb1) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
862 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
863 |
lemma ennreal_inj[simp]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
864 |
"0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> ennreal a = ennreal b \<longleftrightarrow> a = b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
865 |
by (transfer fixing: a b) (auto simp: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
866 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
867 |
lemma ennreal_le_iff[simp]: "0 \<le> y \<Longrightarrow> ennreal x \<le> ennreal y \<longleftrightarrow> x \<le> y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
868 |
by (auto simp: ennreal_def zero_ereal_def less_eq_ennreal.abs_eq eq_onp_def split: split_max) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
869 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
870 |
lemma le_ennreal_iff: "0 \<le> r \<Longrightarrow> x \<le> ennreal r \<longleftrightarrow> (\<exists>q\<ge>0. x = ennreal q \<and> q \<le> r)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
871 |
by (cases x) (auto simp: top_unique) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
872 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
873 |
lemma ennreal_less_iff: "0 \<le> r \<Longrightarrow> ennreal r < ennreal q \<longleftrightarrow> r < q" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
874 |
unfolding not_le[symmetric] by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
875 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
876 |
lemma ennreal_eq_zero_iff[simp]: "0 \<le> x \<Longrightarrow> ennreal x = 0 \<longleftrightarrow> x = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
877 |
by transfer (auto simp: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
878 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
879 |
lemma ennreal_less_zero_iff[simp]: "0 < ennreal x \<longleftrightarrow> 0 < x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
880 |
by transfer (auto simp: max_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
881 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
882 |
lemma ennreal_lessI: "0 < q \<Longrightarrow> r < q \<Longrightarrow> ennreal r < ennreal q" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
883 |
by (cases "0 \<le> r") (auto simp: ennreal_less_iff ennreal_neg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
884 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
885 |
lemma ennreal_leI: "x \<le> y \<Longrightarrow> ennreal x \<le> ennreal y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
886 |
by (cases "0 \<le> y") (auto simp: ennreal_neg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
887 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
888 |
lemma enn2ereal_ennreal[simp]: "0 \<le> x \<Longrightarrow> enn2ereal (ennreal x) = x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
889 |
by transfer (simp add: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
890 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
891 |
lemma e2ennreal_enn2ereal[simp]: "e2ennreal (enn2ereal x) = x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
892 |
by (simp add: e2ennreal_def max_absorb2 ennreal.enn2ereal_inverse) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
893 |
|
67456 | 894 |
lemma enn2ereal_e2ennreal: "x \<ge> 0 \<Longrightarrow> enn2ereal (e2ennreal x) = x" |
895 |
by (metis e2ennreal_enn2ereal ereal_ennreal_cases not_le) |
|
896 |
||
67451 | 897 |
lemma e2ennreal_ereal [simp]: "e2ennreal (ereal x) = ennreal x" |
898 |
by (metis e2ennreal_def enn2ereal_inverse ennreal.rep_eq sup_ereal_def) |
|
899 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
900 |
lemma ennreal_0[simp]: "ennreal 0 = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
901 |
by (simp add: ennreal_def max.absorb1 zero_ennreal.abs_eq) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
902 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
903 |
lemma ennreal_1[simp]: "ennreal 1 = 1" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
904 |
by transfer (simp add: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
905 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
906 |
lemma ennreal_eq_0_iff: "ennreal x = 0 \<longleftrightarrow> x \<le> 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
907 |
by (cases "0 \<le> x") (auto simp: ennreal_neg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
908 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
909 |
lemma ennreal_le_iff2: "ennreal x \<le> ennreal y \<longleftrightarrow> ((0 \<le> y \<and> x \<le> y) \<or> (x \<le> 0 \<and> y \<le> 0))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
910 |
by (cases "0 \<le> y") (auto simp: ennreal_eq_0_iff ennreal_neg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
911 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
912 |
lemma ennreal_eq_1[simp]: "ennreal x = 1 \<longleftrightarrow> x = 1" |
68406 | 913 |
by (cases "0 \<le> x") (auto simp: ennreal_neg simp flip: ennreal_1) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
914 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
915 |
lemma ennreal_le_1[simp]: "ennreal x \<le> 1 \<longleftrightarrow> x \<le> 1" |
68406 | 916 |
by (cases "0 \<le> x") (auto simp: ennreal_neg simp flip: ennreal_1) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
917 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
918 |
lemma ennreal_ge_1[simp]: "ennreal x \<ge> 1 \<longleftrightarrow> x \<ge> 1" |
68406 | 919 |
by (cases "0 \<le> x") (auto simp: ennreal_neg simp flip: ennreal_1) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
920 |
|
64284
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents:
64272
diff
changeset
|
921 |
lemma one_less_ennreal[simp]: "1 < ennreal x \<longleftrightarrow> 1 < x" |
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents:
64272
diff
changeset
|
922 |
by transfer (auto simp: max.absorb2 less_max_iff_disj) |
f3b905b2eee2
HOL-Analysis: more theorems from Sébastien Gouëzel's Ergodic_Theory
hoelzl
parents:
64272
diff
changeset
|
923 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
924 |
lemma ennreal_plus[simp]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
925 |
"0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> ennreal (a + b) = ennreal a + ennreal b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
926 |
by (transfer fixing: a b) (auto simp: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
927 |
|
64267 | 928 |
lemma sum_ennreal[simp]: "(\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i) \<Longrightarrow> (\<Sum>i\<in>I. ennreal (f i)) = ennreal (sum f I)" |
929 |
by (induction I rule: infinite_finite_induct) (auto simp: sum_nonneg) |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
930 |
|
63882
018998c00003
renamed listsum -> sum_list, listprod ~> prod_list
nipkow
parents:
63540
diff
changeset
|
931 |
lemma sum_list_ennreal[simp]: |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
932 |
assumes "\<And>x. x \<in> set xs \<Longrightarrow> f x \<ge> 0" |
63882
018998c00003
renamed listsum -> sum_list, listprod ~> prod_list
nipkow
parents:
63540
diff
changeset
|
933 |
shows "sum_list (map (\<lambda>x. ennreal (f x)) xs) = ennreal (sum_list (map f xs))" |
63099
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
934 |
using assms |
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
935 |
proof (induction xs) |
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
936 |
case (Cons x xs) |
63882
018998c00003
renamed listsum -> sum_list, listprod ~> prod_list
nipkow
parents:
63540
diff
changeset
|
937 |
from Cons have "(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x) + ennreal (sum_list (map f xs))" |
63099
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
938 |
by simp |
63882
018998c00003
renamed listsum -> sum_list, listprod ~> prod_list
nipkow
parents:
63540
diff
changeset
|
939 |
also from Cons.prems have "\<dots> = ennreal (f x + sum_list (map f xs))" |
018998c00003
renamed listsum -> sum_list, listprod ~> prod_list
nipkow
parents:
63540
diff
changeset
|
940 |
by (intro ennreal_plus [symmetric] sum_list_nonneg) auto |
63099
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
941 |
finally show ?case by simp |
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
942 |
qed simp_all |
af0e964aad7b
Moved material from AFP/Randomised_Social_Choice to distribution
eberlm
parents:
63060
diff
changeset
|
943 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
944 |
lemma ennreal_of_nat_eq_real_of_nat: "of_nat i = ennreal (of_nat i)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
945 |
by (induction i) simp_all |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
946 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
947 |
lemma of_nat_le_ennreal_iff[simp]: "0 \<le> r \<Longrightarrow> of_nat i \<le> ennreal r \<longleftrightarrow> of_nat i \<le> r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
948 |
by (simp add: ennreal_of_nat_eq_real_of_nat) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
949 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
950 |
lemma ennreal_le_of_nat_iff[simp]: "ennreal r \<le> of_nat i \<longleftrightarrow> r \<le> of_nat i" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
951 |
by (simp add: ennreal_of_nat_eq_real_of_nat) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
952 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
953 |
lemma ennreal_indicator: "ennreal (indicator A x) = indicator A x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
954 |
by (auto split: split_indicator) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
955 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
956 |
lemma ennreal_numeral[simp]: "ennreal (numeral n) = numeral n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
957 |
using ennreal_of_nat_eq_real_of_nat[of "numeral n"] by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
958 |
|
70271 | 959 |
lemma ennreal_less_numeral_iff [simp]: "ennreal n < numeral w \<longleftrightarrow> n < numeral w" |
960 |
by (metis ennreal_less_iff ennreal_numeral less_le not_less zero_less_numeral) |
|
961 |
||
962 |
lemma numeral_less_ennreal_iff [simp]: "numeral w < ennreal n \<longleftrightarrow> numeral w < n" |
|
963 |
using ennreal_less_iff zero_le_numeral by fastforce |
|
964 |
||
965 |
lemma numeral_le_ennreal_iff [simp]: "numeral n \<le> ennreal m \<longleftrightarrow> numeral n \<le> m" |
|
966 |
by (metis not_le ennreal_less_numeral_iff) |
|
967 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
968 |
lemma min_ennreal: "0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> min (ennreal x) (ennreal y) = ennreal (min x y)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
969 |
by (auto split: split_min) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
970 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
971 |
lemma ennreal_half[simp]: "ennreal (1/2) = inverse 2" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
972 |
by transfer (simp add: max.absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
973 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
974 |
lemma ennreal_minus: "0 \<le> q \<Longrightarrow> ennreal r - ennreal q = ennreal (r - q)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
975 |
by transfer |
68406 | 976 |
(simp add: max.absorb2 zero_ereal_def flip: ereal_max) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
977 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
978 |
lemma ennreal_minus_top[simp]: "ennreal a - top = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
979 |
by (simp add: minus_top_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
980 |
|
67451 | 981 |
lemma e2eenreal_enn2ereal_diff [simp]: |
982 |
"e2ennreal(enn2ereal x - enn2ereal y) = x - y" for x y |
|
983 |
by (cases x, cases y, auto simp add: ennreal_minus e2ennreal_neg) |
|
984 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
985 |
lemma ennreal_mult: "0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
986 |
by transfer (simp add: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
987 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
988 |
lemma ennreal_mult': "0 \<le> a \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
989 |
by (cases "0 \<le> b") (auto simp: ennreal_mult ennreal_neg mult_nonneg_nonpos) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
990 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
991 |
lemma indicator_mult_ennreal: "indicator A x * ennreal r = ennreal (indicator A x * r)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
992 |
by (simp split: split_indicator) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
993 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
994 |
lemma ennreal_mult'': "0 \<le> b \<Longrightarrow> ennreal (a * b) = ennreal a * ennreal b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
995 |
by (cases "0 \<le> a") (auto simp: ennreal_mult ennreal_neg mult_nonpos_nonneg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
996 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
997 |
lemma numeral_mult_ennreal: "0 \<le> x \<Longrightarrow> numeral b * ennreal x = ennreal (numeral b * x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
998 |
by (simp add: ennreal_mult) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
999 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1000 |
lemma ennreal_power: "0 \<le> r \<Longrightarrow> ennreal r ^ n = ennreal (r ^ n)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1001 |
by (induction n) (auto simp: ennreal_mult) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1002 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1003 |
lemma power_eq_top_ennreal: "x ^ n = top \<longleftrightarrow> (n \<noteq> 0 \<and> (x::ennreal) = top)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1004 |
by (cases x rule: ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1005 |
(auto simp: ennreal_power top_power_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1006 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1007 |
lemma inverse_ennreal: "0 < r \<Longrightarrow> inverse (ennreal r) = ennreal (inverse r)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1008 |
by transfer (simp add: max.absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1009 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1010 |
lemma divide_ennreal: "0 \<le> r \<Longrightarrow> 0 < q \<Longrightarrow> ennreal r / ennreal q = ennreal (r / q)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1011 |
by (simp add: divide_ennreal_def inverse_ennreal ennreal_mult[symmetric] inverse_eq_divide) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1012 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1013 |
lemma ennreal_inverse_power: "inverse (x ^ n :: ennreal) = inverse x ^ n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1014 |
proof (cases x rule: ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1015 |
case top with power_eq_top_ennreal[of x n] show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1016 |
by (cases "n = 0") auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1017 |
next |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1018 |
case (real r) then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1019 |
proof cases |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1020 |
assume "x = 0" then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1021 |
using power_eq_top_ennreal[of top "n - 1"] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1022 |
by (cases n) (auto simp: ennreal_top_mult) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1023 |
next |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1024 |
assume "x \<noteq> 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1025 |
with real have "0 < r" by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1026 |
with real show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1027 |
by (induction n) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1028 |
(auto simp add: ennreal_power ennreal_mult[symmetric] inverse_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1029 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1030 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1031 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1032 |
lemma ennreal_divide_numeral: "0 \<le> x \<Longrightarrow> ennreal x / numeral b = ennreal (x / numeral b)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1033 |
by (subst divide_ennreal[symmetric]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1034 |
|
64272 | 1035 |
lemma prod_ennreal: "(\<And>i. i \<in> A \<Longrightarrow> 0 \<le> f i) \<Longrightarrow> (\<Prod>i\<in>A. ennreal (f i)) = ennreal (prod f A)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1036 |
by (induction A rule: infinite_finite_induct) |
64272 | 1037 |
(auto simp: ennreal_mult prod_nonneg) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1038 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1039 |
lemma mult_right_ennreal_cancel: "a * ennreal c = b * ennreal c \<longleftrightarrow> (a = b \<or> c \<le> 0)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1040 |
apply (cases "0 \<le> c") |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1041 |
apply (cases a b rule: ennreal2_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1042 |
apply (auto simp: ennreal_mult[symmetric] ennreal_neg ennreal_top_mult) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1043 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1044 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1045 |
lemma ennreal_le_epsilon: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1046 |
"(\<And>e::real. y < top \<Longrightarrow> 0 < e \<Longrightarrow> x \<le> y + ennreal e) \<Longrightarrow> x \<le> y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1047 |
apply (cases y rule: ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1048 |
apply (cases x rule: ennreal_cases) |
68406 | 1049 |
apply (auto simp flip: ennreal_plus simp add: top_unique intro: zero_less_one field_le_epsilon) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1050 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1051 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1052 |
lemma ennreal_rat_dense: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1053 |
fixes x y :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1054 |
shows "x < y \<Longrightarrow> \<exists>r::rat. x < real_of_rat r \<and> real_of_rat r < y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1055 |
proof transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1056 |
fix x y :: ereal assume xy: "0 \<le> x" "0 \<le> y" "x < y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1057 |
moreover |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1058 |
from ereal_dense3[OF \<open>x < y\<close>] |
63540 | 1059 |
obtain r where r: "x < ereal (real_of_rat r)" "ereal (real_of_rat r) < y" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1060 |
by auto |
63540 | 1061 |
then have "0 \<le> r" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1062 |
using le_less_trans[OF \<open>0 \<le> x\<close> \<open>x < ereal (real_of_rat r)\<close>] by auto |
63540 | 1063 |
with r show "\<exists>r. x < (sup 0 \<circ> ereal) (real_of_rat r) \<and> (sup 0 \<circ> ereal) (real_of_rat r) < y" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1064 |
by (intro exI[of _ r]) (auto simp: max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1065 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1066 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1067 |
lemma ennreal_Ex_less_of_nat: "(x::ennreal) < top \<Longrightarrow> \<exists>n. x < of_nat n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1068 |
by (cases x rule: ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1069 |
(auto simp: ennreal_of_nat_eq_real_of_nat ennreal_less_iff reals_Archimedean2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1070 |
|
69593 | 1071 |
subsection \<open>Coercion from \<^typ>\<open>ennreal\<close> to \<^typ>\<open>real\<close>\<close> |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1072 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1073 |
definition "enn2real x = real_of_ereal (enn2ereal x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1074 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1075 |
lemma enn2real_nonneg[simp]: "0 \<le> enn2real x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1076 |
by (auto simp: enn2real_def intro!: real_of_ereal_pos enn2ereal_nonneg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1077 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1078 |
lemma enn2real_mono: "a \<le> b \<Longrightarrow> b < top \<Longrightarrow> enn2real a \<le> enn2real b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1079 |
by (auto simp add: enn2real_def less_eq_ennreal.rep_eq intro!: real_of_ereal_positive_mono enn2ereal_nonneg) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1080 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1081 |
lemma enn2real_of_nat[simp]: "enn2real (of_nat n) = n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1082 |
by (auto simp: enn2real_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1083 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1084 |
lemma enn2real_ennreal[simp]: "0 \<le> r \<Longrightarrow> enn2real (ennreal r) = r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1085 |
by (simp add: enn2real_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1086 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1087 |
lemma ennreal_enn2real[simp]: "r < top \<Longrightarrow> ennreal (enn2real r) = r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1088 |
by (cases r rule: ennreal_cases) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1089 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1090 |
lemma real_of_ereal_enn2ereal[simp]: "real_of_ereal (enn2ereal x) = enn2real x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1091 |
by (simp add: enn2real_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1092 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1093 |
lemma enn2real_top[simp]: "enn2real top = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1094 |
unfolding enn2real_def top_ennreal.rep_eq top_ereal_def by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1095 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1096 |
lemma enn2real_0[simp]: "enn2real 0 = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1097 |
unfolding enn2real_def zero_ennreal.rep_eq by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1098 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1099 |
lemma enn2real_1[simp]: "enn2real 1 = 1" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1100 |
unfolding enn2real_def one_ennreal.rep_eq by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1101 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1102 |
lemma enn2real_numeral[simp]: "enn2real (numeral n) = (numeral n)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1103 |
unfolding enn2real_def by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1104 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1105 |
lemma enn2real_mult: "enn2real (a * b) = enn2real a * enn2real b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1106 |
unfolding enn2real_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1107 |
by (simp del: real_of_ereal_enn2ereal add: times_ennreal.rep_eq) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1108 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1109 |
lemma enn2real_leI: "0 \<le> B \<Longrightarrow> x \<le> ennreal B \<Longrightarrow> enn2real x \<le> B" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1110 |
by (cases x rule: ennreal_cases) (auto simp: top_unique) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1111 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1112 |
lemma enn2real_positive_iff: "0 < enn2real x \<longleftrightarrow> (0 < x \<and> x < top)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1113 |
by (cases x rule: ennreal_cases) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1114 |
|
64320
ba194424b895
HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents:
64284
diff
changeset
|
1115 |
lemma enn2real_eq_1_iff[simp]: "enn2real x = 1 \<longleftrightarrow> x = 1" |
ba194424b895
HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents:
64284
diff
changeset
|
1116 |
by (cases x) auto |
ba194424b895
HOL-Probability: move stopping time from AFP/Markov_Models
hoelzl
parents:
64284
diff
changeset
|
1117 |
|
69593 | 1118 |
subsection \<open>Coercion from \<^typ>\<open>enat\<close> to \<^typ>\<open>ennreal\<close>\<close> |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1119 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1120 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1121 |
definition ennreal_of_enat :: "enat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1122 |
where |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1123 |
"ennreal_of_enat n = (case n of \<infinity> \<Rightarrow> top | enat n \<Rightarrow> of_nat n)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1124 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1125 |
declare [[coercion ennreal_of_enat]] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1126 |
declare [[coercion "of_nat :: nat \<Rightarrow> ennreal"]] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1127 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1128 |
lemma ennreal_of_enat_infty[simp]: "ennreal_of_enat \<infinity> = \<infinity>" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1129 |
by (simp add: ennreal_of_enat_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1130 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1131 |
lemma ennreal_of_enat_enat[simp]: "ennreal_of_enat (enat n) = of_nat n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1132 |
by (simp add: ennreal_of_enat_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1133 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1134 |
lemma ennreal_of_enat_0[simp]: "ennreal_of_enat 0 = 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1135 |
using ennreal_of_enat_enat[of 0] unfolding enat_0 by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1136 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1137 |
lemma ennreal_of_enat_1[simp]: "ennreal_of_enat 1 = 1" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1138 |
using ennreal_of_enat_enat[of 1] unfolding enat_1 by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1139 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1140 |
lemma ennreal_top_neq_of_nat[simp]: "(top::ennreal) \<noteq> of_nat i" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1141 |
using ennreal_of_nat_neq_top[of i] by metis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1142 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1143 |
lemma ennreal_of_enat_inj[simp]: "ennreal_of_enat i = ennreal_of_enat j \<longleftrightarrow> i = j" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1144 |
by (cases i j rule: enat.exhaust[case_product enat.exhaust]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1145 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1146 |
lemma ennreal_of_enat_le_iff[simp]: "ennreal_of_enat m \<le> ennreal_of_enat n \<longleftrightarrow> m \<le> n" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1147 |
by (auto simp: ennreal_of_enat_def top_unique split: enat.split) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1148 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1149 |
lemma of_nat_less_ennreal_of_nat[simp]: "of_nat n \<le> ennreal_of_enat x \<longleftrightarrow> of_nat n \<le> x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1150 |
by (cases x) (auto simp: of_nat_eq_enat) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1151 |
|
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1152 |
lemma ennreal_of_enat_Sup: "ennreal_of_enat (Sup X) = (SUP x\<in>X. ennreal_of_enat x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1153 |
proof - |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1154 |
have "ennreal_of_enat (Sup X) \<le> (SUP x \<in> X. ennreal_of_enat x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1155 |
unfolding Sup_enat_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1156 |
proof (clarsimp, intro conjI impI) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1157 |
fix x assume "finite X" "X \<noteq> {}" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1158 |
then show "ennreal_of_enat (Max X) \<le> (SUP x \<in> X. ennreal_of_enat x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1159 |
by (intro SUP_upper Max_in) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1160 |
next |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1161 |
assume "infinite X" "X \<noteq> {}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1162 |
have "\<exists>y\<in>X. r < ennreal_of_enat y" if r: "r < top" for r |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1163 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1164 |
from ennreal_Ex_less_of_nat[OF r] guess n .. note n = this |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1165 |
have "\<not> (X \<subseteq> enat ` {.. n})" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1166 |
using \<open>infinite X\<close> by (auto dest: finite_subset) |
63540 | 1167 |
then obtain x where x: "x \<in> X" "x \<notin> enat ` {..n}" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1168 |
by blast |
63540 | 1169 |
then have "of_nat n \<le> x" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1170 |
by (cases x) (auto simp: of_nat_eq_enat) |
63540 | 1171 |
with x show ?thesis |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1172 |
by (auto intro!: bexI[of _ x] less_le_trans[OF n]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1173 |
qed |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1174 |
then have "(SUP x \<in> X. ennreal_of_enat x) = top" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1175 |
by simp |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1176 |
then show "top \<le> (SUP x \<in> X. ennreal_of_enat x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1177 |
unfolding top_unique by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1178 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1179 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1180 |
by (auto intro!: antisym Sup_least intro: Sup_upper) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1181 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1182 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1183 |
lemma ennreal_of_enat_eSuc[simp]: "ennreal_of_enat (eSuc x) = 1 + ennreal_of_enat x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1184 |
by (cases x) (auto simp: eSuc_enat) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1185 |
|
69593 | 1186 |
subsection \<open>Topology on \<^typ>\<open>ennreal\<close>\<close> |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1187 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1188 |
lemma enn2ereal_Iio: "enn2ereal -` {..<a} = (if 0 \<le> a then {..< e2ennreal a} else {})" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1189 |
using enn2ereal_nonneg |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1190 |
by (cases a rule: ereal_ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1191 |
(auto simp add: vimage_def set_eq_iff ennreal.enn2ereal_inverse less_ennreal.rep_eq e2ennreal_def max_absorb2 |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1192 |
simp del: enn2ereal_nonneg |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1193 |
intro: le_less_trans less_imp_le) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1194 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1195 |
lemma enn2ereal_Ioi: "enn2ereal -` {a <..} = (if 0 \<le> a then {e2ennreal a <..} else UNIV)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1196 |
by (cases a rule: ereal_ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1197 |
(auto simp add: vimage_def set_eq_iff ennreal.enn2ereal_inverse less_ennreal.rep_eq e2ennreal_def max_absorb2 |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1198 |
intro: less_le_trans) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1199 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1200 |
instantiation ennreal :: linear_continuum_topology |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1201 |
begin |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1202 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1203 |
definition open_ennreal :: "ennreal set \<Rightarrow> bool" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1204 |
where "(open :: ennreal set \<Rightarrow> bool) = generate_topology (range lessThan \<union> range greaterThan)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1205 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1206 |
instance |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1207 |
proof |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1208 |
show "\<exists>a b::ennreal. a \<noteq> b" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1209 |
using zero_neq_one by (intro exI) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1210 |
show "\<And>x y::ennreal. x < y \<Longrightarrow> \<exists>z>x. z < y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1211 |
proof transfer |
63539 | 1212 |
fix x y :: ereal assume "0 \<le> x" and *: "x < y" |
1213 |
moreover from dense[OF *] guess z .. |
|
67399 | 1214 |
ultimately show "\<exists>z\<in>Collect ((\<le>) 0). x < z \<and> z < y" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1215 |
by (intro bexI[of _ z]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1216 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1217 |
qed (rule open_ennreal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1218 |
|
62375 | 1219 |
end |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1220 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1221 |
lemma continuous_on_e2ennreal: "continuous_on A e2ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1222 |
proof (rule continuous_on_subset) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1223 |
show "continuous_on ({0..} \<union> {..0}) e2ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1224 |
proof (rule continuous_on_closed_Un) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1225 |
show "continuous_on {0 ..} e2ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1226 |
by (rule continuous_onI_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1227 |
(auto simp add: less_eq_ennreal.abs_eq eq_onp_def enn2ereal_range) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1228 |
show "continuous_on {.. 0} e2ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1229 |
by (subst continuous_on_cong[OF refl, of _ _ "\<lambda>_. 0"]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1230 |
(auto simp add: e2ennreal_neg continuous_on_const) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1231 |
qed auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1232 |
show "A \<subseteq> {0..} \<union> {..0::ereal}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1233 |
by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1234 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1235 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1236 |
lemma continuous_at_e2ennreal: "continuous (at x within A) e2ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1237 |
by (rule continuous_on_imp_continuous_within[OF continuous_on_e2ennreal, of _ UNIV]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1238 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1239 |
lemma continuous_on_enn2ereal: "continuous_on UNIV enn2ereal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1240 |
by (rule continuous_on_generate_topology[OF open_generated_order]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1241 |
(auto simp add: enn2ereal_Iio enn2ereal_Ioi) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1242 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1243 |
lemma continuous_at_enn2ereal: "continuous (at x within A) enn2ereal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1244 |
by (rule continuous_on_imp_continuous_within[OF continuous_on_enn2ereal]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1245 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1246 |
lemma sup_continuous_e2ennreal[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1247 |
assumes f: "sup_continuous f" shows "sup_continuous (\<lambda>x. e2ennreal (f x))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1248 |
apply (rule sup_continuous_compose[OF _ f]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1249 |
apply (rule continuous_at_left_imp_sup_continuous) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1250 |
apply (auto simp: mono_def e2ennreal_mono continuous_at_e2ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1251 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1252 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1253 |
lemma sup_continuous_enn2ereal[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1254 |
assumes f: "sup_continuous f" shows "sup_continuous (\<lambda>x. enn2ereal (f x))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1255 |
apply (rule sup_continuous_compose[OF _ f]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1256 |
apply (rule continuous_at_left_imp_sup_continuous) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1257 |
apply (simp_all add: mono_def less_eq_ennreal.rep_eq continuous_at_enn2ereal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1258 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1259 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1260 |
lemma sup_continuous_mult_left_ennreal': |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1261 |
fixes c :: "ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1262 |
shows "sup_continuous (\<lambda>x. c * x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1263 |
unfolding sup_continuous_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1264 |
by transfer (auto simp: SUP_ereal_mult_left max.absorb2 SUP_upper2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1265 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1266 |
lemma sup_continuous_mult_left_ennreal[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1267 |
"sup_continuous f \<Longrightarrow> sup_continuous (\<lambda>x. c * f x :: ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1268 |
by (rule sup_continuous_compose[OF sup_continuous_mult_left_ennreal']) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1269 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1270 |
lemma sup_continuous_mult_right_ennreal[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1271 |
"sup_continuous f \<Longrightarrow> sup_continuous (\<lambda>x. f x * c :: ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1272 |
using sup_continuous_mult_left_ennreal[of f c] by (simp add: mult.commute) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1273 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1274 |
lemma sup_continuous_divide_ennreal[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1275 |
fixes f g :: "'a::complete_lattice \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1276 |
shows "sup_continuous f \<Longrightarrow> sup_continuous (\<lambda>x. f x / c)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1277 |
unfolding divide_ennreal_def by (rule sup_continuous_mult_right_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1278 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1279 |
lemma transfer_enn2ereal_continuous_on [transfer_rule]: |
67399 | 1280 |
"rel_fun (=) (rel_fun (rel_fun (=) pcr_ennreal) (=)) continuous_on continuous_on" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1281 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1282 |
have "continuous_on A f" if "continuous_on A (\<lambda>x. enn2ereal (f x))" for A and f :: "'a \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1283 |
using continuous_on_compose2[OF continuous_on_e2ennreal[of "{0..}"] that] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1284 |
by (auto simp: ennreal.enn2ereal_inverse subset_eq e2ennreal_def max_absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1285 |
moreover |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1286 |
have "continuous_on A (\<lambda>x. enn2ereal (f x))" if "continuous_on A f" for A and f :: "'a \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1287 |
using continuous_on_compose2[OF continuous_on_enn2ereal that] by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1288 |
ultimately |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1289 |
show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1290 |
by (auto simp add: rel_fun_def ennreal.pcr_cr_eq cr_ennreal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1291 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1292 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1293 |
lemma transfer_sup_continuous[transfer_rule]: |
67399 | 1294 |
"(rel_fun (rel_fun (=) pcr_ennreal) (=)) sup_continuous sup_continuous" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1295 |
proof (safe intro!: rel_funI dest!: rel_fun_eq_pcr_ennreal[THEN iffD1]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1296 |
show "sup_continuous (enn2ereal \<circ> f) \<Longrightarrow> sup_continuous f" for f :: "'a \<Rightarrow> _" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1297 |
using sup_continuous_e2ennreal[of "enn2ereal \<circ> f"] by simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1298 |
show "sup_continuous f \<Longrightarrow> sup_continuous (enn2ereal \<circ> f)" for f :: "'a \<Rightarrow> _" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1299 |
using sup_continuous_enn2ereal[of f] by (simp add: comp_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1300 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1301 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1302 |
lemma continuous_on_ennreal[tendsto_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1303 |
"continuous_on A f \<Longrightarrow> continuous_on A (\<lambda>x. ennreal (f x))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1304 |
by transfer (auto intro!: continuous_on_max continuous_on_const continuous_on_ereal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1305 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1306 |
lemma tendsto_ennrealD: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1307 |
assumes lim: "((\<lambda>x. ennreal (f x)) \<longlongrightarrow> ennreal x) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1308 |
assumes *: "\<forall>\<^sub>F x in F. 0 \<le> f x" and x: "0 \<le> x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1309 |
shows "(f \<longlongrightarrow> x) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1310 |
using continuous_on_tendsto_compose[OF continuous_on_enn2ereal lim] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1311 |
apply simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1312 |
apply (subst (asm) tendsto_cong) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1313 |
using * |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1314 |
apply eventually_elim |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1315 |
apply (auto simp: max_absorb2 \<open>0 \<le> x\<close>) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1316 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1317 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1318 |
lemma tendsto_ennreal_iff[simp]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1319 |
"\<forall>\<^sub>F x in F. 0 \<le> f x \<Longrightarrow> 0 \<le> x \<Longrightarrow> ((\<lambda>x. ennreal (f x)) \<longlongrightarrow> ennreal x) F \<longleftrightarrow> (f \<longlongrightarrow> x) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1320 |
by (auto dest: tendsto_ennrealD) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1321 |
(auto simp: ennreal_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1322 |
intro!: continuous_on_tendsto_compose[OF continuous_on_e2ennreal[of UNIV]] tendsto_max) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1323 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1324 |
lemma tendsto_enn2ereal_iff[simp]: "((\<lambda>i. enn2ereal (f i)) \<longlongrightarrow> enn2ereal x) F \<longleftrightarrow> (f \<longlongrightarrow> x) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1325 |
using continuous_on_enn2ereal[THEN continuous_on_tendsto_compose, of f x F] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1326 |
continuous_on_e2ennreal[THEN continuous_on_tendsto_compose, of "\<lambda>x. enn2ereal (f x)" "enn2ereal x" F UNIV] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1327 |
by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1328 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1329 |
lemma continuous_on_add_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1330 |
fixes f g :: "'a::topological_space \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1331 |
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. f x + g x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1332 |
by (transfer fixing: A) (auto intro!: tendsto_add_ereal_nonneg simp: continuous_on_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1333 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1334 |
lemma continuous_on_inverse_ennreal[continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1335 |
fixes f :: "'a::topological_space \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1336 |
shows "continuous_on A f \<Longrightarrow> continuous_on A (\<lambda>x. inverse (f x))" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1337 |
proof (transfer fixing: A) |
67399 | 1338 |
show "pred_fun top ((\<le>) 0) f \<Longrightarrow> continuous_on A (\<lambda>x. inverse (f x))" if "continuous_on A f" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1339 |
for f :: "'a \<Rightarrow> ereal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1340 |
using continuous_on_compose2[OF continuous_on_inverse_ereal that] by (auto simp: subset_eq) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1341 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1342 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1343 |
instance ennreal :: topological_comm_monoid_add |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1344 |
proof |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1345 |
show "((\<lambda>x. fst x + snd x) \<longlongrightarrow> a + b) (nhds a \<times>\<^sub>F nhds b)" for a b :: ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1346 |
using continuous_on_add_ennreal[of UNIV fst snd] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1347 |
using tendsto_at_iff_tendsto_nhds[symmetric, of "\<lambda>x::(ennreal \<times> ennreal). fst x + snd x"] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1348 |
by (auto simp: continuous_on_eq_continuous_at) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1349 |
(simp add: isCont_def nhds_prod[symmetric]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1350 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1351 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1352 |
lemma sup_continuous_add_ennreal[order_continuous_intros]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1353 |
fixes f g :: "'a::complete_lattice \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1354 |
shows "sup_continuous f \<Longrightarrow> sup_continuous g \<Longrightarrow> sup_continuous (\<lambda>x. f x + g x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1355 |
by transfer (auto intro!: sup_continuous_add) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1356 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1357 |
lemma ennreal_suminf_lessD: "(\<Sum>i. f i :: ennreal) < x \<Longrightarrow> f i < x" |
64267 | 1358 |
using le_less_trans[OF sum_le_suminf[OF summableI, of "{i}" f]] by simp |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1359 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1360 |
lemma sums_ennreal[simp]: "(\<And>i. 0 \<le> f i) \<Longrightarrow> 0 \<le> x \<Longrightarrow> (\<lambda>i. ennreal (f i)) sums ennreal x \<longleftrightarrow> f sums x" |
64267 | 1361 |
unfolding sums_def by (simp add: always_eventually sum_nonneg) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1362 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1363 |
lemma summable_suminf_not_top: "(\<And>i. 0 \<le> f i) \<Longrightarrow> (\<Sum>i. ennreal (f i)) \<noteq> top \<Longrightarrow> summable f" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1364 |
using summable_sums[OF summableI, of "\<lambda>i. ennreal (f i)"] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1365 |
by (cases "\<Sum>i. ennreal (f i)" rule: ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1366 |
(auto simp: summable_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1367 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1368 |
lemma suminf_ennreal[simp]: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1369 |
"(\<And>i. 0 \<le> f i) \<Longrightarrow> (\<Sum>i. ennreal (f i)) \<noteq> top \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal (\<Sum>i. f i)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1370 |
by (rule sums_unique[symmetric]) (simp add: summable_suminf_not_top suminf_nonneg summable_sums) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1371 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1372 |
lemma sums_enn2ereal[simp]: "(\<lambda>i. enn2ereal (f i)) sums enn2ereal x \<longleftrightarrow> f sums x" |
64267 | 1373 |
unfolding sums_def by (simp add: always_eventually sum_nonneg) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1374 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1375 |
lemma suminf_enn2ereal[simp]: "(\<Sum>i. enn2ereal (f i)) = enn2ereal (suminf f)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1376 |
by (rule sums_unique[symmetric]) (simp add: summable_sums) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1377 |
|
67399 | 1378 |
lemma transfer_e2ennreal_suminf [transfer_rule]: "rel_fun (rel_fun (=) pcr_ennreal) pcr_ennreal suminf suminf" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1379 |
by (auto simp: rel_funI rel_fun_eq_pcr_ennreal comp_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1380 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1381 |
lemma ennreal_suminf_cmult[simp]: "(\<Sum>i. r * f i) = r * (\<Sum>i. f i::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1382 |
by transfer (auto intro!: suminf_cmult_ereal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1383 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1384 |
lemma ennreal_suminf_multc[simp]: "(\<Sum>i. f i * r) = (\<Sum>i. f i::ennreal) * r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1385 |
using ennreal_suminf_cmult[of r f] by (simp add: ac_simps) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1386 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1387 |
lemma ennreal_suminf_divide[simp]: "(\<Sum>i. f i / r) = (\<Sum>i. f i::ennreal) / r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1388 |
by (simp add: divide_ennreal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1389 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1390 |
lemma ennreal_suminf_neq_top: "summable f \<Longrightarrow> (\<And>i. 0 \<le> f i) \<Longrightarrow> (\<Sum>i. ennreal (f i)) \<noteq> top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1391 |
using sums_ennreal[of f "suminf f"] |
68406 | 1392 |
by (simp add: suminf_nonneg flip: sums_unique summable_sums_iff del: sums_ennreal) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1393 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1394 |
lemma suminf_ennreal_eq: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1395 |
"(\<And>i. 0 \<le> f i) \<Longrightarrow> f sums x \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1396 |
using suminf_nonneg[of f] sums_unique[of f x] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1397 |
by (intro sums_unique[symmetric]) (auto simp: summable_sums_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1398 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1399 |
lemma ennreal_suminf_bound_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1400 |
fixes f :: "nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1401 |
shows "(\<And>N. (\<Sum>n<N. f n) + y \<le> x) \<Longrightarrow> suminf f + y \<le> x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1402 |
by transfer (auto intro!: suminf_bound_add) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1403 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1404 |
lemma ennreal_suminf_SUP_eq_directed: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1405 |
fixes f :: "'a \<Rightarrow> nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1406 |
assumes *: "\<And>N i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> finite N \<Longrightarrow> \<exists>k\<in>I. \<forall>n\<in>N. f i n \<le> f k n \<and> f j n \<le> f k n" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1407 |
shows "(\<Sum>n. SUP i\<in>I. f i n) = (SUP i\<in>I. \<Sum>n. f i n)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1408 |
proof cases |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1409 |
assume "I \<noteq> {}" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1410 |
then obtain i where "i \<in> I" by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1411 |
from * show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1412 |
by (transfer fixing: I) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1413 |
(auto simp: max_absorb2 SUP_upper2[OF \<open>i \<in> I\<close>] suminf_nonneg summable_ereal_pos \<open>I \<noteq> {}\<close> |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1414 |
intro!: suminf_SUP_eq_directed) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1415 |
qed (simp add: bot_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1416 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1417 |
lemma INF_ennreal_add_const: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1418 |
fixes f g :: "nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1419 |
shows "(INF i. f i + c) = (INF i. f i) + c" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1420 |
using continuous_at_Inf_mono[of "\<lambda>x. x + c" "f`UNIV"] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1421 |
using continuous_add[of "at_right (Inf (range f))", of "\<lambda>x. x" "\<lambda>x. c"] |
69861
62e47f06d22c
avoid context-sensitive simp rules whose context-free form (image_comp) is not simp by default
haftmann
parents:
69661
diff
changeset
|
1422 |
by (auto simp: mono_def image_comp) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1423 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1424 |
lemma INF_ennreal_const_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1425 |
fixes f g :: "nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1426 |
shows "(INF i. c + f i) = c + (INF i. f i)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1427 |
using INF_ennreal_add_const[of f c] by (simp add: ac_simps) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1428 |
|
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1429 |
lemma SUP_mult_left_ennreal: "c * (SUP i\<in>I. f i) = (SUP i\<in>I. c * f i ::ennreal)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1430 |
proof cases |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1431 |
assume "I \<noteq> {}" then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1432 |
by transfer (auto simp add: SUP_ereal_mult_left max_absorb2 SUP_upper2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1433 |
qed (simp add: bot_ennreal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1434 |
|
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1435 |
lemma SUP_mult_right_ennreal: "(SUP i\<in>I. f i) * c = (SUP i\<in>I. f i * c ::ennreal)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1436 |
using SUP_mult_left_ennreal by (simp add: mult.commute) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1437 |
|
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1438 |
lemma SUP_divide_ennreal: "(SUP i\<in>I. f i) / c = (SUP i\<in>I. f i / c ::ennreal)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1439 |
using SUP_mult_right_ennreal by (simp add: divide_ennreal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1440 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1441 |
lemma ennreal_SUP_of_nat_eq_top: "(SUP x. of_nat x :: ennreal) = top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1442 |
proof (intro antisym top_greatest le_SUP_iff[THEN iffD2] allI impI) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1443 |
fix y :: ennreal assume "y < top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1444 |
then obtain r where "y = ennreal r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1445 |
by (cases y rule: ennreal_cases) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1446 |
then show "\<exists>i\<in>UNIV. y < of_nat i" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1447 |
using reals_Archimedean2[of "max 1 r"] zero_less_one |
67451 | 1448 |
by (simp add: ennreal_Ex_less_of_nat) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1449 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1450 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1451 |
lemma ennreal_SUP_eq_top: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1452 |
fixes f :: "'a \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1453 |
assumes "\<And>n. \<exists>i\<in>I. of_nat n \<le> f i" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1454 |
shows "(SUP i \<in> I. f i) = top" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1455 |
proof - |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1456 |
have "(SUP x. of_nat x :: ennreal) \<le> (SUP i \<in> I. f i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1457 |
using assms by (auto intro!: SUP_least intro: SUP_upper2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1458 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1459 |
by (auto simp: ennreal_SUP_of_nat_eq_top top_unique) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1460 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1461 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1462 |
lemma ennreal_INF_const_minus: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1463 |
fixes f :: "'a \<Rightarrow> ennreal" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1464 |
shows "I \<noteq> {} \<Longrightarrow> (SUP x\<in>I. c - f x) = c - (INF x\<in>I. f x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1465 |
by (transfer fixing: I) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1466 |
(simp add: sup_max[symmetric] SUP_sup_const1 SUP_ereal_minus_right del: sup_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1467 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1468 |
lemma of_nat_Sup_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1469 |
assumes "A \<noteq> {}" "bdd_above A" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1470 |
shows "of_nat (Sup A) = (SUP a\<in>A. of_nat a :: ennreal)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1471 |
proof (intro antisym) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1472 |
show "(SUP a\<in>A. of_nat a::ennreal) \<le> of_nat (Sup A)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1473 |
by (intro SUP_least of_nat_mono) (auto intro: cSup_upper assms) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1474 |
have "Sup A \<in> A" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1475 |
unfolding Sup_nat_def using assms by (intro Max_in) (auto simp: bdd_above_nat) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1476 |
then show "of_nat (Sup A) \<le> (SUP a\<in>A. of_nat a::ennreal)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1477 |
by (intro SUP_upper) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1478 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1479 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1480 |
lemma ennreal_tendsto_const_minus: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1481 |
fixes g :: "'a \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1482 |
assumes ae: "\<forall>\<^sub>F x in F. g x \<le> c" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1483 |
assumes g: "((\<lambda>x. c - g x) \<longlongrightarrow> 0) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1484 |
shows "(g \<longlongrightarrow> c) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1485 |
proof (cases c rule: ennreal_cases) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1486 |
case top with tendsto_unique[OF _ g, of "top"] show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1487 |
by (cases "F = bot") auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1488 |
next |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1489 |
case (real r) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1490 |
then have "\<forall>x. \<exists>q\<ge>0. g x \<le> c \<longrightarrow> (g x = ennreal q \<and> q \<le> r)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1491 |
by (auto simp: le_ennreal_iff) |
63060 | 1492 |
then obtain f where *: "0 \<le> f x" "g x = ennreal (f x)" "f x \<le> r" if "g x \<le> c" for x |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1493 |
by metis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1494 |
from ae have ae2: "\<forall>\<^sub>F x in F. c - g x = ennreal (r - f x) \<and> f x \<le> r \<and> g x = ennreal (f x) \<and> 0 \<le> f x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1495 |
proof eventually_elim |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1496 |
fix x assume "g x \<le> c" with *[of x] \<open>0 \<le> r\<close> show "c - g x = ennreal (r - f x) \<and> f x \<le> r \<and> g x = ennreal (f x) \<and> 0 \<le> f x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1497 |
by (auto simp: real ennreal_minus) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1498 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1499 |
with g have "((\<lambda>x. ennreal (r - f x)) \<longlongrightarrow> ennreal 0) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1500 |
by (auto simp add: tendsto_cong eventually_conj_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1501 |
with ae2 have "((\<lambda>x. r - f x) \<longlongrightarrow> 0) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1502 |
by (subst (asm) tendsto_ennreal_iff) (auto elim: eventually_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1503 |
then have "(f \<longlongrightarrow> r) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1504 |
by (rule Lim_transform2[OF tendsto_const]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1505 |
with ae2 have "((\<lambda>x. ennreal (f x)) \<longlongrightarrow> ennreal r) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1506 |
by (subst tendsto_ennreal_iff) (auto elim: eventually_mono simp: real) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1507 |
with ae2 show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1508 |
by (auto simp: real tendsto_cong eventually_conj_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1509 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1510 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1511 |
lemma ennreal_SUP_add: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1512 |
fixes f g :: "nat \<Rightarrow> ennreal" |
69313 | 1513 |
shows "incseq f \<Longrightarrow> incseq g \<Longrightarrow> (SUP i. f i + g i) = Sup (f ` UNIV) + Sup (g ` UNIV)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1514 |
unfolding incseq_def le_fun_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1515 |
by transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1516 |
(simp add: SUP_ereal_add incseq_def le_fun_def max_absorb2 SUP_upper2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1517 |
|
64267 | 1518 |
lemma ennreal_SUP_sum: |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1519 |
fixes f :: "'a \<Rightarrow> nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1520 |
shows "(\<And>i. i \<in> I \<Longrightarrow> incseq (f i)) \<Longrightarrow> (SUP n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. SUP n. f i n)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1521 |
unfolding incseq_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1522 |
by transfer |
64267 | 1523 |
(simp add: SUP_ereal_sum incseq_def SUP_upper2 max_absorb2 sum_nonneg) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1524 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1525 |
lemma ennreal_liminf_minus: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1526 |
fixes f :: "nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1527 |
shows "(\<And>n. f n \<le> c) \<Longrightarrow> liminf (\<lambda>n. c - f n) = c - limsup f" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1528 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1529 |
apply (simp add: ereal_diff_positive max.absorb2 liminf_ereal_cminus) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1530 |
apply (subst max.absorb2) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1531 |
apply (rule ereal_diff_positive) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1532 |
apply (rule Limsup_bounded) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1533 |
apply auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1534 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1535 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1536 |
lemma ennreal_continuous_on_cmult: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1537 |
"(c::ennreal) < top \<Longrightarrow> continuous_on A f \<Longrightarrow> continuous_on A (\<lambda>x. c * f x)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1538 |
by (transfer fixing: A) (auto intro: continuous_on_cmult_ereal) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1539 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1540 |
lemma ennreal_tendsto_cmult: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1541 |
"(c::ennreal) < top \<Longrightarrow> (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. c * f x) \<longlongrightarrow> c * x) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1542 |
by (rule continuous_on_tendsto_compose[where g=f, OF ennreal_continuous_on_cmult, where s=UNIV]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1543 |
(auto simp: continuous_on_id) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1544 |
|
67727
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1545 |
lemma tendsto_ennrealI[intro, simp, tendsto_intros]: |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1546 |
"(f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. ennreal (f x)) \<longlongrightarrow> ennreal x) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1547 |
by (auto simp: ennreal_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1548 |
intro!: continuous_on_tendsto_compose[OF continuous_on_e2ennreal[of UNIV]] tendsto_max) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1549 |
|
67727
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1550 |
lemma tendsto_enn2erealI [tendsto_intros]: |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1551 |
assumes "(f \<longlongrightarrow> l) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1552 |
shows "((\<lambda>i. enn2ereal(f i)) \<longlongrightarrow> enn2ereal l) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1553 |
using tendsto_enn2ereal_iff assms by auto |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1554 |
|
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1555 |
lemma tendsto_e2ennrealI [tendsto_intros]: |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1556 |
assumes "(f \<longlongrightarrow> l) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1557 |
shows "((\<lambda>i. e2ennreal(f i)) \<longlongrightarrow> e2ennreal l) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1558 |
proof - |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1559 |
have *: "e2ennreal (max x 0) = e2ennreal x" for x |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1560 |
by (simp add: e2ennreal_def max.commute) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1561 |
have "((\<lambda>i. max (f i) 0) \<longlongrightarrow> max l 0) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1562 |
apply (intro tendsto_intros) using assms by auto |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1563 |
then have "((\<lambda>i. enn2ereal(e2ennreal (max (f i) 0))) \<longlongrightarrow> enn2ereal (e2ennreal (max l 0))) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1564 |
by (subst enn2ereal_e2ennreal, auto)+ |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1565 |
then have "((\<lambda>i. e2ennreal (max (f i) 0)) \<longlongrightarrow> e2ennreal (max l 0)) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1566 |
using tendsto_enn2ereal_iff by auto |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1567 |
then show ?thesis |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1568 |
unfolding * by auto |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1569 |
qed |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1570 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1571 |
lemma ennreal_suminf_minus: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1572 |
fixes f g :: "nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1573 |
shows "(\<And>i. g i \<le> f i) \<Longrightarrow> suminf f \<noteq> top \<Longrightarrow> suminf g \<noteq> top \<Longrightarrow> (\<Sum>i. f i - g i) = suminf f - suminf g" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1574 |
by transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1575 |
(auto simp add: max.absorb2 ereal_diff_positive suminf_le_pos top_ereal_def intro!: suminf_ereal_minus) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1576 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1577 |
lemma ennreal_Sup_countable_SUP: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1578 |
"A \<noteq> {} \<Longrightarrow> \<exists>f::nat \<Rightarrow> ennreal. incseq f \<and> range f \<subseteq> A \<and> Sup A = (SUP i. f i)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1579 |
unfolding incseq_def |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1580 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1581 |
subgoal for A |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1582 |
using Sup_countable_SUP[of A] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1583 |
apply (clarsimp simp add: incseq_def[symmetric] SUP_upper2 max.absorb2 image_subset_iff Sup_upper2 cong: conj_cong) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1584 |
subgoal for f |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1585 |
by (intro exI[of _ f]) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1586 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1587 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1588 |
|
63940
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1589 |
lemma ennreal_Inf_countable_INF: |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1590 |
"A \<noteq> {} \<Longrightarrow> \<exists>f::nat \<Rightarrow> ennreal. decseq f \<and> range f \<subseteq> A \<and> Inf A = (INF i. f i)" |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1591 |
including ennreal.lifting |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1592 |
unfolding decseq_def |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1593 |
apply transfer |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1594 |
subgoal for A |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1595 |
using Inf_countable_INF[of A] |
68406 | 1596 |
apply (clarsimp simp flip: decseq_def) |
63940
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1597 |
subgoal for f |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1598 |
by (intro exI[of _ f]) auto |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1599 |
done |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1600 |
done |
0d82c4c94014
prove HK-integrable implies Lebesgue measurable; prove HK-integral equals Lebesgue integral for nonneg functions
hoelzl
parents:
63882
diff
changeset
|
1601 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1602 |
lemma ennreal_SUP_countable_SUP: |
69313 | 1603 |
"A \<noteq> {} \<Longrightarrow> \<exists>f::nat \<Rightarrow> ennreal. range f \<subseteq> g`A \<and> Sup (g ` A) = Sup (f ` UNIV)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1604 |
using ennreal_Sup_countable_SUP [of "g`A"] by auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1605 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1606 |
lemma of_nat_tendsto_top_ennreal: "(\<lambda>n::nat. of_nat n :: ennreal) \<longlonglongrightarrow> top" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1607 |
using LIMSEQ_SUP[of "of_nat :: nat \<Rightarrow> ennreal"] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1608 |
by (simp add: ennreal_SUP_of_nat_eq_top incseq_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1609 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1610 |
lemma SUP_sup_continuous_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1611 |
fixes f :: "ennreal \<Rightarrow> 'a::complete_lattice" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1612 |
assumes f: "sup_continuous f" and "I \<noteq> {}" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1613 |
shows "(SUP i\<in>I. f (g i)) = f (SUP i\<in>I. g i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1614 |
proof (rule antisym) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1615 |
show "(SUP i\<in>I. f (g i)) \<le> f (SUP i\<in>I. g i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1616 |
by (rule mono_SUP[OF sup_continuous_mono[OF f]]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1617 |
from ennreal_Sup_countable_SUP[of "g`I"] \<open>I \<noteq> {}\<close> |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1618 |
obtain M :: "nat \<Rightarrow> ennreal" where "incseq M" and M: "range M \<subseteq> g ` I" and eq: "(SUP i \<in> I. g i) = (SUP i. M i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1619 |
by auto |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1620 |
have "f (SUP i \<in> I. g i) = (SUP i \<in> range M. f i)" |
69861
62e47f06d22c
avoid context-sensitive simp rules whose context-free form (image_comp) is not simp by default
haftmann
parents:
69661
diff
changeset
|
1621 |
unfolding eq sup_continuousD[OF f \<open>mono M\<close>] by (simp add: image_comp) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1622 |
also have "\<dots> \<le> (SUP i \<in> I. f (g i))" |
69861
62e47f06d22c
avoid context-sensitive simp rules whose context-free form (image_comp) is not simp by default
haftmann
parents:
69661
diff
changeset
|
1623 |
by (insert M, drule SUP_subset_mono) (auto simp add: image_comp) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1624 |
finally show "f (SUP i \<in> I. g i) \<le> (SUP i \<in> I. f (g i))" . |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1625 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1626 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1627 |
lemma ennreal_suminf_SUP_eq: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1628 |
fixes f :: "nat \<Rightarrow> nat \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1629 |
shows "(\<And>i. incseq (\<lambda>n. f n i)) \<Longrightarrow> (\<Sum>i. SUP n. f n i) = (SUP n. \<Sum>i. f n i)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1630 |
apply (rule ennreal_suminf_SUP_eq_directed) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1631 |
subgoal for N n j |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1632 |
by (auto simp: incseq_def intro!:exI[of _ "max n j"]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1633 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1634 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1635 |
lemma ennreal_SUP_add_left: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1636 |
fixes c :: ennreal |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1637 |
shows "I \<noteq> {} \<Longrightarrow> (SUP i\<in>I. f i + c) = (SUP i\<in>I. f i) + c" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1638 |
apply transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1639 |
apply (simp add: SUP_ereal_add_left) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1640 |
apply (subst (1 2) max.absorb2) |
68752 | 1641 |
apply (auto intro: SUP_upper2 add_nonneg_nonneg) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1642 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1643 |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1644 |
lemma ennreal_SUP_const_minus: (* TODO: rename: ennreal_SUP_const_minus *) |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1645 |
fixes f :: "'a \<Rightarrow> ennreal" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1646 |
shows "I \<noteq> {} \<Longrightarrow> c < top \<Longrightarrow> (INF x\<in>I. c - f x) = c - (SUP x\<in>I. f x)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1647 |
apply (transfer fixing: I) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1648 |
unfolding ex_in_conv[symmetric] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1649 |
apply (auto simp add: sup_max[symmetric] SUP_upper2 sup_absorb2 |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1650 |
simp del: sup_ereal_def) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1651 |
apply (subst INF_ereal_minus_right[symmetric]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1652 |
apply (auto simp del: sup_ereal_def simp add: sup_INF) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1653 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1654 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1655 |
subsection \<open>Approximation lemmas\<close> |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1656 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1657 |
lemma INF_approx_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1658 |
fixes x::ennreal and e::real |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1659 |
assumes "e > 0" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1660 |
assumes INF: "x = (INF i \<in> A. f i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1661 |
assumes "x \<noteq> \<infinity>" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1662 |
shows "\<exists>i \<in> A. f i < x + e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1663 |
proof - |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1664 |
have "(INF i \<in> A. f i) < x + e" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1665 |
unfolding INF[symmetric] using \<open>0<e\<close> \<open>x \<noteq> \<infinity>\<close> by (cases x) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1666 |
then show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1667 |
unfolding INF_less_iff . |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1668 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1669 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1670 |
lemma SUP_approx_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1671 |
fixes x::ennreal and e::real |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1672 |
assumes "e > 0" "A \<noteq> {}" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1673 |
assumes SUP: "x = (SUP i \<in> A. f i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1674 |
assumes "x \<noteq> \<infinity>" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1675 |
shows "\<exists>i \<in> A. x < f i + e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1676 |
proof - |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1677 |
have "x < x + e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1678 |
using \<open>0<e\<close> \<open>x \<noteq> \<infinity>\<close> by (cases x) auto |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1679 |
also have "x + e = (SUP i \<in> A. f i + e)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1680 |
unfolding SUP ennreal_SUP_add_left[OF \<open>A \<noteq> {}\<close>] .. |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1681 |
finally show ?thesis |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1682 |
unfolding less_SUP_iff . |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1683 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1684 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1685 |
lemma ennreal_approx_SUP: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1686 |
fixes x::ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1687 |
assumes f_bound: "\<And>i. i \<in> A \<Longrightarrow> f i \<le> x" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1688 |
assumes approx: "\<And>e. (e::real) > 0 \<Longrightarrow> \<exists>i \<in> A. x \<le> f i + e" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1689 |
shows "x = (SUP i \<in> A. f i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1690 |
proof (rule antisym) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1691 |
show "x \<le> (SUP i\<in>A. f i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1692 |
proof (rule ennreal_le_epsilon) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1693 |
fix e :: real assume "0 < e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1694 |
from approx[OF this] guess i .. |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1695 |
then have "x \<le> f i + e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1696 |
by simp |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1697 |
also have "\<dots> \<le> (SUP i\<in>A. f i) + e" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1698 |
by (intro add_mono \<open>i \<in> A\<close> SUP_upper order_refl) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1699 |
finally show "x \<le> (SUP i\<in>A. f i) + e" . |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1700 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1701 |
qed (intro SUP_least f_bound) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1702 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1703 |
lemma ennreal_approx_INF: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1704 |
fixes x::ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1705 |
assumes f_bound: "\<And>i. i \<in> A \<Longrightarrow> x \<le> f i" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1706 |
assumes approx: "\<And>e. (e::real) > 0 \<Longrightarrow> \<exists>i \<in> A. f i \<le> x + e" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1707 |
shows "x = (INF i \<in> A. f i)" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1708 |
proof (rule antisym) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1709 |
show "(INF i\<in>A. f i) \<le> x" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1710 |
proof (rule ennreal_le_epsilon) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1711 |
fix e :: real assume "0 < e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1712 |
from approx[OF this] guess i .. note i = this |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1713 |
then have "(INF i\<in>A. f i) \<le> f i" |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1714 |
by (intro INF_lower) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1715 |
also have "\<dots> \<le> x + e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1716 |
by fact |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1717 |
finally show "(INF i\<in>A. f i) \<le> x + e" . |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1718 |
qed |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1719 |
qed (intro INF_greatest f_bound) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1720 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1721 |
lemma ennreal_approx_unit: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1722 |
"(\<And>a::ennreal. 0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a * z \<le> y) \<Longrightarrow> z \<le> y" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1723 |
apply (subst SUP_mult_right_ennreal[of "\<lambda>x. x" "{0 <..< 1}" z, simplified]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1724 |
apply (rule SUP_least) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1725 |
apply auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1726 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1727 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1728 |
lemma suminf_ennreal2: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1729 |
"(\<And>i. 0 \<le> f i) \<Longrightarrow> summable f \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal (\<Sum>i. f i)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1730 |
using suminf_ennreal_eq by blast |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1731 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1732 |
lemma less_top_ennreal: "x < top \<longleftrightarrow> (\<exists>r\<ge>0. x = ennreal r)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1733 |
by (cases x) auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1734 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1735 |
lemma tendsto_top_iff_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1736 |
fixes f :: "'a \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1737 |
shows "(f \<longlongrightarrow> top) F \<longleftrightarrow> (\<forall>l\<ge>0. eventually (\<lambda>x. ennreal l < f x) F)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1738 |
by (auto simp: less_top_ennreal order_tendsto_iff ) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1739 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1740 |
lemma ennreal_tendsto_top_eq_at_top: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1741 |
"((\<lambda>z. ennreal (f z)) \<longlongrightarrow> top) F \<longleftrightarrow> (LIM z F. f z :> at_top)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1742 |
unfolding filterlim_at_top_dense tendsto_top_iff_ennreal |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1743 |
apply (auto simp: ennreal_less_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1744 |
subgoal for y |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1745 |
by (auto elim!: eventually_mono allE[of _ "max 0 y"]) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1746 |
done |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1747 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1748 |
lemma tendsto_0_if_Limsup_eq_0_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1749 |
fixes f :: "_ \<Rightarrow> ennreal" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1750 |
shows "Limsup F f = 0 \<Longrightarrow> (f \<longlongrightarrow> 0) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1751 |
using Liminf_le_Limsup[of F f] tendsto_iff_Liminf_eq_Limsup[of F f 0] |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1752 |
by (cases "F = bot") auto |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1753 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1754 |
lemma diff_le_self_ennreal[simp]: "a - b \<le> (a::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1755 |
by (cases a b rule: ennreal2_cases) (auto simp: ennreal_minus) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1756 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1757 |
lemma ennreal_ineq_diff_add: "b \<le> a \<Longrightarrow> a = b + (a - b::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1758 |
by transfer (auto simp: ereal_diff_positive max.absorb2 ereal_ineq_diff_add) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1759 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1760 |
lemma ennreal_mult_strict_left_mono: "(a::ennreal) < c \<Longrightarrow> 0 < b \<Longrightarrow> b < top \<Longrightarrow> b * a < b * c" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1761 |
by transfer (auto intro!: ereal_mult_strict_left_mono) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1762 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1763 |
lemma ennreal_between: "0 < e \<Longrightarrow> 0 < x \<Longrightarrow> x < top \<Longrightarrow> x - e < (x::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1764 |
by transfer (auto intro!: ereal_between) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1765 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1766 |
lemma minus_less_iff_ennreal: "b < top \<Longrightarrow> b \<le> a \<Longrightarrow> a - b < c \<longleftrightarrow> a < c + (b::ennreal)" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1767 |
by transfer |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1768 |
(auto simp: top_ereal_def ereal_minus_less le_less) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1769 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1770 |
lemma tendsto_zero_ennreal: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1771 |
assumes ev: "\<And>r. 0 < r \<Longrightarrow> \<forall>\<^sub>F x in F. f x < ennreal r" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1772 |
shows "(f \<longlongrightarrow> 0) F" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1773 |
proof (rule order_tendstoI) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1774 |
fix e::ennreal assume "e > 0" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1775 |
obtain e'::real where "e' > 0" "ennreal e' < e" |
63145 | 1776 |
using \<open>0 < e\<close> dense[of 0 "if e = top then 1 else (enn2real e)"] |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1777 |
by (cases e) (auto simp: ennreal_less_iff) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1778 |
from ev[OF \<open>e' > 0\<close>] show "\<forall>\<^sub>F x in F. f x < e" |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1779 |
by eventually_elim (insert \<open>ennreal e' < e\<close>, auto) |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1780 |
qed simp |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1781 |
|
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1782 |
lifting_update ennreal.lifting |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1783 |
lifting_forget ennreal.lifting |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
1784 |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1785 |
|
69593 | 1786 |
subsection \<open>\<^typ>\<open>ennreal\<close> theorems\<close> |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1787 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1788 |
lemma neq_top_trans: fixes x y :: ennreal shows "\<lbrakk> y \<noteq> top; x \<le> y \<rbrakk> \<Longrightarrow> x \<noteq> top" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1789 |
by (auto simp: top_unique) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1790 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1791 |
lemma diff_diff_ennreal: fixes a b :: ennreal shows "a \<le> b \<Longrightarrow> b \<noteq> \<infinity> \<Longrightarrow> b - (b - a) = a" |
68406 | 1792 |
by (cases a b rule: ennreal2_cases) (auto simp: ennreal_minus top_unique) |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1793 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1794 |
lemma ennreal_less_one_iff[simp]: "ennreal x < 1 \<longleftrightarrow> x < 1" |
68406 | 1795 |
by (cases "0 \<le> x") (auto simp: ennreal_neg ennreal_less_iff simp flip: ennreal_1) |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1796 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1797 |
lemma SUP_const_minus_ennreal: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1798 |
fixes f :: "'a \<Rightarrow> ennreal" shows "I \<noteq> {} \<Longrightarrow> (SUP x\<in>I. c - f x) = c - (INF x\<in>I. f x)" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1799 |
including ennreal.lifting |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1800 |
by (transfer fixing: I) |
68406 | 1801 |
(simp add: SUP_sup_distrib[symmetric] SUP_ereal_minus_right |
1802 |
flip: sup_ereal_def) |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1803 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1804 |
lemma zero_minus_ennreal[simp]: "0 - (a::ennreal) = 0" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1805 |
including ennreal.lifting |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1806 |
by transfer (simp split: split_max) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1807 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1808 |
lemma diff_diff_commute_ennreal: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1809 |
fixes a b c :: ennreal shows "a - b - c = a - c - b" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1810 |
by (cases a b c rule: ennreal3_cases) (simp_all add: ennreal_minus field_simps) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1811 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1812 |
lemma diff_gr0_ennreal: "b < (a::ennreal) \<Longrightarrow> 0 < a - b" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1813 |
including ennreal.lifting by transfer (auto simp: ereal_diff_gr0 ereal_diff_positive split: split_max) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1814 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1815 |
lemma divide_le_posI_ennreal: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1816 |
fixes x y z :: ennreal |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1817 |
shows "x > 0 \<Longrightarrow> z \<le> x * y \<Longrightarrow> z / x \<le> y" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1818 |
by (cases x y z rule: ennreal3_cases) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1819 |
(auto simp: divide_ennreal ennreal_mult[symmetric] field_simps top_unique) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1820 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1821 |
lemma add_diff_eq_ennreal: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1822 |
fixes x y z :: ennreal |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1823 |
shows "z \<le> y \<Longrightarrow> x + (y - z) = x + y - z" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1824 |
including ennreal.lifting |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1825 |
by transfer |
68752 | 1826 |
(insert add_mono[of "0::ereal"], auto simp add: ereal_diff_positive max.absorb2 add_diff_eq_ereal) |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1827 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1828 |
lemma add_diff_inverse_ennreal: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1829 |
fixes x y :: ennreal shows "x \<le> y \<Longrightarrow> x + (y - x) = y" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1830 |
by (cases x) (simp_all add: top_unique add_diff_eq_ennreal) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1831 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1832 |
lemma add_diff_eq_iff_ennreal[simp]: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1833 |
fixes x y :: ennreal shows "x + (y - x) = y \<longleftrightarrow> x \<le> y" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1834 |
proof |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1835 |
assume *: "x + (y - x) = y" show "x \<le> y" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1836 |
by (subst *[symmetric]) simp |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1837 |
qed (simp add: add_diff_inverse_ennreal) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1838 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1839 |
lemma add_diff_le_ennreal: "a + b - c \<le> a + (b - c::ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1840 |
apply (cases a b c rule: ennreal3_cases) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1841 |
subgoal for a' b' c' |
68406 | 1842 |
by (cases "0 \<le> b' - c'") (simp_all add: ennreal_minus top_add ennreal_neg flip: ennreal_plus) |
1843 |
apply (simp_all add: top_add flip: ennreal_plus) |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1844 |
done |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1845 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1846 |
lemma diff_eq_0_ennreal: "a < top \<Longrightarrow> a \<le> b \<Longrightarrow> a - b = (0::ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1847 |
using ennreal_minus_pos_iff gr_zeroI not_less by blast |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1848 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1849 |
lemma diff_diff_ennreal': fixes x y z :: ennreal shows "z \<le> y \<Longrightarrow> y - z \<le> x \<Longrightarrow> x - (y - z) = x + z - y" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1850 |
by (cases x; cases y; cases z) |
68406 | 1851 |
(auto simp add: top_add add_top minus_top_ennreal ennreal_minus top_unique |
1852 |
simp flip: ennreal_plus) |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1853 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1854 |
lemma diff_diff_ennreal'': fixes x y z :: ennreal |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1855 |
shows "z \<le> y \<Longrightarrow> x - (y - z) = (if y - z \<le> x then x + z - y else 0)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1856 |
by (cases x; cases y; cases z) |
68406 | 1857 |
(auto simp add: top_add add_top minus_top_ennreal ennreal_minus top_unique ennreal_neg |
1858 |
simp flip: ennreal_plus) |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1859 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1860 |
lemma power_less_top_ennreal: fixes x :: ennreal shows "x ^ n < top \<longleftrightarrow> x < top \<or> n = 0" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1861 |
using power_eq_top_ennreal[of x n] by (auto simp: less_top) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1862 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1863 |
lemma ennreal_divide_times: "(a / b) * c = a * (c / b :: ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1864 |
by (simp add: mult.commute ennreal_times_divide) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1865 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1866 |
lemma diff_less_top_ennreal: "a - b < top \<longleftrightarrow> a < (top :: ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1867 |
by (cases a; cases b) (auto simp: ennreal_minus) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1868 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1869 |
lemma divide_less_ennreal: "b \<noteq> 0 \<Longrightarrow> b < top \<Longrightarrow> a / b < c \<longleftrightarrow> a < (c * b :: ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1870 |
by (cases a; cases b; cases c) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1871 |
(auto simp: divide_ennreal ennreal_mult[symmetric] ennreal_less_iff field_simps ennreal_top_mult ennreal_top_divide) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1872 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1873 |
lemma one_less_numeral[simp]: "1 < (numeral n::ennreal) \<longleftrightarrow> (num.One < n)" |
68406 | 1874 |
by (simp flip: ennreal_1 ennreal_numeral add: ennreal_less_iff) |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1875 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1876 |
lemma divide_eq_1_ennreal: "a / b = (1::ennreal) \<longleftrightarrow> (b \<noteq> top \<and> b \<noteq> 0 \<and> b = a)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1877 |
by (cases a ; cases b; cases "b = 0") (auto simp: ennreal_top_divide divide_ennreal split: if_split_asm) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1878 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1879 |
lemma ennreal_mult_cancel_left: "(a * b = a * c) = (a = top \<and> b \<noteq> 0 \<and> c \<noteq> 0 \<or> a = 0 \<or> b = (c::ennreal))" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1880 |
by (cases a; cases b; cases c) (auto simp: ennreal_mult[symmetric] ennreal_mult_top ennreal_top_mult) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1881 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1882 |
lemma ennreal_minus_if: "ennreal a - ennreal b = ennreal (if 0 \<le> b then (if b \<le> a then a - b else 0) else a)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1883 |
by (auto simp: ennreal_minus ennreal_neg) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1884 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1885 |
lemma ennreal_plus_if: "ennreal a + ennreal b = ennreal (if 0 \<le> a then (if 0 \<le> b then a + b else a) else b)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1886 |
by (auto simp: ennreal_neg) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1887 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1888 |
lemma power_le_one_iff: "0 \<le> (a::real) \<Longrightarrow> a ^ n \<le> 1 \<longleftrightarrow> (n = 0 \<or> a \<le> 1)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1889 |
by (metis (mono_tags, hide_lams) le_less neq0_conv not_le one_le_power power_0 power_eq_imp_eq_base power_le_one zero_le_one) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1890 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1891 |
lemma ennreal_diff_le_mono_left: "a \<le> b \<Longrightarrow> a - c \<le> (b::ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1892 |
using ennreal_mono_minus[of 0 c a, THEN order_trans, of b] by simp |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1893 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1894 |
lemma ennreal_minus_le_iff: "a - b \<le> c \<longleftrightarrow> (a \<le> b + (c::ennreal) \<and> (a = top \<and> b = top \<longrightarrow> c = top))" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1895 |
by (cases a; cases b; cases c) |
68406 | 1896 |
(auto simp: top_unique top_add add_top ennreal_minus simp flip: ennreal_plus) |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1897 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1898 |
lemma ennreal_le_minus_iff: "a \<le> b - c \<longleftrightarrow> (a + c \<le> (b::ennreal) \<or> (a = 0 \<and> b \<le> c))" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1899 |
by (cases a; cases b; cases c) |
68406 | 1900 |
(auto simp: top_unique top_add add_top ennreal_minus ennreal_le_iff2 |
1901 |
simp flip: ennreal_plus) |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1902 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1903 |
lemma diff_add_eq_diff_diff_swap_ennreal: "x - (y + z :: ennreal) = x - y - z" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1904 |
by (cases x; cases y; cases z) |
68406 | 1905 |
(auto simp: ennreal_minus_if add_top top_add simp flip: ennreal_plus) |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1906 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1907 |
lemma diff_add_assoc2_ennreal: "b \<le> a \<Longrightarrow> (a - b + c::ennreal) = a + c - b" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1908 |
by (cases a; cases b; cases c) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1909 |
(auto simp add: ennreal_minus_if ennreal_plus_if add_top top_add top_unique simp del: ennreal_plus) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1910 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1911 |
lemma diff_gt_0_iff_gt_ennreal: "0 < a - b \<longleftrightarrow> (a = top \<and> b = top \<or> b < (a::ennreal))" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1912 |
by (cases a; cases b) (auto simp: ennreal_minus_if ennreal_less_iff) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1913 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1914 |
lemma diff_eq_0_iff_ennreal: "(a - b::ennreal) = 0 \<longleftrightarrow> (a < top \<and> a \<le> b)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1915 |
by (cases a) (auto simp: ennreal_minus_eq_0 diff_eq_0_ennreal) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1916 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1917 |
lemma add_diff_self_ennreal: "a + (b - a::ennreal) = (if a \<le> b then b else a)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1918 |
by (auto simp: diff_eq_0_iff_ennreal less_top) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1919 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1920 |
lemma diff_add_self_ennreal: "(b - a + a::ennreal) = (if a \<le> b then b else a)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1921 |
by (auto simp: diff_add_cancel_ennreal diff_eq_0_iff_ennreal less_top) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1922 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1923 |
lemma ennreal_minus_cancel_iff: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1924 |
fixes a b c :: ennreal |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1925 |
shows "a - b = a - c \<longleftrightarrow> (b = c \<or> (a \<le> b \<and> a \<le> c) \<or> a = top)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1926 |
by (cases a; cases b; cases c) (auto simp: ennreal_minus_if) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1927 |
|
67727
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1928 |
text \<open>The next lemma is wrong for $a = top$, for $b = c = 1$ for instance.\<close> |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1929 |
|
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1930 |
lemma ennreal_right_diff_distrib: |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1931 |
fixes a b c::ennreal |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1932 |
assumes "a \<noteq> top" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1933 |
shows "a * (b - c) = a * b - a * c" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1934 |
apply (cases a, cases b, cases c, auto simp add: assms) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1935 |
apply (metis (mono_tags, lifting) ennreal_minus ennreal_mult' linordered_field_class.sign_simps(38) split_mult_pos_le) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1936 |
apply (metis ennreal_minus_zero ennreal_mult_cancel_left ennreal_top_eq_mult_iff minus_top_ennreal mult_eq_0_iff top_neq_ennreal) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1937 |
apply (metis ennreal_minus_eq_top ennreal_minus_zero ennreal_mult_eq_top_iff mult_eq_0_iff) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1938 |
done |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1939 |
|
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1940 |
lemma SUP_diff_ennreal: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1941 |
"c < top \<Longrightarrow> (SUP i\<in>I. f i - c :: ennreal) = (SUP i\<in>I. f i) - c" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1942 |
by (auto intro!: SUP_eqI ennreal_minus_mono SUP_least intro: SUP_upper |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1943 |
simp: ennreal_minus_cancel_iff ennreal_minus_le_iff less_top[symmetric]) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1944 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1945 |
lemma ennreal_SUP_add_right: |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1946 |
fixes c :: ennreal shows "I \<noteq> {} \<Longrightarrow> c + (SUP i\<in>I. f i) = (SUP i\<in>I. c + f i)" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1947 |
using ennreal_SUP_add_left[of I f c] by (simp add: add.commute) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1948 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1949 |
lemma SUP_add_directed_ennreal: |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1950 |
fixes f g :: "_ \<Rightarrow> ennreal" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1951 |
assumes directed: "\<And>i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> \<exists>k\<in>I. f i + g j \<le> f k + g k" |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1952 |
shows "(SUP i\<in>I. f i + g i) = (SUP i\<in>I. f i) + (SUP i\<in>I. g i)" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1953 |
proof cases |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1954 |
assume "I = {}" then show ?thesis |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1955 |
by (simp add: bot_ereal_def) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1956 |
next |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1957 |
assume "I \<noteq> {}" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1958 |
show ?thesis |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1959 |
proof (rule antisym) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1960 |
show "(SUP i\<in>I. f i + g i) \<le> (SUP i\<in>I. f i) + (SUP i\<in>I. g i)" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1961 |
by (rule SUP_least; intro add_mono SUP_upper) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1962 |
next |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1963 |
have "(SUP i\<in>I. f i) + (SUP i\<in>I. g i) = (SUP i\<in>I. f i + (SUP i\<in>I. g i))" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1964 |
by (intro ennreal_SUP_add_left[symmetric] \<open>I \<noteq> {}\<close>) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1965 |
also have "\<dots> = (SUP i\<in>I. (SUP j\<in>I. f i + g j))" |
69661 | 1966 |
using \<open>I \<noteq> {}\<close> by (simp add: ennreal_SUP_add_right) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1967 |
also have "\<dots> \<le> (SUP i\<in>I. f i + g i)" |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1968 |
using directed by (intro SUP_least) (blast intro: SUP_upper2) |
69260
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
haftmann
parents:
69064
diff
changeset
|
1969 |
finally show "(SUP i\<in>I. f i) + (SUP i\<in>I. g i) \<le> (SUP i\<in>I. f i + g i)" . |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1970 |
qed |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1971 |
qed |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1972 |
|
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1973 |
lemma enn2real_eq_0_iff: "enn2real x = 0 \<longleftrightarrow> x = 0 \<or> x = top" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1974 |
by (cases x) auto |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1975 |
|
67727
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1976 |
lemma continuous_on_diff_ennreal: |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1977 |
"continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<noteq> top) \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> g x \<noteq> top) \<Longrightarrow> continuous_on A (\<lambda>z. f z - g z::ennreal)" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1978 |
including ennreal.lifting |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1979 |
proof (transfer fixing: A, simp add: top_ereal_def) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1980 |
fix f g :: "'a \<Rightarrow> ereal" assume "\<forall>x. 0 \<le> f x" "\<forall>x. 0 \<le> g x" "continuous_on A f" "continuous_on A g" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1981 |
moreover assume "f x \<noteq> \<infinity>" "g x \<noteq> \<infinity>" if "x \<in> A" for x |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1982 |
ultimately show "continuous_on A (\<lambda>z. max 0 (f z - g z))" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1983 |
by (intro continuous_on_max continuous_on_const continuous_on_diff_ereal) auto |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1984 |
qed |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1985 |
|
67727
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1986 |
lemma tendsto_diff_ennreal: |
63225
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1987 |
"(f \<longlongrightarrow> x) F \<Longrightarrow> (g \<longlongrightarrow> y) F \<Longrightarrow> x \<noteq> top \<Longrightarrow> y \<noteq> top \<Longrightarrow> ((\<lambda>z. f z - g z::ennreal) \<longlongrightarrow> x - y) F" |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1988 |
using continuous_on_tendsto_compose[where f="\<lambda>x. fst x - snd x::ennreal" and s="{(x, y). x \<noteq> top \<and> y \<noteq> top}" and g="\<lambda>x. (f x, g x)" and l="(x, y)" and F="F", |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1989 |
OF continuous_on_diff_ennreal] |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1990 |
by (auto simp: tendsto_Pair eventually_conj_iff less_top order_tendstoD continuous_on_fst continuous_on_snd continuous_on_id) |
19d2be0e5e9f
move ennreal and ereal theorems from MFMC_Countable
hoelzl
parents:
63145
diff
changeset
|
1991 |
|
67727
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1992 |
declare lim_real_of_ereal [tendsto_intros] |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1993 |
|
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1994 |
lemma tendsto_enn2real [tendsto_intros]: |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1995 |
assumes "(u \<longlongrightarrow> ennreal l) F" "l \<ge> 0" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1996 |
shows "((\<lambda>n. enn2real (u n)) \<longlongrightarrow> l) F" |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1997 |
unfolding enn2real_def |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1998 |
apply (intro tendsto_intros) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
1999 |
apply (subst enn2ereal_ennreal[symmetric]) |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
2000 |
by (intro tendsto_intros assms)+ |
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
immler
parents:
67719
diff
changeset
|
2001 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62648
diff
changeset
|
2002 |
end |