src/HOL/Prod.ML
changeset 1465 5d7a7e439cec
parent 1454 d0266c81a85e
child 1485 240cc98b94a7
equal deleted inserted replaced
1464:a608f83e3421 1465:5d7a7e439cec
     1 (*  Title: 	HOL/prod
     1 (*  Title:      HOL/prod
     2     ID:         $Id$
     2     ID:         $Id$
     3     Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1991  University of Cambridge
     4     Copyright   1991  University of Cambridge
     5 
     5 
     6 For prod.thy.  Ordered Pairs, the Cartesian product type, the unit type
     6 For prod.thy.  Ordered Pairs, the Cartesian product type, the unit type
     7 *)
     7 *)
     8 
     8 
    14 qed "ProdI";
    14 qed "ProdI";
    15 
    15 
    16 val [major] = goalw Prod.thy [Pair_Rep_def]
    16 val [major] = goalw Prod.thy [Pair_Rep_def]
    17     "Pair_Rep a b = Pair_Rep a' b' ==> a=a' & b=b'";
    17     "Pair_Rep a b = Pair_Rep a' b' ==> a=a' & b=b'";
    18 by (EVERY1 [rtac (major RS fun_cong RS fun_cong RS subst), 
    18 by (EVERY1 [rtac (major RS fun_cong RS fun_cong RS subst), 
    19 	    rtac conjI, rtac refl, rtac refl]);
    19             rtac conjI, rtac refl, rtac refl]);
    20 qed "Pair_Rep_inject";
    20 qed "Pair_Rep_inject";
    21 
    21 
    22 goal Prod.thy "inj_onto Abs_Prod Prod";
    22 goal Prod.thy "inj_onto Abs_Prod Prod";
    23 by (rtac inj_onto_inverseI 1);
    23 by (rtac inj_onto_inverseI 1);
    24 by (etac Abs_Prod_inverse 1);
    24 by (etac Abs_Prod_inverse 1);
    43 qed "snd_conv";
    43 qed "snd_conv";
    44 
    44 
    45 goalw Prod.thy [Pair_def] "? x y. p = (x,y)";
    45 goalw Prod.thy [Pair_def] "? x y. p = (x,y)";
    46 by (rtac (rewrite_rule [Prod_def] Rep_Prod RS CollectE) 1);
    46 by (rtac (rewrite_rule [Prod_def] Rep_Prod RS CollectE) 1);
    47 by (EVERY1[etac exE, etac exE, rtac exI, rtac exI,
    47 by (EVERY1[etac exE, etac exE, rtac exI, rtac exI,
    48 	   rtac (Rep_Prod_inverse RS sym RS trans),  etac arg_cong]);
    48            rtac (Rep_Prod_inverse RS sym RS trans),  etac arg_cong]);
    49 qed "PairE_lemma";
    49 qed "PairE_lemma";
    50 
    50 
    51 val [prem] = goal Prod.thy "[| !!x y. p = (x,y) ==> Q |] ==> Q";
    51 val [prem] = goal Prod.thy "[| !!x y. p = (x,y) ==> Q |] ==> Q";
    52 by (rtac (PairE_lemma RS exE) 1);
    52 by (rtac (PairE_lemma RS exE) 1);
    53 by (REPEAT (eresolve_tac [prem,exE] 1));
    53 by (REPEAT (eresolve_tac [prem,exE] 1));
   269 qed "unit_eq";
   269 qed "unit_eq";
   270 
   270 
   271 val prod_cs = set_cs addSIs [SigmaI, splitI, splitI2, mem_splitI, mem_splitI2] 
   271 val prod_cs = set_cs addSIs [SigmaI, splitI, splitI2, mem_splitI, mem_splitI2] 
   272                      addIs  [fst_imageI, snd_imageI, prod_fun_imageI]
   272                      addIs  [fst_imageI, snd_imageI, prod_fun_imageI]
   273                      addSEs [SigmaE2, SigmaE, splitE, mem_splitE, 
   273                      addSEs [SigmaE2, SigmaE, splitE, mem_splitE, 
   274 			     fst_imageE, snd_imageE, prod_fun_imageE,
   274                              fst_imageE, snd_imageE, prod_fun_imageE,
   275 			     Pair_inject];
   275                              Pair_inject];