cleaned up; renamed "Porder.op <<" to "Porder.<<"
authorhuffman
Mon, 10 Oct 2005 03:47:00 +0200
changeset 17810 3bdf516d93d8
parent 17809 195045659c06
child 17811 10ebcd7032c1
cleaned up; renamed "Porder.op <<" to "Porder.<<"
src/HOLCF/Porder.thy
src/HOLCF/domain/library.ML
src/HOLCF/pcpodef_package.ML
--- a/src/HOLCF/Porder.thy	Sun Oct 09 17:06:03 2005 +0200
+++ b/src/HOLCF/Porder.thy	Mon Oct 10 03:47:00 2005 +0200
@@ -1,9 +1,6 @@
 (*  Title:      HOLCF/Porder.thy
     ID:         $Id$
     Author:     Franz Regensburger
-
-Definition of class porder (partial order).
-Conservative extension of theory Porder0 by constant definitions.
 *)
 
 header {* Partial orders *}
@@ -19,104 +16,102 @@
 
 	-- {* characteristic constant @{text "<<"} for po *}
 consts
-  "<<"          :: "['a,'a::sq_ord] => bool"        (infixl 55)
+  "<<"          :: "['a,'a::sq_ord] => bool"        (infixl "<<" 55)
 
 syntax (xsymbols)
-  "op <<"       :: "['a,'a::sq_ord] => bool"        (infixl "\<sqsubseteq>" 55)
+  "<<"       :: "['a,'a::sq_ord] => bool"        (infixl "\<sqsubseteq>" 55)
 
 axclass po < sq_ord
         -- {* class axioms: *}
-refl_less [iff]: "x << x"        
-antisym_less:    "[|x << y; y << x |] ==> x = y"    
-trans_less:      "[|x << y; y << z |] ==> x << z"
+  refl_less [iff]: "x \<sqsubseteq> x"        
+  antisym_less:    "\<lbrakk>x \<sqsubseteq> y; y \<sqsubseteq> x\<rbrakk> \<Longrightarrow> x = y"    
+  trans_less:      "\<lbrakk>x \<sqsubseteq> y; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> x \<sqsubseteq> z"
 
 text {* minimal fixes least element *}
 
-lemma minimal2UU[OF allI] : "!x::'a::po. uu<<x ==> uu=(THE u.!y. u<<y)"
+lemma minimal2UU[OF allI] : "\<forall>x::'a::po. uu \<sqsubseteq> x \<Longrightarrow> uu = (THE u. \<forall>y. u \<sqsubseteq> y)"
 by (blast intro: theI2 antisym_less)
 
 text {* the reverse law of anti-symmetry of @{term "op <<"} *}
 
-lemma antisym_less_inverse: "(x::'a::po)=y ==> x << y & y << x"
-apply blast
-done
+lemma antisym_less_inverse: "(x::'a::po) = y \<Longrightarrow> x \<sqsubseteq> y \<and> y \<sqsubseteq> x"
+by simp
 
-lemma box_less: "[| (a::'a::po) << b; c << a; b << d|] ==> c << d"
+lemma box_less: "\<lbrakk>(a::'a::po) \<sqsubseteq> b; c \<sqsubseteq> a; b \<sqsubseteq> d\<rbrakk> \<Longrightarrow> c \<sqsubseteq> d"
 apply (erule trans_less)
 apply (erule trans_less)
 apply assumption
 done
 
-lemma po_eq_conv: "((x::'a::po)=y) = (x << y & y << x)"
-apply (fast elim!: antisym_less_inverse intro!: antisym_less)
-done
+lemma po_eq_conv: "((x::'a::po) = y) = (x \<sqsubseteq> y \<and> y \<sqsubseteq> x)"
+by (fast elim!: antisym_less_inverse intro!: antisym_less)
+
+lemma rev_trans_less: "\<lbrakk>(y::'a::po) \<sqsubseteq> z; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> x \<sqsubseteq> z"
+by (rule trans_less)
 
 subsection {* Chains and least upper bounds *}
 
 consts  
-        "<|"    ::      "['a set,'a::po] => bool"       (infixl 55)
-        "<<|"   ::      "['a set,'a::po] => bool"       (infixl 55)
-        lub     ::      "'a set => 'a::po"
-        tord ::      "'a::po set => bool"
-        chain ::     "(nat=>'a::po) => bool"
-        max_in_chain :: "[nat,nat=>'a::po]=>bool"
-        finite_chain :: "(nat=>'a::po)=>bool"
+        "<|"    ::      "['a set,'a::po] \<Rightarrow> bool"       (infixl "<|" 55)
+        "<<|"   ::      "['a set,'a::po] \<Rightarrow> bool"       (infixl "<<|" 55)
+        lub     ::      "'a set \<Rightarrow> 'a::po"
+        tord ::      "'a::po set \<Rightarrow> bool"
+        chain ::     "(nat \<Rightarrow> 'a::po) \<Rightarrow> bool"
+        max_in_chain :: "[nat,nat\<Rightarrow>'a::po]\<Rightarrow>bool"
+        finite_chain :: "(nat\<Rightarrow>'a::po)\<Rightarrow>bool"
 
 syntax
-  "@LUB"	:: "('b => 'a) => 'a"	(binder "LUB " 10)
+  "@LUB"	:: "('b \<Rightarrow> 'a) \<Rightarrow> 'a"	(binder "LUB " 10)
 
 translations
   "LUB x. t"	== "lub(range(%x. t))"
 
 syntax (xsymbols)
-  "LUB "	:: "[idts, 'a] => 'a"		("(3\<Squnion>_./ _)"[0,10] 10)
+  "LUB "	:: "[idts, 'a] \<Rightarrow> 'a"		("(3\<Squnion>_./ _)"[0,10] 10)
 
 defs
 
 -- {* class definitions *}
-is_ub_def:       "S  <| x == ! y. y:S --> y<<x"
-is_lub_def:      "S <<| x == S <| x & (!u. S <| u  --> x << u)"
+is_ub_def:       "S <| x \<equiv> \<forall>y. y \<in> S \<longrightarrow> y \<sqsubseteq> x"
+is_lub_def:      "S <<| x \<equiv> S <| x \<and> (\<forall>u. S <| u \<longrightarrow> x \<sqsubseteq> u)"
 
 -- {* Arbitrary chains are total orders *}
-tord_def:     "tord S == !x y. x:S & y:S --> (x<<y | y<<x)"
+tord_def:     "tord S \<equiv> \<forall>x y. x \<in> S \<and> y \<in> S \<longrightarrow> (x \<sqsubseteq> y \<or> y \<sqsubseteq> x)"
 
 -- {* Here we use countable chains and I prefer to code them as functions! *}
-chain_def:        "chain F == !i. F i << F (Suc i)"
+chain_def:        "chain F \<equiv> \<forall>i. F i \<sqsubseteq> F (Suc i)"
 
--- {* finite chains, needed for monotony of continouous functions *}
-max_in_chain_def: "max_in_chain i C == ! j. i <= j --> C(i) = C(j)" 
-finite_chain_def: "finite_chain C == chain(C) & (? i. max_in_chain i C)"
+-- {* finite chains, needed for monotony of continuous functions *}
+max_in_chain_def: "max_in_chain i C \<equiv> \<forall>j. i \<le> j \<longrightarrow> C i = C j" 
+finite_chain_def: "finite_chain C \<equiv> chain(C) \<and> (\<exists>i. max_in_chain i C)"
 
-lub_def:          "lub S == (THE x. S <<| x)"
+lub_def:          "lub S \<equiv> THE x. S <<| x"
 
 text {* lubs are unique *}
 
-lemma unique_lub: 
-        "[| S <<| x ; S <<| y |] ==> x=y"
+lemma unique_lub: "\<lbrakk>S <<| x; S <<| y\<rbrakk> \<Longrightarrow> x = y"
 apply (unfold is_lub_def is_ub_def)
 apply (blast intro: antisym_less)
 done
 
 text {* chains are monotone functions *}
 
-lemma chain_mono [rule_format]: "chain F ==> x<y --> F x<<F y"
+lemma chain_mono [rule_format]: "chain F \<Longrightarrow> x < y \<longrightarrow> F x \<sqsubseteq> F y"
 apply (unfold chain_def)
-apply (induct_tac "y")
-apply auto
-prefer 2 apply (blast intro: trans_less)
-apply (blast elim!: less_SucE)
+apply (induct_tac y)
+apply simp
+apply (blast elim: less_SucE intro: trans_less)
 done
 
-lemma chain_mono3: "[| chain F; x <= y |] ==> F x << F y"
+lemma chain_mono3: "\<lbrakk>chain F; x \<le> y\<rbrakk> \<Longrightarrow> F x \<sqsubseteq> F y"
 apply (drule le_imp_less_or_eq)
 apply (blast intro: chain_mono)
 done
 
 text {* The range of a chain is a totally ordered *}
 
-lemma chain_tord: "chain(F) ==> tord(range(F))"
-apply (unfold tord_def)
-apply safe
+lemma chain_tord: "chain F \<Longrightarrow> tord (range F)"
+apply (unfold tord_def, clarify)
 apply (rule nat_less_cases)
 apply (fast intro: chain_mono)+
 done
@@ -125,54 +120,41 @@
 
 lemmas lub = lub_def [THEN meta_eq_to_obj_eq, standard]
 
-lemma lubI[OF exI]: "EX x. M <<| x ==> M <<| lub(M)"
+lemma lubI: "M <<| x \<Longrightarrow> M <<| lub M"
 apply (unfold lub_def)
-apply (rule theI')
-apply (erule ex_ex1I)
-apply (erule unique_lub)
+apply (rule theI)
 apply assumption
+apply (erule (1) unique_lub)
 done
 
-lemma thelubI: "M <<| l ==> lub(M) = l"
+lemma thelubI: "M <<| l \<Longrightarrow> lub M = l"
 apply (rule unique_lub)
 apply (rule lubI)
 apply assumption
 apply assumption
 done
 
-lemma lub_singleton [simp]: "lub{x} = x"
-apply (simp (no_asm) add: thelubI is_lub_def is_ub_def)
-done
+lemma lub_singleton [simp]: "lub {x} = x"
+by (simp add: thelubI is_lub_def is_ub_def)
 
 text {* access to some definition as inference rule *}
 
-lemma is_lubD1: "S <<| x ==> S <| x"
-apply (unfold is_lub_def)
-apply auto
-done
+lemma is_lubD1: "S <<| x \<Longrightarrow> S <| x"
+by (unfold is_lub_def, simp)
 
-lemma is_lub_lub: "[| S <<| x; S <| u |] ==> x << u"
-apply (unfold is_lub_def)
-apply auto
-done
+lemma is_lub_lub: "\<lbrakk>S <<| x; S <| u\<rbrakk> \<Longrightarrow> x \<sqsubseteq> u"
+by (unfold is_lub_def, simp)
 
-lemma is_lubI:
-        "[| S <| x; !!u. S <| u ==> x << u |] ==> S <<| x"
-apply (unfold is_lub_def)
-apply blast
-done
+lemma is_lubI: "\<lbrakk>S <| x; \<And>u. S <| u \<Longrightarrow> x \<sqsubseteq> u\<rbrakk> \<Longrightarrow> S <<| x"
+by (unfold is_lub_def, fast)
 
-lemma chainE: "chain F ==> F(i) << F(Suc(i))"
-apply (unfold chain_def)
-apply auto
-done
+lemma chainE: "chain F \<Longrightarrow> F i \<sqsubseteq> F (Suc i)"
+by (unfold chain_def, simp)
 
-lemma chainI: "(!!i. F i << F(Suc i)) ==> chain F"
-apply (unfold chain_def)
-apply blast
-done
+lemma chainI: "(\<And>i. F i \<sqsubseteq> F (Suc i)) \<Longrightarrow> chain F"
+by (unfold chain_def, simp)
 
-lemma chain_shift: "chain Y ==> chain (%i. Y (i + j))"
+lemma chain_shift: "chain Y \<Longrightarrow> chain (\<lambda>i. Y (i + j))"
 apply (rule chainI)
 apply simp
 apply (erule chainE)
@@ -180,18 +162,14 @@
 
 text {* technical lemmas about (least) upper bounds of chains *}
 
-lemma ub_rangeD: "range S <| x  ==> S(i) << x"
-apply (unfold is_ub_def)
-apply blast
-done
+lemma ub_rangeD: "range S <| x \<Longrightarrow> S i \<sqsubseteq> x"
+by (unfold is_ub_def, simp)
 
-lemma ub_rangeI: "(!!i. S i << x) ==> range S <| x"
-apply (unfold is_ub_def)
-apply blast
-done
+lemma ub_rangeI: "(\<And>i. S i \<sqsubseteq> x) \<Longrightarrow> range S <| x"
+by (unfold is_ub_def, fast)
 
-lemmas is_ub_lub = is_lubD1 [THEN ub_rangeD, standard]
-  -- {* @{thm is_ub_lub} *} (* range(?S1) <<| ?x1 ==> ?S1(?x) << ?x1 *)
+lemma is_ub_lub: "range S <<| x \<Longrightarrow> S i \<sqsubseteq> x"
+by (rule is_lubD1 [THEN ub_rangeD])
 
 lemma is_ub_range_shift:
   "chain S \<Longrightarrow> range (\<lambda>i. S (i + j)) <| x = range S <| x"
@@ -211,66 +189,51 @@
 
 text {* results about finite chains *}
 
-lemma lub_finch1: 
-        "[| chain C; max_in_chain i C|] ==> range C <<| C i"
+lemma lub_finch1: "\<lbrakk>chain C; max_in_chain i C\<rbrakk> \<Longrightarrow> range C <<| C i"
 apply (unfold max_in_chain_def)
 apply (rule is_lubI)
-apply (rule ub_rangeI)
-apply (rule_tac m = "i" in nat_less_cases)
-apply (rule antisym_less_inverse [THEN conjunct2])
-apply (erule disjI1 [THEN less_or_eq_imp_le, THEN rev_mp])
-apply (erule spec)
-apply (rule antisym_less_inverse [THEN conjunct2])
-apply (erule disjI2 [THEN less_or_eq_imp_le, THEN rev_mp])
-apply (erule spec)
-apply (erule chain_mono)
-apply assumption
+apply (rule ub_rangeI, rename_tac j)
+apply (rule_tac x=i and y=j in linorder_le_cases)
+apply simp
+apply (erule (1) chain_mono3)
 apply (erule ub_rangeD)
 done
 
 lemma lub_finch2: 
-        "finite_chain(C) ==> range(C) <<| C(LEAST i. max_in_chain i C)"
+        "finite_chain C \<Longrightarrow> range C <<| C (LEAST i. max_in_chain i C)"
 apply (unfold finite_chain_def)
-apply (rule lub_finch1)
-prefer 2 apply (best intro: LeastI)
-apply blast
-done
-
-lemma bin_chain: "x<<y ==> chain (%i. if i=0 then x else y)"
-apply (rule chainI)
-apply (induct_tac "i")
-apply auto
+apply (erule conjE)
+apply (erule LeastI2_ex)
+apply (erule (1) lub_finch1)
 done
 
-lemma bin_chainmax: 
-        "x<<y ==> max_in_chain (Suc 0) (%i. if (i=0) then x else y)"
-apply (unfold max_in_chain_def le_def)
-apply (rule allI)
-apply (induct_tac "j")
-apply auto
-done
+lemma bin_chain: "x \<sqsubseteq> y \<Longrightarrow> chain (\<lambda>i. if i=0 then x else y)"
+by (rule chainI, simp)
+
+lemma bin_chainmax:
+  "x \<sqsubseteq> y \<Longrightarrow> max_in_chain (Suc 0) (\<lambda>i. if i=0 then x else y)"
+by (unfold max_in_chain_def, simp)
 
-lemma lub_bin_chain: "x << y ==> range(%i::nat. if (i=0) then x else y) <<| y"
-apply (rule_tac s = "if (Suc 0) = 0 then x else y" in subst , rule_tac [2] lub_finch1)
-apply (erule_tac [2] bin_chain)
-apply (erule_tac [2] bin_chainmax)
-apply (simp (no_asm))
+lemma lub_bin_chain:
+  "x \<sqsubseteq> y \<Longrightarrow> range (\<lambda>i::nat. if i=0 then x else y) <<| y"
+apply (frule bin_chain)
+apply (drule bin_chainmax)
+apply (drule (1) lub_finch1)
+apply simp
 done
 
 text {* the maximal element in a chain is its lub *}
 
-lemma lub_chain_maxelem: "[| Y i = c;  ALL i. Y i<<c |] ==> lub(range Y) = c"
-apply (blast dest: ub_rangeD intro: thelubI is_lubI ub_rangeI)
-done
+lemma lub_chain_maxelem: "\<lbrakk>Y i = c; \<forall>i. Y i \<sqsubseteq> c\<rbrakk> \<Longrightarrow> lub (range Y) = c"
+by (blast dest: ub_rangeD intro: thelubI is_lubI ub_rangeI)
 
 text {* the lub of a constant chain is the constant *}
 
 lemma chain_const: "chain (\<lambda>i. c)"
 by (simp add: chainI)
 
-lemma lub_const: "range(%x. c) <<| c"
-apply (blast dest: ub_rangeD intro: is_lubI ub_rangeI)
-done
+lemma lub_const: "range (\<lambda>x. c) <<| c"
+by (blast dest: ub_rangeD intro: is_lubI ub_rangeI)
 
 lemmas thelub_const = lub_const [THEN thelubI, standard]
 
--- a/src/HOLCF/domain/library.ML	Sun Oct 09 17:06:03 2005 +0200
+++ b/src/HOLCF/domain/library.ML	Mon Oct 10 03:47:00 2005 +0200
@@ -102,7 +102,7 @@
 
 (* ----- qualified names of HOLCF constants ----- *)
 
-val lessN      = "Porder.op <<"
+val lessN      = "Porder.<<"
 val UU_N       = "Pcpo.UU";
 val admN       = "Adm.adm";
 val Rep_CFunN  = "Cfun.Rep_CFun";
--- a/src/HOLCF/pcpodef_package.ML	Sun Oct 09 17:06:03 2005 +0200
+++ b/src/HOLCF/pcpodef_package.ML	Mon Oct 10 03:47:00 2005 +0200
@@ -87,7 +87,7 @@
 
     val (Rep_name, Abs_name) = getOpt (opt_morphs, ("Rep_" ^ name, "Abs_" ^ name));
     val RepC = Const (full Rep_name, newT --> oldT);
-    fun lessC T = Const ("Porder.op <<", T --> T --> HOLogic.boolT);
+    fun lessC T = Const ("Porder.<<", T --> T --> HOLogic.boolT);
     val less_def = ("less_" ^ name ^ "_def", Logic.mk_equals (lessC newT,
       Abs ("x", newT, Abs ("y", newT, lessC oldT $ (RepC $ Bound 1) $ (RepC $ Bound 0)))));