# HG changeset patch # User hoelzl # Date 1349863949 -7200 # Node ID dd719cdeca8f03065e71806f9fbf6bcd8e848182 # Parent 43f49922811d3068403af7cc8c8212a23a50966b simplified definitions diff -r 43f49922811d -r dd719cdeca8f src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy --- a/src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy Wed Oct 10 12:12:29 2012 +0200 +++ b/src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy Wed Oct 10 12:12:29 2012 +0200 @@ -145,7 +145,7 @@ "msgs = keys \ {ms. set ms \ messages \ length ms = n}" definition P :: "('key \ 'message list) \ real" where - "P = (\(k, ms). K k * (\i(k, ms). K k * (\i(k, ms). map (observe k) ms)" definition t :: "'observation list \ 'observation \ nat" where - "t seq obs = length (filter (op = obs) seq)" + t_def2: "t seq obs = card { i. i < length seq \ seq ! i = obs}" + +lemma t_def: "t seq obs = length (filter (op = obs) seq)" + unfolding t_def2 length_filter_conv_card by (subst eq_commute) simp lemma card_T_bound: "card ((t\OB)`msgs) \ (n+1)^card observations" proof - @@ -324,7 +327,7 @@ -(\y\Y`msgs. (\

(Y) {y}) * (\x\X`msgs. (\

(X ; Y) {(x,y)}) / (\

(Y) {y}) * log b ((\

(X ; Y) {(x,y)}) / (\

(Y) {y}))))" . qed -lemma ce_OB_eq_ce_t: "\(fst | OB) = \(fst | t\OB)" +lemma ce_OB_eq_ce_t: "\(fst ; OB) = \(fst ; t\OB)" proof - txt {* Lemma 2 *} @@ -433,7 +436,6 @@ note P_t_sum_P_O = this txt {* Lemma 3 *} - txt {* Lemma 3 *} have "\(fst | OB) = -(\obs\OB`msgs. \

(OB) {obs} * ?Ht (t obs))" unfolding conditional_entropy_eq_ce_with_hypothesis using * by simp also have "\ = -(\obs\t`OB`msgs. \

(t\OB) {obs} * ?Ht obs)" @@ -451,16 +453,15 @@ also have "\ = \(fst | t\OB)" unfolding conditional_entropy_eq_ce_with_hypothesis by (simp add: comp_def image_image[symmetric]) - finally show ?thesis . + finally show ?thesis + by (subst (1 2) mutual_information_eq_entropy_conditional_entropy) simp_all qed theorem "\(fst ; OB) \ real (card observations) * log b (real n + 1)" proof - - from simple_function_finite simple_function_finite - have "\(fst ; OB) = \(fst) - \(fst | OB)" - by (rule mutual_information_eq_entropy_conditional_entropy) - also have "\ = \(fst) - \(fst | t\OB)" - unfolding ce_OB_eq_ce_t .. + have "\(fst ; OB) = \(fst) - \(fst | t\OB)" + unfolding ce_OB_eq_ce_t + by (rule mutual_information_eq_entropy_conditional_entropy simple_function_finite)+ also have "\ = \(t\OB) - \(t\OB | fst)" unfolding entropy_chain_rule[symmetric, OF simple_function_finite simple_function_finite] sign_simps by (subst entropy_commute) simp