fun_rel_def is no simp rule by default
authorhaftmann
Tue Nov 09 14:02:12 2010 +0100 (2010-11-09)
changeset 4046375e544159549
parent 40445 65bd37d7d501
child 40464 e1db06cf6254
fun_rel_def is no simp rule by default
src/HOL/Library/Quotient_List.thy
     1.1 --- a/src/HOL/Library/Quotient_List.thy	Mon Nov 08 23:02:20 2010 +0100
     1.2 +++ b/src/HOL/Library/Quotient_List.thy	Tue Nov 09 14:02:12 2010 +0100
     1.3 @@ -82,21 +82,15 @@
     1.4    apply(rule list_all2_rel[OF q])
     1.5    done
     1.6  
     1.7 -lemma cons_prs_aux:
     1.8 -  assumes q: "Quotient R Abs Rep"
     1.9 -  shows "(map Abs) ((Rep h) # (map Rep t)) = h # t"
    1.10 -  by (induct t) (simp_all add: Quotient_abs_rep[OF q])
    1.11 -
    1.12  lemma cons_prs[quot_preserve]:
    1.13    assumes q: "Quotient R Abs Rep"
    1.14    shows "(Rep ---> (map Rep) ---> (map Abs)) (op #) = (op #)"
    1.15 -  by (simp only: fun_eq_iff fun_map_def cons_prs_aux[OF q])
    1.16 -     (simp)
    1.17 +  by (auto simp add: fun_eq_iff comp_def Quotient_abs_rep [OF q])
    1.18  
    1.19  lemma cons_rsp[quot_respect]:
    1.20    assumes q: "Quotient R Abs Rep"
    1.21    shows "(R ===> list_all2 R ===> list_all2 R) (op #) (op #)"
    1.22 -  by (auto)
    1.23 +  by auto
    1.24  
    1.25  lemma nil_prs[quot_preserve]:
    1.26    assumes q: "Quotient R Abs Rep"
    1.27 @@ -120,15 +114,16 @@
    1.28    and     b: "Quotient R2 abs2 rep2"
    1.29    shows "((abs1 ---> rep2) ---> (map rep1) ---> (map abs2)) map = map"
    1.30    and   "((abs1 ---> id) ---> map rep1 ---> id) map = map"
    1.31 -  by (simp_all only: fun_eq_iff fun_map_def map_prs_aux[OF a b])
    1.32 -     (simp_all add: Quotient_abs_rep[OF a])
    1.33 +  by (simp_all only: fun_eq_iff map_prs_aux[OF a b] comp_def)
    1.34 +    (simp_all add: Quotient_abs_rep[OF a] Quotient_abs_rep[OF b])
    1.35 +
    1.36  
    1.37  lemma map_rsp[quot_respect]:
    1.38    assumes q1: "Quotient R1 Abs1 Rep1"
    1.39    and     q2: "Quotient R2 Abs2 Rep2"
    1.40    shows "((R1 ===> R2) ===> (list_all2 R1) ===> list_all2 R2) map map"
    1.41    and   "((R1 ===> op =) ===> (list_all2 R1) ===> op =) map map"
    1.42 -  apply simp_all
    1.43 +  apply (simp_all add: fun_rel_def)
    1.44    apply(rule_tac [!] allI)+
    1.45    apply(rule_tac [!] impI)
    1.46    apply(rule_tac [!] allI)+
    1.47 @@ -146,7 +141,8 @@
    1.48    assumes a: "Quotient R1 abs1 rep1"
    1.49    and     b: "Quotient R2 abs2 rep2"
    1.50    shows "((abs1 ---> abs2 ---> rep2) ---> (map rep1) ---> rep2 ---> abs2) foldr = foldr"
    1.51 -  by (simp only: fun_eq_iff fun_map_def foldr_prs_aux[OF a b])
    1.52 +  apply (simp add: fun_eq_iff)
    1.53 +  by (simp only: fun_eq_iff foldr_prs_aux[OF a b])
    1.54       (simp)
    1.55  
    1.56  lemma foldl_prs_aux:
    1.57 @@ -160,8 +156,7 @@
    1.58    assumes a: "Quotient R1 abs1 rep1"
    1.59    and     b: "Quotient R2 abs2 rep2"
    1.60    shows "((abs1 ---> abs2 ---> rep1) ---> rep1 ---> (map rep2) ---> abs1) foldl = foldl"
    1.61 -  by (simp only: fun_eq_iff fun_map_def foldl_prs_aux[OF a b])
    1.62 -     (simp)
    1.63 +  by (simp add: fun_eq_iff foldl_prs_aux [OF a b])
    1.64  
    1.65  lemma list_all2_empty:
    1.66    shows "list_all2 R [] b \<Longrightarrow> length b = 0"
    1.67 @@ -172,7 +167,7 @@
    1.68    assumes q1: "Quotient R1 Abs1 Rep1"
    1.69    and     q2: "Quotient R2 Abs2 Rep2"
    1.70    shows "((R1 ===> R2 ===> R1) ===> R1 ===> list_all2 R2 ===> R1) foldl foldl"
    1.71 -  apply(auto)
    1.72 +  apply(auto simp add: fun_rel_def)
    1.73    apply (subgoal_tac "R1 xa ya \<longrightarrow> list_all2 R2 xb yb \<longrightarrow> R1 (foldl x xa xb) (foldl y ya yb)")
    1.74    apply simp
    1.75    apply (rule_tac x="xa" in spec)
    1.76 @@ -186,7 +181,7 @@
    1.77    assumes q1: "Quotient R1 Abs1 Rep1"
    1.78    and     q2: "Quotient R2 Abs2 Rep2"
    1.79    shows "((R1 ===> R2 ===> R2) ===> list_all2 R1 ===> R2 ===> R2) foldr foldr"
    1.80 -  apply auto
    1.81 +  apply (auto simp add: fun_rel_def)
    1.82    apply(subgoal_tac "R2 xb yb \<longrightarrow> list_all2 R1 xa ya \<longrightarrow> R2 (foldr x xa xb) (foldr y ya yb)")
    1.83    apply simp
    1.84    apply (rule_tac xs="xa" and ys="ya" in list_induct2)
    1.85 @@ -224,7 +219,7 @@
    1.86  
    1.87  lemma[quot_respect]:
    1.88    "((R ===> R ===> op =) ===> list_all2 R ===> list_all2 R ===> op =) list_all2 list_all2"
    1.89 -  by (simp add: list_all2_rsp)
    1.90 +  by (simp add: list_all2_rsp fun_rel_def)
    1.91  
    1.92  lemma[quot_preserve]:
    1.93    assumes a: "Quotient R abs1 rep1"