src/HOL/Complex.thy
changeset 74223 527088d4a89b
parent 73928 3b76524f5a85
child 74226 38c01d7e9f5b
equal deleted inserted replaced
74218:8798edfc61ef 74223:527088d4a89b
    23 lemma complex_eqI [intro?]: "Re x = Re y \<Longrightarrow> Im x = Im y \<Longrightarrow> x = y"
    23 lemma complex_eqI [intro?]: "Re x = Re y \<Longrightarrow> Im x = Im y \<Longrightarrow> x = y"
    24   by (rule complex.expand) simp
    24   by (rule complex.expand) simp
    25 
    25 
    26 lemma complex_eq_iff: "x = y \<longleftrightarrow> Re x = Re y \<and> Im x = Im y"
    26 lemma complex_eq_iff: "x = y \<longleftrightarrow> Re x = Re y \<and> Im x = Im y"
    27   by (auto intro: complex.expand)
    27   by (auto intro: complex.expand)
       
    28 
    28 
    29 
    29 
    30 
    30 subsection \<open>Addition and Subtraction\<close>
    31 subsection \<open>Addition and Subtraction\<close>
    31 
    32 
    32 instantiation complex :: ab_group_add
    33 instantiation complex :: ab_group_add
   652   shows   "((\<lambda>z. cnj (f z)) has_vector_derivative cnj f') (at z within A)"
   653   shows   "((\<lambda>z. cnj (f z)) has_vector_derivative cnj f') (at z within A)"
   653   using assms by (auto simp: has_vector_derivative_complex_iff intro: derivative_intros)
   654   using assms by (auto simp: has_vector_derivative_complex_iff intro: derivative_intros)
   654 
   655 
   655 
   656 
   656 subsection \<open>Basic Lemmas\<close>
   657 subsection \<open>Basic Lemmas\<close>
       
   658 
       
   659 lemma complex_of_real_code[code_unfold]: "of_real = (\<lambda>x. Complex x 0)" 
       
   660   by (intro ext, auto simp: complex_eq_iff)
   657 
   661 
   658 lemma complex_eq_0: "z=0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 = 0"
   662 lemma complex_eq_0: "z=0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 = 0"
   659   by (metis zero_complex.sel complex_eqI sum_power2_eq_zero_iff)
   663   by (metis zero_complex.sel complex_eqI sum_power2_eq_zero_iff)
   660 
   664 
   661 lemma complex_neq_0: "z\<noteq>0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 > 0"
   665 lemma complex_neq_0: "z\<noteq>0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 > 0"