src/HOL/Library/Extended_Real.thy
changeset 60636 ee18efe9b246
parent 60580 7e741e22d7fc
child 60637 03a25d3e759e
equal deleted inserted replaced
60635:22830a64358f 60636:ee18efe9b246
     6 *)
     6 *)
     7 
     7 
     8 section \<open>Extended real number line\<close>
     8 section \<open>Extended real number line\<close>
     9 
     9 
    10 theory Extended_Real
    10 theory Extended_Real
    11 imports Complex_Main Extended_Nat Liminf_Limsup Order_Continuity
    11 imports Complex_Main Extended_Nat Liminf_Limsup
    12 begin
    12 begin
    13 
    13 
    14 text \<open>
    14 text \<open>
    15 
    15 
    16 This should be part of @{theory Extended_Nat} or @{theory Order_Continuity}, but then the
    16 This should be part of @{theory Extended_Nat} or @{theory Order_Continuity}, but then the
  2766     also have "(?lhs / x) * x = ?lhs" using False ereal_divide_eq mult.commute by force
  2766     also have "(?lhs / x) * x = ?lhs" using False ereal_divide_eq mult.commute by force
  2767     finally show "?lhs \<le> ?rhs" .
  2767     finally show "?lhs \<le> ?rhs" .
  2768   qed
  2768   qed
  2769 qed
  2769 qed
  2770 
  2770 
       
  2771 lemma not_MInfty_nonneg[simp]: "0 \<le> (x::ereal) \<Longrightarrow> x \<noteq> - \<infinity>"
       
  2772   by auto
       
  2773 
       
  2774 lemma sup_continuous_add_left[order_continuous_intros]: "0 \<le> c \<Longrightarrow> sup_continuous f \<Longrightarrow> sup_continuous (\<lambda>x. f x + c :: ereal)"
       
  2775   by (auto simp: sup_continuous_def SUP_ereal_add_left)
       
  2776 
       
  2777 lemma sup_continuous_add_right[order_continuous_intros]: "0 \<le> c \<Longrightarrow> sup_continuous f \<Longrightarrow> sup_continuous (\<lambda>x. c + f x :: ereal)"
       
  2778   using sup_continuous_add_left by (simp add: ac_simps)
       
  2779 
       
  2780 lemma sup_continuous_multc[order_continuous_intros]: "0 \<le> c \<Longrightarrow> c < \<infinity> \<Longrightarrow> sup_continuous (\<lambda>f s. f s * c :: ereal)"
       
  2781   by (cases c) (auto simp: sup_continuous_def fun_eq_iff Sup_ereal_mult_right')
       
  2782 
  2771 subsubsection \<open>Tests for code generator\<close>
  2783 subsubsection \<open>Tests for code generator\<close>
  2772 
  2784 
  2773 (* A small list of simple arithmetic expressions *)
  2785 (* A small list of simple arithmetic expressions *)
  2774 
  2786 
  2775 value "- \<infinity> :: ereal"
  2787 value "- \<infinity> :: ereal"