src/HOLCF/IOA/ABP/Lemmas.ML
author paulson
Thu, 19 Feb 2004 18:24:08 +0100
changeset 14401 477380c74c1d
parent 13524 604d0f3622d6
child 14981 e73f8140af78
permissions -rw-r--r--
removal of the legacy ML structure List

(*  Title:      HOLCF/IOA/ABP/Lemmas.ML
    ID:         $Id$
    Author:     Olaf Müller
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
*)

(* Logic *)

goal HOL.thy "(~(A&B)) = ((~A)&B| ~B)";
by (Fast_tac 1);
val and_de_morgan_and_absorbe = result();

goal HOL.thy "(if C then A else B) --> (A|B)";
by (stac split_if 1);
by (Fast_tac 1);
val bool_if_impl_or = result();

(* Sets *)

val set_lemmas =
   map (fn s => prove_goal Set.thy s (fn _ => [Fast_tac 1]))
        ["f(x) : (UN x. {f(x)})",
         "f x y : (UN x y. {f x y})",
         "!!a. (!x. a ~= f(x)) ==> a ~: (UN x. {f(x)})",
         "!!a. (!x y. a ~= f x y) ==> a ~: (UN x y. {f x y})"];

(* 2 Lemmas to add to set_lemmas ... , used also for action handling, 
   namely for Intersections and the empty list (compatibility of IOA!)  *)
goal Set.thy "(UN b.{x. x=f(b)})= (UN b.{f(b)})"; 
 by (rtac set_ext 1);
 by (Fast_tac 1);
val singleton_set =result();

goal HOL.thy "((A|B)=False) = ((~A)&(~B))";
 by (Fast_tac 1);
val de_morgan = result();

(* Lists *)

Goal "hd(l@m) = (if l~=[] then hd(l) else hd(m))";
by (induct_tac "l" 1);
by (Simp_tac 1);
by (Simp_tac 1);
val hd_append =result();

Goal "l ~= [] --> (? x xs. l = (x#xs))";
 by (induct_tac "l" 1);
 by (Simp_tac 1);
 by (Fast_tac 1);
qed"cons_not_nil";