src/HOL/Nonstandard_Analysis/CLim.thy
author wenzelm
Mon, 08 Jun 2020 21:55:14 +0200
changeset 71926 bee83c9d3306
parent 70723 4e39d87c9737
child 75866 9eeed5c424f9
permissions -rw-r--r--
clarified sessions;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62479
716336f19aa9 clarified session;
wenzelm
parents: 61976
diff changeset
     1
(*  Title:      HOL/Nonstandard_Analysis/CLim.thy
716336f19aa9 clarified session;
wenzelm
parents: 61976
diff changeset
     2
    Author:     Jacques D. Fleuriot
716336f19aa9 clarified session;
wenzelm
parents: 61976
diff changeset
     3
    Copyright:  2001 University of Edinburgh
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     4
    Conversion to Isar and new proofs by Lawrence C Paulson, 2004
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     5
*)
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     6
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
     7
section \<open>Limits, Continuity and Differentiation for Complex Functions\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     8
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
     9
theory CLim
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    10
  imports CStar
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    11
begin
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    12
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    13
(*not in simpset?*)
70723
4e39d87c9737 imported new material mostly due to Sébastien Gouëzel
paulson <lp15@cam.ac.uk>
parents: 70228
diff changeset
    14
declare epsilon_not_zero [simp]
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    15
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    16
(*??generalize*)
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    17
lemma lemma_complex_mult_inverse_squared [simp]: "x \<noteq> 0 \<Longrightarrow> x * (inverse x)\<^sup>2 = inverse x"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    18
  for x :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    19
  by (simp add: numeral_2_eq_2)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    20
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    21
text \<open>Changing the quantified variable. Install earlier?\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    22
lemma all_shift: "(\<forall>x::'a::comm_ring_1. P x) \<longleftrightarrow> (\<forall>x. P (x - a))"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    23
  apply auto
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    24
  apply (drule_tac x = "x + a" in spec)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    25
  apply (simp add: add.assoc)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    26
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    27
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    28
lemma complex_add_minus_iff [simp]: "x + - a = 0 \<longleftrightarrow> x = a"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    29
  for x a :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    30
  by (simp add: diff_eq_eq)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    31
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    32
lemma complex_add_eq_0_iff [iff]: "x + y = 0 \<longleftrightarrow> y = - x"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    33
  for x y :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    34
  apply auto
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    35
  apply (drule sym [THEN diff_eq_eq [THEN iffD2]])
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    36
  apply auto
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    37
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    38
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    39
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    40
subsection \<open>Limit of Complex to Complex Function\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    41
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    42
lemma NSLIM_Re: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> (\<lambda>x. Re (f x)) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S Re L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    43
  by (simp add: NSLIM_def starfunC_approx_Re_Im_iff hRe_hcomplex_of_complex)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    44
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    45
lemma NSLIM_Im: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<Longrightarrow> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S Im L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    46
  by (simp add: NSLIM_def starfunC_approx_Re_Im_iff hIm_hcomplex_of_complex)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    47
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    48
lemma LIM_Re: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. Re (f x)) \<midarrow>a\<rightarrow> Re L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    49
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    50
  by (simp add: LIM_NSLIM_iff NSLIM_Re)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    51
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    52
lemma LIM_Im: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow> Im L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    53
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    54
  by (simp add: LIM_NSLIM_iff NSLIM_Im)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    55
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    56
lemma LIM_cnj: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. cnj (f x)) \<midarrow>a\<rightarrow> cnj L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    57
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    58
  by (simp add: LIM_eq complex_cnj_diff [symmetric] del: complex_cnj_diff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    59
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    60
lemma LIM_cnj_iff: "((\<lambda>x. cnj (f x)) \<midarrow>a\<rightarrow> cnj L) \<longleftrightarrow> f \<midarrow>a\<rightarrow> L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    61
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    62
  by (simp add: LIM_eq complex_cnj_diff [symmetric] del: complex_cnj_diff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    63
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    64
lemma starfun_norm: "( *f* (\<lambda>x. norm (f x))) = (\<lambda>x. hnorm (( *f* f) x))"
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    65
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    66
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    67
lemma star_of_Re [simp]: "star_of (Re x) = hRe (star_of x)"
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    68
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    69
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    70
lemma star_of_Im [simp]: "star_of (Im x) = hIm (star_of x)"
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    71
  by transfer (rule refl)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    72
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    73
text \<open>Another equivalence result.\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    74
lemma NSCLIM_NSCRLIM_iff: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S L \<longleftrightarrow> (\<lambda>y. cmod (f y - L)) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    75
  by (simp add: NSLIM_def starfun_norm
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    76
      approx_approx_zero_iff [symmetric] approx_minus_iff [symmetric])
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    77
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    78
text \<open>Much, much easier standard proof.\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    79
lemma CLIM_CRLIM_iff: "f \<midarrow>x\<rightarrow> L \<longleftrightarrow> (\<lambda>y. cmod (f y - L)) \<midarrow>x\<rightarrow> 0"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    80
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    81
  by (simp add: LIM_eq)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    82
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    83
text \<open>So this is nicer nonstandard proof.\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    84
lemma NSCLIM_NSCRLIM_iff2: "f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S L \<longleftrightarrow> (\<lambda>y. cmod (f y - L)) \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S 0"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    85
  by (simp add: LIM_NSLIM_iff [symmetric] CLIM_CRLIM_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    86
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
    87
lemma NSLIM_NSCRLIM_Re_Im_iff:
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    88
  "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S L \<longleftrightarrow> (\<lambda>x. Re (f x)) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S Re L \<and> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S Im L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    89
  apply (auto intro: NSLIM_Re NSLIM_Im)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    90
  apply (auto simp add: NSLIM_def starfun_Re starfun_Im)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    91
  apply (auto dest!: spec)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    92
  apply (simp add: hcomplex_approx_iff)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    93
  done
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    94
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    95
lemma LIM_CRLIM_Re_Im_iff: "f \<midarrow>a\<rightarrow> L \<longleftrightarrow> (\<lambda>x. Re (f x)) \<midarrow>a\<rightarrow> Re L \<and> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow> Im L"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    96
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    97
  by (simp add: LIM_NSLIM_iff NSLIM_NSCRLIM_Re_Im_iff)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    98
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
    99
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   100
subsection \<open>Continuity\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   101
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   102
lemma NSLIM_isContc_iff: "f \<midarrow>a\<rightarrow>\<^sub>N\<^sub>S f a \<longleftrightarrow> (\<lambda>h. f (a + h)) \<midarrow>0\<rightarrow>\<^sub>N\<^sub>S f a"
70228
2d5b122aa0ff De-applying and combining lemmas to make structured proofs
paulson <lp15@cam.ac.uk>
parents: 69597
diff changeset
   103
  by (rule NSLIM_at0_iff)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   104
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   105
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   106
subsection \<open>Functions from Complex to Reals\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   107
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   108
lemma isNSContCR_cmod [simp]: "isNSCont cmod a"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   109
  by (auto intro: approx_hnorm
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   110
      simp: starfunCR_cmod hcmod_hcomplex_of_complex [symmetric] isNSCont_def)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   111
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   112
lemma isContCR_cmod [simp]: "isCont cmod a"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   113
  by (simp add: isNSCont_isCont_iff [symmetric])
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   114
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   115
lemma isCont_Re: "isCont f a \<Longrightarrow> isCont (\<lambda>x. Re (f x)) a"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   116
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   117
  by (simp add: isCont_def LIM_Re)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   118
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   119
lemma isCont_Im: "isCont f a \<Longrightarrow> isCont (\<lambda>x. Im (f x)) a"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   120
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   121
  by (simp add: isCont_def LIM_Im)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   122
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   123
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   124
subsection \<open>Differentiation of Natural Number Powers\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   125
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   126
lemma CDERIV_pow [simp]: "DERIV (\<lambda>x. x ^ n) x :> complex_of_real (real n) * (x ^ (n - Suc 0))"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   127
  apply (induct n)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   128
   apply (drule_tac [2] DERIV_ident [THEN DERIV_mult])
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   129
   apply (auto simp add: distrib_right of_nat_Suc)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   130
  apply (case_tac "n")
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   131
   apply (auto simp add: ac_simps)
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   132
  done
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   133
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   134
text \<open>Nonstandard version.\<close>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   135
lemma NSCDERIV_pow: "NSDERIV (\<lambda>x. x ^ n) x :> complex_of_real (real n) * (x ^ (n - 1))"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   136
  by (metis CDERIV_pow NSDERIV_DERIV_iff One_nat_def)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   137
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 64601
diff changeset
   138
text \<open>Can't relax the premise \<^term>\<open>x \<noteq> 0\<close>: it isn't continuous at zero.\<close>
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   139
lemma NSCDERIV_inverse: "x \<noteq> 0 \<Longrightarrow> NSDERIV (\<lambda>x. inverse x) x :> - (inverse x)\<^sup>2"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   140
  for x :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   141
  unfolding numeral_2_eq_2 by (rule NSDERIV_inverse)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   142
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   143
lemma CDERIV_inverse: "x \<noteq> 0 \<Longrightarrow> DERIV (\<lambda>x. inverse x) x :> - (inverse x)\<^sup>2"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   144
  for x :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   145
  unfolding numeral_2_eq_2 by (rule DERIV_inverse)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   146
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   147
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 64601
diff changeset
   148
subsection \<open>Derivative of Reciprocals (Function \<^term>\<open>inverse\<close>)\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   149
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   150
lemma CDERIV_inverse_fun:
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   151
  "DERIV f x :> d \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow> DERIV (\<lambda>x. inverse (f x)) x :> - (d * inverse ((f x)\<^sup>2))"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   152
  for x :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   153
  unfolding numeral_2_eq_2 by (rule DERIV_inverse_fun)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   154
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   155
lemma NSCDERIV_inverse_fun:
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   156
  "NSDERIV f x :> d \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow> NSDERIV (\<lambda>x. inverse (f x)) x :> - (d * inverse ((f x)\<^sup>2))"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   157
  for x :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   158
  unfolding numeral_2_eq_2 by (rule NSDERIV_inverse_fun)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   159
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   160
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   161
subsection \<open>Derivative of Quotient\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   162
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   163
lemma CDERIV_quotient:
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   164
  "DERIV f x :> d \<Longrightarrow> DERIV g x :> e \<Longrightarrow> g(x) \<noteq> 0 \<Longrightarrow>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   165
    DERIV (\<lambda>y. f y / g y) x :> (d * g x - (e * f x)) / (g x)\<^sup>2"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   166
  for x :: complex
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   167
  unfolding numeral_2_eq_2 by (rule DERIV_quotient)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   168
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   169
lemma NSCDERIV_quotient:
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   170
  "NSDERIV f x :> d \<Longrightarrow> NSDERIV g x :> e \<Longrightarrow> g x \<noteq> (0::complex) \<Longrightarrow>
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   171
    NSDERIV (\<lambda>y. f y / g y) x :> (d * g x - (e * f x)) / (g x)\<^sup>2"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   172
  unfolding numeral_2_eq_2 by (rule NSDERIV_quotient)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   173
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   174
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   175
subsection \<open>Caratheodory Formulation of Derivative at a Point: Standard Proof\<close>
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   176
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   177
lemma CARAT_CDERIVD:
64601
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   178
  "(\<forall>z. f z - f x = g z * (z - x)) \<and> isNSCont g x \<and> g x = l \<Longrightarrow> NSDERIV f x :> l"
37ce6ceacbb7 misc tuning and modernization;
wenzelm
parents: 62479
diff changeset
   179
  by clarify (rule CARAT_DERIVD)
27468
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   180
0783dd1dc13d move nonstandard analysis theories to NSA directory
huffman
parents:
diff changeset
   181
end