src/HOL/Lattices_Big.thy
changeset 68779 78d9b1783378
parent 67969 83c8cafdebe8
child 68788 d4426a23832e
equal deleted inserted replaced
68778:4566bac4517d 68779:78d9b1783378
   497   "MAX x. B"     \<rightleftharpoons> "CONST MAXIMUM CONST UNIV (\<lambda>x. B)"
   497   "MAX x. B"     \<rightleftharpoons> "CONST MAXIMUM CONST UNIV (\<lambda>x. B)"
   498   "MAX x. B"     \<rightleftharpoons> "MAX x \<in> CONST UNIV. B"
   498   "MAX x. B"     \<rightleftharpoons> "MAX x \<in> CONST UNIV. B"
   499   "MAX x\<in>A. B"   \<rightleftharpoons> "CONST MAXIMUM A (\<lambda>x. B)"
   499   "MAX x\<in>A. B"   \<rightleftharpoons> "CONST MAXIMUM A (\<lambda>x. B)"
   500 
   500 
   501 print_translation \<open>
   501 print_translation \<open>
   502   [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax INFIMUM} @{syntax_const "_INF"},
   502   [Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax MINIMUM} @{syntax_const "_MIN"},
   503     Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax SUPREMUM} @{syntax_const "_SUP"}]
   503     Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax MAXIMUM} @{syntax_const "_MAX"}]
   504 \<close> \<comment> \<open>to avoid eta-contraction of body\<close>
   504 \<close> \<comment> \<open>to avoid eta-contraction of body\<close>
   505 
   505 
   506 text \<open>An aside: @{const Min}/@{const Max} on linear orders as special case of @{const Inf_fin}/@{const Sup_fin}\<close>
   506 text \<open>An aside: @{const Min}/@{const Max} on linear orders as special case of @{const Inf_fin}/@{const Sup_fin}\<close>
   507 
   507 
   508 lemma Inf_fin_Min:
   508 lemma Inf_fin_Min:
   809   with assms show ?thesis
   809   with assms show ?thesis
   810     using hom_Min_commute [of "plus k" N]
   810     using hom_Min_commute [of "plus k" N]
   811     by simp (blast intro: arg_cong [where f = Min])
   811     by simp (blast intro: arg_cong [where f = Min])
   812 qed
   812 qed
   813 
   813 
       
   814 lemma Max_add_commute:
       
   815   fixes k
       
   816   assumes "finite N" and "N \<noteq> {}"
       
   817   shows "Max((\<lambda>x. x+k) ` N) = Max N + k"
       
   818 proof -
       
   819   have "\<And>x y. max x y + k = max (x+k) (y+k)"
       
   820     by(simp add: max_def antisym add_right_mono)
       
   821   with assms show ?thesis
       
   822     using hom_Max_commute [of "\<lambda>x. x+k" N, symmetric] by simp
       
   823 qed
       
   824 
   814 lemma add_Max_commute:
   825 lemma add_Max_commute:
   815   fixes k
   826   fixes k
   816   assumes "finite N" and "N \<noteq> {}"
   827   assumes "finite N" and "N \<noteq> {}"
   817   shows "k + Max N = Max {k + m | m. m \<in> N}"
   828   shows "k + Max N = Max {k + m | m. m \<in> N}"
   818 proof -
   829 proof -