src/HOL/Orderings.thy
changeset 28562 4e74209f113e
parent 28516 e6fdcaaadbd3
child 28685 275122631271
equal deleted inserted replaced
28561:056255ade52a 28562:4e74209f113e
   966 
   966 
   967 instantiation bool :: order
   967 instantiation bool :: order
   968 begin
   968 begin
   969 
   969 
   970 definition
   970 definition
   971   le_bool_def [code func del]: "P \<le> Q \<longleftrightarrow> P \<longrightarrow> Q"
   971   le_bool_def [code del]: "P \<le> Q \<longleftrightarrow> P \<longrightarrow> Q"
   972 
   972 
   973 definition
   973 definition
   974   less_bool_def [code func del]: "(P\<Colon>bool) < Q \<longleftrightarrow> P \<le> Q \<and> P \<noteq> Q"
   974   less_bool_def [code del]: "(P\<Colon>bool) < Q \<longleftrightarrow> P \<le> Q \<and> P \<noteq> Q"
   975 
   975 
   976 instance
   976 instance
   977   by intro_classes (auto simp add: le_bool_def less_bool_def)
   977   by intro_classes (auto simp add: le_bool_def less_bool_def)
   978 
   978 
   979 end
   979 end
   988 by (simp add: le_bool_def)
   988 by (simp add: le_bool_def)
   989 
   989 
   990 lemma le_boolD: "P \<le> Q \<Longrightarrow> P \<longrightarrow> Q"
   990 lemma le_boolD: "P \<le> Q \<Longrightarrow> P \<longrightarrow> Q"
   991 by (simp add: le_bool_def)
   991 by (simp add: le_bool_def)
   992 
   992 
   993 lemma [code func]:
   993 lemma [code]:
   994   "False \<le> b \<longleftrightarrow> True"
   994   "False \<le> b \<longleftrightarrow> True"
   995   "True \<le> b \<longleftrightarrow> b"
   995   "True \<le> b \<longleftrightarrow> b"
   996   "False < b \<longleftrightarrow> b"
   996   "False < b \<longleftrightarrow> b"
   997   "True < b \<longleftrightarrow> False"
   997   "True < b \<longleftrightarrow> False"
   998   unfolding le_bool_def less_bool_def by simp_all
   998   unfolding le_bool_def less_bool_def by simp_all
  1002 
  1002 
  1003 instantiation "fun" :: (type, ord) ord
  1003 instantiation "fun" :: (type, ord) ord
  1004 begin
  1004 begin
  1005 
  1005 
  1006 definition
  1006 definition
  1007   le_fun_def [code func del]: "f \<le> g \<longleftrightarrow> (\<forall>x. f x \<le> g x)"
  1007   le_fun_def [code del]: "f \<le> g \<longleftrightarrow> (\<forall>x. f x \<le> g x)"
  1008 
  1008 
  1009 definition
  1009 definition
  1010   less_fun_def [code func del]: "(f\<Colon>'a \<Rightarrow> 'b) < g \<longleftrightarrow> f \<le> g \<and> f \<noteq> g"
  1010   less_fun_def [code del]: "(f\<Colon>'a \<Rightarrow> 'b) < g \<longleftrightarrow> f \<le> g \<and> f \<noteq> g"
  1011 
  1011 
  1012 instance ..
  1012 instance ..
  1013 
  1013 
  1014 end
  1014 end
  1015 
  1015