src/HOL/Probability/Tree_Space.thy
changeset 66049 d20d5a3bf6cf
parent 66026 704e4970d703
child 66050 3804a9640088
equal deleted inserted replaced
66048:d244a895da50 66049:d20d5a3bf6cf
     1 (*  Title:      HOL/Probability/Tree_Space.thy
     1 (*  Title:      HOL/Probability/Tree_Space.thy
     2     Author:     Johannes Hölzl, CMU *)
     2     Author:     Johannes Hölzl, CMU *)
     3 
     3 
     4 theory Tree_Space
     4 theory Tree_Space
     5   imports Analysis
     5   imports Analysis "~~/src/HOL/Library/Tree"
     6 begin
     6 begin
     7 
     7 
     8 lemma countable_lfp:
     8 lemma countable_lfp:
     9   assumes step: "\<And>Y. countable Y \<Longrightarrow> countable (F Y)"
     9   assumes step: "\<And>Y. countable Y \<Longrightarrow> countable (F Y)"
    10   and cont: "Order_Continuity.sup_continuous F"
    10   and cont: "Order_Continuity.sup_continuous F"
    20     have "\<And>x. countable ((F ^^ n) bot x)"
    20     have "\<And>x. countable ((F ^^ n) bot x)"
    21       by(induct n)(auto intro: step) }
    21       by(induct n)(auto intro: step) }
    22   thus ?thesis using cont by(simp add: sup_continuous_lfp)
    22   thus ?thesis using cont by(simp add: sup_continuous_lfp)
    23 qed
    23 qed
    24 
    24 
    25 datatype 'a tree = Leaf
    25 primrec left :: "'a tree \<Rightarrow> 'a tree"
    26   | Node (left: "'a tree") (val: 'a) (right: "'a tree")
    26 where
    27   where
    27   "left (Node l v r) = l"
    28     "left Leaf = Leaf"
    28 | "left Leaf = Leaf"
    29   | "right Leaf = Leaf"
    29 
    30   | "val Leaf = undefined"
    30 primrec right :: "'a tree \<Rightarrow> 'a tree"
       
    31 where
       
    32   "right (Node l v r) = r"
       
    33 | "right Leaf = Leaf"
       
    34 
       
    35 primrec val :: "'a tree \<Rightarrow> 'a"
       
    36 where
       
    37   "val (Node l v r) = v"
       
    38 | "val Leaf = undefined"
    31 
    39 
    32 inductive_set trees :: "'a set \<Rightarrow> 'a tree set" for S :: "'a set" where
    40 inductive_set trees :: "'a set \<Rightarrow> 'a tree set" for S :: "'a set" where
    33   [intro!]: "Leaf \<in> trees S"
    41   [intro!]: "Leaf \<in> trees S"
    34 | "l \<in> trees S \<Longrightarrow> r \<in> trees S \<Longrightarrow> v \<in> S \<Longrightarrow> Node l v r \<in> trees S"
    42 | "l \<in> trees S \<Longrightarrow> r \<in> trees S \<Longrightarrow> v \<in> S \<Longrightarrow> Node l v r \<in> trees S"
    35 
    43 
   338         by (rule measurable_restrict_space1) auto
   346         by (rule measurable_restrict_space1) auto
   339     qed
   347     qed
   340   qed
   348   qed
   341 qed
   349 qed
   342 
   350 
       
   351 hide_const (open) val
       
   352 hide_const (open) left
       
   353 hide_const (open) right
       
   354 
   343 end
   355 end