src/HOL/Library/Extended_Real.thy
changeset 61188 b34551d94934
parent 61166 5976fe402824
child 61245 b77bf45efe21
equal deleted inserted replaced
61187:ff00ad5dc03a 61188:b34551d94934
  2193   assumes "A \<noteq> {}" shows "ereal_of_enat (Sup A) = (SUP a : A. ereal_of_enat a)"
  2193   assumes "A \<noteq> {}" shows "ereal_of_enat (Sup A) = (SUP a : A. ereal_of_enat a)"
  2194 proof (intro antisym mono_Sup)
  2194 proof (intro antisym mono_Sup)
  2195   show "ereal_of_enat (Sup A) \<le> (SUP a : A. ereal_of_enat a)"
  2195   show "ereal_of_enat (Sup A) \<le> (SUP a : A. ereal_of_enat a)"
  2196   proof cases
  2196   proof cases
  2197     assume "finite A"
  2197     assume "finite A"
  2198     with `A \<noteq> {}` obtain a where "a \<in> A" "ereal_of_enat (Sup A) = ereal_of_enat a"
  2198     with \<open>A \<noteq> {}\<close> obtain a where "a \<in> A" "ereal_of_enat (Sup A) = ereal_of_enat a"
  2199       using Max_in[of A] by (auto simp: Sup_enat_def simp del: Max_in)
  2199       using Max_in[of A] by (auto simp: Sup_enat_def simp del: Max_in)
  2200     then show ?thesis
  2200     then show ?thesis
  2201       by (auto intro: SUP_upper)
  2201       by (auto intro: SUP_upper)
  2202   next
  2202   next
  2203     assume "\<not> finite A"
  2203     assume "\<not> finite A"
  2206     proof safe
  2206     proof safe
  2207       fix x :: ereal assume "x < top"
  2207       fix x :: ereal assume "x < top"
  2208       then obtain n :: nat where "x < n"
  2208       then obtain n :: nat where "x < n"
  2209         using less_PInf_Ex_of_nat top_ereal_def by auto
  2209         using less_PInf_Ex_of_nat top_ereal_def by auto
  2210       obtain a where "a \<in> A - enat ` {.. n}"
  2210       obtain a where "a \<in> A - enat ` {.. n}"
  2211         by (metis `\<not> finite A` all_not_in_conv finite_Diff2 finite_atMost finite_imageI finite.emptyI)
  2211         by (metis \<open>\<not> finite A\<close> all_not_in_conv finite_Diff2 finite_atMost finite_imageI finite.emptyI)
  2212       then have "a \<in> A" "ereal n \<le> ereal_of_enat a"
  2212       then have "a \<in> A" "ereal n \<le> ereal_of_enat a"
  2213         by (auto simp: image_iff Ball_def)
  2213         by (auto simp: image_iff Ball_def)
  2214            (metis enat_iless enat_ord_simps(1) ereal_of_enat_less_iff ereal_of_enat_simps(1) less_le not_less)
  2214            (metis enat_iless enat_ord_simps(1) ereal_of_enat_less_iff ereal_of_enat_simps(1) less_le not_less)
  2215       with `x < n` show "\<exists>i\<in>A. x < ereal_of_enat i"
  2215       with \<open>x < n\<close> show "\<exists>i\<in>A. x < ereal_of_enat i"
  2216         by (auto intro!: bexI[of _ a])
  2216         by (auto intro!: bexI[of _ a])
  2217     qed
  2217     qed
  2218     show ?thesis
  2218     show ?thesis
  2219       by simp
  2219       by simp
  2220   qed
  2220   qed