src/HOL/NSA/HTranscendental.thy
changeset 61975 b4b11391c676
parent 61971 720fa884656e
child 61981 1b5845c62fa0
equal deleted inserted replaced
61974:5b067c681989 61975:b4b11391c676
     3     Copyright   : 2001 University of Edinburgh
     3     Copyright   : 2001 University of Edinburgh
     4 
     4 
     5 Converted to Isar and polished by lcp
     5 Converted to Isar and polished by lcp
     6 *)
     6 *)
     7 
     7 
     8 section{*Nonstandard Extensions of Transcendental Functions*}
     8 section\<open>Nonstandard Extensions of Transcendental Functions\<close>
     9 
     9 
    10 theory HTranscendental
    10 theory HTranscendental
    11 imports Transcendental HSeries HDeriv
    11 imports Transcendental HSeries HDeriv
    12 begin
    12 begin
    13 
    13 
    14 definition
    14 definition
    15   exphr :: "real => hypreal" where
    15   exphr :: "real => hypreal" where
    16     --{*define exponential function using standard part *}
    16     \<comment>\<open>define exponential function using standard part\<close>
    17   "exphr x =  st(sumhr (0, whn, %n. inverse (fact n) * (x ^ n)))"
    17   "exphr x =  st(sumhr (0, whn, %n. inverse (fact n) * (x ^ n)))"
    18 
    18 
    19 definition
    19 definition
    20   sinhr :: "real => hypreal" where
    20   sinhr :: "real => hypreal" where
    21   "sinhr x = st(sumhr (0, whn, %n. sin_coeff n * x ^ n))"
    21   "sinhr x = st(sumhr (0, whn, %n. sin_coeff n * x ^ n))"
    23 definition
    23 definition
    24   coshr :: "real => hypreal" where
    24   coshr :: "real => hypreal" where
    25   "coshr x = st(sumhr (0, whn, %n. cos_coeff n * x ^ n))"
    25   "coshr x = st(sumhr (0, whn, %n. cos_coeff n * x ^ n))"
    26 
    26 
    27 
    27 
    28 subsection{*Nonstandard Extension of Square Root Function*}
    28 subsection\<open>Nonstandard Extension of Square Root Function\<close>
    29 
    29 
    30 lemma STAR_sqrt_zero [simp]: "( *f* sqrt) 0 = 0"
    30 lemma STAR_sqrt_zero [simp]: "( *f* sqrt) 0 = 0"
    31 by (simp add: starfun star_n_zero_num)
    31 by (simp add: starfun star_n_zero_num)
    32 
    32 
    33 lemma STAR_sqrt_one [simp]: "( *f* sqrt) 1 = 1"
    33 lemma STAR_sqrt_one [simp]: "( *f* sqrt) 1 = 1"
   590 lemma NSLIMSEQ_sin_cos_pi:
   590 lemma NSLIMSEQ_sin_cos_pi:
   591      "(%n. real n * sin (pi / real n) * cos (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S pi"
   591      "(%n. real n * sin (pi / real n) * cos (pi / real n)) \<longlonglongrightarrow>\<^sub>N\<^sub>S pi"
   592 by (insert NSLIMSEQ_mult [OF NSLIMSEQ_sin_pi NSLIMSEQ_cos_one], simp)
   592 by (insert NSLIMSEQ_mult [OF NSLIMSEQ_sin_pi NSLIMSEQ_cos_one], simp)
   593 
   593 
   594 
   594 
   595 text{*A familiar approximation to @{term "cos x"} when @{term x} is small*}
   595 text\<open>A familiar approximation to @{term "cos x"} when @{term x} is small\<close>
   596 
   596 
   597 lemma STAR_cos_Infinitesimal_approx:
   597 lemma STAR_cos_Infinitesimal_approx:
   598   fixes x :: "'a::{real_normed_field,banach} star"
   598   fixes x :: "'a::{real_normed_field,banach} star"
   599   shows "x \<in> Infinitesimal ==> ( *f* cos) x @= 1 - x\<^sup>2"
   599   shows "x \<in> Infinitesimal ==> ( *f* cos) x @= 1 - x\<^sup>2"
   600 apply (rule STAR_cos_Infinitesimal [THEN approx_trans])
   600 apply (rule STAR_cos_Infinitesimal [THEN approx_trans])
   601 apply (auto simp add: Infinitesimal_approx_minus [symmetric] 
   601 apply (auto simp add: Infinitesimal_approx_minus [symmetric] 
   602             add.assoc [symmetric] numeral_2_eq_2)
   602             add.assoc [symmetric] numeral_2_eq_2)
   603 done
   603 done
   604 
   604 
   605 lemma STAR_cos_Infinitesimal_approx2:
   605 lemma STAR_cos_Infinitesimal_approx2:
   606   fixes x :: hypreal  --{*perhaps could be generalised, like many other hypreal results*}
   606   fixes x :: hypreal  \<comment>\<open>perhaps could be generalised, like many other hypreal results\<close>
   607   shows "x \<in> Infinitesimal ==> ( *f* cos) x @= 1 - (x\<^sup>2)/2"
   607   shows "x \<in> Infinitesimal ==> ( *f* cos) x @= 1 - (x\<^sup>2)/2"
   608 apply (rule STAR_cos_Infinitesimal [THEN approx_trans])
   608 apply (rule STAR_cos_Infinitesimal [THEN approx_trans])
   609 apply (auto intro: Infinitesimal_SReal_divide Infinitesimal_mult
   609 apply (auto intro: Infinitesimal_SReal_divide Infinitesimal_mult
   610             simp add: Infinitesimal_approx_minus [symmetric] numeral_2_eq_2)
   610             simp add: Infinitesimal_approx_minus [symmetric] numeral_2_eq_2)
   611 done
   611 done