src/HOLCF/IOA/ABP/Lemmas.ML
author mueller
Wed Apr 30 11:24:14 1997 +0200 (1997-04-30)
changeset 3072 a31419014be5
child 3852 e694c660055b
permissions -rw-r--r--
Old ABP files now running under the IOA meta theory based on HOLCF;
mueller@3072
     1
(*  Title:      HOLCF/IOA/ABP/Lemmas.ML
mueller@3072
     2
    ID:         $Id$
mueller@3072
     3
    Author:     Olaf Mueller
mueller@3072
     4
    Copyright   1995  TU Muenchen
mueller@3072
     5
mueller@3072
     6
*)
mueller@3072
     7
mueller@3072
     8
(* Logic *)
mueller@3072
     9
mueller@3072
    10
val prems = goal HOL.thy "(P ==> Q-->R) ==> P&Q --> R";
mueller@3072
    11
  by(fast_tac (!claset addDs prems) 1);
mueller@3072
    12
qed "imp_conj_lemma";
mueller@3072
    13
mueller@3072
    14
goal HOL.thy "(~(A&B)) = ((~A)&B| ~B)";
mueller@3072
    15
by (Fast_tac 1);
mueller@3072
    16
val and_de_morgan_and_absorbe = result();
mueller@3072
    17
mueller@3072
    18
goal HOL.thy "(if C then A else B) --> (A|B)";
mueller@3072
    19
by (rtac (expand_if RS ssubst) 1);
mueller@3072
    20
by (Fast_tac 1);
mueller@3072
    21
val bool_if_impl_or = result();
mueller@3072
    22
mueller@3072
    23
(* Sets *)
mueller@3072
    24
mueller@3072
    25
val set_lemmas =
mueller@3072
    26
   map (fn s => prove_goal Set.thy s (fn _ => [Fast_tac 1]))
mueller@3072
    27
        ["f(x) : (UN x. {f(x)})",
mueller@3072
    28
         "f x y : (UN x y. {f x y})",
mueller@3072
    29
         "!!a. (!x. a ~= f(x)) ==> a ~: (UN x. {f(x)})",
mueller@3072
    30
         "!!a. (!x y. a ~= f x y) ==> a ~: (UN x y. {f x y})"];
mueller@3072
    31
mueller@3072
    32
(* 2 Lemmas to add to set_lemmas ... , used also for action handling, 
mueller@3072
    33
   namely for Intersections and the empty list (compatibility of IOA!)  *)
mueller@3072
    34
goal Set.thy "(UN b.{x.x=f(b)})= (UN b.{f(b)})"; 
mueller@3072
    35
 by (rtac set_ext 1);
mueller@3072
    36
 by (Fast_tac 1);
mueller@3072
    37
val singleton_set =result();
mueller@3072
    38
mueller@3072
    39
goal HOL.thy "((A|B)=False) = ((~A)&(~B))";
mueller@3072
    40
 by (Fast_tac 1);
mueller@3072
    41
val de_morgan = result();
mueller@3072
    42
mueller@3072
    43
(* Lists *)
mueller@3072
    44
mueller@3072
    45
val list_ss = simpset_of "List";
mueller@3072
    46
mueller@3072
    47
goal List.thy "hd(l@m) = (if l~=[] then hd(l) else hd(m))";
mueller@3072
    48
by (List.list.induct_tac "l" 1);
mueller@3072
    49
by (simp_tac list_ss 1);
mueller@3072
    50
by (simp_tac list_ss 1);
mueller@3072
    51
val hd_append =result();
mueller@3072
    52
mueller@3072
    53
goal List.thy "l ~= [] --> (? x xs. l = (x#xs))";
mueller@3072
    54
 by (List.list.induct_tac "l" 1);
mueller@3072
    55
 by (simp_tac list_ss 1);
mueller@3072
    56
 by (Fast_tac 1);
mueller@3072
    57
qed"cons_not_nil";