simplified HOL bootstrap
authorhaftmann
Fri Jul 20 14:27:56 2007 +0200 (2007-07-20)
changeset 23878bd651ecd4b8a
parent 23877 307f75aaefca
child 23879 4776af8be741
simplified HOL bootstrap
src/HOL/ATP_Linkup.thy
src/HOL/Finite_Set.thy
src/HOL/FixedPoint.thy
src/HOL/Fun.thy
src/HOL/HOL.thy
src/HOL/Lattices.thy
src/HOL/Set.thy
     1.1 --- a/src/HOL/ATP_Linkup.thy	Fri Jul 20 00:01:40 2007 +0200
     1.2 +++ b/src/HOL/ATP_Linkup.thy	Fri Jul 20 14:27:56 2007 +0200
     1.3 @@ -7,7 +7,7 @@
     1.4  header{* The Isabelle-ATP Linkup *}
     1.5  
     1.6  theory ATP_Linkup
     1.7 -imports Map Hilbert_Choice
     1.8 +imports Divides Hilbert_Choice Record
     1.9  uses
    1.10    "Tools/polyhash.ML"
    1.11    "Tools/res_clause.ML"
     2.1 --- a/src/HOL/Finite_Set.thy	Fri Jul 20 00:01:40 2007 +0200
     2.2 +++ b/src/HOL/Finite_Set.thy	Fri Jul 20 14:27:56 2007 +0200
     2.3 @@ -7,7 +7,7 @@
     2.4  header {* Finite sets *}
     2.5  
     2.6  theory Finite_Set
     2.7 -imports Divides Equiv_Relations IntDef
     2.8 +imports IntDef Divides
     2.9  begin
    2.10  
    2.11  subsection {* Definition and basic properties *}
    2.12 @@ -94,6 +94,7 @@
    2.13    qed
    2.14  qed
    2.15  
    2.16 +
    2.17  text{* Finite sets are the images of initial segments of natural numbers: *}
    2.18  
    2.19  lemma finite_imp_nat_seg_image_inj_on:
     3.1 --- a/src/HOL/FixedPoint.thy	Fri Jul 20 00:01:40 2007 +0200
     3.2 +++ b/src/HOL/FixedPoint.thy	Fri Jul 20 14:27:56 2007 +0200
     3.3 @@ -8,298 +8,9 @@
     3.4  header {* Fixed Points and the Knaster-Tarski Theorem*}
     3.5  
     3.6  theory FixedPoint
     3.7 -imports Fun
     3.8 -begin
     3.9 -
    3.10 -subsection {* Complete lattices *}
    3.11 -
    3.12 -class complete_lattice = lattice +
    3.13 -  fixes Inf :: "'a set \<Rightarrow> 'a" ("\<Sqinter>_" [900] 900)
    3.14 -  assumes Inf_lower: "x \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> x"
    3.15 -  assumes Inf_greatest: "(\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x) \<Longrightarrow> z \<sqsubseteq> \<Sqinter>A"
    3.16 +imports Lattices
    3.17  begin
    3.18  
    3.19 -definition
    3.20 -  Sup :: "'a set \<Rightarrow> 'a" ("\<Squnion>_" [900] 900)
    3.21 -where
    3.22 -  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<^loc>\<le> b}"
    3.23 -
    3.24 -lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<^loc>\<le> a}"
    3.25 -  unfolding Sup_def by (auto intro: Inf_greatest Inf_lower)
    3.26 -
    3.27 -lemma Sup_upper: "x \<in> A \<Longrightarrow> x \<^loc>\<le> \<Squnion>A"
    3.28 -  by (auto simp: Sup_def intro: Inf_greatest)
    3.29 -
    3.30 -lemma Sup_least: "(\<And>x. x \<in> A \<Longrightarrow> x \<^loc>\<le> z) \<Longrightarrow> \<Squnion>A \<^loc>\<le> z"
    3.31 -  by (auto simp: Sup_def intro: Inf_lower)
    3.32 -
    3.33 -lemma Inf_Univ: "\<Sqinter>UNIV = \<Squnion>{}"
    3.34 -  unfolding Sup_def by auto
    3.35 -
    3.36 -lemma Sup_Univ: "\<Squnion>UNIV = \<Sqinter>{}"
    3.37 -  unfolding Inf_Sup by auto
    3.38 -
    3.39 -lemma Inf_insert: "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
    3.40 -  apply (rule antisym)
    3.41 -  apply (rule le_infI)
    3.42 -  apply (rule Inf_lower)
    3.43 -  apply simp
    3.44 -  apply (rule Inf_greatest)
    3.45 -  apply (rule Inf_lower)
    3.46 -  apply simp
    3.47 -  apply (rule Inf_greatest)
    3.48 -  apply (erule insertE)
    3.49 -  apply (rule le_infI1)
    3.50 -  apply simp
    3.51 -  apply (rule le_infI2)
    3.52 -  apply (erule Inf_lower)
    3.53 -  done
    3.54 -
    3.55 -lemma Sup_insert: "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
    3.56 -  apply (rule antisym)
    3.57 -  apply (rule Sup_least)
    3.58 -  apply (erule insertE)
    3.59 -  apply (rule le_supI1)
    3.60 -  apply simp
    3.61 -  apply (rule le_supI2)
    3.62 -  apply (erule Sup_upper)
    3.63 -  apply (rule le_supI)
    3.64 -  apply (rule Sup_upper)
    3.65 -  apply simp
    3.66 -  apply (rule Sup_least)
    3.67 -  apply (rule Sup_upper)
    3.68 -  apply simp
    3.69 -  done
    3.70 -
    3.71 -lemma Inf_singleton [simp]:
    3.72 -  "\<Sqinter>{a} = a"
    3.73 -  by (auto intro: antisym Inf_lower Inf_greatest)
    3.74 -
    3.75 -lemma Sup_singleton [simp]:
    3.76 -  "\<Squnion>{a} = a"
    3.77 -  by (auto intro: antisym Sup_upper Sup_least)
    3.78 -
    3.79 -lemma Inf_insert_simp:
    3.80 -  "\<Sqinter>insert a A = (if A = {} then a else a \<sqinter> \<Sqinter>A)"
    3.81 -  by (cases "A = {}") (simp_all, simp add: Inf_insert)
    3.82 -
    3.83 -lemma Sup_insert_simp:
    3.84 -  "\<Squnion>insert a A = (if A = {} then a else a \<squnion> \<Squnion>A)"
    3.85 -  by (cases "A = {}") (simp_all, simp add: Sup_insert)
    3.86 -
    3.87 -lemma Inf_binary:
    3.88 -  "\<Sqinter>{a, b} = a \<sqinter> b"
    3.89 -  by (simp add: Inf_insert_simp)
    3.90 -
    3.91 -lemma Sup_binary:
    3.92 -  "\<Squnion>{a, b} = a \<squnion> b"
    3.93 -  by (simp add: Sup_insert_simp)
    3.94 -
    3.95 -end
    3.96 -
    3.97 -lemmas Sup_def = Sup_def [folded complete_lattice_class.Sup]
    3.98 -lemmas Sup_upper = Sup_upper [folded complete_lattice_class.Sup]
    3.99 -lemmas Sup_least = Sup_least [folded complete_lattice_class.Sup]
   3.100 -
   3.101 -lemmas Sup_insert [code func] = Sup_insert [folded complete_lattice_class.Sup]
   3.102 -lemmas Sup_singleton [simp, code func] = Sup_singleton [folded complete_lattice_class.Sup]
   3.103 -lemmas Sup_insert_simp = Sup_insert_simp [folded complete_lattice_class.Sup]
   3.104 -lemmas Sup_binary = Sup_binary [folded complete_lattice_class.Sup]
   3.105 -
   3.106 -(* FIXME: definition inside class does not work *)
   3.107 -definition
   3.108 -  top :: "'a::complete_lattice"
   3.109 -where
   3.110 -  "top = Inf {}"
   3.111 -
   3.112 -definition
   3.113 -  bot :: "'a::complete_lattice"
   3.114 -where
   3.115 -  "bot = Sup {}"
   3.116 -
   3.117 -lemma top_greatest [simp]: "x \<le> top"
   3.118 -  by (unfold top_def, rule Inf_greatest, simp)
   3.119 -
   3.120 -lemma bot_least [simp]: "bot \<le> x"
   3.121 -  by (unfold bot_def, rule Sup_least, simp)
   3.122 -
   3.123 -definition
   3.124 -  SUPR :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::complete_lattice) \<Rightarrow> 'b" where
   3.125 -  "SUPR A f == Sup (f ` A)"
   3.126 -
   3.127 -definition
   3.128 -  INFI :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::complete_lattice) \<Rightarrow> 'b" where
   3.129 -  "INFI A f == Inf (f ` A)"
   3.130 -
   3.131 -syntax
   3.132 -  "_SUP1"     :: "pttrns => 'b => 'b"           ("(3SUP _./ _)" [0, 10] 10)
   3.133 -  "_SUP"      :: "pttrn => 'a set => 'b => 'b"  ("(3SUP _:_./ _)" [0, 10] 10)
   3.134 -  "_INF1"     :: "pttrns => 'b => 'b"           ("(3INF _./ _)" [0, 10] 10)
   3.135 -  "_INF"      :: "pttrn => 'a set => 'b => 'b"  ("(3INF _:_./ _)" [0, 10] 10)
   3.136 -
   3.137 -translations
   3.138 -  "SUP x y. B"   == "SUP x. SUP y. B"
   3.139 -  "SUP x. B"     == "CONST SUPR UNIV (%x. B)"
   3.140 -  "SUP x. B"     == "SUP x:UNIV. B"
   3.141 -  "SUP x:A. B"   == "CONST SUPR A (%x. B)"
   3.142 -  "INF x y. B"   == "INF x. INF y. B"
   3.143 -  "INF x. B"     == "CONST INFI UNIV (%x. B)"
   3.144 -  "INF x. B"     == "INF x:UNIV. B"
   3.145 -  "INF x:A. B"   == "CONST INFI A (%x. B)"
   3.146 -
   3.147 -(* To avoid eta-contraction of body: *)
   3.148 -print_translation {*
   3.149 -let
   3.150 -  fun btr' syn (A :: Abs abs :: ts) =
   3.151 -    let val (x,t) = atomic_abs_tr' abs
   3.152 -    in list_comb (Syntax.const syn $ x $ A $ t, ts) end
   3.153 -  val const_syntax_name = Sign.const_syntax_name @{theory} o fst o dest_Const
   3.154 -in
   3.155 -[(const_syntax_name @{term SUPR}, btr' "_SUP"),(const_syntax_name @{term "INFI"}, btr' "_INF")]
   3.156 -end
   3.157 -*}
   3.158 -
   3.159 -lemma le_SUPI: "i : A \<Longrightarrow> M i \<le> (SUP i:A. M i)"
   3.160 -  by (auto simp add: SUPR_def intro: Sup_upper)
   3.161 -
   3.162 -lemma SUP_leI: "(\<And>i. i : A \<Longrightarrow> M i \<le> u) \<Longrightarrow> (SUP i:A. M i) \<le> u"
   3.163 -  by (auto simp add: SUPR_def intro: Sup_least)
   3.164 -
   3.165 -lemma INF_leI: "i : A \<Longrightarrow> (INF i:A. M i) \<le> M i"
   3.166 -  by (auto simp add: INFI_def intro: Inf_lower)
   3.167 -
   3.168 -lemma le_INFI: "(\<And>i. i : A \<Longrightarrow> u \<le> M i) \<Longrightarrow> u \<le> (INF i:A. M i)"
   3.169 -  by (auto simp add: INFI_def intro: Inf_greatest)
   3.170 -
   3.171 -lemma mono_inf: "mono f \<Longrightarrow> f (inf A B) <= inf (f A) (f B)"
   3.172 -  by (auto simp add: mono_def)
   3.173 -
   3.174 -lemma mono_sup: "mono f \<Longrightarrow> sup (f A) (f B) <= f (sup A B)"
   3.175 -  by (auto simp add: mono_def)
   3.176 -
   3.177 -lemma SUP_const[simp]: "A \<noteq> {} \<Longrightarrow> (SUP i:A. M) = M"
   3.178 -  by (auto intro: order_antisym SUP_leI le_SUPI)
   3.179 -
   3.180 -lemma INF_const[simp]: "A \<noteq> {} \<Longrightarrow> (INF i:A. M) = M"
   3.181 -  by (auto intro: order_antisym INF_leI le_INFI)
   3.182 -
   3.183 -
   3.184 -subsection {* Some instances of the type class of complete lattices *}
   3.185 -
   3.186 -subsubsection {* Booleans *}
   3.187 -
   3.188 -instance bool :: complete_lattice
   3.189 -  Inf_bool_def: "Inf A \<equiv> \<forall>x\<in>A. x"
   3.190 -  apply intro_classes
   3.191 -  apply (unfold Inf_bool_def)
   3.192 -  apply (iprover intro!: le_boolI elim: ballE)
   3.193 -  apply (iprover intro!: ballI le_boolI elim: ballE le_boolE)
   3.194 -  done
   3.195 -
   3.196 -theorem Sup_bool_eq: "Sup A \<longleftrightarrow> (\<exists>x\<in>A. x)"
   3.197 -  apply (rule order_antisym)
   3.198 -  apply (rule Sup_least)
   3.199 -  apply (rule le_boolI)
   3.200 -  apply (erule bexI, assumption)
   3.201 -  apply (rule le_boolI)
   3.202 -  apply (erule bexE)
   3.203 -  apply (rule le_boolE)
   3.204 -  apply (rule Sup_upper)
   3.205 -  apply assumption+
   3.206 -  done
   3.207 -
   3.208 -lemma Inf_empty_bool [simp]:
   3.209 -  "Inf {}"
   3.210 -  unfolding Inf_bool_def by auto
   3.211 -
   3.212 -lemma not_Sup_empty_bool [simp]:
   3.213 -  "\<not> Sup {}"
   3.214 -  unfolding Sup_def Inf_bool_def by auto
   3.215 -
   3.216 -lemma top_bool_eq: "top = True"
   3.217 -  by (iprover intro!: order_antisym le_boolI top_greatest)
   3.218 -
   3.219 -lemma bot_bool_eq: "bot = False"
   3.220 -  by (iprover intro!: order_antisym le_boolI bot_least)
   3.221 -
   3.222 -
   3.223 -subsubsection {* Functions *}
   3.224 -
   3.225 -instance "fun" :: (type, complete_lattice) complete_lattice
   3.226 -  Inf_fun_def: "Inf A \<equiv> (\<lambda>x. Inf {y. \<exists>f\<in>A. y = f x})"
   3.227 -  apply intro_classes
   3.228 -  apply (unfold Inf_fun_def)
   3.229 -  apply (rule le_funI)
   3.230 -  apply (rule Inf_lower)
   3.231 -  apply (rule CollectI)
   3.232 -  apply (rule bexI)
   3.233 -  apply (rule refl)
   3.234 -  apply assumption
   3.235 -  apply (rule le_funI)
   3.236 -  apply (rule Inf_greatest)
   3.237 -  apply (erule CollectE)
   3.238 -  apply (erule bexE)
   3.239 -  apply (iprover elim: le_funE)
   3.240 -  done
   3.241 -
   3.242 -lemmas [code func del] = Inf_fun_def
   3.243 -
   3.244 -theorem Sup_fun_eq: "Sup A = (\<lambda>x. Sup {y. \<exists>f\<in>A. y = f x})"
   3.245 -  apply (rule order_antisym)
   3.246 -  apply (rule Sup_least)
   3.247 -  apply (rule le_funI)
   3.248 -  apply (rule Sup_upper)
   3.249 -  apply fast
   3.250 -  apply (rule le_funI)
   3.251 -  apply (rule Sup_least)
   3.252 -  apply (erule CollectE)
   3.253 -  apply (erule bexE)
   3.254 -  apply (drule le_funD [OF Sup_upper])
   3.255 -  apply simp
   3.256 -  done
   3.257 -
   3.258 -lemma Inf_empty_fun:
   3.259 -  "Inf {} = (\<lambda>_. Inf {})"
   3.260 -  by rule (auto simp add: Inf_fun_def)
   3.261 -
   3.262 -lemma Sup_empty_fun:
   3.263 -  "Sup {} = (\<lambda>_. Sup {})"
   3.264 -proof -
   3.265 -  have aux: "\<And>x. {y. \<exists>f. y = f x} = UNIV" by auto
   3.266 -  show ?thesis
   3.267 -  by (auto simp add: Sup_def Inf_fun_def Inf_binary inf_bool_eq aux)
   3.268 -qed
   3.269 -
   3.270 -lemma top_fun_eq: "top = (\<lambda>x. top)"
   3.271 -  by (iprover intro!: order_antisym le_funI top_greatest)
   3.272 -
   3.273 -lemma bot_fun_eq: "bot = (\<lambda>x. bot)"
   3.274 -  by (iprover intro!: order_antisym le_funI bot_least)
   3.275 -
   3.276 -
   3.277 -subsubsection {* Sets *}
   3.278 -
   3.279 -instance set :: (type) complete_lattice
   3.280 -  Inf_set_def: "Inf S \<equiv> \<Inter>S"
   3.281 -  by intro_classes (auto simp add: Inf_set_def)
   3.282 -
   3.283 -lemmas [code func del] = Inf_set_def
   3.284 -
   3.285 -theorem Sup_set_eq: "Sup S = \<Union>S"
   3.286 -  apply (rule subset_antisym)
   3.287 -  apply (rule Sup_least)
   3.288 -  apply (erule Union_upper)
   3.289 -  apply (rule Union_least)
   3.290 -  apply (erule Sup_upper)
   3.291 -  done
   3.292 -
   3.293 -lemma top_set_eq: "top = UNIV"
   3.294 -  by (iprover intro!: subset_antisym subset_UNIV top_greatest)
   3.295 -
   3.296 -lemma bot_set_eq: "bot = {}"
   3.297 -  by (iprover intro!: subset_antisym empty_subsetI bot_least)
   3.298 -
   3.299 -
   3.300  subsection {* Least and greatest fixed points *}
   3.301  
   3.302  definition
     4.1 --- a/src/HOL/Fun.thy	Fri Jul 20 00:01:40 2007 +0200
     4.2 +++ b/src/HOL/Fun.thy	Fri Jul 20 14:27:56 2007 +0200
     4.3 @@ -460,87 +460,6 @@
     4.4  by (simp add: bij_def)
     4.5  
     4.6  
     4.7 -subsection {* Order and lattice on functions *}
     4.8 -
     4.9 -instance "fun" :: (type, ord) ord
    4.10 -  le_fun_def: "f \<le> g \<equiv> \<forall>x. f x \<le> g x"
    4.11 -  less_fun_def: "f < g \<equiv> f \<le> g \<and> f \<noteq> g" ..
    4.12 -
    4.13 -lemmas [code func del] = le_fun_def less_fun_def
    4.14 -
    4.15 -instance "fun" :: (type, order) order
    4.16 -  by default
    4.17 -    (auto simp add: le_fun_def less_fun_def expand_fun_eq
    4.18 -       intro: order_trans order_antisym)
    4.19 -
    4.20 -lemma le_funI: "(\<And>x. f x \<le> g x) \<Longrightarrow> f \<le> g"
    4.21 -  unfolding le_fun_def by simp
    4.22 -
    4.23 -lemma le_funE: "f \<le> g \<Longrightarrow> (f x \<le> g x \<Longrightarrow> P) \<Longrightarrow> P"
    4.24 -  unfolding le_fun_def by simp
    4.25 -
    4.26 -lemma le_funD: "f \<le> g \<Longrightarrow> f x \<le> g x"
    4.27 -  unfolding le_fun_def by simp
    4.28 -
    4.29 -text {*
    4.30 -  Handy introduction and elimination rules for @{text "\<le>"}
    4.31 -  on unary and binary predicates
    4.32 -*}
    4.33 -
    4.34 -lemma predicate1I [Pure.intro!, intro!]:
    4.35 -  assumes PQ: "\<And>x. P x \<Longrightarrow> Q x"
    4.36 -  shows "P \<le> Q"
    4.37 -  apply (rule le_funI)
    4.38 -  apply (rule le_boolI)
    4.39 -  apply (rule PQ)
    4.40 -  apply assumption
    4.41 -  done
    4.42 -
    4.43 -lemma predicate1D [Pure.dest, dest]: "P \<le> Q \<Longrightarrow> P x \<Longrightarrow> Q x"
    4.44 -  apply (erule le_funE)
    4.45 -  apply (erule le_boolE)
    4.46 -  apply assumption+
    4.47 -  done
    4.48 -
    4.49 -lemma predicate2I [Pure.intro!, intro!]:
    4.50 -  assumes PQ: "\<And>x y. P x y \<Longrightarrow> Q x y"
    4.51 -  shows "P \<le> Q"
    4.52 -  apply (rule le_funI)+
    4.53 -  apply (rule le_boolI)
    4.54 -  apply (rule PQ)
    4.55 -  apply assumption
    4.56 -  done
    4.57 -
    4.58 -lemma predicate2D [Pure.dest, dest]: "P \<le> Q \<Longrightarrow> P x y \<Longrightarrow> Q x y"
    4.59 -  apply (erule le_funE)+
    4.60 -  apply (erule le_boolE)
    4.61 -  apply assumption+
    4.62 -  done
    4.63 -
    4.64 -lemma rev_predicate1D: "P x ==> P <= Q ==> Q x"
    4.65 -  by (rule predicate1D)
    4.66 -
    4.67 -lemma rev_predicate2D: "P x y ==> P <= Q ==> Q x y"
    4.68 -  by (rule predicate2D)
    4.69 -
    4.70 -instance "fun" :: (type, lattice) lattice
    4.71 -  inf_fun_eq: "inf f g \<equiv> (\<lambda>x. inf (f x) (g x))"
    4.72 -  sup_fun_eq: "sup f g \<equiv> (\<lambda>x. sup (f x) (g x))"
    4.73 -apply intro_classes
    4.74 -unfolding inf_fun_eq sup_fun_eq
    4.75 -apply (auto intro: le_funI)
    4.76 -apply (rule le_funI)
    4.77 -apply (auto dest: le_funD)
    4.78 -apply (rule le_funI)
    4.79 -apply (auto dest: le_funD)
    4.80 -done
    4.81 -
    4.82 -lemmas [code func del] = inf_fun_eq sup_fun_eq
    4.83 -
    4.84 -instance "fun" :: (type, distrib_lattice) distrib_lattice
    4.85 -  by default (auto simp add: inf_fun_eq sup_fun_eq sup_inf_distrib1)
    4.86 -
    4.87 -
    4.88  subsection {* Proof tool setup *} 
    4.89  
    4.90  text {* simplifies terms of the form
    4.91 @@ -600,8 +519,6 @@
    4.92  val datatype_injI = @{thm datatype_injI}
    4.93  val range_ex1_eq = @{thm range_ex1_eq}
    4.94  val expand_fun_eq = @{thm expand_fun_eq}
    4.95 -val sup_fun_eq = @{thm sup_fun_eq}
    4.96 -val sup_bool_eq = @{thm sup_bool_eq}
    4.97  *}
    4.98  
    4.99  end
     5.1 --- a/src/HOL/HOL.thy	Fri Jul 20 00:01:40 2007 +0200
     5.2 +++ b/src/HOL/HOL.thy	Fri Jul 20 14:27:56 2007 +0200
     5.3 @@ -218,7 +218,6 @@
     5.4  class minus = type +
     5.5    fixes uminus :: "'a \<Rightarrow> 'a" 
     5.6      and minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>-" 65)
     5.7 -    and abs :: "'a \<Rightarrow> 'a"
     5.8  
     5.9  class times = type +
    5.10    fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>*" 70)
    5.11 @@ -227,6 +226,9 @@
    5.12    fixes inverse :: "'a \<Rightarrow> 'a"
    5.13      and divide :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "\<^loc>'/" 70)
    5.14  
    5.15 +class abs = type +
    5.16 +  fixes abs :: "'a \<Rightarrow> 'a"
    5.17 +
    5.18  notation
    5.19    uminus  ("- _" [81] 80)
    5.20  
    5.21 @@ -235,6 +237,70 @@
    5.22  notation (HTML output)
    5.23    abs  ("\<bar>_\<bar>")
    5.24  
    5.25 +class ord = type +
    5.26 +  fixes less_eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool"  (infix "\<sqsubseteq>" 50)
    5.27 +    and less :: "'a \<Rightarrow> 'a \<Rightarrow> bool"  (infix "\<sqsubset>" 50)
    5.28 +begin
    5.29 +
    5.30 +notation
    5.31 +  less_eq  ("op \<^loc><=") and
    5.32 +  less_eq  ("(_/ \<^loc><= _)" [51, 51] 50) and
    5.33 +  less  ("op \<^loc><") and
    5.34 +  less  ("(_/ \<^loc>< _)"  [51, 51] 50)
    5.35 +  
    5.36 +notation (xsymbols)
    5.37 +  less_eq  ("op \<^loc>\<le>") and
    5.38 +  less_eq  ("(_/ \<^loc>\<le> _)"  [51, 51] 50)
    5.39 +
    5.40 +notation (HTML output)
    5.41 +  less_eq  ("op \<^loc>\<le>") and
    5.42 +  less_eq  ("(_/ \<^loc>\<le> _)"  [51, 51] 50)
    5.43 +
    5.44 +abbreviation (input)
    5.45 +  greater  (infix "\<^loc>>" 50) where
    5.46 +  "x \<^loc>> y \<equiv> y \<^loc>< x"
    5.47 +
    5.48 +abbreviation (input)
    5.49 +  greater_eq  (infix "\<^loc>>=" 50) where
    5.50 +  "x \<^loc>>= y \<equiv> y \<^loc><= x"
    5.51 +
    5.52 +notation (input)
    5.53 +  greater_eq  (infix "\<^loc>\<ge>" 50)
    5.54 +
    5.55 +definition
    5.56 +  Least :: "('a \<Rightarrow> bool) \<Rightarrow> 'a" (binder "\<^loc>LEAST " 10)
    5.57 +where
    5.58 +  "Least P == (THE x. P x \<and> (\<forall>y. P y \<longrightarrow> x \<^loc>\<le> y))"
    5.59 +
    5.60 +end
    5.61 +
    5.62 +notation
    5.63 +  less_eq  ("op <=") and
    5.64 +  less_eq  ("(_/ <= _)" [51, 51] 50) and
    5.65 +  less  ("op <") and
    5.66 +  less  ("(_/ < _)"  [51, 51] 50)
    5.67 +  
    5.68 +notation (xsymbols)
    5.69 +  less_eq  ("op \<le>") and
    5.70 +  less_eq  ("(_/ \<le> _)"  [51, 51] 50)
    5.71 +
    5.72 +notation (HTML output)
    5.73 +  less_eq  ("op \<le>") and
    5.74 +  less_eq  ("(_/ \<le> _)"  [51, 51] 50)
    5.75 +
    5.76 +abbreviation (input)
    5.77 +  greater  (infix ">" 50) where
    5.78 +  "x > y \<equiv> y < x"
    5.79 +
    5.80 +abbreviation (input)
    5.81 +  greater_eq  (infix ">=" 50) where
    5.82 +  "x >= y \<equiv> y <= x"
    5.83 +
    5.84 +notation (input)
    5.85 +  greater_eq  (infix "\<ge>" 50)
    5.86 +
    5.87 +lemmas Least_def = Least_def [folded ord_class.Least]
    5.88 +
    5.89  syntax
    5.90    "_index1"  :: index    ("\<^sub>1")
    5.91  translations
     6.1 --- a/src/HOL/Lattices.thy	Fri Jul 20 00:01:40 2007 +0200
     6.2 +++ b/src/HOL/Lattices.thy	Fri Jul 20 14:27:56 2007 +0200
     6.3 @@ -11,12 +11,6 @@
     6.4  
     6.5  subsection{* Lattices *}
     6.6  
     6.7 -text{*
     6.8 -  This theory of lattices only defines binary sup and inf
     6.9 -  operations. The extension to complete lattices is done in theory
    6.10 -  @{text FixedPoint}.
    6.11 -*}
    6.12 -
    6.13  class lower_semilattice = order +
    6.14    fixes inf :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<sqinter>" 70)
    6.15    assumes inf_le1 [simp]: "x \<sqinter> y \<sqsubseteq> x"
    6.16 @@ -70,6 +64,9 @@
    6.17  
    6.18  end
    6.19  
    6.20 +lemma mono_inf: "mono f \<Longrightarrow> f (inf A B) \<le> inf (f A) (f B)"
    6.21 +  by (auto simp add: mono_def)
    6.22 +
    6.23  
    6.24  context upper_semilattice
    6.25  begin
    6.26 @@ -109,6 +106,9 @@
    6.27  
    6.28  end
    6.29  
    6.30 +lemma mono_sup: "mono f \<Longrightarrow> sup (f A) (f B) \<le> f (sup A B)"
    6.31 +  by (auto simp add: mono_def)
    6.32 +
    6.33  
    6.34  subsubsection{* Equational laws *}
    6.35  
    6.36 @@ -323,6 +323,174 @@
    6.37    min_max.le_infI1 min_max.le_infI2
    6.38  
    6.39  
    6.40 +subsection {* Complete lattices *}
    6.41 +
    6.42 +class complete_lattice = lattice +
    6.43 +  fixes Inf :: "'a set \<Rightarrow> 'a" ("\<Sqinter>_" [900] 900)
    6.44 +  assumes Inf_lower: "x \<in> A \<Longrightarrow> \<Sqinter>A \<sqsubseteq> x"
    6.45 +  assumes Inf_greatest: "(\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x) \<Longrightarrow> z \<sqsubseteq> \<Sqinter>A"
    6.46 +begin
    6.47 +
    6.48 +definition
    6.49 +  Sup :: "'a set \<Rightarrow> 'a" ("\<Squnion>_" [900] 900)
    6.50 +where
    6.51 +  "\<Squnion>A = \<Sqinter>{b. \<forall>a \<in> A. a \<^loc>\<le> b}"
    6.52 +
    6.53 +lemma Inf_Sup: "\<Sqinter>A = \<Squnion>{b. \<forall>a \<in> A. b \<^loc>\<le> a}"
    6.54 +  unfolding Sup_def by (auto intro: Inf_greatest Inf_lower)
    6.55 +
    6.56 +lemma Sup_upper: "x \<in> A \<Longrightarrow> x \<^loc>\<le> \<Squnion>A"
    6.57 +  by (auto simp: Sup_def intro: Inf_greatest)
    6.58 +
    6.59 +lemma Sup_least: "(\<And>x. x \<in> A \<Longrightarrow> x \<^loc>\<le> z) \<Longrightarrow> \<Squnion>A \<^loc>\<le> z"
    6.60 +  by (auto simp: Sup_def intro: Inf_lower)
    6.61 +
    6.62 +lemma Inf_Univ: "\<Sqinter>UNIV = \<Squnion>{}"
    6.63 +  unfolding Sup_def by auto
    6.64 +
    6.65 +lemma Sup_Univ: "\<Squnion>UNIV = \<Sqinter>{}"
    6.66 +  unfolding Inf_Sup by auto
    6.67 +
    6.68 +lemma Inf_insert: "\<Sqinter>insert a A = a \<sqinter> \<Sqinter>A"
    6.69 +  apply (rule antisym)
    6.70 +  apply (rule le_infI)
    6.71 +  apply (rule Inf_lower)
    6.72 +  apply simp
    6.73 +  apply (rule Inf_greatest)
    6.74 +  apply (rule Inf_lower)
    6.75 +  apply simp
    6.76 +  apply (rule Inf_greatest)
    6.77 +  apply (erule insertE)
    6.78 +  apply (rule le_infI1)
    6.79 +  apply simp
    6.80 +  apply (rule le_infI2)
    6.81 +  apply (erule Inf_lower)
    6.82 +  done
    6.83 +
    6.84 +lemma Sup_insert: "\<Squnion>insert a A = a \<squnion> \<Squnion>A"
    6.85 +  apply (rule antisym)
    6.86 +  apply (rule Sup_least)
    6.87 +  apply (erule insertE)
    6.88 +  apply (rule le_supI1)
    6.89 +  apply simp
    6.90 +  apply (rule le_supI2)
    6.91 +  apply (erule Sup_upper)
    6.92 +  apply (rule le_supI)
    6.93 +  apply (rule Sup_upper)
    6.94 +  apply simp
    6.95 +  apply (rule Sup_least)
    6.96 +  apply (rule Sup_upper)
    6.97 +  apply simp
    6.98 +  done
    6.99 +
   6.100 +lemma Inf_singleton [simp]:
   6.101 +  "\<Sqinter>{a} = a"
   6.102 +  by (auto intro: antisym Inf_lower Inf_greatest)
   6.103 +
   6.104 +lemma Sup_singleton [simp]:
   6.105 +  "\<Squnion>{a} = a"
   6.106 +  by (auto intro: antisym Sup_upper Sup_least)
   6.107 +
   6.108 +lemma Inf_insert_simp:
   6.109 +  "\<Sqinter>insert a A = (if A = {} then a else a \<sqinter> \<Sqinter>A)"
   6.110 +  by (cases "A = {}") (simp_all, simp add: Inf_insert)
   6.111 +
   6.112 +lemma Sup_insert_simp:
   6.113 +  "\<Squnion>insert a A = (if A = {} then a else a \<squnion> \<Squnion>A)"
   6.114 +  by (cases "A = {}") (simp_all, simp add: Sup_insert)
   6.115 +
   6.116 +lemma Inf_binary:
   6.117 +  "\<Sqinter>{a, b} = a \<sqinter> b"
   6.118 +  by (simp add: Inf_insert_simp)
   6.119 +
   6.120 +lemma Sup_binary:
   6.121 +  "\<Squnion>{a, b} = a \<squnion> b"
   6.122 +  by (simp add: Sup_insert_simp)
   6.123 +
   6.124 +end
   6.125 +
   6.126 +lemmas Sup_def = Sup_def [folded complete_lattice_class.Sup]
   6.127 +lemmas Sup_upper = Sup_upper [folded complete_lattice_class.Sup]
   6.128 +lemmas Sup_least = Sup_least [folded complete_lattice_class.Sup]
   6.129 +
   6.130 +lemmas Sup_insert [code func] = Sup_insert [folded complete_lattice_class.Sup]
   6.131 +lemmas Sup_singleton [simp, code func] = Sup_singleton [folded complete_lattice_class.Sup]
   6.132 +lemmas Sup_insert_simp = Sup_insert_simp [folded complete_lattice_class.Sup]
   6.133 +lemmas Sup_binary = Sup_binary [folded complete_lattice_class.Sup]
   6.134 +
   6.135 +definition
   6.136 +  top :: "'a::complete_lattice"
   6.137 +where
   6.138 +  "top = Inf {}"
   6.139 +
   6.140 +definition
   6.141 +  bot :: "'a::complete_lattice"
   6.142 +where
   6.143 +  "bot = Sup {}"
   6.144 +
   6.145 +lemma top_greatest [simp]: "x \<le> top"
   6.146 +  by (unfold top_def, rule Inf_greatest, simp)
   6.147 +
   6.148 +lemma bot_least [simp]: "bot \<le> x"
   6.149 +  by (unfold bot_def, rule Sup_least, simp)
   6.150 +
   6.151 +definition
   6.152 +  SUPR :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::complete_lattice) \<Rightarrow> 'b"
   6.153 +where
   6.154 +  "SUPR A f == Sup (f ` A)"
   6.155 +
   6.156 +definition
   6.157 +  INFI :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::complete_lattice) \<Rightarrow> 'b"
   6.158 +where
   6.159 +  "INFI A f == Inf (f ` A)"
   6.160 +
   6.161 +syntax
   6.162 +  "_SUP1"     :: "pttrns => 'b => 'b"           ("(3SUP _./ _)" [0, 10] 10)
   6.163 +  "_SUP"      :: "pttrn => 'a set => 'b => 'b"  ("(3SUP _:_./ _)" [0, 10] 10)
   6.164 +  "_INF1"     :: "pttrns => 'b => 'b"           ("(3INF _./ _)" [0, 10] 10)
   6.165 +  "_INF"      :: "pttrn => 'a set => 'b => 'b"  ("(3INF _:_./ _)" [0, 10] 10)
   6.166 +
   6.167 +translations
   6.168 +  "SUP x y. B"   == "SUP x. SUP y. B"
   6.169 +  "SUP x. B"     == "CONST SUPR UNIV (%x. B)"
   6.170 +  "SUP x. B"     == "SUP x:UNIV. B"
   6.171 +  "SUP x:A. B"   == "CONST SUPR A (%x. B)"
   6.172 +  "INF x y. B"   == "INF x. INF y. B"
   6.173 +  "INF x. B"     == "CONST INFI UNIV (%x. B)"
   6.174 +  "INF x. B"     == "INF x:UNIV. B"
   6.175 +  "INF x:A. B"   == "CONST INFI A (%x. B)"
   6.176 +
   6.177 +(* To avoid eta-contraction of body: *)
   6.178 +print_translation {*
   6.179 +let
   6.180 +  fun btr' syn (A :: Abs abs :: ts) =
   6.181 +    let val (x,t) = atomic_abs_tr' abs
   6.182 +    in list_comb (Syntax.const syn $ x $ A $ t, ts) end
   6.183 +  val const_syntax_name = Sign.const_syntax_name @{theory} o fst o dest_Const
   6.184 +in
   6.185 +[(const_syntax_name @{term SUPR}, btr' "_SUP"),(const_syntax_name @{term "INFI"}, btr' "_INF")]
   6.186 +end
   6.187 +*}
   6.188 +
   6.189 +lemma le_SUPI: "i : A \<Longrightarrow> M i \<le> (SUP i:A. M i)"
   6.190 +  by (auto simp add: SUPR_def intro: Sup_upper)
   6.191 +
   6.192 +lemma SUP_leI: "(\<And>i. i : A \<Longrightarrow> M i \<le> u) \<Longrightarrow> (SUP i:A. M i) \<le> u"
   6.193 +  by (auto simp add: SUPR_def intro: Sup_least)
   6.194 +
   6.195 +lemma INF_leI: "i : A \<Longrightarrow> (INF i:A. M i) \<le> M i"
   6.196 +  by (auto simp add: INFI_def intro: Inf_lower)
   6.197 +
   6.198 +lemma le_INFI: "(\<And>i. i : A \<Longrightarrow> u \<le> M i) \<Longrightarrow> u \<le> (INF i:A. M i)"
   6.199 +  by (auto simp add: INFI_def intro: Inf_greatest)
   6.200 +
   6.201 +lemma SUP_const[simp]: "A \<noteq> {} \<Longrightarrow> (SUP i:A. M) = M"
   6.202 +  by (auto intro: order_antisym SUP_leI le_SUPI)
   6.203 +
   6.204 +lemma INF_const[simp]: "A \<noteq> {} \<Longrightarrow> (INF i:A. M) = M"
   6.205 +  by (auto intro: order_antisym INF_leI le_INFI)
   6.206 +
   6.207 +
   6.208  subsection {* Bool as lattice *}
   6.209  
   6.210  instance bool :: distrib_lattice
   6.211 @@ -330,10 +498,156 @@
   6.212    sup_bool_eq: "sup P Q \<equiv> P \<or> Q"
   6.213    by intro_classes (auto simp add: inf_bool_eq sup_bool_eq le_bool_def)
   6.214  
   6.215 +instance bool :: complete_lattice
   6.216 +  Inf_bool_def: "Inf A \<equiv> \<forall>x\<in>A. x"
   6.217 +  apply intro_classes
   6.218 +  apply (unfold Inf_bool_def)
   6.219 +  apply (iprover intro!: le_boolI elim: ballE)
   6.220 +  apply (iprover intro!: ballI le_boolI elim: ballE le_boolE)
   6.221 +  done
   6.222  
   6.223 -text {* duplicates *}
   6.224 +theorem Sup_bool_eq: "Sup A \<longleftrightarrow> (\<exists>x\<in>A. x)"
   6.225 +  apply (rule order_antisym)
   6.226 +  apply (rule Sup_least)
   6.227 +  apply (rule le_boolI)
   6.228 +  apply (erule bexI, assumption)
   6.229 +  apply (rule le_boolI)
   6.230 +  apply (erule bexE)
   6.231 +  apply (rule le_boolE)
   6.232 +  apply (rule Sup_upper)
   6.233 +  apply assumption+
   6.234 +  done
   6.235 +
   6.236 +lemma Inf_empty_bool [simp]:
   6.237 +  "Inf {}"
   6.238 +  unfolding Inf_bool_def by auto
   6.239 +
   6.240 +lemma not_Sup_empty_bool [simp]:
   6.241 +  "\<not> Sup {}"
   6.242 +  unfolding Sup_def Inf_bool_def by auto
   6.243 +
   6.244 +lemma top_bool_eq: "top = True"
   6.245 +  by (iprover intro!: order_antisym le_boolI top_greatest)
   6.246 +
   6.247 +lemma bot_bool_eq: "bot = False"
   6.248 +  by (iprover intro!: order_antisym le_boolI bot_least)
   6.249 +
   6.250 +
   6.251 +subsection {* Set as lattice *}
   6.252 +
   6.253 +instance set :: (type) distrib_lattice
   6.254 +  inf_set_eq: "inf A B \<equiv> A \<inter> B"
   6.255 +  sup_set_eq: "sup A B \<equiv> A \<union> B"
   6.256 +  by intro_classes (auto simp add: inf_set_eq sup_set_eq)
   6.257 +
   6.258 +lemmas [code func del] = inf_set_eq sup_set_eq
   6.259 +
   6.260 +lemmas mono_Int = mono_inf
   6.261 +  [where ?'a="?'a set", where ?'b="?'b set", unfolded inf_set_eq sup_set_eq]
   6.262 +
   6.263 +lemmas mono_Un = mono_sup
   6.264 +  [where ?'a="?'a set", where ?'b="?'b set", unfolded inf_set_eq sup_set_eq]
   6.265 +
   6.266 +instance set :: (type) complete_lattice
   6.267 +  Inf_set_def: "Inf S \<equiv> \<Inter>S"
   6.268 +  by intro_classes (auto simp add: Inf_set_def)
   6.269 +
   6.270 +lemmas [code func del] = Inf_set_def
   6.271 +
   6.272 +theorem Sup_set_eq: "Sup S = \<Union>S"
   6.273 +  apply (rule subset_antisym)
   6.274 +  apply (rule Sup_least)
   6.275 +  apply (erule Union_upper)
   6.276 +  apply (rule Union_least)
   6.277 +  apply (erule Sup_upper)
   6.278 +  done
   6.279 +
   6.280 +lemma top_set_eq: "top = UNIV"
   6.281 +  by (iprover intro!: subset_antisym subset_UNIV top_greatest)
   6.282 +
   6.283 +lemma bot_set_eq: "bot = {}"
   6.284 +  by (iprover intro!: subset_antisym empty_subsetI bot_least)
   6.285 +
   6.286 +
   6.287 +subsection {* Fun as lattice *}
   6.288 +
   6.289 +instance "fun" :: (type, lattice) lattice
   6.290 +  inf_fun_eq: "inf f g \<equiv> (\<lambda>x. inf (f x) (g x))"
   6.291 +  sup_fun_eq: "sup f g \<equiv> (\<lambda>x. sup (f x) (g x))"
   6.292 +apply intro_classes
   6.293 +unfolding inf_fun_eq sup_fun_eq
   6.294 +apply (auto intro: le_funI)
   6.295 +apply (rule le_funI)
   6.296 +apply (auto dest: le_funD)
   6.297 +apply (rule le_funI)
   6.298 +apply (auto dest: le_funD)
   6.299 +done
   6.300 +
   6.301 +lemmas [code func del] = inf_fun_eq sup_fun_eq
   6.302 +
   6.303 +instance "fun" :: (type, distrib_lattice) distrib_lattice
   6.304 +  by default (auto simp add: inf_fun_eq sup_fun_eq sup_inf_distrib1)
   6.305 +
   6.306 +instance "fun" :: (type, complete_lattice) complete_lattice
   6.307 +  Inf_fun_def: "Inf A \<equiv> (\<lambda>x. Inf {y. \<exists>f\<in>A. y = f x})"
   6.308 +  apply intro_classes
   6.309 +  apply (unfold Inf_fun_def)
   6.310 +  apply (rule le_funI)
   6.311 +  apply (rule Inf_lower)
   6.312 +  apply (rule CollectI)
   6.313 +  apply (rule bexI)
   6.314 +  apply (rule refl)
   6.315 +  apply assumption
   6.316 +  apply (rule le_funI)
   6.317 +  apply (rule Inf_greatest)
   6.318 +  apply (erule CollectE)
   6.319 +  apply (erule bexE)
   6.320 +  apply (iprover elim: le_funE)
   6.321 +  done
   6.322 +
   6.323 +lemmas [code func del] = Inf_fun_def
   6.324 +
   6.325 +theorem Sup_fun_eq: "Sup A = (\<lambda>x. Sup {y. \<exists>f\<in>A. y = f x})"
   6.326 +  apply (rule order_antisym)
   6.327 +  apply (rule Sup_least)
   6.328 +  apply (rule le_funI)
   6.329 +  apply (rule Sup_upper)
   6.330 +  apply fast
   6.331 +  apply (rule le_funI)
   6.332 +  apply (rule Sup_least)
   6.333 +  apply (erule CollectE)
   6.334 +  apply (erule bexE)
   6.335 +  apply (drule le_funD [OF Sup_upper])
   6.336 +  apply simp
   6.337 +  done
   6.338 +
   6.339 +lemma Inf_empty_fun:
   6.340 +  "Inf {} = (\<lambda>_. Inf {})"
   6.341 +  by rule (auto simp add: Inf_fun_def)
   6.342 +
   6.343 +lemma Sup_empty_fun:
   6.344 +  "Sup {} = (\<lambda>_. Sup {})"
   6.345 +proof -
   6.346 +  have aux: "\<And>x. {y. \<exists>f. y = f x} = UNIV" by auto
   6.347 +  show ?thesis
   6.348 +  by (auto simp add: Sup_def Inf_fun_def Inf_binary inf_bool_eq aux)
   6.349 +qed
   6.350 +
   6.351 +lemma top_fun_eq: "top = (\<lambda>x. top)"
   6.352 +  by (iprover intro!: order_antisym le_funI top_greatest)
   6.353 +
   6.354 +lemma bot_fun_eq: "bot = (\<lambda>x. bot)"
   6.355 +  by (iprover intro!: order_antisym le_funI bot_least)
   6.356 +
   6.357 +
   6.358 +text {* redundant bindings *}
   6.359  
   6.360  lemmas inf_aci = inf_ACI
   6.361  lemmas sup_aci = sup_ACI
   6.362  
   6.363 +ML {*
   6.364 +val sup_fun_eq = @{thm sup_fun_eq}
   6.365 +val sup_bool_eq = @{thm sup_bool_eq}
   6.366 +*}
   6.367 +
   6.368  end
     7.1 --- a/src/HOL/Set.thy	Fri Jul 20 00:01:40 2007 +0200
     7.2 +++ b/src/HOL/Set.thy	Fri Jul 20 14:27:56 2007 +0200
     7.3 @@ -6,7 +6,7 @@
     7.4  header {* Set theory for higher-order logic *}
     7.5  
     7.6  theory Set
     7.7 -imports Lattices
     7.8 +imports HOL
     7.9  begin
    7.10  
    7.11  text {* A set in HOL is simply a predicate. *}
    7.12 @@ -1040,13 +1040,6 @@
    7.13    and [symmetric, defn] = atomize_ball
    7.14  
    7.15  
    7.16 -subsection {* Order on sets *}
    7.17 -
    7.18 -instance set :: (type) order
    7.19 -  by (intro_classes,
    7.20 -      (assumption | rule subset_refl subset_trans subset_antisym psubset_eq)+)
    7.21 -
    7.22 -
    7.23  subsection {* Further set-theory lemmas *}
    7.24  
    7.25  subsubsection {* Derived rules involving subsets. *}
    7.26 @@ -1054,12 +1047,10 @@
    7.27  text {* @{text insert}. *}
    7.28  
    7.29  lemma subset_insertI: "B \<subseteq> insert a B"
    7.30 -  apply (rule subsetI)
    7.31 -  apply (erule insertI2)
    7.32 -  done
    7.33 +  by (rule subsetI) (erule insertI2)
    7.34  
    7.35  lemma subset_insertI2: "A \<subseteq> B \<Longrightarrow> A \<subseteq> insert b B"
    7.36 -by blast
    7.37 +  by blast
    7.38  
    7.39  lemma subset_insert: "x \<notin> A ==> (A \<subseteq> insert x B) = (A \<subseteq> B)"
    7.40    by blast
    7.41 @@ -1135,14 +1126,6 @@
    7.42  by blast
    7.43  
    7.44  
    7.45 -text {* \medskip Monotonicity. *}
    7.46 -
    7.47 -lemma mono_Un: "mono f ==> f A \<union> f B \<subseteq> f (A \<union> B)"
    7.48 -  by (auto simp add: mono_def)
    7.49 -
    7.50 -lemma mono_Int: "mono f ==> f (A \<inter> B) \<subseteq> f A \<inter> f B"
    7.51 -  by (auto simp add: mono_def)
    7.52 -
    7.53  subsubsection {* Equalities involving union, intersection, inclusion, etc. *}
    7.54  
    7.55  text {* @{text "{}"}. *}
    7.56 @@ -2014,16 +1997,6 @@
    7.57  lemma eq_to_mono2: "a = b ==> c = d ==> ~ b --> ~ d ==> ~ a --> ~ c"
    7.58    by iprover
    7.59  
    7.60 -lemma Least_mono:
    7.61 -  "mono (f::'a::order => 'b::order) ==> EX x:S. ALL y:S. x <= y
    7.62 -    ==> (LEAST y. y : f ` S) = f (LEAST x. x : S)"
    7.63 -    -- {* Courtesy of Stephan Merz *}
    7.64 -  apply clarify
    7.65 -  apply (erule_tac P = "%x. x : S" in LeastI2_order, fast)
    7.66 -  apply (rule LeastI2_order)
    7.67 -  apply (auto elim: monoD intro!: order_antisym)
    7.68 -  done
    7.69 -
    7.70  
    7.71  subsection {* Inverse image of a function *}
    7.72  
    7.73 @@ -2120,19 +2093,6 @@
    7.74  lemma set_mp: "A \<subseteq> B ==> x:A ==> x:B"
    7.75    by (rule subsetD)
    7.76  
    7.77 -lemmas basic_trans_rules [trans] =
    7.78 -  order_trans_rules set_rev_mp set_mp
    7.79 -
    7.80 -
    7.81 -subsection {* Sets as lattice *}
    7.82 -
    7.83 -instance set :: (type) distrib_lattice
    7.84 -  inf_set_eq: "inf A B \<equiv> A \<inter> B"
    7.85 -  sup_set_eq: "sup A B \<equiv> A \<union> B"
    7.86 -  by intro_classes (auto simp add: inf_set_eq sup_set_eq)
    7.87 -
    7.88 -lemmas [code func del] = inf_set_eq sup_set_eq
    7.89 -
    7.90  
    7.91  subsection {* Basic ML bindings *}
    7.92