
diff -r 0b15b83ded4a -r c96e007b512f Quot/QuotProd.thy
--- a/Quot/QuotProd.thy	Tue Jan 26 01:00:35 2010 +0100
+++ b/Quot/QuotProd.thy	Tue Jan 26 01:42:46 2010 +0100
@@ -1,11 +1,16 @@
+(*  Title:      QuotProd.thy
+    Author:     Cezary Kaliszyk and Christian Urban
+*)
 theory QuotProd
 imports QuotMain
 begin
 
+section {* Quotient infrastructure for product type *}
+
 fun
   prod_rel
 where
-  "prod_rel R1 R2 = (\<lambda>(a,b) (c,d). R1 a c \<and> R2 b d)"
+  "prod_rel R1 R2 = (\<lambda>(a, b) (c, d). R1 a c \<and> R2 b d)"
 
 declare [[map * = (prod_fun, prod_rel)]]
 
@@ -14,37 +19,40 @@
   assumes a: "equivp R1"
   assumes b: "equivp R2"
   shows "equivp (prod_rel R1 R2)"
-unfolding equivp_reflp_symp_transp reflp_def symp_def transp_def
-apply(auto simp add: equivp_reflp[OF a] equivp_reflp[OF b])
-apply(simp only: equivp_symp[OF a])
-apply(simp only: equivp_symp[OF b])
-using equivp_transp[OF a] apply blast
-using equivp_transp[OF b] apply blast
-done
+  apply(rule equivpI)
+  unfolding reflp_def symp_def transp_def
+  apply(simp_all add: split_paired_all)
+  apply(blast intro: equivp_reflp[OF a] equivp_reflp[OF b])
+  apply(blast intro: equivp_symp[OF a] equivp_symp[OF b])
+  apply(blast intro: equivp_transp[OF a] equivp_transp[OF b]) 
+  done
 
 lemma prod_quotient[quot_thm]:
   assumes q1: "Quotient R1 Abs1 Rep1"
   assumes q2: "Quotient R2 Abs2 Rep2"
   shows "Quotient (prod_rel R1 R2) (prod_fun Abs1 Abs2) (prod_fun Rep1 Rep2)"
-unfolding Quotient_def
-using q1 q2
-apply (simp add: Quotient_abs_rep Quotient_abs_rep Quotient_rel_rep Quotient_rel_rep)
-using Quotient_rel[OF q1] Quotient_rel[OF q2] 
-by blast
+  unfolding Quotient_def
+  apply(simp add: split_paired_all)
+  apply(simp add: Quotient_abs_rep[OF q1] Quotient_rel_rep[OF q1])
+  apply(simp add: Quotient_abs_rep[OF q2] Quotient_rel_rep[OF q2])
+  using q1 q2
+  unfolding Quotient_def
+  apply(blast)
+  done
 
-lemma pair_rsp[quot_respect]:
+lemma Pair_rsp[quot_respect]:
   assumes q1: "Quotient R1 Abs1 Rep1"
   assumes q2: "Quotient R2 Abs2 Rep2"
   shows "(R1 ===> R2 ===> prod_rel R1 R2) Pair Pair"
 by simp
 
-lemma pair_prs[quot_preserve]:
+lemma Pair_prs[quot_preserve]:
   assumes q1: "Quotient R1 Abs1 Rep1"
   assumes q2: "Quotient R2 Abs2 Rep2"
   shows "(Rep1 ---> Rep2 ---> (prod_fun Abs1 Abs2)) Pair = Pair"
-apply(simp add: expand_fun_eq)
-apply(simp add: Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2])
-done
+  apply(simp add: expand_fun_eq)
+  apply(simp add: Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2])
+  done
 
 lemma fst_rsp[quot_respect]:
   assumes "Quotient R1 Abs1 Rep1"
@@ -56,9 +64,9 @@
   assumes q1: "Quotient R1 Abs1 Rep1"
   assumes q2: "Quotient R2 Abs2 Rep2"
   shows "(prod_fun Rep1 Rep2 ---> Abs1) fst = fst"
-apply(simp add: expand_fun_eq)
-apply(simp add: Quotient_abs_rep[OF q1])
-done
+  apply(simp add: expand_fun_eq)
+  apply(simp add: Quotient_abs_rep[OF q1])
+  done
 
 lemma snd_rsp[quot_respect]:
   assumes "Quotient R1 Abs1 Rep1"
@@ -70,20 +78,18 @@
   assumes q1: "Quotient R1 Abs1 Rep1"
   assumes q2: "Quotient R2 Abs2 Rep2"
   shows "(prod_fun Rep1 Rep2 ---> Abs2) snd = snd"
-apply(simp add: expand_fun_eq)
-apply(simp add: Quotient_abs_rep[OF q2])
-done
+  apply(simp add: expand_fun_eq)
+  apply(simp add: Quotient_abs_rep[OF q2])
+  done
 
 lemma prod_fun_id[id_simps]: 
   shows "prod_fun id id \<equiv> id"
-  by (rule eq_reflection) 
-     (simp add: prod_fun_def)
+  by (rule eq_reflection) (simp add: prod_fun_def)
 
 lemma prod_rel_eq[id_simps]: 
   shows "prod_rel (op =) (op =) \<equiv> (op =)"
   apply (rule eq_reflection)
-  apply (rule ext)+
-  apply auto
+  apply (simp add: expand_fun_eq)
   done
 
 end




