src/HOL/Data_Structures/RBT_Set.thy
changeset 68431 b294e095f64c
parent 68413 b56ed5010e69
child 68440 6826718f732d
     1.1 --- a/src/HOL/Data_Structures/RBT_Set.thy	Tue Jun 12 07:18:18 2018 +0200
     1.2 +++ b/src/HOL/Data_Structures/RBT_Set.thy	Tue Jun 12 17:18:40 2018 +0200
     1.3 @@ -10,6 +10,9 @@
     1.4    Isin2
     1.5  begin
     1.6  
     1.7 +definition empty :: "'a rbt" where
     1.8 +"empty = Leaf"
     1.9 +
    1.10  fun ins :: "'a::linorder \<Rightarrow> 'a rbt \<Rightarrow> 'a rbt" where
    1.11  "ins x Leaf = R Leaf x Leaf" |
    1.12  "ins x (B l a r) =
    1.13 @@ -121,9 +124,6 @@
    1.14  lemma color_paint_Black: "color (paint Black t) = Black"
    1.15  by (cases t) auto
    1.16  
    1.17 -theorem rbt_Leaf: "rbt Leaf"
    1.18 -by (simp add: rbt_def)
    1.19 -
    1.20  lemma paint_invc2: "invc2 t \<Longrightarrow> invc2 (paint c t)"
    1.21  by (cases t) auto
    1.22  
    1.23 @@ -257,10 +257,10 @@
    1.24  text \<open>Overall correctness:\<close>
    1.25  
    1.26  interpretation Set_by_Ordered
    1.27 -where empty = Leaf and isin = isin and insert = insert and delete = delete
    1.28 +where empty = empty and isin = isin and insert = insert and delete = delete
    1.29  and inorder = inorder and inv = rbt
    1.30  proof (standard, goal_cases)
    1.31 -  case 1 show ?case by simp
    1.32 +  case 1 show ?case by (simp add: empty_def)
    1.33  next
    1.34    case 2 thus ?case by(simp add: isin_set_inorder)
    1.35  next
    1.36 @@ -268,7 +268,7 @@
    1.37  next
    1.38    case 4 thus ?case by(simp add: inorder_delete)
    1.39  next
    1.40 -  case 5 thus ?case by (simp add: rbt_Leaf) 
    1.41 +  case 5 thus ?case by (simp add: rbt_def empty_def) 
    1.42  next
    1.43    case 6 thus ?case by (simp add: rbt_insert) 
    1.44  next