src/HOL/Library/Quotient_Option.thy
changeset 55466 786edc984c98
parent 53026 e1a548c11845
child 55525 70b7e91fa1f9
     1.1 --- a/src/HOL/Library/Quotient_Option.thy	Fri Feb 14 07:53:45 2014 +0100
     1.2 +++ b/src/HOL/Library/Quotient_Option.thy	Fri Feb 14 07:53:46 2014 +0100
     1.3 @@ -11,20 +11,16 @@
     1.4  subsection {* Rules for the Quotient package *}
     1.5  
     1.6  lemma option_rel_map1:
     1.7 -  "option_rel R (Option.map f x) y \<longleftrightarrow> option_rel (\<lambda>x. R (f x)) x y"
     1.8 +  "option_rel R (map_option f x) y \<longleftrightarrow> option_rel (\<lambda>x. R (f x)) x y"
     1.9    by (simp add: option_rel_def split: option.split)
    1.10  
    1.11  lemma option_rel_map2:
    1.12 -  "option_rel R x (Option.map f y) \<longleftrightarrow> option_rel (\<lambda>x y. R x (f y)) x y"
    1.13 +  "option_rel R x (map_option f y) \<longleftrightarrow> option_rel (\<lambda>x y. R x (f y)) x y"
    1.14    by (simp add: option_rel_def split: option.split)
    1.15  
    1.16 -lemma option_map_id [id_simps]:
    1.17 -  "Option.map id = id"
    1.18 -  by (simp add: id_def Option.map.identity fun_eq_iff)
    1.19 -
    1.20 -lemma option_rel_eq [id_simps]:
    1.21 -  "option_rel (op =) = (op =)"
    1.22 -  by (simp add: option_rel_def fun_eq_iff split: option.split)
    1.23 +declare
    1.24 +  map_option.id [id_simps]
    1.25 +  option_rel_eq [id_simps]
    1.26  
    1.27  lemma option_symp:
    1.28    "symp R \<Longrightarrow> symp (option_rel R)"
    1.29 @@ -40,9 +36,9 @@
    1.30  
    1.31  lemma option_quotient [quot_thm]:
    1.32    assumes "Quotient3 R Abs Rep"
    1.33 -  shows "Quotient3 (option_rel R) (Option.map Abs) (Option.map Rep)"
    1.34 +  shows "Quotient3 (option_rel R) (map_option Abs) (map_option Rep)"
    1.35    apply (rule Quotient3I)
    1.36 -  apply (simp_all add: Option.map.compositionality comp_def Option.map.identity option_rel_eq option_rel_map1 option_rel_map2 Quotient3_abs_rep [OF assms] Quotient3_rel_rep [OF assms])
    1.37 +  apply (simp_all add: option.map_comp comp_def option.map_id[unfolded id_def] option_rel_eq option_rel_map1 option_rel_map2 Quotient3_abs_rep [OF assms] Quotient3_rel_rep [OF assms])
    1.38    using Quotient3_rel [OF assms]
    1.39    apply (simp add: option_rel_def split: option.split)
    1.40    done
    1.41 @@ -61,12 +57,12 @@
    1.42  
    1.43  lemma option_None_prs [quot_preserve]:
    1.44    assumes q: "Quotient3 R Abs Rep"
    1.45 -  shows "Option.map Abs None = None"
    1.46 +  shows "map_option Abs None = None"
    1.47    by simp
    1.48  
    1.49  lemma option_Some_prs [quot_preserve]:
    1.50    assumes q: "Quotient3 R Abs Rep"
    1.51 -  shows "(Rep ---> Option.map Abs) Some = Some"
    1.52 +  shows "(Rep ---> map_option Abs) Some = Some"
    1.53    apply(simp add: fun_eq_iff)
    1.54    apply(simp add: Quotient3_abs_rep[OF q])
    1.55    done