src/HOL/Real_Vector_Spaces.thy
changeset 71837 dca11678c495
parent 71827 5e315defb038
child 73109 783406dd051e
equal deleted inserted replaced
71836:c095d3143047 71837:dca11678c495
   300 
   300 
   301 lemma of_real_power [simp]:
   301 lemma of_real_power [simp]:
   302   "of_real (x ^ n) = (of_real x :: 'a::{real_algebra_1}) ^ n"
   302   "of_real (x ^ n) = (of_real x :: 'a::{real_algebra_1}) ^ n"
   303   by (induct n) simp_all
   303   by (induct n) simp_all
   304 
   304 
       
   305 lemma of_real_power_int [simp]:
       
   306   "of_real (power_int x n) = power_int (of_real x :: 'a :: {real_div_algebra,division_ring}) n"
       
   307   by (auto simp: power_int_def)
       
   308 
   305 lemma of_real_eq_iff [simp]: "of_real x = of_real y \<longleftrightarrow> x = y"
   309 lemma of_real_eq_iff [simp]: "of_real x = of_real y \<longleftrightarrow> x = y"
   306   by (simp add: of_real_def)
   310   by (simp add: of_real_def)
   307 
   311 
   308 lemma inj_of_real: "inj of_real"
   312 lemma inj_of_real: "inj of_real"
   309   by (auto intro: injI)
   313   by (auto intro: injI)
   330 lemma of_real_numeral [simp]: "of_real (numeral w) = numeral w"
   334 lemma of_real_numeral [simp]: "of_real (numeral w) = numeral w"
   331   using of_real_of_int_eq [of "numeral w"] by simp
   335   using of_real_of_int_eq [of "numeral w"] by simp
   332 
   336 
   333 lemma of_real_neg_numeral [simp]: "of_real (- numeral w) = - numeral w"
   337 lemma of_real_neg_numeral [simp]: "of_real (- numeral w) = - numeral w"
   334   using of_real_of_int_eq [of "- numeral w"] by simp
   338   using of_real_of_int_eq [of "- numeral w"] by simp
       
   339 
       
   340 lemma numeral_power_int_eq_of_real_cancel_iff [simp]:
       
   341   "power_int (numeral x) n = (of_real y :: 'a :: {real_div_algebra, division_ring}) \<longleftrightarrow>
       
   342      power_int (numeral x) n = y"
       
   343 proof -
       
   344   have "power_int (numeral x) n = (of_real (power_int (numeral x) n) :: 'a)"
       
   345     by simp
       
   346   also have "\<dots> = of_real y \<longleftrightarrow> power_int (numeral x) n = y"
       
   347     by (subst of_real_eq_iff) auto
       
   348   finally show ?thesis .
       
   349 qed
       
   350 
       
   351 lemma of_real_eq_numeral_power_int_cancel_iff [simp]:
       
   352   "(of_real y :: 'a :: {real_div_algebra, division_ring}) = power_int (numeral x) n \<longleftrightarrow>
       
   353      y = power_int (numeral x) n"
       
   354   by (subst (1 2) eq_commute) simp
       
   355 
       
   356 lemma of_real_eq_of_real_power_int_cancel_iff [simp]:
       
   357   "power_int (of_real b :: 'a :: {real_div_algebra, division_ring}) w = of_real x \<longleftrightarrow>
       
   358      power_int b w = x"
       
   359   by (metis of_real_power_int of_real_eq_iff)
   335 
   360 
   336 text \<open>Every real algebra has characteristic zero.\<close>
   361 text \<open>Every real algebra has characteristic zero.\<close>
   337 instance real_algebra_1 < ring_char_0
   362 instance real_algebra_1 < ring_char_0
   338 proof
   363 proof
   339   from inj_of_real inj_of_nat have "inj (of_real \<circ> of_nat)"
   364   from inj_of_real inj_of_nat have "inj (of_real \<circ> of_nat)"
   955 qed
   980 qed
   956 
   981 
   957 lemma norm_power: "norm (x ^ n) = norm x ^ n"
   982 lemma norm_power: "norm (x ^ n) = norm x ^ n"
   958   for x :: "'a::real_normed_div_algebra"
   983   for x :: "'a::real_normed_div_algebra"
   959   by (induct n) (simp_all add: norm_mult)
   984   by (induct n) (simp_all add: norm_mult)
       
   985 
       
   986 lemma norm_power_int: "norm (power_int x n) = power_int (norm x) n"
       
   987   for x :: "'a::real_normed_div_algebra"
       
   988   by (cases n rule: int_cases4) (auto simp: norm_power power_int_minus norm_inverse)
   960 
   989 
   961 lemma power_eq_imp_eq_norm:
   990 lemma power_eq_imp_eq_norm:
   962   fixes w :: "'a::real_normed_div_algebra"
   991   fixes w :: "'a::real_normed_div_algebra"
   963   assumes eq: "w ^ n = z ^ n" and "n > 0"
   992   assumes eq: "w ^ n = z ^ n" and "n > 0"
   964     shows "norm w = norm z"
   993     shows "norm w = norm z"