src/HOL/Orderings.thy
changeset 69791 195aeee8b30a
parent 69605 a96320074298
child 69815 56d5bb8c102e
equal deleted inserted replaced
69790:154cf64e403e 69791:195aeee8b30a
   298     and "\<And>y. P y \<Longrightarrow> x \<le> y"
   298     and "\<And>y. P y \<Longrightarrow> x \<le> y"
   299     and "\<And>x. P x \<Longrightarrow> \<forall>y. P y \<longrightarrow> x \<le> y \<Longrightarrow> Q x"
   299     and "\<And>x. P x \<Longrightarrow> \<forall>y. P y \<longrightarrow> x \<le> y \<Longrightarrow> Q x"
   300   shows "Q (Least P)"
   300   shows "Q (Least P)"
   301 unfolding Least_def by (rule theI2)
   301 unfolding Least_def by (rule theI2)
   302   (blast intro: assms antisym)+
   302   (blast intro: assms antisym)+
       
   303 
       
   304 lemma Least_ex1:
       
   305   assumes   "\<exists>!x. P x \<and> (\<forall>y. P y \<longrightarrow> x \<le> y)"
       
   306   shows     Least1I: "P (Least P)" and Least1_le: "P z \<Longrightarrow> Least P \<le> z"
       
   307   using     theI'[OF assms]
       
   308   unfolding Least_def
       
   309   by        auto
   303 
   310 
   304 text \<open>Greatest value operator\<close>
   311 text \<open>Greatest value operator\<close>
   305 
   312 
   306 definition Greatest :: "('a \<Rightarrow> bool) \<Rightarrow> 'a" (binder "GREATEST " 10) where
   313 definition Greatest :: "('a \<Rightarrow> bool) \<Rightarrow> 'a" (binder "GREATEST " 10) where
   307 "Greatest P = (THE x. P x \<and> (\<forall>y. P y \<longrightarrow> x \<ge> y))"
   314 "Greatest P = (THE x. P x \<and> (\<forall>y. P y \<longrightarrow> x \<ge> y))"