Replace 'list_rel' by 'list_all2'; they are equivalent.
authorCezary Kaliszyk <kaliszyk@in.tum.de>
Wed Jun 23 08:42:41 2010 +0200 (2010-06-23)
changeset 37492ab36b1a50ca8
parent 37491 b5989aa32358
child 37493 2377d246a631
Replace 'list_rel' by 'list_all2'; they are equivalent.
src/HOL/Library/Quotient_List.thy
src/HOL/Quotient_Examples/FSet.thy
     1.1 --- a/src/HOL/Library/Quotient_List.thy	Tue Jun 22 19:46:16 2010 +0200
     1.2 +++ b/src/HOL/Library/Quotient_List.thy	Wed Jun 23 08:42:41 2010 +0200
     1.3 @@ -8,15 +8,7 @@
     1.4  imports Main Quotient_Syntax
     1.5  begin
     1.6  
     1.7 -fun
     1.8 -  list_rel
     1.9 -where
    1.10 -  "list_rel R [] [] = True"
    1.11 -| "list_rel R (x#xs) [] = False"
    1.12 -| "list_rel R [] (x#xs) = False"
    1.13 -| "list_rel R (x#xs) (y#ys) = (R x y \<and> list_rel R xs ys)"
    1.14 -
    1.15 -declare [[map list = (map, list_rel)]]
    1.16 +declare [[map list = (map, list_all2)]]
    1.17  
    1.18  lemma split_list_all:
    1.19    shows "(\<forall>x. P x) \<longleftrightarrow> P [] \<and> (\<forall>x xs. P (x#xs))"
    1.20 @@ -33,52 +25,47 @@
    1.21    apply(simp_all)
    1.22    done
    1.23  
    1.24 +lemma list_all2_reflp:
    1.25 +  shows "equivp R \<Longrightarrow> list_all2 R xs xs"
    1.26 +  by (induct xs, simp_all add: equivp_reflp)
    1.27  
    1.28 -lemma list_rel_reflp:
    1.29 -  shows "equivp R \<Longrightarrow> list_rel R xs xs"
    1.30 -  apply(induct xs)
    1.31 -  apply(simp_all add: equivp_reflp)
    1.32 -  done
    1.33 -
    1.34 -lemma list_rel_symp:
    1.35 +lemma list_all2_symp:
    1.36    assumes a: "equivp R"
    1.37 -  shows "list_rel R xs ys \<Longrightarrow> list_rel R ys xs"
    1.38 -  apply(induct xs ys rule: list_induct2')
    1.39 +  and b: "list_all2 R xs ys"
    1.40 +  shows "list_all2 R ys xs"
    1.41 +  using list_all2_lengthD[OF b] b
    1.42 +  apply(induct xs ys rule: list_induct2)
    1.43    apply(simp_all)
    1.44    apply(rule equivp_symp[OF a])
    1.45    apply(simp)
    1.46    done
    1.47  
    1.48 -lemma list_rel_transp:
    1.49 +thm list_induct3
    1.50 +
    1.51 +lemma list_all2_transp:
    1.52    assumes a: "equivp R"
    1.53 -  shows "list_rel R xs1 xs2 \<Longrightarrow> list_rel R xs2 xs3 \<Longrightarrow> list_rel R xs1 xs3"
    1.54 -  using a
    1.55 -  apply(induct R xs1 xs2 arbitrary: xs3 rule: list_rel.induct)
    1.56 -  apply(simp)
    1.57 -  apply(simp)
    1.58 -  apply(simp)
    1.59 -  apply(case_tac xs3)
    1.60 -  apply(clarify)
    1.61 -  apply(simp (no_asm_use))
    1.62 -  apply(clarify)
    1.63 -  apply(simp (no_asm_use))
    1.64 -  apply(auto intro: equivp_transp)
    1.65 +  and b: "list_all2 R xs1 xs2"
    1.66 +  and c: "list_all2 R xs2 xs3"
    1.67 +  shows "list_all2 R xs1 xs3"
    1.68 +  using list_all2_lengthD[OF b] list_all2_lengthD[OF c] b c
    1.69 +  apply(induct rule: list_induct3)
    1.70 +  apply(simp_all)
    1.71 +  apply(auto intro: equivp_transp[OF a])
    1.72    done
    1.73  
    1.74  lemma list_equivp[quot_equiv]:
    1.75    assumes a: "equivp R"
    1.76 -  shows "equivp (list_rel R)"
    1.77 -  apply(rule equivpI)
    1.78 +  shows "equivp (list_all2 R)"
    1.79 +  apply (intro equivpI)
    1.80    unfolding reflp_def symp_def transp_def
    1.81 -  apply(subst split_list_all)
    1.82 -  apply(simp add: equivp_reflp[OF a] list_rel_reflp[OF a])
    1.83 -  apply(blast intro: list_rel_symp[OF a])
    1.84 -  apply(blast intro: list_rel_transp[OF a])
    1.85 +  apply(simp add: list_all2_reflp[OF a])
    1.86 +  apply(blast intro: list_all2_symp[OF a])
    1.87 +  apply(blast intro: list_all2_transp[OF a])
    1.88    done
    1.89  
    1.90 -lemma list_rel_rel:
    1.91 +lemma list_all2_rel:
    1.92    assumes q: "Quotient R Abs Rep"
    1.93 -  shows "list_rel R r s = (list_rel R r r \<and> list_rel R s s \<and> (map Abs r = map Abs s))"
    1.94 +  shows "list_all2 R r s = (list_all2 R r r \<and> list_all2 R s s \<and> (map Abs r = map Abs s))"
    1.95    apply(induct r s rule: list_induct2')
    1.96    apply(simp_all)
    1.97    using Quotient_rel[OF q]
    1.98 @@ -87,21 +74,16 @@
    1.99  
   1.100  lemma list_quotient[quot_thm]:
   1.101    assumes q: "Quotient R Abs Rep"
   1.102 -  shows "Quotient (list_rel R) (map Abs) (map Rep)"
   1.103 +  shows "Quotient (list_all2 R) (map Abs) (map Rep)"
   1.104    unfolding Quotient_def
   1.105    apply(subst split_list_all)
   1.106    apply(simp add: Quotient_abs_rep[OF q] abs_o_rep[OF q] map_id)
   1.107 -  apply(rule conjI)
   1.108 -  apply(rule allI)
   1.109 +  apply(intro conjI allI)
   1.110    apply(induct_tac a)
   1.111 -  apply(simp)
   1.112 -  apply(simp)
   1.113 -  apply(simp add: Quotient_rep_reflp[OF q])
   1.114 -  apply(rule allI)+
   1.115 -  apply(rule list_rel_rel[OF q])
   1.116 +  apply(simp_all add: Quotient_rep_reflp[OF q])
   1.117 +  apply(rule list_all2_rel[OF q])
   1.118    done
   1.119  
   1.120 -
   1.121  lemma cons_prs_aux:
   1.122    assumes q: "Quotient R Abs Rep"
   1.123    shows "(map Abs) ((Rep h) # (map Rep t)) = h # t"
   1.124 @@ -115,7 +97,7 @@
   1.125  
   1.126  lemma cons_rsp[quot_respect]:
   1.127    assumes q: "Quotient R Abs Rep"
   1.128 -  shows "(R ===> list_rel R ===> list_rel R) (op #) (op #)"
   1.129 +  shows "(R ===> list_all2 R ===> list_all2 R) (op #) (op #)"
   1.130    by (auto)
   1.131  
   1.132  lemma nil_prs[quot_preserve]:
   1.133 @@ -125,7 +107,7 @@
   1.134  
   1.135  lemma nil_rsp[quot_respect]:
   1.136    assumes q: "Quotient R Abs Rep"
   1.137 -  shows "list_rel R [] []"
   1.138 +  shows "list_all2 R [] []"
   1.139    by simp
   1.140  
   1.141  lemma map_prs_aux:
   1.142 @@ -146,8 +128,8 @@
   1.143  lemma map_rsp[quot_respect]:
   1.144    assumes q1: "Quotient R1 Abs1 Rep1"
   1.145    and     q2: "Quotient R2 Abs2 Rep2"
   1.146 -  shows "((R1 ===> R2) ===> (list_rel R1) ===> list_rel R2) map map"
   1.147 -  and   "((R1 ===> op =) ===> (list_rel R1) ===> op =) map map"
   1.148 +  shows "((R1 ===> R2) ===> (list_all2 R1) ===> list_all2 R2) map map"
   1.149 +  and   "((R1 ===> op =) ===> (list_all2 R1) ===> op =) map map"
   1.150    apply simp_all
   1.151    apply(rule_tac [!] allI)+
   1.152    apply(rule_tac [!] impI)
   1.153 @@ -183,53 +165,45 @@
   1.154    by (simp only: expand_fun_eq fun_map_def foldl_prs_aux[OF a b])
   1.155       (simp)
   1.156  
   1.157 -lemma list_rel_empty:
   1.158 -  shows "list_rel R [] b \<Longrightarrow> length b = 0"
   1.159 +lemma list_all2_empty:
   1.160 +  shows "list_all2 R [] b \<Longrightarrow> length b = 0"
   1.161    by (induct b) (simp_all)
   1.162  
   1.163 -lemma list_rel_len:
   1.164 -  shows "list_rel R a b \<Longrightarrow> length a = length b"
   1.165 -  apply (induct a arbitrary: b)
   1.166 -  apply (simp add: list_rel_empty)
   1.167 -  apply (case_tac b)
   1.168 -  apply simp_all
   1.169 -  done
   1.170 -
   1.171  (* induct_tac doesn't accept 'arbitrary', so we manually 'spec' *)
   1.172  lemma foldl_rsp[quot_respect]:
   1.173    assumes q1: "Quotient R1 Abs1 Rep1"
   1.174    and     q2: "Quotient R2 Abs2 Rep2"
   1.175 -  shows "((R1 ===> R2 ===> R1) ===> R1 ===> list_rel R2 ===> R1) foldl foldl"
   1.176 +  shows "((R1 ===> R2 ===> R1) ===> R1 ===> list_all2 R2 ===> R1) foldl foldl"
   1.177    apply(auto)
   1.178 -  apply (subgoal_tac "R1 xa ya \<longrightarrow> list_rel R2 xb yb \<longrightarrow> R1 (foldl x xa xb) (foldl y ya yb)")
   1.179 +  apply (subgoal_tac "R1 xa ya \<longrightarrow> list_all2 R2 xb yb \<longrightarrow> R1 (foldl x xa xb) (foldl y ya yb)")
   1.180    apply simp
   1.181    apply (rule_tac x="xa" in spec)
   1.182    apply (rule_tac x="ya" in spec)
   1.183    apply (rule_tac xs="xb" and ys="yb" in list_induct2)
   1.184 -  apply (rule list_rel_len)
   1.185 +  apply (rule list_all2_lengthD)
   1.186    apply (simp_all)
   1.187    done
   1.188  
   1.189  lemma foldr_rsp[quot_respect]:
   1.190    assumes q1: "Quotient R1 Abs1 Rep1"
   1.191    and     q2: "Quotient R2 Abs2 Rep2"
   1.192 -  shows "((R1 ===> R2 ===> R2) ===> list_rel R1 ===> R2 ===> R2) foldr foldr"
   1.193 +  shows "((R1 ===> R2 ===> R2) ===> list_all2 R1 ===> R2 ===> R2) foldr foldr"
   1.194    apply auto
   1.195 -  apply(subgoal_tac "R2 xb yb \<longrightarrow> list_rel R1 xa ya \<longrightarrow> R2 (foldr x xa xb) (foldr y ya yb)")
   1.196 +  apply(subgoal_tac "R2 xb yb \<longrightarrow> list_all2 R1 xa ya \<longrightarrow> R2 (foldr x xa xb) (foldr y ya yb)")
   1.197    apply simp
   1.198    apply (rule_tac xs="xa" and ys="ya" in list_induct2)
   1.199 -  apply (rule list_rel_len)
   1.200 +  apply (rule list_all2_lengthD)
   1.201    apply (simp_all)
   1.202    done
   1.203  
   1.204 -lemma list_rel_rsp:
   1.205 +lemma list_all2_rsp:
   1.206    assumes r: "\<forall>x y. R x y \<longrightarrow> (\<forall>a b. R a b \<longrightarrow> S x a = T y b)"
   1.207 -  and l1: "list_rel R x y"
   1.208 -  and l2: "list_rel R a b"
   1.209 -  shows "list_rel S x a = list_rel T y b"
   1.210 +  and l1: "list_all2 R x y"
   1.211 +  and l2: "list_all2 R a b"
   1.212 +  shows "list_all2 S x a = list_all2 T y b"
   1.213    proof -
   1.214 -    have a: "length y = length x" by (rule list_rel_len[OF l1, symmetric])
   1.215 -    have c: "length a = length b" by (rule list_rel_len[OF l2])
   1.216 +    have a: "length y = length x" by (rule list_all2_lengthD[OF l1, symmetric])
   1.217 +    have c: "length a = length b" by (rule list_all2_lengthD[OF l2])
   1.218      show ?thesis proof (cases "length x = length a")
   1.219        case True
   1.220        have b: "length x = length a" by fact
   1.221 @@ -243,20 +217,20 @@
   1.222      next
   1.223        case False
   1.224        have d: "length x \<noteq> length a" by fact
   1.225 -      then have e: "\<not>list_rel S x a" using list_rel_len by auto
   1.226 +      then have e: "\<not>list_all2 S x a" using list_all2_lengthD by auto
   1.227        have "length y \<noteq> length b" using d a c by simp
   1.228 -      then have "\<not>list_rel T y b" using list_rel_len by auto
   1.229 +      then have "\<not>list_all2 T y b" using list_all2_lengthD by auto
   1.230        then show ?thesis using e by simp
   1.231      qed
   1.232    qed
   1.233  
   1.234  lemma[quot_respect]:
   1.235 -  "((R ===> R ===> op =) ===> list_rel R ===> list_rel R ===> op =) list_rel list_rel"
   1.236 -  by (simp add: list_rel_rsp)
   1.237 +  "((R ===> R ===> op =) ===> list_all2 R ===> list_all2 R ===> op =) list_all2 list_all2"
   1.238 +  by (simp add: list_all2_rsp)
   1.239  
   1.240  lemma[quot_preserve]:
   1.241    assumes a: "Quotient R abs1 rep1"
   1.242 -  shows "((abs1 ---> abs1 ---> id) ---> map rep1 ---> map rep1 ---> id) list_rel = list_rel"
   1.243 +  shows "((abs1 ---> abs1 ---> id) ---> map rep1 ---> map rep1 ---> id) list_all2 = list_all2"
   1.244    apply (simp add: expand_fun_eq)
   1.245    apply clarify
   1.246    apply (induct_tac xa xb rule: list_induct2')
   1.247 @@ -265,29 +239,29 @@
   1.248  
   1.249  lemma[quot_preserve]:
   1.250    assumes a: "Quotient R abs1 rep1"
   1.251 -  shows "(list_rel ((rep1 ---> rep1 ---> id) R) l m) = (l = m)"
   1.252 +  shows "(list_all2 ((rep1 ---> rep1 ---> id) R) l m) = (l = m)"
   1.253    by (induct l m rule: list_induct2') (simp_all add: Quotient_rel_rep[OF a])
   1.254  
   1.255 -lemma list_rel_eq[id_simps]:
   1.256 -  shows "(list_rel (op =)) = (op =)"
   1.257 +lemma list_all2_eq[id_simps]:
   1.258 +  shows "(list_all2 (op =)) = (op =)"
   1.259    unfolding expand_fun_eq
   1.260    apply(rule allI)+
   1.261    apply(induct_tac x xa rule: list_induct2')
   1.262    apply(simp_all)
   1.263    done
   1.264  
   1.265 -lemma list_rel_find_element:
   1.266 +lemma list_all2_find_element:
   1.267    assumes a: "x \<in> set a"
   1.268 -  and b: "list_rel R a b"
   1.269 +  and b: "list_all2 R a b"
   1.270    shows "\<exists>y. (y \<in> set b \<and> R x y)"
   1.271  proof -
   1.272 -  have "length a = length b" using b by (rule list_rel_len)
   1.273 +  have "length a = length b" using b by (rule list_all2_lengthD)
   1.274    then show ?thesis using a b by (induct a b rule: list_induct2) auto
   1.275  qed
   1.276  
   1.277 -lemma list_rel_refl:
   1.278 +lemma list_all2_refl:
   1.279    assumes a: "\<And>x y. R x y = (R x = R y)"
   1.280 -  shows "list_rel R x x"
   1.281 +  shows "list_all2 R x x"
   1.282    by (induct x) (auto simp add: a)
   1.283  
   1.284  end
     2.1 --- a/src/HOL/Quotient_Examples/FSet.thy	Tue Jun 22 19:46:16 2010 +0200
     2.2 +++ b/src/HOL/Quotient_Examples/FSet.thy	Wed Jun 23 08:42:41 2010 +0200
     2.3 @@ -80,20 +80,20 @@
     2.4  
     2.5  text {* Composition Quotient *}
     2.6  
     2.7 -lemma list_rel_refl:
     2.8 -  shows "(list_rel op \<approx>) r r"
     2.9 -  by (rule list_rel_refl) (metis equivp_def fset_equivp)
    2.10 +lemma list_all2_refl:
    2.11 +  shows "(list_all2 op \<approx>) r r"
    2.12 +  by (rule list_all2_refl) (metis equivp_def fset_equivp)
    2.13  
    2.14  lemma compose_list_refl:
    2.15 -  shows "(list_rel op \<approx> OOO op \<approx>) r r"
    2.16 +  shows "(list_all2 op \<approx> OOO op \<approx>) r r"
    2.17  proof
    2.18    have *: "r \<approx> r" by (rule equivp_reflp[OF fset_equivp])
    2.19 -  show "list_rel op \<approx> r r" by (rule list_rel_refl)
    2.20 -  with * show "(op \<approx> OO list_rel op \<approx>) r r" ..
    2.21 +  show "list_all2 op \<approx> r r" by (rule list_all2_refl)
    2.22 +  with * show "(op \<approx> OO list_all2 op \<approx>) r r" ..
    2.23  qed
    2.24  
    2.25  lemma Quotient_fset_list:
    2.26 -  shows "Quotient (list_rel op \<approx>) (map abs_fset) (map rep_fset)"
    2.27 +  shows "Quotient (list_all2 op \<approx>) (map abs_fset) (map rep_fset)"
    2.28    by (fact list_quotient[OF Quotient_fset])
    2.29  
    2.30  lemma set_in_eq: "(\<forall>e. ((e \<in> xs) \<longleftrightarrow> (e \<in> ys))) \<equiv> xs = ys"
    2.31 @@ -104,32 +104,32 @@
    2.32    by (simp only: set_map set_in_eq)
    2.33  
    2.34  lemma quotient_compose_list[quot_thm]:
    2.35 -  shows  "Quotient ((list_rel op \<approx>) OOO (op \<approx>))
    2.36 +  shows  "Quotient ((list_all2 op \<approx>) OOO (op \<approx>))
    2.37      (abs_fset \<circ> (map abs_fset)) ((map rep_fset) \<circ> rep_fset)"
    2.38    unfolding Quotient_def comp_def
    2.39  proof (intro conjI allI)
    2.40    fix a r s
    2.41    show "abs_fset (map abs_fset (map rep_fset (rep_fset a))) = a"
    2.42      by (simp add: abs_o_rep[OF Quotient_fset] Quotient_abs_rep[OF Quotient_fset] map_id)
    2.43 -  have b: "list_rel op \<approx> (map rep_fset (rep_fset a)) (map rep_fset (rep_fset a))"
    2.44 -    by (rule list_rel_refl)
    2.45 -  have c: "(op \<approx> OO list_rel op \<approx>) (map rep_fset (rep_fset a)) (map rep_fset (rep_fset a))"
    2.46 +  have b: "list_all2 op \<approx> (map rep_fset (rep_fset a)) (map rep_fset (rep_fset a))"
    2.47 +    by (rule list_all2_refl)
    2.48 +  have c: "(op \<approx> OO list_all2 op \<approx>) (map rep_fset (rep_fset a)) (map rep_fset (rep_fset a))"
    2.49      by (rule, rule equivp_reflp[OF fset_equivp]) (rule b)
    2.50 -  show "(list_rel op \<approx> OOO op \<approx>) (map rep_fset (rep_fset a)) (map rep_fset (rep_fset a))"
    2.51 -    by (rule, rule list_rel_refl) (rule c)
    2.52 -  show "(list_rel op \<approx> OOO op \<approx>) r s = ((list_rel op \<approx> OOO op \<approx>) r r \<and>
    2.53 -        (list_rel op \<approx> OOO op \<approx>) s s \<and> abs_fset (map abs_fset r) = abs_fset (map abs_fset s))"
    2.54 +  show "(list_all2 op \<approx> OOO op \<approx>) (map rep_fset (rep_fset a)) (map rep_fset (rep_fset a))"
    2.55 +    by (rule, rule list_all2_refl) (rule c)
    2.56 +  show "(list_all2 op \<approx> OOO op \<approx>) r s = ((list_all2 op \<approx> OOO op \<approx>) r r \<and>
    2.57 +        (list_all2 op \<approx> OOO op \<approx>) s s \<and> abs_fset (map abs_fset r) = abs_fset (map abs_fset s))"
    2.58    proof (intro iffI conjI)
    2.59 -    show "(list_rel op \<approx> OOO op \<approx>) r r" by (rule compose_list_refl)
    2.60 -    show "(list_rel op \<approx> OOO op \<approx>) s s" by (rule compose_list_refl)
    2.61 +    show "(list_all2 op \<approx> OOO op \<approx>) r r" by (rule compose_list_refl)
    2.62 +    show "(list_all2 op \<approx> OOO op \<approx>) s s" by (rule compose_list_refl)
    2.63    next
    2.64 -    assume a: "(list_rel op \<approx> OOO op \<approx>) r s"
    2.65 +    assume a: "(list_all2 op \<approx> OOO op \<approx>) r s"
    2.66      then have b: "map abs_fset r \<approx> map abs_fset s"
    2.67      proof (elim pred_compE)
    2.68        fix b ba
    2.69 -      assume c: "list_rel op \<approx> r b"
    2.70 +      assume c: "list_all2 op \<approx> r b"
    2.71        assume d: "b \<approx> ba"
    2.72 -      assume e: "list_rel op \<approx> ba s"
    2.73 +      assume e: "list_all2 op \<approx> ba s"
    2.74        have f: "map abs_fset r = map abs_fset b"
    2.75          using Quotient_rel[OF Quotient_fset_list] c by blast
    2.76        have "map abs_fset ba = map abs_fset s"
    2.77 @@ -140,20 +140,20 @@
    2.78      then show "abs_fset (map abs_fset r) = abs_fset (map abs_fset s)"
    2.79        using Quotient_rel[OF Quotient_fset] by blast
    2.80    next
    2.81 -    assume a: "(list_rel op \<approx> OOO op \<approx>) r r \<and> (list_rel op \<approx> OOO op \<approx>) s s
    2.82 +    assume a: "(list_all2 op \<approx> OOO op \<approx>) r r \<and> (list_all2 op \<approx> OOO op \<approx>) s s
    2.83        \<and> abs_fset (map abs_fset r) = abs_fset (map abs_fset s)"
    2.84 -    then have s: "(list_rel op \<approx> OOO op \<approx>) s s" by simp
    2.85 +    then have s: "(list_all2 op \<approx> OOO op \<approx>) s s" by simp
    2.86      have d: "map abs_fset r \<approx> map abs_fset s"
    2.87        by (subst Quotient_rel[OF Quotient_fset]) (simp add: a)
    2.88      have b: "map rep_fset (map abs_fset r) \<approx> map rep_fset (map abs_fset s)"
    2.89        by (rule map_rel_cong[OF d])
    2.90 -    have y: "list_rel op \<approx> (map rep_fset (map abs_fset s)) s"
    2.91 -      by (fact rep_abs_rsp_left[OF Quotient_fset_list, OF list_rel_refl[of s]])
    2.92 -    have c: "(op \<approx> OO list_rel op \<approx>) (map rep_fset (map abs_fset r)) s"
    2.93 +    have y: "list_all2 op \<approx> (map rep_fset (map abs_fset s)) s"
    2.94 +      by (fact rep_abs_rsp_left[OF Quotient_fset_list, OF list_all2_refl[of s]])
    2.95 +    have c: "(op \<approx> OO list_all2 op \<approx>) (map rep_fset (map abs_fset r)) s"
    2.96        by (rule pred_compI) (rule b, rule y)
    2.97 -    have z: "list_rel op \<approx> r (map rep_fset (map abs_fset r))"
    2.98 -      by (fact rep_abs_rsp[OF Quotient_fset_list, OF list_rel_refl[of r]])
    2.99 -    then show "(list_rel op \<approx> OOO op \<approx>) r s"
   2.100 +    have z: "list_all2 op \<approx> r (map rep_fset (map abs_fset r))"
   2.101 +      by (fact rep_abs_rsp[OF Quotient_fset_list, OF list_all2_refl[of r]])
   2.102 +    then show "(list_all2 op \<approx> OOO op \<approx>) r s"
   2.103        using a c pred_compI by simp
   2.104    qed
   2.105  qed
   2.106 @@ -336,27 +336,27 @@
   2.107    by (simp add: memb_def[symmetric] ffold_raw_rsp_pre)
   2.108  
   2.109  lemma concat_rsp_pre:
   2.110 -  assumes a: "list_rel op \<approx> x x'"
   2.111 +  assumes a: "list_all2 op \<approx> x x'"
   2.112    and     b: "x' \<approx> y'"
   2.113 -  and     c: "list_rel op \<approx> y' y"
   2.114 +  and     c: "list_all2 op \<approx> y' y"
   2.115    and     d: "\<exists>x\<in>set x. xa \<in> set x"
   2.116    shows "\<exists>x\<in>set y. xa \<in> set x"
   2.117  proof -
   2.118    obtain xb where e: "xb \<in> set x" and f: "xa \<in> set xb" using d by auto
   2.119 -  have "\<exists>y. y \<in> set x' \<and> xb \<approx> y" by (rule list_rel_find_element[OF e a])
   2.120 +  have "\<exists>y. y \<in> set x' \<and> xb \<approx> y" by (rule list_all2_find_element[OF e a])
   2.121    then obtain ya where h: "ya \<in> set x'" and i: "xb \<approx> ya" by auto
   2.122    have "ya \<in> set y'" using b h by simp
   2.123 -  then have "\<exists>yb. yb \<in> set y \<and> ya \<approx> yb" using c by (rule list_rel_find_element)
   2.124 +  then have "\<exists>yb. yb \<in> set y \<and> ya \<approx> yb" using c by (rule list_all2_find_element)
   2.125    then show ?thesis using f i by auto
   2.126  qed
   2.127  
   2.128  lemma [quot_respect]:
   2.129 -  shows "(list_rel op \<approx> OOO op \<approx> ===> op \<approx>) concat concat"
   2.130 +  shows "(list_all2 op \<approx> OOO op \<approx> ===> op \<approx>) concat concat"
   2.131  proof (rule fun_relI, elim pred_compE)
   2.132    fix a b ba bb
   2.133 -  assume a: "list_rel op \<approx> a ba"
   2.134 +  assume a: "list_all2 op \<approx> a ba"
   2.135    assume b: "ba \<approx> bb"
   2.136 -  assume c: "list_rel op \<approx> bb b"
   2.137 +  assume c: "list_all2 op \<approx> bb b"
   2.138    have "\<forall>x. (\<exists>xa\<in>set a. x \<in> set xa) = (\<exists>xa\<in>set b. x \<in> set xa)" proof
   2.139      fix x
   2.140      show "(\<exists>xa\<in>set a. x \<in> set xa) = (\<exists>xa\<in>set b. x \<in> set xa)" proof
   2.141 @@ -364,9 +364,9 @@
   2.142        show "\<exists>xa\<in>set b. x \<in> set xa" by (rule concat_rsp_pre[OF a b c d])
   2.143      next
   2.144        assume e: "\<exists>xa\<in>set b. x \<in> set xa"
   2.145 -      have a': "list_rel op \<approx> ba a" by (rule list_rel_symp[OF list_eq_equivp, OF a])
   2.146 +      have a': "list_all2 op \<approx> ba a" by (rule list_all2_symp[OF list_eq_equivp, OF a])
   2.147        have b': "bb \<approx> ba" by (rule equivp_symp[OF list_eq_equivp, OF b])
   2.148 -      have c': "list_rel op \<approx> b bb" by (rule list_rel_symp[OF list_eq_equivp, OF c])
   2.149 +      have c': "list_all2 op \<approx> b bb" by (rule list_all2_symp[OF list_eq_equivp, OF c])
   2.150        show "\<exists>xa\<in>set a. x \<in> set xa" by (rule concat_rsp_pre[OF c' b' a' e])
   2.151      qed
   2.152    qed
   2.153 @@ -581,14 +581,14 @@
   2.154  
   2.155  text {* Compositional Respectfullness and Preservation *}
   2.156  
   2.157 -lemma [quot_respect]: "(list_rel op \<approx> OOO op \<approx>) [] []"
   2.158 +lemma [quot_respect]: "(list_all2 op \<approx> OOO op \<approx>) [] []"
   2.159    by (fact compose_list_refl)
   2.160  
   2.161  lemma [quot_preserve]: "(abs_fset \<circ> map f) [] = abs_fset []"
   2.162    by simp
   2.163  
   2.164  lemma [quot_respect]:
   2.165 -  "(op \<approx> ===> list_rel op \<approx> OOO op \<approx> ===> list_rel op \<approx> OOO op \<approx>) op # op #"
   2.166 +  "(op \<approx> ===> list_all2 op \<approx> OOO op \<approx> ===> list_all2 op \<approx> OOO op \<approx>) op # op #"
   2.167    apply auto
   2.168    apply (simp add: set_in_eq)
   2.169    apply (rule_tac b="x # b" in pred_compI)
   2.170 @@ -607,59 +607,59 @@
   2.171    by (simp add: expand_fun_eq Quotient_abs_rep[OF Quotient_fset]
   2.172        abs_o_rep[OF Quotient_fset] map_id sup_fset_def)
   2.173  
   2.174 -lemma list_rel_app_l:
   2.175 +lemma list_all2_app_l:
   2.176    assumes a: "reflp R"
   2.177 -  and b: "list_rel R l r"
   2.178 -  shows "list_rel R (z @ l) (z @ r)"
   2.179 +  and b: "list_all2 R l r"
   2.180 +  shows "list_all2 R (z @ l) (z @ r)"
   2.181    by (induct z) (simp_all add: b rev_iffD1[OF a meta_eq_to_obj_eq[OF reflp_def]])
   2.182  
   2.183  lemma append_rsp2_pre0:
   2.184 -  assumes a:"list_rel op \<approx> x x'"
   2.185 -  shows "list_rel op \<approx> (x @ z) (x' @ z)"
   2.186 +  assumes a:"list_all2 op \<approx> x x'"
   2.187 +  shows "list_all2 op \<approx> (x @ z) (x' @ z)"
   2.188    using a apply (induct x x' rule: list_induct2')
   2.189 -  by simp_all (rule list_rel_refl)
   2.190 +  by simp_all (rule list_all2_refl)
   2.191  
   2.192  lemma append_rsp2_pre1:
   2.193 -  assumes a:"list_rel op \<approx> x x'"
   2.194 -  shows "list_rel op \<approx> (z @ x) (z @ x')"
   2.195 +  assumes a:"list_all2 op \<approx> x x'"
   2.196 +  shows "list_all2 op \<approx> (z @ x) (z @ x')"
   2.197    using a apply (induct x x' arbitrary: z rule: list_induct2')
   2.198 -  apply (rule list_rel_refl)
   2.199 +  apply (rule list_all2_refl)
   2.200    apply (simp_all del: list_eq.simps)
   2.201 -  apply (rule list_rel_app_l)
   2.202 +  apply (rule list_all2_app_l)
   2.203    apply (simp_all add: reflp_def)
   2.204    done
   2.205  
   2.206  lemma append_rsp2_pre:
   2.207 -  assumes a:"list_rel op \<approx> x x'"
   2.208 -  and     b: "list_rel op \<approx> z z'"
   2.209 -  shows "list_rel op \<approx> (x @ z) (x' @ z')"
   2.210 -  apply (rule list_rel_transp[OF fset_equivp])
   2.211 +  assumes a:"list_all2 op \<approx> x x'"
   2.212 +  and     b: "list_all2 op \<approx> z z'"
   2.213 +  shows "list_all2 op \<approx> (x @ z) (x' @ z')"
   2.214 +  apply (rule list_all2_transp[OF fset_equivp])
   2.215    apply (rule append_rsp2_pre0)
   2.216    apply (rule a)
   2.217    using b apply (induct z z' rule: list_induct2')
   2.218    apply (simp_all only: append_Nil2)
   2.219 -  apply (rule list_rel_refl)
   2.220 +  apply (rule list_all2_refl)
   2.221    apply simp_all
   2.222    apply (rule append_rsp2_pre1)
   2.223    apply simp
   2.224    done
   2.225  
   2.226  lemma [quot_respect]:
   2.227 -  "(list_rel op \<approx> OOO op \<approx> ===> list_rel op \<approx> OOO op \<approx> ===> list_rel op \<approx> OOO op \<approx>) op @ op @"
   2.228 +  "(list_all2 op \<approx> OOO op \<approx> ===> list_all2 op \<approx> OOO op \<approx> ===> list_all2 op \<approx> OOO op \<approx>) op @ op @"
   2.229  proof (intro fun_relI, elim pred_compE)
   2.230    fix x y z w x' z' y' w' :: "'a list list"
   2.231 -  assume a:"list_rel op \<approx> x x'"
   2.232 +  assume a:"list_all2 op \<approx> x x'"
   2.233    and b:    "x' \<approx> y'"
   2.234 -  and c:    "list_rel op \<approx> y' y"
   2.235 -  assume aa: "list_rel op \<approx> z z'"
   2.236 +  and c:    "list_all2 op \<approx> y' y"
   2.237 +  assume aa: "list_all2 op \<approx> z z'"
   2.238    and bb:   "z' \<approx> w'"
   2.239 -  and cc:   "list_rel op \<approx> w' w"
   2.240 -  have a': "list_rel op \<approx> (x @ z) (x' @ z')" using a aa append_rsp2_pre by auto
   2.241 +  and cc:   "list_all2 op \<approx> w' w"
   2.242 +  have a': "list_all2 op \<approx> (x @ z) (x' @ z')" using a aa append_rsp2_pre by auto
   2.243    have b': "x' @ z' \<approx> y' @ w'" using b bb by simp
   2.244 -  have c': "list_rel op \<approx> (y' @ w') (y @ w)" using c cc append_rsp2_pre by auto
   2.245 -  have d': "(op \<approx> OO list_rel op \<approx>) (x' @ z') (y @ w)"
   2.246 +  have c': "list_all2 op \<approx> (y' @ w') (y @ w)" using c cc append_rsp2_pre by auto
   2.247 +  have d': "(op \<approx> OO list_all2 op \<approx>) (x' @ z') (y @ w)"
   2.248      by (rule pred_compI) (rule b', rule c')
   2.249 -  show "(list_rel op \<approx> OOO op \<approx>) (x @ z) (y @ w)"
   2.250 +  show "(list_all2 op \<approx> OOO op \<approx>) (x @ z) (y @ w)"
   2.251      by (rule pred_compI) (rule a', rule d')
   2.252  qed
   2.253