src/HOL/Library/Quotient_Sum.thy
changeset 55943 5c2df04e97d1
parent 55931 62156e694f3d
child 58881 b9556a055632
     1.1 --- a/src/HOL/Library/Quotient_Sum.thy	Thu Mar 06 15:14:09 2014 +0100
     1.2 +++ b/src/HOL/Library/Quotient_Sum.thy	Thu Mar 06 15:25:21 2014 +0100
     1.3 @@ -10,61 +10,61 @@
     1.4  
     1.5  subsection {* Rules for the Quotient package *}
     1.6  
     1.7 -lemma sum_rel_map1:
     1.8 -  "sum_rel R1 R2 (map_sum f1 f2 x) y \<longleftrightarrow> sum_rel (\<lambda>x. R1 (f1 x)) (\<lambda>x. R2 (f2 x)) x y"
     1.9 -  by (simp add: sum_rel_def split: sum.split)
    1.10 +lemma rel_sum_map1:
    1.11 +  "rel_sum R1 R2 (map_sum f1 f2 x) y \<longleftrightarrow> rel_sum (\<lambda>x. R1 (f1 x)) (\<lambda>x. R2 (f2 x)) x y"
    1.12 +  by (simp add: rel_sum_def split: sum.split)
    1.13  
    1.14 -lemma sum_rel_map2:
    1.15 -  "sum_rel R1 R2 x (map_sum f1 f2 y) \<longleftrightarrow> sum_rel (\<lambda>x y. R1 x (f1 y)) (\<lambda>x y. R2 x (f2 y)) x y"
    1.16 -  by (simp add: sum_rel_def split: sum.split)
    1.17 +lemma rel_sum_map2:
    1.18 +  "rel_sum R1 R2 x (map_sum f1 f2 y) \<longleftrightarrow> rel_sum (\<lambda>x y. R1 x (f1 y)) (\<lambda>x y. R2 x (f2 y)) x y"
    1.19 +  by (simp add: rel_sum_def split: sum.split)
    1.20  
    1.21  lemma map_sum_id [id_simps]:
    1.22    "map_sum id id = id"
    1.23    by (simp add: id_def map_sum.identity fun_eq_iff)
    1.24  
    1.25 -lemma sum_rel_eq [id_simps]:
    1.26 -  "sum_rel (op =) (op =) = (op =)"
    1.27 -  by (simp add: sum_rel_def fun_eq_iff split: sum.split)
    1.28 +lemma rel_sum_eq [id_simps]:
    1.29 +  "rel_sum (op =) (op =) = (op =)"
    1.30 +  by (simp add: rel_sum_def fun_eq_iff split: sum.split)
    1.31  
    1.32 -lemma reflp_sum_rel:
    1.33 -  "reflp R1 \<Longrightarrow> reflp R2 \<Longrightarrow> reflp (sum_rel R1 R2)"
    1.34 -  unfolding reflp_def split_sum_all sum_rel_simps by fast
    1.35 +lemma reflp_rel_sum:
    1.36 +  "reflp R1 \<Longrightarrow> reflp R2 \<Longrightarrow> reflp (rel_sum R1 R2)"
    1.37 +  unfolding reflp_def split_sum_all rel_sum_simps by fast
    1.38  
    1.39  lemma sum_symp:
    1.40 -  "symp R1 \<Longrightarrow> symp R2 \<Longrightarrow> symp (sum_rel R1 R2)"
    1.41 -  unfolding symp_def split_sum_all sum_rel_simps by fast
    1.42 +  "symp R1 \<Longrightarrow> symp R2 \<Longrightarrow> symp (rel_sum R1 R2)"
    1.43 +  unfolding symp_def split_sum_all rel_sum_simps by fast
    1.44  
    1.45  lemma sum_transp:
    1.46 -  "transp R1 \<Longrightarrow> transp R2 \<Longrightarrow> transp (sum_rel R1 R2)"
    1.47 -  unfolding transp_def split_sum_all sum_rel_simps by fast
    1.48 +  "transp R1 \<Longrightarrow> transp R2 \<Longrightarrow> transp (rel_sum R1 R2)"
    1.49 +  unfolding transp_def split_sum_all rel_sum_simps by fast
    1.50  
    1.51  lemma sum_equivp [quot_equiv]:
    1.52 -  "equivp R1 \<Longrightarrow> equivp R2 \<Longrightarrow> equivp (sum_rel R1 R2)"
    1.53 -  by (blast intro: equivpI reflp_sum_rel sum_symp sum_transp elim: equivpE)
    1.54 +  "equivp R1 \<Longrightarrow> equivp R2 \<Longrightarrow> equivp (rel_sum R1 R2)"
    1.55 +  by (blast intro: equivpI reflp_rel_sum sum_symp sum_transp elim: equivpE)
    1.56  
    1.57  lemma sum_quotient [quot_thm]:
    1.58    assumes q1: "Quotient3 R1 Abs1 Rep1"
    1.59    assumes q2: "Quotient3 R2 Abs2 Rep2"
    1.60 -  shows "Quotient3 (sum_rel R1 R2) (map_sum Abs1 Abs2) (map_sum Rep1 Rep2)"
    1.61 +  shows "Quotient3 (rel_sum R1 R2) (map_sum Abs1 Abs2) (map_sum Rep1 Rep2)"
    1.62    apply (rule Quotient3I)
    1.63 -  apply (simp_all add: map_sum.compositionality comp_def map_sum.identity sum_rel_eq sum_rel_map1 sum_rel_map2
    1.64 +  apply (simp_all add: map_sum.compositionality comp_def map_sum.identity rel_sum_eq rel_sum_map1 rel_sum_map2
    1.65      Quotient3_abs_rep [OF q1] Quotient3_rel_rep [OF q1] Quotient3_abs_rep [OF q2] Quotient3_rel_rep [OF q2])
    1.66    using Quotient3_rel [OF q1] Quotient3_rel [OF q2]
    1.67 -  apply (simp add: sum_rel_def comp_def split: sum.split)
    1.68 +  apply (simp add: rel_sum_def comp_def split: sum.split)
    1.69    done
    1.70  
    1.71 -declare [[mapQ3 sum = (sum_rel, sum_quotient)]]
    1.72 +declare [[mapQ3 sum = (rel_sum, sum_quotient)]]
    1.73  
    1.74  lemma sum_Inl_rsp [quot_respect]:
    1.75    assumes q1: "Quotient3 R1 Abs1 Rep1"
    1.76    assumes q2: "Quotient3 R2 Abs2 Rep2"
    1.77 -  shows "(R1 ===> sum_rel R1 R2) Inl Inl"
    1.78 +  shows "(R1 ===> rel_sum R1 R2) Inl Inl"
    1.79    by auto
    1.80  
    1.81  lemma sum_Inr_rsp [quot_respect]:
    1.82    assumes q1: "Quotient3 R1 Abs1 Rep1"
    1.83    assumes q2: "Quotient3 R2 Abs2 Rep2"
    1.84 -  shows "(R2 ===> sum_rel R1 R2) Inr Inr"
    1.85 +  shows "(R2 ===> rel_sum R1 R2) Inr Inr"
    1.86    by auto
    1.87  
    1.88  lemma sum_Inl_prs [quot_preserve]: