# HG changeset patch # User nipkow # Date 1547478656 -3600 # Node ID 2b56cbb02e8ab2e1417f1bf99aafe6bc1473b8f1 # Parent bc758f4f09e56f01a3f4b8909144168a0ce14842 root_val -> value diff -r bc758f4f09e5 -r 2b56cbb02e8a src/HOL/Data_Structures/Array_Braun.thy --- a/src/HOL/Data_Structures/Array_Braun.thy Mon Jan 14 14:46:12 2019 +0100 +++ b/src/HOL/Data_Structures/Array_Braun.thy Mon Jan 14 16:10:56 2019 +0100 @@ -501,7 +501,7 @@ function list_fast_rec :: "'a tree list \ 'a list" where "list_fast_rec ts = (if ts = [] then [] else let us = filter (\t. t \ Leaf) ts - in map root_val us @ list_fast_rec (map left us @ map right us))" + in map value us @ list_fast_rec (map left us @ map right us))" by (pat_completeness, auto) lemma list_fast_rec_term: "\ ts \ []; us = filter (\t. t \ \\) ts \ \ @@ -576,13 +576,13 @@ case False with less.prems(2) have *: "\i < 2 ^ k. ts ! i \ Leaf - \ root_val (ts ! i) = xs ! i + \ value (ts ! i) = xs ! i \ braun_list (left (ts ! i)) (take_nths (i + 2 ^ k) (Suc k) xs) \ (\ys. ys = take_nths (i + 2 * 2 ^ k) (Suc k) xs \ braun_list (right (ts ! i)) ys)" by (auto simp: take_nths_empty hd_take_nths braun_list_not_Nil take_nths_take_nths algebra_simps) - have 1: "map root_val ts = take (2 ^ k) xs" + have 1: "map value ts = take (2 ^ k) xs" using less.prems(1) False by (simp add: list_eq_iff_nth_eq *) have 2: "list_fast_rec (map left ts @ map right ts) = drop (2 ^ k) xs" using less.prems(1) False diff -r bc758f4f09e5 -r 2b56cbb02e8a src/HOL/Library/Tree.thy --- a/src/HOL/Library/Tree.thy Mon Jan 14 14:46:12 2019 +0100 +++ b/src/HOL/Library/Tree.thy Mon Jan 14 16:10:56 2019 +0100 @@ -9,7 +9,7 @@ datatype 'a tree = Leaf ("\\") | - Node "'a tree" (root_val: 'a) "'a tree" ("(1\_,/ _,/ _\)") + Node "'a tree" ("value": 'a) "'a tree" ("(1\_,/ _,/ _\)") datatype_compat tree primrec left :: "'a tree \ 'a tree" where diff -r bc758f4f09e5 -r 2b56cbb02e8a src/HOL/Probability/Tree_Space.thy --- a/src/HOL/Probability/Tree_Space.thy Mon Jan 14 14:46:12 2019 +0100 +++ b/src/HOL/Probability/Tree_Space.thy Mon Jan 14 16:10:56 2019 +0100 @@ -231,18 +231,18 @@ unfolding * using A by (intro sets.Un Node_in_tree_sigma pair_measureI) auto qed -lemma measurable_root_val': "root_val \ restrict_space (tree_sigma M) (-{Leaf}) \\<^sub>M M" +lemma measurable_value': "value \ restrict_space (tree_sigma M) (-{Leaf}) \\<^sub>M M" proof (rule measurableI) - show "t \ space (restrict_space (tree_sigma M) (- {Leaf})) \ root_val t \ space M" for t + show "t \ space (restrict_space (tree_sigma M) (- {Leaf})) \ value t \ space M" for t by (cases t) (auto simp: space_restrict_space space_tree_sigma) fix A assume A: "A \ sets M" from sets.sets_into_space[OF this] - have "root_val -` A \ space (restrict_space (tree_sigma M) (- {Leaf})) = + have "value -` A \ space (restrict_space (tree_sigma M) (- {Leaf})) = {Node l a r | l a r. (a, l, r) \ A \ space (tree_sigma M) \ space (tree_sigma M)}" by (auto simp: space_tree_sigma space_restrict_space elim: trees.cases) also have "\ \ sets (tree_sigma M)" using A by (intro sets.Un Node_in_tree_sigma pair_measureI) auto - finally show "root_val -` A \ space (restrict_space (tree_sigma M) (- {Leaf})) \ + finally show "value -` A \ space (restrict_space (tree_sigma M) (- {Leaf})) \ sets (restrict_space (tree_sigma M) (- {Leaf}))" by (auto simp: sets_restrict_space_iff space_restrict_space) qed @@ -254,14 +254,14 @@ (insert \B \ A\, auto) -lemma measurable_root_val[measurable (raw)]: +lemma measurable_value[measurable (raw)]: assumes "f \ X \\<^sub>M tree_sigma M" and "\x. x \ space X \ f x \ Leaf" - shows "(\\. root_val (f \)) \ X \\<^sub>M M" + shows "(\\. value (f \)) \ X \\<^sub>M M" proof - from assms have "f \ X \\<^sub>M restrict_space (tree_sigma M) (- {Leaf})" by (intro measurable_restrict_space2) auto - from this and measurable_root_val' show ?thesis by (rule measurable_compose) + from this and measurable_value' show ?thesis by (rule measurable_compose) qed @@ -344,7 +344,7 @@ qed next case (Node ls u rs) - let ?F = "\\. ?N (\, left (t \), root_val (t \), right (t \), + let ?F = "\\. ?N (\, left (t \), value (t \), right (t \), rec_tree (l \) (n \) (left (t \)), rec_tree (l \) (n \) (right (t \)))" show ?case proof (rule measurable_cong[THEN iffD2]) @@ -366,7 +366,7 @@ by (rule measurable_restrict_space1) (rule measurable_compose[OF Node(3) measurable_right]) subgoal - apply (rule measurable_compose[OF _ measurable_root_val']) + apply (rule measurable_compose[OF _ measurable_value']) apply (rule measurable_restrict_space3[OF Node(3)]) by auto subgoal