Domain r, Range r replace fst``r, snd``r
authorpaulson
Mon, 02 Nov 1998 15:31:29 +0100
changeset 5788 e3a98a7c0634
parent 5787 4e5c74b7cd9e
child 5789 7d4ac02677a6
Domain r, Range r replace fst``r, snd``r
src/HOL/Induct/LList.ML
src/HOL/Prod.ML
src/HOL/Univ.ML
--- a/src/HOL/Induct/LList.ML	Mon Nov 02 12:36:16 1998 +0100
+++ b/src/HOL/Induct/LList.ML	Mon Nov 02 15:31:29 1998 +0100
@@ -63,16 +63,6 @@
 by (simp_tac (simpset() addsimps [In1_UN1, Scons_UN1_y]) 1);
 qed "CONS_UN1";
 
-(*UNUSED; obsolete?
-goal Prod.thy "split p (%x y. UN z. f x y z) = (UN z. split p (%x y. f x y z))";
-by (Simp_tac 1);
-qed "split_UN1";
-
-goal Sum.thy "sum_case s f (%y. UN z. g y z) = (UN z. sum_case s f (%y. g y z))";
-by (Simp_tac 1);
-qed "sum_case2_UN1";
-*)
-
 val prems = goalw LList.thy [CONS_def]
     "[| M<=M';  N<=N' |] ==> CONS M N <= CONS M' N'";
 by (REPEAT (resolve_tac ([In1_mono,Scons_mono]@prems) 1));
@@ -148,7 +138,7 @@
 end;
 qed "LListD_unfold";
 
-Goal "!M N. (M,N) : LListD(diag(A)) --> ntrunc k M = ntrunc k N";
+Goal "!M N. (M,N) : LListD(diag A) --> ntrunc k M = ntrunc k N";
 by (res_inst_tac [("n", "k")] less_induct 1);
 by (safe_tac ((claset_of Fun.thy) delrules [equalityI]));
 by (etac LListD.elim 1);
@@ -163,16 +153,16 @@
 
 (*The domain of the LListD relation*)
 Goalw (llist.defs @ [NIL_def, CONS_def])
-    "fst``LListD(diag(A)) <= llist(A)";
+    "Domain (LListD(diag A)) <= llist(A)";
 by (rtac gfp_upperbound 1);
 (*avoids unfolding LListD on the rhs*)
-by (res_inst_tac [("P", "%x. fst``x <= ?B")] (LListD_unfold RS ssubst) 1);
+by (res_inst_tac [("P", "%x. Domain x <= ?B")] (LListD_unfold RS ssubst) 1);
 by (Simp_tac 1);
 by (Fast_tac 1);
-qed "fst_image_LListD";
+qed "Domain_LListD";
 
 (*This inclusion justifies the use of coinduction to show M=N*)
-Goal "LListD(diag(A)) <= diag(llist(A))";
+Goal "LListD(diag A) <= diag(llist(A))";
 by (rtac subsetI 1);
 by (res_inst_tac [("p","x")] PairE 1);
 by Safe_tac;
@@ -180,7 +170,7 @@
 by (rtac (LListD_implies_ntrunc_equality RS spec RS spec RS mp RS 
           ntrunc_equality) 1);
 by (assume_tac 1);
-by (etac (fst_imageI RS (fst_image_LListD RS subsetD)) 1);
+by (etac (DomainI RS (Domain_LListD RS subsetD)) 1);
 qed "LListD_subset_diag";
 
 
@@ -216,7 +206,7 @@
 
 
 (*This converse inclusion helps to strengthen LList_equalityI*)
-Goal "diag(llist(A)) <= LListD(diag(A))";
+Goal "diag(llist(A)) <= LListD(diag A)";
 by (rtac subsetI 1);
 by (etac LListD_coinduct 1);
 by (rtac subsetI 1);
@@ -228,7 +218,7 @@
 				       LListD_Fun_CONS_I])));
 qed "diag_subset_LListD";
 
-Goal "LListD(diag(A)) = diag(llist(A))";
+Goal "LListD(diag A) = diag(llist(A))";
 by (REPEAT (resolve_tac [equalityI, LListD_subset_diag, 
                          diag_subset_LListD] 1));
 qed "LListD_eq_diag";
--- a/src/HOL/Prod.ML	Mon Nov 02 12:36:16 1998 +0100
+++ b/src/HOL/Prod.ML	Mon Nov 02 15:31:29 1998 +0100
@@ -301,6 +301,9 @@
 by (blast_tac (claset() addIs [prod_fun]) 1);
 qed "prod_fun_imageE";
 
+AddIs  [prod_fun_imageI];
+AddSEs [prod_fun_imageE];
+
 
 (*** Disjoint union of a family of sets - Sigma ***)
 
@@ -369,41 +372,6 @@
 by (Blast_tac 1);
 qed "UNION_Times_distrib";
 
-(*** Domain of a relation ***)
-
-Goalw [image_def] "(a,b) : r ==> a : fst``r";
-by (rtac CollectI 1);
-by (rtac bexI 1);
-by (rtac (fst_conv RS sym) 1);
-by (assume_tac 1);
-qed "fst_imageI";
-
-val major::prems = Goal
-    "[| a : fst``r;  !!y.[| (a,y) : r |] ==> P |] ==> P"; 
-by (rtac (major RS imageE) 1);
-by (resolve_tac prems 1);
-by (etac ssubst 1);
-by (rtac (surjective_pairing RS subst) 1);
-by (assume_tac 1);
-qed "fst_imageE";
-
-(*** Range of a relation ***)
-
-Goalw [image_def] "(a,b) : r ==> b : snd``r";
-by (rtac CollectI 1);
-by (rtac bexI 1);
-by (rtac (snd_conv RS sym) 1);
-by (assume_tac 1);
-qed "snd_imageI";
-
-val major::prems = Goal "[| a : snd``r;  !!y.[| (y,a) : r |] ==> P |] ==> P"; 
-by (rtac (major RS imageE) 1);
-by (resolve_tac prems 1);
-by (etac ssubst 1);
-by (rtac (surjective_pairing RS subst) 1);
-by (assume_tac 1);
-qed "snd_imageE";
-
 
 (** Exhaustion rule for unit -- a degenerate form of induction **)
 
@@ -413,10 +381,6 @@
 by (rtac (Rep_unit_inverse RS sym) 1);
 qed "unit_eq";
  
-AddIs  [fst_imageI, snd_imageI, prod_fun_imageI];
-AddSEs [fst_imageE, snd_imageE, prod_fun_imageE];
-
-
 (*simplification procedure for unit_eq.
   Cannot use this rule directly -- it loops!*)
 local
--- a/src/HOL/Univ.ML	Mon Nov 02 12:36:16 1998 +0100
+++ b/src/HOL/Univ.ML	Mon Nov 02 15:31:29 1998 +0100
@@ -568,16 +568,16 @@
 
 (*** Domain ***)
 
-Goal "fst `` diag(A) = A";
+Goal "Domain (diag A) = A";
 by Auto_tac;
-qed "fst_image_diag";
+qed "Domain_diag";
 
-Goal "fst `` (r<**>s) = (fst``r) <*> (fst``s)";
+Goal "Domain (r<**>s) = (Domain r) <*> (Domain s)";
 by Auto_tac;
-qed "fst_image_dprod";
+qed "Domain_dprod";
 
-Goal "fst `` (r<++>s) = (fst``r) <+> (fst``s)";
+Goal "Domain (r<++>s) = (Domain r) <+> (Domain s)";
 by Auto_tac;
-qed "fst_image_dsum";
+qed "Domain_dsum";
 
-Addsimps [fst_image_diag, fst_image_dprod, fst_image_dsum];
+Addsimps [Domain_diag, Domain_dprod, Domain_dsum];