src/HOL/Fun.thy
changeset 21547 9c9fdf4c2949
parent 21327 2b3c41d02e87
child 21870 c701cdacf69b
equal deleted inserted replaced
21546:268b6bed0cc8 21547:9c9fdf4c2949
   450   thus "surj (swap a b f)" by (rule surj_imp_surj_swap) 
   450   thus "surj (swap a b f)" by (rule surj_imp_surj_swap) 
   451 qed
   451 qed
   452 
   452 
   453 lemma bij_swap_iff: "bij (swap a b f) = bij f"
   453 lemma bij_swap_iff: "bij (swap a b f) = bij f"
   454 by (simp add: bij_def)
   454 by (simp add: bij_def)
   455  
   455 
       
   456 
       
   457 subsection {* Order on functions *}
       
   458 
       
   459 instance "fun" :: (type, order) order
       
   460   le_fun_def: "f \<le> g \<equiv> \<forall>x. f x \<le> g x"
       
   461   less_fun_def: "f < g \<equiv> f \<le> g \<and> f \<noteq> g"
       
   462   by default
       
   463     (auto simp add: le_fun_def less_fun_def intro: order_trans, rule ext, auto intro: order_antisym)
       
   464 
       
   465 lemma le_funI: "(\<And>x. f x \<le> g x) \<Longrightarrow> f \<le> g"
       
   466   unfolding le_fun_def by simp
       
   467 
       
   468 lemma le_funE: "f \<le> g \<Longrightarrow> (f x \<le> g x \<Longrightarrow> P) \<Longrightarrow> P"
       
   469   unfolding le_fun_def by simp
       
   470 
       
   471 lemma le_funD: "f \<le> g \<Longrightarrow> f x \<le> g x"
       
   472   unfolding le_fun_def by simp
       
   473 
       
   474 instance "fun" :: (type, ord) ord ..
       
   475 
       
   476 
       
   477 subsection {* ML legacy bindings *} 
   456 
   478 
   457 text{*The ML section includes some compatibility bindings and a simproc
   479 text{*The ML section includes some compatibility bindings and a simproc
   458 for function updates, in addition to the usual ML-bindings of theorems.*}
   480 for function updates, in addition to the usual ML-bindings of theorems.*}
   459 ML
   481 ML
   460 {*
   482 {*