src/HOLCF/IOA/ABP/Lemmas.ML
author wenzelm
Tue Dec 16 17:58:03 1997 +0100 (1997-12-16)
changeset 4423 a129b817b58a
parent 4098 71e05eb27fb6
child 4833 2e53109d4bc8
permissions -rw-r--r--
expandshort;
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";
wenzelm@4423
    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)";
wenzelm@4423
    19
by (stac expand_if 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!)  *)
wenzelm@3852
    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
wenzelm@4098
    45
val list_ss = simpset_of List.thy;
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";