src/HOL/Real.thy
changeset 54281 b01057e72233
parent 54263 c4159fe6fa46
child 54489 03ff4d1e6784
equal deleted inserted replaced
54280:23c0049e7c40 54281:b01057e72233
   922 instantiation real :: linear_continuum
   922 instantiation real :: linear_continuum
   923 begin
   923 begin
   924 
   924 
   925 subsection{*Supremum of a set of reals*}
   925 subsection{*Supremum of a set of reals*}
   926 
   926 
   927 definition
   927 definition "Sup X = (LEAST z::real. \<forall>x\<in>X. x \<le> z)"
   928   Sup_real_def: "Sup X \<equiv> LEAST z::real. \<forall>x\<in>X. x\<le>z"
   928 definition "Inf (X::real set) = - Sup (uminus ` X)"
   929 
       
   930 definition
       
   931   Inf_real_def: "Inf (X::real set) \<equiv> - Sup (uminus ` X)"
       
   932 
   929 
   933 instance
   930 instance
   934 proof
   931 proof
   935   { fix x :: real and X :: "real set"
   932   { fix x :: real and X :: "real set"
   936     assume x: "x \<in> X" "bdd_above X"
   933     assume x: "x \<in> X" "bdd_above X"
   949     also from s z have "... \<le> z"
   946     also from s z have "... \<le> z"
   950       by blast
   947       by blast
   951     finally show "Sup X \<le> z" . }
   948     finally show "Sup X \<le> z" . }
   952   note Sup_least = this
   949   note Sup_least = this
   953 
   950 
   954   { fix x z :: real and X :: "real set"
   951   { fix x :: real and X :: "real set" assume x: "x \<in> X" "bdd_below X" then show "Inf X \<le> x"
   955     assume x: "x \<in> X" and [simp]: "bdd_below X"
   952       using Sup_upper[of "-x" "uminus ` X"] by (auto simp: Inf_real_def) }
   956     have "-x \<le> Sup (uminus ` X)"
   953   { fix z :: real and X :: "real set" assume "X \<noteq> {}" "\<And>x. x \<in> X \<Longrightarrow> z \<le> x" then show "z \<le> Inf X"
   957       by (rule Sup_upper) (auto simp add: image_iff x)
   954       using Sup_least[of "uminus ` X" "- z"] by (force simp: Inf_real_def) }
   958     then show "Inf X \<le> x" 
       
   959       by (auto simp add: Inf_real_def) }
       
   960 
       
   961   { fix z :: real and X :: "real set"
       
   962     assume x: "X \<noteq> {}" and z: "\<And>x. x \<in> X \<Longrightarrow> z \<le> x"
       
   963     have "Sup (uminus ` X) \<le> -z"
       
   964       using x z by (force intro: Sup_least)
       
   965     then show "z \<le> Inf X" 
       
   966         by (auto simp add: Inf_real_def) }
       
   967 
       
   968   show "\<exists>a b::real. a \<noteq> b"
   955   show "\<exists>a b::real. a \<noteq> b"
   969     using zero_neq_one by blast
   956     using zero_neq_one by blast
   970 qed
   957 qed
   971 end
   958 end
   972 
   959